T-BT9H-router-send-to-native-to-resume-to-open-delivery-chain
State: closed/done · Impact: high · Complexity: large
Build the Router that delivers PR feedback (and, later, other messages) into
whatever session already holds a subject’s lease, before falling back to a fresh
headless dispatch — the capability the fold-in decision calls out as genuinely new
from simple-dispatch. It rides on the prs tick’s PR-action path (P2,
#2296) rather than replacing the
orchestrate loop, which P2 already ships.
Approach
Section titled “Approach”- Define
DeliveryIntent/DeliveryOutcomeandcreateRouter(deps)per simple-dispatch-interfaces.html’s Router section. - Implement the delivery chain in order: live-terminal send (via
Host.sendplus status/waitIdle), harness native send, resume (close + reopen with the message as the prompt), fresh open (worktree ensure + lease acquire + open with the message as the prompt). - Wire
recovery.ensureServing/recovery.tick()ahead of delivery so a gone session is restarted before the message is attempted. - Hook the Router into the
prstick (lib/services/orchestrator/, P2) as the delivery mechanism for NEEDS-RESPONSE PRs, in place of always dispatching/sdlc:pr-respondcold. - Cover the outcomes table (delivered/unconfirmed/held/failed per situation) with tests.
| Area | Note |
|---|---|
solutions/ontological/lib/services/dispatch/ | New: Router, DeliveryIntent/Outcome |
solutions/ontological/lib/services/orchestrator/ | prs tick integration point |
solutions/ontological/lib/services/host/ | Consumes Host.send / harness nativeSend |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1: A NEEDS-RESPONSE PR with a live session gets its feedback delivered via send/native/resume without opening a duplicate session.
- AC-2: A PR with no live session falls back to a fresh open with the message as the prompt.
- AC-3: The busy policy (
queue/send) andqueue_maxare honored per simple-dispatch-interfaces.html’s outcomes table.
Out of scope
Section titled “Out of scope”- DeliveryRecord persistence (
T-9Q4A), though the Router depends on it to avoid re-sending - the PR-subject lease that lets a PR have no task behind it (
T-KMPU)
Dependencies
Section titled “Dependencies”T-CPJIT-UU2N- the
prstick from P2 (#2296)
Depends on
Section titled “Depends on”T-CPJI, T-UU2N