Skip to content

refactor(core): share repeated lifecycle and plugin paths - #167646

Merged
steipete merged 2 commits into
mainfrom
deslop/d29-core-misc-p2-20261007
Oct 9, 2026
Merged

steipete merged 2 commits into
mainfrom
deslop/d29-core-misc-p2-20261007

Conversation

@steipete

@steipete steipete commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Core and small plugins repeat request preparation, result projection, and cleanup logic across closely related operations.

User Impact

No user-visible change. Features, messages, configuration, CLI options, wire formats, and persisted data remain identical. No migration is required.

Why This Change Was Made

Share the repeated work while keeping meaningful differences explicit: Markdown source context, provider stream state, request variants, resource rollback order, inference authority checks, and worker cleanup. The old parallel implementations are removed.

The implemented deep pass removes 512 net production lines, counting new helpers and excluding tests and baselines. This uses the campaign's 500–999 exception; the normal 1,000-line and 3% targets were not reached. The coverage log includes retained paths and candidates discarded after implementation and measurement.

Evidence

The final source is reviewed and the focused syntax check confirms the corrected eight-file lint batch is clean. Full type-aware lint and final Linux Zalouser proof remain hosted-CI gates: local SDK preparation hit its unchanged budget, and the final Testbox reservation did not allocate within the 20-minute window and was stopped. No additional lease was allocated after that cutoff.

The complete directory run passed 646 files / 7,871 tests across 15 shards on blacksmith-testbox (621.06s; 2 files / 52 existing tests skipped). It covered all four core directories, all 19 touched plugin packages, lint-suppression tests, and landing-wrapper/eager-import closure tests. The isolated failing-case selection passed 34 tests (22.05s), and all four real Claws lifecycle CLI cases passed (287.16s including build preparation).

The final loop correction passed all 205 rendering tests locally and 3,176 complete renderer output comparisons against the original base. Redaction separately matched native patterns in 31,125 comparisons across 6,225 inputs. Tests, assertions, deadlines, retries, and skip conditions are unchanged. Independent review of the full candidate and the subsequent one-file correction is scoped-clean through P2. Final runtime-value cycles and Madge cycles are both zero; clean-base Madge is also zero. Fresh lint-suppression tests passed all three cases.

Core production and all 27 core test graphs passed. Extension production and extension test typechecks also passed again after the final loop correction. Core and scripts lint passed. The remaining static checks passed except one own no-map-spread finding, corrected by projecting each style inside the existing merge loop without an intermediate array or suppression. The Plugin SDK API comparison from 121417e32b0fec872d73a785865a47f1e25d797c to d45efeb68bb82abe62637b5e0d453a89c8eb47db reports no changes. The later delta affects only the private Zalouser renderer loop, outside the unchanged SDK rendering inputs.

The full changed-file gate failed on four untouched unused exports. A fresh pinned-main checkout at 48e0271f6040cca380256d69d1d97e5f1636b770 reproduced all four. Completed main CI job 113659329749, at 15305ccd53dedd1663a89f92a402480d7b71bbf8, independently reports the exact same findings. All four file blobs match between that main run, pinned main, and this candidate; none is in this PR's changed paths:

  • src/agents/cli-runner/tool-authority.ts: bindCliQuestionAnswerAuthority
  • src/auto-reply/reply/session-event-handoff.ts: prepareSessionEventTargetForHost
  • src/config/sessions/session-accessor.sqlite-entry-cache-publication.ts: readSessionEntryCreationTransition
  • src/infra/heartbeat-events-filter.ts: RESTART_CONTINUATION_CONTEXT_PREFIX

Local failures remain recorded; a passing isolated run does not establish a fix for them:

Local failure Investigation and disposition
Noisy-command probe output missing in src/system-agent/probes.test.ts Clean-base focused replay and isolated candidate runs pass at the original 1-second budget. Original cause remains unclassified.
Three redaction wall-time bounds Adversarial, doubled-input, and plus-joined cases took 1.70s, 1.50s, and 1.11s against their unchanged 1-second bounds. Isolated focused and complete unit-fast shards pass.
Seven process cases Four output-observer cases, output-retention, no-output reset, and owned-stdio cleanup timed out or terminated before expected output. Isolated focused and complete unit-fast shards pass at original budgets.
Seven Zalouser ingress-verdict waits after the loop correction All failed at the unchanged 5-second observer in ingress.test-support.ts, with six late-handled rejections from the same promises. Cases: durable append before dispatch; completed-duplicate rejection; independent-conversation dispatch; auth dead-lettering; DM pairing account scope; missing-mention diagnostics; explicit-mention routing. Their mocked sending/ingress paths do not reach the corrected renderer loop. The earlier isolated full run passed them; local contention was observed, but its precise causal contribution remains unproven.

One early invocation ran zero tests because this lane pruned its assertion baseline during build preparation; inputs were then frozen. Duplicate local builds/checks were deliberately interrupted with exit 130 after isolated proof became available. Their task-owned stale artifact locks were recovered only after verifying process cleanup. Later local Knip and SDK-declaration preparation exceeded their existing 600-second and 300-second budgets; these were tooling proof gaps, not passing checks. No timeout was raised. The final local changed-file attempt again passed its preceding guards and extension typechecks, then its Knip scan reached the unchanged 600-second deadline. Isolated proof supplies the completed checks described above; exact-head hosted CI must cover the remaining full-lint/Linux gap.

File-by-file deep-pass coverage

d29 P2 coverage

Each row records inspected source or an implemented candidate. Partial reads and candidates discarded after implementation and measurement are explicit. Checkpoint observations are historical; final PR evidence owns validation results.

lead

File Inspection and result
src/logging/redact.ts Re-read full 1,581-line owner in chunks, including previous partial tail. Text replacement versus original-offset bitmap has deliberate grammar/rewrite differences; pre-conversion native receiver versus serialized field processing retain separate receiver semantics. Existing capture/scanner owners already shared. Retained.
src/logging/diagnostic-stability.ts Full read: sanitized event fields and insertion order differ by discriminant; common copy helper and record filter already exist. Implemented a shared snapshot footer in an isolated .local source copy, preserving generatedAt/count/dropped and summary-getter evaluation order at both callers. After formatting 795 -> 801 lines (net +6); discarded measured growth, source unchanged.
src/logging/diagnostic-support-export.ts Full read: config parse failure and fs failure retain distinct exception boundaries; snapshot success/failure includes JSON creation in the catch scope. Existing read/redact/archive owners already shared. Retained.
src/logging/diagnostic-cpu-profile.ts Full read with heap/profile siblings; CPU samples/graph topology require different validation from heap allocation tree. Retained.
src/logging/diagnostic-heap-profile.ts Full read: native tree aggregation, signed V8 fields, and bounded summary are different CPU contracts. Retained.
src/logging/diagnostic-profile.ts Full shared owner read. Setup/start/stop/disable already parameterized; cleanup uncertain flag guards different state from capturing. Retained.
src/logging/diagnostic-memory-bundle.ts Full read: required numbers, optional positives, worker missing-reason filtering encode distinct import policies. Retained.
extensions/google-meet/src/cli-space-commands.ts Full read and docs; common CLI wrappers already parameterized; output shapes and token/meeting validation order differ. Retained while checking artifact sibling commands.
extensions/google-meet/src/meet-api.ts Full read. Collection core already shared. Implemented a private named-resource fetch/validation wrapper in an isolated .local source copy, migrated all three operations, and formatted it: 467 -> 468 lines (net +1). Rejected measured growth; production source unchanged.
extensions/visitor-access/src/visitors.ts Full read/docs: admission versus resume, renewal versus revocation retain distinct authority, lifetime, and failure recovery. No equivalent loop consolidation; retained.
extensions/device-pair/index.ts Full read with auth/api/callers and index tests; share fixed invocation-local issuance request across normal, QR, and two failed-QR replacement paths. Reissue and revoke timing, fresh tokens, live assertCurrent, URL/access policy and all text unchanged. Net -11 before formatter; full package tests required.
extensions/google-meet/src/cli-export.ts Full owner, caller, complete CLI artifact/export tests and docs read; createReport shares preamble, title variation and field label formatting for attendance/artifacts. Net -5 after formatter. All text/order unchanged.
extensions/facetime/src/runtime-call-control.ts Full owner, runtime, state/lifecycle/helper-result siblings and complete runtime + carrier-alias suites read. Shared ordered safe-mute/terminate loop with explicit method/action/error message tuple; lazy method lookup, receiver, peer retention, separate caught errors and later two-topology absence proof unchanged. Net -12 after formatter.
extensions/facetime/src/runtime-call-events.ts Full owner read. Incoming/outgoing/active creation differs in status installation timing, pending dial authority and answer effects; retained.
extensions/facetime/src/runtime.ts Full owner read; retained independent pending-dial and active-call authority/settlement; no schema/protocol changes.
extensions/facetime/src/runtime-state.ts Full read; native state projection uses nullish preservation with max-only numeric sampling. Types/public status retained.
extensions/facetime/src/call-lifecycle.ts Full read; alias/lifecycle authority and FIFO native command owner already shared. Retained.
extensions/facetime/src/runtime-helper-results.ts Full read; pending-dial peer filtering differs from active calls; absence proofs retain snapshot epoch and complete topology. Retained.
extensions/visitor-access/src/cloudflare.ts Full read; single API request owner already shared, read/update identity and before-effect authority preserved. Retained.
extensions/diagnostics-prometheus/src/service.ts Read major event/render/service paths; one truncated queue-drop segment not claimed complete. Metric names/descriptions are text contracts. No edit.
extensions/diagnostics-prometheus/src/prometheus-metric-store.ts Full read; counter mutates retained sample whereas gauge replaces it, so scalar setter unification would obscure snapshot identity semantics. Admission core already shared.
extensions/diagnostics-prometheus/src/service-memory.ts Full read; metrics already share typed field tables; counter-value vs gauges distinct.
extensions/diagnostics-prometheus/src/service-sessions.ts Full read; session roster gauges and event counters distinct authorities. Retained.
extensions/teams-meetings/index.ts Full read; shared SDK meeting owner already absorbs flow. Retained.
extensions/slack-huddles/index.ts Full read; shared SDK meeting owner already absorbs flow. Slack-specific input/timeout/admission policy retained.
extensions/session-share/src/session-catalog.ts Partial combined read (output truncated), no complete-audit claim. Remote refresh authority distinct from native file catalog; no edit.
extensions/admin-http-rpc/src/handler.ts Full owner, methods/index/callers, full handler/index tests and admin HTTP docs read; shared success/failure response envelope preserves ID/variant/metadata insertion order and exception behavior. Net -7 after formatter. Protocol fields/auth/allowlist untouched.
extensions/facetime/src/runtime-call-control.ts Second pass shares invocation-local cleanup failure logger with stage text explicit. Four asynchronous cleanup effects still evaluated/awaited in original order; optional logger formatting and callback return behavior preserved. Additional -13; module total -25.
extensions/llm-task/src/llm-task-tool.ts Full read; model/credential/default ownership and result/schema handling are already shared or different public errors; retained.

core

File Inspection and result
src/claws/update-capability-changes.ts Implemented shared current/desired resolved capability view; explicit memory config parameter preserves original current-memory source. Removed routing of each field to parallel roots. Deny and allow sets use shared classifier with explicit wildcard grant handling; deny reverses direction, preserving removal precedence. Full owner/test read. Focused update-capability-changes.test.ts; full src/claws pending freeze.
src/claws/application-plan.ts Fully reread. Extension preflight carries protocol-sensitive omissions and ordered diagnostic policy; no equivalent runtime duplicate beyond existing owners.
src/claws/packages.ts Fully reread. Skill/plugin install paths share lease owner; preflight, resume, runtime activation and rollback remain distinct. No broad lifecycle consolidation; still evaluating narrow candidates.
src/claws/update-plan.ts Fully reread. Resource loop facts and policy differ; evaluating common action projection without changing digest omissions.
src/process/exec-runner.ts Fully reread. Current main already shares output-stream handlers; startup vs final results and stream deadline/custody state remain distinct. No sound reduction yet.
src/system-agent/operations-execute.ts Fully reread. Persistent owner already shared; distinct lazy dispatch retained. Implemented shared config-set/ref dispatch through the same persistent operation and runConfigSetOperation owner, with audit operation and summary/details branch explicit. Existing full operations.test.ts and config-write-validation.test.ts read; no test changes.
src/system-agent/operations-execution-helpers.ts Fully reread. Live proof and persistent mutation authority operate at separate times, distinct failure messages retained.
src/system-agent/verified-inference.ts Fully reread with complete verified-inference.test.ts and support. Implemented shared execution-auth fingerprint selector, preserving creation throws vs revalidation catch, trim/default preparation, runtime/credential selection, and all live artifact checks. Measured small but real -5 after formatter; owner protocols unchanged.
src/system-agent/setup-inference-turn.ts Fully reread. Probe owner shared; verify requires exact owner snapshot/current config revalidation, completion intentionally does not. Public wrappers preserve different user messages.
src/claws/lifecycle-delete-support.ts Retained: filesystem staging restoration survives authority loss; ownership and post-config cleanup errors deliberately differ. No safe shared loop across mutation boundaries.
src/claws/workspace-update.ts Retained: removal rollback requires absence; overwrite rollback requires exact new digest; merging validation obscures opposite preservation rules.
src/claws/lifecycle-state.ts Retained: shared owner already covers config removal and monitor drainage. Action rows have different omissions and fixed order.
src/claws/export.ts Retained: portable projections and output serialization preserve exact bytes; data-path declarations are field-specific.
src/claws/package-remove.ts Retained: before/after claim reads intentionally bind different state and authority; retain/uninstall have distinct independent-owner checks.
src/system-agent/config-redaction.ts Retained: value and embedded-path checks differ for URLs, unknown owners, container labels, schema dynamic segments. Current metadata preparation is duplicated but factoring adds equal plumbing.
src/system-agent/operation-types.ts Retained public parsed operation contract, inspected as dispatcher input.
src/process/command-queue.ts Retained: shared queue owner already normalizes timeout and generation logic; callback/abort/owner-deadline ordering distinct.
src/process/supervisor/supervisor.ts Retained: current main already shares stream handlers/deadlines. Construction, result/output, and process extinction are different lifetimes.
src/process/exec-output.ts Retained: head/tail/discard capture carry distinct byte accounting, UTF-8 boundary and retained-buffer behavior.
src/process/exec.ts Retained: buffered discard-stream accounting cannot delegate to combined runner cap without changing observable captured output/error behavior.
src/claws/update-apply.ts Implemented shared rollback step registry and ordered agent/package/(optional cron)/MCP/workspace rollback core. Each closure defers method lookup and preserves receiver; original catch policies/partial classification stay local. Full update-apply.test.ts (including lazy-getter/receiver assertions) and update-apply.packages.test.ts read. -8 measured.
src/claws/update-rollback.ts Read canonical collector; sequential attempts and failure-label strings remain unchanged.
src/claws/add.ts Fully reread. Host requirements precede workspace/config, workspace packages follow; partial-state receipts and failure status differ intentionally. No additional candidate implemented.
src/system-agent/setup-inference-credentials.ts Fully reread. New and saved credentials already share stagePreparedCandidate; guided preparation requires different cancellation/persistence ownership. No new candidate beyond existing owner.
src/system-agent/setup-inference-activate.ts Implemented one revalidateOwner continuation retaining exact turn auth, artifact snapshot and generation, with candidate route explicit. Separate config-write and credential-activation freshness checks unchanged. Full activation suite and fixture plus credential lifecycle suite read. -4 measured.
src/claws/lifecycle.ts Fully reread with application schema and add-plan tests. Implemented shared package/extension preflight-state projection, measured combined +2 production LOC after formatting, then removed only that task-owned attempt. Retained distinct optional-field materialization and lazy diagnostics.
src/claws/application-plan.ts Second candidate implementation/rejection above: helper growth exceeded removed parallel state branches; original file restored via exact inverse task edit.
src/claws/types.ts Read package preflight/plan/result contracts for candidate; unchanged shapes.
src/process/supervisor/adapters/child.ts Fully reread. Native Windows Job, POSIX tree signaling, private-input admission, exit/close/drain facts differ; existing stdout/stderr subscriber seam handles shared output.
src/process/spawn-broker/resource-host.ts Fully reread. Pending owner acknowledgments vs inbound reordering retain different release/notification failure behavior; no shared state consolidation found.
src/process/spawn-broker/resource-server.ts Fully reread. Submission socket differs from native resource custody and parent seal; acknowledgment replay must retain distinct failure receipts.
src/system-agent/chat-turn-router.ts Fully reread. Host proposals, model approvals, operator-only decisions and wizard handoffs have distinct state retirement; common execution owner already extracted.
src/system-agent/greeting.ts Fully reread. Model cache/failure/flight identities and host-owned delivery cursor have separate lifetimes; snapshot owners captured synchronously before awaits. Retained.
src/system-agent/overview.ts Fully reread. Actually implemented a shared leaf projection, moving the summary type and passing explicit view differences for missing-model/path formatting. Two variants measured +1 net production LOC after formatting; removed the task-owned attempt. Full overview.test.ts read alongside earlier operations suite. Existing fallback agent includes explicit undefined model whereas normal summaries omit it.
src/process/exec-spawn.ts Fully reread. Command scope joins observed native cleanup after cancellation; caller result and custody reservation have different release conditions. Retained.
src/process/gateway-work-admission.ts Fully reread (split output after truncation). Sync/async continuation owners and detached work already share factories; async cleanup cannot use the sync release boundary. Retained.
src/process/terminal-pty-node.ts Fully reread with full node PTY and failure tests. Candidate queued for next edit window: share boot/prepared launch-policy catch boundary, preserving private launch receipt and helper cleanup.
src/process/terminal-pty.ts Fully reread as PTY caller/native owner; Bun and Windows argument/environment contracts distinct.
src/process/terminal-pty-protocol.ts Fully reread protocol validation owner; no shape changes.
src/process/supervisor/adapters/pty.ts Fully reread. Native PTY fallback deadline deliberately resets unlike child adapter; stdin ended/destroyed facts remain distinct.
src/system-agent/assistant.ts Fully reread plus full assistant.configured.test.ts/support. Candidate queued: shared terminal-result/runtime-error guidance with agent-turn; planner generic failure still returns null.
src/system-agent/agent-turn.ts Fully reread plus full 953-line agent-turn.test.ts and terminal suite. Same classifier candidate; failed proposal/CLI continuity cleanup remains turn-owned.
src/system-agent/inference-error.ts Read shared error contract; leave leaf unchanged to avoid broadening runtime imports. Candidate helper belongs in its own run-error module.
src/system-agent/system-agent.ts Fully reread. One-shot persistent guard intentionally differs in error identity handling; private harness cache/lease kept alive for conversation, separate from config metadata. Retained.
src/system-agent/dialogue.ts Fully reread: planner invocation has unique echo and null-result contract, no structural duplicate beyond guard already extracted in P1.
src/claws/mcp-update.ts Full source/test read. Candidate shared reverse-order rollback and typed failure core; guarded set/unset and provenance restoration preserve distinct ownership contracts.
src/claws/cron-update.ts Full source/test read. Same rollback-core candidate; readiness failure vs uncertain scheduler mutation remain separate.
src/claws/package-update.ts Full source/test read. Candidate share conflicting-pin predicate and compare-and-swap claim publication across persist/complete/final reconciliation, with read/write timing unchanged. Extra external-artifact rollback policy stays local.
src/claws/provenance-write.worker.ts Fully reread. Package lease proof differs from MCP pending reconciliation; no shared mutation semantics. Retained.
src/claws/removal-journal.worker.ts Fully reread. Begin and rollback bind different journal state and commit receipts. Retained.
src/claws/provenance-runtime-read.ts Fully reread. P1 shared failed snapshots remain owner; handoff/publication and lifecycle authority scopes separate. Retained.
src/system-agent/inference-fallback.ts Fully reread. Policy verification success returns route while ordinary verification success returns live binding; existing shared owner handles attempt/dedup/failure logic. Retained.
src/system-agent/setup-inference-credential-access.ts Fully reread with complete lifecycle and activation tests. Queued candidate: shared exact-owner mutation-token read, and revision validator accepting explicit prepared revision. No read crosses an await/mutation.
src/system-agent/setup-inference-transition.ts Fully reread. Apply/recovery callbacks own separate config/auth receipts and settlement; reverse patch logic preserves concurrent edits. Retained.
src/system-agent/setup-apply.ts Fully reread. Existing runCommittedFollowUp already shares postcommit authority/error policy; roster materialization, locked candidate and after-write route proof are distinct snapshots.
src/system-agent/chat-wizard-host.ts Fully reread. HOSTED_SETUP already unifies variants; structured/text validation could share a helper but introduces equal adapter code; no production change during freeze.
src/claws/migrate.ts Fully reread. Queued pure package-file summary projection candidate shared by consent digest and visible plan; generated package cleanup/adoption checks stay separate.
src/claws/migrate-package.ts Fully reread. Preview cleanup removes its temporary tree; generated destination cleanup checks every exact file digest and only removes empty directories. Retained separate publication/cleanup policy.
src/claws/project-build.ts Fully reread. Each selected input binds validated bytes; a common capture helper is possible but small. Archive order, reinspection, atomic link publication retained.
src/claws/project.ts Fully reread. Project discovery, portable collisions, excluded source trees and exclusive writes have distinct error precedence. Retained.
src/system-agent/assistant.ts; agent-turn.ts; new inference-run-errors.ts Share existing terminal-result and runtime-exception guidance. Planner generic failure still returns null; turn preserves its phase fallback and clears partial session state. Original terminal precedence and strings unchanged.; 2
src/process/terminal-pty-node.ts Shared boot/prepared launch authority and error boundary; per-frame body, retained readiness receipt, helper exit/IPC/output settlement unchanged.; 3
src/system-agent/setup-inference-credential-access.ts Shared exact-owner mutation-token reads and revision comparison; every read remains at original point around prepare/publish/rollback/final assert. Explicit revision argument preserves undefined refusal if an invalid runtime ever supplies one.; 8
src/claws/workspace-update.ts; mcp-update.ts; cron-update.ts; update-rollback.ts Common reverse-order rollback collection and typed throw, with workspace partial=true explicit. Package external-artifact rollback policy remains local.; 4
src/claws/package-update.ts Shared conflicting-pin predicate across initial/current reads and claim CAS/publication across persist/complete/reconciliation. Reads and writes remain at original boundaries.; 12
src/claws/migrate.ts Shared sorted package-file summary for visible plan and canonical integrity calculation; same bytes, digests, sort and visible property order.; 2
src/claws/reader.ts Shared five-field source identity preparation; callback receives a clone so mutation cannot influence final source identity.; 3

