Repository navigation
v1.91.42.0 fix(cso): lift the snapshot file-count ceiling, bound report lists, actionable capacity errors - #3078
Merged
Merged
Conversation
…ty errors /cso refused any repository with more than about 3,100 tracked files before an audit started: the snapshot manifest was pretty-printed and both its writer and every reader capped it at the shared 1 MiB private-state limit (#3068, manifest half of #2993). - snapshot.json is written compactly and capped by SNAPSHOT_MANIFEST_LIMIT (16 MiB), a constant local to the snapshot module. - readJson takes a per-artifact cap; readSnapshotManifest is the only reader of snapshot.json and passes the snapshot cap through recovery and the private-file size check. MAX_STATE_FILE and MAX_OUTPUT stay 1 MiB. - The manifest-cap and 64 MiB source-cap errors name the bound cap, the measured value, what counts toward it, the next step and #2993. A single file that would cross 64 MiB now hits the same message before it is read. - Older pretty-printed manifests still load (recheck, inspect). Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Lifting the manifest cap alone moved the failure into the audit: report.json listed one transformation per transformed entry plus one coverage gap or exclusion per omitted entry (1.97 MB for 5,000 nested paths), and sensitive-evidence.json grew per scanner hit (1.68 MB), both under the 1 MiB private-state cap that saveReport and the start stdout share. - boundedList (state.ts) keeps the leading entries that fit a byte budget, measured as the pretty-printed JSON they add at their nesting depth, and ends the list with one summary carrying the omitted count. - report.json snapshot lists share one 256 KiB budget (gaps 128 KiB, transformations 96 KiB, exclusions 32 KiB); coverage counts and status are computed before trimming, so they stay exact. - sensitive-evidence.json keeps 512 KiB of per-file evidence plus an omitted-count record. - Snapshot coverage and publicSnapshotPath no longer scan the whole manifest per entry. Test: 5,000 long nested paths, mostly excluded or withheld, 999 files with scanner hits, driven through start, inspect, submit, finish and recheck. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
With the manifest cap lifted, the next file-count wall was the shared 1 MiB process-output cap on Git's path listings: ls-files/ls-tree --name-only failed at roughly 15-20k files (23,749-file grafana/grafana fails there) and the comparison-base ls-tree near 8-10k. runProcess lets raw callers, whose output is never printed or persisted, opt in to up to 16 MiB; git() forwards an optional cap, and the four snapshot listings pass SNAPSHOT_MANIFEST_LIMIT. Every other caller keeps the MAX_OUTPUT clamp. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
docs/troubleshooting.md#cso-capacity covers the snapshot-list cap, the 64 MiB source cap and the tracked-symlink refusal. TODOS.md records the symlink design call, the #2993 aggregate cap, the full-manifest inspect output and repair-bundle transformations. 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 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. |
…le-ceiling Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md # TODOS.md # VERSION # agents-digest/gstack-AGENTS.md # package.json
BenjaminDSmithy
added a commit
to BenjaminDSmithy/gstack
that referenced
this pull request
Oct 8, 2026
Upstream moved to 1.91.42.0 (garrytan#3074, garrytan#3076, garrytan#3078), above this branch's 1.91.35.0, and the release queue holds 1.91.43.0 to 1.91.47.0, so the release moves to 1.91.48.0 (PATCH, from bin/gstack-next-version: bumped past claimed 1.91.47.0). - CHANGELOG.md: main's file byte-identical from line 44 down, with this branch's entry on top, re-headed [1.91.48.0]. - VERSION, package.json and the agents digest: main's side, then bin/gstack-version-bump write --version 1.91.48.0 --regen-digest. bin/gstack-hook-check on the merged tree: 9 ok, rc 0. Focused set (the hook-check, doctor, session-update, autoplan, version and digest files): 609 pass, 6 skip, 0 fail across 16 files. Co-Authored-By: Claude Opus 5.5 <[email protected]>
levi85
pushed a commit
to levi85/gstack
that referenced
this pull request
Oct 14, 2026
…rt lists, actionable capacity errors (garrytan#3078) * fix(cso): give snapshot.json its own 16 MiB cap and actionable capacity errors /cso refused any repository with more than about 3,100 tracked files before an audit started: the snapshot manifest was pretty-printed and both its writer and every reader capped it at the shared 1 MiB private-state limit (garrytan#3068, manifest half of garrytan#2993). - snapshot.json is written compactly and capped by SNAPSHOT_MANIFEST_LIMIT (16 MiB), a constant local to the snapshot module. - readJson takes a per-artifact cap; readSnapshotManifest is the only reader of snapshot.json and passes the snapshot cap through recovery and the private-file size check. MAX_STATE_FILE and MAX_OUTPUT stay 1 MiB. - The manifest-cap and 64 MiB source-cap errors name the bound cap, the measured value, what counts toward it, the next step and garrytan#2993. A single file that would cross 64 MiB now hits the same message before it is read. - Older pretty-printed manifests still load (recheck, inspect). Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(cso): bound per-entry report and evidence lists with omitted counts Lifting the manifest cap alone moved the failure into the audit: report.json listed one transformation per transformed entry plus one coverage gap or exclusion per omitted entry (1.97 MB for 5,000 nested paths), and sensitive-evidence.json grew per scanner hit (1.68 MB), both under the 1 MiB private-state cap that saveReport and the start stdout share. - boundedList (state.ts) keeps the leading entries that fit a byte budget, measured as the pretty-printed JSON they add at their nesting depth, and ends the list with one summary carrying the omitted count. - report.json snapshot lists share one 256 KiB budget (gaps 128 KiB, transformations 96 KiB, exclusions 32 KiB); coverage counts and status are computed before trimming, so they stay exact. - sensitive-evidence.json keeps 512 KiB of per-file evidence plus an omitted-count record. - Snapshot coverage and publicSnapshotPath no longer scan the whole manifest per entry. Test: 5,000 long nested paths, mostly excluded or withheld, 999 files with scanner hits, driven through start, inspect, submit, finish and recheck. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(cso): admit Git path listings above 1 MiB during snapshot capture With the manifest cap lifted, the next file-count wall was the shared 1 MiB process-output cap on Git's path listings: ls-files/ls-tree --name-only failed at roughly 15-20k files (23,749-file grafana/grafana fails there) and the comparison-base ls-tree near 8-10k. runProcess lets raw callers, whose output is never printed or persisted, opt in to up to 16 MiB; git() forwards an optional cap, and the four snapshot listings pass SNAPSHOT_MANIFEST_LIMIT. Every other caller keeps the MAX_OUTPUT clamp. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs(cso): explain the capacity refusals and file the follow-ups docs/troubleshooting.md#cso-capacity covers the snapshot-list cap, the 64 MiB source cap and the tracked-symlink refusal. TODOS.md records the symlink design call, the garrytan#2993 aggregate cap, the full-manifest inspect output and repair-bundle transformations. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * chore(release): v1.91.42.0 /cso lifts its file-count ceiling 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.
/cso refused any repository with more than about 3,100 files before an audit started ("Snapshot manifest exceeds the 1 MiB private-state admission limit"). This PR lifts that ceiling to about 50,000 files. It does not make /cso work on every real-size repository: repositories with more than 64 MiB of tracked source, or with any tracked symlink, are still refused. The error now names the limit that applied and says what to do next.
What shipped
The snapshot list gets its own cap
snapshot.jsonis written as compact JSON and capped at 16 MiB (SNAPSHOT_MANIFEST_LIMIT, local tolib/cso/snapshot.ts).readJsontakes a per-artifact cap.readSnapshotManifest(dir)is the only reader ofsnapshot.json: all 13 sites incli.tsuse it, and a source test fails if a direct read comes back. Every other private artifact keepsMAX_STATE_FILEat 1 MiB, andMAX_OUTPUTandcontracts.tsare unchanged.The failure doesn't just move into the audit
boundedList(lib/cso/state.ts) keeps the first entries that fit a byte budget, measured as the pretty-printed JSON they add, and ends the list with one omitted-count item. It bounds these lists:report.json: the snapshot coverage gaps, exclusions and source transformations, under one 256 KiB budget split 128/96/32 KiB. Counts and status are computed before trimming, so they stay exact.sensitive-evidence.json: 512 KiB of evidence plus an omitted-count record.ls-filesandls-tree) were clamped at the shared 1 MiB process-output cap. That was the next wall: roughly 11k to 23k files depending on path length, and 7k to 10k with--diff/--base.runProcessnow lets raw callers opt in to up to 16 MiB; non-raw callers keep theMAX_OUTPUTclamp.publicSnapshotPathno longer scan the whole manifest for every entry (that was O(n²)).Actionable capacity errors
docs/troubleshooting.md#cso-capacitycovers both caps and the symlink refusal.Measured on public repositories
Shallow clones measured 2026-10-08 with
start --offline, before and after this PR:Three of eight repositories now pass with no changes. Five are refused for tracked symlinks, mostly test fixtures. That fail-closed rule predates this PR and is now the most common blocker. Treating symlinks as unread exclusions is a security design call, recorded in TODOS.md. With symlinks removed, 6 of 8 pass, and only the two repositories over 20k files hit the 64 MiB cap. #2993's aggregate cap stays open, with a stream-hash follow-up in TODOS.md.
Validation
Revision
d8b1c01ff0e028ea1bcdbbaf24af7b1ca41c2a27, merged with main at v1.91.36.0. The full suite ran onb6d006d0f; the only later change is the release-version bump, in 5 metadata files.Reproduced on main first. At 2,500 files the manifest is 829,282 B and the run passes; 4,000 and 5,000 files are refused with /cso refuses the repo before any audit runs #3068's message. With only the two caps raised, a secret-heavy 5,000-file repository wrote a 1,968,861 B
report.json, a 1,683,003 Bsensitive-evidence.jsonand 1.97 MB of stdout, all over 1 MiB.New
test/cso-file-ceiling.test.ts(10 tests). It drives a 5,000-file synthetic repository with long nested paths, mostly excluded or withheld and with 999 files carrying scanner hits, through start, inspect, submit, finish (the finalsaveReport) and recheck, and asserts every omitted-count line. It also covers:snapshot.jsonloading in recheck;MAX_OUTPUTstill 1 MiB;snapshot.jsonreads;The listing tests fail on the pre-fix code.
Focused CSO suites: 361 pass, 0 fail across 18 files, rerun after the process change. After the merge with main: 99 pass, 0 fail.
Cheap checks:
format:cso:check,typecheckandtypecheck:test(865 known diagnostics, none new) are clean.gen:skill-docs --dry-runreports everything fresh.bun run eval:bg:pr(local backend): selected 0 of 243 tests, cost $0,EXIT=0. No skill prompt changed.cso-diff-mode,cso-full-auditandcso-infra-scopeare deferred to broad coverage.Final acceptance:
bun run test:ubicloud(the free suite on a standard-16 Ubicloud VM) passed on all 17 shards: 26,563 tests in 1,118 files, 26,475 pass, 88 skip, 0 fail.Not verified: Windows and macOS runs of the new tests. The change is platform-neutral TypeScript, and the new test assumes
/usr/bin/gitand/bin/sh, like the existing CSO CLI tests.Fixes #3068
Refs #2993
Thanks to @almoatasemm for the report (#3068) and @saanjay for the capacity diagnosis of the manifest, reader and source caps (#2993).