Skip to content

Tasks: a first-class PR review workflow

Phase 3 of 3. A DAG of small, verifiable tasks; each task's _Test:_ names a row of testing-plan.md.

Task list

  • [x] 1. Names, constants and the keyword

    • cli/the_loop/control.py: REVIEW in the constants, COMMANDS, _ARMING_COMMANDS, SPAWN_COMMANDS, DEFAULT_KEYWORDS.
    • cli/the_loop/graph/model.py: PDLC_REVIEW_LOOP, SHIPPED_LOOPS, OUTER_PATH_LOOPS, GUEST_LOOPS (new), LOOP_FOR_CONTROL_COMMAND, __all__.
    • Security-relevant (trust boundaries 1 and 4, design.md §Security design): the keyword stays a constant; resolve_outer_loop stays the one reader.
    • Depends on: none
    • Requirements: R2.1, R2.3, R2.4
    • Test: T1 — pytest tests/test_graph_review.py -k "keyword or loop" (red→green)
  • [x] 2. The graph

    • cli/the_loop/graph/pdlc-review-loop.yaml: the six nodes, four edges, header comment stating what is omitted and why.
    • Depends on: 1
    • Requirements: R1.1–R1.6, R5.1, R6.1
    • Test: T1 — pytest tests/test_graph_review.py -k graph (red→green)
  • [x] 3. The brief gate

    • cli/the_loop/graph/hooks/review.py: parse_brief, post-review-brief, classify-review-brief; import in graph/hooks/__init__.py.
    • cli/the_loop/graph/runtime.py: fold brief into the decision record beside goal.
    • Security-relevant (trust boundary 2, design.md §Security design): authorized, non-self-authored comments only; the brief is a fact, never a destination.
    • Depends on: 2
    • Requirements: R4.1–R4.6
    • Test: T1 — pytest tests/test_graph_review.py -k brief (red→green)
  • [x] 4. PR-first targeting

    • cli/the_loop/webhook/dispatcher.py: _apply_control's REVIEW branch (pr_work_item as target and session lookup), _on_unmatched's optional target parameter.
    • Depends on: 1
    • Requirements: R3.1–R3.3
    • Test: T2 — pytest tests/test_graph_review.py -k target (red→green)
  • [x] 5. The guest carve-outs and the session's posture

    • cli/the_loop/graphlink.py: _is_review, the render_graph_context review branch, _write_default via GUEST_LOOPS.
    • cli/the_loop/core/graphs.py: _runtime's adopt guard via GUEST_LOOPS.
    • Depends on: 1
    • Requirements: R6.2, R7.1–R7.3
    • Test: T1/T10 — pytest tests/test_graph_review.py -k "guest or context" plus the existing test_graphlink.py / test_core_graphs.py unchanged (red→green)
  • [x] 6. The command

    • commands/review-pr.md: the reviewer-not-author posture, the walk, the brief.
    • Depends on: 2
    • Requirements: R6.1, R6.3
    • Test: T11 n/a — prose; the graph's command: values are asserted in T1's shape test
  • [x] 7. The config surface

    • cli/the_loop/schemas/cli-config.schema.json and .the-loop/cli-config.schema.json (byte-identical): routing.control.keywords.review.
    • skills/the-loop/templates/cli-config.yaml, docs/config/cli/routing-options.md.
    • Depends on: 1
    • Requirements: R2.1, non-functional §config
    • Test: T10 — pytest tests/test_config_schema_parity.py tests/test_docs_parity.py (red→green)
  • [x] 8. The UI rendering path

    • ui/src/api/model.ts: ADHOC_LOOPSTREELESS_LOOPS + the new name; ui/src/api/model.test.ts, ui/src/views/Sessions.tsx as needed.
    • Depends on: 1
    • Requirements: design §10
    • Test: T5 — bun run test (red→green)
  • [x] 9. The suite

    • cli/tests/test_graph_review.py mirroring test_graph_adhoc.py: graph shape, hooks, keyword, loop selection, targeting, the Gherkin walk, the abuse cases.
    • cli/tests/test_graph_cleanup.py: add the review loop to the cleanup-node parametrizations.
    • Depends on: 3, 4, 5
    • Requirements: all; abuse cases 1–6
    • Test: T1/T2/T8 — the suite itself
  • [x] 10. Documentation and the decision record

    • docs/capabilities/process-graph.md, docs/capabilities/webhook-triggers.md, skills/the-loop/SKILL.md, skills/the-loop/reference/workflow.md, README.md (Four loops → Five loops), docs/guide/*, docs/reference/commands.md, docs/config/harness-config.md, docs/decisions/decision-101.md + index row.
    • Depends on: 2, 6
    • Requirements: R1–R7 (documentation of record)
    • Test: T10 — markdownlint + the docs-parity tests
  • [x] 11. Verification

    • Execute testing-plan.md's activities; tick them; fill ## Verification results; commit evidence under evidence/.
    • Depends on: 9, 10
    • Requirements: all
    • Test: the plan itself
  • [x] 12. Work-item-level reviews (added at needs-review, from the owner's PR #280 ruling)

    • cli/the_loop/graph/integrations/github.py: get-thread and linked-pulls ops on both transports.
    • cli/the_loop/graph/hooks/review.py: the work-item template variant with detected suggestions (pr-loops/ state + provider links), the Pull requests: section, ref normalization, the frozen pullRequests scope.
    • Security-relevant (trust boundary 2): stated scope normalizes to composed refs; unparseable bullets are dropped.
    • Depends on: 3
    • Requirements: R8.1–R8.6
    • Test: T1 — pytest tests/test_graph_review.py -k "work_item or pull_request" (red→green)

Dependency graph (DAG)

mermaid
flowchart LR
  T1[1 · constants + keyword] --> T2[2 · the graph]
  T2 --> T3[3 · brief gate]
  T1 --> T4[4 · PR-first targeting]
  T1 --> T5[5 · guest carve-outs]
  T2 --> T6[6 · the command]
  T1 --> T7[7 · config surface]
  T1 --> T8[8 · UI]
  T3 --> T9[9 · the suite]
  T4 --> T9
  T5 --> T9
  T2 --> T10[10 · docs + decision]
  T6 --> T10
  T9 --> T11[11 · verification]
  T10 --> T11
  T3 --> T12[12 · work-item reviews]
  T12 --> T11

Checkpoints

  • After task 9: full make test run and an execution-log append.
  • After task 11: make check (lint, format, typecheck, validate, test) and the final evidence capture.

Review comments

Released under the MIT License.