Repository navigation
v1.94.14.0 fix(review): review_exclude_paths keeps native binaries, NUL-bearing code and attribute-binary secret lines; exact --review-exclude docs (GST-972) - #3902
Merged
Conversation
…code and attribute-binary secret lines; exact --review-exclude docs (GST-972) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
…tial scan flags Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
attributeBinaryLines reads attribute-binary files in one git diff per argument-byte chunk instead of one per file (red-team#2). The changelog and ship-policy row say readers' own diffs still show such a kept file as binary (red-team#1, deferred as #3905). Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ibute-text files are #3910 Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ones (Step 14.5 audit) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…hangelog and PR notes Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…atchet Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…l binary, whatever .gitattributes says; exact review_exclude docs (GST-972 round 2) bytesBinary reads git diff --numstat with attributes from the empty tree, so a branch's '*.png diff -binary' cannot make an ELF read as text and skip the magic check (#3910). Adds 64-bit universal Mach-O magic. ship-policy's key row lists every kept class; troubleshooting and the write/queue refusal lines say a review_exclude mismatch compares the --review-exclude argument, not the review ledger. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ot what reviewers read Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GST-972 items 2, 3, 5 and 6. Item 1 was dropped because GST-884 covers it. Item 4 waits for GST-1084, because
lib/review-depth.tsis pinned.--review-excludeis bound to the digest the base policy gives HEAD. It is not bound to the review, because write never reads the ledger. That limit is now stated everywhere the old claim was. Binding the flag to the ledger was not done, because the ledger is a local file the same writer produces, so the binding would still be self-reported, and it would take a larger edit inbin/gstack-ship-receipt, which is the GST-552 lane's file..node,.so,.dyliband.dllfiles stay in review. So does any file git reports as binary that starts with ELF, Mach-O, PE, WebAssembly or#!magic, whatever its extension. Round 2 reads git's binary verdict a second time with the branch's attributes switched off (--attr-source=<empty tree>), so a branchdiffattribute cannot make git treat an ELF as text and skip the check, and it adds the 64-bit fat Mach-O magic. When git is too old for--attr-source, every matched path is sniffed.RECEIPT_CARRY_REFUSED: review_exclude changed), the write refusal, the queue line, ship-policy.md and the troubleshooting entry now say only that the digest the receipt holds, which came from write's--review-excludeargument, differs from the head's selection. None of them claims anything about what the reviewers read..bin,.datand data blobs. Every other binary is kept ascode.git diff --text --no-textconv --no-ext-diff -U0, one call per 24,000 bytes of literal pathspecs. When a git call fails or its output does not line up with the paths, every file in that chunk is kept.Security read: there are no network calls, environment reads, permission changes, workflow, setup or dependency edits. The new code runs local
git diffcalls with the existing timeout and buffer.Files shared with sibling lanes:
bin/gstack-ship-receipt(help text and two refusal strings) andlib/ship-receipt-depth.ts(one comment and theexcludeMismatchmessage) are on GST-552's list.Failing first
Four new tests in
test/review-exclude.test.tsfailed on main 14d7414 (0 pass, 4 fail; on main the three exclusion tests gotkept_files: [], and the docs test found the over-claim after the write with theexpected=digest succeeded). After the fix the whole file passes (19/19). Logs:captain-gstack-minder/handoffs/GSTA-202/evidence-GST-972/.Security read
No network calls, environment reads, permission changes, workflow, setup or dependency edits. The new code runs one local
git diff --textper attribute-binary matched file, with the existing timeout and buffer.Follow-up (not in this PR)
The named-by-code consumer scan uses
git grep -I, which honors.gitattributes: a branch that marks a consumer code filebinaryhides it from the scan, so the data file it names is excluded instead of kept asnamed-by-code. The code file itself stays in review and the.gitattributesedit shows in the diff.Files shared with sibling lanes
bin/gstack-ship-receipt(help text only) andlib/ship-receipt-depth.ts(one comment and theexcludeMismatchmessage) are on the GST-552 lane's list.Refs GST-972
What changed
The four GST-972 tests fail on main and pass on this branch. The image render failed on this machine (
PR_SHOTS_RENDER_FAILED: the bundled browser would not start), so this is the text version. Round 2 added a fifth test (a branch .gitattributes that makes git read an ELF as text cannot get it excluded; fat64 Mach-O is native): it is red at bf48ff6 and green at 645770c.Before/after as text: The four GST-972 tests fail on main and pass on this branch
Why
The Captain's rule for GST-972 was "the docs must not over-claim what a gate stops".
gstack-ship-receipt's help, the troubleshooting entry, ship-policy.md and the queue's refusal line all said a receipt write alone cannot clearfield=review_exclude. But write takes the digest from--review-excludeand never reads the review ledger, so passing the refusal's ownexpected=digest clears it. That text now says what the check does. Separately, three kinds of code or secrets could still be excluded from review under a basereview_exclude_pathspattern: native binaries, NUL-bearing source with an extension that was not on the list, and a credential line in a file a branch marks binary through.gitattributes. All three now stay in review. Round 2 closes the gap the outside voice found (#3910): a branchdiffattribute could make git read an ELF as text, so the magic check never ran.Blast radius
reviewExcludefeeds the plan, dispatch, the receipt write, carry and the queue. All of them call the same function, so they agree on one digest. A repository whose base declaresreview_exclude_pathswill now see more files kept (unknown-extension binaries, native libraries, key stores) and a different digest. Readers will also be asked to read more. That is fail-closed and needs a fresh review on such branches (evidence:test/review-exclude.test.ts20/20 at b140058, plus the CI free tier dispatched on the branch head, run 41574670508 at tree b957a29). Repositories without the key are unchanged:reviewExcludereturnsnonebefore any of the new code runs.Approvals
No approvals recorded for branch capy/reviewexcludepaths-keeps-native.
Test Coverage
Each of the 4 changed runtime files has a changed test naming it (
gstack-ship-preflight --audit: Coverage deterministic). The four new tests are red on main 14d7414 and green at bf48ff6.The round-2 test is red at bf48ff6 and green at 645770c (logs: evidence-GST-972/round2-failing-first-bf48ff6.log, round2-after-fix.log).
Tests ran: targeted 376
Pre-Landing Review
REVIEW_LOOP: passes=3 blocking_found=5 deferred=1 noted=5 fixed=1 scope=frozen unrecorded=4 ledgers_read=3 fix_checks=2 dispatches=4
Review-loop exception: accepted by GStack Minder (Captain, GSTA-36) 2026-11-02 via Captain reply relayed by the parent lane on GST-972, option A for #3902: string fix to the carry refusal at bin/gstack-ship-receipt:754 after fix-check fc2: change one string with no behavior change; the acceptance covers it, so it gets no review round and no fix-check (fix-check at 645770c, 3 findings)
Gate edits: none detected (GATE_SCAN tagged=0 at bf48ff6)
Outside review: openai/gpt-6.1-sol at high reasoning (outside the certified medium configuration) returned one High finding. It is deferred as #3910, see below.
The pass-1 plan was full depth for the gate class: specialists (testing, security, state-machines) found nothing. The Red Team found 2 issues. #1 (CRITICAL, outside the diff): readers' own diffs still show an attribute-binary kept file as binary. It is deferred as #3905, and the changelog says so. #2 (INFORMATIONAL): one git call per file. It is fixed by batching. The one fix-check found 2 INFORMATIONAL notes, listed below. Step 11 voices: the native adversarial pass found nothing blocking, and its own severities were Medium or Low (its FIXABLE lines were collected as CRITICAL, so they count in
unrecorded). The outside voice found #3910. Round 2 was one fix round the Captain granted (approval a-6124918f3402) for #3910 and the item-2 wording: one scoped fix-check (fc2) read the fix hunks at 645770c and returned 3 INFORMATIONAL notes, listed below. The carry-refusal string it flagged was then fixed under the exception above. The two later pass-2 rows are the plan'sNEXT: done (round cap 2 reached)for the Step 14.5 config-row edit and a test-only type fix. Nobody read those two edits.unrecorded=4counts the Step 11 voice findings that have no path:line for the rows to pair with: #3910 (deferred) and adversarial-native FIXABLE 3 to 5 (below).Deferred findings
lib/review-exclude.ts:346. Readers'git difffollows the branch's.gitattributes, so a kept attribute-binary file shows asBinary files differto every reader. This is pre-existing and applies to any file, not just excluded ones..gitattributesdiffattribute makes git read an ELF as text, so the magic check never runs and an ELF named.pngis excluded as data. Main behaves the same way. Fixed in round 2, under the Captain's grant (test above).Review notes
lib/review-exclude.ts:179: a file-to-symlink typechange on an attribute-binary path prints two sections, so the whole chunk is kept asconsumer-scan-unavailable. This fails closed.lib/review-exclude.ts:177: a userdiff.orderFilereorders sections, so the chunk is kept (fails closed). Plan and receipt machines with different configs could then compute different digests. Pinning with-O/dev/nullis the follow-up.BINARY_CONTENT_EXTstill allows.zip,.npzand.h5, which can hold code (Medium). A NUL-bearing.datskips the secret-line check (Medium). The section split also breaks on\r, which fails closed (Low). The text diff over-reads files that are already kept (Low).REVIEW_EXCLUDE_KEY_VERSIONwas not raised, so a mixed-version writer and queue fail closed (Low).docs/ship-policy.md:61: the key row does not name theconsumer-scan-unavailableandgate-scan-unavailablekept reasons (KEPT_REASONS,lib/review-exclude.ts:41). Files with those reasons are kept as well. Open note.lib/review-exclude.ts:282: on git older than 2.40 (no--attr-source, for example Apple's Xcode git) the fallback sniffs every matched path, symlinks and gitlinks included. Those land asconsumer-scan-unavailableinstead oflink. The file is still kept, but the digest can then differ by git version, so a receipt written on git 2.40+ and checked on 2.39 refuses withfield=review_excludewhen a submodule or a directory symlink sits under a pattern. The suggested fix is to skip modes 120000/160000 in the fallback. Open note.bin/gstack-ship-receipt:754: the carry refusal still said the reviewers read another selection. Fixed in b140058 under the review-loop exception.field=review_excludewithout a review (Medium). That was item 2's finding, and this PR documents it rather than changing the control.Exploratory QA
No interactive surface changed. The behavior is covered by the fixture tests above.
Design Review
No frontend files changed, so design review was skipped.
Eval Results
No prompt-related files changed, so evals were skipped.
Plan Completion
Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). The brief was GST-972 items 2, 3, 5 and 6, and all four are done.
Issues
Refs #3905
Refs #3910
TODOS
No TODO items completed in this PR.
Documentation
Scope: Mode edit, branch capy/reviewexcludepaths-keeps-native against main. I read the 7-file PR diff and the review_exclude_paths sections of docs/ship-policy.md (key table row, the excluded-and-kept rules, the reason table and the receipt-digest paragraph), docs/troubleshooting.md (field=review_exclude, REVIEW_DIFF_TOO_LARGE fix list) and docs/review-policy.md (readers under review_exclude_paths, module pointers). I also read the changelog fragment and the receipt help text in bin/gstack-ship-receipt. The working tree was clean when I looked, so there were no staged, unstaged or untracked files to add. Result: Current, with no edits. The PR already updated the docs for native-magic binaries, the content-extension allowlist,
git diff --textfor attribute-only binaries, and the receipt-write wording. They match lib/review-exclude.ts:BINARY_CONTENT_EXT,NATIVE_MAGICand the secret-line rule. A grep found no stale references to the removed source/script-extension rule. docs/review-policy.md makes no claims about binary classification. Debt: I did not run the docs-caps check (not in the Steps 1-4 and 6 scope). I did not verify the docs against the full test run.Documentation: blocked. The round-2 edits came after audit docs-gst972-2, and the audit budget allows no third audit, so they were not re-audited. The fix-check fc2 read them.
Documentation exception: accepted by GStack Minder (Captain, GSTA-36) 2026-11-02 via Captain reply relayed by the parent lane on GST-972, option A for #3902: round-2 doc and help-text edits to bin/gstack-ship-receipt, docs/ship-policy.md, docs/troubleshooting.md, lib/review-exclude.ts, lib/ship-receipt-depth.ts and the changelog fragment, read by fix-check fc2, no third audit
Test plan
bun test test/review-exclude.test.ts test/troubleshooting-anchors.test.ts test/gstack-ship-policy.test.ts test/module-size-ratchet.test.ts: 376 pass, 0 fail (finish lane at b140058)bun run typecheckandbun run typecheck:test: no errors, no new diagnostics (round 2, 645770c)