logging

File Inspection and result
redact-linear-matchers.ts Full read; implemented shared cached-run end scanner for JWT/form values, keeping three independent JWT segment caches and per-call state. Reused existing fixed-width tail checker for dapi and Atlassian rules, retained only rightmost valid Atlassian split. -18 lines measured 2026-10-09T00:34Z.
redact-pattern-runtime.ts Full read; matching/replacement and atom parser preserve distinct regex semantics; no sound further shared core.
redact-pem.ts Full read; scanner state versus composed prepend histories distinct, retained.
redact-json-tokens.ts Full read; scalar, empty-container and raw-line tokens differ in origin/path/encoding. Factory could consolidate default empty arrays but adds comparable typed plumbing, retained pending other candidates.
redact-edit-composition.ts Full read; composition versus rebasing use different coordinate spaces. Retained.
diagnostic-liveness.ts Full read; event and warning cooldowns have distinct ownership. Numerical helpers shared only across unrelated modules, no change.
diagnostic-session-attention.ts Full read; reason/type distinctions carry recovery semantics, retained.
diagnostic-owned-activity.ts Full read; retry wait and backend activity have different lifetime, renewal and completion; retained.
diagnostic-session-recovery-coordinator.ts Full read; sync versus async completion/release ordering retained.
diagnostic-runtime.ts Full read; queue events and backlog mutations differ, retained.
diagnostic-session-recovery.ts Full read; ordered fields and outcome discriminants preserve text, retained.
diagnostic-argument-churn-activity.ts Full read; continuity, policy-wait and sequence merge are distinct authoritative evidence. Retained.
diagnostic-repeated-request-activity.ts Full read; repeated request count is distinct from argument churn semantic clock, retained.
diagnostic-run-activity-state.ts Full read; alias maps and owner indices differ in invalidation; retained.
diagnostic-run-activity-snapshot.ts Full read; deadlines derive from different owner/evidence clocks; retained.
diagnostic-tool-loop.ts Full read; already narrow event owner, retained.
diagnostic-model-stream-progress.ts Full read; stream progress and throttled events/timeline must have separate lifecycles, retained.
diagnostic-gc.ts Full read; listener presence versus current callback ownership checks intentional. Retained.
diagnostic-heap-snapshot.ts Full read; native capture, file reservation and cleanup retain authority boundaries. Retained.
diagnostic-phase.ts Full read; overlapping phase identities and bounded history already direct. Retained.
code-mode-diagnostic.ts Full read; scalar/list bounding already parameterized, retained.
diagnostic-payload.ts Full read; convenience wrapper exported through SDK is contract, retained.
diagnostic-stability-readers.ts Full read; already shared ordered projection core, retained.
diagnostic-stability-query.ts Full read; decimal-only parsing gate preserves accepted language, retained.
diagnostic-session-context.ts Full read; generation/identity-aware enrichment lifecycle retained.
diagnostic.ts Full read; event field whitelists and text differ; no spreading caller params. Recovery warning and eligibility timing retained.
logger.ts Full read; native conversion versus diagnostic arguments, file versus log-record paths retain observable distinctions. Retained.
subsystem.ts Full read; console override/raw/JSON/file paths already share emit owner; retained.
console.ts Full read; capture and pre-capture dispatch share output owner, retained.
config.ts Full read; partial style and redaction config reads have independent failure domains, retained.
log-file-path.ts Full read; profile encoder and rolling-family selectors preserve documented contracts. Retained.
log-file-shared.ts Full read; existing date/fs helper owner is small, retained.
secret-redaction-registry.ts Full read; registered membership, scoped snapshots and reentrant replacement retain distinct lifecycle. Retained.
diagnostic-stability-bundle.ts Full read plus complete bundle tests; implemented shared inventory of matching regular bundle files with explicit stat failure policy (throw / use-zero). Read path keeps missing-file outcome; pruning retains best-effort stat fallback and published-file protection. Serialized bundle and public exports untouched. Delta pending formatter.
diagnostic-memory-bundle.ts Full read; required/optional numeric fields and missing-worker filters encode different import policies; retained.
redact-bounded.ts Small owner preserving existing per-chunk replacement semantics; retained.
redact-source.ts Cached tokenizer and parser have distinct acceptance roles; retained.
redact-prefilter.ts Different conservative trigger supersets intentionally protect different sinks; retained.
redact-internal.ts Publicly used read/copy seam enforces redaction provenance; retained.
redact-internal-state.ts WeakMap proof plus live policy/registry revision needed; retained.
redact-mask.ts Source value delimiters and full/hinted mask distinctions preserve output; retained.
redact-performance.ts Small conditional measurement owner; retained.
structured-authorization-code.ts Error transport code exemption differs from secret code fields; retained.
parse-log-line.ts Named, positional, and root context precedence is intentional; retained.
json-console-line.ts Block trimming/control-sequence policy differs from single-line output; retained.
logger-file-message.ts Message spans retain native-versus-JSON roles and UTF16 clipping; retained.
timestamps.ts Shared cache and differing output formats already direct; retained.
logger-settings-internal.ts File-target bridge prevents logger dependency cycle; retained.
redact-patterns.ts Full rule/scanner read; AWS URL-context and pass-prose classifications differ; rule order/source identity contractual. Retained.
diagnostic-run-activity-recovery.ts Full read; marker collection already shares clear core. Retained.
diagnostic-run-activity.ts Full read and recent semantic-progress change inspected. Apparent unreachable boolean provenance branch is reachable: imported type is true; DiagnosticEmbeddedRunOwner. Retained exact authority semantics.
logger-file-transport.ts Full read; sync exit rescue versus async bounded batches already share safe prepare owner; issued append cancellation differs. Retained.
log-tail.ts Full read; window cursor, rotation, selected-line masks and preceding multiline context require distinct state; retained.
redacting-stream.ts Full read; partial possible longest match retention intentional; retained.
message-lifecycle.ts Full read; queue/state versus processed events retain distinct enablement and reference requirements; retained.
diagnostic-session-state.ts Full read; alias merge and generation policies differ from run activity; retained.
diagnostic-embedded-run-index.ts Latest owner is sequence-derived rather than insertion-ordered; retained.
levels.ts Small typed severity mapping; retained.
env-log-level.ts Warning deduplication owns invalid-value transitions; retained.
state.ts Native/source singleton with upgrade field initialization; retained.
types.ts Public settings contract; retained.

providers

File Inspection and result
amazon-bedrock/stream.runtime.ts Full 1,294 lines reread including prior partial tail. Candidate: event handlers repeatedly pass same stream-owned block/output/cache state; use explicit shared state owner. Message/reasoning conversion, tool completion, refusal buffering, endpoint and cache policy distinctions retained.
anthropic/register.runtime.ts Full 651 lines reread. Existing forward-compat model paths distinguish shipped generations, canonical IDs, CLI provider, and catalog/explicit operator overrides. Retained; simple merger would hide those contracts.
microsoft-foundry/onboard.ts Full 615 lines reread. Candidate: Anthropic and chat connection-test payloads duplicate the same user/max_tokens body; select endpoint/thinking explicitly. Prompt families, Azure listing and tenant fallback remain distinct.
minimax/provider-registration.ts Full 345 lines reread. Regional methods already parameterized. Candidate: repeated thinking hook duplicates contract owner; modern-model hook shared between both provider variants. Catalog credential precedence remains separate.
minimax/provider-contract-api.ts Full module read. Existing shared regional/static provider descriptor owns thinking profile.
minimax/provider-catalog.ts Full module read. Public API exports mean portal factory alias is retained.
minimax/index.ts Full module read. Registration order preserved.
ollama/src/stream.runtime.ts Full 1,262 lines reread. Deferred tool arguments, sanitizer rewrites, suppressed-thinking usage and reader/resource cleanup are distinct contracts. Retained pending lifecycle sharing evaluation.
acpx/src/runtime.ts Full 1,322 lines read. Retained: generation/record custody, current-vs-retired snapshots, launch/probe leases and close/reset lifecycles have distinct authority and cleanup contracts. Shared upstream ACP behavior belongs in acpx dependency per scoped AGENTS; dependency changes outside task.
agentsapi/agentsapi-messages.ts Full 715 lines read. Retained: canonical reconciliation, commentary/reasoning emission, recovered partials, terminal usage and transient event usage intentionally have different metadata/closure rules.
agentsapi/agentsapi-client.ts Full 684 lines read. Retained: SDK operations already own transport; artifact pagination has explicit 100-page and duplicate-cursor bounds unlike unbounded SDK iterPages. Request identity checks differ by returned object.
agentsapi/agentsapi-native-items.ts Full 191 lines read. Retained: transcript text and bounded structured value projections preserve distinct output shapes; callback extraction would not reduce code.
agentsapi/agentsapi-usage.ts Full module read. Retained: canonical usage fills absent counters and prices, unlike transient usage projection which preserves missing buckets.
elevenlabs/speech-provider-factory.ts Full 493 lines read. Retained: numeric directives already share validation; Talk and runtime config defaults/normalization intentionally differ.
xai/src/responses-tool-shared.ts Full 255 lines read. Retained: shared request/response owner already exists; annotation fallback, bounded raw-prefix offsets and inline citations have different scan/normalization contracts.
xai/src/web-search-provider.runtime.ts Initial 260 lines read; remaining tail not yet audited. Auth selection/profile fallback guards are not duplicate lifecycle state.
xai/speech-provider.ts Full module read. Shared synthesis preparation exists; buffered/stream result adapters need distinct audioBuffer/audioStream/release fields.
xai/speech-provider-metadata-factory.ts Full module read. Retained: materialized config, raw config and Talk overlays intentionally differ in defaulting/secret resolution.
google/realtime-voice-model-contract.ts Full module read. Retained: model version predicates and Live 3.8 extended-thinking contract differ as documented by existing wire proof.
copilot/src/history-compaction.ts Full module read; no changes.
copilot/src/attempt-session-setup.ts Full module read; prompt authority, settled finalization, raw modes and proxy-backed compaction config are intentionally distinct.
copilot/index.ts Full module read; lazy plugin-state store and runtime registration unchanged.
xai/src/web-search-provider.runtime.ts Remaining tail read; now complete. Retained OAuth-first refresh, configured-secret blocking and env/profile API-key fallback ordering. Cancellation/errors are deliberately handled differently by each route.
xai/src/tool-auth-shared.ts Full module read; resolved/blocked/missing credentials have different observable sync capability vs async request behavior. Retained.
xai/src/tool-config-shared.ts Full module read; already narrow field normalization. Retained.
xai/src/x-search-config.ts Full module read; explicit base-URL fallback and mutable setup config owner retained.
github-copilot/models.ts Full module read; live vendor metadata differs from forward-compat defaults, and starter selection priorities retain their explicit order. Retained.
github-copilot/embeddings.ts Full module read; model discovery and embeddings have distinct timeouts/error policies; query batch intentionally sends independent requests. Retained.
github-copilot/model-metadata.ts Full module read; live declared effort opt-outs override manifest fallbacks; retained.
github-copilot/runtime-auth-error.ts Full module read; HTTP and timeout diagnostics preserve separate fields/cause. Retained.
venice/index.ts Full module read; SDK entry/catalog/replay owners already shared. Retained.
venice/models.ts Full module read; known catalog rows retain metadata while newly discovered rows derive capabilities; immutable copy/compat behavior differs. Retained.
venice/usage.ts Full module read; balance and epoch usage projections encode different measurements. Retained.
venice/pricing-api.ts Full module read; shared rate reader already parameterized through object shape; extended cache-price validation distinct. Retained.
venice/stream.ts Full module read; model-bound signature replay and unsigned Gemini 3 downgrade preserve per-occurrence call/result association. Retained.
zai/index.ts Full module read; interactive capture vs noninteractive persistence and endpoint detection are already shared where equivalent. Retained.
apple-fm/index.ts Full module read; lazy native owner and setup callbacks already shared. Retained.
qwen/index.ts Full module/test read; shared live-catalog resolver implemented.
qwen/provider-catalog.ts Full module read; preserves distinct endpoint catalogs/defaults. Retained.
qwen/models.ts Model-family and base-URL catalog selection portion read; no changes.
qwen/stream.ts Read wrapper and family constraint paths, including tail missed by the initial combined output. Retained pre/post-caller distinctions from P1.
tencent/index.ts Full module read; provider variants already table-driven. Retained.
volcengine/index.ts Full module read; existing SDK provider-family catalog owner. Retained.
byteplus/index.ts Full module read; existing SDK provider-family catalog owner. Retained.
cloudflare-ai-gateway/index.ts Full module read; explicit credential metadata and regional prompts differ; no smaller shared owner found. Retained.
anthropic/provider-contract-api.ts Full module read; three auth descriptors mostly distinct public text, table extraction would add code. Retained.
anthropic/fast-mode-policy.ts Full module read; native/service-tier routing and auth availability states are distinct. Retained.
minimax/music-generation-provider.ts Full module reread plus shared media runtime; request policy, deadlines and base-response checks already share one owner. Retained stream completion/aggregate suppression rules.
minimax/media-provider-runtime.ts Full module reread; guards already shared. Image generation intentionally has different error fallback text/validation and cannot substitute current helper directly.

channels

File Inspection and result
extensions/mattermost/src/mattermost/client.ts Completed P1-truncated full read. Guarded/custom request branches have different capability capture and request-current checks; explicit variant helper saves little and blurs lifetime. API wrappers already share request owner. Retained.
extensions/signal/src/channel.ts Revisited send text/media candidate. Abort placement, chunks and reply fanout remain distinct; retained pending complete new-source audit.
extensions/zalouser/src/zalo-js.ts Complete read. Re-evaluating entry-resolution duplication with explicit result projection; preserve read-only persistence and friend-only ambiguity note. QR/auth/listener ownership not collapsed.
extensions/zalouser/src/tool.ts Complete owner/test/caller/send owner read. Consolidate text/image/link dispatch and receipt handling with explicit per-action validation, send function, and media options; all strings and result shapes retained.
extensions/zalouser/src/send.ts Complete read; chunk acceptance and per-delivery callback order retained.
extensions/zalouser/src/send-api.ts Complete read; audio is two-effect flow with partial receipt and failure distinction; retained.
extensions/zalouser/src/setup-surface.ts Complete read; auth lookup callers retain different empty/unresolved semantics.
extensions/zalouser/src/directory-index.ts Complete read; canonical name index retained.
extensions/nostr/src/nostr-profile-http.ts Existing mutation gate already shared. Import/update differ in body-error acceptance, rate-limit/account checks and persistence ordering; no sound common handler with a net reduction.
extensions/line/src/send.ts Push/reply already share transport. Identity loaders have nested catches because account-resolution failure must not be cached whereas provider failure is cached; retained.
extensions/line/src/outbound.ts Rich/inline quick reply branches intentionally alter batch-vs-separate delivery and accepted-part ordering; retain pending payload-shaping approach.
extensions/line/src/auto-reply-delivery.ts Reply-token, push and text recovery paths have distinct ambiguity/partial-send state and reply-token consumption; retained.
extensions/mattermost/src/mattermost/interactions.ts Token/source/post gates deliberately ordered; fallback system event and post-update failures handled independently. Retained.
extensions/tlon/src/urbit/sse-client.ts Subscribe/ack/stream use different timeouts, response parsing and watermark updates; chunk delimiter and surrogate-byte accounting retained.
extensions/signal/src/client.ts Native HTTP and SSE have different deadline lifetimes, body decoding and drain semantics. No switch to Fetch.
extensions/signal/src/client-container.ts Full REST/WS/RPC adapter reread. Each endpoint retains backend-specific recipient/receipt/protocol differences; no body-reader merger across differing cap/error/release semantics.
extensions/x/src/api.ts Completed P1-truncated full read. Cost reservation/current-authority and OAuth rotation must retain existing request-order contract; user/app token lookups differ intentionally.
extensions/sms/src/status.ts Comparison functions intentionally preserve distinct discriminant/result shapes and strings; shared generic comparator would add more type/projection plumbing than remove. Probe scheduling simplified separately.
extensions/irc/src/setup-surface.ts Existing account text-input factory already consolidates most variants. Port/list normalization and NickServ prompted transitions differ materially; retained.
extensions/irc/src/outbound-base.ts Small canonical sanitizer; retained.
extensions/irc/src/send.ts Current client checks before and after awaited dispatch are both required; transient client owns join/quit and partial receipt. Retained.
extensions/googlechat/src/approval-handler.runtime.ts Existing native approval runtime already centralizes lifecycle; cards retain per-kind headers/content and transport suppression ordering.
extensions/googlechat/src/format.ts Distinct IR projections preserve source ranges/escaping and parser markers; no combined renderer.
extensions/nextcloud-talk/src/send.ts Message/reaction transport resembles duplication but payload signing and dispatch callback ordering differ; common helper would require more parameter plumbing than worthwhile reduction.
extensions/zalouser/src/channel.adapters.ts Account/current callback ownership already shared by text/media adapters; group/user lookup ranking intentionally differs.
extensions/zalouser/src/text-styles-ranges.ts Block/inline boundary projection distinctions retained; no normalization semantic change.
extensions/zalouser/src/text-styles-inline.ts Token protection, local tag projection and range ordering preserve byte/range contracts.
extensions/zalouser/src/text-styles-shared.ts Shared metadata/token ownership retained.
extensions/zalouser/src/text-styles.ts Shared parser/protection/compiler sequence already one owner.
extensions/tlon/src/monitor/index.ts Full 1,282-line P2 source reread. DM/channel decoding, invite snapshot versus delta tracking, admission revalidation and deferred group discovery have distinct semantics; existing P1 state/target sharing retained.
extensions/tlon/src/monitor/utils.ts Full read. Inline top-level links/breaks and nested emphasis differ intentionally; shared extraction owner already present.
extensions/tlon/src/monitor/approval-runtime.ts Full reread. Blocked-ship checks catch errors during normalized matching; blocked-list display only reads raw list. Extracting read outside the catch would change malformed-provider behavior, so retained.
extensions/signal/src/approval-reactions.ts Full read. Persisted route normalization differs from fresh request route normalization; rendering and delivery registration require checks at different ownership stages. No state/protocol change.
extensions/mattermost/src/channel.ts Full 809-line reread. Common content sender already serves adapters. Read/reaction action gates and threaded/current target behavior retained. Directory guards could share a tiny factory, but would not materially improve clarity.
extensions/clickclack/src/discussions/service-open.ts Full reread after freeze. Candidate queued for parent: bind repeated revocation argument blocks into local closure preserving exact effect positions. Initial/post-create label/title/section/URL projection can share pure preparation while retaining their snapshots.
extensions/clickclack/src/discussions/service.ts Full reread. Similar binding resolution appears in info/open/reconcile; asynchronous helper risks additional suspension or changing inactive fallthrough behavior, so kept separate. Metadata projection differs in fallback agent and live config-read timing.
extensions/clickclack/src/discussions/naming.ts Full read. Existing label/fingerprint/session identity owners retained; no hash/namespace/shape change.
extensions/clickclack/src/discussions/control-session-url.ts Full read. Canonical session URL builder retained.

misc

File Inspection and result
memory-wiki/src/chatgpt-import.ts Full current source read, including previously partial rollback. Created/updated already share one recovery loop; skip/snapshot ordering, per-slot persistence and finalization fences remain necessary. Retain.
memory-wiki/src/chatgpt-import-recovery.ts Full read. Reserve/move/remove operations have distinct ownership and symlink identity checks. Retain.
crabbox/src/crabbox-worker-provider.ts Full read. Candidate shared runtime preparation has genuinely different scrub/target/capture/error-cleanup ownership; defer unless simpler explicit parameters can preserve it.
crabbox/src/crabbox-worker-warm-image.ts Full read. Retirement/capture/checkpoint already own shared CAS code; phase-specific collection keeps different retention obligations. Retain.
openshell/src/backend.ts Full read. Common command execution/failure and SSH session lifetime are repeatable candidates; mirrors and remote initialization remain separate.
openshell/src/fs-bridge.ts Full read. Write/create have a small shared core candidate. Root/alias precedence and local/remote ordering remain distinct.
openshell/src/cli.ts Full read. Existing narrow CLI owner; potential common sandbox command validation.
openshell/src/mirror.ts Full read. Stage/replace already share recursion with explicit replace. Retain.
team-reports/src/store.worker.ts Full read. Queries and scratch aggregation already share column/row owners; remaining SQL scopes differ. Retain.
cua-computer/src/driver-result.ts Full read. Typed optional field projections are potential local table-driven reduction; native schemas preserved.
logbook/src/service.ts Full read (P1 had partial). Lifecycle/analysis/capture ownership distinct; llm call preambles too small to justify new policy wrapper. Retain.
active-memory/index.ts Full read. Prompt publication/recollection deadlines and private audience fences distinct; preflight and recall must retain separate budgets. Retain.
beam/src/mirror.ts Full read. Active uploads dedupe/fingerprint; terminal uploads refresh completion and rotate failed ownership. One generic path would obscure different evidence and errors. Retain.
mxc/src/fs-bridge.ts Full read. Root/mount precedence differs from OpenShell. Cross-plugin private sharing prohibited; generic SDK promotion for a few writes is not warranted. Retain.
raft/src/gateway.ts Full read. HTTP rejection and bridge lifecycle gates already shared; health/drain/wake auth order intentional. Retain.
onepassword/src/broker.ts Full read. Policy, pending authorization, grants and cache-hit outcomes carry different audit and revocation points. Retain.
a2a/src/http.ts Full read. Send/get request shapes, detached ownership, notification suppression and batch caps distinct. Retain.
memory-lancedb/embeddings.ts Full read. Global retirement tail preserves predecessor close failures; direct OpenAI and provider-adapter ownership intentionally separate. Retain.
oc-path/src/oc-path/universal.ts Full read. Structured JSONC/JSONL leaves already shared; YAML coercion and insertion rules differ. Retain.
oc-path/src/oc-path/jsonc/edit.ts Full read. JSONC source-editing preserves raw formatting and sentinel validation; unlike JSONL persistent AST rebuild. Retain.
oc-path/src/oc-path/jsonl/edit.ts Full read. Object/array recursive replace has different entry wrappers; common recursion adds type plumbing for negligible reduction. Retain.
diagnostics-otel/src/service-metrics.ts Full read. Catalog already uses counter/histogram helpers; descriptions/units/buckets retained.
diagnostics-otel/src/service-recorders-model.ts Full read. Started/finished shared attribution; end-only usage/content and tracked-span consumption distinct. Retain.
diagnostics-otel/src/service-recorders-tools.ts Full read. Trusted/internal admission and root context differ between process/system/tool variants. Retain.
diagnostics-otel/src/service-recorders-operations.ts Full read. Run completion retains late children unlike tool completion; no common generic finish policy added.
diagnostics-otel/src/service-recorders-harness.ts Full read. Lifecycle block resembles run but status fallback/attributes differ; the runtime already owns completion and retention. Retain.
migrate-hermes/memory.ts Full read. Two source file plan; target conflict checks repeated with Claude but shared helper would require SDK expansion for modest scope. Retain.
migrate-claude/memory.ts Full read. Collection scan/cap and canonical source/destination separation are independent obligations. Retain.
team-reports/src/render/html.ts Full read. Shared cards/history/trends already extracted, exact HTML text retained.
file-transfer/src/tools/file-fetch-tool.ts Full read, implemented common integrity decoder.
file-transfer/src/tools/dir-fetch-tool.ts Full read, implemented common integrity decoder and bounded text owner.
file-transfer/src/tools/dir-list-tool.ts Full read, implemented common bounded text owner.
file-transfer/src/tools/file-write-tool.ts Full read. Inline strict validation and media store loading already share send path. Retain.
file-transfer/src/tools/node-tool-invoke.ts Full read. Existing invocation/audit owner retained.
file-transfer/src/shared/params.ts Full read. Existing readers retained.
file-transfer/src/shared/base64.ts Full read. Strict nonallocating inspection deliberately differs from fetch decoder. Retain.
crabbox/src/crabbox-worker-desktop-macos.ts Full read completes P1 partial. Existing GUI launch owner preserves signed app/account/console checks and browser/terminal-specific launch. No sound native consolidation.
crabbox/src/crabbox-worker-desktop-windows.ts Full read completes P1 partial. interactiveScript already shares request/result/cancellation lifecycle; VNC service handover and node launch have different credential/session custody. Retain all native scripts.
crabbox/src/crabbox-worker-warm-image-store.ts Full read. Prepared/enrolled already share markPhase; canonical CAS retry and generation mutation helpers own repeated work. Projection shapes kept exact. Retain.
crabbox/src/crabbox-worker-warm-image-capture.ts Full read. Capture/create/publish/uncertain transitions require distinct current allocation predicates; remaining duplication is small ownership checks. Retain.
typesafe/src/schema.ts Full read. Array/object bounded JSON walkers differ in sparse/accessor/key constraints; schema shapes and exact guidance retained.
code-mode-quickjs/src/code-mode.worker.ts Full read. Main's exec/resume payloads repeat run+capture lifecycle; candidate for next edit window. VM loop/restore receipt/memory ownership already shared and unchanged.
code-mode-quickjs/src/executor.ts Full read. Snapshot lease is one-use; host watch/abort classifications distinct. Retain.
code-mode-quickjs/src/worker-lifecycle.test.ts Full read including real exec/resume and interrupted/legacy snapshot cases; assertions unchanged.
onnx/src/worker-client.ts Full read. Queued cancellation versus active retirement differs because the native process holds its slot until close. Error/disconnect handlers have an identical small current-worker callback candidate.
onnx/src/worker-client.test.ts Full lifecycle/FIFO/cancellation/malformed-input test read plus plugin README; unchanged.
memory-wiki/src/claim-health.ts Full read. Timestamp fallback, claim text/status grouping and page-note grouping retain different admission/normalization semantics. Existing common freshness builder retained.
team-reports/src/work-sessions.ts Full read. Viewer-local profile/page cache ownership and bounded per-member dispatch distinct; no new shared owner required. Retain.
code-mode-quickjs/src/code-mode.worker.ts Exec/resume retain their exact payload normalization and validation order, then share the one run/capture path. VM lifecycle and snapshot handling untouched.; -7
file-transfer/src/shared/node-invoke-policy-preflight.ts Invalid missing/empty names and invalid named entries share audit/rejection construction; explicit hasName retains canonical path selection and exact message spacing. Policy/real-dir tests read in full.; -9
onnx/src/worker-client.ts Error/disconnect share the same current-worker failure callback, preserving persistent error versus once-only disconnect subscription and allocation of each error at callback time.; -3

Consolidate capability projections, rollback steps, inference checks,
provider and transport handlers, and file-transfer parsing.

Preserve messages, ordering, authority checks, and persisted contracts.
Remove 513 net production lines with unchanged tests.
Remove the intermediate mapped array while retaining style field order
and indentation coalescing. Resolve the no-map-spread finding without a
lint suppression.
@clawsweeper

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

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

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

  • Current SHA: ba640e37efa705cf82d87f2965590798c1f8db28
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/logging/redact-linear-matchers.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.

Carefully review these changes before merging.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 Oct 9, 2026
@clawsweeper

clawsweeper Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR consolidates repeated request preparation, result projection, validation, and cleanup within existing core and plugin owners.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful, clean consolidation with extensive supporting validation, but demonstrated production runtime coverage is narrower than the patch.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored internal refactor is outside the external contributor setup-proof gate. The body records real Claws CLI execution and extensive preservation comparisons, with narrower runtime coverage for other owners; source inspection verifies unchanged persisted projections and canonical digest behavior, so no migration is required.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes
Reason: Removing repeated implementations reduces maintenance drift without expanding the product surface. Prior merged area history establishes owner involvement, and the patch preserves meaningful differences explicitly.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored refactor remains a distinct, useful contribution. The inspected introduced hunks preserve existing contracts, and no concrete regression was identified.

Priority: P3
Reviewed head: ba640e37efa705cf82d87f2965590798c1f8db28

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Recorded shipped-entry-point coverage exercises Claws; the plugin transport and native PTY paths have supporting tests rather than demonstrated live runs.
Agent review details

How this fits together

Core coordinates agent execution and managed agent packages, while plugins handle provider and channel operations. These paths receive requests and runtime events and produce results, messages, saved artifacts, and cleanup outcomes.

flowchart TD
  A[User and agent requests] --> B[Core lifecycle owners]
  A --> C[Provider and channel plugins]
  B --> D[Shared preparation and validation]
  C --> D
  D --> E[Existing operation and transport owners]
  E --> F[Results and messages]
  E --> G[Ordered cleanup and rollback]
Loading

Technical review

Best possible solution:

Keep consolidation within the existing owners while preserving exact outputs, live checks, rollback ordering, and stored formats.

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

Not applicable: this PR proposes behavior-preserving consolidation rather than a reported user-facing defect.

Is this the best way to solve the issue?

Yes: the inspected changes reuse existing owners and remove parallel implementations without adding configuration, SDK surface, or a competing lifecycle.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Introduced patch inspected: Read the pinned merge-base-to-head diff across all introduced paths; changes consolidate existing implementations rather than introduce new configuration or plugin SDK exports. (ba640e37efa7)
  • Full PR evidence inspected: Read the supplied opening and the remaining body through REST, preserving captured body identity 3b2fa07d919e5dd07ad984266077e61267ebac566601a73bc927c13b52e2bea4. It reports complete directory tests, four real Claws CLI cases, renderer and redaction comparisons, and explicitly distinguishes unresolved local failures from passing isolated checks. (ba640e37efa7)
  • Maintainer context: The repository context identifies a MEMBER author, and the security-guard discussion independently records repository admin access and informational security review treatment. (ba640e37efa7)
  • Current-main necessity and base drift: The touched production paths retain their pre-refactor implementations on fetched main. GitHub's comparison from the test merge's main parent to fetched main lists no overlapping changed paths; no verified superseding fix was established. (d1ebf36cd054)
  • Test merge identity: Raw recorded parents are exactly the pinned main parent followed by the reviewed PR head; the host-provided merge-result inventory contains the introduced paths. (9f45f79fb3fa)
  • Rollback contract preserved: The shared helper reverses the same undo steps, attempts them sequentially, and retains workspace partial=true. Existing update tests exercise lazy rollback lookup, receiver binding, and ordered failure reporting. (src/claws/update-rollback.ts:24, ba640e37efa7)

Likely related people:

  • Peter Steinberger: Raw commit b420450 adds src/process/terminal-pty-node.ts:33 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: b42045004ffc; files: src/process/terminal-pty-node.ts)
  • Agustin Rivera: Raw commit 39b4bdb adds src/logging/redact-linear-matchers.ts:23 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 39b4bdbb6427; files: src/logging/redact-linear-matchers.ts)
  • Gio Della-Libera: Raw commit 7d159fd adds src/claws/cron-update.ts:124 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 7d159fdc7700; files: src/claws/cron-update.ts)

PR surface

Source -512, Other 0. Total -512 across 54 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 53 1117 1629 -512
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 1 0
Total 54 1118 1630 -512

Labels

Label changes:

  • add P3: This is internal maintainability cleanup with no intended user-visible behavior change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is internal maintainability cleanup with no intended user-visible behavior change.
  • 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.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

Reviewed October 9, 2026, 2:23 AM ET / 06:23 UTC.

@steipete
steipete enabled auto-merge (squash) October 9, 2026 06:44
@steipete
steipete merged commit 98d2a0e into main Oct 9, 2026
236 of 254 checks passed
@steipete
steipete deleted the deslop/d29-core-misc-p2-20261007 branch October 9, 2026 06:46
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 10, 2026
…67646)

Share capability projections, rollback and inference handling, provider and
channel operations, file-transfer parsing, and cleanup within existing owners.

Preserve outputs, ordering, authority checks, configuration, and persisted
contracts. Remove 512 net production lines with unchanged tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant