fix(live-proof): keep review module caches writable - #1220
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 4:36 AM ET / 08:36 UTC. ClawSweeper reviewWhat this changesThe PR gives each review live-proof child a scratch-local Go module cache and appends Go’s writable-module-cache flag while retaining inherited Go flags. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readinessNo blocking correctness or security defect was found. This bounded fix has credible after-fix terminal evidence and focused coverage, but remains open for normal maintainer review because it is member-authored. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherLive-proof execution runs a reviewed repository command in a private scratch profile. The child environment determines where Go writes its module cache before the scratch profile is removed after proof execution. flowchart LR
A[Review job] --> B[Live-proof plan]
B --> C[Private scratch profile]
C --> D[Child environment]
D --> E[Go module cache]
E --> F[Proof command]
F --> G[Scratch cleanup]
Before merge
Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Land the constrained child-environment fix after the remaining required checks finish, keeping Go cache handling localized to the review live-proof boundary. Do we have a high-confidence way to reproduce the issue? Yes—current source gives a focused path: run a Go-backed live proof with its scratch profile as HOME, then remove that profile after module-cache population; the PR body also records an after-fix real-Go probe. Is this the best way to solve the issue? Yes—the change repairs the cache state at the child-environment producer rather than broadening cleanup permissions, retries, or process lifecycle behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 56591f8ebaf3. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Flagging production impact in case it helps prioritize this draft. This scratch cleanup is failing live on The The review itself succeeded ( Your |
0664e36 to
04d30dc
Compare
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper re-review Please review exact head |
|
🦞🧹 I asked ClawSweeper to review this item again. |
04d30dc to
a6d8945
Compare
|
@clawsweeper re-review Please review exact head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
a6d8945 to
e5c3456
Compare
|
@clawsweeper re-review Please review exact head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
What Problem This Solves
Review live-proof jobs can finish successfully and then fail while removing their private
HOMEbecause Go creates read-only module-cache directories by default. The cleanup error masks the successful review, requeues the item, and repeats the review work.Why This Change Was Made
The private live-proof child environment now pins
GOMODCACHEunder its scratch profile and composes inherited flags with[environment.GOFLAGS, "-modcacherw"].filter(Boolean).join(" "). Appending preserves existing flags and makes the final value authoritative when an inherited environment contains-modcacherw=false.The environment composition lives in one focused producer helper so the exact inherited and replacement values can be tested without adding cleanup behavior.
This fixes the state at its producer. It does not add permission recovery, filesystem traversal, cleanup retries, ignored cleanup failures, or process/worktree lifecycle changes.
User Impact
Successful Go-backed review proofs no longer create read-only module-cache directories under the private scratch profile, so ordinary recursive cleanup can complete without turning a successful review into a failed and requeued run.
OpenClaw Bay Impact
Bay is unaffected. Queue state, durable records, publication payloads, comments, dashboard contracts, and cleanup ownership are unchanged.
Documentation Impact
Reviewed the live-proof documentation and contributor workflow. No documentation update is needed because commands, output, flags, and operator workflow are unchanged.
Evidence
Exact head:
e5c34566436448ad33dba6e0499f173ec8e39e55origin/main.node_modules/.bin/tsc -p tsconfig.jsonenv -u TMUX -u TMUX_PANE TMUX_TMPDIR=<isolated> node --test test/live-proof-review-environment.test.ts- 2 passedtest/live-proof.test.ts,test/review-blob-hydration.test.ts, andtest/live-proof-review-environment.test.ts- 62 passedoxfmt, type-awareoxlint, andgit diff --check0555; inherited-trimpath -modcacherw=falsefollowed by-modcacherwproduced mode0755; recursive removal succeededcodex review --base origin/main- no introduced defectThe linked worktree intentionally shares
node_modules, so repository-level pnpm wrappers attempt to purge that symlink. Their focused exact-head constituents ran directly. Hosted CI provides the clean-install full-check proof.Real Behavior Proof
executeReviewLiveProofschild-environment construction and the real static-plan execution path.GOFLAGS=-trimpath -modcacherw=falseand a sharedGOMODCACHE.go mod downloadruns against separate default and appended-flag caches.GOFLAGS=-trimpath -modcacherw=false -modcacherw, replaces the shared module-cache path with its scratch-local cache, and the live-proof integration test completes. The real Go cache changes from mode0555by default to0755with the appended flag and is recursively removable.default=555 writable=755andwritable_cleanup=removed.Prior Review Findings
This replaces the previous broad lifecycle rewrite entirely. The reviewed
lstat/chmodrace, detached-descendant concern, permission-recovery traversal, and cleanup retry behavior are absent from this head. The narrow producer fix leaves the existing cleanup and process ownership model untouched.A pre-commit review also reproduced the separate existing-server tmux environment limitation. That is not accepted into this PR: fixing it requires the previously rejected process/socket lifecycle expansion, while the affected exact-review workflow runs the proof in a fresh hosted job. This PR deliberately keeps the reviewed producer-only scope.
Diff
+6/-0+18/-1The production delta creates one canonical, directly testable Go-environment producer and applies it at the existing child boundary.