checkwright 0.21.0 → 0.22.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 (236) hide show
  1. package/README.md +385 -19
  2. package/lib/common/digest.sh +18 -0
  3. package/lib/common/lock.sh +11 -0
  4. package/lib/common/recipe.sh +8 -11
  5. package/lib/doctor.sh +49 -0
  6. package/lib/init.sh +152 -29
  7. package/package.json +2 -2
  8. package/payload/artifact/targets.list +30 -0
  9. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates +0 -0
  10. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates.sha256 +1 -0
  11. package/payload/canon-kit/README.md +1 -0
  12. package/payload/canon-kit/SPEC.md +279 -24
  13. package/payload/canon-kit/checks/check-comment-tier.sh +7 -2
  14. package/payload/canon-kit/checks/check-docs-link-convention.sh +11 -4
  15. package/payload/canon-kit/checks/check-payload-claim.sh +133 -0
  16. package/payload/canon-kit/checks/check-prose-enum.sh +1 -1
  17. package/payload/canon-kit/checks/check-spec-pointer.sh +9 -2
  18. package/payload/canon-kit/gate-tests/check-comment-tier/good/good.sh +3 -0
  19. package/payload/canon-kit/gate-tests/check-comment-tier.test.sh +26 -3
  20. package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/OUTSIDE.md +4 -0
  21. package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/docs/index.md +3 -0
  22. package/payload/canon-kit/gate-tests/check-docs-link-convention/good/OUTSIDE.md +4 -0
  23. package/payload/canon-kit/gate-tests/check-docs-link-convention/good/docs/methodology.md +8 -0
  24. package/payload/canon-kit/gate-tests/check-docs-link-convention.test.sh +94 -0
  25. package/payload/canon-kit/gate-tests/check-manifest-count.test.sh +5 -3
  26. package/payload/canon-kit/gate-tests/check-payload-claim/bad/README.md +15 -0
  27. package/payload/canon-kit/gate-tests/check-payload-claim/bad/expect.txt +2 -0
  28. package/payload/canon-kit/gate-tests/check-payload-claim/bad/install.md +19 -0
  29. package/payload/canon-kit/gate-tests/check-payload-claim/bad/posts/note.md +6 -0
  30. package/payload/canon-kit/gate-tests/check-payload-claim/bad/scripts/canon-config.sh +8 -0
  31. package/payload/canon-kit/gate-tests/check-payload-claim/bad/scripts/payload-claims.sh +7 -0
  32. package/payload/canon-kit/gate-tests/check-payload-claim/good/README.md +15 -0
  33. package/payload/canon-kit/gate-tests/check-payload-claim/good/expect.txt +2 -0
  34. package/payload/canon-kit/gate-tests/check-payload-claim/good/install.md +20 -0
  35. package/payload/canon-kit/gate-tests/check-payload-claim/good/posts/note.md +6 -0
  36. package/payload/canon-kit/gate-tests/check-payload-claim/good/scripts/canon-config.sh +8 -0
  37. package/payload/canon-kit/gate-tests/check-payload-claim/good/scripts/payload-claims.sh +7 -0
  38. package/payload/canon-kit/gate-tests/check-prose-enum.test.sh +24 -1
  39. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/expect.txt +1 -0
  40. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/widget.sh +1 -0
  41. package/payload/canon-kit/gate-tests/check-spec-pointer/good/widget.sh +1 -0
  42. package/payload/canon-kit/lib/spec.sh +22 -12
  43. package/payload/canon-kit/smoke/install.sh +20 -1
  44. package/payload/canon-kit/templates/SPEC-amendment.md +5 -1
  45. package/payload/context-kit/SPEC.md +25 -1
  46. package/payload/context-kit/lib/toolfloor.sh +1 -1
  47. package/payload/context-kit/smoke/install.sh +3 -1
  48. package/payload/delegation-kit/SPEC.md +383 -13
  49. package/payload/delegation-kit/bin/run-dispatch-guard-tests.sh +97 -0
  50. package/payload/delegation-kit/checks/check-gate-tamper.sh +1 -1
  51. package/payload/delegation-kit/lib/delegation.sh +1 -0
  52. package/payload/delegation-kit/smoke/install.sh +2 -1
  53. package/payload/delegation-kit/templates/agent-dispatch-guard.sh +61 -0
  54. package/payload/delegation-kit/templates/agent-execution.md +103 -12
  55. package/payload/delegation-kit/templates/delegation-config.sh +4 -0
  56. package/payload/delegation-kit/templates/dispatch-checklists.md +1 -1
  57. package/payload/delegation-kit/usage-tests/dispatch-guard-cases.tsv +30 -0
  58. package/payload/doctrine-kit/DOCTRINE.md +27 -0
  59. package/payload/doctrine-kit/README.md +5 -0
  60. package/payload/doctrine-kit/SPEC.md +62 -3
  61. package/payload/doctrine-kit/bin/install-doctrine.sh +84 -4
  62. package/payload/doctrine-kit/smoke/install.sh +77 -1
  63. package/payload/drift-kit/README.md +3 -2
  64. package/payload/drift-kit/SPEC.md +253 -20
  65. package/payload/drift-kit/bin/stage-economics.sh +157 -3
  66. package/payload/drift-kit/kpis/kpi-incident-recurrence.sh +42 -0
  67. package/payload/drift-kit/smoke/install.sh +155 -1
  68. package/payload/drift-kit/templates/economics.md +9 -0
  69. package/payload/drift-kit/templates/kpis.list +6 -1
  70. package/payload/evidence-kit/README.md +20 -6
  71. package/payload/evidence-kit/SPEC.md +355 -17
  72. package/payload/evidence-kit/bin/run-validate.sh +51 -9
  73. package/payload/evidence-kit/checks/check-battery-roster.sh +86 -0
  74. package/payload/evidence-kit/checks/check-producer-liveness.sh +34 -0
  75. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/args +1 -0
  76. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/expect.txt +1 -0
  77. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/runner.md +14 -0
  78. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/scripts/evidence-config.sh +7 -0
  79. package/payload/evidence-kit/gate-tests/check-battery-roster/good/args +1 -0
  80. package/payload/evidence-kit/gate-tests/check-battery-roster/good/expect.txt +1 -0
  81. package/payload/evidence-kit/gate-tests/check-battery-roster/good/runner.md +14 -0
  82. package/payload/evidence-kit/gate-tests/check-battery-roster/good/scripts/evidence-config.sh +7 -0
  83. package/payload/evidence-kit/gate-tests/check-battery-roster.test.sh +68 -0
  84. package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/args +1 -0
  85. package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/expect.txt +1 -0
  86. package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/run-validate.lock +1 -0
  87. package/payload/evidence-kit/gate-tests/check-producer-liveness/good/args +1 -0
  88. package/payload/evidence-kit/gate-tests/check-producer-liveness/good/expect.txt +2 -0
  89. package/payload/evidence-kit/gate-tests/check-producer-liveness/good/run-validate.lock +1 -0
  90. package/payload/evidence-kit/gate-tests/producer-lock.test.sh +109 -0
  91. package/payload/evidence-kit/lib/evidence.sh +18 -0
  92. package/payload/evidence-kit/smoke/install.sh +17 -3
  93. package/payload/gate-sdk/README.md +4 -1
  94. package/payload/gate-sdk/SPEC.md +1949 -74
  95. package/payload/gate-sdk/bin/gen-pre-commit.sh +12 -2
  96. package/payload/gate-sdk/bin/run-consumer-smoke.sh +121 -1
  97. package/payload/gate-sdk/bin/run-gate-tests.sh +40 -9
  98. package/payload/gate-sdk/bin/run-gates.sh +31 -2
  99. package/payload/gate-sdk/bin/upgrade-smoke.sh +3 -3
  100. package/payload/gate-sdk/checks/check-action-gh-repo.gate +2 -0
  101. package/payload/gate-sdk/checks/check-action-pinning.gate +2 -0
  102. package/payload/gate-sdk/checks/check-action-run-shell.sh +3 -1
  103. package/payload/gate-sdk/checks/check-core-files.sh +27 -4
  104. package/payload/gate-sdk/checks/check-exec-bit.sh +20 -1
  105. package/payload/gate-sdk/checks/check-gate-binary-fresh.sh +106 -0
  106. package/payload/gate-sdk/checks/check-gate-exemption-tasks.sh +6 -7
  107. package/payload/gate-sdk/checks/check-gate-output.sh +9 -1
  108. package/payload/gate-sdk/checks/check-gate-substrate-parity.sh +302 -0
  109. package/payload/gate-sdk/checks/check-graph.sh +4 -5
  110. package/payload/gate-sdk/checks/check-readme-roster.sh +5 -0
  111. package/payload/gate-sdk/checks/check-reads-couples.sh +70 -21
  112. package/payload/gate-sdk/checks/check-template-registry-parity.sh +81 -0
  113. package/payload/gate-sdk/gate-tests/check-action-run-shell.test.sh +16 -1
  114. package/payload/gate-sdk/gate-tests/check-core-files.test.sh +64 -0
  115. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/args +2 -0
  116. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/expect.txt +5 -0
  117. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/kitroot/checks/check-vendored.gate +2 -0
  118. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/check-ported.gate +2 -0
  119. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/gate-sdk-config.sh +2 -0
  120. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/gates.list +4 -0
  121. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/stamp.txt +1 -0
  122. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/stub-bin +6 -0
  123. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/args +2 -0
  124. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/expect.txt +5 -0
  125. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/kitroot/checks/check-vendored.gate +2 -0
  126. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/check-ported.gate +2 -0
  127. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/gate-sdk-config.sh +2 -0
  128. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/gates.list +4 -0
  129. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/stamp.txt +1 -0
  130. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/stub-bin +5 -0
  131. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh.test.sh +81 -0
  132. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/TASK-QUEUE.md +3 -1
  133. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/expect.txt +3 -1
  134. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/gates/check-sample.sh +3 -1
  135. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/expect.txt +1 -0
  136. package/payload/gate-sdk/gate-tests/check-gate-output/bad/check-sample.sh +1 -0
  137. package/payload/gate-sdk/gate-tests/check-gate-output/good/check-sample.sh +1 -0
  138. package/payload/gate-sdk/gate-tests/check-gate-output/good/expect.txt +1 -0
  139. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/args +2 -0
  140. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/conservation.md +7 -0
  141. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/expect.txt +12 -0
  142. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/impl/gate.rs +2 -0
  143. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/kitroot/check-orphan.rs +3 -0
  144. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/publish.yml +15 -0
  145. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-alpha.sh +3 -0
  146. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-dup.gate +1 -0
  147. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-dup.sh +3 -0
  148. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-orphan.gate +1 -0
  149. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gate-sdk-config.sh +6 -0
  150. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gates.list +3 -0
  151. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/stub-bin +3 -0
  152. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/targets.list +3 -0
  153. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/args +2 -0
  154. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/conservation.md +8 -0
  155. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/expect.txt +7 -0
  156. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/impl/gate.rs +2 -0
  157. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/kitroot/check-other.rs +3 -0
  158. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/publish.yml +15 -0
  159. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-alpha.sh +3 -0
  160. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-ported.gate +2 -0
  161. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gate-sdk-config.sh +6 -0
  162. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gates.list +2 -0
  163. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/stub-bin +3 -0
  164. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/targets.list +2 -0
  165. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity.test.sh +123 -0
  166. package/payload/gate-sdk/gate-tests/check-reads-couples.test.sh +139 -0
  167. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/templates/widgets.list +4 -0
  168. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/widgets/widget-one.sh +3 -0
  169. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/widgets/widget-two.sh +3 -0
  170. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/args +4 -0
  171. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/expect.txt +1 -0
  172. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/scripts/gate-sdk-config.sh +5 -0
  173. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/templates/widgets.list +4 -0
  174. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/widgets/widget-one.sh +3 -0
  175. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/widgets/widget-two.sh +3 -0
  176. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/args +8 -0
  177. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/beta-kit/templates/rules.list +5 -0
  178. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/beta-kit/templates/table.tsv +4 -0
  179. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/expect.txt +1 -0
  180. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/scripts/gate-sdk-config.sh +5 -0
  181. package/payload/gate-sdk/gate-tests/lib-declaration.test.sh +4 -4
  182. package/payload/gate-sdk/gate-tests/lib-gate.test.sh +41 -1
  183. package/payload/gate-sdk/gate-tests/run-gate-tests.test.sh +144 -0
  184. package/payload/gate-sdk/lib/consumer-smoke.sh +26 -1
  185. package/payload/gate-sdk/lib/gate.sh +75 -0
  186. package/payload/gate-sdk/lib/inject.sh +21 -1
  187. package/payload/gate-sdk/smoke/install.sh +19 -1
  188. package/payload/guard-kit/README.md +4 -3
  189. package/payload/guard-kit/SPEC.md +88 -10
  190. package/payload/guard-kit/bin/compare-settings-allow.sh +40 -7
  191. package/payload/guard-kit/gate-tests/compare-settings-allow.test.sh +64 -0
  192. package/payload/guard-kit/lib/guard.sh +1 -0
  193. package/payload/guard-kit/templates/close-triage.md +35 -7
  194. package/payload/guard-kit/templates/guard-config.sh +3 -0
  195. package/payload/lifecycle-kit/README.md +1 -0
  196. package/payload/lifecycle-kit/SPEC.md +575 -29
  197. package/payload/lifecycle-kit/bin/enter-stage.sh +13 -3
  198. package/payload/lifecycle-kit/bin/file-gap.sh +42 -1
  199. package/payload/lifecycle-kit/bin/file-survey.sh +50 -0
  200. package/payload/lifecycle-kit/checks/check-merge-attrs.sh +1 -1
  201. package/payload/lifecycle-kit/checks/check-skill-binding.sh +1 -1
  202. package/payload/lifecycle-kit/checks/check-survey-record.sh +102 -0
  203. package/payload/lifecycle-kit/gate-tests/check-merge-attrs/bad/.gitattributes +1 -0
  204. package/payload/lifecycle-kit/gate-tests/check-merge-attrs/good/.gitattributes +1 -0
  205. package/payload/lifecycle-kit/gate-tests/check-merge-attrs.test.sh +1 -0
  206. package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/args +2 -0
  207. package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/expect.txt +4 -0
  208. package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/record.md +18 -0
  209. package/payload/lifecycle-kit/gate-tests/check-survey-record/good/args +2 -0
  210. package/payload/lifecycle-kit/gate-tests/check-survey-record/good/expect.txt +1 -0
  211. package/payload/lifecycle-kit/gate-tests/check-survey-record/good/record.md +13 -0
  212. package/payload/lifecycle-kit/gate-tests/check-survey-record.test.sh +84 -0
  213. package/payload/lifecycle-kit/gate-tests/file-gap-recurrence.test.sh +94 -0
  214. package/payload/lifecycle-kit/gate-tests/survey-record-entry.test.sh +102 -0
  215. package/payload/lifecycle-kit/lib/stages.sh +8 -2
  216. package/payload/lifecycle-kit/smoke/install.sh +17 -1
  217. package/payload/lifecycle-kit/templates/consult.md +73 -0
  218. package/payload/lifecycle-kit/templates/lead.md +103 -7
  219. package/payload/lifecycle-kit/templates/stages/align.md +12 -0
  220. package/payload/lifecycle-kit/templates/stages/build.md +8 -0
  221. package/payload/lifecycle-kit/templates/stages/close.md +25 -4
  222. package/payload/lifecycle-kit/templates/stages/scope.md +34 -0
  223. package/payload/lifecycle-kit/templates/stages/spec.md +8 -0
  224. package/payload/lifecycle-kit/templates/stages/validate.md +8 -0
  225. package/payload/queue-kit/README.md +4 -1
  226. package/payload/queue-kit/SPEC.md +230 -6
  227. package/payload/queue-kit/bin/queue-edges.sh +78 -0
  228. package/payload/queue-kit/checks/check-queue-entry-budget.sh +5 -3
  229. package/payload/queue-kit/gate-tests/check-queue-hygiene/good/TASK-QUEUE.md +5 -0
  230. package/payload/queue-kit/gate-tests/queue-edges.test.sh +130 -0
  231. package/payload/queue-kit/smoke/install.sh +4 -1
  232. package/payload/queue-kit/templates/TASK-QUEUE.md +3 -0
  233. package/payload/site-kit/SPEC.md +41 -27
  234. package/payload/site-kit/smoke/install.sh +9 -1
  235. package/payload/gate-sdk/checks/check-action-gh-repo.sh +0 -321
  236. package/payload/gate-sdk/checks/check-action-pinning.sh +0 -55
@@ -79,6 +79,12 @@ design *ruling* is design work — it goes to the deferred section
79
79
  `[design-pending]` until scope rules on it. Enforced by
80
80
  `check-amendment-queue`.
81
81
 
82
+ An amendment file is **outside the governed manifest**: `CANON_KIT_MANIFEST_FILES`
83
+ globs `*/SPEC.md`, which `SPEC-<name>.md` does not match, so the prose and knob
84
+ gates never scan one. Their obligations attach at the merge rather than at the
85
+ amendment — an amendment may carry a citation or a knob mention that would red
86
+ once integrated, and §Merging an amendment step 2 is where that debt comes due.
87
+
82
88
  The tag is a **checksum on the promotion move**, not a second source of the
83
89
  state its section already carries. Its redundancy is the mechanism: a
84
90
  promotion crosses a section boundary *and* swaps the tag, so
@@ -132,7 +138,13 @@ supplies the checklist they invoke and the gate behind the promotion rule.
132
138
  embedded wire-delta becomes a citation to the now-existing contract
133
139
  file — the amendment's exemption is file-scoped, so once step 3 deletes
134
140
  the file `check-spec-embedded-source` re-arms and a kept embed goes red.
135
- 3. Delete the amendment file; verify none remain for the component.
141
+ 3. Delete the amendment file; verify none remain for the component. **The
142
+ none-remain half is discharged at the iteration, not at the commit** — with
143
+ sibling amendments in flight for one component, only the batch merging the
144
+ last of them can satisfy it, and the earlier batches' identical assertions are
145
+ unsatisfiable at their own commits. The horizon is the iteration because the
146
+ build stage stays resident until the queue empties and close refuses entry on
147
+ a non-empty active queue.
136
148
  4. Move the queue entry to `## Done`, dropping its `[spec:]` tag — the
137
149
  amendment it referenced is gone, and `check-amendment-queue` requires
138
150
  every `[spec:]` ref to resolve to a file on disk.
@@ -299,6 +311,15 @@ unset, and the loader exits 2 on a malformed config. Knobs:
299
311
  kit literal (the provenance seam). This repo sets
300
312
  `bash scripts/install-transports.sh`, `^(Quick start|Install)`, and
301
313
  `("docs/posts/*")`.
314
+ - `CANON_KIT_PAYLOAD_CLAIMS_CMD` — a consumer command emitting the payload
315
+ disclosure classes `check-payload-claim` holds, one `<claim-id>`⇥`<ERE>` line
316
+ per class, default empty ⇒ clean skip (the correct posture for a tree whose
317
+ payload discloses one thing only). `CANON_KIT_PAYLOAD_CLAIM_EXCLUDE` — array
318
+ of globs dropped from that gate's scanned set on top of
319
+ `CANON_KIT_MDREF_EXCLUDE`, default empty. A spelling of what a payload
320
+ discloses is one project's distribution model, so it is consumer config for
321
+ the same provenance-seam reason the transport vocabulary above is. This repo
322
+ sets `bash scripts/payload-claims.sh` and `("docs/posts/*")`.
302
323
  - `CANON_KIT_COMMENT_MACHINE` / `CANON_KIT_COMMENT_REASON` — arrays, default
303
324
  empty: extra directive prefixes appended to the built-in kit-mechanism
304
325
  roster (a consumer's product vocabulary). `CANON_KIT_COMMENT_SURFACE` —
@@ -352,6 +373,16 @@ each degrading to "no icebox" rather than to a wrong section when left unset. Va
352
373
 
353
374
  ## Per-component contracts
354
375
 
376
+ Each gate below owns its own section — the assertion, its fixture pair, and the
377
+ reason for any bespoke unit test beside it. The bespoke unit tests are named
378
+ together here, because a roster spread across per-gate sections is one no reader
379
+ and no oracle sees whole: `check-comment-tier.test.sh`,
380
+ `check-deprecation-task.test.sh`, `check-docs-link-convention.test.sh`,
381
+ `check-knob-citation.test.sh`, `check-knob-default-coupling.test.sh`,
382
+ `check-manifest-count.test.sh`, `check-md-refs.test.sh`,
383
+ `check-prose-enum.test.sh`, `check-spec-dod-singleton.test.sh` and
384
+ `check-tracking-claim.test.sh`.
385
+
355
386
  ### lib/spec.sh
356
387
 
357
388
  The sourced config loader plus shared adapters — values and adapters only,
@@ -367,7 +398,24 @@ same shapes:
367
398
  never disagree on the set — and a done slug for a bare-slug bullet outside
368
399
  them; the single grammar `check-todo-task-liveness`
369
400
  and `check-deprecation-task` resolve a `task: <slug>` binding through (each
370
- caller builds its own live/done map and fail-closes on the walk status).
401
+ caller builds its own live/done map and fail-closes on the walk status). That
402
+ walk's bullet lead-line predicate is re-implemented here rather than sourced,
403
+ making canon-kit one of the format's independent holders under the
404
+ re-implement-and-cite-from-both-ends rule
405
+ (queue-kit/SPEC.md §The queue format); the holder census and the residue it
406
+ leaves live at gate-sdk/SPEC.md §check-gate-exemption-tasks.
407
+ - **The governed comment surface:** `spec_comment_surface` and
408
+ `spec_comment_surface_with_templates` — the one corpus primitive
409
+ `check-spec-pointer`, `check-comment-tier`, `check-todo-task-liveness` and
410
+ `check-deprecation-task` all call, the pair differing only in whether
411
+ `templates/` sources are pruned. Its file set spans **both gate declaration
412
+ spellings and the ported implementation**: `*.sh`, the `*.gate` descriptor,
413
+ and `*.rs`. Stated once here rather than at each of the four callers, since a
414
+ gate whose rule became a compiled subcommand must not have its `# spec:`
415
+ pointer, its comment tier, or a `TODO(task:)` marker silently drop out of
416
+ coverage — the widening is made at the shared primitive so no caller can
417
+ inherit a narrower corpus than its siblings
418
+ (gate-sdk/SPEC.md §Meta-gate conservation for the binary substrate).
371
419
  - **Finders:** the canonical-spec / amendment finders the spec-scanning gates
372
420
  share, and the manifest-set finder the narration-gate family shares —
373
421
  canonical specs plus `README.md`/`CLAUDE.md`, amendments excluded — so its
@@ -389,17 +437,30 @@ same shapes:
389
437
  matches the same total shapes — including a total whose cardinal and noun
390
438
  straddle a prose wrap, reported at the cardinal's physical line. The boundary
391
439
  rule and the mechanical exemptions live in one shared fragment, so no sibling
392
- drifts from another in what it counts as a total (§check-manifest-count).
440
+ drifts from another in what it counts as a total (§check-manifest-count). That
441
+ boundary guards a prose **noun** against gluing to a following word ("gate"
442
+ inside "gatekeepers") — a different rule from the enum matcher's **identifier**
443
+ boundary (§check-prose-enum), which the two once spelled alike and only
444
+ half-alike at that. English nouns do not compound across underscores, so the
445
+ noun rule stays as it is; the shared spelling was never a shared rule.
393
446
  - **The enum sets** arrive through the consumer's `CANON_KIT_ENUM_SETS_CMD`,
394
447
  validated and fail-closing (exit 2) on a command error or an unparsable line
395
448
  (§check-prose-enum).
396
- - **The install transports** arrive the same way, through
397
- `CANON_KIT_INSTALL_TRANSPORTS_CMD`, and `spec_install_transports` carries the
449
+ - **The claim vocabularies** arrive the same way, through
450
+ `spec_claim_vocabulary <command> <label>` — one loader for every
451
+ `<id>`⇥`<ERE>` vocabulary a claim gate reads, taking the command as an
452
+ argument rather than from one named knob so a second claim axis costs a caller
453
+ and not a second copy. It carries the
398
454
  same fail-closed contract its enum-set sibling does — a command error, an
399
- unparsable line, an id that is not slug-shaped, or a repeated id is exit 2. The
400
- duplicate check is what a bare emit grammar cannot express and the gate needs:
401
- two lines claiming one id would give a transport two patterns and make its
402
- match order arbitrary (§check-install-claim).
455
+ unparsable line, an id that is not slug-shaped, or a repeated id is exit 2 —
456
+ and the `<label>` it is given names the failing vocabulary in every message,
457
+ so a fail-closed exit still says which one failed. The duplicate check is what
458
+ a bare emit grammar cannot express and both gates need: two lines claiming one
459
+ id would give a class two patterns and make its match order arbitrary. Its
460
+ callers are `spec_install_transports`, over
461
+ `CANON_KIT_INSTALL_TRANSPORTS_CMD` (§check-install-claim), and
462
+ `check-payload-claim` directly, over `CANON_KIT_PAYLOAD_CLAIMS_CMD`
463
+ (§check-payload-claim).
403
464
  - **The comment-surface adapters:** the comment gates read *different* surfaces.
404
465
  `check-spec-pointer` scans the template-pruned surface — a template's `spec:`
405
466
  line is an unresolvable-by-design placeholder (§check-spec-pointer);
@@ -606,8 +667,25 @@ Set declarations are consumer config, never gate literals (the provenance seam):
606
667
  emitting one `<set-name>`⇥`<member>` line per member, loaded through
607
668
  `spec_enum_sets` (§lib/spec.sh); a command that fails or a line that does not
608
669
  parse is fail-closed (exit 2). A member matches word-bounded — bracketed
609
- (`[spec:]`) or bare (`spec`), neither an alphanumeric nor a hyphen abutting, so a
610
- stem never matches inside a longer tag — and the attested drift used bare stems.
670
+ (`[spec:]`) or bare (`spec`), neither an alphanumeric, a hyphen, nor an
671
+ underscore abutting, so a stem never matches inside a longer tag, and an
672
+ **underscore-separated identifier never reads as present inside a longer
673
+ sibling**: `guard_allow` is named by "the `guard_allow` helper" and not by "the
674
+ `guard_allow_match` pair", which is what a reader means by both sentences. A
675
+ member that falsely reads as present is one the gate stops asking about, so the
676
+ paragraph omitting it reports clean — the silent direction, and the reason the
677
+ class holds the whole identifier rather than most of it. `.` and `/` stay
678
+ *outside* the class deliberately, and that is what makes the identifier reading
679
+ exactly one character wide: a basename member matches prose spelling the file
680
+ kit-relative, repo-relative or bare (below), which admitting either would break.
681
+ The attested drift used bare stems.
682
+ The grammar stays two fields. A third, scoping a set to a whole file rather than
683
+ a paragraph, was weighed against a **cross-document** absence — members spread
684
+ over per-section prose, which a paragraph-scoped judge structurally cannot see —
685
+ and refused: it changes a wire grammar whose fail-closed rule rejects a third
686
+ field, and a document-scoped completeness test has a far worse false-positive
687
+ profile, since any mention anywhere satisfies it. Reshaping such prose into a
688
+ roster the paragraph judge can read closes the same case with no grammar change.
611
689
 
612
690
  The scanned set and the paragraph walk are the shared `spec_manifest_files`
613
691
  finder and `spec_manifest_walk_awk` driver (§lib/spec.sh); this gate's
@@ -637,12 +715,50 @@ two roles are separate sets because a paragraph naming one role's tags is not
637
715
  enumerating the other. A set a consumer can only hand-list is that consumer's
638
716
  own drift to own; the kit contract asks only for the emit grammar.
639
717
 
718
+ The same emitter adds two roster families over the kit tree, one set per kit
719
+ root: a `<kit>-lib` set of the tracked top-level `lib/*.sh` basenames and a
720
+ `<kit>-gate-test` set of the tracked top-level `gate-tests/*.test.sh` basenames,
721
+ with the roots read from `gate_kit_roots_rel` (gate-sdk/SPEC.md §lib/gate.sh) so
722
+ the sets cannot enumerate a tree the battery does not. A new kit, lib or unit
723
+ test enrols with no edit, which is the property a hand correction per stale
724
+ roster would not have. Members are basenames rather than paths because a
725
+ basename matches prose spelling the file kit-relative, repo-relative or bare —
726
+ the boundary rule above accepts the leading slash. The families fail closed
727
+ where an empty result contradicts the shape they read (no kit roots at all, or a
728
+ `lib/` tracking no top-level `*.sh`) and stay silent where emptiness is real: a
729
+ `gate-tests/` holding only `good/`+`bad/` fixture directories ships no bespoke
730
+ unit test, and that is a normal kit.
731
+
732
+ Two further families — a per-lib set of its function names, and a per-lib set of
733
+ the files sourcing it — were derived, measured against this tree and refused;
734
+ the reason is recorded so neither is re-minted. Both fail on one property: a
735
+ lib's functions and its sourcers are a vocabulary prose *discusses*, not a set
736
+ prose *rosters*, so the set-difference is real while the finding is false. The
737
+ function family reported an omission at every passage explaining how two helpers
738
+ interact, none of them a roster — the measurement that is dispositive on its own,
739
+ and the one that produced the rule this paragraph ends on. The refusal rests on
740
+ that ground alone. It rests **not at all** on the matcher, which bounds an
741
+ identifier on the underscore too (above), so `guard_allow` is absent from a
742
+ paragraph naming only `guard_allow_match`: a refusal resting partly on a broken
743
+ matcher would invite exactly the wrong inference — fix the matcher, re-mint the
744
+ family. That matcher defect was sighted while measuring this very family, which
745
+ is where the identifier boundary rule came from and why the family is named here
746
+ as its origin rather than as a second reason to refuse.
747
+ The caller family's one intended site is a caller roster written as narrative, which
748
+ the hand-list adjacency rule correctly declines to judge, so it was inert there
749
+ while still firing falsely on a README row naming two of a kit's tools. The rule
750
+ the pair teaches: declare a derived set when the tree shape it reads is one the
751
+ prose rosters — a layout is such a shape, an incidental relation is not.
752
+
640
753
  Calibration follows the count gate's procedure: tuned against this tree, every
641
754
  hit dispositioned — cite the set, complete the list, or site-exempt with reason.
642
755
  The good/bad pair covers a bare comma hand list dropping a member and the
643
756
  marked-subset cases; `check-prose-enum.test.sh` covers the config-driven paths
644
757
  (the empty-default skip, the fail-closed escapes, bracketed matching, multi-set
645
- independence, the exempt escapes) the pair cannot reach. `precommit` tier.
758
+ independence, the exempt escapes, and the identifier boundary's prefix-sibling
759
+ pair) the pair cannot reach — the boundary case needs a declared set holding
760
+ underscore members, which is a config no pair running on the consumer's own
761
+ hyphenated sets can supply. `precommit` tier.
646
762
 
647
763
  ### check-knob-citation
648
764
 
@@ -785,7 +901,9 @@ topology exists). `align-only` tier.
785
901
 
786
902
  Invariant: every full-line comment on a governed source is one of — a
787
903
  machine directive (a comment a tool parses: `graph:`, `shellcheck`,
788
- `contract:`), a reason directive (a spec pointer, usage synopsis, or
904
+ `contract:`, `smoke-unregistered:` — the last read by
905
+ `run-consumer-smoke.sh` off a kit's vendored `smoke/install.sh`, gate-sdk/SPEC.md
906
+ §Consumer smoke), a reason directive (a spec pointer, usage synopsis, or
789
907
  positional justification: `spec:`, `usage:`, `exception-list:`,
790
908
  `no-fixture:`, `assertion`, `permanent:`, `TODO(task:`,
791
909
  `TODO(spec-ambiguity)`, which blesses a bounded window — its own line plus
@@ -810,6 +928,16 @@ second copy no gate reads. `comment-tier-exempt: <reason>` is the honest
810
928
  directive for a genuinely-local fact below SPEC altitude that neither tier
811
929
  owns.
812
930
 
931
+ The governed-source corpus reaches the **implementation of a ported gate**, not
932
+ just shell — `spec_comment_surface_with_templates` (§lib/spec.sh), which owns
933
+ the file set. This is the load-bearing half of the reader
934
+ partition gate-sdk/SPEC.md §The `# graph:` manifest states — locality-class
935
+ directives bind to a line of implementation and therefore stay there, so the
936
+ tier rule has to follow them across the substrate or go dark exactly where it
937
+ still applies. A descriptor's own lines are directives by construction. Marker
938
+ matching is on the **token**, independent of the comment leader, so `//` and `#`
939
+ carry the same directives and no language earns a quieter standard.
940
+
813
941
  One shape overrides the window: a full-line comment carrying a **restated
814
942
  collection total** — the count grammar of §check-manifest-count, over the same
815
943
  `CANON_KIT_COUNT_COLLECTIONS` vocabulary — is flagged even where a directive
@@ -857,7 +985,16 @@ this gate governs them, where
857
985
  workflow directory's **tracked** members blessing only `contract:`/`see`,
858
986
  whatever their extension (the capture tier is gitignored and headerless, so
859
987
  tracking is the filter, not the suffix — gate-sdk/SPEC.md §The workflow
860
- directory);
988
+ directory). On a **markdown** member of that directory a `##`-or-deeper line is
989
+ the surface's own block grammar rather than a comment, and is read as an
990
+ ordinary content line: a workflow surface whose records *are* `## ` blocks
991
+ (lifecycle-kit/SPEC.md §The survey record) would otherwise have every record
992
+ heading flagged as untagged prose, and no tagging is available that would not
993
+ put a directive inside the data. The narrowing costs no coverage — the member's
994
+ `# contract:` header is still classified here, and its tier and header payload
995
+ are `check-workflow-tiering`'s (gate-sdk/SPEC.md §The workflow directory) — and
996
+ it is deliberately extension-scoped rather than content-sniffed, so a `.txt`
997
+ data member's `#` lines stay comments;
861
998
  slash-comment parsing (`//`, `/* */`, doc-comments, heredoc skipping) ships
862
999
  as mechanism and activates when a consumer widens `CANON_KIT_COMMENT_SURFACE`
863
1000
  to a language that needs it. Positional rescue is language-agnostic — its
@@ -878,8 +1015,14 @@ pointer **directive** on a governed source resolves, and every free-prose
878
1015
  directive set is exactly what `check-comment-tier` blesses by shape: full-line
879
1016
  `spec:` / `contract:` comments on the governed sources, plus the `# contract:`
880
1017
  headers on the workflow directory's **tracked** members (gate-sdk/SPEC.md §The
881
- workflow directory owns that tier; a version-marker payload resolves as no path
882
- and rides `CANON_KIT_COMMENT_WHITELIST`). A directive's target grammar is
1018
+ workflow directory owns that tier). That section rules two `contract:` payloads,
1019
+ and this gate honours both: a **version-marker** payload (`<format-name> v<N>`,
1020
+ matched on that section's own anchored shape, and only after `contract:` — a
1021
+ `spec:` directive wearing the shape still resolves as a path) is a wire-format
1022
+ version its owning gate parses, so it names no path, resolves as none, and is
1023
+ counted on the clean line rather than skipped silently. Discriminating it here is
1024
+ what keeps the form usable without a per-consumer whitelist entry. A directive's
1025
+ target grammar is
883
1026
  `<path> [§<heading>]`: `<path>` (repo-relative) must be a tracked file, and when
884
1027
  a `§<heading>` fragment is present the file must carry a matching markdown
885
1028
  heading; a pointer without `§` resolves file-only. Reddens on a missing or
@@ -1160,13 +1303,17 @@ gate body, config, a directory: files the site does not render — cites the tre
1160
1303
  with an absolute GitHub blob link
1161
1304
  `https://<host>/<owner>/<repo>/blob/<ref>/<path>[#anchor]`, anchored when it
1162
1305
  names a section, because a relative link into the unrendered surrounding tree
1163
- would 404 on a site that serves `docs/` alone. Both are the downward-citation
1164
- shape of the tiering topology, one on-site and one off. Resolution of the blob
1165
- form belongs to `check-md-refs`' self-repo pass (identity derivation and the
1166
- ref knob live there); `check-docs-link-convention` owns the shape of the
1167
- relative links that stay inside `docs/`. The mirror is what a site opts into,
1168
- not a precondition of the grammar: absent a published mirror, rendered-document
1169
- references fall back to the same off-site blob form as source references.
1306
+ would 404 on a site that serves `docs/` alone. **That prescription is held by
1307
+ `check-docs-link-convention`'s off-root rule** (§check-docs-link-convention
1308
+ below): a relative link whose target resolves outside the site root is a
1309
+ violation, so the requirement above is enforced rather than merely stated.
1310
+ Both are the downward-citation shape of the tiering topology, one on-site and
1311
+ one off. Resolution of the blob form belongs to `check-md-refs`' self-repo pass
1312
+ (identity derivation and the ref knob live there); `check-docs-link-convention`
1313
+ owns the shape of the relative links that stay inside `docs/`. The mirror is
1314
+ what a site opts into, not a precondition of the grammar: absent a published
1315
+ mirror, rendered-document references fall back to the same off-site blob form
1316
+ as source references.
1170
1317
 
1171
1318
  ### check-docs-link-convention
1172
1319
 
@@ -1187,6 +1334,20 @@ there:
1187
1334
  back to that same kit's own `README.md` or `SPEC.md` must carry a `#section`
1188
1335
  anchor. A page cites downward into a *named* section, never at the whole spec —
1189
1336
  the anti-restatement doctrine expressed as a link shape.
1337
+ - **No off-root relative link.** A relative link whose target *resolves* to an
1338
+ existing path outside `CANON_KIT_LINK_ROOT` must instead cite the absolute
1339
+ self-repo blob form (§The reference-link grammar). The rule turns on the
1340
+ resolved path, not the link text, so a `../`-prefixed link that resolves back
1341
+ under the root is silent. Only resolving targets are classified — a relative
1342
+ target that resolves to nothing is `check-md-refs`' finding alone, and this
1343
+ rule does not double-report it; a directory target outside the root still
1344
+ satisfies the first rule's predicate first and is reported there, once.
1345
+ Anchors and absolute URLs never fire, by the gate's existing scope. Generated
1346
+ mirror pages (`generated: true` front matter) are in scope, deliberately: their
1347
+ off-root conformance is a property of the generator that emits them, which is a
1348
+ thing that can regress, and exempting them would blind the corpus's larger half.
1349
+ The existing `docs-link-exempt: <reason>` valve suppresses this rule as it does
1350
+ the other two — no second valve.
1190
1351
 
1191
1352
  The scanned tree is `CANON_KIT_LINK_ROOT` (default `docs`; the fixture pair
1192
1353
  overrides it with a positional arg pointing at a synthetic tree), walked for
@@ -1264,6 +1425,19 @@ per transport through `CANON_KIT_INSTALL_TRANSPORTS_CMD`, loaded by
1264
1425
  `spec_install_transports` (§lib/spec.sh) — because a kit literal spelling a
1265
1426
  transport publishes one project's distribution model as a kit fact.
1266
1427
 
1428
+ **Where this gate ends and §check-payload-claim begins.** The two answer
1429
+ different questions and share only the vocabulary loader. This one is
1430
+ **positional and install-section-scoped**: naming a secondary transport is
1431
+ correct prose, so what it judges is which transport a selected section *leads*
1432
+ with. Its sibling is **membership over the whole governed document**, because a
1433
+ disclosure class other than the declared one has no correct-but-secondary form —
1434
+ it is wrong wherever it appears. The scopes do not coincide either, so neither
1435
+ gate is the other's second assertion pair: an install section under this repo's
1436
+ section regex is not where the disclosure claim is ruled, and folding a
1437
+ whole-document membership rule into a section-scoped positional gate would make
1438
+ this gate's name false and give one gate two unrelated calibrations to reason
1439
+ about on a red.
1440
+
1267
1441
  The scanned set is `check-md-refs`' governed doc set (the manifest set minus
1268
1442
  `CANON_KIT_MDREF_EXCLUDE`) minus `CANON_KIT_INSTALL_CLAIM_EXCLUDE`. Two
1269
1443
  assertions:
@@ -1326,6 +1500,84 @@ select, and a published note the path valve keeps out of the scanned set. The
1326
1500
  `# graph:` manifest couples the gate to the doc set and `scripts/*.sh`, so a
1327
1501
  transport rename re-fires it over the docs. `precommit` tier.
1328
1502
 
1503
+ ### check-payload-claim
1504
+
1505
+ Invariant: exactly one governed doc declares what a gate on the vendored payload
1506
+ discloses, and no scanned governed doc asserts a different disclosure class. Two
1507
+ assertions: (A) **singleton owner** — exactly one declaration exists across the
1508
+ scanned set; (B) **no contradicting assertion** — no scanned line matches the
1509
+ pattern of a class other than the declared one.
1510
+
1511
+ The claim's machine-readable owner is a full-line
1512
+ `<!-- payload-discloses: <claim-id> -->` HTML comment, the same
1513
+ tier-beside-the-prose shape §check-install-claim uses and for the same reason:
1514
+ the reader-facing form of this claim already exists as prose and must stay prose.
1515
+ It belongs in the section that rules the fact, which in this repo is
1516
+ gate-sdk/SPEC.md §Consumer payload. The disclosure vocabulary is consumer config
1517
+ — one `<claim-id>`⇥`<ERE>` line per class through
1518
+ `CANON_KIT_PAYLOAD_CLAIMS_CMD`, loaded by `spec_claim_vocabulary` (§lib/spec.sh)
1519
+ — because a spelling of what a payload discloses is one project's distribution
1520
+ model, and a kit literal carrying one would publish it. The scanned set is
1521
+ `check-md-refs`' governed doc set (the manifest set minus
1522
+ `CANON_KIT_MDREF_EXCLUDE`) minus `CANON_KIT_PAYLOAD_CLAIM_EXCLUDE` — the same
1523
+ composition its sibling uses, so a consumer configures one scanned-set idiom
1524
+ rather than two.
1525
+
1526
+ **Assertion A.** Zero declarations is the defect the gate exists for: nothing
1527
+ owns the claim, so an unbounded number of surfaces drift with nothing watching,
1528
+ and no reader can tell which surface is the one to believe. Two owners is that
1529
+ same defect wearing a different shape. A `<claim-id>` outside the configured
1530
+ vocabulary is **fail-closed (exit 2)** rather than a violation — with no
1531
+ resolvable declared class the gate holds nothing to compare a line against, so
1532
+ it must not run rather than pass.
1533
+
1534
+ **Assertion B.** Across each scanned document, any line matching the pattern of a
1535
+ class other than the declared one is a violation, wherever in the document it
1536
+ sits. Membership rather than position, because a non-declared disclosure class
1537
+ has no correct secondary form. The declaration line itself is skipped, since a
1538
+ claim is not evidence for itself. Fenced content is scanned, because a quoted
1539
+ recipe is exactly where a disclosure claim shows up in passing. The report names
1540
+ the offending class, because "wrong disclosure class" alone would leave the
1541
+ reader grepping.
1542
+
1543
+ **The declared class's own pattern is latent rather than unread.** Assertion B
1544
+ matches only the classes that are *not* declared, so the declared one's pattern
1545
+ does no work while it holds the declaration — and starts doing it the moment the
1546
+ declaration moves to another class. The vocabulary is a set of classes, not a set
1547
+ of live matchers, so a class is emitted with its pattern whether or not it is
1548
+ currently the declared one.
1549
+
1550
+ **One claim axis rather than a claim registry.** The shape behind this gate and
1551
+ its sibling — a declared owner, an id vocabulary, a scanned corpus — invites a
1552
+ registry keyed by claim name. Refused for now, with the reason recorded so it is
1553
+ not re-derived: one axis exists, this gate and its sibling already share the only
1554
+ piece worth sharing (the vocabulary loader), and a registry would mint an
1555
+ axis-name knob and an indirection to hold a single member. The refusal is cheap to reverse — a
1556
+ second axis is the trigger, and both gates would collapse into the registry with
1557
+ their vocabularies unchanged.
1558
+
1559
+ **Honest limits.** The gate is only as sharp as the emitted patterns, and a
1560
+ loosely-written one wins matches by accident — the same consumer-owned drift
1561
+ §check-install-claim states, since the kit contract asks for the emit grammar and
1562
+ never for the patterns. A claim phrased in a shape no emitted pattern recognizes
1563
+ is out of reach; what the gate converts is an unbounded prose corpus into a
1564
+ checkable one, not an English-language reader. And the scanned set is the
1565
+ manifest set, so a claim made on a surface the consumer has not brought into that
1566
+ set stays unheld.
1567
+
1568
+ Producer: the maintainer editing the section that rules the fact, plus the
1569
+ consumer's disclosure command; both are live tracked configuration in this repo,
1570
+ not fixture-only. Consumer: the committing operator via the output contract, and
1571
+ both assertions read the declaration's one field — at the membership check, at
1572
+ the declared-versus-other comparison, and in the violation report.
1573
+
1574
+ The good/bad pair covers the reintroduction path itself — one corrected sentence
1575
+ restored verbatim to its original overclaiming form — beside the near-miss
1576
+ sentences the pattern boundary must stay silent on and a published dated note the
1577
+ path valve keeps out of the scanned set. The `# graph:` manifest couples the gate
1578
+ to the governed doc set and `scripts/*.sh`, so an edit to a claim surface or to
1579
+ the vocabulary re-fires it. `precommit` tier.
1580
+
1329
1581
  ### check-prose-tells
1330
1582
 
1331
1583
  The mechanical subset of the AI-prose tells — the machine-detectable patterns
@@ -1386,7 +1638,10 @@ by `check-prose-tells` at scan time and no other component.
1386
1638
 
1387
1639
  ### templates/
1388
1640
 
1389
- `canon-config.sh` — the consumer config template documenting every knob.
1641
+ `canon-config.sh` — the consumer config template: a two-line `# spec:` pointer
1642
+ to the §Layout and configuration knob table, so the table stays the one owner
1643
+ of the knob roster rather than a parallel copy in the template drifting
1644
+ against it.
1390
1645
  `SPEC-amendment.md` — the amendment skeleton: delta sections plus the
1391
1646
  Definition-of-Done checklist (causal completeness, no information lost on
1392
1647
  merge, amendment deleted, none remaining, gaps filed as debt).
