Skip to content

perf(state): stop re-reading the ownership lock on every shared-state read - #160139

Merged
steipete merged 3 commits into
mainfrom
perf/state-ownership-monitored-reads
Sep 28, 2026
Merged

steipete merged 3 commits into
mainfrom
perf/state-ownership-monitored-reads

Conversation

@steipete

@steipete steipete commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: the Gateway re-verified the same state-ownership lock file on every shared-state read. A single Control UI reload spent hundreds of synchronous open and realpath calls on the event loop, re-proving an ownership fact that had not changed.

User Impact

Shared-state reads verify ownership at most once per second instead of on every read, which removes most per-read lock-file opens and canonical-path resolutions from the Gateway event loop during session loading. Writes, schema/maintenance transitions, lease grants, and every generic SQLite worker job keep their current immediate checks. A transient filesystem error during a verification fails only that read, and the next read retries. No schema, config, protocol, or update behavior changes.

Why This Change Was Made

Maintainer question behind this: why so many locks? The inventory showed the hot path is mostly one lock re-verified at many independent read-lifetime boundaries: the process-owner sidecar, plus its compatibility projection. Each full check costs two canonicalizing realpath calls plus a re-read of the sidecar by path. The other layers protect distinct failures and are mostly memory checks. Maintenance admission keeps work out during maintenance. Physical database identity/generation keeps results from attaching to a replaced file. Native-handle custody prevents closing in-use handles. Worker request/grant admission stops mutations after authority changes. SQLite transactions serialize writes. This PR keeps all of them.

The owner sidecar uses staleMs: Infinity with PID/start-time liveness and no heartbeat, so a conforming peer never evicts a live owner. Per-read re-verification therefore only guarded against out-of-band sidecar replacement or deletion, a peer misjudging liveness (for example across PID namespaces), and an operator retargeting a state-directory alias.

  • gateway-state-owner.ts records a monotonic verifiedAt for the root owner and its projection whenever a physical verification succeeds. assertStateDatabaseReadAllowed (used only by the dedicated shared-state read transport) admits from memory while the cached canonical owner path and both verifications are younger than one second. Otherwise it re-resolves the canonical path and runs a fresh verifyStillHeld() synchronously before admitting. No read is ever admitted on a verification older than one second, independent of timers.
  • A failed or throwing verification refuses that read with the existing error and records nothing sticky; the next read retries. Strict assertStateDatabaseAccessAllowed behavior is unchanged. Acquire, lease run/release, and cleanup invalidate the cached read state immediately.
  • Only the dedicated shared-state read transport (openclaw-state-db-readonly.ts, via the read-retention entry points in openclaw-state-db-borrow.ts/openclaw-state-db-cache.ts) opts in. The generic SQLite worker broker has no read/write access-mode contract (for example, capture.listSessions/capture.readBlob share the writable opener that can create state), so it deliberately stays strict.
  • docs/gateway/gateway-lock.md and the worker-access page document the bound: explicit reads can be admitted for at most one second after an out-of-band lock replacement or alias retarget; mutations never are; transient verification errors fail only the affected read.

An earlier revision used fs-safe's setInterval compromise monitor. Review correctly found that a late tick could stretch the window and that a transient verification error became permanent. This revision removes the timer and the sticky flag entirely.

Evidence

  • Live authority chain on an isolated Gateway (synthetic state; one authenticated WebSocket calling the production device.pair.list RPC, which reads through the shared-state read transport; a scratch preload recorded worker postMessage read dispatches by command ID only):
Phase RPC result Shared-state read dispatches Explicit-read ownership checks
allowed allowed 2 (1 pairing read + 1 concurrent health read) 0 (within window)
owner sidecar atomically replaced out of band; RPC 1,250 ms later refused (UNAVAILABLE: "OpenClaw state ownership at /state/openclaw.sqlite could not be verified; retry after maintenance finishes.") 0 2
original sidecar inode restored allowed (same connection, no restart) 1 1
  • Production-transport regressions (fake clock): an expired read is refused at dispatch before worker I/O; a read queued behind a delayed dispatch is refused when its dispatch check runs after the window; a transient verification throw refuses one read and the next read with the intact lock succeeds, with strict access unaffected. All three fail on the previous head and pass on this one. Existing strict-path tests (sidecar or projection theft, alias retarget under maintenance, lease refusal) are unchanged and pass.
  • 872 passing tests across the 59 related files (two existing skips). Two compile-cache child-process tests timed out once under host load and passed on replay (11/11); their original cause is unresolved and is not related to this change. pnpm tsgo:core, pnpm tsgo:core:test, CI oxlint on touched files, and independent Codex P2 review pass.
  • Syscall evidence (scratch main-thread counter, one warm Control UI reload on synthetic state): versus main, explicit-read sidecar opens drop to zero within the window; the earlier monitor's timer opens (18 per reload) are gone. The remaining sidecar opens (~278 per reload) come from strict paths and the generic broker. A whole-reload aggregate for this revision was confounded by extra lazy startup loading in the measured run, so no aggregate or latency number is claimed here.

Per-file cost: the new/changed owner and transport tests use fake clocks; CI seconds will be added from the first run.

Follow-up (not in this PR): give generic SQLite worker operations an explicit read/write access mode so audited read-only broker jobs can use the same bounded check; capture.listSessions/capture.readBlob first need a non-creating read-only opener.

@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime size: M labels Sep 28, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 28, 2026, 7:46 AM ET / 11:46 UTC (Revision 4).

ClawSweeper review

What this changes

The branch lets the Gateway’s dedicated SQLite state-read transport reuse recent ownership verification for up to one second and updates its documentation, wrapper inventory, and tests.

Merge readiness

⛔ Blocked before merge - 5 items remain

Current main still checks the ownership lock on each shared-state read. The earlier merged performance PR removed repeated checks within a read, so this branch has distinct value. The documented one-second change to read authority needs explicit maintainer acceptance before merge.

Priority: P2
Reviewed head: f80a2702e6f1b0632bf533a02dcfb685e2645b7b
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The branch has relevant production-path proof and focused authority tests, with a documented tradeoff and test-cost follow-up still requiring resolution.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The captured PR body connects the changed Gateway read owner to an authenticated device.pair.list request on an isolated Gateway: after sidecar replacement, the request was refused before worker read dispatch at 1,250 ms, and a request succeeded after restoration. The worker-transport tests supplement that trace; no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured PR body connects the changed Gateway read owner to an authenticated device.pair.list request on an isolated Gateway: after sidecar replacement, the request was refused before worker read dispatch at 1,250 ms, and a request succeeded after restoration. The worker-transport tests supplement that trace; no stored-data contract changes.
Evidence reviewed 8 items Introduced read admission: The pinned PR delta adds a one-second cached owner-path and physical-verification check for dedicated reads.
Dispatch boundary: The dedicated read transport calls its authority check when the worker task is dispatched, including after a queue wait.
Read-only routing: Only the dedicated read path selects cached ownership checks; ordinary database access retains the strict check.
Findings 1 actionable finding [P3] Report the added test cost before merge
Security Needs attention Bounded stale ownership for reads: A retained shared-state read can use recent owner proof for less than one second after sidecar replacement or alias retargeting. This is documented and bounded, but changes the physical-ownership admission contract and needs explicit acceptance.

How this fits together

Gateway requests read shared SQLite state through a dedicated worker transport. The Gateway checks state ownership before dispatch; the worker returns rows used by features such as device pairing and sessions.

flowchart LR
  A[Gateway request] --> B[Shared-state read]
  B --> C{Recent ownership proof?}
  C -- No --> D[Verify owner sidecars]
  C -- Yes --> E[Read worker]
  D --> E
  E --> F[SQLite rows and reply]
Loading

Decision needed

Question Recommendation
Is a less-than-one-second window for dedicated shared-state reads after out-of-band owner-sidecar replacement or alias retargeting acceptable for the measured Gateway read-path benefit? Accept the bounded read window: Record acceptance of the documented subsecond exposure while retaining fresh checks for writes and maintenance.

Why: The branch deliberately changes when physical ownership loss stops reads; source and proof can establish the bound, but cannot choose that safety tradeoff for maintainers.

Before merge

  • Report the added test cost before merge (P3) - The new ownership and worker test files enter per-PR CI, but the PR body still gives no measured per-file one-worker wall time and defers available CI seconds. Add those measurements so the new suites can be checked against the repository’s test budget.
  • Resolve security concern: Bounded stale ownership for reads - A retained shared-state read can use recent owner proof for less than one second after sidecar replacement or alias retargeting. This is documented and bounded, but changes the physical-ownership admission contract and needs explicit acceptance.
  • Resolve merge risk (P1) - For up to one second after an out-of-band ownership-sidecar replacement or state-directory alias retarget, a retained read can proceed using stale owner proof. The PR documents this tradeoff, but explicit maintainer acceptance is not visible.
  • Complete next step (P2) - Record explicit maintainer acceptance or rejection of the subsecond stale-owner read window, and add measured per-file test wall times and available CI seconds to the PR body.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.

