Repository navigation
fix(update): preserve unrelated notices during handoff recovery - #188212
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThe managed updater uses canonical notice operations to preserve unrelated notices and the current update’s failure diagnostics. Example: Recovery encounters a notice with handoff ID systemd-boundary but run ID another-run.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current-main notice ownership defect; no actionable introduced bug was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe detached update helper receives the updater’s result, records restart notices and terminal history, and uses the existing local lease and recovery decision to restore the Gateway. flowchart TD
A[Managed update request] --> B[Captured detached helper]
B --> C[Real updater CLI]
C --> D[Child result and recovery decision]
D --> B
B --> E[Canonical notice owner]
E --> F[Selected state database]
B --> G[Gateway recovery and run history]
Technical reviewBest possible solution: Use the captured canonical notice owner while preserving the existing updater, lease, recovery, and terminal-settlement responsibilities. Do we have a high-confidence way to reproduce the issue? Current-main source shows both ownership gaps, and the added run/root regressions directly exercise them; the supplied evidence records their failure before the fix, while this review executed no target code. Is this the best way to solve the issue? This is the smallest complete ownership repair: reuse the existing canonical operations, remove duplicated SQLite policy, and retain packaged proof for recovery through an older runtime. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9d6050fa1692. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -116, Tests +422, Other +656. Total +962 across 24 files. Added test files: 0. View PR surface stats
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 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 HistoryReviewed October 31, 2026, 1:38 AM ET / 05:38 UTC (Revision 3). |
11bffde to
4dddf32
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…claw#188212) * test(update): expose cross-run handoff notice mutation * fix(update): use canonical handoff sentinel ownership * fix(update): preserve handoff diagnostic failure boundaries * test(update): exercise packaged rollback through an older runtime * test(update): satisfy rollback harness lint rules * test(update): bind the recovery observer event receiver * test(update): use the service account home for rollback proof * test(update): report packaged recovery failure coordinates * test(update): bound the published recovery state fixture * fix(update): reconcile captured notice owner with launchd identity * test(update): complete the packaged handoff service fixture * test(update): brace survivor service fixture branches * test(update): preserve failed recovery startup diagnostics * test(update): prioritize recovery failure causes * test(update): isolate published recovery runtime * test(update): observe notice preservation at canonical refusal Co-authored-by: Vincent Koc <[email protected]>
What Problem This Solves
A detached managed update could rewrite an unrelated restart notice sharing its handoff ID, or borrow a failure reason from another installation.
User Impact
Recovery preserves notices belonging to other runs and installations while the real updater and local lease continue to authorize restoration. No config, schema, protocol or public SDK change.
Why This Change Was Made
Capture the canonical SQLite inspection and outcome writers before package replacement. Share outcome preparation with the PostgreSQL transport; remove duplicate SQLite policy and the PostgreSQL-only result-source module. Revision, consumed-notice, cancellation and terminal-settlement checks remain. The helper retains the shared launchd parser from PR #188226.
Application runtime −116 lines; acceptance infrastructure/catalog/Knip/budget record +656; tests +422. Combined non-test growth is +540: it supplies the required executable packaged older-runtime compatibility proof. The separate test allocation covers only this PR's regression growth.
The fixture isolates published SDK, ledger and notice operations from candidate process-global registries. It publishes through the real canonical writer before forwarding the updater's actual close event. Notice preservation is observed after the canonical owner commits its refusal, including when the updater has already verified recovery and the helper correctly skips another restart. Missing rows and observation errors fail the full-row assertion.
Evidence
504a6686d67677da187086ca81b8e5bb624215e7: CI SUCCESS, 51 successful jobs, 27 skips, zero failures. Scripts lint, script types and test-line budget passed. Diagnostics passed 17 cases in 3171 ms; the actual-preload no-restart observation regression passed in 24 ms.[email protected]and ran the candidate-generated sealed helper against its real CLI. It verified exact candidate/restored package payloads, settings, workspace contents and SQLite plugin data; the unrelated notice's full raw row/revision at the post-refusal observation; fresh Gateway identity and HTTP readiness; terminalrolled-backhistory; lease release; and sensitive-file cleanup. The published runtime lacks the new operation export. No parameters, lease history or recovery results are fabricated.f22a2670eaf09742beff52aeaa568705114356d7, version2026.10.9, tarball SHA-256a5b09e9fb6620ef2ca3d1a012591a0565837f807388bd7e938f411994a6ed63b. Application source is byte-identical; subsequent commits touch excluded harness/tests/budget metadata only. The producer was cancelled after artifact publication.The disposable service adapter reports observed Gateway identity; it does not prove real transient systemd/cgroup custody or native macOS execution. No live operator update was performed.
Five generated-helper PostgreSQL cases remain skipped; general conformance does not replace them. Follow-up: generated-helper PostgreSQL execution inventory. Prior package validation passed published 10.9 authenticated restart/full payload checks; its separate 10.8 secondary UI specimen exceeded the deadline. Follow-up: isolate that specimen's receipt/phase timing. The new lane joins unfiltered Docker-all; explicit release profiles remain unchanged.