egkf.7 terminal: the daemon-side ephemeral Kit container + PTY executor and its transport #1352
Notifications
Due Date
No due date set.
Blocks
Reference: sam/archie#1352
Reference in new issue
Block a user
egkf.7's dashboard slice (OAuth bindings + setup terminal UI + webui routes/authorizer) ships behind a narrow webui-owned interface that degrades to 503 until this lands. The real backend is unsettled by design: no terminal backend or contract exists anywhere in the tree, and only the daemon can own an ephemeral Kit container with a PTY and an egress session (cmd/archie-ui/architecture_test.go measures the linked binary and bans internal/container, internal/app/archied and internal/agentexec from the UI binary). Needs a decision doc before code: the session contract, who authorises an operator to open one, what bounds the session's life, how egress is scoped, and what the daemon does when Kit is unavailable. Do not implement it in a UI lane.
Acceptance criteria
a design doc in docs/prds/ settling the session contract for both an ephemeral setup session (profile-scoped) and a run-scoped session (task-scoped), covering authorisation, session lifetime, egress phase and the Kit-unavailable path; followed by a daemon-side executor whose transport the dashboard interface consumes, delivering the ephemeral setup session; the 503 degrade path is replaced by a real setup session. The run-scoped surface is delivered separately.
Notes
Scope widened 2026-10-08 (maintainer direction). The session contract settled here must be session-scoped, not setup-shaped: it has to account for two targets, an ephemeral setup session (OAuth seeding, addressed by Kit profile) and a run-scoped session (a live view of a running task's sandbox, optionally with takeover, addressed by task and attempt). Settle the contract once here so the run-scoped case does not need a second, competing contract; the run-scoped surface is tracked in its own bead.
Correction: cmd/archie-ui/architecture_test.go no longer exists. It was deleted in
ff424b70("a journey in 150k lines of tests to none"), so the ban it enforced (the UI binary must not link internal/container, internal/app/archied or internal/agentexec) is now intent, not a gate. Either re-add the check or state where the boundary is enforced, if it is to hold.Why the contract must be session-scoped: only the daemon owns containers (container.NewPool is built in app/archied), and archie-ui never imports internal/container. Both targets need the same three primitives: a daemon-owned container exec, a duplex contract, and the dashboard xterm.js surface. Only the address (profile vs task), the lifetime (setup-bounded vs task-bounded) and the egress phase (install vs runtime) differ, so one contract parameterised on those is smaller than two.
Shipped (2026-10-08): docs/prds/external-agent-harness.md, "Session contract" settles both targets; proto/harness/v1 serves a daemon-owned bidi session; internal/infrastructure/harnesssession builds the ephemeral container; the dashboard consumes it over [services.harness] and the 503 is replaced. The listener requires HARNESS_TOKEN even on loopback. Follow-ups filed: archie-core-p3t1 (a default install's empty binding org and the asserted org-sys disagree, so capture does not round-trip), archie-core-wcbr (egress forwards a token endpoint for an ungranted optional OAuth service).
Close reason
Closed
Imported from beads
archie-core-h3s0· GitHub #1338 · type task · priority P2 · created 2026-10-01 · closed 2026-10-08