checkwright 0.25.0 → 0.26.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 (1025) hide show
  1. package/README.md +35 -1361
  2. package/bin/checkwright.ps1 +157 -0
  3. package/bin/checkwright.sh +187 -44
  4. package/package.json +15 -14
  5. package/payload/artifact/aarch64-apple-darwin/checkwright-gates +0 -0
  6. package/payload/artifact/aarch64-apple-darwin/checkwright-gates.sha256 +1 -0
  7. package/payload/artifact/aarch64-pc-windows-msvc/checkwright-gates.exe +0 -0
  8. package/payload/artifact/aarch64-pc-windows-msvc/checkwright-gates.exe.sha256 +1 -0
  9. package/payload/artifact/aarch64-unknown-linux-gnu/checkwright-gates +0 -0
  10. package/payload/artifact/aarch64-unknown-linux-gnu/checkwright-gates.sha256 +1 -0
  11. package/payload/artifact/targets.list +120 -24
  12. package/payload/artifact/x86_64-apple-darwin/checkwright-gates +0 -0
  13. package/payload/artifact/x86_64-apple-darwin/checkwright-gates.sha256 +1 -0
  14. package/payload/artifact/x86_64-pc-windows-msvc/checkwright-gates.exe +0 -0
  15. package/payload/artifact/x86_64-pc-windows-msvc/checkwright-gates.exe.sha256 +1 -0
  16. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates +0 -0
  17. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates.sha256 +1 -1
  18. package/payload/canon-kit/README.md +23 -37
  19. package/payload/canon-kit/checks/check-amendment-queue.gate +2 -2
  20. package/payload/canon-kit/checks/check-amendment-retired-spelling.gate +3 -0
  21. package/payload/canon-kit/checks/check-amendment-update-target.gate +1 -1
  22. package/payload/canon-kit/checks/check-comment-tier.gate +1 -1
  23. package/payload/canon-kit/checks/check-deprecation-task.gate +2 -1
  24. package/payload/canon-kit/checks/check-docs-cmd.gate +2 -2
  25. package/payload/canon-kit/checks/check-docs-link-convention.gate +1 -1
  26. package/payload/canon-kit/checks/check-docs-restatement-parity.gate +4 -0
  27. package/payload/canon-kit/checks/check-fence-command-head.gate +3 -0
  28. package/payload/canon-kit/checks/check-fence-run.gate +3 -0
  29. package/payload/canon-kit/checks/check-install-claim.gate +2 -1
  30. package/payload/canon-kit/checks/check-knob-citation.gate +1 -1
  31. package/payload/canon-kit/checks/check-manifest-count.gate +1 -1
  32. package/payload/canon-kit/checks/check-manifest-temporal.gate +1 -1
  33. package/payload/canon-kit/checks/check-md-refs.gate +1 -1
  34. package/payload/canon-kit/checks/check-md-unwrapped.gate +3 -0
  35. package/payload/canon-kit/checks/check-measured-claim.gate +2 -1
  36. package/payload/canon-kit/checks/check-payload-claim.gate +2 -1
  37. package/payload/canon-kit/checks/check-prose-bounds.gate +3 -0
  38. package/payload/canon-kit/checks/check-prose-enum.gate +2 -1
  39. package/payload/canon-kit/checks/check-prose-tells.gate +1 -1
  40. package/payload/canon-kit/checks/check-provenance-seam.gate +3 -0
  41. package/payload/canon-kit/checks/check-spec-derivable-section.gate +1 -1
  42. package/payload/canon-kit/checks/check-spec-dod-singleton.gate +1 -1
  43. package/payload/canon-kit/checks/check-spec-embedded-source.gate +1 -1
  44. package/payload/canon-kit/checks/check-spec-fence-balance.gate +1 -1
  45. package/payload/canon-kit/checks/check-spec-pointer.gate +2 -2
  46. package/payload/canon-kit/checks/check-surface-duplication.gate +3 -0
  47. package/payload/canon-kit/checks/check-todo-task-liveness.gate +1 -1
  48. package/payload/canon-kit/checks/check-tracking-claim.gate +1 -1
  49. package/payload/canon-kit/checks/check-unmarked-claim.gate +2 -1
  50. package/payload/canon-kit/gate-tests/check-amendment-queue/bad/SPEC-tidy.md +3 -0
  51. package/payload/canon-kit/gate-tests/check-amendment-queue/bad/TASK-QUEUE.md +37 -8
  52. package/payload/canon-kit/gate-tests/check-amendment-queue/bad/expect.txt +6 -3
  53. package/payload/canon-kit/gate-tests/check-amendment-queue/good/SPEC-widget.md +7 -0
  54. package/payload/canon-kit/gate-tests/check-amendment-queue/good/TASK-QUEUE.md +11 -3
  55. package/payload/canon-kit/gate-tests/check-amendment-retired-spelling/bad/SPEC-nosection.md +16 -0
  56. package/payload/canon-kit/gate-tests/check-amendment-retired-spelling/bad/SPEC-thing.md +26 -0
  57. package/payload/canon-kit/gate-tests/check-amendment-retired-spelling/bad/expect.txt +8 -0
  58. package/payload/canon-kit/gate-tests/check-amendment-retired-spelling/bad/surface/one.md +4 -0
  59. package/payload/canon-kit/gate-tests/check-amendment-retired-spelling/bad/surface/two.md +3 -0
  60. package/payload/canon-kit/gate-tests/check-amendment-retired-spelling/good/SPEC-tidy.md +20 -0
  61. package/payload/canon-kit/gate-tests/check-amendment-retired-spelling/good/SPEC-widget.md +37 -0
  62. package/payload/canon-kit/gate-tests/check-amendment-retired-spelling/good/component/README.md +4 -0
  63. package/payload/canon-kit/gate-tests/check-amendment-retired-spelling/good/component/SPEC.md +4 -0
  64. package/payload/canon-kit/gate-tests/check-amendment-retired-spelling/good/expect.txt +1 -0
  65. package/payload/canon-kit/gate-tests/check-amendment-retired-spelling/good/unnamed.md +4 -0
  66. package/payload/canon-kit/gate-tests/check-amendment-update-target.test.sh +1 -1
  67. package/payload/canon-kit/gate-tests/check-comment-tier/good/good.sh +1 -1
  68. package/payload/canon-kit/gate-tests/check-comment-tier.test.sh +37 -26
  69. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/TASK-QUEUE.md +3 -1
  70. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/scripts/canon-config.knobs +2 -0
  71. package/payload/canon-kit/gate-tests/check-deprecation-task/good/TASK-QUEUE.md +6 -2
  72. package/payload/canon-kit/gate-tests/check-deprecation-task/good/expect.txt +1 -1
  73. package/payload/canon-kit/gate-tests/check-deprecation-task/good/scripts/canon-config.knobs +2 -0
  74. package/payload/canon-kit/gate-tests/check-deprecation-task.test.sh +12 -10
  75. package/payload/canon-kit/gate-tests/check-docs-cmd/good/doc.md +4 -1
  76. package/payload/canon-kit/gate-tests/check-docs-cmd.test.sh +61 -0
  77. package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/expect.txt +3 -0
  78. package/payload/canon-kit/gate-tests/check-docs-link-convention.test.sh +21 -2
  79. package/payload/canon-kit/gate-tests/check-docs-restatement-parity/bad/expect.txt +2 -0
  80. package/payload/canon-kit/gate-tests/check-docs-restatement-parity/bad/kit/README.md +10 -0
  81. package/payload/canon-kit/gate-tests/check-docs-restatement-parity/bad/kit/index.md +11 -0
  82. package/payload/canon-kit/gate-tests/check-docs-restatement-parity/bad/scripts/canon-config.knobs +2 -0
  83. package/payload/canon-kit/gate-tests/check-docs-restatement-parity/bad/scripts/gate-sdk-config.knobs +2 -0
  84. package/payload/canon-kit/gate-tests/check-docs-restatement-parity/good/expect.txt +1 -0
  85. package/payload/canon-kit/gate-tests/check-docs-restatement-parity/good/kit/README.md +12 -0
  86. package/payload/canon-kit/gate-tests/check-docs-restatement-parity/good/kit/index.md +13 -0
  87. package/payload/canon-kit/gate-tests/check-docs-restatement-parity/good/scripts/canon-config.knobs +2 -0
  88. package/payload/canon-kit/gate-tests/check-docs-restatement-parity/good/scripts/gate-sdk-config.knobs +2 -0
  89. package/payload/canon-kit/gate-tests/check-fence-command-head/bad/args +1 -0
  90. package/payload/canon-kit/gate-tests/check-fence-command-head/bad/doc.md +16 -0
  91. package/payload/canon-kit/gate-tests/check-fence-command-head/bad/expect.txt +5 -0
  92. package/payload/canon-kit/gate-tests/check-fence-command-head/good/args +1 -0
  93. package/payload/canon-kit/gate-tests/check-fence-command-head/good/bin/run.sh +3 -0
  94. package/payload/canon-kit/gate-tests/check-fence-command-head/good/doc.md +41 -0
  95. package/payload/canon-kit/gate-tests/check-fence-command-head/good/expect.txt +1 -0
  96. package/payload/canon-kit/gate-tests/check-fence-command-head/good/lib/tool.sh +5 -0
  97. package/payload/canon-kit/gate-tests/check-fence-command-head/good/scripts/canon-config.knobs +2 -0
  98. package/payload/canon-kit/gate-tests/check-fence-run/bad/args +1 -0
  99. package/payload/canon-kit/gate-tests/check-fence-run/bad/doc.md +32 -0
  100. package/payload/canon-kit/gate-tests/check-fence-run/bad/expect.txt +7 -0
  101. package/payload/canon-kit/gate-tests/check-fence-run/good/args +1 -0
  102. package/payload/canon-kit/gate-tests/check-fence-run/good/doc.md +31 -0
  103. package/payload/canon-kit/gate-tests/check-fence-run/good/expect.txt +1 -0
  104. package/payload/canon-kit/gate-tests/check-install-claim/bad/scripts/canon-config.knobs +7 -0
  105. package/payload/canon-kit/gate-tests/check-install-claim/good/scripts/canon-config.knobs +7 -0
  106. package/payload/canon-kit/gate-tests/check-knob-citation.test.sh +42 -7
  107. package/payload/canon-kit/gate-tests/check-knob-default-coupling/bad/scripts/{gate-sdk-config.sh → gate-sdk-config.knobs} +1 -2
  108. package/payload/canon-kit/gate-tests/check-knob-default-coupling/good/scripts/{gate-sdk-config.sh → gate-sdk-config.knobs} +2 -3
  109. package/payload/canon-kit/gate-tests/check-knob-default-coupling.test.sh +37 -8
  110. package/payload/canon-kit/gate-tests/check-manifest-count/bad/SPEC.md +3 -0
  111. package/payload/canon-kit/gate-tests/check-manifest-count/good/SPEC.md +10 -0
  112. package/payload/canon-kit/gate-tests/check-manifest-count.test.sh +6 -6
  113. package/payload/canon-kit/gate-tests/check-md-refs.test.sh +1 -1
  114. package/payload/canon-kit/gate-tests/check-md-unwrapped/bad/doc.md +13 -0
  115. package/payload/canon-kit/gate-tests/check-md-unwrapped/bad/expect.txt +4 -0
  116. package/payload/canon-kit/gate-tests/check-md-unwrapped/bad/scripts/canon-config.knobs +2 -0
  117. package/payload/canon-kit/gate-tests/check-md-unwrapped/good/doc.md +45 -0
  118. package/payload/canon-kit/gate-tests/check-md-unwrapped/good/expect.txt +1 -0
  119. package/payload/canon-kit/gate-tests/check-md-unwrapped/good/scripts/canon-config.knobs +4 -0
  120. package/payload/canon-kit/gate-tests/check-measured-claim/bad/SPEC.md +3 -0
  121. package/payload/canon-kit/gate-tests/check-measured-claim/bad/expect.txt +1 -0
  122. package/payload/canon-kit/gate-tests/check-measured-claim/bad/scripts/canon-config.knobs +4 -0
  123. package/payload/canon-kit/gate-tests/check-measured-claim/good/SPEC.md +8 -0
  124. package/payload/canon-kit/gate-tests/check-measured-claim/good/scripts/canon-config.knobs +4 -0
  125. package/payload/canon-kit/gate-tests/check-measured-claim/good/worktrees/SPEC.md +12 -0
  126. package/payload/canon-kit/gate-tests/check-measured-claim.test.sh +32 -13
  127. package/payload/canon-kit/gate-tests/check-payload-claim/bad/scripts/canon-config.knobs +6 -0
  128. package/payload/canon-kit/gate-tests/check-payload-claim/good/scripts/canon-config.knobs +6 -0
  129. package/payload/canon-kit/gate-tests/check-prose-bounds/bad/CLAUDE.md +9 -0
  130. package/payload/canon-kit/gate-tests/check-prose-bounds/bad/SPEC.md +11 -0
  131. package/payload/canon-kit/gate-tests/check-prose-bounds/bad/expect.txt +3 -0
  132. package/payload/canon-kit/gate-tests/check-prose-bounds/bad/scripts/canon-config.knobs +3 -0
  133. package/payload/canon-kit/gate-tests/check-prose-bounds/good/CLAUDE.md +10 -0
  134. package/payload/canon-kit/gate-tests/check-prose-bounds/good/SPEC.md +27 -0
  135. package/payload/canon-kit/gate-tests/check-prose-bounds/good/expect.txt +1 -0
  136. package/payload/canon-kit/gate-tests/check-prose-bounds/good/scripts/canon-config.knobs +3 -0
  137. package/payload/canon-kit/gate-tests/check-prose-bounds.test.sh +98 -0
  138. package/payload/canon-kit/gate-tests/check-prose-enum/bad/scripts/canon-config.knobs +3 -0
  139. package/payload/canon-kit/gate-tests/check-prose-enum/good/scripts/canon-config.knobs +3 -0
  140. package/payload/canon-kit/gate-tests/check-prose-enum.test.sh +55 -25
  141. package/payload/canon-kit/gate-tests/check-prose-tells/bad/prose.md +2 -0
  142. package/payload/canon-kit/gate-tests/check-prose-tells/bad/scripts/canon-config.knobs +5 -0
  143. package/payload/canon-kit/gate-tests/check-prose-tells/good/prose.md +6 -0
  144. package/payload/canon-kit/gate-tests/check-prose-tells/good/scripts/{canon-config.sh → canon-config.knobs} +2 -5
  145. package/payload/canon-kit/gate-tests/check-prose-tells/good/worktrees/prose.md +17 -0
  146. package/payload/canon-kit/gate-tests/check-provenance-seam/bad/TASK-QUEUE.md +15 -0
  147. package/payload/canon-kit/gate-tests/check-provenance-seam/bad/expect.txt +8 -0
  148. package/payload/canon-kit/gate-tests/check-provenance-seam/bad/scripts/canon-config.knobs +3 -0
  149. package/payload/canon-kit/gate-tests/check-provenance-seam/bad/scripts/gate-sdk-config.knobs +2 -0
  150. package/payload/canon-kit/gate-tests/check-provenance-seam/bad/scripts/lifecycle-config.knobs +12 -0
  151. package/payload/canon-kit/gate-tests/check-provenance-seam/bad/widget-toolkit/SPEC.md +27 -0
  152. package/payload/canon-kit/gate-tests/check-provenance-seam/good/TASK-QUEUE.md +15 -0
  153. package/payload/canon-kit/gate-tests/check-provenance-seam/good/expect.txt +1 -0
  154. package/payload/canon-kit/gate-tests/check-provenance-seam/good/scripts/canon-config.knobs +3 -0
  155. package/payload/canon-kit/gate-tests/check-provenance-seam/good/scripts/gate-sdk-config.knobs +2 -0
  156. package/payload/canon-kit/gate-tests/check-provenance-seam/good/scripts/lifecycle-config.knobs +12 -0
  157. package/payload/canon-kit/gate-tests/check-provenance-seam/good/widget-toolkit/SPEC.md +20 -0
  158. package/payload/canon-kit/gate-tests/check-provenance-seam.test.sh +136 -0
  159. package/payload/canon-kit/gate-tests/check-spec-dod-singleton.test.sh +1 -1
  160. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/README.md +6 -0
  161. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/SPEC-widget.md +5 -0
  162. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/bad.rs +2 -0
  163. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/expect.txt +4 -0
  164. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/scripts/canon-config.knobs +6 -0
  165. package/payload/canon-kit/gate-tests/check-spec-pointer/good/README.md +15 -0
  166. package/payload/canon-kit/gate-tests/check-spec-pointer/good/SPEC-widget.md +10 -0
  167. package/payload/canon-kit/gate-tests/check-spec-pointer/good/expect.txt +1 -1
  168. package/payload/canon-kit/gate-tests/check-spec-pointer/good/good.rs +2 -0
  169. package/payload/canon-kit/gate-tests/check-spec-pointer/good/scripts/canon-config.knobs +6 -0
  170. package/payload/canon-kit/gate-tests/check-spec-pointer/good/vendored-kit/notes.txt +4 -0
  171. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/TASK-QUEUE.md +3 -1
  172. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/TASK-QUEUE.md +9 -3
  173. package/payload/canon-kit/gate-tests/check-tracking-claim.test.sh +1 -1
  174. package/payload/canon-kit/gate-tests/check-unmarked-claim/bad/SPEC.md +3 -0
  175. package/payload/canon-kit/gate-tests/check-unmarked-claim/bad/expect.txt +1 -0
  176. package/payload/canon-kit/gate-tests/check-unmarked-claim/bad/scripts/canon-config.knobs +4 -0
  177. package/payload/canon-kit/gate-tests/check-unmarked-claim/good/SPEC.md +3 -0
  178. package/payload/canon-kit/gate-tests/check-unmarked-claim/good/scripts/canon-config.knobs +4 -0
  179. package/payload/canon-kit/gate-tests/check-unmarked-claim/good/worktrees/SPEC.md +11 -0
  180. package/payload/canon-kit/gate-tests/check-unmarked-claim.test.sh +53 -28
  181. package/payload/canon-kit/templates/SPEC-amendment.md +46 -25
  182. package/payload/canon-kit/templates/canon-config.knobs +1 -0
  183. package/payload/context-kit/README.md +33 -61
  184. package/payload/context-kit/checks/check-brevity.gate +2 -2
  185. package/payload/context-kit/checks/check-footprint-fresh.gate +3 -2
  186. package/payload/context-kit/checks/check-memory-off.gate +1 -1
  187. package/payload/context-kit/checks/check-settings-paths.gate +2 -2
  188. package/payload/context-kit/checks/check-settings-pins.gate +1 -1
  189. package/payload/context-kit/checks/check-surface-ratchet.gate +3 -0
  190. package/payload/context-kit/gate-tests/check-brevity/bad/CLAUDE.md +9 -2
  191. package/payload/context-kit/gate-tests/check-brevity/bad/expect.txt +1 -0
  192. package/payload/context-kit/gate-tests/check-brevity/good/CLAUDE.md +9 -4
  193. package/payload/context-kit/gate-tests/check-brevity/good/expect.txt +1 -1
  194. package/payload/context-kit/gate-tests/check-brevity.test.sh +107 -24
  195. package/payload/context-kit/gate-tests/check-footprint-fresh/good/CLAUDE.md +6 -0
  196. package/payload/context-kit/gate-tests/check-footprint-fresh/good/demo-kit/SPEC.md +3 -0
  197. package/payload/context-kit/gate-tests/check-footprint-fresh/good/demo-kit/templates/guide.md +3 -0
  198. package/payload/context-kit/gate-tests/check-footprint-fresh/good/docs/footprint.md +30 -0
  199. package/payload/context-kit/gate-tests/check-memory-off/bad/scripts/{context-config.sh → context-config.knobs} +1 -3
  200. package/payload/context-kit/gate-tests/check-memory-off/good/scripts/{context-config.sh → context-config.knobs} +1 -3
  201. package/payload/context-kit/gate-tests/check-memory-off.test.sh +1 -1
  202. package/payload/context-kit/gate-tests/check-settings-paths/bad/expect.txt +2 -0
  203. package/payload/context-kit/gate-tests/check-settings-paths/bad/settings.json +21 -0
  204. package/payload/context-kit/gate-tests/check-settings-paths/bad/tools/run-gates.sh +4 -0
  205. package/payload/context-kit/gate-tests/check-settings-paths/good/expect.txt +2 -1
  206. package/payload/context-kit/gate-tests/check-settings-paths/good/settings.json +48 -1
  207. package/payload/context-kit/gate-tests/check-settings-paths/good/tools/run-gates.sh +4 -0
  208. package/payload/context-kit/gate-tests/check-settings-pins.test.sh +1 -1
  209. package/payload/context-kit/gate-tests/check-surface-ratchet/bad/CLAUDE.md +5 -0
  210. package/payload/context-kit/gate-tests/check-surface-ratchet/bad/expect.txt +2 -0
  211. package/payload/context-kit/gate-tests/check-surface-ratchet/bad/scripts/context-config.knobs +4 -0
  212. package/payload/context-kit/gate-tests/check-surface-ratchet/bad/surface-ceiling.txt +2 -0
  213. package/payload/context-kit/gate-tests/check-surface-ratchet/bad/templates/ungoverned.md +3 -0
  214. package/payload/context-kit/gate-tests/check-surface-ratchet/good/CLAUDE.md +3 -0
  215. package/payload/context-kit/gate-tests/check-surface-ratchet/good/expect.txt +1 -0
  216. package/payload/context-kit/gate-tests/check-surface-ratchet/good/scripts/context-config.knobs +4 -0
  217. package/payload/context-kit/gate-tests/check-surface-ratchet/good/surface-ceiling.txt +4 -0
  218. package/payload/context-kit/gate-tests/check-surface-ratchet/good/templates/held.md +4 -0
  219. package/payload/context-kit/gate-tests/check-surface-ratchet.test.sh +76 -0
  220. package/payload/context-kit/index-tests/corpus/baseline.txt +1 -1
  221. package/payload/context-kit/index-tests/corpus/surface.md +1 -6
  222. package/payload/context-kit/index-tests/expected/always-loaded.txt +1 -1
  223. package/payload/context-kit/templates/close-brevity.md +9 -28
  224. package/payload/context-kit/templates/context-config.knobs +1 -0
  225. package/payload/context-kit/templates/session-context.sh +43 -28
  226. package/payload/delegation-kit/README.md +35 -69
  227. package/payload/delegation-kit/checks/check-agent-tier-explicit.gate +1 -1
  228. package/payload/delegation-kit/checks/check-gate-tamper.gate +1 -1
  229. package/payload/delegation-kit/gate-tests/check-gate-tamper.test.sh +23 -2
  230. package/payload/delegation-kit/templates/agent-execution.md +23 -389
  231. package/payload/delegation-kit/templates/delegation-config.knobs +4 -0
  232. package/payload/delegation-kit/templates/dispatch-checklists.md +8 -45
  233. package/payload/delegation-kit/usage-tests/dispatch-guard-cases.tsv +33 -17
  234. package/payload/doctrine-kit/DOCTRINE.md +92 -458
  235. package/payload/doctrine-kit/README.md +24 -55
  236. package/payload/doctrine-kit/checks/check-doctrine-registration.gate +1 -1
  237. package/payload/doctrine-kit/gate-tests/check-doctrine-registration.test.sh +48 -3
  238. package/payload/drift-kit/README.md +43 -89
  239. package/payload/drift-kit/templates/close-knowledge.md +7 -22
  240. package/payload/drift-kit/templates/drift-config.knobs +1 -0
  241. package/payload/drift-kit/templates/economics.md +10 -48
  242. package/payload/drift-kit/templates/kpi-deprecated-surface.sh +31 -9
  243. package/payload/drift-kit/templates/kpis.list +2 -1
  244. package/payload/drift-kit/templates/price-table.tsv +1 -1
  245. package/payload/evidence-kit/README.md +23 -46
  246. package/payload/evidence-kit/checks/check-battery-roster.gate +1 -1
  247. package/payload/evidence-kit/checks/check-evidence-baseline.gate +2 -2
  248. package/payload/evidence-kit/checks/check-evidence-manifest.gate +1 -1
  249. package/payload/evidence-kit/checks/check-producer-liveness.gate +3 -0
  250. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/scripts/evidence-config.knobs +7 -0
  251. package/payload/evidence-kit/gate-tests/check-battery-roster/good/scripts/evidence-config.knobs +7 -0
  252. package/payload/evidence-kit/gate-tests/check-battery-roster.test.sh +7 -7
  253. package/payload/evidence-kit/gate-tests/check-evidence-baseline/bad/TASK-QUEUE.md +3 -1
  254. package/payload/evidence-kit/gate-tests/check-evidence-baseline/bad/args +1 -0
  255. package/payload/evidence-kit/gate-tests/check-evidence-baseline/bad/expect.txt +2 -0
  256. package/payload/evidence-kit/gate-tests/check-evidence-baseline/bad/scripts/evidence-config.knobs +4 -0
  257. package/payload/evidence-kit/gate-tests/check-evidence-baseline/bad/validate-baseline.txt +1 -0
  258. package/payload/evidence-kit/gate-tests/check-evidence-baseline/good/TASK-QUEUE.md +3 -1
  259. package/payload/evidence-kit/gate-tests/check-evidence-baseline/good/args +1 -0
  260. package/payload/evidence-kit/gate-tests/check-evidence-baseline/good/scripts/evidence-config.knobs +3 -0
  261. package/payload/evidence-kit/gate-tests/check-evidence-baseline.test.sh +134 -14
  262. package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/scripts/{evidence-config.sh → evidence-config.knobs} +3 -5
  263. package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/scripts/{evidence-config.sh → evidence-config.knobs} +3 -5
  264. package/payload/evidence-kit/gate-tests/check-evidence-manifest.test.sh +5 -4
  265. package/payload/evidence-kit/gate-tests/diff-baseline-status.test.sh +128 -0
  266. package/payload/evidence-kit/gate-tests/evidence-lib.test.sh +51 -45
  267. package/payload/evidence-kit/gate-tests/pre-hook.test.sh +66 -0
  268. package/payload/evidence-kit/gate-tests/producer-lock.test.sh +29 -16
  269. package/payload/evidence-kit/templates/evidence-config.knobs +1 -0
  270. package/payload/gate-sdk/README.md +48 -79
  271. package/payload/gate-sdk/bin/build-native.sh +27 -4
  272. package/payload/gate-sdk/bin/run-gates.ps1 +266 -0
  273. package/payload/gate-sdk/bin/run-gates.sh +53 -277
  274. package/payload/gate-sdk/checks/check-action-gh-repo.gate +1 -1
  275. package/payload/gate-sdk/checks/check-action-job-ref.gate +3 -0
  276. package/payload/gate-sdk/checks/check-action-permissions.gate +3 -0
  277. package/payload/gate-sdk/checks/check-action-pinning.gate +1 -1
  278. package/payload/gate-sdk/checks/check-action-run-path.gate +3 -0
  279. package/payload/gate-sdk/checks/check-action-run-shell.gate +3 -0
  280. package/payload/gate-sdk/checks/check-commit-msg.gate +2 -1
  281. package/payload/gate-sdk/checks/check-commit-subject.gate +1 -1
  282. package/payload/gate-sdk/checks/check-core-files.gate +1 -1
  283. package/payload/gate-sdk/checks/check-crate-arms.gate +3 -0
  284. package/payload/gate-sdk/checks/check-enforcement-fresh.gate +3 -2
  285. package/payload/gate-sdk/checks/check-exec-bit.gate +1 -1
  286. package/payload/gate-sdk/checks/check-front-end-fail-open.gate +3 -0
  287. package/payload/gate-sdk/checks/check-gate-assertions.gate +2 -2
  288. package/payload/gate-sdk/checks/check-gate-binary-fresh.gate +1 -1
  289. package/payload/gate-sdk/checks/check-gate-exemption-tasks.gate +1 -1
  290. package/payload/gate-sdk/checks/check-gate-fail-closed.gate +1 -1
  291. package/payload/gate-sdk/checks/check-gate-fixture-coverage.gate +1 -1
  292. package/payload/gate-sdk/checks/check-gate-output.gate +1 -1
  293. package/payload/gate-sdk/checks/check-gate-substrate-parity.gate +3 -0
  294. package/payload/gate-sdk/checks/check-graph.gate +2 -1
  295. package/payload/gate-sdk/checks/check-hook-exec-bit.gate +1 -1
  296. package/payload/gate-sdk/checks/check-identity.gate +1 -1
  297. package/payload/gate-sdk/checks/check-install-disposition.gate +3 -0
  298. package/payload/gate-sdk/checks/check-kit-enum.gate +1 -1
  299. package/payload/gate-sdk/checks/check-kit-registration.gate +1 -1
  300. package/payload/gate-sdk/checks/check-kit-roots-dialect.gate +3 -0
  301. package/payload/gate-sdk/checks/check-packed-links.gate +3 -0
  302. package/payload/gate-sdk/checks/check-path-dialect.gate +3 -0
  303. package/payload/gate-sdk/checks/check-pipe-membership.gate +3 -0
  304. package/payload/gate-sdk/checks/check-portability-floor.gate +4 -0
  305. package/payload/gate-sdk/checks/check-projection-roster.gate +4 -0
  306. package/payload/gate-sdk/checks/check-reads-couples.gate +1 -1
  307. package/payload/gate-sdk/checks/check-root-tiering.gate +1 -1
  308. package/payload/gate-sdk/checks/check-shellcheck.gate +3 -0
  309. package/payload/gate-sdk/checks/check-template-copy-parity.gate +1 -1
  310. package/payload/gate-sdk/checks/check-tree-terms.gate +2 -1
  311. package/payload/gate-sdk/checks/check-workflow-tiering.gate +1 -1
  312. package/payload/gate-sdk/gate-tests/check-action-job-ref/bad/args +2 -0
  313. package/payload/gate-sdk/gate-tests/check-action-job-ref/bad/expect.txt +1 -0
  314. package/payload/gate-sdk/gate-tests/check-action-job-ref/bad/scripts/gate-sdk-config.knobs +1 -0
  315. package/payload/gate-sdk/gate-tests/check-action-job-ref/bad/tree/notes.md +3 -0
  316. package/payload/gate-sdk/gate-tests/check-action-job-ref/bad/tree/workflows/ci.yml +8 -0
  317. package/payload/gate-sdk/gate-tests/check-action-job-ref/good/args +3 -0
  318. package/payload/gate-sdk/gate-tests/check-action-job-ref/good/expect.txt +1 -0
  319. package/payload/gate-sdk/gate-tests/check-action-job-ref/good/scripts/gate-sdk-config.knobs +1 -0
  320. package/payload/gate-sdk/gate-tests/check-action-job-ref/good/tree/notes.md +3 -0
  321. package/payload/gate-sdk/gate-tests/check-action-job-ref/good/tree/workflows/ci.yml +8 -0
  322. package/payload/gate-sdk/gate-tests/check-action-permissions/bad/args +3 -0
  323. package/payload/gate-sdk/gate-tests/check-action-permissions/bad/expect.txt +5 -0
  324. package/payload/gate-sdk/gate-tests/check-action-permissions/bad/tree/workflows/empty-allowlist.yml +29 -0
  325. package/payload/gate-sdk/gate-tests/check-action-permissions/bad/tree/workflows/gates.yml +25 -0
  326. package/payload/gate-sdk/gate-tests/check-action-permissions/good/args +5 -0
  327. package/payload/gate-sdk/gate-tests/check-action-permissions/good/expect.txt +1 -0
  328. package/payload/gate-sdk/gate-tests/check-action-permissions/good/tree/action.yml +9 -0
  329. package/payload/gate-sdk/gate-tests/check-action-permissions/good/tree/not-actions.yml +7 -0
  330. package/payload/gate-sdk/gate-tests/check-action-permissions/good/tree/workflows/declared.yml +69 -0
  331. package/payload/gate-sdk/gate-tests/check-action-permissions/good/tree/workflows/valves.yml +22 -0
  332. package/payload/gate-sdk/gate-tests/check-action-run-path/bad/args +4 -0
  333. package/payload/gate-sdk/gate-tests/check-action-run-path/bad/expect.txt +2 -0
  334. package/payload/gate-sdk/gate-tests/check-action-run-path/bad/tree/scripts/present.sh +3 -0
  335. package/payload/gate-sdk/gate-tests/check-action-run-path/bad/tree/workflows/ci.yml +14 -0
  336. package/payload/gate-sdk/gate-tests/check-action-run-path/good/args +5 -0
  337. package/payload/gate-sdk/gate-tests/check-action-run-path/good/expect.txt +1 -0
  338. package/payload/gate-sdk/gate-tests/check-action-run-path/good/tree/scripts/build.sh +3 -0
  339. package/payload/gate-sdk/gate-tests/check-action-run-path/good/tree/sub/scripts/inner.sh +3 -0
  340. package/payload/gate-sdk/gate-tests/check-action-run-path/good/tree/workflows/ci.yml +36 -0
  341. package/payload/gate-sdk/gate-tests/check-action-run-shell/bad/args +4 -2
  342. package/payload/gate-sdk/gate-tests/check-action-run-shell/bad/expect.txt +2 -0
  343. package/payload/gate-sdk/gate-tests/check-action-run-shell/bad/tree/workflows/runner-dialect.yml +36 -0
  344. package/payload/gate-sdk/gate-tests/check-action-run-shell/good/args +3 -2
  345. package/payload/gate-sdk/gate-tests/check-action-run-shell/good/expect.txt +1 -1
  346. package/payload/gate-sdk/gate-tests/check-action-run-shell/good/tree/workflows/runner-dialect.yml +71 -0
  347. package/payload/gate-sdk/gate-tests/check-action-run-shell.test.sh +102 -9
  348. package/payload/gate-sdk/gate-tests/check-assertion-strength/bad/smoke/install.sh +1 -1
  349. package/payload/gate-sdk/gate-tests/check-assertion-strength/good/smoke/install.sh +1 -1
  350. package/payload/gate-sdk/gate-tests/check-assertion-strength.test.sh +55 -0
  351. package/payload/gate-sdk/gate-tests/check-commit-msg/bad/expect.txt +1 -0
  352. package/payload/gate-sdk/gate-tests/check-commit-msg/bad/msg.txt +4 -0
  353. package/payload/gate-sdk/gate-tests/check-commit-msg/bad/patterns.list +5 -1
  354. package/payload/gate-sdk/gate-tests/check-commit-msg/good/msg.txt +7 -0
  355. package/payload/gate-sdk/gate-tests/check-commit-msg/good/patterns.list +5 -1
  356. package/payload/gate-sdk/gate-tests/check-commit-subject.test.sh +2 -2
  357. package/payload/gate-sdk/gate-tests/check-core-files.test.sh +1 -1
  358. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/scripts/gate-sdk-config.knobs +3 -0
  359. package/payload/gate-sdk/gate-tests/check-crate-arms/good/scripts/gate-sdk-config.knobs +3 -0
  360. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/good/demo-kit/SPEC.md +3 -0
  361. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/good/demo-kit/checks/check-demo.gate +1 -0
  362. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/good/demo-kit/probe.conf +1 -0
  363. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/good/demo-kit/templates/guide.md +3 -0
  364. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/good/docs/enforcement.md +33 -0
  365. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/good/scripts/gate-sdk-config.knobs +1 -0
  366. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/good/scripts/gates.list +1 -0
  367. package/payload/gate-sdk/gate-tests/check-exec-bit.test.sh +1 -1
  368. package/payload/gate-sdk/gate-tests/check-front-end-fail-open/bad/args +3 -0
  369. package/payload/gate-sdk/gate-tests/check-front-end-fail-open/bad/expect.txt +2 -0
  370. package/payload/gate-sdk/gate-tests/check-front-end-fail-open/bad/gate-sdk/bin/run-gates.ps1 +5 -0
  371. package/payload/gate-sdk/gate-tests/check-front-end-fail-open/bad/gate-sdk/bin/run-gates.sh +9 -0
  372. package/payload/gate-sdk/gate-tests/check-front-end-fail-open/good/args +4 -0
  373. package/payload/gate-sdk/gate-tests/check-front-end-fail-open/good/expect.txt +1 -0
  374. package/payload/gate-sdk/gate-tests/check-front-end-fail-open/good/gate-sdk/bin/run-gates.ps1 +5 -0
  375. package/payload/gate-sdk/gate-tests/check-front-end-fail-open/good/gate-sdk/bin/run-gates.sh +9 -0
  376. package/payload/gate-sdk/gate-tests/check-gate-assertions/good/scripts/SPEC.md +4 -1
  377. package/payload/gate-sdk/gate-tests/check-gate-assertions.test.sh +1 -1
  378. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/gate-sdk-config.knobs +2 -0
  379. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/gate-sdk-config.knobs +2 -0
  380. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh.test.sh +6 -12
  381. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/TASK-QUEUE.md +5 -3
  382. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/TASK-QUEUE.md +3 -1
  383. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks.test.sh +4 -2
  384. package/payload/gate-sdk/gate-tests/check-gate-output.test.sh +1 -1
  385. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/ci/build-artifact.sh +9 -0
  386. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/ci.yml +9 -0
  387. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/expect.txt +4 -2
  388. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gate-sdk-config.knobs +5 -0
  389. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gates.list +6 -0
  390. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/ci/build-artifact.sh +9 -0
  391. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/ci.yml +16 -0
  392. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/expect.txt +7 -3
  393. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gate-sdk-config.knobs +5 -0
  394. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gates.list +1 -1
  395. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity.test.sh +222 -197
  396. package/payload/gate-sdk/gate-tests/check-graph/bad/SPEC-example-gate.md +7 -2
  397. package/payload/gate-sdk/gate-tests/check-graph/bad/expect.txt +4 -0
  398. package/payload/gate-sdk/gate-tests/check-graph/good/SPEC-second-gate.md +3 -1
  399. package/payload/gate-sdk/gate-tests/check-graph-cap.test.sh +1 -1
  400. package/payload/gate-sdk/gate-tests/check-graph-refs.test.sh +8 -8
  401. package/payload/gate-sdk/gate-tests/check-graph-theme.test.sh +2 -2
  402. package/payload/gate-sdk/gate-tests/check-graph-tree.test.sh +49 -14
  403. package/payload/gate-sdk/gate-tests/check-identity/bad/scripts/{gate-sdk-config.sh → gate-sdk-config.knobs} +4 -4
  404. package/payload/gate-sdk/gate-tests/check-identity/good/scripts/{gate-sdk-config.sh → gate-sdk-config.knobs} +4 -4
  405. package/payload/gate-sdk/gate-tests/check-identity.test.sh +1 -1
  406. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-eta.sh +7 -0
  407. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-iota.sh +7 -0
  408. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-theta.sh +7 -0
  409. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-zeta.gate +3 -0
  410. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/smoke/install.sh +1 -1
  411. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/args +8 -5
  412. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/expect.txt +5 -0
  413. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/native/src/installer/recipe.rs +10 -0
  414. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/scripts/{gate-sdk-config.sh → gate-sdk-config.knobs} +2 -3
  415. package/payload/gate-sdk/gate-tests/check-install-disposition/good/args +8 -4
  416. package/payload/gate-sdk/gate-tests/check-install-disposition/good/expect.txt +2 -0
  417. package/payload/gate-sdk/gate-tests/check-install-disposition/good/scripts/{gate-sdk-config.sh → gate-sdk-config.knobs} +2 -3
  418. package/payload/gate-sdk/gate-tests/check-install-disposition/good/{alpha-kit → site-kit}/checks/check-alpha.sh +1 -1
  419. package/payload/gate-sdk/gate-tests/check-install-disposition/good/site-kit/checks/check-beta.gate +3 -0
  420. package/payload/gate-sdk/gate-tests/check-install-disposition/good/site-kit/checks/check-gamma.sh +6 -0
  421. package/payload/gate-sdk/gate-tests/check-install-disposition/good/site-kit/checks/check-omega.sh +7 -0
  422. package/payload/gate-sdk/gate-tests/check-install-disposition/good/site-kit/checks/check-psi.sh +7 -0
  423. package/payload/gate-sdk/gate-tests/check-install-disposition/good/{alpha-kit → site-kit}/smoke/install.sh +2 -2
  424. package/payload/gate-sdk/gate-tests/check-kit-registration/bad/registry-doc.md +15 -12
  425. package/payload/gate-sdk/gate-tests/check-kit-registration/good/args +7 -5
  426. package/payload/gate-sdk/gate-tests/check-kit-registration/good/scripts/gate-sdk-config.knobs +2 -0
  427. package/payload/gate-sdk/gate-tests/check-kit-registration.test.sh +2 -2
  428. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/args +5 -0
  429. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/expect.txt +1 -0
  430. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/alpha-kit/checks/placeholder.txt +3 -0
  431. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/alpha-kit/gate-tests/alpha.test.sh +3 -0
  432. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/alpha-kit/lib/alpha.sh +3 -0
  433. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/beta-kit/checks/placeholder.txt +3 -0
  434. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/beta-kit/gate-tests/beta.test.sh +3 -0
  435. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/beta-kit/lib/beta.sh +3 -0
  436. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/gate-sdk/checks/placeholder.txt +3 -0
  437. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/gate-sdk/lib/gate.sh +3 -0
  438. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/scripts/gate-sdk-config.knobs +7 -0
  439. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/scripts/gates.list +3 -0
  440. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/args +7 -0
  441. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/expect.txt +1 -0
  442. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/alpha-kit/checks/placeholder.txt +3 -0
  443. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/alpha-kit/gate-tests/alpha.test.sh +3 -0
  444. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/alpha-kit/lib/alpha.sh +3 -0
  445. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/beta-kit/checks/placeholder.txt +3 -0
  446. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/beta-kit/gate-tests/beta.test.sh +3 -0
  447. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/beta-kit/lib/beta.sh +3 -0
  448. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/gate-sdk/checks/placeholder.txt +3 -0
  449. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/gate-sdk/lib/gate.sh +3 -0
  450. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/scripts/gates.list +3 -0
  451. package/payload/gate-sdk/gate-tests/check-packed-links/bad/alpha-kit/README.md +5 -0
  452. package/payload/gate-sdk/gate-tests/check-packed-links/bad/args +5 -0
  453. package/payload/gate-sdk/gate-tests/check-packed-links/bad/beta-kit/README.md +5 -0
  454. package/payload/gate-sdk/gate-tests/check-packed-links/bad/expect.txt +2 -0
  455. package/payload/gate-sdk/gate-tests/check-packed-links/bad/scripts/gate-sdk-config.knobs +4 -0
  456. package/payload/gate-sdk/gate-tests/check-packed-links/good/alpha-kit/README.md +5 -0
  457. package/payload/gate-sdk/gate-tests/check-packed-links/good/args +8 -0
  458. package/payload/gate-sdk/gate-tests/check-packed-links/good/beta-kit/README.md +9 -0
  459. package/payload/gate-sdk/gate-tests/check-packed-links/good/expect.txt +1 -0
  460. package/payload/gate-sdk/gate-tests/check-packed-links/good/gamma-kit/SPEC.md +4 -0
  461. package/payload/gate-sdk/gate-tests/check-packed-links/good/scripts/gate-sdk-config.knobs +6 -0
  462. package/payload/gate-sdk/gate-tests/check-path-dialect/bad/args +3 -0
  463. package/payload/gate-sdk/gate-tests/check-path-dialect/bad/expect.txt +15 -0
  464. package/payload/gate-sdk/gate-tests/check-path-dialect/bad/native/src/primitive.rs +19 -0
  465. package/payload/gate-sdk/gate-tests/check-path-dialect/bad/native/src/producer.rs +8 -0
  466. package/payload/gate-sdk/gate-tests/check-path-dialect/bad/native/src/walk.rs +13 -0
  467. package/payload/gate-sdk/gate-tests/check-path-dialect/bad/tree/bound-root.sh +5 -0
  468. package/payload/gate-sdk/gate-tests/check-path-dialect/bad/tree/case-arm.sh +6 -0
  469. package/payload/gate-sdk/gate-tests/check-path-dialect/bad/tree/commented.sh +5 -0
  470. package/payload/gate-sdk/gate-tests/check-path-dialect/bad/tree/common-dir.sh +4 -0
  471. package/payload/gate-sdk/gate-tests/check-path-dialect/bad/tree/glob-test.sh +4 -0
  472. package/payload/gate-sdk/gate-tests/check-path-dialect/bad/tree/late-anchor.sh +7 -0
  473. package/payload/gate-sdk/gate-tests/check-path-dialect/bad/tree/logical-readback.sh +5 -0
  474. package/payload/gate-sdk/gate-tests/check-path-dialect/bad/tree/probe.sh +7 -0
  475. package/payload/gate-sdk/gate-tests/check-path-dialect/bad/tree/two-root.sh +5 -0
  476. package/payload/gate-sdk/gate-tests/check-path-dialect/good/args +3 -0
  477. package/payload/gate-sdk/gate-tests/check-path-dialect/good/expect.txt +13 -0
  478. package/payload/gate-sdk/gate-tests/check-path-dialect/good/native/src/commented.rs +5 -0
  479. package/payload/gate-sdk/gate-tests/check-path-dialect/good/native/src/local.rs +12 -0
  480. package/payload/gate-sdk/gate-tests/check-path-dialect/good/native/src/namespace.rs +11 -0
  481. package/payload/gate-sdk/gate-tests/check-path-dialect/good/native/src/typed.rs +10 -0
  482. package/payload/gate-sdk/gate-tests/check-path-dialect/good/native/src/verdict.rs +5 -0
  483. package/payload/gate-sdk/gate-tests/check-path-dialect/good/native/src/walk.rs +24 -0
  484. package/payload/gate-sdk/gate-tests/check-path-dialect/good/tree/anchored.sh +6 -0
  485. package/payload/gate-sdk/gate-tests/check-path-dialect/good/tree/cd-only.sh +7 -0
  486. package/payload/gate-sdk/gate-tests/check-path-dialect/good/tree/commented.sh +6 -0
  487. package/payload/gate-sdk/gate-tests/check-path-dialect/good/tree/one-root.sh +4 -0
  488. package/payload/gate-sdk/gate-tests/check-path-dialect/good/tree/probe.sh +8 -0
  489. package/payload/gate-sdk/gate-tests/check-path-dialect/good/tree/rooted.sh +23 -0
  490. package/payload/gate-sdk/gate-tests/check-path-dialect/good/tree/subshell.sh +6 -0
  491. package/payload/gate-sdk/gate-tests/check-path-dialect/good/tree/two-line.sh +8 -0
  492. package/payload/gate-sdk/gate-tests/check-path-dialect/good/tree/verdict.sh +7 -0
  493. package/payload/gate-sdk/gate-tests/check-pipe-membership/bad/args +4 -0
  494. package/payload/gate-sdk/gate-tests/check-pipe-membership/bad/expect.txt +6 -0
  495. package/payload/gate-sdk/gate-tests/check-pipe-membership/bad/scripts/gate-sdk-config.knobs +1 -0
  496. package/payload/gate-sdk/gate-tests/check-pipe-membership/bad/tree/array-grep.sh +6 -0
  497. package/payload/gate-sdk/gate-tests/check-pipe-membership/bad/tree/echo-max-count.sh +5 -0
  498. package/payload/gate-sdk/gate-tests/check-pipe-membership/bad/tree/gate-tests/membership.test.sh +6 -0
  499. package/payload/gate-sdk/gate-tests/check-pipe-membership/bad/tree/loop-head.sh +5 -0
  500. package/payload/gate-sdk/gate-tests/check-pipe-membership/bad/tree/tests/relocated.test.sh +6 -0
  501. package/payload/gate-sdk/gate-tests/check-pipe-membership/good/args +5 -0
  502. package/payload/gate-sdk/gate-tests/check-pipe-membership/good/expect.txt +3 -0
  503. package/payload/gate-sdk/gate-tests/check-pipe-membership/good/tree/full-reader.sh +4 -0
  504. package/payload/gate-sdk/gate-tests/check-pipe-membership/good/tree/gate-tests/check-x/bad/violating.test.sh +6 -0
  505. package/payload/gate-sdk/gate-tests/check-pipe-membership/good/tree/gate-tests/clean.test.sh +8 -0
  506. package/payload/gate-sdk/gate-tests/check-pipe-membership/good/tree/loop-membership.sh +8 -0
  507. package/payload/gate-sdk/gate-tests/check-pipe-membership/good/tree/no-pipefail.sh +6 -0
  508. package/payload/gate-sdk/gate-tests/check-pipe-membership/good/tree/one-line-producer.sh +5 -0
  509. package/payload/gate-sdk/gate-tests/check-portability-floor/bad/args +2 -0
  510. package/payload/gate-sdk/gate-tests/check-portability-floor/bad/expect.txt +8 -0
  511. package/payload/gate-sdk/gate-tests/check-portability-floor/bad/patterns.list +4 -0
  512. package/payload/gate-sdk/gate-tests/check-portability-floor/bad/scripts/gate-sdk-config.knobs +4 -0
  513. package/payload/gate-sdk/gate-tests/check-portability-floor/bad/tree/empty-reason-verb +5 -0
  514. package/payload/gate-sdk/gate-tests/check-portability-floor/bad/tree/strings.ps1 +6 -0
  515. package/payload/gate-sdk/gate-tests/check-portability-floor/bad/tree/too-far-verb +5 -0
  516. package/payload/gate-sdk/gate-tests/check-portability-floor/bad/tree/undeclared-verb +3 -0
  517. package/payload/gate-sdk/gate-tests/check-portability-floor/good/args +2 -0
  518. package/payload/gate-sdk/gate-tests/check-portability-floor/good/expect.txt +1 -0
  519. package/payload/gate-sdk/gate-tests/check-portability-floor/good/patterns.list +5 -0
  520. package/payload/gate-sdk/gate-tests/check-portability-floor/good/scripts/gate-sdk-config.knobs +4 -0
  521. package/payload/gate-sdk/gate-tests/check-portability-floor/good/tree/front.ps1 +7 -0
  522. package/payload/gate-sdk/gate-tests/check-portability-floor/good/tree/plain-verb +5 -0
  523. package/payload/gate-sdk/gate-tests/check-portability-floor/good/tree/portability-patterns.list +5 -0
  524. package/payload/gate-sdk/gate-tests/check-portability-floor/good/tree/upgrade-verb +7 -0
  525. package/payload/gate-sdk/gate-tests/check-portability-floor.test.sh +154 -0
  526. package/payload/gate-sdk/gate-tests/check-projection-roster/bad/demo-kit/checks/check-beta.gate +2 -0
  527. package/payload/gate-sdk/gate-tests/check-projection-roster/bad/docs/roster.md +11 -0
  528. package/payload/gate-sdk/gate-tests/check-projection-roster/bad/expect.txt +7 -0
  529. package/payload/gate-sdk/gate-tests/check-projection-roster/bad/scripts/check-alpha.gate +2 -0
  530. package/payload/gate-sdk/gate-tests/check-projection-roster/bad/scripts/check-gamma.gate +2 -0
  531. package/payload/gate-sdk/gate-tests/check-projection-roster/bad/scripts/check-plain.gate +1 -0
  532. package/payload/gate-sdk/gate-tests/check-projection-roster/bad/scripts/gate-sdk-config.knobs +3 -0
  533. package/payload/gate-sdk/gate-tests/check-projection-roster/bad/scripts/gates.list +4 -0
  534. package/payload/gate-sdk/gate-tests/check-projection-roster/good/demo-kit/checks/check-beta.gate +2 -0
  535. package/payload/gate-sdk/gate-tests/check-projection-roster/good/docs/roster.md +16 -0
  536. package/payload/gate-sdk/gate-tests/check-projection-roster/good/expect.txt +1 -0
  537. package/payload/gate-sdk/gate-tests/check-projection-roster/good/scripts/check-alpha.gate +2 -0
  538. package/payload/gate-sdk/gate-tests/check-projection-roster/good/scripts/check-delta.gate +2 -0
  539. package/payload/gate-sdk/gate-tests/check-projection-roster/good/scripts/check-epsilon.gate +2 -0
  540. package/payload/gate-sdk/gate-tests/check-projection-roster/good/scripts/check-plain.gate +1 -0
  541. package/payload/gate-sdk/gate-tests/check-projection-roster/good/scripts/gate-sdk-config.knobs +4 -0
  542. package/payload/gate-sdk/gate-tests/check-projection-roster/good/scripts/gates.list +5 -0
  543. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/scripts/gate-sdk-config.knobs +4 -0
  544. package/payload/gate-sdk/gate-tests/check-readme-roster/good/args +1 -1
  545. package/payload/gate-sdk/gate-tests/check-readme-roster/good/scripts/gate-sdk-config.knobs +4 -0
  546. package/payload/gate-sdk/gate-tests/check-reads-couples/bad/expect.txt +1 -1
  547. package/payload/gate-sdk/gate-tests/check-reads-couples/bad/sandbox-gate.sh +4 -4
  548. package/payload/gate-sdk/gate-tests/check-reads-couples/good/sandbox-gate.sh +4 -4
  549. package/payload/gate-sdk/gate-tests/check-reads-couples.test.sh +25 -20
  550. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/bad/alpha-kit/smoke/install.sh +1 -1
  551. package/payload/gate-sdk/gate-tests/{check-template-registry-parity/bad/scripts/gate-sdk-config.sh → check-smoke-entry-guard/bad/scripts/gate-sdk-config.knobs} +2 -3
  552. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/good/alpha-kit/smoke/install.sh +1 -1
  553. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/good/alpha-kit/smoke/violation.sh +1 -1
  554. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/good/args +1 -1
  555. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/good/beta-kit/smoke/install.sh +1 -1
  556. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/good/scripts/gate-sdk-config.knobs +4 -0
  557. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/args +3 -1
  558. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/delegation-kit/templates/session-note.sh +6 -0
  559. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/expect.txt +1 -1
  560. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/scripts/session-note.sh +6 -0
  561. package/payload/gate-sdk/gate-tests/check-template-copy-parity.test.sh +1 -1
  562. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/args +2 -0
  563. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/drift-kit/templates/kpis.list +18 -0
  564. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/expect.txt +2 -0
  565. package/payload/gate-sdk/gate-tests/{check-smoke-entry-guard/bad/scripts/gate-sdk-config.sh → check-template-registry-parity/bad/scripts/gate-sdk-config.knobs} +2 -3
  566. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/args +3 -1
  567. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/drift-kit/templates/kpis.list +17 -0
  568. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/expect.txt +1 -1
  569. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/scripts/gate-sdk-config.knobs +4 -0
  570. package/payload/gate-sdk/gate-tests/check-test-hermetic-smoke.test.sh +5 -5
  571. package/payload/gate-sdk/gate-tests/check-tree-terms/bad/expect.txt +1 -0
  572. package/payload/gate-sdk/gate-tests/check-tree-terms/bad/patterns.list +4 -0
  573. package/payload/gate-sdk/gate-tests/check-tree-terms/bad/tree/accounts.txt +1 -0
  574. package/payload/gate-sdk/gate-tests/check-tree-terms/good/expect.txt +1 -1
  575. package/payload/gate-sdk/gate-tests/check-tree-terms/good/patterns.list +5 -1
  576. package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/anchored.txt +1 -0
  577. package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/handles.txt +2 -0
  578. package/payload/gate-sdk/gate-tests/check-tree-terms.test.sh +44 -5
  579. package/payload/gate-sdk/gate-tests/emit-arm-shape.test.sh +95 -0
  580. package/payload/gate-sdk/gate-tests/enforcement-map.test.sh +10 -10
  581. package/payload/gate-sdk/gate-tests/lib-gate.test.sh +10 -184
  582. package/payload/gate-sdk/gate-tests/reads-census.test.sh +96 -0
  583. package/payload/gate-sdk/gate-tests/run-arm-contract.test.sh +190 -0
  584. package/payload/gate-sdk/gate-tests/run-dispatch-streams.test.sh +64 -41
  585. package/payload/gate-sdk/gate-tests/run-for-path.test.sh +2 -2
  586. package/payload/gate-sdk/gate-tests/run-gate-tests.test.sh +121 -16
  587. package/payload/gate-sdk/gate-tests/run-gates-linked-worktree.test.sh +136 -0
  588. package/payload/gate-sdk/lib/gate.sh +231 -484
  589. package/payload/gate-sdk/lib/test-hermetic.sh +39 -9
  590. package/payload/gate-sdk/templates/check-skeleton.sh +3 -2
  591. package/payload/gate-sdk/templates/gates-workflow.yml +23 -10
  592. package/payload/gate-sdk/templates/msg-patterns.list +14 -5
  593. package/payload/gate-sdk/templates/portability-patterns.list +56 -0
  594. package/payload/guard-kit/README.md +43 -47
  595. package/payload/guard-kit/checks/check-door-binding.gate +3 -0
  596. package/payload/guard-kit/gate-tests/check-door-binding/bad/alpha-kit/README.md +6 -0
  597. package/payload/guard-kit/gate-tests/check-door-binding/bad/alpha-kit/templates/alpha-config.knobs +3 -0
  598. package/payload/guard-kit/gate-tests/check-door-binding/bad/args +5 -0
  599. package/payload/guard-kit/gate-tests/check-door-binding/bad/beta-kit/lib/beta.sh +6 -0
  600. package/payload/guard-kit/gate-tests/check-door-binding/bad/expect.txt +5 -0
  601. package/payload/guard-kit/gate-tests/check-door-binding/bad/scripts/gate-sdk-config.knobs +4 -0
  602. package/payload/guard-kit/gate-tests/check-door-binding/bad/scripts/guard-config.knobs +3 -0
  603. package/payload/guard-kit/gate-tests/check-door-binding/bad/site/banner.md +8 -0
  604. package/payload/guard-kit/gate-tests/check-door-binding/bad/site/landing.md +11 -0
  605. package/payload/guard-kit/gate-tests/check-door-binding/good/alpha-kit/README.md +8 -0
  606. package/payload/guard-kit/gate-tests/check-door-binding/good/alpha-kit/templates/settings-hooks.json +20 -0
  607. package/payload/guard-kit/gate-tests/check-door-binding/good/args +7 -0
  608. package/payload/guard-kit/gate-tests/check-door-binding/good/beta-kit/lib/beta.sh +6 -0
  609. package/payload/guard-kit/gate-tests/check-door-binding/good/expect.txt +1 -0
  610. package/payload/guard-kit/gate-tests/check-door-binding/good/scripts/gate-sdk-config.knobs +4 -0
  611. package/payload/guard-kit/gate-tests/check-door-binding/good/scripts/guard-config.knobs +3 -0
  612. package/payload/guard-kit/gate-tests/check-door-binding/good/site/mirror.md +12 -0
  613. package/payload/guard-kit/gate-tests/check-door-binding/good/site/register.md +24 -0
  614. package/payload/guard-kit/gate-tests/compare-settings-allow.test.sh +40 -27
  615. package/payload/guard-kit/gate-tests/consumer-rules.test.sh +189 -0
  616. package/payload/guard-kit/gate-tests/door-binding-corpus.test.sh +72 -0
  617. package/payload/guard-kit/gate-tests/git-mutation-under-producer.test.sh +48 -23
  618. package/payload/guard-kit/gate-tests/guard-config-knobs.test.sh +170 -0
  619. package/payload/guard-kit/gate-tests/rewrite.test.sh +73 -0
  620. package/payload/guard-kit/gate-tests/scan-prompts.test.sh +174 -8
  621. package/payload/guard-kit/gate-tests/scratch-run.test.sh +149 -13
  622. package/payload/guard-kit/gate-tests/worktree-confinement.test.sh +169 -0
  623. package/payload/guard-kit/guard-tests/background-cases.tsv +14 -5
  624. package/payload/guard-kit/guard-tests/cases.tsv +360 -54
  625. package/payload/guard-kit/guard-tests/powershell-background-cases.tsv +29 -0
  626. package/payload/guard-kit/guard-tests/powershell-cases.tsv +81 -0
  627. package/payload/guard-kit/templates/close-triage.md +15 -62
  628. package/payload/guard-kit/templates/guard-config.knobs +26 -0
  629. package/payload/guard-kit/templates/settings-allow.json +15 -0
  630. package/payload/guard-kit/templates/settings-hooks.json +5 -5
  631. package/payload/lifecycle-kit/README.md +48 -76
  632. package/payload/lifecycle-kit/checks/check-audit-roster.gate +3 -0
  633. package/payload/lifecycle-kit/checks/check-close-surfaces.gate +1 -1
  634. package/payload/lifecycle-kit/checks/check-dispatch-entry.gate +3 -0
  635. package/payload/lifecycle-kit/checks/check-gap-inbox-neutrality.gate +1 -1
  636. package/payload/lifecycle-kit/checks/check-lesson-disposition.gate +1 -1
  637. package/payload/lifecycle-kit/checks/check-lifecycle-registration.gate +1 -1
  638. package/payload/lifecycle-kit/checks/check-merge-attrs.gate +1 -1
  639. package/payload/lifecycle-kit/checks/check-scratch-citation.gate +1 -1
  640. package/payload/lifecycle-kit/checks/check-shim-restatement.gate +1 -1
  641. package/payload/lifecycle-kit/checks/check-skill-binding.gate +1 -1
  642. package/payload/lifecycle-kit/checks/check-stage-entry.gate +2 -2
  643. package/payload/lifecycle-kit/checks/check-stage-evidence.gate +1 -1
  644. package/payload/lifecycle-kit/checks/check-stage-skill-coverage.gate +2 -2
  645. package/payload/lifecycle-kit/checks/check-stamp-subject.gate +3 -0
  646. package/payload/lifecycle-kit/checks/check-survey-record.gate +2 -2
  647. package/payload/lifecycle-kit/gate-tests/boundary-scratch-wipe.test.sh +93 -18
  648. package/payload/lifecycle-kit/gate-tests/boundary-stage-journal.test.sh +196 -0
  649. package/payload/lifecycle-kit/gate-tests/boundary-worktree-refusal.test.sh +214 -0
  650. package/payload/lifecycle-kit/gate-tests/check-audit-roster/bad/args +2 -0
  651. package/payload/lifecycle-kit/gate-tests/check-audit-roster/bad/expect.txt +6 -0
  652. package/payload/lifecycle-kit/gate-tests/check-audit-roster/bad/roster.txt +34 -0
  653. package/payload/lifecycle-kit/gate-tests/check-audit-roster/good/args +2 -0
  654. package/payload/lifecycle-kit/gate-tests/check-audit-roster/good/expect.txt +1 -0
  655. package/payload/lifecycle-kit/gate-tests/check-audit-roster/good/roster.txt +22 -0
  656. package/payload/lifecycle-kit/gate-tests/check-audit-roster.test.sh +101 -0
  657. package/payload/lifecycle-kit/gate-tests/check-close-surfaces/bad/scripts/lifecycle-config.knobs +2 -0
  658. package/payload/lifecycle-kit/gate-tests/check-close-surfaces/good/owners/worktrees/inbox.md +5 -0
  659. package/payload/lifecycle-kit/gate-tests/check-close-surfaces/good/scripts/lifecycle-config.knobs +2 -0
  660. package/payload/lifecycle-kit/gate-tests/check-close-surfaces.test.sh +21 -4
  661. package/payload/lifecycle-kit/gate-tests/check-dispatch-entry/bad/args +6 -0
  662. package/payload/lifecycle-kit/gate-tests/check-dispatch-entry/bad/expect.txt +1 -0
  663. package/payload/lifecycle-kit/gate-tests/check-dispatch-entry/bad/head.txt +5 -0
  664. package/payload/lifecycle-kit/gate-tests/check-dispatch-entry/bad/marker.txt +1 -0
  665. package/payload/lifecycle-kit/gate-tests/check-dispatch-entry/bad/msg.txt +4 -0
  666. package/payload/lifecycle-kit/gate-tests/check-dispatch-entry/bad/paths.txt +1 -0
  667. package/payload/lifecycle-kit/gate-tests/check-dispatch-entry/bad/staged.txt +5 -0
  668. package/payload/lifecycle-kit/gate-tests/check-dispatch-entry/good/args +6 -0
  669. package/payload/lifecycle-kit/gate-tests/check-dispatch-entry/good/expect.txt +1 -0
  670. package/payload/lifecycle-kit/gate-tests/check-dispatch-entry/good/head.txt +5 -0
  671. package/payload/lifecycle-kit/gate-tests/check-dispatch-entry/good/marker.txt +1 -0
  672. package/payload/lifecycle-kit/gate-tests/check-dispatch-entry/good/msg.txt +4 -0
  673. package/payload/lifecycle-kit/gate-tests/check-dispatch-entry/good/paths.txt +2 -0
  674. package/payload/lifecycle-kit/gate-tests/check-dispatch-entry/good/staged.txt +6 -0
  675. package/payload/lifecycle-kit/gate-tests/check-dispatch-entry.test.sh +60 -0
  676. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition.test.sh +1 -1
  677. package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration/bad/AGENT.md +1 -5
  678. package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration/good/AGENT.md +1 -5
  679. package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration.test.sh +1 -1
  680. package/payload/lifecycle-kit/gate-tests/check-merge-attrs.test.sh +2 -2
  681. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/scripts/lifecycle-config.knobs +2 -0
  682. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/scripts/lifecycle-config.knobs +2 -0
  683. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/surfaces/worktrees/queue.md +13 -0
  684. package/payload/lifecycle-kit/gate-tests/check-shim-restatement.test.sh +1 -1
  685. package/payload/lifecycle-kit/gate-tests/check-skill-binding.test.sh +1 -1
  686. package/payload/lifecycle-kit/gate-tests/check-stage-entry.test.sh +158 -11
  687. package/payload/lifecycle-kit/gate-tests/check-stage-evidence.test.sh +27 -2
  688. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/commands/align.md +4 -1
  689. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/commands/build.md +4 -1
  690. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/commands/close.md +5 -0
  691. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/commands/scope.md +4 -1
  692. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/commands/validate.md +1 -1
  693. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/expect.txt +1 -1
  694. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/commands/align.md +4 -1
  695. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/commands/build.md +4 -1
  696. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/commands/close.md +4 -1
  697. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/commands/scope.md +4 -1
  698. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/commands/validate.md +4 -1
  699. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage.test.sh +73 -0
  700. package/payload/lifecycle-kit/gate-tests/check-stamp-subject/bad/args +4 -0
  701. package/payload/lifecycle-kit/gate-tests/check-stamp-subject/bad/expect.txt +1 -0
  702. package/payload/lifecycle-kit/gate-tests/check-stamp-subject/bad/head.txt +5 -0
  703. package/payload/lifecycle-kit/gate-tests/check-stamp-subject/bad/msg.txt +4 -0
  704. package/payload/lifecycle-kit/gate-tests/check-stamp-subject/bad/staged.txt +6 -0
  705. package/payload/lifecycle-kit/gate-tests/check-stamp-subject/good/args +4 -0
  706. package/payload/lifecycle-kit/gate-tests/check-stamp-subject/good/expect.txt +1 -0
  707. package/payload/lifecycle-kit/gate-tests/check-stamp-subject/good/head.txt +5 -0
  708. package/payload/lifecycle-kit/gate-tests/check-stamp-subject/good/msg.txt +4 -0
  709. package/payload/lifecycle-kit/gate-tests/check-stamp-subject/good/staged.txt +7 -0
  710. package/payload/lifecycle-kit/gate-tests/check-stamp-subject.test.sh +59 -0
  711. package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/expect.txt +3 -0
  712. package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/record.md +24 -0
  713. package/payload/lifecycle-kit/gate-tests/check-survey-record/good/expect.txt +1 -1
  714. package/payload/lifecycle-kit/gate-tests/check-survey-record/good/record.md +10 -0
  715. package/payload/lifecycle-kit/gate-tests/check-survey-record.test.sh +56 -5
  716. package/payload/lifecycle-kit/gate-tests/dispatch-marker.test.sh +152 -0
  717. package/payload/lifecycle-kit/gate-tests/file-gap-recurrence.test.sh +23 -48
  718. package/payload/lifecycle-kit/gate-tests/gap-inbox-route.test.sh +7 -5
  719. package/payload/lifecycle-kit/gate-tests/lead-journal-open.test.sh +119 -0
  720. package/payload/lifecycle-kit/gate-tests/preflight-valve.test.sh +170 -0
  721. package/payload/lifecycle-kit/gate-tests/rename-iteration.test.sh +5 -3
  722. package/payload/lifecycle-kit/gate-tests/ruling-staleness.test.sh +89 -0
  723. package/payload/lifecycle-kit/gate-tests/stamp-before-write.test.sh +66 -0
  724. package/payload/lifecycle-kit/gate-tests/survey-record-entry.test.sh +12 -6
  725. package/payload/lifecycle-kit/templates/consult.md +9 -63
  726. package/payload/lifecycle-kit/templates/lead.md +143 -431
  727. package/payload/lifecycle-kit/templates/lifecycle-config.knobs +1 -0
  728. package/payload/lifecycle-kit/templates/release-sweep.md +6 -35
  729. package/payload/lifecycle-kit/templates/stages/align.md +14 -82
  730. package/payload/lifecycle-kit/templates/stages/build.md +30 -98
  731. package/payload/lifecycle-kit/templates/stages/close.md +21 -170
  732. package/payload/lifecycle-kit/templates/stages/scope.md +42 -167
  733. package/payload/lifecycle-kit/templates/stages/spec.md +31 -97
  734. package/payload/lifecycle-kit/templates/stages/validate.md +22 -59
  735. package/payload/lifecycle-kit/templates/upgrade.md +6 -37
  736. package/payload/queue-kit/README.md +33 -48
  737. package/payload/queue-kit/checks/check-deferred-board-tags.gate +3 -0
  738. package/payload/queue-kit/checks/check-queue-entry-budget.gate +2 -2
  739. package/payload/queue-kit/checks/check-queue-hygiene.gate +2 -2
  740. package/payload/queue-kit/checks/check-queue-prose-precondition.gate +1 -1
  741. package/payload/queue-kit/checks/check-queue-sections.gate +1 -1
  742. package/payload/queue-kit/checks/check-queue-slug-liveness.gate +2 -2
  743. package/payload/queue-kit/checks/check-queue-wrap.gate +2 -2
  744. package/payload/queue-kit/checks/check-roadmap-fresh.gate +3 -2
  745. package/payload/queue-kit/checks/check-tag-lead-line.gate +2 -2
  746. package/payload/queue-kit/checks/check-task-conservation.gate +1 -1
  747. package/payload/queue-kit/checks/check-task-names.gate +2 -2
  748. package/payload/queue-kit/gate-tests/check-deferred-board-tags/bad/TASK-QUEUE.md +41 -0
  749. package/payload/queue-kit/gate-tests/check-deferred-board-tags/bad/expect.txt +6 -0
  750. package/payload/queue-kit/gate-tests/check-deferred-board-tags/bad/widget-kit/README.md +3 -0
  751. package/payload/queue-kit/gate-tests/check-deferred-board-tags/good/TASK-QUEUE.md +39 -0
  752. package/payload/queue-kit/gate-tests/check-deferred-board-tags/good/expect.txt +1 -0
  753. package/payload/queue-kit/gate-tests/check-deferred-board-tags/good/widget-kit/README.md +3 -0
  754. package/payload/queue-kit/gate-tests/check-queue-entry-budget/bad/TASK-QUEUE.md +76 -31
  755. package/payload/queue-kit/gate-tests/check-queue-entry-budget/bad/expect.txt +12 -4
  756. package/payload/queue-kit/gate-tests/check-queue-entry-budget/bad/scripts/queue-config.knobs +4 -0
  757. package/payload/queue-kit/gate-tests/check-queue-entry-budget/good/TASK-QUEUE.md +58 -19
  758. package/payload/queue-kit/gate-tests/check-queue-entry-budget/good/expect.txt +8 -4
  759. package/payload/queue-kit/gate-tests/check-queue-entry-budget/good/scripts/queue-config.knobs +4 -0
  760. package/payload/queue-kit/gate-tests/check-queue-entry-budget.test.sh +124 -0
  761. package/payload/queue-kit/gate-tests/check-queue-hygiene/bad/TASK-QUEUE.md +11 -1
  762. package/payload/queue-kit/gate-tests/check-queue-hygiene/bad/expect.txt +2 -0
  763. package/payload/queue-kit/gate-tests/check-queue-hygiene/good/TASK-QUEUE.md +30 -11
  764. package/payload/queue-kit/gate-tests/check-queue-prose-precondition/bad/TASK-QUEUE.md +3 -1
  765. package/payload/queue-kit/gate-tests/check-queue-prose-precondition/bad/expect.txt +1 -0
  766. package/payload/queue-kit/gate-tests/check-queue-prose-precondition/good/TASK-QUEUE.md +22 -6
  767. package/payload/queue-kit/gate-tests/check-queue-slug-liveness/bad/TASK-QUEUE.md +3 -1
  768. package/payload/queue-kit/gate-tests/check-queue-slug-liveness/bad/docs/page.md +1 -1
  769. package/payload/queue-kit/gate-tests/check-queue-slug-liveness/bad/expect.txt +3 -1
  770. package/payload/queue-kit/gate-tests/check-queue-slug-liveness/bad/scripts/queue-config.knobs +1 -0
  771. package/payload/queue-kit/gate-tests/check-queue-slug-liveness/good/TASK-QUEUE.md +6 -2
  772. package/payload/queue-kit/gate-tests/check-queue-slug-liveness/good/docs/page.md +3 -3
  773. package/payload/queue-kit/gate-tests/check-queue-slug-liveness/good/docs/worktrees/page.md +4 -0
  774. package/payload/queue-kit/gate-tests/check-queue-slug-liveness/good/scripts/queue-config.knobs +1 -0
  775. package/payload/queue-kit/gate-tests/check-queue-slug-liveness.test.sh +100 -0
  776. package/payload/queue-kit/gate-tests/check-queue-wrap/bad/TASK-QUEUE.md +3 -1
  777. package/payload/queue-kit/gate-tests/check-queue-wrap/good/TASK-QUEUE.md +20 -6
  778. package/payload/queue-kit/gate-tests/check-roadmap-fresh/bad/TASK-QUEUE.md +15 -8
  779. package/payload/queue-kit/gate-tests/check-roadmap-fresh/bad/scripts/queue-config.knobs +5 -0
  780. package/payload/queue-kit/gate-tests/check-roadmap-fresh/good/TASK-QUEUE.md +13 -6
  781. package/payload/queue-kit/gate-tests/check-roadmap-fresh/good/scripts/queue-config.knobs +5 -0
  782. package/payload/queue-kit/gate-tests/check-tag-lead-line/bad/TASK-QUEUE.md +28 -7
  783. package/payload/queue-kit/gate-tests/check-tag-lead-line/bad/expect.txt +10 -2
  784. package/payload/queue-kit/gate-tests/check-tag-lead-line/good/TASK-QUEUE.md +30 -8
  785. package/payload/queue-kit/gate-tests/check-task-names/bad/TASK-QUEUE.md +18 -3
  786. package/payload/queue-kit/gate-tests/check-task-names/bad/expect.txt +9 -0
  787. package/payload/queue-kit/gate-tests/check-task-names/good/TASK-QUEUE.md +20 -6
  788. package/payload/queue-kit/gate-tests/entry-history.test.sh +197 -0
  789. package/payload/queue-kit/gate-tests/queue-counts.test.sh +77 -73
  790. package/payload/queue-kit/gate-tests/queue-edges.test.sh +168 -87
  791. package/payload/queue-kit/gate-tests/queue-index.test.sh +30 -16
  792. package/payload/queue-kit/gate-tests/roadmap.test.sh +65 -58
  793. package/payload/queue-kit/templates/TASK-QUEUE.md +36 -23
  794. package/payload/queue-kit/templates/queue-config.knobs +1 -0
  795. package/payload/site-kit/README.md +26 -45
  796. package/payload/site-kit/checks/check-docs-cname-parity.gate +1 -1
  797. package/payload/site-kit/checks/check-docs-highlight-coverage.gate +4 -0
  798. package/payload/site-kit/checks/check-docs-liquid-parse.gate +3 -0
  799. package/payload/site-kit/checks/check-docs-render-fidelity.gate +3 -0
  800. package/payload/site-kit/gate-tests/check-docs-cname-parity/bad/args +1 -1
  801. package/payload/site-kit/gate-tests/check-docs-cname-parity/bad/scripts/site-config.knobs +2 -0
  802. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/args +2 -2
  803. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/scripts/site-config.knobs +2 -0
  804. package/payload/site-kit/gate-tests/check-docs-highlight-coverage/bad/docs/_layouts/default.html +11 -0
  805. package/payload/site-kit/gate-tests/check-docs-highlight-coverage/bad/expect.txt +4 -0
  806. package/payload/site-kit/gate-tests/check-docs-highlight-coverage/bad/scripts/highlight-tokens.list +7 -0
  807. package/payload/site-kit/gate-tests/check-docs-highlight-coverage/bad/scripts/site-config.knobs +3 -0
  808. package/payload/site-kit/gate-tests/check-docs-highlight-coverage/good/docs/_layouts/default.html +14 -0
  809. package/payload/site-kit/gate-tests/check-docs-highlight-coverage/good/expect.txt +1 -0
  810. package/payload/site-kit/gate-tests/check-docs-highlight-coverage/good/scripts/highlight-tokens.list +7 -0
  811. package/payload/site-kit/gate-tests/check-docs-highlight-coverage/good/scripts/site-config.knobs +1 -0
  812. package/payload/site-kit/gate-tests/check-docs-liquid-parse/bad/docs/_layouts/default.html +4 -0
  813. package/payload/site-kit/gate-tests/check-docs-liquid-parse/bad/docs/span.md +3 -0
  814. package/payload/site-kit/gate-tests/check-docs-liquid-parse/bad/expect.txt +2 -0
  815. package/payload/site-kit/gate-tests/check-docs-liquid-parse/good/docs/_layouts/default.html +4 -0
  816. package/payload/site-kit/gate-tests/check-docs-liquid-parse/good/docs/front.md +7 -0
  817. package/payload/site-kit/gate-tests/check-docs-liquid-parse/good/docs/loop.md +5 -0
  818. package/payload/site-kit/gate-tests/check-docs-liquid-parse/good/docs/plain.html +1 -0
  819. package/payload/site-kit/gate-tests/check-docs-liquid-parse/good/docs/raw.md +3 -0
  820. package/payload/site-kit/gate-tests/check-docs-liquid-parse/good/docs/search.json +4 -0
  821. package/payload/site-kit/gate-tests/check-docs-liquid-parse/good/expect.txt +1 -0
  822. package/payload/site-kit/gate-tests/check-docs-liquid-parse-parser.test.sh +62 -0
  823. package/payload/site-kit/gate-tests/check-docs-render-fidelity-batch.test.sh +40 -45
  824. package/payload/site-kit/gate-tests/check-docs-render-fidelity-foreign.test.sh +7 -4
  825. package/payload/site-kit/gate-tests/check-docs-render-fidelity-span.test.sh +7 -4
  826. package/payload/site-kit/gate-tests/check-docs-render-fidelity-table.test.sh +7 -4
  827. package/payload/site-kit/templates/site-health.yml +67 -4
  828. package/profiles.list +4 -5
  829. package/lib/common/digest.sh +0 -18
  830. package/lib/common/lock.sh +0 -75
  831. package/lib/common/profile.sh +0 -91
  832. package/lib/common/recipe.sh +0 -106
  833. package/lib/diff.sh +0 -66
  834. package/lib/doctor.sh +0 -164
  835. package/lib/init.sh +0 -428
  836. package/lib/uninstall.sh +0 -214
  837. package/lib/update.sh +0 -34
  838. package/payload/canon-kit/SPEC.md +0 -2443
  839. package/payload/canon-kit/checks/check-surface-duplication.sh +0 -106
  840. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/scripts/canon-config.sh +0 -6
  841. package/payload/canon-kit/gate-tests/check-deprecation-task/good/scripts/canon-config.sh +0 -6
  842. package/payload/canon-kit/gate-tests/check-install-claim/bad/scripts/canon-config.sh +0 -10
  843. package/payload/canon-kit/gate-tests/check-install-claim/good/scripts/canon-config.sh +0 -10
  844. package/payload/canon-kit/gate-tests/check-measured-claim/bad/scripts/canon-config.sh +0 -6
  845. package/payload/canon-kit/gate-tests/check-measured-claim/good/scripts/canon-config.sh +0 -6
  846. package/payload/canon-kit/gate-tests/check-payload-claim/bad/scripts/canon-config.sh +0 -8
  847. package/payload/canon-kit/gate-tests/check-payload-claim/good/scripts/canon-config.sh +0 -8
  848. package/payload/canon-kit/gate-tests/check-prose-enum/bad/scripts/canon-config.sh +0 -4
  849. package/payload/canon-kit/gate-tests/check-prose-enum/good/scripts/canon-config.sh +0 -4
  850. package/payload/canon-kit/gate-tests/check-prose-tells/bad/scripts/canon-config.sh +0 -8
  851. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/scripts/canon-config.sh +0 -5
  852. package/payload/canon-kit/gate-tests/check-spec-pointer/good/scripts/canon-config.sh +0 -5
  853. package/payload/canon-kit/gate-tests/check-unmarked-claim/bad/scripts/canon-config.sh +0 -6
  854. package/payload/canon-kit/gate-tests/check-unmarked-claim/good/scripts/canon-config.sh +0 -6
  855. package/payload/canon-kit/lib/spec.sh +0 -560
  856. package/payload/canon-kit/smoke/install.sh +0 -58
  857. package/payload/canon-kit/smoke/violation.sh +0 -22
  858. package/payload/canon-kit/templates/canon-config.sh +0 -2
  859. package/payload/context-kit/SPEC.md +0 -1134
  860. package/payload/context-kit/bin/always-loaded.sh +0 -70
  861. package/payload/context-kit/bin/env-probe.sh +0 -142
  862. package/payload/context-kit/bin/md-index.sh +0 -80
  863. package/payload/context-kit/bin/md-section.sh +0 -63
  864. package/payload/context-kit/bin/pub-index.sh +0 -90
  865. package/payload/context-kit/bin/run-index-tests.sh +0 -91
  866. package/payload/context-kit/gate-tests/check-footprint-fresh/good/args +0 -4
  867. package/payload/context-kit/gate-tests/check-footprint-fresh/good/emit.txt +0 -12
  868. package/payload/context-kit/gate-tests/check-footprint-fresh/good/projection.txt +0 -12
  869. package/payload/context-kit/index-tests/expected/toolfloor.txt +0 -23
  870. package/payload/context-kit/index-tests/toolfloor-cases.sh +0 -49
  871. package/payload/context-kit/lib/context.sh +0 -56
  872. package/payload/context-kit/lib/pub-lang/rust.sh +0 -26
  873. package/payload/context-kit/lib/pub-lang/ts.sh +0 -32
  874. package/payload/context-kit/lib/toolfloor.sh +0 -58
  875. package/payload/context-kit/smoke/agents-md.sh +0 -139
  876. package/payload/context-kit/smoke/install.sh +0 -64
  877. package/payload/context-kit/smoke/violation.sh +0 -21
  878. package/payload/context-kit/templates/context-config.sh +0 -2
  879. package/payload/delegation-kit/SPEC.md +0 -2078
  880. package/payload/delegation-kit/bin/run-budget-guard-tests.sh +0 -88
  881. package/payload/delegation-kit/bin/run-dispatch-guard-tests.sh +0 -97
  882. package/payload/delegation-kit/bin/run-trend-tests.sh +0 -63
  883. package/payload/delegation-kit/bin/run-usage-tests.sh +0 -226
  884. package/payload/delegation-kit/bin/usage-trend.sh +0 -120
  885. package/payload/delegation-kit/bin/usage-verdict.sh +0 -144
  886. package/payload/delegation-kit/bin/wait-probe.sh +0 -184
  887. package/payload/delegation-kit/gate-tests/subagent-stop-liveness.test.sh +0 -99
  888. package/payload/delegation-kit/lib/delegation.sh +0 -84
  889. package/payload/delegation-kit/smoke/install.sh +0 -83
  890. package/payload/delegation-kit/smoke/violation.sh +0 -16
  891. package/payload/delegation-kit/templates/agent-budget-guard.sh +0 -18
  892. package/payload/delegation-kit/templates/agent-dispatch-guard.sh +0 -61
  893. package/payload/delegation-kit/templates/delegation-config.sh +0 -6
  894. package/payload/delegation-kit/templates/statusline-usage.sh +0 -101
  895. package/payload/delegation-kit/templates/subagent-stop-liveness.sh +0 -56
  896. package/payload/delegation-kit/templates/usage-poller.sh +0 -67
  897. package/payload/delegation-kit/usage-tests/budget-guard-cases.tsv +0 -20
  898. package/payload/doctrine-kit/SPEC.md +0 -385
  899. package/payload/doctrine-kit/bin/install-doctrine.sh +0 -194
  900. package/payload/doctrine-kit/bin/stage-rules.sh +0 -51
  901. package/payload/doctrine-kit/lib/doctrine.sh +0 -29
  902. package/payload/doctrine-kit/smoke/install.sh +0 -203
  903. package/payload/doctrine-kit/smoke/violation.sh +0 -13
  904. package/payload/drift-kit/SPEC.md +0 -1187
  905. package/payload/drift-kit/bin/drift-report.sh +0 -155
  906. package/payload/drift-kit/bin/kfric.sh +0 -61
  907. package/payload/drift-kit/bin/overhead-meter.sh +0 -106
  908. package/payload/drift-kit/bin/stage-economics.sh +0 -465
  909. package/payload/drift-kit/kpis/kpi-always-loaded.sh +0 -39
  910. package/payload/drift-kit/kpis/kpi-amendment-age.sh +0 -33
  911. package/payload/drift-kit/kpis/kpi-deferred-age.sh +0 -46
  912. package/payload/drift-kit/kpis/kpi-gate-backlog.sh +0 -52
  913. package/payload/drift-kit/kpis/kpi-gate-runtime.sh +0 -31
  914. package/payload/drift-kit/kpis/kpi-incident-recurrence.sh +0 -42
  915. package/payload/drift-kit/kpis/kpi-knowledge-friction.sh +0 -21
  916. package/payload/drift-kit/kpis/kpi-overhead.sh +0 -44
  917. package/payload/drift-kit/kpis/kpi-price-table-age.sh +0 -68
  918. package/payload/drift-kit/kpis/kpi-prompt-friction.sh +0 -38
  919. package/payload/drift-kit/kpis/kpi-queue-net-delta.sh +0 -74
  920. package/payload/drift-kit/kpis/kpi-settings-local.sh +0 -21
  921. package/payload/drift-kit/kpis/kpi-task-split.sh +0 -43
  922. package/payload/drift-kit/lib/drift.sh +0 -43
  923. package/payload/drift-kit/smoke/install.sh +0 -537
  924. package/payload/drift-kit/smoke/overhead-fixture.jsonl +0 -4
  925. package/payload/drift-kit/templates/drift-config.sh +0 -2
  926. package/payload/evidence-kit/SPEC.md +0 -740
  927. package/payload/evidence-kit/bin/diff-baseline.sh +0 -34
  928. package/payload/evidence-kit/bin/run-validate.sh +0 -124
  929. package/payload/evidence-kit/checks/check-producer-liveness.sh +0 -75
  930. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/scripts/evidence-config.sh +0 -7
  931. package/payload/evidence-kit/gate-tests/check-battery-roster/good/scripts/evidence-config.sh +0 -7
  932. package/payload/evidence-kit/lib/evidence.sh +0 -193
  933. package/payload/evidence-kit/smoke/install.sh +0 -59
  934. package/payload/evidence-kit/smoke/violation.sh +0 -8
  935. package/payload/evidence-kit/templates/evidence-config.sh +0 -2
  936. package/payload/gate-sdk/SPEC.md +0 -10872
  937. package/payload/gate-sdk/bin/gen-pre-commit.sh +0 -297
  938. package/payload/gate-sdk/bin/install-hooks.sh +0 -60
  939. package/payload/gate-sdk/bin/port-blockers.sh +0 -473
  940. package/payload/gate-sdk/bin/run-consumer-smoke.sh +0 -239
  941. package/payload/gate-sdk/bin/run-gate-tests.sh +0 -179
  942. package/payload/gate-sdk/bin/upgrade-smoke.sh +0 -236
  943. package/payload/gate-sdk/checks/check-action-run-shell.sh +0 -223
  944. package/payload/gate-sdk/checks/check-crate-arms.sh +0 -62
  945. package/payload/gate-sdk/checks/check-gate-substrate-parity.sh +0 -450
  946. package/payload/gate-sdk/checks/check-install-disposition.sh +0 -93
  947. package/payload/gate-sdk/checks/check-shellcheck.sh +0 -57
  948. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/scripts/gate-sdk-config.sh +0 -2
  949. package/payload/gate-sdk/gate-tests/check-crate-arms/good/scripts/gate-sdk-config.sh +0 -2
  950. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/good/args +0 -4
  951. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/good/emit.txt +0 -14
  952. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/good/projection.txt +0 -14
  953. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/gate-sdk-config.sh +0 -2
  954. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/gate-sdk-config.sh +0 -2
  955. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gate-sdk-config.sh +0 -6
  956. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/stub-bin +0 -3
  957. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gate-sdk-config.sh +0 -6
  958. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/stub-bin +0 -3
  959. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/installer/lib/common/recipe.sh +0 -9
  960. package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-beta.gate +0 -3
  961. package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-gamma.sh +0 -6
  962. package/payload/gate-sdk/gate-tests/check-install-disposition/good/installer/lib/common/recipe.sh +0 -10
  963. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/scripts/gate-sdk-config.sh +0 -5
  964. package/payload/gate-sdk/gate-tests/check-readme-roster/good/scripts/gate-sdk-config.sh +0 -5
  965. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/good/scripts/gate-sdk-config.sh +0 -5
  966. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/scripts/gate-sdk-config.sh +0 -5
  967. package/payload/gate-sdk/gate-tests/declaration-lib-parity.test.sh +0 -211
  968. package/payload/gate-sdk/gate-tests/lib-declaration.test.sh +0 -112
  969. package/payload/gate-sdk/lib/consumer-smoke.sh +0 -69
  970. package/payload/gate-sdk/lib/declaration.sh +0 -59
  971. package/payload/gate-sdk/lib/inject.sh +0 -80
  972. package/payload/gate-sdk/smoke/install.sh +0 -171
  973. package/payload/gate-sdk/smoke/violation.sh +0 -13
  974. package/payload/guard-kit/SPEC.md +0 -1415
  975. package/payload/guard-kit/bin/compare-settings-allow.sh +0 -115
  976. package/payload/guard-kit/bin/run-guard-tests.sh +0 -110
  977. package/payload/guard-kit/bin/scan-prompts.sh +0 -166
  978. package/payload/guard-kit/bin/scratch-run.sh +0 -34
  979. package/payload/guard-kit/gate-tests/guard-read-path.test.sh +0 -52
  980. package/payload/guard-kit/lib/guard.sh +0 -1014
  981. package/payload/guard-kit/smoke/install.sh +0 -26
  982. package/payload/guard-kit/templates/bash-guard.sh +0 -20
  983. package/payload/guard-kit/templates/escalation-guard.sh +0 -27
  984. package/payload/guard-kit/templates/guard-config.sh +0 -8
  985. package/payload/guard-kit/templates/wakeup-guard.sh +0 -20
  986. package/payload/lifecycle-kit/SPEC.md +0 -2884
  987. package/payload/lifecycle-kit/bin/cite-survey.sh +0 -81
  988. package/payload/lifecycle-kit/bin/enter-stage.sh +0 -380
  989. package/payload/lifecycle-kit/bin/file-gap.sh +0 -101
  990. package/payload/lifecycle-kit/bin/file-survey.sh +0 -69
  991. package/payload/lifecycle-kit/bin/install-lifecycle.sh +0 -36
  992. package/payload/lifecycle-kit/bin/session-id.sh +0 -75
  993. package/payload/lifecycle-kit/gate-tests/check-close-surfaces/bad/scripts/lifecycle-config.sh +0 -4
  994. package/payload/lifecycle-kit/gate-tests/check-close-surfaces/good/scripts/lifecycle-config.sh +0 -4
  995. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/scripts/lifecycle-config.sh +0 -4
  996. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/scripts/lifecycle-config.sh +0 -4
  997. package/payload/lifecycle-kit/gate-tests/workflow-state-guard.test.sh +0 -100
  998. package/payload/lifecycle-kit/lib/stages.sh +0 -194
  999. package/payload/lifecycle-kit/smoke/install.sh +0 -434
  1000. package/payload/lifecycle-kit/smoke/violation.sh +0 -8
  1001. package/payload/lifecycle-kit/templates/lifecycle-config.sh +0 -2
  1002. package/payload/lifecycle-kit/templates/workflow-state-guard.sh +0 -29
  1003. package/payload/queue-kit/SPEC.md +0 -1436
  1004. package/payload/queue-kit/bin/lesson-sink.sh +0 -28
  1005. package/payload/queue-kit/bin/queue-counts.sh +0 -35
  1006. package/payload/queue-kit/bin/queue-edges.sh +0 -78
  1007. package/payload/queue-kit/gate-tests/check-queue-entry-budget/bad/scripts/queue-config.sh +0 -6
  1008. package/payload/queue-kit/gate-tests/check-queue-entry-budget/good/scripts/queue-config.sh +0 -6
  1009. package/payload/queue-kit/gate-tests/check-queue-slug-liveness/bad/scripts/queue-config.sh +0 -3
  1010. package/payload/queue-kit/gate-tests/check-queue-slug-liveness/good/scripts/queue-config.sh +0 -3
  1011. package/payload/queue-kit/gate-tests/check-roadmap-fresh/bad/scripts/queue-config.sh +0 -6
  1012. package/payload/queue-kit/gate-tests/check-roadmap-fresh/good/scripts/queue-config.sh +0 -6
  1013. package/payload/queue-kit/gate-tests/queue-lib-parity.test.sh +0 -215
  1014. package/payload/queue-kit/lib/queue.sh +0 -129
  1015. package/payload/queue-kit/smoke/install.sh +0 -25
  1016. package/payload/queue-kit/smoke/violation.sh +0 -8
  1017. package/payload/queue-kit/templates/queue-config.sh +0 -2
  1018. package/payload/site-kit/SPEC.md +0 -601
  1019. package/payload/site-kit/checks/check-docs-render-fidelity.sh +0 -242
  1020. package/payload/site-kit/gate-tests/check-docs-cname-parity/bad/scripts/site-config.sh +0 -7
  1021. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/scripts/site-config.sh +0 -7
  1022. package/payload/site-kit/lib/site.sh +0 -43
  1023. package/payload/site-kit/smoke/install.sh +0 -34
  1024. package/payload/site-kit/smoke/violation.sh +0 -20
  1025. /package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/{check-ported.gate → check-stage-entry.gate} +0 -0
