Tasks: the-loop ask + POST /api/v1/sessions/reply
Derived from
design.mdandtesting-plan.md. Ticket: #208.
Task list
- [x] 1. Register the two event types
session.awaiting_inputandsession.reply_sentineventlog.EVENT_TYPES, mirrored in the observability reference.- Depends on: none
- Requirements: R3.2
- Test: T12 — docs parity
- [x] 2.
post_issue_comment_with_urlincomments.py- Shared private implementation with
post_issue_comment; parseshtml_urlfrom gh's JSON, degrading to empty on unparsable output. - Depends on: none
- Requirements: R1.2
- Test: T1 —
test_comments.py(red→green)
- Shared private implementation with
- [x] 3.
ask_sessionincore/sessions.py- Parse/refuse, central
mark_self_authored, post, emit (success and gh-failure paths),{messages, exitCode}shape. - Depends on: 1, 2
- Requirements: R1.1–R1.4
- Test: T1 —
test_core_sessions.py(red→green)
- Parse/refuse, central
- [x] 4.
reply_sessionincore/sessions.py- Registry lookup, paused/missing/dead refusals (no respawn), provenance framing,
TmuxRunner.deliver, emit, marked best-effort report comment. - Depends on: 1
- Requirements: R2.1–R2.6
- Test: T1 —
test_core_sessions.py(red→green)
- Registry lookup, paused/missing/dead refusals (no respawn), provenance framing,
- [x] 5.
the-loop askcommandcommands/ask_cmd.py:--work-item,--question/--question-file(-= stdin), in-process execution with the documented exception rationale.- Depends on: 3
- Requirements: R1.1–R1.5
- Test: T2 — CLI scenario with fake gh
- [x] 6.
POST /api/v1/sessions/replyroute + contractSessionReplyBody, one delegation line,operationId: replySession; the authored OpenAPI file gains the path.- Depends on: 4
- Requirements: R2.1–R2.5, R2.7
- Test: T2, T3 (red→green)
- [x] 7.
awaiting-inputkind incore/attention.py- Event-log derivation with the open/answered rule; question text as detail.
- Depends on: 1
- Requirements: R3.1
- Test: T1 —
test_core_attention.py(red→green)
- [x] 8. The interaction directive names the verb
_WORK_ITEM_DIRECTIVEininteraction.py: ask throughthe-loop ask; manual gh + marker stays as the stated fallback. Constant text, no interpolation.- Depends on: 5
- Requirements: R4.1
- Test: T1 — existing
test_interaction.pyassertions updated
- [x] 9. Integration scenarios
test_ask_reply_integration.pywith Gherkin docstrings: delivery, refusals, no-respawn, marked bodies, the CLI verb end-to-end.- Depends on: 5, 6, 7
- Requirements: R1, R2, R3.1; abuse cases 2–5
- Test: T2, T8
- [x] 10. UI: the reply box goes live
client.replySession, the demo transport simulating the delivery (its control verbs' convention), enabled controls + submit/busy/error/refresh, stale copy removed (WorkItemDetail.tsx,model.ts,useControlPlane.ts,App.tsx,ui/README.md), tests updated; theawaiting-inputattention row deduplicated against the event-derived question entry.- Depends on: 6
- Requirements: R5.1, R5.2
- Test: T15
- [x] 11. Docs + decision
docs/capabilities/control-plane.mdanddocs/capabilities/cli.md(current behaviour + history rows),docs/capabilities/webhook-triggers.md(the directive's stated behaviour),skills/the-loop/reference/collaboration.md§ where questions go + loop prevention, CLI command doc forask(+ index + sidebar),docs/config/cli/routing-options.md,docs/decisions/decision-078.md(central stamping; in-process ask; no reply-from-ticket closure). The event catalog lives ineventlog.EVENT_TYPES(the observability reference points there, no mirror to edit).- Depends on: 1–10
- Requirements: R3.2, R4.2
- Test: T12, T14
- [x] 12. Verification
- Execute the plan, tick activities with evidence under
evidence/. - Depends on: 1–11
- Requirements: all
- Test: the plan itself
- Execute the plan, tick activities with evidence under