Extract the engine host — per-surface lifecycle policy behind a transport seam #178

Closed
opened 2026-11-09 11:18:51 +01:00 by AlexKucera · 0 comments
Owner

What to build

From the 2026-11-09 architecture review (mentor line, step 2 of 3).

The engine lifecycle policy — spawn, handshake, respawn-on-crash, teardown, and the per-surface residency rules (resident chat engine; on-demand pass engines spawned per run, torn down at the verdict, per ADR-0014) — moves out of the session model into an engine-host module sitting over the ACP client through a narrow transport seam. A scripted in-process transport becomes the second adapter at that seam, so engine-behaviour tests (streaming, crash, cancel, restart, per-surface spawn) run without child processes. Exactly one real-process end-to-end smoke per LLM Surface survives as the wire-contract guard — the rest of the zsh fake-server rigs retire from logic tests, attacking the documented real-process flake family.

The session model keeps session + turn coordination and remains the only observable the panes see; roster persistence and the ACP wire client already exist as their own types and stay put.

Acceptance criteria

  • Engine lifecycle policy lives behind the host's interface; the session model coordinates sessions and turns, not processes
  • The transport seam has two adapters: real stdio ACP client in production, scripted in-process adapter in tests
  • Engine behaviour tests run in-process; real-process tests remain only as one wire smoke per surface
  • No pane observes the host directly; the session model stays the single observable
  • Full suite green; build + test verified by executed count, not the success banner

Blocked by

  • #177 — Type the transcript rail; extract from the smaller, typed-rows model (native blocking edge set).

[Generated by AI]

## What to build From the 2026-11-09 architecture review (mentor line, step 2 of 3). The engine lifecycle policy — spawn, handshake, respawn-on-crash, teardown, and the per-surface residency rules (resident chat engine; on-demand pass engines spawned per run, torn down at the verdict, per ADR-0014) — moves out of the session model into an **engine-host module** sitting over the ACP client through a narrow transport seam. A scripted in-process transport becomes the second adapter at that seam, so engine-behaviour tests (streaming, crash, cancel, restart, per-surface spawn) run without child processes. Exactly **one real-process end-to-end smoke per LLM Surface** survives as the wire-contract guard — the rest of the zsh fake-server rigs retire from logic tests, attacking the documented real-process flake family. The session model keeps session + turn coordination and remains **the only observable the panes see**; roster persistence and the ACP wire client already exist as their own types and stay put. ## Acceptance criteria - [ ] Engine lifecycle policy lives behind the host's interface; the session model coordinates sessions and turns, not processes - [ ] The transport seam has two adapters: real stdio ACP client in production, scripted in-process adapter in tests - [ ] Engine behaviour tests run in-process; real-process tests remain only as one wire smoke per surface - [ ] No pane observes the host directly; the session model stays the single observable - [ ] Full suite green; build + test verified by executed count, not the success banner ## Blocked by - #177 — Type the transcript rail; extract from the smaller, typed-rows model (native blocking edge set). [Generated by AI]
AlexKucera added the ready-for-agent label 2026-11-09 11:18:54 +01:00
Sign in to join this conversation.