Tasks: don't baseline a control command nobody has processed
Phase 3 of 3. Derived from
requirements.mdanddesign.md(both locked).tdd.mode: standard— each task writes the failing test first.
Dependency graph (DAG)
mermaid
flowchart LR
T1["T1 red: integration<br/>regression test"] --> T2["T2 _pending_control_ids<br/>+ first-sight fall-through"]
T2 --> T3["T3 negative unit tests<br/>(AC4–AC7)"]
T2 --> T4["T4 ordering test (AC2)"]
T3 --> T5["T5 capability doc"]
T4 --> T5
T5 --> T6["T6 make check + evidence"]Task list
- [x] T1 — Red: the regression test the bug deserves. In
cli/tests/test_control_integration.py, drive a realDispatcher+SessionRegistry+ControlStore(requireStartCommandon) with a provider whose thread already carriesthe-loop:start-executionat first sight. Assert: one spawn, a recordedstart, zero presence events. Gherkin docstring withRequirement: docs/specs/issue-119/requirements.md AC1, AC3. Requirements: AC1, AC3, AC9. - [x] T2 — Green: defer unprocessed control comments. Add
Poller._pending_control_idsand rework the first-sight branch perdesign.md§3.2 (baseline everything else,_try_spawnonly when nothing is pending, fall through otherwise). Requirements: AC1, AC2, AC3, AC5, AC8. - [x] T3 — Negative unit tests. In
cli/tests/test_poller.py: an unauthorized comment author, a self-authored body, an ambiguous body,control.enabled: false, an unauthorized item author, and an item that already carries a control record each baseline the keyword comment and forward nothing. Plus the happy-path unit assertions (deferred id absent fromseenComments, comment forwarded, no presence event). Requirements: AC1, AC4, AC5, AC6, AC7, AC8, AC11. - [x] T4 — Ordering test. A first-sight thread carrying
startthenstopends withstoprecorded and no live session. Requirements: AC2. - [x] T5 — Capability doc + execution log. Record the behaviour in
docs/capabilities/webhook-triggers.md(current behaviour + history row) and keepexecution-log.mdcurrent. Requirements: AC10. - [x] T6 — Ready-to-ship gate.
make check(ruff, ruff format, pyright, markdownlint, config validation, pytest) green; security checklist recorded; reviewer briefing posted on the PR. Requirements: all.