Repository navigation
fix(pr): stop spilling captured review evidence to disk - #201775
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper review Please review the captured-byte stdin transport and its security invariant. The PR includes differential validation on macOS and Linux, and preserves all authority, ancestry, signature, lock, and replay checks. |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThis PR sends captured evidence buffers directly to Git instead of writing temporary hash snapshots. Example: Validate retained baseline evidence containing 268,457,912 captured bytes.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review No introduced correctness or security defect was found. This maintainer-authored PR provides a measured storage-write reduction and has green exact-head CI; the author’s explicit local-validation hold remains. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherNative PR preparation and correction validation capture evidence bytes, compute Git object IDs, and use those identities when reconstructing signed candidates and checking retained review evidence. flowchart LR
A[Retained evidence] --> B[Regular file capture]
B --> C[Captured buffer]
C --> D[Git stdin pipe]
D --> E[Git object identity]
E --> F[Correction validation]
Technical reviewBest possible solution: Use the existing hash owner’s direct buffer transport while preserving exact bytes, Git object semantics, and all existing validation boundaries. Do we have a high-confidence way to reproduce the issue? Current-main source writes every captured hash buffer to a temporary snapshot, directly establishing the storage-write path; supplied parent/head results report matching regression failures and passes, but no target code was executed during this review. Is this the best way to solve the issue? The change is the smallest complete repair within the existing owner: remove redundant disk transport, retain Git hashing and writes, and reuse existing correctness tests plus an opt-in measurement workload. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 18b04f2fd591. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +173, Docs -5, Other -24. Total +144 across 7 files. Added test files: 1. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 19, 2026, 7:10 AM ET / 12:10 UTC (Revision 2). |
|
@clawsweeper re-review The previous review had no open items. The new head consolidates the no-spill assertion into the existing correction-validator integration case (green in 8 seconds, red on the exact parent), and keeps the production-scale benchmark opt-in. Production code is unchanged. Please review the final head. |
|
🦞👀 Re-review progress:
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@clawsweeper re-review The previous final-head request completed as superseded (run 44512201663), but the durable report still names 44246ee. Please review current head 03a9a1d. The older report has zero open items; production code is unchanged, and the regression was consolidated into the existing validator fixture. |
|
🦞👀 Re-review progress:
|
|
@clawsweeper explain Two requests to review head 03a9a1d completed as superseded by a newer review tuple (runs 44512201663 and 44513944268), but the durable review comment still names 44246ee. Please identify the current review/publication state and the supported recovery for this mismatch. No merge has been submitted. |
|
ClawSweeper status:
|
|
@clawsweeper re-review Please review head 03a9a1d with the updated evidence. Exact-head CI is green (44512184419, attempt 2); investigated local failures and passing diagnostic replays are documented in the body. The previous report had zero open items. Production code is unchanged since that report; the no-spill regression now reuses the existing validator fixture. The earlier superseded requests overlapped readiness/body updates. This request follows the completed body update; I will leave those inputs unchanged while the review runs. No merge has been submitted. |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
What Problem This Solves
Preparing and recovering a PR with retained baseline evidence can write gigabytes of temporary data just to verify evidence hashes. Each correction validation spills captured buffers to disk, and replacement recovery repeats that validation several times.
User Impact
Maintainer PR operations stop writing captured evidence to temporary files. In a synthetic 62,000-file repository, Linux/Btrfs storage writes fell 81% per successor validation (333 MB to 64 MB). No user configuration, migration, or public behavior changes.
Why This Change Was Made
baseline-refresh.mjsnow supplies its already-captured buffer directly togit hash-object --no-filters --stdinusing synchronous piped input. Git never reopens an authority pathname. This deletes the temporary directory, exclusive writer, reopened descriptor, unlink, and cleanup machinery (production LOC: −24).The captured-bytes invariant is unchanged.
readRegularstill owns no-follow capture and concurrent-change checks; Git still owns the object ID and conditional-wobject write. Signature verification, expected head/tree/review bindings, merge-base ancestry, retained evidence comparisons, operation/lifetime locks, sweep behavior, and all validation calls are unchanged. No cache or memoization is added. The repeated validator calls run in separate processes; sharing results across them would require state beyond one invocation and additional authority semantics.Earlier #173899 and #186821 used file descriptors after reported stdin stalls, without reproducing the underlying pipe failure. This change explicitly exercises binary/newline-sensitive inputs, post-capture pathname mutation, Git/spawn failures, written Git blobs, and large native validation on macOS Node 26 and Linux Node 24. It does not claim to identify the cause of those historical stalls.
The pipe trades disk I/O for memory transport. Warm validator latency was about 6% higher on Linux in this sample and essentially flat on macOS; peak RSS stayed within 1%. This is a storage-write fix, not a claim of a general latency improvement. Temporary Git index writes remain.
Evidence
The 32 MiB no-spool regression fails on the parent with
EFBIGunder a 1 KiB file-size limit and passes with the fix. The existing full correction-validator integration case now rejects any temporary hash snapshot creation; this also fails on the exact parent and passes in about eight seconds. The opt-in workload uses the real signed baseline/preparation/publication owners, two changed product files, 62,000 synthetic 18 KB files (1.116 GB), and a 128 MiB retained build log across two archives. It compares every hash and the complete validation decision against the parent.Acceptance: zero hash-snapshot bytes, identical object IDs and decisions, and materially fewer kernel storage writes. Baseline controls and five alternating warm base/candidate pairs passed on both platforms.
write_bytes, medianwchar, medianwcharincludes pipe traffic, so it deliberately does not establish the storage improvement. Btrfs cancelled writes were zero. The removed 268.6 MB of kernel writes closely matches the 268.5 MB of hash snapshots; roughly 64 MB of remaining writes include temporary Git indexes. CPU/allocation profiles were collected separately from timing samples; the base's snapshotwriteBuffersamples disappear.The existing replacement-recovery fixture counted seven
validatechildren plus one local preflight (initial attempt: six plus preflight). At this workload, eight passes avoid approximately 2.15 GB of snapshots. Repeated authority checks remain intact.Focused snapshot/baseline tests: 32 passed. Both no-spill regressions fail on the exact parent and pass with the fix. Production-shaped differential validation passed on macOS/APFS and Linux/Btrfs. Two isolated Codex autoreviews found no actionable P0–P2 findings. Final
pnpm check:changed --base 82b682c627ba8passed.Exact-head CI is green: run 44512184419, attempt 2, head
03a9a1d827fb1ebac718ca49f2fe2364c8e13d82. Attempt 1 passed every executed test shard; one shard failed before tests because an Ubuntu package-mirror index had the wrong size. One diagnosed infrastructure retry passed. No code-red rerun or admin exception.The broad local scripts/pr run completed: 89 files (81 passed, 7 failed, 1 skipped); 2,454 tests passed, 11 failed, 30 skipped. Two earlier passing files (32 tests) were reused. Its failures remain recorded:
Native review preserves
tests.result=failand all investigated local failures. ClawSweeper reviewed final head03a9a1d827fb1ebac718ca49f2fe2364c8e13d82with zero findings/open items (review). The local timing failures need follow-up even though exact-head CI is green; their causal introducer is not established. Landing uses the ordinary exact-head native route, without an admin or inherited-failure exception.Existing retained workflow bindings continue to execute their pinned implementation. Normal reviewed workflow succession or new bindings adopt this change; no trust anchors are rewritten.
Reproduce the synthetic differential workload
The directory retains only synthetic fixture/evidence and a generated
measure.pyfor replay on the same absolute paths. The production-scale measurement is opt-in; routine no-spill assertions reuse existing owner tests without adding another full native preparation workflow. Benchmark controls separate initial cold execution from warm alternating samples. No production databases or workspaces are copied.The additional test code provides the full validator regression and reproducible measurement; normal runtime code shrinks. Open #199006 also touches the owner but changes workflow-equivalence admission, not this transport.