Repository navigation
perf(sqlite): skip empty admission publications and expose worker timing - #170235
Conversation
|
🦞👀 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 maintainer review before merge. What this changesThis PR skips empty SQLite admission publications and adds opt-in worker request timestamps. Example: A SQLite worker returns zero changed admission records.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR provides a focused admission optimization and useful timing diagnostics; no discrete introduced correctness or security defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe SQLite broker sends typed storage requests and admission snapshots to workers, then receives results and publishes completion diagnostics. flowchart LR
A[Storage caller] --> B[SQLite broker]
B --> C[Admission registry]
B --> D[SQLite worker]
D --> E[Storage backend]
E --> D
D --> B
B --> F[Request diagnostics]
Technical reviewBest possible solution: Retain the existing admission owner and shared validity checks while eliminating empty publication work and exposing bounded diagnostic timestamps. Do we have a high-confidence way to reproduce the issue? Current main unconditionally publishes on install([]), which advances the registry revision and rebuilds worker environment data; this was verified from source without executing target code. Is this the best way to solve the issue? The early return fixes redundant work at its existing owner, and timing extends the established diagnostics path without changing scheduling or settlement. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0ab9dd8be4da. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +65, Tests +48, Docs +16. Total +129 across 9 files. Added test files: 0. View PR surface stats
Review metrics
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 Reviewed October 12, 2026, 5:00 PM ET / 21:00 UTC. |
## What Problem This Solves A first database open can fail during temporary schema contention because the worker's schema-prepare exchange records the pending condition as a terminal refusal before the existing cold-open retry owner can handle it. ## User Impact Cold database opens can wait within their existing deadline for schema preparation to finish. Non-initial opens, companion databases, held schema leases, revoked authority, and ordinary transaction refusals remain terminal. No DDL, schema version, stored-row format, configuration, permission, or retention change is introduced. ## Why This Change Was Made Preserve the pending result across both sides of the existing port exchange before a schema lease or mutation body begins. The existing cold-open owner supplies the retry and deadline; this adds no owner, handshake, timeout, or write replay. The real-port regression covers retry, exhaustion, revocation, path boundaries, and held leases. No authority check is removed. Candidate `2af1dd0ac7cab0cfaecfb49c6eeb176c40b006e0` changes two files (+161/−70). Its delta matches the isolated Codex-reviewed patch and preserves main's private receipt simplification. Main `6315f8adc18ab275a4c933c497113a65bc3f783b` still has the exact preimages of both changed files, so there is no source overlap at that pin. The separate broker repair is excluded. ## Evidence Scoped qualification is complete. The exact-candidate update cell passed; skipped or historical jobs remain labeled according to their actual scope. | Boundary | Result and scope | | --- | --- | | Current static qualification | [Run 38315479055](https://github.com/openclaw/openclaw/actions/runs/38315479055), exact candidate: production/test types, all selected lint, source contracts, boundaries, baseline ratchets, and architecture passed. Madge reported zero cycles and Kysely guardrails passed. The run completed with 51 successful, eight failed, and 25 skipped jobs. Build-artifacts and published-driver update explicitly skipped. | | Current Knip | Job 115031514632 failed its full-tree unused-file scan on the two Control UI benchmark files described below. Production/export scans completed; production unused-file scan passed with zero entries. The inherited failure is repaired by landed #170347 (`0d1e09b7913219091baae888feb7fcdec2b06d2c`): selected-head run 38318772519 executed `deadcode:full` with all five file/export groups at zero, Madge at zero cycles, and applicable static gates passing. This does not change the failed candidate job into a pass. | | Cold-admission regression | All 13 cases, including eight schema cases, passed in [job 114956450854](https://github.com/openclaw/openclaw/actions/runs/38292637049/job/114956450854) on a prior composition with identical changed-source blobs. That job was red on four usage-cache fixture assertions. Bounded source/input review qualifies this retained pass for the admission change; no exact-candidate execution is claimed. | | Operation-admission sibling | 26/26 passed in [job 115001073266](https://github.com/openclaw/openclaw/actions/runs/38306200884/job/115001073266), on a prior composition with identical owner and test blobs; bounded source/input review qualifies this focused reuse, not exact-candidate execution. | | Node-host config sibling | `pnpm test src/node-host/config.test.ts --maxWorkers=1`: 13/13 on composition `7ac691f4a04689c9711192262ad0bc3c73b6ad92`, 175.41 s runner / 606.8 s wrapper. This included the separate broker repair and does not isolate either repair's effect. | | Required update cell | [Job 115046869851](https://github.com/openclaw/openclaw/actions/runs/38316114387/job/115046869851) passed on verified candidate `2af1dd0ac7cab0cfaecfb49c6eeb176c40b006e0`: published 2026.10.2 → candidate 2026.10.2, readiness 200, running version verified, and durable/incognito before-and-after stages all exited zero. One attempt, 658 seconds; lane and service cleanup completed. | The focused reuse compares complete owners/tests and 63 source/config/package inputs. Infra runner/setup inputs and test-loader versions match. Identified drift consists of credential cleanup, opt-in lock-diagnostic removal, lifecycle drain classification, unused Postgres/actor-maintenance paths, a TypeBox bump outside the imported standalone normalization helpers, and a PostCSS patch outside these stylesheet-free tests. The operation sibling calls unchanged settlement directly, not the changed actor dispatch path. These changes do not alter the focused admission/receipt behavior being asserted. The preceding cached-main audit at `b68c44ca8f3ca9d0d4bccb7b620f867547e4cd55` found 60 of the 63 retained inputs unchanged since the previous audit. The three changed inputs come from #170235: optional worker timing in broker request/reply functions, its type-only contract fields, and an early return for empty registry installs. The retained tests call admission and settlement directly, outside the changed broker functions. Schema cases do not install registry payloads; creation cases do not depend on an empty install publishing a revision or cleaning unrelated retired records, and new descriptor creation still publishes its facts. The two-file patch retains the same reviewed patch ID. Additional lockfile drift adds only Control UI dependencies, and workflow drift selects WebKit for another UI suite. This supports the same bounded reuse; it does not qualify general registry housekeeping, worker timing, or the merged runtime. The preceding source audit pinned `0d1e09b7913219091baae888feb7fcdec2b06d2c`, after #169622 and the Knip repair. All 63 retained inputs are unchanged since the preceding audit. The #169622 session/authority contract changes do not enter the two focused tests: cold cases construct the admission owner and real port directly, while the operation sibling uses native in-memory transactions and direct settlement. A supporting static-relative import census found no #169622 changes among 133 cold-test modules, 213 operation-test modules, or 25 shared-setup modules. Its only intersections in the 47-module infra-config census are two lists selecting other tests; neither focused file’s selection or isolation changes. The unchanged owners and actual call paths preserve the bounded 13/13 and 26/26 reuse; #169622 does not itself require integration or fresh execution for those assertions. This is not a complete dynamic import graph and does not qualify its session/authority integration, the broader Gateway, or an installed update. The separate exact-candidate update pass above supplies installed-update evidence at its selected SHA. The final source pin is `6315f8adc18ab275a4c933c497113a65bc3f783b`. Both candidate-file preimages and all 63 retained inputs are unchanged from the preceding audit, including the intermediate `a00f582` check. The direct admission/port and transaction/settlement boundaries preserve the same bounded focused-test reuse. The candidate imports/exports are unchanged, so this repair needs no fresh graph qualification. The passing update cell qualifies the unchanged candidate package; it is not represented as execution of this later main or a merged tree. The prior published-driver cell [job 115009067830](https://github.com/openclaw/openclaw/actions/runs/38306200884/job/115009067830) passed published 2026.10.2 → candidate 2026.10.2 with readiness 200 and running-version verification. It is historical coverage only: dependencies and update/Doctor/state-migration owners have changed since that composition. The subsequent composition omitted this patch and supplies no cold-schema update proof. The red tests are classified separately against completed scheduled-main run [38311154418](https://github.com/openclaw/openclaw/actions/runs/38311154418), head `11a12460482f7790aca049243de04cb9193e87c2`: - Four `session-cost-usage-cache.creation-race.test.ts` cases match historical main's offline-maintenance error instead of the expected creation/schema-refresh refusal. Current main contains fixture fix `a919b2151d5f6487689d5dd032032a9280231e71`, which explicitly prepares shared storage while keeping the competing agent database cold; its exact postimage is verified. No new runtime pass is claimed by this source audit. - Seventeen `board-progress.write-admission.test.ts` cases match historical main's unprepared user-profile catalog, followed by retirement and recursive instrumentation errors. Node/Bun stack formatting differs; the named cases and primary error match. Current main’s #169622 fixture prepares the role schema/catalog and restores instrumentation even when a request rejects; no new executed pass is claimed here. - The default-store rotation case in `session-accessor.test.ts` matches main's expected `session-rebound` / received `undefined` failure. Main already contains fixture fix `be7696c5e9bca74537156e5dc326fb71ca81aa02`; the candidate contains its exact preimage. - Seven `users-preferences.test.ts` cases fail before dispatch because runtime config is unprepared. Their fixtures are already corrected on main by `7e596d5128cc1f678a8463cc9e39d6b27fd179e3`. This is source-verified fixture debt; no executed scheduled-main signature was located or claimed. - Knip reports `scripts/bench-control-ui-cold-load.ts` and `ui/src/test-helpers/control-ui-cold-load-probes.ts`. The flagged files, all-exports config and scan driver remain unchanged; current main’s root Knip config now includes the missing executable entry. Commit `5559404e2da9eb32abe8bbfd74f159d605630f57` introduced the documented path-invoked benchmark without a Knip root; it imports the flagged helper. The separate Knip repair also registers the path-invoked Linux onboarding Vite fixture. Its exact-head manual run 38318772519 passed the full dead-code scan, Madge and applicable statics, and the repair is merged. The inherited static failure is resolved by that landed fix. This is a real static failure, not infrastructure. The exact-candidate real-Gateway job also timed out in `background-work.real-gateway.e2e.test.ts`, while 16 other cases passed. The candidate contains the exact two-file preimage of main fix `9b54cd97281693edf641d320a7a6a9a44d6e2820`: its observer omits `chat.startup`, which appears successful in the timeout diagnostics. This is a known, already-fixed observer defect; the compact log does not prove it was the sole cause of the timeout. The 14 failures in `media-generate-background-retention.test.ts` are source-attributed to the older runtime-config fixture, already repaired on main by `4944a6df77080f328fed59ee22384e3ee45d522f`. The candidate writes config without preparing its runtime snapshot: admission returns null before requester lookup in eight cases, and six late-revocation cases wait for a requester-read spy that is never reached. The existing fix prepares the snapshot after all four fixture writes, without weakening assertions; #169622 now sets that fixture snapshot directly. Both production media owners remain unchanged. The session-accessor and users-preferences fixtures also gained explicit early snapshot preparation in #169622; their earlier failures remain historical evidence, not current-main failures or passes. This is historical fixture debt, not infrastructure. The hidden config exception is not printed in this job, and no pass on the repaired version is claimed. One isolated Codex review completed with no actionable P0–P2 findings; the reviewed delta is unchanged. Source formatting and diff checks passed. Direct basic oxlint reports `max-lines` at 711 > 700; the repository's native CI lint policy makes that rule advisory, and current core lint passed. The raw basic lint command is not reported as passing. This is a correctness repair, not a SQL-reduction change. It adds no SQL call or public SDK surface. No numeric statement/request or main-thread T1 reduction, standalone cold-file wall time, aggregate green CI result, or exact-head `check:changed` pass is claimed.
…ing (openclaw#170235) Avoid rebuilding and republishing the SQLite admission registry when a worker exchange has no new facts. Keep shared revocation, actual publication, FIFO execution, error propagation, and native write settlement unchanged. Expose optional sqlite.worker-timing stages for worker round-trip diagnosis without payload content. Quiet-host microbenchmark overhead p50/p95 improves from 0.1005/0.3412 ms to 0.0946/0.2828 ms; warmed workload remains 201 statements and 45 requests with zero MAIN statements. The turn-latency target is not established by the variable paired measurements. Empty exchanges may retain retired metadata until a real publication or full capture; revoked facts remain invalid immediately. Changed-owner tests, types, lint/contracts, Madge and database ratchets pass. Land under the authorized inherited-failure exception for matching main config/collector/cron failures and three unrelated Knip exports. Full attribution and measurement tables are in the PR.
## What Problem This Solves A first database open can fail during temporary schema contention because the worker's schema-prepare exchange records the pending condition as a terminal refusal before the existing cold-open retry owner can handle it. ## User Impact Cold database opens can wait within their existing deadline for schema preparation to finish. Non-initial opens, companion databases, held schema leases, revoked authority, and ordinary transaction refusals remain terminal. No DDL, schema version, stored-row format, configuration, permission, or retention change is introduced. ## Why This Change Was Made Preserve the pending result across both sides of the existing port exchange before a schema lease or mutation body begins. The existing cold-open owner supplies the retry and deadline; this adds no owner, handshake, timeout, or write replay. The real-port regression covers retry, exhaustion, revocation, path boundaries, and held leases. No authority check is removed. Candidate `2af1dd0ac7cab0cfaecfb49c6eeb176c40b006e0` changes two files (+161/−70). Its delta matches the isolated Codex-reviewed patch and preserves main's private receipt simplification. Main `feb893ca13908081c27230530cc88c59ac7c0158` still has the exact preimages of both changed files, so there is no source overlap at that pin. The separate broker repair is excluded. ## Evidence Scoped qualification is complete. The exact-candidate update cell passed; skipped or historical jobs remain labeled according to their actual scope. | Boundary | Result and scope | | --- | --- | | Current static qualification | [Run 38315479055](https://github.com/openclaw/openclaw/actions/runs/38315479055), exact candidate: production/test types, all selected lint, source contracts, boundaries, baseline ratchets, and architecture passed. Madge reported zero cycles and Kysely guardrails passed. The run completed with 51 successful, eight failed, and 25 skipped jobs. Build-artifacts and published-driver update explicitly skipped. | | Current Knip | Job 115031514632 failed its full-tree unused-file scan on the two Control UI benchmark files described below. Production/export scans completed; production unused-file scan passed with zero entries. The inherited failure is repaired by landed openclaw#170347 (`73611b92e96a103e7ecd4260dd2583150f90a1cd`): selected-head run 38318772519 executed `deadcode:full` with all five file/export groups at zero, Madge at zero cycles, and applicable static gates passing. This does not change the failed candidate job into a pass. | | Cold-admission regression | All 13 cases, including eight schema cases, passed in [job 114956450854](https://github.com/openclaw/openclaw/actions/runs/38292637049/job/114956450854) on a prior composition with identical changed-source blobs. That job was red on four usage-cache fixture assertions. Bounded source/input review qualifies this retained pass for the admission change; no exact-candidate execution is claimed. | | Operation-admission sibling | 26/26 passed in [job 115001073266](https://github.com/openclaw/openclaw/actions/runs/38306200884/job/115001073266), on a prior composition with identical owner and test blobs; bounded source/input review qualifies this focused reuse, not exact-candidate execution. | | Node-host config sibling | `pnpm test src/node-host/config.test.ts --maxWorkers=1`: 13/13 on composition `7ac691f4a04689c9711192262ad0bc3c73b6ad92`, 175.41 s runner / 606.8 s wrapper. This included the separate broker repair and does not isolate either repair's effect. | | Required update cell | [Job 115046869851](https://github.com/openclaw/openclaw/actions/runs/38316114387/job/115046869851) passed on verified candidate `2af1dd0ac7cab0cfaecfb49c6eeb176c40b006e0`: published 2026.10.2 → candidate 2026.10.2, readiness 200, running version verified, and durable/incognito before-and-after stages all exited zero. One attempt, 658 seconds; lane and service cleanup completed. | The focused reuse compares complete owners/tests and 63 source/config/package inputs. Infra runner/setup inputs and test-loader versions match. Identified drift consists of credential cleanup, opt-in lock-diagnostic removal, lifecycle drain classification, unused Postgres/actor-maintenance paths, a TypeBox bump outside the imported standalone normalization helpers, and a PostCSS patch outside these stylesheet-free tests. The operation sibling calls unchanged settlement directly, not the changed actor dispatch path. These changes do not alter the focused admission/receipt behavior being asserted. The preceding cached-main audit at `2be43c633c855851ffd8f6f8e3cba47038d2b9fb` found 60 of the 63 retained inputs unchanged since the previous audit. The three changed inputs come from openclaw#170235: optional worker timing in broker request/reply functions, its type-only contract fields, and an early return for empty registry installs. The retained tests call admission and settlement directly, outside the changed broker functions. Schema cases do not install registry payloads; creation cases do not depend on an empty install publishing a revision or cleaning unrelated retired records, and new descriptor creation still publishes its facts. The two-file patch retains the same reviewed patch ID. Additional lockfile drift adds only Control UI dependencies, and workflow drift selects WebKit for another UI suite. This supports the same bounded reuse; it does not qualify general registry housekeeping, worker timing, or the merged runtime. The preceding source audit pinned `73611b92e96a103e7ecd4260dd2583150f90a1cd`, after openclaw#169622 and the Knip repair. All 63 retained inputs are unchanged since the preceding audit. The openclaw#169622 session/authority contract changes do not enter the two focused tests: cold cases construct the admission owner and real port directly, while the operation sibling uses native in-memory transactions and direct settlement. A supporting static-relative import census found no openclaw#169622 changes among 133 cold-test modules, 213 operation-test modules, or 25 shared-setup modules. Its only intersections in the 47-module infra-config census are two lists selecting other tests; neither focused file’s selection or isolation changes. The unchanged owners and actual call paths preserve the bounded 13/13 and 26/26 reuse; openclaw#169622 does not itself require integration or fresh execution for those assertions. This is not a complete dynamic import graph and does not qualify its session/authority integration, the broader Gateway, or an installed update. The separate exact-candidate update pass above supplies installed-update evidence at its selected SHA. The final source pin is `feb893ca13908081c27230530cc88c59ac7c0158`. Both candidate-file preimages and all 63 retained inputs are unchanged from the preceding audit, including the intermediate `01bf2a7` check. The direct admission/port and transaction/settlement boundaries preserve the same bounded focused-test reuse. The candidate imports/exports are unchanged, so this repair needs no fresh graph qualification. The passing update cell qualifies the unchanged candidate package; it is not represented as execution of this later main or a merged tree. The prior published-driver cell [job 115009067830](https://github.com/openclaw/openclaw/actions/runs/38306200884/job/115009067830) passed published 2026.10.2 → candidate 2026.10.2 with readiness 200 and running-version verification. It is historical coverage only: dependencies and update/Doctor/state-migration owners have changed since that composition. The subsequent composition omitted this patch and supplies no cold-schema update proof. The red tests are classified separately against completed scheduled-main run [38311154418](https://github.com/openclaw/openclaw/actions/runs/38311154418), head `60e5d43fa25737d62aa6ac7bdb7a11f9d936bdcb`: - Four `session-cost-usage-cache.creation-race.test.ts` cases match historical main's offline-maintenance error instead of the expected creation/schema-refresh refusal. Current main contains fixture fix `b506924d58fc9447ab35a821c2029f0c8e110cbf`, which explicitly prepares shared storage while keeping the competing agent database cold; its exact postimage is verified. No new runtime pass is claimed by this source audit. - Seventeen `board-progress.write-admission.test.ts` cases match historical main's unprepared user-profile catalog, followed by retirement and recursive instrumentation errors. Node/Bun stack formatting differs; the named cases and primary error match. Current main’s openclaw#169622 fixture prepares the role schema/catalog and restores instrumentation even when a request rejects; no new executed pass is claimed here. - The default-store rotation case in `session-accessor.test.ts` matches main's expected `session-rebound` / received `undefined` failure. Main already contains fixture fix `5e848de8695e9e8a93ac431447c11de2ffb02a6b`; the candidate contains its exact preimage. - Seven `users-preferences.test.ts` cases fail before dispatch because runtime config is unprepared. Their fixtures are already corrected on main by `95f8e973c07b5984c2760dcc3429cfae9a26ae86`. This is source-verified fixture debt; no executed scheduled-main signature was located or claimed. - Knip reports `scripts/bench-control-ui-cold-load.ts` and `ui/src/test-helpers/control-ui-cold-load-probes.ts`. The flagged files, all-exports config and scan driver remain unchanged; current main’s root Knip config now includes the missing executable entry. Commit `e35494d3fdfc92cedccd7273910de78b28571aa2` introduced the documented path-invoked benchmark without a Knip root; it imports the flagged helper. The separate Knip repair also registers the path-invoked Linux onboarding Vite fixture. Its exact-head manual run 38318772519 passed the full dead-code scan, Madge and applicable statics, and the repair is merged. The inherited static failure is resolved by that landed fix. This is a real static failure, not infrastructure. The exact-candidate real-Gateway job also timed out in `background-work.real-gateway.e2e.test.ts`, while 16 other cases passed. The candidate contains the exact two-file preimage of main fix `3dcebb24ab46297acdf43ca08acf2c715f8b277d`: its observer omits `chat.startup`, which appears successful in the timeout diagnostics. This is a known, already-fixed observer defect; the compact log does not prove it was the sole cause of the timeout. The 14 failures in `media-generate-background-retention.test.ts` are source-attributed to the older runtime-config fixture, already repaired on main by `8f447c5e83cb39fd74840eace70034c8ad1c3dd6`. The candidate writes config without preparing its runtime snapshot: admission returns null before requester lookup in eight cases, and six late-revocation cases wait for a requester-read spy that is never reached. The existing fix prepares the snapshot after all four fixture writes, without weakening assertions; openclaw#169622 now sets that fixture snapshot directly. Both production media owners remain unchanged. The session-accessor and users-preferences fixtures also gained explicit early snapshot preparation in openclaw#169622; their earlier failures remain historical evidence, not current-main failures or passes. This is historical fixture debt, not infrastructure. The hidden config exception is not printed in this job, and no pass on the repaired version is claimed. One isolated Codex review completed with no actionable P0–P2 findings; the reviewed delta is unchanged. Source formatting and diff checks passed. Direct basic oxlint reports `max-lines` at 711 > 700; the repository's native CI lint policy makes that rule advisory, and current core lint passed. The raw basic lint command is not reported as passing. This is a correctness repair, not a SQL-reduction change. It adds no SQL call or public SDK surface. No numeric statement/request or main-thread T1 reduction, standalone cold-file wall time, aggregate green CI result, or exact-head `check:changed` pass is claimed.
Problem and result
Ordinary SQLite worker exchanges with no new admission facts still swept and republished the process admission registry. This invalidated the publication cursor shortcut and rebuilt worker bootstrap data without changing database facts. Empty installs are now no-ops; real publications, reference changes, worker exit, and full capture retain their existing owner paths.
The quiet-host one-row benchmark measures a modest improvement: overhead excluding SQL falls from 0.1005 / 0.3412 ms to 0.0946 / 0.2828 ms (p50 / p95) with detailed timing disabled. This is about 6% at p50, not the target 50%. A trivial round trip is approximately 0.1 ms, so the earlier 3.5 ms-per-request workload estimate cannot be treated as fixed transport overhead. Warmed SQL and request counts are unchanged.
Adds opt-in
OPENCLAW_DIAGNOSTICS=sqlite.worker-timingtimestamps to completed worker diagnostics for queue/dispatch, posting, worker entry/execution/serialization, and broker reply receipt. The startup-sampled flag adds no timing record or additional clocks when disabled. Owner execution includes JavaScript and SQL; caller continuation is measured separately. Framed requests report their initial exchange, omitting unavailable stages. No payloads or SQL text are recorded.FIFO ordering, admission semantics, error propagation, live invalidation, and native write settlement keep their existing contracts. No schema, migration, config contract, request-count/order, or PostgreSQL bridge change. Owned byte transfers already exist, and the audited path has no double JSON encoding to remove. Related request-count work is #170171; the database-engine admission key and once-per-store contract from #169933 remain intact.
Removed check and accepted edge
Empty admission installation no longer calls
publish()to sweep/rebuild metadata. Accepted edge: an empty exchange may leave retired metadata allocated until the next real publication or full capture. Shared retirement/revocation cells invalidate those facts immediately; this does not extend their authority. No compensating checks or new handshake were added.Measurements
Quiet Linux Testbox, Node 24.19.0 / SQLite 3.53.3. Baseline
93bceb67948e, candidate9b7c39693b1d; remote candidate tree6d12426bd5b170f56e1f0c7bd95e153f34f9898fmatches the source head. The shared harness was copied without edits. Three alternating M,C pairs for SQL, latency, and microbenchmark; 10 warmed turns per run, 3,000 one-row reads per micro run/mode after 300 warmups. Microbenchmark isolates the empty-install change with identical timing instrumentation on both sides; SQL timing includes iterator execution. Micro pre-run idle was at least 94%, and latency pre-run idle at least 99.75%.The whole-workload +1 statement median is background/window noise: every causal warmed turn is equal, and the touched admission operation adds 0 statements / 0 requests. T1 calls in all touched production owners: 0 → 0; the handler already runs in
sqlite-store.worker.ts. Whole-workload MAIN includes startup/one-shot work, not warm turns.Shared read families are identical in every run. Request-family sets overlap and must not be summed.
Detailed one-row timing stages (p50 / p95 ms)
These percentiles overlap and are not additive. Outbound includes postMessage; execution includes SQL; inbound includes the final admission/owned-byte preparation after the reply marker. Detailed timings diagnose the path rather than provide an uninstrumented transport-only measurement.
The first three latency pairs were noisy, so the one allowed extra M,C pair was run (latency only; no additional SQL or micro pairs). Detailed product timing was disabled for turn measurements; the same performance observer ran on both revisions. No run was discarded.
Per-pair turn p50 values (base → candidate): 309.1 → 266.9, 305.2 → 316.2, 595.8 → 259.9, and 294.2 → 295.9 ms. The slow third baseline affects the pooled difference substantially; the extra pair is effectively level. These observations do not establish a reliable warmed-turn saving or the −80 ms target. The repeatable scope of the implementation is eliminating empty-publication bookkeeping; measured trivial-request overhead improves modestly. The turn observer counts window requests (46–53), including background work; the separate causal SQL harness consistently measures 45 turn-caused requests. The extra pair pre-run idle was 99.875% / 99.625%.
Validation and landing exception
check:changedinvocation is claimed.src/infra/sqlite-schema-facts.native.test.ts51/51 (summed test-case time 0.879 s),src/infra/sqlite-worker-broker.test.ts16/16 (8.524 s; changed FIFO/timing case 0.852 s). These are CI case timings, not standalonepnpm test <file> --maxWorkers=1wall times; standalone wall times were not collected.pnpm deadcode:exportsran all three Knip scans: production has exactly the same three findings as main job 114997826780:hasActiveDeliveryOwnerinsrc/infra/outbound/delivery-queue-storage.ts, andlistOpenClawStateFeatureSchemas/OpenClawStateFeatureSchemainsrc/state/openclaw-state-feature-schema.ts. Full-tree and scripts scans pass. None of these files is changed here.93087c17bfe94952104013432f07a71f14ea7503:pnpm test src/gateway/server-methods/cron.runs.test.ts --maxWorkers=1gives 5 failed / 9 passed on both, allCRON_JOB_NOT_FOUND; command walls 91.31 s / 68.69 s. Failing fixtures/owners are unchanged. The failure is a missing prepared user-profile fixture after the main fallback removal. CI remains red; landing uses the explicitly authorized inherited-failure exception, with these failures assigned to the main-repair owner.Size: 9 files, +145 / −16 lines. Most added lines expose the diagnostic timing stages and their documentation; the runtime optimization is one early return in the admission owner.