Repository navigation
fix(tooling): retain compiler artifacts when cleanup recording fails - #160176
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 28, 2026, 12:32 PM ET / 16:32 UTC (Revision 14). ClawSweeper reviewWhat this changesThe branch makes the shared build-artifact owner retain its lock or child claim when recording uncertain compiler cleanup fails, and adds process-based refusal and recovery tests. Merge readiness⛔ Blocked before merge - 1 item remains Current main still releases artifact custody when recording uncertain cleanup fails. This PR has a distinct fix with process-level refusal and recovery evidence. The latest release predates the artifact owner. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw build, lint, and source-update commands share ownership of compiler outputs in a checkout. That owner admits writers, tracks incomplete child cleanup, and releases or retains the lock before later writes and update activation. flowchart LR
A[Build, lint, or update] --> B[Artifact ownership]
B --> C[Compiler work]
C --> D{Cleanup verified?}
D -- Yes --> E[Release lock]
D -- No --> F[Retain lock or child claim]
E --> G[Later writer admitted]
F --> H[Later writer refused]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +80, Other +29. Total +109 across 2 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep one shared artifact owner and the existing on-disk lock format; require documented recovery only after all associated compiler work has settled. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source exposes the marker-write failure path that can release custody; the submitted process proof reports baseline failure and candidate recovery, although this read-only review did not rerun it. Is this the best way to solve the issue? Yes. Retaining uncertainty in the existing shared owner is the narrowest repair, and the diff keeps the serialized lock and marker formats intact. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 648fd69cd307. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (13 earlier review cycles; latest 8 shown)
|
dc493d6 to
6f5f4fa
Compare
2f2a97b to
6e3fb42
Compare
6e3fb42 to
5cbe37b
Compare
|
@clawsweeper re-review Exact head: |
|
🦞👀 Re-review progress:
|
5cbe37b to
3187a78
Compare
|
@clawsweeper re-review Please review exact head |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Exact head |
|
🦞👀 Re-review progress:
|
46e5f79 to
efe4f51
Compare
|
@clawsweeper re-review Please review exact head |
|
🦞👀 Re-review progress:
|
efe4f51 to
1d0c3fa
Compare
|
@clawsweeper re-review Exact head |
|
🦞👀 Re-review progress:
|
…penclaw#160176) Latch uncertain compiler cleanup at the shared artifact owner before marker I/O. Retain the existing owner/child claim when recording fails, preserve both errors and refuse a later inherited generation until verified recovery. Validation: 49 focused ownership/preflight cases, formatting, script types and typed lint passed under a 7 GiB process-tree limit without swap. Direct and nested ENOSPC cases deny later writes before mutation; the published v2026.9.6 updater environment also preserves serving artifacts through refusal and recovery. Claim formats and readers are unchanged.
Related: #160010
What Problem This Solves
A build, lint, or update command could release its artifact owner after uncertain compiler cleanup if writing the uncertainty marker failed or a nested CLI caught the error. A later writer could then enter outputs whose previous compiler users were not known to have exited.
Result
The shared artifact owner latches uncertainty before filesystem I/O, retains its existing owner/child claim when marker writing fails, and refuses another inherited generation. Both the original cleanup error and marker-write error remain visible. Operators use the existing artifact-owner recovery procedure before a later build or update proceeds.
This is an independent main-targeted repair. It includes the inherited-error catch previously carried by #160152, without compiler activation or platform policy. The latch is process-local: existing
owner.json,child-<pid>, andunjoinednames, payloads, readers and recovery contract are unchanged. There is no stored-data migration.Validation
Head:
1d0c3fa3f96c330ee044f59b66eca4c2ffd1d1dd; base:4902e4ae49a669702b92a1df3aeb01b167ec6715. Both changed files and the aggregate patch are identical to the prior reviewedefe4f51c71444b870d970b35071275895b0c53f5head; all three commits remain signed. This base includes the landed artifact-preflight fence fixture repair. Refreshed exact-head CI and review are complete; both required CI gate surfaces pass.The final 25-line test addition extends both direct and nested ENOSPC cases with a separate later writer. It checks refusal before artifact mutation, retained owner bytes, then success after all fixture processes have exited and the fixture-owned fence is removed. No detached compiler is started in these synthetic cases. The existing deadlines and assertions remain unchanged. Independent P0–P2 review of this addition is clean; production bytes are unchanged from the prior reviewed owner.
Prior-head remote proof, using a 7 GiB kernel process-tree cap and no swap for each validation phase:
008776904b52278e1ea8bbb90be96b31cc38c353bdd5a07585b4a61bbcbe985a. The prior committed tree had that full fingerprint. This rebase preserves the two changed files while incorporating subsequent main commits.Published updater compatibility cell
The same worker loaded the actual published v2026.9.6
resolveBuildEnvproducer from commit eb377ac, verifying Git blobc41c56b94a649aed1ff69b680f5574f77f6c4208before stripping types. Its two relative imports resolved to real candidate modules; no ownership or updater-preflight helper was mocked.For each direct/nested ENOSPC case, a fresh faulting child exited and retained the owner without a durable uncertainty marker. The published producer supplied its real update/cache environment to candidate
runBuildAllStepsfrom a distinct candidate directory. Candidate admission refused before the build callback or output/cache mutation. After joining every fixture writer and removing only that fixture's fence, the identical candidate invocation ran exactly once and released ownership. The pre-existing serving artifact's bytes, inode and mtime remained unchanged.Redacted terminal result (3.999 s; 7 GiB; swap disabled):
{"scope":"published build-env producer x candidate admission","rows":[{"nested":false,"refusedBeforeWrite":true,"ownerPreserved":true,"recoveryWrites":1,"servingArtifactUnchanged":true},{"nested":true,"refusedBeforeWrite":true,"ownerPreserved":true,"recoveryWrites":1,"servingArtifactUnchanged":true}]}This is executable proof of the shipped environment producer crossing the changed candidate admission boundary. It is not a full installed-CLI rollout or a serving-Gateway health test. Published preflight ordering runs the candidate build before preparation/import; failure returns before the later activation callback. Current candidate
build-all.mtsinvokes installed-artifact admission before build steps. The pinned@openclaw/fs-safe0.21.1 source confirms fail-closed admission does not reclaim this retained owner merely because its PID exited.Review disposition
The exact-head review, reviewed at 2026-09-28T16:32:02.319Z, covers
1d0c3fa3f96c330ee044f59b66eca4c2ffd1d1dd. It finds no source/security defect, accepts the later-writer and published-producer terminal proof, and judges the shared owner the best repair point.Disposition of its generated Add data-model compatibility proof checkbox: the proof is supplied above. No migration is added because the diff changes process-local error state and claim retention, not serialization:
owner.jsonadmission/reading is unchanged;child-<pid>still containsAwaiting child completion.\n;unjoinedstill containsChild cleanup was not verified.\n; their names and readers are unchanged. The published v2026.9.6 environment producer is exercised against candidate admission in both failure modes and after recovery. The review itself explicitly confirms there is no stored-data contract change and accepts that compatibility cell. Its path-basedunknown-data-model-changeflag does not identify an additional format or migration obligation. No full installed-CLI or live Gateway availability claim is made. The earlier artifact-preflight prerequisite is now merged and included; the exact-head review confirms that blocker is resolved. The generated data-model checkbox above is its only remaining listed item and is dispositioned by this unchanged serialization and executable compatibility evidence.Integrated CI attempt 1 stopped on the inherited progress-widget fixture in UI E2E job 108926260610. The initial spinner failed before the scope transition; the tested merge, prior base/head and inspected main had identical relevant widget/renderer/mock/test blobs. Main independently repaired that canonical seed and qualified a delayed-descriptor interleaving in d6aa710c509, now included in this base. Our two sibling fixture repairs remain separate in #160463. The historical CI request ordering was not recovered, and this cancelled attempt is not passing proof.
The base contains the independently landed fixture repairs #160412 and #160407. Prior CI failures in those unrelated fixtures are not attributed to this owner change.
Production/tooling +41/-12 (net +29) supplies failure-retention state and the inherited-error boundary; tests +80/-0. Two files only; no new serialized format, schema, dependency, compiler invocation or platform restriction.
Inherited CI failure and repaired prerequisite
CI run 36427836832 failed the unchanged artifact-preflight available-completion fixture at its 120-second timeout; eight other cases in that file passed. The test is byte-identical at this PR's base/head, and the retention diff does not change its successful direct-acquisition path. The fixture reaches real native-service discovery before its synthetic build step, unlike the already isolated sibling build-all tests. Separate test-only repair #160515 keeps actual artifact admission/staging and all existing assertions/timeouts; 145 owner/fence tests and formatting, script-test types and typed lint pass under 7 GiB with swap disabled. That prerequisite is now merged as
d2bef8abd389d66731cfe5ed10f21bf5a525191dand included in this base; this unchanged retention patch is running fresh exact-head CI. No retention production change was made to mask the fixture failure.Current CI disposition
Run 36448338726, attempt 1 failed UI E2E shard 7/9: the camera-permission case timed out before
talk.client.create, and the delayed/btwrail case timed out then retired its fork after incomplete cleanup. Subsequent companion cases are a cascade. The complete UI tree is identical between this PR's base and head (8ec2c57d06f3c17b381bb53c377a91d866e63753), and both failing owners remain unchanged on inspected main. The same delayed-rail/cleanup failure independently recurs in #160265 and #160433. Public failure captures show a live connected browser with no crash/disconnect; the precise first-event race remains unproven.After inspecting source, sibling evidence and public artifacts, one diagnostic failed-jobs rerun was requested on this unchanged head. It also resumes the cancelled lanes; no successful jobs were intentionally rerun. The held-module waiter lifecycle and action-readiness follow-up are recorded in #160010. No UI code, assertions or timeout changes are part of this PR, and no UI stability claim is made.
Final CI attempt 2 passes on this unchanged head, including the two resumed Node lanes and UI E2E. Both the required check-run gate and commit-status gate are successful. This supplies merge qualification; it does not resolve the separate UI waiter/action-readiness follow-up.