Testing plan: quiz only — standalone quizzes, and a code quiz every reviewer can see
Derived from
requirements.mdanddesign.md, beforetasks.md. Authored attest-planningand completed atverification.This file is executable content. It names commands an agent will run, so review it like code. No command here needs a credential.
The short version
Three rows carry the weight:
- T8, security. One negative test per abuse case, because this change lets an unauthorized account cause a daemon action for the first time.
- T2, integration. The reply and the reviewer changes are driven through both ingresses, the webhook and the poller, against a fake GitHub.
- T10, upgrade. State written before the change is loaded and walked.
Everything runs in this repository with fakes. No live GitHub call is planned: the attribution of a tick was proved live in issue-488 and is not changed here. Performance and contract testing are n/a, with reasons below.
Check: that every abuse case in design.md § Security design has a row under T8.
Test matrix
| # | Type | Applies? | Scope / what it proves | Where it runs |
|---|---|---|---|---|
| T1 | Unit | yes | the selection row and its alias; the rename table on state; old attestation sentences; the micro check; banner placement and rows; the taken record; the keyword parse | cd cli && uv run python -m pytest -q |
| T2 | Integration (scenario) | yes | reply, reviewer changes, fallback and upgrade paths through the router, poller and dispatcher, Gherkin-documented | cd cli && uv run python -m pytest -q tests/test_quiz_integration.py tests/test_quiz_taken_integration.py |
| T3 | Contract (OpenAPI / GraphQL SDL) | n/a — the change adds no endpoint to the control-plane API; the new keyword and events are covered by T6 | ||
| T4 | End-to-end | yes | the outer loop walked through both quiz gates, the micro bypass and the banner, by the scenario runner | cd cli && uv run python -m pytest -q tests/test_pdlc_e2e_integration.py |
| T5 | UI / visual | yes | templates/quiz.html in its four forms matches the prototype, light, dark and at 375 px | node docs/specs/issue-557/evidence/ui/check.mjs |
| T6 | Snapshot / parity | yes | golden checklists (GitHub, Jira, handoff), the event-type catalog, the config schema, the docs and graph parity tests | cd cli && uv run python -m pytest -q (the parity and fixture tests) |
| T7 | Performance / load | n/a — a reply costs a bounded number of API calls (one comment read, one pull request read, at most one write); T8 asserts the bound instead of measuring time | ||
| T8 | Security / abuse case | yes | one negative test per abuse case 1–9 | cd cli && uv run python -m pytest -q -k "abuse or quiz_taken or banner" |
| T9 | Accessibility | yes | axe on the quiz page: no serious or critical violation; keyboard reaches every option and the Part 2 link | node docs/specs/issue-557/evidence/ui/check.mjs |
| T10 | Migration / upgrade | yes | state frozen before the change loads and walks; a pre-change quiz comment is still answerable; finished items are not rewritten | cd cli && uv run python -m pytest -q -k "legacy or renamed or pre_change" |
| T11 | Manual exploratory | yes | the banner markdown renders as a quote with a table, as design.md shows it | procedure under Verification activities |
| T12 | Static checks | yes | lint, format, types, config validation, markdown lint | make check and npx --yes markdownlint-cli2@0.18.1 |
Scenarios & requirement trace
| Row | Requirement(s) | Scenario / case |
|---|---|---|
| T1 | R1.1–R1.8 | the checklist shows one quiz row and no experiment rows; unticked skips four nodes under quiz; explainer in a reply is read as quiz; experiment rows are ignored; no explainerExperiments is frozen |
| T1 | R2.1–R2.3 | the graph has the four nodes in place, no id, stage or token says explainer, and the writing nodes name the quiz command |
| T1 | R3.3, R3.4 | a micro record turns the preceding node's outcome into micro; an absent record changes nothing; a micro Part 2 with a Part 1 takes the ordinary path |
| T1 | R4.2, R5.6, R5.7, R5.9 | a record claiming carried over while the spec is newer blocks; a record with no committed location blocks |
| T1 | R6.6, R5.8 | the quiz comment mentions no explainer and gives the artifact URL and both one-liners |
| T1 | R8.3–R8.5, R8.7, NFR bound | row rules: author row, requested and reviewed people, repliers, one row per person, removal, the 20-row bound |
| T1 | R8.8, R8.9, R9.1 | the placement table: one pair, no markers with and without the heading, an unpaired marker, two pairs |
| T1 | R7.9, R7.10 | the keyword is anchored, ambiguous with a second keyword, configurable and disableable |
| T2 | R7.1–R7.6 | Scenario: A reviewer who is not authorized is recorded and gates nothing |
| T2 | R7.6, NFR idempotent | Scenario: A second reply from the same person writes nothing |
| T2 | R7.8 | Scenario: A reply on a pull request with no code quiz is refused |
| T2 | R8.1, R8.6 | Scenario: Posting the code quiz puts the banner in the description |
| T2 | R8.6, R6.2 | Scenario: The author's tick marks the author row taken |
| T2 | R8.6, R8.7, R8.12 | Scenario: A reviewer request and its removal update the table on the poller |
| T2 | R8.6, R8.12 | Scenario: A submitted review keeps the reviewer's row on the webhook |
| T2 | R8.10 | Scenario: A new quiz round resets the table |
| T2 | R9.1–R9.3 | Scenario: A description with malformed markers falls back to a comment |
| T2 | R9.4 | Scenario: A refused description write falls back and does not block the gate |
| T4 | R2, R3.3, R6.1–R6.4, R8.11 | happy-path: both gates with the new ids and records. quiz-gates: refused tick, stale spec, authorized pass, and a micro quiz that bypasses its gate with no comment and no banner |
| T5 | R2.4, R4.1, R4.3–R4.5 | the four page forms: spec quiz; code quiz without Part 1; Part 1 carried over, with the note and the link; Part 1 regenerated, with the other note and no link |
| T6 | R1.8, R11.1–R11.3 | golden checklists regenerated; graph.quiz_taken and the three other events in the catalog; quiz-taken in the config schema and the keyword docs; no doc describes an explainer page as current |
| T8 | abuse 1 | Scenario: A reply from a stranger leaves the work item at code-quiz |
| T8 | abuse 2 | the existing refused-tick case in quiz-gates |
| T8 | abuse 3 | Scenario: A reply carrying extra text writes only the login |
| T8 | abuse 4 | 30 distinct repliers give 20 rows and a summary line; a repeat reply causes no write |
| T8 | abuse 5 | a stranger's comment carrying the fallback marker is never edited; two marker pairs fall back |
| T8 | abuse 6 | a signal with a login outside the grammar records nothing |
| T8 | abuse 7 | T5's hostile-string probe: </script> and markup in every field render as text and run nothing |
| T8 | abuse 8 | Scenario: A reply on a pull request that delivers no work item does nothing |
| T8 | abuse 9 | the-loop's own marked comment records nothing; a webhook whose sender differs from the comment's author records nothing |
| T9 | NFR accessibility | axe run on each form and theme; keyboard walk |
| T10 | R10.1–R10.3 | Scenario: A selection frozen with explainer unticked skips the four quiz nodes; Scenario: A work item parked at spec-explainer continues at spec-quiz-write; a frozen explainerExperiments loads |
| T10 | R10.4, R10.5 | a gate with only the old record name reads it; a pre-change quiz comment passes on an authorized tick |
| T10 | R10.6 | no committed file of a finished work item under docs/specs/ is changed by this pull request |
| T11 | R8.1, R8.2 | the rendered banner |
Verification environment
- Repositories: this repository only.
- Services / containers: none. GitHub is faked by the test suite's existing fake client and scenario runner.
- Fixtures & data: the golden checklists under
cli/tests/fixtures/, the scenario folders undercli/tests/test_pdlc_e2e/scenarios/, and a new fixture state file written in the pre-change format for T10. - Credentials: none.
- Bring-up:
make install-dev, and for T5 and T9npm i --prefix docs/specs/issue-557/evidence/ui playwright@1 axe-core@4thennpx --prefix docs/specs/issue-557/evidence/ui playwright install chromium. Tear-down: none;node_modulesunderevidence/ui/is not committed. - If bring-up fails: record it under Verification results, leave the dependent activities unticked, and escalate. If only Playwright cannot be installed, T5 and T9 fall back to the system's headless Chromium for screenshots, and the axe run is reported as not executed.
Evidence plan
| Row | Evidence | Path under evidence/ |
|---|---|---|
| T1, T6, T8, T10 | test summary: counts, duration, and the names of the new tests | unit.md |
| T2 | the scenario table from the-loop scenarios --format markdown, and the run output | integration.md |
| T4 | the scenario runner's output for happy-path and quiz-gates | e2e.md |
| T5, T9 | the check script, its output, and screenshots of each form in light, dark and 375 px | ui/check.mjs, ui/check.md, ui/<form>-<theme>.png |
| T5 | an animated capture of answering a question and jumping to Part 2 | ui/quiz-flow.gif |
| T8 | the abuse-case table with the test that proves each | security-tests.md |
| T10 | git diff --stat limited to other work items' spec folders, showing none changed | upgrade.md |
| T11 | a screenshot of the rendered banner | banner.png |
| T12 | the tail of make check and of the markdown lint | checks.md |
| red → green | for each new behaviour, the failing run before its implementation | unit.md, section per task |
Redaction: the captures contain no token or hostname by construction. Logins in fixtures are invented.
Verification activities
- [x] T1 — Run
cd cli && uv run python -m pytest -qand record the summary. - [x] T2 — Run the two integration files and record the output with the scenario table.
- [x] T4 — Run
cd cli && uv run python -m pytest -q tests/test_pdlc_e2e_integration.py. - [x] T5 — Run
node docs/specs/issue-557/evidence/ui/check.mjs skills/the-loop/templates/quiz.html docs/specs/issue-557/evidence/uiand compare the captures withdesign/code-quiz.html. - [x] T6 — Confirm the parity and golden-fixture tests ran inside T1 and name them.
- [x] T8 — Run
cd cli && uv run python -m pytest -q -k "abuse or quiz_taken or banner"and fill the abuse-case table. - [x] T9 — Read the axe results and the keyboard checks from the T5 run.
- [x] T10 — Run
cd cli && uv run python -m pytest -q -k "legacy or renamed or pre_change", thengit diff --stat origin/main...HEAD -- docs/specs ':!docs/specs/issue-557'. - [x] T11 — Render the banner for a sample table to HTML with
npx --yes marked@12 --gfm, capture it with headless Chromium, and check it againstdesign.md§ The banner. - [x] T12 — Run
make checkandnpx --yes markdownlint-cli2@0.18.1.
Verification results
Executed on 2026-11-30, in the work item's checkout, and run again after the review rounds changed the code. Every activity ran and passed; the numbers are those of the final code.
| Activity | Command / procedure | Outcome | Evidence |
|---|---|---|---|
| T1 | cd cli && uv run python -m pytest -q | pass: 8174 passed, 2 skipped | evidence/unit.md |
| T2 | cd cli && uv run python -m pytest -q tests/test_quiz_integration.py tests/test_quiz_taken_integration.py -v | pass: 50 passed | evidence/integration.md |
| T4 | cd cli && uv run python -m pytest -q tests/test_pdlc_e2e_integration.py -v | pass: 17 passed | evidence/e2e.md |
| T5 | node docs/specs/issue-557/evidence/ui/check.mjs skills/the-loop/templates/quiz.html docs/specs/issue-557/evidence/ui, then the captures compared with design/code-quiz.html | pass: 163 checks; the page matches the prototype | evidence/ui/check.md |
| T6 | the parity and golden-fixture files, named in the evidence | pass: 159 passed | evidence/unit.md § T6 |
| T8 | cd cli && uv run python -m pytest -q -k "abuse or quiz_taken or banner" | pass: 431 passed; every abuse case has a passing negative test | evidence/security-tests.md |
| T9 | the axe results and keyboard checks of the T5 run | pass: no violation in any form or theme; Tab reaches the Part 2 link and an option, Space answers | evidence/ui/check.md |
| T10 | cd cli && uv run python -m pytest -q -k "legacy or renamed or pre_change"; git diff --stat origin/main...HEAD -- docs/specs ':!docs/specs/issue-557' | pass: 45 passed; no other work item's file changed | evidence/unit.md § T10, evidence/upgrade.md |
| T11 | the banner rendered for a sample table with npx --yes marked@12 --gfm --breaks, captured with headless Chromium | pass: a quote with the three lines and the table, as design.md shows it | evidence/banner.png |
| T12 | make check | pass: exit 0 | evidence/checks.md |
Three things a reader should know:
- The environment. The test commands were run with
THE_LOOP_INSTANCE,THE_LOOP_WORK_ITEMandTHE_LOOP_CLI_CONFIGunset. This session runs inside a the-loop daemon, and those variables make about 46 unrelated tests fail onmaintoo. - T11 used
--breaks. GitHub renders a line break inside a pull request description as a line break, and plain GFM does not. The capture uses the option that matches GitHub. Nothing was posted to a real pull request for this. - No live GitHub call was made, as planned. The banner writer and the reply path ran against in-memory fakes of the five new operations.
Not executed: none.
Review comments
Appended by the-loop's
record-feedbackhook when a human gate approves with comments (issue-109). Append-only and attributed: an approval never silently discards a reviewer's suggestions, and the feedback travels with the document it concerns rather than living in a side-channel tracker.