@@ -1,2443 +0,0 @@
1
- # canon-kit — spec discipline for agent-authored components
2
-
3
- One canonical spec per component, deltas as short-lived amendment files, and
4
- a star topology across the prose surfaces: every fact has exactly one owning
5
- surface, and every other surface cites it — never restates it. The problem
6
- the kit solves: when coding agents author the specs, design rationale gets
7
- re-derived under build pressure unless it is captured up front, and a
8
- parallel copy of any gated fact is an un-gateable second source that drifts
9
- silently. The remedy is a lifecycle (amendments authored up front,
10
- merged and deleted at build) and gates over the copy-shaped failure modes.
11
-
12
- The kit carries the lifecycle, the checklists, and its gates; a consumer's
13
- surface names, banned headings, and scan languages are config, with this
14
- repo's layout as the defaults. Requires [gate-sdk](../gate-sdk/) (the gates
15
- follow its four contracts and resolve through its registry); the queue
16
- lifecycle gate reads the tag syntax [queue-kit](../queue-kit/) defines.
17
-
18
- ## The spec model
19
-
20
- Every component has exactly one canonical spec file (default `SPEC.md`) —
21
- complete, current, the single source of truth. A spec has three jobs, and
22
- "copying the code into prose" is not one of them:
23
-
24
- 1. **Owns semantics** — invariants, ordering, error behavior; the prose no
25
- other artifact carries.
26
- 2. **Names contracts** — every interface is named, and each name is tied to
27
- the implementation by a gate; a named-but-ungated contract is the rot
28
- vector.
29
- 3. **Never copies a structural definition** — reference the code, do not
30
- copy it. Anything readable from the code (exact types, field layouts,
31
- config values) is implementation, not spec content; an ungated verbatim
32
- copy drifts silently the moment the code changes
33
- (`check-spec-embedded-source`).
34
-
35
- A **SPEC amendment** (default glob `SPEC-*.md`, in the owning component's
36
- directory) is the delta artifact for a designed-but-unimplemented change:
37
- it describes only what is added or changed, is named after the feature
38
- (`SPEC-sqlite.md`, never `SPEC-PHASE3-SQLITE.md`), and is a transition
39
- artifact — merged into the canonical spec and deleted when the work
40
- completes; an amendment never outlives its implementation. The one
41
- sanctioned copy exemption: an amendment may embed a wire-contract delta
42
- (e.g. a fenced proto block) until merge, because it is the design home for
43
- a contract that does not exist yet; the canonical spec cites the contract
44
- file, never re-embeds it. A ruling with no owning component (governance,
45
- workflow, gates) is a **root-level amendment**: same lifecycle, lives at
46
- the repo root, merges into the consumer's rulebook instead of a component
47
- spec.
48
-
49
- ## The amendment lifecycle
50
-
51
- Spec-writing is an **authoring-stage** activity, not a build activity — build
52
- sessions never author specs. The feature/debt litmus runs at filing in the
53
- scoping stage's triage; the amendment is *authored* in whichever stage the
54
- roster designates for it (scope by default, or a dedicated authoring stage where
55
- the roster splits one out).
56
- A feature task is therefore in exactly one of two states, marked with the
57
- queue tags whose syntax queue-kit defines:
58
-
59
- - **Design-pending** — no amendment yet; the entry sits in a **design-pending
60
- section** tagged `[design-pending]`, excluded from selection. That set is
61
- the deferred section plus, where the consumer configures one, queue-kit's
62
- optional icebox tier (`CANON_KIT_ICEBOX_SECTION`; the tier is
63
- queue-kit/SPEC.md §The icebox tier). A dormant entry is unbuilt design, so
64
- the state and its tag reach it unchanged. Every entry in the set carries the
65
- tag — all such work is design-pending by definition.
66
- The token names the *state*, not a promised artifact — a deferred **debt**
67
- entry promotes with the tag deleted rather than converted, and the tag has
68
- to be true of that entry too.
69
- - **Spec-ready** — the amendment exists; the entry sits in the feature
70
- section tagged `[spec: <ref>]`, eligible for selection.
71
-
72
- The **bidirectional rule**: every feature entry in the active queue carries
73
- a `[spec:]` ref that resolves to a file on disk, and every amendment on
74
- disk has a queue entry pointing at it. Writing the amendment *is* promoting
75
- the deferred entry — without the pairing, design rationale and ruled-out
76
- alternatives get re-derived under build pressure. Technical debt needs no
77
- amendment (it fixes behavior to an existing spec); a debt task that needs a
78
- design *ruling* is design work — it goes to the deferred section
79
- `[design-pending]` until scope rules on it. Enforced by
80
- `check-amendment-queue`.
81
-
82
- **The delta-ID grammar.** An amendment's `## What changes` is a sequence of
83
- **deltas**, and both a delta and a citation to one have a pinned form. Pinned
84
- because the next section requires each update target to name the delta that
85
- owns it, and a name no surface specifies is unmechanizable: a gate cannot match
86
- a grammar the template never states.
87
-
88
- A **delta** is a `###` heading under `## What changes` of the form
89
- `### (<N>) <title>`, where `<N>` is a positive decimal integer written without a
90
- leading zero and `<title>` is non-empty. Delta numbers begin at one and are
91
- **sequential and unique** within the amendment — a gap or a repeat means a delta
92
- was split or dropped without its citations moving, which is the drift this
93
- grammar exists to make visible.
94
-
95
- A **citation** is the token `delta <N>` or `deltas <N>` (case-insensitive),
96
- optionally continuing into further integers separated by commas and/or the word
97
- `and`; a trailing possessive (`delta 3's`) is the same citation. The literal
98
- `all deltas` cites **every** delta the amendment defines — the form a
99
- whole-amendment update target already uses in practice (a generated mirror is
100
- stale the moment any delta lands), admitted rather than forced into an
101
- enumeration that would itself drift as deltas are added.
102
-
103
- A heading rather than a bold lead-in token, because a heading gives a delta an
104
- anchor a reader can link to and a scanner can find in one pass, and it survives
105
- reordering under a diff more legibly than a token buried in a paragraph. The
106
- **work-class tag** an amendment may carry (`{mechanical}` / `{design-bearing}`)
107
- is deliberately **outside** this grammar: its owner is the roster's
108
- authoring-stage template and its reader is the iteration lead at batch-cut, so
109
- carrying it inside the delta token would tie two independent conventions to one
110
- string and stop either changing without the other. Stated as a non-target so a
111
- later reader does not read the silence as an omission. Enforced by
112
- `check-amendment-update-target`.
113
-
114
- An amendment file is **outside the governed manifest**: `CANON_KIT_MANIFEST_FILES`
115
- globs `*/SPEC.md`, which `SPEC-<name>.md` does not match, so the prose and knob
116
- gates never scan one. Their obligations attach at the merge rather than at the
117
- amendment — an amendment may carry a citation or a knob mention that would red
118
- once integrated, and §Merging an amendment step 2 is where that debt comes due.
119
-
120
- The tag is a **checksum on the promotion move**, not a second source of the
121
- state its section already carries. Its redundancy is the mechanism: a
122
- promotion crosses a section boundary *and* swaps the tag, so
123
- forbidden-in-active catches a move that dropped the swap and
124
- `[spec:]`-in-design-pending catches a swap that dropped the move. That is
125
- also the test a further tag has to pass: a tag marking a move that crosses no
126
- pending/ready boundary adds a state name without adding a caught error class,
127
- and is refused.
128
-
129
- The feature/debt litmus is **new names**: a task that adds any name to a
130
- governed surface — a script, a config knob, a file or directory convention,
131
- a tag, a contract another component must honor — is a feature and needs the
132
- amendment, however small the diff; debt converges behavior on names the
133
- spec already carries. The tell for misfiling: a queue entry whose body
134
- carries more than a few lines of design ruling is an amendment inlined
135
- where this gate cannot see it — the entry format has no home for causal
136
- completeness, and the rationale evaporates when the done section is
137
- cleared. The gate cannot decide which section a task belongs in (that is
138
- the semantic residue); it enforces the pairing once the section is chosen,
139
- so the litmus runs at filing time, in the scope skill's triage.
140
-
141
- ### The causal-completeness check
142
-
143
- Before an amendment is ready, every new state, event, and interface it
144
- introduces passes five points:
145
-
146
- 1. **Producer named and reachable** — what code path, call, or timer
147
- triggers it; a named producer whose enabling config no deployed
148
- configuration actually sets is dead everywhere but unit tests.
149
- 2. **Consumer named** — what component receives it, by what mechanism
150
- (which stream, which call, which poll).
151
- 3. **Existing integration sections updated** — any affected spec section
152
- describing the prior flow is updated in the amendment itself.
153
- 4. **Every field has a named reader** — for each field on a new message,
154
- name the consumer that reads it and the transition where it is read; a
155
- field with no reader is removed, and a field read at one transition is
156
- not populated at others.
157
- 5. **Each reader's red condition named, not merely its subject** — binding
158
- on a delta that *narrows* a corpus (a prune, a tighter glob, a dropped
159
- file). A reader is safe to clear **by inspection** under a narrowing only
160
- if its verdict is monotone in the violation set, and three ordinary shapes
161
- are not: a reader that reds on *finding none*, one asserting an exact
162
- count, and one holding a minimum or a coverage floor. So enumerate what
163
- makes each reader **red**, never what it is about, and inspect only the
164
- monotone ones. Attested: pruning the file that held a declaration's sole
165
- instance flips `check-install-claim` green to red, because its
166
- red condition is a zero count — the narrowing *added* a violation.
167
- "A narrower corpus can only remove violations" is false, and it is the
168
- first argument a narrowing delta reaches for.
169
-
170
- A cross-component causal gap that surfaces during build is not a deferred
171
- TODO: stop, resolve it that session, update the spec before resuming.
172
- lifecycle-kit's scope/build skill templates carry these hooks; canon-kit
173
- supplies the checklist they invoke and the gate behind the promotion rule.
174
-
175
- ### Merging an amendment (on task completion)
176
-
177
- 1. Read the canonical spec fully, then the amendment.
178
- 2. Integrate — do not append: each addition lands in its proper section,
179
- and the merged spec reads as one coherent document a reader who never
180
- saw the amendment can use alone. The merge separates by tier: design
181
- rationale relocates into the spec's prose (its permanent home), and any
182
- embedded wire-delta becomes a citation to the now-existing contract
183
- file — the amendment's exemption is file-scoped, so once step 3 deletes
184
- the file `check-spec-embedded-source` re-arms and a kept embed goes red.
185
- 3. Delete the amendment file; verify none remain for the component. **The
186
- none-remain half is discharged at the iteration, not at the commit** — with
187
- sibling amendments in flight for one component, only the batch merging the
188
- last of them can satisfy it, and the earlier batches' identical assertions are
189
- unsatisfiable at their own commits. The horizon is the iteration because the
190
- build stage stays resident until the queue empties and close refuses entry on
191
- a non-empty active queue.
192
- 4. Move the queue entry to `## Done`, dropping its `[spec:]` tag — the
193
- amendment it referenced is gone, and `check-amendment-queue` requires
194
- every `[spec:]` ref to resolve to a file on disk.
195
- **Unless the entry outlives the amendment.** Where an entry's deliverable is a
196
- *corpus* and the amendment delivered one **increment** of it, the terminal move
197
- is a **demotion** rather than a Done move: drop the `[spec:]` tag and return the
198
- entry to the deferred section under its design-pending tag, so the next
199
- increment re-promotes with a fresh amendment. A Done move there asserts a
200
- finished deliverable that is not finished. It also costs a second thing that is
201
- easy to miss: a done entry is a bare slug, so **every** tag the entry carried
202
- goes with it — including any tag a generated public projection reads, which
203
- silently drops the item from that projection while the work remains outstanding.
204
- This is the branch to state explicitly because it is the uncatchable one — the
205
- Done-move contract has no gate behind either half, so the wrong terminal move
206
- reds nothing and is found only by a later reader.
207
- 5. Propagate removals (grep every spec for names the change retired), file
208
- discovered gaps as debt tasks, and commit the merge with the work.
209
-
210
- The shipped amendment template ends in a Definition-of-Done checklist that
211
- includes causal completeness, merged-with-no-information-lost, the
212
- file-deleted assertions, and gap filing.
213
-
214
- ## Content tiering — the star topology
215
-
216
- Every governed prose surface owns exactly one content tier and *points to*
217
- — never restates — a fact owned by another surface. Which surfaces exist
218
- and what each owns is the consumer's tier contract (each consumer's is its
219
- own instance); the kit's rules are the topology itself:
220
-
221
- - **One owner per fact.** A parallel copy of a gated fact is the defect —
222
- a second source no gate reads, drifting silently. The fix keeps each
223
- surface's tier and replaces the foreign-tier slab with a pointer.
224
- - **Definitions have one home.** A canonical bold-lead-in definition of a
225
- glossary term belongs only to the glossary; another surface may *use*
226
- the term, explain *why* it exists, or carry its local mechanism — never
227
- the definition (`check-surface-duplication`, with per-site valves for a
228
- surface that legitimately introduces a concept).
229
- - **Quantitative literals are code-owned.** A count or enumerated set
230
- transcribed into prose is a parallel copy; cite the owning source
231
- instead (`check-manifest-count` bans a bare cardinal quantifying a
232
- governed collection in a manifest — the collection is the count's owner).
233
- A literal stays verbatim only when load-bearing, and then only
234
- gate-coupled — and `check-measured-claim` is the mechanism that clause names:
235
- a `measured:` marker binds the literal to an oracle the gate re-runs, which
236
- turns a transcribed number into a generated, freshness-gated copy and is the
237
- second remedy this bullet offers beside citing the owner. Prefer citing the
238
- owner where the number need not be stated; mark it where a reader is served by
239
- reading it. **What makes marking happen at all is a third mechanism**, because
240
- the two above both wait for an author to act: `check-unmarked-claim` lets a
241
- consumer declare a *class* of claim that may not go unoracled, so the sentences
242
- most worth binding are pressured into a marker rather than left to authorial
243
- memory — and the class reaches a claim carrying no number, which is where this
244
- bullet's own rules stop.
245
- A **user-facing** claim takes the same treatment when a reader
246
- acts on it: `check-install-claim` gives the primary-install-path claim one
247
- declared owner and holds every governed install section to it, so the topology
248
- reaches beyond the internal facts the rules above are stated over.
249
- A path's **version-control tracking status** is code-owned in
250
- the same sense a count is — git owns it — so prose states the rule and
251
- `check-tracking-claim` verifies it, rather than prose transcribing membership.
252
- - **Comments cite, never restate.** The code surface is a tier too: a
253
- full-line comment on a governed source is a machine or reason directive,
254
- rides the contiguous run a directive opens, or is exempt — design
255
- rationale lives in the owning SPEC section, not re-derived in a comment
256
- block; the pointer names where the why lives and couples the code to it —
257
- never relocating the why into the comment (`check-comment-tier`; the
258
- FP-prone trailing-comment judgment stays a review tripwire).
259
- - **Honest mechanizability.** Only the structural sub-rules gate (banned
260
- headings, fence density, duplicate definitions, verbatim copies,
261
- temporal-narration markers, restated collection totals); the core
262
- judgment — is this sentence a definition or a narration, a why or a
263
- mechanism — is FP-prone and stays a review tripwire, explicitly not a
264
- blocking gate.
265
-
266
- ## Layout and configuration
267
-
268
- The kit is vendored beside gate-sdk (conventionally at `canon-kit/`); its
269
- gates are registered in the consumer's `gates.list` by name — each
270
- where its surface exists (a consumer with no glossary does not register
271
- `check-surface-duplication`) — and resolve through gate-sdk's multi-kit
272
- path.
273
-
274
- Brand tokens and generic vocabulary sit on opposite sides of a seam. Brand
275
- tokens carry the kit's identity and move with the kit name: the kit dir
276
- (`canon-kit/`), the `CANON_KIT_` env-knob prefix, the discovered config
277
- filename (`canon-config.sh`, the `<kit>-config.sh` convention), and the
278
- docs-site page dir (`docs/canon-kit/`). Generic vocabulary names the spec
279
- *artifact* discipline rather than the brand and is fixed regardless of the
280
- kit's name: the `SPEC.md` canonical-spec filename, the `SPEC-*.md` amendment
281
- glob, the `spec:` and `contract:` source directives, the `[spec:]` and
282
- `[design-pending]` queue tags, the `check-spec-*` gate names, and the internal
283
- `lib/spec.sh` loader (where "spec" names the discipline). The consumer gate
284
- `check-kit-ref-liveness` (declared by a `.gate` descriptor in `scripts/` and
285
- dispatched to the binary substrate — the dangling-reference hazard is a kit
286
- author's, so it is not templated into gate-sdk) holds the brand-token side
287
- honest tree-wide: every slash- or
288
- line-anchored `<name>-kit` / `gate-sdk` path segment must name a
289
- `gate_kit_roots` dir, and every live-prefix kit knob must resolve to a tracked
290
- kit knob (check-docs-cmd's resolver, reused so the non-uniform knob-prefix map
291
- has one home). **A knob resolves through a family stem in either direction**: a
292
- scanned `<FAMILY>_` stem resolves when kit source defines any member under it,
293
- and a scanned member resolves when kit source defines the stem. The second
294
- direction is what a **dispatch-composed** knob name needs — gate-sdk's
295
- `GATE_SDK_KNOB_<NAME>` bridge builds the full name at runtime from the knob it
296
- is carrying (gate-sdk/SPEC.md §lib/gate.sh), so kit source contains the stem and
297
- never the members. Spelling the members out to satisfy an exact match would be a
298
- hardcoded roster of consumer knob names in a kit literal, which is the one shape
299
- that crosses the provenance seam here. It valves the surfaces that legitimately
300
- name design-ahead or frozen brands — `gate-tests/` fixture bodies, `docs/posts/*`, the generated
301
- trajectory data, `SPEC-*.md` amendments, and the queue — so a rename cannot
302
- leave a dangle without turning a gate red.
303
-
304
- Config follows queue-kit's pattern: copy `templates/canon-config.sh` into
305
- the gates dir as `canon-config.sh` (or point `CANON_KIT_CONFIG_FILE`
306
- elsewhere) and override any knob; defaults fill what the consumer left
307
- unset, and the loader exits 2 on a malformed config. Knobs:
308
-
309
- - `CANON_KIT_SPEC_NAME` — canonical spec filename, default `SPEC.md`.
310
- - `CANON_KIT_AMENDMENT_GLOB` — default `SPEC-*.md`.
311
- - `CANON_KIT_QUEUE_FILE` — default `${GATE_SDK_QUEUE_FILE:-TASK-QUEUE.md}`.
312
- - `CANON_KIT_FEATURE_SECTIONS` — array, default `("New Features")`: active
313
- sections whose entries require `[spec:]`.
314
- - `CANON_KIT_ACTIVE_SECTIONS` — array, default
315
- `("New Features" "Technical Debt")`: sections where `[design-pending]` is a
316
- violation.
317
- - `CANON_KIT_DEFERRED_SECTION` — default `Deferred`: the section whose
318
- every entry requires `[design-pending]`.
319
- - `CANON_KIT_ICEBOX_SECTION` — scalar, default **empty**: the second
320
- design-pending section, queue-kit's optional icebox tier. Empty means the
321
- set is the deferred section alone. Naming the deferred section is malformed
322
- config. What generalizes here is the section **set**, not the tag set — no
323
- icebox-specific tag exists or is wanted.
324
- - `CANON_KIT_DOD_HEADING` — default `Definition of Done`;
325
- `CANON_KIT_DOD_MODE` — `exactly-one` (the default) or `at-most-one`
326
- (a reference-spec corpus like this repo's kits carries no DoD).
327
- - `CANON_KIT_SCAN_KIT_ROOTS` — `0` (default) or `1`. At `0` the shared finders
328
- skip vendored kit roots (`gate_kit_roots`): a kit's `SPEC.md`/`SPEC-*.md` and
329
- its `README.md` alike are a dependency's documentation, not governed content,
330
- so the `exactly-one` default holds out of the box on a tree that merely
331
- vendored the kits beside gate-sdk and no consumer is asked to answer for a
332
- dependency's own internal links. Set `1` when the kit docs are the consumer's
333
- own first-party content (this repo does, and keeps `at-most-one` for them).
334
- - `CANON_KIT_BANNED_HEADINGS` — array, default
335
- `("Directory Structure" "Public API" "Cargo.toml Dependencies")`;
336
- `CANON_KIT_DERIVABLE_DENSITY` — default `60` (percent fenced);
337
- `CANON_KIT_DERIVABLE_POINTER_REGEX` — the index-pointer marker that exempts
338
- a shed section, default `pub-index|proto-index` (consumer index tooling).
339
- - `CANON_KIT_EMBED_THRESHOLD` / `CANON_KIT_EMBED_MINLINES` — defaults `0.70`
340
- / `8`; `CANON_KIT_EMBED_LANGS` — the scanned fence-language → source
341
- mapping, one `kind|fence-alias,…|file-glob,…` entry per language family,
342
- default = the bundled list; `CANON_KIT_EMBED_ILLUSTRATIVE` — fences
343
- illustrative-by-default, default `(json)`; `CANON_KIT_EMBED_WIRE_KIND` — the
344
- one fence an amendment may embed as a not-yet-merged contract delta,
345
- default `proto`.
346
- - `CANON_KIT_GLOSSARY_FILE` — default `GLOSSARY.md`;
347
- `CANON_KIT_DUP_SURFACES` — array of surfaces scanned for foreign
348
- definitions, default `(VISION.md)` plus every component spec.
349
- - `CANON_KIT_MANIFEST_FILES` — array of globs, default empty ⇒ derive the
350
- manifest set (canonical specs, `README.md` at any depth, `CLAUDE.md`);
351
- `CANON_KIT_PROSE_SURFACE_GLOBS` — array of candidate globs, default empty:
352
- each matched file joins the manifest set **iff it is slot-free** (no
353
- lifecycle-kit binding slot `*<name: …>*`, no `CONSUMER BINDING` header), so
354
- slot-free kit-template markdown and agent definitions come under the manifest
355
- doc gates while slot-bearing surfaces self-exclude — which surfaces a consumer
356
- governs is their config, the discriminator is kit mechanism (§lib/spec.sh).
357
- This repo sets `("*/templates/*.md" ".claude/agents/*.md")`.
358
- `CANON_KIT_TEMPORAL_MARKERS` — the temporal-narration marker set scanned by
359
- `check-manifest-temporal`, default a generic-English list (`previously`,
360
- `formerly`, `renamed from`, …), matched case-insensitively and extended
361
- through `CANON_KIT_TEMPORAL_MARKERS_EXTRA` under the `_EXTRA` semantics below;
362
- `CANON_KIT_TEMPORAL_EXEMPT_SECTIONS` — array of heading names whose whole
363
- section is exempt, default empty (this repo sets `Out of scope`).
364
- - `CANON_KIT_MDREF_EXCLUDE` — array of globs, default empty: manifest-set docs
365
- `check-md-refs` skips (a consumer's generated documentation whose links a
366
- build tool owns).
367
- - `CANON_KIT_COUNT_COLLECTIONS` — array of collection-noun plurals
368
- `check-manifest-count` treats as growing governed sets, default
369
- `("gates" "meta-gates" "checks" "kits" "stages" "rules" "KPIs")` (a consumer
370
- appends its own governed plurals); `CANON_KIT_COUNT_WEDGE_WORDS` — how many
371
- words may sit between the cardinal and the noun, default `2`;
372
- `CANON_KIT_COUNT_ALLOWED_PHRASES` — exact-phrase allowlist for fixed named
373
- sets a doc may cite inline, default empty (a consumer names its own fixed
374
- sets, and only a phrase whose noun it governs needs the valve).
375
- - `CANON_KIT_ENUM_SETS_CMD` — a consumer command emitting the governed sets
376
- `check-prose-enum` holds, one `<set-name>`⇥`<member>` line per member,
377
- default empty ⇒ clean skip (no declared sets). This repo sets
378
- `bash scripts/enum-sets.sh`, which derives the queue tag sets from
379
- queue-kit's own parser rather than restating them.
380
- - `CANON_KIT_INSTALL_TRANSPORTS_CMD` — a consumer command emitting the install
381
- transports `check-install-claim` holds, one `<transport-id>`⇥`<ERE>` line per
382
- transport, default empty ⇒ clean skip. `CANON_KIT_INSTALL_SECTION_RE` — an ERE
383
- matched against `##`-or-deeper heading text to select the sections that gate
384
- scans, default empty ⇒ clean skip; either knob left empty skips the whole gate,
385
- since neither assertion has a vocabulary to judge against without the other.
386
- `CANON_KIT_INSTALL_CLAIM_EXCLUDE` — array of globs dropped from that gate's
387
- scanned set on top of `CANON_KIT_MDREF_EXCLUDE`, default empty. A transport
388
- vocabulary is one project's distribution model, so no spelling of it ships as a
389
- kit literal (the provenance seam). This repo sets
390
- `bash scripts/install-transports.sh`, `^(Quick start|Install)`, and
391
- `("docs/posts/*")`. `CANON_KIT_INSTALL_TRANSPORT_IDS` /
392
- `CANON_KIT_INSTALL_TRANSPORT_PATTERNS` — the index-aligned halves of that
393
- command's parsed output, default empty arrays, filled by this kit's library only
394
- while one of the two is the knob under resolution; they are the bridged form the
395
- compiled member reads and are not a consumer-authored knob (§lib/spec.sh).
396
- - `CANON_KIT_PAYLOAD_CLAIMS_CMD` — a consumer command emitting the payload
397
- disclosure classes `check-payload-claim` holds, one `<claim-id>`⇥`<ERE>` line
398
- per class, default empty ⇒ clean skip (the correct posture for a tree whose
399
- payload discloses one thing only). `CANON_KIT_PAYLOAD_CLAIM_EXCLUDE` — array
400
- of globs dropped from that gate's scanned set on top of
401
- `CANON_KIT_MDREF_EXCLUDE`, default empty. A spelling of what a payload
402
- discloses is one project's distribution model, so it is consumer config for
403
- the same provenance-seam reason the transport vocabulary above is. This repo
404
- sets `bash scripts/payload-claims.sh` and `("docs/posts/*")`.
405
- `CANON_KIT_PAYLOAD_CLAIM_IDS` / `CANON_KIT_PAYLOAD_CLAIM_PATTERNS` — that
406
- command's parsed output in the same bridged, index-aligned shape as the
407
- transport pair above, default empty arrays.
408
- - `CANON_KIT_MEASURED_CLAIMS_CMD` — a consumer command emitting the oracle
409
- `check-measured-claim` re-runs, one `<key>`⇥`<value>` line per measurable fact,
410
- default empty ⇒ clean skip (no oracle, so no marker has anything to disagree
411
- with). `CANON_KIT_MEASURED_SURFACE_GLOBS` — array of globs naming the scanned
412
- surface, default empty ⇒ empty corpus and a clean gate; the two are set
413
- together or not at all. What a project measures is that project's vocabulary,
414
- so no key ships as a kit literal (the provenance seam). This repo sets
415
- `bash scripts/measured-claims.sh` and the `CANON_KIT_MANIFEST_FILES` globs plus
416
- `.claude/commands/*.md` — the shims the manifest set omits and the prose surface
417
- excludes on a copy-shape ownership this rule is not covered by. The surface knob
418
- has a **second reader**, `check-unmarked-claim`, which shares it rather than
419
- forking a knob of its own: the pair composes over one corpus
420
- (§check-unmarked-claim), and the recorded cost is that a consumer cannot scan
421
- claim classes over a different surface than its measured claims.
422
- - `CANON_KIT_CLAIM_CLASSES_CMD` — a consumer command emitting the claim classes
423
- `check-unmarked-claim` holds, one `<class-id>`⇥`<ERE>` line per class, default
424
- empty ⇒ clean skip (no declared class, so no sentence falls in one). A class is
425
- a spelling of what one project claims about itself, so it is consumer config for
426
- the same provenance-seam reason the vocabularies above are, and for one more:
427
- this kit's own SPEC is governed prose, so a kit literal here would match its own
428
- class while describing it. This repo sets `bash scripts/claim-classes.sh`. The
429
- gate reads `CANON_KIT_MEASURED_SURFACE_GLOBS` above for its corpus and adds no
430
- surface knob. `CANON_KIT_CLAIM_CLASS_IDS` / `CANON_KIT_CLAIM_CLASS_PATTERNS` —
431
- that command's parsed output in the same bridged, index-aligned shape as the
432
- transport and payload pairs above, default empty arrays.
433
- - `CANON_KIT_COMMENT_MACHINE` / `CANON_KIT_COMMENT_REASON` — arrays, default
434
- empty: extra directive prefixes appended to the built-in kit-mechanism
435
- roster (a consumer's product vocabulary). `CANON_KIT_COMMENT_SURFACE` —
436
- array of globs, default empty ⇒ derive: shell sources under the root (kit
437
- roots per `CANON_KIT_SCAN_KIT_ROOTS`, `templates/` pruned) plus the
438
- `${GATE_SDK_WORKFLOW_DIR:-.workflow}/*.txt` state files.
439
- `CANON_KIT_COMMENT_POSITIONAL` — the language construct roster for
440
- positional rescue, default empty (the kit is language-agnostic; a Rust
441
- consumer sets `.unwrap( .expect( unsafe #[allow(`).
442
- `CANON_KIT_COMMENT_WHITELIST` — array of globs, default empty: the
443
- consumer's not-yet-swept sources, its array tagged `# exception-list:`
444
- with a per-entry `# until: <drain-task>`. `CANON_KIT_COMMENT_RUN_CAP` —
445
- positive integer, default 3: total physical comment lines a directive
446
- blesses (its own line plus continuations, blank `#` lines counted).
447
- - `CANON_KIT_PROSE_TELL_GLOBS` — array of repo-root-relative globs, default
448
- empty ⇒ nothing scanned, a clean pass: the reader-facing prose surfaces
449
- `check-prose-tells` reads. Which surfaces carry authored prose is the
450
- consumer's editorial posture, and per the provenance seam it never lands as a
451
- kit literal. The threshold knobs, each read by `check-prose-tells` alone:
452
- `CANON_KIT_PROSE_TELL_EMDASH_MAX` — em-dashes a paragraph may carry, default
453
- `2`; `CANON_KIT_PROSE_TELL_CONTRAST_MAX` — "not X, it's Y" contrast turns a
454
- section may carry, default `1`; `CANON_KIT_PROSE_TELL_RHYTHM_MIN_SENTENCES` —
455
- sentences a paragraph needs before its rhythm is judged, default `4`;
456
- `CANON_KIT_PROSE_TELL_RHYTHM_CV_MIN` — the word-count coefficient-of-variation
457
- floor beneath which a paragraph reads as metronomic, default `0.25`;
458
- `CANON_KIT_PROSE_TELL_TRICOLON_MAX` — "A, B, and C" triples a section may
459
- carry, default `2`. `CANON_KIT_PROSE_TELL_PHRASES` — array of throat-clearing
460
- phrases matched case-insensitively, default a bundled generic-English set
461
- (`It's worth noting`, `That said`, …); `CANON_KIT_PROSE_TELL_ABBR_ALLOW` —
462
- array of abbreviations exempt from the undefined-abbreviation tell, default a
463
- bundled universal set (`API`, `CLI`, `URL`, …). A consumer extends any
464
- bundled vocabulary — these two and `CANON_KIT_TEMPORAL_MARKERS` above — with
465
- its own through the matching `_EXTRA` knob:
466
- `CANON_KIT_PROSE_TELL_PHRASES_EXTRA`,
467
- `CANON_KIT_PROSE_TELL_ABBR_ALLOW_EXTRA` and
468
- `CANON_KIT_TEMPORAL_MARKERS_EXTRA`, all default empty, which the lib
469
- unions onto the base after the base defaults resolve: the effective set is
470
- base plus extra. Extension therefore costs one token, never a restatement of
471
- the bundled default that would silently diverge from it. Assigning a base
472
- array keeps its replace semantics, and that is the narrowing valve: a consumer
473
- wanting a bundled member *gone* replaces the base array. Generic English is
474
- kit-shippable; a consumer's own vocabulary never becomes a kit literal (the
475
- provenance seam).
476
-
477
- Cross-kit note: the section knobs carry the same defaults as queue-kit's;
478
- the knobs are independent (either kit runs without the other), so a
479
- consumer renaming its sections sets both — and the icebox section name spans
480
- every kit that reads the tier on that same shape (queue-kit's
481
- `QUEUE_KIT_ICEBOX_SECTION`, this knob, drift-kit's `DRIFT_KIT_ICEBOX_SECTION`),
482
- each degrading to "no icebox" rather than to a wrong section when left unset. Valve and marker spellings <!-- prose-enum-exempt: names the two amendment-lifecycle tags specifically; [blocked-by:] is a dependency tag outside that lifecycle, not a dropped task-tag member -->
483
- (`[design-pending]`, `[spec:]`, `vision-introduces` / `spec-introduces`,
484
- `spec-embedded-source-exempt: <reason>`) are mechanism, not config.
485
-
486
- ## Per-component contracts
487
-
488
- Each gate below owns its own section — the assertion, its fixture pair, and the
489
- reason for any bespoke unit test beside it. The bespoke unit tests are named
490
- together here, because a roster spread across per-gate sections is one no reader
491
- and no oracle sees whole: `check-amendment-update-target.test.sh`,
492
- `check-comment-tier.test.sh`,
493
- `check-deprecation-task.test.sh`, `check-docs-link-convention.test.sh`,
494
- `check-knob-citation.test.sh`, `check-knob-default-coupling.test.sh`,
495
- `check-manifest-count.test.sh`, `check-md-refs.test.sh`,
496
- `check-measured-claim.test.sh`, `check-prose-enum.test.sh`,
497
- `check-spec-dod-singleton.test.sh`, `check-tracking-claim.test.sh` and
498
- `check-unmarked-claim.test.sh`.
499
-
500
- ### lib/spec.sh
501
-
502
- The sourced config loader plus shared adapters — values and adapters only,
503
- never gate structure. It centralizes the surfaces and vocabularies the
504
- spec-scanning gates share, so a rule enters once and every sibling matches the
505
- same shapes:
506
-
507
- - **Section grammar and queue resolution:** the section-regex builders the
508
- queue-facing gates use (queue-kit's rule — both sides of a section boundary
509
- must parse identically), and the one queue walk that emits a live slug for a
510
- bold lead-in bullet in an active or **design-pending** section — deferred
511
- plus a configured icebox, built as one regex so the tag rule and the walk can
512
- never disagree on the set — and a done slug for a bare-slug bullet outside
513
- them; the single grammar `check-todo-task-liveness`
514
- and `check-deprecation-task` resolve a `task: <slug>` binding through. **The
515
- walk is `native/src/spec.rs`'s `queue_slugs`**: both members compile, so the
516
- shell walk went with its last caller, and so did the shell library's section
517
- builders — the compiled classifier matches a section name against the
518
- configured sets directly rather than through a built regex, so those builders
519
- are defined here with no reader left in the tree, a residue whose disposition
520
- is filed rather than taken at a close. That walk's bullet lead-line predicate is written again in the
521
- crate rather than pointed at `native/src/queue.rs`'s adapters, which keeps
522
- canon-kit one of the format's independent holders under the
523
- re-implement-and-cite-from-both-ends rule
524
- (queue-kit/SPEC.md §The queue format) — two modules in one crate are still two
525
- holders where one shared function is not; the holder census and the residue it
526
- leaves live at gate-sdk/SPEC.md §check-gate-exemption-tasks.
527
- - **The governed comment surface:** `comment_surface` in `native/src/spec.rs` —
528
- the one corpus primitive `check-spec-pointer`, `check-comment-tier`,
529
- `check-todo-task-liveness` and `check-deprecation-task` all call, its single
530
- parameter deciding whether `templates/` sources are pruned. Its file set spans
531
- **both gate declaration spellings, the ported implementation, and the workflow
532
- directory's tracked tier**: `*.sh`, the `*.gate` descriptor, `*.rs`, and every
533
- tracked member of `GATE_SDK_WORKFLOW_DIR` whatever its extension. Stated once
534
- here rather than at each of the four callers, since a gate whose rule became a
535
- compiled subcommand must not have its `# spec:` pointer, its comment tier, or a
536
- `TODO(task:)` marker silently drop out of coverage — the widening is made at the
537
- shared primitive so no caller can inherit a narrower corpus than its siblings
538
- (gate-sdk/SPEC.md §Meta-gate conservation for the binary substrate). The shell
539
- forms are **deleted rather than duplicated**: all four callers compiled in one
540
- cohort, so criterion 6 is satisfied in the form it calls strongest — the
541
- duplication is absent rather than machine-held. A consumer whose own gate called
542
- `spec_comment_surface`, `spec_comment_surface_with_templates` or
543
- `spec_comment_whitelisted` shadows the gate, which is the answer this section
544
- already gives for the finder-choice question below.
545
- - **Finders:** the canonical-spec / amendment finders the spec-scanning gates
546
- share, and the manifest-set finder the narration-gate family shares —
547
- canonical specs plus `README.md`/`CLAUDE.md`, amendments excluded — so its
548
- members read one identical set. The finder then folds in each
549
- `CANON_KIT_PROSE_SURFACE_GLOBS` candidate that is **slot-free**: it bears no
550
- lifecycle-kit binding slot (`*<name: …>*`, slot-name `[a-z][a-z0-9-]*` — the
551
- grammar lifecycle-kit/SPEC.md §templates/stages/ owns) and no
552
- `CONSUMER BINDING` header. A slot-bearing candidate is silently excluded — a template still
553
- awaiting binding is a placeholder, not finished prose, and its coverage stays
554
- the shim/binding gates (§Layout and configuration states the knob). All three
555
- markdown finders — canonical specs, amendments, and the manifest set's
556
- `README.md` half — skip a `templates/` skeleton (a copyable stub, not governed
557
- content, the same rationale as the gate-tests prune) and, unless
558
- `CANON_KIT_SCAN_KIT_ROOTS=1`, any vendored kit root under the scan root. The
559
- kit-root prune reaches the README because the knob's rationale turns on whose
560
- documentation a file is, not on which filename carries it: a vendored kit's
561
- `README.md` is a dependency's docs exactly as its `SPEC.md` is, and pruning
562
- one while governing the other reds a consumer on a dependency's own internal
563
- links — measured, on a profile that vendors canon-kit without queue-kit, where
564
- `canon-kit/README.md`'s `../queue-kit/` link dangles on a bare install tree.
565
- An ancestor kit root — the case when a kit's own fixture dir is the scan
566
- root — never prunes.
567
-
568
- **One asymmetry inside the manifest set, written down because a port that
569
- tidies it changes the corpus.** The canonical-spec half and the `README.md`
570
- half are both `templates/`-filtered and kit-root pruned; the **`CLAUDE.md`
571
- half is neither**. A consumer's agent manifest is governed content wherever it
572
- sits, including inside a vendored kit root and inside a `templates/`
573
- skeleton — so regularizing the three finders into one loop silently drops two
574
- files that belong in the set. The rule is the asymmetry, not the tidy form.
575
-
576
- **Which primitive is on which substrate.** `spec_manifest_files` has a Rust
577
- implementation (`native/src/spec.rs`) carrying all three branches — explicit
578
- globs, the default walk, and the prose-surface fold — plus the kit-root path
579
- prune, because its family is partly compiled; the shell form stays, since
580
- members outside that family still call it. That module carries the claim-gate
581
- primitives too: the declaration grammar, the declaration roster, the
582
- governed-doc set behind its two exclude valves, and the bridged vocabulary
583
- loader. The shell kept a copy of the last two per member; the compiled form has
584
- one, ported once and proved by each member that calls it. `comment_surface` and
585
- `queue_slugs` are **compiled only**, and so are all four of their callers
586
- (gate-sdk/SPEC.md §The first cohort, and the rule that selects the next): where
587
- the manifest finder is dual because members outside its family still call it,
588
- these two emptied their caller sets in one cohort and their shell forms were
589
- removed in the same commit.
590
- The two implementations of the manifest finder are held together by the config
591
- bridge rather than by a copied default: every knob either reads crosses it as
592
- a resolved value, so there is exactly one place each is computed
593
- (gate-sdk/SPEC.md §The port-candidate criteria, criterion 6).
594
- - **The emitter-backed vocabularies** — the enum sets, the install transports
595
- and the payload-disclosure classes a consumer supplies as a *command*. For a
596
- compiled member the command's **output** is the interface, never the command:
597
- the library runs the emitter at knob-resolution time and the binary receives
598
- data, so no compiled gate spawns an interpreter to read consumer config and no
599
- spelling of a consumer's vocabulary becomes a kit literal. A pair rides two
600
- index-aligned arrays (`CANON_KIT_ENUM_SET_NAMES` / `..._MEMBERS`) because the
601
- bridge's wire format separates elements with a tab and refuses one inside an
602
- element, so a `<name>`⇥`<member>` line cannot cross as a single string. The
603
- resolution is gated on `GATE_SDK_RESOLVING_KNOB` (gate-sdk/SPEC.md
604
- §lib/gate.sh), because it costs a subprocess and this library is sourced once
605
- per declared knob per gate. Four vocabularies ride that shape, one pair each:
606
- the enum sets, `CANON_KIT_INSTALL_TRANSPORT_IDS` / `..._PATTERNS`,
607
- `CANON_KIT_PAYLOAD_CLAIM_IDS` / `..._PATTERNS`, and
608
- `CANON_KIT_CLAIM_CLASS_IDS` / `..._PATTERNS` (§Layout and configuration). The
609
- emitting **command** knob is bridged beside each pair, because it is what tells
610
- *none configured* from *configured, and it declared nothing* — the two clean
611
- skips a claim gate reports apart. The tab a POSIX ERE may legitimately carry
612
- cannot reach the bridge: `spec_claim_vocabulary` below rejects a line with an
613
- extra tab before the value is ever serialized.
614
- - **The count adapter** the restated-total gates share, so a consumer's
615
- `CANON_KIT_COUNT_COLLECTIONS` vocabulary enters once and every such gate
616
- matches the same total shapes — including a total whose cardinal and noun
617
- straddle a prose wrap, reported at the cardinal's physical line. **That
618
- wrap-straddling normalization now has a second reader**: `check-unmarked-claim`
619
- matches a class ERE against the same normalized paragraph and maps the match's
620
- span back to the physical line it starts on (`FlatPara`,
621
- `native/src/spec.rs`), so both cross a prose wrap by one rule rather than by a
622
- copy each. What the count adapter owns is the *total* grammar; what the flatten
623
- adapter owns is the *subject* a pattern is matched against, and separating them
624
- is why a second reader cost a call rather than a fork. The boundary
625
- rule and the mechanical exemptions live in one shared fragment, so no sibling
626
- drifts from another in what it counts as a total (§check-manifest-count). That
627
- boundary guards a prose **noun** against gluing to a following word ("gate"
628
- inside "gatekeepers") — a different rule from the enum matcher's **identifier**
629
- boundary (§check-prose-enum), which the two once spelled alike and only
630
- half-alike at that. English nouns do not compound across underscores, so the
631
- noun rule stays as it is; the shared spelling was never a shared rule.
632
- - **The enum sets** arrive through the consumer's `CANON_KIT_ENUM_SETS_CMD`,
633
- validated and fail-closing (exit 2) on a command error or an unparsable line
634
- (§check-prose-enum).
635
- - **The claim vocabularies** arrive the same way, through
636
- `spec_claim_vocabulary <command> <label>` — one loader for every
637
- `<id>`⇥`<ERE>` vocabulary a claim gate reads, taking the command as an
638
- argument rather than from one named knob so a second claim axis costs a caller
639
- and not a second copy. **That argument is attested rather than anticipated:**
640
- `check-unmarked-claim` is the fourth caller and it arrived as a caller and
641
- nothing else — no fork of the loader, no second copy of the shape checks. It
642
- carries the
643
- same fail-closed contract its enum-set sibling does — a command error, an
644
- unparsable line, an id that is not slug-shaped, or a repeated id is exit 2 —
645
- and the `<label>` it is given names the failing vocabulary in every message,
646
- so a fail-closed exit still says which one failed. The duplicate check is what
647
- a bare emit grammar cannot express and both gates need: two lines claiming one
648
- id would give a class two patterns and make its match order arbitrary. Its
649
- callers are `spec_install_transports`, over
650
- `CANON_KIT_INSTALL_TRANSPORTS_CMD` (§check-install-claim);
651
- `check-payload-claim` directly, over `CANON_KIT_PAYLOAD_CLAIMS_CMD`
652
- (§check-payload-claim); `spec_measured_claims`, over
653
- `CANON_KIT_MEASURED_CLAIMS_CMD` (§check-measured-claim) — whose second field is
654
- a measured value rather than an ERE, which the loader neither interprets nor
655
- needs to, since every check it makes is on the line's shape; and
656
- `check-unmarked-claim` directly, over `CANON_KIT_CLAIM_CLASSES_CMD`
657
- (§check-unmarked-claim). The two-field shape is what makes that last caller
658
- coverage-only: a class cannot carry a required key beside its ERE without a
659
- third field this loader refuses, and the refusal is kept rather than relaxed.
660
- - **The comment-surface adapters:** the comment gates read *different* surfaces,
661
- which is the one thing the primitive's parameter decides.
662
- `check-spec-pointer` scans the template-pruned surface — a template's `spec:`
663
- line is an unresolvable-by-design placeholder (§check-spec-pointer);
664
- `check-comment-tier` scans the with-templates surface — a copied-out
665
- template's `spec:` pointer resolves against the vendored kit path (kit SPECs
666
- travel with the vendor-whole install), so its comments are governed like any
667
- source (§check-comment-tier). Which finder a gate uses is kit contract, not
668
- consumer config — a consumer wanting the old blanket exemption shadows the
669
- gate.
670
- - **The amendment finder** `spec_amendments`, the amendment-glob counterpart of
671
- `spec_canonical_specs` above. Its last shell caller left at §The sixth budget
672
- batch (gate-sdk/SPEC.md), and the function stays: the dead-twin disposition
673
- (gate-sdk/SPEC.md §The port-candidate criteria, criterion 2) reaches
674
- **undocumented** surface only, and this bullet documents it. The live holder is
675
- `native/src/spec.rs`.
676
- Its consumers are `check-amendment-queue` and
677
- `check-amendment-update-target`, and they **differ in fail-closed posture on
678
- purpose** — so the crate holds two spellings of one walk, `amendments` and
679
- `amendments_strict`, rather than one that reads as drift. The best-effort form
680
- swallows an unwalkable scan root and yields no amendments, which the queue gate
681
- can afford because an empty amendment set cannot hide a violation there (every
682
- `[spec:]` ref then dangles and the run reds). The update-target gate has no
683
- second surface to contradict an empty set, so for it an empty set hides every
684
- violation silently and the walk refuses instead. Each section states its own
685
- half; the difference is a reasoned divergence, never an inconsistency to
686
- reconcile.
687
- - **The default-statement grammar** both knob gates share, so the rule for
688
- what reads as a stated default has one home. `sk_literal_at` recognizes the
689
- value literal opening a window (a backticked non-knob string, a quoted string,
690
- or a number) and `sk_default_literal` returns the literal the word "default"
691
- binds; a caller-supplied `sk_is_knobname` keeps a bare knob name from reading
692
- as a value. `check-knob-citation` reads it to reject a restated value in prose;
693
- `check-knob-default-coupling` reads it to confirm the SPEC states the source's
694
- literal (§check-knob-default-coupling).
695
- **Both callers are compiled since §The sixth budget batch, so the live holder is
696
- `native/src/spec.rs`'s `DefaultGrammar`** — promoted there out of the first
697
- gate's private implementation at that port, because the second caller arriving
698
- is exactly when a private copy becomes the second owner this bullet exists to
699
- prevent. The shell form's caller set emptied with it and it is **not** deleted:
700
- the dead-twin disposition (gate-sdk/SPEC.md §The port-candidate criteria,
701
- criterion 2) bounds itself to undocumented surface, and this bullet documents it.
702
-
703
- ### check-amendment-queue
704
-
705
- Invariant: the bidirectional rule holds — (a) no feature-section entry
706
- without `[spec:]`, no `[design-pending]` anywhere in the active sections
707
- (entries or prose; a prose mention masks the tag's absence), and no
708
- `[spec:]`-tagged entry in an active non-feature section (a spec-ready
709
- entry is misfiled there — it belongs in a feature section); (b) every entry in
710
- a **design-pending section** carries `[design-pending]`, and one already
711
- carrying `[spec:]` must be promoted; (c) every amendment on disk pairs
712
- with a `[spec:]` queue entry and every `[spec:]` ref resolves to a file.
713
-
714
- Calibration: a ref is a bare amendment basename (searched tree-wide) or a
715
- repo-relative path (resolved directly — the generalization that lets a
716
- consumer point a task at any design artifact, e.g. this repo's kit-SPEC
717
- drafts). Sub-bullets and prose notes are outside the entry grammar;
718
- `precommit` tier.
719
-
720
- Coverage limit, stated because the tag's section-wide reach invites the
721
- stronger claim: any heading that is not a feature, active, or deferred
722
- section classifies as `other` and skips every arm, so the **done section is
723
- an exempt population** — an entry moved out of design-pending into it still
724
- carrying the tag reds nowhere, and queue-kit's lead-line gate misses it too
725
- (its scanned surface is the task sections alone). In practice the done
726
- grammar is a bare slug line, so the tag is dropped by that grammar rather
727
- than by a gate. The guard is total over the *promotion* moves it exists to
728
- catch — design-pending → an active section — and silent on the disposition
729
- move. This is a limit on *this* gate's axis only: the amendment artifact is
730
- held on a second axis by `check-amendment-update-target`
731
- (§check-amendment-update-target), whose corpus is the same amendment set and
732
- whose subject is what the file says about itself rather than how it pairs with
733
- the queue.
734
-
735
- **The amendment finder is best-effort, and the port had to reproduce that
736
- rather than harden it.** `spec_amendments` ends `2>/dev/null … || true`, so an
737
- unwalkable scan root yields *no amendments* instead of a refusal. Read against
738
- gate-sdk/SPEC.md §Fail-closed contract the compiled form would refuse there —
739
- and that would be a verdict change across the seam, which is exactly what the
740
- port's parity run holds invariant. It is also not the vacuity that contract
741
- guards: an empty amendment set cannot hide a violation in either direction,
742
- because every `[spec:]` ref then dangles and the run reds. Recorded here
743
- because the natural port instinct is to add the refusal, and the sibling
744
- `check-todo-task-liveness` — which *does* refuse on a bad scan root — makes the
745
- instinct look precedented. That member's shell form carried the `-d` guard;
746
- this one never has.
747
-
748
- ### check-amendment-update-target
749
-
750
- Invariant: in every amendment on disk, each entry under
751
- `## Existing sections updated` cites at least one delta, and every cited delta is
752
- defined under `## What changes` in the same amendment. The grammar it reads —
753
- what a delta is, what a citation looks like — is contract, stated at
754
- §The amendment lifecycle and shown to the author in
755
- `templates/SPEC-amendment.md`.
756
-
757
- The failure it closes is attested: an update target no delta claims **reaches
758
- build as an orphan a batch adopts on its own authority**, which is the
759
- template's own words for it. That is not hypothetical — one iteration dropped a
760
- tightened-gates declaration across all three of its build batches, and a fourth
761
- batch repaired it at validate.
762
-
763
- **Three arms and a valve.**
764
-
765
- - **A — the grammar.** Red (exit 1) when a `###` heading under `## What changes`
766
- does not match `### (<N>) <title>`, or when the delta numbers, read in
767
- document order, are not `1..n` unique and ascending. This is the arm that makes
768
- B and C possible at all. Only the **first** ordering breach in a file is
769
- reported: inserting one delta shifts every number after it, so reporting each
770
- would bury the single edit that caused them.
771
- - **B — the uncited target.** Red when a top-level `-` bullet under
772
- `## Existing sections updated` carries no citation. The bullet's entry is the
773
- bullet line plus its indented continuation, so a citation that wrapped across a
774
- newline is still one subject — the same wrap-straddling boundary
775
- §check-unmarked-claim crosses, for the same reason.
776
- - **C — the dangling citation.** Red when a citation names an `<N>` no
777
- `### (<N>)` heading defines, `all deltas` in an amendment that defines none
778
- included. Without C, arms A and B both pass on an amendment whose targets cite
779
- deltas that were renumbered out from under them.
780
- - **Valve** — `<!-- update-target-exempt: <reason> -->` on the bullet's first
781
- line or the one above, riding the shared exempt-window (§lib/spec.sh — the line
782
- or the one above), and the reason is mandatory (the `comment-tier-exempt:`
783
- convention). An exempt bullet leaves the target count as well as the finding.
784
-
785
- A fenced block is skipped whole, on the ground §The amendment lifecycle already
786
- gives the fence its exemption for: an amendment may embed a wire-contract delta
787
- until merge, and a heading or a bullet inside one is grammar being shown rather
788
- than a delta being defined.
789
-
790
- **Fail-closed (exit 2):** a scan root that is not a directory; an amendment
791
- carrying `## Existing sections updated` but no `## What changes`, where no entry
792
- *can* be owned and no arm could say which to blame; a file the finder returns and
793
- the reader cannot read; and **an unwalkable scan root**, where
794
- §check-amendment-queue's best-effort finder returns empty instead. That last
795
- divergence is deliberate and is the one to read carefully: the queue gate can
796
- afford an empty amendment set because its other direction contradicts it, while
797
- here an empty set hides every violation silently. The two spellings of the walk
798
- live at §lib/spec.sh, which owns the asymmetry.
799
-
800
- **No new knob, and the reason is not laziness.** The corpus is `spec_amendments`
801
- (§lib/spec.sh) — the same finder §check-amendment-queue uses, already applying
802
- the `templates/` exclusion that keeps a shipped `SPEC-amendment.md` skeleton from
803
- being read as a live amendment, so the skeleton's illustrative headings cannot
804
- red the gate that governs its copies. The two heading names are **kit constants,
805
- not config**: they are canon-kit's own template's headings, and a consumer
806
- editing them has edited canon-kit's artifact rather than configured it. The
807
- contrast with §check-spec-dod-singleton's configurable Definition-of-Done heading
808
- is real, and the line is where the surface is authored — that heading appears in
809
- **consumer-authored canonical specs**, these appear in **copies of a kit-shipped
810
- skeleton**. A knob is available later behind an attested consumer rename; adding
811
- one now would be a knob whose only reader is §check-knob-citation.
812
-
813
- **Deliberately not asserted: roster completeness.** The gate cannot check that
814
- the update-target roster names every surface the change obliges a write to —
815
- that is a claim about the world, not about the file, and no scanner reaches it.
816
- It asserts the decidable half (every listed target is owned) and the align stage
817
- keeps the other half, whose duty is unchanged: arm B catches a target that was
818
- *listed and unowned*, never one that was never listed at all. Two stronger arms
819
- were weighed and refused. Requiring **every delta to be cited by some target** is
820
- false — a delta adding a wholly new section legitimately touches no existing one.
821
- Requiring **every path or `§` reference in a delta body to appear in the roster**
822
- would be high-false-positive, because a delta body names many surfaces for
823
- context, and a gate that cries wolf trains its readers to bypass it (gate-sdk/SPEC.md
824
- §When a gate earns its place).
825
-
826
- **Criterion 4** (gate-sdk/SPEC.md §The port-candidate criteria) **clears**: the
827
- corpus is `spec_amendments`, which reaches no gate declaration path. **Born
828
- native**, no shell form authored — a crate-carrying tree births a gate native by
829
- default and none of the three exception classes applies. Its `good/`+`bad/` pair
830
- is its oracle: the `bad/` case carries a malformed heading, a non-sequential
831
- delta number, an uncited target and a dangling citation together, so each arm has
832
- an executable statement, while the `good/` case exercises the wrapped citation,
833
- the list and possessive forms, `all deltas`, the fenced decoy and the valve.
834
- `check-amendment-update-target.test.sh` holds the fail-closed exits and the
835
- empty-corpus clean, which a one-pair harness cannot spell.
836
-
837
- Producer of nothing but a verdict; its consumer is the committing session through
838
- the output contract, on the generated pre-commit hook, `run-gates.sh` and CI, and
839
- `run-gate-tests.sh` through the fixture pair. Its input is `spec_amendments`'
840
- output — an existing producer with an existing enabling path, so nothing new must
841
- be configured for the gate to see a live corpus. `precommit` tier.
842
-
843
- ### check-spec-dod-singleton
844
-
845
- Invariant: no canonical spec carries the configured Definition-of-Done
846
- heading more than once (a duplicate checklist is the two-sources defect on
847
- the completion contract); under `exactly-one` mode a spec with none is
848
- also flagged.
849
-
850
- Calibration: heading match is level-insensitive within `##`–`####`;
851
- `at-most-one` exists because a reference-spec corpus legitimately has no
852
- DoD. The good/bad pair covers the DoD count; `check-spec-dod-singleton.test.sh`
853
- covers the finder's kit-root scoping — a DoD-less vendored kit `SPEC.md` is
854
- pruned by default (so `exactly-one` holds on a vendored tree) and re-included
855
- by `CANON_KIT_SCAN_KIT_ROOTS=1`. `align-only` tier.
856
-
857
- ### check-spec-derivable-section
858
-
859
- Invariant: no canonical-spec section under a banned heading (the
860
- configured code-derivable set) whose body exceeds the density budget in
861
- fenced lines — such a section is a code dump that drifts; it sheds to a
862
- one-line index pointer (which is exempt).
863
-
864
- Calibration: density counts non-blank lines; the heading set and budget
865
- are config because what is derivable depends on the consumer's index
866
- tooling. `align-only` tier.
867
-
868
- ### check-spec-embedded-source
869
-
870
- Invariant: no fenced block in a canonical spec verbatim-copies a tracked
871
- source file above the overlap threshold — cite the path instead. Overlap
872
- detection needs no author opt-in; the two valves are the amendment
873
- wire-delta exemption — an amendment is a short-lived design-to-code bridge,
874
- so a not-yet-cite-able wire contract legitimately embeds there until merge
875
- promotes it to a file the canonical spec cites — and the per-site
876
- `spec-embedded-source-exempt: <reason>` marker.
877
-
878
- Calibration: blocks shorter than `CANON_KIT_EMBED_MINLINES` are ignored;
879
- languages in `CANON_KIT_EMBED_ILLUSTRATIVE` are skipped by default; the
880
- threshold is calibrated against real specs, not synthetic fixtures.
881
- `precommit` tier.
882
-
883
- **The wire-delta exemption is scoped to the configured wire kind, not to
884
- amendments.** An amendment quoting enough distinct non-trivial lines of a tracked
885
- file in a fence of any *other* language fires exactly as a canonical spec would,
886
- which is what keeps the valve a bridge for a wire contract rather than a blanket
887
- licence for amendment prose. The per-site marker is the general escape, and it is
888
- a **path-identity** test against the amendment set rather than a name pattern —
889
- which is what re-arms the exemption the moment the amendment is deleted, instead
890
- of leaving a spelling that outlives its subject.
891
-
892
- **Ported to the binary substrate at §The sixth budget batch** (gate-sdk/SPEC.md).
893
- Criterion 4's verdict on it was taken **conservatively without ruling the class**:
894
- its walk opens and content-compares every source file the language roster names,
895
- its own declaration and every sibling's included, but as a *diff reference* rather
896
- than as its assertion target, and whether that satisfies the criterion is the open
897
- ruling `spec-embedded-source-criterion-4-membership` owns. The batch took the
898
- binding verdict for its own member because that costs a fixture widening and
899
- cannot be wrong in the harmful direction, while clearing wrongly ships the hole
900
- the criterion exists to point at; a later reader must not read the disposition as
901
- that entry's answer. The widening the verdict bought is the one delta the pair was
902
- missing: its cases derive a real corpus and do reach the finder, but neither valve
903
- was exercised by any committed case, and both now are.
904
-
905
- **One second-order fact the port prices whichever way that class falls**: every
906
- port removes a shell declaration from this gate's candidate index and adds a Rust
907
- module to it, so its verdicts move under *every* sibling's port — the narrowing is
908
- a swap rather than a removal, and a port can therefore create a violation here by
909
- moving a derivation's text from a file the specs do not quote into one they do.
910
-
911
- ### check-manifest-temporal
912
-
913
- Invariant: no temporal-narration marker in governed manifest prose outside an
914
- exempt site. A manifest states current behavior only — history is derivable
915
- from git, and a `formerly…` line is standing context cost documenting the old
916
- cost, taxing every session that reads it. This gate mechanizes the lexical
917
- share of that judgment; context-kit's close-stage brevity pass keeps the
918
- semantic residue (*is this sentence about the past?*); a by-eye
919
- narration-marker KPI is superseded by this gate (drift-kit/SPEC.md
920
- §Out of scope).
921
-
922
- The scanned set is the shared `spec_manifest_files` finder (§lib/spec.sh):
923
- canonical specs, `README.md` at any depth, and `CLAUDE.md`; amendments are
924
- excluded by construction (a transition artifact describes change — that is its
925
- nature). Markers are `CANON_KIT_TEMPORAL_MARKERS`, the base array merged with
926
- `CANON_KIT_TEMPORAL_MARKERS_EXTRA` (§Layout and configuration), matched
927
- case-insensitively;
928
- fenced code blocks are skipped and a marker inside an inline-code span is a
929
- meta-reference, not narration — so a gate-output example or this section's own
930
- vocabulary may name one. Three valves suppress a legitimately past line: a
931
- per-site `manifest-temporal-exempt: <reason>` comment on the line or the one
932
- above; `CANON_KIT_TEMPORAL_EXEMPT_SECTIONS` — heading names whose whole
933
- section (subsections included) is exempt, this repo's config naming
934
- `Out of scope` (a deliberate-absence ruling may narrate what the kit
935
- excludes); and `CANON_KIT_TEMPORAL_EXEMPT_PATHS` — path
936
- globs whose whole file is exempt, for an immutable dated-narrative surface a
937
- heading name cannot address (this repo's config naming `docs/posts/*`, the
938
- dated announcement posts, which take link and command resolution but not
939
- narration governance). Producer: the generated pre-commit hook /
940
- `run-gates.sh`; consumer: the committing operator via the output contract; each
941
- marker hit is read at the single scan transition (file, line, marker in the
942
- message), no persistent state. Fail-closed on an unreadable manifest.
943
-
944
- The rule is a **compiled subcommand** (gate-sdk/SPEC.md §The POSIX ERE matcher):
945
- each marker is a consumer-supplied ERE, compiled through the crate's matcher
946
- before the first corpus line is read, so a pattern outside the POSIX grammar
947
- exits 2 naming the pattern and the knob rather than scanning past what it meant.
948
- Two fidelity points a transliteration loses, recorded because both are invisible
949
- in a green run: the marker test runs against a **case-folded subject** and the
950
- pattern is not folded, so a marker written with an upper-case letter matches
951
- nothing; and `CANON_KIT_TEMPORAL_MARKERS_EXTRA` unions onto the base array inside
952
- this kit's library *before* the bridge reads it, so the compiled member declares
953
- the base knob alone and a second `_EXTRA` knob would double every added marker.
954
-
955
- Calibration: the marker set is tuned against this repo as the FP corpus — bare
956
- `used to` is excluded (it collides with instrumental "used to build/filter").
957
- At build every hit is dispositioned: reword (preferred — narration is standing
958
- cost), section-exempt (provenance), or site-exempt with reason. `precommit`
959
- tier.
960
-
961
- ### check-manifest-count
962
-
963
- Invariant: no bare cardinal quantifying a governed collection noun
964
- in manifest prose outside an exempt site. A pinned total for a *growing*
965
- collection — `six gates`, `seven meta-gates` — is a second source no gate reads:
966
- the count's owner is the collection itself (`gates.list`, a `checks/` dir, the
967
- stages config), and a restated total drifts the moment the collection grows.
968
- Ban, don't validate — a validating gate carries
969
- the standing token cost context-kit's brevity machinery rejects plus FP-prone
970
- entity mapping; a lexical tripwire eliminates the copy. The motivating find: this
971
- repo landed one gate and left the same total in four disagreeing copies (across
972
- two READMEs and a SPEC), caught only by close-stage review.
973
-
974
- The scanned set is the shared manifest-set finder (§lib/spec.sh) —
975
- canonical specs, `README.md`, `CLAUDE.md`; amendments excluded, fenced blocks
976
- skipped, an inline-code cardinal a meta-reference (so this section may name its
977
- own examples). Both the grammar and the matcher come from the shared count
978
- adapter, and the prose walk is the shared manifest-prose driver (§lib/spec.sh),
979
- so this gate, its `check-prose-enum` sibling, and its comment-tier cousin
980
- read one vocabulary and one exemption behavior, and a total wrapped across a
981
- prose break is caught and reported at its first physical line; a blank line, a
982
- fence, and a `manifest-count-exempt:` site each end the paragraph — an exempted
983
- line cannot join its neighbours into a total. The cardinal
984
- grammar is digit sequences and the spelled
985
- `two`…`twelve`, case-insensitive; `one` is deliberately outside it — singleton and
986
- cardinality-rule idioms ("one owner per fact", "one iteration per kit") are
987
- invariants, not totals. Collection nouns are `CANON_KIT_COUNT_COLLECTIONS`
988
- (default the plurals the kits themselves grow: `gates`, `meta-gates`, `checks`,
989
- `kits`, `stages`, `rules`, `KPIs`) — the one place consumer vocabulary enters,
990
- and it enters as config.
991
-
992
- Two match shapes carry the cardinal to the noun: the *quantifier* shape, which
993
- allows up to `CANON_KIT_COUNT_WEDGE_WORDS` (default `2`) modifiers wedged between
994
- cardinal and noun (so `nine generic rules` pins a total as surely as the
995
- adjacent `six gates`, adjacency being the zero-wedge case), and the
996
- *noun-then-range* shape (`rules 1-8`), which pins both endpoints of an ordered
997
- collection and rots on every append. The exempt contexts an author writes into:
998
- a threshold or comparator on the same line (a bound is a rule, not a total); the
999
- `all but <cardinal>` partition idiom; a partitive marker (`of`, `out of`) on
1000
- either side of the match (in `three of the twelve gates` neither cardinal is a
1001
- restated total); `CANON_KIT_COUNT_ALLOWED_PHRASES`, an exact-phrase allowlist for
1002
- fixed named sets a doc legitimately enumerates (default empty — fixed-set naming
1003
- is consumer judgment, config not mechanism, biting only on a phrase whose noun
1004
- the consumer governs); and the per-site `manifest-count-exempt: <reason>` marker
1005
- on the line or the one above. The exact operator and phrase tokens each context
1006
- recognizes are the check's own regex, generic-English mechanism rather than
1007
- config.
1008
-
1009
- **The sanctioned discharge is the `measured:` marker** (§check-measured-claim),
1010
- and it is the only one of the four that *answers* the ban rather than stepping
1011
- around it: the objection this invariant encodes is a transcribed total with no
1012
- owner, and a marker binds the total to an oracle a gate re-runs. So a cardinal
1013
- under a `<!-- measured: <key>=<value> -->` line satisfies the ban the way a
1014
- generated copy satisfies derivation-first, which strictly shrinks this gate's
1015
- violation set. It rides the same per-site window the exempt marker does — the
1016
- marker line and the claim below it — so the two discharges are one behavior with
1017
- two spellings rather than a second walk. Rewording to cite the owning collection
1018
- stays preferred where the total is not worth stating at all; the exempt tag drops
1019
- to a genuine last resort, because "deliberately unchecked" is now the one thing
1020
- it means.
1021
- Producer: the generated pre-commit hook / `run-gates.sh`; consumer: the
1022
- committing operator via the output contract; each hit read at the single scan
1023
- transition (file, line, matched span in the message), no persistent state.
1024
- Fail-closed on an unreadable manifest.
1025
-
1026
- Calibration shares the sibling's FP corpus and procedure
1027
- (§check-manifest-temporal): the default noun list is tuned against this tree,
1028
- every hit dispositioned — reword to cite the owning collection (preferred),
1029
- extend `CANON_KIT_COUNT_ALLOWED_PHRASES` (a genuinely fixed set), or site-exempt
1030
- with reason. The good/bad pair covers every match shape and the mechanical
1031
- exemptions;
1032
- `check-manifest-count.test.sh` covers the config-driven paths (a consumer-governed
1033
- noun and the allowlist containment) the stock defaults cannot reach, and the
1034
- measured-marker discharge's *window* — that the marked claim is exempt and the
1035
- next paragraph is not, which a pair cannot spell because a fixture file either
1036
- trips or does not. `precommit` tier.
1037
-
1038
- ### check-measured-claim
1039
-
1040
- Invariant: a measured count or extent claim that names an oracle agrees with it.
1041
- The class this closes is a claim authored into governed prose with **no** oracle
1042
- at all — a total, a corpus size, a swept set — which goes stale the moment the
1043
- thing it measured moves, and whose detection is a human re-measuring by hand at
1044
- review time if at all. The sibling ban (§check-manifest-count) reaches the
1045
- tractable slice of that class by refusing a bare cardinal over a governed
1046
- collection; it cannot reach a claim carrying no cardinal, and an *extent* claim
1047
- ("the kit SPECs came back clean") is exactly that shape. Both halves need the
1048
- author to say what was measured, so this is a **marker** an author applies rather
1049
- than a scanner inferring intent: a scanner triggers on a numeral, and the claims
1050
- that cost the most carry none.
1051
-
1052
- **The marker binds a claim to an oracle key and its measured value**, as a
1053
- full-line HTML comment on the line immediately above the claim:
1054
-
1055
- ```
1056
- <!-- measured: <key>=<value> -->
1057
- ```
1058
-
1059
- It joins the family `install-primary:` (§check-install-claim) and
1060
- `payload-discloses:` (§check-payload-claim) rather than inventing a form — a
1061
- full-line comment pairing a prose claim with a machine-readable id drawn from a
1062
- consumer-owned vocabulary behind a `*_CMD` knob. It is deliberately **not** the
1063
- `-exempt:` family: those are suppression valves that make a gate look away, and
1064
- this is an attachment that gives a gate something to check. The reader-facing
1065
- form of the claim stays prose; the marker is the tier beside it.
1066
-
1067
- **The oracle is consumer-owned.** `CANON_KIT_MEASURED_CLAIMS_CMD` names a command
1068
- emitting one `<key>`⇥`<value>` line per measurable fact, loaded through
1069
- `spec_claim_vocabulary` (§lib/spec.sh) and so carrying that loader's fail-closed
1070
- contract. The marker grammar and the comparison are kit mechanism; every key,
1071
- every oracle command and every measured fact is consumer config, because a kit
1072
- literal enumerating what a project measures would publish that project's
1073
- vocabulary. An unset knob means the gate has no oracle and reports clean — the
1074
- inactive-by-default posture its `*_CMD` siblings take.
1075
-
1076
- **Three arms.**
1077
-
1078
- - **A — the oracle disagrees.** Red when the emitter's current value for `<key>`
1079
- differs from the marker's `<value>`. This is the point: the number in the
1080
- document is now checked against the tree.
1081
- - **B — the key is unknown.** Fail closed (exit 2) when `<key>` is absent from
1082
- the emitter's roster. A marker naming a key nobody emits is a claim with no
1083
- oracle wearing the costume of one, which is worse than an unmarked claim. A
1084
- marker that does not parse fails closed for the same reason.
1085
- - **C — the marker drifted off its own sentence.** When `<value>` is a bare
1086
- cardinal, red unless that cardinal appears as a token in the claim the marker
1087
- binds. Without arm C the marker and the prose can disagree while the marker and
1088
- the oracle agree, and the gate would go green over a false sentence — the exact
1089
- failure being closed.
1090
-
1091
- Arm C's cardinal grammar is §check-manifest-count's, read as a value: a digit run
1092
- or a spelled `two`…`twelve` normalized to digits, so a marker's `12` and a
1093
- sentence's "twelve" are one cardinal rather than two. The claim a marker binds is
1094
- the paragraph below it, ending at a blank line, a fence, a second marker or the
1095
- end of file. **The authoring contract arm C prices:** a bound claim carrying more
1096
- than one distinct cardinal is ambiguous, and the gate fails closed rather than
1097
- guessing which one the marker holds — the remedy in the help line is to split the
1098
- sentence or move the marker onto the clause that carries the measurement. That
1099
- cost is bounded: it applies only to sentences an author chose to mark.
1100
-
1101
- **Extent claims are covered by arms A and B alone, and that is the design rather
1102
- than a gap.** An extent claim carries no cardinal, so arm C does not apply and arm
1103
- A does the work, with `<value>` whatever the author declares the extent to be and
1104
- the emitter recomputes: a corpus size, a sorted membership list, a digest over
1105
- the swept set. This is the axis no scanner reaches and it costs nothing extra —
1106
- the same arms, with a set-valued rather than integer-valued oracle. Because the
1107
- config bridge refuses an element containing a tab and tab is this protocol's own
1108
- field separator, a set-valued oracle joins its members with something else. This
1109
- repo's first such inhabitant is `gate-substrates`, the live substrate set the
1110
- enforcement core runs on, its members joined with `+`; it is the shape that makes
1111
- a **definitional or qualitative** sentence self-correcting, since such a sentence
1112
- carries no cardinal for arm C to check and would otherwise be marked with nothing
1113
- an emitter could recompute.
1114
-
1115
- **The known limit, stated rather than hidden: a claim nobody marks is uncaught
1116
- here.** It is narrowed from both sides, along different axes.
1117
- §check-manifest-count's discharge makes marking pressured rather than voluntary
1118
- wherever the ban already bites — a narrowing by **shape**, reaching whatever
1119
- carries a bare cardinal over a governed collection. §check-unmarked-claim narrows
1120
- by **subject**, reaching a claim a consumer has declared must not go unoracled
1121
- whether or not it carries a number. Neither closes the limit; between them the
1122
- uncaught remainder is a claim that is both unnumbered and undeclared, which is a
1123
- smaller set than either alone leaves.
1124
-
1125
- The scanned surface is its own glob knob, `CANON_KIT_MEASURED_SURFACE_GLOBS`,
1126
- **not** the manifest set. The motivating class ranges over SPEC sections and
1127
- binding shims alike, and neither existing surface reaches a shim: the manifest set
1128
- excludes them by omission, with no documented rationale (a reader should not infer
1129
- a ruling from a silent absence), and the prose surface (§lib/spec.sh) excludes them
1130
- by a documented decision about which gate *owns* a shim — `check-shim-restatement`,
1131
- which holds copy shape. That ownership is not this rule's: a restatement that is
1132
- **wrong** has diverged from its owner's wording and is therefore not a copy. So
1133
- reusing either surface would under-scan by exactly the instance that motivated the
1134
- class. Fenced blocks are skipped (a fence is grammar being shown, not a claim being
1135
- made), and a per-site `measured-claim-exempt: <reason>` marker on the line or the
1136
- one above suppresses a marker a document is exhibiting rather than asserting.
1137
-
1138
- **The valve stays, and its zero live uses are not evidence against it** (ruled at
1139
- the `native-cohort-canon-kit` close, on a filed observation that it shipped unused).
1140
- The use count was taken over *this* tree, which is the wrong corpus: canon-kit is a
1141
- kit, so the valve's readers are adopters whose prose this repo cannot see. It is a
1142
- fail-safe for an author who must exhibit a full-line marker outside a fence, and a
1143
- fail-safe carrying live uses would mean the fence-and-inline escapes had already
1144
- failed. It stands beside the family boundary drawn above rather than against it —
1145
- that boundary rules what the `measured:` marker *is*, not whether a suppression
1146
- valve may accompany it.
1147
-
1148
- Producer: the generated pre-commit hook / `run-gates.sh`; consumer: the committing
1149
- operator via the output contract; each marker read at the single scan transition
1150
- (file, line, key, value), no persistent state. `precommit` tier.
1151
-
1152
- **Born native, and this is the first gate with no shell original** — operator-ruled
1153
- 2026-08-12 with the cost below in view. TRAJECTORY.md §The objectives' sixth
1154
- shrinks the interpreter surface to the unavoidable, so a new shell gate is debt
1155
- created knowingly; landing it as a Rust module plus a `.gate` descriptor avoids
1156
- that, and it needs no unbuilt substrate (its glob corpus is served by the walker
1157
- already in production, which is why the corpus was designed as its own surface
1158
- rather than a union with the manifest set). The port criteria govern *ports*, so a
1159
- gate with one implementation has no second substrate to prove parity against: its
1160
- oracle is its `good/`+`bad/` pair, exactly like any new shell gate's, with
1161
- `check-measured-claim.test.sh` holding the fail-closed arms a pair cannot spell.
1162
- **The accepted cost:** a `.gate`-declared member is omitted from the `gates.list` of
1163
- a consumer whose host the release publishes no artifact for, so on an uncovered
1164
- platform this gate does not run where a shell gate would have. That is the port's
1165
- standing cost, already accepted for the members whose shell forms were deleted, and
1166
- it is why the omit-and-declare path exists — a paid price, not an open risk. Its
1167
- reach stayed deliberately open here — *this* gate settled, a second one weighing
1168
- the cost again rather than citing this one as blanket precedent — and that
1169
- question has since been **closed by ruling rather than by precedent**: new gates
1170
- in a crate-carrying tree are born native by default, with shell an exception
1171
- under one of three stated classes (gate-sdk/SPEC.md §The port-candidate
1172
- criteria). The refusal above is unaffected in its own terms: what settles the
1173
- second gate is the ruling, never this section.
1174
-
1175
- ### check-unmarked-claim
1176
-
1177
- Invariant: on the scanned prose surface, a paragraph matching a
1178
- consumer-declared **claim-class** pattern carries a `measured:` marker. The class
1179
- this closes is the axis §check-measured-claim names as its own known limit: the
1180
- marker is voluntary, so the claims that most need an oracle are exactly the ones
1181
- an author never thought to mark. This gate makes marking **pressured inside a
1182
- declared class**, the same narrowing §check-manifest-count already performs for
1183
- the bare-cardinal shape — there by *shape*, here by *subject*.
1184
-
1185
- **It declares a class; it does not ban a phrase, and the difference is the whole
1186
- design.** A ban is discharged forever the moment the banned phrase is deleted, and
1187
- it can only ever face one direction. A class assertion fires again on the next
1188
- author who states the same thing in new words, and it covers a claim that
1189
- overstates in *either* direction, because what puts a sentence in the class is
1190
- what it asserts rather than which words it reaches for. The two properties are
1191
- one property: the class is written over the claim, never over a canonical
1192
- phrasing.
1193
-
1194
- **Two arms and a valve.**
1195
-
1196
- - **A — an unmarked claim.** Red (exit 1) when a paragraph matches a declared
1197
- class ERE and no `measured:` marker binds it. The finding names the class id,
1198
- the file, and the physical line where the match starts, and its `help:` line
1199
- states the three remedies below. A paragraph yields at most one finding, at the
1200
- first class in roster order that matches it.
1201
- - **B — the vocabulary fails to load.** Exit 2 on a command error, an unparsable
1202
- line, a non-slug id, or a repeated id — inherited unchanged from
1203
- `spec_claim_vocabulary` (§lib/spec.sh), which already names the failing
1204
- vocabulary by its `<label>` in every message — and on a declared ERE that does
1205
- not compile, which is the same unreadable-roster failure one step later.
1206
- - **Valve** — `<!-- unmarked-claim-exempt: <reason> -->` on the flagged line or
1207
- directly above it, riding the shared exempt-window (§lib/spec.sh — the line or
1208
- the one above), and the reason is mandatory (the `comment-tier-exempt:`
1209
- convention — a deliberate keep carries its cause in-line, a reasonless valve is
1210
- red).
1211
-
1212
- **The three remedies, and the gate is indifferent between them.** Rewrite the
1213
- sentence out of the class (the doctrine's preference — a claim not made cannot go
1214
- stale); attach a `measured:` marker binding it to an oracle; or land a reasoned
1215
- valve. Naming all three on the finding is what keeps the gate from reading as a
1216
- ban, which it deliberately is not.
1217
-
1218
- **Matching is whitespace-normalized across lines, and this is load-bearing rather
1219
- than a nicety.** A claim spans a prose wrap as readily as it fits on one line, so
1220
- a line-keyed predicate is blind by construction on whatever fraction of its corpus
1221
- happens to wrap — a fraction no author controls and no reviewer can see. The ERE
1222
- is matched against the paragraph with every run of whitespace, the newline at a
1223
- wrap included, collapsed to one space; the finding is reported at the physical
1224
- line the match starts on. This is not a new mechanism: it is the boundary
1225
- §check-manifest-count already crosses for a total whose cardinal and noun straddle
1226
- a wrap, reported at the cardinal's physical line, and the shared adapter
1227
- (§lib/spec.sh) is where that normalization already lives. The subject is
1228
- **ASCII-lowercased** before matching and a class pattern is authored in lower
1229
- case, so a sentence's opening capital is not a way past the class.
1230
-
1231
- **A paragraph is the unit, and it is §check-measured-claim's paragraph**, so the
1232
- both gates agree on what a marker binds: the block ending at a blank line, a fence,
1233
- or the end of file, with the marker line riding inside the block it heads — which
1234
- is what makes carrying a marker a property of the paragraph rather than of a line.
1235
- Fenced blocks are skipped for the reason that section gives: a fence is grammar
1236
- being shown, not a claim being made.
1237
-
1238
- **Coverage-only, and the reason is a constraint rather than a preference.** The
1239
- gate asserts that a matched claim carries *a* marker; it does not assert *which*
1240
- key. `spec_claim_vocabulary` is a two-field loader that **rejects a line carrying
1241
- an extra tab**, so a class cannot declare a required key beside its ERE without a
1242
- third field the loader refuses. Adding one would fork the loader every claim gate
1243
- shares — the cost §lib/spec.sh explicitly took the shared-loader shape to avoid.
1244
- The key is checked by `check-measured-claim` on the very next arm (its arm B fails
1245
- closed on a key nobody emits, its arm A on a value the oracle now contradicts),
1246
- so the composition covers it and neither gate duplicates the other.
1247
-
1248
- The scanned surface is `CANON_KIT_MEASURED_SURFACE_GLOBS` — **shared with
1249
- `check-measured-claim`, not forked**, because they compose: a claim this
1250
- one pressures into a marker is a claim that one then re-measures, and holding them
1251
- over one corpus is what makes that handoff total. The cost of sharing is stated
1252
- rather than hidden: a consumer wanting claim classes over a *different* surface
1253
- than its measured claims cannot express that, and the split is available later
1254
- behind an attested need.
1255
-
1256
- **The roster is consumer config and the seam here is sharper than its siblings'.**
1257
- Every class id and every pattern arrives through `CANON_KIT_CLAIM_CLASSES_CMD`
1258
- (§Layout and configuration); the scan, the normalization, the marker lookup and
1259
- the verdict are kit mechanism. Beyond the provenance seam every claim gate
1260
- observes, this one has a reason of its own: **this SPEC is itself governed prose**,
1261
- so a kit that enumerated a consumer's claim phrasings would match its own class
1262
- while describing it and need a valve to say what it does. Holding the roster in
1263
- consumer config means the kit's prose never spells a member. An unset command
1264
- means no class is declared and the gate reports clean — the inactive-by-default
1265
- posture its `*_CMD` siblings take, and the correct posture rather than a gap: only
1266
- a consumer's own vocabulary can turn this gate on.
1267
-
1268
- **The honest limit, and it is a property of what a roster can hold.** A claim
1269
- stated in a **single implementation-tool token** with no predicate around it is out
1270
- of reach: rostering the bare token would fire on every passing mention of the tool,
1271
- and a gate that cries wolf is a gate its readers learn to bypass — the failure §When
1272
- a gate earns its place (gate-sdk/SPEC.md) names as a defect in the gate rather than
1273
- in the corpus. The general move for a noisy member is to roster **the predicate the
1274
- noisy subject attaches to** rather than the subject, which recovers the site with
1275
- none of the noise; a bare token offers no predicate to move to, and that is the
1276
- residue. Two further bounds are deliberate: the gate cannot tell a **true** class
1277
- member from a false one — it asserts the claim is *bound* to an oracle and
1278
- `check-measured-claim` then asserts the oracle agrees — and neither reaches a
1279
- sentence whose prose is true today and whose stated *reason* is wrong, which stays
1280
- a human judgment.
1281
-
1282
- **Criterion 4** (gate-sdk/SPEC.md §The port-candidate criteria) **clears**: the
1283
- corpus is a pure glob expansion of the configured surface set, reaching no gate
1284
- declaration path in this tree — the same verdict and the same reasoning as
1285
- §check-prose-tells, and flippable by the same consumer config. **Born native**, with
1286
- no shell form authored: a crate-carrying tree births a gate native by default and
1287
- none of the three exception classes applies here (gate-sdk/SPEC.md §The
1288
- port-candidate criteria). Its `good/`+`bad/` pair is its oracle — the `bad/` case
1289
- carries a claim wrapped across a newline, so the line-keyed blindness above is
1290
- executable rather than asserted — with `check-unmarked-claim.test.sh` holding the
1291
- fail-closed vocabulary arms and the two distinct clean skips a pair cannot spell.
1292
-
1293
- Producer of nothing but a verdict; its consumer is the committing session through
1294
- the output contract, on the generated pre-commit hook, `run-gates.sh` and CI. Each
1295
- paragraph is read at the single scan transition, no persistent state. `precommit`
1296
- tier.
1297
-
1298
- ### check-prose-enum
1299
-
1300
- Invariant: within one manifest-prose paragraph, a delimited hand list naming two
1301
- or more members of one declared governed set must name every member of that set,
1302
- unless an exempt site holds; a member absent from the paragraph is reported as
1303
- omitted. This is the enumeration sibling of check-manifest-count's restated
1304
- totals and the prose analog of check-kit-enum's hand-list doctrine: the count
1305
- gate catches a bare cardinal over a growing collection, but a row that
1306
- *enumerates instead of counting* drifts just as silently when the set grows.
1307
- <!-- prose-enum-exempt: historical attested-drift citation — names the set as it stood when the drift occurred, deliberately not tracking growth -->
1308
- The attested drift: a README row's `blocked-by/needs-spec/spec` tag algebra went
1309
- incomplete when a sibling tag landed — same restatement, different surface form,
1310
- no scanner. Engagement mirrors check-kit-enum — two members are a list, a lone
1311
- member (or two scattered across a paragraph, not adjacent) is a mention, not a
1312
- list.
1313
-
1314
- Set declarations are consumer config, never gate literals (the provenance seam):
1315
- `CANON_KIT_ENUM_SETS_CMD` (default empty — clean skip) names a consumer command
1316
- emitting one `<set-name>`⇥`<member>` line per member, loaded through
1317
- `spec_enum_sets` (§lib/spec.sh); a command that fails or a line that does not
1318
- parse is fail-closed (exit 2). A member matches word-bounded — bracketed
1319
- (`[spec:]`) or bare (`spec`), neither an alphanumeric, a hyphen, nor an
1320
- underscore abutting, so a stem never matches inside a longer tag, and an
1321
- **underscore-separated identifier never reads as present inside a longer
1322
- sibling**: `guard_allow` is named by "the `guard_allow` helper" and not by "the
1323
- `guard_allow_match` pair", which is what a reader means by both sentences. A
1324
- member that falsely reads as present is one the gate stops asking about, so the
1325
- paragraph omitting it reports clean — the silent direction, and the reason the
1326
- class holds the whole identifier rather than most of it. `.` and `/` stay
1327
- *outside* the class deliberately, and that is what makes the identifier reading
1328
- exactly one character wide: a basename member matches prose spelling the file
1329
- kit-relative, repo-relative or bare (below), which admitting either would break.
1330
- The attested drift used bare stems.
1331
- The grammar stays two fields. A third, scoping a set to a whole file rather than
1332
- a paragraph, was weighed against a **cross-document** absence — members spread
1333
- over per-section prose, which a paragraph-scoped judge structurally cannot see —
1334
- and refused: it changes a wire grammar whose fail-closed rule rejects a third
1335
- field, and a document-scoped completeness test has a far worse false-positive
1336
- profile, since any mention anywhere satisfies it. Reshaping such prose into a
1337
- roster the paragraph judge can read closes the same case with no grammar change.
1338
-
1339
- The scanned set and the paragraph walk are the shared `spec_manifest_files`
1340
- finder and `spec_manifest_walk_awk` driver (§lib/spec.sh); this gate's
1341
- `sk_on_pflush` hook judges each flushed paragraph. Two or more members present
1342
- count as a *hand list* only when a run of them is chained by list separators
1343
- (comma, slash, brackets, whitespace, or `and`/`or`); members merely co-occurring
1344
- in one paragraph with prose between them stay mentions. Omitted members are set
1345
- members absent from the whole paragraph — the sibling that landed but never
1346
- joined the list. Exempt contexts follow the count gate's family shape,
1347
- mechanical markers first, per-site tag last: a subset marker in the window
1348
- (`e.g.`, `such as`, `among them` — the list declares itself partial), a
1349
- partitive marker on the match (`some of`, `one of`, `of the set` — a selection,
1350
- not an enumeration), and the per-site `prose-enum-exempt: <reason>` on the line
1351
- or the one above. The corrective names both legitimate fixes: cite the owning
1352
- set by name, or complete the enumeration — never trim to a silent subset.
1353
-
1354
- Producer: the generated pre-commit hook / `run-gates.sh`, coupled to the
1355
- manifest set plus the consumer's config and kit sources (a set change re-fires
1356
- the gate over the docs). Consumer: the committing operator via the output
1357
- contract — file, line, set name, count, and the omitted members all read once at
1358
- the scan transition. `CANON_KIT_ENUM_SETS_CMD` is read at startup; both fields of
1359
- each emitted line are read at match time (set name in the report, member in the
1360
- matcher). This repo's consumer config is `scripts/enum-sets.sh`, which derives
1361
- the queue task-tag set and the Lessons-channel set from queue-kit's own
1362
- lead-line tag parser plus `QUEUE_KIT_LESSON_TAGS` — derived, not restated; the
1363
- two roles are separate sets because a paragraph naming one role's tags is not
1364
- enumerating the other. A set a consumer can only hand-list is that consumer's
1365
- own drift to own; the kit contract asks only for the emit grammar.
1366
-
1367
- The same emitter adds two roster families over the kit tree, one set per kit
1368
- root: a `<kit>-lib` set of the tracked top-level `lib/*.sh` basenames and a
1369
- `<kit>-gate-test` set of the tracked top-level `gate-tests/*.test.sh` basenames,
1370
- with the roots read from `gate_kit_roots_rel` (gate-sdk/SPEC.md §lib/gate.sh) so
1371
- the sets cannot enumerate a tree the battery does not. A new kit, lib or unit
1372
- test enrols with no edit, which is the property a hand correction per stale
1373
- roster would not have. Members are basenames rather than paths because a
1374
- basename matches prose spelling the file kit-relative, repo-relative or bare —
1375
- the boundary rule above accepts the leading slash. The families fail closed
1376
- where an empty result contradicts the shape they read (no kit roots at all, or a
1377
- `lib/` tracking no top-level `*.sh`) and stay silent where emptiness is real: a
1378
- `gate-tests/` holding only `good/`+`bad/` fixture directories ships no bespoke
1379
- unit test, and that is a normal kit.
1380
-
1381
- Two further families — a per-lib set of its function names, and a per-lib set of
1382
- the files sourcing it — were derived, measured against this tree and refused;
1383
- the reason is recorded so neither is re-minted. Both fail on one property: a
1384
- lib's functions and its sourcers are a vocabulary prose *discusses*, not a set
1385
- prose *rosters*, so the set-difference is real while the finding is false. The
1386
- function family reported an omission at every passage explaining how two helpers
1387
- interact, none of them a roster — the measurement that is dispositive on its own,
1388
- and the one that produced the rule this paragraph ends on. The refusal rests on
1389
- that ground alone. It rests **not at all** on the matcher, which bounds an
1390
- identifier on the underscore too (above), so `guard_allow` is absent from a
1391
- paragraph naming only `guard_allow_match`: a refusal resting partly on a broken
1392
- matcher would invite exactly the wrong inference — fix the matcher, re-mint the
1393
- family. That matcher defect was sighted while measuring this very family, which
1394
- is where the identifier boundary rule came from and why the family is named here
1395
- as its origin rather than as a second reason to refuse.
1396
- The caller family's one intended site is a caller roster written as narrative, which
1397
- the hand-list adjacency rule correctly declines to judge, so it was inert there
1398
- while still firing falsely on a README row naming two of a kit's tools. The rule
1399
- the pair teaches: declare a derived set when the tree shape it reads is one the
1400
- prose rosters — a layout is such a shape, an incidental relation is not.
1401
-
1402
- Calibration follows the count gate's procedure: tuned against this tree, every
1403
- hit dispositioned — cite the set, complete the list, or site-exempt with reason.
1404
- The good/bad pair covers a bare comma hand list dropping a member and the
1405
- marked-subset cases; `check-prose-enum.test.sh` covers the config-driven paths
1406
- (the empty-default skip, the fail-closed escapes, bracketed matching, multi-set
1407
- independence, the exempt escapes, and the identifier boundary's prefix-sibling
1408
- pair) the pair cannot reach — the boundary case needs a declared set holding
1409
- underscore members, which is a config no pair running on the consumer's own
1410
- hyphenated sets can supply. `precommit` tier.
1411
-
1412
- ### check-knob-citation
1413
-
1414
- Invariant: no kit knob stated *with its value* in governed manifest prose
1415
- outside the owning kit's SPEC. This is the enforcement half of the
1416
- de-literalization rule (doctrine-kit/DOCTRINE.md §Methodology-maintenance
1417
- rules): a knob default copied into a README or a sibling SPEC is a second source
1418
- no gate reads, and it drifts the moment the owner changes. Where the count and
1419
- enum siblings ban a restated *total* and a restated *enumeration*, this bans a
1420
- restated *knob value*.
1421
-
1422
- The knob-token vocabulary is derived, never listed — the provenance seam holds
1423
- (a kit literal carrying a private vocabulary would publish it). Each
1424
- `gate_kit_roots` member yields two SCREAMING_SNAKE prefix forms: the dir name
1425
- uppercased with hyphens mapped to underscores (`gate-sdk` → `GATE_SDK_`,
1426
- `delegation-kit` → `DELEGATION_KIT_`), and for a `-kit`-suffixed dir the
1427
- suffix-dropped short form too (`lifecycle-kit` → `LIFECYCLE_`), so a knob on
1428
- either the long or the short form is governed. Both forms derive mechanically,
1429
- so adding a kit widens the vocabulary with no edit here and the gate ships no
1430
- term list. A SCREAMING_SNAKE token is a candidate
1431
- only when it starts with a derived prefix; the short form widens the token
1432
- space, and the value-marker leg below is what holds the false-positive rate.
1433
-
1434
- A candidate fires on the value-marker triad, every leg required: a
1435
- derived-prefix token; a same-line value marker; and a surface that is not the
1436
- token's owning SPEC (`<owning-kit>/` joined to `CANON_KIT_SPEC_NAME`). The
1437
- marker is one of two shapes — `=` appended directly to the token
1438
- (`<KIT>_<KNOB>=<value>`), or the word "default" bound within a short window to a
1439
- value literal (a backticked value, a quoted string, or a number). Bare knob
1440
- names stay legal everywhere: prose cites the name and points at the owning
1441
- roster, the fixed instance the gate must never flag; a bare number with no knob
1442
- token in reach never fires — a tripwire left to human judgment, not a gate rule.
1443
- Code and config are out of scope: code owns values, and only the prose manifest
1444
- is scanned.
1445
-
1446
- Two calibrations hold the false-positive rate against this tree, the corpus the
1447
- leg is tuned on. A token named inside a `${…}` shell parameter expansion is a
1448
- name citation — another knob's default *expression*, a fallback source — never a
1449
- value statement of itself, so expansions are blanked before the token scan. And
1450
- the "default" leg binds: the word must be followed within a short window by a
1451
- literal that is not itself a backticked knob name, so a stated default like
1452
- ``default `docs/CNAME` `` fires while a knob cited bare after the verb ("these
1453
- paths default through `<KIT>_<KNOB>`") does not.
1454
-
1455
- The scanned set is the shared `spec_manifest_files` finder and the prose walk is
1456
- the shared `spec_manifest_walk_awk` driver (§lib/spec.sh); this gate supplies the
1457
- `sk_on_line` hook (the per-line triad) and leaves `sk_on_pflush` unused — the
1458
- marker is same-line, so no paragraph join is needed. Fences are skipped, and a
1459
- `knob-citation-exempt: <reason>` on the line or the one above is the per-site
1460
- valve for a genuine local restatement (a wiring example whose value is the
1461
- citing kit's own path). Producer: the generated pre-commit hook / `run-gates.sh`,
1462
- coupled to the manifest set and the kit SPECs; consumer: the committing operator
1463
- via the output contract — file, line, the knob token, and the owning SPEC the
1464
- value belongs in, each read once at the scan transition, no persistent state.
1465
- Fail-closed on the awk status.
1466
-
1467
- Calibration follows the family procedure (§check-manifest-temporal): every hit
1468
- dispositioned — cite the knob by name and point at its SPEC roster (preferred),
1469
- or exempt a genuine local restatement with reason. The good/bad pair covers both
1470
- marker shapes, the short-derived prefix, the `${…}` name citation, the
1471
- default-as-verb non-hit, and the per-site valve; `check-knob-citation.test.sh`
1472
- covers the owning-SPEC exemption (a kit may state its own knob's value in its own
1473
- SPEC but not in its README) the fixture pair cannot reach. `precommit` tier.
1474
-
1475
- This gate polices where a value is *placed* (prose may not restate it); its
1476
- sibling `check-knob-default-coupling` polices whether the value *agrees* between
1477
- the source fallback and the SPEC that owns it. The two share the
1478
- default-statement grammar (§lib/spec.sh) — one reads it to reject a value in
1479
- prose, the other to confirm the SPEC states the source's literal.
1480
-
1481
- ### check-knob-default-coupling
1482
-
1483
- Invariant, for every literal kit-knob default in kit executable source: the
1484
- literal (1) agrees across every site that supplies it and (2) equals the default
1485
- the owning kit's SPEC states. Where `check-knob-citation` bars a knob value
1486
- copied into prose *outside* the owning SPEC, this closes the channel that gate
1487
- leaves open — the `:-` fallback (or guarded assignment) in the source that
1488
- actually supplies the default is coupled to the SPEC statement, so the two
1489
- cannot drift silently.
1490
-
1491
- Two default idioms are scanned: a `${PREFIX_KNOB:-value}` fallback expansion, and
1492
- the guarded assignment that is the dominant form in the kits' `lib/*.sh` — a
1493
- `[[ -v PREFIX_KNOB ]] || PREFIX_KNOB=value` scalar or a
1494
- `declare -p PREFIX_KNOB &>/dev/null || PREFIX_KNOB=(…)` array. The knob prefix is
1495
- derived, never listed — one SCREAMING_SNAKE form per `gate_kit_roots` member
1496
- (the dir uppercased, hyphens to underscores), so the gate ships no term list and
1497
- the provenance seam holds; a token is a candidate only when it opens with a
1498
- derived prefix. The scanned surface is the kit source under those roots (the
1499
- roster the meta-gates walk, `templates/` and fixtures pruned); a knob's owning
1500
- SPEC is resolved by its prefix, not the citing file's kit, so a `canon-kit`
1501
- source citing a `GATE_SDK_` knob couples to gate-sdk's SPEC.
1502
-
1503
- Assertion 1 (source self-agreement): every literal site for one knob carries the
1504
- same literal; two disagreeing is drift inside the source before any SPEC is
1505
- read, and it suppresses the knob's assertion-2 check (fix the source first).
1506
- Assertion 2 (SPEC agreement): the owning SPEC states that same literal as the
1507
- knob's default, read through the default-statement grammar `check-knob-citation`
1508
- shares (§lib/spec.sh). A default stated as the same `${…:-tail}` deferral the
1509
- source uses is reduced tail-to-tail before the compare, so a knob inheriting
1510
- another kit's default reads as agreement. A knob whose SPEC carries no default
1511
- statement at all reds — the SPEC owns knob defaults.
1512
-
1513
- The coupling is literal-to-literal, and the calibration draws the boundary of
1514
- what carries a single literal to couple. Skipped-and-counted, never coupled: a
1515
- computed default (any expansion, substitution, or arithmetic in the value), an
1516
- array default (no single literal), an empty fallback (`${X:-}` is the `set -u`
1517
- presence-guard idiom, not a value — the real default lives at the else-branch or
1518
- guarded-assignment site the gate reaches there), and a default the SPEC states
1519
- *descriptively* rather than as a literal (a regex, a phrase set, a bundled list —
1520
- code owns the complex value and the SPEC describes it, the widest-true tier). The
1521
- honest limit: agreement is confirmed by the source literal appearing as the
1522
- SPEC's stated default, so a value the SPEC never pins to a literal cannot be
1523
- coupled — only a literal disagreement or a wholly undocumented default reds.
1524
-
1525
- **Ported to the binary substrate at §The sixth budget batch** (gate-sdk/SPEC.md),
1526
- where it took criterion 4 in its sharpest form: its `couples=` field is one level
1527
- deep and so does not cover its own declaration path, while the recursive kit-root
1528
- walk beneath it — which prunes `templates/` and nothing else — reads that path as
1529
- content on every run. Couple clears, walk binds. Its assertion target is the
1530
- grammar of a default, never a gate's dispatch relation, so the criterion is paid
1531
- by the good/bad pair rather than answered by staying shell (§Meta-gate
1532
- conservation for the binary substrate).
1533
-
1534
- Producer: the generated pre-commit hook / `run-gates.sh`, coupled to kit source
1535
- and the kit SPECs; consumer: the committing operator via the output contract —
1536
- file, the knob, the source literal, and the owning SPEC, each read once at the
1537
- scan transition, no persistent state. Fail-closed on an unreadable kit root or an
1538
- unresolved knob. The good/bad
1539
- pair covers self-agreement, the SPEC disagreement, and both idioms;
1540
- `check-knob-default-coupling.test.sh` covers the cross-kit owning SPEC, the
1541
- absent-default red, and the descriptive/array/empty/deferral skips the pair
1542
- cannot reach. `precommit` tier.
1543
-
1544
- ### check-surface-duplication
1545
-
1546
- Invariant: no unvalved bold-lead-in definition of a glossary term on a
1547
- configured non-glossary surface — the canonical definition form belongs
1548
- only to the glossary; elsewhere it is a second definition that drifts.
1549
- Valves `vision-introduces:` / `spec-introduces:` (same line or the line
1550
- above) make a legitimate narrative or local introduction a reviewable
1551
- decision in the diff.
1552
-
1553
- Calibration: a bold lead-in naming a component (a directory owning a
1554
- canonical spec) is never flagged — a component's definition lives in its
1555
- own spec, so there is nothing to restate; gate-test fixtures are excluded;
1556
- exits 2 when the glossary file is absent (register the gate only where the
1557
- topology exists). `align-only` tier.
1558
-
1559
- ### check-comment-tier
1560
-
1561
- Invariant: every full-line comment on a governed source is one of — a
1562
- machine directive (a comment a tool parses: `graph:`, `shellcheck`,
1563
- `contract:`, `install:`, `smoke-unregistered:` — the last two read off a kit's
1564
- vendored source, `install:` by the installer's recipe module and
1565
- `check-install-disposition`, `smoke-unregistered:` by `run-consumer-smoke.sh`
1566
- off `smoke/install.sh`, gate-sdk/SPEC.md §The install disposition and
1567
- §Consumer smoke), a reason directive (a spec pointer, usage synopsis, or
1568
- positional justification: `spec:`, `usage:`, `exception-list:`,
1569
- `no-fixture:`, `no-port:`, `port-until:`, `assertion`, `permanent:`, `TODO(task:`,
1570
- `TODO(spec-ambiguity)`, which blesses a bounded window — its own line plus
1571
- continuation lines up to `CANON_KIT_COMMENT_RUN_CAP` total physical comment
1572
- lines, blank `#` lines counted; a directive mid-run opens a fresh window
1573
- from its own line, and every comment line beyond a window classifies on its
1574
- own), `comment-tier-exempt: <reason>`, or the
1575
- comment immediately above a positional construct from the language roster.
1576
- Anything else is flagged. Code is the WHAT, its SPEC the WHY — the seam the
1577
- align stage checks each side against; a comment that restates the code, or
1578
- paraphrases the SPEC section it cites, is deleted, not blessed. A `spec:`
1579
- directive earns its place by the coupling it makes — a bare pointer binding
1580
- this code site to the requirement that governs it, as `contract:` / `assertion`
1581
- / `graph:` bind a site to a manifest contract, an enumerated assertion, or the
1582
- gate graph. The binding is the value: either side's drift breaks it visibly
1583
- (gate-checked both sides for `graph:` and `assertion`; for `spec:` /
1584
- `contract:` `check-spec-pointer` gate-checks the forward side — the target
1585
- resolves — leaving only the reverse, an uncovered requirement, a review
1586
- concern), which is why it blesses only its own one-line binding, never a
1587
- relocated block — restatement couples nothing, it just forks the why into a
1588
- second copy no gate reads. `comment-tier-exempt: <reason>` is the honest
1589
- directive for a genuinely-local fact below SPEC altitude that neither tier
1590
- owns.
1591
-
1592
- The governed-source corpus reaches the **implementation of a ported gate**, not
1593
- just shell — `comment_surface` with templates kept (§lib/spec.sh), which owns
1594
- the file set. This is the load-bearing half of the reader
1595
- partition gate-sdk/SPEC.md §The `# graph:` manifest states — locality-class
1596
- directives bind to a line of implementation and therefore stay there, so the
1597
- tier rule has to follow them across the substrate or go dark exactly where it
1598
- still applies. A descriptor's own lines are directives by construction. Marker
1599
- matching is on the **token**, independent of the comment leader, so `//` and `#`
1600
- carry the same directives and no language earns a quieter standard.
1601
-
1602
- **The colon side's sharp edge is a naming rule, not a matcher one.** A colon
1603
- directive matches as a substring (the joining rule under Calibration below), so a
1604
- short token nests inside ordinary vocabulary: a directive named `port:` would
1605
- silently bless `support:`, `transport:`, `export:` and `report:`. Roster names on
1606
- that side are chosen not to nest; a bare word is bounded and carries no such
1607
- hazard. Unenforced by construction — the hazard is in a name that does not exist
1608
- yet, and a scanner over a roster of literals would be checking the roster against
1609
- itself.
1610
-
1611
- One shape overrides the window: a full-line comment carrying a **restated
1612
- collection total** — the count grammar of §check-manifest-count, over the same
1613
- `CANON_KIT_COUNT_COLLECTIONS` vocabulary — is flagged even where a directive
1614
- blesses it, and positional rescue does not reach it either. A count is never
1615
- directive wording. A directive's blessing covers its own wording physically
1616
- wrapped, never a total pinned beside it, and such a total is exactly the second
1617
- source the manifest gate bans: `# rules 1-8` sat stale in this repo's own guard
1618
- while its ruleset grew past eight, invisible because no gate read comments for
1619
- counts. The fix is deleting the count or citing the owning collection; the sole
1620
- valve is `comment-tier-exempt: <reason>`, whose window suppresses the override
1621
- as it suppresses the tier rule. The override still catches a total hidden in a
1622
- directive's own wrapped wording — the wrap is exactly where one would escape a
1623
- line-at-a-time scan — and an exempt line cannot launder its neighbours into one.
1624
- The weighed alternative — a source-coupled
1625
- numeral scan with an allowlist — is rejected: legitimate numerals abound in
1626
- source (exit codes, indices, field positions) and the false-positive rate would
1627
- exceed the catch. Counts in *code* stay a review concern; counts in *prose*,
1628
- wherever the prose lives, are gated.
1629
-
1630
- Calibration: the built-in roster is Checkwright's own kit-mechanism
1631
- directive names; `CANON_KIT_COMMENT_MACHINE` / `_REASON` append a consumer's
1632
- product vocabulary (the same split as `check-graph`'s vocab — the mechanism
1633
- ships, the rule content is config). The window cap is
1634
- `CANON_KIT_COMMENT_RUN_CAP` (default 3 — one wrapped sentence): a
1635
- within-window continuation is the directive's own wording physically
1636
- wrapped, blessed as such, while prose beyond the window is presumed
1637
- relocated restatement and deleted. `comment-tier-exempt:` is reserved for a
1638
- genuinely-local fact neither tier owns, and exempting a restatement rather
1639
- than deleting it is itself the defect — a long roster (a `usage:` option
1640
- list, a header) restructures into directive-anchored short paragraphs or
1641
- trims, never launders prose past the cap. The count-shape override reads the
1642
- shared count adapter (§lib/spec.sh) rather than a second grammar, so it
1643
- inherits that gate's carve-outs unchanged: a comparator bound or a `per`-phrase
1644
- in a directive is a rule and not a total, a partitive proportion exempts both
1645
- its cardinals, and a cardinal in inline code is a meta-reference — which is why
1646
- a directive may still say `at most three checks per run` or name a
1647
- `` `six gates` `` example. No knob is added: the noun vocabulary enters through
1648
- `CANON_KIT_COUNT_COLLECTIONS` and the wedge window through
1649
- `CANON_KIT_COUNT_WEDGE_WORDS`. The default surface is shell
1650
- (`#`) — `templates/` stubs included: a copied-out template's `spec:` line
1651
- resolves against the vendored kit path (kit SPECs travel with the
1652
- vendor-whole install), so its comments are directives like any source and
1653
- this gate governs them, where
1654
- `check-spec-pointer` exempts them as placeholders-by-design — with the
1655
- workflow directory's **tracked** members blessing only `contract:`/`see`,
1656
- whatever their extension (the capture tier is gitignored and headerless, so
1657
- tracking is the filter, not the suffix — gate-sdk/SPEC.md §The workflow
1658
- directory). On a **markdown** member of that directory a `##`-or-deeper line is
1659
- the surface's own block grammar rather than a comment, and is read as an
1660
- ordinary content line: a workflow surface whose records *are* `## ` blocks
1661
- (lifecycle-kit/SPEC.md §The survey record) would otherwise have every record
1662
- heading flagged as untagged prose, and no tagging is available that would not
1663
- put a directive inside the data. The narrowing costs no coverage — the member's
1664
- `# contract:` header is still classified here, and its tier and header payload
1665
- are `check-workflow-tiering`'s (gate-sdk/SPEC.md §The workflow directory) — and
1666
- it is deliberately extension-scoped rather than content-sniffed, so a `.txt`
1667
- data member's `#` lines stay comments;
1668
- slash-comment parsing (`//`, `/* */`, doc-comments, heredoc skipping) ships
1669
- as mechanism and activates when a consumer widens `CANON_KIT_COMMENT_SURFACE`
1670
- to a language that needs it. Positional rescue is language-agnostic — its
1671
- construct roster (`CANON_KIT_COMMENT_POSITIONAL`) is consumer config, empty
1672
- by default so inert on the shell surface (a Rust consumer supplies the
1673
- `unwrap`/`allow`-class tokens; a consumer's language is not a kit
1674
- literal). Trailing inline comments are out of scope by construction — the
1675
- FP-prone half of the judgment stays a review tripwire. Not-yet-swept
1676
- sources ride `CANON_KIT_COMMENT_WHITELIST` (its array tagged
1677
- `# exception-list:`, each `# until:` a live drain task per
1678
- `check-gate-exemption-tasks`), draining kit by kit. `precommit` tier.
1679
-
1680
- **Declared by `check-comment-tier.gate`, dispatching to the binary**, with the
1681
- four members of this family ported as one cohort
1682
- (gate-sdk/SPEC.md §The first cohort, and the rule that selects the next). Its
1683
- `couples=` carries `*.gate` and `*.rs` as **bare globs** beside the shell and
1684
- workflow spellings: the corpus scans both declaration forms and the ported
1685
- implementation, and a token naming this repo's crate directory would publish one
1686
- consumer's layout into a kit file (CLAUDE.md §The provenance seam) and be false
1687
- for every other. The gate reads no regex engine — its blessing roster is a set of
1688
- literal directive tokens, matched as a substring for a `keyword:` and
1689
- non-alphanumeric-bounded for a bare word, which is joining rather than
1690
- interpreting (gate-sdk/SPEC.md §The POSIX ERE matcher).
1691
-
1692
- ### check-spec-pointer
1693
-
1694
- Invariant, two passes, forward direction only: every `spec:` / `contract:`
1695
- pointer **directive** on a governed source resolves, and every free-prose
1696
- `<path>.md §<heading>` **citation** on a governed manifest resolves. The
1697
- directive set is exactly what `check-comment-tier` blesses by shape: full-line
1698
- `spec:` / `contract:` comments on the governed sources, plus the `# contract:`
1699
- headers on the workflow directory's **tracked** members (gate-sdk/SPEC.md §The
1700
- workflow directory owns that tier). That section rules two `contract:` payloads,
1701
- and this gate honours both: a **version-marker** payload (`<format-name> v<N>`,
1702
- matched on that section's own anchored shape, and only after `contract:` — a
1703
- `spec:` directive wearing the shape still resolves as a path) is a wire-format
1704
- version its owning gate parses, so it names no path, resolves as none, and is
1705
- counted on the clean line rather than skipped silently. Discriminating it here is
1706
- what keeps the form usable without a per-consumer whitelist entry. A directive's
1707
- target grammar is
1708
- `<path> [§<heading>]`: `<path>` (repo-relative) must be a tracked file, and when
1709
- a `§<heading>` fragment is present the file must carry a matching markdown
1710
- heading; a pointer without `§` resolves file-only. Reddens on a missing or
1711
- untracked target file, on a named heading the target lacks, and — fail-closed —
1712
- on a directive that matched the pointer shape but carries no target path.
1713
-
1714
- The prose-citation pass closes the gap where a citation woven into a sentence
1715
- (`context-kit/SPEC.md §The memory-off doctrine`) resolved neither file nor
1716
- heading while the structured directive and the markdown-link anchor were both
1717
- verdict-checked. It scans the manifest set (`spec_manifest_files`, the same
1718
- surface the manifest-narration gate family reads) over a blank-line-delimited
1719
- paragraph join so a heading that wraps a line reassembles, and resolves the
1720
- heading through one shared resolution path — the directive pass and the
1721
- citation pass call the same helper, so they cannot diverge. Free prose runs on past the heading with no delimiter, so
1722
- the citation pass matches a heading as a boundary-anchored **prefix** of the
1723
- fragment where the directive pass matches it whole. A cited path that is not a
1724
- tracked file is out of this pass's scope — path liveness stays with the gates
1725
- that own it (`check-md-refs`, `check-kit-ref-liveness`); ruling only on headings
1726
- of resolvable files is what holds the false-positive rate at the directive
1727
- pass's level.
1728
-
1729
- `check-comment-tier` owns the directive's *shape*; this gate adds *resolution*
1730
- on top, the binding a `spec:` pointer makes being only as good as its liveness
1731
- — a renamed or deleted heading leaves every inbound pointer or citation
1732
- dangling, otherwise caught only on review. Heading match tolerates a trailing
1733
- `(qualifier)` on either side: a pointer narrowing a section to a labelled point
1734
- (`§check-graph (assertion G)` → the `check-graph` heading) or a heading carrying
1735
- a locator the pointer omits (`§The guard framework` → `## The guard framework
1736
- (lib/guard.sh)`). Two `§` carve-outs keep the false-positive floor and must not
1737
- be conflated: a directive's em-dash *prose tail* (`spec: <path> §<h> — <gloss>`)
1738
- strips at the `` — `` so a `§` in the gloss is not read as a heading, while a
1739
- free-prose citation *is* a heading marker — the citation pass fires on a
1740
- tracked `.md` path immediately followed by `§`, and a bare `§` with no tracked
1741
- path before it (the deliberate non-citation use) never fires. Fenced code
1742
- blocks are skipped in both passes — a quoted example is not a citation.
1743
-
1744
- Calibration: forward direction only. The reverse — flagging a requirement with
1745
- no inbound pointer as uncovered code — needs a "what counts as a requirement"
1746
- notion that risks false positives against the cheap-and-FP-free bar, so it is
1747
- ruled out (a separate task with its own ruling if ever wanted; this gate
1748
- reserves no syntax for it). Configuration is shared with `check-comment-tier` —
1749
- the whitelist predicate and the same
1750
- `CANON_KIT_COMMENT_*` knobs, so no new config knob — but this gate scans
1751
- the **pruned** comment surface, which drops `templates/` sources where
1752
- `check-comment-tier` keeps them. The split is by design, not a "SPECs don't
1753
- travel" claim: a template's `spec: <your SPEC> §check-<area>` line is a
1754
- placeholder the consumer fills in, unresolvable *by design* in the kit's own
1755
- tree — resolving it there would check the consumer's homework against a stub.
1756
- The tier gate still governs those template comments by *shape* (they must be
1757
- directives), so each gate draws the `templates/` line where its own semantics
1758
- put it. `precommit` tier.
1759
-
1760
- Retention ruling: the standing doubt — forward-only checking plus the
1761
- basename↔§heading convention make the pointer largely redundant, its gloss a
1762
- restatement risk — is answered and the roster slot kept. The convention
1763
- derives a section's *name*, never its liveness: absent an inbound pointer,
1764
- renaming or deleting a SPEC heading reddens nothing, and the pointer is the
1765
- only mechanized code→prose coupling (the reverse direction stays a review
1766
- concern per the paragraph above). Sites away from a file's header bind
1767
- sections no naming convention can derive. Narrowing the directive to a bare
1768
- pointer buys nothing: the gloss is already capped at the one-line binding
1769
- (§check-comment-tier), and a gloss restating the cited section is deleted
1770
- under that doctrine, not re-gated here. Dropping the slot would also orphan
1771
- the citation coverage the convention carries — the reason a dedicated
1772
- script↔doc citation gate stays unbuilt.
1773
-
1774
- **Declared by `check-spec-pointer.gate`, dispatching to the binary**, with its
1775
- `couples=` widened to `*.gate`, `*.rs` and every tracked workflow member on the
1776
- same terms `check-comment-tier`'s is. The gate that reads a `# spec:` directive
1777
- is now itself declared by one, so a member of this family reads its own cohort's
1778
- descriptors — which is why the fixture pair carries a descriptor arm rather than
1779
- resting on the live tree to exercise it.
1780
-
1781
- ### check-todo-task-liveness
1782
-
1783
- Invariant: every `TODO(task: <slug>)` marker on a governed source resolves to a
1784
- live queue task. A `<slug>` naming an active or deferred task resolves; a slug
1785
- sitting in `Done` is **stale** (the work finished, the marker did not); a slug
1786
- absent from the queue is **unresolved** (a typo or an unfiled task). Stale and
1787
- unresolved both redden — a marker referencing nothing is a dangling forward
1788
- reference, the source-side twin of a `blocked-by` tag left pointing at a
1789
- completed task.
1790
-
1791
- `check-comment-tier` owns the marker's *shape* — it blesses `TODO(task:` as a
1792
- reason directive — and this gate adds *resolution* on top, exactly as
1793
- `check-spec-pointer` adds resolution to the `spec:` shape the same tier gate
1794
- blesses. It closes the liveness gap those siblings already guard elsewhere:
1795
- `check-task-names` flags a `blocked-by` gone stale on a done slug and
1796
- `check-gate-exemption-tasks` resolves an exemption's `# until:` slug against the
1797
- live set, but a `TODO(task:)` bound to a cleared task passed forever because
1798
- nothing read the source side. The marker requires a resolvable slug after the
1799
- colon, so a tool carrying the bare roster literal (`check-comment-tier`'s own
1800
- directive name) never self-matches, and full-line versus trailing placement is
1801
- immaterial: resolution governs the referent, not the comment tier. Bare
1802
- `TODO`/`FIXME`/`HACK` markers are out of scope — trailing-comment scanning is a
1803
- separate ruling if the need attests.
1804
-
1805
- Placement: the marker is a comment directive on the governed comment surface, so
1806
- it is canon-kit's, not queue-kit's (which disclaims source-file conventions in
1807
- its Out of scope). The gate scans the pruned comment surface, dropping `templates/`
1808
- as placeholders-by-design like `check-spec-pointer`, and reads the queue through
1809
- `CANON_KIT_QUEUE_FILE` with no new knob — the live/done split is the shared
1810
- `queue_slugs` adapter (§lib/spec.sh), one queue walk reading a bare-slug
1811
- bullet outside the active and deferred sections as the queue's done shape. That
1812
- `task: <slug>` binding grammar — a `task:` key naming a slug that must resolve
1813
- to a live queue entry — is one grammar both liveness gates share:
1814
- `check-deprecation-task` is the twin, resolving the same binding on a
1815
- deprecation marker through the same adapter (§check-deprecation-task). Latent at landing: no such marker exists in
1816
- the tree yet — the gate ships before the first one, so a future `TODO(task:)`
1817
- cannot outlive its task silently. A queue-read failure is fail-closed (exit 2).
1818
- `precommit` tier. **Declared by `check-todo-task-liveness.gate`, dispatching to
1819
- the binary**, its `couples=` widened to `*.gate` and `*.rs` and its
1820
- `.workflow/*.txt` spelling corrected to `.workflow/*`, which is the tier the
1821
- corpus actually takes.
1822
-
1823
- ### check-deprecation-task
1824
-
1825
- Invariant: every deprecation marker on a governed source binds a `task: <slug>`
1826
- that resolves to a live queue task. The marker vocabulary is consumer config —
1827
- `CANON_KIT_DEPRECATION_MARKERS`, a roster of regexes (one per element) matched
1828
- against the governed comment surface. A language's marker spelling is never a
1829
- kit literal: the roster ships empty, so a repo that sets none is clean-skipped
1830
- (the `check-graph`/`graph-vocab` seam — the kit ships the resolution mechanism,
1831
- the consumer names its own `#[deprecated]`, `@deprecated`, or `@Deprecated`).
1832
- The scan itself stays consumer toolchain — a clippy/ESLint-class linter already
1833
- inventories deprecation markers; this gate adds the governance coupling no
1834
- linter ships: a deprecated surface that names no decommission task, or names a
1835
- done or absent one, has nothing tracking its removal.
1836
-
1837
- A marker line carrying no `task: <slug>` is **unbound**; a bound slug sitting in
1838
- `Done` is **stale** (the decommission finished, the marker did not); a bound
1839
- slug absent from the queue is **unresolved**. All three redden — each finding
1840
- names the file, the line, the matched marker, and the offending slug. The
1841
- binding grammar and the queue-resolution pass are `check-todo-task-liveness`'s:
1842
- the same `task: <slug>` key over the same `queue_slugs` adapter
1843
- (§check-todo-task-liveness, §lib/spec.sh), one grammar both liveness gates
1844
- share. The gate scans the pruned comment surface (templates dropped as
1845
- placeholders-by-design) and reads the queue through `CANON_KIT_QUEUE_FILE`, no
1846
- new knob beyond the roster. An unreadable queue or source is fail-closed
1847
- (exit 2); an empty roster is the clean skip, not an error.
1848
-
1849
- **Declared by `check-deprecation-task.gate`, dispatching to the binary**, with
1850
- the same widened `couples=` its twin carries. The roster is where this member
1851
- parts from its three siblings: it is a consumer array joined into one alternation
1852
- and **interpreted**, so the compiled form compiles it through the crate's POSIX
1853
- ERE matcher (gate-sdk/SPEC.md §The POSIX ERE matcher) and reports the offending
1854
- knob by name on a pattern the engine refuses. One shell defect went with the
1855
- port, found by widening the fixture pair rather than by review: the unbound
1856
- finding named the marker as `''`, because the record carried an empty slug field
1857
- *between* two populated ones and `IFS=$'\t' read` collapses a tab run. It was
1858
- repaired in the shell before the port, so the parity run proves the repaired
1859
- message on both substrates rather than freezing the defect into the compiled
1860
- form.
1861
-
1862
- This repo sets no roster, so the gate clean-skips here — the good/bad fixture
1863
- pair and `check-deprecation-task.test.sh` carry the resolved and reddened paths
1864
- under a fixture-local roster (the `check-manifest-count` config-path precedent).
1865
- The release-boundary disposition walk over the standing marker inventory
1866
- (decommission now, re-justify and carry the task forward, or un-deprecate) is
1867
- lifecycle-kit's `release-sweep` skill template, and the between-major backlog
1868
- trend over the same roster is drift-kit's `kpi-deprecated-surface` example
1869
- (lifecycle-kit SPEC §templates, drift-kit SPEC §Out of scope). `precommit` tier.
1870
-
1871
- ### check-tracking-claim
1872
-
1873
- Invariant: every **tracking claim** on a governed manifest surface agrees with
1874
- git. A tracking claim is a fixed-vocabulary predicate bound to the backticked
1875
- repo-relative path token it follows:
1876
-
1877
- | Predicate | Holds when |
1878
- | --- | --- |
1879
- | `is committed`, `is tracked` | the path has tracked members and no ignored ones |
1880
- | `is gitignored`, `is local-only` | the path has ignored members and no tracked ones |
1881
- | `is two-tier` | both classes are non-empty — the path holds tracked and ignored members |
1882
-
1883
- It exists because the defect class it catches — an always-loaded surface
1884
- asserting a directory is committed while part of it is gitignored — is invisible
1885
- to every other gate the kit ships: `check-md-refs` resolves paths,
1886
- `check-spec-pointer` resolves headings, and neither reads what the sentence
1887
- *claims* about the path. Resolution: a path naming a directory expands to its
1888
- members (`git ls-files` for the tracked side, `git check-ignore --no-index` on
1889
- the path for the ignored side); a path naming a file is its own single member.
1890
- The ignored side is read from the rules, not the working tree, so a gitignored
1891
- runtime path with no file in a fresh checkout still resolves — a presence read
1892
- (`ls-files --others --ignored`, which lists only files that exist) made the same
1893
- claim verify locally and red in CI. `--no-index` is load-bearing for the mixed
1894
- predicate: plain `check-ignore` refuses to report a directory that has a tracked
1895
- member as ignored, and a two-tier directory always has one. The mixed predicate
1896
- is what lets an honestly-mixed directory have a true sentence at all — without
1897
- it, the always-loaded tier could only be given a false one. Its rule-based proof
1898
- reaches only a directory the rules match whole (a `dir/` pattern) that also
1899
- carries a tracked member; a directory whose ignored members are matched by file
1900
- patterns, the directory itself matching no rule, has no rule-based two-tier proof
1901
- and stays a prose description (the `runtime-dir-two-tier-detector` debt).
1902
-
1903
- Reddens on a predicate whose verification fails, and — fail-closed — on a bound
1904
- path that exists in neither the index, the ignore rules, nor the working tree,
1905
- since an unresolvable path makes the claim unverifiable rather than true.
1906
-
1907
- Surface: the manifest set (`spec_manifest_files`, the same surface the
1908
- manifest-narration gate family reads). **No new knob**: the predicate vocabulary
1909
- is kit-owned generic English, and which surfaces are governed is a knob that
1910
- already exists. Fenced code blocks are skipped, matching `check-spec-pointer` —
1911
- a quoted example is not a claim — and a predicate inside an inline code span is
1912
- a meta-reference, not an assertion (`check-manifest-count`'s carve-out, same
1913
- reason), which is what lets this section name its own vocabulary.
1914
-
1915
- Calibration, stated as the gate's honest limit: **forward direction only, fixed
1916
- vocabulary only, adjacency only.** The gate fires on the listed predicates and
1917
- rules on nothing else; a claim phrased any other way ("the workflow directory
1918
- ships in the repo") is out of scope and stays a review concern — the same
1919
- forward-only bar `check-spec-pointer` holds, and for the same reason: widening to
1920
- "any sentence asserting tracking" needs a notion of assertion that cannot hold
1921
- the false-positive floor. **Adjacency is the binding**: only whitespace may sit
1922
- between the path's closing backtick and the predicate, so a clause in between
1923
- unbinds it (`` `core-files.list` `` *manifest exists in the worktree and* is
1924
- tracked is correctly not a claim). That is deliberate under-detection, and it is
1925
- what buys the false-positive floor: the fixture pair covers both directions.
1926
-
1927
- The gate landed green over this repo — two claims (`.tmp/` and `.metric/`, both
1928
- gitignored), each verified rule-based against the ignore rules; a third
1929
- directory, `.workflow/`, is described in prose citing gate-sdk/SPEC.md §The
1930
- workflow directory rather than as a bound claim, because its ignored members are
1931
- file-pattern-matched and the directory itself matches no rule, so no rule-based
1932
- two-tier proof exists for it (the `runtime-dir-two-tier-detector` debt). No
1933
- backfill. That is the expected shape: it is a regression gate for a defect that already shipped on the
1934
- always-loaded tier, not a discovery tool, and §When a gate earns its place in
1935
- gate-sdk/SPEC.md governs that class. No per-site valve is taken: a claim that
1936
- cannot be made true is a claim that must be reworded, and a valve would restore
1937
- exactly the unverified-prose state the gate exists to end. Tier `precommit`; the
1938
- `# graph:` manifest couples the manifest set and `.gitignore`.
1939
-
1940
- ### check-spec-fence-balance
1941
-
1942
- Invariant: every governed markdown file carries an even count of code-fence
1943
- delimiters (lines opening with ```` ``` ````). The fence-skipping parsers across
1944
- the kits — `check-spec-embedded-source`, `check-tag-lead-line`, the queue
1945
- scanners — all toggle a fence flag line by line; an odd count leaves the flag
1946
- stuck and the rest of the file is read *inside* a phantom fence, so every later
1947
- finding silently fails open. This gate turns that silent hole into a red. The
1948
- surface is the manifest set (`spec_manifest_files`) plus the configured queue
1949
- file (`CANON_KIT_QUEUE_FILE`) — two motivating parsers (`check-tag-lead-line`,
1950
- `check-queue-wrap`) scan the queue, which the manifest set excludes — with no
1951
- new knob. A grep error (not a no-match) is fail-closed (exit 2).
1952
-
1953
- ### check-md-refs
1954
-
1955
- Invariant: every internal markdown link in the governed doc set resolves. A
1956
- relative-path target (with the source file's directory as the base) must be a
1957
- tracked file, or a directory holding tracked files; a `#anchor` — alone
1958
- (same-file) or trailing a path — must match the GitHub heading slug of a
1959
- heading in the target file. External URLs (`scheme://`, `mailto:`) are out of
1960
- scope: the network is not a gate dependency. The doc set is the manifest set
1961
- (`CLAUDE.md` included; a vendored kit's own `README.md` only where
1962
- `CANON_KIT_SCAN_KIT_ROOTS` re-includes it) minus the `CANON_KIT_MDREF_EXCLUDE` globs
1963
- (default empty, for a consumer's generated docs); the scan runs over tracked
1964
- sources only, so an untracked local-only file (`BRIEF.local.md`) is a legitimate
1965
- link *source* that is never scanned and, being git-ignored-and-present, a
1966
- legitimate *target* that resolves without being tracked. A grep error is
1967
- fail-closed (exit 2). The link extractor is purely syntactic — it matches the
1968
- bracket-then-paren link shape (a `]` immediately followed by a parenthesized
1969
- target) without stripping code spans, so a literal markdown link written in
1970
- governed prose is scanned as a real link even inside inline backticks; to name
1971
- such a link in prose without tripping the gate, separate the `]` and the `(`
1972
- (a space, or a line break — the scan is per-line). The amendment `SPEC-*.md`
1973
- files escape only by lying outside the scanned doc set, not by any code-span
1974
- exemption. Links are this gate's charge; the sibling `check-docs-cmd` takes the
1975
- invoked commands and env knobs written inside fences and backticks, over the
1976
- same governed doc set (one shared set, no second knob).
1977
-
1978
- **The self-repo blob-link pass.** An absolute link is normally out of scope —
1979
- the network is not a gate dependency — with one exception: a link into this
1980
- same repository's GitHub tree, which resolves against the working tree exactly
1981
- as a relative link does. The repo identity is derived at gate runtime from
1982
- `git remote get-url origin` through the shared `gate_self_repo_prefix` adapter
1983
- (gate-sdk/SPEC.md §lib/gate.sh), so the resolver here and any reference-link
1984
- *producer* draw one identity; the `git@host:owner/repo` and
1985
- `https://host/owner/repo[.git]` remote forms normalize to one
1986
- `https://host/owner/repo` identity, so the kit ships no repo name (the
1987
- provenance seam holds) and CI's checkout and a local clone alike supply it. A
1988
- link whose prefix is `<identity>/blob/<CANON_KIT_DOCS_BLOB_REF>/` (the ref
1989
- default `master`) is a self-repo reference link: its `<path>` must be a
1990
- git-tracked file, and a trailing `#anchor` must slug — under the same GitHub
1991
- heading-slug rules the same-file anchors use — to a heading in that file. A
1992
- repo with no `origin` skips the pass: a self-repo link cannot be identified, so
1993
- it falls through to the external-URL skip. The ref is a knob rather than a
1994
- literal because it is a policy choice, not a derived fact — the site is living
1995
- documentation of the current tree, so a reference link pins to the default
1996
- branch (this repo's `master`), and a tag-pinned reference copy would buy
1997
- staleness, not stability.
1998
-
1999
- **Coverage the good/bad pair cannot hold**, and where it lives:
2000
- `gate-tests/check-md-refs.test.sh`. The harness resolves exactly one `good/` and
2001
- one `bad/` case dir per gate, and this gate's pair is spent on the core
2002
- link-resolution logic, so two behaviors ride a bespoke test instead. The
2003
- self-repo pass is the first: each case builds a throwaway repo with a controlled
2004
- `origin`, which a case dir run inside this repo cannot do. The kit-root prune on
2005
- the manifest set's README half is the second, and the two cases differ only in
2006
- `CANON_KIT_SCAN_KIT_ROOTS` over one tree — a shape the pair's
2007
- one-tree-per-verdict form cannot express even with a slot free. That second half
2008
- is the **only** executable oracle the prune has: this repo sets the knob, so its
2009
- battery is a no-op on it, and a consumer's knob is `0` either way, so no
2010
- consumer-smoke run distinguishes a knob-gated prune from an unconditional one.
2011
- The sibling `gate-tests/check-spec-dod-singleton.test.sh` carries the same
2012
- prune's canonical-spec half for the same reason.
2013
-
2014
- ### The reference-link grammar
2015
-
2016
- A docs-site page cites two kinds of in-repo target, and the grammar splits on
2017
- which. A *rendered-document* reference — a kit's `SPEC.md`, `README.md`, or
2018
- `DOCTRINE.md` — cites the on-site mirror of that document *relatively* when the
2019
- site publishes one: a generated, freshness-gated projection under `docs/<kit>/`
2020
- that keeps reference reading on the served site. The mirror preserves the
2021
- documents' cross-citation topology one-to-one, so the relative shape a page
2022
- uses is the same shape the source tree uses. A *source* reference — a script, a
2023
- gate body, config, a directory: files the site does not render — cites the tree
2024
- with an absolute GitHub blob link
2025
- `https://<host>/<owner>/<repo>/blob/<ref>/<path>[#anchor]`, anchored when it
2026
- names a section, because a relative link into the unrendered surrounding tree
2027
- would 404 on a site that serves `docs/` alone. **That prescription is held by
2028
- `check-docs-link-convention`'s off-root rule** (§check-docs-link-convention
2029
- below): a relative link whose target resolves outside the site root is a
2030
- violation, so the requirement above is enforced rather than merely stated.
2031
- Both are the downward-citation shape of the tiering topology, one on-site and
2032
- one off. Resolution of the blob form belongs to `check-md-refs`' self-repo pass
2033
- (identity derivation and the ref knob live there); `check-docs-link-convention`
2034
- owns the shape of the relative links that stay inside `docs/`. The mirror is
2035
- what a site opts into, not a precondition of the grammar: absent a published
2036
- mirror, rendered-document references fall back to the same off-site blob form
2037
- as source references.
2038
-
2039
- ### check-docs-link-convention
2040
-
2041
- `checks/check-docs-link-convention.gate` (`precommit`, binary-dispatched).
2042
- Invariant: every relative markdown link on a docs-site page obeys the
2043
- downward-citation *shape* — the resolution of those links is `check-md-refs`'
2044
- charge, and this gate owns shape alone. Absolute reference links (the off-site
2045
- blob grammar above) are out of this gate's scope entirely: their resolution is
2046
- `check-md-refs`' self-repo pass, and this gate turns only on the relative links
2047
- that stay inside the tree. Each rule is scoped to the docs tree
2048
- because the "kit page" it turns on (a `<root>/<kit>/index.md`) exists only
2049
- there:
2050
-
2051
- - **No directory-target link.** A relative link whose target names a directory
2052
- (a trailing `/`, or a path that resolves to a tracked directory) must instead
2053
- name the file — `kit/index.md`, never `kit/`. A bare directory link is
2054
- ambiguous about what the page is citing and defeats anchor-level citation.
2055
- - **Anchored kit back-links.** On a kit page (`<root>/<kit>/index.md`), a link
2056
- back to that same kit's own `README.md` or `SPEC.md` must carry a `#section`
2057
- anchor. A page cites downward into a *named* section, never at the whole spec —
2058
- the anti-restatement doctrine expressed as a link shape.
2059
- - **No off-root relative link.** A relative link whose target *resolves* to an
2060
- existing path outside `CANON_KIT_LINK_ROOT` must instead cite the absolute
2061
- self-repo blob form (§The reference-link grammar). The rule turns on the
2062
- resolved path, not the link text, so a `../`-prefixed link that resolves back
2063
- under the root is silent. Only resolving targets are classified — a relative
2064
- target that resolves to nothing is `check-md-refs`' finding alone, and this
2065
- rule does not double-report it; a directory target outside the root still
2066
- satisfies the first rule's predicate first and is reported there, once.
2067
- Anchors and absolute URLs never fire, by the gate's existing scope. Generated
2068
- mirror pages (`generated: true` front matter) are in scope, deliberately: their
2069
- off-root conformance is a property of the generator that emits them, which is a
2070
- thing that can regress, and exempting them would blind the corpus's larger half.
2071
- The existing `docs-link-exempt: <reason>` valve suppresses this rule as it does
2072
- the other two — no second valve.
2073
-
2074
- The scanned tree is `CANON_KIT_LINK_ROOT` (default `docs`; the fixture pair
2075
- overrides it with a positional arg pointing at a synthetic tree), walked for
2076
- every `*.md`. The link extractor is the same syntactic bracket-then-paren match
2077
- `check-md-refs` uses; `scheme://` and `mailto:` targets are out of scope, and a
2078
- pure `#anchor` (no path) satisfies neither rule. Per-site valve: a
2079
- `docs-link-exempt: <reason>` HTML comment on the link line or the one directly
2080
- above suppresses that one finding — for the rare legitimate directory link a
2081
- consumer's layout demands. A missing scan root is fail-closed (exit 2).
2082
-
2083
- **The walk is unpruned, deliberately, and the port carries that rather than the
2084
- kit's shared prune set** (gate-sdk/SPEC.md §The fourth budget batch): the shell
2085
- form reached for a bare `find` rather than `gate_find`, so a docs tree with a
2086
- directory named like a prune entry is still scanned whole. The compiled form
2087
- takes the prune-free traversal for the same reason, and orders its pages by
2088
- bytes where the shell's `| sort` ordered them by the invoking locale's
2089
- collation — a report-order narrowing, never a change to which pages are read.
2090
- Target resolution is likewise lexical where the shell called
2091
- `realpath -m --relative-to=.`: the two agree on a tree with no symlinked docs
2092
- directory, which every case compared at the port confirmed, including an
2093
- absolute scan root and a scan root of `.`. The bespoke
2094
- `gate-tests/check-docs-link-convention.test.sh` holds the off-root rule's edges
2095
- and dispatches through `gate_run`.
2096
-
2097
- ### check-docs-cmd
2098
-
2099
- Invariant: every invoked repo-relative `.sh` path and every kit-prefixed env
2100
- knob written inside a fence or inline backticks in the governed doc set resolves
2101
- against the tree — the command/knob analog of `check-md-refs`, since a broken
2102
- `bash <path>` line or a retired knob name drifts silently where a broken link
2103
- would be caught. Two assertions:
2104
-
2105
- - **(A) invoked command paths.** Inside a fenced block, a `.sh` path in
2106
- *invocation* position — the first word of a `;`/`|`/`&&`-separated segment, or
2107
- the first non-flag argument when that word is `bash`/`sh`/`source`/`.` — must
2108
- resolve to a tracked file, tried doc-directory-relative first (a kit SPEC's
2109
- own `bin/x.sh`) then repo-root-relative (a cross-kit `gate-sdk/bin/x.sh`).
2110
- Only invocations are checked, so a path in argument position — a `cp
2111
- templates/x.sh scripts/x.sh` install *destination*, which the consumer
2112
- creates and this repo need not track — is never a finding. That is the
2113
- deliberate calibration: the invariant's failure mode is a broken invocation,
2114
- and scoping to the two named forms (a bare `<dir>/…/<name>.sh` and the
2115
- `bash <path>` form) drops the hypothetical-install-target class by
2116
- construction, with no whole-file exemption.
2117
- - **(B) env knobs.** Any backticked or fenced ALL-CAPS name carrying a kit
2118
- prefix (the roster is each `gate_kit_roots` member's basename uppercased,
2119
- hyphens to underscores, trailing `_`: `gate-sdk` → `GATE_SDK_`) must occur in
2120
- the kits' tracked *code* — their shell sources and config templates, never
2121
- their own prose, so a knob name-dropped only in markdown cannot self-satisfy.
2122
- The corpus is the union across all kits, not the prefix owner alone: a
2123
- namespaced knob may be read by a dependent kit (`GATE_SDK_LIB` is gate-sdk's,
2124
- resolved in delegation-kit and evidence-kit), and the prefix marks scope, not
2125
- location. A family stem — a caps run ending `_` because a placeholder or glob
2126
- follows it (`EVIDENCE_KIT_RUN_<suite>`, `CANON_KIT_COMMENT_*`) — resolves when
2127
- any code name extends it. Names with no kit prefix are out of scope, so
2128
- generic shell vars never false-positive.
2129
-
2130
- The governed doc set is exactly `check-md-refs`' — the manifest set minus
2131
- `CANON_KIT_MDREF_EXCLUDE` — shared, with no gate-specific knob. Prose outside
2132
- fences and backticks is never scanned; a hypothetical example path is written
2133
- unfenced, or its whole doc joins the per-file `CANON_KIT_MDREF_EXCLUDE` valve.
2134
- The knob set is built by a repo-root-anchored `git grep`, so it holds when the
2135
- fixture runner invokes from a case directory. Not a git repository, or a
2136
- `git grep` that errors, is fail-closed (exit 2). The `# graph:` manifest couples
2137
- the doc set to `scripts/*.sh` and every kit's shell sources (`kit:*.sh`), so a
2138
- script rename or a knob retirement re-fires the gate over the docs.
2139
-
2140
- ### check-install-claim
2141
-
2142
- Invariant: exactly one governed doc declares which install transport is primary,
2143
- and no scanned install section leads with a different one. This is the star
2144
- topology's first *user-facing* application — the same one-owner-per-fact rule the
2145
- kit applies to internal facts, aimed at a claim a first-time reader acts on.
2146
-
2147
- **What it does not attempt.** Whether a documented install command resolves
2148
- against a live registry needs network egress at gate time and is out of a
2149
- hermetic battery's reach. It is not built, and this paragraph says so rather than
2150
- leaving a reader to over-read a green run: the command that drove this gate's
2151
- filing was syntactically fine, and only a registry could have contradicted it.
2152
- What is decidable from the tree alone is the consistency half — two surfaces
2153
- cannot name different primary transports — and that is the whole of what runs.
2154
-
2155
- The claim's machine-readable owner is a full-line
2156
- `<!-- install-primary: <transport-id> -->` HTML comment. A marker rather than a
2157
- visible sentence, because the reader-facing form of this claim already exists as
2158
- prose and must stay prose; the marker is the tier beside it, not a replacement.
2159
- The transport vocabulary is consumer config — one `<transport-id>`⇥`<ERE>` line
2160
- per transport through `CANON_KIT_INSTALL_TRANSPORTS_CMD`, loaded by
2161
- `spec_install_transports` (§lib/spec.sh) — because a kit literal spelling a
2162
- transport publishes one project's distribution model as a kit fact.
2163
-
2164
- **Where this gate ends and §check-payload-claim begins.** The two answer
2165
- different questions and share only the vocabulary loader. This one is
2166
- **positional and install-section-scoped**: naming a secondary transport is
2167
- correct prose, so what it judges is which transport a selected section *leads*
2168
- with. Its sibling is **membership over the whole governed document**, because a
2169
- disclosure class other than the declared one has no correct-but-secondary form —
2170
- it is wrong wherever it appears. The scopes do not coincide either, so neither
2171
- gate is the other's second assertion pair: an install section under this repo's
2172
- section regex is not where the disclosure claim is ruled, and folding a
2173
- whole-document membership rule into a section-scoped positional gate would make
2174
- this gate's name false and give one gate two unrelated calibrations to reason
2175
- about on a red.
2176
-
2177
- The scanned set is `check-md-refs`' governed doc set (the manifest set minus
2178
- `CANON_KIT_MDREF_EXCLUDE`) minus `CANON_KIT_INSTALL_CLAIM_EXCLUDE`. Two
2179
- assertions:
2180
-
2181
- - **(A) Singleton owner.** Exactly one declaration exists across the scanned set.
2182
- Zero is the defect the gate was built for — nothing owns the claim, so two
2183
- pages can drift apart with nothing watching — and two owners is that same
2184
- defect wearing a different shape. An id outside the configured vocabulary is
2185
- fail-closed (exit 2) rather than a violation: the gate then holds no primary to
2186
- compare a section against, so it must not run rather than pass.
2187
- - **(B) Leading transport.** Within each scanned document, for every
2188
- `##`-or-deeper section whose heading text matches
2189
- `CANON_KIT_INSTALL_SECTION_RE`, the **earliest** line matching any transport
2190
- pattern must match the declared primary. Later matches are never flagged, and a
2191
- section matching no transport pattern is silent. One line matching two patterns
2192
- passes when either id is the primary — a sentence naming both transports is not
2193
- leading with the secondary one. Fenced content is scanned, because a recipe is
2194
- exactly where a transport shows, but a fenced line is never read as a heading;
2195
- the declaration line is skipped, since a claim is not evidence for itself.
2196
-
2197
- **The rule is a compiled subcommand, and one piece of it is load-bearing beyond
2198
- this gate.** The section regex and every transport pattern are consumer EREs
2199
- compiled through the crate's matcher (gate-sdk/SPEC.md §The POSIX ERE matcher);
2200
- the `install-primary:` declaration grammar and the `^#{2,6}[[:space:]]+` heading
2201
- grammar are kit literals. The heading one goes through the matcher anyway, and
2202
- deliberately: taking a heading's text is a **span** read, so routing it through
2203
- `find` gives the matcher's leftmost-longest span API a production reader on every
2204
- invocation of a precommit-tier gate, rather than one alive only in unit tests.
2205
-
2206
- **One declaration grammar, where two spellings once disagreed.** The declaration
2207
- is detected and its id extracted by the same grammar, so the terminator is part
2208
- of it: an id run and the `-->` that closes the comment share the hyphen, and the
2209
- run gives hyphens back until the terminator matches. A space-less
2210
- `<!--install-primary:tarball-->` therefore declares `tarball`, and the rule runs.
2211
- The compiled form is the single spelling; a detecting pattern that required the
2212
- terminator beside an extracting one that did not made that same line read as a
2213
- declaration of `tarball--` and fail-closed on a vocabulary it was never checked
2214
- against.
2215
-
2216
- Assertion B is the answer to the leading-versus-mentioning question: naming a
2217
- secondary transport is correct prose and must stay green, so the rule is
2218
- positional. **The scope in which "leading" is well-defined is the install
2219
- section, not the file**, and that calibration was verified rather than assumed —
2220
- this repo's own install page names its npm path in the H1 preamble about 120
2221
- lines above the tarball recipe, so a whole-file first-match rule would red the
2222
- owner page on correct prose.
2223
-
2224
- Three honest limits, each stated because a reader would otherwise over-trust a
2225
- green run. Registry reachability is the first, above. **Pattern quality is the
2226
- second, and it is the consumer's own drift to own:** the gate is only as sharp as
2227
- the emitted EREs, and a loosely-written pattern wins matches by accident — the
2228
- kit contract asks for the emit grammar, exactly as `check-prose-enum` says of a
2229
- hand-listed set. **The third is bought by the section scope:** the prose tier of
2230
- the declared claim may itself sit outside any scanned section, as this repo's
2231
- does, in which case rewriting that prose to name a different transport while
2232
- leaving the declaration alone stays green. That binding is documentary — held by
2233
- this section and by a reader, not by the gate. It is the price of the scoping
2234
- rather than an argument against it, since the alternative whole-file rule reds
2235
- the owner page today, and the recurrence path that actually fired is unaffected:
2236
- the drift was a `## Quick start` section leading with the wrong transport, which
2237
- is in scope.
2238
-
2239
- Producer: the maintainer editing the section that owns the claim, plus the
2240
- consumer's transport command; both are live tracked configuration in this repo,
2241
- not fixture-only. Consumer: the committing operator via the output contract —
2242
- assertion B's report names the section, the offending line, and *which* transport
2243
- it led with, because "wrong transport" alone would leave the reader grepping. The
2244
- declaration carries exactly one field and both assertions read it; each emitted
2245
- line's id is read at the membership check and in the report, its ERE at the
2246
- per-line match.
2247
-
2248
- The gate lands greenfield: the drift that filed it was fixed inline at the close
2249
- that filed it, so this pins a currently-consistent claim and its value is
2250
- recurrence. That claim drifted at two consecutive releases with nothing watching
2251
- it, on the surface a first-time reader runs first. The good/bad pair covers the
2252
- recurrence path itself — a quick-start section leading with the secondary
2253
- transport — beside a silent no-transport section, a heading the regex does not
2254
- select, and a published note the path valve keeps out of the scanned set. The
2255
- `# graph:` manifest couples the gate to the doc set and `scripts/*.sh`, so a
2256
- transport rename re-fires it over the docs. `precommit` tier.
2257
-
2258
- ### check-payload-claim
2259
-
2260
- Invariant: exactly one governed doc declares what a gate on the vendored payload
2261
- discloses, and no scanned governed doc asserts a different disclosure class. Two
2262
- assertions: (A) **singleton owner** — exactly one declaration exists across the
2263
- scanned set; (B) **no contradicting assertion** — no scanned line matches the
2264
- pattern of a class other than the declared one.
2265
-
2266
- The claim's machine-readable owner is a full-line
2267
- `<!-- payload-discloses: <claim-id> -->` HTML comment, the same
2268
- tier-beside-the-prose shape §check-install-claim uses and for the same reason:
2269
- the reader-facing form of this claim already exists as prose and must stay prose.
2270
- It belongs in the section that rules the fact, which in this repo is
2271
- gate-sdk/SPEC.md §Consumer payload. The disclosure vocabulary is consumer config
2272
- — one `<claim-id>`⇥`<ERE>` line per class through
2273
- `CANON_KIT_PAYLOAD_CLAIMS_CMD`, loaded by `spec_claim_vocabulary` (§lib/spec.sh)
2274
- — because a spelling of what a payload discloses is one project's distribution
2275
- model, and a kit literal carrying one would publish it. The scanned set is
2276
- `check-md-refs`' governed doc set (the manifest set minus
2277
- `CANON_KIT_MDREF_EXCLUDE`) minus `CANON_KIT_PAYLOAD_CLAIM_EXCLUDE` — the same
2278
- composition its sibling uses, so a consumer configures one scanned-set idiom
2279
- rather than two.
2280
-
2281
- **Assertion A.** Zero declarations is the defect the gate exists for: nothing
2282
- owns the claim, so an unbounded number of surfaces drift with nothing watching,
2283
- and no reader can tell which surface is the one to believe. Two owners is that
2284
- same defect wearing a different shape. A `<claim-id>` outside the configured
2285
- vocabulary is **fail-closed (exit 2)** rather than a violation — with no
2286
- resolvable declared class the gate holds nothing to compare a line against, so
2287
- it must not run rather than pass.
2288
-
2289
- **Assertion B.** Across each scanned document, any line matching the pattern of a
2290
- class other than the declared one is a violation, wherever in the document it
2291
- sits. Membership rather than position, because a non-declared disclosure class
2292
- has no correct secondary form. The declaration line itself is skipped, since a
2293
- claim is not evidence for itself. Fenced content is scanned, because a quoted
2294
- recipe is exactly where a disclosure claim shows up in passing. The report names
2295
- the offending class, because "wrong disclosure class" alone would leave the
2296
- reader grepping.
2297
-
2298
- The rule is a **compiled subcommand** — structurally the simplest consumer of the
2299
- crate's matcher, membership over the whole document rather than position inside a
2300
- section, so the engine and the vocabulary bridge were both proved by its two
2301
- cohort siblings before it landed. It shares the declaration grammar
2302
- §check-install-claim states, including that section's single-spelling rule.
2303
-
2304
- **The declared class's own pattern is latent rather than unread.** Assertion B
2305
- matches only the classes that are *not* declared, so the declared one's pattern
2306
- does no work while it holds the declaration — and starts doing it the moment the
2307
- declaration moves to another class. The vocabulary is a set of classes, not a set
2308
- of live matchers, so a class is emitted with its pattern whether or not it is
2309
- currently the declared one.
2310
-
2311
- **One claim axis rather than a claim registry.** The shape behind this gate and
2312
- its sibling — a declared owner, an id vocabulary, a scanned corpus — invites a
2313
- registry keyed by claim name. Refused for now, with the reason recorded so it is
2314
- not re-derived: one axis exists, this gate and its sibling already share the only
2315
- piece worth sharing (the vocabulary loader), and a registry would mint an
2316
- axis-name knob and an indirection to hold a single member. The refusal is cheap to reverse — a
2317
- second axis is the trigger, and both gates would collapse into the registry with
2318
- their vocabularies unchanged.
2319
-
2320
- **Honest limits.** The gate is only as sharp as the emitted patterns, and a
2321
- loosely-written one wins matches by accident — the same consumer-owned drift
2322
- §check-install-claim states, since the kit contract asks for the emit grammar and
2323
- never for the patterns. A claim phrased in a shape no emitted pattern recognizes
2324
- is out of reach; what the gate converts is an unbounded prose corpus into a
2325
- checkable one, not an English-language reader. And the scanned set is the
2326
- manifest set, so a claim made on a surface the consumer has not brought into that
2327
- set stays unheld.
2328
-
2329
- Producer: the maintainer editing the section that rules the fact, plus the
2330
- consumer's disclosure command; both are live tracked configuration in this repo,
2331
- not fixture-only. Consumer: the committing operator via the output contract, and
2332
- both assertions read the declaration's one field — at the membership check, at
2333
- the declared-versus-other comparison, and in the violation report.
2334
-
2335
- The good/bad pair covers the reintroduction path itself — one corrected sentence
2336
- restored verbatim to its original overclaiming form — beside the near-miss
2337
- sentences the pattern boundary must stay silent on and a published dated note the
2338
- path valve keeps out of the scanned set. The `# graph:` manifest couples the gate
2339
- to the governed doc set and `scripts/*.sh`, so an edit to a claim surface or to
2340
- the vocabulary re-fires it. `precommit` tier.
2341
-
2342
- ### check-prose-tells
2343
-
2344
- The mechanical subset of the AI-prose tells — the machine-detectable patterns
2345
- that mark agent-authored reader-facing prose — over the consumer-configured
2346
- markdown surfaces (`CANON_KIT_PROSE_TELL_GLOBS`; empty ⇒ nothing scanned, the
2347
- correct unconfigured-consumer no-op). Judgment-dependent tells (voice, argument
2348
- shape, hedging) are out of scope permanently: the gate never grows heuristics
2349
- that would make it probabilistic; that read stays human.
2350
-
2351
- It runs six mechanical assertions over each surface, every one threshold-gated:
2352
- em-dash density (A), throat-clearing phrases (B), contrast cadence (C),
2353
- undefined abbreviations (D), sentence-rhythm variance (E), and tricolon density
2354
- (F). A paragraph is a blank-line-delimited block and a section is a `##`-headed
2355
- span, except that each markdown list item (`-`/`*`/`+`/`N.`) is its own unit for
2356
- every paragraph and section assertion — a definition list carrying one em-dash
2357
- per item is well-formed markdown, not flowing prose, so its items are never
2358
- lumped into one block (the same structural holdout the non-prose surfaces below
2359
- earn). Because the tells measure authored prose, three non-prose surfaces are
2360
- held out before any assertion runs: inline `` `code` `` spans, markdown table
2361
- rows, and generated `<!-- name:begin -->`…`<!-- name:end -->` regions (each
2362
- byte-gated elsewhere — a prose gate that forced edits to generated content
2363
- would contradict its generation, the same reasoning that keeps `docs/posts/`
2364
- out of the opt-in). Fenced code the shared walk driver already drops.
2365
-
2366
- - **A. Em-dash density** — a paragraph carrying more than
2367
- `CANON_KIT_PROSE_TELL_EMDASH_MAX` em-dashes.
2368
- - **B. Throat-clearing phrases** — a case-insensitive match of any
2369
- `CANON_KIT_PROSE_TELL_PHRASES` member, the base array merged with
2370
- `CANON_KIT_PROSE_TELL_PHRASES_EXTRA` (§Layout and configuration).
2371
- - **C. Contrast cadence** — the "not X — it's Y" shape (a `not …` clause
2372
- resolved across an em-dash or `, but` into `it's`/`it is`) more than
2373
- `CANON_KIT_PROSE_TELL_CONTRAST_MAX` times in a section.
2374
- - **D. Undefined abbreviations** — an all-caps token of length ≥ 3 the file
2375
- never expands (no parenthesized expansion at any occurrence) and absent from
2376
- `CANON_KIT_PROSE_TELL_ABBR_ALLOW` merged with
2377
- `CANON_KIT_PROSE_TELL_ABBR_ALLOW_EXTRA` (§Layout and configuration).
2378
- - **E. Sentence-rhythm variance** — a paragraph of at least
2379
- `CANON_KIT_PROSE_TELL_RHYTHM_MIN_SENTENCES` sentences whose sentence
2380
- word-count coefficient of variation falls below
2381
- `CANON_KIT_PROSE_TELL_RHYTHM_CV_MIN` (metronomic cadence).
2382
- - **F. Tricolon density** — more than `CANON_KIT_PROSE_TELL_TRICOLON_MAX`
2383
- `A, B, and C` constructions in a section.
2384
-
2385
- Exact detection regexes are implementation, owned by the gate source; the
2386
- `good/`+`bad/` fixture pair is the executable statement of each boundary
2387
- (`bad/` trips every assertion, `good/` passes all and demonstrates the valve).
2388
- Thresholds are the `CANON_KIT_PROSE_TELL_*` knobs (§Layout and configuration).
2389
-
2390
- **Ported to the binary substrate at §The sixth budget batch** (gate-sdk/SPEC.md).
2391
- Two properties of the port are stated here because neither is visible from the
2392
- assertion list. The corpus is walked **once per file**, not once per surface set:
2393
- assertion D is an in-file assertion, so a shared walk would pool every surface's
2394
- tokens into one buffer and an abbreviation expanded in any file would clear it in
2395
- all of them. And the thresholds are **coerced, not validated** — the port
2396
- reproduces that rather than hardening it, because a refusal the shell form never
2397
- made is a verdict change across the seam. A malformed threshold therefore reads
2398
- as zero on both substrates, which makes the gate fire on everything or never; the
2399
- repair belongs in the library, where one computation would serve both, and is
2400
- filed as its own unit rather than taken here.
2401
-
2402
- Criterion 4 **clears** on this member and the verdict is a property of a
2403
- consumer's config rather than of the gate: its corpus is a pure glob expansion of
2404
- the configured prose-surface set, which reaches no gate declaration path in this
2405
- tree. A consumer whose prose globs named descriptors would flip it.
2406
-
2407
- **Valve** — an HTML comment `<!-- prose-tell-exempt: <reason> -->` on the
2408
- flagged line or directly above it suppresses the tell at that site; it rides the
2409
- shared exempt-window (§lib/spec.sh — the line or the one above), and the reason
2410
- is mandatory (the `comment-tier-exempt:` convention — a deliberate stylistic
2411
- keep carries its cause in-line, a reasonless valve is red). The gate is a
2412
- producer of nothing but a verdict: the committing session reads the red and
2413
- either fixes the prose or lands a reasoned valve (oracle-first), the fixture
2414
- pair feeds `run-gate-tests.sh`, and every `CANON_KIT_PROSE_TELL_*` field is read
2415
- by `check-prose-tells` at scan time and no other component.
2416
-
2417
- ### templates/
2418
-
2419
- `canon-config.sh` — the consumer config template: a two-line `# spec:` pointer
2420
- to the §Layout and configuration knob table, so the table stays the one owner
2421
- of the knob roster rather than a parallel copy in the template drifting
2422
- against it.
2423
- `SPEC-amendment.md` — the amendment skeleton: delta sections plus the
2424
- Definition-of-Done checklist (causal completeness, no information lost on
2425
- merge, amendment deleted, none remaining, gaps filed as debt).
2426
-
2427
- ## Out of scope
2428
-
2429
- A consumer's tier contract — which surfaces exist and what each owns — is its
2430
- own instance; canon-kit ships the topology rules, not the table. Glossary and
2431
- vision structural gates (`check-glossary-tiering`,
2432
- `check-glossary-entry-types`, `check-vision-tiering`,
2433
- `check-retired-term-coupling`) encode one instance's surface roles, entry
2434
- taxonomy, and ubiquitous-language couplings — rule content; their generic
2435
- cross-surface axis ships here as `check-surface-duplication`.
2436
- `check-comment-tier` splits: a consumer's *product* directive vocabulary
2437
- (`glossary:`, `diagram:`, `domain-enum`, …) is rule content, supplied as
2438
- `CANON_KIT_COMMENT_*` config, while the classifier, the kit-mechanism directive
2439
- roster, and the surface/positional parsing machinery ship here — the comment
2440
- surface is one of the enforced tiering surfaces. A `check-root-tiering` is a
2441
- pure consumer-filename allowlist with no mechanism residue. Global-constant
2442
- literal gates (the pagination-literal pattern) are per-constant rule content.
2443
- Diagram/spec annotation couplings are unclaimed, a later kit's scope.