Skip to content

refactor(acp): extract nori-acp-host crate (slice G2)#529

Open
CSRessel wants to merge 1 commit into
refactor/extract-nori-configfrom
refactor/extract-acp-host
Open

refactor(acp): extract nori-acp-host crate (slice G2)#529
CSRessel wants to merge 1 commit into
refactor/extract-nori-configfrom
refactor/extract-acp-host

Conversation

@CSRessel

@CSRessel CSRessel commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

Slice G2 of the crate-layering refactor (design doc). Stacked on #528 (slice G1, nori-config extraction).

What

Extracts the agent-agnostic ACP hosting machinery from nori-acp into a new Layer-0 crate, nori-acp-host:

Moved What it is
connection/ agent subprocess spawn, AcpConnection wire client, MCP server wiring
translator.rs generic ACP-wire ↔ codex-protocol event bridge
registry.rs agent registry / distribution resolution
patch.rs file-change / diff helpers
error_category.rs AcpErrorCategory + categorize_acp_error (split out of backend/mod.rs)

enhanced_error_message stays in the nori-acp backend — it's user-facing UX wording, not a wire concern.

Compatibility

nori-acp re-exports the moved modules (pub use nori_acp_host::connection; etc.), so downstream consumers (TUI) are unchanged in this slice. Slice H rewires the TUI onto direct crate deps and drops the aliases.

Why

Per the design doc §3, Layer-0 leaves (nori-acp-host, nori-protocol, mock-acp-agent) must be independently usable and testable by other projects in the ACP / harness-engineering ecosystem. This is the crate you'd pull in to host any ACP agent from your own frontend.

Validation

  • cargo test -p nori-acp-host standalone-clean (106 tests). Standalone build caught two dep-feature gaps masked by workspace feature unification (tokio-util compat, agent-client-protocol-schema unstable) — exactly the class of bug this extraction exists to surface.
  • Full workspace suite green (cargo test --workspace --exclude tui-pty-e2e).
  • cargo build --bin nori + cargo test -p tui-pty-e2e green.
  • elizacp close-the-loop TUI drive: prompt → response rendered → prompt returns.
  • just fmt, just fix -p nori-acp-host clean.

Pull the agent-agnostic ACP hosting machinery out of nori-acp into a new
Layer-0 crate, nori-acp-host, per docs/specs/crate-layering.md §3:

- connection/ (agent subprocess spawn, AcpConnection wire client, MCP wiring)
- translator.rs (ACP wire ↔ codex-protocol event bridge)
- registry.rs (agent registry / distribution resolution)
- patch.rs (file-change/diff helpers)
- error_category.rs (AcpErrorCategory + categorize_acp_error, split out of
  backend/mod.rs; enhanced_error_message stays in the backend — it is UX
  wording, not a wire concern)

nori-acp re-exports the moved modules (`pub use nori_acp_host::connection;`
etc.), so downstream consumers are untouched in this slice; the TUI is
rewired onto direct crate deps in slice H.

Validation: cargo test -p nori-acp-host standalone-clean (106 tests; caught
two feature gaps masked by workspace unification — tokio-util "compat",
agent-client-protocol-schema "unstable"); full workspace suite green;
tui-pty-e2e green; elizacp close-the-loop TUI drive green.

Part of the crate-layering refactor (docs/specs/crate-layering.md).
@cursor

cursor Bot commented Jul 4, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant