Skip to content

refactor(state): move restart preflight into inspection worker - #166252

Merged
steipete merged 30 commits into
mainfrom
dbasync/w6discovery-preflight
Oct 8, 2026
Merged

steipete merged 30 commits into
mainfrom
dbasync/w6discovery-preflight

Conversation

@steipete

@steipete steipete commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

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:

Phase Main Candidate
Boot 2685 2673
Connect 370 375
First turn 3557 3521
Warmed mean 1347.9 1343.9
Second session 4608 4576
Control 44 44
Cron 1859 1828
Compaction 755 752
Shutdown 1049 1045

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.

Inherited case Main reproduction
Model-context completion order differs from submission order Same 128-result ordering assertion; 103.630 s
Refresh-lock contenders return [false,true] Same initial acquisition assertion; 33.133 s
Ancestry read budget observes 9 rather than at most 8 Same value; 46.211 s
Local model-catalog snapshot mock called twice rather than once Same value; 59.660 s; also scheduled main run 37751789220/job 113226895303
Search-scope payload retains indexing:true Same property assertion; 70.644 s

Each 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 35e5f4ab9818deb9347e2ec87c38aee8c05b3e05 plus candidate 30377118356f52ecc0fa8cf5f38f222337d44b6b (tree e818b2f097ec118299541cd7be50639e90657231), 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.dismiss returned retryable UNAVAILABLE; 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 IMMEDIATE lock 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.

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.
@clawsweeper

clawsweeper Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes scripts Repository scripts size: L labels Oct 6, 2026
@steipete

steipete commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 8, 2026, 5:14 AM ET / 09:14 UTC (Revision 42).

ClawSweeper review

What this changes

This 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 src/infra/sqlite-schema-facts.ts, src/state/openclaw-state-db-schema-version.ts. Prefer a design that avoids changing persisted SQLite tables. Migration or upgrade compatibility proof is recorded, but maintainers should still confirm that the schema change is necessary.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful and source-clean with substantial real-path evidence, but measured confidence in the latest integrated composition remains limited.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (logs): Recorded readiness-boundary traces exercise the moved production inspection and preserve all 33 outcomes while eliminating warm caller payload SQL; completed native Gateway workloads on the qualified predecessor also preserve functional outcomes. The new integration's separately declared sanity qualification remains outstanding. Source inspection confirms no persisted schema, serialized format, or migration change.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes
User problem: Database inspection during restart readiness occupies the Gateway thread and can delay other work.
Reason: The change follows the established area's worker-access direction and removes measured caller-thread work through existing owners without adding a user-facing surface.

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
Reviewed head: 91d1830533818ccbbb27efe4fb15490595adcd6d

Before merge

  • Resolve merge risk (P1) - The integrated head's runtime SQL and declaration compatibility qualification is unfinished; the completed predecessor results do not establish the new reader-observation composition's measured behavior.
  • Complete next step (P2) - Complete and record the declared integrated preflight, test-type, import-cycle, SDK, and alternating native qualification for head 91d1830.

Findings

None.

Tests

  • Missing end-to-end proof: The declared alternating native main/candidate sanity pair for head 91d1830 is still pending. Reported predecessor negative controls and passes remain attributed to their original sources; this read-only review did not execute them.
Agent review details

How this fits together

Before 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]
Loading

Technical review

Best 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 options

Maintainer options:

  1. Complete the integrated qualification (recommended)
    Finish the declared SDK comparison and alternating native pair for the reviewed head, preserving functional outcomes and applying the recorded SQL acceptance policy.

Provenance checked

Testing

Proof path: shipped entry point. Added test files: 9.

Security

None.

Evidence

What I checked:

  • Distinct work remains on current main: Current main still opens the shared-state snapshot and reads its schema, registry, and retained-deletion facts in the caller. The introduced branch dispatches runtime inspection to the existing child while retaining native boot and Doctor callbacks. (src/state/openclaw-database-preflight.ts:252, 91d183053381)
  • Snapshot custody and settlement: The launcher captures snapshot identity before yielding, checks it after the response, and exposes joined child disposal. The preflight owner retains snapshot cleanup until that disposal settles. (src/state/openclaw-agent-schema-inspection-worker.ts:222, 91d183053381)
  • Version-cache boundaries: Only the content marker is retained at the admitted schema, foreign-commit, and local-mutation revision; each read applies its own published-version floor. Transactions, pinned snapshots, and dynamic authorizers remain outside this reuse. (src/state/openclaw-state-db-schema-version.ts:40, 91d183053381)
  • Previous review item and current qualification: The latest body explicitly completes the previous head's SDK comparison and alternating Linux native pair: every functional outcome, including mentions.dismiss, passed with zero failed native SQL statements and decreased gated phase counts. For head 91d1830, it reports 67 affected tests and core types passed, but preflight tests, test-type lanes, Madge, SDK comparison, and the alternating native pair remain in progress. Historical failures are not presented as repaired or inherited. (91d183053381)
  • Direct production-boundary evidence: The historical archive records 33 readiness requests through assertOpenClawDatabasesReady with preserved outcomes and nonincreasing caller/all-process SQL counts; warm healthy payload inspection fell from 27 caller statements to zero. It also retains published-driver update proof and native runtime qualification under their original source identities. Relevant archive ranges were inspected; this does not assert complete reading of every historical range. Captured archive SHA-256: d4775734dd15ab0dc1171e89ced575dbb2149236379d0eb3594280918040c15b. (21796d60730a)
  • Recorded performance disposition: The author and established area owner records a phase-median policy, accepts historical individual warmed-turn increases and the unchanged-background compaction tolerance, and requires one sanity pair per integration. Those accepted historical tradeoffs are not additional blockers. (705920552aeb)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

PR surface

Source +402, Tests +388, Docs +20, Other +1. Total +811 across 28 files.

View PR surface stats
Area Files Added Removed Net
Source 17 611 209 +402
Tests 9 434 46 +388
Docs 1 20 0 +20
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 0 +1
Total 28 1066 255 +811

Stored data model

Persistent data-model change detected: database schema: src/infra/sqlite-schema-facts.ts, database schema: src/state/openclaw-state-schema-preflight.ts, migration/backfill/repair: src/state/openclaw-state-schema-preflight.ts, unknown-data-model-change: src/infra/sqlite-schema-facts.ts, unknown-data-model-change: src/state/openclaw-state-db-schema-version.ts. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded runtime responsiveness improvement with no established urgent user-facing regression.
  • merge-risk: 🚨 other: The remaining concern is unqualified SQL overhead in the integrated reader/cache composition; historical tolerances are already accepted and are not reopened.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Complete the declared integrated SDK comparison and alternating native sanity pair, recording functional outcomes and phase counts for the reviewed head.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (41 earlier review cycles; latest 8 shown)
  • reviewed 2026-10-07T22:33:49.670Z sha 378d30e :: blocked before merge. :: none
  • reviewed 2026-10-07T23:24:40.299Z sha 378d30e :: blocked before merge. :: none
  • reviewed 2026-10-08T03:17:55.202Z sha 7059205 :: blocked before merge. :: none
  • reviewed 2026-10-08T03:52:04.550Z sha 7059205 :: blocked before merge. :: none
  • reviewed 2026-10-08T04:34:56.535Z sha 7059205 :: blocked before merge. :: none
  • reviewed 2026-10-08T04:54:03.610Z sha 7059205 :: blocked before merge. :: none
  • reviewed 2026-10-08T07:51:20.236Z sha 6834b33 :: blocked before merge. :: none
  • reviewed 2026-10-08T08:43:02.181Z sha 3037711 :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 6, 2026
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Oct 6, 2026
@steipete

steipete commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Oct 7, 2026
@steipete

steipete commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete

steipete commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 8, 2026
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.
@steipete

steipete commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete

steipete commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

Historical evidence for PR #166252

The complete Evidence section below is copied verbatim from the verified published body for head 6834b333374942a32a8c4b1e09a158922efa882c. “Current” and pending statements retain their original historical meaning. This archive preserves every recorded failed sample, table, investigation and limitation; it does not qualify a later tree. The PR body owns current source and gate status.

Evidence

Current candidate 683 — qualification pending

Head 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 mentions.dismiss succeeded; that absent-ID request returned retryable UNAVAILABLE. Raw traces show rollback before mention payload access, narrowed to native ownership/host admission. Its exact swallowed cause remains unknown; no repair or inherited-CI waiver is claimed. The existing mention-owner suite is being checked. New-head CI and ClawSweeper are pending; the complete pair is not labeled passing.

Sanity phase (all threads) Main Candidate C/M duration
Boot 2780 2765 0.662
Connect 438 261 0.261
First 3748 3805 0.824
Warmed mean 1487.8 1465 0.705
Second session 4949 5051 1.247
Control 43 122 1.094
Cron 2250 2036 0.692
Compaction 650 635 0.836
Shutdown, inclusive 1914 1907 0.434

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 BEGIN IMMEDIATE lock error. No sample or failed statement was excluded.

Previous 705 — historical measurements and CI

3ac5189 → 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 UNKNOWN mergeability. Baseline samples remain intact. The corrected launcher bounded-polls every three minutes, revalidating the head and lease budgets. Both old owned leases are released with cleanup complete.

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 sql-comparison.md; medians below are successful/inclusive where they differ.

Phase Main median 705 median Change
Boot 2739 2728 -11
Connect 421 396 -25
First turn 3716 / 3718 3674 -42 / -44
Warmed per turn 1435.8 1434.6 -1.2
Second session 4931 4916 -15
Control plane 42 42 0
Cron 1987 1960 -27
Compaction 833 843 +10
Shutdown 1070 1063 -7
Total 30100 29970 -130

Original strict failures, identical in both views:

Phase Main samples 705 samples Median change
Turn 04 [1428, 1422, 1429] [1428, 1429, 1429] +1
Turn 05 [1421, 1421, 1421] [1429, 1429, 1429] +8
Turn 08 [1437, 1435, 1436] [1449, 1440, 1443] +7
Compaction [833, 833, 833] [830, 843, 846] +10

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 BEGIN IMMEDIATE calls and candidate's zero; no sample was removed.

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 failed rather than interrupted before the successor starts; all preceding lease, receipt and exit-budget assertions pass. Exact Linux/Node24.19 whole-file comparison: main 52747cb 5/5 pass, tested merge 110c4435 4/5 pass, with replay2 reproducing the CI mismatch. All ten raw logs and source identities are retained. One post-exit diagnostic passed (52.668 s), showing six interrupted sessions; it did not identify the original failure producer. Recent main run 37719593344 has no matching handoff failure. Cause remains unresolved; no repair or inherited-main claim. After that investigation, the single-job rerun passed. Exact-head attempt 2 completed 116 successful / 23 skipped / zero failed or pending jobs, including openclaw/ci-gate. This passing replay is not a repair or main-inheritance proof. Both evidence archives were verified and the lease stopped. Two earlier local lint attempts timed out before lint at unchanged SDK-preparation limits; hosted success does not relabel those attempts.

Previous 378 — inherited widget fixture failure, repaired on main

CI 37696109238, root job 113048736013, failed test/gateway-widget-restart.e2e.test.ts; the aggregate also failed, while security-fast passed. Its checkout 6a788665f8d53b20cca1514e70d7dbabf7a86b44 combines main c19dc23 with head 378d30e.

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 failed

Published 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:

All-thread phase Main samples Candidate samples Median change
Warmed turn 2 1530, 1536, 1542 1524, 1537, 1540 1536 → 1537 (+1)
Control-plane 49, 53, 56 51, 55, 55 53 → 55 (+2)

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 BEGIN IMMEDIATE lock refusals remain counted. No retries, exclusions, timing allowances or noise waiver were used. The owned lease and all observed processes are settled.

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 update-command-mutable-signals.test.ts fail before admission because the handoff resolves outside the private fixture. Main #166722 / 87f2a98 changed the dependency subpath to @openclaw/fs-safe/secure-temp-root, while the test hooks intercept only @openclaw/fs-safe/temp. Five unchanged whole-file runs on main c669 and five on PR 9a04 reproduce 190/190 identical failures with Node 24.19.0 on macOS; CI uses a Bun parent on Linux with Node 24.19.0 children. A separate real-consumer negative control on the exact Bun 1.4.3 fork also reproduces the hook mismatch. Source hashes remained unchanged; no CI rerun was requested. The fixture-only correction f2e25af is now published on main and integrated above. It passes 42 Node cases, the original 19 with the exact Bun parent, and a direct Bun consumer/witness check; selected gates and P2 pass. Private-directory and consumer-witness assertions remain intact.

Earlier 29644 ownership CI failure was independently inherited and repaired on main. Run 37678068521, job 112987271835, failed the malformed shared-store ownership case in doctor-config-preflight.legacy-owner.process.test.ts:169 (expected 78, got 0/__READY__). Five original main030 / PR296 file runs per side passed 80 cases; unchanged newer main e730 and the merged PR reproduced the failure. Main #166617 removed the incidental startup lease check when deferring optional registry writes. Fix 7cbba45c1323, verified on main f8349c4, calls the existing ownership parser on the open readiness handle. Its 48-test/three-file proof, core/lint/P2 passed; the extracted kernel retains that check. No PR CI waiver was used.

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 bb710

Published 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 SESSION_WORK_START_CHANGED in 16 Gateway logs. This does not conclusively identify the older race.

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 [5350,5390,5382], candidate [5293,5425,5409]. The representative medians are both repetition 3; the excess is worker SQL. Maintenance plans increased 8 → 13 and age commands 14 → 23 in that repetition. Warmed mean-per-turn median improved 1594.7 → 1563.1, and full-workload median 33091 → 32670; those savings do not waive the failing phase. All six full workloads passed functionally, and all 33 readiness outcomes passed and matched. Candidate runs contained 0/2/1 failed native statements, versus main 0/0/0: first-turn host BEGIN IMMEDIATE admission retries subsequently succeeded. Their causal relation to the later worker-only increase is unproven. No retry, exclusion, or noise allowance was used; every sample is retained. The AWS lease was released with authoritative cleanup complete at 2026-10-07 18:51 UTC.

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 proof

Published head de3fbff, tree ba98b075c8e25b168b673d56df2b8d7130e6827f, merges protected main 7a8e5a1 into 6b22fb4e. GitHub confirmed it MERGEABLE after publication. No rebase or dependency patch was used.

The three conflicts came from main's #166503 (cb01febf9fa4f). Resolution preserves its guarded worker-thread capability/canonical-definition receipts and this PR's explicit preflight/retention subprocess IPC. The read-only broker transport is a subprocess, so the thread receipt does not replace that handoff. Both transports feed the same source-keyed canonical-definition owner. Inherited thread receipts keep the format, PID, current-source hash, and entry-type checks; maps are copied at boundaries. Only fresh canonical construction publishes thread receipts. Actual target-schema comparison, cookie checks, and lifecycle invalidation remain unchanged. Both transport regression cases remain.

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 (d9a083657dba5) now applies the same existing artifact-preserving scope directly around the Doctor device-identity read. This independently covers the earlier Doctor defect. This PR retains propagation of the caller’s requested scope through discovery; the two scopes nest as the same boolean AsyncLocalStorage setting and the scope operation itself performs no SQL or snapshot work (src/state/openclaw-state-db-readonly.ts:229). The changes merge cleanly and preserve both sides. The restart-inspection cutover remains absent on main.

Historical 7a8e5a1 → de3fbffd SDK/boundary pass, ack 18e5e388: public declarations unchanged, 131 internal reachable changes; no shim.

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.

Measure (all threads) Main 7a8e5a1 PR de3fbff
Warmed mean-per-turn median 1594.2 1563.7
Full-workload median 33102 32527
Control-plane median 51 51
Readiness total, successful 2316 2148
Readiness total, including expected failures 2319 2151

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 src/sessions/session-state-events.test.ts and the initial unrestricted-provider response in test/e2e/qa-lab/runtime/telegram-model-picker-prepared-gateway.e2e.test.ts. Failed logs were fetched once. Both exact-main/tested-merge investigations are complete below; neither failure is waived or classified as inherited. The single session-job rerun passed, and the single Telegram-job rerun is pending. Native exact-head review validation and GitHub-pending preparation have completed. Native security/CI admission remains required; no merge request is armed yet.

Session-state CI investigation completed; cause remains unestablished. The unchanged whole file src/sessions/session-state-events.test.ts ran five times singly (node scripts/run-vitest.mjs src/sessions/session-state-events.test.ts --maxWorkers=1) on exact main 1caa1c8 and tested merge 1413de5f, with separate dependencies/module caches and stable clean source pins, on macOS Node 24.21.0. All 170 cases passed, including all 60 native-verdict variants. Main times were 351.872, 195.293, 146.115, 181.787, 229.138 s; merge times 275.587, 134.387, 228.693, 194.573, 110.547 s. The immediate test/admission owners are identical across the pair, but the flow reaches changed schema/cache infrastructure, so source equality does not establish independence. The original CI assertion only proves that changedAfterVerdict stayed false; later recorded-row/version assertions were not reached. A source/facts refusal or peer-update failure is possible, not proven. Main’s exact commit had only security-scope CI, so it supplies no counterpart test result. Under the authorized policy for an unattributable failure after this investigation, exactly one single-job rerun of 112889856867 was requested. The replacement job 112909923677 passed at 2026-10-07 17:13:33 UTC on unchanged head de3. This is a passing rerun, not an established repair. Scheduled main CI 37653464694 also passed all 17 session-state cases; it does not prove the original failure was inherited. The workflow remains failed solely on the original Telegram job plus its aggregate gate. No repair, inherited classification, assertion change, or extra local retry is claimed.

Telegram CI investigation completed; cause remains unestablished. The unchanged whole test/e2e/qa-lab/runtime/telegram-model-picker-prepared-gateway.e2e.test.ts file ran five times singly per side with node scripts/run-vitest.mjs test/e2e/qa-lab/runtime/telegram-model-picker-prepared-gateway.e2e.test.ts --maxWorkers=1, on exact main 1caa1c8 and tested merge 1413de5f, using Linux x86_64/Node 24.19.0, npm 11.17.0, and pnpm 12.5.1. Both independent frozen installs and private-QA builds passed. All 30 cases passed, with unchanged source/test hashes and no excluded run. Main times were 145.409, 120.997, 117.349, 119.476, 121.484 s; merge times 142.093, 115.090, 115.940, 114.087, 113.785 s. Ten direct owner/test/harness files match, but changed startup/schema paths remain reachable, so inheritance is not established. The original failure is the first response’s missing mdl_list_ollama_1 callback at line 674 after later callback interactions succeeded. The original payload was not logged; a catalog publication/refusal race remains a hypothesis. Scheduled main 37653464694 supplied no matching failure. Under the authorized post-investigation policy, exactly one single-job rerun was accepted for its current-attempt counterpart 112909918457. The initial request using the older attempt’s ID was explicitly refused without execution; no extra test rerun occurred. No source fix, changed assertion, or inherited-CI waiver is claimed.

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 96ccec4a and its tested merge 94c046eb each failed only the stop case 5/5 times, while all 30 sibling cases passed. Every stop failure was the same count assertion; captured follow-ups were accepted, then refused with SESSION_WORK_START_CHANGED 93–132 ms later. The invalidating writer remains untraced. Both investigation leases are released with cleanup verified. Current de3 CI ran and passed all four requester-restored cases, including stop, and all five requester-owner cases. This is a current-head pass, not a claimed repair of the old race. Historical observations and the bounded original-source comparison remain separate from current admission. Security is never waived.

Previous candidates, measured failures, and source-bound investigations

Previous candidate 6b22: source-bound integration and repair evidence

Published 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:

  • e90dcde passes the already-read published version into content-version validation. Native traces showed an immediate duplicate PRAGMA user_version during cold admission. The existing registered-worker regression fails on old production at 3 reads versus 2 and passes with this one-line repair. All 15 cache-boundary tests pass, including foreign commits, rollback, and dynamic-authorizer refusal. This adds no cache lifetime, signature change, or SQL.
  • 6b22fb4 preserves copied SQLite artifacts during Doctor device-identity discovery. All three original migration-plan failures reproduced 5/5 on exact main 96ccec4 and 5/5 on 1ee. Tracing found that the device detector lost the planner's existing artifact-preserving scope, so an ordinary read-only open created or altered source shared-memory bytes. The existing discovery owner now applies the snapshot scope when requested; normal identity reads and mutation authority are unchanged. The final repair passes 51 tests in three unchanged files (271.016 s), and the original full planning file passes 7/7 on this combined tree (198.311 s).

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 (cb01febf9fa4f) landed after this tree's validation and now conflicts in capability tests and canonical expected-definition reuse. Its worker-thread admission transfer must be preserved; the next candidate will reuse that owner and remove any superseded unreleased handoff. The published head is not merge-ready.

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 evidence

Published head 1ee9635, tree b19670d66bb8b07772dcfcbbd38830f159f3cd22, merges protected main 7a75498 into prior d3a2f2d5. The merge resolved without conflicts. It incorporates main's 4ed39a25f674c fixture fix (join projection disposal before shared-state close) and 1d10375ee563b terminal-font contract correction. No rebase or dependency patch was used. Main's newer device-auth worker, session-manager, membership/discovery and runtime changes remain intact.

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 [68,68,68], candidate [65,69,69]. This is a failure in both stock-successful and failure-inclusive views, with zero native SQL failures on either side. Every other measured phase and each individual warmed-turn median was nonincreasing; warmed mean-per-turn median 2259.7 → 2228.5, full-workload median 43477 → 42992. All 33 readiness outcomes were preserved and each cell was nonincreasing: total successful statements 2316 → 2148, failure-inclusive 2319 → 2151 (the expected malformed-input reads are included).

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 state-migrations.plan.test.ts artifact-identity / shared-memory failures reproduce on the exact tested main baseline 96ccec4a; the bounded five-run comparison and mutation tracing remain in progress. The restored-requester stop case expected two model requests and saw one; exact-main versus tested-merge reproduction remains in progress. No current CI exception is claimed. ClawSweeper completed its exact-head review at 2026-10-07 14:13 UTC, finding no actionable code or security defect; the required SQL gate remains unmet. A newly landed test-cleanup change now conflicts in the preflight test file, so main integration is in progress while preserving both that cleanup and this PR's caller-thread regression.

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 d3 CI attempt 2 remained red after the single archive-job rerun. Category and archive fixture repairs are now integrated from main and pass the full local files. The older visible-yield timeout was independently reproduced with an identical diagnostic snapshot on exact main de38; restored-requester stop and three requester-owner yield failures retain their unresolved current-source attribution. The newer shared identity/session changes make those prior-head results historical. Fresh exact-head CI and ClawSweeper now determine current readiness; no old failure evidence is being presented as a waiver for this head, and security is never waived.

Current landing status

Current candidate d3a2f2d, tree 6a8d6184d8a5571b52caf68367ae6b6f472dc644, merges main 0dc2091 into reviewed predecessor 767c0856153875cca3a354d93e705f0b2bd98452. The sole conflict was the update-status test's SQLite-version replacement. Main's generalized replacement preserves the combined probe behavior and removes that file from this PR's delta. Main's session receipt publication, read-only canonical admission, raw-key worker reads and restart crash-loop handling remain intact. No rebase or dependency patch was used.

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 0dc20916 is required and is not yet claimed.

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 0dc20916 is scoped-clean. SDK passed: 0 entrypoint/export changes, 131 reachable changes, digest b635ee05, 1202.807 s. No released sync/async signature or required parameter changes were introduced. Current exact-head CI disposition and the matched SQL gate remain required before landing.

Exact current-head CI run 37613514952, attempt 1, tested merge 39ae311c39c3a90c339f0d693e97b8b7cba7c352 with ordered parents main de38a04548251cbd6cc7e190c1470412c077908b and PR d3a2f2d5. It completed with 107 successful jobs, 23 skipped, five failed root jobs and the failed aggregate, no cancellations. Security-fast passed. The terminal-font TS2353 is independently qualified on current main: all 16 critical source/compiler inputs match the earlier exact-main reproduction. Category registration is independently qualified: both exact cases failed in 5/5 main de38a045 and 4/5 candidate d3a2f2d5 single-file runs. The visible-yield continuation timeout and teardown ENOENT are also qualified by exact-main scheduled run 37614737482, job 112770574447: its normalized authority-rejection, child-success and dispatching/replay-count-2 snapshot matches PR CI; the first rejected authority predicate remains unknown.

Archive investigation and one permitted rerun: five unchanged single-file runs per revision (--maxWorkers=1, macOS Node 24.21.0) produced read-admission errors in other cases on main 3/5 and candidate 2/5 runs. Neither CI case—sessions.patch waits for orphaned provisioning cleanup (failure=true) or sessions.patch leaves active placement unarchived and releases its drain when reclaim is rejected—reproduced. The suites close shared state before the canonical projection-disposal hook, a concrete fixture lifetime hazard; it is not claimed as a proven cause of these exact cases. Assertions, timeouts, source and harness remain unchanged. With the required paired investigation complete and this case gap retained, one single-job rerun of 112766829402 is being requested under the investigation policy. A passing replay will not be described as a fix or main inheritance.

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 767c0856 passing proof remains historical; the CI and SQL outcome records are retained.

CI run 37604823423, attempt 1, completed on predecessor 767c0856: 104 successful jobs, 23 skipped, two failing root jobs and the failed aggregate, no cancelled jobs. terminal-panel-fonts.test.ts:56 TS2353 is independently reproduced on exact CI main 3fc3205a; #166213 removed the boot signal option and later #166180's test still supplies it. UI, producer, compiler inputs and dependencies match the tested merge. The separate restored-requester stop E2E expected two model requests and saw one. That exact failure reproduced on main 3fc3205a in the third of five unchanged single-file runs, independently proving inheritance. The full paired main/CI-merge investigation is finishing; the underlying timing mechanism remains unknown. No CI rerun has been made.

