Skip to content

fix(dashboard): preserve macOS temp project paths - #6905

Closed
leonlaiyc wants to merge 2 commits into
kirodotdev:mainfrom
leonlaiyc:fix/project-git-macos-path-redaction
Closed

leonlaiyc wants to merge 2 commits into
kirodotdev:mainfrom
leonlaiyc:fix/project-git-macos-path-redaction

Conversation

@leonlaiyc

@leonlaiyc leonlaiyc commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

The dashboard's project-git endpoints echo an absolute repository path back to the UI through security.redact(). On macOS that destroys ordinary paths: GET /api/project/git returns repoRoot and path as the literal string [REDACTED: credential], so the activity panel shows a redaction marker where the repository root should be.

redact()'s _BARE_SECRET_RUN_RE deliberately includes / in its character class, because real credentials (base64, OAuth/PKCE material) contain slashes. A POSIX path is therefore scanned as one token. macOS's per-user temporary root has the fixed shape /private/var/folders/<2 chars>/<30 chars>/T/…, which yields a 63-character run whose 40-character window clears every entropy and structural gate.

Measured against this branch's base commit, using the production redactor:

redact("/private/var/folders/6r/54rts88h7yebke7n6clhoq9d0roaen/T/project")
  -> "[REDACTED: credential]"

The repository has hit this twice before and worked around it in the test layer both times, never in production:

  • test/test_project_git.py deleted its two happy-path tests, leaving a comment stating the defect "is still present and is now unobserved" and that the remedy is "a path-specific sanitizer at the call site" — explicitly not a change to the redactor.
  • Later, fix(test): make the backend suite pass on macOS, not only on Linux #5366 repointed Darwin's pytest temp base to /tmp repo-wide, which removed the symptom for tests only.

Neither touched the endpoint. This PR implements the call-site sanitizer that comment specified.

Why it matters

  • A real macOS user still sees the bug. fix(test): make the backend suite pass on macOS, not only on Linux #5366 changed where pytest puts temp directories; it did nothing for a real project directory. Any macOS project whose realpath sits under the per-user temp root — scratch and ephemeral workspaces, and anything created via mkdtemp — is rendered as [REDACTED: credential] in the activity panel. The in-code comment at handlers/files.py claiming "A normal path is unchanged" was false on that platform.
  • A coverage hole outlived its cause. The two deleted tests were the only automated proof that the endpoint resolves a branch on the happy path and walks up from a subdirectory to the repository root. That gap has been safely closeable since fix(test): make the backend suite pass on macOS, not only on Linux #5366 landed and simply was not noticed; while it stood, a regression in repo-root resolution would have shipped silently on all platforms.

The redactor itself is deliberately left alone. The prior investigation recorded in that comment tried and rejected three redactor-level fixes with evidence — a path-shape guard leaked a real AWS key containing two slashes, splitting the run on / missed every real key, and a window slash-count threshold leaked 2.555% of otherwise-caught keys over 200k samples. Weakening a credential redactor so a path renders is the wrong trade, so the fix belongs at the call site.

What changed (motivation → approach → change)

Symptom → a fixed-shape, OS-owned path prefix is indistinguishable from a high-entropy bare secret to a slash-tolerant detector. Root cause → the endpoint applies the generic bare-secret redactor to a value it already knows is a filesystem path. Change → give those call sites a path-aware wrapper that exempts only the OS-owned prefix and still sends everything an agent can influence through the canonical redactor.

