Tasks: the session that opens a pull request is the one that records it
The last spec artifact (bugfix → design → testing plan → tasks). Derived from the approved
design.mdandtesting-plan.md.
Task list
- [x] 1. Red run — the tests, before the code
- Every case in
testing-plan.mdT1/T2/T8, written against the interfacesdesign.mdnames, and captured failing inevidence/red.md. - Depends on: none
- Requirements: R3.1, R3.2
- Test:
uv run pytest cli/tests/test_core_sessions.py cli/tests/test_webhook_routing_integration.py -k link(red)
- Every case in
- [x] 2.
core.sessions.link_pull_request- Parse the work item; resolve the pull request (bare number /
#N→ the work item's repository, otherwise a full ref); refuse a self-link; exit 1 with no write when the work item has no record; otherwiseSessionRegistry.link_pull_requestand render the linked / already-linked message. - Depends on: 1
- Requirements: R1.1–R1.7
- Test:
T1, T8 — uv run pytest cli/tests/test_core_sessions.py -k link(red→green)
- Parse the work item; resolve the pull request (bare number /
- [x] 3. The three surfaces
- CLI
sessions link-pr(routed()+_render+_report, like its siblings);POST /api/v1/sessions/link-prwithSessionLinkPrBodyandoperationId: linkSessionPullRequest; the MCPlink_pull_requesttool, registered. - Depends on: 2
- Requirements: R1.1
- Test:
T1, T3 — uv run pytest cli/tests/test_cli.py cli/tests/test_api_contract_parity.py cli/tests/test_api_routers_integration.py cli/tests/test_mcp_integration.py
- CLI
- [x] 4. The authored OpenAPI contract
docs/api-specs/openapi/the-loop.v1.yaml: the path, the response and theSessionLinkPrBodyschema — the contract is the source of truth, the served schema must match it.- Depends on: 3
- Requirements: R1.1
- Test:
T3 — uv run pytest cli/tests/test_api_contract_parity.py
- [x] 5. The reproduction, end to end
- A Gherkin-documented integration scenario: a
pull_request_review_commenton a pull request with no closing reference, aloop/<id>-requirementsbranch and a body that only mentions the issue — dropped asawaiting-startwithout the binding, delivered into the work item's existing session with it. - Depends on: 2
- Requirements: R1.2, R3.2
- Test:
T2 — uv run pytest cli/tests/test_webhook_routing_integration.py -k link(red→green)
- A Gherkin-documented integration scenario: a
- [x] 6. The workflow rule (R2)
skills/the-loop/reference/automation.md(the command and why inference is not enough),commands/work-on.md,commands/execute-tasks.md,skills/the-loop/templates/execution-log.md.- Depends on: 3
- Requirements: R2.1, R2.2, R2.3
- Test:
T13 — uv run pytest cli/tests/test_harness_usage.py cli/tests/test_writing_parity.py
- [x] 7. The documentation (R2.4)
docs/cli/commands/sessions.md(the action and its flags),docs/cli/service.md(the routed-operations table),docs/capabilities/cli.md, anddocs/capabilities/webhook-triggers.md— the binding as a linkage source the-loop writes, with its history row. Event catalogue:session.pr_linkednames its new writer.- Depends on: 3
- Requirements: R2.4
- Test:
T13 — uv run pytest cli/tests/test_docs_parity.py cli/tests/test_eventlog.py
- [x] 8. Verification, evidence and review
- Run every activity in
testing-plan.md, record the results and commit the evidence; self-review ×3 and critic-review ×3 perreviews; security review perreference/security.md; the reviewer briefing on the PR. - Depends on: 1–7
- Requirements: R3.1, R3.2
- Test:
make check
- Run every activity in