M0: ACP bridge spike (S2.2) #14

Closed
opened 2026-08-28 18:33:04 +02:00 by AlexKucera · 0 comments
Owner

Destination

Every decision the ACP bridge spike needs is made — transport framing, lifecycle, rendering, fix-card strategy, credentials — so a build session implements the acceptance criteria below without deciding anything.

Notes

  • Plan-don't-do: this map produces decisions; execution goes to the build session that picks up this spec.
  • Consult: CONTEXT.md (Engine, Museion Profile, Session, Fix Card), PRD S2.2 + the M0 milestone row, Museion/AGENTS.md (engine-gate & provisioning seams), hermes-acp-client skill (spawn/gate/capabilities; adapter 0.20.6 verified 2026-09-05).
  • Grilling tickets: load grilling + domain-modeling skills. Research tickets: research skill.
  • Tracker ops: docs/agents/issue-tracker.md (Wayfinding operations).
  • Charting decisions (2026-09-05 — settled, do not re-ask):
    • Transport: newline-delimited JSON-RPC on stdio (verified in the acp SDK — connection.py/stdio.py readline). stdout is the wire; stderr is engine logs, never parsed.
    • Child lifecycle: lazy — spawn when the debug pane opens its first session, keep alive for the app's life, tear down on app quit. EOF/crash surfaces an in-pane Restart prompt, never data loss. Binary discovery reuses the gate's winner (EngineGateModel.currentBinaryPath / EngineProbe machinery); no re-probe.
    • Version verify: advisory — initialize() returns agent_info.version; compare with state.json's engineVersion. Mismatch = one os_log line + both versions visible in the pane; never blocks (matches state.json's advisory posture).
    • Live turn: real model turn against the live engine. Credentials are user-managed — task ticket below; it gates only the live-turn verification AC, never the build (fake double first).
    • Fix-card round-trip: fake ACP server test double — a script speaking the protocol emits a fix-card-shaped session/update tool_call; the Swift client parses and renders it as a card (data, not prose). Extends the fake-binary Process pattern from EngineGateTests. No live provoked tool call; no museion-tools stub at M0 (that is #23 / M2).
    • Session cwd: home directory (~) — no Museion Home or Piece folders until M1; neutral for a resident mentor with no Piece context.
    • Pane placement: post-gate main surface — replaces today's content placeholder; the gate's Start Writing opens the pane. It is the M0 demo surface.
    • Rendering fidelity: text + tool calls first-class, rest raw — agent_message_chunk (and thought) render as text; tool_call / fix-card renders as a card; every other update type a collapsible raw-JSON row. Freeform input; multiple prompts per session.
    • Cancel: Stop button in the pane while a turn streams, wired to session/cancel.
    • Permissions: no session/request_permission handler at M0 — a conversational turn asks nothing dangerous; the adapter always offers a deny option if one ever arrives.
    • Client surface: hand-rolled thin client — initialize, session/new, session/prompt, session/cancel out; session/update notifications in (ponytail: no Swift SDK exists; revisit if one appears).

Decisions so far

Not yet specified

<empty — the fog is clear; the way to the destination is decided>

Out of scope

  • museion-tools MCP server (#23, M2) — the fix-card transport here is a test-double stand-in, not the real tool surface.
  • Session lifecycle UI beyond the pane (S2.3 — resume/fork/compact/list) — the spike is one session: new, prompt, cancel.
  • Profile backup (#15, S2.6) — separate effort, own future map.
  • A Swift ACP SDK / generated client — hand-rolled until one exists (already the AC's ponytail stance).

What to build

The app spawns the Engine as a child process (hermes acp -p museion, stdio JSON-RPC) through a hand-rolled thin Swift ACP client — initialize, session new/prompt/update, cancel. It opens a Session, sends a prompt, and renders the streamed reply live in a debug pane. A fix-card-shaped structured message round-trips (received and displayed as data, not prose). App quit tears down the child; a child crash surfaces a restart prompt, never data loss. (PRD S2.2, M0; ponytail: hand-rolled thin client until a Swift SDK appears)

Acceptance criteria

[ ] Child spawned under the museion profile; initialize handshake completes against the actually-installed Hermes version
[ ] Session opens; prompt sent; streamed updates render live in a debug pane
[ ] A fix-card-shaped message round-trips and renders as structured data
[ ] Quit tears down the child cleanly; crash surfaces a restart prompt; no data loss
[ ] Engine version verified against the recorded one from the gate

Blocked by

• #13 — M0: Profile provisioning & skill seeding (S2.1)

[Generated by AI]

## Destination Every decision the ACP bridge spike needs is made — transport framing, lifecycle, rendering, fix-card strategy, credentials — so a build session implements the acceptance criteria below without deciding anything. ## Notes - Plan-don't-do: this map produces decisions; execution goes to the build session that picks up this spec. - Consult: CONTEXT.md (Engine, Museion Profile, Session, Fix Card), PRD S2.2 + the M0 milestone row, `Museion/AGENTS.md` (engine-gate & provisioning seams), `hermes-acp-client` skill (spawn/gate/capabilities; adapter 0.20.6 verified 2026-09-05). - Grilling tickets: load grilling + domain-modeling skills. Research tickets: research skill. - Tracker ops: docs/agents/issue-tracker.md (Wayfinding operations). - Charting decisions (2026-09-05 — settled, do not re-ask): - **Transport**: newline-delimited JSON-RPC on stdio (verified in the acp SDK — `connection.py`/`stdio.py` `readline`). stdout is the wire; stderr is engine logs, never parsed. - **Child lifecycle**: lazy — spawn when the debug pane opens its first session, keep alive for the app's life, tear down on app quit. EOF/crash surfaces an in-pane Restart prompt, never data loss. Binary discovery reuses the gate's winner (`EngineGateModel.currentBinaryPath` / `EngineProbe` machinery); no re-probe. - **Version verify**: advisory — `initialize()` returns `agent_info.version`; compare with `state.json`'s `engineVersion`. Mismatch = one os_log line + both versions visible in the pane; never blocks (matches state.json's advisory posture). - **Live turn**: real model turn against the live engine. Credentials are user-managed — task ticket below; it gates only the live-turn verification AC, never the build (fake double first). - **Fix-card round-trip**: fake ACP server test double — a script speaking the protocol emits a fix-card-shaped `session/update` tool_call; the Swift client parses and renders it as a card (data, not prose). Extends the fake-binary Process pattern from EngineGateTests. No live provoked tool call; no museion-tools stub at M0 (that is #23 / M2). - **Session cwd**: home directory (`~`) — no Museion Home or Piece folders until M1; neutral for a resident mentor with no Piece context. - **Pane placement**: post-gate main surface — replaces today's content placeholder; the gate's Start Writing opens the pane. It is the M0 demo surface. - **Rendering fidelity**: text + tool calls first-class, rest raw — `agent_message_chunk` (and thought) render as text; tool_call / fix-card renders as a card; every other update type a collapsible raw-JSON row. Freeform input; multiple prompts per session. - **Cancel**: Stop button in the pane while a turn streams, wired to `session/cancel`. - **Permissions**: no `session/request_permission` handler at M0 — a conversational turn asks nothing dangerous; the adapter always offers a deny option if one ever arrives. - **Client surface**: hand-rolled thin client — `initialize`, `session/new`, `session/prompt`, `session/cancel` out; `session/update` notifications in (ponytail: no Swift SDK exists; revisit if one appears). ## Decisions so far - [Task: provider credentials for the museion profile](https://git.babylondreams.de/AlexKucera/museion/issues/49) — env-inheritance sufficed: one-shot `ready` with zero config changes. Serving: Z.AI / GLM glm-5.3 via inherited shell-env key; profile config untouched. Live-turn AC unblocked. ## Not yet specified <empty — the fog is clear; the way to the destination is decided> ## Out of scope - museion-tools MCP server (#23, M2) — the fix-card transport here is a test-double stand-in, not the real tool surface. - Session lifecycle UI beyond the pane (S2.3 — resume/fork/compact/list) — the spike is one session: new, prompt, cancel. - Profile backup (#15, S2.6) — separate effort, own future map. - A Swift ACP SDK / generated client — hand-rolled until one exists (already the AC's ponytail stance). --- ## What to build The app spawns the Engine as a child process (hermes acp -p museion, stdio JSON-RPC) through a hand-rolled thin Swift ACP client — initialize, session new/prompt/update, cancel. It opens a Session, sends a prompt, and renders the streamed reply live in a debug pane. A fix-card-shaped structured message round-trips (received and displayed as data, not prose). App quit tears down the child; a child crash surfaces a restart prompt, never data loss. (PRD S2.2, M0; ponytail: hand-rolled thin client until a Swift SDK appears) ## Acceptance criteria [ ] Child spawned under the museion profile; initialize handshake completes against the actually-installed Hermes version [ ] Session opens; prompt sent; streamed updates render live in a debug pane [ ] A fix-card-shaped message round-trips and renders as structured data [ ] Quit tears down the child cleanly; crash surfaces a restart prompt; no data loss [ ] Engine version verified against the recorded one from the gate ## Blocked by • #13 — M0: Profile provisioning & skill seeding (S2.1) [Generated by AI]
AlexKucera added the ready-for-agent label 2026-08-28 18:33:04 +02:00
AlexKucera added a new dependency 2026-08-28 19:18:41 +02:00
AlexKucera added a new dependency 2026-08-28 19:18:43 +02:00
AlexKucera added a new dependency 2026-08-28 19:18:44 +02:00
AlexKucera added the wayfinder:map label 2026-09-16 15:05:25 +02:00
Sign in to join this conversation.