Repository navigation
Let review exclusions handle big results PRs (GST-1967) - #4184
Merged
Merged
Conversation
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
… stay at their replayed bytes 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>
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.
Big results PRs whose captured transcripts only mention a credential's name now fit under /ship's review size limit, so data-heavy PRs like harness-evals#333 can be reviewed and shipped again.
Takeaways
$AGENT_API_TOKEN,${OPENAI_API_KEY}, a keychain) stop being kept. Lines that name a credential and carry a value still keep their file: a key value,OPENAI_API_KEY=sk-…, a key inside a JSON string, a key after the name, and a base64 blob.git diffhas no--pathspec-from-file(git 2.55 prints its usage), so the cap fix chunks git calls instead.What changed
Which lines keep a file. Under
review_exclude_paths, a data file stayed in review if any added line named a credential. Captured model prompts name$AGENT_API_TOKENand keychains all the time, so #333 kept 2,610 trial files. NowsecretValueLine(lib/review-exclude.ts) keeps a file only when a line names a credential and carries a value. That means one of two things. Either the credential scan the secrets check runs finds a secret on the line (the same scan and env-read rule as #4157), or a credential-shaped run of 20+ characters mixing upper case, lower case and digits follows the name within 200 characters. Variable references like$Xare never counted as values. A key name given a value (OPENAI_API_KEY=,"GH_TOKEN":) also counts as a name now.The argument-byte cap. Files kept only for a secret line reach readers as an excerpt file, never through the
DIFF_KEEP:command. So they no longer count toward the 24,000-byte bound, andDIFF_KEEP:leaves them out.readSelectionreads both the kept files and the excerpt files in git calls of at most 24,000 argument bytes each, so no command passes Windows' limit. Kept files that a reader's command names still count toward the bound.Why
"HARN-1's results PR harness-evals#333 couldn't get a /ship receipt." Its
docs/benchmarks/*/main/trials/**pattern needed 251,063 argument bytes for its kept files, so the pattern wasn't applied, and splitting the PR doesn't help. With this change the pattern applies and the reader's diff fits under the ceiling. Measured on the real PR tree (base 5c685dfc, head dd42b9e6) throughcollectCommit,reviewExcludeandreadSelection.Of the 21,932 matched lines in the 2,610 files, none carries a value under the new rule.
Blast radius
This changes only which files under a base
review_exclude_pathspattern are kept, and how kept files are read, so repositories without that key plan exactly as before (lib/review-exclude.ts read). Pregate's secrets check is unchanged and still scans every added line. Four existing fixtures used name-only lines (curl -H $OPENAI_API_KEY) to stand for a credential line, and each now carries a base64 value so it still tests the keep, excerpt and selection paths it was written for.Summary
Results PRs with thousands of captured transcripts couldn't get a receipt because every transcript that mentioned an API key's name stayed in review. The first commit adds the value rule and the chunked reads (c54117d), and the second moves the value rule out of the pinned review-risk module (66c98ec). A third commit (19c26dc) rewords the changelog entry so it passes the prose check.
Test Coverage
Coverage: deterministic. Each of the 4 changed runtime files has a changed test naming it (bin/gstack-review-plan, lib/review-exclude.ts, lib/review-targeted.ts, docs/ship-policy.md; map from the /ship audit). No audit reader was needed.
Tests ran: targeted 77
Tests ran: typecheck count unavailable
Tests ran: typecheck-test count unavailable
Pre-Landing Review
Full panel (forced): one batched specialist over all nine checklists, the Red Team, the native adversarial voice, an outside voice on openai/gpt-6.1-sol and the targeted secret reader. No finding fails a test or loses data. Two findings the outside voice marked blocking were kept open under the crew's blocking floor and are listed for a follow-up.
SECRET_LINEmatch) can't be excerpted, yet it was exempted from the 24,000-byte bound. SosettleExcerptadds it whole to one reader keep command, and 400 such files make a 32.8 to 56 KB command, past Windows' limit. The Red Team, the native voice and the outside voice all found it, and QA captures 003 and 005 replayed it. It fails closed (readers get more, never less). Follow-up: count a file as excerptable only when an added line matchesSECRET_LINE, or make the excerpt usesecretValueLine.readSelectionconcatenates every excerpt chunk's raw diff before excerpting, so the 256 MB buffer bounds each git call, not the total. A multi-gigabyte set of excerpt files could exhaust memory before the 2 MB ceiling applies. Follow-up: excerpt each chunk and keep only its output.VALUE_TOKENallows/, so a mixed-case path with a digit within 200 characters after a credential name counts as a value and keeps the file (QA 002 and 004 replayed it). That over-keeps; it never hides a file.secretValueLinescans whole lines with no per-line limit, and a contrived 200 KB line took 7.7 s.DIFF_KEEP:now omits excerpt files, so a reader built by hand fromDIFF_CMD/DIFF_KEEPsees neither. The change narrows what readers see, which crew rule 15 gates on a no-loss replay.Outside review: completed (openai/gpt-6.1-sol, VERDICT: FINDINGS).
Review notes
The six noted findings above are below the blocking floor. The two skipped CRITICAL findings are named for the owner. No issue was filed: this unattended run files no GitHub issues.
Exploratory QA
Functional smoke on
secretValueLineandsecretExcerpt(pure functions, run in place, no writes). Capture 001 passed: name-only lines keep nothing, whileKEY=valueand a JSON key with a value keep their file. Captures 002 and 004 failed: a path after a credential name counts as a value. Captures 003 and 005 failed: a key=value-only file goes whole instead of being excerpted. The verdict is fail, on the two INFORMATIONAL findings above, which the crew's floor accepts as non-blocking. Limit: no end-to-endgstack-review-dispatch passover a synthetic results repo was run.Design Review
No frontend files changed, so design review was skipped.
Eval Results
No eval ran. The selector picked 116 behavioral probes only through derived references (lib/review-exclude.ts, lib/review-targeted.ts and bin/gstack-review-plan feed 252 gate cases); no prompt, template or judge text changed. They were not run under this lane's $30 tree cap. This is a validation gap the Captain can close.
Review bot comments
No review bot comments (one Trunk merge-queue notice, not a review).
Scope Drift
Scope Check: CLEAN. Intent: let review exclusions handle big results PRs (GST-1967). Delivered: the value rule for kept files, excerpt files leaving the keep bound, chunked git reads, the matching docs, and a changelog wording fix.
Plan Completion
Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches).
Verification Results
No plan verification items exist (bug fix, no plan file). Automatic QA is reported above.
TODOS
No TODO items completed in this PR.
Documentation
Status: current — the documentation already matches the change; no edits.
Scope: base e077053..66c98ec (2 commits, 10 files) plus one unstaged changelog.d wording edit; no staged or new files. Change: review exclusions keep a file only for a credential line that carries a value (
secretValueLine), secret-line excerpt files leaveDIFF_KEEP:and the 24,000-byte keep-command limit, and kept/excerpt reads are split into chunks under that limit.Documentation health:
docs/ship-policy.md— current (secret-line reason, keep-command limit, excerpts section updated in the branch)docs/troubleshooting.md— current (skipped-pattern and still-over guidance updated)docs/review-policy.md— current (reader selection description still accurate)changelog.d/review-exclusions-handle-big-results-prs.md— current (reviewed only)Coverage debt:
secretValueLine(internal) has reference coverage in ship-policy.md; no user-facing gaps. Advisory: the secret-line excerpts paragraph's "results PRs need this" rationale predates GST-1967 and now reads as history. Diagram drift: none.Test plan
Agent notes
Bypass tests (test/review-exclude-secret-value.test.ts) were written first and failed before the fix. Six value lines keep their file, and six name-only lines (two copied from Codex CLI doesn't follow symlinks in .agents/skills/ — skills not discovered #333's captures) keep nothing, both for
secretValueLineand throughgstack-review-plan --json. A 260-file excerpt-only fixture past the 24,000-byte bound now applies its pattern, and underGIT_TRACEevery git diff it runs stays under the bound. The same files named by code still skip the pattern.Known narrowing: a data file whose only value is a bare key on a line that names no credential, next to name-only lines, is now excluded. Before, those name lines kept it, by accident. Pregate's credential scan reads every added line and still fails that push.
secretLine(lib/review-targeted.ts) had one caller and is gone. The targeted pass'sSECRET_LINEclasses are unchanged, and lib/review-risk.ts (pinned to its no-loss replay, GST-1350) is untouched: the value rule lives in lib/review-exclude.ts.Review follow-ups (non-blocking under the crew's floor): make the excerpt's hit rule match
secretValueLine(fixes the Windows keep-command overflow and the omitted value line together), excerpt per chunk to bound memory, and drop/fromVALUE_TOKENruns that look like paths. Docs audit debt: the secret-line excerpts paragraph's "results PRs need this" rationale now reads as history.Gate edits: none detected (8 listed, 4 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none). The three read hunks add a value to name-only fixture lines so they keep testing the keep path.
Refs GST-1967
REVIEW_LOOP: passes=1 blocking_found=2 deferred=0 noted=6 fixed=0 scope=frozen ledgers_read=3 dispatches=10
Approvals
No approvals recorded for branch review-exclusions-handle-big-results-prs.
Plan: exempt: bug fix
Plan check: exempt bug fix