Skip to content

refactor(infra): deslop infrastructure and outbound - #164046

Merged
steipete merged 5 commits into
mainfrom
deslop/l336-simplify-infra-root-n-z-outbound-20261002
Oct 3, 2026
Merged

steipete merged 5 commits into
mainfrom
deslop/l336-simplify-infra-root-n-z-outbound-20261002

Conversation

@steipete

@steipete steipete commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Infrastructure maintenance requires tracing one-use forwarding layers, duplicate projections, and unused internal options around otherwise necessary delivery, migration, and native-resource owners.

User Impact

No user-visible behavior change. Configuration, persisted state, public SDK contracts, command output, delivery ordering, egress enforcement, and authority checks retain their existing behavior. No operator action or migration is required.

Why This Change Was Made

This batch removes 944 net production lines across 67 production files, plus two test/support updates. The batch removed 1,002 lines before the final rebase; fresh main already contains 58 lines of those simplifications. The full coverage log is attached below. It keeps the lifecycle and recovery machinery that enforces real contracts and simplifies the code surrounding those owners.

Area Simplification and rationale
Shell wrappers Replace generic recursive state callbacks and wrapper descriptors with a bounded concrete walk and shell kinds; retain depth and startup restrictions.
Command requests Use one argv formatter and inline single-call display/validation projections; retain the existing export and mismatch diagnostics.
Package managers Share pnpm/yarn exec and dlx parsing; derive recognized npm options from the existing context-option set.
Proxy probes Share allowed/denied fetch setup, inline one-use APNs validation, and derive generated-canary handling from its existing token.
Runtime discovery Parse lsof rows directly; document why the native Node bootstrap keeps its small cache loop local.
Push results Project APNs results directly and retain each Web Push subscription in its rejection handler instead of reconstructing it by index.
Outbound routing Remove one-use channel factories, target-prefix forwarding, alias wrapper records, and multi-stage peer-kind helpers.
Media payloads Reuse canonical first-wins indexing and media-source selection; keep alias precedence and selected-media behavior.
Delivery execution Replace a per-payload map with the current payload's fact, merge redundant diagnostic flags, and remove unused source-delivery inputs and projections.
Queue media Inline the only prune caller and remove its unused grace-period knob; keep the captured retention snapshot and orphan window.
Outbound audit Inline sent-result lookup and combine identical terminal/lifecycle projection branches without changing completion ownership.
Usage reporting Inline a one-use summary-finishing helper that only forwarded its caller's prepared values.
SQLite helpers Use canonical rollback and busy-timeout owners; remove one-use BEGIN and prepared-location forwarding.
SQLite snapshots Consume admitted native locations and remove unused telemetry knobs; retain cancellation, custody, disposal, and retry behavior.
Doctor orchestration Return preparation and remaining steps explicitly; share refused-plan construction and thrown-step receipt/tail settlement without changing callback or warning order.
Transcript migration Reuse the canonical query and row projection while preserving exact legacy metadata; remove event-identity rechecks where the local transform only replaces message.
Importer plumbing Remove audit witness/retry forwarding, infer ACP parser types, inline single-use TUI/source helpers, and remove ignored session-store options.
Workspace migration Share source traversal and receipt operations and collapse duplicated attestation replacement branches; preserve source priority and durable receipts.
Worker cleanup Replace synchronized cleanup Set/WeakMap state with one Map and remove unused retirement projections.
Platform helpers Avoid duplicate WSL kernel reads, inline Windows registry forwarding, and reuse existing normalization/error predicates.
Update reporting Reuse the existing receipt mutation/CAS owner, inline display/step forwarding, and remove a schema used only to infer an internal type.

Fixes found along the way

The generic resource-worker fixture eagerly loaded auth and database modules before handling even an in-memory retain/wait request. Two retained-worker cases hit their unchanged startup deadline during the loaded-host fallback run. Load those exact modules only for a database request, within the existing awaited handler; keep the real database-deletion sibling coverage and all assertions/deadlines.

Update five SQL expectations to the canonical busy-timeout setter spelling, preserving exact values, call counts and ordering. July 2026 and later migration contracts remain supported; active overlapping work and recently changed updater lifecycle files were excluded.

Evidence

  • Linux owner/sibling proof before the final main integration: 111 files passed, 2,167 tests passed, 5 existing platform skips.
  • Rebased source tree: both import-cycle checks reported 0; all 306 tests in 11 affected channel/migration suites passed.
  • Retained-worker stability: pnpm test src/infra/worker-task-pool.retained.test.ts --repeats 19 --maxWorkers=1 passed all 100 executions on Linux (50.24 seconds wall). The same 100 executions passed on the loaded Mac (328.70 seconds wall).
  • WAL proof: pnpm test src/infra/sqlite-wal.test.ts --maxWorkers=1 passed 59 tests on Linux (36.16 seconds wall; Vitest file duration 32.83 seconds). Values, counts, and ordering assertions remain exact.
  • The real-Gateway database recreation/deletion sibling passed both cases with the lazy fixture imports.
  • Independent Codex reviews, including the native-bootstrap, discriminated-union, and lint corrections, were clean through P2. Native Node bootstrap loading, core production types, core/scripts lint, coercion checks, deprecated API checks, and all three unused-export scans passed. The final correction passed 152 fast tests plus 58 infrastructure tests. All 27 canonical core-test type graphs passed across the resumed runs, including the corrected services graph; every selected changed-check gate has completed successfully.
  • Blacksmith did not allocate a runner; AWS broker/sync attempts failed. Final remote proof ran on a task-owned Hetzner Linux lease with exact changed-file hashes and Git-tree identity checks. Early loaded-Mac runs exposed the fixture startup issue and SQL expectation drift; the unchanged Telegram public-facade cases timed out locally and passed in the full Linux run.

The pre-rebase source tree (including the generated assertion-baseline reduction) matched the candidate Git tree exactly. Both node --import ./scripts/tsx.mjs scripts/check-madge-import-cycles.ts and node --import ./scripts/tsx.mjs scripts/check-import-cycles.ts reported 0 cycles.

Final rebase is onto 7ff3b3be3713751de356800167d67ce752ad0d04. Main's shared snapshot telemetry and session-key option owners are preserved. Assertion-baseline conflicts retain the lower count per entry, including main's existing count of 2 for unhandled rejections. Independent rebase review is clean through P2. On the exact rebased Git tree, both cycle checks reported 0, the assertion SAFETY ratchet passed, and all 15 affected test files passed: 340 tests passed with 2 existing skips (144.76 seconds across three shards). Hosted CI will gate the published head.

Hosted CI on ad82746ed4997e578e90282b5c30788facdb7aab completed in run 37098654155. All other CI jobs passed or were intentionally skipped; two jobs failed, plus the aggregate gate:

  • Published driver update: driver 2026.9.8 fails package-verify with Invalid package dist content inventory at dist/postinstall-content-inventory.json: expected packaged file hashes and executable bits to match current dist files. The published-driver-update artifact's update.stdout matches the same step and message in main run 37097223041, job 111131015571, head f3b754f361175b52b86d1d6c9b63affdb354b10e. Package installation and predecessor Gateway recovery pass in both. Published-driver harness and package-inventory sources are identical between that main baseline and this PR. This failure is qualified as inherited.
  • checks-node-changed-compact-small-1: the compiler reports Boundary configuration or resolution topology changed during compilation, naming removal of the three .cold-facade-*/fixture source/manifest files. The facade fixture passed and removed its files while shared subprocess compilation was active; dependent suites then fail before assertions. The facade fixture and compiler/cache owners are unchanged versus main. A bounded search did not find an independent current hosted run with this same race, so it remains unqualified for the inherited-failure exception.

