Repository navigation
refactor(gateway): move startup database work off the main thread - #169880
Conversation
Await worker-backed approval recovery, revision key loading, config preparation, hook selection, shared-auth ownership, and placement hydration before publishing startup state. Reuse owner operations and batch approval recovery without changing stored data or authority checks.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
|
Codex review: needs real behavior proof before merge. What this changesThis PR moves Gateway startup database initialization into existing workers and awaits prepared results before publishing runtime state. Example: Restart with a pending approval from runtime-a.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 4 items remain Keep open: this maintainer-directed refactor addresses remaining startup database work on main, and the reviewed diff establishes no discrete introduced bug. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherGateway startup consumes configuration and persisted state, prepares approval recovery, installation keys, consent, hooks, and cron selection, then publishes runtime state for request handling. flowchart TD
Startup --> ReadWorker
Startup --> WriteWorker
ReadWorker --> SQLite
WriteWorker --> SQLite
SQLite --> PreparedFacts
PreparedFacts --> Runtime
Runtime --> Effects
Technical reviewBest possible solution: Keep startup preparation in the existing workers while preserving readiness ordering, installation identity, retained data, and current consent enforcement. Do we have a high-confidence way to reproduce the issue? Current main still performs synchronous approval boot recovery and revision-key initialization; source inspection establishes the paths, and the PR reports matching live startup traces. Is this the best way to solve the issue? Reusing existing workers, batching approval recovery, and carrying prepared selections is a coherent solution that follows the repository's single-owner design. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7f1400c19c4c. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: shipped entry point. SecurityNeeds attention: No concrete security violation was established, but the standalone consent authority handoff remains unproven. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +11, Tests +307, Docs +18, Other -20. Total +316 across 69 files. Added test files: 2. View PR surface stats
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (10 earlier review cycles; latest 8 shown)
Reviewed October 12, 2026, 3:39 PM ET / 19:39 UTC (Revision 11). |
|
Coordination note from a parallel landing attempt (stopped; nothing was pushed to this branch). The PR removes the synchronous main-thread provenance read behind A test restoring synchronous-path coverage is on Local classification on a heavily loaded host (timings unreliable): |
## What Problem This Solves Two generated fixtures in `test/non-isolated-runner.test.ts` fail before completing their intended lifecycle proof. After #170162 (`17c9b482ee5d`), the native cron module gained runtime dependencies that Node could not resolve from TypeScript source. Fixing relative imports exposed a workspace alias, then a parameter property in the existing retry package that Node's strip-only mode cannot load. Separately, #169880 (`04d4e9cd3fbf`) removed the synchronous provenance initializer still called by both generated Gateway lifetime tests. ## Why This Change Was Made Prime the real cron module through the fixture's native CommonJS entry point with a temporary synchronous resolution hook for relative source imports and exact aliases from `tsconfig.json`. Always deregister the hook in `finally`, and enable Node's native TypeScript transformation only in this generated child project's `execArgv`. Vite still imports the same native generation. Migrate both Gateway fixtures to await the existing `prepareClawInstallSchemaVersions(options)` owner and publish its result. Carry the Gateway project's plugins into the child and give its newly asynchronous worker calls the same managed compiled-worker setup and joined disposal used by the cleanup child. Run this generated host fixture in a fork: shared-state admission requires a process main thread, as the existing live and agents-support test configurations already document. Keep the Gateway isolation and custom cleanup runner. ## User Impact The combined change touches three test files (+59/−17). It preserves native cache identity, reset behavior, partial-mock metadata, readiness and close notifications, `afterAll` ordering, awaited resource drains, retired-generation isolation, and every lifecycle assertion and aggregate count. The pool metadata assertion now expects `forks`. Readiness failures include the captured provenance error before the intentional close replaces that snapshot. Production code, timeouts, and test counts are unchanged. ## Evidence At final head `b59341be18c2`, [CI run 38314652902](https://github.com/openclaw/openclaw/actions/runs/38314652902) passes both tests in `test/non-isolated-runner.test.ts`: shared runner cleanup in 60.697 seconds and Gateway worker lifetimes in 38.036 seconds. Vitest duration is 100.66 seconds; the CI test step takes 104 seconds and its job takes 172 seconds including setup. This is exact-head runtime proof for the complete patch; the earlier failed runs below only establish the causes. The focused reproduction command is `pnpm test test/non-isolated-runner.test.ts --maxWorkers=1`; no separate local runtime run is claimed. The two earlier resolver changes each passed targeted formatting/lint, diff checks, normal commit hooks, and an independent Codex P0–P2 review. The fixture follow-ups passed targeted lint, formatting, diff checks, and normal hooks; the transform/provenance follow-up also received a separate maintainer diff inspection. The two completed review rounds are retained without a third round. CI run [38302535736](https://github.com/openclaw/openclaw/actions/runs/38302535736) showed the original relative-import failure; [38306200884](https://github.com/openclaw/openclaw/actions/runs/38306200884) reached the workspace-alias failure. At the prior PR head `2fe45983c46b`, run [38310484484](https://github.com/openclaw/openclaw/actions/runs/38310484484) passed the selected type, lint, baseline, source-contract, and architecture checks, but both parent tests failed: cleanup encountered the unsupported retry parameter property, and Gateway lifetime encountered the removed initializer. The cleanup report expected six failed modules/suite errors from intentional fixtures and observed ten/nine because of the unexpected import failures. Those intentional MCP, watcher, and cancellation failures are not product regressions. At head `3703bbbc703d`, run [38312339272](https://github.com/openclaw/openclaw/actions/runs/38312339272) passed cleanup in 63.515 seconds, confirming the native import and transformation fixes. Gateway lifetime still failed with `A:state-error` and `B:state-error`. That log did not emit the underlying exception, and no retained fixture artifact was uploaded. The following patch restored omitted Gateway plugins and managed compiled-worker ownership and added error diagnostics. At head `aefd7bcd3712`, run [38313572251](https://github.com/openclaw/openclaw/actions/runs/38313572251) again passed cleanup and exposed the exact Gateway error: `Shared-state admission requires the host broker`. The native `isMainThread` guard in `openSharedStateSqliteWorkerStore` rejects the inherited thread pool before broker admission. The final fixture-only change selects `forks` and updates the pool metadata expectation; it does not mock or weaken that owner boundary. All selected static leaf checks pass at the final head: changed-test, source-contract, boundary, lint, production-type, all five core test-type stripes, root test-type, and baseline-ratchet checks. The architecture job executes both cycle checks with zero cycles and passes Kysely guardrails. The PR does not select Knip. Scoped Knip evidence comes from the actual V28 scan at `0c4b38b77adf`: its only findings were three unrelated Team-scale fixture exports, fixed on main by `36e78f215f1f`. Comparing the three fixture files and their configs shows no new static module edges, exports, dependencies, or test entry selection after that scan. The generated provenance import switches symbols within the same owner module; runtime changes are proven by this PR's passing tests. The only Knip-config difference is the unrelated PostgreSQL generator entry already landed as `e2f58e771393`. This qualifies the fixture scope; it does not claim that the full V28 Knip scan passed. The diff is test-only: no SQL statements, requests, T1 calls, SDK APIs, schema, updater, or service lifecycle behavior changes are claimed. Build and published-driver jobs are skipped by PR selection. The final exact-head CI run is green, including `openclaw/ci-gate`: 28 jobs succeeded and 28 were skipped by selection.
…enclaw#169880) Move approval recovery, config revision-key creation, config preparation, hook selection, cron partition selection, and Claw provenance preparation through their existing database workers. Await required preparation before Gateway readiness and remove the superseded synchronous startup paths. Keep approval and consent authority with their existing owners. Batch approval recovery in one transaction, retain the durable revision key with an atomic upsert, and reuse committed facts and captured startup selections. No schema, stored-format, retention, or update behavior changes.
…0263) ## What Problem This Solves Two generated fixtures in `test/non-isolated-runner.test.ts` fail before completing their intended lifecycle proof. After openclaw#170162 (`271e435a9bbe`), the native cron module gained runtime dependencies that Node could not resolve from TypeScript source. Fixing relative imports exposed a workspace alias, then a parameter property in the existing retry package that Node's strip-only mode cannot load. Separately, openclaw#169880 (`c8a40c7a9dab`) removed the synchronous provenance initializer still called by both generated Gateway lifetime tests. ## Why This Change Was Made Prime the real cron module through the fixture's native CommonJS entry point with a temporary synchronous resolution hook for relative source imports and exact aliases from `tsconfig.json`. Always deregister the hook in `finally`, and enable Node's native TypeScript transformation only in this generated child project's `execArgv`. Vite still imports the same native generation. Migrate both Gateway fixtures to await the existing `prepareClawInstallSchemaVersions(options)` owner and publish its result. Carry the Gateway project's plugins into the child and give its newly asynchronous worker calls the same managed compiled-worker setup and joined disposal used by the cleanup child. Run this generated host fixture in a fork: shared-state admission requires a process main thread, as the existing live and agents-support test configurations already document. Keep the Gateway isolation and custom cleanup runner. ## User Impact The combined change touches three test files (+59/−17). It preserves native cache identity, reset behavior, partial-mock metadata, readiness and close notifications, `afterAll` ordering, awaited resource drains, retired-generation isolation, and every lifecycle assertion and aggregate count. The pool metadata assertion now expects `forks`. Readiness failures include the captured provenance error before the intentional close replaces that snapshot. Production code, timeouts, and test counts are unchanged. ## Evidence At final head `b59341be18c2`, [CI run 38314652902](https://github.com/openclaw/openclaw/actions/runs/38314652902) passes both tests in `test/non-isolated-runner.test.ts`: shared runner cleanup in 60.697 seconds and Gateway worker lifetimes in 38.036 seconds. Vitest duration is 100.66 seconds; the CI test step takes 104 seconds and its job takes 172 seconds including setup. This is exact-head runtime proof for the complete patch; the earlier failed runs below only establish the causes. The focused reproduction command is `pnpm test test/non-isolated-runner.test.ts --maxWorkers=1`; no separate local runtime run is claimed. The two earlier resolver changes each passed targeted formatting/lint, diff checks, normal commit hooks, and an independent Codex P0–P2 review. The fixture follow-ups passed targeted lint, formatting, diff checks, and normal hooks; the transform/provenance follow-up also received a separate maintainer diff inspection. The two completed review rounds are retained without a third round. CI run [38302535736](https://github.com/openclaw/openclaw/actions/runs/38302535736) showed the original relative-import failure; [38306200884](https://github.com/openclaw/openclaw/actions/runs/38306200884) reached the workspace-alias failure. At the prior PR head `2fe45983c46b`, run [38310484484](https://github.com/openclaw/openclaw/actions/runs/38310484484) passed the selected type, lint, baseline, source-contract, and architecture checks, but both parent tests failed: cleanup encountered the unsupported retry parameter property, and Gateway lifetime encountered the removed initializer. The cleanup report expected six failed modules/suite errors from intentional fixtures and observed ten/nine because of the unexpected import failures. Those intentional MCP, watcher, and cancellation failures are not product regressions. At head `3703bbbc703d`, run [38312339272](https://github.com/openclaw/openclaw/actions/runs/38312339272) passed cleanup in 63.515 seconds, confirming the native import and transformation fixes. Gateway lifetime still failed with `A:state-error` and `B:state-error`. That log did not emit the underlying exception, and no retained fixture artifact was uploaded. The following patch restored omitted Gateway plugins and managed compiled-worker ownership and added error diagnostics. At head `aefd7bcd3712`, run [38313572251](https://github.com/openclaw/openclaw/actions/runs/38313572251) again passed cleanup and exposed the exact Gateway error: `Shared-state admission requires the host broker`. The native `isMainThread` guard in `openSharedStateSqliteWorkerStore` rejects the inherited thread pool before broker admission. The final fixture-only change selects `forks` and updates the pool metadata expectation; it does not mock or weaken that owner boundary. All selected static leaf checks pass at the final head: changed-test, source-contract, boundary, lint, production-type, all five core test-type stripes, root test-type, and baseline-ratchet checks. The architecture job executes both cycle checks with zero cycles and passes Kysely guardrails. The PR does not select Knip. Scoped Knip evidence comes from the actual V28 scan at `0c4b38b77adf`: its only findings were three unrelated Team-scale fixture exports, fixed on main by `2531250f6525`. Comparing the three fixture files and their configs shows no new static module edges, exports, dependencies, or test entry selection after that scan. The generated provenance import switches symbols within the same owner module; runtime changes are proven by this PR's passing tests. The only Knip-config difference is the unrelated PostgreSQL generator entry already landed as `19581446c556`. This qualifies the fixture scope; it does not claim that the full V28 Knip scan passed. The diff is test-only: no SQL statements, requests, T1 calls, SDK APIs, schema, updater, or service lifecycle behavior changes are claimed. Build and published-driver jobs are skipped by PR selection. The final exact-head CI run is green, including `openclaw/ci-gate`: 28 jobs succeeded and 28 were skipped by selection.
#170162 backport The #170162 backport (cf6f760) added a runtime import of agents/run-termination.js to cron/service/active-run-cancellation.ts. The non-isolated runner fixture loads that source through native CommonJS require, which cannot resolve .js specifiers to TypeScript sources, so 09-d and 09-i failed with 'Cannot find module .../run-termination.js' (FRV run 38333371459, job 115088198455). Port the cron fixture portion of main's companion fix #170263 (aeaae03): prime the native generation through a temporary synchronous resolve hook for relative .js and tsconfig alias imports, and enable --experimental-transform-types in the generated child project. The Gateway lifetime hunks of #170263 are not ported: they follow #169880, which is not on this branch, and that test passes here.
What Problem This Solves
Gateway startup still ran business initialization SQL on its main thread, even though the relevant owners already support worker access.
User Impact
Startup recovery and configuration retain their existing behavior and finish before accepting requests. Database admission, schema versions, stored bytes, consent checks, and update behavior are unchanged.
Why This Change Was Made
Approval recovery now closes orphaned requests and prunes terminal rows in one worker request and one transaction. Gateway startup awaits that recovery after registering cleanup. Browser notification recovery follows the committed result as retained background work.
The config revision key uses an atomic, key-preserving upsert through the existing writer. Applied config publication awaits asynchronous preparers, including Claw consent provenance. Remote catalog startup uses its existing worker preparation. Internal hooks share one worker-read selection across startup outcomes, sidecars, and the loader. The secrets startup fast path prepares shared-auth ownership through its existing worker-backed cache before inspecting legacy sources, preserving lazy loading of the full secrets runtime.
Cron resolves its partition once through the shared read worker alongside the existing bootstrap preparations; service construction and reload consume that prepared path. A measured 7.52-second late worker-dispatch wait led to moving this read earlier, where it overlaps startup preparation without adding a request. Late Claw policy registration uses published provenance facts without opening SQLite. Standalone agent setup prepares those facts alongside secrets before activation, then binds the returned configuration through the existing captured-config preparation operation. Secrets activation publishes a clone, so the returned configuration needs its own binding to those already loaded facts. This adds no SQL. The supported provenance writers publish updates or invalidate the cache, so consent still uses current owner-held authority.
The synchronous startup paths are removed. Unrelated released synchronous interfaces retain their existing contracts. GitHub OAuth and placement hydration were already worker-backed on the integrated base of this PR; this PR claims no savings for them.
Removed duplicate work and accepted edge cases:
Real approval, credential, placement-effect, and consent authority checks remain in their owning boundaries.
Evidence
Basic changed-file formatting, lint, and whitespace checks passed. Regression coverage includes rejected approval recovery aborting real Gateway startup, off-main recovery with immediate readback, persisted and corrupt revision keys, applied-config publication ordering, hook read-after-write, and shared-auth startup without caller-thread SQL or loading the full secrets runtime. Tests and required static checks run in PR CI under the campaign's relaxed testing policy.
Codex autoreview completed two rounds with no actionable P0–P2 findings, covering startup ordering and failure cleanup, approval recovery, key persistence/corruption, captured hook selection, and shared-auth fast-path behavior. The final live-boot trace exposed three remaining synchronous statements; the completion commit removes them through the existing cron and provenance owners and adds direct regression coverage for both. That completion was manually reviewed and checked against writer publication and standalone-agent behavior; no third routine review was run under the two-round limit.
The integration includes main's existing fixture and database-admission repairs. CI exposed two stale test expectations: the startup trace now includes the parallel
cron.store-pathpreparation; the corrupt-key test inspects preserved corrupt bytes through a raw read-only handle because the managed opener correctly rejects corruption on readmission. Both assertions retain their original contract.Pre-conflict CI 38276082392, head
b42322c71212, passed production and test types, lint, source/architecture guards, worker/dialect/baseline ratchets, and Madge (zero cycles). Both test-only corrections passed. The earlier Doctor process and node-execution timeout cases passed on the runtime-identical head (29.514 and 96.021 seconds).The complete 71-job audit found four failing cases in two jobs: historical transcript normalization in
doctor-config-preflight.test.ts; fresh revisions and both large-shrink deletion variants inserver.config-patch.test.ts. All are unchanged against integrated main32c839147a80. The Doctor case reproduces identically there: its transcript-directives step refuses with “Transcript payload preparation requires admitted SQLite schema facts,” leaving the same inline directives unchanged. The failure is recorded for the main repair owner.The config CI log records a session-worker
prunecallback timeout followed by teardown errors. A focused Node 24 run on integrated main also failed all three cases: fresh revisions and deletion with authority open timed out in server-start hooks (180.453 and 268.607 seconds); deletion with authority revoked reached the test, thenagents.createhit its 10-second client timeout. The first case spent 129.343 seconds in cold import. The candidate diagnostic under Node 26 also failed all three: fresh revisions in the server-start hook (182.510 seconds), both deletion cases atagents.createwith 10-second client timeouts after completed setup. These different phases are not claimed as exact reproductions of the CI failure. Node 24 candidate preparation refused to overwrite Node 26 artifacts because unrelated managed-service metadata could not prove separation; the supported Node 26 diagnostic is not a matching-runtime CI replay. No product regression was demonstrated by these runs, and all timeout failures remain recorded.Of the 46 explicitly tracked owner/consumer suites, 40 passed in CI, Doctor failed as above, and five were unselected. Focused consumer execution recorded 52 passes and three 120-second timeouts: the first health import, Telegram owner closure between deliveries, and the next send preflight case. The health test only awaits a dynamic import before synchronous assertions; later imports passed. The send fixture retains queued one-shot mocks across tests, so the timed-out Telegram case may contaminate subsequent deferred signals; this is a source-supported possibility, not a proven cause. That run was interrupted through native cleanup to stop the cascade, retaining every failure. A fresh process then ran only unexecuted coverage: 82 passed, with the 13 previously executed send cases excluded. Total supplemental consumer execution: 134 passed, three preserved timeouts. No assertions, retries, or time budgets were changed.
Integrated-head Knip found an unused
TransactionRecipesexport in the unchanged database-engine owner. The identical production scan on integrated main reports the same rule, file, and symbol; source and configuration are byte-identical. This inherited finding is recorded for the main repair owner and already fixed upstream by4cdac89. The script scan passed. The concurrent full-tree scan timed out at its existing 600-second budget. Its standalone retry completed in 570.48 seconds and found only the sameTransactionRecipestype export, with no other entries. No scan budget, rule, or exclusion was changed.Same-engine inventory of baseline and measured candidate shows startup T1 calls 9 → 0 (revision key 4 → 0, approval boot 5 → 0), global T1 calls 502 → 493, and deprecated-only calls 2 → 2. Across all touched files T1 is 10 → 1: the unchanged generic config-row helper remains classified runtime/mixed, but live stacks show no remaining MAIN business initialization in this lane. All three dialect groups remain 0 → 0. Madge passed. Knip production and full-tree scans have only the independently reproduced inherited export finding; its script scan passed. All tracked owner/consumer suites have executed, with failures and runtime limits recorded above. This landing uses the authorized relaxed CI exception for the recorded inherited failure and investigated timeout results; it does not label those runs green.
Published-driver × candidate update cell: not applicable. This changes runtime business initialization, with no changes to the installed updater, schema/migrations, plugin loading, or OS service lifecycle. Startup ordering and readiness are exercised by the live boot proof.
Pre-conflict ClawSweeper review completed with no findings or concrete security violation. Its request for consent proof is covered by the completed 14-case integration suite, including restarted frozen-tool use and changed/closed provenance failing closed.
The shared live harness completed the same 13-turn workload on baseline
c6a2ce08ac91and candidateddf8ed89bc9e, including child execution, cron, compaction, and clean shutdown. One live pair follows the campaign's relaxed testing policy. Ten warmed turns per run give these medians [min–max]:The one MAIN statement on each run is outside this startup lane. Across the full workload, statements were 11,409 → 10,788 and requests 2,070 → 1,847. These raw reductions include integrated session-owner changes and are not claimed as this lane's saving.
Per-operation startup evidence, including worker admission/transaction envelopes: approval recovery is one request / four statements (the old MAIN path executed ten statements); revision-key preparation is one request / eight statements (old MAIN seven); provenance preparation is two statements (old MAIN two); install-schema loading is one request / two statements (old MAIN two); cron selection is one request / one statement. The comparable
config.*operations total five requests / eleven statements on both baseline and candidate (health.patch1/3,health.read2/2,snapshot.read1/1,snapshot.upsert1/5). These are cold startup operations, not per-turn work. Stack-attributed family counts omit worker envelopes, so they are not used to claim an additional query reduction. Moving calls to workers alone is not counted as a query saving.Shared read-family statements per warmed turn did not increase:
The first candidate's TCP-listen timing was 100.441 seconds versus baseline 83.484 seconds on the loaded host; the late cron read demonstrably occupied 7.52 seconds. Commit
16c179920a56moved that same read into existing parallel preparations. The final short boot used that exact runtime with only the two test changes inb42322c71212: business MAIN remained 0, TCP listen was 43.010 seconds, readiness 50.421 seconds, and the early cron preparation span 84.6 milliseconds. Baseline readiness was 99.922 seconds. Both runs used isolated state and completed connection/clean-shutdown checks. These are single runs on a heavily loaded host, not a claimed stable speedup; the final trace shows no startup latency regression and confirms removal of the late serial cron wait.The final diff against integrated main
428b3c2ec545is 69 files, +941/−625 lines, including regression tests and the test-only CI corrections.Final conflict integration:
efd33dfe3c16merges main428b3c2ec545. It retains the async startup cutover while adopting main’s committed provenance-cache reuse and inferred config-worker result type. The provenance regression uses supported install/delete writers; the removed foreign-writer test contradicts the Gateway’s single-owner contract. Focused provenance proof passed all 26 tests in 276.78 seconds; its worker preparation took 226.10 seconds on the loaded host. Formatting and syntax lint passed. The broad local lint wrapper timed out after 300 seconds in SDK declaration preparation, before linting; required type-aware proof remains in CI. Earlier SQL measurements remain historical evidence for the unchanged startup cutover, not measurements of this integrated head.The integrated-head CI exposed two redundant failure-reply branches in the cron and hook readers after main narrowed the shared read result type.
1b21e2d730aabremoves those six lines:executeExistingOpenClawStateReadalready throws on failure or a mismatched reply and returns only the validated success. There is no new SQL or runtime fallback. The session canonical-validation test also failed at its pending-dirty assertion (server-methods.canonical-validation.test.ts:262). The identical test and assertion fail on scheduled mainc66da3d764b0, run 38292584060, job 114956275365; the unchanged files and exact failure are recorded for the main repair owner. Final static CI passed after this type fix.Final integration CI also recorded a 120-second timeout in
install.npm-spec.e2e.test.ts(the real npm-pack successor lifecycle case). Its test and owners are unchanged against the merged main parent, but scheduled-main CI does not select that E2E file, so this is recorded as an unresolved timeout, not a proven inherited failure. No timing budget or assertion was changed.Additional integration failures are recorded separately: all four
session-cost-usage-cache.creation-race.test.tscases match scheduled mainc66da3d764b0, job 114956274659, including the offline-maintenance error versus expected fencing/schema-refresh errors.memory-dreaming-reload.test.tsfails during the light phase with “Runtime config is not prepared.” Its initial runtime-facade read succeeds; the later transcript-corpus host read is the unresolved boundary. Scheduled main excludes this release-only suite, so this is an unclassified follow-up, not proven inherited. The fixture uses the unchanged synchronous snapshot setters; no bootmain product regression has been demonstrated. Both are recorded for the main repair owner.Final-head CI: 38298010221 at
1b21e2d730aab; all production/test type partitions, type-aware lint, source contracts, architecture/Madge, boundaries, and baseline/worker/dialect ratchets passed. Knip was not selected by CI; the separate production, full-tree, and script export scans all passed with zero entries on this exact head. Remaining CI test failures are recorded below.Final-head integration CI repeats the exact Doctor, creation-race, canonical-validation, and memory-dreaming failures described above. The npm-pack successor lifecycle test passed in final-head CI; its prior timeout remains recorded, without a claim that a code change fixed it. Required static gates are green, including the separate final-head Knip production, full-tree, and script export scans (zero entries).
The final cron-message integration shard also failed three cases: the Claude CLI/read case timed out after 60 seconds; the trusted-operator Discord edit hit a closed shared-state read admission; the Discord 429 retry case observed startup recovery marking its job interrupted. Scheduled main does not execute this unchanged integration file, so these are unclassified, not proven inherited. The fixture does not cancel a timed-out scenario body before its shared-process cleanup can overlap later scenarios; the first timeout was followed by a passing channel-info scenario, then the two lifecycle failures. That supports possible cleanup fallout but does not prove it, and the first blocked boundary is unknown. The live SQL harness independently completed its cron flow. All three cases are recorded for the main repair owner; no timeout, retry, or assertion was changed.
Landing: all final-head static gates passed. The completed CI run retains three independently proven inherited failures and the explicitly unclassified memory/cron integration failures above. This uses the authorized relaxed landing policy; those tests are not represented as passing or as all inherited. There is no demonstrated product regression in the startup cutover, and the isolated live boot/turn proof remains recorded above.
Latest conflict integration:
3e29d8e9bfa0merges main930bb545e38b. The only textual conflict was the worker-module inventory; resolution retains both this lane’s provenance reader and main’s profile-worker entries. Automatically merged cron code uses main’s authoritative deletion facts, and shutdown retains main’s shared-state option. No new startup behavior or SQL was added. Earlier measurement and behavioral evidence are reused for the unchanged startup cutover; final-head static verification is in progress.New integrated-head test failures at
3e29d8e9bfa08: session wait dedupe (three cases; job 114984186793), pending Stop producer binding (three cases; job 114984187078), and board broadcasts (two cases; job 114984186820) fail at resident user-profile catalog readiness; pending Stop also reports its abortability assertion. All failing test files plususer-profile-list.tsandoperator-role-policy.tsare byte-identical to merged main930bb545e38b. Scheduled mainc66da3d764b0predates the latest profile-worker changes and passed the wait/stop cases, so these new failures are unclassified, not claimed as independently reproduced inherited failures. They are assigned to the main repair inbox without changing tests or adding bypasses. The canonical-validation case repeats its already verified inherited assertion failure.The same integrated CI also records two
session-pending-input-foreign-rewrite.test.tscatalog-readiness failures (job 114984187017) and foursession-processes.test.tsprocess-control projection failures under Bun (job 114984186808). These are outside the authored diff and remain unclassified; no current-main reproduction is claimed. The four creation-race failures repeat the already independently confirmed offline-maintenance mismatch (job 114984186782).The integrated head also repeats the unresolved memory-dreaming runtime-config preparation failure (job 114984186868). Fresh Knip production/full-tree/script scans all pass with zero entries. The local worker ratchet passes (484 → 471 T1 calls using the current inventory engine against its selected comparison base
428b3c2ec545; this is separate from the measured historical 502 → 493 comparison).Job 114984186755 reports
startup-migration.registry-recovery.test.tsfailing withdatabase is locked; the test and migration owner are outside this PR’s authored diff. It remains an unclassified follow-up; no inherited reproduction or timing fix is claimed.Merge-head static verification is complete for
3e29d8e9bfa08: CI 38300953486 passed production types, every test-type partition, every lint partition, source contracts, architecture/Madge, boundaries, guards, security, and worker/dialect/baseline ratchets. Fresh production/full-tree/script Knip scans all passed with zero entries. Later test failures include three chat-read-scope cases (visibility assertion plus two asynchronous-read timeouts, job 114984187056) and one session-resolution projection assertion (job 114984187297). These unchanged owner/test files are recorded as unclassified, not claimed inherited. At the static-gate decision there were ten failed test jobs and two still-running test jobs; this landing does not claim a green full suite. The campaign's explicitly authorized relaxed landing rule permits landing once static gates pass unless a product regression in this change is demonstrated; none has been established here.Final change size remains 69 files, +941/−625 lines. Both Codex review rounds and the historical isolated boot/turn proof remain valid for the unchanged startup migration; there is no third routine review or repeated live measurement for the conflict-only integration.