Trusted ClawSweeper review completed on 767c0856 at 2026-10-07 10:16:35 UTC, revision 15, with no actionable correctness/security findings. Its technical review confirms there is no stored-data contract change requiring migration. Remaining performance evidence is supplied above; a new head will require fresh review. Security is not waived.

Historical proof, failures and investigations (explicit source bindings)

Landing candidate — full SQL comparison pending

Current published candidate is 767c085 (tree 1feb256fa6db9daa0342e79c0c5939458dfcf7bd). It is a merge commit over repaired head a98c2d0dc708 and current main 68ea994, preserving both sides. The sole textual conflict was the SQLite test helper: the resolution retains the real native-statement spy and timeout assertion, plus main's one-query assertion. Main #166265 now supplies the same combined native capability probe; this PR reuses it. Main's incognito retention settlement, typed lease and mutation-counter changes remain intact. No rebase was used.

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 68ea9948 → 767c0856 tests, types, Madge, P2 and SDK passed (ack 6f29107d). Its later CI and SQL outcomes remain recorded above; these are not current-head gates.

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 6110f0e clean. 9aa → a98 SDK passed: 865.353 s, 1ce31e86, zero entrypoint/export changes, 131 reachable changes. This report remains historical after main integration.

Integrated head 6110f0e (tree a60fe2ff26c6493bcbea35ac698bfd294931226c) merged main 9aa7455 without conflicts. This includes #166217's MCP SDK advisory fix, #166403's Board read-path repair, and #166253's schema-admission/lease-test repair. The last changes the schema-fact revision owner used here, so its integration received fresh focused proof, typechecks, cycle checks and review. No rebase was used. Commit 1ef0114 fixes the original unbound-method lint failure; 6bc55fe removes repeated content-marker reads under the existing connection revision.

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.

6110f0e passed production/27 test-type partitions (released preparation included), zero-cycle Madge, P2; 116 tests/5 files, 549.575 s covering reader/schema/policy/preparation/creation-witness contracts. The earlier cache regression failed on its unfixed implementation with ten redundant marker SELECTs; the current implementation preserves zero repeated marker SELECTs across ten unchanged requests while retaining all ten freshness probes and requested reads. It also preserves peer updates, malformed/newer refusals, local mutation/rollback, caller floors and authorizers. Exact-head CI completed; the test jobs with inherited failures are listed below.

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.

6bc55fe48 passed format/type-aware lint, 83 focused tests, eight Board/preflight/snapshot/wrapper/import integration files (493.554 s), owned-native-token (1/1, 38.709 s). That token replay does not establish a repair for its earlier intermittent failure. SDK reports 0be7509 → 6bc55fe (digest c8e021c1) and local 9aa7455 → 6110f0e (98287b1a) passed: each zero entrypoint/export changes, 131 reachable changes. Earlier proof remains historical.

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 [2431.8, 2436.5, 2440.3] on main and [2398.7, 2407.0, 2391.6] on the candidate: medians 2436.5 → 2398.7. Full-workload medians fell 46272 → 45612. However, the first warmed turn increased 2446 → 2455 (+9) because its helper-process median increased 38 → 73 while workers fell 2380 → 2354 and MAIN stayed 28. Every other measured phase median was nonincreasing. The strict per-flow gate is therefore not satisfied, and no merge will be submitted until this is resolved. Captured statement order identified broad retention-sweep invalidation by unrelated session metadata writes. The same unchanged retention logic and extra sweeps occur on main; the candidate interleaving encountered more of them. Each fresh helper redundantly constructed 17 canonical DDL statements and read their expected definitions, even though all six runs already built the same map on MAIN during the first turn. Commit a98c2d0dc708 reuses that existing map; it preserves the sweep retry and mutation checks. Aggregate savings and sample spread do not waive the failure, and the unchanged three-run harness must qualify the repaired head. Earlier 68718f238 also failed its warmed gate by one statement; that historical result remains separate.

CI on previous head 6110f0e, 37577679333, attempt 1, tested merge 4b46183c5d4a5845ad32751ecd6645f98727b5fb with ordered parents main fcb147d and PR 6110f0e. It finished with five failing test jobs and no cancelled jobs. All 13 failing cases have independently reproduced main counterparts in untouched tests and failure owners:

  • Diagnostics warning spy: the same empty-spy assertion reproduces on main 078ca895 in the exact 23-file PR order, although standalone and main's different cohort pass. The capture/timing mechanism remains unknown.
  • Reply admission: all four physical-release assertions fail on main CI and five paired repetitions. The fixture assumes one idle executor after main intentionally increased retention to four.
  • Reconciliation lifecycle: the same four-versus-one idle-lease assertion fails on main CI and five paired repetitions.
  • Cron retention: the missing-deletion-history byte mismatch occurs on main CI and local replay; the fixture snapshots database bytes without awaiting asynchronous worker-close settlement. Exact checkpoint timing is not claimed.
  • Session creation: all six admission-closed cases have main counterparts, five in scheduled CI and the native-consent case in a focused main reproduction. Fixture reset can revoke an executor while its previous owner is still closing; the exact interleaving is not claimed.

Main 37572469797 and retained local main replays provide the independent evidence. The inspected source bridge from 078ca895 to the tested main fcb147dc preserves the failing guards, revocation and four-idle policy. #166412 adds custody during full-integrity verification but does not alter those invariants or interact with this PR's content-marker read scope. The relevant owners match between the CI baseline and tested merge. No direct test execution on fcb147dc is claimed. The complete native inherited-failure evidence binds all five jobs, every case, the checkout composition, source hashes, logs and aggregate failure. Security-fast passed. The Security Review publisher also succeeded, and its sensitive-review status is successful; native admission still owns final security and authority clearance.

Previous-head CI 37572617073 also timed out after 120 seconds in src/plugins/install.managed-npm-authority.e2e.test.ts, “refuses a returned Promise after real npm-pack preparation without moving the original project.” The 6110 job 112650555994 passes both cases in 2352 ms / 1941 ms (file 6.57 s). The source audit finds filesystem/manifest/npm child execution and no changed preflight or inspection owner executing in the test body. The stuck phase remains unknown. Local attempts were refused before tests by the managed-artifact separation guard; paired Linux proof completed on Node 24.19.0/npm 11.17.0: five file-alone runs passed on main 9aa and five on 6110, 20/20 cases. The npm-pack case took 3.52–3.59 s on main and 3.46–3.70 s on the candidate. The npm investigation's lease is released. The current pass does not establish a fix or main inheritance, and no waiver or CI rerun is requested for this historical timeout.

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 767c08561538. Its technical review confirms no persisted-data contract change; the automatic schema warning does not imply a new migration. Fresh P2 autoreview is scoped-clean. No merge request has been submitted.

Historical local runs on 68718f238 exposed lifecycle marker timeouts and an owned-native artifact-token mismatch. Five candidate lifecycle repetitions produced 46 passed and four failed cases; five main repetitions produced 49 passed and one failed case. The original three snapshot-marker cases passed all 15 main comparisons; a separate snapshot-cleanup-entry failure occurred on both revisions. Five token repetitions produced one candidate failure and four passes versus five main passes. An observation-only lifecycle run passed all ten cases. These results do not establish a repair or justify an inherited-CI waiver for the unmatched failures; no safe source repair was established. Assertions and timeouts are unchanged. These remain investigated local failures with unresolved causes under the repository test-failure policy, not repaired defects or inherited-CI exceptions. The exact-head native review retains the original failures, attempted reproductions, evidence, and remaining uncertainty.

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: 21796d60730a280070036d0eaee26c0a45bed001; tree: 9b3a5c09f71bf355ab4b652d828c5c910ab0a9a3; pinned base: 71b59f0b23df88e07b767b2e3d5cc298fb2af7d3.

The shared campaign SQL observer follows the caller and its inspection/copy children through the actual assertOpenClawDatabasesReady({ operation: "gateway-restart" }) entry. Fixture setup runs separately. Each case starts a fresh caller, then makes one cold and two warm requests, each with a fresh inspection child. All 33 before/after requests preserve the outcome and do not increase MAIN or all-process statements. Both warm repetitions have identical counts. This is a standalone readiness entry, not a full Gateway server turn; ordinary turn/discovery paths are unchanged by this independent split.

Synthetic state Cold MAIN before → after Cold all before → after Warm MAIN before → after Warm all before → after
absent 0 → 0 0 → 0 0 → 0 0 → 0
healthy 317 → 18 330 → 317 44 → 17 57 → 45
retained-agent 317 → 18 330 → 317 44 → 17 57 → 45
active-newer-agent 334 → 35 365 → 350 61 → 34 92 → 78
newer-state 26 → 18 39 → 37 24 → 17 37 → 36
older-v1 36 → 18 49 → 44 34 → 17 47 → 43
legacy-v16 47 → 18 60 → 54 38 → 17 51 → 46
legacy-v16-malformed 43 → 18 56 → 50 34 → 17 47 → 42
malformed-content 24 → 18 37 → 34 22 → 17 35 → 33
malformed-metadata 40 → 18 53 → 40 38 → 17 51 → 39
malformed-file 20 → 18 33 → 31 18 → 17 31 → 30

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.

  • Focused owner/lifecycle/restart/primitive/migration/CLI/import/build-graph proof: 568 passed/2 skipped, 32 files, --maxWorkers=1, 1798.355 s; all import-closure suites and test/scripts/runtime-process-build-graph.test.ts included.
  • Separate primitive/schema-contract proof: 156 passed/2 skipped, 28.475 s.
  • New real two-child regression starts with a cold contract cache, verifies the first response publishes canonical contracts, and verifies a second fresh child reuses them without additional canonical DDL or fingerprint drift: 9.690 s test time. Its negative control changed IPC field ordering and failed for the intended index mismatch (7.673 s test, 464.773 s loaded-host command wall). The earlier caller-SQL regression uses the shared observer. These process-boundary contracts require real inspection children; no per-test Gateway boot was added. CI seconds are not yet measured.
  • macOS arm64 adapters passed: Node 24.16.0 (5.752 s), 26.1.0 (3.856 s), Bun 1.4.0 (24.825 s); timeout/read-only, combined probe/reuse, JSONB, extensions, NUL, guard, cleanup. Bun: production SQLite 3.53.4. Official binary checksums verified.
  • Bun IPC: cold publication and reuse by a distinct child passed (1.971/2.620 s; 30.982 s wall); both children exited before return. This is behavior/lifecycle evidence, not a Bun SQL-count claim.
  • Madge: 0 cycles, 69.427 s. Database-worker ratchet against the pinned base: passed, 18.316 s. git diff --check passed.
  • Independent Codex P2 review: partitioned review scoped-clean; a final cohesive pass inspected cache/IPC/snapshot ownership and raised one proposed regression. Rejected after checking the pinned baseline: src/state/openclaw-database-preflight.ts:448 already returned immediately on registry errors, exactly as the current missing-journal result does. Raw findings are retained; no accepted/actionable P0–P2 finding remains.
  • Historical 21796d60730a SDK (ack a3c37619) retained 131 reachable closure changes and no direct export changes. Its package build, 2026.9.8 → candidate managed-update cell and changed checks passed. These results remain bound to that source, not the current head.
  • Final-commit startup check: pnpm test src/gateway/server-agent-database-startup.test.ts --maxWorkers=1, 13/13 passed in 172.287 s command wall (258.930 s including fresh-runner bootstrap). Both historically failing cases passed in this single unchanged run; assertions and timeouts were not changed. This current-head result does not establish the cause of the earlier failures.

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 src/gateway/server-agent-database-startup.test.ts: “applies startup admission while worker follows its recover lifecycle” expected pending but received inspection-failed at line 460; “reports history in a skipped unconfigured agent store as not found” timed out at line 844. The same startup file passed on pinned main (13/13, 394.798 s) and the earlier cutover candidate 7df1561691196f23d6ac4a6725da8c5601e07d65 on AWS (13/13, 173.951 s), with original order and limits. Timing suggested load sensitivity but did not establish the cause; those failures are not called fixed or inherited-only. The final 32-file group is separate, successful evidence and does not include that exact startup file; it includes the preflight lifecycle/startup-index/startup-integrity/startup-prepared suites, scheduler, inspection worker, and reload handlers. A final-commit run of the exact startup file is reported separately above.

Remote setup initially encountered stale Docker supplementary groups before code gates, then the first changed-check attempt stopped at the ratchet because OS rg was missing (76.812 s). Using the already granted Docker group and installing ripgrep corrected the environment; the complete changed-check rerun above passed on identical source. SDK/package/update successes were reused, and no permissions or guard limits were weakened. An earlier pre-repair remote check was interrupted by a host reboot and has no verified terminal result; it is not used for this candidate. A preliminary SQL fixture used the wrong constant export; that harness defect was corrected and all affected cases rerun. The IPC fingerprint mismatch was a product defect caught by the matrix and fixed with the failing regression above. No guard was skipped.

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.

v2026.10.1-beta.1 audit: no removed export or public sync-to-async change; schema/source helper parameters remain optional and public sqlite-runtime opening signature unchanged. Internal callback correction needs no compatibility adapter.

CI run 37514890438 timed out in ui/src/e2e/cloud-reconciliation-followup.e2e.test.ts:122 waiting for “Cloud · syncing files.” Five isolated single-file runs on the corrected candidate and five on the pinned baseline all passed with --maxWorkers=1. The button consumes browser-injected placement fixtures; this flow does not call the changed database preflight owner. UI and fixture sources are identical across the two revisions. These macOS/Node 26 replays do not explain the Linux/Node 24 timeout and are not claimed as a fix or inherited-main proof. Full file wall times were 74.96/55.49/50.27/94.10/48.91 seconds for the candidate and 111.15/47.97/111.47/61.57/79.25 seconds for the baseline. The one authorized single-job rerun reproduced the same timeout (attempt 2, job 112457418696). Subsequent exact-main reproduction at cc7e664dfe34fd3b0bd53473dc10d033dc5c0e29 failed the identical selector: main commit 6c8e0b466f9 (#163647) changed the locale to “Worker · syncing files” and “Finalizing worker workspace” while leaving this test’s old selectors unchanged. The synthetic browser capture shows those new labels. All UI, Vitest harness, and runner inputs are unchanged from that tested main to 76beb568588. This is an independently reproduced inherited-main stale-selector failure; this PR changes neither the UI nor the test.

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 openclaw-agent-execution.creation-witness.test.ts) did not recur in five candidate runs, five pinned-base runs, or five exact-main Linux/Node 24.19.0 runs: each passed all 31 tests. The current scheduled-main run also supplied no same-case failure. This is not an inherited-failure waiver or a proven repair. Its one original-order CI shard rerun passed (attempt 4, job 112476152054): 733 tests in 42 files passed in 810.77 seconds, followed by 7 Doctor-workspace tests in 24.77 seconds. The original failing case itself passed in 5.270 seconds. The cause remains unconfirmed; no assertion, timeout, or production change is claimed as its repair. Both Linux attribution leases have stopped.

Overlap and scope

This 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.

@openclaw-barnacle openclaw-barnacle Bot removed the gateway Gateway runtime label Oct 8, 2026
@steipete

steipete commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete

steipete commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete
steipete merged commit 53fd3d8 into main Oct 8, 2026
209 of 218 checks passed
@steipete
steipete deleted the dbasync/w6discovery-preflight branch October 8, 2026 09:37
@steipete

steipete commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 9, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant