<!-- Authored per the the-loop:writing skill. -->
Tasks: tell the work item's session what happens to its pull-request sessions
Derived from
design.mdandtesting-plan.md. Each task is test-first: the named test goes red before the code that makes it green.
Task list
- [x] 1. Notice renderer and gate predicate
cli/the_loop/prnotice.py:TRANSITIONS,DECLINE_REASONS,_identifier(),render(...).waits_on_inner_loops(node)incli/the_loop/graph/hooks/loops.py.- Register
session.pr_notice_delivered|skipped|failedandgraph.outer_reevaluatedineventlog.EVENT_TYPES. - Depends on: none
- Requirements: R1.1–R1.8 (text), R2.3, R4.1, abuse case 1
- Test: T1, T2 —
pytest tests/test_prnotice.py(red→green)
- [x] 2.
GraphLink.on_inner_loop_finishedandGraphLink.inner_loop_gate- Re-run the outer exit chain only when parked on a node whose exit has
await-inner-loops; emitgraph.outer_reevaluated. - Depends on: 1
- Requirements: R2.1–R2.6, R3.5, R4.2
- Test: T5 —
pytest tests/test_pr_notices_integration.py -k reevaluat(red→green)
- Re-run the outer exit chain only when parked on a node whose exit has
- [x] 3. Dispatcher notice channel and the close path
Dispatcher._notify_owner; in the close path, read the endpoint'stmux_targetbefore_close_tmux, notifymerged/closed, thenon_inner_loop_finishedon a merge.- Update the issue-172 regression test that asserted no delivery on a linked PR's merge.
- Depends on: 1, 2
- Requirements: R1.5, R1.6, R1.9, R2.1, R2.6, R3.1–R3.4, R4.3, abuse cases 2–4
- Test: T4, T8, T9 —
pytest tests/test_pr_notices_integration.py tests/test_webhook_routing_integration.py(red→green)
- [x] 4. Spawn and respawn paths
_endpoint_cwd→EndpointCheckout(cwd, reason);_decline_intoprepends the notice to the event for the four fallbacks;spawnedafter a successful spawn;respawned/respawn-failedin_respawn_tmuxwhenowneris not the endpoint.- Depends on: 3
- Requirements: R1.1–R1.4, R1.8, R1.9
- Test: T3, T7 —
pytest tests/test_pr_notices_integration.py -k "spawn or declin or respawn"(red→green)
- [x] 5. Inner-advance path
_after_inner_advanceat both inner-advance sites of_dispatch_one:completed+on_inner_loop_finishedwhen the inner pointer reachedcomplete, elseescalated.- Depends on: 3
- Requirements: R1.5, R1.7, R2.2
- Test: T6 —
pytest tests/test_pr_notices_integration.py -k "completed or escalat"(red→green)
- [x] 6. Capability and user-facing docs
docs/capabilities/process-graph.md(the one-way rule now has a daemon-side re-run) and the capability doc covering pull-request sessions; the skill'sreference/workflow.md§ Several repositories, if it states the old behaviour;evidence/documentation.md.- Depends on: 3, 4, 5
- Requirements: all (documentation)
- Test: T10 — markdownlint
Dependency graph (DAG)
Checkpoints
- After each task: the task's own test command, then
make lint format-check. - After task 5:
make testandmake typecheck(the full suite; T9). - After task 6: the
verificationnode runstesting-plan.mdV1–V5.