Skip to content

refactor(device-identity): admit runtime identities through the shared worker - #166539

Merged
steipete merged 13 commits into
mainfrom
dbasync/w6device
Oct 7, 2026
Merged

steipete merged 13 commits into
mainfrom
dbasync/w6device

Conversation

@steipete

@steipete steipete commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Cold device identity discovery and creation still run SQLite on the caller thread during Gateway/client authentication, public sharing, goal requests, APNs delivery, and monitor reconciliation.

User Impact

Identity preparation uses the existing shared-state worker while preserving identity bytes, read-only versus creating behavior, and released client contracts. Schemas, configuration, retention, durability, and update behavior are unchanged.

Qualification passed. The final alternating comparison reduces warmed-turn and first-turn medians, reduces control plus cron, and leaves every phase median no higher than its pinned main baseline. Exact-head CI is green; native merge admission is next.

Why This Change Was Made

Callers await the identity owner and reuse its process identity/signing-codec caches. Client shutdown joins accepted preparation and prevents late connection effects. Sharing prepares its codec before the final row/authority read; only cold preparation requires a bounded reread if that read first reveals a share. Goal and APNs callers recheck authority after preparation. Cron prepares one seed for both monitor families. APNs URL policy remains in a leaf module, outside relay transport imports.

Pairing reads reuse freshness within their admitted synchronous operation, preserving the fresh probe after BEGIN and foreign-commit visibility on the next unpinned read. Ordinary chat normalization stays synchronous; goal fingerprinting remains asynchronous.

Retired-plugin cleanup now avoids lease writes when its conservative filesystem scan finds no candidates. Actual cleanup shares one fresh, unfiltered installed-index payload in a private operation-scoped cache under the existing lifecycle lease. It preserves malformed-receipt checks, live deletion guards, and hot Gateway cache facts. Cache disposal finishes before lease release. Timers and deletion criteria are unchanged; concurrent artifacts missed by enumeration remain for later cleanup.

The released GatewayClient constructor, methods, options, and synchronous custom identity callback remain compatible. Boot pairing, node startup/connect CLI, configuration preflight, Doctor identity/cadence migrations, and worker kernels retain native admission. No SQL is added inside host grant callbacks.

Overlap: #162433, #164265, #166094, #166364, #166444, and #166445; integration also preserves #166621 and #166657. Later main #166683 changes heap-snapshot/runtime-instance cleanup; this PR’s private metadata-only cleanup cache creates no runtime instances. The publication-fixture repair reuses #166293's design, also recorded in #166519. Integration preserves #166447's atomic row/member snapshot and #166523's device-auth error policy.

Evidence

Current candidate: 6ab6119e85627f90896f44559492fe50a88d0dbe, merging main d72a907b6125aef3ad98b709c533c8dec2f16c49 into pushed repair head 823ac87709a182149e3e99cbd6eaa5d0354eaa7e (merge commit, no rebase). GitHub reported real conflicts in call.ts and chat-send-request.ts. The resolutions keep main’s literal-credential-aware auth resolver and ordinary-chat predicate, plus awaited identity admission and synchronous ordinary normalization. Main’s client leaf imports, prepared public-session rows, and retained database/write context remain intact.

The reviewed merge tree passed 234 tests across 15 files in 865.651s, core types in 33.778s, all core-test type lanes in 901.135s, Madge in 120.941s (zero cycles), and conflict-file lint in 50.464s. Full integrated P2 review is scoped-clean. No dependency or lockfile change needed installation. The performance fixes are:

Repair Verified proof
31bee3c994783aa627c45904f333ae31c2d621d9: pairing freshness and synchronous normalization 95 tests across six files passed in 1550.604s; full core-test types passed in 730.782s; core production types passed earlier; independent P2 review scoped-clean.
d08563c74b8a8d6379147ee8e9563391844b45d9: cleanup and docs All five negative controls failed as intended in 288.151s: three empty-path witnesses changed data version 2→3, and two inventory cases read metadata twice instead of once. Positive proof passed 30 tests across two files in 422.299s, including malformed receipts, live lease/caller revocation, and native fallback protection. Independent P2 review scoped-clean.

The production Knip scan exposed a namespace-binding analysis gap, reproduced in an isolated fixture. 823ac87709a182149e3e99cbd6eaa5d0354eaa7e uses named destructuring in the same dynamic import tuple; no import targets or runtime semantics change. Production Knip now passes, 11 cleanup tests passed in 136.099s, core types passed in 8.403s, and P2 review is scoped-clean. The original changed-file gate stopped only at that Knip finding. After repair, all three export scans and every remaining planned check passed; earlier successful checks were retained, with no exemption or disabled guard.

Test wall times include compilation/worker startup; they are not product latency claims. Final exact-head CI completed in 879s overall, with an 875s active-job window; these are whole-run costs, not invented per-file CI timings.

Final qualification Status
Candidate / comparison main 6ab6119e85627 / d72a907b6125
Post-integration local proof Passed as recorded above. Fresh local SDK report passed in 1472.138s; digest 8c288ff99868821bbaa881dd0a2e695ad2d3f0e48e03969562a1ab6e86eb6790.
Unchanged-harness alternating medians, duration ratios and attribution PASS, full samples and attribution below.
Exact-head CI 37661598308: success; 82 successful jobs, 23 skipped, zero failures.
Trusted ClawSweeper review Completed exact 6ab6119e at 2026-10-07 18:00:31.926 UTC; no actionable code or security findings. Its then-pending SQL/SDK checklist is satisfied by the completed results here.

The previous head c1e9bbfe1b99ae9e2fba8d9a6898b8e7c1e56e12 passed CI 37636985496: 74 successful jobs, 23 skipped, 17m35s overall. ClawSweeper subsequently completed the 823ac877 review at 2026-10-07 17:24:17 UTC without actionable code or security findings; it retained conflict resolution, current SQL qualification, and the compatibility scope clarified below. The later integrated-head review is recorded above. These are prior-head results. No inherited-CI exception was used; old admin evidence for subsequently fixed failures is retired.

Released-contract checks covered v2026.10.1-beta.1 and stable v2026.9.8. Changed helpers/removed exports are internal, outside Plugin SDK and api.runtime exports. The pre-integration SDK report for 7a75498 → d08563c passed in 1311.822s: 131 reachable fingerprints and one private client declaration change, with no changed public callable, export, or entrypoint. Digest: 4599fa905ad0487db51123156ef9927253c553e3874976d4e09ef86c9efa09ad, structurally identical to the prior report. The binding-only 823ac877 follow-up preserves import targets, explicit signatures and every emitted-declaration contract input, so that proof is reused without relabeling its tested head. SDK temporary checkouts for that report were removed. The fresh d72a907b → 6ab6119e comparison passed in 1472.138s. Digest: 8c288ff99868821bbaa881dd0a2e695ad2d3f0e48e03969562a1ab6e86eb6790. It retains 131 reachable fingerprint changes and one private-client declaration change, with no public callable or entrypoint change; its temporary checkouts were removed.

Published 2026.9.8 driver → exact-SHA candidate 2fa3b18c passed the Docker update proof in 469.09s on Linux/Node 24.21.0: readiness HTTP 200, expected version, durable session/marker preserved, empty incognito history after restart, and artifact inspection passed. Native-drain and service integration passed 14/121 tests. scripts/database-worker-inventory.mjs changes classification only; the new managed-npm-retention.ts predicate only enumerates existing marker directories. Marker writers, serialized fields, schema versions, and deletion eligibility are unchanged. This driver run proves the originally approved head, not subsequent source. The follow-up repairs preserve updater behavior, schema and stored formats; current legacy-layout and native-capture recovery tests cover their cleanup boundary. No new updater contract requires another driver matrix. Task-owned infrastructure was released.

Final SQL cost verification

The unchanged canonical workload passed in alternating order (main, candidate, repeated three times) on one isolated host, using Node 24.21.0 and SQLite 3.53.4. Exact sources: main d72a907b6125aef3ad98b709c533c8dec2f16c49 and candidate 6ab6119e85627f90896f44559492fe50a88d0dbe (tree fb3e5c8a5037ae9b7844ad6db78edf83d77ded32). Independent verification matched 259 retained input files against the downloaded archive, checked source/harness hashes and all 12 calibration traces, and reconciled raw phase/thread/SQL counts exactly. All six flows and child-process cleanups passed; SQL execution and preparation errors were zero.

All-thread statements Main runs 1 / 2 / 3 Candidate runs 1 / 2 / 3 Median change
First turn 4,733 / 4,717 / 4,734 4,735 / 4,730 / 4,732 4,733 → 4,732 (−1)
Ten warmed turns 15,952 / 15,942 / 15,918 15,867 / 15,879 / 15,887 15,942 → 15,879 (−63)
Control plus adjacent cron 1,632 / 1,627 / 1,629 1,601 / 1,625 / 1,616 1,629 → 1,616 (−13)

Every individual phase median is no greater than main. Warmed and combined-window duration ratios are 1.0170 and 1.00194, respectively; no phase exceeds the 1.5 invalidation limit. Combined totals are 4,888 → 4,842 (−46), and all 16 nonzero median-delta SQL/full-stack groups occur in baseline traces. The first-turn, warmed-turn and remaining phase gates therefore pass without an exception.

The tables below group native statements by their complete captured producer stack. The deltas use the actual median-bearing runs, so they add to the window median change; they are not sums of independently selected family medians. Each row preserves all six sample counts.

Warmed producer family (median-bearing runs: M2, C2) Main 1 / 2 / 3 Candidate 1 / 2 / 3 Δ
Pairing readers/cache (device-pairing-*) 72 / 72 / 67 55 / 55 / 60 −17
Lease acquire/release (openclaw-state-lease-*) 21 / 21 / 0 0 / 0 / 0 −21
Metadata rows (installed-plugin-index-row) 6 / 6 / 0 0 / 0 / 0 −6
Periodic WAL (maintainPeriodic) 48 / 52 / 48 48 / 48 / 52 −4
Session maintenance 804 / 810 / 802 806 / 801 / 804 −9
Plugin-state operations 8 / 8 / 8 8 / 8 / 8 0
Trajectory retention 0 / 0 / 50 0 / 0 / 0 0
Other session/state operations and admission 14,993 / 14,973 / 14,943 14,950 / 14,967 / 14,963 −6
Total 15,952 / 15,942 / 15,918 15,867 / 15,879 / 15,887 −63
Control plus cron producer family (median-bearing runs: M3, C3) Main 1 / 2 / 3 Candidate 1 / 2 / 3 Δ
Pairing readers/cache 12 / 12 / 12 5 / 10 / 10 −2
Periodic WAL (maintainPeriodic) 20 / 20 / 16 12 / 20 / 20 +4
Session maintenance 93 / 88 / 93 79 / 88 / 100 +7
Plugin-state operations 4 / 4 / 4 4 / 4 / 4 0
Other session/state operations and admission 1,503 / 1,503 / 1,504 1,501 / 1,503 / 1,482 −22
Total 1,632 / 1,627 / 1,629 1,601 / 1,625 / 1,616 −13

The remaining session/state deltas include shared-state schema/freshness checks, session row reads/writes and transcript projection snapshots; the full SQL strings, stacks and raw file/line examples are retained in the verification summary. The candidate removes the observed warmed lease/metadata cycle and reduces pairing SQL, consistent with skipping empty cleanup and reusing admitted pairing freshness. Canonical traces contain no worker request IDs or command inputs, so these are statement/producer counts, not worker request counts; they do not independently identify a particular logical lease caller. No diagnostic observer was used for these gates. The isolated lease is released and cleanup is complete. Final archive SHA-256: 2c3ea1c3c0d9a382d3b41851f6641c7c985573052e0cf0cd5df1de14078229e0.

Earlier CI failures and repairs
Failure Attribution and resolution
37599570984: socket/TUI fixtures entered real identity loading PR-caused: both files failed 5/5 PR runs and passed 5/5 merge-base runs. d52042643c7cf83132123cf2a8479fcb443d92ea supplies explicit null/synthetic identities; transport assertions remain intact. Repaired files passed 72 tests in 77.23s.
37603599803: anonymous publication raced child metadata settlement 6ecf7e58aae63fccde9f08eb30ee58c209e47445 waits for existing session-work release without sleeps/retries or weakened assertions. Full flow passed 5/5; median wall 45.625s. CI's 404 and merge-base's 503 in 3/5 runs remain distinct observations.
37621408600: stale managed-auth assertion and duplicate plugin registration Independently reproduced on main, then fixed and integrated through 7a75498. Earlier terminal-font TS2353 also reproduced on main de38a045; its published correction was integrated. Old admin evidence is no longer applicable.
37631309065: probe service-auth cases lacked the host broker PR-caused test routing: file failed 5/5 PR runs and passed 5/5 merge-base runs. c1e9bbfe1b99ae9e2fba8d9a6898b8e7c1e56e12 routes it into the existing fork inventory. No test/deadline/assertion changes; corrected 9/9 passed in 148.025s.

One earlier probe.device-auth-scope case ended before its connect frame under its existing 2000ms deadline; unchanged replay passed 9/9. The original cause remains unestablished, and the replay is not claimed as a fix.

Historical integration proof passed 190 tests/11 files in 494.12s, core/core-test types, zero-cycle Madge, runtime process graph, reply/worker import closures, and wrapper inventory. Final changed-file/static qualification remains separate.

Approved phase move and completed pre-repair SQL attribution

The maintainer approved only the original +4 first-turn schema-admission phase move: connect MAIN fell 14→0 while first-turn all-thread counts changed 6126→6130. Raw stacks matched four existing checks moving from connect to first turn: schema version, user version, schema catalog, and schema content marker. The schema owner and complete-workload MAIN catalog/content counts (17/33) were unchanged. Connect's other ten saved MAIN statements are separate identity/admission work. This exception does not authorize unrelated first-turn growth or warmed-turn increases.

An earlier grouped comparison (1b395594→d6298c8a) failed control alone, 50→64. Its adjacent control-plus-cron medians were 2002→2001, but grouped ordering and two unmatched stack groups prevented qualification. The alternating replacement below is the operative historical evidence.

Unchanged harness, M,C,M,C,M,C, one isolated host, Node 24.21.0/SQLite 3.53.4: main 7a75498beb6ece381f483f7e194dd8665c77f3a1 versus production 77ecbf16d11f6e90125c4fad9938d18b53f85fef. All six workloads, conservation assertions, and child cleanup checks passed without SQL execution/preparation errors. c1e9bbfe changed only test routing.

Phase Main all-thread median Candidate median Change
Boot 3919 3918 −1
Connect 349 338 −11
First turn 5987 5978 −9
Ten warmed turns 23169 23228 +59 — FAIL
Second session/child 7227 7153 −74
Control plus cron 1889 1928 +39 — FAIL
Compaction 901 782 −119
Shutdown 2207 2205 −2
Complete workload 45641 45506 −135

Raw first-turn runs: main [5986,5987,6023], candidate [5971,5978,6097]; warmed [23191,23169,23162] versus [23228,23231,23169]; combined [1889,1880,1917] versus [1928,1899,2053]. Warmed/combined median duration ratios were 1.0021/1.0006. Combined aggregates increased 5686→5880; complete-workload aggregates decreased 136897→136780. Workload savings do not waive failed phase gates; independently computed medians need not sum.

The following uses median-bearing runs: warmed M2/C1 and combined M1/C1. Families follow full producer stacks; unidentified outer admission remains in other reads.

Producer family Warmed delta Control plus cron delta
State lease acquisition/release +21 0
Installed-plugin metadata +6 0
Periodic WAL maintenance +4 +6
Device pairing +5 +6
Plugin-state reads 0 +4
Session maintenance 0 +15
Other reads/admission +23 +8
Total +59 +39

All 90 changed combined-window SQL/stack groups exist in baseline traces; that does not waive the increase. Every candidate executes the lease/metadata cycle during warmed turns; M1/M2 do so during second-session, M3 not after boot. Whole-workload lease totals are [372,372,351] versus [372,372,372]; metadata [27,27,21] versus [27,27,27]. Pairing combined-window snapshot misses are two per baseline and three per candidate.

A separate diagnostic-only observer copy found equal warmed pairing/plugin-state request counts (13/6 each side). Lease→metadata→metadata→release shared one actor/connection, but lacked host caller information. Retired-plugin cleanup is a source-supported candidate, not a proven trace identity or identity-commit trigger. Diagnostic retention retries were absent from all six original warmed traces and are excluded as the cause. This diagnostic is not gate evidence.

The repaired final-source medians are recorded above. Historical measurement archive SHA-256: 47b7526855e0ef58b3f1e7c723d0d56294306c76955282ef8e8c1cefa49485ec.

…d worker

Move live client, call, sharing, goal, APNs, and monitor identity preparation off the caller thread while retaining read-only discovery, process caches, boot/Doctor paths, and accepted client settlement. Reuse the existing shared-state owner and avoid a redundant warm freshness lookup.
Keep warm codecs synchronous and authorize against a fresh session row after cold identity preparation. Reject ownership changes during codec loading, including foreign publication that was absent from resident sharing facts.
@clawsweeper

clawsweeper Bot commented Oct 7, 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 cli CLI command changes scripts Repository scripts commands Command implementations size: XL labels Oct 7, 2026
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: 6ab6119e85627f90896f44559492fe50a88d0dbe
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/gateway/call-device-auth.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/exec-approval-ios-push.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/infra/device-pairing-store-cache.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.

Carefully review these changes before merging.

@steipete

steipete commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 7, 2026, 2:00 PM ET / 18:00 UTC (Revision 14).

ClawSweeper review

What this changes

Move runtime device identity preparation into the shared database worker, preserve authentication and shutdown ordering, and reduce redundant pairing and retired-plugin cleanup work.

Merge readiness

⛔ Blocked before merge - 3 items remain

Keep open: this remains useful, distinct work that current main does not implement. No actionable introduced code or security defect was found, but the agreed performance and integrated compatibility qualifications remain incomplete.

Priority: P2
Reviewed head: 6ab6119e85627f90896f44559492fe50a88d0dbe

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Functional evidence is strong and no discrete defect was found, but current workload cost and integrated compatibility qualification remain uncertain.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Recorded production Gateway workloads exercise the identity-dependent runtime flows, and published-driver update evidence verifies preserved durable state on the original candidate. Integrated focused results cover the subsequent repairs; the replacement SQL-cost qualification remains a separate unresolved gate. Inspection found no introduced stored-format or schema change.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Recorded production Gateway workloads exercise the identity-dependent runtime flows, and published-driver update evidence verifies preserved durable state on the original candidate. Integrated focused results cover the subsequent repairs; the replacement SQL-cost qualification remains a separate unresolved gate. Inspection found no introduced stored-format or schema change.
Evidence reviewed 8 items Pinned introduction and clean checkout: Reviewed the introduced delta from d72a907 to 6ab6119. Raw commit records confirm the head's ordered parents are the repair head and integrated main. The supplied test merge is stale and was not used to infer merge removals. Final git status remained clean.
Still necessary on current main: Fetched main still resolves Gateway call identities through synchronous native identity loaders. The introduced branch awaits the existing worker-backed loaders instead. The merged concurrent-CLI authentication repair preserves errors and credentials but does not implement this remaining runtime cutover.
Captured body read completely: The fetched body exactly matches the captured snapshot: 13,583 UTF-16 units and SHA-256 d02d61ebe458afee7513e6c2a4332857ea0e7ef4501e856f99e279f58469f8b2. The previously omitted tail retains all failed phase measurements and explicitly says final repaired medians remain pending.
Findings None None.
Security None None.

How this fits together

Device identity supplies signing keys for Gateway connections, public session links, goal receipts, and push delivery. Runtime callers now prepare those keys through the existing shared-state worker before continuing their authorized operations.

flowchart TD
  A[Gateway and runtime requests] --> B[Identity preparation]
  B --> C[Process cache]
  B --> D[Shared database worker]
  D --> E[Canonical identity state]
  C --> F[Current authority and lifetime checks]
  D --> F
  F --> G[Connection signing and authorized effects]
Loading

Before merge

  • Resolve merge risk (P1) - The revised source has not completed the agreed alternating SQL qualification; the last completed comparison failed warmed-turn and control-plus-cron conditions, so its current workload cost remains unknown.
  • Complete next step (P2) - Complete and record the fresh integrated SDK comparison; the prior report does not cover the changed integration inputs.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +207, Tests +506, Docs +44, Other +6. Total +763 across 79 files.

View PR surface stats
Area Files Added Removed Net
Source 34 533 326 +207
Tests 41 714 208 +506
Docs 2 44 0 +44
Config 0 0 0 0
Generated 0 0 0 0
Other 2 10 4 +6
Total 79 1301 538 +763

Review metrics

Metric Value Why it matters
Production versus regression coverage production net +207 lines; tests/support net +506 lines Production growth supports awaited admission and operation-owned cleanup; added coverage protects shutdown, foreign commits, authority, and zero caller-thread SQL.

Stored data model

Persistent data-model change detected: database schema: scripts/database-worker-inventory.mjs, migration/backfill/repair: scripts/database-worker-inventory.mjs, serialized state: src/plugins/managed-npm-retention.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Qualify the revised workload (recommended)
    Complete the existing alternating comparison on the integrated source and repair any remaining producer overhead without excluding background statements or expanding the accepted phase exception.

Technical review

Best possible solution:

Retain one worker-backed identity owner with fresh final-effect authority checks, stable released client contracts, and demonstrated non-growing workload SQL cost.

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

Not applicable as a bug reproduction: source confirms the native runtime identity paths being moved, and the body records a real Gateway workload comparison; no new failing current-main execution was performed during this read-only review.

Is this the best way to solve the issue?

Yes: extending the existing shared-state worker and preserving current authority guards is the appropriate ownership boundary, subject to completing the agreed cost and integrated compatibility checks.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 5e01ab02de35.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded runtime database improvement with no demonstrated urgent user-facing regression.
  • merge-risk: 🚨 other: The previous workload comparison failed two SQL-cost conditions, and focused repair tests do not establish the integrated source's replacement performance result.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Recorded production Gateway workloads exercise the identity-dependent runtime flows, and published-driver update evidence verifies preserved durable state on the original candidate. Integrated focused results cover the subsequent repairs; the replacement SQL-cost qualification remains a separate unresolved gate. Inspection found no introduced stored-format or schema change.
  • proof: sufficient: Contributor real behavior proof is sufficient. Recorded production Gateway workloads exercise the identity-dependent runtime flows, and published-driver update evidence verifies preserved durable state on the original candidate. Integrated focused results cover the subsequent repairs; the replacement SQL-cost qualification remains a separate unresolved gate. Inspection found no introduced stored-format or schema change.

Evidence

What I checked:

  • Pinned introduction and clean checkout: Reviewed the introduced delta from d72a907 to 6ab6119. Raw commit records confirm the head's ordered parents are the repair head and integrated main. The supplied test merge is stale and was not used to infer merge removals. Final git status remained clean. (6ab6119e8562)
  • Still necessary on current main: Fetched main still resolves Gateway call identities through synchronous native identity loaders. The introduced branch awaits the existing worker-backed loaders instead. The merged concurrent-CLI authentication repair preserves errors and credentials but does not implement this remaining runtime cutover. (src/gateway/call-device-auth.ts:101, 5e01ab02de35)
  • Captured body read completely: The fetched body exactly matches the captured snapshot: 13,583 UTF-16 units and SHA-256 d02d61ebe458afee7513e6c2a4332857ea0e7ef4501e856f99e279f58469f8b2. The previously omitted tail retains all failed phase measurements and explicitly says final repaired medians remain pending. (6ab6119e8562)
  • Performance qualification remains unresolved: The completed alternating comparison measured ten warmed turns at 23,169→23,228 statements and control plus cron at 1,889→1,928. These are historical pre-repair failures, not measurements of this head. The accepted exception covers only four first-turn schema-admission statements; it does not authorize warmed-turn growth. Focused pairing and cleanup results address the prior coverage request, but replacement workload medians and attribution remain pending. (6ab6119e8562)
  • Authority and shutdown ordering: Client preparation joins accepted identity work and checks its aborted lifetime before opening transport. Sharing prepares the codec before the authoritative row read, rereads after a late cold preparation, and checks management authority at commit. Goal mutations and APNs consumers recheck current authority after identity preparation. Foreign-owner and revoked-cleanup tests exercise refusal before disclosure or deletion. (src/gateway/client.ts:320, 6ab6119e8562)
  • Cleanup and stored-state compatibility: Cleanup uses a private operation cache under the existing lifecycle lease, shares one installed-index payload, and retains malformed-receipt protection and live deletion checks. The diff changes candidate enumeration and preparation, not marker writers, persisted fields, schema versions, retention criteria, or identity bytes. The recorded published-driver update passed on the original candidate; later cleanup coverage includes legacy layouts and native captures. (src/gateway/server-retained-plugin-cleanup.ts:47, 6ab6119e8562)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • fuller-stack-dev: 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.

  • Complete the agreed alternating SQL comparison for the integrated source, including both previously failing phase conditions.
  • Complete the fresh integrated SDK comparison against d72a907.

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 (13 earlier review cycles; latest 8 shown)
  • reviewed 2026-10-07T12:42:37.733Z sha d6298c8 :: blocked before merge. :: none
  • reviewed 2026-10-07T13:00:46.483Z sha d6298c8 :: blocked before merge. :: none
  • reviewed 2026-10-07T13:38:30.636Z sha d6298c8 :: blocked before merge. :: none
  • reviewed 2026-10-07T13:51:41.392Z sha 77ecbf1 :: blocked before merge. :: none
  • reviewed 2026-10-07T14:09:33.444Z sha 77ecbf1 :: blocked before merge. :: [P2] [P2] Route the reachability suite through the host-broker test owner
  • reviewed 2026-10-07T14:33:46.712Z sha c1e9bbf :: blocked before merge. :: none
  • reviewed 2026-10-07T15:24:57.540Z sha c1e9bbf :: blocked before merge. :: none
  • reviewed 2026-10-07T17:24:17.164Z sha 823ac87 :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 7, 2026
@steipete

steipete commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 7, 2026
The transcript append checkpoint precedes final session metadata writes. Join
the real session-work admission before asserting a stable public response.

Reuse the fixture correction prepared for #166293
(1444b89); keep the public-read and permission assertions unchanged.
@steipete

steipete commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

The real-socket service-auth probes now reach asynchronous identity admission. Select the existing fork-based worker test owner so the unchanged cases retain real broker admission, socket behavior, and read-only assertions.
@steipete

steipete commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Oct 7, 2026
@steipete

steipete commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete
steipete merged commit de7c3b7 into main Oct 7, 2026
180 checks passed
@steipete
steipete deleted the dbasync/w6device branch October 7, 2026 18:34
@steipete

steipete commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

scribe-dandelion-cult added a commit to karmaterminal/openclaw that referenced this pull request Oct 7, 2026
8 upstream commits. One conflict, in src/infra/heartbeat-runner.ts:
upstream openclaw#166539 (de7c3b7) dropped the resolveHeartbeatSchedulerSeed
re-export and keeps re-exporting runHeartbeatOnce/startHeartbeatRunner. The
feature defines those two locally as wrappers over the split runner, so the
resolution keeps the feature side and follows upstream's removal of the
seed re-export; nothing imports it through this module. The worker access
inventory is regenerated for this tree.

Checks, all on the canonical runner:
- Typecheck: core plus test shards infra and gateway-methods, all clean.
- Ratchets: assertion-safety OK; database-worker ratchet OK.
- Tests: src/infra/heartbeat-runner*.test.ts plus sessions-sharing
  (+authority), 33 files, 361 tests, all green.
  heartbeat-runner.live.test.ts is excluded by config (*.live.test.ts) and
  byte-identical to upstream.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Jhynq2GVpzuVQQieebEubg
steipete added a commit that referenced this pull request Oct 8, 2026
Culprit de7c3b7 (#166539) moved health device-identity reads into the
shared SQLite worker. The threaded wizard fixture lacks its host broker.
Register the unchanged test with the existing isolated fork-based owner,
preserving real health authentication and ambient-endpoint isolation.

Validation: focused finalization/health/Doctor tests, whole wizard and
unit-fast configs, registry and planner guards, full test-types, typed and
boundary lint, complete check-changed, four real manifest shapes, and P2.
Whole tooling completed with 941 files passed and 7 skipped; its sole
failure is the inherited logging-suppression inventory from #166701.

Full infra config gate waived by coordinator: fleet at cap; registry/planner/tooling proof passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 8, 2026
…d worker (openclaw#166539)

* refactor(device-identity): admit runtime identities through the shared worker

Move live client, call, sharing, goal, APNs, and monitor identity preparation off the caller thread while retaining read-only discovery, process caches, boot/Doctor paths, and accepted client settlement. Reuse the existing shared-state owner and avoid a redundant warm freshness lookup.

* fix(device-identity): preserve probe helpers and monitor service types

* fix(device-identity): refresh sharing facts after codec admission

Keep warm codecs synchronous and authorize against a fresh session row after cold identity preparation. Reject ownership changes during codec loading, including foreign publication that was absent from resident sharing facts.

* test(device-identity): isolate CLI drain and probe credentials

* test(device-identity): isolate transport fixtures from identity admission

* test(gateway): wait for child settlement before public reads

The transcript append checkpoint precedes final session metadata writes. Join
the real session-work admission before asserting a stable public response.

Reuse the fixture correction prepared for openclaw#166293
(1444b89); keep the public-read and permission assertions unchanged.

* test(cli): run reachability probes with the host broker

The real-socket service-auth probes now reach asynchronous identity admission. Select the existing fork-based worker test owner so the unchanged cases retain real broker admission, socket behavior, and read-only assertions.

* perf(state): reuse pairing freshness and synchronous chat validation

* perf(plugins): avoid idle cleanup writes and reuse inventory facts

* refactor(plugins): name lazy cleanup import
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 8, 2026
Culprit 8b189ec (openclaw#166539) moved health device-identity reads into the
shared SQLite worker. The threaded wizard fixture lacks its host broker.
Register the unchanged test with the existing isolated fork-based owner,
preserving real health authentication and ambient-endpoint isolation.

Validation: focused finalization/health/Doctor tests, whole wizard and
unit-fast configs, registry and planner guards, full test-types, typed and
boundary lint, complete check-changed, four real manifest shapes, and P2.
Whole tooling completed with 941 files passed and 7 skipped; its sole
failure is the inherited logging-suppression inventory from openclaw#166701.

Full infra config gate waived by coordinator: fleet at cap; registry/planner/tooling proof passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts security-sensitive-changed size: XL 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