T-CPJI-host-send-deliver-a-message-into-an-already-open-session
State: closed/done · Impact: high · Complexity: medium
Today’s host contract only opens sessions (session()) or terminals
(terminal()); nothing can deliver a message into a session that is already
running. This is the gap the Router (M-27ZR) needs closed before it can route
PR feedback into a live session instead of always opening a new one.
Approach
Section titled “Approach”- Add a
sendpart to the host contract (lib/services/host/contract.ts) per simple-dispatch-interfaces.html’s Host section:send(target, message)into a live terminal. - Implement it for hosts that can support it first (orca via its session/paste
API, tmux via
send-keys), leaving hosts with no live-input surface (bare terminal) to report the part as absent viarequirePart. - Add a per-harness
nativeSendfallback distinct from the host-levelsend(Router step 2 in simple-dispatch-interfaces.html), so the Router can try harness-level native delivery when the host has no send part. - Add tests exercising send against a fixture session.
| Area | Note |
|---|---|
solutions/ontological/lib/services/host/contract.ts | New send part |
solutions/ontological/lib/services/host/hosts/orca.ts | send implementation |
solutions/ontological/lib/services/host/hosts/tmux.ts | send implementation (pairs with T-5UT9) |
solutions/ontological/lib/services/host/engines.ts | Per-harness nativeSend |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1 (refined — “smoke test” replaced per this campaign’s no-real-process
testing rule):
Host.senddelivers a string against a fakeCommandRunnerfor both orca (orca terminal send) and tmux (send-keys), asserting the exact argv sent, for a fixture session — no real orca/tmux process is started. Verified:hosts.test.ts’s orca/tmuxsenddescribe blocks. - AC-2: A host without a send part is reported via
requirePart, not a silent no-op. Verified:hosts.test.ts’s terminal/cmuxrequirePart(host, 'send')test. - AC-3: A harness-level
nativeSendis callable independently of hostsend, unit-tested against a fake runner. Verified:harnessNativeSendtests (codex real argv + non-zero-exit; claude/cursor/pi all null). - AC-4 (added): the Router’s existing
liveroute (dispatch/router.ts’sattemptLive) is rewired to callHost.sendinstead of its own hardcodedspawnLive('orca')+ bespokeorca terminal sendargv — proven by arouter.test.tscase showing the live route now also succeeds for a tmux-hosted session, which the old orca-only implementation could never reach. Verified:router.test.ts’s tmux-hostedlivetest, run against the realmakeTmuxHost.
Out of scope
Section titled “Out of scope”- the Router’s fallback chain deciding when to call send vs. resume vs. open
(
T-BT9H) - status hooks (
T-UU2N)
Dependencies
Section titled “Dependencies”T-GG0N
Depends on
Section titled “Depends on”T-GG0N