src/kiro_crew/dashboard/handlers/files.py:

  • New _MACOS_TEMP_PROJECT_PREFIX_RE, anchored at \A, matching exactly /private/var/folders/[a-z0-9]{2}/[a-z0-9_]{30}/T followed by / or end-of-string. Both variable components are OS-owned and fixed-width. The lookahead is load-bearing: without it an attacker-chosen segment such as …/Tevil/ would be swallowed by the exemption.
  • New _redact_project_path(path). No match → returns redact(path), so every non-Darwin-shaped path keeps today's behaviour byte-for-byte. On a match → returns the prefix up to but excluding its trailing /T, concatenated with redact() applied to that /T plus the entire remaining suffix. See Boundary contract below for why the split sits at exactly that point.
  • Applied to the three absolute-path egress sites in api_project_git (repoRoot, the "Not a directory" 400 body, and the success envelope's path), and to api_project_git_status's repoRoot. The latter is included because its own comment already promises it "goes through the same redaction as api_project_git" — fixing only the first endpoint would have silently falsified that.

Deliberately unchanged: branch, head, and the repo-relative file paths in the status response stay on bare redact() — they are not absolute paths and carry no OS-owned prefix. The SEL audit trail continues to record the real, unredacted path, and a test pins that.

Two in-code comments that the change made inaccurate are corrected in the same commit.

/api/project/tree is now included. An earlier revision left it out as a separate endpoint with its own response contract. Two reviewers independently counted it and were right that the reason did not distinguish anything: the wrapper is byte-identical to redact() off-Darwin, so applying it there changes no contract, and a macOS user's Files tab still rendered [REDACTED: credential] where the project root belongs. Both root egress sites in api_project_tree — the not-a-directory early return and the listing response — now use _redact_project_path. That is the whole class in this file: six absolute-path egress sites, six fixed. The listed paths stay on bare redact(), correctly — they are project-relative and carry no OS-owned prefix.

Boundary contract — where the split goes, and why it stops there. The exact-head review raised this twice and was right both times. The history matters because it is what fixes the shape of the argument, not just the byte count:

head split window that leaked
11b9d5fa match.group(0) + redact(path[match.end():]) every window crossing the boundary
cded733c prefix[:-1] + redact(prefix[-1] + …) the one starting on the / before T
a3b5ad1e prefix[:-2] + redact(prefix[-2:] + …) —

The governing fact is that an AWS secret key may itself contain /. So a 40-byte window is a real credential candidate whenever every one of its bytes is either a fixed literal or user-controlled — it is not disqualified by "borrowing OS bytes", which is the reasoning both earlier revisions rested on. Both leaks were the same defect: a class where

redact(path) != path          # canonical removes it
_redact_project_path(path) == path   # the helper did not

i.e. the helper weakening the canonical output policy rather than narrowing a false positive. Two concrete fixtures, both accepted by _looks_like_secret_key standing alone, now pin it:

T/PtYgjmUhBel31iEl2hpChYgCfrL1spNxnyVmih    # leaked at 11b9d5fa
/T/EqV8ib8HDy88YtDtXbiufMdI8X2Y4rUmer/BH    # leaked at cded733c

Why this is not "one more byte" a third time. The prefix regex is /private/var/folders/[a-z0-9]{2}/[a-z0-9_]{30}/T — it ends in the fixed literal /T, and everything to the left of that literal is the OS-generated id. Scanning /T + suffix therefore covers every window composed entirely of fixed or user-controlled bytes, and there is no next byte to concede: a window reaching further left necessarily contains id bytes, which the OS generates and no caller can choose. The recursion terminates at a stateable boundary rather than at wherever the last review stopped looking.

That boundary is also what the exemption is for. The id is high-entropy and self-flagging — redact() removes it on its own account — so letting it into the scan is exactly the #6905 false positive this PR exists to fix. The review's suggested full revert (return redact(path)) does precisely that.

Measured cost of the second boundary byte — 300 samples per corpus, under both a self-flagged and a non-self-flagged prefix (n=600 each). "canonical" is redact() on the whole path, i.e. today's pre-PR behaviour.

corpus prefix[-1] (1 byte) prefix[-2:] (2 bytes) canonical
ordinary project names 0 0 300
pytest temp-dir names 0 0 300
truncated sha-256 digests (38 hex) 0 0 300
truncated sha-256 digests (37 hex) 0 0 300
uuid4 hex 0 0 300
uniformly-random base64, 37 0 506 562
uniformly-random base64, 38 512 518 571

The second byte costs zero additional redactions on every realistic corpus — identical to the one-byte split. The only class it newly redacts is uniformly-random base64 of 37–38 characters, where canonical already removes 562/600 and 571/600 on this same path, so the boundary stays strictly narrower than canonical rather than becoming a second policy. The 300s in the canonical column are the defect itself: every self-flagged-prefix path.

Two corrections to my own earlier replies on this thread, since both are now on the record. (1) I argued a ≤ 38-character user-controlled run is below the classifier's exact-40 minimum and so costs no detection — that is the reasoning the /-in-keys fact defeats, and it was wrong at both byte positions. (2) I claimed a 2-character T/ boundary "re-redacts ~85% of opaque 38-character directory names (pytest temp dirs, hashes)". That figure came from a uniformly-random base64 corpus and was generalised to corpora it had never been run against; re-measured, both are 0 (table above).

docs/system-specs/modules/learn-cron-dashboard.md is updated so the "Project git" entry describes the split accurately instead of claiming all four fields pass through plain redact, and the "Project tree" entry no longer says root and every path alike pass through redact.

Tests

New, in test/test_project_git.py — these are what actually prove the fix, and they use hardcoded macOS-shaped strings, so they exercise the exemption identically on every platform:

  • test_macos_temp_root_is_not_mistaken_for_a_bare_secret — a macOS temp project root survives byte-for-byte.
  • test_macos_temp_root_still_redacts_a_secret_in_the_suffix — security negative control: an AKIA… key in the user-controlled suffix is still redacted. Asserts both that the key is absent and that a redaction marker is present.
  • test_other_paths_still_use_the_canonical_redactor — patches redact and asserts a non-Darwin path reaches it verbatim, exactly once.
  • test_similar_macos_path_with_the_wrong_id_width_is_not_exempt — negative control on the regex: a 31-character id (one over the fixed width) is not exempted and falls through to the canonical redactor, pinning that the exemption is shape-exact rather than a prefix heuristic.

New, in test/test_project_git.py, class TestMacosPrefixBoundary — the boundary contract above, stated as properties rather than examples:

  • test_a_credential_spanning_the_prefix_boundary_is_redacted — both blocking findings, pinned. Runs the T/ and /T/ fixtures above: each is asserted to be a credential by _looks_like_secret_key standing alone, then asserted removed by BOTH the canonical redactor and the helper, under both prefixes. Asserting both halves means a regression cannot pass by making the canonical side stop firing. Red-before against 11b9d5fa's helper: 3 failed, 17 passed. Red-before against cded733c's one-byte helper: 2 failed, 18 passed — AssertionError: boundary credential survived: /private/var/folders/6r/zyxvpxvq6csfxvn_n0000000000000/T/EqV8ib8HDy88YtDtXbiufMdI8X2Y4rUmer/BH.
  • test_the_two_fixture_prefixes_behave_as_documented — establishes the two controls. An all-alphanumeric temp id is self-flagged (the fix(dashboard): preserve macOS temp project paths #6905 defect); an ordinary id carrying an underscore is not, because the underscore falls outside the bare-secret character class. The second control is what lets the boundary property be measured independently of the false positive this PR fixes.
  • test_neither_boundary_name_is_a_secret_standing_alone — both fixture names are under 40 characters and unflagged bare; they differ only in what their own leading separator buys them.
  • test_a_38_char_name_is_judged_on_its_own_boundary_window — replaces the earlier test_a_38_char_name_is_kept_and_was_never_classifiable, whose premise the review overturned. Being under 40 characters is not what decides such a name; the window actually evaluated is T/ plus the name. This fixture clears the classifier's gates and is now removed, while the OS-owned id above the boundary is still preserved byte-for-byte.
  • test_ordinary_project_names_survive_under_both_prefixes — the false-positive control, covering the boundary. Seven ordinary names — including a pytest temp-dir shape, a 38-character hex digest, and a 37-character one, the length that reaches 40 only via /T/ and is therefore exactly what the second boundary byte exposes — plus the bare prefix with no suffix, under both prefixes. This is the assertion that breaks if the boundary is ever widened into the OS id.
  • test_the_os_owned_id_never_enters_the_scan — why the exemption exists at all: the self-flagged id is removed by the canonical redactor on its own account and must stay out of the scan.
  • test_a_39_char_name_is_still_scanned_with_its_separator — under both prefixes.
  • test_a_real_credential_never_survives_the_split — the security invariant, 12 cases: three real credential shapes × four placements, each asserted detectable standing alone first, then asserted absent under both prefixes.
  • test_the_exemption_is_exactly_prefix_plus_canonical_suffix — the whole contract as an identity: everything above the trailing /T is preserved byte-for-byte, and /T plus the tail equals redact() of the same. The split point itself is asserted (boundary == "/T") rather than assumed, so the exemption cannot drift into a second redaction policy.

Mutation-checked: widening the exemption to return the path unchanged fails this class across every credential placement; reverting to the original split fails three of its tests, and reverting just the second boundary byte fails two. No half of the contract is vacuously green.

New, in test/test_project_tree.py:

  • test_not_a_directory_root_takes_the_path_aware_redactor — the early-return arm. Reached with a real non-directory rather than by patching os.path.isdir, which is process-global and breaks unrelated lazy imports.
  • test_listing_root_takes_the_path_aware_redactor — the listing arm, pinned on the call because the two redactors agree off-Darwin, plus an assertion that the listing itself still works.

New, in test/test_project_git_status_log.py:

  • test_repo_root_uses_the_path_aware_redactor — pins the parity the neighbouring comment promises. Red-before on this branch with only that one line reverted: AssertionError: assert 0 == 1 (the wrapper is never reached).

Also restored: test_returns_branch_for_repo and test_finds_repo_root_from_subdirectory, deleted when the endpoint defect was first documented. To be precise about what this is and is not — these two pass on macOS because of #5366's temp-base redirect, not because of this production change; pytest's tmp_path resolves under /private/tmp, which the new regex intentionally does not match. They are restored here because this PR removes the comment that justified deleting them, and they recover the lost coverage of branch labelling and repo-root walk-up. They are not evidence for the fix; the four tests above are.

Three pre-existing assertions relaxed from .startswith("<") to "<" in: with a preserved prefix the redacted value no longer begins at index 0 on a Darwin-shaped path. The endswith(">") half is retained, so each still proves the tail passed through the patched redactor.

Results on head a3b5ad1e (Python 3.10.6, Windows):

  • test_project_git.py + test_project_tree.py + test_security.py + test_project_git_status_log.py + test_log_redaction.py + test_redaction_mirror_parity.py + test_redact_meta_snapshot.py — 1107 passed, 19 skipped, 0 failed.
  • One earlier run of that same set reported a single failure that did not reproduce on re-run and printed no nodeid to attribute. Both known base-equal flakes on this box live in that set (TestHomeDirTargetsCache::test_second_call_does_not_rebuild, whole-file only, and TestIsSensitiveBashCommand::test_chained_cd_expansions_do_not_blow_up_the_gate, a wall-clock guard). Recorded rather than omitted; it is not being claimed as attributed.
  • One inherited local error, not a failure and not from this change: test_project_tree.py::test_vanished_directory_response_is_redacted (pre-existing, untouched by this PR) monkeypatches the process-global os.path.isdir, which breaks a lazy numpy C-extension import during teardown on this Windows box. Verified at this branch's base: that test alone reports 1 passed, 1 error there too. The new tree tests deliberately avoid that patch.
  • Previously reported and unchanged: 6 WinError 1314 symlink-privilege failures in test_file_download.py / test_file_raw.py, reproduced identically on a pristine origin/main worktree at this branch's own base. Inherited local environment limitation; neither file has any path to the diff.

Gates green on head a3b5ad1e: mypy --platform linux on the changed handler (no issues), black baseline gate (scripts/check_black_formatting.py, 5 files in scope, no new offenders), isort, flake8, docs-lint, lockdown-before-publish, brand-name, changelog-history, focus-cue.

Manual verification

N/A — unit coverage sufficient: the defect is a deterministic pure-string transformation of a response field, and the exemption's positive case, secret-bearing suffix, boundary windows, wrong-width shape, attacker-chosen T… segment, and non-Darwin fallthrough are each pinned by a test that runs identically on every platform.

On the ## Screenshots / video section, deleted above: the rendered surfaces (the activity panel's branch label and the Files tab's project tree) do change for a macOS user — [REDACTED: credential] becomes the real path — so this is not a no-visual-delta change and is not being claimed as one. What changes is one string in a JSON response, with no layout, component, or style change; and the delta is reproducible only on Darwin, which this branch was developed and tested on Windows. Rather than stage a synthetic screenshot that would not be evidence of the platform-specific behaviour, the before/after is given as the redactor's actual output at the base commit and on this head, in Problem / Motivation above. A macOS reviewer can confirm it directly by opening any project whose realpath is under /private/var/folders/…/T/.

Related Issues

No filed issue. The defect was documented in-tree by the comment this PR removes from test/test_project_git.py, which recorded it as "still present and now unobserved" and specified the call-site sanitizer implemented here.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Pattern harvest

Rule candidate: review-prompt / semgrep — a bare-secret detector whose character class includes / cannot be handed a filesystem path, because an OS-owned path prefix scans as one high-entropy token; the fix belongs at the call site as a path-aware wrapper that exempts only a fixed-shape, OS-generated prefix, and the exemption must be split at the last fixed literal in that prefix so every window composed entirely of fixed or caller-controlled bytes is still scanned — an exemption that leaves redact(p) != p while wrapper(p) == p is weakening the policy, not narrowing a false positive.

Section appended by a maintainer to satisfy the PR Hygiene gate, which began requiring a Pattern harvest section on fix: PRs after this PR was opened. No other part of this description, and nothing on the branch, was touched.

@leonlaiyc
leonlaiyc requested review from a team and CrysisDeu August 30, 2026 03:04
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Aug 30, 2026
@github-actions

github-actions Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review (fork) — 🔴 changes requested (blocking)

Reviewed c56e4c7e4454d94daffe81b5f89c56140b72734b via the fork AI-review pipeline; updated in place on each push.

1 of 1 blocking finding(s) are security-class and were withheld from adjudication, so the blocking verdict stands.

BLOCKING -- src/kiro_crew/dashboard/handlers/files.py:6084 -- Slash-dense credentials bypass egress redaction
return prefix[:-2] + redact(prefix[-2:] + path[match.end():])
macOS temp path ending in a classifier-accepted 40-byte key with four slashes -> project API redaction -> raw credential returned in JSON.
Anchor: residual/security
Fix: Explicitly redact detectable 40-character credential windows in the suffix before concatenation.
[BLOCK-MERGE] c56e4c7
[GPT-REVIEWED] c56e4c7

Adjudication (Opus 4.8) — is blocking on each finding proportionate?

F1 is fenced (credential-exposure class), so my verdict set is UPHOLD-FENCED / FLAG.

Conditions confirmed in this run:

  • Darwin only: files.py:97 returns redact(path) unchanged off macOS.
  • Prefix match required: _MACOS_TEMP_PROJECT_PREFIX_RE (files.py:24), applied at files.py:99; the scan sees /T + suffix (files.py:106).
  • The declined-window mechanism: a 40-char key window is accepted by _looks_like_secret_key (redaction.py:735-747) but, because /T/+suffix is longer than one key (a fragment), a window carrying >_SECRET_MAX_SLASHES (=3) slashes is declined by the fragment ceiling at redaction.py:810. So a slash-dense key spanning the path separators is not masked.

Recovery / no-new-exposure: the identical key is also unredacted on any ordinary deep path product-wide (/srv/<key>, /tmp/<key>, /<key>) — the fragment ceiling loses slash-dense keys everywhere, not here — pinned in this run by test_a_slash_dense_key_is_treated_as_on_any_other_path (test_project_git.py:592-623). The macOS full-path masking the helper removes was itself the false positive the OS-id slash-free run created, not real key recognition. The SEL audit retains the true path regardless; the only egress consumer is a decorative branch/root label.

Rarity / remedy: exposure requires a real 40-char AWS-secret-shaped credential to be the literal nested directory structure of a project root under /private/var/folders/…/T/ — an input an operator does not produce (a secret key is not a directory tree). The finding's proposed fix ("explicitly redact detectable credential windows in the suffix") means implementing a more aggressive, divergent detector in this one helper than the canonical redactor deliberately runs — precisely the false-positive spelling-chase the repo's security invariants forbid, and it would then mask ordinary deep paths canonical preserves.

Complete record, genuine acceptable residual, no new product-wide exposure → FLAG (finding still blocks; this only pre-drafts the override rationale).

[ADJUDICATION] c56e4c7e4454d94daffe81b5f89c56140b72734b total=0 uphold=0 downgrade=0
[GPT-ADJUDICATED] c56e4c7e4454d94daffe81b5f89c56140b72734b
[ADJUDICATION-FENCED] c56e4c7e4454d94daffe81b5f89c56140b72734b fenced=1 flagged=1
FLAG F1 src/kiro_crew/dashboard/handlers/files.py:6084 -- Leak requires an operator's project directory tree to literally spell a 40-char slash-dense AWS key under the macOS temp root; that same key is already unredacted on any deep path product-wide (parity-pinned by test_a_slash_dense_key_is_treated_as_on_any_other_path), so the helper adds no new exposure and only drops an accidental false-positive masking on Darwin, while the proposed remedy is a divergent over-aggressive detector the security invariants forbid.
[GPT-ADJUDICATED-FENCED] c56e4c7e4454d94daffe81b5f89c56140b72734b

🏷️ Fenced finding(s) machine-flagged as likely edge case

The security fence keeps these findings blocking regardless of adjudication; the only clearance path is a human override recorded by a repository writer, who must independently verify a rationale before recording it — it is machine-authored, and a wrong override on a security-class finding ships exactly the class the fence exists to stop. (This lane's comment deliberately carries no override command.)

  • F1 src/kiro_crew/dashboard/handlers/files.py:6084 — Leak requires an operator's project directory tree to literally spell a 40-char slash-dense AWS key under the macOS temp root; that same key is already unredacted on any deep path product-wide (parity-pinned by test_a_slash_dense_key_is_treated_as_on_any_other_path), so the helper adds no new exposure and only drops an accidental false-positive masking on Darwin, while the proposed remedy is a divergent over-aggressive detector the security invariants forbid.

@github-actions

github-actions Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5, fork) — ✅ PASS

Design-level review of c56e4c7e4454d94daffe81b5f89c56140b72734b via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Verify on a real Mac that realpath($TMPDIR) matches the exact [a-z0-9]{2}/[a-z0-9_]{30} shape — a width mismatch makes the exemption silently never fire.

[DESIGN-REVIEWED] c56e4c7

@github-actions

github-actions Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5, fork) — ✅ PASS

Premise-level review of c56e4c7e4454d94daffe81b5f89c56140b72734b via the fork AI-review pipeline — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: PASS

Verify on a real Mac that non-root users cannot create chosen ids under /private/var/folders — the OS-ownership premise the exemption's safety rests on; tests only simulate Darwin.

Not justified as shipped

  • Item 5 — rides along: three assertions loosen from startswith("<") to "<" in, matching the wrapper's preserved-prefix contract; harm-free consequence of the fix.

What this change ships

Inventory (7 items) — 6 justified

Intent: FIX — macOS projects under the per-user temp root render as [REDACTED: credential] in the dashboard; exempt only the OS-owned prefix at path egress. Provenance is on base: test/test_project_git.py:120-143 records the defect and prescribes exactly "a path-specific sanitizer at the call site". All six bare redact() absolute-path egress sites on base (files.py:6028, 6121, 6137, 7671, 7869, 7960) are converted; grep for other absolute project-path egress through redact() in src/kiro_crew/dashboard/ found zero unfixed siblings.

  1. Activity panel shows the real macOS temp project path instead of a redaction marker — justified
  2. /api/project/git/status repoRoot takes the same exemption its own comment promised — justified
  3. Files tab root (/api/project/tree, both egress arms) fixed the same way — justified
  4. Two deleted happy-path tests restored, per the deleting comment's own terms — justified
  5. Three redaction assertions loosened to substring form — rides along (see above)
  6. Spec paragraph updated in same commit — justified (AGENTS.md mandate)
  7. Boundary-contract regression suite pinning what the exemption may cost — justified

[FIRST-PRINCIPLES-REVIEWED] c56e4c7

@github-actions

github-actions Bot commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Opus 4.8 Review (fork) — ✅ no blocking findings

Reviewed c56e4c7e4454d94daffe81b5f89c56140b72734b via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] c56e4c7

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Aug 30, 2026
@leonlaiyc

