Repository navigation
fix: allow ratchet checks to read large Git baselines - #164743
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
|
Codex review: needs maintainer review before merge. Reviewed October 3, 2026, 11:37 PM ET / October 4, 2026, 03:37 UTC. ClawSweeper reviewWhat this changesThe PR lets CI ratchet checks read large committed and staged baselines by applying the existing finite Git output limit and enlarging an existing snapshot regression. Merge readiness✅ Ready for maintainer review This PR remains necessary: fetched main and the latest release still use the default buffer for baseline reads. The focused repair preserves enforcement, and no actionable patch defect was found. Priority: P1 Review scores
Verification
How this fits togetherRatchet checks compare repository baselines with current or staged files to prevent new policy violations. Their shared Git reader supplies committed and staged baseline text to the existing parsers and enforcement rules. flowchart TD
A[Committed baseline] --> C[Shared Git reader]
B[Staged baseline] --> C
C --> D[Bounded text output]
D --> E[Baseline parser]
F[Current source inventory] --> G[Policy comparison]
E --> G
G --> H[Pass or actionable violations]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +1, Other +1. Total +2 across 2 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep baseline transport bounded at the existing shared limit while preserving exact-factory and shrink-only enforcement. Do we have a high-confidence way to reproduce the issue? Yes: current-main source routes a verified 1,675,312-byte baseline through a subprocess reader without an explicit buffer limit, and the supplied report records ENOBUFS through the real CLI. This read-only review did not execute the failing command. Is this the best way to solve the issue? Yes: applying the existing finite limit at the shared reader fixes committed and staged reads without changing baseline policy or adding a competing implementation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d0c59630c5a6. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Fixed: ratchet checks can read large staged and committed baselines without overflowing the Git output buffer. |
Document the existing auth quota fixture isolation, and exercise real node discovery and capability selection through the Gateway RPC fixture. Prune four obsolete mock allowances without expanding the baseline. The exact failing mock-export guard, all 65 auth cases and 28 node cases, changed checks, deslop, and independent review passed. Auth and node test files took 37.91s and 30.43s wall. Reuse the upstream large-baseline reader fix from #164743.
Ratchet checks can read large staged and committed baselines while preserving existing baseline enforcement. Fixes openclaw#164741.
Document the existing auth quota fixture isolation, and exercise real node discovery and capability selection through the Gateway RPC fixture. Prune four obsolete mock allowances without expanding the baseline. The exact failing mock-export guard, all 65 auth cases and 28 node cases, changed checks, deslop, and independent review passed. Auth and node test files took 37.91s and 30.43s wall. Reuse the upstream large-baseline reader fix from openclaw#164743.
Ratchet checks can read large staged and committed baselines while preserving existing baseline enforcement. Fixes openclaw#164741. (cherry picked from commit 58310ca)
Ratchet checks can read large staged and committed baselines while preserving existing baseline enforcement. Fixes openclaw#164741. (cherry picked from commit 58310ca) (cherry picked from commit e544e57) Co-authored-by: RomneyDa <[email protected]>
Closes #164741
What Problem This Solves
Fixes the baseline-ratchet CI lane failing with
spawnSync git ENOBUFSwhen the mock-export ledger exceeds Node's default 1 MiB subprocess output buffer. The committed ledger at comparison base301a040is 1,675,312 bytes, so unrelated pull requests fail before the check can inspect mock factories.User Impact
CI can read large committed and staged baseline files and continue enforcing the existing rules. There is no runtime or configuration change. The exact-factory comparison, shrink-only policy, malformed-input rejection, and missing-path behavior remain intact; no baseline entry or exception is added.
Why This Change Was Made
The shared Git text reader now uses the same finite 256 MiB output bound already used by its sibling Git readers. This fixes both reference and index reads at their existing owner without introducing a second reader or an unbounded allocation policy.
The existing real-Git snapshot test now uses a baseline larger than 1 MiB. Its distinct trailing values still prove that worktree, index, and committed-reference reads select the correct snapshot, and its missing-path control remains unchanged. No additional test fixture lifecycle or test case was added.
Evidence
On an isolated Cloud Mac with Node 24.21.0 and locked pnpm 12.5.1 dependencies, against base
b72a95e3f75cb6143847265fe83cc2362b57eea2:ENOBUFSon the original reader: 11 passed, 1 failed, 2.64 seconds wall time.pnpm test test/scripts/shrink-ratchet.test.ts test/scripts/check-test-mock-exports.test.ts --maxWorkers=1passes all 14 tests after the repair in 2.21 seconds wall time. This is the combined two-file duration; no additional test case or fixture lifecycle is added.pnpm check:test-mock-exports --base 301a040200d10e65813c434a57364c5eb79e7b97command now reads the ledger and reaches enforcement. It still exits 1 for three existing incomplete mock factories insrc/agents/auth-profiles/usage.test.tsandsrc/agents/bash-tools.exec-host-node.integration.test.ts. Those files, the ledger, and the scanner are unchanged by this PR. This is proof that the buffer failure is repaired, not an all-green ratchet claim.The same repaired scanner also reports those identical three policy violations when invoked through its existing
main(root, argv)entry point against a clean, untouchedb72a95e3worktree. This is repaired-tool/baseline-data evidence, distinct from the original CLI reproduction that stops earlier at ENOBUFS.Exact-head CI run 37174459227 completed with 33 successful and 26 skipped jobs. The ratchet job reports only the same three existing policy violations, and the CI aggregate reports that failed job. The other selected test, type, lint, structural, and security jobs passed. ClawSweeper awarded Platinum to head
0d89862b2d0891ef114eb756d5a614df6cd23613with no findings. The separate mock-policy violations remain outside this buffer repair; this is not an all-green CI claim.