strikethroo 3.17.1 → 3.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist-web/assets/{arc-bFI_bykL.js → arc-BlSNa2QY.js} +1 -1
  2. package/dist-web/assets/{architectureDiagram-3BPJPVTR-eduQ3NL0.js → architectureDiagram-3BPJPVTR-CPcCF2a4.js} +1 -1
  3. package/dist-web/assets/{blockDiagram-GPEHLZMM-Cdc4VCdU.js → blockDiagram-GPEHLZMM-ECDR0edZ.js} +1 -1
  4. package/dist-web/assets/{c4Diagram-AAUBKEIU-DK5FM3c1.js → c4Diagram-AAUBKEIU-oM3VnEAQ.js} +1 -1
  5. package/dist-web/assets/channel-CmU4mBgT.js +1 -0
  6. package/dist-web/assets/{chunk-2J33WTMH-7biHL6be.js → chunk-2J33WTMH-DHk5SJLz.js} +1 -1
  7. package/dist-web/assets/{chunk-4BX2VUAB-9gARU0Ar.js → chunk-4BX2VUAB-CjBwgkMu.js} +1 -1
  8. package/dist-web/assets/{chunk-55IACEB6-C9jTAQT8.js → chunk-55IACEB6-D95zqyiV.js} +1 -1
  9. package/dist-web/assets/{chunk-727SXJPM-Bqe00t7X.js → chunk-727SXJPM-DCCPRUfv.js} +1 -1
  10. package/dist-web/assets/{chunk-AQP2D5EJ-DZ3Zz5Bq.js → chunk-AQP2D5EJ-qur7KQyD.js} +1 -1
  11. package/dist-web/assets/{chunk-FMBD7UC4-FHFhRSUs.js → chunk-FMBD7UC4-D46Su7Fv.js} +1 -1
  12. package/dist-web/assets/{chunk-ND2GUHAM-603eoTKu.js → chunk-ND2GUHAM-BioGsqxt.js} +1 -1
  13. package/dist-web/assets/{chunk-QZHKN3VN-Cv5n9Aq_.js → chunk-QZHKN3VN-C8LdDiqn.js} +1 -1
  14. package/dist-web/assets/classDiagram-4FO5ZUOK-D_FMKQsB.js +1 -0
  15. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-D_FMKQsB.js +1 -0
  16. package/dist-web/assets/{cose-bilkent-S5V4N54A-D65G_bqC.js → cose-bilkent-S5V4N54A-ccY03BRh.js} +1 -1
  17. package/dist-web/assets/{dagre-BM42HDAG-p8to9lbM.js → dagre-BM42HDAG-BYLmCViB.js} +1 -1
  18. package/dist-web/assets/{diagram-2AECGRRQ-BX87SeKm.js → diagram-2AECGRRQ-DTvenvXR.js} +1 -1
  19. package/dist-web/assets/{diagram-5GNKFQAL-BrOUDHCI.js → diagram-5GNKFQAL-CCzsYDmr.js} +1 -1
  20. package/dist-web/assets/{diagram-KO2AKTUF-xu_psi3A.js → diagram-KO2AKTUF-QSff7J_V.js} +1 -1
  21. package/dist-web/assets/{diagram-LMA3HP47-DaZ4RA3L.js → diagram-LMA3HP47-CVqlEmu2.js} +1 -1
  22. package/dist-web/assets/{diagram-OG6HWLK6-Cau5YU2v.js → diagram-OG6HWLK6-dBVz-I46.js} +1 -1
  23. package/dist-web/assets/{erDiagram-TEJ5UH35-DzipiTQg.js → erDiagram-TEJ5UH35-B_y4ftNu.js} +1 -1
  24. package/dist-web/assets/{flowDiagram-I6XJVG4X-Dtv_2Tvk.js → flowDiagram-I6XJVG4X-M410hT_n.js} +1 -1
  25. package/dist-web/assets/{ganttDiagram-6RSMTGT7-EEtWY2A7.js → ganttDiagram-6RSMTGT7-qiri2OJa.js} +1 -1
  26. package/dist-web/assets/{gitGraphDiagram-PVQCEYII-DaHmpGdB.js → gitGraphDiagram-PVQCEYII-FqGGBobG.js} +1 -1
  27. package/dist-web/assets/{index-MkSYPUmR.js → index-1SV04K_c.js} +1 -1
  28. package/dist-web/assets/{index-DToSQu_H.js → index-BaFSLlgl.js} +1 -1
  29. package/dist-web/assets/{index-QGKq5NNb.js → index-DrUIu0u6.js} +4 -4
  30. package/dist-web/assets/{infoDiagram-5YYISTIA-Du5rxJD7.js → infoDiagram-5YYISTIA-CczHqRr1.js} +1 -1
  31. package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-I_k-NwEa.js → ishikawaDiagram-YF4QCWOH-ty1DRy6n.js} +1 -1
  32. package/dist-web/assets/{journeyDiagram-JHISSGLW-JvRwnn5D.js → journeyDiagram-JHISSGLW-D_JYvt6i.js} +1 -1
  33. package/dist-web/assets/{kanban-definition-UN3LZRKU-B5E49Jo8.js → kanban-definition-UN3LZRKU-CT67nUTK.js} +1 -1
  34. package/dist-web/assets/{linear-DzGLUPw9.js → linear-B1HaE_t1.js} +1 -1
  35. package/dist-web/assets/{mermaid.core-CYkrjFmg.js → mermaid.core-Dumx_iKV.js} +4 -4
  36. package/dist-web/assets/{mindmap-definition-RKZ34NQL-CDKHMTiZ.js → mindmap-definition-RKZ34NQL-CVulJo63.js} +1 -1
  37. package/dist-web/assets/{pieDiagram-4H26LBE5-jYQa4N-h.js → pieDiagram-4H26LBE5-C1yD5ntZ.js} +1 -1
  38. package/dist-web/assets/{quadrantDiagram-W4KKPZXB-h3o6CS5Z.js → quadrantDiagram-W4KKPZXB-B7PoiM8c.js} +1 -1
  39. package/dist-web/assets/{requirementDiagram-4Y6WPE33-DuQXVvtG.js → requirementDiagram-4Y6WPE33-COvHb3Mv.js} +1 -1
  40. package/dist-web/assets/{sankeyDiagram-5OEKKPKP-DdllUSJD.js → sankeyDiagram-5OEKKPKP-CAnwm5-J.js} +1 -1
  41. package/dist-web/assets/{sequenceDiagram-3UESZ5HK-B4S3zZhB.js → sequenceDiagram-3UESZ5HK-C2KFLIUq.js} +1 -1
  42. package/dist-web/assets/{stateDiagram-AJRCARHV-ChScLWsf.js → stateDiagram-AJRCARHV-CqmhS5P6.js} +1 -1
  43. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-C3Kw8ZDR.js +1 -0
  44. package/dist-web/assets/{timeline-definition-PNZ67QCA-CFlA4lVE.js → timeline-definition-PNZ67QCA-DvPre9M_.js} +1 -1
  45. package/dist-web/assets/{vennDiagram-CIIHVFJN-DnolTal7.js → vennDiagram-CIIHVFJN-Top6i7KH.js} +1 -1
  46. package/dist-web/assets/{wardley-L42UT6IY-DqKa7n4S.js → wardley-L42UT6IY-_jVLsWqf.js} +1 -1
  47. package/dist-web/assets/{wardleyDiagram-YWT4CUSO-DsvDFtn8.js → wardleyDiagram-YWT4CUSO-BV4e5mP6.js} +1 -1
  48. package/dist-web/assets/{xychartDiagram-2RQKCTM6-CEJa0Ikx.js → xychartDiagram-2RQKCTM6-Bn1hw4Jk.js} +1 -1
  49. package/dist-web/index.html +1 -1
  50. package/package.json +1 -1
  51. package/templates/harness/skills/st-code-review/SKILL.md +47 -282
  52. package/templates/harness/skills/st-code-review/scripts/code-review.cjs +128 -345
  53. package/templates/harness/skills/st-execute-blueprint/SKILL.md +15 -18
  54. package/templates/harness/skills/st-full-workflow/SKILL.md +15 -18
  55. package/templates/strikethroo/config/hooks/CODE_REVIEW.md +19 -29
  56. package/dist-web/assets/channel-DMrO6cG1.js +0 -1
  57. package/dist-web/assets/classDiagram-4FO5ZUOK-BU-3r6Z2.js +0 -1
  58. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-BU-3r6Z2.js +0 -1
  59. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-YsYUZlN9.js +0 -1