Copy link
Copy Markdown
Contributor Author

Re the BLOCKING finding on _redact_project_path — the mechanism is real and I reproduced it; the stated consequence is not, so the suggested revert is not the right remedy. Detail is in the PR body under Boundary contract; the short version:

Reproduced. On a prefix that is not self-flagged (an ordinary Darwin id carrying an underscore, so the #6905 false positive is out of the picture), a 38-character directory name is redacted by redact(whole) and preserved by _redact_project_path. So the split does drop windows.

But it drops no detection. _looks_like_secret_key gates on an exactly-40-character window, and the prefix regex ends at T with a lookahead for /, so a non-empty suffix always starts at that separator — a user-controlled run of ≥ 39 characters is still scanned as a full window. Only ≤ 38-character runs lose one, and those are below the classifier's own minimum: the canonical redactor does not flag such a value standing alone either. Measured across run lengths 37–41, and over labelled-credential and base64-chunk placements at four positions under two prefixes — no value that redact() detects on its own becomes visible. The T/-borrowing window in the finding is not a key: two of its forty bytes are a fixed OS path.

Why not revert. That restores the defect the PR exists to fix. I also measured the natural middle ground — giving the scan boundary context from the prefix — and it is worse, because the OS id is itself high-entropy and any overlapping window inherits it: 39 characters of context re-redacts ~50% of ordinary project names, and even a 2-character T/ context re-redacts ~85% of opaque 38-character directory names while catching nothing the canonical policy would catch.

Pinned by TestMacosPrefixBoundary (mutation-checked: widening the exemption fails 14 of its assertions), and recorded in the helper's docstring.

Separately, the Design and First Principles reviews were right about /api/project/tree — the two root sites are folded in rather than left as a follow-up. Six absolute-path egress sites in the file, six fixed.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Aug 30, 2026
@leonlaiyc
leonlaiyc force-pushed the fix/project-git-macos-path-redaction branch from 8e4b326 to 11b9d5f Compare August 30, 2026 13:05
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Aug 30, 2026
leonlaiyc added a commit to leonlaiyc/KiroCrew that referenced this pull request Aug 31, 2026
`_redact_project_path` handed the canonical redactor only the text after
the Darwin temp prefix, so a 40-character window that begins at the
prefix's trailing `T` was never evaluated. An AWS secret key may contain
`/`, so `T/` plus 38 user-controlled characters is a well-formed 40-byte
key rather than a window that merely borrows OS bytes -- and that class
produced `redact(path) != path` while the helper returned `path`
unchanged, weakening the canonical output policy instead of narrowing a
false positive.

Move the split one byte earlier: preserve everything above the trailing
`T`, and hand `T` plus the suffix to the canonical redactor. The
high-entropy `[a-z0-9]{2}/[a-z0-9_]{30}` id still never enters the scan,
which is what the exemption exists for, so the kirodotdev#6905 false positive
cannot return.

Measured over 300 samples each of ordinary project names, pytest temp-dir
names, truncated sha-256 digests and uuid hex, under both a self-flagged
and a non-self-flagged prefix: the boundary byte costs zero additional
redactions. The only names it newly redacts are uniformly-random 38-char
base64 runs, which the canonical redactor already redacts on this path.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Aug 31, 2026
@iamwhatever
iamwhatever force-pushed the fix/project-git-macos-path-redaction branch from a3b5ad1 to 20537d2 Compare September 21, 2026 21:34
@iamwhatever

Copy link
Copy Markdown
Contributor

Rebased onto current origin/main by a maintainer (maintainer_can_modify), pushed once as 20537d280. Fresh CI runs on that head; the red Backend Tests you see above are stale runs against the pre-rebase head.

Premise re-verified on current main first

This branch is three weeks old and the redactor moved underneath it, so the defect was re-confirmed against origin/main at 0140fdd57 before any rebase work. Calling main's own redact_credentials on a real macOS temp project path (30-character [a-z0-9_]{30} id, all-alphanumeric so the base64-alphabet run stays intact):

input main's output
/private/var/folders/6r/54rts88h7yebke7n6clhoq9d0roaen/T/project [REDACTED: credential]
/private/var/folders/6r/54rts88h7yebke7n6clhoq9d0roaen/T/my-app/src/main.py [REDACTED: credential]-app/src/main.py

Both are whole-path losses on output that was only meant to have secrets removed, so the premise is alive. With this branch applied, _redact_project_path returns each of them unchanged. An id containing _ (e.g. zyxvpxvq6csfxvn_n0000000000000) breaks the run and was never affected either way — before or after.

Conflicts resolved

Two files conflicted; both are "main restructured the same lines", not a disagreement about behaviour. In both cases main's side was kept and this branch's single change re-applied on top.

  1. src/kiro_crew/dashboard/handlers/files.py, api_project_tree (two hunks). Main added the directories / truncatedDirectories response fields and moved the listed paths onto segment-aware redact_path_segments(p, redact) with order-preserving de-duplication. This branch had only ever touched the root value. Resolution keeps all of main's new fields and its segment-aware path handling verbatim and changes exactly two expressions: "root": redact(base) and result["root"] = redact(result["root"]) become _redact_project_path(...). The project-relative paths stay on main's segment-aware redactor, which is correct — they carry no OS-owned prefix.
  2. docs/system-specs/modules/learn-cron-dashboard.md. Main's Project git and Project tree paragraphs grew substantially (filter-driver refusal, the directory skeleton, the truncation markers). Rather than restoring this branch's older paragraph text, main's paragraphs were kept and the Darwin-prefix exception spliced into the one sentence in each that enumerates what gets redacted.

All seven call sites are on the wrapper after the rebase: _project_git_branch, the not-a-directory and success responses of api_project_git, api_project_git_status's repoRoot, and both api_project_tree root sites.

Narrowing checked, since this is a security helper

The wrapper must only ever redact less for this one path shape, never redact less of anything that is actually a credential. Checked directly against redact as the oracle:

  • credentials planted in the user-controlled suffix (AKIA..., ghp_..., a 40-char AWS-secret shape, a JWT, a PEM block) are still redacted under both a self-flagged and a clean prefix — 10/10;
  • 40-character base64 windows that begin on the / before T, i.e. straddle the split, are still scanned and still redacted — 6/6 matched redact's verdict, which is the boundary property TestMacosPrefixBoundary guards;
  • every non-matching input is byte-identical to plain redact: /var/folders/... without /private, a wrong-width id, /Tmp instead of the /T segment, an ordinary home path, a bare AKIA..., and the empty string.

No case was found where the wrapper preserves something redact would have removed. The diff adds a regex and a wrapper and weakens no credential pattern.

Tests and gates

Run from a clean clone of kirodotdev/KiroCrew on the rebased head.

  • test/test_project_git.py, test/test_project_git_status_log.py, test/test_project_tree.py (this branch's own files) plus test/test_log_redaction.py, test/test_redact_path_segments.py, test/test_redaction_mirror_parity.py, test/test_redact_meta_snapshot.py (the redaction suites, since the change sits in a security helper): 230 passed.
  • black baselined gate (scripts/check_black_formatting.py): passed, nothing in scope unformatted outside .github/black-baseline.txt.
  • isort --check-only, flake8, mypy src/kiro_crew/ (1673 files): clean.
  • scripts/docs-lint.sh: all documentation checks passed.
  • scripts/check_comment_history.py with COMMENT_HISTORY_BASE_REF=origin/main: initially failed on three added comment lines carrying the issue number (one docstring line in files.py, two in test_project_git.py). Those three lines were reworded to state current behaviour without the reference, and the gate then passed. That is the only content change made beyond the conflict resolution; the tests were re-run after it.

Verification before pushing: git diff --stat origin/main...HEAD is 5 files, +402/-42, against the pre-rebase +403/-42 — the one-line difference is the reworded docstring. A comm -23 symbol check over files.py between origin/main and the rebased head is empty, so no upstream function was dropped. No binaries in the diff. Authorship is unchanged.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 21, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

Review round on the rebased head, answered on 119172a36. Both findings are taken; neither is disputed.

F1 (BLOCKING, security-fenced) — Darwin exemption applied on every platform

Accepted, fixed. _MACOS_TEMP_PROJECT_PREFIX_RE carried no platform guard, so the helper withheld [a-z0-9]{2}/[a-z0-9_]{30} from the credential scan on Linux and Windows too. The whole safety argument for withholding that region is that the OS generates it — off Darwin /private/var/folders/<id>/T names nothing the OS owns, so a caller who can choose a project directory (the value is agent-influenceable via set_project, which is why this path is redacted at all) can choose those bytes outright and place a credential-shaped run in the one region the helper never scans.

The fix is the one the finding names: if not platform_compat.IS_MACOS: return redact(path). Off Darwin the helper is now the canonical redactor byte for byte, so the exemption stays exactly as wide as the false positive it was measured against and no wider.

I did not route this to a human override on the adjudicator's "residual is plausibly acceptable" reading. The adjudication is sound as far as it goes — a 40-char [A-Za-z0-9+/] window cannot form from a lowercase-only 32-char id alone — but that argument rests on the region being OS-generated, which is precisely what does not hold off Darwin. A one-line platform guard is cheaper than an override and removes the question instead of accepting it.

Tests: the Darwin-arm cases now flip platform_compat.IS_MACOS through an as_darwin fixture, following test_socketsec.py's convention, rather than asserting a branch that only executes on the macOS runner. Two new cases pin the off-Darwin arm — the helper equals redact() for every input shape, and the self-flagged id is redacted there rather than preserved. Both fail with the guard removed:

FAILED TestBranchRedaction::test_the_exemption_does_not_apply_off_darwin
FAILED TestBranchRedaction::test_a_credential_in_the_withheld_id_region_is_redacted_off_darwin

F2 (FINDING) — deleting (?=/|\Z) left the added cases green

Accepted, fixed. The mutation is real: with the lookahead deleted, every added case still passed, so the segment boundary was present-but-unproven and a caller-chosen segment merely starting with T (/Tevil/…) would have been exempted — the same blind spot as F1, reached through the regex instead of the platform.

test_similar_macos_path_with_the_wrong_id_width_is_not_exempt is now test_a_similar_path_that_is_not_the_temp_root_is_not_exempt, parametrized over the too-wide id plus /Tevil/project and /Tevil. With the lookahead deleted:

FAILED ...test_a_similar_path_that_is_not_the_temp_root_is_not_exempt[.../Tevil/project]
FAILED ...test_a_similar_path_that_is_not_the_temp_root_is_not_exempt[.../Tevil]

Verification

test_project_git.py, test_project_tree.py, test_project_git_status_log.py: 147 passed locally. isort, flake8 and the baselined black gate clean on both touched files. Shape after the push: +483/-42, 5 files, 2 commits, no file deleted relative to main. No behaviour change on macOS — the exemption there is byte-identical to the reviewed head.

Pushed by a maintainer under maintainer_can_modify, as a second commit so the original commit stays intact and attributed.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 22, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

Round 2 F1 — disagreed, no code change

The finding is technically accurate about which window is unscanned, and I am not disputing that. I am disputing the fix, because the window it names is the one the helper's own docstring already identifies as the terminating case, and the requested remedy reintroduces the exact defect this PR exists to fix.

Why the window is different in kind from the two already conceded. The earlier boundary findings (11b9d5fa → cded733c → a3b5ad1e) were each right for one reason: every byte of the unscanned window was fixed or caller-chosen, so a caller who can set the project directory could position a real credential inside it. The window this round names starts one byte further left, on the final character of the OS-generated [a-z0-9_]{30} id. That byte is not caller-chosen. For a real 40-char key to occupy the window it would have to begin with whatever character macOS happened to generate for this user's temp id, and carry /T/ at positions 1–3 — the caller controls neither. A credential the caller can place lands wholly in the scanned suffix, which is pinned by test_a_real_credential_never_survives_the_split over four placements. The adjudicator reached the same conclusion independently and FLAGged rather than upheld, calling it "inputs the writer of a real credential cannot produce."

That distinction is the stated stopping rule in the docstring, not a line drawn now:

a window reaching further left necessarily contains id bytes, which the OS generates and no caller can choose. That is the terminating argument, and it is why this is not "one more byte" a third time.

Why the requested fix cannot be implemented. "Scan and redact every 40-byte window crossing the boundary" requires feeding real id bytes to the detector. Measured on the current tree:

self-flagged id  project      scan-whole-string -> REDACTED (false positive)
self-flagged id  kiro-crew    scan-whole-string -> REDACTED (false positive)
self-flagged id  my_app-2     scan-whole-string -> REDACTED (false positive)
clean id         project      scan-whole-string -> PRESERVED

An ordinary Darwin project path under an all-alphanumeric temp id comes back [REDACTED: credential] — the original bug, restored. The narrower variant (scan the whole string, discard hits lying wholly inside the id region) does not help either: the id's longest base64-alphabet run is 30 characters, under the detector's 40-character minimum, so no hit is ever wholly inside the id — every false-positive window borrows the fixed literal folders/ and /T bytes and would be kept. Both candidate implementations trade a reachable false positive for an unreachable residual.

So the choice here is not fix-versus-ignore. It is: accept a residual no caller can reach, or ship a redactor that mangles ordinary macOS project paths in the Files tab. I am taking the first, which is also what the adjudicator's FLAG rationale recommends.

What this leaves. The security fence keeps the lane red regardless, and clearing it needs a human override recorded by a repository writer who has independently verified the rationale. That decision is not mine to record, so I am stopping here rather than pushing a third concession of the same argument — the previous two each produced the next round's finding, and a fourth would drag the OS id into the scan.

Everything else on this head is green: the round-1 findings are fixed on 119172a36 (platform gate plus the /Tevil boundary case), all other review lanes pass, and the one red test shard is test_admission_gate.py::TestCronAdmissionDeferral::test_critical_defers_then_runs_on_recovery on Windows — a cron admission-gate timing assertion in an unrelated subsystem, rerunning now.

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.
@iamwhatever
iamwhatever force-pushed the fix/project-git-macos-path-redaction branch from 119172a to c56e4c7 Compare September 22, 2026 07:40
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 22, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

Override request for the one fenced finding — verified independently, not taken on faith

F1 src/kiro_crew/dashboard/handlers/files.py:6084 — "Slash-dense credentials bypass redaction". Adjudicated FLAG (likely edge case), but the security fence keeps it blocking, so only a repository writer can clear it.

I re-ran the measurement rather than trusting the previous pass's prose, and one of that pass's claims turned out to be wrong. Both results are below; the second is the one the request rests on.

What I measured

Harnesses are untracked under kcmeasure/ in the review worktree; each is a single module with a main() that prints the table it claims.

1. The previous pass's cost argument was false. It said feeding the boundary window to the detector "re-mangles ordinary macOS project paths". Measured over 1,200 ordinary temp-project paths (plain/hyphenated/snake names, nested names, pytest-of-* tmp paths, mkdtemp names, uuid4 hex, truncated sha-256), extending the scan k bytes left of the /T boundary costs:

k scan starts paths mangled (realistic ids) (uniform ids)
0 /T — as shipped 0/600 0/600
1 1 byte into the id 0/600 0/600
3 3 bytes into the id 0/600 0/600
5 5 bytes into the id 0/600 1/600
10 10 bytes into the id 2/600 8/600
30 the whole id 122/600 63/600
≥31 past the id → canonical 185/600 79/600

So conceding one byte is free. The cost only appears from k≈5 and becomes the original bug at canonical. Do not clear this finding on the "one more byte re-mangles paths" rationale — it does not hold at one byte. The split's real justification is reachability, below.

2. The finding is real and is not a new exposure. The current head's own docstring and test_a_slash_dense_key_is_treated_as_on_any_other_path now record this, and the numbers are:

  • A 40-char key with more than _SECRET_MAX_SLASHES (=3) separators is masked standing alone — a 40-char run is the token somebody wrote, so _contains_bare_secret deliberately exempts it from the separator ceiling.
  • Inside the helper the scanned text is /T + suffix, i.e. longer than one key → a fragment → the ceiling applies → every window is declined. 98 of 30,000 sampled caller layouts.
  • Control: the same keys also survive the canonical redactor on ordinary deep paths with no exemption anywhere near them — 387/400 on /srv/<key>, 370/400 on /home/runner/work/<key>, 400/400 on /<key>. The ceiling loses this shape product-wide.
  • Canonical's hit on the full temp-root path is not credential detection: the OS id supplies a slash-free stretch that lets an id-straddling window clear the ceiling. It masks the path via the exact false positive this exemption removes.

Every key that the detector actually masks is still masked here: 0/29,900 caller layouts of at-or-below-ceiling keys survive the helper.

Why the suggested fix is declined

"Redact the user-controlled suffix independently" only helps by removing the ceiling's fragment rule, which is a global redactor change. That was rejected previously with 200k-sample evidence (it revives a 2.555% real-key false-negative rate), and it is not this PR's surface. The adjudicator reached the same conclusion independently.

What a repository writer needs to do

Please satisfy yourself of the control numbers above (kcmeasure/ceiling_control.py reproduces them, or read the parity test in the diff), then record:

/ai-review override gpt c56e4c7e4454d94daffe81b5f89c56140b72734b: Real but not a new exposure -- the >3-slash 40-char key it needs already survives redact() on any deep path via the product-wide fragment separator ceiling, the helper's parity test pins that equivalence, and the only fix is weakening the global redactor, previously rejected on 200k-sample evidence.

Every other lane on this head is green: Design Review PASS, First Principles PASS, Opus 4.8 no blocking findings, Publish readiness signal success.

@iamwhatever

Copy link
Copy Markdown
Contributor

/ai-review override gpt c56e4c7: Verified independently, no new exposure: the >3-slash ceiling applies only when the run is LONGER than _SECRET_KEY_LEN (redaction.py:798,810), so the same 40-char slash-dense key already survives redact() on any prefixed path (measured 400/400 on /, 388/400 on /home/runner/work/), while 0/12000 at-or-below-ceiling layouts leak through the helper that canonical masks. The parity test pins that equivalence; the only fix weakens the global redactor. Residual accepted by the maintainer.

Recording this after reproducing the control against the redactor at this head rather than accepting the request's prose. What I ran, and what it showed:

  • The ceiling is length-gated, and that is the whole mechanism. is_fragment = len(run) > _SECRET_KEY_LEN (redaction.py:798) and the decline at redaction.py:810 is if is_fragment and window.count("/") > _SECRET_MAX_SLASHES. A standalone 40-char run is not a fragment, so it is exempt from the ceiling and gets masked; any prefix makes the run longer than 40 and switches the ceiling on. Nothing about that is Darwin-specific — files.py only decides which text reaches redact().
  • Control, on 400 generated slash-dense 40-char keys that the classifier itself masks standing alone (0/400 survive alone): with an ordinary path prefix they survive redact_credentials at 400/400 on /<key>, 397/400 on /srv/<key>, 397/400 on /tmp/<key>, 388/400 on /home/runner/work/<key>. The separator ceiling loses this shape product-wide, with no exemption anywhere near it.
  • The parity test's own fixture checks out: cr/3YYUFFyoVEK2O/pmcPr4rjgfo//FDAHqlB572 is a key by _looks_like_secret_key, carries 4 separators, is masked standing alone, and survives on /srv/<key> — so the test's control assertion (ordinary_untouched is True) is a true statement about the product, not a blessed outcome.
  • The safety direction, which is the one that would have declined this: over 12,000 caller layouts built from at-or-below-ceiling keys (bare, nested, with an extension, with a trailing segment), the helper leaked 0 keys that canonical redact() masks. The helper stays strictly narrower than canonical rather than becoming a second policy.

The requested fix — redacting the suffix independently — only helps by removing the fragment separator rule, which is a global redactor change rejected previously on 200k-sample evidence (2.555% real-key false-negative rate), and is not this PR's surface. Opus 4.8 reached the same conclusion and machine-flagged the finding as an edge case; the security fence is what kept it blocking.

For the record: I am not relying on the "conceding one more byte re-mangles ordinary macOS paths" rationale. The request itself reports that measurement as falsified (k=1 costs 0/600, the same as k=0), and it is not load-bearing here. The ground for this override is reachability — the residual is a product-wide property of the redactor's fragment ceiling, not something this helper introduces.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@iamwhatever marked the gpt AI finding as false positive, not applicable, or explicitly accepted for c56e4c7e4454d94daffe81b5f89c56140b72734b.

Verified independently, no new exposure: the >3-slash ceiling applies only when the run is LONGER than _SECRET_KEY_LEN (redaction.py:798,810), so the same 40-char slash-dense key already survives redact() on any prefixed path (measured 400/400 on /, 388/400 on /home/runner/work/), while 0/12000 at-or-below-ceiling layouts leak through the helper that canonical masks. The parity test pins that equivalence; the only fix weakens the global redactor. Residual accepted by the maintainer.

This decision applies only to this commit. A new push requires a new judgment.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded, but the following reviewer lane(s) could not be re-run automatically: GPT 5.6. Re-run the lane's latest workflow run for c56e4c7e4454d94daffe81b5f89c56140b72734b manually from the Actions tab.

@iamwhatever iamwhatever self-assigned this Sep 23, 2026
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Sep 23, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

Thanks @leonlaiyc for this fix! The change is continuing in #14880 (an in-repo replacement) with you credited as co-author. It's all green there, so we're closing this one as superseded. Really appreciate the contribution.

@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Sep 29, 2026
@mbriones98 mbriones98 removed the drive-to-green PR claimed by drive-to-green pipeline label Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor) merge conflict Branch has merge conflicts with its base — author must resolve before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants