Repository navigation
v1.91.112.0 fix(cso): --paths scopes an audit and reports every skipped path (no more hand-trimmed copies) - #3230
Merged
Merged
Conversation
A repo over the 64 MiB cap was audited on hand-trimmed copies, so the verdict read assessed over partial input. --paths records out-of-scope files unread as snapshot-inputs gaps (coverage partial), keeps --diff fail-closed, and carries the scope through submit, recheck and replay. Field list 2 item 12; related #2993. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
Contributor
E2E Evals: ✅ PASS0 executed, 0 reused rule/judge records | 0 manual accepted (unscored; no score-cache credit) | $0 rule/judge cost | reconcile exit: 0 Profile: pr / mode Rule and judge shards
Fail-closed reconciliationSliced lane: planner → duration-packed executors → fail-closed report. Behavior cases run a pre-registered 3-trial panel (PASS at 2/3 with no contract violation); a PASS 2/3 is shown with its failed trial, never as a clean pass. Reused results retain their original provenance and expiry. |
- Comparison mode hashes out-of-scope files in bounded 1 MiB chunks and re-hashes them in both stability passes instead of reading whole files. - --diff --paths refuses every changed path outside the scope except host dependency trees, including credential and agent configuration. - --paths prefixes that report persistence would rewrite are refused. - In-scope gaps sort first; out-of-scope files and deletions share the skipped tier and are dropped from transformations. - History is limited to --paths, reported as partial, and history queries on out-of-scope paths are refused. - A --diff recheck refused for out-of-scope changes says to start a new audit. 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>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ed path (#3230) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…audit Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md # VERSION # agents-digest/gstack-AGENTS.md # package.json
…audit Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md # VERSION # agents-digest/gstack-AGENTS.md # package.json
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.
Fast-track fix from field list 2, item 12 (wrong security result). GBRA-120 reviewed gbrain security fix gbrain#6853 on a hand-trimmed copy of src/core and src/mcp, because gbrain is over /cso's 64 MiB source admission cap and the cap message said "run /cso on a smaller checkout". cso then treated the trimmed copy as the whole repository: snapshot-inputs coverage read
assessed, and the verdict never said what was left out. So the tool's own advice produced a clean-looking verdict over partial input.What changes
gstack-cso start --paths <prefix,prefix,...>lets cso narrow itself and disclose what it left out:Every listed file outside the prefixes gets a manifest entry recorded from
lstatonly (originalHash: not-read, transformationwithheld: outside the --paths audit scope, neverexcluded:). It isn't copied, assessed, or counted toward the 64 MiB cap. snapshot-inputs coverage becomespartialwith one bounded gap per skipped path, and the evidence line names the prefixes and the skipped count. The race checks, the special-file rejection and the manifest validator are unchanged.Validation rejects empty,
.or..segments, a leading-or/, backslashes and control characters, more than 32 prefixes or 1024 characters, and a prefix that matches no source file.--difffails closed. A changed, added or deleted path outside--pathsrefuses withINVALID_ARGUMENTand names those paths, including credential and agent configuration such as.npmrc,bunfig.tomland.claude/. Only host dependency trees (node_modules,vendor/bundleand similar), which are never read with or without--paths, are exempt. To support this, out-of-scope files are hashed in bounded 1 MiB chunks for changed-path detection only when a comparison base is set; without a base, no out-of-scope payload is ever opened. A refused--diffrecheck says to start a new audit.Git history is limited to the
--pathsprefixes, history-inputs coverage readspartialwith a gap naming the limit, andhistory RUN PATHrefuses an out-of-scope path. In-scope gaps are listed before skipped paths so the bounded list never hides them, and out-of-scope deletions are reported as skipped, not as in-scope deletions.A
--pathsprefix that report persistence would rewrite (redaction or the CI run-id rewrite) is refused, so a run can't reject its own in-scope findings.Findings and rechecks stay in scope.
submitrefuses a finding whose root cause is outside--paths. Recheck rebuilds--pathsfrom the original policy, and recheck evidence that cites a withheld path is refused. Replay with--sourcerereads the scope from the run's report, where before it would have failed every scoped bundle's input-hash check.Only
sourceCapMessagenow points to--paths(and warns against hand-trimmed copies). The manifest cap (16 MiB) and the entry limit still count one entry per file, so their guidance is unchanged. A gbrain-sized repo (11,570 tracked files) is well under both./cso skill: an Arguments row for
--paths, plus a Phase 13 rule that a--pathsrun states partial snapshot-inputs coverage and summarizes the skipped paths. Four sentences were tightened and one duplicate was dropped to stay under the parity skeleton cap.docs/troubleshooting.md: the cso-capacity entry now points to--pathsfor the source cap instead of "a smaller checkout".Not in this PR: automatic scoping to the diff plus sibling call sites (the rest of item 12) is in the field-list-2 autoplan, behind a measurement spike.
Known limits: under
--paths, the original-source hash ignores content changes outside the scope (replay still runs only the in-scope snapshot); out-of-scope files are hashed with no byte cap, only the time budget;--pathswith--comprehensiveruns on a trimmed tree; a recheck refuses if the audited directory was renamed.Tests
New
test/cso-audit-paths.test.ts(9 cases) covers: which cap advice each failure prints; a repo over the cap admitted with--paths, with exact withheld entries, gaps, partial snapshot and history coverage, out-of-scope history refusal and out-of-scope deletions; in-scope gaps ordered first; bounded-chunk hashing with a comparison base (mutation-checked); no out-of-scope payload opened without a base; invalid and redaction-altered values refused with no run left behind; the--diffrefusal in both directions, including.npmrcandAGENTS.md(mutation-checked); recheck carrying--paths, including the--diffrecheck refusal; and replay keeping the scope. At fbb96db: focused cso suites 169 pass, troubleshooting-anchors, parity and gen-skill-docs 656 pass, typecheck andformat:cso:checkclean.Review: /review ran three rounds with adversarial passes; every finding above Low is fixed. The final adversarial pass (GPT, 66 launcher probes at dcf955d) found no P0/P1 and no new P2/P3. The remaining items are under Known limits.
E2E gate: 0 paid cases selected and run ($0.00); the planner deferred the 14 /cso behavior cases and 2 changed prompt files to scheduled/release runs, so this PR is not eval-verified.
Field list: GBRA-40's field list 2 plus the GBRA-108 addendum (item 12). Related: #2993.