Repository navigation
refactor(state): move restart preflight into inspection worker - #166252
Conversation
Inspect shared-state schema, registry, and retained deletion facts in the existing schema inspection child during Gateway restart. Keep startup and Doctor native admission callbacks and preserve snapshot cleanup ownership. Snapshot staging locks remain native; this path does not run during warmed chat turns.
…w6discovery-preflight
|
🦞👀 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. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: blocked before merge. Reviewed October 8, 2026, 5:14 AM ET / 09:14 UTC (Revision 42). ClawSweeper reviewWhat this changesThis PR moves restart database inspection into the existing inspection child and reuses canonical schema expectations and admitted version facts. Warning SQLite table change This PR modifies persisted SQLite tables in Review scores
ProductKind: Refactor · Worth it: Yes Merge readiness⛔ Blocked before merge - 2 items remain Keep open: this useful, owner-directed refactor remains absent from current main, and no actionable introduced defect was found. Qualification of the latest integration is still incomplete. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherBefore restarting, the Gateway checks saved shared state and agent databases to determine whether the successor can safely open them. This change moves shared-state inspection off the Gateway thread while returning the same readiness and refusal facts. flowchart TD
A[Gateway restart request] --> B[Preflight owner]
B --> C[Captured database snapshot]
C --> D[Existing inspection child]
E[Canonical schema expectations] --> D
D --> F[Readiness and refusal facts]
F --> G[Restart lifecycle owner]
B --> H[Joined child and snapshot cleanup]
Technical reviewBest possible solution: Keep one shared inspection kernel and the existing lifecycle owners, qualifying the integrated reader and cache composition under the recorded acceptance policy. Do we have a high-confidence way to reproduce the issue? Not applicable as a new bug reproduction: source confirms caller-thread restart inspection on current main, and recorded production-boundary measurements demonstrate the work being moved. Is this the best way to solve the issue? Yes: extending the existing inspection child and sharing its kernel with native admission avoids a competing owner while preserving readiness semantics. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 54bd6ecee189. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: shipped entry point. Added test files: 9. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +402, Tests +388, Docs +20, Other +1. Total +811 across 28 files. View PR surface stats
Stored data modelPersistent data-model change detected: LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 HistoryReview history (41 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Deferred registry persistence no longer acquires a startup writer lease. Validate the reserved ownership record during the existing shared-state readiness read so malformed metadata still refuses startup before work begins. Reuse the existing parser and read handle, preserving external-supervisor policy and deferred persistence. The original CLI refusal regression, shared ownership cases, and database preflight tests pass (48 tests); core types, lint, and review through P2 pass. Failure attribution is recorded in openclaw#166252.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Historical evidence for PR #166252The complete Evidence section below is copied verbatim from the verified published body for head EvidenceCurrent candidate 683 — qualification pendingHead 6834b33, tree 8a679cabc62f7631410314e8e6c1aab094efacf6, merges main a6a353a. The real #166963 conflict preserves worker/native dispatch and moves main's newer-version early return into their shared kernel. Main's explicit state-path owner, Doctor and status fixes remain unchanged; reader admission retains the header callback and main fallback. The new restart negative control failed for duplicate Doctor advice (122.812 s). Fixed-tree passes: 167 tests/13 files, 654.674 s; wrapper 16.196 s; core 34.531 s; 27 test-type partitions 627.538 s; zero-cycle Madge 68.514 s; P2 clean. The exact SDK report is complete, ack 3784af99: zero direct public/entrypoint changes; all 131 reachable flags and eight declaration sections match the prior assessment apart from closure hashes. Native command and cleanup completed (2775.991 s). One alternating macOS/Node 24.21.0 main,candidate pair ran, with both samples retained. All flows except candidate
Deferred startup moves into first: boot+connect+first 6966→6831; matching startup ownership/cron-load/lease counts are 123/9/4 on both sides. Warmed decreases; no new PR-caused first/warmed request is identified. Second+control+cron totals 7242→7209, but second alone rises 102 (2.061%), including canonical-ready reads 0→37 through existing owners; the exact timing attribution remains incomplete. The control count retains the failed rollback. Both sides retain one shutdown Previous 705 — historical measurements and CI3ac5189 → 7059205 previously passed 261 tests/16 files, wrapper/types/Madge/P2 and SDK (ack db91b0ab, zero direct public changes, 131 reachable flags); SDK resources were removed. Its CI and review below are historical. The first 3ac→705 attempt was incomplete: three baseline workloads and readiness/source/count audits passed; candidate capture never started because the launcher rejected temporary Trusted ClawSweeper completed 705 on 2026-10-08 03:52 UTC, with no actionable code/security findings, requesting SQL and current-main composition proof. The later real main conflict was resolved in 683 above. The completed 705 capture used unchanged Linux/Node 24.21.0/SQLite 3.53.4 inputs on one exclusive host; all pre-run idle guards passed. It ran three main then three candidate workloads, not alternating, so it cannot satisfy the final 683 gate. Its original result remains FAIL_ALL_THREAD_INCREASE. All raw vectors remain in
Original strict failures, identical in both views:
The explicit LANDING ACCELERATION policy supersedes the old strict rule: individual-turn increases above are nonblocking; compaction's +10 is accepted under the non-turn tolerance for unchanged background work. Compaction is +13 worker statements minus three removed helper version probes. Existing plugin-state, delivery-queue, device-pairing and ownership-marker reads shift from cron into compaction; their owners are unchanged between the compared revisions. Full-run plugin/delivery/ownership counts stay 9/9/17 in every repetition; paired/pending device medians stay 36/26 (one baseline run was 35/25). This does not rewrite the original failure or make this sequence alternating. Final 683 still needs its one main,candidate pair. All 33 readiness outcomes passed in both views: inclusive 2316→2148, successful 2313→2145. Full workloads retain main's two failed native CI 37720965264, attempt 1: 114 successful / 23 skipped / two failed jobs, root 113128619987 plus aggregate. Hosted lint and security-fast passed. The widget fixture passes. The restart-handoff case instead sees Previous 378 — inherited widget fixture failure, repaired on mainCI 37696109238, root job 113048736013, failed The observer reconnected the original Control UI device as TEST using shared authentication. That intentionally rotates the token to an issuerless token, so exact-source recovery correctly refuses the old credential. Nine direct owner/test blobs match between main and the tested merge; both compiled recovery frames map line 140 to the token-identity mismatch. Five unchanged whole-file runs on each exact revision failed on Linux/Node 24.19.0. The retained detailed main log matches CI's two original provider calls, zero recovery calls, three revocations and terminal tombstone. Nine detailed replay logs were lost by an empty artifact collector; all ten commands, exit results, summaries and compiled-frame evidence remain retained. Identical detailed causes for all ten are not claimed, and no replacement rerun was used. Fix 6b19665, published on main through 5a9a6d3 and integrated above, gives the TEST observer its own synthetic device. All original assertions and production authority checks remain intact. The repaired Linux file passed in 58.625 s after a 230.436 s build; P2 was clean, all downloaded evidence hashes verified, and its lease was stopped. No failed security requirement was waived. The 06a1→378 SQL attempt never reached capture or workload: main became conflicting and the launcher refused. Its normally admitted AWS lease was released with provider cleanup complete at 2026-10-07 23:41:10 UTC. Both earlier capacity denials and the refusal are retained. No samples or performance result exist for that attempted pair. All earlier failed measurements and unresolved local failures remain below. Previous 9a04 — strict SQL qualification failedPublished head 9a04e75, tree c6669ba9d075c464a5f3223444c2f31e4d32cefe, integrates main c6698b1 with a merge commit. The 30-file introduced delta preserves main's maintenance planner/completion observer (#166674), content-marker cache (#166259), worker device identity (#166539), transcript previews (#166635), and bound-source terminalization alongside this PR's prepared chat freshness. No rebase, dependency patch, or merge request was used. The unchanged c669 → 9a04 matched SQL gate failed in both successful-only and failure-inclusive views. Three workloads per side ran on one exclusive Linux host with identical toolchain, packages, workload and observer. All six workloads and all 33 readiness cells per side passed functionally; every readiness count was nonincreasing. Two phase medians increased:
Warmed mean-per-turn median improved 1528.7 → 1523.6, and total median 31629 → 31513; these savings do not waive the phase failures. Main's native failed calls were 0/2/0, candidate 0/0/0; the two first-turn Raw attribution: warmed repetition 2 is MAIN −6, worker −1, helper +8. The extra helper work is two four-statement post-read auth-profile cache-token checks. Each repeats data-version, SQLite-version, non-mutating WAL-state and page-size reads. Control-plane is one three-statement delivery-queue snapshot minus one saved version read. Exactly nine outbound snapshots occur in every full run; the existing scheduler places one in phase 05 instead of 04. That phase placement does not waive the strict gate. Repairs are being proven for redundant runtime-version probing and cold schema-admission reads; live freshness/ownership checks and scheduler cadence remain required. No repaired performance result is claimed yet. 9a04 passed: 162 tests/14 files, wrapper, core/27 test-type partitions, zero-cycle Madge, lint/format, P2. SDK 914.737 s, ack 3096385a: zero direct signature/export/entrypoint changes; 131 reachable flags/seven internal sections. SDK cleanup complete. Trusted ClawSweeper completed this head at 2026-10-07 21:08 UTC with no introduced correctness/security finding; its pending SQL request is answered by the failure above. Its technical assessment confirms no stored-data contract change despite the automatic schema heuristic. 9a04 CI is terminal with an inherited updater fixture failure. Run 37686569514 completed 111 successful jobs, 23 skipped jobs, and two failures: root job 113016536748 plus its aggregate gate. Security-fast passed. Its tested merge e3e1ad26a087516cac5577a83d8de17e68f148c8 has parents main 74d5f2d and PR 9a04e75. All 19 cases in Earlier 29644 ownership CI failure was independently inherited and repaired on main. Run 37678068521, job 112987271835, failed the malformed shared-store ownership case in The 030 → 29644 SQL attempt stopped during toolchain setup before any workload sample; provider deletion subsequently proved cleanup after native cancellation was uncertain. Superseded f834 → 516 SQL preparation allocated nothing; its interrupted SDK run was cleaned up, not called successful. Earlier passed proof stays bound to its original source, and all failed measurements and unresolved failures below remain retained. The next candidate needs fresh qualification before landing. Previous published candidate bb710Published head bb71093, tree fe9a7a5f37031553eaa4d429626ba2653e0d44a7, merges protected main 630e969 into de3. GitHub confirmed OPEN/MERGEABLE with no auto-merge request; the push preserved the exact reviewed/tested tree. No rebase was used. Main’s df8b0cb repairs a reachable direct-ingress rejection of a settled Stop outcome with no remaining recovery custody. The source path reaches the same refusal code, but the exact earlier CI interleaving is not conclusively established; new real-entry proof remains required. Main’s #166671 now owns Doctor device-identity artifact preservation, so this candidate removes the redundant discovery wrapper and uses that owner directly. The merge had no conflicts and the residual PR delta is 19 files. The removed Doctor helper was introduced only on this PR and is absent from latest beta v2026.10.1-beta.1 and stable v2026.9.8 SDK/runtime/infra sources. No released compatibility shim is required. SDK passed: 350.281 s, digest 452d2616, zero entrypoint/export/direct-signature changes, 131 reachable flags. Linux/Node 24.21.0 requester proof: 4/4 per side, including Stop (main 180.552 s, candidate 182.447 s); no The strict performance gate FAILED on bb710; it was not landed. The unchanged 630 → bb710 matched workload ran three times per side. The second-session all-thread median increased 5382 → 5409 (+27) in both successful-only and failure-inclusive counting: main The two bounded owner repairs subsequently committed in 14d3 addressed: empty maintenance currently repeats a writer/age round trip after a no-op finalization, and chat drops lifecycle timestamps already read by its retained worker before invoking a legacy host freshness read. A new regression against unchanged maintenance proves 3 writer transactions exceed the budget of 2 while preserving archival at the original deadline. Fresh source-bound tests, P2 review, SDK, ClawSweeper, CI and matched SQL proof remain required after repair. CI 37665409832, attempt 1: 111 passed/23 skipped/zero failures, including CI/dependency/security gates; merge 198634da597e29b20e7174005a95cf18ae34338a = main c938a54 + bb710. Trusted ClawSweeper, 2026-10-07 18:27 UTC: no introduced correctness/security finding; proof requests superseded above. Neither CI nor review waives the failed SQL gate. No merge request is armed. The prior de3 CI attempt 3 passed Telegram but failed the historical requester-stop assertion in job 112922349500; native merge admission refused that red gate before submission, and its own operation lock was recovered after process settlement. No admin exception was used. This main integration precedes further attribution; exact-head CI, completed ClawSweeper review, and native security admission remain required. Published de3 source and completed prior proofPublished head de3fbff, tree ba98b075c8e25b168b673d56df2b8d7130e6827f, merges protected main 7a8e5a1 into The three conflicts came from main's #166503 ( The two bounded fixes remain: e90dcde removes the immediate duplicate schema-version read, and 6b22fb4 preserves copied SQLite sidecars during Doctor device discovery. Their original failing proofs and passing owner-level regressions remain below. This integration changes neither fix's contract. Parallel landing overlap: main #166671 ( Historical de3 strict SQL passed: three unchanged workloads/side on exclusive Linux AWS; zero native failures. Both counting views: no all-thread median increases in 20 phase/aggregate rows, every warmed turn or 33 readiness cells; all outcomes matched.
No retries, statement exclusions, timing allowances, or weakened outcomes were used. Native PR capture/verified detached main; baseline source/count/readiness/settlement audited first. Approved host setup and seven workload/four readiness inputs unchanged. All processes settled; AWS cleanup confirmed 2026-10-07 16:36 UTC. Earlier failed source pairs remain retained below and are not reclassified as passes. Initial CI on this head, 37649580212 attempt 1, was terminal: 108 jobs passed, 23 skipped, two root failures plus the aggregate gate. The actual tested merge was 1413de5f0407c65a0153ab00bea1a201327d59f9, with ordered parents main 1caa1c8 and this PR head. The failures are the first ownership-verdict case in Session-state CI investigation completed; cause remains unestablished. The unchanged whole file Telegram CI investigation completed; cause remains unestablished. The unchanged whole ClawSweeper completed its latest trusted review of de3fbff at 2026-10-07 17:32:07 UTC, with no actionable introduced correctness or security finding. It explicitly accepted the exact-head SQL and SDK evidence above and removed its performance/report merge-risk requests. Its technical inspection confirms that the delta changes no stored schema, persisted format, retention policy, or migration algorithm; the automatic stored-table warning does not identify a schema change. Actual-schema rejection, existing-data readiness, Doctor artifact preservation, and published-driver update evidence remain recorded below. The historical requester-stop comparison is complete: unchanged Linux/Node 24.19.0 runs on exact main Previous candidates, measured failures, and source-bound investigationsPrevious candidate 6b22: source-bound integration and repair evidencePublished head 6b22fb4, tree 847a76185246e0e47bd8a2ff4f9dfdfbfbfa472e. Merge commit b34139f incorporates protected main cb04039. The only conflict was the preflight test cleanup from #166619: main's consolidation and dangling-Workshop coverage remain, together with this PR's caller-thread/retained-deletion regression. No rebase or dependency patch was used. Two focused landing repairs follow that merge:
The changed cache assertion extends an existing test and adds no fixture boot or timer. Its fixed whole-file command took 98.054 s, including 56.53 s of compiled-worker preparation; individual test bodies totaled approximately 318 ms. Current-head CI seconds remain pending. A further integration is in progress: main's #166503 ( Remaining merge gates: a fresh matched cb04039 → 6b22 SQL workload and all 33 readiness cells, the final local released-SDK report, completed ClawSweeper review, and exact-head CI/security admission. No passing performance result or CI waiver is claimed yet. The earlier controlled Linux comparison's control-plane 68 → 69 (+1) remains a failed result below; full-run or warmed-turn savings do not waive it. The harness and counting rules remain unchanged, including failed native statements. A proposed WAL shortcut was rejected after a native SQLite probe showed that PRAGMA preparation can still invoke the busy handler; WAL maintenance remains unchanged. The prior head's restored-requester stop failure (one model request observed where two were required) remains under an unchanged-file, exact-main/tested-merge comparison. Its old CI evidence does not stand in for this head. Security requirements are never waived. Previous candidate 1ee: retained measurement and CI evidencePublished head 1ee9635, tree b19670d66bb8b07772dcfcbbd38830f159f3cd22, merges protected main 7a75498 into prior The controlled Linux performance gate failed on this exact head. The unchanged full workload ran three times per side on the same exclusive 8-CPU host, pinned Node 24.21.0 / SQLite 3.53.4, with every pre-run idle check passing. Control-plane all-thread statement medians increased 68 → 69 (+1): main repetitions Raw traces locate the control-plane difference: candidate runs 2 and 3 execute one four-statement periodic PASSIVE checkpoint bundle (read timeout, set zero, checkpoint, restore timeout), while content-marker reads drop from five to two on every run. This identifies the observed cost, not PR causation; no timing exclusion, noise allowance, or unchanged rerun is claimed. A bounded owner-level optimization investigation is active. All raw captures and failed results are retained. The lease was released after all observed processes settled; authoritative cleanup reports complete. Exact-head CI 37631964899 attempt 1 is terminal: 107 successful, 23 skipped, two root job failures plus the aggregate gate. The three The prior 0dc → d3 local pair failed the strict gate: cron medians 1726 → 1774 (+48) and compaction 1004 → 1008 (+4) in both stock and failure-inclusive views. All individual warmed-turn medians and 33 readiness cells passed, but those savings do not waive either increase. Traces locate differing cold listing, placement reconciliation, WAL, OAuth and secret-expiry work; fourteen corresponding owner files are unchanged. Some work moved across phase windows, and placement cleanup also executed more full-run work on the candidate. PR causation is not established, and no noise allowance or statement exclusion is claimed. All 239 raw captures are retained unchanged. The failed source pair remains historical evidence; a new result must stand on its own. Prior Current landing statusCurrent candidate d3a2f2d, tree 68ea994 → 767c085 passed every all-thread flow/warmed-turn gate; three identical workloads/side, exclusive host. Warmed 2317.1 → 2277.3, total 44654 → 44009. No flow was excluded or given a noise allowance. 33 readiness outcomes matched, no cell increased; total 2316 → 2148. Archives, SQL counts, runtime/package/harness identities and settlement audited; lease released. Because the required integration changes reachable session/read owners, a fresh matched comparison against The repair behind this result carries an already cached canonical validation contract through the existing typed trajectory-retention read request. It eliminates repeated construction of expected definitions; actual-schema, identity, quarantine, freshness, authority, retention and retry checks remain. Cold capture performs no SQL. The real-worker regression passes, and disabling only adoption fails its intended SQL assertion. d3 integration passed: 226 tests/15 files, no skips/failures (366.857 s); production types 20.578 s; zero-cycle Madge 178.107 s. Of the 27 core-test partitions, 26 passed; the sole error is the independently reproduced main terminal-font TS2353 described below (828.713 s total). Fresh full-PR P2 review against Exact current-head CI run 37613514952, attempt 1, tested merge Archive investigation and one permitted rerun: five unchanged single-file runs per revision ( Restored-requester stop and three requester-owner yield cases remain unqualified on the current baseline. The older paired result does not automatically qualify this head because main changed the session publication path. Testbox's first admission queued for 15 minutes without a runner or payload, then was stopped and reconciled; guarded local proof will use independent physical checkouts and the documented private-QA build owner. No admin exception has been submitted. Trusted ClawSweeper completed this exact head at 2026-10-07 11:27:54.607 UTC, revision 16, with no actionable correctness or security finding. It correctly retains the outstanding integrated performance gate and confirms there is no stored-data contract change requiring migration. The matched workload is now using the unchanged harness's supported macOS path with Node 24.21.0/SQLite 3.53.4 after remote control-plane reads failed before source sync. The harness records actual load and makes no unloaded-Linux-host claim. Its strict per-flow and per-warmed-turn all-thread rule is unchanged; no current result is claimed until all runs and readiness cells are audited. Earlier CI run 37604823423, attempt 1, completed on predecessor Trusted ClawSweeper review completed on Historical proof, failures and investigations (explicit source bindings)Landing candidate — full SQL comparison pendingCurrent published candidate is 767c085 (tree The repair carries an already cached canonical validation contract through the existing typed trajectory-retention read request. The receiver accepts only its exact schema-source key and copies the definitions into the existing comparison cache. Cold capture performs no SQL; actual-schema, identity, quarantine, freshness, authority and retention checks remain unchanged. No parser, persisted-data change or new service is introduced. Historical Pre-integration canonical proof: 35/35 passed, 486.857 s wall; new real-reader case 6.077 s. The omitted-contract control executes comparison DDL and reads expected definitions; the carried healthy request avoids both, and a dropped actual trigger still refuses admission. Disabling only worker adoption fails that SQL assertion; restoring it passes. 46 tests/8 retention/import/build-graph files passed, 268.541 s; production types 19.348 s; 27 test-type partitions 420.858 s; zero-cycle Madge 83.408 s; type-aware lint/P2 against Integrated head 6110f0e (tree The schema-version query owner retains one raw marker row, including absence, only while its admitted connection revision is unchanged. Existing foreign-commit probes, local writes, rollback, schema/snapshot changes and authorizer policy invalidate reuse. Each call still parses and applies its own published-version floor. No new admission owner, schema, public signature or persistent format is introduced.
9aa7455 → 6110f0e real-entry readiness: all 33 outcomes preserved, all MAIN/process counts nonincreasing. MAIN 1918 → 571, all-process 2362 → 2148, healthy warm 57 → 45; 30 cells decreased, three absent-database cells stayed zero. Three expected malformed-file failed reads remain, moved to the helper. Only exact build-SHA diagnostic stamps were normalized. The table below matches this source pair.
Prior-head full-workload gate — failed; repaired candidate pending: the valid matched 9aa7455 → 6110f0e comparison completed three runs per side on the same exclusive machine with identical runtime, package inventory and harness. Warmed all-thread averages were CI on previous head
Main 37572469797 and retained local main replays provide the independent evidence. The inspected source bridge from Previous-head CI Previous-head ClawSweeper review binds 6110f0e at 2026-10-07 05:54:16 UTC, with no actionable correctness/security finding. Both remaining checklist items concern the full matched SQL workload. Fresh exact-head review is pending for Historical local runs on The Gateway startup file also timed out in its first worker/recover case, followed by twelve fixture-open cleanup failures. The identical primary timeout and cascade reproduced independently on pinned main twice. The later failures are consequences of the unfinished first fixture, not twelve independent product regressions. Five main and five candidate repetitions reproduced the primary timeout on main twice and on the candidate zero times. A diagnostic replay settled 315 spans without locating a stalled await. All assertion classes had main counterparts except one handoff-pending observation at line 513; that observation and the underlying wait remain unresolved under the local test-failure policy, without a claimed repair. The earlier package, update, SDK, and other proof below remains explicitly pinned to its original source; it is not relabeled as new-head CI. Source: The shared campaign SQL observer follows the caller and its inspection/copy children through the actual
On warmed healthy/retained-agent requests, moved payload inspection is 27 → 0 MAIN statements. Remaining MAIN statements belong to existing snapshot staging locks and the cold capability probe. Malformed-file cases preserve three expected failed native reads, moved into the helper. SQL provenance hashes were checked against the committed bytes; the observer was unchanged.
The worker-cutover importer audit found no newly required host-owner routing. Historical broader importer testing passed 336 tests with four skipped and two local failures in Remote setup initially encountered stale Docker supplementary groups before code gates, then the first changed-check attempt stopped at the ratchet because OS PR context passed after template-heading alignment (run 37515589650). ClawSweeper completed its exact-head review at 2026-10-06 19:05 UTC with no actionable findings; its technical review explicitly says the automatic migration-proof warning does not apply because the persisted contract is unchanged. The published-driver update evidence above remains the compatibility proof.
CI run 37514890438 timed out in The owned-native token test's original CI failure changes only the shared-memory family hash before backup. Five isolated candidate runs produced one post-backup SHM mismatch and four passes; five pinned-base runs passed. Five exact-main Linux runs on Node 24.19.0 (matching CI) also passed, in 21/25/26/29/31 seconds. No same-case failure was found in the current scheduled-main run. Source tracing reaches unchanged read-operation/snapshot/backup owners and unchanged default branches in the schema-version helpers; it does not invoke the new restart inspection path. This remains an unattributed failure, not an inherited-main waiver or a proven fix. The one allowed rerun of its original CI shard passed (attempt 3, job 112472357449), including the original test group with 261 passed and 13 skipped tests. No production or test change is claimed to have fixed this failure; its cause remains unconfirmed. The execution-witness CI failure (“Agent schema admission changed before publication” in Overlap and scopeThis is the independently reviewable restart-preflight split of W6-02; session discovery and resident-row work follows separately. It does not depend on the session-reader branch. Related work: #166054 (merged), #166053, #166050, sqlopt-schema/sqlopt-envelope, the other wave-6 lanes, incognito P7k/P7m, and the locked-writes chain. Main cleanup #166077 was integrated for a named deadcode failure. #166074's idempotent timeout restoration was inspected: it does not introduce a known-timeout cache, and this change preserves tracking while configuring the source timeout at open. #162433 is the inactive umbrella overlap; this PR does not restructure its ownership design. Whoever lands second integrates main and preserves earlier cutovers. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…law#166252) * refactor(state): move restart preflight into inspection worker Inspect shared-state schema, registry, and retained deletion facts in the existing schema inspection child during Gateway restart. Keep startup and Doctor native admission callbacks and preserve snapshot cleanup ownership. Snapshot staging locks remain native; this path does not run during warmed chat turns. * test(state): reuse caller SQL observer in preflight regression * perf(state): reuse canonical contracts across preflight workers * fix(state): preserve extractable schema inspection callbacks * perf(state): reuse admitted schema content markers * perf(state): reuse canonical contracts in retention readers Carry already cached canonical validation definitions through the existing retention read request. Keep observed-schema checks, physical identity, freshness and retention retries unchanged. * perf(state): reuse the version read during schema admission * fix(doctor): preserve snapshot artifacts during device discovery * perf(sessions): reuse retained maintenance and chat freshness facts Reuse the guarded age deadline when maintenance has no archival or deletion work. Carry the retained worker's lifecycle timestamps into durable chat admission and consume the existing reset policy with the same current entry. Keep native incognito freshness and all source, authority, and retirement guards. The existing deadline regression now bounds empty passes to two writer transactions. The chat regression preserves stale-header daily reset decisions without host transcript reads. Focused proof passes 118 tests across nine files. * perf(sqlite): reuse admission facts during read validation Reuse the admitted native library capability for fresh WAL observations. Gather read schema facts once while validating the captured header before catalog inspection, then retain the full content and integrity policy. Preserve refusal precedence and live ownership checks.
What Problem This Solves
Gateway restart readiness copied SQLite snapshots but still inspected their shared-state schema, registry and retained-deletion payload on the Gateway thread.
Why This Change Was Made
Move inspection into the existing schema-inspection child, returning typed facts through the shared boot/Doctor/native kernel. Capture physical snapshot identity before yielding, retain it through child settlement, and preserve live restart-generation checks before effects.
Reuse source-keyed canonical expectations through the existing contract cache; observed schemas never become expectations. Each inspection rereads stored facts. Trajectory retention carries an already cached contract through its existing request; cold hosts do not build one for the handoff.
User Impact
The remaining delta preserves public APIs, storage, durability, retention, write queues and update behavior. Runtime payload inspection has no caller-thread fallback. Enclosing snapshots remain authoritative; later calls observe later commits. No new host-grant SQL or
OPENCLAW_*names.Boot/Doctor/native callbacks and staging locks retain their owners. Content markers follow admitted connection revisions, invalidated by foreign commits, local writes, rollback and schema changes; version floors apply per read. Actual schema, identity, quarantine, authority and freshness checks remain. Both extracted preflight modules stay inventoried.
Evidence
Current integration — qualified; inherited CI exception
Published head 91d1830, tree 07de1ae03171a53c0a2fcb4e3615930d844f09a7, integrates main 6aa9262 by merge commit for a real conflict. Only the retained-reader cache test conflicted: preserve main #166293's combined version-observation query/warmup alongside this PR's one-time header/catalog admission checks. The remaining delta is 28 files.
Main #166587 owns lifecycle timestamps and terminal commit-authority/source-identity checks; main #161057's Workshop retirement remains. Main #167035's target/build distinction remains: report the requested target, return early only beyond this build, and read the actual content marker for supported validation and maintenance admission.
Current proof passed 162 tests / 8 files (348.309 s), core types (16.306 s), all 27 test-type partitions (412.764 s), zero-cycle Madge (25.319 s), and full-delta P2. Fresh local SDK comparison passed in 456.930 s, ack 3c6481fb: zero direct public signature/kind/export/entrypoint changes; 131 reachable flags, six resulting declaration sections identical to the prior report. Released SDK inspection found no new compatibility action. SDK processes and temporary resources settled and were removed.
Trusted ClawSweeper completed this head at 2026-10-08T09:14:41.496Z, with no findings. Its pending local/SDK/native qualification requests are now complete.
One alternating M,C sanity pair on the same Linux host passed every functional outcome, including
mentions.dismiss, with zero native SQL failures and valid duration ratios. Both counting views agree:Connect +5 (+1.35%) is exactly five unchanged cron-startup worker statements shifted from main's first-turn into candidate connect, with identical full-run per-stack totals. It passes the explicit non-turn tolerance. First and warmed phases decrease; individual turn increases are diagnostics under the phase-median policy. No full series is needed. Lease admission required one 10-minute capacity backoff; native execution and cleanup completed, lease released.
Exact-head CI 37754308359 completed with 112 passed, 23 skipped, five inherited test-job failures plus their aggregate gate failure, each test failure independently reproduced on its exact main parent 54bd6ec, in source files unchanged by this PR. CI tested merge 6de97cd1be7c4a1830a9cd397e4306474ff9d1fe, ordered parents main54bd and PR91d. Security-fast passed. No jobs in the CI run were cancelled. Native admin admission retains complete checkout, root-job and aggregate evidence; no CI reruns or security exception. Independent merge-tree verification matches the actual tested merge tree. No merge is claimed until GitHub confirms it.
[false,true]indexing:trueEach reproduction was its first unchanged whole-file run with one test worker. Main's parallel transcript reader pool invalidates the completion-order assumption; independently awaited lock reads make first-caller victory nondeterministic; main's combined freshness SELECT adds the counted ancestry read; main #167008 adds the second explicit catalog snapshot read. The search-indexing producer was not instrumented; independent baseline reproduction establishes inheritance without claiming a repair. All declared failure-owner blobs match the baseline and tested merge.
Completed qualification of prior head 3037711
On main
35e5f4ab9818deb9347e2ec87c38aee8c05b3e05plus candidate30377118356f52ecc0fa8cf5f38f222337d44b6b(treee818b2f097ec118299541cd7be50639e90657231), all declared qualification completed before the new conflict. The older-target negative control failed the intended damaged-schema assertion (81.219 s); restored fixed source passed 310 tests/16 files, two existing skips (543.092 s), wrapper inventory (11.896 s), core types (30.128 s), all 27 test-type partitions (484.448 s), zero-cycle Madge (37.879 s), formatting and full-delta P2.SDK comparison completed locally with ack
f66bf4e5: zero direct public signature/kind/export/entrypoint changes, 131 reachable flags across six internal or optional declaration sections, no newly breaking released contract. Native cleanup completed. Exact-head CI 37750593535 finished 120 success/23 skipped/zero failures, including security-fast and openclaw/ci-gate; no rerun. Trusted ClawSweeper completed at 2026-10-08T08:43:02.181Z with no findings; its requested SDK/native qualification subsequently completed.One alternating M,C pair on the same Linux host passed every functional outcome, including mentions.dismiss, with zero failed native SQL statements. Both inclusive and successful-only counting agree. Main→candidate: boot 2711→2699; connect 405→400; first turn 3675→3647; warmed mean 1429.5→1425.7; second session 4907→4894; control 43→42; cron 1952→1949; compaction 778→775; shutdown 1062→1058. Total (diagnostic) 29828→29721. Every gated phase decreased; no tolerance or combined-window exception needed. Maximum duration ratio 1.0276; native exit and lease cleanup completed. This pass does not retroactively establish causes or repairs for earlier failures.
Statement admission uses phase medians. Historical individual warmed-turn increases of +1/+8/+7 are diagnostics, and historical compaction +10 is accepted by the explicit non-turn tolerance for unchanged background work. The historical strict report and all raw failures remain intact. One sanity pair qualifies each required integration; a full series is needed only for a PR-attributable first/warmed regression beyond the noise floor.
Historical 683 comparison — failed functional outcome retained
The single alternating macOS pair retained both samples. Candidate absent-ID
mentions.dismissreturned retryableUNAVAILABLE; every other RPC/turn/cron/compaction/shutdown outcome succeeded. Rollback precedes payload access, narrowed to native ownership/host admission; the swallowed cause remains unknown. The existing mention-owner suite passed 28 cases, not proof of repair or inheritance.All-thread first-turn work rose 3748→3805, while warmed mean fell 1487.8→1465. Deferred startup shifted into first: boot+connect+first fell 6966→6831, with matching startup ownership/cron-load/lease counts 123/9/4. Second+control+cron fell 7242→7209, but second alone rose 4949→5051 (+2.061%); canonical-ready reads were 0→37 and main-key reads 112→135 through existing producers. No added ordinary caller request was identified; exact timing/cache attribution remains incomplete. This is not an exact RPC/worker-request census. The additional maintenance authority check can replan on invalidation, but that was not established in this sample.
The explicit phase-median policy allows examination of adjacent combined windows; it does not erase the mention failure, establish its cause or qualify this newer tree. The control count includes its rollback; both samples retain one shutdown
BEGIN IMMEDIATElock error. No sample or failed statement was excluded, and the complete pair is not called passing.Complete historical evidence, raw failure tables and investigated uncertainties. All earlier strict SQL failures, unsuccessful attempts and source-bound limitations remain verbatim there. The seven investigated failure records are retained separately in the review evidence.
Overlap and scope
This independent W6-02 restart-preflight split leaves session discovery/resident-row work separate. Main's lifecycle, Workshop retirement, reader admission and authority changes remain. The residual change moves inspection and reuses canonical facts within existing owners.