Repository navigation
fix(update): avoid Windows rollback from rounded lease identities - #162245
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 October 1, 2026, 3:28 AM ET / 07:28 UTC (Revision 11). ClawSweeper reviewWhat this changesThe branch accepts older Windows updater lease identities at initial candidate admission, retains exact identities afterward, and reports underlying lease-read failures. Merge readiness⛔ Blocked before merge - 5 items remain This PR remains necessary: current main and the latest release retain the cross-version identity mismatch. No introduced correctness defect was found, but the two previously requested production-boundary proofs remain outstanding. Priority: P0 Review scores
Verification
How this fits togetherThe updater delegates Doctor and other installation operations to candidate processes using a SQLite lease database. Candidate admission checks filesystem identity and live process ownership before granting permission to continue. flowchart TD
A[Installed Windows updater] --> B[Transported lease grant]
B --> C[Candidate identity admission]
D[SQLite leases and live processes] --> C
C --> E[Exact identity pins]
E --> F[Delegated executor checks]
F --> G[Doctor and installation operations]
Before merge
Findings
Agent review detailsSecurityNeeds attention: No concrete bypass or supply-chain regression was found; normalized execution authority still needs final-effect safety proof. PR surfaceSource +36, Tests +198, Docs +6. Total +240 across 9 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Preserve the narrow candidate-side compatibility bridge and exact subsequent pins, with demonstrated Windows upgrade success and live-authority rejection before effects. Do we have a high-confidence way to reproduce the issue? Yes for the representation mismatch: published 9.6 uses numeric identities while current main and 9.7 compare bigint strings exactly. No current-main execution was performed, and the original failed invocation's sealed grant remains unavailable. Is this the best way to solve the issue? Yes at the code boundary: initial legacy normalization in the existing identity owner preserves the shipped contract without creating a competing authority owner. Production upgrade and final-effect safety remain unproven. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3f7689e64a08. LabelsLabel changes: No label changes. Label justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (10 earlier review cycles; latest 8 shown)
|
Preserve the shipped numeric identity contract at first candidate admission, then retain exact bigint pins for later operations and descendant grants. Keep lease read diagnostics instead of reporting a parent-binding mismatch. The initial legacy hop accepts the inherited rounding ambiguity.
a861278 to
2cc6107
Compare
|
Landed via the admin exception for inherited failures (squash |
…act bigint identities (openclaw#162245) A Windows 2026.9.6 -> 2026.9.7 update passed every candidate check, published 9.7, then rolled back because the first delegated live Doctor reported "Candidate executor binding does not match its parent": openclaw#158491 switched the managed-update lease-directory identity to bigint lstat while keeping an exact string compare, so a 9.6 parent's numeric (precision-lost) identity never matched, and the identity read error was swallowed into an unreadable-lease classification. The shared identity owner now accepts the legacy numeric spelling once at initial admission when it equals the candidate's bigint identity rounded through the same serialization (an accepted one-hop tradeoff recorded at the comparer), pins exact bigint identities for every subsequent operation, and surfaces underlying read errors. Closes openclaw#162130
…act bigint identities (#162245) A Windows 2026.9.6 -> 2026.9.7 update passed every candidate check, published 9.7, then rolled back because the first delegated live Doctor reported "Candidate executor binding does not match its parent": #158491 switched the managed-update lease-directory identity to bigint lstat while keeping an exact string compare, so a 9.6 parent's numeric (precision-lost) identity never matched, and the identity read error was swallowed into an unreadable-lease classification. The shared identity owner now accepts the legacy numeric spelling once at initial admission when it equals the candidate's bigint identity rounded through the same serialization (an accepted one-hop tradeoff recorded at the comparer), pins exact bigint identities for every subsequent operation, and surfaces underlying read errors. Closes #162130 (cherry picked from commit f885caa)
Closes #162130
What Problem This Solves
Fixes rollback at the first live Doctor when the 2026.9.6 Windows updater passes a rounded NTFS lease identity to a candidate that reads bigint identities. The 9.7 capture change left an exact string comparison against the older driver's numeric serialization.
User Impact
The candidate accepts the shipped older-driver handoff, then enforces exact file and parent-directory identities. Lease read failures report their underlying error instead of a misleading parent-binding mismatch. Identity strings, activation receipts, and downgrade format stay compatible.
Why This Change Was Made
Lease initialization, adoption, capture, and comparison use the shared bigint formatter in
sqlite-worker-identity.ts, alongside the landed Linux birthtime policy from #162305. Candidate admission validates the original lineage bytes before normalizing older numeric identities. Live row/process checks remain authoritative; later operations and descendant grants use exact pins. Bare-UUID legacy bridges qualify only while their helper and executor identities match.Accepted tradeoff: initial legacy admission inherits the older driver's numeric precision limit, so two inode values with the same
Number()serialization cannot be distinguished at that admission. This bounded ambiguity is accepted for the shipped one-hop contract; every later check uses exact bigint identities.Thanks to @WG-Mojo for the cross-version diagnosis.
Rebase validation
Rebased head:
2cc6107554dc55d1628b467022139d96401400be, on maine9b768b14d266d0ddd935a6af36a12e6736f8ef5.Conflicts occurred while replaying commits in:
package.jsonsrc/infra/sqlite-worker-identity.tssrc/infra/update-managed-service-handoff-foreground.test.tssrc/infra/package-update-swap.windows.test.tsNo resolution introduced a behavior change. Main's Windows inventory, path normalization, birthtime handling, and landed fixture repairs are preserved. The foreground fixture now uses main's canonical prepared entrypoints; the duplicate test mappings drop out of this PR. Grant admission, lease database operations, error propagation, and regression assertions remain byte-for-byte identical to the reviewed
a86127842083...head, including its explicit-column INSERTs.The touched suites ran once: 11 files, 230 passed / 3 existing skips, 85.80 s wall, including 10.844 s worker preparation. Longest case: 13.155 s; largest file case-time sum: 58.338 s. The requested gate ran once:
CI=1 node scripts/check-changed.mjs --base e9b768b14d266d0ddd935a6af36a12e6736f8ef5 -- <all nine authored diff paths>. It failed with exit 2 after 305.32 s at thecore-test-gateway-rootgraph:The failing file is byte-identical in the rebase base and pushed head (blob
f9000417936584d432760473b0a73e462dc69198); it calls the undeclared/unimported name at line 123. Production typecheck, the first three test graphs, and preceding guards passed. The remaining 23 test graphs and subsequent lint, dead-export, schema, cycle, and authorization guards were unrun. The inherited UI error is left for the lead under the no-rerun ruling; no unrelated repair was added. No test or CI reruns were requested. The fresh Blacksmith Testbox leasetbx_01m3v33bcjsh6z3azemqjkjhd3(run) fetched the pushed SHA and installed frozen dependencies without a tree sync. It is stopped; the exact source checkout was verified clean.Earlier evidence
Earlier validated head:
a86127842083314144e82bcb25a5debcaaeaed26, based onbe052821d69c581a94c39f91623419bdfc1093b1.tbx_01m3twq1bth5py2etnydcqe64jis stopped (run).ac7f84515a9e25834c1058e11fa720b2e342bd16:CI=1 node scripts/check-changed.mjs --base 2fd8e321baea18b32c64d61da04cf690a11c6f45 -- <12 authored diff paths>passed in 1321.02 s, including production types, all 27 selected test graphs, ratchets, boundary guards, three dead-export scans (zero), scoped lint (zero warnings/errors), and runtime cycles (zero). That head also passed all 149 CI jobs and 30 affected importer files (363 passed / 1 existing skip). Earlier four-owner importer coverage on0380ddda84aeea7b01cbdd33a3125bcb56a1bc57passed 53 files / 848 tests, with 4 existing skips. These remain explicitly prior-head results.Main integration adopted the canonical native Windows fixture repair from #162352, removing that test change from this PR. The regression INSERTs now name their four columns so they coexist with main's recovery metadata from #160488. This PR authors no schema change. The resumed 49-file importer run completed on this exact head: 49 files, 795 passed / 2 existing skips, exit 0, in 725.42 s wall, preserving the original file order. Command:
env CI=1 node scripts/run-vitest.mjs <the 49 original importer paths> --reporter=verbose. Shared runtime build stages took 539.634 s (including 525.3 s tsdown), plus 10.734 s worker preparation; the nine routed Vitest groups reported 160.69 s total duration. The longest case was 28.762 s and the largest file case-time sum was 51.371 s. No failures, retries, source changes, or additional checks were performed. Per the lead’s ruling, the four narrowed remote type graphs and scoped lint were not added; CI already covers selection.The resumed importer proof used fresh Blacksmith Testbox
tbx_01m3txxbxy5p2wf9pr7sq9x02b(run), which fetcheda86127842083314144e82bcb25a5debcaaeaed26, checked it out cleanly, and ranpnpm install --frozen-lockfilewithout a tree sync.Linux proof uses Blacksmith Testbox
tbx_01m3twpr43d48acz8053tc2m0n(run), fetching the exact commit with frozen dependencies. No Mac test/typecheck/build or tree sync was used. All lane-owned leases and SSH clients are stopped.Test cost and CI repairs
The foreground preparation repair is now retained from main. The handoff suite previously loaded source runtimes repeatedly in its child processes. Reusing existing prepared entrypoints preserves all 21 scenarios and assertions: broad importer runs on separate leases measured 150.285 s → 67.577 s test time. The focused single-worker result was 61.279 s tests / 76.33 s wall, including 10.876 s compiler preparation.
The cross-version cases share the existing lease-database publication fixture. This avoids a separate file startup and fixes the earlier Windows placement-budget failure without editing a timing baseline or weakening its limit. On the previously validated
ac7f84515a9e...head,CI=1 pnpm test <file> --maxWorkers=1 --reporter=verbosemeasured all 26 publication tests at 1.304 s tests / 15.64 s wall. Current native Windows case timings are above.Follow-up and remaining proof
Lead-waived follow-up: an unchanged Windows ownership test crossed the campaign's approximate 30-second single-test threshold. The lead explicitly waived this pre-existing suite as a blocker for this PR; retain its profiling work as a separate follow-up.
src/state/openclaw-state-ownership.test.ts:187, “external shared-state ownership > refuses unauthorized Doctor admission before staging a public snapshot”, passed in 31.555 s in the current Windows job (25.871 s on the preceding head). This is case time, not shared preparation time.The case creates a real claimed database, verifies unauthorized Doctor rejection before snapshot staging, then completes an authorized
runDoctorConfigPreflightwithmigrateState: true. The positive path includes update-history reconciliation, lazy state migration imports, configuration/plugin preparation, cron repair, and legacy-state migration with SQLite worker activity. The logs do not isolate the dominant phase. A safe bounded correction is not established; a dedicated Windows profiling lane should measure the existing preflight phases and worker launches before changing fixture reuse. Both assertions are preserved; no timeout, retry, skip, or timing-shift workaround was added.The last completed ClawSweeper review read by this lane was for
ac7f84515a9e...: it found no introduced defect and requested a full published 9.6 Windows npm-global live Doctor run plus combined normalized-grant-to-final-I/O authority traces. Those broader pre-merge requests are not performed or claimed cleared here. The lane's native Windows CI and Linux boundary proof are recorded above; the lander must read the current exact-head review.Production: +76/-40 (+36 net). Tests/support: +206/-8 (+198 net). Docs: +6. Production growth preserves the shipped one-hop contract and the original read error within one identity owner.
The PR is ready, auto-merge is off, and this authoring lane stops without merging or releasing.