<!-- Authored per the the-loop:writing skill. -->
Tasks: the explainer, the spec quiz and the code quiz
Derived from the approved
requirements.md,design.mdandtesting-plan.md. The work is all in this repository, so no other repositories are declared. Every code task is written test-first: the named test goes red, then green, and that change is recorded in the commit that carries it.
Task list
- [x] A1: the graph. Add
spec-explainer,spec-quiz,code-explainerandcode-quiztopdlc-work-item-loop.yaml, along with the skip setexplainer, the re-pointedpass/skippededges and thestaleback-edge. Register the new hook names as placeholders thatA4fills in, and add the notify eventquiz-pendingto the event catalogue. Update the pinned tests:test_graph_skips.py(skip-set equality),test_graph_model.py, the e2e traces (happy-path,trivial-tier,review-rejection,gh-unreachable), and the newexplainer-offscenario.- Depends on: none
- Requirements: R1.2, R1.6, R2.1, R3.1, R3.6
- Test: T4 (e2e walk through the four nodes, and the
explainer-offscenario); T10test_frozen_graph_without_quiz_nodes_keeps_walking
- [x] A2: the checklist row. In
selection.py, addEXPLAINER_TOKEN, exclude the skip-set members from_phase_rows, add the Settings section (rendered only when the graph defines the skip set),_parse_explainer(absent → on), the four declared skips carryingtoken: explainer, the_frozen_graphmarks and the confirmation line. Pin the token in Slack's list (channels/slack.py), and updatetest_selection_layout.py,test_selection_control.pyand the Jira checklist fixtures.- Depends on: A1
- Requirements: R1.1, R1.3, R1.4, R1.5, R1.6, R1.7
- Test: T1 (row parser, skip provenance, Slack
without); T6 (checklist and confirmation snapshots)
- [x] A3: who edited a comment. Add
GitHubClient.comment_edits(node_id, host)(one GraphQL query) returningGhCommentEdits, newest edit first. Add thecomment-editsop ingraph/integrations/github.py; the Jira op set answersunsupported.- Depends on: none
- Requirements: R2.6, R3.8
- Test: T1
comment_editsmapping against recorded fixtures incli/tests/fixtures/github/comment_edits/(authorized, unauthorized, null editor, empty history, error)
- [x] A4: the two hooks. Write
graph/hooks/quiz.pywithpost-quiz-attestation(record read, spec digest into the marker, ticket or PR fan-out with ticket fallback, the view commands for a repo-pathLocation, idempotent marker scan,blockon a missing record) andquiz-attested(stale digest →stale, GraphQL attribution, self-authored and node/digest marker checks, non-empty authorized editor, typed fallback,graph.quiz_refused). In the runtime's decision path, copyattestedBy,attestedAtandcomment.- Depends on: A1, A3
- Requirements: R2.4–2.7, R3.6–3.8, R3.10, R5.4, R5.6; abuse cases 1, 2, 4, 6
- Test: T1 (every branch of
quiz-attested, the digest, idempotency, fan-out); T6 (quiz comment bodies); T8test_quiz_attested_refuses_unauthorized_editor,test_quiz_attested_fails_closed_without_editor,test_quiz_attested_ignores_unmarked_and_artifact_text,test_quiz_attested_ignores_forged_comment
- [x] A5: edits reach the gate. In the poller, add tick detection before the
seenskip, plusPollState.quizSeen. In the webhook, rewrite anissue_comment.editedthat carries the quiz marker and a ticked box toquiz_attestation, before the self-reply guard. In the dispatcher, makequiz_attestationdelivery-only: it callsgraphlink.on_eventwith{"attestation": …}at a human gate, and is dropped withreason: no-gateotherwise. It never arms or spawns.- Depends on: A4
- Requirements: R2.6, R3.8; design C5
- Test: T1 (poller keying, webhook rewrite, dispatcher drop)
- [x] A6: the scenarios. Write
cli/tests/test_quiz_integration.pywith Gherkin docstrings that link the requirements.- Depends on: A2, A5
- Requirements: R1.3, R2.5, R2.6, R3.7, R3.8, R5.6
- Test: T2: the six
Scenario:titles intesting-plan.md
- [x] B1: the page template. Create
skills/the-loop/templates/explainer.htmlfrom the approved prototype: placeholder tab content, an emptyQUIZblock, and the engine unchanged. Add the check scriptdocs/specs/issue-488/evidence/ui/check.mjs(Playwright plus axe-core), and a fixture fill that puts a<script>string in one option.- Depends on: none
- Requirements: R3.3, R4.1, R6.6, NFR accessibility; abuse case 3
- Test: T5 (tabs, reveal-after-select, no network, no errors, 375 px); T8
test_explainer_template_renders_text_not_markup; T9 (axe, keyboard)
- [x] B2: the agent's procedure.
- New
skills/the-loop/reference/explainer.md: depth ladder, prose budget, section contract, spec-only variant, R6 quiz checklist, publishing table, redaction step, and "never tick an attestation box". - New
commands/explain.md, which branches on the current node. - The
explaincommand name is valid for the graph. - The
pr-briefing.md"Start here: the explainer" row. - The
.the-loop/manifest.yamlevidence rowsspec-explainer.mdandexplainer.md. - Depends on: A1, B1
- Requirements: R2.2, R2.3, R3.2–3.5, R3.9, R4, R5.1–5.3, R6
- Test: T1 (the graph's
command:resolves tocommands/explain.md; manifest validation viamake validate); the R6 content rules are judged in review (testing-plan.md§ Scenarios)
- New
- [x] B3: the documentation.
SKILL.md: the chain section, and one operating-principles bullet.reference/workflow.md: a new section, "The explainer and the quizzes".- Capability docs
process-graph.mdandspec-workflow.md: behaviour plus history rows. docs/cli/commands/graph.md: the checklist.- The README flow.
ui/src/demo/fixture.ts: the node list.docs/decisions/decision-143.md(ticks are attributable for quiz gates) and its index row.- Depends on: A2, A4, B2
- Requirements: NFR documentation
- Test:
make lint(markdown across the repo);make validate
Not implementation tasks. C1 and C2 were listed here at first, but they are the work of the graph's own
verificationnode and review chain, andimplementationgates on every box in this list. They are kept as a note so the plan still reads end to end.
- C1: verify. The
verificationnode runstesting-plan.mdT1–T11. T11 needs @MadaraUchiha-314 to tick a sandbox quiz comment.- C2: review and ship. The review chain: self-review, critic review, the security review, this work item's own explainer and code quiz, documentation, and the reviewer briefing on PR #489.
Dependency graph (DAG)
A1, A3 and B1 have no dependencies and can start in parallel.
Checkpoints
- After A1, A4 and A6:
make test. The graph, the hooks and the scenarios are the three points where a regression in the existing walk would first show. - Before every commit: the repository's pre-commit hooks (
make lint,make format-check,make typecheck,make test), which are the same commands as CI. - After B1: the T5 check script against the template.
- After the last task, the
verificationnode executestesting-plan.md. The review chain follows.
Review comments
Appended by the-loop's
record-feedbackhook when a human gate approves with comments (issue-109). Append-only and attributed.