@@ -52,7 +52,7 @@ join_alt() { # a '|'-joined ERE alternation of bracket-escaped literals
52
52
  # spec: canon-kit/SPEC.md §check-comment-tier — the built-in kit-mechanism roster
53
53
  # (Checkwright's own directive names); the CANON_KIT_COMMENT_* knobs append a
54
54
  # consumer's extras.
55
- shell_colon=(graph: spec: contract: usage: exception-list: no-fixture: permanent: comment-tier-exempt: "TODO(task:" "TODO(spec-ambiguity)")
55
+ shell_colon=(graph: spec: contract: usage: exception-list: no-fixture: permanent: smoke-unregistered: comment-tier-exempt: "TODO(task:" "TODO(spec-ambiguity)")
56
56
  # shellcheck disable=SC2034 # nameref-consumed by build_bless
57
57
  shell_word=(shellcheck assertion)
58
58
  shell_colon+=("${CANON_KIT_COMMENT_MACHINE[@]}" "${CANON_KIT_COMMENT_REASON[@]}")
@@ -139,6 +139,8 @@ STYLE == "hash" && hd != "" {
139
139
  flush_block(0); next
140
140
  }
141
141
  STYLE == "hash" && FNR == 1 && /^#!/ { noncomment(); next }
142
+ # a markdown data surface's '##' section heading is structure, not a comment (MDHEAD)
143
+ STYLE == "hash" && MDHEAD == 1 && /^[ \t]*##/ { noncomment(); next }
142
144
  STYLE == "hash" {
143
145
  if ($0 ~ /^[ \t]*#/) { b = $0; sub(/^[ \t]*#/, "", b); record(b) }
144
146
  else noncomment()
@@ -186,7 +188,10 @@ scanned=0
186
188
  for f in "${SURFACE[@]}"; do
187
189
  rel="${f#"$ROOT"/}"; rel="${rel#./}"
188
190
  spec_comment_whitelisted "$rel" && continue
191
+ mdhead=0
189
192
  case "$rel" in
193
+ # spec: canon-kit/SPEC.md §check-comment-tier — a workflow-dir markdown member's '##' headings are the surface's own block grammar, not comments; its '# contract:' header stays governed here and its tier stays governed by check-workflow-tiering
194
+ "${GATE_SDK_WORKFLOW_DIR:-.workflow}"/*.md) style="hash"; bless="$TXT_BLESS"; pos=""; mdhead=1 ;;
190
195
  "${GATE_SDK_WORKFLOW_DIR:-.workflow}"/*) style="hash"; bless="$TXT_BLESS"; pos="" ;;
191
196
  *.sh|*.bash) style="hash"; bless="$SHELL_BLESS"; pos="$POS_RE" ;;
192
197
  *.txt) style="hash"; bless="$TXT_BLESS"; pos="" ;;
@@ -194,7 +199,7 @@ for f in "${SURFACE[@]}"; do
194
199
  *) style="hash"; bless="$SHELL_BLESS"; pos="$POS_RE" ;;
195
200
  esac
196
201
  scanned=$((scanned + 1))
197
- out="$(awk -v STYLE="$style" -v BLESS="$bless" -v POS="$pos" -v CAP="$CANON_KIT_COMMENT_RUN_CAP" -v SQ="'" -v DQ='"' -v XRE="$EXEMPT_RE" -v SK_QRE="$COUNT_QRE" -v SK_RRE="$COUNT_RRE" -v SK_PHRASES="$COUNT_PHRASES" "$AWKSRC" "$f")"; st=$?
202
+ out="$(awk -v STYLE="$style" -v MDHEAD="$mdhead" -v BLESS="$bless" -v POS="$pos" -v CAP="$CANON_KIT_COMMENT_RUN_CAP" -v SQ="'" -v DQ='"' -v XRE="$EXEMPT_RE" -v SK_QRE="$COUNT_QRE" -v SK_RRE="$COUNT_RRE" -v SK_PHRASES="$COUNT_PHRASES" "$AWKSRC" "$f")"; st=$?
198
203
  fail_closed "$st" COMMENT-TIER "awk classifier ($rel)"
199
204
  while IFS= read -r line; do
200
205
  [[ -n "$line" ]] && errors+=("${line#"$ROOT"/}")
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bash
2
2
  # graph: couples=docs/*.md,docs/*/index.md,docs/posts/*.md dir=one valve=none tier=precommit
3
- # spec: canon-kit/SPEC.md §check-docs-link-convention — docs pages cite downward: no directory-target relative link (name the file), a kit page's back-link to its own README/SPEC carries a #section anchor
3
+ # spec: canon-kit/SPEC.md §check-docs-link-convention — docs pages cite downward: no directory-target relative link (name the file), a kit page's back-link to its own README/SPEC carries a #section anchor, no relative link to a target resolving outside the docs root
4
4
  #
5
5
  # usage: check-docs-link-convention.sh [docs-root] (default CANON_KIT_LINK_ROOT;
6
6
  # the optional arg points the fixture pair at a synthetic docs tree)
@@ -51,6 +51,11 @@ for f in "${pages[@]}"; do
51
51
  exempt "$f" "$lno" || bad+=("$f:$lno: directory-target link '$tgt' → $p/ — name the file (e.g. $tgt/index.md), not the directory")
52
52
  continue
53
53
  fi
54
+ if [[ -e "$p" && "$p" != "$ROOT"/* ]]; then
55
+ exempt "$f" "$lno" \
56
+ || bad+=("$f:$lno: off-root relative link '$tgt' → $p — resolves outside $ROOT/, so it 404s on a site served from $ROOT/ alone; cite it in the absolute self-repo blob form")
57
+ continue
58
+ fi
54
59
  if [[ -n "$kit" && -z "$anchor" ]]; then
55
60
  b="$(basename "$p")"
56
61
  [[ ( "$b" == README.md || "$b" == SPEC.md ) && "$(basename "$(dirname "$p")")" == "$kit" ]] \
@@ -63,9 +68,11 @@ if [[ ${#bad[@]} -gt 0 ]]; then
63
68
  echo "check-docs-link-convention: docs page link(s) break a shape convention (resolution is check-md-refs' job; this gate owns shape):"
64
69
  printf ' %s\n' "${bad[@]}"
65
70
  echo " help: name the file a directory link points at (kit/index.md, not kit/); give a kit page's"
66
- echo " back-link to its own README/SPEC a #section anchor. Per-site valve: a 'docs-link-exempt:"
67
- echo " <reason>' HTML comment on the link line or the one above."
71
+ echo " back-link to its own README/SPEC a #section anchor; cite a target outside the docs"
72
+ echo " root with the absolute self-repo blob form (canon-kit/SPEC.md §The reference-link"
73
+ echo " grammar) rather than relatively. Per-site valve: a 'docs-link-exempt: <reason>'"
74
+ echo " HTML comment on the link line or the one above."
68
75
  exit 1
69
76
  fi
70
- echo "DOCS-LINK-CONVENTION: clean (${#pages[@]} docs page(s), $links relative link(s); no directory target, kit back-links anchored)"
77
+ echo "DOCS-LINK-CONVENTION: clean (${#pages[@]} docs page(s), $links relative link(s); no directory target, kit back-links anchored, no off-root relative target)"
71
78
  exit 0
@@ -0,0 +1,133 @@
1
+ #!/usr/bin/env bash
2
+ # graph: couples=*SPEC*.md,*README.md,CLAUDE.md,SECURITY.md,docs/*.md,scripts/*.sh dir=one valve=none tier=precommit
3
+ # spec: canon-kit/SPEC.md §check-payload-claim — exactly one governed doc declares what a gate on the vendored payload discloses, and no scanned governed doc asserts a different disclosure class
4
+ #
5
+ # usage: check-payload-claim.sh [scan-root] (default '.')
6
+ # Scans the manifest set (lib/spec.sh) minus CANON_KIT_MDREF_EXCLUDE and
7
+ # CANON_KIT_PAYLOAD_CLAIM_EXCLUDE. Unconfigured claim vocabulary: no-op.
8
+ set -uo pipefail
9
+
10
+ KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
11
+ SDK="${GATE_SDK_ROOT:-$KIT/../gate-sdk}"
12
+ # shellcheck source=../../gate-sdk/lib/gate.sh
13
+ source "$SDK/lib/gate.sh"
14
+ # shellcheck source=../lib/spec.sh
15
+ source "$KIT/lib/spec.sh"
16
+
17
+ ROOT="${1:-.}"
18
+ [[ -d "$ROOT" ]] || { echo "check-payload-claim: not a directory: $ROOT" >&2; exit 2; }
19
+
20
+ # spec: canon-kit/SPEC.md §check-payload-claim — the disclosure vocabulary is consumer config with no kit default, so an empty command is the clean skip for a tree whose payload discloses one thing only
21
+ if [[ -z "$CANON_KIT_PAYLOAD_CLAIMS_CMD" ]]; then
22
+ echo "PAYLOAD-CLAIM: clean (no disclosure vocabulary configured — nothing to hold)"
23
+ exit 0
24
+ fi
25
+
26
+ claims="$(spec_claim_vocabulary "$CANON_KIT_PAYLOAD_CLAIMS_CMD" CANON_KIT_PAYLOAD_CLAIMS_CMD)"; st=$?
27
+ fail_closed "$st" check-payload-claim "CANON_KIT_PAYLOAD_CLAIMS_CMD"
28
+ [[ -n "$claims" ]] || { echo "PAYLOAD-CLAIM: clean (CANON_KIT_PAYLOAD_CLAIMS_CMD declared no disclosure classes)"; exit 0; }
29
+
30
+ excluded() {
31
+ local rel="$1" g
32
+ for g in "${CANON_KIT_MDREF_EXCLUDE[@]+"${CANON_KIT_MDREF_EXCLUDE[@]}"}" \
33
+ "${CANON_KIT_PAYLOAD_CLAIM_EXCLUDE[@]+"${CANON_KIT_PAYLOAD_CLAIM_EXCLUDE[@]}"}"; do
34
+ # shellcheck disable=SC2053 # $g is the exclude glob, matched unquoted on purpose
35
+ [[ "$rel" == $g ]] && return 0
36
+ done
37
+ return 1
38
+ }
39
+
40
+ files=()
41
+ while IFS= read -r f; do
42
+ rel="${f#./}"; rel="${rel#"$ROOT"/}"
43
+ excluded "$rel" || files+=("$f")
44
+ done < <(spec_manifest_files "$ROOT" | sort -u)
45
+ [[ ${#files[@]} -eq 0 ]] && { echo "PAYLOAD-CLAIM: clean (0 governed doc(s) found)"; exit 0; }
46
+
47
+ DECL_RE='^[[:space:]]*<!--[[:space:]]*payload-discloses:[[:space:]]*([a-z0-9][a-z0-9-]*)[[:space:]]*-->[[:space:]]*$'
48
+
49
+ decls="$(grep -nE "$DECL_RE" -- "${files[@]}" /dev/null)"; st=$?
50
+ [[ $st -le 1 ]] || { echo "check-payload-claim: grep failed scanning the governed doc set" >&2; exit 2; }
51
+
52
+ ndecl=0
53
+ [[ -n "$decls" ]] && ndecl="$(printf '%s\n' "$decls" | wc -l)"
54
+
55
+ # assertion A: exactly one governed doc declares the disclosure class
56
+ if [[ "$ndecl" -eq 0 ]]; then
57
+ echo "check-payload-claim: no governed doc declares what the vendored payload discloses:"
58
+ echo " 0 'payload-discloses:' declarations across ${#files[@]} governed doc(s)"
59
+ echo " help: an unowned disclosure claim is how an unbounded number of surfaces drift into"
60
+ echo " promising the consumer something else, with nothing watching. Put one full-line"
61
+ echo " '<!-- payload-discloses: <claim-id> -->' in the section that rules the fact,"
62
+ echo " naming a class CANON_KIT_PAYLOAD_CLAIMS_CMD emits."
63
+ exit 1
64
+ fi
65
+ if [[ "$ndecl" -gt 1 ]]; then
66
+ echo "check-payload-claim: the payload-disclosure claim has $ndecl owners; exactly one is required:"
67
+ printf '%s\n' "$decls" | sed 's/^/ /'
68
+ echo " help: keep the declaration in the section that rules the fact and delete the others;"
69
+ echo " two owners is the same unowned-claim defect wearing a different shape."
70
+ exit 1
71
+ fi
72
+
73
+ decl_site="${decls%%:*}"
74
+ decl_line="$(printf '%s\n' "$decls" | cut -d: -f2)"
75
+ declared="$(printf '%s\n' "$decls" | sed -E "s/.*payload-discloses:[[:space:]]*([a-z0-9][a-z0-9-]*).*/\1/")"
76
+
77
+ # spec: canon-kit/SPEC.md §check-payload-claim — an id outside the configured vocabulary is fail-closed, not a violation: with no resolvable declared class the gate holds nothing to compare a line against, so it must not run rather than pass
78
+ if ! printf '%s\n' "$claims" | cut -f1 | grep -qxF -- "$declared"; then
79
+ echo "check-payload-claim: declared class '$declared' ($decl_site:$decl_line) is not a configured disclosure class:" >&2
80
+ printf '%s\n' "$claims" | cut -f1 | sed 's/^/ /' >&2
81
+ exit 2
82
+ fi
83
+
84
+ export SK_CLAIMS="$claims"
85
+ export SK_DECLARED="$declared"
86
+ export SK_DECL_RE="$DECL_RE"
87
+
88
+ # assertion B: no scanned line asserts a disclosure class other than the declared one
89
+ # spec: canon-kit/SPEC.md §check-payload-claim — membership over the whole document rather than position inside a section: a non-declared class is wrong wherever it appears. Fenced content is scanned, because a quoted recipe is exactly where a disclosure claim shows up in passing; the declaration line is skipped, since a claim is not evidence for itself.
90
+ read -r -d '' AWKSRC <<'AWK' || true
91
+ BEGIN {
92
+ n = split(ENVIRON["SK_CLAIMS"], cl, "\n")
93
+ for (i = 1; i <= n; i++) {
94
+ if (cl[i] == "") continue
95
+ tp = index(cl[i], "\t")
96
+ cid = substr(cl[i], 1, tp - 1)
97
+ if (cid == ENVIRON["SK_DECLARED"]) continue
98
+ nc++
99
+ oid[nc] = cid
100
+ ore[nc] = substr(cl[i], tp + 1)
101
+ }
102
+ declre = ENVIRON["SK_DECL_RE"]
103
+ }
104
+ {
105
+ if ($0 ~ declre) next
106
+ for (i = 1; i <= nc; i++) {
107
+ if ($0 !~ ore[i]) continue
108
+ printf " %s:%d: asserts '%s', not the declared '%s'\n", \
109
+ FILENAME, FNR, oid[i], ENVIRON["SK_DECLARED"]
110
+ break
111
+ }
112
+ }
113
+ END { printf "%d other class(es) held\n", nc }
114
+ AWK
115
+
116
+ out="$(awk "$AWKSRC" "${files[@]}")"; st=$?
117
+ fail_closed "$st" check-payload-claim awk
118
+
119
+ findings="$(printf '%s\n' "$out" | grep '^ ' || true)"
120
+ held="$(printf '%s\n' "$out" | tail -n1)"
121
+
122
+ if [[ -n "$findings" ]]; then
123
+ echo "check-payload-claim: a governed doc asserts a disclosure class the declared claim does not name:"
124
+ printf '%s\n' "$findings"
125
+ echo " help: correct the sentence to the declared class, or move the declaration"
126
+ echo " ($decl_site:$decl_line) to the class the payload actually discloses."
127
+ echo " The declared class is what the payload ships; every other class is wrong"
128
+ echo " wherever it appears, whichever section it sits in."
129
+ exit 1
130
+ fi
131
+
132
+ echo "PAYLOAD-CLAIM: clean (${#files[@]} governed doc(s), $held; '$declared' declared at $decl_site:$decl_line, and no scanned line asserts another class)"
133
+ exit 0