Repository navigation
fix(update): preserve preparation lock ownership - #207139
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: passed. What this changesThis PR preserves preparation-lock ownership through cleanup and recovery, while using process-birth identity to recover locks after PID reuse. Example: An update remains alive after its 45-minute preparation budget.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR addresses a current update-lock defect, resolves the prior PID-reuse finding, and introduces no actionable correctness finding; exact-head CI remains pending. Reviewed head: Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe shared update store arbitrates CLI, Gateway, and early-release recovery preparation; the launcher activates prepared releases, and Gateway readiness settles their recorded outcomes. flowchart TD
A[CLI or Gateway update] --> B[Preparation owner]
C[Early release recovery] --> D[Shared update lock store]
B --> D
D --> E[Filesystem lock provider]
B --> F[Resident launcher]
F --> G[Gateway readiness]
G --> D
Technical reviewBest possible solution: Keep the existing shared store as the single custody owner, with acquisition-bound release and process-instance recovery across all callers. Do we have a high-confidence way to reproduce the issue? Current-main source directly permits expiry of a live preparation and unconditional successor deletion; the PR supplies focused regressions, but this read-only review executed no target code. Is this the best way to solve the issue? The repair uses the existing lock provider and stale-owner classifier, migrates all production callers, and preserves the published legacy-lock contract without adding another lifecycle owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 64d84290c4c7. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +60, Tests +394, Docs +6. Total +460 across 11 files. Added test files: 0. 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:
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 readiness starts with the lower of the proof and patch scores. It is capped at 3/6 if the fix is partial, the change offers little benefit, a product decision is still open, or the PR reverses an earlier decision without saying why. ✨ 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 (3 earlier review cycles)
Reviewed November 29, 2026, 11:36 PM ET / November 30, 2026, 04:36 UTC (Revision 4). |
07cbca6 to
343cc4c
Compare
|
@clawsweeper re-review — exact head 343cc4c. Both prior findings are repaired; the unchanged identity guard, all 92 updater cases, all 16 Gateway RPC cases, seven type jobs and scoped core lint pass. The existing four-field lock JSON is preserved; the passing store regression writes pre-provider JSON with a real exited PID and reclaims, reads and releases it. Compatibility proof and remaining execution limits are in the PR body. |
|
🦞👀 Re-review progress:
|
343cc4c to
cec31b9
Compare
|
@clawsweeper re-review — exact head 6950ad9. The restored early-release recovery caller now retains acquisition-bound custody in its parent through joined finishing and failure recording. All 181 distinct owner/sibling cases pass across focused runs; the two files affected by host suspension passed all 56 cases awake with unchanged timeouts. Production and targeted test types, lint, formatting and the full exact-head build pass. Current proof and the INDEX-only review finding's resolution are recorded in the PR body. Please review the canonical lock owner and recovery caller integration. |
|
🦞👀 Re-review progress:
|
0737678 to
8a990c9
Compare
|
@clawsweeper re-review — exact prepared head 917add3. The reused-PID finding is fixed at the shared lock owner: canonical process-birth identity, explicit unknown identity for new writers, complete retirement snapshots, and the published four-field legacy recovery contract. Four focused regressions failed against the prior implementation. Integrated owner/sibling coverage passed 205 tests; the final Gateway fixture rerun passed 31/31. Formatting, targeted lint, production/affected test types and the full final-source-tree build passed. Independent P0–P3 review found no actionable issue; later test-fixture deduplication was separately checked. The published 2026.11.12 updater installed the exact candidate and recorded success/readiness. Its subsequent entry-budget failure and the UI timeout also occur on contemporaneous main; linked evidence and the later unrun probes remain explicit in the PR body. Source-built commit/rollback proof passed. Normal exact-head CI is now starting. Please review the repaired ownership and process-reuse boundary. |
|
🦞👀 Re-review progress:
|
|
Merged via squash auto-merge.
|
* commit 'b21f557c8fa038ebc1842e204e356eb063aea4c6': (46 commits) test(ui): keep real exports in the channel settings distribution mock (#208855) test(normalization): preserve inline code in quoted previews (#208857) fix(ci): restore adaptive priors across large repository trees (#208838) test(agents): cover typography preservation in patch updates (#208851) fix(ci): wait for selected agent during model setup proof (#208847) fix: keep Telegram topic messages out of Home’s chat history (#208778) fix(worktrees): name the session to restore and say agents can't (#208828) fix: tell an idle parent when a child result couldn't reach its chat (#208772) fix: keep the provider search focused when accounts load (#208780) fix(clawrouter): respect permitted speeds on model fallback (#208830) fix(ui): show provider rejection details without Markdown escapes (#208829) fix: make the cloud worker deletion test reliable across reconnects (#208812) fix(update): preserve preparation lock ownership (#207139) chore(release): update appcast for 2026.11.12 (#208820) fix(android): Talk does nothing when mic access is permanently denied (#206609) test(config): preserve media model primaries across repeated edits (#208837) fix(browser): use the mock keychain for new headed macOS profiles (#208814) fix: start source workers without synchronous filesystem reads in the caller (#208789) refactor(ios): stop loading retired Overview data (#208795) perf(knowledge): stop repeating write-input schemas in batch and correct tools (#208617) ...
What Problem This Solves
An update can lose its preparation lock while still running; late cleanup can then delete a successor's lock. Removing expiry alone also strands an interrupted lock when its PID is reused.
User Impact
New preparation locks retain ownership through slow preparation and joined recovery work. A reused PID with a different recorded process birth can be reclaimed. Competing updates keep the existing update-running refusal while the owner remains live or its identity is unknown.
Why This Change Was Made
The shared store uses pinned fs-safe acquisition at the existing path. Its release capability stays with preparation or the recovery parent through cleanup and finishing. A finishing child records the parent's result without releasing custody.
The store records canonical
starttime, includingnullwhen capture is unavailable, and uses the existing stale-owner classifier. Gateway retirement compares every custody field before reclaiming an observed lock.This removes the separate hard-link/reclaim loop, unconditional prefix deletion, caller-supplied PID and PID-based child release. Production +149/-89 (net +60) establishes acquisition-bound ownership, process-instance recovery and the restored recovery caller. Tests +520/-126 (net +394); shared Gateway fixtures remove duplication and the temporary line-budget allocation.
Upgrade Contract
The original
runId,pid,startedAtanddeadlineMsmeanings stay unchanged.starttimeis additive and existing JSON readers ignore it. There is no dependency, configuration, database-schema, wire-protocol or public SDK change.Four-field locks retain their existing deadline policy until retired. That behavior is present in the published beta's store, whose blob
8195db11e5a788099a457e7e9cf8689f7c0308a3matches the frozen base. Those records cannot distinguish a live original process from a reused PID. Keeping their old behavior avoids introducing permanent lockout during an upgrade; its old live-over-budget limitation remains. No new writer produces that shape. This branch can retire when supported upgrades no longer leave pre-identity locks; Doctor cannot reconstruct a missing birth fact.The existing local-process lock contract remains; file mtime is not a heartbeat and no cross-container extinction inference is added.
Evidence
917add3024e21dd2d8f1e746e86e8b0690bcd7db, frozen baseb86e2ff658d1e972e53a487a2b89ac32fd1a8f6b.6950ad9d510ad33ce63806f4bd36f00120eeec24: reused-PID reclamation, legacy expiry, identity-aware successor fencing and Gateway settlement.8a990c: store, recovery, Gateway trial, public Gateway RPC, preparation and preparation failure. The final Gateway fixture rerun passed 31/31. Production bytes are unchanged since8a990c.pnpm buildpassed in 307.9 seconds, including unified declarations and UI budgets. That run used checkout9f5653dplus the final one-line fixture correction; its complete tracked tree was verified equal to917add3.b86e2ff...8a990crange with intact lock/recovery/process-identity context: scoped-clean, no actionable findings. It did not execute project code. The later test-only fixture refactor was independently checked for equivalence; its missing directory binding was caught by tests and corrected before the passing rerun.TranscriptSearchResultexport in unchanged UI source. The UI authorization timeout also matches main, including identical test/helper blobs. The source-built Docker survivor passed both commit and rollback cases, preserving both test rows and refusing a newer schema in the older reader. The manual run remains red: 45 passed, 23 skipped, three underlying failures plus the aggregate gate.Named Follow-ups
Related: #207040, #207085, #207062.