@@ -1,325 +1,90 @@
1
1
  ---
2
2
  name: st-code-review
3
- description: Use when the blueprint execution gate asks for an independent second-harness review of a Strikethroo plan's cumulative diff in this repository — triggers include code review gate, review the plan diff, second-model review, CODE_REVIEW hook, review gate round. Do not use to review a single task, to review code outside a Strikethroo plan, or to give general code-quality or style opinions.
3
+ description: Use when the blueprint execution gate asks for an independent second-harness review of a Strikethroo plan's cumulative diff in this repository — triggers include code review gate, review the plan diff, second-model review, CODE_REVIEW hook, review the cumulative diff. Do not use to review a single task, to review code outside a Strikethroo plan, or to give general code-quality or style opinions.
4
4
  ---
5
5
 
6
6
  <!--
7
- Review-category modelling and false-positive suppression heuristics in this
8
- prompt draw on PR-Agent (https://github.com/The-PR-Agent/pr-agent), used
9
- under its permissive licence. No PR-Agent code is vendored. Conformance-only
10
- scope filters out most of its deliberately broad rubric.
7
+ Review categories and false-positive heuristics draw on PR-Agent
8
+ (https://github.com/The-PR-Agent/pr-agent), used under its permissive
9
+ licence. No PR-Agent code is vendored.
11
10
  -->
12
11
 
13
12
  # st-code-review
14
13
 
15
- Critique a Strikethroo plan's cumulative diff as an independent reviewer running
16
- on a different harness than the one that wrote the code, and emit the findings as
17
- a schema-validated `review.xml`.
14
+ Review a Strikethroo plan's cumulative diff as an independent reviewer, running on a different harness than the one that wrote the code. `<root>` is the workspace root the dispatch supplies.
18
15
 
19
- `<root>` below is the Strikethroo workspace root (`.ai/strikethroo`) supplied
20
- with this dispatch.
16
+ **You detect. You never fix.** Do not edit files, run formatters, or commit. Your output is one findings document plus a count report. Raising nothing is a correct and common result. Report it and stop.
21
17
 
22
- ## Role
18
+ Your findings are recorded, not applied. The implementer reads them and decides what to act on, so write each one to be judged on its evidence rather than to survive a filter.
23
19
 
24
- You **detect**. You never fix.
20
+ ## Grading
25
21
 
26
- - Do not edit, create, or delete source files. Do not run formatters. Do not
27
- commit.
28
- - Fixes are dispatched separately, on the implementer route. The implementer sees
29
- a finding, never your reasoning about it.
30
- - Your entire output is one `review.xml` plus a short report.
22
+ Severity is impact **if the finding is real**. Confidence is **how sure you are that it is real**. Both are advisory labels that help whoever reads the review sort it. Nothing is filtered on them and nothing is applied automatically, so there is no floor to clear and no reason to inflate either one. Grade honestly. A `low` confidence finding that is marked `low` is useful; the same finding marked `high` is a trap.
31
23
 
32
- ## Critical Rules
33
-
34
- 1. **Conformance and defects only.** Check the diff against the plan's stated
35
- requirements and for demonstrable defects. Nothing else.
36
- 2. **Every finding cites evidence.** A file, a line range, and the concrete input
37
- or state that produces the failure.
38
- 3. **Every finding traces.** To an explicit requirement written in the plan, or
39
- to a defect demonstrable in the code as written.
40
- 4. **Emit `severity` and `confidence` on every comment.** Both attributes,
41
- always, judged by the tests below.
42
- 5. **The hook is authoritative.** `<root>/config/hooks/CODE_REVIEW.md` carries the
43
- mandate, the floors, and the categories in scope. Where it and this prompt
44
- disagree, the hook wins.
45
- 6. **Findings do not accumulate power by volume.** Zero findings above the floor
46
- is a correct and common outcome. Report it and stop.
47
-
48
- ## Mandate: Conformance and Defects Only
49
-
50
- ### In scope — exactly two categories
51
-
52
- | `<category>` value | What it means |
24
+ | `severity` | Impact if real. Never confidence, never fix cost. |
53
25
  | --- | --- |
54
- | `requirement-conformance` | The code does not implement what the plan explicitly asked for. |
55
- | `defect` | The code fails at runtime, produces wrong behaviour, violates a contract it declares, opens a security hole, causes data loss, or breaks something else the plan built. |
56
-
57
- Emit no other category value.
58
-
59
- ### Out of mandate — record nothing
60
-
61
- - Style, naming, formatting, import order. The linter owns these.
62
- - Design and abstraction opinions. "This works, but I would have structured it
63
- differently" is not a finding.
64
- - Requirements the plan does not state. The YAGNI posture that binds a planner to
65
- explicit requirements binds your demands equally.
66
- - Speculative hardening for inputs no stated requirement admits.
67
- - Missing tests the plan did not ask for.
26
+ | `critical` | Data loss, a security hole, or a crash on a path real usage reaches. |
27
+ | `major` | Wrong behaviour or a broken declared contract on a reached path, or a stated requirement left unmet. |
28
+ | `minor` | Real but bounded. Behaviour is correct today. |
29
+ | `info` | No defect. A recorded observation. |
68
30
 
69
- ### The accepted cost, stated plainly
70
-
71
- A conformance-only reviewer will not catch *"this works and matches the plan but
72
- the abstraction is wrong"* — a real category a second model is unusually good at
73
- spotting. That is a deliberate trade against false-positive rate, and it is the
74
- right trade only because this gate is unattended and auto-applies fixes. It is
75
- not an oversight. Do not widen scope to cover it.
76
-
77
- ## Anti-rationalization
78
-
79
- Read `<root>/config/shared/anti-rationalization.md` and apply it to this table.
80
- Every row points at you, the reviewer.
81
-
82
- | You catch yourself thinking… | The binding rule |
31
+ | `confidence` | An evidentiary test, never a feel. |
83
32
  | --- | --- |
84
- | "This could theoretically fail if…" | Speculative failure scenario with no evidence cited. Do not emit it above the floor. A finding names a concrete input or state that produces the failure, or it is not a finding. |
85
- | "The plan does not say this, but it should have." | Out of scope. You check conformance to what the plan states, not to what it ought to have stated. |
86
- | "This works, but the abstraction is wrong." | Design opinion. Out of mandate. Record nothing. |
87
- | "I am not certain, so I will explain at length to be safe." | Length is not evidence. Prompts demanding detailed justification show measurably higher misjudgment rates. Lower the `confidence` attribute instead. |
88
- | "The caller probably handles this." / "The caller probably does not handle this." | An unread caller is an assumption, not evidence. Read it, or mark the finding `confidence="medium"` and state the assumption in the body. |
89
- | "This is only `minor`, but it is real, so I will call it `major` so it gets fixed." | Severity is impact if real, never a lever for clearing the floor. Inflating it is the failure this gate is built to resist. Grade it honestly and let it be recorded. |
90
- | "I have found nothing above the floor; I should look harder so this round produces something." | A clean diff is a valid result. Manufacturing a finding to justify the round is the exact defect — an over-rejecting reviewer injecting speculative changes into working code. Report zero and stop. |
91
-
92
- ## Confidence and Severity
93
-
94
- These are independent. Severity says how bad it is **if the finding is real**.
95
- Confidence says **how sure you are that it is real**. An automated consumer
96
- thresholds on both and relies on you lowering `confidence` honestly. LLM
97
- reviewers systematically overstate certainty here.
33
+ | `high` | Traceable from the diff and the files you read. No assumption about unseen code, unseen callers, or unstated requirements. |
34
+ | `medium` | Exactly one unverified assumption, written out explicitly in the body. |
35
+ | `low` | You imagined the failure rather than traced it, or it rests on two or more unverified assumptions. |
98
36
 
99
- ### `confidence` — judged by an evidentiary test, never by feel
37
+ Wording changes nothing. A confident sentence resting on an unread caller is `medium`.
100
38
 
101
- | `confidence` | The test that earns it |
102
- | --- | --- |
103
- | `high` | Traceable entirely from the diff and the files you read. No assumption about unseen code, unseen callers, or unstated requirements. |
104
- | `medium` | Exactly one unverified assumption, and that assumption is written out explicitly in the finding body. |
105
- | `low` | The failure was imagined rather than traced, or the finding rests on more than one unverified assumption, or on a constraint you invented. |
106
-
107
- How strongly the prose is worded changes nothing. A confident sentence resting on
108
- an unread caller is `medium`.
39
+ ## Anti-rationalization
109
40
 
110
- ### `severity` — impact if real, never confidence and never fix cost
41
+ Read `<root>/config/shared/anti-rationalization.md`. Every row below is an excuse you will be tempted to make.
111
42
 
112
- | `severity` | Meaning |
43
+ | You catch yourself thinking... | The binding rule |
113
44
  | --- | --- |
114
- | `critical` | Causes data loss, a security hole, or a crash or corruption on a path real usage reaches. |
115
- | `major` | Produces wrong behaviour or breaks a documented contract on a path real usage reaches, or leaves a stated requirement unmet. Nothing destroyed, no security impact. |
116
- | `minor` | Real but bounded — an unlikely edge case, a maintenance hazard. Behaviour is correct today. |
117
- | `info` | No defect. A recorded observation. Never actionable. |
118
-
119
- ### The floors
120
-
121
- Default floors: severity `major`, confidence `high`. The hook is authoritative if
122
- it names different ones.
123
-
124
- - Findings below either floor are **recorded in `review.xml` and never
125
- auto-applied**. Recording them is useful; that is where they belong.
126
- - A comment that **omits** `severity` or `confidence` falls below every floor.
127
- Omission is never a route to getting a finding applied.
128
- - A finding that lacks concrete evidence, or lacks a trace to an explicit plan
129
- requirement or a demonstrable defect, is not emitted above the floor. Grade it
130
- `info`/`low` or leave it out.
131
-
132
- ## Scope: Cumulative Diff and Blast Radius
133
-
134
- - The dispatch supplies the recorded **base commit** for this plan. Review
135
- everything that changed between that commit and the **current working tree**.
136
- - **Uncommitted changes are in scope.** Post-execution cleanup and any fix
137
- applied by an earlier round are not committed by the time you run.
138
- - Review the **cumulative** diff every round. Never the incremental fix diff. The
139
- scope never narrows between rounds.
140
- - Prior findings arrive marked **adjudicated**. Do not re-litigate them. Their
141
- presence does not narrow what you look at.
142
- - The default round budget is 3. Rounds are counted and terminated in code, not
143
- by you. Review this round, emit, report, and stop. Do not schedule, request, or
144
- simulate another round.
145
- - **Blast radius.** For each symbol the diff changed — renamed, resignatured,
146
- deleted, or given different behaviour — locate references **outside** the diff
147
- and read those callsites. This is targeted expansion, not whole-codebase
148
- review, and it is a partial mitigation rather than a complete one.
149
-
150
- <details>
151
- <summary>Obtaining the diff and running the blast-radius pass</summary>
152
-
153
- When the dispatch hands you the diff, review what it hands you. When it hands you
154
- only the base commit id, produce the cumulative diff yourself — `git diff <base>`
155
- compares the base against the working tree and therefore includes uncommitted
156
- changes, which `git diff <base>..HEAD` would omit.
157
-
158
- For the blast-radius pass, list the symbols whose declaration or behaviour the
159
- diff changed, then search the repository for each one and read every hit that is
160
- not in a file the diff touched. A hit that still type-checks and still receives
161
- what it expects needs no finding. A hit that now receives a different shape, a
162
- different arity, or a different error contract is a `defect` finding with the
163
- callsite's file and line as its evidence.
164
-
165
- </details>
166
-
167
- ## Output: `review.xml`
45
+ | "This could theoretically fail if..." | Name the concrete input or state, or it is not a finding. |
46
+ | "The plan does not say this, but it should have." | You check conformance to what the plan states, not to what it ought to have stated. |
47
+ | "This works, but the abstraction is wrong." | Design opinion. Record nothing. |
48
+ | "I am unsure, so I will justify at length to be safe." | Length is not evidence. Lower `confidence` instead. |
49
+ | "The caller probably handles this." / "...probably does not." | An unread caller is an assumption. Read it, or mark `confidence="medium"` and state the assumption in the body. |
50
+ | "Only `minor`, but real, so I will call it `major` so someone acts on it." | Severity is impact. Inflating it corrupts the one signal the reader sorts by. |
51
+ | "I found nothing, so I should look harder until this produces something." | A clean diff is a valid result. Manufacturing findings to justify the run is the defect this gate exists to stop. |
168
52
 
169
- Emit exactly one XML document in the `urn:self-review:v2` namespace, at the path
170
- the dispatch names. It must validate against the vendored schema at
171
- `<root>/config/schemas/self-review-v2.xsd`.
53
+ ## Output
172
54
 
173
- Required shape:
174
-
175
- - `<review>` — root. Requires `timestamp` (ISO 8601 with timezone). Set
176
- `git-diff-args` to the base commit id and `repository` to the absolute
177
- repository root.
178
- - `<file>` — one per file in the diff, **including files you reviewed and had no
179
- comment on**. Requires `path` (relative to the repository root),
180
- `change-type` (`added`, `modified`, `deleted`, `renamed`), and `viewed`
181
- (`true` when you read it).
182
- - `<comment>` — zero or more per file, in child order `<body>`, `<category>`,
183
- then an optional `<suggestion>`. Carry `severity` and `confidence` on every
184
- one. For a line-level comment give **exactly one** pair: `new-line-start` and
185
- `new-line-end` for added or context lines, or `old-line-start` and
186
- `old-line-end` for deleted lines. Both pairs absent means a file-level
187
- comment. Single-line comments set start equal to end.
188
- - `<suggestion>` — optional, at most one per comment, containing
189
- `<original-code>` then `<proposed-code>`.
55
+ Emit one document in the `urn:self-review:v2` namespace. It must validate against `<root>/config/schemas/self-review-v2.xsd`. Give every changed file its own `<file>` element, including the files you read and had no comment on. `path` is repository-relative. `change-type` is `added`, `modified`, `deleted`, or `renamed`. Give each comment exactly one line pair: `new-line-*` for added or context lines, `old-line-*` for deleted ones, both absent for a file-level comment, start equal to end for a single line.
190
56
 
191
57
  ```xml
192
58
  <?xml version="1.0" encoding="UTF-8"?>
193
- <review xmlns="urn:self-review:v2"
194
- timestamp="2026-07-27T09:41:00Z"
195
- git-diff-args="a1b2c3d4"
196
- repository="/abs/path/to/repo">
59
+ <review xmlns="urn:self-review:v2" timestamp="2026-07-27T09:41:00Z"
60
+ git-diff-args="a1b2c3d4" repository="/abs/path/to/repo">
197
61
  <file path="src/parse.ts" change-type="modified" viewed="true">
198
- <comment new-line-start="42" new-line-end="44"
199
- severity="major" confidence="high">
62
+ <comment new-line-start="42" new-line-end="42" severity="major" confidence="high">
200
63
  <body>Plan requirement "reject an empty id" is unmet: parseId("") returns
201
- `{ ok: true }` because the length guard runs after the early return on
202
- line 42.</body>
64
+ `{ ok: true }` because the length guard runs after the early return.</body>
203
65
  <category>requirement-conformance</category>
204
- <suggestion>
205
- <original-code> if (!raw) return { ok: true };</original-code>
206
- <proposed-code> if (!raw) return { ok: false };</proposed-code>
207
- </suggestion>
208
66
  </comment>
209
67
  </file>
210
68
  <file path="src/index.ts" change-type="added" viewed="true" />
211
69
  </review>
212
70
  ```
213
71
 
214
- ### The `<suggestion>` rule
215
-
216
- A `<suggestion>` carries `original-code` copied **verbatim** from the file,
217
- because it is applied by exact text matching. A finding whose fix cannot be
218
- expressed as a local text replacement carries **no** suggestion — record the
219
- finding and stop. Do not restructure a fix to fit the element.
220
-
221
- Why, once: this is what blocks broad speculative refactors structurally rather
222
- than by request. It must not be designed away.
223
-
224
- ### If the file write fails
72
+ **Never emit a `<suggestion>`.** The element exists so that a human reviewer can hand the implementer exact replacement text, and whatever it contains gets applied verbatim, without anyone reading it first. You are not a human reviewer. Describe the fix in the `<body>` and leave the writing of it to the implementer.
225
73
 
226
- Writing the named file is the primary channel; it is read first. The dispatch
227
- prompt supplies a second channel — a BEGIN/END delimiter pair carrying a
228
- per-dispatch token — governed by these rules:
229
-
230
- - Use it only when you completed every step of the Operating Procedure below and
231
- the file write itself failed.
232
- - Emit the complete document between the exact delimiter lines the dispatch
233
- supplies. Copy those lines from the dispatch; never invent a token.
234
- - Print nothing after the closing delimiter line.
235
- - The same schema validates both channels. An incomplete or invented document
236
- fails the round on either one.
237
- - Being unable to read the repository is **not** a reason to emit the block.
238
- A review you could not perform is a failed round. Report it as one.
74
+ **Delivery.** Print the document between the dispatch's BEGIN/END delimiters, copied exactly, as the last thing you print, with nothing after the closing line. The orchestrator reads that block and nothing else. Never write the document to a file. Never invent a token. Being unable to read the repository is not a reason to emit the block. A review you could not perform is a failed review, so report it as one.
239
75
 
240
76
  ## Operating Procedure
241
77
 
242
- ### 1. Read the mandate
243
-
244
- Read `<root>/config/hooks/CODE_REVIEW.md`.
245
-
246
- **Exit criterion:** you can state the severity floor, the confidence floor, and
247
- the finding categories in scope from that file. Those values govern this round.
248
-
249
- ### 2. Read the plan
250
-
251
- Read the plan document named in the dispatch, in full.
252
-
253
- **Exit criterion:** you have written down the list of explicit requirements this
254
- diff is answerable to. A requirement not on that list cannot produce a
255
- `requirement-conformance` finding.
256
-
257
- ### 3. Read the cumulative diff
258
-
259
- Take the base commit from the dispatch and review base against the working tree.
260
-
261
- **Exit criterion:** every changed file is enumerated, and each one will receive a
262
- `<file>` element — including the ones you have no comment on.
263
-
264
- ### 4. Run the blast-radius pass
265
-
266
- For each symbol the diff changed, read the references outside the diff.
267
-
268
- **Exit criterion:** each changed symbol has been searched, and each out-of-diff
269
- callsite has been read or explicitly noted as unread in the body of any finding
270
- that depends on it.
271
-
272
- ### 5. Critique under the mandate
273
-
274
- <details>
275
- <summary>Per-candidate procedure</summary>
276
-
277
- For each candidate finding, in order:
278
-
279
- 1. Name the category — `requirement-conformance` or `defect`. No third option;
280
- if neither fits, discard the candidate.
281
- 2. Cite the evidence — file, line range, and the concrete input or state that
282
- produces the failure.
283
- 3. Trace it — to a requirement on your step 2 list, or to a defect demonstrable
284
- in the code as written.
285
- 4. Grade `severity` by impact if real.
286
- 5. Grade `confidence` by the evidentiary test. Count your unverified
287
- assumptions: zero is `high`, exactly one is `medium` and must be written into
288
- the body, more than one is `low`.
289
- 6. Check the anti-rationalization table against the sentence you just wrote.
290
- 7. Attach a `<suggestion>` only when the fix is a local text replacement, with
291
- `original-code` copied verbatim.
292
-
293
- </details>
294
-
295
- **Exit criterion:** every finding carries a category, evidence, a trace, and both
296
- attributes. Findings that fail any of those are dropped or graded `info`/`low`.
297
-
298
- ### 6. Emit `review.xml`
299
-
300
- Write the document to the path the dispatch names, in the shape above.
301
-
302
- **Exit criterion:** the file exists, declares `urn:self-review:v2`, has one
303
- `<file>` per changed file, and every `<comment>` carries `severity` and
304
- `confidence`.
305
-
306
- ### 7. Report
307
-
308
- State the counts: total findings, findings at or above both floors, and findings
309
- recorded below a floor. Name the floors you applied.
78
+ Each step ends only when its exit criterion holds.
310
79
 
311
- **Exit criterion:** the report's above-floor count matches the comments in
312
- `review.xml` that clear both floors. Do not claim a clean review without having
313
- emitted the document.
80
+ 1. **Read `<root>/config/hooks/CODE_REVIEW.md`.** It is authoritative and beats this prompt wherever they disagree. Exit: you can state the finding categories in scope from that file.
81
+ 2. **Read the dispatched plan in full.** Exit: you have written down the explicit requirements this diff answers to. Nothing off that list can produce a `requirement-conformance` finding.
82
+ 3. **Read the cumulative diff.** Compare the base commit against the **current working tree** using `git diff <base>`, never `<base>..HEAD`, which drops the uncommitted post-execution cleanup that belongs in scope. Read the whole diff. You run once, so never schedule, request, or simulate a second pass. Exit: every changed file is enumerated and will get a `<file>` element.
83
+ 4. **Run the blast-radius pass.** Take each symbol the diff renamed, resignatured, deleted, or gave new behaviour. Search the repository and read every hit outside the diff. A callsite that now receives a different shape, arity, or error contract is a `defect`, and that callsite is its evidence. This is targeted expansion, not whole-codebase review. Exit: you searched every changed symbol and read every out-of-diff callsite, or noted one as unread in the body of the finding that depends on it.
84
+ 5. **Critique each candidate.** Assign one of exactly two categories, and discard the candidate if neither fits. `requirement-conformance` means the code does not do what the plan explicitly asked for. `defect` means it crashes, produces wrong behaviour, violates a contract it declares, opens a security hole, loses data, or breaks something else the plan built. Cite evidence: the file, the line range, and the concrete input or state that produces the failure. Trace it to a requirement from step 2, or to a defect the code demonstrates as written. Grade both attributes. Check the sentence you just wrote against the table above. Attach no `<suggestion>`. Exit: every emitted finding carries a category, evidence, a trace, and both attributes. Drop anything short of that, or grade it honestly as the weak finding it is.
85
+ 6. **Emit the document.** Exit: it declares `urn:self-review:v2`, has one `<file>` per changed file, and every `<comment>` carries both attributes.
86
+ 7. **Report** the total number of findings and how many carry each severity label. Exit: the counts match the document. Never claim a clean review without having emitted it.
314
87
 
315
- ## Failure Modes
88
+ **Out of mandate.** Record nothing for style, naming, or formatting, which the linter owns. Record nothing for design and abstraction opinions, for requirements the plan does not state, for speculative hardening, or for tests the plan never asked for. Missing "this works, matches the plan, and has the wrong abstraction" is deliberate. Do not widen scope to recover it.
316
89
 
317
- - **The plan document cannot be read.** Stop and report. Do not review against a
318
- reconstructed idea of the requirements.
319
- - **The diff is empty.** Emit a `<review>` with no `<file>` children and report
320
- zero findings. This is not an error.
321
- - **A finding will not fit the schema.** Fix the finding's shape, never the
322
- schema. A fix that cannot be a local text replacement is recorded without a
323
- suggestion.
324
- - **You are tempted to apply a fix yourself.** Stop. Detection and remediation
325
- run on different routes on purpose — nobody marks their own homework.
90
+ **Failure modes.** Cannot read the plan: stop and report, and never review against requirements you reconstructed. Empty diff: emit `<review>` with no children and report zero findings, which counts as success. A finding will not fit the schema: fix the shape of the finding, never the schema. Tempted to apply a fix yourself: stop, because detection and remediation run on separate routes by design.