Repository navigation
improve(reef): reduce native state database work - #168340
Conversation
Prepare and settle Reef trust, audit, review, identity, and cursor state through source-bound plugin-state operations. Preserve released native adapters and recheck live authority at external effects and storage admission. Reuse readonly observations for send and receipt state, and restrict metadata effect checks to mutation and commit boundaries. Keep schemas, retention, and permission behavior unchanged. Name the existing usage-health store return contract for declaration emission.
|
🦞👀 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 Reef state operations into shared SQLite worker transactions and carries revocable receipts to subsequent effects. Example: A warmed Reef message is sent to trusted peer alice.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 3 items remain Keep this PR open: the worker cutover has clear performance value, and the previous wrapper-inventory defect is fixed. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherReef connects guarded peer messaging to plugin-owned SQLite state; worker operations consume captured stores and authority, then return committed results and receipts used before delivery or session writes. flowchart LR
A[Reef message flow] --> B[Captured state operation]
B --> C[Shared SQLite worker]
C --> D[Canonical plugin state]
C --> E[Revocable receipt]
E --> F[Relay initiation]
E --> G[Session metadata commit]
Technical reviewBest possible solution: Complete the worker cutover while demonstrating that current authority governs both relay initiation and session metadata commit. Do we have a high-confidence way to reproduce the issue? This is a performance refactor; supplied measurements quantify the original SQLite workload, and no target code was executed during this read-only review. Is this the best way to solve the issue? Composing operations in the existing shared-state worker addresses repeated transaction and lookup overhead while preserving one storage owner and explicit released-host compatibility. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 06d231d65279. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: shipped entry point. SecurityNeeds attention: No concrete authorization bypass was established, but the changed authority chain still needs final-effect proof. EvidenceWhat I checked:
Likely related people:
PR surfacePR surface statistics unavailable: the file list is incomplete. 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 (7 earlier review cycles)
Reviewed October 10, 2026, 1:12 PM ET / 17:12 UTC (Revision 8). |
Merge origin/main into dbasync/t1reef without rebasing. Preserve both row publication and operation acknowledgement through one native commit observer. Conflict-resolution scope; lane performance proof remains historical, focused integration and update proof follow.
Scope read-only migration resource discovery to temporary plugin source storage bound to the selected state directory. Bundled operation capture must not create the canonical destination while Doctor is preserving and relocating legacy state.
Resolve the schema-lifetime and read-cache test splits against the single-owner SQLite changes on main. Remove the superseded owned-state freshness suppression wrapper and retain worker transactions, receipt admission, and temporary-schema settlement.
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
* refactor(reef): move native state work to the shared worker Prepare and settle Reef trust, audit, review, identity, and cursor state through source-bound plugin-state operations. Preserve released native adapters and recheck live authority at external effects and storage admission. Reuse readonly observations for send and receipt state, and restrict metadata effect checks to mutation and commit boundaries. Keep schemas, retention, and permission behavior unchanged. Name the existing usage-health store return contract for declaration emission. * perf(reef): avoid write preparation for rejection recovery * fix(reef): complete worker cutover validation * refactor(reef): remove unused peer observation type * test(reef): document intentional async authority misuse * fix(reef): preserve receivers and settle async test setup * test(state): isolate nested reader lifetime regression * test(reef): keep authority fixtures lint compliant * refactor(reef): batch native state operations in the shared worker * fix(reef): validate review records at the worker boundary * fix(reef): resolve state operations through the captured plugin owner * test(reef): expect revoked operation receipts at ingress * perf(plugin-state): share quota and expiry observations * perf(plugin-state): reuse compiled cross-row reads * docs(database): refresh inventory after conflict resolution * fix(plugins): resolve source SDK imports in compiled workers Preserve native module identity and existing JavaScript resolution when a compiled worker loads TypeScript SDK sources. Include the operation capture modules in the PR wrapper inventory. Validation: native loader regression fails before and passes after on Node 24.19.0; native-module-require.test.ts passes 20 tests in 4.45 seconds. Scoped P0/P1 review is clean. * fix(plugins): capture bundled operation import closures * fix(plugins): keep backup discovery captures outside live state Scope read-only migration resource discovery to temporary plugin source storage bound to the selected state directory. Bundled operation capture must not create the canonical destination while Doctor is preserving and relocating legacy state. * refactor(sqlite): split schema lifetime and marker tests * fix(pr): retain SQLite schema lifetime in wrapper sources
…#170511) ## What Problem This Solves Consolidate duplicate extension paths and remove speculative lifecycle defenses in Codex, Memory Core, Microsoft Teams, Matrix, Reef, and Workboard. The candidate removes **522 net production lines** (tests, fixtures, generated files, declaration files, and documentation excluded; both new production modules included). This uses the campaign's honest 500–999-line fallback after the scoped growth/largest-first pass; it does not remove features to reach a quota. Workboard's four card actions now share one discriminated action component, its draft controls share one renderer, and menu-only pass-through components are gone. Reef's worker and released-host adapters share one pure seven-command trust-transition policy while retaining their own atomic storage boundaries. Teams reuses its Graph/context/setup owners. Memory keeps normal parallel-query and sync-generation retirement draining, expressed with simpler active-completion tracking rather than nested borrower wrappers. An adjacent Workboard defect is fixed: conditional Solid fragments could run a popover ref before the preceding trigger entered the document, positioning the details menu at the page origin. Listener/anchor setup now runs after the DOM commit. The regression fails against the unchanged implementation and passes with this repair. No SDK export, config, protocol, dependency, database schema, durability, retention, or permission contract is changed. The protected standalone session-memory backend is untouched. No changelog edit. User impact: Workboard details menus anchor to their trigger instead of the page origin. Other changes simplify internal implementation, with the best-effort timing and diagnostic compromises below; no migration or operator action is required. ## Best-effort tradeoffs accepted - Codex diagnostic accessors throwing or mutable transport identities: [#163388](#163388) adds synthetic throwing-accessor coverage, not an actual-use human report. Actual accessors are local reads and registration publishes frozen identities. Accessor programmer errors now surface; the diagnostic sink catch, disclosure allowlist, attempt isolation, and timeout/cleanup behavior remain. - Offline Codex migration CAS conflicts: [#168479](#168479) introduced retry loops without a human competing-writer report. Gateway ownership excludes live foreign writers. One atomic attempt plus existing persisted-result validation now retains the source sidecar and reports a warning on conflict; a later Doctor run can retry. - Retired Codex legacy JSON rewritten during migration: [#104504](#104504) added a synthetic locator-rewrite test; human [#104503](#104503) concerns fingerprint overflow, whose fix remains. Legacy indexes are offline inputs, so a second locator/lifecycle read is removed. Initial containment/malformed-owner validation and canonical session ownership checks remain; unsupported concurrent legacy edits are picked up next run. - Memory manager acquisition repeatedly retrying failed global retirement: [#144252](#144252) has synthetic close failures, no human incident requiring recursive acquisition recovery. Acquisition now awaits the pending close once and reports its error; the retirement owner is retained and explicit close can retry. - Abandoned, abort-ignoring memory diagnostic probes holding provider retirement indefinitely: [#113471](#113471) and [#166973](#166973) provide synthetic lifecycle proof, not a human abandoned-probe incident. Timed-out read-only diagnostics no longer retain a redundant inner borrower. Ordinary active searches, sync generations, healthy operations, and custom closable-provider draining remain protected. - Teams simultaneous Gateway writers: [#88411](#88411) introduced the persistence migration/file lock without a human multi-Gateway incident and did not test live tenant traffic. The Gateway is the sole database owner. Removed cross-process stale-lock/backoff machinery; local FIFO remains. Unsupported simultaneous processes may overwrite each other rather than coordinate. - Workboard stale cache publication and an exact-expiry late join: [#165896](#165896), [#165141](#165141), and [#165698](#165698) use synthetic performance/interleaving controls, not a human incident. One read may return an older projection/fallback; normal revision/age invalidation refreshes it next read. Measured caching, the 64-entry bound, and read authority remain. - Workboard direct stop/start before asynchronous startup settles: [#146976](#146976) forces unsupported lifecycle ordering in a test. The host service owner already awaits raw startup before stop. Removed plugin-local generation/startup handoff; supported host lifecycle is unchanged, unsupported direct reentry no longer has a second lifecycle owner. - Reef failed owner-notice dispatch/ack retry timing: [#109160](#109160) pins injected failures and exponential timers, without a human report requiring that second scheduler. Durable pending notices now retry during ordinary successful 30-second reconciliation or restart. A failed acknowledgement may redispatch conservative stop-only guidance; durable resend reservation/cooldown prevents granting a second resend. The per-peer queue also makes the removed in-flight set redundant. - Reef synchronous intermediate lease theft: [#109380](#109380) and [#168340](#168340) describe synthetic interleavings, not human concurrent-writer incidents. SDK callbacks commit synchronously and there is no await between acquisition and settlement. Unsupported reentrant callbacks/foreign writers are no longer checked at every intermediate step. Initial acquisition, final head-owner check, staged recovery, uncertain-commit witness, rollback, and retention ordering remain. - Workboard fabricated native event targets and repeated widget predicates: renderer port [#168606](#168606) added boilerplate without a human incident. JSX native bindings already guarantee `currentTarget` types, and the owning menu already excludes widgets. Fabricated direct handler calls may throw; real event dispatch, widget behavior, and untrusted `event.target` checks are unchanged. ## Coverage ledger Discovery began with scoped three-day growth, then fourteen-day history and largest production owners. Each removed mechanism was checked against its introduction and current callers; no dormant/in-flight foundation was deleted. Exact and normalized duplicate scans informed structural inspection, not automatic rewrites. | Owner / original location | Decision and evidence | | --- | --- | | Codex `app-server/request-diagnostics.ts:28,109,133` | Remove speculative accessor catches/identity copy; keep timeout sink and disclosure boundary (#163388). | | Codex `command-handler-actions.ts:109` | Share sandbox/execution result assembly; preserve policy selectors, guards, currentness and release. | | Codex `migration/session-binding-sidecars.ts:460,549,627` | Single CAS attempt and one legacy-input read; preserve sidecar on conflict and canonical effect validation (#168479, #104504). | | Codex `installed-probe.ts:29`, native session preparation/monitor | KEEP isolated managed storage, credentials, native execution authority and ordinary write settlement. Upstream configuration/storage contract inspected directly. | | Memory `memory/search-deadline.ts:42` | One rejected cancellation promise replaces sentinel race; preserve cancellation/error identity, abort ordering, wall-clock guard and cleanup (#95757, #147702). | | Memory `manager-embedding-ops.ts:84`, `manager-registry.ts:264` | Simplify nested borrower bookkeeping and failed-close recovery; preserve outer leases, normal drain and documented retiring-cache fence (#113471, #166973, #144252). An initially broader removal was rejected during review. | | Memory publication, database context, index generation, transfer and cache owners | KEEP user-data transaction/publication, Forget exclusion, bounded transfers, worker ownership, integrity, performance caches and normal shutdown settlement (#168860, #169164, #169251, #170183, #170302, #170407). | | Memory paused deadlines, Unicode query, KNN/vector scan, watchers | KEEP human-reported SQLite stalls (#137056), dependency tokenizer behavior, external/native input validation, bounded resources and realistic cancellation. | | Memory dreaming/REM, migration/repair, backfill and standing intents | KEEP user-facing features, privacy/source validation, persisted rollback and public formats. Phase E untouched. | | Teams `sqlite-state.ts:27`, `graph.ts:85,177` | Remove redundant foreign-writer lock; one guarded Graph transport retains auth/SSRF, bounded parsing and release (#88411). | | Teams `setup-surface.ts:102`, `graph-group-management.ts:32,96`, `channel.ts:267` | Consolidate identical saves/context/pending result bookkeeping; preserve provider-specific validation, labels, errors, ordering and direct results (#112811). | | Matrix `matrix/actions/reactions.ts:135` | Remove duplicate missing-sender/empty-result guards; selector remains ownership boundary, empty list has no redactions. | | Matrix crypto store, verification, readiness, send FIFO and thread binding owners | KEEP room-key durability, real throwing dependency getters, encryption/send authority, public compatibility and accepted writes (#160707, #70401, #163012, #168485, #169405). | | Teams pending-upload dual owners | HOLD: persisting currently memory-only reply consent bytes would change privacy/persistence; deleting SQLite loses restart recovery. Needs an explicit policy choice, not a deslop shortcut. | | Teams streaming, multi-account configuration and exported setup factory | KEEP Stop/partial-delivery/FIFO, credential isolation and published factory signature (#141348, #112811). | | Reef `trust-state-operation.ts:164`, `trust-store.legacy.ts:115` | Share pure seven-command transitions, retain worker/native atomic adapters, schema checks, trust revisions and authorization (#168340). | | Reef `owner-notice.ts:32,72,122,253`, `audit-state.legacy.ts:145–255` | Remove duplicate retry scheduler/in-flight set and synchronous intermediate lease checks; preserve durable recovery/security (#109160, #109380). | | Reef released-host adapter and trust delivery settlement | KEEP declared host compatibility, accepted-write shutdown settlement, peer/key authority and user-data crash recovery. | | X events/allowlist/verification | KEEP paid-event settlement, bounded polling and credential/access authority. | | llama.cpp media/provider/install/orphan owners | KEEP confidentiality of local inputs, digest cache integrity and safe process identity before termination (#167902). | | ClawRouter pool/dashboard | KEEP untrusted network projection, bounded responses and active features; no useful large duplicate justified added abstraction. | | Workboard `view-card-actions.tsx:215`, `view-card.tsx:102`, `view-draft-choices.tsx:6` | Consolidate actions, menu wrappers and card/bulk draft controls; all callers migrated (#168606). | | Workboard native handlers and `view-popover.ts:19` | Drop impossible bound-target guards; repair ordinary conditional-fragment anchor timing (#168606). | | Workboard `sessions-board.ts:149,305`, `change-events.ts:6`, `gateway.ts:211` | Remove duplicate cache/lifecycle fences; share workspace input preparation while retaining workspace/security effect checks. | | Workboard draft/focus/pending-write/editor, board save and label measurement owners | KEEP real unsaved input, async writes, keyboard focus, live-authority checks and measured layout batching. | ## Evidence All local build/test/CLI commands use task-owned HOME, OpenClaw state/config and XDG directories. No real Gateway or user state is used. No timeout increases, retries, skips, new suppressions or weakened retained-behavior baselines. Final proof receipts and exact-head CI attribution are recorded below. Cold compiled-worker preparation dominates several local timings; these are not CI timings or live-provider claims. | Focused local proof | Result / wall cost | | --- | --- | | Codex request diagnostics | 14/14 pass; wrapper445.55s (cold worker/import dominated). | | Codex commands + Doctor contract | 122/123 pass; wrapper1352.60s. Doctor contract passes. The one method-list assertion (`commands.test.ts:951`) also observes background monitor `thread/read` calls. It **reproduces with explicit clean-base source loaded from `56715acf0e5943edecd34fa6f451532cfa9d5f35`**: extra reads followed by the expected `thread/resume`, selected-case8.411s/Vitest403.28s. The affected test/support/actions/bindings/monitor files are byte-unchanged between that base and pinned main. No test skips or timing changes were added;99 unrelated cases were unselected for attribution. | | Workboard backend (sessions-board, Gateway, change-events, registration lifecycle) | 48/48 pass, four files; wrapper587.54s, Vitest545.18s. | | Workboard entire browser scope before final followups; final affected browser suites | 237/237 across29 files in59.03s; final103/103 across6 files in31.95s. New popover regression1/1 in9.34s; unchanged source fails intended geometry assertion in14.57s. | | Workboard actual compiled WebKit consumer | Pass: anchored menu, filter keyboard dismissal, nested Escape preserving dialog, focus return, zero page errors. | | Reef trust/friends/audit/receipt/outbound/notifier | 119/119 across6 files; wrapper927.25s, including cold worker compilation. Earlier unchanged channel proof25/25 pass. | | Teams sqlite/Graph/read authority/setup | 72/72 across5 files; wrapper385.62s. | | Teams Graph contexts/actions | 73/73 across3 files; wrapper327.91s. | | Teams mutation callers/setup policy | 42/42 across5 files; wrapper776.30s. | | Teams resolver + existing channel tests | Resolver4/4 pass; existing channel44 pass/2 fail, wrapper550.01s. **Both failures reproduce on full pinned main `3c63da22f046b15db9d56cf35769f20b398b8c9b`**,44 pass/2 fail, wrapper464.42s: approval-monitor startup timeout120000ms (`channel.test.ts:313`) and subsequent `MSTeams runtime not initialized` (`runtime-store.ts:85` → `monitor.ts:81` → `channel.test.ts:970`). No budgets changed; the second appears cascading, not separately diagnosed. | | Matrix reaction ownership | 11/11 pass; wrapper339.25s. | | Lint suppression contracts | 3/3 pass on frozen candidate; wrapper48.94s. No new suppressions. | | Architecture | Zero runtime value cycles; zero static/Madge components. | Memory owner/sibling proof: 108/109 pass across nine files, wrapper939.49s. The only failure was this patch's newly authored assertion expecting the provider's raw close error instead of the owner's existing normalized diagnostic. After correcting that assertion without a production change, its exact case passed (4.389s execution, Vitest350.74s, wrapper373.90s, dominated by transforms). The other twelve registry cases were unselected in that focused invocation, not skipped in source. Together the runs prove all109 selected contracts, including actual-query retirement, shutdown drain, fallback/reload, healthy probe, transport and deadline behavior. Local tooling notes: the first changed-file run required removing one now-unused assertion-safety allowance. The corrected run passed conflict markers (27.14s), line-cap (4.43s), max-lines (69.87s), and assertion-safety (183.85s), then was intentionally stopped after the full-source SQLite worker inventory produced no result for 681.03s. This was incomplete local proof, not a passing inventory or an inherited source failure. Native production and test extension typegraphs both pass. Scoped lint could not begin analysis because SDK declaration preparation hit its unchanged 300000ms budget, both in the earlier Reef attempt and the final scoped attempt; neither produced a lint diagnostic. Final exact-head hosted CI below closes both gaps, with inventories running on the PR's frozen merge tree. Two custom-config attribution attempts were abandoned for harness setup failures; they are not behavior proof. Teams attribution above uses a normal full-main export and normal harness. No remote lease, live Teams tenant or live provider proof is claimed. Final formatting: all changed source/test/doc files pass. Plugin boundary report passes (zero eligible compatibility removals); UI localization verification passes. No public SDK files/exports or package manifests changed, so an SDK API-surface diff is not applicable. Independent review reported one P2 about an older Workboard read replacing newer `lastKnown` fallback facts before a subsequent backend outage. Declined as the explicitly accepted cache tradeoff, not silently ignored: fallback is presentation-only, availability remains visible, the next successful read repairs it, and `move` independently rereads authoritative facts/scope before its guarded write. The introducing controls are synthetic (#165896/#165141); no user-data, authorization, or persisted-write invariant is relaxed. First hosted CI run `38334064250` on `dabbd9208a20068c24e6901b41a13415c04ac856` completed with two owned lint failures: `check-lint-extensions-2` (explicit boolean and exhaustive return in Reef) and `check-lint-extensions-3` (default generic argument/Promise iterable in Memory, exhaustive return/shadowed local in Workboard). Its `openclaw/ci-gate` failure aggregates those two jobs. All other planned jobs passed, including SQLite inventories, source contracts, types, extension tests, and QA smoke. The focused correction adds five production lines. The first PR-evidence run also failed because this body's headings did not match the required template; corrected headings passed in run `38334357043`. Metadata auto-response cancellations and the superseded evidence run contain no product test suite. No inherited-failure exception is being claimed for these owned failures. **Final exact-head CI passes:** [run 38335564816](https://github.com/openclaw/openclaw/actions/runs/38335564816) on `b86c1ba06fa325f178007ba736c294cdd67a566d`, including `openclaw/ci-gate`, both extension-lint stripes, full inventories/ratchets, source contracts, typegraphs, selected extension bundles, security, and all QA smoke profiles. This closes the local inventory/lint tooling gaps described above. All exact-head check runs were enumerated; no failed, cancelled, timed-out, or pending check remains. No admin exception, manual rerun, dispatch, or rebase was used. CI job wall seconds: extension bundles 1/2/3/4-1/4-2/5 = 210/160/183/247/137/229; extension lint stripes 2/3 = 145/91; baseline ratchets = 271. These are parallel job wall times including setup, not added test execution time. The lint-only correction also passes native production types, formatting, suppression contracts (3/3; 65.59s wrapper), runtime cycles (0), static/Madge cycles (0), Workboard actions (32/32; 17.93s) and popover (1/1; 16.16s), plus Reef trust/Memory provider lifecycle (51/51; 401.38s Vitest, 445.49s wrapper). Independent review of that delta is scoped-clean at P0–P2; the original explicitly declined display-cache tradeoff remains documented above. ## Visual proof Before/after attachments show the actual built Workboard plugin against synthetic fixture data. Before: details menu at the page origin. After: anchored to its trigger. No pixel-identical claim across fixture timestamps.  
…openclaw#170511) ## What Problem This Solves Consolidate duplicate extension paths and remove speculative lifecycle defenses in Codex, Memory Core, Microsoft Teams, Matrix, Reef, and Workboard. The candidate removes **522 net production lines** (tests, fixtures, generated files, declaration files, and documentation excluded; both new production modules included). This uses the campaign's honest 500–999-line fallback after the scoped growth/largest-first pass; it does not remove features to reach a quota. Workboard's four card actions now share one discriminated action component, its draft controls share one renderer, and menu-only pass-through components are gone. Reef's worker and released-host adapters share one pure seven-command trust-transition policy while retaining their own atomic storage boundaries. Teams reuses its Graph/context/setup owners. Memory keeps normal parallel-query and sync-generation retirement draining, expressed with simpler active-completion tracking rather than nested borrower wrappers. An adjacent Workboard defect is fixed: conditional Solid fragments could run a popover ref before the preceding trigger entered the document, positioning the details menu at the page origin. Listener/anchor setup now runs after the DOM commit. The regression fails against the unchanged implementation and passes with this repair. No SDK export, config, protocol, dependency, database schema, durability, retention, or permission contract is changed. The protected standalone session-memory backend is untouched. No changelog edit. User impact: Workboard details menus anchor to their trigger instead of the page origin. Other changes simplify internal implementation, with the best-effort timing and diagnostic compromises below; no migration or operator action is required. ## Best-effort tradeoffs accepted - Codex diagnostic accessors throwing or mutable transport identities: [openclaw#163388](openclaw#163388) adds synthetic throwing-accessor coverage, not an actual-use human report. Actual accessors are local reads and registration publishes frozen identities. Accessor programmer errors now surface; the diagnostic sink catch, disclosure allowlist, attempt isolation, and timeout/cleanup behavior remain. - Offline Codex migration CAS conflicts: [openclaw#168479](openclaw#168479) introduced retry loops without a human competing-writer report. Gateway ownership excludes live foreign writers. One atomic attempt plus existing persisted-result validation now retains the source sidecar and reports a warning on conflict; a later Doctor run can retry. - Retired Codex legacy JSON rewritten during migration: [openclaw#104504](openclaw#104504) added a synthetic locator-rewrite test; human [openclaw#104503](openclaw#104503) concerns fingerprint overflow, whose fix remains. Legacy indexes are offline inputs, so a second locator/lifecycle read is removed. Initial containment/malformed-owner validation and canonical session ownership checks remain; unsupported concurrent legacy edits are picked up next run. - Memory manager acquisition repeatedly retrying failed global retirement: [openclaw#144252](openclaw#144252) has synthetic close failures, no human incident requiring recursive acquisition recovery. Acquisition now awaits the pending close once and reports its error; the retirement owner is retained and explicit close can retry. - Abandoned, abort-ignoring memory diagnostic probes holding provider retirement indefinitely: [openclaw#113471](openclaw#113471) and [openclaw#166973](openclaw#166973) provide synthetic lifecycle proof, not a human abandoned-probe incident. Timed-out read-only diagnostics no longer retain a redundant inner borrower. Ordinary active searches, sync generations, healthy operations, and custom closable-provider draining remain protected. - Teams simultaneous Gateway writers: [openclaw#88411](openclaw#88411) introduced the persistence migration/file lock without a human multi-Gateway incident and did not test live tenant traffic. The Gateway is the sole database owner. Removed cross-process stale-lock/backoff machinery; local FIFO remains. Unsupported simultaneous processes may overwrite each other rather than coordinate. - Workboard stale cache publication and an exact-expiry late join: [openclaw#165896](openclaw#165896), [openclaw#165141](openclaw#165141), and [openclaw#165698](openclaw#165698) use synthetic performance/interleaving controls, not a human incident. One read may return an older projection/fallback; normal revision/age invalidation refreshes it next read. Measured caching, the 64-entry bound, and read authority remain. - Workboard direct stop/start before asynchronous startup settles: [openclaw#146976](openclaw#146976) forces unsupported lifecycle ordering in a test. The host service owner already awaits raw startup before stop. Removed plugin-local generation/startup handoff; supported host lifecycle is unchanged, unsupported direct reentry no longer has a second lifecycle owner. - Reef failed owner-notice dispatch/ack retry timing: [openclaw#109160](openclaw#109160) pins injected failures and exponential timers, without a human report requiring that second scheduler. Durable pending notices now retry during ordinary successful 30-second reconciliation or restart. A failed acknowledgement may redispatch conservative stop-only guidance; durable resend reservation/cooldown prevents granting a second resend. The per-peer queue also makes the removed in-flight set redundant. - Reef synchronous intermediate lease theft: [openclaw#109380](openclaw#109380) and [openclaw#168340](openclaw#168340) describe synthetic interleavings, not human concurrent-writer incidents. SDK callbacks commit synchronously and there is no await between acquisition and settlement. Unsupported reentrant callbacks/foreign writers are no longer checked at every intermediate step. Initial acquisition, final head-owner check, staged recovery, uncertain-commit witness, rollback, and retention ordering remain. - Workboard fabricated native event targets and repeated widget predicates: renderer port [openclaw#168606](openclaw#168606) added boilerplate without a human incident. JSX native bindings already guarantee `currentTarget` types, and the owning menu already excludes widgets. Fabricated direct handler calls may throw; real event dispatch, widget behavior, and untrusted `event.target` checks are unchanged. ## Coverage ledger Discovery began with scoped three-day growth, then fourteen-day history and largest production owners. Each removed mechanism was checked against its introduction and current callers; no dormant/in-flight foundation was deleted. Exact and normalized duplicate scans informed structural inspection, not automatic rewrites. | Owner / original location | Decision and evidence | | --- | --- | | Codex `app-server/request-diagnostics.ts:28,109,133` | Remove speculative accessor catches/identity copy; keep timeout sink and disclosure boundary (openclaw#163388). | | Codex `command-handler-actions.ts:109` | Share sandbox/execution result assembly; preserve policy selectors, guards, currentness and release. | | Codex `migration/session-binding-sidecars.ts:460,549,627` | Single CAS attempt and one legacy-input read; preserve sidecar on conflict and canonical effect validation (openclaw#168479, openclaw#104504). | | Codex `installed-probe.ts:29`, native session preparation/monitor | KEEP isolated managed storage, credentials, native execution authority and ordinary write settlement. Upstream configuration/storage contract inspected directly. | | Memory `memory/search-deadline.ts:42` | One rejected cancellation promise replaces sentinel race; preserve cancellation/error identity, abort ordering, wall-clock guard and cleanup (openclaw#95757, openclaw#147702). | | Memory `manager-embedding-ops.ts:84`, `manager-registry.ts:264` | Simplify nested borrower bookkeeping and failed-close recovery; preserve outer leases, normal drain and documented retiring-cache fence (openclaw#113471, openclaw#166973, openclaw#144252). An initially broader removal was rejected during review. | | Memory publication, database context, index generation, transfer and cache owners | KEEP user-data transaction/publication, Forget exclusion, bounded transfers, worker ownership, integrity, performance caches and normal shutdown settlement (openclaw#168860, openclaw#169164, openclaw#169251, openclaw#170183, openclaw#170302, openclaw#170407). | | Memory paused deadlines, Unicode query, KNN/vector scan, watchers | KEEP human-reported SQLite stalls (openclaw#137056), dependency tokenizer behavior, external/native input validation, bounded resources and realistic cancellation. | | Memory dreaming/REM, migration/repair, backfill and standing intents | KEEP user-facing features, privacy/source validation, persisted rollback and public formats. Phase E untouched. | | Teams `sqlite-state.ts:27`, `graph.ts:85,177` | Remove redundant foreign-writer lock; one guarded Graph transport retains auth/SSRF, bounded parsing and release (openclaw#88411). | | Teams `setup-surface.ts:102`, `graph-group-management.ts:32,96`, `channel.ts:267` | Consolidate identical saves/context/pending result bookkeeping; preserve provider-specific validation, labels, errors, ordering and direct results (openclaw#112811). | | Matrix `matrix/actions/reactions.ts:135` | Remove duplicate missing-sender/empty-result guards; selector remains ownership boundary, empty list has no redactions. | | Matrix crypto store, verification, readiness, send FIFO and thread binding owners | KEEP room-key durability, real throwing dependency getters, encryption/send authority, public compatibility and accepted writes (openclaw#160707, openclaw#70401, openclaw#163012, openclaw#168485, openclaw#169405). | | Teams pending-upload dual owners | HOLD: persisting currently memory-only reply consent bytes would change privacy/persistence; deleting SQLite loses restart recovery. Needs an explicit policy choice, not a deslop shortcut. | | Teams streaming, multi-account configuration and exported setup factory | KEEP Stop/partial-delivery/FIFO, credential isolation and published factory signature (openclaw#141348, openclaw#112811). | | Reef `trust-state-operation.ts:164`, `trust-store.legacy.ts:115` | Share pure seven-command transitions, retain worker/native atomic adapters, schema checks, trust revisions and authorization (openclaw#168340). | | Reef `owner-notice.ts:32,72,122,253`, `audit-state.legacy.ts:145–255` | Remove duplicate retry scheduler/in-flight set and synchronous intermediate lease checks; preserve durable recovery/security (openclaw#109160, openclaw#109380). | | Reef released-host adapter and trust delivery settlement | KEEP declared host compatibility, accepted-write shutdown settlement, peer/key authority and user-data crash recovery. | | X events/allowlist/verification | KEEP paid-event settlement, bounded polling and credential/access authority. | | llama.cpp media/provider/install/orphan owners | KEEP confidentiality of local inputs, digest cache integrity and safe process identity before termination (openclaw#167902). | | ClawRouter pool/dashboard | KEEP untrusted network projection, bounded responses and active features; no useful large duplicate justified added abstraction. | | Workboard `view-card-actions.tsx:215`, `view-card.tsx:102`, `view-draft-choices.tsx:6` | Consolidate actions, menu wrappers and card/bulk draft controls; all callers migrated (openclaw#168606). | | Workboard native handlers and `view-popover.ts:19` | Drop impossible bound-target guards; repair ordinary conditional-fragment anchor timing (openclaw#168606). | | Workboard `sessions-board.ts:149,305`, `change-events.ts:6`, `gateway.ts:211` | Remove duplicate cache/lifecycle fences; share workspace input preparation while retaining workspace/security effect checks. | | Workboard draft/focus/pending-write/editor, board save and label measurement owners | KEEP real unsaved input, async writes, keyboard focus, live-authority checks and measured layout batching. | ## Evidence All local build/test/CLI commands use task-owned HOME, OpenClaw state/config and XDG directories. No real Gateway or user state is used. No timeout increases, retries, skips, new suppressions or weakened retained-behavior baselines. Final proof receipts and exact-head CI attribution are recorded below. Cold compiled-worker preparation dominates several local timings; these are not CI timings or live-provider claims. | Focused local proof | Result / wall cost | | --- | --- | | Codex request diagnostics | 14/14 pass; wrapper445.55s (cold worker/import dominated). | | Codex commands + Doctor contract | 122/123 pass; wrapper1352.60s. Doctor contract passes. The one method-list assertion (`commands.test.ts:951`) also observes background monitor `thread/read` calls. It **reproduces with explicit clean-base source loaded from `9b5bac5de29fac5a2df162265bbf01b6fb82e6ed`**: extra reads followed by the expected `thread/resume`, selected-case8.411s/Vitest403.28s. The affected test/support/actions/bindings/monitor files are byte-unchanged between that base and pinned main. No test skips or timing changes were added;99 unrelated cases were unselected for attribution. | | Workboard backend (sessions-board, Gateway, change-events, registration lifecycle) | 48/48 pass, four files; wrapper587.54s, Vitest545.18s. | | Workboard entire browser scope before final followups; final affected browser suites | 237/237 across29 files in59.03s; final103/103 across6 files in31.95s. New popover regression1/1 in9.34s; unchanged source fails intended geometry assertion in14.57s. | | Workboard actual compiled WebKit consumer | Pass: anchored menu, filter keyboard dismissal, nested Escape preserving dialog, focus return, zero page errors. | | Reef trust/friends/audit/receipt/outbound/notifier | 119/119 across6 files; wrapper927.25s, including cold worker compilation. Earlier unchanged channel proof25/25 pass. | | Teams sqlite/Graph/read authority/setup | 72/72 across5 files; wrapper385.62s. | | Teams Graph contexts/actions | 73/73 across3 files; wrapper327.91s. | | Teams mutation callers/setup policy | 42/42 across5 files; wrapper776.30s. | | Teams resolver + existing channel tests | Resolver4/4 pass; existing channel44 pass/2 fail, wrapper550.01s. **Both failures reproduce on full pinned main `4915e46c89b223ae4cdcdefe46fabc948b9bf7fa`**,44 pass/2 fail, wrapper464.42s: approval-monitor startup timeout120000ms (`channel.test.ts:313`) and subsequent `MSTeams runtime not initialized` (`runtime-store.ts:85` → `monitor.ts:81` → `channel.test.ts:970`). No budgets changed; the second appears cascading, not separately diagnosed. | | Matrix reaction ownership | 11/11 pass; wrapper339.25s. | | Lint suppression contracts | 3/3 pass on frozen candidate; wrapper48.94s. No new suppressions. | | Architecture | Zero runtime value cycles; zero static/Madge components. | Memory owner/sibling proof: 108/109 pass across nine files, wrapper939.49s. The only failure was this patch's newly authored assertion expecting the provider's raw close error instead of the owner's existing normalized diagnostic. After correcting that assertion without a production change, its exact case passed (4.389s execution, Vitest350.74s, wrapper373.90s, dominated by transforms). The other twelve registry cases were unselected in that focused invocation, not skipped in source. Together the runs prove all109 selected contracts, including actual-query retirement, shutdown drain, fallback/reload, healthy probe, transport and deadline behavior. Local tooling notes: the first changed-file run required removing one now-unused assertion-safety allowance. The corrected run passed conflict markers (27.14s), line-cap (4.43s), max-lines (69.87s), and assertion-safety (183.85s), then was intentionally stopped after the full-source SQLite worker inventory produced no result for 681.03s. This was incomplete local proof, not a passing inventory or an inherited source failure. Native production and test extension typegraphs both pass. Scoped lint could not begin analysis because SDK declaration preparation hit its unchanged 300000ms budget, both in the earlier Reef attempt and the final scoped attempt; neither produced a lint diagnostic. Final exact-head hosted CI below closes both gaps, with inventories running on the PR's frozen merge tree. Two custom-config attribution attempts were abandoned for harness setup failures; they are not behavior proof. Teams attribution above uses a normal full-main export and normal harness. No remote lease, live Teams tenant or live provider proof is claimed. Final formatting: all changed source/test/doc files pass. Plugin boundary report passes (zero eligible compatibility removals); UI localization verification passes. No public SDK files/exports or package manifests changed, so an SDK API-surface diff is not applicable. Independent review reported one P2 about an older Workboard read replacing newer `lastKnown` fallback facts before a subsequent backend outage. Declined as the explicitly accepted cache tradeoff, not silently ignored: fallback is presentation-only, availability remains visible, the next successful read repairs it, and `move` independently rereads authoritative facts/scope before its guarded write. The introducing controls are synthetic (openclaw#165896/openclaw#165141); no user-data, authorization, or persisted-write invariant is relaxed. First hosted CI run `38334064250` on `dabbd9208a20068c24e6901b41a13415c04ac856` completed with two owned lint failures: `check-lint-extensions-2` (explicit boolean and exhaustive return in Reef) and `check-lint-extensions-3` (default generic argument/Promise iterable in Memory, exhaustive return/shadowed local in Workboard). Its `openclaw/ci-gate` failure aggregates those two jobs. All other planned jobs passed, including SQLite inventories, source contracts, types, extension tests, and QA smoke. The focused correction adds five production lines. The first PR-evidence run also failed because this body's headings did not match the required template; corrected headings passed in run `38334357043`. Metadata auto-response cancellations and the superseded evidence run contain no product test suite. No inherited-failure exception is being claimed for these owned failures. **Final exact-head CI passes:** [run 38335564816](https://github.com/openclaw/openclaw/actions/runs/38335564816) on `b86c1ba06fa325f178007ba736c294cdd67a566d`, including `openclaw/ci-gate`, both extension-lint stripes, full inventories/ratchets, source contracts, typegraphs, selected extension bundles, security, and all QA smoke profiles. This closes the local inventory/lint tooling gaps described above. All exact-head check runs were enumerated; no failed, cancelled, timed-out, or pending check remains. No admin exception, manual rerun, dispatch, or rebase was used. CI job wall seconds: extension bundles 1/2/3/4-1/4-2/5 = 210/160/183/247/137/229; extension lint stripes 2/3 = 145/91; baseline ratchets = 271. These are parallel job wall times including setup, not added test execution time. The lint-only correction also passes native production types, formatting, suppression contracts (3/3; 65.59s wrapper), runtime cycles (0), static/Madge cycles (0), Workboard actions (32/32; 17.93s) and popover (1/1; 16.16s), plus Reef trust/Memory provider lifecycle (51/51; 401.38s Vitest, 445.49s wrapper). Independent review of that delta is scoped-clean at P0–P2; the original explicitly declined display-cache tradeoff remains documented above. ## Visual proof Before/after attachments show the actual built Workboard plugin against synthetic fixture data. Before: details menu at the page origin. After: anchored to its trigger. No pixel-identical claim across fixture timestamps.  
Backport note: kept the branch's number-based statSync identities; carried the temporary-placement withPluginSourceCaptureStorage wrap for Doctor backup resource discovery (from #168340, absent on the branch) so the new copyOnly capture path applies; kept both updating.md paragraphs. (cherry picked from commit de1531d)
Integrated candidate line-cap repair
Commit
90de431ea2b4dbuilds directly on the lander's integrated candidate6402e739(including Doctor fix86d4ad2fand the main merge). Schema snapshot lifetime handling now lives insrc/infra/sqlite-schema-lifetime.ts, imported by the existing schema-facts owner. The standalone content-marker migration/rollback test moves into the existing schema-version suite; its local helper is renamed to avoid shadowing that suite's helper. The function body and test behavior are preserved. Net growth is 14 lines for module/test imports and formatting; limits are unchanged.src/infra/sqlite-schema-facts.tssrc/state/openclaw-state-db-read-connection.cache.test.tsFocused proof on an isolated, hash-verified copy of this candidate:
pnpm check:madge-import-cycles: 0 cycles, 114.172 s. The subsequent test-local binding rename changes no import edges.git diff --checkalso passed. The initial shadowing diagnostic is resolved.The remote lease gate was observed. Testbox never assigned a runner, and the AWS attempt encountered a very slow full-tree sync; both leases are inactive. After more than 30 minutes of accumulated capacity waiting, the campaign's local fallback ran through the proof-slot gate in an isolated shallow checkout (one-minute host load 42.54 at the successful first invocation, 47.48 for the final correction). A frozen-lockfile install and exact file hashes bound the proof to the lane. No passing remote result is claimed for this split.
Per the coordinator, the lander's 326-test and passing published-driver × candidate update proof for
6402e739is reused: this correction only moves existing code/tests and changes a test-local binding name. It adds no SQL statements, worker commands, schema changes, or runtime behavior. The PR remains READY for the lander; this lane does not land it.What Problem This Solves
Reef trust, review, and delivery operations repeat SQLite work on the Gateway thread.
User Impact
This is an internal performance change: warmed Reef outbound SQL falls from 168 to 27 statements, and its native-state work leaves the Gateway main thread. Trust, review, audit, and delivery behavior is preserved. No configuration or stored-format change is required.
Why This Change Was Made
The optional
PluginStateKeyedStore.createOperationcapability sends complete operations to the existing shared-state worker. Each key load, trust/autonomy edit, review decision/capacity operation, and rejection reservation/completion uses one command and one synchronous transaction. Outbound uses two commands around external guard classification: prepare, then finalize the audit chain and exact delivery binding. The transport checks an in-process receipt immediately before relay initiation.Each operation captures physical database identity, namespace handles, plugin code generation, and live authority before awaiting. Queued mutations invalidate receipts, including writes through path aliases; reads honor earlier pending mutations, and accepted writes settle after caller closure. Quota and expiry facts share one fresh aggregate. Batch queries reuse compiled SQL with fresh bindings and rows. No foreign-commit polling or per-call schema checks were added.
The current host removes the former observation/CAS and synchronous effect-read paths. Released hosts without the additive capability retain their existing adapters, selected before awaits; failures never activate a fallback. The released synchronous
ChannelPluginmetadata/security-policylistCurrentcontract remains a documented exception. Ordinary listings and effect authority use the worker/receipt path. Schemas, stored formats, durability, retention policy, and permissions are unchanged.Evidence
Update-path repair: selective operation capture
The lander's built-package proof exposed an update regression: loading Reef's bundled worker module attempted to capture every dependency named by its source manifest.
@noble/cipherswas already compiled into the bundle, so no standalone runtime copy existed; capture failed and Doctor exited before session migration.The fix uses the existing selective-entry capture API for every bundled operation entry in the selected source/build family. A single captured generation follows their actual imports, including shared chunks under the source owner's
distordist-runtimetree. Custody and native-admission identity cover the complete entry selection; SDK imports still resolve through the separately linked host. External imports retain their normal dependency requirement. No Reef exception, alternate capture mechanism, dependency-manifest change, or duplicate installed dependency was added. The plugin runtime documentation now states this capture contract and its update behavior.Repair commit:
3872c24ac7071aeae4d3afa2505dbf1b16a9f9c9. The remote build used source carrier4bd4ac4fe00d3b77fe7554f6e3976787bc74587a; the wrapper verified the full source snapshot and SHA-256 checks confirmed all six changed files match the committed patch before and after proof. Candidate package SHA-256:5cb6b88fb1c98b3f3acdc2edfd293f3070fa710df5d8968747065548b9e33789.Plugin dependency bundled-away is missingpnpm test <15 focused files> --maxWorkers=1; 204 s wrapper wall time; new capture cases total about 616 ms. These are measured remote test seconds, not GitHub CI seconds2026.9.9→ candidate, 491 s total cell; updater command exit 0 in 396.574 s, durable runsucceeded / finished, readiness 200, candidate build identity verified, durable history preserved and incognito history cleared. Candidate Doctor exit 0 (17.996 s), post-update Doctor exit 0 (23.485 s); both lint phases exit 0. Existing fixture/config/advisory warnings remain recorded, with no lint errorscheck-changedtook 641 s and exited 1 only on two inherited unused exports:PUBLIC_SESSION_ENTRY_SCRIPTandisClaudeLikeLiveAgent. Removing this repair reproduces both failures. Current main already makes them private in06c6e83f4351fandcb1422fb0e52d. Core production and all 27 selected test type graphs passed; T1 has no growth. All nine checks after the dead-code stop point were run explicitly and passed, including zero runtime import cycles. Changed-file lint has zero errors and one 703-line size warning inplugin-generation-artifact.ts; the growth ratchet passedAWS repair proof, lease
cbx_02e2d02ec100, ran under the campaign remote lease gate. Testbox first waited about 15 minutes without a runner before the authorized AWS fallback; AWS source sync took 11m19s. The AWS lease is stopped and its campaign remote slot released. The queued Testbox was also confirmed stopped. Protected local staging capsules remain with the native recovery owner; no evidence archive or package was published.Follow-up checks on the same AWS lease verified source commit
3872c24ac7071aeae4d3afa2505dbf1b16a9f9c9, reproduced the baseline export findings, restored and hash-verified the patch, and completed the remaining checks. Command time was 319.369 s; source synchronization took 10m47s.This repair adds 38 net production lines, 57 net test lines, and nine documentation lines. It changes capture only: no SQL statements, worker commands, SDK declarations, schema, durability, retention, or permissions change. The historical performance and T1 measurements below retain their original source attribution; they were not remeasured for this repair.
Performance evidence
The scoped performance gate passes for
4eda6352f848253eedbf7660e1c17b6a52d7fed0againstec7c8bb9454bab03e76057ecc000bfad35897ce9. Three complete alternating M,C pairs exercised the unchanged Reef message and owner workloads on one AWS host. Every measured Reef SQL median decreases. Key loading is 1.27946 → 1.80514 ms, 1.410862513×, and rejection reservation is 2.55549 → 3.69549 ms, 1.446099433×, both below the strict 1.5 ratio. Only the three previously authorized sub-10-ms scalar-admin exceptions remain; their raw ratios are shown below.Warmed Reef outbound drops 168 → 27 all-thread statements (−141, −83.9%) and 161 → 0 MAIN statements. Its raw worker requests rise 1 → 3.3 [3.3–3.6]: exactly two composed operation commands plus 1.3 [1.3–1.6] source-worker loader requests per send in the measured window. Every raw request remains counted. Complete inbound, receipt, and notifier request increases are also explicit below.
Per-phase statements, requests, durations, attribution, and source qualifications
Source scope and proof integrity
ec7c8bb9454bab03e76057ecc000bfad35897ce94eda6352f848253eedbf7660e1c17b6a52d7fed0ec7c8bb9454bab03e76057ecc000bfad35897ce938e2318741c8ab11a5cfa4080efe1009d64f4f39Shared reuse is narrow and source-bound. The only production change from 38e231 to 4eda caches compilation of
selectPluginStateBatchRows; SQL text and fresh plugin/tuple/time/row bindings are unchanged. Its sole production caller isexecutePluginStateOperation's batched lookup, dispatched only bypluginState.executeOperation. All 14 prior shared samples have exactly zero such requests and completions, verified against their original request CSVs and raw-conservation records. Existing import edges are unchanged. The shared table remains labeled with its original head and host; no fresh shared latency claim is made. The historical 38e231 whole-matrix duration failure remains recorded and is superseded only for the freshly rerun Reef workloads.The fresh analyzer validated exact Git commits/trees, built operation-module provenance, all 22 unchanged original input hashes and five separate scope hashes, launch order/nonoverlap, case counts, command sequences, and raw SQL/request conservation. A second local verification independently checked all 48 retained evidence/CSV hashes, recomputed every fresh phase/thread/request total and duration, and verified the compact manifest: 390 files / 167,796,230 bytes, SHA-256
1a061755d88ffa2e9b4e69c576203597853794072037c61211391b8563219690. All 12 fresh samples conserve exactly. All 1,073 selected causal witnesses are present. Fresh samples have no failed native calls, unknown targets, unmatched sends/receives, or operation SQL spilling across API boundaries.The reused manifest is
9ba984c93f8a6eeaa390d1f93ec581ae1dc7faebedcb99fb030983c138a901bb; 24 copied source/phase/conservation/request files were independently checked. Shared-reuse receipt SHA-256 isd6d0eac9f3a39a611323ec6734f024c0c0ea664edb6298a80761ac31b0edf186; zero-operation receipt isa5109c804aec49358cb654c6faaab5789fe324b8c2de3e6a8cdb50c8fe491b4b. The prior shared instrumentation retains two typed unresolved-target boot sends and two unmatched receives per sample, plus one failed MAIN connectexecper sample; those unchanged diagnostics are not hidden or relabeled as fresh proof.MAIN means the real Gateway process for shared, and the standalone real-owner fixture process for Reef. Each fresh sample has ten warmed operations per flow plus separately reported first-message operations. Counts and durations are divided within each sample before taking the cross-sample median and range. No operation is trimmed: the 5.89-ms key-load outlier in C1 remains included in its 2.2615-ms sample mean and the reported range. Native prepare calls and failures remain separate from successful statement counts. No evidence archive was created. The remote slot wait was 8,591.620 seconds; admitted resources were 32 effective CPUs and 65,965,027,328 bytes of memory.
Fresh 4eda phase measurements
Message flows
Counts are median [min–max] across alternating runs. Duration is milliseconds per stated unit.
Owner operations
Counts are median [min–max] across alternating runs. Duration is milliseconds per stated unit.
Reused shared Gateway measurements — candidate 38e231
These are the original seven-pair medians, reused under the scope qualification above. The shared warmed workload remains about 1042 statements/turn; this lane does not establish the campaign's global under-500 target.
Shared first-turn is 2549→2549; warmed is 1042.2→1041.7 SQL and 194.2→194.1 requests. No turn-noise exemption or extra whole-workload pair is needed for that evidence. Connect's +2 SQL median, with unchanged 58-request median, comes from +1 existing
deliveryQueue.countPendingownership read and +1channelIngress.failedHealthschema-content read. Both have baseline witnesses; grouping by family/type/SQL leaves the same 349-statement remainder in every sample. The producing owners are unchanged, while full stacks honestly retain their touched generic wrappers. This falls within the non-turn tolerance. Combined windows are reported for context, not substituted for the first-turn gate.Raw requests and named command budgets
All 300 fresh candidate owner operations contain exactly one expected command. All 33 first/warmed outbound sends contain exactly
runReefOutboundOperation:preparefollowed byrunReefOutboundOperation:finish. No command or its SQL escapes its measured API interval. These limits apply to the named owner APIs and ordinary outbound; complete inbound/receipt/notifier compositions contain multiple distinct owner operations.Every request column is per measured operation, median [min–max] across runs. Plugin command counts are a subset of raw requests. No loader, other, or outside-window work is subtracted.
Message flows
Commands outside individual API windows in measured phases: 0. They remain in phase totals and are listed in summary.json.
Every named owner phase has exactly one raw/plugin command, zero loader or other requests, and zero commands outside its API window; the per-operation SQL/duration table above retains each owner separately.
The full composite sequences explain the request increases. Inbound acceptance uses four audit appends, one trust snapshot, and one review lookup (six commands); cursor handling adds
cursor.advance(seven). Accepted/rejected receipts use two audit appends,readDelivery, one trust snapshot, andconsumeDelivery/rejectDelivery(five). Warmed rejection notification addsreserveRejectionandcompleteRejection(seven total); its first use adds an initial trust snapshot (eight). Each constituent owner operation uses one command. The outbound two-command limit is not applied to these whole compositions.Outbound removes one
pluginState.lookup, adds two operation commands, and observes the loader work below. Warmed inbound removes one lookup and adds six commands, with existing maintenance requests changing 0.2→0.1 per operation, for raw 11.2→16.1. Cursor handling removes two lookups, one observe, and one compare-update, adds seven commands, with the same maintenance difference, for 14.2→17.1. Plain receipts replace native work with five commands (0→5 raw). Warmed rejection notification adds seven commands while its two existing requests remain (2→9). First notification adds eight commands while its three existing requests remain (3→11). Each named owner API replaces native work with one request. These are explicit request increases accompanying the worker cutover, not request savings.Statement attribution
Warmed outbound's exact 141-statement saving balances below, identically in every fresh sample. Moving SQL to a worker earns no saving. The compiled-query follow-up changes CPU work and allocation only; these SQL savings come from the cross-row operation cutover and removing repeated preparation/envelopes.
Audit append commits the final linked suffix and head together instead of separate lease/staging/link/head/garbage transactions. Traversal uses one head/migration batch plus an entry scan. Review capacity combines inspection, scan, eviction and insertion in one transaction. Identity load combines three keyed reads. Rejection reserve batches peer/delivery reads; completion combines the peer notice update and delivery deletion. One namespace aggregate computes live count and expiry facts, eliminating empty-expiry probes when rows prove none are needed. Required ownership reads, transaction/commit admission and live effect assertions remain.
The following table attributes every measured flow's net SQL change by class. Each sample's classes sum exactly to its raw total; for this series their median deltas also reconcile to every displayed net delta. Exact SQL, per-run class values, request ancestry and full stacks remain in the compact evidence.
“Other owner SQL” is retained explicitly rather than subtracted: first inbound/cursor each remove 46 additional admission/connection/schema statements (table/index/integrity and connection setup checks); first outbound includes nine existing session-reclamation reads; receipt cold-flow differences include existing session maintenance and periodic WAL work. Small ±0.1/0.2 warmed differences are maintenance/WAL timing. Exact SQL strings and per-request class totals identify these separately from Reef storage changes. The deterministic outbound reduction contains none of this residual category.
Loader and residual MAIN work
All six fresh message samples contain exactly 544 transforms for the existing session disk-budget worker startup. Baseline emits them in
seed.outbound; candidate redistributes them across first/warmed outbound, verification and the next seed. Candidate warmed windows contain [13, 13, 16] transforms across ten sends, accounting for the 1.3 [1.3–1.6] raw loader requests per send. Their parent task is fixture session creation:replaceSessionEntry→kickSessionHistoryDiskBudgetMaintenance→measureSessionPhysicalDiskUsage, followed by source TypeScript worker/tsx/esbuild startup. Packaged JavaScript worker resolution does not add a TypeScript preload. The raw totals remain unchanged by this explanation.Each of the nine fresh warmed inbound/cursor/notifier phase samples retains the same five MAIN statements: one version observation,
schema_meta,session_key_contract,session_participants, andsession_nodesplus snapshot fields. They originate in existingdeliverPendingDeliveryNotice→loadSessionEntryReadOnly→ session projection readers. They are not Reef plugin-state SQL. First compositions also contain cold admission work. Named Reef owners, outbound and plain receipt flows are MAIN-free; complete inbound/notifier compositions are not described that way.Duration and gate classification
All non-exempt fresh duration ratios are ≤1.5. Key loading is 1.410862513× and reservation is 1.446099433×. The three authorized exceptions are review decision, 3.567961 ms at 1.753746191×; trust-set, 4.779546 ms at 2.288699092×; autonomy, 3.650427 ms at 1.828129682×. Each candidate median is strictly below 10 ms. Thus
durationValidis true whilerawDurationValidremains false; no additional exception was invented. The three valid initial pairs satisfy the frozen rule, so no recovery extension was needed.T1 counts static primitive call sites, not the runtime thread. Shared plugin-state leaf SQL remains in mixed owners for released synchronous SDK contracts, Doctor/migration use and retained channel adapters. Reef extension code has no direct native-site inventory rows. The runtime tables prove Reef's cutover. The generated 4eda inventory is bound to the exact source; W is 1061 versus 1060 on baseline (the compilation refactor changes scanner primitive visibility), and T1 remains 771.
Scope and remaining qualifications
Reef fixtures exercise real storage owners, cryptography, effect-preparation checks, prepared core metadata recording, cursor persistence and notifier paths with synthetic relay/model responses. They omit the outer live Gateway/OAuth/model/dispatch-custody lifecycle. Shared is a separate fixed Gateway workload, reused at its original source. No claim is made that every sample measured 4eda, that request counts fell globally, or that the global under-500 target is reached.
The final measured source is 4eda. Tests, code checks, compatibility, package proof, review, and update acceptance are reported separately.
Private evidence:
measurements-4eda-analysis/aggregate-verification.json,duration-command-verification.json,sql-class-attribution.json/.csv; attempt27'sderived-attribution/summary.json, phase/request tables, exact SQL/request class CSVs, stack/source registry, compact clock/ancestry witnesses and duration witnesses; and the separately hashedshared-reuse.json,shared-zero-operation.json, andprior-sharedevidence. Prior 38e231 owner failures remain diagnostic history, not current owner acceptance.Original performance-lane validation
Original lane proof source:
4eda6352f848253eedbf7660e1c17b6a52d7fed0. AWS proof run, leasecbx_883a99656990, 32 CPUs / 61.4 GiB. The final campaign slot wait was 2 h 23 min; a prior Testbox attempt queued without a runner for over 15 minutes before the authorized AWS fallback. The lease and campaign slots are released. Raw traces were pruned only after conservation and verified compact retrieval; remote measurement worktrees and the final local transport were removed.plugin-state-store.reads.tsec7c8bb9454b→e07c82e4c4ef: no entrypoint additions/removals; 156 reachable export changes from additive store/authority types (digest7d8187de). Subsequent repairs change no SDK declarationsThe monolithic
check-changedrun is not green. Its final remote invocation took 638.958 s and stopped on four unrelated unused exports already reproduced on the pinned baseline:bindCliQuestionAnswerAuthority,prepareSessionEventTargetForHost,readSessionEntryCreationTransition, andRESTART_CONTINUATION_CONTEXT_PREFIX. Earlier remaining native checks were run explicitly. The separately run final-file core lint passed through a normal local proof slot; its total wait plus execution was 51 min 13 s, after the host load fell below the campaign threshold. The existingregistry-runtime.tssize warning is 937 counted lines, down from 941 on the baseline; its growth ratchet passes. No suppressions or check-skip environment flags were added.Sibling reuse is explicit: 22 unchanged files passed remotely on the earlier candidate, the corrected channel file passed 26 tests, and four remaining files passed 65 tests. The channel correction expects the earlier stale-receipt refusal while preserving its positive control and zero-dispatch/acknowledgment checks. The final seven-file owner run covers the retention and compiled-query changes. A refused local 27-file attempt ran no shards and is not counted as proof.
Test wall time: the final seven-file command was
pnpm test src/plugin-state/plugin-state-store.retention.test.ts src/plugin-state/plugin-state-store.retained.test.ts src/plugin-state/plugin-state-operation.test.ts extensions/reef/src/trust-store.test.ts extensions/reef/src/flow.worker-outbound.test.ts extensions/reef/src/audit-state.test.ts extensions/reef/src/state.test.ts --maxWorkers=1(138.497 s). The changed retention file alone passed in 39.711 s on the loaded Mac. The corrected channel file passed withpnpm test extensions/reef/src/channel.test.ts --maxWorkers=1in 117.743 s. The remaining owner-notice, transport, direct-DM, and prepared-turn lifecycle files passed together in 149.053 s. GitHub CI seconds are pending the first PR run; these are measured test execution times, not claimed CI results.The final package is 103,493,667 bytes, SHA-256
53c349ec6b8f4cc72b3c33861f756da4c49b087bd486c5ef8b483955e66181a4. The package bytes were verified remotely before scratch pruning; the source/build/hash receipt is retained. No package was published. The update cell was pending at that earlier proof point; the required published-driver × candidate acceptance is now complete for the capture repair above. This is separate from the completed historical SDK checks. Live relay/model service execution is not claimed; the synthetic flow and shared-workload scope limits are recorded above.Production changes add 5,848 and remove 1,495 lines (net +4,353); tests/support add 3,993 and remove 924 (net +3,069). Documentation is +139 net and tooling +16. Growth covers the shared transaction/receipt contract, Reef handlers, released-host compatibility adapters, and authority/FIFO/settlement/expiry regressions. The old unpublished operation path is removed. T1 counts retained static native primitives; the runtime traces establish the measured MAIN reduction.