Skip to content

refactor(cli): deslop CLI and fix Gateway presence publication - #159554

Merged
steipete merged 5 commits into
mainfrom
deslop/l113-cli4
Sep 28, 2026
Merged

steipete merged 5 commits into
mainfrom
deslop/l113-cli4

Conversation

@steipete

@steipete steipete commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Merged as ae602ac11e99ddafae39f53963093cab3b5c0eb7 from head 1eb731364351b6fd8df0ec2fab15051f7d9705ff under the authorized pre-existing CI failure exception. Merge ancestry and the reconstructed pinned-head tree were verified on main.

What Problem This Solves

Maintainer-requested fourth-pass CLI cleanup removes repeated command preparation, argument handling, rendering, and forwarding code left after the earlier CLI sweeps.

User Impact

The CLI simplifications preserve commands, flags, help text, output formats, exit codes, and configuration writes. The follow-up Gateway repair prevents a failed hello from briefly publishing a connected client, while retaining its own hello snapshot and disconnect cleanup. HTTP watch-node replacements also retain visible presence. No configuration migration is required; the Gateway correction is the release-note context.

Why This Change Was Made

  • Centralize local capability config, agent, and account-secret preparation; reuse the TTS command output owner and shared lazy model loader.
  • Keep config-set mode selection with its input owner, share route value-flag validation, and match patch replacement paths through their existing serialized identity.
  • Share directory lookup lifecycle, skill/hook requirement rendering, plugin inspection sections, and repeated daemon status output.
  • Use canonical node media coercion, PID discovery, and invocation payload construction; remove the Gateway health route's test-only dependency injection while retaining its lazy imports.
  • Remove repeated container parsing, attachment target projection, plugin-policy messages, and startup-progress finalization guards already owned by the progress reporter.
  • Simplify updater clone collision handling, tag projection, Windows authority callbacks, and checks already enforced inside child custody. Published-driver entrypoints, update admission, rollback, service ownership, and configuration behavior remain intact.

This is a below-threshold sweep after full source coverage. The earlier merged passes were #156622, #157748, and #158514. Their file lists were inspected first; unchanged code retains its named runtime or public contract rather than being compressed to meet a line target.

Evidence

Final head 1eb731364351b6fd8df0ec2fab15051f7d9705ff preserves the reviewed production tree and adds five test-fixture corrections over 5a1193657fd16e9d5aa255a6052b969964f8a895. Source tree: fa719f78174fc59a8dc92b67842d36a43254fff6. The fifth rebase remains the final rebase; no additional main integration was performed.

  • The failed config audit test seeded files while an independent watcher could publish their environment during an approved write. An unchanged original-order replay passed in 250.07 s; that replay is not a fix claim. A controlled run with the real watcher then advanced environment generation 1 to 2 inside write preparation and reproduced the exact ConfigMutationConflictError at the unchanged generation fence. Only this three-layout audit table now disables file notifications. Real managed preflight/application, include/root ownership, journals, and every existing assertion remain active.
  • The browser failure happened during fixture startup, before the download request. Its free-port probe closed the listener before real startup, and the helper discarded startup refusal before retrying fetch. The fixture now hands the same bound OS listener to the real Express app and cleans up unconsumed reservations. The existing download test proves a competing bind receives EADDRINUSE, then retains its route assertions. Restoring only the original reservation helpers makes that assertion fail because the competing bind succeeds. The original CI startup diagnostic was suppressed, so this proves and removes the allocation gap without claiming its historical bind error was captured. The standalone production occupied-port/auth tests remain unmocked and passed; startup fetch retries were removed.
  • Blacksmith Testbox tbx_01m3m1ach9r8wz6a8sfrxvsvd3 (run 36424932156) verified the candidate tree. Both negative controls failed for their intended reasons; their temporary source edits were restored byte-for-byte. The repaired original config shard passed 85 cases (with four existing Windows-only skips) in 254.36 s, the 29-file browser selection passed 739 cases (one existing skip) in 66.18 s, and the two additional browser boundary files passed 13 cases in 34.70 s. Standalone costs using pnpm test <file> --maxWorkers=1: config audit file 81/81, 153.33 s; browser command file 50/50, 32.19 s.
  • Scoped changed checks: passed in 1,825.15 s, including structural guards, core/extension test types, dead exports, lint, and six guard tests; the full invocation exited 0. Fresh independent Codex review is scoped-clean through P2. Prior completed production/CLI proof, build, and 332-path help comparison remain valid for the unchanged production source. Net branch delta: 504 lines removed, 1,038 added / 1,542 deleted across 89 files.
  • Observed hosted case-time sums on the preceding head (not file wall time): hello-order 8.373 s; ws-connection 0.398 s; Control UI admission 1.836 s; post-connect-health 12.616 s; suspension admission 0.629 s; system-presence 0.265 s. All 136 cases passed. The Control UI admission and system-presence jobs were later cancelled elsewhere and are not reported as successful jobs.
  • Exact-head CI 36436801585 concluded cancelled: 70 successful jobs, 76 fail-fast cancellations, 21 skips, and the planner failure plus aggregate gate. Sole failing test check: checks-node-compact-small-22, job 108978080578, ci-changed-node-test-plan.integration.test.ts > retains every PR-exempt file in hourly and release plans with its canonical owner, timed out at 120,000 ms. The successful PR failure monitor cancelled siblings; cancelled work is not passing coverage. Security-fast, security-sensitive review, and dependency review passed.
  • Pre-existing-failure qualification: unrelated perf(sessions): keep cold snapshots out of metadata reads #160358 remains on current head 83fb0337e8bc28ddef4071c78abc35f0b9fa492d; run 36432996490, job 108964699374, fails the identical case with the identical 120-second timeout. Test and planner owner bytes match between its main parent 3e0def1451b31ce1208c5b3665cd13f19e2ea029 and our tested main cbc0f01aa24d0b5a3edf555d4f9ced01aad5f2ba. Our tested merge is f069bc39115afb434259d34abe9077cf8c798413. Inspection found zero PR-changed paths in its 175-file executable import superset or 906 present PR-exempt test paths; this case enumerates those tests without importing/running them. Repository source is also indexed as metadata, so blanket input-byte disjointness is not claimed.
  • Pinned squash completed using that inherited-failure exception and the passing Testbox proof above. git merge-base --is-ancestor confirms the merge commit on refreshed main. Earlier planner fixes fix(ci): keep PR-exempt ownership proof within its timeout #160408 and fix(ci): prevent leaf-config ownership check timeouts #160458 were already present in both failing runs; the remaining unmatched-source parsing cost is now owned by active draft fix(ci): avoid parsing unmatched test consumer sources #160507 and overlapping fix(ci): reduce PR-exempt ownership check runtime #160517. No duplicate repair or competing landing was started. All identified leases are stopped; native source staging is removed.
  • New-head hosted case sums before cancellation: config-patch six recorded passing cases, 59.996 s; browser contract all 50 recorded passing cases, 2.021 s (the repaired relative-download case: 17 ms). These are not complete-file wall times or successful-job claims.

Fifth rebase candidate: 5a1193657fd16e9d5aa255a6052b969964f8a895, onto 809b62cc7e49b9e34720eff64a2170c3d1ae1b54, source tree b70018b9789d9dc754448bc4db63388132e039f2.

  • Kept/dropped: all four commits replayed patch-identically without conflicts; no additional hunks were dropped. Main's new assertRecoveryCurrent Windows recovery-authority check is retained unchanged alongside the equivalent shared service-guard callback. Net: 547 lines removed, 950 added / 1,497 deleted across 84 files. Earlier conflict resolutions and dropped hunks remain recorded below.
  • The fourth-round changed check failed because two unchanged package-update tests imported the now-private assertReliabilityForcedExit. Existing main repair da2efd83b8a689572803d31c740fd700d0f0a907 restores that export and is included here. No duplicate fix was added. The coordinator's renewed old-head auto-merge request was retired before this rebase.
  • Changed checks and selected tests passed on the exact candidate source. Blacksmith Testbox tbx_01m3kjgp288d94grwg5w44aan6 (run 36398343273) passed node scripts/check-changed.mjs --base 809b62cc7e49b9e34720eff64a2170c3d1ae1b54 --head HEAD --timed in 2,410.60 s, plus routed configurations 0–9. SSH then ended with exit 255 before configuration 10 produced a result; this invocation is not represented as wholly successful. Its lease completed and was stopped.
  • Only unfinished work resumed on Blacksmith Testbox tbx_01m3ksxkx9619034k2g93cf32e (run 36411610444), again verifying the candidate SHA and tree. The resumed invocation exited 0; the lease is stopped. Combined first completed results across 17 CLI/direct-importer/owner/boundary configurations: 673 passing files / 12,781 passing tests, with three skipped files and 52 existing skipped tests. This includes import-boundary coverage and all 106 CLI E2E cases. Main CLI: 419.10 s; serial CLI process configuration: 1,459.48 s.
  • The Gateway handshake suite passed 20/20 standalone runs (four cases each). The original packed CI shard passed 3/3 repetitions, in 686.34 s, 703.78 s, and 677.53 s. These repetitions supplement the negative controls and owner-level causal proof below; they do not erase or relabel the earlier failure.
  • Blacksmith Testbox tbx_01m3kx735tzwjr3pmrx682e5fj (run 36417333538) passed the candidate build in 377.89 s and the pinned-base build in 347.54 s. 332 before/after help paths matched in exit code, stderr, and text: 325 byte-identical, seven differing only in the exact known build-commit banner. Isolated empty config/state was used; no other normalization or mismatches. The invocation exited 0. The lease is stopped.
  • Fresh Codex review completed through P2 with no accepted actionable finding. Raw review findings and their source-based rejections remain documented below. The four replayed commits are patch-identical. Main through 526f67dc6382bae28cb26231b0813ce755521d80 had no changed-path intersection. Fresh main 2da0e9a4c85b4976d0c6ac56b3dab57e88f859f6 merges cleanly as tree 99bf0f36d061614326ade4a8db89ea380d6a839e; its sole intersecting file, server-lifecycle.ts, changes notification scheduling and old timer cleanup in separate hunks. Those incoming changes and this PR's presence callbacks remain intact. No equivalent presence repair was found on main.
  • The explicit old-head force-with-lease push succeeded. CI run 36422188594 attached to exact head 5a1193657fd16e9d5aa255a6052b969964f8a895 and completed with 104 successful jobs, two failing test jobs plus the aggregate gate, 31 fail-fast cancellations, and 20 skips. The run conclusion is cancelled, not passed. checks-node-changed-compact-small-21 failed the include-only operation audit case in server.config-patch.test.ts with ConfigMutationConflictError: active config environment changed while preparing write. checks-node-changed-extensions-bundle-13 failed browser download fixture startup with ECONNREFUSED. Neither failure is currently claimed as qualifying inherited evidence. The original Gateway shard is replaying on owned Blacksmith Testbox tbx_01m3m1ach9r8wz6a8sfrxvsvd3 (run 36424932156); no merge has been requested.
  • Gateway test wall costs from final-path Testbox runs using pnpm test <file> --maxWorkers=1: hello-order 23.807 s (four cases), ws-connection 15.238 s (37), control-ui-build-admission 20.769 s (two), post-connect-health 33.718 s after unchanged helper extraction (63), suspension-admission 16.279 s (11), and system-presence 1.635 s (19). Hosted timings are being extracted from the completed run without treating cancelled work as coverage.

Historical fourth rebase: 45a746bab1d0cd1e8cb18bfc397e5dee7a3ac72f onto ff8c752d852f5d01da5a8a5e6abb7546c1328e83. All four commits replayed patch-identically; no additional hunks were dropped. The inherited attachment line-cap failure was repaired on main by 2e95cdba84c2 (#160159), with duplicate-export cleanup bb05e779e2a7cef13417cdc7cd06291627cb2cb0; no duplicate UI fix was added. Its lease is stopped. Gateway review's stale-disconnect and shared-node-callback findings were rejected against unique operator keys, exact-current node unregister, and the HTTP-only callback owner. Independent caller inspection corrected HTTP replacement readiness and a missing mock export. The extracted helpers preserve their bodies and timing. Later complete proof supersedes this round's partial checks.

  • Exact-head CI 36374729522 completed with six failing test jobs (plus the aggregate gate). Checkout/planning fixtures and native-child preload failures are repaired on main by b9cd492ac60fe4cd5924fe6faa3962df9659ee29 (fix(tooling): enforce Linux process-tree memory limits #160024); the packaged-worker fixture also has 995048d9a9b8c2ca29e0715cf541c51b94154d44 (fix(test): prevent Vitest preloads from breaking packaged workers #160069). No duplicate fixture repair is being added.
  • Matching inherited evidence: main full run 36374799305, head 6d684b94eae486bc4cc8ee4d7e2f5847f21d4ae3, repeats all seven checkout mismatches in job 108778486718 and all four database-verifier exit-1 failures in job 108778488172. Unrelated fix: stop worker provisioning effects after host authority closes #159178's current head c9921022529005400c41de6580dfabc99b7948dc, run 36375622410, repeats all 17 missing ci-static-step.sh planning failures in job 108781143704. The exact packaged-worker failure was found on an older unrelated head only, so it is not claimed as qualifying current-run proof.
  • Gateway hello-order also fails identically on unrelated fix(daemon): retry a transient SQLITE_IOERR owner-lease read after schtasks /End #159297's current head 4880c84c8d03caf123eb194cbb757b13895c5544, run 36296893094, job 108558354184. However, its import path reaches this PR's changed core-command-descriptors.ts and subcli-descriptors.ts; those edits only affect types/comments, but the operator's strict no-overlap exception is not met. Landing remains held for a repair.
  • The next rebase onto 246e575c929fa43dc13d8cdf65c7fea4faf975e9 replayed all three commits patch-identically with no conflicts: all prior simplifications were kept, no additional hunks were dropped. The known fixture repairs are incorporated. The new Gateway fix keeps a connecting row private until hello delivery and forces the overlapping-broadcast race in the retained registered WebSocket test. The deferred-WebSocket regression failed both cases on the original code and passed with the repair; 173 owner/sibling cases passed. Final-path cost runs passed all 136 cases, including the real HTTP handoff, and the HTTP negative control failed as intended when publication readiness was withheld. All 106 CLI E2E cases passed. The first changed-check attempt caught four lines of growth in an already oversized test; its existing backend-client and wait helpers were moved verbatim into the existing support module, preserving every assertion and timeout. Remaining validation is in progress; no final-head pass or merge is claimed yet.

Current candidate: 571cc7e95aedfe00facbf564dcb2b2c467b8da6b, rebased onto 38dbd361b708a1fd53e123cebc3fda7ffbc7e471. The coordinator's auto-merge request was retired and its absence verified before this rebase.

  • Kept: all equivalent CLI simplifications. Main's unmanaged restart fix verifies the listener/lock/owner before probing, revalidates after probing, and fences delivery; that ordering is retained. Both listener lookups use findVerifiedGatewayListenerPidsOnPortSync, whose existing finite/positive/self-PID filtering makes the removed wrapper redundant. The complete call-site cutover retains main's new safeguards.
  • Dropped: the incoming pre-verification restart-probe placement; main's verified-target ordering wins. The provider-error assertion correction in help-exit.process.test.ts is already on main, so it drops out of this branch's diff. The previously retired Tasks/TaskFlow paths remain absent.
  • Net: 697 lines removed across 71 files: 745 added / 1,442 deleted. Production: 602 removed; tests: 89 removed; assertion baseline: six removed.
  • The base includes the stale Bun smoke assertion repair in da6e11cf802afb8946cae58cf60f6eb14a1d914a (fix(android): align Play Store icon with the app #159964), replacing the source-string assertion with an executed candidate-version mismatch fixture. No duplicate repair was added.
  • Independent Codex review completed through P2. Its QR-credential precedence finding was rejected against the complete command: supplying both CLI credentials is rejected before configuration loading, and main already prioritizes a configured remote token over a configured remote password. The existing registered-command rejection test is retained and passed in the CLI suite. No actionable finding remains; the reviewer report was not relabeled as a clean report.
  • All requested Testbox proof passed on exact source tree 579e5513568c598c087e334c1e83d94fb2b6de6b, Blacksmith Testbox tbx_01m3jtpgw6vy3hjtzxbdmbtcm3 (run 36366849818), Node 24.19.0. The full invocation exited 0. git diff --check passed; check-changed --base origin/main --head HEAD --timed passed in 1,645.77 s; all 17 routed CLI/direct-importer configurations passed: 640 files / 12,310 tests, with three skipped files and 52 existing skipped tests. Import-boundary coverage passed. The serial process configuration passed in 885.33 s; main CLI in 331.75 s.
  • The unchanged eight-file E2E selection passed 106/106, including the formerly failing ClawHub telemetry-unavailable install-record case. This base includes stale-worker-generation repair fix(state): retire stale workers before replacement admission #159944; the new pass demonstrates current-head behavior without claiming to prove the older failure's exact cause. No cache clearing, assertion weakening, or test retries were added.
  • Candidate build passed in 412.55 s; baseline build passed in 367.86 s. 332 before/after help paths matched in exit code, stderr, and text after normalizing only the exact known build commit in the banner. Of those, 325 were byte-identical and seven differed only in that build hash; there were no other mismatches. Both sides used isolated empty configuration/state.
  • The Testbox lease has been stopped. Fresh-main merge simulation was conflict-free before publication. The explicit old-head force-with-lease push succeeded. CI run 36374729522 is attached to exact head 571cc7e95aedfe00facbf564dcb2b2c467b8da6b and completed with failures diagnosed in the latest entry above. Auto-merge became enabled externally after the push; this task did not arm it and explicitly retired it before the new repair.

Earlier-head evidence below is historical and does not replace this candidate's proof.

Rebase refresh: 0e068d83786921cc374de9518aecbadfc63705db onto 8bfc0ce8e1f982974c92a8177a7726eadb743b88. Rebase only; the coordinator auto-merge request was retired before replacing the head. No merge or re-arm was requested.

  • Kept: all still-equivalent CLI simplifications and both existing follow-up fixes. The descriptor uses the shared NamedCommandDescriptor type, surviving routes keep shared value-flag parsing, and Gateway mode diagnostics retain identical bytes. Main's Gateway config-read and startup-failure behavior remains intact. The two follow-up commits replayed patch-identically.

  • Dropped: retry/dismiss registration consolidation and list/audit parser simplifications for Tasks/TaskFlow, which main intentionally removed in refactor: remove Tasks and TaskFlow runtime #159179. The Tasks descriptor, registration file, and route exports remain absent. No retired path or test was restored.

  • Net diff: 697 lines removed, 745 added / 1,442 deleted across 72 files. Production: 617 added / 1,219 deleted (602 removed); tests: 125 / 214 (89 removed); assertion baseline: 3 / 9 (6 removed).

  • Fresh independent Codex review is scoped-clean through P2. The first diff-only review questioned two removed outer updater checks; supplying the complete custody and executor owners confirmed that termination, killed-process, and unsettled-cleanup rejection still occurs before returning a result. No code change was needed.

  • Exact source tree f3a8ba533f33584467fb85a84e5ffa94db8bc978 was verified on Blacksmith Testbox. check-changed --base origin/main --head HEAD --timed passed the early guards, graph boundary, and production typecheck, then failed at unchanged src/agents/tools/media-generate-background-retention.test.ts:233 (TS2554: the spy omits the worker-owner callback argument). Test and reader blobs match the rebase base exactly. Repair fix(ci): repair stale core test fixtures #159836 owns this defect and has now merged as 0b6f02faae371776d8bfdb5b4f3a7696ee50e34b; no duplicate fix was added to this frozen candidate. Command wall: 316.87 s. Check Testbox run. Lease tbx_01m3j2wfef2fnjfyrmrbg3h6jm stopped.

  • Baseline build passed (380.20 s), candidate build passed (406.70 s), and 332 before/after help paths retain the same behavior: 325 captures are byte-identical; the other seven differ only in the expected build commit hash in the cached help banner. All stderr and exit codes match. Each of the seven raw diffs was inspected. Build/help Testbox run, lease tbx_01m3j4ndszkee1kddac1gkb4q9, stopped. The wrapper returned nonzero because the raw comparator deliberately reported those metadata differences and an earlier selection helper failed; those exits are not reported as fully green commands.

  • Cross-shard CLI/direct-importer validation: 16 configurations passed, covering 632 passing files / 12,587 passing tests, with three skipped files and 52 existing skipped tests. This includes import-boundary selections, the serial CLI process configuration (982 passing tests; 1,047.93 s), and the main CLI configuration (8,430 passing tests; 386.37 s). The source stayed fixed throughout. Earlier Testbox run; outage-recovery Testbox run. Lease tbx_01m3j5fa979ye115b852yb8m5s completed after a transport exit 255 during CLI process tests; a fresh owned lease reran that unfinished configuration and the remaining selections. Completed configuration evidence was retained. Recovery/E2E lease tbx_01m3jfqeykv4xtzhn42gwn3tc2 is stopped; all task-owned leases are stopped or completed.

  • The eight-file E2E selection completed with 105 passed / one failed: plugins-cli.clawhub-install.e2e.test.ts, “keeps a valid local install successful when telemetry is unavailable,” returned child exit 0 but then read no persisted install record. The test and examined install/read/cache/telemetry owners are unchanged by this candidate. The identical failure is documented in refactor(cli): reuse environment snapshots in tests #159669's run 36322636530; that PR is an investigation reference, not a known fix. Its equivalent environment-restoration test refactor does not change those production owners. This supports an inherited integration failure, but its mechanism remains unproven. A same-selection replay reproduced the identical failure: again 105 passed / one failed. First E2E command wall: 658.16 s; replay: 601.46 s, including the wrapper-owned E2E build prerequisite. The original failure remains unresolved; no speculative fix was added. Across the selected tests, the first completed results are 12,692 passed / one failed / 52 skipped. git diff --check also passed remotely.

  • Discarded proof-harness attempts encountered an overbroad graph/deleted filename filter, a file-list buffer limit, and mismatched assumptions about the router's ordinary/E2E selection shapes. Empty or aborted selections are not counted as passing proof. The final selection contains 643 test files across 17 configurations; the last E2E configuration runs directly through the repository wrapper.

  • The state-migration plugin-execution refusals owned by fix: state migration leases target a retired database #159757 and published-upgrade WhatsApp Doctor source-identity failure owned by fix(plugins): prevent WhatsApp Doctor failures after updates #159650 remain outside this rebase. Owner states were refreshed after outage recovery: fix: state migration leases target a retired database #159757 remains open and fix(plugins): prevent WhatsApp Doctor failures after updates #159650 is merged. No duplicate repair or published-upgrade rerun was attempted here.

  • Force-push with an explicit old-head lease succeeded. CI run 36360757192 is attached to exact head 0e068d83786921cc374de9518aecbadfc63705db and was queued at handoff. GitHub reports the PR open and mergeable. This task did not re-arm auto-merge or request a merge. A subsequent remote observation showed auto-merge enabled by another session; that request was left with its owner.

Prior-head evidence and campaign history follow; they do not replace the current-head results above.

  • Independent Codex autoreview: scoped-clean through P2. The refresh onto d760c81b9e7c4d8c4851efce7da124bb6d9e8d53 dropped four comment removals already on main. Refreshes through 96a91f0e005ef02d95c3249249839ad6c4df64f8, including the filesystem boundary and SQLite worker repairs, are patch-identical. The CLI source tree is unchanged by the last refresh.
  • Production: 617 net lines removed (640 added, 1,257 deleted). Tests: 89 net lines removed.
  • Blacksmith Testbox tbx_01m3gw7r3jnttcqyn4rcv154k2: baseline build passed (412.7 s), candidate build passed (395.7 s), and 571 before/after help invocations matched exactly in stdout, stderr, and exit code (563.6 s). Testbox run. Lease stopped.
  • Initial cross-shard selection stopped in its first shard on four stale source-wiring assertions. The guard now recognizes the canonical capability-agent preparation owner; its existing target-scope checks remain. The assertion-safety ratchet was reduced to the measured counts after cast removal.
  • Testbox cross-shard CLI/importer selections have passed across the 12 routed configurations, with corrected fixtures re-proved separately. This includes src/infra/fs-safe-import-boundary.test.ts, the plugin/test-helper boundary siblings, and src/flows/doctor-health.legacy-update.test.ts in its infra owner. The remaining CLI config passed 409 files / 8,416 tests; the E2E config passed 8 files / 106 tests. The original process-shard failure is addressed below.
  • The correction-scoped node scripts/check-changed.mjs --base 8620e9097726a817be6bd8f9385a14a54e24f89d -- <correction files> passed (1,267.71 s): formatting, every typecheck shard, all dead-export scans, lint, and guards. The earlier full selection passed its non-lint gates and exposed the inherited line-cap failures listed below.
  • pnpm update:compat:check passed the published 2026.9.1–2026.9.6 inventory. The final build passed (359.94 s), and the credential-free published-driver upgrade-survivor base cell passed (672.49 s) on Blacksmith Testbox tbx_01m3h8s1x912ps58k12ht74apm (run). Its synced source tree is 02406e7486983a0f7aaa44aed81810abf13aca25, identical to pre-rebase head 14f265708dda0d286757983f93408a4889a15c7b. The published baseline resolved to 2026.9.6; its installed updater applied the candidate tarball, preserved seeded state and unavailable-plugin config bytes, repaired dependency debris, and passed Gateway health/readiness/status. Installed and candidate manifests match across all 11,193 files. Lease stopped.
  • Pre-rebase exact-head CI passed in run 36317484406. The next refresh exposed upstream refactor: reuse fs-safe for directory scans #159603's direct filesystem-package import in file-transfer. Separate repair fix(file-transfer): preserve plugin filesystem boundary #159654 passed its original-source control, 25 boundary tests, 354 plugin tests, checks, build, and CI; it merged as e8b091921ef03a016985cbb9a55abf0766470773 during closeout and is included here.
  • Later CI run 36323378481 hit the unchanged Doctor migration fixture. Replaying its original 46-file selection at eight workers and Node 24.21.0 produced one unexpected lease-step throw across three attempts; five additional diagnostic attempts passed without capturing the original cause. This was not treated as a fix. Upstream e52420e1eea then repaired the canonical owner: cached workers must retain current original admission even when their inode matches, and fixture teardown must await agent/shared workers before deleting roots. Its real-worker relocation regressions are included here; no duplicate patch was added.
  • Current head 7fd67af9deb31b69efd755b89f07246a591b7cbe passed the fixed worker suite (33 tests), 20 consecutive migration-file runs (23 cases each; 797.11 s total), three original eight-worker shard runs (490 passed / two existing skips per run; 135.69 / 128.18 / 127.83 s), and all import-boundary siblings. Full checks passed (1,602.77 s), build passed (365.25 s), and the compatibility inventory passed (1.27 s) on Blacksmith Testbox tbx_01m3hq1ey26wv5p1p2py1jps07 (run), Node 24.21.0, four actual CPUs / 16.6 GB RAM. The shard worker setting matches CI; this Testbox has fewer CPUs than the original CI host. The published 2026.9.6 driver completed package activation, then Doctor failed to load WhatsApp with Plugin source changed while preparing its reload (650.01 s cell wall). This is the exact default/manual upgrade defect owned by fix(plugins): prevent WhatsApp Doctor failures after updates #159650, whose final candidate has matching published-driver proof. Its repair is still open; no duplicate patch or blind rerun was made. This lane's lease was stopped after retaining the failed summary.
  • CI run 36328898707 exposed the corrupt PNG in the unchanged Windows media-file-URL fixture. Our alternative repair test(agents): use a valid PNG for Windows media URLs #159770 passed exact-head CI (including the actual Windows case, 1.314 s), four image-worker tests, 25 boundary tests, full checks (247.53 s), and build (379.42 s) on Blacksmith Testbox tbx_01m3hvvc8r30qa44fk1cn00mpf (run); that lease is stopped. Ayaan Zaidi's equivalent test(media): use a decodable PNG in the Windows media tool test #159771 landed first as 7969275f362caa4fb5326f0059dbaf1024e459b4, so test(agents): use a valid PNG for Windows media URLs #159770 was closed unmerged. Current-main ancestry and the retained replacement fixture were verified. The next CLI refresh will incorporate that repair.
  • Earlier CI caught three lint diagnostics, then finalizer call-count assertions and a stateful getter fixture. The lint hunks were reverted to preserve strict wire validation and error shape. The progress tests now assert completion before parsing and real spinner stream routing; the progress owner still covers duplicate completion and newer-line safety. All corrections received clean independent review through P2 and remote proof.

Changed-test wall cost on Testbox using pnpm test <file> --maxWorkers=1: capability CLI 24.07 s; command-secret targets 15.28 s; config-set mode 1.38 s; lifecycle fallback 1.73 s; Gateway health route 1.78 s; nodes media utilities 1.25 s. The source-wiring guard measured 14.27 s; the corrected process fixture measured 72.39 s. Its existing 29-case subprocess matrix proves actual process exits, output draining, and JSON envelopes; only one expected diagnostic changed. Progress rendering measured 2.13 s (15 tests), and CLI exit behavior measured 19.53 s (203 tests). A negative control removing pre-parse completion fails the strengthened ordering assertion; the original source was restored and its hash verified. These changes retain existing boundary coverage; no real timers, retries, or weakened assertions were added. Hosted case-execution sums from CI run 36313555292, which exposed the progress fixtures corrected above: capability CLI 15.433 s; secret targets 0.860 s; lifecycle fallback 0.018 s; Gateway health route 0.331 s; progress 0.089 s; CLI exit behavior 21.922 s. These sums exclude collection, transformation, startup, and file teardown; whole-file CI wall time was not retained.

Fixes found along the way: the process test for an unknown model provider still expected the old generic error after #159237 intentionally added the rejected provider and recovery command. The fixture now checks the current exact diagnostic; its JSON envelope, clean stdout/stderr, ANSI/BEL, and exit-code assertions are retained. The two expected failures were reproduced on clean base 8620e9097726a817be6bd8f9385a14a54e24f89d; the corrected full process file passed all 29 tests (72.39 s). No product behavior or retry policy was changed.

Inherited main failures during the first full check: the untouched task-settlement test helper exceeded its line cap (811 counted lines), as did session row projection (701). Their fixes subsequently landed in #159584 and #159473; both are included by the final rebase. No duplicate fixes were added to this lane. The first lease expired before executing a check, and the first review route had expired authentication; both were recovered through their existing owners.

Coverage: all 161 production CLI files over 200 lines, verified against the final CLI head and sorted by original size
Base LOC Production file Coverage Finding
1639 src/cli/run-main.ts READ Removed a second progress-completion guard; createCliProgress owns idempotence. Retained startup, proxy and plugin resource lifetime ordering.
1439 src/cli/exec-approvals-cli.ts READ Retained target-specific approval protocols, exact-id escaping, stale-write guards and distinct snapshot rendering; prior pass already consolidated allowlist mutation actions.
1421 src/cli/mcp-cli.ts READ Unified timeout field translation and stat-kind validation; removed unused doctor path and duplicate JSON write; transport/OAuth/probe ownership retained.
1400 src/cli/gateway-cli/run-loop.ts READ Retained: signal admission, parked update ownership, deadline handoff and restart recovery encode distinct lifecycle contracts.
1219 src/cli/skills-cli.ts READ Removed narrating comments; strict verification of unvalidated ClawHub JSON, workspace/Gateway fallback and workshop revision boundaries remain explicit.
1124 src/cli/gateway-cli/run.ts READ Applied: removed generic natural-language mode formatter and unreachable small-list cases; fixed CLI error strings stay identical.
1111 src/cli/devices-cli.runtime.ts READ Reused normalized identity matching for replacement requests, consolidated optional client-metadata comparisons and collapsed the pending-device label branch.
956 src/cli/command-secret-gateway.ts READ Collapsed duplicate forced-active compatibility failure handling and removed unreachable empty-target classification; preserved scoped local fallback and diagnostic output.
918 src/cli/plugins-cli.runtime.ts READ Prior passes already consolidated enablement and marketplace projection; registry refresh, diagnostics disposal, and runtime application retain distinct receipts and failure behavior.
902 src/cli/plugins-authoring-command.ts READ Removed trivial path/string forwarding helpers; unified required text normalization and narrowed scaffold type via successful lookup; generated artifact bytes preserved.
859 src/cli/gateway-cli/register.ts READ Retained: prior passes own action wrapping; query-specific parsing and diagnostics output remain distinct.
786 src/cli/logs-cli.ts READ Unified duplicate plain Gateway-unavailable predicates; removed padding immediately trimmed from normalized severity labels; retained recovery/cursor and fallback lifecycle.
752 src/cli/command-secret-targets.ts READ Forwarded the existing selected-provider state directly and retired two test-only static-target exports in favor of the real scoped target selectors.
749 src/cli/daemon-cli/status.gather.ts READ Retained: fast/full config reads, service targeting and plugin readiness have different observation and authority contracts.
738 src/cli/update-cli/update-command-run.ts READ Retained installed admission, preview custody, deferred ledger writes and explicit terminal ownership.
736 src/cli/update-cli/update-command-executor.ts READ Direct and delegated executors have distinct lease admission and release contracts; shared child owner already canonical.
728 src/cli/update-cli/update-command-post-update.ts READ Retained rollback, Windows autostart compensation, deferred plugin convergence and post-settlement reporting order.
722 src/cli/update-cli/update-command-execution.ts READ Package and Git flows already share candidate validation and activation; remaining adapters preserve distinct staging contracts.
721 src/cli/update-cli/update-command-service-plan.ts READ Read-only service ownership, runtime fallback and recovery instructions retain different failure contracts.
713 src/cli/update-cli/update-command-service-maintenance.ts READ Native stop preparation rechecks ownership after awaited work and preserves platform-specific compensation.
706 src/cli/update-cli/update-command.ts READ Existing preparation, admission, resolved execution and finalization owners separate fresh-state and migrated-state paths.
704 src/cli/config-model-validation.ts READ Retained authored/runtime reference comparison, inherited-agent validation and deferred provider loading; these have different provenance and failure contracts.
697 src/cli/plugins-update-command.ts READ Plugin/hook updates already share selection, logging and deferred settlement; fresh config snapshots, source projection, and package custody checks carry separate invariants.
688 src/cli/daemon-cli/lifecycle-core.ts READ Retained: start/stop/restart callbacks differ in loaded-state recovery, ordering and failure envelopes; earlier passes consolidated common owner.
685 src/cli/update-cli/update-command-git.ts READ Shared Git inspection parameter type; ordered direct/peeled Map merge preserves peeled precedence without key union and lookup.
668 src/cli/daemon-cli/status.print.ts READ Applied: one local labeled-info printer owns repeated label/value styling without changing stream or output bytes.
665 src/cli/gateway-cli/pre-bootstrap.ts READ Retained: selection, reset and final environment snapshots carry different trust and rollback semantics.
665 src/cli/update-cli/shared.ts READ Combined adjacent clone destination guards; retained error boxing to preserve rollback aggregate shape and cleanup authority.
662 src/cli/update-cli/update-command-rollback.ts READ Retained schema, config, native-definition and previous-runtime proofs around package restoration.
659 src/cli/claws-cli.runtime.ts READ Add/remove/export share failure output already; consent, resume matching, live package ownership, and operation-specific settlement cannot be merged safely.
655 src/cli/update-cli/update-command-target.ts READ Target resolution retains mode-specific metadata and service-root checks; prior passes already share refusal owner.
653 src/cli/cron-cli/shared.ts READ Retained canonical formatting and CLI error owner: status decoration, lookup diagnostics, strict parsing, and legacy Gateway warnings have distinct contracts.
649 src/cli/daemon-cli/lifecycle.ts READ Applied: unmanaged stop calls canonical verified-PID discovery directly instead of redundant filtering wrapper.
648 src/cli/update-cli/update-command-package.ts READ Staging promises retain activation custody; Doctor projections preserve optional fields and error attribution.
636 src/cli/update-cli/update-command-service.ts READ Installer, restart and readiness paths preserve different native outcomes and required service revalidation.
634 src/cli/update-cli/update-command-result.ts READ Existing reporting owner preserves typed refusal and recovery semantics; best-effort sentinels have different escalation policy.
631 src/cli/config-cli-input.ts READ Unified mode selection with input parsing and replaced per-length linear path comparisons with exact serialized keys, retaining length gating for deep input.
627 src/cli/update-cli/update-command-plugins.ts READ Cohort and convergence already share owners; remaining projections preserve notices, repair evidence and config provenance.
623 src/cli/update-cli/update-command-post-core.ts READ Released updater handoff, child settlement and index compensation require retained compatibility branches.
619 src/cli/daemon-cli/install.ts READ Retained: native definition inspection, runtime pins and token persistence require separate failure boundaries and update authority.
618 src/cli/command-catalog.ts READ Catalog entries define distinct route and startup overrides; grouping nonadjacent entries could change ordered policy composition.
618 src/cli/completion-runtime.ts READ Retained shell-specific quoting, profile ownership, encoding, symlink and portable-hook rules; each protects persisted shell startup configuration.
618 src/cli/config-cli-runner.ts READ Retained ordered roster remapping, deletion intent, authored-value preparation and guarded config write; merging these steps would lose lifecycle distinctions.
607 src/cli/update-cli/update-command-fresh-doctor.ts READ Fresh Doctor authority, diagnostic redaction and target-owned validation remain separate bounded responsibilities.
606 src/cli/nodes-cli/register.status.ts READ Retained: effective/live/pending views have distinct compatibility fields and presentation contracts; previous pass owns merging and parsing.
599 src/cli/capability-cli/model.ts READ Retained separate local completion and Gateway transports plus tracked cleanup; model/auth acquisition and response envelopes have distinct ownership.
590 src/cli/update-cli/update-command-terminal.ts READ Terminal publisher owns post-settlement reporting and preserves pending recovery without reacquiring mutation authority.
585 src/cli/update-cli/update-command-config.ts READ Channel restoration distinguishes authored includes, model overrides and source snapshots; shared missing-key helper already canonical.
574 src/cli/models-cli.ts READ Replaced private module promise cache with canonical createLazyRuntimeModule; retained option projections and global-vs-agent rejection ordering.
572 src/cli/daemon-cli/restart-health.ts READ Retained: migration progress, process identity and settling deadlines independently prevent false readiness.
565 src/cli/exec-policy-cli.ts READ Retained preset/config/approval ownership and restrictive rollback rules; prior pass already removed the extra config projection wrapper.
559 src/cli/update-cli/update-command-finalize.ts READ Finalization phases preserve service custody and legacy maintenance outcomes; prior pass consolidated maintenance settlement.
547 src/cli/config-cli-path.ts READ Retained union-aware schema traversal and model-array merge semantics; schema.lookup uses first-match and depth/key restrictions and is not behavior-equivalent.
544 src/cli/update-cli/update-command-resume.ts READ Legacy parent identity and parent-owned completion are shipped contracts; shared plugin producer already canonical.
521 src/cli/capability-cli/tts-runtime.ts READ Removed record revalidation of fully resolved typed TTS config; raw provider-location checks remain necessary to preserve channel/direct config shapes.
520 src/cli/completion-cli.ts READ Retained shell generators and command registration order: generated shell bytes and hidden/alias/choice handling are observable contracts.
514 src/cli/update-cli/update-finalization-lifecycle.ts READ Phase budgets, cancellation settlement and diagnostic publication each retain lifecycle ownership.
513 src/cli/program/route-args.ts READ Centralized admitted route shape plus declared value-flag parsing; removed repeated null checks and one-use forwarding locals while preserving projections.
512 src/cli/program/register.status-health-sessions.ts READ Retained session parent-option rejection, lifecycle target mapping and strict numeric parsing; previous pass already shares list/gateway options.
502 src/cli/config-cli-validation.ts READ Retained selected-secret policy checks and independent provider/schema/model validation; each protects a distinct mutation boundary.
488 src/cli/skills-cli.format.ts READ Shared requirement-group rendering with hooks while preserving skill labels and missing.config semantics; removed narration.
478 src/cli/argv.ts READ Help-token roles, root-option relocation and sentinel handling are distinct parsers with explicit accepted-input contracts.
472 src/cli/config-cli.ts READ Retained command-specific output and exit envelopes, lazy imports, and mutation callbacks; option text is the fixed CLI contract.
461 src/cli/plugins-inspect-command.ts READ Centralized section appends and boolean policy projection; retained snapshot/runtime inspection differences and package-owned install records.
453 src/cli/update-cli/update-command-service-recovery.ts READ Original service restoration is distinct from failed package activation; shared health recovery already canonical.
446 src/cli/program/register.onboard.ts READ Retained canonical shared onboarding option registration and provider-manifest deduplication; modern/recommendation routes have different write contracts.
441 src/cli/ports.ts READ Represented parsed listeners as complete PortProcess values instead of partial values plus assertions; shortened duplicate retry commentary.
439 src/cli/channels-cli.ts READ Retained lazy per-channel option registration, option-source inheritance, and distinct auth errors; prior passes already consolidated auth registration.
434 src/cli/cron-cli/register.cron-edit.ts READ Retained exact CAS revision reads, stream/cron metadata preservation and failure-alert patch semantics; previous pass removed repeated assignments.
434 src/cli/program/register.maintenance.ts READ Retained mutually exclusive Doctor operations, JSON failure modes and lazy migration/lint dispatch; cleanup would alter failure precedence or output.
432 src/cli/secrets-store-cli.ts READ Retained secret/env value policies, write-only retrieval, allowed-host updates and scoped mutation confirmation; no equivalent shared owner removes these branches.
420 src/cli/update-cli/update-command-convergence.ts READ Fresh/current runtime adapters converge through one plugin producer while preserving installed-target behavior.
415 src/cli/update-cli/update-command-service-command.ts READ Native child capability and receipts protect shipped target contracts; command lifecycle remains single owner.
415 src/cli/update-cli/update-command-verification.ts READ Readiness proof and report formatting already share canonical facts; recovery purpose retains distinct recording policy.
408 src/cli/hooks-cli.ts READ Read reports already use one Gateway/local owner and one-shot runner; toggle writes and deprecated aliases retain distinct failure/output lifecycles.
397 src/cli/cron-cli/register.cron-add.ts READ Retained create-only payload/session/delivery compatibility and validation ordering; edit semantics differ materially.
397 src/cli/daemon-cli/restart-health-probe.ts READ Retained: HTTP startup/readiness and authenticated Gateway health validate separate external contracts.
396 src/cli/update-cli/status.ts READ Status combines distinct diagnostics and preserves exact JSON omission and text ordering contracts.
393 src/cli/node-cli/daemon.ts READ Applied: merged identical missing/stopped recovery-hint output, removed one-use wrapper and redundant port fallback/type casts.
383 src/cli/secrets-cli.ts READ Retained bounded plan IO and the distinct interactive versus file-apply output/confirmation flows; shared error handling already exists.
382 src/cli/update-cli/update-command-readiness.ts READ Readiness owner retains one deadline and generation checks across service, RPC and HTTP observations.
379 src/cli/capability-cli/image.ts READ Moved repeated local config/agent/account-secret preparation to shared capability owner; retained image fallback, exact input and output behavior.
377 src/cli/update-cli/update-command-original-service.ts READ Retained original-runtime fingerprints have distinct mandatory and best-effort evidence requirements.
376 src/cli/update-cli/update-command-initialization-run.ts READ Fresh profile initialization preserves candidate versus installed admission and published schema-1 writer fences.
373 src/cli/update-cli/update-command-migrated.ts READ Candidate-only migrated state access and private continuation payload preserve published worker contracts.
366 src/cli/update-cli/update-command-handoff.ts READ Membership, ancestry and foreground handoffs encode distinct admission failures and transfer protocols.
364 src/cli/startup-trace.ts READ Buffered trace records, config-gated timeline activation and process-exit flushing have separate lifetime contracts.
362 src/cli/update-cli/update-command-schema.ts READ Preview and mutation schema admission already share context owner; preview retains read-only failure policy.
356 src/cli/proxy-cli.runtime.ts READ Proxy start, child runs and store queries have different cleanup ordering and aggregate-error contracts; prior passes own shared finalization.
355 src/cli/capability-cli/video.ts READ Moved repeated local config/agent/account-secret preparation to shared capability owner; retained bounded downloads, streamed output and release lifecycle.
355 src/cli/directory-cli.ts READ Routed group-member listing through the common limit/selection/result-rendering lifecycle while retaining member-specific lookup arguments and error text.
353 src/cli/channel-auth.ts READ Retained login reconciliation versus live-owned logout with local fallback; combining them would conflate different authority and persistence contracts.
352 src/cli/program/register.backup.ts READ Retained command-specific archive/Git/SQLite projections and exact help/option ordering; lazy registrations have different argument signatures.
350 src/cli/plugins-install-hook-fallback.ts READ Hook fallback is admitted only for eligible rejected artifacts and uses fresh guarded config ownership; apparent duplicate inspection/install calls have different custody roles.
350 src/cli/program/config-guard.ts READ Retained admission, invalid-config recovery and read-only inspection branches; cache invalidation and state preparation ordering are essential.
343 src/cli/cron-cli/schedule-options.ts READ Retained distinct create/edit schedule admission and metadata merging; unsigned-only stream numeric tokens differ from general strict integer parser.
340 src/cli/update-cli.ts READ Leaf dry-run and inherited option guards already share a registration owner; hidden protocols and repair flags remain distinct.
337 src/cli/skills-library-cli.ts READ Leaf/execute/mutate/activate registration already consolidated; create/update/import preserve different upload, revision, supporting-file, and expectedRevision contracts.
334 src/cli/nodes-camera.ts READ Applied: import coercion owners directly, remove redundant camera target alias and option projection, trim narrating comments.
330 src/cli/native-hook-relay-cli.ts READ Direct bridge fallback, stdin bounds and deadline checks protect different failure stages; lazy Gateway boundary remains necessary.
318 src/cli/exec-policy-diagnostics.ts READ Retained offline policy versus live preview ownership and explanatory output; legacy preview interpretation has an older-Gateway contract.
316 src/cli/connect-cli.ts READ Join URL validation, credential origin binding and first-connect service installation have distinct trust and persistence contracts.
314 src/cli/update-cli/update-command-service-publication.ts READ Physical artifact publication requires distinct path identity and offline native custody checks.
311 src/cli/capability-cli/metadata.ts READ Retained data-only public capability inventory; descriptions, flag order and result shapes are emitted as JSON.
311 src/cli/update-cli/progress.ts READ Progress observer owns poll, spinner and terminal ordering; existing report owner shared across output modes.
306 src/cli/gateway-cli/update-successor.ts READ Retained: foreground stop settlement and managed handoff cancellation maintain separate live ownership states.
306 src/cli/hooks-cli.format.ts READ Shared requirement rendering with skills; one status renderer preserves list/detail capitalization and hook-only configChecks semantics.
306 src/cli/progress.ts READ Removed duplicate fallback classification and no-op guards; optional renderers now use direct optional calls with lifecycle unchanged.
305 src/cli/nodes-cli/rpc.ts READ Applied: generic invocation now shares buildNodeInvokeParams; payload input honestly accepts the pre-existing arbitrary parsed JSON.
305 src/cli/tagline.ts READ Remaining size is public text and holiday date data; preserving emitted strings and date-selection semantics leaves no sound reduction.
300 src/cli/update-cli/update-command-candidate-admission.ts READ Private staging and installed execution authority stay separate; result application already canonical.
294 src/cli/update-cli/update-command-executor-children.ts READ Shared direct/delegated child interval preserves lineage, PID binding and release order.
293 src/cli/cron-cli/register.cron-simple.ts READ Retained bounded task-ledger completion polling and exact output statuses; simple mutation registration already shares descriptors.
293 src/cli/run-main-policy.ts READ Unified duplicate excluded-plugin command messages while preserving owner selection, allowlists and exact user-facing bytes.
285 src/cli/nodes-cli/register.camera.ts READ Applied: canonical record guards replace payload casts/forwarder; collapse repeated normalization and throwing-IIFE facing selection.
283 src/cli/cron-cli/register.cron-edit-options.ts READ Retained kind-preserving payload and delivery patch builder, set/clear mutexes and explicit unrestricted tool grants.
282 src/cli/plugins-cli.ts READ Lazy runtime bindings already own shared commands; explicit callbacks intentionally drop Commander trailing args before optional RuntimeEnv parameters.
282 src/cli/program/subcli-descriptors.ts READ Removed unused type alias and narrating comments; kept canonical NamedCommandDescriptor and descriptor inventory unchanged.
280 src/cli/update-cli/update-repair-command.ts READ Read-only repair fast paths retain bounded history proof and native readiness before reconciliation.
279 src/cli/daemon-cli/start-repair.ts READ Retained: repair target comparisons and runtime-pin preservation protect intentional operator service definitions.
277 src/cli/container-target.ts READ Reused the parsed container selector instead of reparsing the same argv before runtime dispatch.
277 src/cli/update-cli/update-command-noop.ts READ Shared warning stream selection for already-current plugin notices; retained target runtime and managed-service validation.
276 src/cli/daemon-cli/response.ts READ Retained: JSON/text and action-specific install failure envelopes share an existing owner; no safe remaining consolidation.
276 src/cli/update-cli/update-command-service-drain.ts READ Drain retains resident identity, legacy listener checks, write custody and final resume behavior.
274 src/cli/dns-cli.ts READ macOS setup output, privileged write fallback and DNS bootstrap ordering are separate contracts; no interchangeable owner found.
273 src/cli/daemon-cli/restart-health-inspect.ts READ Applied: retain the canonical reachability result instead of eight mutable shadow fields synchronized by the loader.
273 src/cli/qr-cli.ts READ Selected explicit or remote credentials once before applying the common auth override; inlined the single-use public-URL getter.
272 src/cli/program/register.tasks.ts READ Unified retry/dismiss registration through command descriptors; preserved inherited-option rejection before lazy owner loading.
271 src/cli/program/register.agent.ts READ Retained distinct command projections and automation flag detection; lazy owner loading is intentional startup boundary.
270 src/cli/claws-cli.project.ts READ Project error output and plan notices already share owners; dev owns disposable artifact lifetime while create/build have different JSON envelopes.
270 src/cli/session-ref.ts READ URL, shorthand and literal targets have distinct auth, escaping and option-consumption contracts; canonical URL parser already shared.
260 src/cli/worktrees-cli.ts READ Retained distinct exact-state, lossless-removal and snapshot-retirement owner calls and result envelopes; recent perf pass already removed repeated inventories.
256 src/cli/program/preaction.ts READ Retained Commander option-role checks and current lifecycle authority; startup guard decisions are not redundant config checks.
256 src/cli/program/register.subclis.ts READ Retained lightweight metadata/import separation, alias group replacement and plugin-before/after ordering.
254 src/cli/cron-cli/list-jobs.ts READ Retained revisioned pagination consistency and explicit protocol-v4 compatibility proof; remote payload checks are boundary validation.
250 src/cli/update-cli/update-command-admit.ts READ Candidate admission intentionally reads target-owned config/schema without installed mutation authority.
249 src/cli/resume-cli.runtime.ts READ Handoff resolution and recent-session selection have different identity and error contracts; connection shutdown already has one owner.
248 src/cli/daemon-cli/shared.ts READ Retained: safe environment projection, runtime styling and platform hints are shared owners used outside one command.
245 src/cli/claw-banner.ts READ Animation phases, signal restoration and settle-to-static behavior own distinct terminal state; art bytes must remain identical.
245 src/cli/session-target.ts READ Gateway identity validation, older-server diagnostics and explicit-target auth scope are meaningful boundary checks.
242 src/cli/program/message/helpers.ts READ Retained scoped plugin preload and bounded cleanup owner; numeric option policies and Gateway-owned actions have distinct dispatch semantics.
241 src/cli/update-cli/update-command-dry-run.ts READ Preview projection retains exact output keys and action order; no redundant runtime policy remains.
240 src/cli/nodes-cli/register.pairing.ts READ Retained: approval scope discovery and stale request diagnostics preserve shipped authorization/error contracts; earlier pass owns handlers.
238 src/cli/update-cli/update-command-service-env.ts READ Full owned environment and selective overrides have different restoration contracts; prior pass centralized both.
237 src/cli/update-cli/update-command-plugins-internals.ts READ Plugin diagnostics, requirement assessment and warnings are already shared by current and shipped handoffs.
234 src/cli/update-cli/update-command-windows-task.ts READ Shared identical suspension and compensation service-guard callbacks; retained restoration ordering and custody.
230 src/cli/config-set-input.ts READ Absorbed mode selection from config-set-parser, removing flag-projection wrappers and the intermediate result/error envelope.
230 src/cli/security-cli.ts READ Retained runtime auth override checks, secret resolution and per-severity rendering; mutation and audit output shapes differ.
229 src/cli/failure-output.ts READ Shared error renderer already owns classification and JSON/text envelopes; debug, schema and accepted-run fields have distinct contracts.
223 src/cli/capability-cli/shared.ts READ Added one local agent preparation owner for media/embedding runners; removed private pass-through auth-profile helper.
217 src/cli/update-cli/update-command-unwind.ts READ Unwind distinguishes migrated ledger custody, pending publication and settled legacy compensation.
215 src/cli/update-cli/update-command-database-context.ts READ Installed service inspection and database schema revalidation already share canonical context owners.
212 src/cli/claws-update-cli.runtime.ts READ Source selection, plan refusal and apply failure envelopes differ; retained existing read-only storage admission instead of introducing CLI-side lifecycle changes.
212 src/cli/fleet-cli/register.ts READ Fleet registration preserves command-specific argument parsing, defaults and lazy runtime ownership; no identical flow remains.
210 src/cli/attach-cli.ts READ Constructed the requested Gateway connection once for both explicit target resolution and direct grant paths.
207 src/cli/pairing-cli.ts READ Retained differing list/approve positional parsing, account scoping, owner bootstrap and optional notification; exported channel compatibility is documented.
206 src/cli/plugins-feature-scaffold.ts READ Most lines are generated source, CSS and README artifacts whose bytes are a hard output contract; scaffold writes already share one file map.
202 src/cli/daemon-cli/register-service-commands.ts READ Retained: hidden updater modes and source-aware parent options differ across command contracts.
202 src/cli/program/register.migrate.ts READ Retained shared option owner and parent precedence; root/default and explicit plan/apply routes have distinct write/backup controls.
202 src/cli/update-cli/schema-preflight.ts READ Schema union retains first incompatible observation, canonical path identity and source-bound legacy projections.
201 src/cli/completion-bash.ts READ Retained shell execution program and escaped template output; wordbreaks, quoting and Readline replacement spans are platform contracts.

@clawsweeper

clawsweeper Bot commented Sep 27, 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 cli CLI command changes size: XL labels Sep 27, 2026
@steipete
steipete marked this pull request as ready for review September 27, 2026 08:59
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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. labels Sep 27, 2026
@clawsweeper

clawsweeper Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 28, 2026, 10:50 AM ET / 14:50 UTC (Revision 22).

ClawSweeper review

What this changes

The branch consolidates CLI command, secret, and updater helpers, delays Gateway connection presence publication until hello delivery, and repairs related test fixtures.

Merge readiness

⛔ Blocked before merge - 4 items remain

This PR remains useful: current main does not delay Gateway presence publication until hello delivery. The remaining merge blocker is upgrade proof for the final production tree; the published-updater run documented in the PR used an earlier tree.

Priority: P3
Reviewed head: 1eb731364351b6fd8df0ec2fab15051f7d9705ff

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch has substantial boundary validation and no confirmed code defect, but final-tree managed upgrade proof is still missing.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.
Evidence reviewed 7 items Introduced Gateway behavior: Authenticated connections are staged as pending, and hello delivery commits the matching connection before presence is published.
Current main still needs the presence repair: The fetched main implementation sends hello and calls the delivery callback without the pending-presence commit.
Handshake boundary coverage: The added isolated-Gateway tests cover successful hello publication, failed or closed hello delivery, and HTTP watch-node replacement.
Findings None None.
Security None None.

How this fits together

The CLI prepares commands and updates for an installed Gateway. The Gateway authenticates WebSocket clients, sends a hello snapshot, and publishes connection presence to other readers.

flowchart LR
A[CLI commands] --> B[Command and update helpers]
B --> C[Gateway service]
D[WebSocket client] --> E[Authenticated hello]
C --> E
E --> F[Presence store]
F --> G[Snapshots and events]
Loading

Before merge

  • Resolve merge risk (P1) - The documented published 2026.9.6 updater cell predates the final Gateway production change. A managed installation's first update into this tree has not shown a healthy restart with the same service identity and preserved operator state.
  • Complete next step (P2) - Record a published 2026.9.6 updater first hop into the final production tree, including managed Gateway restart, service identity, operator-state preservation, and health.
  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

None.

Stored data model

Persistent data-model change detected: serialized state: src/cli/plugins-authoring-command.ts, unknown-data-model-change: src/cli/plugins-authoring-command.ts, unknown-truncated-pull-files, vector/embedding metadata: src/cli/capability-cli/embedding.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Prove the managed first hop (recommended)
    Run the published 2026.9.6 updater into the final production tree and record the managed Gateway restart, service identity, operator state, and health.

Technical review

Best possible solution:

Retain the consolidated CLI owners and publish connection presence only after successful hello delivery, with the released updater verified against that final behavior.

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

Yes for the Gateway presence race: current-main source publishes without a pending-delivery fence, and the PR supplies an isolated-Gateway handshake scenario. This read-only review did not execute it.

Is this the best way to solve the issue?

Yes for the presence repair: staging at authenticated connect and committing after hello delivery uses the existing presence owner. The updater portion still needs the repository's upgrade proof.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

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

Label justifications:

  • P3: This is primarily an internal cleanup with a bounded Gateway presence correction.
  • merge-risk: 🚨 compatibility: Updater and service-lifecycle helpers change, while the documented published-updater proof targets an earlier production tree.
  • merge-risk: 🚨 availability: The unproven managed first hop could affect whether an existing Gateway restarts successfully after update.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.

Evidence

What I checked:

  • Introduced Gateway behavior: Authenticated connections are staged as pending, and hello delivery commits the matching connection before presence is published. (src/gateway/server/ws-connection/connect-hello.ts:288, 1eb731364351)
  • Current main still needs the presence repair: The fetched main implementation sends hello and calls the delivery callback without the pending-presence commit. (src/gateway/server/ws-connection/connect-hello.ts:287, ec4e102c8720)
  • Handshake boundary coverage: The added isolated-Gateway tests cover successful hello publication, failed or closed hello delivery, and HTTP watch-node replacement. (src/gateway/server.auth.hello-order.test.ts:87, 1eb731364351)
  • Required upgrade contract: Repository policy requires a published-driver-to-candidate cell for updater and service-lifecycle changes. (AGENTS.md:84, 1eb731364351)
  • Proof source identity and remaining gap: The complete live PR body matched the supplied 64,642-unit snapshot and SHA-256. Its published 2026.9.6 updater cell identifies a pre-presence source tree; its final-head section reports fixture checks and retains earlier production proof, without a managed first-hop result for the final production tree.
  • Latest commit scope: The final commit changes browser and config test fixtures only; it does not supply a new updater or Gateway production implementation. (1eb731364351)

Likely related people:

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

  • Attach final-tree published-updater evidence showing managed service identity, restart health, and preserved operator state.

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 (21 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-28T00:20:10.270Z sha 0e068d8 :: blocked before merge. :: none
  • reviewed 2026-09-28T03:57:03.227Z sha 571cc7e :: blocked before merge. :: none
  • reviewed 2026-09-28T05:30:38.909Z sha 571cc7e :: blocked before merge. :: none
  • reviewed 2026-09-28T06:30:46.787Z sha 571cc7e :: blocked before merge. :: none
  • reviewed 2026-09-28T08:21:56.714Z sha 571cc7e :: blocked before merge. :: none
  • reviewed 2026-09-28T09:42:24.875Z sha 571cc7e :: blocked before merge. :: none
  • reviewed 2026-09-28T12:39:22.773Z sha 5a11936 :: blocked before merge. :: none
  • reviewed 2026-09-28T13:08:32.539Z sha 5a11936 :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 27, 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 27, 2026
@steipete
steipete enabled auto-merge (squash) September 27, 2026 17:21
@steipete
steipete disabled auto-merge September 27, 2026 18:40
@steipete
steipete enabled auto-merge (squash) September 28, 2026 00:03
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 28, 2026
@steipete
steipete disabled auto-merge September 28, 2026 01:17
@steipete
steipete enabled auto-merge (squash) September 28, 2026 03:43
@steipete
steipete disabled auto-merge September 28, 2026 04:44
Retain three original implementations required by strict validation and lint contracts. Align the process fixture with the provider diagnostic already shipped by #159237, without weakening envelope, output, or exit assertions.
Keep pending connection rows in the canonical presence store, but expose them only to their own hello snapshot until delivery succeeds. Preserve disconnect cleanup and explicitly transfer publication ownership when an HTTP watch node replaces a pending WebSocket connection.

Force an overlapping presence broadcast in the registered handshake regression and cover the HTTP handoff through its real route. Keep existing handshake assertions and move unchanged fixture helpers into their existing support module to satisfy the line-cap ratchet.
@steipete steipete changed the title refactor(cli): deslop CLI fourth pass refactor(cli): deslop CLI and fix Gateway presence publication Sep 28, 2026
@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components. This comment is informational because the PR author has repository Maintain or Admin access.

  • Current SHA: 1eb731364351b6fd8df0ec2fab15051f7d9705ff
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/gateway/server/ws-connection/connect-hello.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/gateway/server/ws-connection/connect-session.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.

Carefully review these changes before merging.

@openclaw-barnacle openclaw-barnacle Bot added the gateway Gateway runtime label Sep 28, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 28, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 28, 2026
@steipete
steipete merged commit ae602ac into main Sep 28, 2026
165 of 244 checks passed
@steipete
steipete deleted the deslop/l113-cli4 branch September 28, 2026 15:56
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 29, 2026
…law#159554)

* refactor(cli): deslop CLI fourth pass

Consolidate command preparation, argument validation and report rendering under their existing CLI owners. Remove redundant forwarding, test-only injection, repeated normalization and duplicate finalization guards while preserving command, output and configuration contracts.

* test(cli): preserve boundary checks and current provider diagnostics

Retain three original implementations required by strict validation and lint contracts. Align the process fixture with the provider diagnostic already shipped by openclaw#159237, without weakening envelope, output, or exit assertions.

* test(cli): verify progress completion before command parsing

* fix(gateway): publish connection presence after hello delivery

Keep pending connection rows in the canonical presence store, but expose them only to their own hello snapshot until delivery succeeds. Preserve disconnect cleanup and explicitly transfer publication ownership when an HTTP watch node replaces a pending WebSocket connection.

Force an overlapping presence broadcast in the registered handshake regression and cover the HTTP handoff through its real route. Keep existing handshake assertions and move unchanged fixture helpers into their existing support module to satisfy the line-cap ratchet.

* test: stabilize config audit and browser server fixtures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes extensions: browser gateway Gateway runtime merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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