Skip to content

refactor(acp): extract runtime composition - #644

Merged
ewen-poch merged 2 commits into
mainfrom
refactor/acp-runtime-composition
Aug 3, 2026
Merged

refactor(acp): extract runtime composition#644
ewen-poch merged 2 commits into
mainfrom
refactor/acp-runtime-composition

Conversation

@ewen-poch

Copy link
Copy Markdown
Member

Problem

ACP Electron IPC owns construction of the cross-framework runtime coordinator as well as transport registration. That mixes application composition with handler registration and leaves duplicate compatibility forwarding in AcpRuntime and AcpRuntimeCoordinator.

Issue #458 remains forward compatibility only. This pull request adds no orchestration state, parent/child relationship, budget, plan, persistence, method, event, or public API.

Proposed change

Move runtime/coordinator construction into main-owned runtime-composition.ts. Keep ipc.ts responsible for registering the unchanged ACP handler inventory against an already-composed runtime. Remove unused compatibility wrappers and duplicate continuation aliases.

flowchart LR
  M["Main application composition"] --> C["ACP runtime composition"]
  C --> R["AcpRuntimeCoordinator"]
  M --> I["Electron ACP adapter"]
  I --> R
  W["Local / remote Web captured handler registry"] --> I
  R --> E["3 unchanged ACP events"]
Loading

Handler-owned create/resume diagnostics and prompt notification tracking/rollback remain behaviorally unchanged here and are explicitly assigned to A9.4b. This PR does not claim the final side-effect-free handler boundary.

Compatibility boundaries

  • Preserve all 13 ACP calls and 3 events, including payloads, snapshots, rejection behavior, and event names.
  • Preserve Electron preload and generated Web maps.
  • Preserve local Web and remote Web use of the captured handler registry.
  • Preserve remote authorization/expiry and remote Compute download/reveal denial.
  • Preserve Specialist as Electron-only and the current Permission/Compute surface asymmetry.
  • Preserve Task, CLI, local RPC, Session identity/adoption, transcript replay, and notification behavior.
  • No public schema, persistence/data relationship, UI, or user-interaction change.

Commits and size

  1. test(transport): pin acp handler inventory
  2. refactor(acp): extract runtime composition

Production churn is +255/-289 = 544, within the 300–550 target. The new composition module replaces construction removed from the IPC adapter.

Validation

  • Changed-file Prettier: passed.
  • Changed-file ESLint with --max-warnings=0: passed with 0 findings.
  • Node and full typecheck: passed.
  • Focused ACP/Electron/preload/Web handler tests: 143/143 passed.
  • Focused Web HTTP tests: 15/15 passed.
  • Focused ACP runtime tests: 384/384 passed.
  • Focused Task/handoff tests: 10/10 passed.
  • Full Vitest: 683 files passed / 15 skipped; 10,015 tests passed / 184 skipped.
  • Full lint: exit 0; 18 warnings are unchanged baseline files, while changed files have zero warnings.
  • git diff --check: passed.
  • Independent review: Standards 0 findings; the single Spec P2 identified the A9.4b follow-up boundary instead of expanding this PR toward the 700-line hard stop.

Review focus

  • Confirm application composition, not Electron IPC, owns runtime construction.
  • Confirm removed registerAcpIpcHandlers, continuePrompt, and sendPromptForHandoff aliases have no remaining consumers and their canonical operations are unchanged.
  • Confirm existing handler diagnostics and notification side effects are unchanged and clearly deferred to A9.4b.
  • Confirm no renderer/Web/Task/CLI capability or authorization boundary changed.
  • Confirm no module cycle or issue [Feature]: Provider-neutral multi-agent research orchestration #458 speculative interface was introduced.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codex Review

Verdict: mergeable

No actionable findings.

Summary: Static inspection found no concrete merge-blocking defect in the pull request changes. The moved ACP composition preserves existing wiring, and removed compatibility aliases have no remaining repository callers. Branch and title prechecks are valid.

@github-actions github-actions Bot added the ready-to-merge All completed AI reviewers found this pull request mergeable. label Aug 3, 2026
@ewen-poch
ewen-poch force-pushed the refactor/acp-runtime-composition branch from 7d7e3e1 to 5ee9ee0 Compare August 3, 2026 02:55
@github-actions github-actions Bot removed the ready-to-merge All completed AI reviewers found this pull request mergeable. label Aug 3, 2026
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codex Review

Verdict: mergeable

No actionable findings.

Summary: No concrete merge-blocking defects found in the requested diff. Branch and pull request title prechecks are valid.

@github-actions github-actions Bot added the ready-to-merge All completed AI reviewers found this pull request mergeable. label Aug 3, 2026
@ewen-poch
ewen-poch merged commit a6904f6 into main Aug 3, 2026
23 checks passed
@ewen-poch
ewen-poch deleted the refactor/acp-runtime-composition branch August 3, 2026 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge All completed AI reviewers found this pull request mergeable.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant