Repository navigation
fix: replace the host name in diagnostics bundle members - #31159
Conversation
f1051ef to
b8ec891
Compare
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the host pass runs inside the bundle scrub, after credential redaction, and it removes nothing. Notes
[DESIGN-REVIEWED] 849188d Description read[DESCRIPTION-READ] 8f3b76284e97086dbfc89c8c851edbc1d4470dea8ffbb52e4e8dcda66c22f6e1 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The bundle scrub is the one place that sanitizes a public attachment, and the fix goes in that scrub. #28485 supplies the provenance. Grepping What this change shipsInventory (5 items) — 4 justifiedIntent: let a user attach a diagnostics bundle to a public issue without it naming their machine. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] 849188d Description read[DESCRIPTION-READ] 2753d985e54afca7bcbe9671a2d435a15d7355209fcecb46a91daa47a3b4786f That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findings (all downgraded on adjudication)GPT 6.1 flagged blocking issues on This comment is updated in place on each push. Review detailsBLOCKING -- AUTOSDE.yaml:1190 -- New skip exemption weakens an existing blocking rule
Adjudication (Opus 5.5) — is blocking on each finding proportionate?F1 — rung: LOW. Nothing would be prevented by blocking this PR.
False positive or not applicable? A repository writer can comment: |
b8ec891 to
3cd2d67
Compare
3cd2d67 to
7de3c21
Compare
8fe6202 to
341034a
Compare
A diagnostics bundle is meant to be dragged into a public issue, but its loop-stall dump headers and last-healthy-boot marker carry the PID domain, which starts with the machine's host name. The bundle scrub removed credentials and collapsed home paths, never the host name. The bundle scrub now replaces the live host name and the one the dump writer recorded at boot with <host>, in full and in short form, as a whole segment only, and counts the replacements with the path collapses. Local crash-dump files keep the real domain. Closes #28485
341034a to
849188d
Compare
A diagnostics bundle is meant to be dragged into a public issue, but its loop-stall dump headers and last-healthy-boot marker carry the PID domain, which starts with the machine's host name. The bundle scrub removed credentials and collapsed home paths, never the host name. The bundle scrub now replaces the live host name and the one the dump writer recorded at boot with <host>, in full and in short form, as a whole segment only, and counts the replacements with the path collapses. Local crash-dump files keep the real domain. Closes #28485 (cherry picked from commit 70fcc4e) Original author: @bolichen97
A diagnostics bundle is meant to be dragged into a public issue, but its loop-stall dump headers and last-healthy-boot marker carry the PID domain, which starts with the machine's host name. The bundle scrub removed credentials and collapsed home paths, never the host name. The bundle scrub now replaces the live host name and the one the dump writer recorded at boot with <host>, in full and in short form, as a whole segment only, and counts the replacements with the path collapses. Local crash-dump files keep the real domain. Closes #28485 (cherry picked from commit 70fcc4e) Original author: @bolichen97
A diagnostics bundle is meant to be dragged into a public issue, but its loop-stall dump headers and last-healthy-boot marker carry the PID domain, which starts with the machine's host name. The bundle scrub removed credentials and collapsed home paths, never the host name. The bundle scrub now replaces the live host name and the one the dump writer recorded at boot with <host>, in full and in short form, as a whole segment only, and counts the replacements with the path collapses. Local crash-dump files keep the real domain. Closes #28485 (cherry picked from commit 70fcc4e) Original author: @bolichen97
A diagnostics bundle is meant to be dragged into a public issue, but its loop-stall dump headers and last-healthy-boot marker carry the PID domain, which starts with the machine's host name. The bundle scrub removed credentials and collapsed home paths, never the host name. The bundle scrub now replaces the live host name and the one the dump writer recorded at boot with <host>, in full and in short form, as a whole segment only, and counts the replacements with the path collapses. Local crash-dump files keep the real domain. Closes #28485 (cherry picked from commit 70fcc4e) Original author: @bolichen97
A diagnostics bundle is meant to be dragged into a public issue, but its loop-stall dump headers and last-healthy-boot marker carry the PID domain, which starts with the machine's host name. The bundle scrub removed credentials and collapsed home paths, never the host name. The bundle scrub now replaces the live host name and the one the dump writer recorded at boot with <host>, in full and in short form, as a whole segment only, and counts the replacements with the path collapses. Local crash-dump files keep the real domain. Closes #28485 (cherry picked from commit 70fcc4e) Original author: @bolichen97
A diagnostics bundle is meant to be dragged into a public issue, but its loop-stall dump headers and last-healthy-boot marker carry the PID domain, which starts with the machine's host name. The bundle scrub removed credentials and collapsed home paths, never the host name. The bundle scrub now replaces the live host name and the one the dump writer recorded at boot with <host>, in full and in short form, as a whole segment only, and counts the replacements with the path collapses. Local crash-dump files keep the real domain. Closes #28485 (cherry picked from commit 70fcc4e) Original author: @bolichen97
A diagnostics bundle is meant to be dragged into a public issue, but its loop-stall dump headers and last-healthy-boot marker carry the PID domain, which starts with the machine's host name. The bundle scrub removed credentials and collapsed home paths, never the host name. The bundle scrub now replaces the live host name and the one the dump writer recorded at boot with <host>, in full and in short form, as a whole segment only, and counts the replacements with the path collapses. Local crash-dump files keep the real domain. Closes #28485 (cherry picked from commit 70fcc4e) Original author: @bolichen97
Problem / Motivation
Goal: A diagnostics bundle no longer carries the machine's host name, so a user can attach it to a public issue without naming their machine.
kirocrew doctor --bundleand the in-app Report a Problem flow build a zip the user drags into a public GitHub issue. Two of its members, the loop-stall dump header (# PID: <pid> @ <pid-domain> ...) and thelast-healthy-bootmarker, carry the PID domain, which starts withsocket.gethostname(). The bundle scrubs credentials and collapses home paths to~, but leaves the host name in clear text.Why it matters
The issue body the bundle pre-fills says "N path(s) collapsed", so a reader can fairly assume the zip is anonymised. On a work machine the host name often carries the user's name, an asset tag or the organisation, and it lands in a public attachment.
Not a goal
What changed (motivation → approach → change)
Symptom: a bundle's crash-dump members show the host name. Cause: the bundle scrub in
diagnostics.py(_scrub_bundle) knows credentials and home paths, but not the host name the dump writer puts into every PID domain.Change: the scrub replaces the host name with
<host>in every text member, the user's note included. It replaces the live name, the name this gateway recorded at boot (the writer caches its PID domain, so the two differ after a network change), each in full and in its short form before the first.. A name of 6 characters or more is replaced wherever it appears, whatever precedes it (an escape, an ANSI control sequence, a percent-encoded byte), and only a name-character after it stops a match, sojane-laptop2stays. A shorter name is replaced only as a whole word, so a generic short host name does not rewrite ordinary words, and a bare\does not count as a word boundary, so a one-letter name never eats thetof a serialized\t. The pass runs only after the credential scrub and the home collapse, so a host name that is also a word a credential rule keys on cannot hide that credential. A long name is matched anywhere, so a control byte the scrub strips cannot hide it; a short name joined onto a word that way is a known gap, tracked with the other surviving spellings, and names from earlier gateway processes, in #32005. The replacements count with the path collapses, and the issue-body tally reads "path(s) collapsed to~or host name(s) replaced". The local dump files keep the real domain.Docs:
troubleshooting.mdsays the bundle shortens home paths and replaces the current host name, and that an older name or another spelling can remain, so the user should look through the zip before attaching it, and theFeedbackTrackerProvider.report_issue_urldocstring ininterfaces_runtime.pysayspath_collapsesincludes host-name replacements.Backwards compatibility
Compatible: only the bundle copies change; no file format, API or config key does, and the local crash-dump files still hold the real PID domain.
Reader: src/kiro_crew/dashboard/crash_dump_store.py:_dump_owner -- release -- it reads the local dump header, which this change does not touch; only the bundle copy is rewritten (test/test_crash_dump_store.py)
Tests
test/test_diagnostics.py::test_bundle_replaces_the_host_name_crash_records_carrywrites a loop-stall dump header and thelast-healthy-bootmarker with the writer's boot-time domain, plus a log line naming the live host in another case. It checks that no member of the zip carries either name, full or short, thatjane-laptop2survives, and that the replacements are counted.test/test_diagnostics.py::test_bundle_replaces_the_host_name_after_an_escaped_newline_or_tab: the log line{"stdout":"boot\njane-laptop\n","err":"a\tjane-laptop"}comes out with<host>in both places. It is red without the escape boundary and passed 3 runs in a row.test_bundle_replaces_the_host_name_after_a_form_feed_or_a_color_codeand..._after_any_escape_or_control_sequence: serialized\f,\x1b,\u001b,\u001b[?25hand raw ANSI codes before the name.test_bundle_replaces_a_host_name_joined_on_by_a_stripped_control_character: a real form feed, vertical tab or ANSI code before the name.test_a_long_host_name_goes_inside_a_word_and_a_short_one_only_whole:%2Fjane-laptopandxjane-laptopare replaced,jane-laptop2stays; the short nameboxis replaced alone but not inboxesorinbox.test_a_one_letter_host_name_leaves_serialized_escapes_intact: with hostt,failure\tstays intact while\ntbecomes\n<host>(red when a bare backslash counts as a boundary).test_the_host_pass_before_redaction_keeps_a_credential_redacted: a token in a URL on the host is still redacted.test_a_host_name_never_defeats_credential_redaction: a host namedauthorization,bearerortokenleaves an Authorization header, a bare Bearer token and atoken=query value redacted (red when the host pass runs before the credential scrub).-n0; 10 at-n 4 --dist loadgroup --max-worker-restart=2withtest/test_diagnostics_kiro_log_layout.pyandtest/test_windows_logs_and_diagnostics.pyas co-tenants;test/test_diagnostics.pyin shuffled order (seed 16803). All green.scripts/local-gate.pyon the first head: the related backend tests (5970 passed) and the related frontend tests (492 files) pass. On this head:test_diagnostics.pyand the seven test files that import the changed modules plustest_crash_dump_store.py(786 passed), flake8, isort and mypy on the changed files.Proof: PROVEN test/test_diagnostics.py::test_bundle_replaces_the_host_name_crash_records_carry, test/test_diagnostics.py::test_bundle_replaces_the_host_name_after_an_escaped_newline_or_tab, test/test_diagnostics.py::test_bundle_replaces_the_host_name_after_a_form_feed_or_a_color_code, test/test_diagnostics.py::test_bundle_replaces_the_host_name_after_any_escape_or_control_sequence[x-escape], test/test_diagnostics.py::test_bundle_replaces_the_host_name_after_any_escape_or_control_sequence[u-escape] (head 2998d288b511)
Manual verification
N/A — unit coverage sufficient: the test drives
collect_bundleend to end over real files written in the writers' formats.Screenshots / video
N/A — the diff touches no frontend surface.
Related Issues
Closes #28485
Sibling sweep
Swept: git grep -nE "gethostname(|platform.node(" -- src/
Sibling: src/kiro_crew/snapshot_build.py:460 -- not affected -- a snapshot is a private backup the operator restores, never a public attachment
Sibling: src/kiro_crew/portability_stream.py:252 -- not affected -- an export archive goes to the operator's own other install, not a public issue
Sibling: src/kiro_crew/dashboard/handlers_system.py:324 -- not affected -- shown on the owner's own dashboard and never packed into the bundle
Pattern harvest
Not generalizable: the diagnostics bundle is the one artifact built for a public issue, and its single scrub path now covers the host name.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license.