Tasks: three named choices, and a tree the endpoint can actually work in
Phase 3 of 3. A DAG of small, verifiable tasks. Each task references the requirements it serves and names the testing-plan row that proves it.
tdd.mode: standard— the red tests come first and their failure is captured as evidence.
Task list
- [x] T1 — red: the mode table. Assert every row of
design.md§C1 againstTmuxConfig.from_mapping— absent,true,false, the three names, and a value the system does not recognise. Fails today: the field is abool. Requirements: R1.1–R1.5, R3.1–R3.2 · Test: T1, T10 - [x] T2 — red: the routing rule. Assert
_endpoint_forunder all three modes for both a same-repository and a cross-repository pull request. Fails today:alwaysis not a value, and the same-repository collapse is unconditional. Requirements: R1.1–R1.3 · Test: T1 - [x] T3 — red:
require_branch. Assert thatWorkspace.prepare(require_branch=True)raisesWorkspaceErrorwhen the head branch cannot be checked out, and that the default still degrades to a detached default-branch worktree. Fails today: no such argument. Requirements: R2.2 · Test: T1, T8 - [x] T4 — red: the schema. Assert the schema accepts
true,falseand the three names and rejects"sometimes". Fails today:{"type": "boolean"}. Requirements: R3.3 · Test: T3 - [x] T5 — red: the integration scenarios. Two Gherkin-documented scenarios through the receiver:
always+ a per-pull-request clone spawns a second tmux session for a same-repository pull request;always+strategy: worktreedeclines to one. Requirements: R1.3, R2.1–R2.3 · Test: T2 - [x] T6 — green: the three values. Add the mode constants and
_session_per_pr_modetodispatcher.py; makeTmuxConfig.session_per_prastrwithsplits_pull_requests/splits_same_repository. Turns T1 green. Requirements: R1.1–R1.5, R3.1–R3.2 · Test: T1, T10 · Depends: T1 - [x] T7 — green: the routing rule.
_endpoint_forconsultssplits_same_repository;delivery_statuspassessplits_pull_requests. Turns T2 green. Requirements: R1.1–R1.3 · Test: T1 · Depends: T2, T6 - [x] T8 — green: the branch requirement.
Workspace.prepare/ensure_worktree/ensure_workitem_clonetakerequire_branch;_endpoint_cwdpasses it for a same-repository endpoint and turns the raise into the existing decline. Turns T3 and the declining half of T5 green. Requirements: R2.1–R2.3 · Test: T1, T2, T8 · Depends: T3 - [x] T9 — green: the schema. a
typeunion plus anenumin.the-loop/cli-config.schema.json, copied byte-for-byte tocli/the_loop/schemas/. Turns T4 green. Requirements: R3.3 · Test: T3 · Depends: T4 - [x] T10 — docs: the configuration reference.
docs/config/cli/routing-options.mdrewrites thetmux.sessionPerPrsection for three values, states thealways+strategy: cloneobligation, and keeps the docs-parity gate green. Requirements: R1, R2, R3 · Test: T12 · Depends: T9 - [x] T11 — docs: the capability page and the decision.
docs/capabilities/webhook-triggers.md(behaviour + a history row),docs/cli/state.md,docs/capabilities/process-graph.md, thepdlc-pr-loop.yamlheader comment,decision-092.md+ the decisions index, and this repository's own.the-loop/cli-config.yamlcommentary. Requirements: R1, R2 · Test: T12 · Depends: T7, T8 - [x] T12 — verification. Run every activity in
testing-plan.md, commit the evidence, fill Verification results. Test: all · Depends: T6–T11
Dependency graph (DAG)
mermaid
flowchart LR
T1 --> T6 --> T7 --> T11
T2 --> T7
T3 --> T8 --> T11
T4 --> T9 --> T10 --> T12
T5 --> T7
T5 --> T8
T11 --> T12
T8 --> T12Two independent red roots — the config/routing chain (T1, T2, T4) and the workspace chain (T3) — so the branch requirement can be proved without the mode existing yet, and vice versa.
Checkpoints
- After T5: the full red run is captured to
evidence/red.mdand committed before any production line changes. That commit is the TDD record. - After T9:
make testis green andmake validateaccepts this repository's own config unchanged — proof that R3 holds before any documentation is written against the new value. - After T12: the ready-to-ship gate — green checks, capability docs updated in this pull request, reviewer briefing posted.
Review comments
Appended by the-loop's
record-feedbackhook when a human gate approves with comments.