Findings

  • [P3] Report the added test cost before merge — src/infra/gateway-state-owner.read.test.ts:62
  • [medium] Bounded stale ownership for reads — src/infra/gateway-state-owner.ts:597
Agent review details

Security

Needs attention: The diff adds no dependency or secret-handling change, but deliberately delays read refusal after out-of-band loss of state-lock ownership.

PR surface

Source +120, Tests +308, Docs +14, Other +1. Total +443 across 13 files.

View PR surface stats
Area Files Added Removed Net
Source 6 220 100 +120
Tests 4 337 29 +308
Docs 2 14 0 +14
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 0 +1
Total 13 572 129 +443

Review metrics

Metric Value Why it matters
Ownership reuse window less than 1 second This is the material behavior and authority boundary maintainers must evaluate.
Production and test lines production +120 net, tests +308 net The PR states a syscall reduction as the reason for the production growth; the new tests cover expiry and dispatch behavior.

Merge-risk options

Maintainer options:

  1. Accept the measured bound (recommended)
    Explicitly accept the documented subsecond stale-owner read window after reviewing the production-path refusal and recovery evidence.
  2. Retain strict read authority
    Keep fresh sidecar verification at dispatch if any post-replacement read is unacceptable.

Technical review

Best possible solution:

Keep ownership policy in the existing state owner, with bounded reuse for dedicated reads only if the responsible maintainer accepts its documented window and strict admission remains in place for mutations.

Do we have a high-confidence way to reproduce the issue?

Yes from source: current main performs fresh physical ownership checks on the read path, and the PR body reports repeated synchronous lock operations during a Control UI reload. I did not execute the Gateway in this read-only review.

Is this the best way to solve the issue?

Yes as a focused implementation path: it changes the existing state owner and dedicated reader instead of adding a competing lock owner. Its safety tradeoff still needs explicit acceptance.

Full review comments:

  • [P3] Report the added test cost before merge — src/infra/gateway-state-owner.read.test.ts:62
    The new ownership and worker test files enter per-PR CI, but the PR body still gives no measured per-file one-worker wall time and defers available CI seconds. Add those measurements so the new suites can be checked against the repository’s test budget.
    Confidence: 0.98

Overall correctness: patch is correct
Overall confidence: 0.86

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 659f4b73d8e2.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This is a bounded Gateway performance improvement with a maintainer-visible ownership tradeoff.
  • merge-risk: 🚨 security-boundary: The PR intentionally permits dedicated reads to use recent owner proof briefly after physical lock ownership changes out of band.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured PR body connects the changed Gateway read owner to an authenticated device.pair.list request on an isolated Gateway: after sidecar replacement, the request was refused before worker read dispatch at 1,250 ms, and a request succeeded after restoration. The worker-transport tests supplement that trace; no stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured PR body connects the changed Gateway read owner to an authenticated device.pair.list request on an isolated Gateway: after sidecar replacement, the request was refused before worker read dispatch at 1,250 ms, and a request succeeded after restoration. The worker-transport tests supplement that trace; no stored-data contract changes.

Evidence

Security concerns:

  • [medium] Bounded stale ownership for reads — src/infra/gateway-state-owner.ts:597
    A retained shared-state read can use recent owner proof for less than one second after sidecar replacement or alias retargeting. This is documented and bounded, but changes the physical-ownership admission contract and needs explicit acceptance.
    Confidence: 0.9

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Record the maintainer’s decision on the subsecond read-authority window.
  • Add measured per-file test wall times and available CI seconds to the PR body.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (3 earlier review cycles)
  • reviewed 2026-09-28T05:15:26.035Z sha d26e651 :: needs real behavior proof before merge. :: [P1] Require a successful lock check when the monitor deadline expires | [P2] Recover safely from transient monitor read failures
  • reviewed 2026-09-28T08:53:41.158Z sha 9ad3d98 :: needs real behavior proof before merge. :: [P1] Require a successful lock check when the monitor deadline expires | [P2] Recover safely from transient monitor read failures
  • reviewed 2026-09-28T11:23:50.431Z sha eaa7bec :: blocked before merge. :: [P3] Report the added test cost before merge

