Skip to content

refactor(gateway): deslop server methods and worker environments third pass - #161737

Merged
steipete merged 2 commits into
mainfrom
deslop/l213-gateway-methods3
Sep 30, 2026
Merged

steipete merged 2 commits into
mainfrom
deslop/l213-gateway-methods3

Conversation

@steipete

@steipete steipete commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Third-pass maintainer-requested cleanup of duplicated Gateway RPC adapters and worker-environment helpers, following #159752 and #161284.

User Impact

No intended user-visible change. Gateway protocol, RPC method names/parameters/results/errors, authorization revalidation, worker lifecycle/fencing, and persisted state remain unchanged.

Why This Change Was Made

  • Reuse canonical stable bounded sorting for Doctor status and the existing schema validator for desktop adapters.
  • Share node subscription fencing and local plugin-detail projection; select approval turn-source metadata once.
  • Inline the single-use tool catalog assembly at its RPC owner.
  • Share bootstrap archive verification and observed-lock cleanup; reuse canonical placement matching.
  • Remove forwarding authority callbacks, repeated workspace manifest filtering, and an instanceof wrapper. The recovery test retains its class, cause, and no-rollback assertions.

Measured final diff: 113 net production lines removed across 14 production files, plus 4 test lines removed. All changes stay within the two assigned subtrees. The reading pass covered all 645 production files at the starting base; the size-sorted READ log for every production file over 200 lines is below.

Evidence

  • Independent Codex autoreview: scoped-clean at P0-P2, including the one-line lint follow-up. The conflict rebase only dropped overlaps already landed in fix(nodes): apply the same tool policy to node sessions as Gateway sessions #160444, fix(cron): sessions_send fails after current automation runs #161085, and refactor(worker-workspace): remove dead code and comment slop in worker workspaces #161642; it added no new cleanup logic.
  • Rebased candidate 794b59368258338b94758cf7d5e0750e8d0e7374: full Git tree 950898866ca4c8c9bf8f61f749218e0cca96786a verified on a fresh remote checkout; both check-madge-import-cycles.ts and check-import-cycles.ts report 0; targeted core lint has 0 warnings/errors.
  • node scripts/run-vitest.mjs with 28 focused owner/importer/boundary files: 401 passed, one existing opt-in Podman skip, across five Vitest shards in 231.00s. Includes fs-safe and extension import-boundary checks.
  • Rebased pnpm protocol:check: passed with zero drift. pnpm plugin-sdk:check-exports and pnpm plugin-sdk:surface:check: passed.
  • Initial candidate: full build passed (460s); changed checks passed core types, all 27 test-type groups, ratchets, boundaries and all three dead-export scans. The reduction made the old bootstrap max-lines suppression unused, so lint failed; removed that directive, reviewed it, and reran lint, both cycle checks, and all 38 bootstrap tests successfully. The initial hosted run failed check-lint-core-1; that check passes on the current head.
  • Current-head hosted CI run 36693161484 executed the build and test lanes. The only failing test job is checks-node-changed-compact-small-1-1: session-activity-summaries.test.ts / "readmits a relocated store and fences a delayed result from its previous owner", expected 2 to be 3. The identical case and assertion already failed in unrelated PR test(runtime): remove low-value tests (batch d110) #161714 at head 8080a45a385095e4cbc0d59b4203b0f959263369, run 36692028664 / job 109811633901. That PR changes test cleanup and CI selection, not the recap owner. This PR changes neither the recap owner, its storage/transcript dependencies, nor the failing test; the exercised direct service.ensure path uses mocked model completion and does not call the changed RPC or workspace paths. The downstream CI gate reflects that single inherited failure. Landing uses the explicitly authorized exact-head pre-existing-failure exception; no passing hosted CI claim is made. The recap fixture remains for the main-CI coordinator to repair.
  • Changed-test cost: pnpm test src/gateway/worker-environments/workspace-accepted-sync.test.ts --maxWorkers=1 passed in 40s including cold worker compilation. No tests were added.

Proof ran on direct AWS Crabbox lease cbx_e8e46a107289; final run run_a38b4376fbeb0b9d55c40d6e3f61ba78. The Blacksmith route did not execute tests; owned Testbox tbx_01m3rgscpq81ak794x6ds6fj4g expired and is confirmed stopped. After a local Git-seed preparation timeout, the AWS proof used the public base plus the task patch and verified the complete candidate tree before execution. No tests or builds ran on the Mac.

No product bug fix is claimed. Existing authority, recovery, cursor, and byte-order contracts were retained where reducing them would change behavior.

Third-pass coverage: all 270 production files over 200 lines

Size is the starting census at 3801005f695. The rebase onto 16be7f0f270 dropped four overlaps already landed on main. READ means the complete production file was inspected; retained paths have the reason below. Prior passes and subtree history since September 20 were checked before selecting changes.

Lines Production file Result
1203 src/gateway/server-methods/config.ts READ: Array intent, full replacement, hashless preference CAS and persisted-write recovery have distinct error ordering and storage contracts.
1107 src/gateway/server-methods/agents.ts READ: Deletion identity, journal fencing, shared-store exclusions and cleanup ordering are required; create/update/delete have distinct commit custody.
950 src/gateway/server-methods/send.ts READ: FOLLOWUP: Remove four redundant ?? undefined coalesces after normalizeOptionalString (owner returns string | undefined). Shared route owner already handles binding/dedupe; delivery receipts, partial-send handling, mirror timing, and handoff checks must remain distinct.
949 src/gateway/server-methods/cron.ts READ: Scoped job wrappers already canonical; create/update guards and reads preserve different validation and authority timing.
775 src/gateway/server-methods/doctor.ts READ: REUSED shared sortAndLimitBy stable bounded selection owner; removed local insertion algorithm.
755 src/gateway/worker-environments/bootstrap.ts READ: Shared archive digest verifier and observed-lock cleanup without changing hashing or ownership checks.
746 src/gateway/worker-environments/node-worker-tunnel.ts READ: No sound simplification: exact retained entry and shutdown/drain authority distinguishes each path.
739 src/gateway/worker-environments/provider-lifecycle.ts READ: No sound simplification: provider replay and cancellation settlement retain distinct ordering contracts.
730 src/gateway/worker-environments/service.ts READ: No sound simplification: explicit service surface avoids exposing lifecycle internals; shutdown tracks distinct custody.
730 src/gateway/server-methods/chat-abort-runtime.ts READ: Queued collector, active runs and pending admissions have distinct live owners and persistence settlement rules.
727 src/gateway/server-methods/update.ts READ: RETAIN: Native/managed/foreground update orchestration preserves requester authority, campaign adoption, acknowledgement, sentinel persistence, transfer, and cancellation ordering; error and skipped outcomes have distinct wire contracts.
724 src/gateway/server-methods/sessions-patch-engine.ts READ: Retain preflight, detached preparation and final commit guard checks; they protect different concurrency boundaries.
721 src/gateway/worker-environments/inference.ts READ: No sound simplification: admission replay, unknown write settlement and live fencing have distinct lifetimes.
718 src/gateway/server-methods/chat-send-admission.ts READ: Admission branches preserve restart recovery, request identity, upload authority and run custody boundaries.
717 src/gateway/server-methods/chat-send-agent-dispatch.ts READ: Dispatch and post-dispatch finalization distinguish runtime-owned transcript/media and source delivery.
715 src/gateway/worker-environments/placement-dispatch-startup.ts READ: No sound simplification: provisioning retention, prepared binding and activation have distinct authority lifetimes.
715 src/gateway/worker-environments/local-workspace-projection.ts READ: Pass current authority checks directly to custody and Git callbacks; retain every lease/session/revision check.
714 src/gateway/server-methods/approval-shared.ts READ: Approval request/resolve/wait paths already shared; revalidation and best-effort hooks require existing ordering.
711 src/gateway/server-methods/chat-send-reply-dispatch.ts READ: Transcript receipts, media rewrite generations and staged reply ownership are required; no safe broad consolidation.
710 src/gateway/server-methods/sessions-abort.ts READ: RETAIN: Exact run, narrow caller, queued collector, embedded run, and yielded-parent paths have distinct authority, cancellation, terminal-persistence, and dedupe contracts.
709 src/gateway/server-methods/sessions-rewind.ts READ: RETAIN: Shared message-cut flow already owns rewind/switch/fork; pre-fence and commit identity checks protect distinct yields, and upstream/repository fork rollback preserves ownership.
705 src/gateway/worker-environments/worker-turn-launcher.ts READ: FOLLOW-UP: centralize local fallback at admission-loop head; six wait paths repeat routing after refreshed placement.
705 src/gateway/worker-environments/node-workspace-transfer-service.ts READ: No sound simplification: transfer token ownership, upload settlement and context cleanup must remain separately fenced.
703 src/gateway/worker-environments/node-bootstrap-artifact.ts READ: No sound simplification: package closure, artifact modes, bounded buffers and producer lifetime enforce independent contracts.
701 src/gateway/server-methods/question.ts READ: Retained prepared session authorization, exact observation ownership, secret-store commit and waiter barriers; no sound simplification beyond prior passes.
698 src/gateway/server-methods/chat-send-handler.ts READ: Input custody, Goal commit, pre-ACK steering and post-ACK dispatch retain distinct settlement boundaries; thin public wrapper keeps trusted options private.
698 src/gateway/server-methods/chat-metadata-runtime.ts READ: Current and pending generation ownership, profile-local catalogs and optional reads have distinct invalidation contracts.
697 src/gateway/server-methods/chat-send-pre-admission.ts READ: Retry replay, durable recovery and stop commands have distinct error and lifetime ordering; fresh authority checks are not redundant.
697 src/gateway/server-methods/chat-abort-handler.ts READ: Exact-run withdrawal, pending runs, collectors and worker cancellation retain different ownership and persistence contracts.
695 src/gateway/worker-environments/node-launch-adapter.ts READ: No sound simplification: receipt polling, admission rearming and cancellation deadlines have distinct contracts.
692 src/gateway/server-methods/sessions-sharing.ts READ: FOLLOWUP: Make tokenCodec local to the exclusive mutation and publicShareGrant local to the patch callback; requireManageableTarget returns an unused role. Preserve tri-state actor evidence and each commit guard.
688 src/gateway/server-methods/sessions-suggestions.ts READ: FOLLOWUP: Replace conditional object spread for queueMode with one conditional property in dispatchSuggestion. Claim/release/finalize and throttled typing authority rechecks otherwise encode distinct boundaries.
687 src/gateway/server-methods/tools-effective.ts READ: Retain registry/cache/MCP lifecycle; dependency-bag removal requires out-of-lane test migration.
686 src/gateway/server-methods/sessions-dispatch.ts READ: RETAIN: Dispatch/move/reclaim already share target, workspace, error, and projection owners; automatic device retry needs current placement and post-await slot fencing.
680 src/gateway/worker-environments/workspace-quiescence-scripts.ts READ: Acquire/renew/resume process sweeps have distinct durable custody and recovery behavior; shared primitives already own matching logic.
680 src/gateway/worker-environments/computer-transport.ts READ: No sound simplification: logical/physical execution identity and operator control fences have distinct lifetimes.
678 src/gateway/server-methods/sessions-create.ts READ: RETAIN: Preparations already delegate catalog, project, root, lifecycle, provenance, and initial-turn ownership; creation publication and captured source authority must remain ordered.
677 src/gateway/server-methods/models-list-result.ts READ: Retained separate live and provider-config catalog projections, native readiness overlays, and current-owner guards; merging these would blur distinct contracts.
676 src/gateway/worker-environments/worker-turn-rpc.ts READ: No sound simplification: terminal ACK replay fences and request-specific result errors require current ordering.
676 src/gateway/worker-environments/placement-dispatch-pending-results.ts READ: No sound simplification: accepted/staged/missing results and live/restarted custody require distinct recovery branches.
668 src/gateway/worker-environments/placement-store.ts READ: No sound simplification: conditional transitions retain exact CAS and postcommit publication ordering.
662 src/gateway/server-methods/nodes.invoke.ts READ: Retained deadline, upload, pairing, approval, reconnect and pending-action checks at their current await boundaries; prior passes already share wake stages.
661 src/gateway/server-methods/devices.ts READ: Pairing and token operations retain different denial events, response claims and worker reconciliation ordering.
660 src/gateway/server-methods/board.ts READ: Validated method/error owner already shared; per-widget authority and persisted content paths differ meaningfully.
658 src/gateway/worker-environments/workspace-sync.ts READ: SSH sync and reconcile flows retain different retry, authority and byte-fence contracts; no sound further collapse found.
653 src/gateway/server-methods/chat-transcript-persistence.ts READ: Exact row, turn-index and mirror-tail rewrites retain different fences; shared text extractor is not equivalent (it coerces non-string blocks).
652 src/gateway/server-methods/terminal.ts READ: Retain catalog policy refresh, deadline ownership, pairing fences and late-open cleanup.
651 src/gateway/worker-environments/placement-turn-claims.ts READ: FOLLOW-UP: use canonical cleared-claim column object for four repeated five-column NULL patches; retain guards and timestamps.
648 src/gateway/worker-environments/worker-session-tool-executor.ts READ: Canonical normalization landed in #160444; dropped this already-landed cleanup from the PR and retained the newer node tool-policy owner.
645 src/gateway/worker-environments/inference-runtime.ts READ: No sound simplification: provider auth-route selection and stream publication preserve independent boundaries.
644 src/gateway/server-methods/system-agent.ts READ: Retain setup admission, transcript acknowledgement and delegated approval ownership; no safe large collapse.
641 src/gateway/worker-environments/placement-move-intent.ts READ: No sound simplification: shipped optional-column compatibility and exact move CAS need dedicated storage migration before broader cleanup.
639 src/gateway/worker-environments/session-attachment-service.ts READ: Attachment creation, reservation cancellation and parked cleanup encode independent authority and lifecycle transitions.
637 src/gateway/server-methods/channels.ts READ: Probe/audit/summary differ in side effects and errors; candidate: eliminate widen-then-cast status maps and validated-param casts.
633 src/gateway/server-methods/system-changes.ts READ: Retain bounded journal scans, cursor head freeze and collapse markers; simplification would touch legacy synchronous audit storage.
632 src/gateway/worker-environments/worker-turn-execution.ts READ: No sound simplification: context and transcript admission, launch delivery and result reconciliation have separate custody.
631 src/gateway/worker-environments/environment-access.ts READ: No sound simplification: SSH/node transports and observe/launch ownership have different revalidation points.
630 src/gateway/worker-environments/node-worker-workspace-actions.ts READ: FOLLOW-UP: canonical token-scoped transfer helper may replace repeated revoke-finally blocks without moving staging cleanup.
628 src/gateway/server-methods/projects.ts READ: Retained bounded newest-first candidates, visibility-aware identity probes, credential sanitization and post-await access checks; no redundant owner found.
627 src/gateway/server-methods/sessions-files.ts READ: RETAIN: Delta folding has bounded LRU and singleflight ownership; list/get share a handler while repository/local adapters retain different availability and response contracts.
613 src/gateway/server-methods/exec-approval.ts READ: Creation and approval consumers have different authority lifetimes; candidate: remove SAFETY narration and redundant schema-narrowed parameter casts.
612 src/gateway/worker-environments/provider-intent.ts READ: No sound simplification: allocation admission, retention and replay use intentionally different source-authority scopes.
609 src/gateway/server-methods/chat-history-handler.ts READ: History, startup and delta share read owner while preserving cursor/retained-transcript and model-projection behavior.
600 src/gateway/worker-environments/live-events.ts READ: No sound simplification: transient windows, active registry owners and buffered terminal capacity retain distinct fences.
600 src/gateway/server-methods/workspace-files.ts READ: RETAIN: File listing, bounded search, preview MIME policy, CAS tokens, content round-trip checks, and safe writes share canonical filesystem owners without duplicating lifecycle policy.
596 src/gateway/server-methods/sessions-mutations.ts READ: FOLLOWUP: Build patchMany outcomes with map instead of push-only intermediate array; preserve index association, optional agentId omission, diagnostics timing, and exact failure payloads.
590 src/gateway/worker-environments/prepared-pool.ts READ: No sound simplification: demand, policy, prepared content and deferred cleanup preserve independent capacity decisions.
582 src/gateway/worker-environments/placement-turn-claim-events.ts READ: No sound simplification: prepared claim authority, run authority and finishing ACK custody remain independently revalidated.
571 src/gateway/worker-environments/store.ts READ: No sound simplification: explicit typed mutation adapters strip host guards and carry exact commit publication facts.
571 src/gateway/worker-environments/placement-dispatch-coordinator.ts READ: FOLLOW-UP: direct method references can replace two pass-through environment-session readers; admission queues remain unchanged.
570 src/gateway/server-methods/control-ui.ts READ: GitHub previews, session PR reads and subscriptions have distinct current identity and delivery boundaries.
567 src/gateway/server-methods/models-auth-status.ts READ: Retained profile/auth-order projection and refresh semantics; apparent abort-ops duplication deliberately omits the canonical helper's extra callbacks and config input.
565 src/gateway/server-methods/environments.ts READ: REUSED defineValidatedGatewayHandler for all desktop RPC adapters; deleted repeated guard-and-forward shells.
564 src/gateway/worker-environments/workspace-result-finalize.ts READ: Earlier pass touched this file; execution, artifact cleanup and final reconciliation failure policies remain intentionally distinct.
561 src/gateway/server-methods/chat-abort-authorization.ts READ: Canonical selection is already shared; typed active-run and unknown pre-registration payload readers differ intentionally.
560 src/gateway/worker-environments/workspace-reconcile-recovery.ts READ: Recovery checks distinguish missing replacements, derived directories and concurrent edits; preserve journal-specific guards.
558 src/gateway/server-methods/skills.ts READ: FOLLOWUP: Remove three casts around validated params.query, params.limit, and params.slug (schema and assertValidParams narrowing verified). Workshop operations already share workspace/error handling and preserve upload commit guards.
555 src/gateway/server-methods/task-suggestions.ts READ: RETAIN: Acceptance singleflight and claim restoration share canonical acceptance helpers; local/worktree/cloud/source-session paths have distinct creation, dispatch, startup, and cleanup contracts.
545 src/gateway/server-methods/artifacts.ts READ: Managed-media IDs, inline bytes and HTTP grants retain distinct data and disclosure authority; coalescing is request-local.
536 src/gateway/worker-environments/placement-record.ts READ: No sound simplification: discriminated states and exact claim checks preserve persisted state invariants.
533 src/gateway/worker-environments/store-projection.ts READ: No sound simplification: native overlay revisions and per-authority admission fences are independent.
532 src/gateway/server-methods/shared-types.ts READ: RETAIN: Type-only context contracts separate kernel, transport, and resident ownership; SystemAgentHistoryTurn intentionally remains a leaf mirror to avoid the documented import cycle.
527 src/gateway/server-methods/session-change-event.ts READ: Preserve leading/trailing publication, oldest tombstone object identity, bounded debounce, snapshot generation and Gateway drain custody; repeated capture assignments intentionally preserve tombstone aliases.
525 src/gateway/worker-environments/bundle.ts READ: No sound simplification: cached manifests, npm integrity and exclusive cache cleanup have distinct contracts.
520 src/gateway/server-methods/agents-files.ts READ: Remote bridge and local fs-safe access have different stat, symlink, encoding and conflict semantics; no safe broad unification.
518 src/gateway/worker-environments/workspace-sync-scripts.ts READ: Bounded standalone inventory and hashing use existing shared generated primitives; only its canonical entry fragment was simplified.
514 src/gateway/server-methods/push.ts READ: Retained separate persisted worker guards and native compatibility guards plus subscription/profile binding checks; each owns a different lifetime boundary.
509 src/gateway/worker-environments/workspace-result-staging.ts READ: Candidate, accepted and cleanup refs retain separate durable ownership and crash-recovery transitions.
504 src/gateway/worker-environments/placement-dispatch.ts READ: No sound simplification: local admission, allocation, activation and forced reclaim retain different lifecycle checks.
502 src/gateway/worker-environments/workspace-accepted-remote-script.ts READ: Transaction phases have distinct rollback and commit namespace semantics; no safe descriptor consolidation identified.
491 src/gateway/worker-environments/placement-session-tool-operations.ts READ: No sound simplification: replay identity and tool admission use exact transaction and waiter boundaries.
490 src/gateway/server-methods/approval.ts READ: Unified durable approval owner preserves malformed-deny, channel custody, live waiter and terminal replay contracts.
481 src/gateway/server-methods/message-operation-route.ts READ: Retained route-binding aliases, keyed lock lifetime, replay isolation and in-flight settlement; non-replay path has distinct authorization and account semantics.
481 src/gateway/server-methods/chat-send-session.ts READ: Session preparation preserves global alias, exact physical target and native-consent initialization contracts.
473 src/gateway/worker-environments/prepared-environment-store.ts READ: No sound simplification: reserve/build capacity and consumption retain distinct persisted-state predicates.
472 src/gateway/server-methods/chat-restart-recovery.ts READ: Fingerprint, accepted recovery claim and terminalization own distinct restart-safe states and persisted invariants.
470 src/gateway/server-methods/chat-send-dispatch-errors.ts READ: Pre-ACK error, queued completion and post-dispatch failure need different cleanup and terminal publication ordering.
469 src/gateway/worker-environments/placement-workspace-result.ts READ: FOLLOW-UP: repeated exact pending-result row reads can share a canonical private lookup while retaining error/publication order.
468 src/gateway/server-methods/sessions-read.ts READ: Retain projection/current-authority response frame and final buffered-preview reauthorization.
465 src/gateway/server-methods/sessions-compact.ts READ: RETAIN: Trim and runtime compaction have different admission/preflight/accounting contracts; repeated reads guard queued work and synchronous writer identity after awaited compaction.
464 src/gateway/worker-environments/workspace-sync-helpers.ts READ: Existing shared helpers own SSH argv, validation and bounded rsync; quota final checks are required fences.
462 src/gateway/server-methods/usage.ts READ: Retain creator attribution, aggregate-before-limit behavior and exact wire errors.
458 src/gateway/worker-environments/workspace-actual-manifest.ts READ: Selective inventory and recursive inventory intentionally differ on unsupported nodes and parent admission; preserve bounded joins.
458 src/gateway/worker-environments/session-repository-checkpoints.ts READ: Checkpoint and optional publication companion retain different failure and durable-ref contracts; previous second pass already simplified this file.
457 src/gateway/worker-environments/placement-dispatch-failure.ts READ: No sound simplification: active, draining and orphan failures preserve independent physical teardown proofs.
453 src/gateway/worker-environments/node-workspace-retain-coordinator.ts READ: No sound simplification: bundle and manifest retention carry independent bounds and reconnect generations.
446 src/gateway/worker-environments/provider-owner-lifecycle.ts READ: No sound simplification: confirmed versus uncertain allocation cleanup and shared-host teardown must remain separate.
443 src/gateway/server-methods/cron-caller-scope.ts READ: Scheduled authority provenance, management grants and creator ownership are distinct; reusable scope owner already centralized.
443 src/gateway/server-methods/chat-send-source-finalization.ts READ: Source mirrors and late-progress delivery retain separate transcript rewrite and terminal-event custody.
442 src/gateway/server-methods/nodes.pairing.ts READ: Retained pairing permission decisions and generation-bound surface refresh; remove/reject/approve have distinct effects and response shapes.
439 src/gateway/worker-environments/node-enrollment.ts READ: No sound simplification: paired setup issuance and runtime grants bind distinct exact owner generations.
436 src/gateway/server-methods/session-catalog-list.ts READ: Retain separate planning, provider and delivery lifetimes; factoring readiness awaits risks losing consumer-frame freshness.
433 src/gateway/server-methods/usage-session-selection.ts READ: Retain physical-store identity, historical-family ownership and post-await visibility rechecks.
432 src/gateway/server-methods/session-create-project.ts READ: Retain pending workspace intent, exact run identity and post-commit rollback ownership.
429 src/gateway/worker-environments/repository-project-admission.ts READ: REST and pinned GraphQL branches preserve current repository identity and credential revalidation; guards are required boundaries.
425 src/gateway/server-methods/system-agent-approval.ts READ: RETAIN: Exact delegated authority, proposal hash, registration, correction limit, settlement, and history persistence are separate responsibility boundaries; failures retire only their captured proposal.
424 src/gateway/worker-environments/placement-turn-authority.ts READ: No sound simplification: commit, rollback and uncertain writes intentionally publish different revocation facts.
423 src/gateway/server-methods/migrations.ts READ: Retained request and plan fingerprints, terminal deduplication, provider lifetime, cleanup settlement and wire projection; prior passes already centralized normalization.
420 src/gateway/worker-environments/credential-broker.ts READ: No sound simplification: delivery TTL, durable turns and credential rotation have different authority contracts.
415 src/gateway/worker-environments/transcript-commit.runtime.ts READ: Active-prefix recovery differs from pending-ledger DAG recovery; keep authority rollback and publication order unchanged.
415 src/gateway/worker-environments/placement-row-codec.ts READ: No sound simplification: validation order and transition projections preserve persisted error and publication behavior.
414 src/gateway/server-methods/nodes.read.ts READ: Retained read redaction, capability rotation, inventory admission and persisted consent revalidation; wrappers carry protocol-specific errors or projection.
414 src/gateway/server-methods/chat-send-reply-finalization.ts READ: Final reply projection preserves binding-owned transcripts, TTS markers and staged-media receipt ownership.
413 src/gateway/worker-environments/inference-control-internal.ts READ: No sound simplification: captured cancellation, accepted drains and retained unknown settlement require separate custody.
408 src/gateway/server-methods/sessions-patch-model-selection.ts READ: RETAIN: Model default, auth repin, runtime consent, operator policy, and environment restriction paths already consume canonical owners; validation closures must survive preparation to commit.
407 src/gateway/worker-environments/project-preparation.ts READ: FOLLOW-UP: exact repeated prepared-project script identity fields can share one local descriptor; preserve verified-retained and timeout arguments.
407 src/gateway/worker-environments/placement-dispatch-recovery.ts READ: No sound simplification: startup, runtime and interrupted-owner recovery have intentionally different admission and teardown policies.
401 src/gateway/worker-environments/worker-turn-admission.ts READ: Required-string helper inlining landed in #161085; dropped this duplicate and retained its Cron alias repair.
401 src/gateway/worker-environments/node-desktop-carrier.ts READ: No sound simplification: stream and launcher scopes preserve independent physical resource settlement.
401 src/gateway/server-methods/themes.ts READ: Retain profile/current-owner checks and preference CAS; collapsing result awaits could introduce a response-authority gap.
400 src/gateway/server-methods/plugins.ts READ: APPLIED: local catalog detail and ClawHub-offline fallback share one inspection/result projection while preserving source-specific inspection eligibility.
397 src/gateway/server-methods/chat-send-message-injection.ts READ: Pre-ACK acceptance and committed steering completion intentionally use different lifecycle/error contracts.
395 src/gateway/server-methods/sessions-patch-archive.ts READ: RETAIN: Archive preparation, drain custody, projection validation, and post-commit worktree cleanup are separate lifecycle stages with distinct failure mappings.
391 src/gateway/worker-environments/placement-reclaim.ts READ: FOLLOW-UP: return the single-use reclaim closure directly; keep final workspace acceptance and teardown ordering unchanged.
391 src/gateway/worker-environments/desktop-tunnel.ts READ: No sound simplification: observer transport and stateful launcher lifetimes retain separate exact-epoch fencing.
389 src/gateway/server-methods/chat-assistant-content.ts READ: Prepared vs raw directive handling and sensitive display vs persisted media differ intentionally.
387 src/gateway/worker-environments/provider-node-provisioning.ts READ: No sound simplification: runtime preparation, enrollment and bundle installation retain separately closable owners.
386 src/gateway/server-methods/sessions-delete.ts READ: RETAIN: Shared operator/incognito deletion owner captures exact incarnation before lazy load, drains outside mutation lock, and preserves post-delete hook and worktree cleanup order.
386 src/gateway/server-methods/chat-reply-media.ts READ: Existing shared media custody helper already unifies normalization/content preparation; mixed trusted audio requires per-item treatment.
385 src/gateway/server-methods/skills-library.ts READ: RETAIN: Shared libraryHandler already centralizes validation and error projection; activation and selected reads retain exact session/skill revision and current authority checks. Storage access changes would require a separate owner migration.
380 src/gateway/worker-environments/session-placement-lifecycle.ts READ: Mutation, archive and retirement guards encode distinct allowed states; central samePlacementOwner already serves comparisons.
376 src/gateway/server-methods/channel-pairing.ts READ: Pairing policy and account resolution already shared; candidate: common public account projection in request rows.
375 src/gateway/worker-environments/node-worker-repository-preparation.ts READ: FOLLOW-UP: remove redundant lexical block and else-after-throw around seeded checkout fallback; no error/authority changes.
374 src/gateway/server-methods/session-mutation-guards.ts READ: Retain opaque request-object custody and distinct worker, profile and admitted-input authority.
371 src/gateway/worker-environments/worker-turn-payload.ts READ: No sound simplification: replay window fitting and exact runtime bearer sizing are distinct boundaries.
370 src/gateway/server-methods/system.ts READ: Retain process-stable facts and live presence policy; event suppressions and wake paths have distinct contracts.
369 src/gateway/worker-environments/placement-turn-claims-store.ts READ: No sound simplification: closed command projections, uncertain native settlement and cleanup retries preserve exact custody.
369 src/gateway/worker-environments/inference-store.kernel.ts READ: No sound simplification: per-turn replay and pending-run exclusion differ; retention preserves encoding-specific byte budgets.
369 src/gateway/server-methods/secrets.ts READ: RETAIN: One shared write service owns redaction before validation/persistence and runtime refresh; set/delete distinguish pre-write validation from committed-but-refresh-failed outcomes and validate outgoing protocol payloads.
368 src/gateway/worker-environments/workspace-manifest.ts READ: Filter derived paths once before projecting file/symlink entries and directories; all parser budgets and errors retained.
366 src/gateway/server-methods/workspace-fs.ts READ: Retain remote-owner routing, fs-safe containment and conflict-safe local writes; remote bridge lacks atomic editing.
366 src/gateway/server-methods/users.ts READ: Retain per-operation error/publication order and preference conflict outcomes; legacy synchronous profile paths need a separate migration.
365 src/gateway/worker-environments/store-transitions.ts READ: No sound simplification: state-specific transport, credential and bootstrap rules protect persisted invariants.
364 src/gateway/server-methods/sessions-lifecycle-drain.ts READ: RETAIN: Canonical drain joins controller/reply/embedded/placement/worker/terminal owners; admission release and accepted worker settlement cannot collapse without changing cleanup semantics.
364 src/gateway/server-methods/chat-history-page-kernel.ts READ: Anchor-window and offset-tail algorithms protect different pagination and recovery contracts.
361 src/gateway/worker-environments/placement-move-service.ts READ: No sound simplification: ordinary reclaim, abandonment and restart recovery use different live-authority rules.
361 src/gateway/server-methods/chat-send-attachments.ts READ: Managed PDF fallback, sandbox staging, image capability and cancellation cleanup preserve distinct outcomes.
361 src/gateway/server-methods/chat-history-budget.ts READ: Byte accounting, activity omission, oversized placeholders and in-flight snapshots each preserve different visibility priorities.
354 src/gateway/worker-environments/workspace-manifest-worker.ts READ: Adapters own worker transfer buffers, memo publication and batch budgets; direct worker-context branches avoid recursive dispatch.
349 src/gateway/worker-environments/transcript-commit-store.ts READ: Sequence ledger checks enforce persisted replay and pending reservation ownership; no storage-contract changes attempted.
348 src/gateway/worker-environments/workspace-inventory-computation.runtime.ts READ: Candidate streams, selected ignored paths and inventory budgets retain distinct bounded I/O responsibilities.
344 src/gateway/server-methods/chat-send-request.ts READ: Validation order preserves exact Goal, continuation, mention, work-context and copilot wire errors.
340 src/gateway/server-methods/chat-send-user-turn.ts READ: Source input, approved text, prompt media and transcript media retain different stable-byte/custody contracts.
336 src/gateway/worker-environments/ssh.ts READ: No sound simplification: pinned-host and materialized-identity lifetime retain platform and transport contracts.
335 src/gateway/server-methods/plugin-approval.ts READ: APPLIED: select authoritative turn source once and replace local nullable-string normalization wrapper with the canonical normalization-core helper.
331 src/gateway/server-methods/session-active-runs.ts READ: Independent controller, subagent, projected and embedded owners retain different liveness/queued semantics; request-scoped indexes already prevent per-row controller rescans.
331 src/gateway/server-methods/conversations.ts READ: Shared write runner already owns send/turn dedupe; list and cancel remain separate contracts.
330 src/gateway/server-methods/config-write-flow.ts READ: Config publication, restart and shared-auth generation checks are distinct; candidate: inline one-use sentinel success wrapper.
325 src/gateway/server-methods/usage-date-range.ts READ: RETAIN: Canonical date owner preserves strict calendar round-trip validation, fixed-offset fallback, DST/day-line skipped dates, explicit-boundary atomicity, and historical UTC/default-range wire behavior.
322 src/gateway/server-methods/chat-history-session-read.ts READ: Resident sharing and excluded/retained transcript facts require separate materialization and disclosure revalidation.
319 src/gateway/worker-environments/store.kernel.ts READ: No sound simplification: operations preserve exact durable state checks and transaction ownership.
318 src/gateway/worker-environments/workspace-accepted-sync.ts READ: Replace pure instanceof forwarding predicate with direct existing error-class check; uncertain-publication rollback exclusion unchanged.
315 src/gateway/worker-environments/node-workspace-upload-reader.ts READ: No sound simplification: binary framing, streaming writes and post-I/O ownership checks each enforce distinct contracts.
315 src/gateway/worker-environments/node-worker-bundle-installer.ts READ: No sound simplification: shared install observations retain per-serve progress and per-environment subscription ownership.
314 src/gateway/server-methods/session-catalog-provider-access.ts READ: Provider admission, retained plugin consumers, completion callbacks and registry/config-derived caches own distinct lifetimes; direct-list and stepped-list adapters have different contracts.
308 src/gateway/server-methods/agent-session-patch.ts READ: Freshness, rotation fencing, inherited group provenance and clearing persisted state remain separate invariants.
307 src/gateway/worker-environments/worker-turn-media.ts READ: No sound simplification: current versus historical attachment availability and exact model frame limits have distinct contracts.
305 src/gateway/worker-environments/workspace-mutation-lock-remote-script.ts READ: Reclaim CAS and inode/owner validation fence concurrent processes; repeated observations are required live ownership checks.
304 src/gateway/worker-environments/placement-projector.ts READ: FOLLOW-UP: share the repeated optional ACK cursor projection for active and terminal states while preserving field presence.
303 src/gateway/worker-environments/workspace-reconcile-apply.ts READ: Use direct existing error-class check after removing pure instanceof forwarding helper; rollback and fencing unchanged.
303 src/gateway/server-methods/tts.ts READ: Retain distinct file-path and inline-audio responses and pre-synthesis request errors.
302 src/gateway/worker-environments/workspace-sync-inventory.ts READ: Scratch writers join before cleanup and retain independent output/cancellation ordering; no safe simplification found.
302 src/gateway/server-methods/session-catalog-list-lifetime.ts READ: Retain separate source accounting, subscriber preparation, publisher release and root admission custody; successful aggregate response does not mean background publication is finished.
295 src/gateway/worker-environments/placement-workspace-journal.ts READ: No sound simplification: active/draining/failed recovery ownership and snapshot hashes protect distinct persisted boundaries.
291 src/gateway/server-methods/web-search-status.ts READ: RETAIN: Prepared catalog/auth/metadata facts separate native, external, managed, and unavailable search routes; credential-source precedence and post-await catalog currentness are required.
289 src/gateway/worker-environments/skill-resource-transfer.ts READ: Generated resource protocol preserves per-chunk directory identities and bounded delivery; source selection distinguishes retained and skipped names.
289 src/gateway/server-methods/sessions-subscriptions.ts READ: RETAIN: Replay requires provisional subscribe before snapshot, bounded freshness renewal, current authority, and rollback; recent duplicate-validation removal in #161555 must remain.
288 src/gateway/server-methods/claws-monitors.ts READ: Monitor inspect/quiesce/drain share binding checks but need distinct scheduler and database fencing.
287 src/gateway/server-methods/users-personal-file.ts READ: RETAIN: Shared get/set owner retains original admitted person, live connection and role authority, workspace identity, safe no-alias filesystem reads/writes, and CAS serialization.
285 src/gateway/server-methods/plugin-host-hooks.ts READ: Retained plugin-provided JSON/schema checks and scope checks; typed registrations still cross untrusted plugin runtime boundaries.
283 src/gateway/worker-environments/service-contract.ts READ: No sound simplification: leaf request contracts intentionally avoid runtime import cycles and secret-bearing records.
282 src/gateway/server-methods/nodes.wake.ts READ: Retained wake versus nudge timing/projection differences and post-await liveness checks; two flows are not interchangeable.
280 src/gateway/server-methods/models-auth-status-usage-cache.ts READ: Retained credential-scoped cache identity, invalidation generations, refresh settlement ownership and timeout-specific last-good retention.
278 src/gateway/worker-environments/workspace-result-inventory.runtime.ts READ: Shipped v1 result refs and current v2 delta refs have named compatibility contracts; single/blob and batch readers have different framing.
276 src/gateway/worker-environments/placement-worker-gate.ts READ: No sound simplification: runtime refresh hands off result custody before rereading exact claim authority.
276 src/gateway/server-methods/update-status.ts READ: RETAIN: Manager/native history adapters preserve distinct ownership and reconciled reads; lifecycle currentness, restart admission, fallback sentinel, and effective-channel refresh cover real asynchronous boundaries.
275 src/gateway/worker-environments/store-row-codec.ts READ: No sound simplification: row codecs validate independent persisted shapes with named errors.
274 src/gateway/server-methods/sessions-patch-expectations.ts READ: RETAIN: Expectation checks and prepared storage/target custody protect different persisted and authority facts; cleanup aggregates independent owner failures in required order.
270 src/gateway/worker-environments/tunnel-contract.ts READ: No sound simplification: cleanup aggregation preserves disconnected-owner error precedence and transport capabilities remain explicit.
270 src/gateway/server-methods/sessions-messaging.ts READ: RETAIN: Send/steer share one dispatch owner; missing-main creation, idempotent archived replay, admitted-input authority, and accepted collector cleanup are necessary behavior.
269 src/gateway/server-methods/web-search.ts READ: RETAIN: Shared status preparation and authority predicate already own common behavior; read/admin scopes, live provider execution, sanitized errors, and final currentness checks differ intentionally.
267 src/gateway/server-methods/chat-send-commentary-media.ts READ: Progress-media writer captures exact transcript authority and stages/cleans media before publication; no redundant lifecycle.
267 src/gateway/server-methods/chat-broadcast.ts READ: Common frame owner already unifies final/error/delta; node alias projection and side replies have different identity rules.
266 src/gateway/server-methods/sessions-github.ts READ: RETAIN: Method factory already owns validation/error mapping; personal/shared publication reads and writes have distinct requester, lease, and post-await authority contracts.
266 src/gateway/server-methods/chat-send-command-replies.ts READ: Raw/prepared reply ownership, attachment matching and status semantics require separate merge paths.
266 src/gateway/server-methods/agents-workspace.ts READ: Shared read-only workspace scope already canonical; text and sniffed-image previews retain independent byte/error contracts.
265 src/gateway/server-methods/session-catalog-entry-snapshot.ts READ: Planning snapshots freeze adoption identities before IO while delivery projects current profile and session facts; consolidating those caches would weaken generation fencing.
264 src/gateway/worker-environments/node-workspace-transfer-http.ts READ: No sound simplification: manifest, verified blob, pack and upload have different post-await authority responses.
264 src/gateway/server-methods/update-report.ts READ: RETAIN: Report projection and preview/submit paths preserve exact failed-attempt identity, consent digest, original connection authority, redacted public projection, and owner/browser publication routing.
264 src/gateway/server-methods/agent-session-prepare.ts READ: Shared session-reuse policy already extracted; cron continuation and pre-attachment identity checks remain necessary.
263 src/gateway/server-methods/chat-user-turn-recorder.ts READ: Recorder composes Goal, mention and context-free command persistence at their synchronous owner boundary.
263 src/gateway/server-methods/chat-message-get-handler.ts READ: Exact message/pending input access and anchored visibility differ intentionally; repeated wire outcomes remain clear.
262 src/gateway/worker-environments/project-setup-script.ts READ: No sound simplification: setup publication invalidates completion before mutation and verifies standalone Git and manifest owners.
260 src/gateway/server-methods/approval-visible-record.ts READ: Visibility, durable reconciliation and manager-local binding checks guard different states.
259 src/gateway/server-methods/models-auth-status-facts.ts READ: Retained source-specific auth-provider inclusion and semantic cache invalidation; external CLI freshness requires its independent reader.
259 src/gateway/server-methods/environments.session.ts READ: Caller owner resolver is shared; create/status/destroy have distinct service and post-await revalidation contracts.
259 src/gateway/server-methods/chat-origin-routing.ts READ: Explicit, inherited CLI and internal routes differ intentionally; local ACP-any-segment predicate differs from shared prefix predicate, so cannot simply replace.
257 src/gateway/worker-environments/session-attachment-store.ts READ: Atomic attachment reservation, close and cancellation transitions preserve their persisted identity contract.
255 src/gateway/server-methods/approval-record-lookup.ts READ: Canonical visibility and pending/resolved lookup owners already shared.
254 src/gateway/server-methods/tools-catalog.ts READ: Applied: inline single-use catalog assembly into its RPC handler; retain separate core/plugin projection owners.
254 src/gateway/server-methods/exec-approvals.ts READ: Node handler already unified; local CAS and native-node config shapes differ. Candidate: schema-proven file cast/check cleanup.
253 src/gateway/server-methods/chat-history-pages.ts READ: Local CLI import identity merging differs from worker page projection; guarded fallback and cursor semantics retained.
252 src/gateway/worker-environments/artifact-transfer-http.ts READ: No sound simplification: stream completion, range offsets and descriptor cleanup preserve separate invariants.
251 src/gateway/worker-environments/portal-node-carrier.ts READ: No proven defect: real node invoke cancellation retires and resolves synchronously; portal service serializes and joins pending closes.
246 src/gateway/worker-environments/workspace-reconcile-preflight.ts READ: Structural ancestor conflicts and deletion convergence differ from leaf content conflicts; cached snapshots are bounded to one pass.
245 src/gateway/server-methods/github-personal-authorization.ts READ: Read and write paths intentionally retain distinct connection, role, session visibility and mutation revalidation contracts.
244 src/gateway/worker-environments/workspace-hash-memo.ts READ: One generated helper already serves host/worker stat identity and memo selection; lifecycle pruning and worker metric ownership are necessary.
243 src/gateway/worker-environments/worker-turn-attachments.ts READ: No sound simplification: remote directory/file identity and chunk publication fences differ from normal workspace transfer.
242 src/gateway/server-methods/session-catalog-visibility.ts READ: Initial planning access and final per-page access use different moments; provider audience, current adoption and read-versus-mutate sharing checks remain distinct.
241 src/gateway/server-methods/agent-session-reset.ts READ: Reset result projection retains incognito no-session contract and delivery ownership; fallback load types merit later review.
239 src/gateway/worker-environments/service-validation.ts READ: No sound simplification: provider boundaries require closed projections and preserve specific invalid-result errors.
238 src/gateway/worker-environments/workspace-reconcile-fs.ts READ: Absolute and root-contained reads serve distinct callers; directory helpers distinguish empty, derived and journal-owned trees.
238 src/gateway/server-methods/approval-request-authority.ts READ: Source-narrowed policy, request/worker guard and revoke/restore observation protect different live authority states.
237 src/gateway/server-methods/wizard.ts READ: Retain shared wizard admission and terminal settlement before response; paths differ in cancellation ownership.
236 src/gateway/server-methods/commands-list-result.ts READ: Native/skill/plugin projection bounds retained; candidate: direct map for plugin entries instead of push loop.
236 src/gateway/server-methods/chat-transcript-inject.ts READ: Settled-producer and ordinary transcript append use different authoritative write owners and duplicate suppression.
235 src/gateway/worker-environments/artifact-transfer-service.ts READ: No sound simplification: bearer grants retain active serve identity and revocation/expiry lifecycle.
235 src/gateway/server-methods/chat-webchat-media.ts READ: Trusted local audio, data images and transcript captions have distinct allowlist/read/size rules; media preservation remains intentional.
234 src/gateway/worker-environments/computer-service.ts READ: No sound simplification: retained closing promise correctly joins exact native cleanup across concurrent shutdown.
232 src/gateway/server-methods/audit.ts READ: Legacy and activity projections preserve shipped schema variants; source/run cursor contracts differ.
231 src/gateway/server-methods/cron-runs.ts READ: All-job and exact-job history have different deletion visibility and authorization; shared page projection owner already used.
231 src/gateway/server-methods/agent-reset-phase.ts READ: Reset commit, follow-up input and reply delivery keep independent accepted/result settlement state.
224 src/gateway/server-methods/web.ts READ: RETAIN: Login provider/request resolution already shared; start and wait intentionally differ in account stop/restore timing, QR takeover, and running-state fallback.
224 src/gateway/server-methods/chat-history-delta.ts READ: Delta reset fallback, source projection and bounded activity envelope use required separate contracts.
223 src/gateway/server-methods/system-agent-setup-wizard.ts READ: RETAIN: Provider-auth replacement queue preserves predecessor settlement, cancellation locks, newest-request admission, pending IDs, and denied-caller error custody.
223 src/gateway/server-methods/sessions-groups.ts READ: RETAIN: Group owners implement put/rename/delete/update semantics; unconditional final invalidation for partial moves differs from successful-put publication.
222 src/gateway/server-methods/update-admission.ts READ: RETAIN: Shared update admission owns OCM handoff, current requester, install ownership inspection, and failure ledger projection; helper failure record formats intentionally differ.
222 src/gateway/server-methods/cron-history.ts READ: Recorded-run cursor is bound to physical transcript identity and revalidated by retained history owner.
218 src/gateway/worker-environments/node-worker-workspace-fallback.ts READ: No sound simplification: local origin eligibility and remote checkout fallback have independent failure semantics.
218 src/gateway/server-methods/health.ts READ: Cached and fresh health paths intentionally differ in enrichment and background scheduling.
216 src/gateway/worker-environments/local-workspace-archive.ts READ: Pass current authority callback directly to archive staging and retirement; durable restore receipts and cleanup remain unchanged.
216 src/gateway/server-methods/device-scope-upgrade.ts READ: Request and wait preserve different current paired identity/role ceilings; no safe guard removal.
215 src/gateway/server-methods/session-catalog-list-operations.ts READ: Caller-scoped enumeration keys, registry retirement and cached fallback pages retain different ownership; one-second budget releases response only, never source work.
213 src/gateway/server-methods/session-catalog.ts READ: Read, continue and archive share registration/authorization owners; their separate creation policy, provider mutation and result handling are required.
213 src/gateway/server-methods/chat-send-work-admission.ts READ: Reference-counted queued custody and Goal commit guard retain required release/authority ordering.
211 src/gateway/worker-environments/placement-disk-space.ts READ: No sound simplification: safe integer wire projection, binding freshness and stale-build suppression have distinct contracts.
211 src/gateway/server-methods/nodes.pending-work.ts READ: Retained drain/enqueue pairing fencing and wake stages; apparent redundant parameter cast bridges protocol Type.String enum typing and runtime literal unions.
210 src/gateway/worker-environments/store-validation.ts READ: No sound simplification: persisted transport, receipt and credential validators retain named errors and normalization.
210 src/gateway/server-methods/core-handlers.ts READ: Explicit lazy import registry retains static bundler edges and family rejection caching; generated descriptors would add an owner.
209 src/gateway/server-methods/tools-github.ts READ: RETAIN: Canonical agent scope and OAuth/profile services own resolution; configure consumes one handoff credential and CAS identity, while start/poll/cancel retain distinct errors and lifecycle operations.
209 src/gateway/server-methods/chat-send-turn-adoption.ts READ: Queue adoption, pending withdrawal and terminal source publication share distinct cancellation versus execution custody.
206 src/gateway/server-methods/chat-metadata-session-projection.ts READ: Prepared catalog owner shared; per-session native auth presentation remains a deliberate uncached overlay.
205 src/gateway/worker-environments/workspace-reconcile-core.ts READ: Canonical comparison and directory mutation owners already shared; manifest inspection and final verification are separate concurrency fences.
203 src/gateway/worker-environments/workspace-git-base.ts READ: Pinned Git snapshot and thin-pack donor paths retain distinct immutable-object and bounded-output contracts.
203 src/gateway/server-methods/cron-input-validation.ts READ: Authored input before normalization and post-patch routing checks enforce distinct error order and compatibility semantics.
203 src/gateway/server-methods/agents-config-mutations.ts READ: Config retry callbacks revalidate model selection at persistence owner; optional deletion hooks are caller contracts.
202 src/gateway/worker-environments/tunnel.ts READ: No sound simplification: retained owner set and shared stop promise protect reentrant teardown through physical cleanup.
202 src/gateway/worker-environments/store-mutations.ts READ: No sound simplification: update wrapper returns validated postimage; global epoch and attachment repair preserve storage ownership.
202 src/gateway/worker-environments/provider-machine-catalog.ts READ: No sound simplification: catalog reload invalidation and immutable allocation display facts are separate concerns.
201 src/gateway/server-methods/portals.ts READ: Retained attached environment authority, resource cleanup, redacted events and protocol-specific error distinction.

@clawsweeper

clawsweeper Bot commented Sep 30, 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 gateway Gateway runtime size: L labels Sep 30, 2026
@steipete
steipete enabled auto-merge (squash) September 30, 2026 07:57
@clawsweeper

clawsweeper Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 30, 2026, 5:06 AM ET / 09:06 UTC (Revision 3).

ClawSweeper review

What this changes

The branch consolidates Gateway request validation and response handling, Doctor status ordering, and worker bootstrap and workspace helpers without intending to change their results.

Merge readiness

⛔ Blocked before merge - 3 items remain

Keep open. Current main does not contain this distinct cleanup, and source review found no concrete patch defect. The required published-updater compatibility proof remains outstanding.

Priority: P3
Reviewed head: 794b59368258338b94758cf7d5e0750e8d0e7374

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The consolidation and focused validation are credible, while required existing-install upgrade proof remains 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 10 items Doctor change: The branch replaces the local bounded selection with the shared stable sorting helper for all three dreaming entry lists.
Existing sorting contract: The shared helper inserts equal entries after earlier entries and bounds the selected list, matching the removed local selection's relevant ordering behavior.
Worker bootstrap change: The introduced installer still selects SHA-256 for bundles and SHA-512 integrity for npm packages before extraction, while sharing the verifier and observed-lock cleanup.
Findings None None.
Security None None.

How this fits together

Gateway RPC handlers turn client requests into diagnostics, plugin details, desktop actions, and node events. The worker-environment layer provisions workers and reconciles their workspaces, returning receipts and placement state to the Gateway.

flowchart LR
  A[Gateway clients] --> B[RPC handlers]
  B --> C[Validation and projections]
  C --> D[Client responses]
  B --> E[Worker placement]
  E --> F[Bootstrap and workspace sync]
  F --> G[Worker receipts]
Loading

Before merge

  • Resolve merge risk (P1) - A published updater has not been exercised against this candidate with existing operator state; a post-update Doctor status or worker bootstrap failure could remain unseen.
  • Complete next step (P2) - Record a published-updater × candidate run with copied existing operator state, including Doctor status and successful worker bootstrap.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source -113, Tests -4. Total -117 across 15 files.

View PR surface stats
Area Files Added Removed Net
Source 14 174 287 -113
Tests 1 1 5 -4
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 15 175 292 -117

Review metrics

None.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/gateway/server-methods/doctor.ts, unknown-data-model-change: src/gateway/server-methods/doctor.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Prove the update path (recommended)
    Run a published updater against the candidate using a copy of existing operator state, then record the Doctor status and worker bootstrap outcomes.

Technical review

Best possible solution:

Keep the shared-owner cleanup once an existing installation can update to the candidate and still report Doctor status and provision a worker successfully.

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

Not applicable: this PR claims a behavior-preserving cleanup rather than a current-main defect.

Is this the best way to solve the issue?

Yes. The branch reuses existing validation and sorting owners and retains the observed authority checks; the update path still needs its required proof.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is an internal cleanup with no intended user-visible behavior change.
  • merge-risk: 🚨 compatibility: Doctor and worker bootstrap run in existing installations, but the required published-updater compatibility case is unproven.
  • 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:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Patrick Erichsen: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

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

  • Record a published-driver × candidate upgrade result covering Doctor status and worker bootstrap with existing 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 (2 earlier review cycles)
  • reviewed 2026-09-30T07:58:09.088Z sha f65decc :: blocked before merge. :: none
  • reviewed 2026-09-30T08:32:04.725Z sha 7c69cf3 :: blocked before merge. :: none

@steipete
steipete disabled auto-merge September 30, 2026 08:07
@steipete
steipete enabled auto-merge (squash) September 30, 2026 08:26
@steipete
steipete disabled auto-merge September 30, 2026 08:29
…d pass

Reuse canonical validation, sorting, normalization and placement helpers.
Consolidate duplicate RPC and workspace projections while preserving wire
errors, current-owner revalidation, worker fencing and persisted state.

Third-pass maintainer sweep following #159752 and #161284. No user-visible
behavior or protocol change is intended. Retain existing recovery assertions.
@steipete
steipete force-pushed the deslop/l213-gateway-methods3 branch from 7c69cf3 to 794b593 Compare September 30, 2026 08:59
@steipete
steipete enabled auto-merge (squash) September 30, 2026 09:01
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 30, 2026
@steipete
steipete disabled auto-merge September 30, 2026 09:27
@steipete
steipete merged commit 73ca63c into main Sep 30, 2026
264 of 268 checks passed
@steipete
steipete deleted the deslop/l213-gateway-methods3 branch September 30, 2026 09:27
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 1, 2026
…d pass (openclaw#161737)

Third-pass maintainer-requested Gateway cleanup following openclaw#159752 and openclaw#161284.
Reuse canonical validation, stable bounded sorting and placement matching; consolidate RPC and workspace projections and remove forwarding wrappers.

Preserve protocol, RPC results and errors, live-owner authority, worker lifecycle/fencing and persisted state. No user-visible behavior change is intended. Drop overlaps already landed in openclaw#160444, openclaw#161085 and openclaw#161642.

Validation: independent Codex review clean at P0-P2; both import-cycle checks report zero; lint clean; 401 tests passed across 28 files and five Vitest shards, with one existing opt-in Podman skip. Rebased protocol generation has zero drift and SDK export/surface checks pass. Full source reading covered 645 production files at the starting base.

Hosted CI run 36693161484 executed its build/test lanes. The sole failed test, session-activity-summaries.test.ts relocated-store recovery (expected 2 to be 3), also fails on unrelated PR openclaw#161714 head 8080a45, run 36692028664 job 109811633901. The changed RPC/workspace code is outside the failing execution path. Land under the explicitly authorized pre-existing-failure exception; retain this failure for the main-CI coordinator.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime 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. size: M 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