Squash auto-merge is enabled for the reviewed head. No admin merge has been submitted; the compiler-race qualification remains the landing blocker. No CI rerun or refresh push was performed.

Full production-file coverage (including excluded owners)

l336 coverage log

Sizes reflect the final rebased tree. READ dispositions come from the completed file-by-file lane reports. Explicit exclusions retain their overlap or recent-lifecycle reason. Fresh main already contains 58 lines of the original 1,002-line reduction; the final PR removes 944 net production lines.

Lines Production file Disposition
3312 src/infra/state-migrations.doctor.ts READ — explicit preparation/remaining steps replace positional slicing, ID filters and impossible guards; share refusal projection and failed-step tail settlement; use canonical config record coercion. Keep all July-era migrations, modes, receipts, refusal checks, callback order, warnings, and notices.
2388 src/infra/update-managed-service-handoff.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
1359 src/infra/update-global.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
1301 src/infra/outbound/delivery-queue-recovery.ts READ — Unchanged: recovery distinguishes active owners, post-send uncertainty, retries, admission closure and terminal cleanup; all exported entry points have real callers and reconciliation/lease boundaries are required.
1123 src/infra/npm-managed-root.ts READ: Peer ownership, npm override reconciliation, platform-package verification and host-link cleanup each enforce distinct installation contracts.
1026 src/infra/state-migrations.session-store.ts READ — retained main canonicalizer options and inlined the one-use surface-group predicate; alias precedence and shared-store ownership remain intact.
1012 src/infra/restart.ts READ: Admission fencing, parked acknowledgement hooks, coalescing and bounded drain state preserve live restart ordering; no isolated simplification found.
760 src/infra/net/fetch-guard.ts READ: Strict/trusted proxy branches, per-hop DNS/authority checks and redirect replay rules are distinct security contracts; retained.
752 src/infra/update-check.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
740 src/infra/worker-task-pool-core.ts READ; retained admission, queued preparation, reply validation, native sections, host exchange and retirement ordering; recent agent-reader fencing is intentional.
739 src/infra/update-candidate-state.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
738 src/infra/package-update-swap.ts SKIPPED: open deslop PR / concurrent lane reservation
737 src/infra/net/ssrf.ts SKIPPED: open deslop PR / concurrent lane reservation
728 src/infra/sqlite-worker-broker.ts READ — FIFO, per-slot capacity, original actor identity, drainage, and settlement are one broker owner; no removable parallel flow.
727 src/infra/sqlite-snapshot-staging-owner.ts READ — Retained synchronous servicing tracks native directory custody across VM loss; async-only replacement would weaken cleanup.
726 src/infra/update-startup.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
726 src/infra/outbound/deliver-queue-execute.ts READ — Unchanged: excluded by PR #161513 (deslop/l201-infra7).
720 src/infra/state-migrations.meeting-transcripts-files.ts READ. Staging, source hashes, no-symlink boundaries, rollback, and canonical-export restoration protect distinct failure stages; retained.
718 src/infra/update-candidate-canary.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
718 src/infra/package-update-steps.ts SKIPPED: open deslop PR / concurrent lane reservation
717 src/infra/session-event-wake.ts READ — Queue generations, retained retries, global barriers, waiter settlement, and store ownership are active contracts; no sound simplification that preserves them remained.
714 src/infra/sqlite-readonly-location.ts READ — Removed constant reporter arguments; byte-coherence, journal recovery, descriptor identity, and sync/async drivers remain required.
713 src/infra/update-managed-service-handoff-lease.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
709 src/infra/sqlite-snapshot.ts READ — Exclusive publication, pinned file identity, hardlink fallback and cleanup recovery each enforce a distinct durability boundary.
706 src/infra/outbound/message-action-runner.ts READ — Unchanged: excluded by PR #161513 (deslop/l201-infra7).
705 src/infra/state-migrations.audit-logs.ts READ. Claims, append-only generations, scrub checkpoints, and quarantine outcomes are real recovery/security contracts; retained.
703 src/infra/state-migrations.meeting-transcripts.ts READ. Pending-receipt recovery and archive-before-finalization ordering are required; verification simplification is in its helper.
701 src/infra/update-runner-git-preflight.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
700 src/infra/update-runner-git-target.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
694 src/infra/outbound/targets.ts READ — Unchanged: excluded by PR #161513 (deslop/l201-infra7).
693 src/infra/session-cost-usage-rollup.ts READ — Per-bucket floating-point order, latency centroids, tie ranking, and date/model accumulator variants carry distinct semantics; kept the shared accumulators.
689 src/infra/update-candidate-plugin-tree.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
689 src/infra/system-run-mutable-file-operand.ts READ — Runtime-specific option scans enforce approval binding and distinguish mutable operands from startup/loading flags; kept fail-closed branches.
685 src/infra/session-sqlite-migration-manifest.ts READ — Durable recovery receipts, V1 path canonicalization, and source/archive containment date to July 2026; retained shipped recovery compatibility and durability checks.
680 src/infra/update-runner-git.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
677 src/infra/tailscale.ts READ; replaced local object-shape casts/checks with existing array-permitting record coercion and inlined one-use test-binary selector; route authority, serialized ownership, retries and hostname/whois contracts retained.
673 src/infra/outbound/message-action-execution.ts READ — Unchanged: excluded by PR #161513 (deslop/l201-infra7).
671 src/infra/update-recovery-baseline-capture.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
661 src/infra/state-migrations.runtime-state.ts READ. JSON import/commit/archive ordering is shared already; current-conversation normalization differs from the private runtime key owner, so no new leaf or cross-owner change.
658 src/infra/outbound/source-reply-mirror.ts READ — Unchanged: terminal restart receipts, source completion and transcript mirrors have distinct eligibility; recipient/thread evidence and awaited alias authority cannot be merged safely.
656 src/infra/package-update-filesystem.ts SKIPPED: lifecycle changed within 48 hours
653 src/infra/session-sqlite-migration-readers.ts READ — Streaming import planning, byte fingerprints, bounded compaction targets, and read-only schema projections support July 2026 migration shapes.
652 src/infra/package-local-overrides.ts SKIPPED: lifecycle changed within 48 hours
651 src/infra/update-failure-report.ts READ — combined identical pending/retryable/stale result variants; retained submission authority, private artifact ownership, ambiguous transport reconciliation, and all messages.
651 src/infra/system-run-approval-binding.ts READ — Prepared identity, PATH selection, mutable-byte snapshots, and post-await authority are distinct security contracts; retained boundary validation.
648 src/infra/outbound/current-conversation-bindings.ts READ — Unchanged: shipped synchronous SDK operations and worker-backed internal reads are both used; registry snapshots and callbacks fence asynchronous ownership.
647 src/infra/sqlite-readonly-worker.ts READ — Scope and one-shot transports have distinct native lock isolation and close semantics; budgets and cancellation preserve caller authority.
646 src/infra/package-root-imports.ts READ: Lexical binding, immutable-prefix and caller-vs-root provenance cases are required for conservative package ownership analysis.
645 src/infra/outbound/message-action-send.ts READ — Unchanged: attachment precedence, mutation ordering, TTS, session commit and gateway/core custody paths have distinct user-visible contracts.
644 src/infra/state-migrations.plugin-doctor.ts READ. Distinct detection, offline authority, completion certification, and post-lease settlement paths are required; retained.
642 src/infra/sqlite-schema-contract.ts READ — Excluded from edits: concurrent l315 / PR 163840 owns this path; canonical schema inspection still read for caller context.
638 src/infra/update-run-recovery-schema.ts READ; retained strict persisted recovery invariants and separate legacy inspection/current mutation schemas. Legacy receipt support originated September 2026, inside the retained migration window; removing it changes historical inspection and recovery refusal.
634 src/infra/restart-stale-pids.ts READ: Native enumeration, protected ancestry, process identity and signal timing differ by platform and remain required.
627 src/infra/state-migrations.workspace-setup.ts READ. Unified identical setup and state-root attestation discovery loops with their existing kind/path descriptors; retained separate sibling-attestation admission and every priority/identity check.
622 src/infra/windows-gateway-firewall-diagnostics.ts READ; EXCLUDED from edits because deslop-17 already owns this file.
620 src/infra/ports-inspect.ts READ: Applied direct lsof connection parsing; removed the single-use intermediate listener-array projection.
620 src/infra/outbound/message.ts READ — Unchanged: direct/gateway send and poll paths preserve different payload, authority and durable-result contracts; lazy facades keep expensive runtime imports cold.
616 src/infra/outbound/session-binding-service.ts READ — Unchanged: public synchronous adapter compatibility, native ordered selection, stacked registration ownership and asynchronous retirement checks all have current consumers.
606 src/infra/state-migrations.media-persistence.ts READ. Supported schema admission, owner-held maintenance, source drift, and archive ownership have separate contracts; retained.
606 src/infra/package-update-publication-owner.ts SKIPPED: open deslop PR / concurrent lane reservation
602 src/infra/outbound/message-action-params.ts READ — Unchanged: excluded by PR #163840 (deslop/l315-deslop-commands-cli-infra-20261002).
593 src/infra/update-recovery-backup-reader.ts READ; removed an unused runtime schema built only to infer Outcome, removed terminal-schema alias and one-use digest-schema alias, used direct strict-object constructors, and replaced duplicate generation-digest branches with the known-key assignment. Retained all authority, pin, fingerprint, scope, and capture-lineage checks.
589 src/infra/sqlite-snapshot-single-flight.ts READ — Lease accounting and synchronous servicing retain original producer cleanup on cancellation; eager generic map replacement would change reentrancy.
589 src/infra/session-cost-usage-worker.ts READ — Overlap guard: l315 / PR #163840 owns this file; READ for projection caller context and left untouched.
584 src/infra/push-web-store.kernel.ts READ: Transaction admission, browser/profile binding, recovery delivery custody and current-row deletion are independent storage contracts.
581 src/infra/state-migrations.workspace-setup-store.ts READ. Collapsed duplicated attestation replacement branches into one write path after the same timestamp/hash/receipt-priority decision; no SQL or receipt policy changes.
581 src/infra/outbound/deliver-queue.ts READ — Unchanged: public authority stripping, stable preparation serialization, reusable queue ownership and producer lease lifecycle are required distinct paths.
580 src/infra/state-migrations.audit-recovery.ts READ. Partial-write progress journal and same-inode scrub/restore handling are required for predecessor append descriptors; retained.
577 src/infra/sqlite-readonly-location-cleanup.ts READ — Collapsed extra createPreparedLocation forwarding layer into the retained adoption owner; original removal and reader fences preserved.
575 src/infra/triage-continuation.ts READ; live IPC, lease identity, parent custody and uncertain-cleanup recovery are distinct contracts; no sound simplification remains.
575 src/infra/provider-usage.auth.ts SKIPPED: open deslop PR / concurrent lane reservation
575 src/infra/outbound/delivery-queue-migration.ts READ — Unchanged: D4 migration was introduced July 30, 2026, and handles supported July-plus persisted rows; preparation leases and media custody must survive interrupted upgrades.
571 src/infra/state-migrations.shared-auth-store.ts READ. Copy, ownership publication, receipt rewrite, and source cleanup are distinct crash-recovery boundaries; retained.
568 src/infra/session-cost-usage-worker-runtime.ts READ — Worker/host effects, captured database identity, lock authority, and cancellation cleanup remain required; retained worker and memory boundaries.
568 src/infra/restart-sentinel.ts SKIPPED: lifecycle changed within 48 hours
567 src/infra/package-update-integrity.ts SKIPPED: lifecycle changed within 48 hours
566 src/infra/shell-wrapper-resolution.ts READ — APPLIED: replaced generic recursive state-callback unwrapping and wrapper-spec registry with a bounded concrete loop and shell kinds; shared the canonical argv formatter.
566 src/infra/package-update-activation-journal.ts READ: Read fully; bounded row decoding, inode custody, hot-journal recovery and revalidated commit/publication checks must remain separate.
563 src/infra/provider-usage.fetch.minimax.ts SKIPPED: open deslop PR / concurrent lane reservation
561 src/infra/state-migrations.legacy-session-store.ts READ. Removed ignored cache/clone/partial-persistence option declarations and two one-use plugin-state normalizer wrappers; normalization order and maintenance behavior retained.
557 src/infra/outbound/deliver-channel.ts READ — Unchanged: legacy outbound and message adapters have named public contracts; dispatch fences, send lifecycle hooks, receipt normalization and scoped runtime calls remain required.
556 src/infra/state-migrations.legacy-sessions.ts READ. Retained source ownership, SQLite-family deferral, reversible file moves, quarantine and rollback; pre-July retirement was already landed.
555 src/infra/update-run-report.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
555 src/infra/sqlite-wal.ts READ — Reused canonical setSqliteBusyTimeout instead of duplicating validation and PRAGMA writing; scheduler, checkpoint and native-close lifecycle unchanged.
554 src/infra/state-migrations.transcript-directives-archives.ts READ. Canonical blobs, derived archive files, verification receipts and live-authority checks own separate persistence contracts; retained.
552 src/infra/update-failure-report-receipt-store.ts READ — used existing mutateReceipt owner for stale-preparation cleanup and sweep claim, preserving every guard, timestamp capture point relative to valid-row admission, CAS revision, and serialized field; removed one-boolean URL-validator option bag.
548 src/infra/session-cost-usage-collection.ts READ — JSONL/archive/SQLite discovery share precedence but have distinct identity and materialization contracts; recent canonical-locator fix retained.
545 src/infra/worker-native-lifecycle.ts READ; retained source generation, native owner receipt, broker resource and aggregate-cleanup semantics; recent supervisor-loss work is excluded from edits.
542 src/infra/outbound/deliver-core.ts READ — Replaced the per-payload delivery-kind Map with the current sequential payload value, collapsed diagnostic flags, and removed redundant handler/payload aliases.
537 src/infra/update-candidate-plugins.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
534 src/infra/update-runner-git-runtime.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
533 src/infra/state-migrations.debug-proxy.ts READ. No edit: overlapping lane l315 / PR #163840 owns this file.
531 src/infra/state-migrations.managed-outgoing-images.ts READ. Removed one-use path wrapper; claims, original-file ownership checks, transient expiry, and rollback remain.
528 src/infra/update-run-ledger.ts READ; forwarded step input directly to applyUpdateRunStep, which already owns reason extraction. Preserved admission, transaction, driver lineage, and recovery exclusion.
528 src/infra/restart-intent.ts READ: Retained v2026.9.4 upgrade reader, current-owner admission and compare-and-delete receipt semantics.
527 src/infra/sqlite-transaction.ts READ — Inlined single-use beginTransaction forwarding helper; BEGIN diagnostics, nested savepoints, deadlines and COMMIT fencing unchanged.
524 src/infra/sqlite-readonly-native-resource.ts READ — Native process owner must survive target Worker loss; allocation acknowledgements and reader retirement cannot merge with transport.
520 src/infra/shell-env.ts READ — Sync and async probes deliberately differ to preserve controlling-terminal isolation and child-pipe timeout ownership; successful-probe caching has repeated call paths.
512 src/infra/state-migrations.source-snapshot.ts READ. No edit: overlapping lane l315 / PR #163840 owns this file.
509 src/infra/sqlite-worker-broker-reply.ts READ — Protocol framing, known/unknown outcome distinction and native cleanup completion are distinct responsibilities; retain them.
508 src/infra/outbound/delivery-queue-storage.ts READ — Unchanged: excluded by PR #161513 (deslop/l201-infra7).
507 src/infra/update-migrated-finalize.worker.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
501 src/infra/update-candidate-snapshot.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
499 src/infra/push-apns.ts READ: Applied direct final push-result projection; removed the intermediate relay-shaped DTO and single-use suffix wrapper.
498 src/infra/state-migrations.device-identity.ts READ. No edit: overlapping lane l315 / PR #163840 owns this file.
494 src/infra/update-startup-auto-run.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
492 src/infra/update-doctor-result.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
490 src/infra/state-migrations.transcript-directives.ts READ. Constructed identical insert/update cursor columns once; kept separate source comparisons, migration leases and event-loop yielding.
488 src/infra/outbound/target-resolver.ts READ — Unchanged: excluded by PR #163840 (deslop/l315-deslop-commands-cli-infra-20261002).
486 src/infra/state-migrations.exec-approvals.ts READ. Distinct security policy decisions, malformed UTF-8 retention, and receipt authority remain necessary.
485 src/infra/sqlite-integrity.ts READ — Structural and foreign-key integrity, generation reconfirmation and repair classification protect distinct admitted states.
485 src/infra/package-lifecycle.ts SKIPPED: lifecycle changed within 48 hours
479 src/infra/update-repair-agent.runtime.ts READ — no sound remaining simplification: environment restore, explicit tool policy, lazy runtime imports, separate SDK/database cleanup errors, process-scope cleanup, and current-authority checks each enforce a distinct contract.
475 src/infra/update-failure-report-prepare.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
473 src/infra/outbound/message-action-routing.ts READ — Unchanged: excluded by PR #161513 (deslop/l201-infra7).
472 src/infra/sqlite-store.worker.ts READ — Preparation and execution deliberately differ in authority and synchronous settlement; result framing retains cleanup outcome.
472 src/infra/push-apns-store.ts SKIPPED: open deslop PR / concurrent lane reservation
470 src/infra/restart-sentinel-store.ts READ: Typed-column decoding, sparse/optional normalization, revision floors and transactional compare-and-delete are behavior-bearing.
468 src/infra/update-managed-service-handoff-database.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
461 src/infra/sqlite-worker-operation-admission.ts READ — Live host grants, transaction/commit sequencing, retained schema lease and native receipts are documented authority boundaries.
460 src/infra/state-migrations.state-dir.ts READ. Collapsed repeated fail-closed try/catch ladders in symlink-mirror inspection while preserving filesystem probe order, empty-directory refusal and every containment check.
460 src/infra/restart-handoff.ts READ: Wire normalization, bounded TTL/trace validation and transaction-owned consumption have distinct contracts.
458 src/infra/update-managed-service-handoff-control.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
457 src/infra/terminal-file-upload.ts READ; streaming quota scan, inode deadlines, cross-process upload lock and delayed cleanup each protect real ownership; no sound reduction found.
454 src/infra/outbound/outbound-send-service.ts READ — Unchanged: excluded by PR #161513 (deslop/l201-infra7).
454 src/infra/outbound/outbound-audit.ts READ — Inlined one-use prior-success lookup and consolidated lifecycle emission while retaining the unknown-send precedence, exact metadata fields, privacy classification and exception isolation.
452 src/infra/net/proxy/proxy-validation.ts READ: Applied one direct allowed/denied fetch flow plus inline APNs probe; removed projected runner bags and redundant canary transport flag.
451 src/infra/session-cost-usage-worker-refresh.ts READ — Overlap guard: l315 / PR #163840 owns this file; READ for rollup call context and left untouched.
449 src/infra/state-migrations.snapshot.worker.ts READ. WAL-index authentication, volatile-region masking, hardlink bounds and whole-tree revalidation provide distinct immutable-plan evidence; retained.
449 src/infra/package-manager-exec-wrapper.ts READ: Applied shared pnpm/yarn exec/dlx unwrapping and canonical npm recognized-option derivation; preserved case and terminator rules.
444 src/infra/state-migrations.apns.ts READ. No edit: overlapping lane l315 / PR #163840 owns this file.
443 src/infra/outbound/delivery-completion.ts READ — Unchanged: conversation and pending-final owners have different persistence semantics; writer authority, sibling ambiguity and restart receipt projection cannot be collapsed.
439 src/infra/update-database-backup.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
435 src/infra/outbound/account-scoped-conversation-bindings.ts READ — Unchanged: account manager and adapter projections preserve public synchronous methods, worker-native reads, current-owner fencing and per-account expiry policy.
434 src/infra/sqlite-integrity-worker.ts READ — Inspection scopes retain native child exit through success/failure and separate elapsed metrics; no safe simplification found.
432 src/infra/state-migrations.node-host.ts READ. Different canonical/legacy parser contracts and installed-app-sharing preservation prevent generic merging; retained.
424 src/infra/telemetry.ts READ; privacy filtering, repeated consent admission after awaited payload work, DB worker context and in-flight/pending-success behavior are real contracts.
419 src/infra/package-dist-inventory.ts SKIPPED: lifecycle changed within 48 hours
415 src/infra/state-migrations.web-push.ts READ. Multi-source claims, VAPID identity, endpoint collisions, timestamp conflict checks and source restoration are required; retained.
414 src/infra/outbound/outbound-session.ts READ — Flattened four private inference/forwarding helpers into the existing peer-kind owner; provider, prefix, capability and direct fallback precedence remain identical.
411 src/infra/sqlite-schema-facts.ts READ — Schema publication and data-version caches preserve native transaction, authorizer and pinned-snapshot semantics; duplicated iterator boundary has lazy timing.
411 src/infra/npm-install-env.ts READ: Npm env/config precedence, freshness-policy selection, native probes and cache invalidation remain required.
406 src/infra/outbound/payloads.ts READ — Replaced the custom first-wins URL/attachment de-duplication loop with shared indexFirstByKey; metadata associations and empty-reference filtering preserved.
404 src/infra/oauth-loopback-callback.ts READ: Callback consumption, deferred-response cancellation, DNS binding and partial-server cleanup have independent ownership semantics.
403 src/infra/state-migrations.acp-replay.ts READ. Derived internal event/session types from actual parsing and removed one-use path wrapper; parsing, sequence checks, accounting, and reconciliation unchanged.
399 src/infra/worker-native-handle.ts READ; native execution versus resource custody, retriable failed stops, queued samples and serialized transport each remain necessary; no safe collapse.
398 src/infra/state-migrations.restart-sentinel.ts READ. Update/restart custody and generation-specific decisions are protected lifecycle work; retained.
395 src/infra/sqlite-strict.ts READ — Migration preserves rowid models, high-water marks, foreign keys and database-local objects; retained migrations are post-July supported shapes.
394 src/infra/state-migrations.media-persistence-targets.ts READ. Config/registry/deletion authority precedence, unresolved state retention, and realpath/inode classification must remain distinct.
394 src/infra/outbound/agent-delivery.ts READ — Unchanged: explicit destination, current-turn route, configured binding and provider-resolved session evidence have distinct routing precedence and trust contracts.
392 src/infra/sqlite-readonly-worker-session.ts READ — Native and broker transports retain genuine distinct spawn/close behavior; prepared callbacks avoid a cyclic import of worker orchestration.
386 src/infra/session-cost-usage-reporting.ts READ — Live refresh and diagnostic transcript readers have distinct consistency contracts; sampling preserves floating-point addition order and logs retain bounded out-of-order windows.
385 src/infra/shell-inline-command.ts READ — Separate POSIX/fish/Nu/PowerShell parsing reflects different shell grammars and startup semantics; retained all flag and stop-boundary behavior.
382 src/infra/update-failure-report-artifact.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
375 src/infra/worker-cpu.ts READ; CPU/heap port samples, pending native interrupts, late samples and native-exit accounting have independent lifetimes; no safe simplification.
374 src/infra/state-migrations.workspace-setup-receipts.ts READ. Used canonical SHA-256 helper and removed receipt-owner re-export; kept migration source-key bytes, archive verification and move conflicts.
374 src/infra/session-cost-usage-cache-runtime.ts READ — Per-scope refresh ownership, retained busy retries, sync-on-empty, and session-specific freshness are live behaviors; no speculative merge of distinct flows.
373 src/infra/sqlite-readonly-native-resource.client.ts READ — Result envelopes distinguish remote operation refusal from lost transport cleanup authority; cannot flatten into rejected promises.
372 src/infra/state-migrations.plugin-doctor-context.ts READ. Inspection projection deliberately excludes mutators at runtime; trust gates and authority rechecks are required, not redundant wrappers.
371 src/infra/windows-encoding.ts READ; removed impossible non-finite/empty checks after bounded numeric regex capture; distinct streaming UTF-8/legacy/UTF-16 decoding state retained.
369 src/infra/outbound/deliver-prepare.ts READ — Unchanged: exact-once hook modifiers, structured metadata preservation, canonical prepared custody and preparation-error attribution are required by recovery.
364 src/infra/push-apns.relay.ts READ: Origin matching, signed request payload, live-send checks and bounded response fallback remain required.
364 src/infra/outbound/current-conversation-bindings.kernel.ts READ — Unchanged: indexed exact/legacy-key reads, transactional normalization, expiry repair and per-handle query caches serve distinct durable/public contracts.
361 src/infra/state-migrations.channel-pairing.ts READ. Ambiguous channel/account filenames and case-fold collisions have distinct authorization semantics; retained.
360 src/infra/state-migrations.mcp-oauth.ts READ. No edit: overlapping lane l315 / PR #163840 owns this file.
359 src/infra/unhandled-rejections.ts READ; made existing SQLite-object predicate carry its narrowing fact and removed repeated object/empty-message guards; all fatal, transient and exact-message classification remains.
359 src/infra/session-cost-usage-cache.sqlite.ts READ — Current worker-writer and incognito/native paths carry different custody; lock CAS, lost-reply cleanup, and exact owner admission preserved.
358 src/infra/update-candidate-predecessor-stop.ts READ; September released-driver stop receipts, native mutation identity and post-stop compensation preserve supported update recovery.
357 src/infra/package-local-overrides-capture.ts SKIPPED: open deslop PR / concurrent lane reservation
355 src/infra/package-update-lifecycle.ts SKIPPED: lifecycle changed within 48 hours
354 src/infra/state-migrations.plan.ts READ — retain snapshot worker protocol validation, pipe settlement, digest binding, environment authority and stable public plan shape; no remaining sound simplification.
354 src/infra/outbound/outbound-policy.ts READ — Unchanged: excluded by PR #161513 (deslop/l201-infra7); egress allowlists and cross-context enforcement remain identical.
349 src/infra/sqlite-readonly-location.worker.ts READ — Child-only domain imports and staging versus ordinary inspection result handling preserve real loader and cleanup contracts.
349 src/infra/package-update-activation-prepare.ts SKIPPED: lifecycle changed within 48 hours
347 src/infra/update-doctor-process-custody.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
346 src/infra/net/undici-global-dispatcher.ts READ: Dispatcher classification, managed-proxy wrapping, TLS cache invalidation and lifecycle forwarding remain required.
345 src/infra/push-apns-http2.ts READ: CONNECT/TLS/session ownership, abort cleanup and bounded APNs proof body capture remain required.
343 src/infra/update-runner-git-transfer.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
341 src/infra/update-database-restore.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
339 src/infra/session-cost-usage-projection.ts READ — APPLIED: inlined single-use summary finishing helper to remove a large parameter shuttle; preserved scan-before-format order, daily filling, status and timestamp shape.
339 src/infra/push-web-store.ts READ: Worker admission, native compatibility, snapshot authority and terminal write settlement prevent unsafe flattening.
333 src/infra/outbound/deliver-queue-state.ts READ — Unchanged: same-claim queue transitions, failure projection and pre/post-platform marker fallback preserve custody and at-most-once delivery evidence.
327 src/infra/worker-task-pool-retirement.ts READ; one cleanup Map replaces synchronized Set plus WeakMap; removed unused duplicated return interface/member; native retirement and artifact settlement unchanged.
327 src/infra/update-native-package-stage.ts READ; native pnpm/Bun layout copying, mutation fingerprints, symlink relocation and rollback source binding are necessary.
327 src/infra/session-delivery-queue-storage.ts READ — Queue publication, session lifecycle lease, worker admission, and settled-write handling are intentional ownership boundaries; wrappers preserve typed operation and error contracts.
327 src/infra/session-delivery-queue-recovery.ts READ — Recovery statuses distinguish deferred, charged, acknowledged, retryable, and terminal outcomes; coordinator owns claim/pacing and finalization without replay.
326 src/infra/state-migrations.prelude.ts READ. Frozen endpoints, explicit refusal descriptors and staged plugin/session discovery have different ownership; retained.
322 src/infra/sqlite-wal-checkpoint.ts READ — Checkpoint result normalization, observed diagnostics and monotonic worker publication remain separate required facts.
317 src/infra/system-events.ts READ — Snapshot versus owned event APIs preserve clone/removal authority; July-compatible ID-less snapshots and recent channel-route fix retained.
317 src/infra/sqlite-snapshot-source.ts READ — Live versus child snapshots and retained versus awaited producers preserve POSIX lock isolation and cancellation precedence.
315 src/infra/sqlite-worker-broker-lifecycle.ts READ — Close capability determines pooled versus dedicated native resource retirement; generation and actor drainage semantics are required.
315 src/infra/sqlite-wal-filesystem.ts READ — Excluded from edits: concurrent l315 / PR 163840 owns this path; filesystem classification read for WAL caller context.
315 src/infra/sqlite-snapshot-staging.ts READ — Async allocation wrapper retains error/cancellation precedence across the awaited boundary; inlining would change synchronous failure ordering.
314 src/infra/state-migrations.plugin-state.ts READ. Capacity/eviction recovery, creation-time retention and shared-source final-consumer cleanup are real contracts; retained.
314 src/infra/sqlite-index-schema.ts READ — Probe index construction, rollback, named-index convergence and physical-corruption repair are distinct admitted operations.
314 src/infra/outbound/message-action-contracts.ts READ — Unchanged: excluded by PR #161513 (deslop/l201-infra7).
313 src/infra/update-run-codec.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
312 src/infra/ocm-update-client.ts READ: Native manager capability/identity checks and ambiguous-write reconciliation are required external contracts.
308 src/infra/update-run-schema.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
308 src/infra/state-migrations.commitments.ts READ. Removed one-use path wrapper; exact retirement shape, claim identity, and discard receipt preserved.
307 src/infra/update-campaign.ts READ; idle/countdown/hold/applying states retain distinct operator and scheduler contracts; no forced generic state replacement.
305 src/infra/push-web.ts READ: Applied per-subscription rejection mapping before Promise.all; removed allSettled-to-result indexing projection.
304 src/infra/system-presence.ts READ — Presence publication and lifetime freshness differ from public activity clocks; pending connection custody, suspend and rollback behavior retained.
299 src/infra/windows-install-roots.ts READ; inlined single-use registry run/parse forwarders into query owner, retaining view order, budgets, PATH trust and caches.
299 src/infra/outbound/deliver-payload.ts READ — Unified delivery capability media-source enumeration with the narrow queue-media source owner; retained all read authority, payload normalization and post-send observer guards.
298 src/infra/update-triage-resolution.ts READ — no sound remaining simplification: attribution, later-completion predicates, expected version/commit identity, runtime validation, and post-await owner rechecks are separate resolution evidence.
296 src/infra/package-update-manager-preflight.ts SKIPPED: lifecycle changed within 48 hours
295 src/infra/update-run-reader.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
295 src/infra/net/proxy/proxy-lifecycle.ts READ: Nested registrations, inherited proxy state, rollback and loopback policy remain one lifetime owner.
294 src/infra/update-runner-git-steps.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
293 src/infra/net/proxy-env.ts SKIPPED: open deslop PR / concurrent lane reservation
292 src/infra/startup-migration-checkpoint.ts READ — Startup/Doctor shared lease serialization, stale-owner reclaim and bounded acquisition are active storage contracts; no timing or schema change.
290 src/infra/state-migrations.media-persistence-database.ts READ. Removed identity re-validation after the local transform that only replaces message; bounded scans, source drift, and writer authority remain.
288 src/infra/update-retained-runtime.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
287 src/infra/system-disks.ts READ — Mount visibility, APFS identity, timed-out native work and partial snapshots protect live topology; platform-specific collections cannot be folded without semantic change.
286 src/infra/sqlite-worker-store.ts READ — Public broker facades own error hydration and host-only admission; ephemeral and shared store custody differ materially.
286 src/infra/sqlite-worker-broker-admission.ts READ — Physical identity, captured native context and cleanup reservation protect separate phases of awaited admission.
285 src/infra/update-managed-service-handoff-reclamation.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
285 src/infra/update-failure-facts.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
285 src/infra/ssh-tunnel.ts READ — Exact-child listener attribution and losing-readiness cleanup protect port ownership; process lifetime and post-ready cancellation retained.
283 src/infra/worker-task-pool-owned.ts READ; unified identical absent-owner/already-closed completion branches; preparation and explicit custody release remain intact.
281 src/infra/state-migrations.tui-last-session.ts READ. Inlined one-use path, snapshot, heartbeat predicate and row comparison helpers; exact timestamp conflict, source snapshot and claim behavior retained.
281 src/infra/package-local-overrides-shared.ts SKIPPED: lifecycle changed within 48 hours
280 src/infra/update-candidate-plugin-repair.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
279 src/infra/outbound/deliver-contracts.ts READ — Unchanged: excluded by PR #161513 (deslop/l201-infra7).
278 src/infra/sqlite-reader-lifecycle.ts READ — Weak connection inventory and active-reader leases have different lifetimes; normalization differs from case-preserving admission paths.
277 src/infra/outbound/deliver-hooks.ts READ — Unchanged: legacy SDK hook stage and durable pre-policy stage are intentionally different; cancellation, metadata copying and failure projection preserve their contracts.
275 src/infra/session-delivery-queue.worker.ts READ — Operation handlers encode distinct authoritative transitions; admission, idempotent settlement and completion retention preserved.
274 src/infra/sqlite-audit-record.kernel.ts READ — Sequence ordering and pruning retain canonical diagnostic store semantics; prepared insert cache serves repeated domain callers.
273 src/infra/windows-process-start.ts READ; native timestamp, sealed-helper fallback, PID-reuse-safe ancestor checks and independent diagnostics routing are necessary.
273 src/infra/runtime-guard.ts READ: Runtime/SQLite diagnostics and recovery distinctions are user-visible; no sound reduction identified.
271 src/infra/worker-native-lifecycle.worker.ts READ; recursive transfer ownership, stop/native-join/resource receipts and forwarded error identities are distinct contracts.
268 src/infra/outbound/delivery-queue-media-spool.ts READ — Inlined single-caller orphan pruning into its snapshot-owning entry point, removing the unused private grace override and duplicate retain-set construction; retention and filesystem checks unchanged.
268 src/infra/openclaw-process-census.ts READ: Conservative custody and native ancestry/partial-evidence distinctions are needed for safe update cleanup.
267 src/infra/update-run-write.ts READ; reduced the callback that only invokes applyUpdateRunDiagnostics to its direct expression. Kept status/phase, cleanup-error, persistence, and diagnostics ownership.
266 src/infra/update-candidate-rehearsal.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
266 src/infra/outbound/channel-selection.ts READ — Removed unreachable selected-element fallback/assertion branches and the single-use warning-limit constant; account inspections and fallback precedence preserved.
265 src/infra/update-retained-runtime-tree.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
264 src/infra/update-triage.ts READ — retained separate completed/failed union arms because consumers extract them by status; diagnostics and cancellation contracts remain intact.
263 src/infra/update-managed-service-handoff-cleanup.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
263 src/infra/path-env.ts READ: Trusted roots, symlink/cwd rejection and runtime-before-system PATH ordering are security contracts.
262 src/infra/state-migrations.meeting-transcripts-detection.ts READ. Sync detection, exact/folded export ownership, and inode-backed fallback are needed; combining with async file traversal would add policy plumbing or alter scheduling.
260 src/infra/update-managed-service-handoff-cancellation.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
260 src/infra/node-duplex-framing.ts READ: Frame ordering, bounded reassembly, readiness and joined listener lifetime are wire/lifecycle contracts.
259 src/infra/state-migrations.types.ts READ — retained public migration plan/receipt and live repair authority contracts; optional legacy detector fields are still accepted by caller/test inputs.
259 src/infra/provider-usage.admin.ts SKIPPED: open deslop PR / concurrent lane reservation
258 src/infra/update-candidate-canary-readiness.ts READ; progress-renewed deadlines, hard bound, proxy bypass ownership and cancellation after awaited work are necessary.
257 src/infra/outbound/source-delivery-plan.ts READ — Removed unused best-effort/progress inputs and unused best-effort/progress/default-target projections after whole-tree caller checks; current cron plan fields and delivery target satisfaction remain intact.
256 src/infra/provider-usage.fetch.claude.ts READ: OAuth/web fallback and independently normalized windows/billing preserve API-specific usage behavior.
255 src/infra/update-repair-agent.ts READ — no sound remaining simplification: single-flight process environment, budget/abort scopes, oracle validation and uncertain-cleanup retention are necessary; canonical abort helper was rejected because its fixed error message changes visible cancellation reasons.
255 src/infra/update-package-manager.ts READ; exact pinned manager probing, Corepack/native bootstrap fallback and temporary tool cleanup retain current install contracts.
254 src/infra/package-update-swap-retirement.ts SKIPPED: lifecycle changed within 48 hours
252 src/infra/worker-task-server.ts READ; public SDK facade, serial task/resource handoffs, stale reply cancellation and reader fences retained; recent lifecycle change is intentional.
252 src/infra/openclaw-root.ts READ: Sync/async root resolution, node_modules boundaries and selected-vs-complete plugin-cache facts have distinct consumers.
250 src/infra/update-runtime-relocation.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
250 src/infra/session-cost-usage-cache.kernel.ts READ — Overlap guard: l315 / PR #163840 owns this file; READ for cache/projection context and left untouched.
249 src/infra/question-channel-runtime-internal.ts READ: Captured delivery generation, owner retirement and retained finalizer drain enforce asynchronous authority.
249 src/infra/outbound/channel-bootstrap.runtime.ts READ — Unchanged: cache generation, scoped registration precedence, retired registry checks and async metadata admission each enforce live lifecycle contracts.
248 src/infra/update-candidate-canary-process.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
248 src/infra/outbound/channel-resolution.ts READ — Removed pass-through lookup closures; sync/async bootstrap generator retained because both public entry points consume the same resolution decisions.
247 src/infra/update-managed-command-custody.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
246 src/infra/outbound/deliver-queue-admission.ts READ — Unchanged: staged media publication, stable preparation CAS, durable custody adoption and rollback-aware cleanup are separate irreversible boundaries.
244 src/infra/widearea-dns.ts READ; domain/path validation, persisted content hash, RFC1982 serial advancement and durable zone replacement retained; shared progress hash is private to another owner.
241 src/infra/outbound/target-normalization.ts READ — Unchanged: excluded by PR #163840 (deslop/l315-deslop-commands-cli-infra-20261002).
238 src/infra/session-delivery-queue-runtime.ts READ — Generation fences, scheduler scopes, pending-read joins, and retry rearming have separate required responsibilities; retained lifecycle ownership.
236 src/infra/state-migrations.audit-checkpoints.ts READ. Generation order, checkpoint capacity, and descriptor-bound hash verification are independent contracts; retained.
236 src/infra/session-sqlite-migration-artifact.ts READ — No-copy link publication, inode/hash verification and durable cleanup receipt sequencing are required recovery safety boundaries.
235 src/infra/windows-shell-command.ts READ; removed redundant capture throw wrappers and empty-array check already excluded by tokenizer; shell token policy unchanged.
235 src/infra/update-runner-git-commands.ts READ; ref resolution, private preflight location, workspace isolation and operator provenance for pnpm policy remain needed.
235 src/infra/sqlite-snapshot-staging.worker.ts READ — Removed revalidation of the location already validated and typed by native.runOnce; all wire input validation remains.
234 src/infra/update-candidate-plugin-tree-links.ts READ; shares final code-link capture/return after preserving distinct host-link and private-tree validation branches.
233 src/infra/update-freebsd-pkg-ownership.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
233 src/infra/net/node-proxy-agent.ts READ: Node-specific transport adapters preserve per-request bypass, TLS trust and deferred invalid-route failures.
230 src/infra/net/undici-runtime.ts READ: SOCKS/header policy and joined env-proxy close/destroy semantics are required transport contracts.
229 src/infra/state-migrations.audit-backup.ts READ. Collapsed one-use backup retry/witness layers into capture; kept three attempts, 25 ms delays, and database-witness failure outside retry scope.
229 src/infra/outbound/conversation-delivery.ts READ — Unchanged: recently worker-migrated in #163222; durable operation replay and queue settlement retain separate custody from caller-visible errors.
228 src/infra/state-migrations.cron-run-logs.ts READ. Shipped row import preserves stored columns, mirrored run identity semantics, and malformed-row accounting; retained.
224 src/infra/update-candidate-admission.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
222 src/infra/update-candidate-io.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
222 src/infra/sqlite-worker-contract.ts READ — Cross-module error classification intentionally avoids proxy/getter execution; protocol contracts are live and imported.
220 src/infra/sqlite-worker-transfer.ts READ — Bounded framing, record continuity and cleanup retry custody cannot be collapsed without weakening transport guarantees.
220 src/infra/sqlite-schema-sql.ts READ — Shared tokenizer preserves quoted strings, comments and nested lists for distinct callers; no sound replacement found.
220 src/infra/sqlite-readonly-worker-protocol.ts READ — Published one-shot parents require exact wire shapes and error tags; parsing and staging classifications remain necessary.
220 src/infra/outbound/message-action-threading.ts READ — Removed a redundant dry-run recheck after route creation already excludes dry-run sends; reply-to consumption and same-conversation checks preserved.
219 src/infra/update-runner-command.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
219 src/infra/state-migrations.receipts.ts READ. Generic run/source receipts are reused broadly and their conflict-update fields differ intentionally; retained.
217 src/infra/update-managed-service-handoff-process.ts READ; native identity, PID liveness, Windows argv fallback and synchronous Darwin ancestry scope are distinct authority evidence.
217 src/infra/ports-format.ts READ: Listener classification and exact process/address-family ownership serve status and control-ui-handoff callers.
215 src/infra/outbound/deliver-types.ts READ — Unchanged: exported result/error contracts retain real consumers; sentinel classification, partial-send evidence and physical receipt counting differ deliberately.
214 src/infra/outbound/message-account-selection.ts READ — Unchanged: excluded by PR #161513 (deslop/l201-infra7).
213 src/infra/update-run-step.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
213 src/infra/system-run-approval-context.ts READ — Wire payload normalization retains shipped prepared/legacy plan variants and command-preview rules; no protocol change.
213 src/infra/retained-operation.ts READ: Synchronous servicing, contextual continuations and final-only error-combining cleanup cannot become ordinary Promise wrappers.
212 src/infra/sqlite-snapshot-retirement.ts READ — Nested token fencing, legacy grace periods and allowed artifact layouts protect destruction authority and cannot be discarded.
212 src/infra/outbound/message-action-spec.ts READ — Removed the one-field alias DTO and list-building helper; direct core/plugin alias arrays retain bootstrap screening and selected-adapter null semantics.
211 src/infra/update-managed-service-handoff-rows.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
210 src/infra/push-web-preferences.ts READ: Per-field normalization, device overrides, quiet hours and category policy remain direct required logic.
210 src/infra/package-update-activation.ts SKIPPED: lifecycle changed within 48 hours
210 src/infra/outbound/markdown-details.ts READ — Unchanged: parser stack, code protection, linear blank-line trimming, container layout and depth fallback protect distinct malformed/nested Markdown cases.
209 src/infra/update-control-plane-sentinel.ts READ; published restart metadata normalization and continuation ownership retain persisted/protocol shapes.
209 src/infra/npm-registry-spec.ts SKIPPED: open deslop PR / concurrent lane reservation
208 src/infra/update-channels.ts READ; inlined one-use display label DTO/formatter into its sole owner; channel choice and text remain identical.
207 src/infra/windows-port-pids.ts READ; PowerShell/netstat/WMIC fallback ownership, diagnostics environments, exact parse and observation deadlines are distinct.
207 src/infra/update-run-record.ts EXCLUDED — updater lifecycle changed within the guarded 48-hour window.
205 src/infra/worker-task-pool-resources.ts READ; per-slot receipt tracking, shared exit waiters, reentrant servicing and failure cleanup protect resource custody.
205 src/infra/update-run-recovery-native-schema.ts READ; transition, revision, reconciliation, and preparation-history validation are real persisted/service contracts. No sound deletion found.
205 src/infra/sqlite-worker-identity.ts READ — Sync and async admission have different native-path failure contracts; physical identity and Windows namespace handling are required.
204 src/infra/session-cost-usage-rollup-codec.ts READ — Versioned envelope, body hashes, size validation and source freshness protect cache correctness; codec checks retained.
203 src/infra/state-migrations.restart-sentinel-receipts.ts READ. Published v2026.9.5 tombstones and update handoff generation bindings remain required; retained.
201 src/infra/provider-usage.load.ts READ: Provider hooks, per-provider auth/error handling, deadlines and sorting preserve plugin result ordering.

Remove one-use forwarding layers, redundant projections, and unused internal options while preserving delivery, migration, security, and native lifecycle contracts.

Load database dependencies only for database requests in the generic worker fixture. Preserve existing assertions and deadlines; verify repeated retained-worker behavior and real Gateway deletion boundaries.
Keep the Node runtime resolver free of local JavaScript imports because tooling loads its TypeScript source before a loader is available. Restore the original bounded-cache loop and document that constraint.
Keep completed and failed as separate union members so status-specific Extract consumers retain their types. Runtime values remain unchanged.
Avoid parameter reassignment and hint shadowing. Update only the newly created transcript projection while preserving the opaque legacy metadata contract.
@clawsweeper

clawsweeper Bot commented Oct 3, 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.

@steipete
steipete enabled auto-merge (squash) October 3, 2026 05:06
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 3, 2026
@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 3, 2026, 1:49 AM ET / 05:49 UTC (Revision 2).

ClawSweeper review

What this changes

Simplifies infrastructure, outbound delivery, migration orchestration, and worker cleanup by replacing redundant forwarding and projections with existing owners.

Merge readiness

⛔ Blocked before merge - 1 item remains

This remains useful, distinct cleanup, and no actionable introduced defect was found. The earlier migration-compatibility concern is not supported by the actual hunks: stored contracts and migration decisions remain unchanged. Failed CI remains recorded and does not establish a patch regression.

Priority: P3
Reviewed head: ad82746ed4997e578e90282b5c30788facdb7aab

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, coherent simplification with substantial recorded validation and no supported blocking correctness finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied MEMBER author classification exempts this internal refactor from external-contributor proof requirements. The captured body records affected native worker, Gateway, and migration validation, with failed CI clearly distinguished. Source comparison establishes no stored-data contract change or material authority change, so the previous migration-proof request does not remain a blocker.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied MEMBER author classification exempts this internal refactor from external-contributor proof requirements. The captured body records affected native worker, Gateway, and migration validation, with failed CI clearly distinguished. Source comparison establishes no stored-data contract change or material authority change, so the previous migration-proof request does not remain a blocker.
Evidence reviewed 10 items Pinned introduction and merge ownership: Read the introduced merge-base-to-head hunks across all supplied paths. Raw test-merge parents are the pinned base followed by the exact PR head; the Gateway spawn test is base-only work and was not attributed to this PR.
Migration compatibility concern resolved: The Doctor refactor retains the same two preparation steps, remaining-step order, refusal receipts, callback ordering, and blocked-tail settlement. It changes the internal representation of the step list, not its stored contract.
Existing-state semantics preserved: Workspace attestation replacement retains timestamp, exact-hash, and receipt-priority decisions. Transcript verification keeps the existing query predicates and restores opaque legacy metadata after canonical row projection; media transformation replaces only the message field. No schema, serialized-field, retention, or migration-policy change was identified.
Findings None None.
Security None None.

How this fits together

OpenClaw infrastructure connects command requests, outgoing payloads, and legacy state to execution, channel transports, and SQLite owners. These helpers preserve routing, delivery bookkeeping, migration receipts, and resource cleanup.

flowchart TD
  A[Command requests] --> D[Infrastructure helpers]
  B[Outgoing payloads] --> D
  C[Legacy state] --> D
  D --> E[Execution and channel owners]
  D --> F[SQLite migration owners]
  E --> G[Results and delivery receipts]
  F --> H[Canonical state and migration receipts]
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source -944, Tests +3, Other -2. Total -943 across 70 files.

View PR surface stats
Area Files Added Removed Net
Source 67 814 1758 -944
Tests 2 10 7 +3
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 3 -2
Total 70 825 1768 -943

Review metrics

None.

Stored data model

Persistent data-model change detected: database schema: src/infra/state-migrations.transcript-directives.ts, migration/backfill/repair: src/infra/state-migrations.audit-backup.ts, migration/backfill/repair: src/infra/state-migrations.media-persistence-database.ts, migration/backfill/repair: src/infra/state-migrations.media-persistence-transform.ts, unknown-data-model-change: src/infra/state-migrations.doctor.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep the simplifications with existing delivery, migration, and lifecycle owners while preserving their current contracts.

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

Not applicable: this is a behavior-preserving cleanup, and source review found no concrete introduced bug to reproduce.

Is this the best way to solve the issue?

Yes: consolidating redundant internal layers into existing owners is maintainable, and the inspected hunks preserve their decisions and state contracts.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is internal simplification with no identified user-visible behavior change or urgent regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied MEMBER author classification exempts this internal refactor from external-contributor proof requirements. The captured body records affected native worker, Gateway, and migration validation, with failed CI clearly distinguished. Source comparison establishes no stored-data contract change or material authority change, so the previous migration-proof request does not remain a blocker.

Evidence

What I checked:

  • Pinned introduction and merge ownership: Read the introduced merge-base-to-head hunks across all supplied paths. Raw test-merge parents are the pinned base followed by the exact PR head; the Gateway spawn test is base-only work and was not attributed to this PR. (ba0d524c9669)
  • Migration compatibility concern resolved: The Doctor refactor retains the same two preparation steps, remaining-step order, refusal receipts, callback ordering, and blocked-tail settlement. It changes the internal representation of the step list, not its stored contract. (src/infra/state-migrations.doctor.ts:1623, ad82746ed499)
  • Existing-state semantics preserved: Workspace attestation replacement retains timestamp, exact-hash, and receipt-priority decisions. Transcript verification keeps the existing query predicates and restores opaque legacy metadata after canonical row projection; media transformation replaces only the message field. No schema, serialized-field, retention, or migration-policy change was identified. (src/infra/state-migrations.meeting-transcripts-verify.ts:35, ad82746ed499)
  • Outbound ownership preserved: Delivery-kind bookkeeping now belongs to the current sequential payload. Audit projection still gives unknown sends precedence, and queue-media pruning retains its captured inventory and existing orphan grace. Removed source-plan projections have no remaining consumers of those fields. (src/infra/outbound/deliver-core.ts:224, ad82746ed499)
  • Security and authority inspection: Shell unwrapping retains its depth bound, startup restrictions, environment tracking, and raw-command mismatch rejection. Proxy validation retains generated-canary token checks and APNs reachability criteria. No material authority transfer, dependency change, or new third-party execution surface was introduced. (src/infra/shell-wrapper-resolution.ts:98, ad82746ed499)
  • Test changes retain meaningful assertions: Five WAL expectations follow the canonical busy-timeout setter's semicolon-free SQL while retaining values, counts, and ordering. Resource-fixture imports become lazy only for database requests; assertions and deadlines remain intact. No tests were executed during this read-only review. (src/infra/sqlite-wal.test.ts:1019, ad82746ed499)

Likely related people:

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

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 (1 earlier review cycle)
  • reviewed 2026-10-03T05:09:03.604Z sha ad82746 :: blocked before merge. :: none

@steipete

steipete commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author

Evidence: landing over an inherited main failure

Head ad82746ed49, CI run 37098654155 after one rerun of the failed jobs:

  • checks-node-changed-compact-small-1 (the .cold-facade-* compiler fixture race) passed on rerun. Its owners are unchanged by this PR, so this was a flake.
  • published-driver-update / Published driver update, the inventory mismatch, is the only remaining failure. The worker matched it independently to main, as recorded in the PR body evidence. It is not an authority, fence or security test.

All other hosted jobs passed. Admin squash-merging pinned to the exact head, per maintainer direction for pre-existing main failures.

@steipete
steipete merged commit ae068d0 into main Oct 3, 2026
338 of 344 checks passed
@steipete
steipete deleted the deslop/l336-simplify-infra-root-n-z-outbound-20261002 branch October 3, 2026 06:13
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 4, 2026
* refactor(infra): deslop runtime and outbound helpers

Remove one-use forwarding layers, redundant projections, and unused internal options while preserving delivery, migration, security, and native lifecycle contracts.

Load database dependencies only for database requests in the generic worker fixture. Preserve existing assertions and deadlines; verify repeated retained-worker behavior and real Gateway deletion boundaries.

* fix(infra): preserve native Node bootstrap loading

Keep the Node runtime resolver free of local JavaScript imports because tooling loads its TypeScript source before a loader is available. Restore the original bounded-cache loop and document that constraint.

* fix(infra): preserve triage result discriminants

Keep completed and failed as separate union members so status-specific Extract consumers retain their types. Runtime values remain unchanged.

* refactor(infra): simplify local bindings and projections

Avoid parameter reassignment and hint shadowing. Update only the newly created transcript projection while preserving the opaque legacy metadata contract.

* chore(infra): shrink assertion safety baseline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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