Skip to content

<!-- Written per the the-loop:writing skill. -->

Testing plan: give each pull request of a multi-PR work item its own scoped spec ​

Derived from the approved requirements and design, before tasks.md. Authored at test-planning and completed at verification.

This file is executable content. Review it like code. It names no credential: every GitHub call is stubbed.

The short version ​

Most of the proof is unit and integration tests in the repository's own pytest suite. They run against fixture trees: an origin checkout holding a chain and a work-item state, and a PR checkout holding a PR spec. The GitHub client is stubbed, so visibility and comments are deterministic and no token is needed. Five Gherkin scenarios carry the end-to-end behaviour, and abuse cases AC1–AC5 each get a negative test. Two rows are deliberately not automated:

  • A contract check of the new OpenAPI path, through the repository's existing validation step.
  • A manual dogfood run of the verb against this work item's own PR, which shows the record and the briefing link as a reviewer would meet them.

Test matrix ​

#TypeApplies?Scope / what it provesWhere it runs
T1Unityespr-spec-current hook: applicability (single-PR, multi-PR, self rows, declared repos, spec-only), record validation, digest recomputation with front matter stripped, stale detection, the forged-record cases; the verb's eight checks one by one; the citation parser and resolver for all five formscd cli && uv run python -m pytest -q tests/test_pr_spec.py
T2Integration (scenario)yesThe five Gherkin scenarios in design § Testing strategy, driven through the real graph runtime and the-loop graph verbscd cli && uv run python -m pytest -q tests/test_pr_spec_integration.py
T3Contract (OpenAPI)yesPOST /api/v1/graph/pr-spec exists in the-loop.v1.yaml, its request body carries the six fields, and the served schema matches the authored one (test_api_contract_parity.py)cd cli && uv run python -m pytest -q tests/test_api_contract_parity.py
T4End-to-endn/aNo live multi-repository GitHub fixture exists, and a run would need write access to two real repositories. T2 drives the same verbs and graph against stubbed GitHub; T11 shows the real artifacts on this repository.
T5UI / visualn/athe-loop has no product UI.
T6SnapshotyesThe four templates/pr-spec/*.md templates and the rendered pr-spec assignment text, through the existing template-parity and assignment-render tests, extended to the new filescd cli && uv run python -m pytest -q tests/test_graph_loops.py tests/test_manifest_schemas.py tests/test_writing_parity.py
T7Performance / loadn/aThe hook hashes four files and reads two JSON files per evaluation, in the same order of cost as await-inner-loops. There is nothing to load-test.
T8Security / abuse caseyesAC1 private→public refused without a grant, refused with an unauthorized or marked grant, refused with a grant naming another repository, and recorded with a valid one. AC2 a visibility fetch failure is refused as visibility-unknown. AC3 the verb's written-file set is exactly one pr-spec.json and the hook writes nothing. AC4 .., / and empty owner/repo/id parts, and a symlinked docs/specs escaping the checkout, are refused. AC5 a seeded token in a PR-spec file is a finding. A forged required: false record on a multi-PR item still blocks.cd cli && uv run python -m pytest -q tests/test_pr_spec.py -k "abuse or forged"
T9Accessibilityn/aNo UI surface.
T10Migration / upgradeyesExisting inner-loop states that sit at implementation or later and were written before pr-spec existed still load, and are not moved back to pr-spec. A work item with no pr-spec.json anywhere and a single PR passes every placement. test_graph_skips.py changes deliberately: pr-spec becomes the shipped inner loop's one skippable node.cd cli && uv run python -m pytest -q tests/test_graph_skips.py tests/test_graph_loops.py tests/test_graph_multirepo_integration.py
T11Manual exploratoryyesDogfood on this repository. Write a PR spec for PR #546 at docs/specs/issue-543/pr-546/, run the-loop graph pr-spec issue-543 --pr 546 --checkout ., and record the output. Then edit design.md locally and show that the-loop check issue-543 --pr 546 reports the record stale. The edit is discarded afterwards.the commands named, from the repository root
T12Full suite and lint (CI parity)yesNothing else regressed. Markdown lint covers the new templates, command and docs.make check

Scenarios & requirement trace ​

RowRequirement(s)Scenario / case
T1R1.1–R1.3, R1.6, R2.7, R3.1–R3.3, R3.5, R4.2, R4.4, R5.1applicability table; verb checks 1–8; citation forms; digest ignores front matter; no status key in a PR spec
T2R1.1, R4.1, R4.5Scenario: a cross-repository PR cannot start implementation without a recorded PR spec
T2R5.1, R5.2, R5.3Scenario: a changed chain blocks the PR at reviewer-briefing until it is re-derived (with the --still-valid path as a second example)
T2R1.2, NFR "single-repository unaffected"Scenario: a single-PR work item walks past pr-spec untouched
T2R1.4, R1.6Scenario: under never mode the outer implementation holds until every PR has a record
T2Security AC1, AC2Scenario: a private origin will not publish a PR spec to a public repository without an authorized grant
T3Interfaces § API and schemaOpenAPI path and parity
T6R2.1–R2.6, R4.1, R4.6the templates' required sections and Context section; the assignment names both commands; the pr-briefing.md template links the PR spec first
T8Security AC1–AC5, forged recordnegative tests listed in the matrix
T10R1.5, NFR "single-repository unaffected"the skip declared via graph skip --pr N --node pr-spec reads skipped by declaration; pre-existing inner states load unchanged
T11R4.3, R4.6, R4.7, R5.1the real record, path and stale report on this repository

R6 (feedback routing) and R7 (documentation) are session behaviour and text. No test runs them. They are verified at review: R6 by reading /the-loop:derive-pr-spec and reference/workflow.md, R7 by the capability-docs node's evidence/documentation.md.

Verification environment ​

  • Repositories: this repository only. The integration tests build a second "PR checkout" as a temporary git repository with a remote URL naming another repository, so no second real checkout is needed.
  • Services / containers: none. Tests construct the graph runtime and the CLI in-process.
  • Fixtures & data: fixture trees are created by the tests under tmp_path, and the GitHub client is stubbed per test. T11 uses this working tree.
  • Credentials: none. T11's verb reads repository visibility through the service's GitHub client, which uses the operator's existing GH_TOKEN, by reference.
  • Bring-up: make install-dev · Tear-down: none.
  • If bring-up fails: record it under Verification results, leave the dependent activities unticked, and escalate.

Evidence plan ​

RowEvidencePath under evidence/
T1, T8, T10pytest summary per command (counts, duration, any failures)unit.md
T2the-loop scenarios --glob cli/tests/test_pr_spec_integration.py --format markdown, then the run outputintegration.md
T3, T6validate and parity outputcontract-and-snapshot.md
T11the verb's JSON output, the committed pr-spec.json, and the check output before and after the local chain edit (redacted: no token or hostname appears)dogfood.md
T12make check summaryci-parity.md

Verification activities ​

  • [x] T1 — cd cli && uv run python -m pytest -q tests/test_pr_spec.py
  • [x] T2 — cd cli && uv run python -m pytest -q tests/test_pr_spec_integration.py
  • [x] T3 — cd cli && uv run python -m pytest -q tests/test_api_contract_parity.py
  • [x] T6 — cd cli && uv run python -m pytest -q tests/test_graph_loops.py tests/test_manifest_schemas.py tests/test_writing_parity.py
  • [x] T8 — cd cli && uv run python -m pytest -q tests/test_pr_spec.py -k "abuse or forged"
  • [x] T10 — cd cli && uv run python -m pytest -q tests/test_graph_skips.py tests/test_graph_loops.py tests/test_graph_multirepo_integration.py
  • [x] T11 — dogfood the verb and the stale report on PR #546 (accepted as run, partial: see Verification results)
  • [x] T12 — make check

Verification results ​

Run on 2026-11-19 at commit 08fba802 (T11's record refreshed after it). Seven of eight activities passed. T11 ran only in part. @MadaraUchiha-314 accepted it as run on #543.

ActivityCommand / procedureOutcomeEvidence
T1cd cli && uv run python -m pytest -q tests/test_pr_spec.pypass — 118 passedunit.md
T2cd cli && uv run python -m pytest -q tests/test_pr_spec_integration.pypass — 5 scenariosintegration.md
T3cd cli && uv run python -m pytest -q tests/test_api_contract_parity.pypass — 6 passedcontract-and-snapshot.md
T6cd cli && uv run python -m pytest -q tests/test_graph_loops.py tests/test_manifest_schemas.py tests/test_writing_parity.pypass — 85 passedcontract-and-snapshot.md
T8cd cli && uv run python -m pytest -q tests/test_pr_spec.py -k "abuse or forged"pass — 49 passedunit.md
T10cd cli && uv run python -m pytest -q tests/test_graph_skips.py tests/test_graph_loops.py tests/test_graph_multirepo_integration.pypass — 138 passedunit.md
T11the-loop graph pr-spec issue-543 --pr 546 --checkout ., then pr-spec-current before and after a discarded design.md editpartial — recorded single-pr, and the gate passes as not-required at both placements. No PR spec was written and no stale report shown: issue-543 has one PR, and R1.2 says it needs none. T2's second scenario shows the stale path. Dogfooding found and fixed a ref-case bug. Accepted as run by the owner.dogfood.md
T12make checkpass — exit 0; 7176 passed, pyright 0 errors, markdownlint 0 errorsci-parity.md

Review comments ​

Appended by the-loop's record-feedback hook when a human gate approves with comments (issue-109). Append-only and attributed.

2026-11-19 — approved ​

@MadaraUchiha-314 wrote:

approved

Released under the MIT License.