Repository navigation
fix(dashboard): preserve macOS temp project paths - #14880
Conversation
Design Review (Fable 5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS No test ever feeds a real Darwin temp path through the fix — the regex's id shape is asserted only against hand-written fixtures. WatchThe description grants "Manual verification: N/A" while the exemption's entire value is Darwin-only and, per its own words, "#5366 only moved pytest's temp base" — so on a real mac, Suggestions
[DESIGN-REVIEWED] 98625bf Description read[DESCRIPTION-READ] 64c4eda3bf660eee5d91db73c63671d4828e78b0a6ba62663db5d3a629ac0316 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 (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Confirm the restored happy-path tests ran on a real macOS machine: every exemption test flips What this change shipsInventory (6 items) — 6 justifiedIntent: FIX — a macOS temp-rooted project shows its real path in the dashboard's Git/Files panels instead of
The deleted base comment is fulfilled, not reversed: it prescribed exactly "a path-specific sanitizer at the call site", and the description declares the restoration. Sibling count: grepped [FIRST-PRINCIPLES-REVIEWED] 98625bf Description read[DESCRIPTION-READ] 32ec3059c7d5d6cf56a20089394c2d815900c8bf0436ffc796c4948f2d6486ea That sha256 names the PR description this verdict read. Recompute it with |
GPT 5.6 Review — ✅ human override acceptedHuman judgment by @iamwhatever overrides the GPT 5.6 finding for [GPT-OVERRIDE] 98625bf This comment is updated in place on each push. The model was not re-run because an authorized human decision supersedes it. False positive or not applicable? A repository writer can comment: |
Opus 5 Review — ✅ no blocking findingsReviewed Review detailsNo blocking findings. FINDING — src/kiro_crew/dashboard/handlers/files.py:6616 — [OPUS-REVIEWED] 98625bf Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
A project rooted under Darwin's per-user temp dir renders as `[REDACTED: credential]` in the dashboard. The generic bare-secret detector's character class includes `/`, so `/private/var/folders/<2>/<30>/T/...` reads as one long high-entropy token even though both variable components are OS-owned and fixed-width. Give the six absolute-path egress sites in this file a path-aware wrapper that withholds only the OS-generated id from the scan. Off Darwin it is byte-identical to `redact`. BOUNDARY. The split sits at the END of the variable region: the prefix regex ends in the literal `/T`, and that literal is handed to the canonical redactor along with the suffix. An AWS secret key may itself contain `/`, so a window is a real credential candidate whenever every byte in it is fixed or user-controlled -- `/T/` plus 37 user-controlled characters is a well-formed 40-byte key. Scanning `/T` + suffix covers every such window, so there is no further byte to concede: anything reaching further left necessarily contains OS-generated id bytes that no caller can choose. Measured over ordinary project names, pytest temp-dir names, truncated sha-256 digests and uuid hex (300 samples each, under both a self-flagged and a non-self-flagged prefix): the boundary costs zero additional redactions. The only names it newly redacts are uniformly-random 37-38 character base64 runs, which the canonical redactor already redacts on this path. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
8975df9 to
f9be88a
Compare
Review round on the rebased head raised one blocking finding and one test-strength finding. Both are taken. BLOCKING -- the exemption regex carried no platform guard, so the helper withheld its two-component region from the credential scan on every OS. Off Darwin `/private/var/folders/<id>/T` names nothing the OS owns: a caller who can choose a project directory can choose those bytes outright and put a credential-shaped run in the one region the helper never scans. Gate the exemption on `platform_compat.IS_MACOS` so the canonical redactor decides alone everywhere else. This also keeps the exemption exactly as wide as the false positive it was measured against. The Darwin-arm tests now flip `platform_compat.IS_MACOS` through an `as_darwin` fixture rather than asserting a branch that only runs on one runner, and two new cases pin the off-Darwin arm: the helper is the canonical redactor byte for byte, and the self-flagged id is redacted there instead of preserved. Both fail with the guard removed. FINDING -- deleting the prefix regex's `(?=/|\Z)` lookahead left every added case green, so the boundary was unproven: a caller-chosen segment merely STARTING with `T` would have been exempted. The similar-path test is now parametrized over `/Tevil/project` and `/Tevil` alongside the too-wide id, and both new cases fail with the lookahead deleted. DOCSTRING ACCURACY -- re-measuring the boundary contract found one claim in it too strong. It said the two rejected splits each produced a class where `redact(path) != path` while the helper returned `path` unchanged, implying the shipped split produces none. It produces one, at roughly 3 in 1000 sampled caller layouts: a 40-char key carrying more than `_SECRET_MAX_SLASHES` separators. Standalone such a key is masked, because a 40-char run is the token somebody wrote and the separator ceiling is deliberately not applied to it; prepending `/T` makes the scanned run longer than one whole key, which is the condition that switches the ceiling on, and every window is then declined. That residual is not a weakening, and the control says why: the same key also survives the canonical redactor on an ordinary deep path with no exemption anywhere near it -- 387/400 sampled keys on `/srv/<key>`, 400/400 on `/<key>`. The separator ceiling loses slash-dense keys everywhere in the product, so the helper is no weaker than the treatment the same key already gets elsewhere. Canonical's hit on the full temp-root path comes from an id-straddling window clearing the ceiling -- it masks the key via the very false positive this exemption removes, not by recognising it. The docstring now states that residual and its control, and a new test pins the property as an EQUIVALENCE against the ordinary-path behaviour rather than blessing an outcome, so it fails if either side moves. It fails with the exemption removed. No behaviour change on macOS, and no change to the split.
f9be88a to
98625bf
Compare
|
/ai-review override gpt 98625bf: Reaching it needs macOS, a credential the agent already holds re-encoded as a 4+-level nested directory tree under the OS-generated temp root, registered as an allow-listed project and a git root; the decline comes from the canonical redactor's own fragment ceiling (redaction.py:859), which loses the same key on any deep path (control pinned at test/test_project_git.py:808-810), so the helper is at exact parity with the product and the proposed fix would add a stricter-than-canonical policy in this one helper without closing the class. |
|
AI-review override not recorded: keep the reason to 500 characters or fewer. |
|
/ai-review override gpt 98625bf: Reaching it needs macOS, a credential the agent already holds re-encoded as a 4+-level nested directory tree under the OS-generated temp root, registered as an allow-listed project and a git root; the decline comes from the canonical redactor's own fragment ceiling (redaction.py:859), which loses the same key on any deep path (control pinned at test/test_project_git.py:808-810), so the helper is at exact parity with the product and the proposed fix would add a stricter-than-canonical policy in this one helper without closing the class. |
|
AI-review override not recorded: keep the reason to 500 characters or fewer. |
|
/ai-review override gpt 98625bf: macOS-only exemption gated on IS_MACOS. Reaching it needs macOS, a credential the agent already holds re-encoded as a 4+-level nested dir tree under the OS temp root, and that tree registered as an allow-listed git project. Opus 5 adjudged exposure nil: the decline is the canonical redaction fragment ceiling, which loses the same key on any deep path. Same finding was overridden on fork #6905. |
Human judgment recorded@iamwhatever marked the gpt AI finding as false positive, not applicable, or explicitly accepted for
This decision applies only to this commit. A new push requires a new judgment. |
bolichen97
left a comment
There was a problem hiding this comment.
Reviewed on behalf of the maintainers (readiness sweep 2026-09-29, round 7): readiness passed, required check green on the current head, no live CHANGES_REQUESTED, no open blocking review threads, security posture reviewed. Approving and merging (squash).
Problem / Motivation
Goal: A project rooted under macOS's per-user temp directory shows its real path in the dashboard's Git/Files panels instead of
[REDACTED: credential].On macOS, a project directory such as
/private/var/folders/<2>/<30>/T/...is echoed to the dashboard through the project-git and project-tree endpoints. The generic bare-secret detector's character class includes/, so the whole temp path reads as one long high-entropy token and the credential gate collapses it to[REDACTED: credential]. The activity panel then shows the project as a redacted string even though both variable components of that prefix are OS-owned and fixed-width. Prior work (#5366) only moved pytest's temp base; the production egress path was never fixed.Why it matters
Every macOS user whose project lives under the OS temp root sees a redacted, unusable path label in the dashboard Git and Files panels — the panels' one job (showing where the project is and what changed) is defeated for a whole platform, with no security benefit, since the redacted bytes are OS-generated and caller-fixed.
Not a goal
/private/var/folders/<2>/<30>/Tprefix.What changed (motivation → approach → change)
[REDACTED: credential]in the dashboard.redact()'s slash-including bare-secret regex treats the fixed-width, OS-generated/private/var/folders/<2>/<30>/Tprefix as part of one 40+ char high-entropy run, tripping the credential gate._redact_project_path()used at the six absolute-path egress sites infiles.py(repoRootin project-git and project-git/status, echoedpathin project-git,rootin project-tree). It withholds only the OS-generated id from the credential scan and passes the entire user-controlled suffix through the canonicalredact(). The split sits at the END of the variable region (the literal/Tis handed to the redactor with the suffix), so every 40-byte window composed of fixed or user-controlled bytes is still scanned — the docstring records the boundary argument and the one measured residual (a slash-dense key, which the canonical redactor loses everywhere in the product anyway). The exemption is gated onplatform_compat.IS_MACOS: off Darwin those bytes name nothing the OS owns, so a caller who can pick the project directory could otherwise place a credential in the one region never scanned.Backwards compatibility
Compatible: on non-macOS platforms the wrapper is byte-identical to
redact(). On macOS it only narrows a false positive (preserving an OS-owned prefix); it never widens what reaches the dashboard beyond what the canonical redactor would already pass on an ordinary path.Tests
test/test_project_git.py:TestMacosPrefixBoundarypins the split boundary (a caller segment merely starting withT, e.g./Tevil/project, is still redacted; the too-wide id is not preserved), the Darwin-only guard (off Darwin the helper equalsredact()byte-for-byte and a self-flagged id is redacted), andtest_a_slash_dense_key_is_treated_as_on_any_other_path(the residual slash-dense key gets the same treatment it gets on/srv/<key>,/tmp/<key>,/<key>). Restores the two deleted happy-path tests.test/test_project_git_status_log.py: the status route'srepoRootand the tree route'srootlabel the same path identically.test/test_project_tree.py: the treeroottakes the same macOS exemption; repo-relative paths do not.Manual verification
N/A — unit coverage sufficient. The change is a pure egress-string transform with deterministic tests over both the Darwin and off-Darwin arms.
Screenshots / video
N/A — the diff touches only the backend egress redaction of a path string; no rendered frontend surface changes.
Related Issues
Supersedes #6905.
Pattern harvest
Not generalizable: this is a targeted, platform-specific false positive of the bare-secret detector against one fixed-shape OS temp prefix; the fix withholds only OS-generated bytes and is inherently scoped to that one prefix on one platform.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)