Tasks: a forwarded event carries the instruction, not GitHub's metadata
The last spec artifact. Derived from the approved
design.mdandtesting-plan.md.
Task list
[x] 1. Capture the baseline measurement
- Commit
evidence/measure_prompt.py(a realisticissue_commentwebhook payload, rendered through the shipped event template) and its output asevidence/baseline.md. - This is the number the change is judged against; it must exist before the change.
- Depends on: none
- Requirements: non-functional (cost)
- Test:
T8 — uv run python docs/specs/issue-243/evidence/measure_prompt.py
- Commit
[x] 2. Red: unit tests for the comment surfaces
cli/tests/test_excerpt.py—issue_comment,pull_request_review_comment,pull_request_review: the carried fields, the anchor-before-body order, the bare login, and the negative assertions (noissue, nosender, noapi.github.com, noavatar_url).- Depends on: none
- Requirements: R1.1–R1.5
- Test:
T1 — uv run pytest cli/tests/test_excerpt.py(red→green)
[x] 3. Red: unit tests for every other routed event
- Lifecycle (
issues,pull_request) with and without alabel;workflow_run,check_run(includingoutput),check_suite;status; an unknown event; an empty payload. - Depends on: none
- Requirements: R2.1–R2.7
- Test:
T2 — uv run pytest cli/tests/test_excerpt.py(red→green)
- Lifecycle (
[x] 4. Red: unit tests for the caps and the abuse cases
- A 10 KB body: field-only truncation, parseable JSON, surviving
html_url/anchor. Forged JSON inside a body. An unlisted hostile field. A malformed container. - Depends on: none
- Requirements: R3.1–R3.3, abuse cases 1–4
- Test:
T3, T6 — uv run pytest cli/tests/test_excerpt.py -k "cap or abuse"(red→green)
- A 10 KB body: field-only truncation, parseable JSON, surviving
[x] 5. Green:
cli/the_loop/webhook/excerpt.py- The two tables,
event_excerpt(event, payload), thepayload_excerptalias, the per-field text cap and the defensive global cap. - Depends on: 2, 3, 4
- Requirements: R1, R2, R3
- Test:
T1, T2, T3, T6 — uv run pytest cli/tests/test_excerpt.py
- The two tables,
[x] 6. Green: wire it into
Dispatcher._render_prompt- Pass
routed.event; re-exportpayload_excerptfromdispatcherfor compatibility; delete the old implementation and its now-unused key tuple. - Depends on: 5
- Requirements: R4.2, R5.2
- Test:
T7 — uv run pytest cli/tests/test_routing.py cli/tests/test_interaction.py
- Pass
[x] 7. Integration: ingress parity and the untouched gates
cli/tests/test_excerpt_integration.py, Gherkin-documented: the poller's synthesised comment event and the webhook event for the same comment render the same fields; and authorization / self-comment detection / control parsing / reaction targeting still decide correctly for an event whose excerpt omits their inputs.- Depends on: 6
- Requirements: R4.1, R5.1
- Test:
T4, T5 — uv run pytest cli/tests/test_excerpt_integration.py(red→green)
[x] 8. Measure again and record the delta
- Re-run task 1's script; commit
evidence/after.md; reconcile the numbers quoted inrequirements.md§ Introduction anddesign.mdwith what was measured. - Depends on: 6
- Requirements: non-functional (cost)
- Test:
T8 — uv run python docs/specs/issue-243/evidence/measure_prompt.py
- Re-run task 1's script; commit
[x] 9. Docs: capability doc, user-facing docs, decision record
docs/capabilities/webhook-triggers.mdgains the distillation behaviour block and a history row; the decision log records the allow-list choice and the deferred answer to the constant-text question.- Depends on: 6
- Requirements: R6.1
- Test:
T7 — uv run pytest cli/tests/test_docs_parity.py+markdownlint
[x] 10. Verification, reviews, briefing
- Execute
testing-plan.mdand fill its results; self-review rounds; security review; post the pros/cons analysis on the ticket for the owner (R6.2); reviewer briefing on the PR. - Depends on: 7, 8, 9
- Requirements: R6.1, R6.2
- Test:
T7 — uv run pytest(whole suite) + the full lint set
- Execute
Dependency graph (DAG)
mermaid
flowchart LR
T1[1 baseline] --> T8[8 measure again]
T2[2 red: comments] --> T5[5 excerpt.py]
T3[3 red: other events] --> T5
T4[4 red: caps + abuse] --> T5
T5 --> T6[6 wire the dispatcher]
T6 --> T7[7 integration]
T6 --> T8
T6 --> T9[9 docs]
T7 --> T10[10 verify + review]
T8 --> T10
T9 --> T10Three independent red roots (2, 3, 4) plus the baseline (1), which is independent of all of them and must land before task 5 changes what is measured.
Checkpoints
- After tasks 2–4: the red run is captured to
evidence/red.mdbefore task 5 exists. - After task 6: the whole existing suite runs — this is where a regression in an operator template contract or a delivery test would show.
- After task 8: the measured delta replaces every estimated number in the specs.
- After task 10: the ready-to-ship gate — green checks, evidence committed, capability doc updated, briefing posted, ticket carrying the R6 analysis.
Review comments
None yet.