Repository navigation
perf(gateway): reduce SQLite work for restart-safe chat - #166587
Conversation
Carry prepared lifecycle timestamps and the admitted physical store into chat claim settlement. Record a newly created store's identity at acknowledged COMMIT before fallible observers, preserving durable input before ACK and accepted settlement during shutdown. Publish complete membership facts from the existing worker metadata read so claim publications do not trigger redundant sharing preparation. Preserve foreign-commit visibility and exact claim ownership. Follow up on #166042 without changing schema, retention, or recovery policy.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed October 8, 2026, 1:52 AM ET / 05:52 UTC (Revision 17). ClawSweeper reviewWhat this changesThis PR reuses prepared session facts, moves recovery-claim mutations through existing database workers, and waits for memory-indexing admission before asynchronous compaction returns. Example: Compact a session with postIndexSync set to "async".
Warning SQLite table change This PR modifies persisted SQLite tables in Review scores
ProductKind: Performance · Worth it: Yes Merge readiness✅ Ready for maintainer review The completed pinned qualification resolves the previous proof blocker, and current main still lacks the central optimization. No actionable correctness or security finding remains in the reviewed delta. Priority: P2 Before mergeNone. FindingsNone. Provenance
Agent review detailsHow this fits togetherThe Gateway accepts chat requests and stores session and recovery state in per-agent SQLite databases. Existing database workers perform durable changes and publish committed facts back to the Gateway; the memory owner indexes transcripts after compaction. flowchart TD
A[Chat request] --> B[Prepared session read]
B --> C[Current authority and recovery checks]
C --> D[Existing database worker]
D --> E[Committed session facts]
E --> F[Gateway response and recovery]
E --> G[Compaction memory handoff]
G --> H[Background transcript index]
Technical reviewBest possible solution: Keep the existing worker and publication owners, preserve current authority and invalidation contracts, and use the completed pinned cohort as qualification for this bounded optimization. Do we have a high-confidence way to reproduce the issue? Not applicable as a new bug report; the performance request has a documented pinned before/after Gateway workload and focused regression controls, which were inspected but not rerun. Is this the best way to solve the issue? Yes: the diff uses existing read, write, publication, and memory owners, preserves released contracts, and removes redundant work without adding another service or persistent cache. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 40bc48c782dc. Provenance checked
TestingProof path: shipped entry point. Added test files: 20. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +468, Tests +1352, Docs +24, Other -1. Total +1843 across 50 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (16 earlier review cycles; latest 8 shown)
|
Merge main while preserving its complete projection receipts and the restart-safe chat worker cutover. Carry membership in the existing metadata read and invalidate only superseding native entry deltas; later complete worker receipts retain their published facts.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
The restart-safe worker cutover exposed a 253-statement compaction readmission envelope, including 219 per-table and per-index inspections. Reuse the schema owner's bounded snapshot reader while preserving catalog authorization, drift detection, native shadow handling, integrity checks, and atomic repair. The full agent schema now needs at most seven inspection statements. Regression coverage preserves absent-table authorizer refusals and main-schema repair with temporary PRAGMA shadows.
Canonical index admission now consumes the batched table-contract reader. Retain the per-index helper for its same-module callers and remove its unused internal export, matching the released private surface.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Merge main c6698b1 without rebasing. Reuse its context-owned transcript source publication and typed terminal settlement while retaining prepared freshness and physical-source checks. Port custody and shutdown proof to the integrated owner, and route model command suites through the host broker required by the main placement reader.
Merge main 38c9604 without rebasing. Preserve its prepared operator-authority source guard alongside the captured physical session target and existing lifecycle guard. Accepted cleanup keeps its original settlement custody.
Merge main 471f950 without rebasing. Keep its single publication registry and generation-unchanged proof transport alongside prepared committed facts, supersession handling, and membership fences. Resolve only the overlapping imports.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
) * perf(gateway): keep restart-safe chat SQL in workers Carry prepared lifecycle timestamps and the admitted physical store into chat claim settlement. Record a newly created store's identity at acknowledged COMMIT before fallible observers, preserving durable input before ACK and accepted settlement during shutdown. Publish complete membership facts from the existing worker metadata read so claim publications do not trigger redundant sharing preparation. Preserve foreign-commit visibility and exact claim ownership. Follow up on openclaw#166042 without changing schema, retention, or recovery policy. * perf(sessions): adopt restart recovery claims in workers * perf(memory): reuse transaction-local storage schema inspection * perf(memory): reuse admission facts and restore timeouts once * refactor(gateway): keep restart settlement with dispatch lifecycle * test(gateway): verify durable admission under outcome-only status * perf(sqlite): batch canonical index admission metadata The restart-safe worker cutover exposed a 253-statement compaction readmission envelope, including 219 per-table and per-index inspections. Reuse the schema owner's bounded snapshot reader while preserving catalog authorization, drift detection, native shadow handling, integrity checks, and atomic repair. The full agent schema now needs at most seven inspection statements. Regression coverage preserves absent-table authorizer refusals and main-schema repair with temporary PRAGMA shadows. * refactor(sqlite): keep index fingerprint helper private Canonical index admission now consumes the batched table-contract reader. Retain the per-index helper for its same-module callers and remove its unused internal export, matching the released private surface. * fix(compaction): validate predecessors without writable admission Use the existing-only worker reader for the latest predecessor row. Validation must not recreate a removed database or prepare a writable schema when no successor mutation is needed. Keep the live claim checks and the separate guarded writer for actual successor changes. The missing-store regression fails on the previous reader and passes with the read-only path. Focused successor, rotation, settlement, and lifetime proof, types, lint, and P2 review pass. * fix(compaction): hand off memory indexing before caller retirement * test(memory): count catalog reads independently of projection * test(gateway): avoid shadowing the close fixture signal * test: deduplicate model command worker routes
What Problem This Solves
Related: #166042.
Restart-safe Gateway chat repeatedly reads session freshness and settles recovery claims on the Gateway thread, adding synchronous SQLite work to first and warmed turns.
User Impact
The first message accepted while a managed worktree is being prepared keeps its restart/crash recovery contract, and same-key retries still join or replay one run. This change reduces database work through the existing worker owners while preserving FIFO ordering, current ownership, foreign-commit visibility, and accepted settlement through close. Unknown outcomes are never replayed. Ordinary chat during preparation keeps its explicit-resend behavior.
No schema, storage-format, durability, retention, environment-name, or required configuration change. Released synchronous Plugin SDK contracts retain their compatible boundaries. Asynchronous post-compaction indexing now waits for manager acquisition or admitted provider invocation before returning, while indexing settlement remains asynchronous; cold initialization can add latency, as documented.
Why This Change Was Made
Carry freshness and membership facts from admitted reads and acknowledged writes instead of preparing them again for unrelated claim changes. Claim adoption, checkpoints, terminalization, retirement, and cleanup use the existing agent writer, with exact durable ownership predicates inside its transaction. Source custody is retained before fallible publication observers run.
The measurement follow-up batches canonical-index metadata inspection, reuses schema facts within their existing transaction lifetime, and validates a compaction predecessor through the existing read-only owner. Validation of a missing predecessor no longer creates a database merely to reject it. The faster path exposed a race in asynchronous memory indexing: foreground retirement could occur before the memory owner accepted the operation. The compaction owner now joins that handoff; native providers signal it only after the adapter's admission barrier and currency checks. Existing cancellation, audience, provider-lifetime, and cleanup checks remain intact.
Evidence
Current reviewed head
Current head
a67f2b5cbe1f89541c8ba66689ff06a04825650cadds a two-line test-routing correction to production headf64289f7ba315652d7b0b0e4995af172bc85862d. CI run 37710467891 stopped in preflight because the previous main integration retained duplicate host-broker entries for the model directive and native slash suites. The correction removes only the redundant second entries; both suites remain routed through the host broker. The same duplicate-ownership failure reproduced locally, and the corrected planner returns 107 executable shards. Its independent P2 review is clean. Production, build, SDK and workload inputs are unchanged.Production head
f64289f7ba315652d7b0b0e4995af172bc85862dmerges main471f950ee340e11abc5111fbfb7022be953b89b6after #166758 created two import conflicts. The resolution preserves main’s single publication registry and generation-unchanged proof transport alongside this PR’s committed-fact reuse, native supersession, membership reconciliation and physical-source fences. Synchronous generation reads retain main’s identity-preserving behavior; effectful preparation still joins pending publication. No rebase or competing owner was introduced.The exact head has a clean independent P2 review. All 137 focused publication, replacement, receipt, worker, generation, ACP and memory-audience tests passed with one worker in 534.78 seconds. Core production, all 27 core-test shards, extension production/tests, changed lint, and both cycle checks pass. Twelve selected runtime/import/PR-wrapper inventory tests passed in 13.00 seconds. Local SDK comparison against
471f950ecompleted with exit 0: digestd3ebc6628cedf80d3be9b09676ca0350725afa47baae1c433a4456e21f6d510d; no entrypoint additions/removals, no changes to 131 affected top-level declarations, and eight internal closure changes.Exact-head CI is green: run 37712610681 tested synthetic merge
eeb939679cddaada7c8ab774ed5e02677ec3400cof this head into main09efbc7acb5131ae7532b2e8a019b597486149d9. The latest trusted ClawSweeper review completed fora67f2b5cwith no actionable correctness or security finding. Its reader-composition question is resolved: main #165921 (a10773f7f6af0bfd39c2bfafc9a533bee4375ec2) adds the session-ID lookup helper insession-accessor.sqlite-entry-read.tsand explicitly serializes the read-only request insession-entry-read-runtime.ts. Those hunks are separate from this PR’s membership plumbing and writable-reader extraction. GitHub comparison proves that commit is an ancestor of the green CI base (34 ahead, 0 behind), so the passing synthetic merge already includes both changes. No additional integration is needed for that overlap. The final pinned statement qualification is recorded below.Final integrated statement gate: PASS. The isolated AWS run measured baseline
471f950ee340e11abc5111fbfb7022be953b89b6and production candidatef64289f7ba315652d7b0b0e4995af172bc85862din the fixed order M1,C1,M2,C2,M3,C3 on one c7a.4xlarge host. Final heada67f2b5cchanges only two duplicate test-routing entries. Both pinned builds, calibrations, source receipts, SQL conservation checks, all six workloads and all six complete-memory-index assertions passed. Every index retained three expected transcripts and five chunks with correct text, provenance and vectors, revision 8 and three embedding requests.Duration qualification was decided from timestamps before numerical assessment. Every phase ratio passed; the maximum candidate/main median ratio is 1.058520. First-turn ratio is 0.993121, warmed is 1.006454, connect is 0.999131, and compaction+shutdown is 0.995188. No extra pairs or count-driven retries were used.
All ten individual warmed-turn medians also decrease. Raw all-thread counts decide the gate; attribution is not subtracted to manufacture a pass. The only higher phase is control, within the approved non-turn absolute tolerance of ten statements:
The four extra executions are exactly one each of
PRAGMA busy_timeout,PRAGMA busy_timeout = 0,PRAGMA wal_checkpoint(PASSIVE), andPRAGMA busy_timeout = 5000. PID/thread/phase-bound stacks identify the existingGatewayScheduler→maintainPeriodic→reclaimSqliteWalFreePagesowner. All producer functions are unchanged; the touched schema-facts module adds only a separate transaction-reuse predicate. Each full run executes exactly 64 scheduled WAL statements. Its cron-phase counts move from four on main to zero on candidate, so the adjacent control+cron WAL total remains eight in every run. This is phase placement of unchanged work, not a new request or weakened maintenance check.The workload and verifier retain the exact, approved generated-output exception: Workboard's two declared asset paths, manifest mode 0644 and exact generated JS/CSS hashes. Every other source hash and all seven shared harness files remain unchanged. The completed archive was downloaded and verified before the AWS lease was released; no cloud resource remains held.
Investigated local failure remains unresolved. The separate local cohort completed M1,C1,M2,C2 with successful workloads and final-index assertions, then baseline M3 timed out at
auth_validatedafter 15,103 ms, before any turn. Startup took 169 seconds at host load 72.7 on 32 CPUs, with 14.289 seconds of overlapping post-ready plugin-registry work. This supports contention but does not identify the precise awaited profile operation. The later expired-profile-authority diagnostic followed socket closure and SIGTERM. Handshake/profile/host-name owners are unchanged by the PR and through inspected main8204e917; no named fix was found. All observed processes ended, and fixture database paths were disjoint. The incomplete local cohort is excluded from the isolated performance comparison; passing isolated runs are not claimed to fix the local failure. No timeout or assertion was weakened.The latest completed trusted ClawSweeper review reviewed exact head
a67f2b5cat 2026-10-08T03:54:34.399Z, with no actionable correctness or security finding. Its remaining request was this final pinned qualification, now satisfied. Its earlier blocked verdict is not relabeled as an approval. Exact-head CI is green; no inherited-CI admin exception is requested.Previously validated operator-recovery integration
Candidate
1432788977f1f88c8dbc6891b1abff128f992979merges main38c96048a567f287293207a172388bb7ca1e6f65after #166553 created a real conflict. It preserves both this PR’s captured physical session target and main’s prepared operator-authority source guard. The source guard remains a separate worker-guard property so its preparation metadata survives; accepted cleanup retains its original settlement authority. Main’s authenticated source capture, replay, revocation, and retry snapshot behavior is preserved. No rebase was used.Independent P2 review is clean. All 117 focused claim/admission/lifecycle/successor and Gateway/operator-recovery tests passed with one worker in 792.25 seconds. Core production, all 27 core-test shards, extension production/tests, changed lint, and Madge/runtime-cycle checks pass. Twelve selected runtime/import/PR-inventory tests passed in 15.74 seconds; the other sixteen tooling cases were intentionally outside this focused selection and retain their prior completed evidence. The local SDK report completed with exit 0: digest
4fb5fcf062e0d68ba68001fa375da89251366c6cd2035f9257c66abcd064ec94, no entrypoint additions/removals, all 131 affected top-level export declarations unchanged, and eight internal closure changes. Its temporary worktrees were removed.That operator-recovery head passed a separate local Node 24.21.0 / macOS arm64 comparison against main
38c96048. Cloud admission had reached its fleet cap. Five alternating pairs retained all samples; the first three triggered a timestamp-only extension, and the final maximum median duration ratio was 1.199379. All ten workloads and exact three-source/five-chunk memory assertions passed.Boot +3 (0.109%) was unchanged shared-reader/WAL timing, with identical residual medians of 2594. Individual warm06 +4 (0.265%) was unchanged WAL timing: main WAL counts
[4,0,0,4,0], candidate[0,4,10,12,0]; residual medians were 1508→1502. Producer blobs and PID/thread/phase-bound stack evidence establish the standing non-turn and 0.5% turn-noise qualifications. Raw all-thread counts remain the gate; exclusions are attribution only. No unloaded-host claim is made. Run 3 on both sides recorded one nonfatal shutdown audit-prune database-lock attempt in byte-identical audit owners; every other run had none, and all semantic checks passed. Both worktrees were removed, no remote lease was used, and the archive SHA-256 isff33bd7b22f8baa4e1a62b0515aa0d84101a73a2633adfc8e3d84bebdf5bfc87.This is historical evidence for
14327889, not the finalf64289f7measurement.Previously validated integration with #166674
Candidate
8b9c738335e70b45155d5053dfff1674cb0b3606contains merge commit3b7a68485ec5d49ae7c7fd651baeab8655300067with mainc6698b1e9b2b4adc9e0c2b0ee10439fe9936b693, followed only by a test callback-variable rename. The main merge resolves the real overlap with #166674: it reuses main’s context-owned source publication and typed terminal settlement, removes the superseded unreleased public callback, and retains prepared freshness plus live and physical-store guards for diagnostics. No rebase was used.The final production tree and test-only follow-up each have a clean independent P2 review. Post-integration core production, all 27 core-test shards, extension production/tests, formatting and affected lint pass; Madge and runtime-value graphs both report zero cycles. All 266 focused Gateway/Goal, admission/recovery, persistence/custody, and model-command tests passed with one worker in 972.39 seconds. All 28 wrapper/import-closure tests passed in 151.97 seconds. The real first-Goal publication-failure and Gateway close-settlement cases pass.
The local SDK report is checked for
c6698b1e9b2b→3b7a68485ec5: digestf31f57bfe90d29b5cd4af1246d44c5e97ed1d14ea50c22a21874502b09ffd208. No entrypoint additions/removals; all 131 affected top-level export declarations/kinds are unchanged. Eight internal declaration-closure changes retain compatible optional facts and helper moves. The final test-only rename changes no SDK or benchmark input. Both SDK temporary worktrees were removed.Fresh integrated performance gate: PASS. The AWS run measured main
c6698b1e9b2bagainst production candidate3b7a68485ec5as M1,C1,M2,C2,M3,C3 on one c7a.4xlarge host. Every workload, calibration, SQL conservation and final-index assertion passed. No phase median increased. The maximum median duration ratio is 1.02451; no extra pairs were needed. The final8b9c7383commit changes only a test callback variable and leaves all production, build and harness inputs unchanged.The compaction+shutdown delta reconciles exactly in every pair:
Connect’s third-pair +31 is unchanged cron-store mutation (+24), shared-state worker opening (+4), and reader admission (+3) crossing from the baseline first-turn window into connect. All SQL/stack groups appear in baseline and the producer blobs are identical. Control’s first-pair +4 is unchanged WAL-maintenance placement. The fresh cohort executes exactly 64 WAL and 11 discovery statements per complete run; these are distinct from the earlier approved 68/18 cohort. Connect/control medians are equal, so no tolerance exception is needed. Request-census sidecars are absent; this is statement/stack attribution, not per-request categorization.
Every final index retained exactly three source transcripts and five expected chunks, correct text hashes, provenance and vectors, revision 8 and three embedding requests. Native error lists are empty. The remote worktrees were cleaned up and the lease was verified released. Archive SHA-256:
16cba028f4a15f1599e5b52adc0e27a1fa1531052b6ba1dcace683839a2d573a. A portal event-append timeout did not affect the successful workload, receipt, or complete downloaded archive.CI on
496b8731ran synthetic merge75b60aa3with main87f2a98fand failed three model-command cases indirective-handling.model.test.tsandget-reply-native-slash-fast-path.test.ts: the async placement reader added by main #166445 requires the host shared-state broker. The integration routes those two suites through the existing host-owned project; all 146 tests in the two files now pass without changing production guards or assertions. Independent attribution is complete: both complete files passed five runs on raw PR496b8731and five runs on merge basef1862732, each with one worker under Node 26.10.0 (97 directive and 49 slash cases per run). Mainc6698b1reproduced the exact directive failure three times (96/97 pass) and both slash failures once (47/49 pass). All 24 receipts are retained; no assertion, broker guard, or runtime behavior was weakened. The cause is main commit83a95401(#166445), which introduced the async placement read after the failing PR head’s base. Exact-head green hosted CI and fresh trusted ClawSweeper remain required before landing.Previously approved cohort, before the #166674 integration
Candidate
496b87316d669980f59dd9f38f5bc6c083f5b4b9, tree1c22678ea7de512ce14de7413f4e6326ea1ca032, contains the approved production revision897a910608255c833156f5b3c24a216d7f7db810(tree3fbd711cf11d2016d4593df6ff378ccca39c24ac) plus the test-only catalog-counter repair below. Production and benchmark inputs are unchanged. It includes mainf1862732145936ea98ad720fcb8901a704e6695athrough a merge commit. The integration preserves the restart-safe freshness cases and awaits main's asynchronous request normalization. No rebase was used.Performance gate: PASS, explicitly approved by the maintainer/coordinator on 2026-10-07 for production revision
897a91060825, unchanged by the test-only follow-up. The connect median increase of four statements is within the non-turn tolerance (at most +10 statements absolute, or +2%) and is fully attributed to unchanged WAL maintenance and bundled discovery crossing phase boundaries. First turn, warmed turns, and compaction+shutdown all decrease; control is unchanged. No new PR-caused connect requests were identified.The complete AWS run executed M1,C1,M2,C2,M3,C3 on one c7a.4xlarge host. Every workload, calibration, phase/thread/SQL conservation check, and closed-state memory assertion passed. All six final indexes contain the expected three sources and five content chunks, correct provenance and vectors, and a positive publication revision; all six observed revision 8 and three embedding requests. Every median duration ratio is below 1.5 (maximum 1.0563), so the timestamp-only rule did not extend the cohort.
Connection duration ratio is 1.0026; compaction+shutdown is 0.9958. All other phase medians satisfy their numeric limits. The first-turn reduction is 179 statements and the warmed reduction is 25.4 statements/turn. The additional writer-schema refresh is now zero in all six runs.
Exact remaining connection attribution:
Every full run executes exactly 68 WAL statements and 18 discovery statements. Producer source is byte-identical; the only differing traced module adds a schema-reuse helper and leaves the existing read-operation functions unchanged. The third pair’s extra four WAL statements account for the total medians 323→327; pair two’s +7 is discovery placement. Five one-run sentinel groups differ only in their asynchronous stack tails and preserve their SQL counts within the invariant 320. Request-census sidecars were absent, so no stronger host-request causal claim is made.
Boot+connect sums are main 3710/3707/3708 and candidate 3708/3714/3708, with equal medians. The explicit approval applies the non-turn tolerance directly to connect: +4 statements (+1.238%), with unchanged whole-run owner totals. First-turn savings are not combined with connect. No additional numerical run was requested, and no maintenance or freshness check was weakened.
Both remote worktrees were removed and the AWS lease was verified released immediately after artifact download. Archive SHA-256:
720d00f4c8192aa92a91a2f70914f743c7863f38557fcc64a2502c7ec1704b6d. A nonfatal portal stdout-event append timeout occurred after the workload; the complete downloaded archive and successful native receipt were verified. Earlier download-option and workspace-adoption refusals occurred before any remote payload or sample; the supported fresh-PR checkout route resolved them.The released SDK comparison completed locally for the exact final baseline/head: digest
cf431cb28ed3dfcab2d0872d80e4cad4e83a1b90fa6c0699cf2fb4fe72f02822. No entrypoints were added or removed. All 131 affected top-level declaration strings and export kinds are unchanged; eleven reachable internal declaration changes contain compatible optional facts/callbacks and helper moves. This does not claim identical declaration closures. Both snapshots rendered successfully in 527.7 / 526.5 seconds. No additional compatibility record is required.ClawSweeper completed a trusted review of
496b87316d669980f59dd9f38f5bc6c083f5b4b9with no actionable code or security findings; it required resolution of the later main conflicts. That review is historical, and the final published head requires fresh hosted CI and ClawSweeper. CI on897a91060825failed five catalog-budget cases inmemory-schema-storage-migration.test.ts; ClawSweeper independently reported the same P2 finding and accepted the performance evidence, with no security finding. This was PR-caused test-observer drift: the production query correctly addedtbl_namefor authorization, while the test matched only the oldSELECT name, sqlprojection. Commit496b87316d66recognizes the full catalog query independently of projection, preserving the one/two-read limits, storage-preservation checks, and changing-authorizer assertions. No production file changed.The full migration file reproduced the same five failures in all five PR-head runs. All five merge-base runs passed its 22 existing tests under the same Node 26.10.0 runtime; the new failing cases do not exist on main, so no inherited-failure exception applies. After the repair, all 29 migration tests and 109 schema-contract tests passed in 15.43 seconds, with the repository runner and one worker. The selected changed-file checks and fresh P2 review also pass. Current-head CI remains mandatory; prior-head hosted checks are historical evidence only.
That historical integrated tree has a scoped-clean independent P2 review. Core production, all 27 core-test type shards (including SDK type assertions), extension production/tests, formatting, lint, ratchets, unused-export scans, and storage/auth/loader guards pass. Both Madge and the runtime-value graph report zero cycles. The diff adds zero environment names and no static main-thread database-call debt. The selected extension lint reuses its successful isolated run (136.70 seconds): the two extension inputs, package manifest, and lockfile are byte-identical to that tested candidate.
Focused proof includes 123 compaction/provider lifecycle tests in 64.59 seconds, 88 integrated chat/admission/recovery tests in 295.09 seconds, and six Doctor contract tests in 19.04 seconds, all using the repository runner with one worker. The manager-acquisition regression failed before the repair, and the real native adapter's delayed-admission cases failed before the handoff signal was moved. A fixture initially retained a provider binding across its explicit module reset; binding it in the active test-module lifetime fixed that isolation error without changing production behavior. Runtime-process build graph and get-reply import closure passed. Earlier valid ownership, corruption, rollback, replacement, worker-routing, and restart-close proof remains applicable to unchanged contracts; no test project was bypassed.
Statement attribution and rejected evidence
The originally rejected cohort had compaction+shutdown main 1927/1999/1929 versus candidate 2274/2156/2167. Its warmed +0.2/turn was explicitly accepted as noise; that acceptance does not waive a later cohort's gates.
A later integrated cohort isolated a remaining 40-statement writer readmission immediately before the existing predecessor entry read (main 0/0/0; candidate 40/40/40). Both trees read the predecessor once. The read-only-owner repair removes this writable preparation; actual successor mutations still use the guarded writer. A missing-store regression failed before the repair because validation recreated the store, and passes with the store left absent.
The first read-only candidate's apparent large statement reduction was rejected: its final memory indexes were empty in all three runs. Main and the earlier candidate had three sources and five chunks. Those samples are functional failures, not performance evidence. The final cohort above verified complete indexed content, provenance, embeddings, and a positive publication revision after every invocation.
Original connection attribution (baseline
86b83b74, candidate1cff897f; each cell is runs 1 / 2 / 3):This reconciles the median 327→349 (+22). Catalog/discovery displacement is directly proven: all six runs execute exactly 18 model-catalog and 19 bundled-discovery statements across boot + connect + first-turn. Candidate run 2 moves nine cron statements into first-turn; all runs execute 39 cron-mutation statements overall. Queue-health placement varies across phases, and a phase can split a read envelope from its payload. These producers are unchanged by the PR; the native stacks do not retain host request IDs, so no stronger caller-level causal claim is made.
Original control attribution:
The four-statement outbound envelope is a data-version probe, schema-content version read, queue-ownership read, and unfinished-delivery SELECT. Existing scheduled recovery owns it (
deliveryQueue.outbound); baseline traces contain the same payload in other phases. The WAL stack names periodic maintenance through GatewayScheduler. No new connect/control SQL signature or changed producer supports a production fix, and their freshness/ownership checks remain intact. This attribution does not waive the final cohort's numeric gates or pool historical samples.Compatibility, integration, and retained proof
Released surfaces were checked against
v2026.10.1-beta.1andv2026.9.8: SDK exports, runtime contracts, and documented subpaths. The synchronous session-reset-freshness API retains its existing compatibility adapter, deprecation record, migration documentation, and type test. The superseded explicit source-commit callback is absent from both release tags and has been removed in favor of main’s internal context publisher. The providerrefresh(): Promise<void>signature and existing acquisition/binding signatures are unchanged; the new handoff helper is internal. The removed index helper was never a released plugin subpath or runtime API.Main's #166674 overlaps transcript source publication and terminal settlement; the integration uses its single owner and retains this PR's custody tests at that boundary. Main's #166503 overlaps the index batching repair; this integration reuses that design and its TEMP-shadow tests, and preserves empty-database column authorization in the existing catalog query. Earlier integration also preserves main's sharing-specific projection, complete replacement receipts, and incognito member-result envelopes. Overlap with #166102, #165901, #166183, #165921, #166253, and the adjacent session/transcript/placement/profile cleanup work is incidental or incorporated; focused hunks preserve their semantics. #162433 remains a separate design draft.
The moved claim-grant callbacks retain no synchronous SQL reads of other owners, so there is no SQL-in-grant exception to list. Same-owner claim predicates remain transaction-local; placement/profile guards consume prepared facts and failure publication checks physical file identity.
The published-driver update cell at the originally reviewed tree used the real 2026.9.8 driver in a disposable AWS Docker environment and passed in 464.596 seconds: candidate installation succeeded, readiness returned 200, durable history survived, and incognito history cleared on restart. Its canonical package build passed in 393.982 seconds. Subsequent changes alter admission/publication work and memory handoff, not schema or upgrade contracts; this is retained contract evidence, not a claim of a new package build at the final head. The paired cohort supplies final-tree Gateway builds and behavioral proof.
The latest Testbox measurement attempt waited beyond 15 minutes without a runner; its lease was stopped and verified completed without running a workload. The authorized AWS fallback owns the new cohort. An interrupted local SDK render was cleaned up and restarted at the same pinned revisions. No failed numerical cohort was rerun merely to obtain green.