Repository navigation
perf(state): carry admitted schema facts with database handles instead of re-querying per call - #164490
Conversation
Refresh freshness at read admission and after BEGIN while reusing handle-owned facts for runtime schema checks. Validate canonical triggers before exposing agent readers and classify shared-state failures only after failed admission. Focused runtime checks execute zero SQL statements, versus 30 with the baseline owner. Preserve foreign-commit and snapshot semantics. Full workload measurement and remote integration checks remain merge preconditions after remote runner and fleet-capacity admission failed.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed October 4, 2026, 3:23 AM ET / 07:23 UTC (Revision 18). ClawSweeper reviewWhat this changesThe PR reuses validated SQLite schema and session-key policy facts through existing database handles, reducing repeated queries while preserving freshness checks. Warning SQLite table change This PR modifies persisted SQLite tables in Merge readiness⛔ Blocked before merge - 1 item remains This remains useful, distinct performance work. No actionable introduced defect was found, and the captured body now records completion of the previous review’s validation request. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s database admission layer validates shared control-plane and per-agent session databases before runtime reads and writes consume them. This change carries those validated facts through the connection lifecycle while refreshing them at operation boundaries. flowchart TD
A[Session and state operations] --> B[Database admission]
B --> C[Connection-owned schema facts]
C --> D[Read or transaction entry]
D --> E[Foreign commit and local mutation checks]
E --> F[Current schema and policy facts]
F --> G[Session reads and state writes]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +137, Tests +278, Docs +4, Other 0. Total +419 across 27 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Retain one connection-owned freshness mechanism, with admission and transaction boundaries refreshing facts before existing runtime owners consume them. Do we have a high-confidence way to reproduce the issue? Not applicable as a bug reproduction: source and the recorded before/after Gateway workload establish repeated-query overhead and its reduction; this review executed no target code. Is this the best way to solve the issue? Yes. Reusing facts through existing connection and admission owners avoids a competing cache while retaining explicit fresh reads and conservative policy invalidation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3f6c1d3a23b9. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (17 earlier review cycles; latest 8 shown)
|
Integrate the pinned measurement baseline and retain main-key facts through the existing connection and reader-admission owners. Preserve raw writes, foreign commits, transaction snapshots, authorizers, and continuation authority.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Use the existing worker generation claim for maintenance metadata instead of retaining a host read handle. Keep both live ownership checks around the required transaction-entry freshness probe. Consolidate shared-state cache initialization, refresh, and terminal failures in its admission sibling and update the compiled-wrapper inventory. This keeps the cache within the existing module-size limit without changing stored schema or quarantine semantics. Focused maintenance, ownership, schema, worker, wrapper, and quarantine proof passed. Independent Codex review is clean through P2. Full landing validation remains required before merge.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Refresh canonical readiness when it consumes schema facts. Retention only holds native lifetime, so cold restore and other worker handoffs no longer execute host SQLite before dispatch. Protect foreign schema invalidation at the warm readiness fast path. Tighten retained-reader budgets to the optimized counts, and require early missing-table diagnosis before callbacks while preserving handle-cleanup assertions. Validation: 93 focused tests, production types, state/config test types, and independent review clean through P2.
Integrate the released-SDK diff tooling fix and the inherited child-coordination fixture correction. The merge preserves every authored source, test, and documentation blob; the wrapper inventory combines both branches.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Integrate the current main fixes for oversized Git baseline reads and the malformed-plugin-config assertion inventory. Preserve all schemafacts production, test, and documentation changes; incorporate the current wrapper dependency inventory.
Integrate main's canonical transcript notification and exact-owner preview fixture repair, plus the native Node duration-helper import correction. Preserve all schemafacts production, test, and documentation changes and incorporate the current wrapper dependency inventory. Fresh independent P2 review of the combined candidate found no actionable findings. Final-head update, SDK, focused validation, and hosted CI follow.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Integrate main's MCP capability fixture repair and behavior-based spinner assertion, together with its lifecycle-context ownership changes. Preserve all schemafacts production, test, and documentation changes and retain the current wrapper inventory alongside the cache-admission module. Fresh independent P2 review found no actionable findings in the combined candidate. Final-head CI, lifecycle boundary checks, and the published-driver update cell remain required before landing.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
Merge main d2a9f9a after the schema-facts prerequisite #164490 landed. Retain main's archive-runtime cleanup and incorporate the native duration-import and preview fixes. No conflicts or new lane signature changes were introduced. The complete integrated delta has a clean P2 review. Eleven import/runtime build-graph tests and the staged mock-export ratchet pass. Local Gateway proof recorded a WebSocket response timeout in reclamation concurrency under heavy startup load; its authority-revocation sibling passed. The remaining local run was interrupted and is not passing coverage. Exact candidate/main attribution, fresh released-SDK diff, and final CI follow.
Use the existing read-operation admission owner before raw schema and launch-receipt reads. Main's schema-facts change in #164490 moved foreign commit freshness to operation admission, leaving three fixtures reading stale facts or skipping a required freshness probe. Preserve same-handle rollback/retry, table visibility, reopen durability, and the exact nine-probe assertion. Each original failure reproduced five out of five times on unchanged main. The three repaired files pass all 89 tests (544.71s wrapper wall on the loaded local host), and P2 review is clean. Found while landing #164805.
Refresh retained schema facts at the connection-bound factory admission boundary, before factories inspect optional tables. The freshness move in c828f7e (#164490) omitted this boundary, so a retained worker could skip existing first-use tombstone creation after foreign DDL and make memory forget fail before recording the deletion. Also join canonical asynchronous database retirement before the stale-borrow fixture reopens its successor. Preserve every existing assertion and all schema, migration, transaction-authority, and deletion contracts. Bisect: the focused forget.mark regression passes on 3e8edff and fails on c828f7e. Current main reproduced all ten tombstone failures; the fixed recovery and settlement suites pass 12/12. Validation: 441 passing memory, forget, tombstone, schema, and worker tests across 25 files (four existing skips); production and extension-test types; both import-cycle checks report zero cycles. The changed fixture passes 11/11 with one worker in 309.16s (344.91s wrapper wall time) on the loaded local host. No tests or runtime assertions were removed or weakened. The broader changed gate was stopped during all-core test typechecks after production types and static ratchets passed. Testbox remained queued and was stopped without check execution; verification was local. Formatting and the native schema-version guard pass. Lint could not start: its plugin-sdk boundary declaration prerequisite timed out after 300000ms on the loaded host. This is recorded as an unrun lint check, not a pass.
…d of re-querying per call (openclaw#164490) * perf(state): carry admitted schema facts with database handles Refresh freshness at read admission and after BEGIN while reusing handle-owned facts for runtime schema checks. Validate canonical triggers before exposing agent readers and classify shared-state failures only after failed admission. Focused runtime checks execute zero SQL statements, versus 30 with the baseline owner. Preserve foreign-commit and snapshot semantics. Full workload measurement and remote integration checks remain merge preconditions after remote runner and fleet-capacity admission failed. * fix(state): preserve worker handoffs during schema admission Use the existing worker generation claim for maintenance metadata instead of retaining a host read handle. Keep both live ownership checks around the required transaction-entry freshness probe. Consolidate shared-state cache initialization, refresh, and terminal failures in its admission sibling and update the compiled-wrapper inventory. This keeps the cache within the existing module-size limit without changing stored schema or quarantine semantics. Focused maintenance, ownership, schema, worker, wrapper, and quarantine proof passed. Independent Codex review is clean through P2. Full landing validation remains required before merge. * fix(state): keep retained handles free of schema probes Refresh canonical readiness when it consumes schema facts. Retention only holds native lifetime, so cold restore and other worker handoffs no longer execute host SQLite before dispatch. Protect foreign schema invalidation at the warm readiness fast path. Tighten retained-reader budgets to the optimized counts, and require early missing-table diagnosis before callbacks while preserving handle-cleanup assertions. Validation: 93 focused tests, production types, state/config test types, and independent review clean through P2. * test(gateway): await private timeout receipt settlement The maintenance scheduler starts worker-backed completion without joining it. Wait for the real recorder's accepted write before reading its receipt, while preserving the held producer and lifecycle writes and all timeout outcome assertions.
Use the existing read-operation admission owner before raw schema and launch-receipt reads. Main's schema-facts change in openclaw#164490 moved foreign commit freshness to operation admission, leaving three fixtures reading stale facts or skipping a required freshness probe. Preserve same-handle rollback/retry, table visibility, reopen durability, and the exact nine-probe assertion. Each original failure reproduced five out of five times on unchanged main. The three repaired files pass all 89 tests (544.71s wrapper wall on the loaded local host), and P2 review is clean. Found while landing openclaw#164805.
Refresh retained schema facts at the connection-bound factory admission boundary, before factories inspect optional tables. The freshness move in 06566ec (openclaw#164490) omitted this boundary, so a retained worker could skip existing first-use tombstone creation after foreign DDL and make memory forget fail before recording the deletion. Also join canonical asynchronous database retirement before the stale-borrow fixture reopens its successor. Preserve every existing assertion and all schema, migration, transaction-authority, and deletion contracts. Bisect: the focused forget.mark regression passes on 60de457 and fails on 06566ec. Current main reproduced all ten tombstone failures; the fixed recovery and settlement suites pass 12/12. Validation: 441 passing memory, forget, tombstone, schema, and worker tests across 25 files (four existing skips); production and extension-test types; both import-cycle checks report zero cycles. The changed fixture passes 11/11 with one worker in 309.16s (344.91s wrapper wall time) on the loaded local host. No tests or runtime assertions were removed or weakened. The broader changed gate was stopped during all-core test typechecks after production types and static ratchets passed. Testbox remained queued and was stopped without check execution; verification was local. Formatting and the native schema-version guard pass. Lint could not start: its plugin-sdk boundary declaration prerequisite timed out after 300000ms on the loaded host. This is recorded as an unrun lint check, not a pass.
What Problem This Solves
Warm agent and shared-state reads repeatedly execute schema freshness probes through already-admitted handles. Canonical main-key admission also rereads the same policy row; SQLite
data_versionalone cannot invalidate that value after a same-connection write.Why This Change Was Made
Carry the existing connection-owned schema facts through runtime checks. Read admission and transaction entry after
BEGINown freshness, inside rollback protection. Nested checks share the operation's probe; explicit fresh reads still execute. Agent open/admission verifies canonical invalidation schema before exposing the handle. Shared-state cache admission owns initial schema facts, cached refresh, and terminal failure handling; ordinary runtime checks consume those admitted facts.The existing canonical reader admission now retains its main-key value, keyed by schema facts, observed foreign-commit version, and a connection-owned mutation revision. The native connection owner observes local mutating SQL, including raw batches, CTEs, prepared statements, and indirect triggers. Active mutations, suspended
RETURNINGiterators, explicit transactions, pinned snapshots, and dynamic authorizers bypass policy reuse. An explicit fresh probe that observes a foreign commit also prevents an older enclosing read scope from serving stale policy. Continuation authority stays with canonical admission.DDL, rollback, snapshot, authorizer, close, and physical replacement invalidation remain with the existing owners. Foreign commits still compare schema and user versions: a
user_version-only migration cannot be distinguished from a data commit bydata_versionalone. Ordinary commits retain schema facts. Boot/Doctor/migration integrity and canonical-index work remains with admission and migration owners. Unmanaged connections retain their native inspection contract.The policy writer audit covers the startup/Doctor setter, schema bootstrap, generic STRICT migration copies, canonical-ready receipts, and backup/update replacement. Raw writes remain supported through the tracked native owner and invalidate; setter-only invalidation would have missed existing callers. The policy add-on is +86/-2 (88 changed production lines).
User Impact
The identical local workload reduces warmed main-thread SQL from 638.8 to 524.6 statements per turn (-17.9%). All seven named schema sites and the canonical projection schema probes execute zero statements during warmed turns. Main-key policy reads fall from 44 to 22 per turn, with transaction/snapshot and current-policy reads preserved.
No schema version, stored format, retention, durability, worker service, configuration option, or environment name is added. The published-driver update cell passed on prior head
395e837; proof is being refreshed for the integrated candidate below. Drifted-schema refusal remains covered by the admission and foreign-process regressions.Evidence
At measured head
5077cb423a98b35debc2bf8b639a88f3eb42a6db, production diff against the pinned measurement baseline: +203/-77/net +126 across 14 production files; four test files and one documentation file also change. There are zero newOPENCLAW_*names.Full identical synthetic Gateway workload: pinned
origin/mainat4df9a0636badcaf63c362072a6f8d10a4a90eb6b→5077cb423a98b35debc2bf8b639a88f3eb42a6db. Both used Node 24.21.0, SQLite 3.53.4, source-mapqaRuntimebuilds, isolated state/ports, and byte-identical harness/observer files. Only the original harness’s temporary path and head metadata were made portable.Warmed main-thread SQL: 638.8 → 524.6 statements/turn (-114.2; -17.9%). Whole-workload main-thread statements: 14,480 → 12,708.
Counts are successful top-level native SQLite executions, excluding
prepare(). Phase totals include concurrent maintenance in that execution window; elapsed times are not a performance benchmark. Named sites follow the historical functions; the logical-owner count additionally includes semantic schema-facts probes at relocated admission/transaction callers and canonical-validation schema work. Generic SQL execution wrappers are excluded. Logical and named columns overlap and must not be added together.Steady-turn means
Per phase — before → after
Each warmed turn — before → after
Seven named sites: per-phase and per-turn counts
openclaw-agent-db-schema-read.ts:22— supported agent schemaopenclaw-agent-canonical-validation-schema.ts:70— canonical validation schemaopenclaw-state-db-runtime-failure.ts:58— former success-path runtime validationopenclaw-state-db-schema-helpers.ts:51— admitted table factsopenclaw-state-db-schema-runtime.ts:159— STRICT migrationopenclaw-state-db-schema-runtime.ts:173— shared-state canonical indexesopenclaw-agent-db-schema.ts:145— agent canonical indexesPer phase, before → after:
Each warmed turn, before → after:
T1 inventory with the same candidate classifier: 1,198 → 1,198 sites, 316 → 316 files.
check-database-worker-ratchetpassed against4df9a0636badcaf63c362072a6f8d10a4a90eb6b. T1 counts five named static primitives, so it does not measure the removed native PRAGMA executions.Both runs completed all 13 top-level turns, the real child turn, the scheduled cron with
status=ok, committed compaction, and shutdown[0, null]. All recorded RPCs succeeded; Inbox dismissal was the original empty-Inbox no-op. All resolved database paths stayed inside each synthetic fixture. Main-thread failed execution attempts: 0 → 0. All observed task-owned process IDs were checked after shutdown and had exited.The candidate includes the pinned baseline commit, so the measured source difference is this PR. The older historical 546-statement result is not used as the comparison baseline. Full build, full changed checks, released-SDK comparison, and the published-driver update cell are separate gates and are not implied by this measurement.
Retained work and caller classification
The remaining 22 main-key policy reads per warmed turn are not claimed as removed:
applySessionEntryPatchInDatabaseloadReplySessionInitializationEntriesreadSessionEntryStoreduring lifecycle maintenancereadSessionEntrySelectionSnapshotThe first three groups account for 11 transaction/snapshot reads per turn. The other 11 are observed cache fills or uncached reads in planning/read-admission paths. The original observer records SQL and stacks, not each cache-eligibility predicate, so it cannot distinguish missing policy receipts from revision invalidation for every one of those reads; they are not all labeled “unadmitted.”
The retained 131.6 logical schema-facts statements per turn are 117
data_versionprobes plus 7.3schema_versionand 7.3user_versionrechecks. The version pairs run in the freshness owner's changed-data_versionbranch. Caller totals include relocated work:data_version/turnwithOpenClawAgentDatabaseReadOnly,retainOpenClawAgentDatabaseReadOnly)scanSessionEntryRows,readExactSessionEntryRow, transcript watermark/read)getCachedOpenClawStateDatabaseThe three canonical-projection executions in compaction are one schema-facts rebuild:
PRAGMA schema_version,PRAGMA user_version, and the table catalogue query. Their stack isacceptCompactionSuccessor→loadSessionEntry→hasCanonicalSessionValidationProjection→ the!owner.factsrebuild ingetAdmittedSqliteSchemaFacts. This is one rebuild, not three repeated warmed checks; the warmed canonical-projection count is zero in all ten turns. The trace does not identify which preceding invalidation condition caused that rebuild.The remaining native transaction and selection/planning work belongs to the
agenttx/sessprojowners. Further policy reuse needs a proven invalidation contract; the conservative local mutation revision preserves raw and trigger-driven policy writes.Focused regressions and review
All commands below use
--maxWorkers=1on the local host; times are wall time.pnpm test … --maxWorkers=1)src/infra/sqlite-schema-facts.test.ts src/config/sessions/session-canonical-key-policy.test.tssrc/config/sessions/session-canonical-key.test.ts src/config/sessions/session-canonical-reader-continuation.test.ts src/infra/sqlite-transaction.test.ts src/infra/sqlite-transaction.diagnostics.test.tssrc/state/openclaw-agent-db-readonly-scope.test.ts src/state/openclaw-agent-canonical-validation-schema.test.ts src/state/openclaw-state-worker-error.test.tstest/scripts/runtime-process-build-graph.test.ts src/auto-reply/reply/get-reply.imports.test.ts src/state/openclaw-state.worker.imports.test.tsThe new policy observer assertion fails against the actual pinned-base canonical reader with ten policy SELECTs versus the candidate's zero (negative control: 7.57 s). Tests cover setter/raw/CTE/prepared/trigger writes, native callbacks, suspended RETURNING iterators, partially failed batches, rollback, foreign commits, explicit fresh probes, snapshots, and authorizers. Existing continuation tests retain SQL-free capture/revalidation and current-authority revocation.
The schema observer proves ten repetitions of version, table-existence, and canonical-schema checks execute zero statements. The earlier owner negative control against the original PR base
fc7e71baproduced exactly 30PRAGMA data_versionstatements (10.75 s). The cold-open regression refuses a missing canonical trigger with Doctor guidance; its earlier opener negative control against that original base incorrectly admitted the database (307.86 s). Both candidate byte sets were restored before subsequent proof. The complete affected schema suite passed on the measured candidate.Fresh isolated Codex autoreview against
4df9a0636badcaf63c362072a6f8d10a4a90eb6b: scoped-clean through P2, no accepted/actionable findings. Deslop required no change. Targeted formatting andgit diff --checkpass. CI seconds for newly selected tests are not available yet.Required landing validation
Current candidate:
7a4b906b9c7696aa438bb784e785e6e3873f45d9, a clean merge with main65829ead96bb115b69782e6357e8b619b3add8bf. It includes main's MCP capability fixture repair42b9aee33a7b03442f4c5ce3f088fd5e7dcefaf0and behavior-based spinner assertion from65829ead…. Every PR-authored production, test, and documentation blob remains unchanged from3dd800e; the wrapper inventory incorporates main's three new lifecycle helpers. The incoming lifecycle change releases opening callback captures after settlement while preserving per-operation database/caller authority and each queued writer's own async context. Fresh independent P2 review of the complete staged candidate against this main is scoped-clean. No new schema, durability, retention, permission, or environment-name policy is introduced by the schemafacts changes.Final-head CI run 37182358825 passed: 96 successful jobs, 21 skipped, no failures or cancellations. ClawSweeper completed exact head
7a4b906bat2026-10-04T06:23:37.338Zwith no actionable code or security findings; its declared final validation is now complete. No CI rerun or inherited-failure admin exception is needed.The exact-head Testbox campaign 37184045655 passed. Canonical full build/package completed in 467 seconds, including tarball integrity and import-graph validation. All nineteen complete regression/import files passed (266 tests across eight routed shards,
--maxWorkers=1, 282.843 seconds); selected wrapper inventory passed in 3.776 seconds, and Madge found zero cycles in 28.177 seconds. The added coverage exercises incoming worker/queue lifecycle, Doctor lease/maintenance authority, and foreign-schema freshness.The published
2026.9.8driver updated to candidate7a4b906b9c7696aa438bb784e785e6e3873f45d9in 170.254 seconds, recorded durablefinished/succeeded, and returned readiness HTTP 200. The connected serving Gateway and installed package both report build ID2026.9.8-7a4b906b9c76-2026-10-04T06-54-57.874Z; matching package version alone was not used as proof. Candidate treefaaf0f7879c8ff09edfdfe14624f7cf94fb885fbwas verified after a clean exact-SHA remote clone and frozen install. The immutablec13c486…bootstrap transport is separate from the tested candidate. Native execution exited 0, local cleanup settled, and the lease is stopped.The released SDK comparison against
v2026.9.8passed on3dd800efcbe10c585c17c1132725210c58169c6f(exit 0, 1,992.307 seconds; digeste18517df8df10249f8785d7da9f5b7bd76754c5d7eb5b05b9562b40062f78010). It reports one added/eight removed entrypoints and 2,316 affected exports, including main changes. The sole new direct-signature diagnostic versus cacd is the compatibleresolveStorePathparameter-name change (optionstoopts) after main replaced a wrapper with an alias. The subsequent source audit through65829eadfinds no changed SDK entrypoint/public-runtime contract, manifest, lockfile, compiler config, or renderer owner, and no new released callable-contract change in the queue/lifecycle/LLM/Doctor updates. PublicAsyncWorkScope,runQueuedStoreWrite, scheduler, and transcript-recorder signatures remain intact; the moved detached-context helper and async Doctor lease helper are internal. The report retains its actual 3dd head; conservative closure hashes are not claimed identical. The authored getter-only attribution and lack of a released callable removal remain unchanged.The complete
node scripts/check-changed.mjs --base 9aee9ad5…proof remains bound toe53258a(exit 0, 4,092.001 seconds). All authored production/test/docs inputs remain identical; hosted CI and focused new-head checks cover the integrated main inputs.Historical CI run 37180677202 on
3dd800ecompleted with 92 successful jobs, 21 skipped jobs, two failed UI fixture jobs and their aggregate, with no cancellations. The full UI subtree and relevant harness/package inputs were identical between maindac9277…and tested merge0fcd301…. One test pinned the old CSS animation name after main consolidated equivalent keyframes; the other passed an obsolete fourth capability-helper argument. Both main fixes are now integrated, so neither historical failure is used as an admin exception. Windows DTS passed after the earlier native import repair. The superseded 3dd update capture stopped before lease allocation or candidate execution.Historical CI run 37176827180 on
cacd9dcahad two inherited failures: the preview fixture and native Node declaration-fixture import. Both full files reproduced the exact case five times on main2e76e316…and five times on tested merged346f7df…in paired Testbox run 37179139232. The DTS Linux replay was not Windows validation. Main's fixes217efe0a…and3c0f7e4c…are already integrated. No CI rerun was requested for these historical attempts.Completed proof and failure qualification on e53258a
This section records
e53258aa87414768fb7f48d481d4724273953332, a clean merge commit with main9aee9ad5a3748836d5ffb43ab895f484b564d600. Main acquired the exact delivery-recovery fixture fix1836ae2146443e952337bce1bccb41c524ea0639while independent qualification was running, so that fix is integrated instead of using an inherited-failure exception. Every PR-authored production blob is unchanged by this merge. Main's wrapper inventory and table-driven schema test cleanup merged cleanly; this incidental cleanup overlap preserves the same contracts and assertions. Fresh isolated P2 review of the complete staged candidate against the merged main is scoped-clean, with no actionable findings.The previous CI attempt
37168732287had 93 successful jobs, 21 skipped jobs, one failed delivery-recovery job, and its derived gate. In paired Testbox run 37170646089, five complete single-worker runs on its exact main parent5a8856d4and five on tested merge6956d790reproduced the same five failures with 36 other cases passing each time. All ten full assertion blocks match. The fixture omitted the explicit queue-state environment after worker-backed pending-final settlement landed; main's fix adds it to fixture creation, reads, and replacements. The three recent scheduled-main runs supplied no matching failed-node annotations, which is not treated as passing proof. The comparison lease is stopped and its wrapper is settled. This qualification is historical; it is not an exception for the new candidate.The two SDK commands completed successfully on
e53258a. The release report has digest66254a9725dca6ee0b60019f9a3105b80d2e0ed745708652772c8002438feb01; the main-attribution report has digest2dac8683b81885ff0b5634c1cbea60540f297af7e41a1fba501c973a8fcc1a15. The attribution again finds 128 unchanged direct public signatures and only the internal-getter whole-module fallback delta. These reports retain their original head binding. No merge request is armed before the new candidate’s required proof completes.The e53258a CI run 37172335178 tested merge
d7a6bb06c522cb4289184666850cb8c6d14c9320over mainb02aaf1e3e0725e60772da600c1773b194f8f16c. All three failures are independently inherited. In Testbox comparison 37174195890, the complete ratchet CLI and both complete failing test files each reproduced their exact CI failure five times on mainb02aaf1eand five times on tested merged7a6bb06(30 processes total). The ratchet fails before scanning PR code because its Git-reading helper uses the default 1 MiB output buffer for main's 1,675,312-byte baseline. Main added two negative type assertions without updating the inventory; that file has one failure and three passing cases every run. The preview file has the same missing last-message field and six passing cases every run. Its key-only backfill waiter can accept empty or rejected publications; that is a source-supported diagnosis, not a claimed repair. This path reaches changed database owners, so the paired proof was required despite unchanged immediate owners and fixture. Expected/received output matches CI; preview normalization removes only the RPC UUID and timestamp. Both paired revisions used Node 24.19.0 and frozen dependencies; CI was configured for 24.21.0. No timeout, unhandled error, extra failing case, or CI rerun occurred. The comparison lease is stopped. The three recent completed scheduled-main runs predate the new scanner and marker changes, so their results are not counted as passing evidence for this baseline. ClawSweeper completed this exact head at2026-10-04T02:59:03.857Zwith no actionable findings.Passed validation before the latest main integration
The following proof was executed on
395e837b023866e540cd2c23f79f4eb85513ce58unless another head is explicitly named. The final test-only correction carries the real private-input recorder through the existing consumption handshake and joins its accepted completion write before reading the timeout receipt. All producer, execution, lifecycle, and outcome assertions remain intact. The three timeout variants passed (565.26 seconds in Vitest; 695.83 seconds including worker compilation/verification), and fresh isolated P2 review is scoped-clean.The only path changed from
9bd9115a3287a88aba5db15912e1bb4f05373c11issrc/gateway/server.private-completion.test.ts(+4/-3). Production, package, SDK and import inputs are unchanged. The full changed check passed on9bd9115a…; the incremental changed check also passed for this correction. Final-head Madge reports zero cycles (188.175 seconds); the wrapper inventory passed (24.075 seconds), and all 13 tests across the three complete import/build-graph files passed (309.576 seconds). The required full build passed in 479.6 seconds in final-head Testbox run 37169789708. Both complete gateway files passed all 32 tests (81.234 seconds including runner setup, 79.24 seconds in Vitest). The published2026.9.8driver updated successfully to exact candidate395e837b023866e540cd2c23f79f4eb85513ce58, recorded its durable successful outcome, and started the candidate Gateway with readiness HTTP 200 and verified build identity. The update took 172.329 seconds; remote execution and local wrapper cleanup both exited 0, and the lease is stopped. The full build emitted a nonfatal inherited UI gzip warning (374,319 bytes versus the 373,454-byte budget).Current CI run 37168732287 tests merge
6956d79038988695ca7d9407dda6f081910a59e5over main5a8856d4c2f6419c1641b2b77eaa4022420ebee9. That main parent already contains Doctor's nested-diagnostic fix54cfa2f8647c66fa34d72ad149a316caf8b8f6e4; the earlier Doctor failure qualification is historical, not an exception for this repaired merge tree. The earlier node-placement publication fix2e33b81f2efa7d4b2a719640b58837fb02e1d814was integrated by merge commit9bd9115a….The initial remote campaign could not obtain capacity; those attempts executed no candidate checks and their leases were stopped. The later published-driver cell and full build completed successfully on exact head
9376dad14cf0e74a246c18c001341577ae6b5d8ain Testbox run 37160723484. Published2026.9.8updated to this candidate, recordedfinished/succeeded, and started the replacement Gateway with readiness HTTP 200 and verified candidate build identity. Full build took 497 seconds; update took 171 seconds. The lease is stopped. A UI gzip budget warning (+46 bytes) and post-proof portal-sync timeout were nonfatal; the proof wrapper exited 0.Both released SDK commands completed successfully on
9bd9115a3287a88aba5db15912e1bb4f05373c11; their production/declaration inputs are byte-identical at the final test-only head. Release comparison againstv2026.9.8reports one added and eight removed entrypoints plus 2,314 affected exports, including existing main changes (digestfef6cd9472b7ae396ec22f6bedffacba212de5f7ca5e5728a809b6f3eb2ff5c3). Main-to-candidate attribution reports zero entrypoint additions/removals and 128 unchanged direct public signatures with differing conservative closure hashes (digest4233d3cd88f3b1defbbaddb95e3cad2b806832fb325b0383138fbbbfcb0c084a). The sole declaration delta removes an internal cache getter.The indexed
typeof importinhost-capability-types.tscauses whole-module fallback traversal. FollowingCommandOwnerReferenceby its actual named type exposes onlyversionandid, not that module's unrelated database operations or the cache. The getter has no released SDK/API-runtime export; package exports provide no internal-state subpath or wildcard. The three additional gateway-dispatch diagnostic roots likewise expose response/error envelopes, not a cache object. No released callable signature changes; no compatibility boundary is needed. The SDK reports are retained as unchanged-input proof, not relabeled as a new run.On head
9376dad14cf0e74a246c18c001341577ae6b5d8a,node scripts/check-changed.mjs --base 88415783fb415fb9db81b1014161d023c04ad400passed, including all 27 test-type graphs, lint, dead exports, runtime cycles, and selected architecture guards. The wrapper inventory also passed (16.447 seconds), all 13 tests in the three complete import/build-graph files passed (213.656 seconds), and fresh Madge reported zero cycles (42.182 seconds). That historical hosted CI run completed with 90 successful jobs, 20 skipped jobs, and two failing test jobs plus their aggregate gate. The paired-node lifecycle failure was inherited and its main fix is now integrated. The Doctor failure was independently reproduced on both sides; current CI incorporates its main fix. This historical failed run is not treated as green.Coordination
The
sessprojoverlap is the minimal validity-token call insession-accessor.sqlite-entry-revision.ts; its explicit fresh probe now also refreshes schema ownership. Thecanonkeyadmission-probe finding is handled by the same schema-facts change. The policy optimization is folded in under the coordinator's follow-up, using existing owners and preserving raw-write invalidation. The shared transaction helper refresh covers native and worker callers without rewriting theagenttxtransaction owner. No new worker grant callbacks or authority reads are introduced.RoboClaw #162433 is incidental under the standing overlap decision. #140042 has stale, different-function changes in the agent DB module; #122008 changes the media floor/export rather than these admission operations. No competing design or unrelated restructuring is adopted.
Retained preservation-provider debt
Existing maintenance authority callbacks recapture preservation at
src/config/sessions/session-accessor.sqlite-maintenance-kick.ts:415, reachable from transaction/commit grants throughsrc/config/sessions/session-accessor.sqlite-replacement-worker.ts:138. The placement provider atsrc/gateway/server-worker-placement-startup.ts:376calls the shared-state query atsrc/gateway/worker-environments/placement-store.ts:364; this is a scan of non-local/non-reclaimed placements, not a claimed bounded exact-key lookup. The subagent provider atsrc/agents/subagents/registry/subagent-registry-maintenance.ts:48also retains a cache-miss storage path (src/agents/subagents/registry/subagent-registry-read-cache.ts:279; SQL ownersrc/agents/subagents/registry/subagent-registry.store.sqlite.ts:79). Its prepared path remains available; no cold read during a grant is claimed as observed proof. The failed-environment check uses the environment owner's in-memory map and is not another SQL query. These cross-owner callback/read sites are unchanged by this PR and remain follow-up work for their preservation-provider owners; no blanket zero-host-SQL or measured slowness/blocking claim is made.The schemafacts readiness probe runs before the worker lifetime/admission boundary (
src/config/sessions/session-canonical-validation-readiness.ts:61, versus:88). Metadata maintenance skips the same-owner host retention path atsrc/config/sessions/session-accessor.sqlite-reclamation-run.ts:246. This PR adds no grant callback or cross-owner authority read.Landing corrections and current evidence
Commit
e6aa2e609f99f89e10321c2b8d5d4c50718fc130addresses the exact-head CI and ClawSweeper findings. Run 37152097353 failed in the Windows ownership test and five Linux maintenance-worker cases, then cancelled dependent work. These are PR-caused, not an inherited-main exception. The original ownership file reproduced the same one failure in five single-worker runs, and the original maintenance file reproduced all five CI failures; five-run baseline comparisons independently confirmed both causes.Maintenance metadata now uses its existing worker executor and generation claim instead of retaining a host read handle. The existing zero-host-SQL assertions remain unchanged. The ownership test now checks the exact sequence of both indexed ownership reads around the required post-BEGIN freshness probe. Cache initialization, refresh, and terminal failure handling are consolidated in
openclaw-state-db-cache.admission.ts, replacing the former runtime-failure module; the compiled-wrapper inventory is updated. The extraction also preserves the persisted-quarantine terminal path. No schema, durability, retention, permission, or environment-name change is introduced.Local corrected-source proof:
node scripts/run-vitest.mjs ... --maxWorkers=1No new test cases were added by the landing correction. The existing ownership SQL-order assertion changed; its full-file cost on the original head was 141–258 seconds on the loaded local host, and the original Windows job completed in about 202 seconds including setup and sibling files. These numbers are test cost, not runtime performance. The performance measurements above remain bound to their original measured head; this corrective commit is not a new workload measurement.
Released SDK source and generated declaration reports were audited against
v2026.9.8, as detailed above. The SDK tooling fix is integrated. Released transaction and agent-read signatures remain unchanged.Foreign-process migration refusal is exercised by
src/state/database-runtime-schema-checks.test.ts, which starts a child process that changes both warm databases'user_versionand verifies refusal on their next use. Independent-connection regressions also cover committed DDL, canonical-trigger drift, and next-unpinned-read freshness.Final correction
b6796f12f8cfcd2d950e44ef8cbc0d0f21d28a2cremoves the newly added probe from warm handle retention itself, covering cold restore, archive, and deletion handoffs as well as maintenance. The actual canonical-readiness decision now owns one fresh read scope. All 11 production retention callers were audited for their actual read/transaction/revision owner. A foreign-trigger regression demonstrates that removing the retention probe alone would incorrectly reuse a clean readiness receipt, and passes with the paired read-boundary correction.The earlier integrated head
9376dad14cf0e74a246c18c001341577ae6b5d8awas a merge commit with main88415783fb415fb9db81b1014161d023c04ad400; there was no rebase. Every authored source, test, and documentation blob was unchanged by that merge. It includes the SDK tooling fix and main's child-coordination fixture fix31412680307a94480b812c2a39378ee87346a40d.The final correction passed 93 tests in 797.50 seconds across readiness, cold storage, cold publication, maintenance worker, reader cache, and read-error files, all with
--maxWorkers=1. The new foreign-trigger case took 0.777 seconds locally and 0.111 seconds in CI run 37160368709 (job 111312631927); its assertion passed in that otherwise-red job. Production and all 27 shared test-type graphs passed; staged correction review is scoped-clean through P2. The early-refusal tests preserve typed missing-table errors, require Doctor guidance, prove the read callback never executes, and retain native-handle cleanup assertions. The reader-cache test now requires one probe per operation and one prepared probe after eviction, while still checking foreign commits.Exact-main board evidence: CI tested merge
df1480613b9fd4ca0286f70cbf71c9b24efa3281over mainb2c392dc0961ef09cc21655c16d72ca290d000ef. On that exact main, five standalone runs ofsrc/gateway/server-methods/board.mcp-admission.test.tsreproduced all four failures (20/20 cases). The fixture holds the writer reservation while waiting forputWidget; after #164448, the preceding source-authority read queues behind that same reservation. Board code, test, and admission owner are identical between tested main and CI's merge tree. No schemafacts source change is involved in that scheduling cycle.The original ownership and maintenance CI failures were independently confirmed PR-caused by five-run head/base comparisons. The later cold-storage, reader-cache, and early-read-refusal failures were also PR-caused and are fixed by the final correction. Child-coordination failed five times on both CI merge and main; its existing main fix is integrated. Private-completion passed five standalone runs on each side, but the original CI group rerun reproduced the failure. The final test correction explicitly joins receipt settlement; the passing earlier replays were not treated as a fix.
Prior-head proof is historical and is reused only where inputs are unchanged. The validation in this historical section is bound to
395e837b023866e540cd2c23f79f4eb85513ce58; the current candidate is recorded in Required landing validation above. Auto-merge is not armed.CI investigation before the final fixture correction
Run
37163584322, attempt 1, tested mergecace5c1c7a5243192607694b5de896ee88e2a6edover protected mainc13c486969497270e091759059297731a73afd48. Its node-lifecycle tests pass with the integrated main fix.The Doctor job (
111322081790) fails onlyrefuses shared-schema before changing the malformed source: it expects the newer-schema diagnostic but receives the generic maintenance/Gateway ownership wrapper. Five single-worker full-file runs on exact main and five on the tested merge reproduce byte-identical assertion failures; the other four cases pass every time, with no timeouts. The Testbox lease is stopped. This is independently proven inherited diagnostic behavior; refusal is preserved, and the test and causal owners are unchanged by this PR.The private-completion job (
111322081635) failspreserves executing private timeout facts (abandoned)while parsing an absent completion row. The fixture reads the receipt after advancing a scheduler whose settlement callback launches detached completion; that advance does not join the recorder's pending input settlement. The test, paired incognito file, and direct completion owners are byte-identical to the prior CI-merge/main pair, where five standalone runs per side all passed. The latest three completed scheduled main runs have no matching failure annotation among their 19 failed Node jobs. A current-main replay of the original two-file group passed the target case but had preceding unrelated timeout/dispatch failures, so it provides no clean attribution. This remains a timing failure with unresolved PR attribution, not a demonstrated fix or an inherited-failure waiver. The one authorized rerun (attempt 2, job111329844939) reproduced the same missing-receipt assertion in an otherwise-passing 32-test group (100.24 seconds). Commit395e837b023866e540cd2c23f79f4eb85513ce58fixes the fixture synchronization through the real recorder settlement hook; it adds no timer, retry, production seam, or weakened assertion. Current-head CI and the complete two-file Testbox group both passed this correction, with all 32 group tests passing and no filters or reruns.