Repository navigation
feat(update): support root-owned foreground FreeBSD updates - #149882
vincentkoc wants to merge 94 commits into
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: needs real behavior proof before merge. Reviewed September 24, 2026, 3:58 AM ET / 07:58 UTC (Revision 56). ClawSweeper reviewWhat this changesThe branch adds foreground FreeBSD update admission and package-ownership checks, revises update history and worker authority handling, and changes shared SQLite transaction reporting, diagnostics, tests, and documentation. Merge readiness⛔ Blocked before merge - 11 items remain This maintainer-owned draft remains useful as source work, but its author has explicitly parked the combined branch. Current main still lacks the foreground FreeBSD update path, and a previously reported live-lease gap remains in the proposed history writer. Priority: P2 Review scores
Verification
How this fits togetherThe update command checks the installation, package, service, and state owners before staging a replacement. Its executor and workers then perform the update and publish history, diagnostics, and restart outcomes. flowchart LR
A[Update command] --> B[Installation and package checks]
B --> C[Live executor lease]
C --> D[Package update and Doctor]
C --> E[History writer]
D --> F[Result and restart notice]
E --> F
Before merge
Findings
Agent review detailsSecurityNeeds attention: The new FreeBSD history admission does not revalidate live executor authority at its final write boundary. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the combined draft as source material and develop small owner-scoped changes against current main, with live executor authority checked at each final write and native FreeBSD update outcomes proved before landing. Do we have a high-confidence way to reproduce the issue? No direct native reproduction is recorded for the proposed FreeBSD path or lease-replacement failure. Source inspection identifies the final history-write path and its missing live-lease assertion. Is this the best way to solve the issue? No. The combined branch spans several owners and retains an authority gap; the author's proposed scope reset to narrower owner-scoped changes is the safer path. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 163cd10bfa83. LabelsLabel changes: No label changes. Label justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (55 earlier review cycles; latest 8 shown)
|
c927eb9 to
8af5c0a
Compare
8af5c0a to
f9a7c11
Compare
f9a7c11 to
ae2fc1d
Compare
ae2fc1d to
cf932c2
Compare
Related: #45233 and #147681
What Problem This Solves
FreeBSD needs a foreground update path owned by the installation account. Package, state and history writes must stop when their canonical ownership changes, including across asynchronous staging, Doctor/finalizer workers and restart notices. Diagnostic failures must preserve the original cause without leaking transactions or granting write authority.
Current signed head:
aca8f05544e2f77f255fb411b1298974c20f60af, treedd92b4bf50f2aa05d44e289bfd4fbed1f7e0ea5e. This correction composes the preserved implementation with frozen mainc6b21f6f086a8f3c16bbd37eb143906c9035a09e.User Impact and Ownership
The installation-owning account, including an ordinary account, can use
openclaw updateandopenclaw update --dry-run.--no-restartremains optional. Stop a foreground Gateway through its existing process owner first; active Gateway/state leases and foreign installation owners still exclude writes. Pkg/Ports installations retain their package-manager owner.FreeBSD rc.d discovery is advisory. It adds no service start/stop/restart, automatic-update or API/campaign authority. An older installed updater that refuses FreeBSD before staging still needs the documented manual package-manager replacement; a candidate cannot patch an already-running parent.
The existing executor owns admission and worker grants. One synchronous SQLite transaction owner, admission registry and terminal-handle fence serve reporters and heartbeat. A run-owned ledger binding pins environment, selectors, run identity and canonical file generation. Replacement latches the first refusal; restart notices and fresh worker receivers enforce it before publication. Deferred parents cannot recapture a replacement.
Both executor activation boundaries revoke authority on canonical nested cleanup failure and rethrow the original error. Direct pre-release refusal and plain-timeout behavior remain distinct. Canonical c6b retained-history initialization, cloned worker environment/admission, immediate SQLite freshness and preactivation recovery remain in place.
Warning delivery uses one logging-free helper at the connected transaction/coordinator sites. It cannot replace SQL, admission, commit, rollback or service errors. FreeBSD package inspection preserves native causes and exposes only a bounded operation/error-code or shared-budget summary. These diagnostics do not establish the cause of earlier ARM failures.
Canonical upstream fixture fixes, including Peter Steinberger’s Gateway fixture correction, retain their author and commit provenance. The separate S fixture backport retains its upstream co-author credits.
The official 2026.9.6 compatibility row preserves older rows and carries all 39 required members. The bridge resolver excludes the separate native-hook-relay graph while retaining canonical aliases and genuine ambiguity refusal. The emitted callGateway bridge resolves to the root runtime graph.
Validation
dc432efeb910a26f15156fc2961265c75c79ff2c, tree726f72214c70e9a5d5829092ae32d044f5a67150, ordered parents P aca8 and S5dd54332e20fdb92a8621bd88a338470b0ae2e03. Full custody verified 49,166 source entries before=after, 12,814 package files, all 39 bridges and emitted finalizer bytes. Candidate: 98,546,657 bytes, SHA-256dcaff69b99ce02a670312c76e0717f4c6c89a317a6328c471d9be856aae86fea; seal6dcf9cb1363a54573bc11ad967e9eb11064d4dc14592cfad21b9f25052f3e7fc. This is combined P/S build evidence, not an isolated P build.4c226077e8dd7b4db2a5312fec2b8506e4694a0b. Independent full-tree comparison confirms all other 49,139 paths and all package/build/dependency inputs are unchanged from S 5dd. The frozen runtime target remains dc432; no old source/build receipt is relabeled as the new S test head.Current Gates and Limits
Exact aca8 ordinary CI, the protected-main AWS publisher and final exact-head review are pending. The streaming publisher repair landed as
81fdcbd01c2288954b1983e0251ec3a479c2397c; this publication is its first actual protected-main continuation. Publication alone is not a successful publisher rollout or landing proof.The existing three-cell FreeBSD matrix remains pending: ARM root fresh, ARM ordinary fresh, and x64 ordinary seeded. Its source/package custody stays bound to dc432; the reviewed S test head is a separate identity. No native FreeBSD, rc.d restart, native systemd, ARM source Vitest or model-inference qualification is inferred from Linux/package evidence.
Earlier f7 native failures remain historical: ARM root package inspection lost its original errno/budget cause; ARM ordinary reported candidate Doctor lint refusal before later cancellation and lacked final updater/source-after/guest-settlement receipts. Earlier
892enative results and their startup, lock and interrupted-capture gaps are not current-head proof. Recovery-wait and S diagnostic work retain their separate scopes: #156523 and #156547.Auto-merge remains disabled. No merge, release, deployment or repair of an unobserved ARM cause is claimed. The temporary proof PR remains unmerged.
Scope
Final production/tooling +2,522/-1,598 (net +924); tests/test support net +3,828; metadata net +1,194, counted separately. Production growth owns foreground installation custody, worker/ledger write authority, canonical transaction/error handling and installed-updater compatibility. The final owner move is net +2 and adds no runtime branch. No duplicate transaction engine, environment-keyed authority registry or compatibility re-export remains.