@steipete

Copy link
Copy Markdown
Contributor Author

CI note for run 36380641313: the only failing job was checks-node-changed-compact-large-39 (shard bun:core-unit-fast-2), in src/plugins/runtime.retention.test.ts ("Completed retirement retained a successor registry" / "Live recovery retained its retired instance"). The other failures in that run were fail-fast cancellations.

This is a pre-existing Bun GC-timing flake, unrelated to this change:

  • The failing test spawns a --expose-gc child that builds, retires, and garbage-collects plugin registries. It never loads the state-ownership code this PR changes; the new compromise monitor only exists while an ownership lock is held.
  • Local Bun-lane reproduction (OPENCLAW_VITEST_RUNTIME=bun node scripts/run-vitest.mjs src/plugins/runtime.retention.test.ts): unchanged origin/main 8d7ec42 failed 3 of 6 runs; this branch failed 2 of 6. Under Node both pass 9/9.

The flake is tracked as a separate fix (deterministic GC check under Bun, without weakening the assertion). Rerunning the failed job on this head.

Keep process/projection exclusion, schema leases, native-handle custody,
physical database identity, maintenance admission, and SQLite transaction
and commit grants. The hot cost was repeated observation of the same
process owner at independent read lifetime boundaries.

Monitor owner/projection sidecars every second and cache canonical owner
paths for one second, invalidating them on ownership and schema lifecycle
transitions. Only the dedicated shared-state read transport opts in.
Reads tolerate that bounded window after out-of-band lock replacement or
alias retargeting; writes and generic broker jobs keep fresh checks.
Foreign and maintenance ownership remain strict. No schema or dependency
changes; update behavior is unchanged.

One warm Control UI reload on synthetic state (46 RPCs), base f5866a5
versus candidate: realpathSync.native 1478 -> 913 (-38.2%), openSync
536 -> 275 (-48.7%). Counter windows were 8.087s and 9.810s. The top-40
stack buckets show explicit-read sidecar opens 256 -> 0; candidate
monitoring adds 20 opens. This is syscall evidence, not a latency claim.

Validation: fake-timer ownership/projection theft, alias expiry, lifecycle
and failed-cleanup invalidation, and no warm read ownership syscalls.
The transport regression fails on the base with an owner-sidecar open.
Both core typecheck lanes, touched-file CI oxlint, line-cap ratchet,
diff checks, and independent P2 review pass. Runtime/UI builds pass
with declaration emission disabled; runtime postbuild/stamps are included.

The broader run initially timed out the unchanged synchronous snapshot
test after 162.790s against its 120s deadline under heavy host load.
Its same-file-order replay with the original concurrent lifecycle suite
passed in 5.002s without a fix, so the original cause remains unresolved.
The selected 57 files finish with 852 passing tests and two existing skips
across the successful runs. No timeout or assertion was weakened.

New ownership test cost: 8 cases, 7.879s summed test time and 80.49s shard
wall under host load. The two changed read/borrow files shared a 417.61s
unit shard; initial worker transformation dominated that cold run.
Benchmark and broad-suite evidence use the original f5866a5 base;
rebase integration preserves the unchanged ownership implementation.

Benchmark limitations: an initial cold-start warmup timeout was discarded.
Both base and candidate reproduce existing Teams/Zoom plugin shutdown
cleanup failures, but both isolated Gateways stopped and state was removed.
Both UI builds retain the existing 363.4/362.9 KiB startup-JS advisory.
@steipete
steipete force-pushed the perf/state-ownership-monitored-reads branch from d26e651 to 9ad3d98 Compare September 28, 2026 08:46
@steipete
steipete enabled auto-merge (squash) September 28, 2026 09:00
Merge main while preserving relocated Doctor ownership and retained projection
custody. Replace the fs-safe compromise monitor with monotonic timestamps for
successful root and projection verification. Explicit reads synchronously
refresh expired proof before worker dispatch; transient verification failures
refuse one attempt without poisoning the owner. Strict access stays unchanged.

Keep canonical-path expiry and lifecycle invalidation independent of sidecar
proof. Root-only checks cannot renew projection evidence. The read-only
transport accepts a bounded sub-second ownership window; writes, maintenance,
schema leases, and generic SQLite worker jobs retain fresh checks.

Production-transport regressions fail on 9ad3d98 for expired admission,
delayed dispatch, and sticky transient errors. Update the ownership docs to
state the timer-free bound and retry behavior.

Live device.pair.list proof refused after replacement and 1250ms with zero
shared-read dispatches, then recovered after restoring the original inode.
Ownership sidecar opens stayed 280 -> 278; timer opens fell 18 -> 0. Raw reload
counts were confounded by lazy startup work and do not prove aggregate speedup.

Focused proof: 872 passed, 2 existing skips, and 2 unchanged child-process
timeouts. The compile-cache replay passed all 11 cases without a code change;
the initial timeout cause remains unresolved. Core/test types, touched-file
CI oxlint, diff checks, and Codex P2 autoreview passed.
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 28, 2026
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Sep 28, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 28, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

CI note for checks-ui-e2e (7/9) on f80a270: the two failures are UI e2e tests that run against a mocked Gateway, so this Gateway-side ownership change cannot reach them:

  • session-management.rename-composition.e2e.test.ts (keeps the rename draft during legacy composition Escape): expected 'Original session' to contain '確定した名前' / matcher timeout. The same test failed on unrelated perf(ui): render less offscreen work when presenting a conversation #160298, where it passed 3/3 locally both with the PR's files and with main's files.
  • session-management.unread.e2e.test.ts (preserves manually unread state through active run updates): locator.waitFor 30 s timeout.

These are timing flakes on loaded runners; they are being tracked separately. Rerunning only the failed job on this head.

@steipete
steipete merged commit b95394a into main Sep 28, 2026
362 of 366 checks passed
@steipete
steipete deleted the perf/state-ownership-monitored-reads branch September 28, 2026 12:27
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 29, 2026
… read (openclaw#160139)

* perf(state): monitor ownership for explicit shared-state reads

Keep process/projection exclusion, schema leases, native-handle custody,
physical database identity, maintenance admission, and SQLite transaction
and commit grants. The hot cost was repeated observation of the same
process owner at independent read lifetime boundaries.

Monitor owner/projection sidecars every second and cache canonical owner
paths for one second, invalidating them on ownership and schema lifecycle
transitions. Only the dedicated shared-state read transport opts in.
Reads tolerate that bounded window after out-of-band lock replacement or
alias retargeting; writes and generic broker jobs keep fresh checks.
Foreign and maintenance ownership remain strict. No schema or dependency
changes; update behavior is unchanged.

One warm Control UI reload on synthetic state (46 RPCs), base f5866a5
versus candidate: realpathSync.native 1478 -> 913 (-38.2%), openSync
536 -> 275 (-48.7%). Counter windows were 8.087s and 9.810s. The top-40
stack buckets show explicit-read sidecar opens 256 -> 0; candidate
monitoring adds 20 opens. This is syscall evidence, not a latency claim.

Validation: fake-timer ownership/projection theft, alias expiry, lifecycle
and failed-cleanup invalidation, and no warm read ownership syscalls.
The transport regression fails on the base with an owner-sidecar open.
Both core typecheck lanes, touched-file CI oxlint, line-cap ratchet,
diff checks, and independent P2 review pass. Runtime/UI builds pass
with declaration emission disabled; runtime postbuild/stamps are included.

The broader run initially timed out the unchanged synchronous snapshot
test after 162.790s against its 120s deadline under heavy host load.
Its same-file-order replay with the original concurrent lifecycle suite
passed in 5.002s without a fix, so the original cause remains unresolved.
The selected 57 files finish with 852 passing tests and two existing skips
across the successful runs. No timeout or assertion was weakened.

New ownership test cost: 8 cases, 7.879s summed test time and 80.49s shard
wall under host load. The two changed read/borrow files shared a 417.61s
unit shard; initial worker transformation dominated that cold run.
Benchmark and broad-suite evidence use the original f5866a5 base;
rebase integration preserves the unchanged ownership implementation.

Benchmark limitations: an initial cold-start warmup timeout was discarded.
Both base and candidate reproduce existing Teams/Zoom plugin shutdown
cleanup failures, but both isolated Gateways stopped and state was removed.
Both UI builds retain the existing 363.4/362.9 KiB startup-JS advisory.

* fix(scripts): add gateway state owner directory to the PR wrapper inventory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant