checkwright 0.0.1 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (874) hide show
  1. package/README.md +260 -4
  2. package/bin/checkwright.sh +53 -0
  3. package/lib/common/lock.sh +28 -0
  4. package/lib/common/profile.sh +58 -0
  5. package/lib/common/recipe.sh +93 -0
  6. package/lib/doctor.sh +90 -0
  7. package/lib/init.sh +289 -0
  8. package/package.json +15 -3
  9. package/payload/canon-kit/README.md +79 -0
  10. package/payload/canon-kit/SPEC.md +1410 -0
  11. package/payload/canon-kit/checks/check-amendment-queue.sh +116 -0
  12. package/payload/canon-kit/checks/check-comment-tier.sh +211 -0
  13. package/payload/canon-kit/checks/check-deprecation-task.sh +90 -0
  14. package/payload/canon-kit/checks/check-docs-cmd.sh +153 -0
  15. package/payload/canon-kit/checks/check-docs-link-convention.sh +71 -0
  16. package/payload/canon-kit/checks/check-install-claim.sh +146 -0
  17. package/payload/canon-kit/checks/check-knob-citation.sh +117 -0
  18. package/payload/canon-kit/checks/check-knob-default-coupling.sh +239 -0
  19. package/payload/canon-kit/checks/check-manifest-count.sh +46 -0
  20. package/payload/canon-kit/checks/check-manifest-temporal.sh +83 -0
  21. package/payload/canon-kit/checks/check-md-refs.sh +115 -0
  22. package/payload/canon-kit/checks/check-prose-enum.sh +115 -0
  23. package/payload/canon-kit/checks/check-prose-tells.sh +207 -0
  24. package/payload/canon-kit/checks/check-spec-derivable-section.sh +69 -0
  25. package/payload/canon-kit/checks/check-spec-dod-singleton.sh +45 -0
  26. package/payload/canon-kit/checks/check-spec-embedded-source.sh +133 -0
  27. package/payload/canon-kit/checks/check-spec-fence-balance.sh +42 -0
  28. package/payload/canon-kit/checks/check-spec-pointer.sh +176 -0
  29. package/payload/canon-kit/checks/check-surface-duplication.sh +105 -0
  30. package/payload/canon-kit/checks/check-todo-task-liveness.sh +80 -0
  31. package/payload/canon-kit/checks/check-tracking-claim.sh +136 -0
  32. package/payload/canon-kit/gate-tests/check-amendment-queue/bad/SPEC-tidy.md +5 -0
  33. package/payload/canon-kit/gate-tests/check-amendment-queue/bad/TASK-QUEUE.md +15 -0
  34. package/payload/canon-kit/gate-tests/check-amendment-queue/bad/expect.txt +1 -0
  35. package/payload/canon-kit/gate-tests/check-amendment-queue/good/SPEC-widget.md +6 -0
  36. package/payload/canon-kit/gate-tests/check-amendment-queue/good/TASK-QUEUE.md +15 -0
  37. package/payload/canon-kit/gate-tests/check-amendment-queue/good/expect.txt +1 -0
  38. package/payload/canon-kit/gate-tests/check-comment-tier/bad/bad.sh +25 -0
  39. package/payload/canon-kit/gate-tests/check-comment-tier/bad/expect.txt +1 -0
  40. package/payload/canon-kit/gate-tests/check-comment-tier/good/expect.txt +1 -0
  41. package/payload/canon-kit/gate-tests/check-comment-tier/good/good.sh +32 -0
  42. package/payload/canon-kit/gate-tests/check-comment-tier.test.sh +146 -0
  43. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/TASK-QUEUE.md +19 -0
  44. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/bad.sh +6 -0
  45. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/expect.txt +1 -0
  46. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/scripts/canon-config.sh +5 -0
  47. package/payload/canon-kit/gate-tests/check-deprecation-task/good/TASK-QUEUE.md +21 -0
  48. package/payload/canon-kit/gate-tests/check-deprecation-task/good/expect.txt +1 -0
  49. package/payload/canon-kit/gate-tests/check-deprecation-task/good/good.sh +5 -0
  50. package/payload/canon-kit/gate-tests/check-deprecation-task/good/scripts/canon-config.sh +5 -0
  51. package/payload/canon-kit/gate-tests/check-deprecation-task.test.sh +98 -0
  52. package/payload/canon-kit/gate-tests/check-docs-cmd/bad/args +1 -0
  53. package/payload/canon-kit/gate-tests/check-docs-cmd/bad/doc.md +9 -0
  54. package/payload/canon-kit/gate-tests/check-docs-cmd/bad/expect.txt +1 -0
  55. package/payload/canon-kit/gate-tests/check-docs-cmd/good/args +1 -0
  56. package/payload/canon-kit/gate-tests/check-docs-cmd/good/bin/tool.sh +3 -0
  57. package/payload/canon-kit/gate-tests/check-docs-cmd/good/doc.md +18 -0
  58. package/payload/canon-kit/gate-tests/check-docs-cmd/good/expect.txt +1 -0
  59. package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/args +4 -0
  60. package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/docs/demokit/index.md +5 -0
  61. package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/docs/index.md +3 -0
  62. package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/expect.txt +1 -0
  63. package/payload/canon-kit/gate-tests/check-docs-link-convention/good/args +4 -0
  64. package/payload/canon-kit/gate-tests/check-docs-link-convention/good/docs/demokit/index.md +6 -0
  65. package/payload/canon-kit/gate-tests/check-docs-link-convention/good/docs/index.md +3 -0
  66. package/payload/canon-kit/gate-tests/check-docs-link-convention/good/docs/methodology.md +3 -0
  67. package/payload/canon-kit/gate-tests/check-docs-link-convention/good/expect.txt +1 -0
  68. package/payload/canon-kit/gate-tests/check-install-claim/bad/README.md +12 -0
  69. package/payload/canon-kit/gate-tests/check-install-claim/bad/expect.txt +1 -0
  70. package/payload/canon-kit/gate-tests/check-install-claim/bad/install.md +24 -0
  71. package/payload/canon-kit/gate-tests/check-install-claim/bad/posts/note.md +7 -0
  72. package/payload/canon-kit/gate-tests/check-install-claim/bad/scripts/canon-config.sh +10 -0
  73. package/payload/canon-kit/gate-tests/check-install-claim/bad/scripts/install-transports.sh +7 -0
  74. package/payload/canon-kit/gate-tests/check-install-claim/good/README.md +12 -0
  75. package/payload/canon-kit/gate-tests/check-install-claim/good/expect.txt +1 -0
  76. package/payload/canon-kit/gate-tests/check-install-claim/good/install.md +24 -0
  77. package/payload/canon-kit/gate-tests/check-install-claim/good/posts/note.md +7 -0
  78. package/payload/canon-kit/gate-tests/check-install-claim/good/scripts/canon-config.sh +10 -0
  79. package/payload/canon-kit/gate-tests/check-install-claim/good/scripts/install-transports.sh +7 -0
  80. package/payload/canon-kit/gate-tests/check-knob-citation/bad/SPEC.md +10 -0
  81. package/payload/canon-kit/gate-tests/check-knob-citation/bad/expect.txt +1 -0
  82. package/payload/canon-kit/gate-tests/check-knob-citation/good/SPEC.md +19 -0
  83. package/payload/canon-kit/gate-tests/check-knob-citation/good/expect.txt +1 -0
  84. package/payload/canon-kit/gate-tests/check-knob-citation.test.sh +71 -0
  85. package/payload/canon-kit/gate-tests/check-knob-default-coupling/bad/expect.txt +1 -0
  86. package/payload/canon-kit/gate-tests/check-knob-default-coupling/bad/scripts/gate-sdk-config.sh +4 -0
  87. package/payload/canon-kit/gate-tests/check-knob-default-coupling/bad/widget-kit/SPEC.md +4 -0
  88. package/payload/canon-kit/gate-tests/check-knob-default-coupling/bad/widget-kit/lib/widget-cli.sh +3 -0
  89. package/payload/canon-kit/gate-tests/check-knob-default-coupling/bad/widget-kit/lib/widget.sh +5 -0
  90. package/payload/canon-kit/gate-tests/check-knob-default-coupling/good/expect.txt +1 -0
  91. package/payload/canon-kit/gate-tests/check-knob-default-coupling/good/scripts/gate-sdk-config.sh +5 -0
  92. package/payload/canon-kit/gate-tests/check-knob-default-coupling/good/widget-kit/SPEC.md +7 -0
  93. package/payload/canon-kit/gate-tests/check-knob-default-coupling/good/widget-kit/lib/widget-cli.sh +3 -0
  94. package/payload/canon-kit/gate-tests/check-knob-default-coupling/good/widget-kit/lib/widget.sh +5 -0
  95. package/payload/canon-kit/gate-tests/check-knob-default-coupling.test.sh +73 -0
  96. package/payload/canon-kit/gate-tests/check-manifest-count/bad/SPEC.md +15 -0
  97. package/payload/canon-kit/gate-tests/check-manifest-count/bad/expect.txt +1 -0
  98. package/payload/canon-kit/gate-tests/check-manifest-count/good/SPEC.md +37 -0
  99. package/payload/canon-kit/gate-tests/check-manifest-count/good/expect.txt +1 -0
  100. package/payload/canon-kit/gate-tests/check-manifest-count.test.sh +104 -0
  101. package/payload/canon-kit/gate-tests/check-manifest-temporal/bad/SPEC.md +6 -0
  102. package/payload/canon-kit/gate-tests/check-manifest-temporal/bad/expect.txt +1 -0
  103. package/payload/canon-kit/gate-tests/check-manifest-temporal/good/SPEC.md +17 -0
  104. package/payload/canon-kit/gate-tests/check-manifest-temporal/good/expect.txt +1 -0
  105. package/payload/canon-kit/gate-tests/check-md-refs/bad/args +1 -0
  106. package/payload/canon-kit/gate-tests/check-md-refs/bad/doc.md +3 -0
  107. package/payload/canon-kit/gate-tests/check-md-refs/bad/expect.txt +1 -0
  108. package/payload/canon-kit/gate-tests/check-md-refs/good/args +1 -0
  109. package/payload/canon-kit/gate-tests/check-md-refs/good/doc.md +3 -0
  110. package/payload/canon-kit/gate-tests/check-md-refs/good/expect.txt +1 -0
  111. package/payload/canon-kit/gate-tests/check-md-refs/good/target.md +1 -0
  112. package/payload/canon-kit/gate-tests/check-md-refs.test.sh +82 -0
  113. package/payload/canon-kit/gate-tests/check-prose-enum/bad/SPEC.md +4 -0
  114. package/payload/canon-kit/gate-tests/check-prose-enum/bad/expect.txt +1 -0
  115. package/payload/canon-kit/gate-tests/check-prose-enum/bad/scripts/canon-config.sh +4 -0
  116. package/payload/canon-kit/gate-tests/check-prose-enum/good/SPEC.md +16 -0
  117. package/payload/canon-kit/gate-tests/check-prose-enum/good/expect.txt +1 -0
  118. package/payload/canon-kit/gate-tests/check-prose-enum/good/scripts/canon-config.sh +4 -0
  119. package/payload/canon-kit/gate-tests/check-prose-enum.test.sh +127 -0
  120. package/payload/canon-kit/gate-tests/check-prose-tells/bad/expect.txt +1 -0
  121. package/payload/canon-kit/gate-tests/check-prose-tells/bad/prose.md +15 -0
  122. package/payload/canon-kit/gate-tests/check-prose-tells/bad/scripts/canon-config.sh +8 -0
  123. package/payload/canon-kit/gate-tests/check-prose-tells/good/expect.txt +1 -0
  124. package/payload/canon-kit/gate-tests/check-prose-tells/good/prose.md +21 -0
  125. package/payload/canon-kit/gate-tests/check-prose-tells/good/scripts/canon-config.sh +8 -0
  126. package/payload/canon-kit/gate-tests/check-spec-derivable-section/bad/SPEC.md +20 -0
  127. package/payload/canon-kit/gate-tests/check-spec-derivable-section/bad/expect.txt +1 -0
  128. package/payload/canon-kit/gate-tests/check-spec-derivable-section/good/SPEC.md +13 -0
  129. package/payload/canon-kit/gate-tests/check-spec-derivable-section/good/expect.txt +1 -0
  130. package/payload/canon-kit/gate-tests/check-spec-dod-singleton/bad/SPEC.md +15 -0
  131. package/payload/canon-kit/gate-tests/check-spec-dod-singleton/bad/expect.txt +1 -0
  132. package/payload/canon-kit/gate-tests/check-spec-dod-singleton/good/SPEC.md +13 -0
  133. package/payload/canon-kit/gate-tests/check-spec-dod-singleton/good/expect.txt +1 -0
  134. package/payload/canon-kit/gate-tests/check-spec-dod-singleton.test.sh +63 -0
  135. package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/SPEC.md +16 -0
  136. package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/expect.txt +1 -0
  137. package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/widget.sh +9 -0
  138. package/payload/canon-kit/gate-tests/check-spec-embedded-source/good/SPEC.md +19 -0
  139. package/payload/canon-kit/gate-tests/check-spec-embedded-source/good/expect.txt +1 -0
  140. package/payload/canon-kit/gate-tests/check-spec-embedded-source/good/widget.sh +9 -0
  141. package/payload/canon-kit/gate-tests/check-spec-fence-balance/bad/args +1 -0
  142. package/payload/canon-kit/gate-tests/check-spec-fence-balance/bad/doc.md +8 -0
  143. package/payload/canon-kit/gate-tests/check-spec-fence-balance/bad/expect.txt +1 -0
  144. package/payload/canon-kit/gate-tests/check-spec-fence-balance/good/args +1 -0
  145. package/payload/canon-kit/gate-tests/check-spec-fence-balance/good/doc.md +9 -0
  146. package/payload/canon-kit/gate-tests/check-spec-fence-balance/good/expect.txt +1 -0
  147. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/README.md +4 -0
  148. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/SPEC-target.md +6 -0
  149. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/SPEC-widget.md +5 -0
  150. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/cand-tmpl.md +5 -0
  151. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/expect.txt +1 -0
  152. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/scripts/canon-config.sh +5 -0
  153. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/widget.sh +5 -0
  154. package/payload/canon-kit/gate-tests/check-spec-pointer/good/README.md +4 -0
  155. package/payload/canon-kit/gate-tests/check-spec-pointer/good/SPEC-target.md +6 -0
  156. package/payload/canon-kit/gate-tests/check-spec-pointer/good/SPEC-widget.md +5 -0
  157. package/payload/canon-kit/gate-tests/check-spec-pointer/good/cand-tmpl.md +7 -0
  158. package/payload/canon-kit/gate-tests/check-spec-pointer/good/expect.txt +1 -0
  159. package/payload/canon-kit/gate-tests/check-spec-pointer/good/scripts/canon-config.sh +5 -0
  160. package/payload/canon-kit/gate-tests/check-spec-pointer/good/widget.sh +6 -0
  161. package/payload/canon-kit/gate-tests/check-surface-duplication/bad/GLOSSARY.md +11 -0
  162. package/payload/canon-kit/gate-tests/check-surface-duplication/bad/VISION.md +6 -0
  163. package/payload/canon-kit/gate-tests/check-surface-duplication/bad/expect.txt +1 -0
  164. package/payload/canon-kit/gate-tests/check-surface-duplication/good/GLOSSARY.md +11 -0
  165. package/payload/canon-kit/gate-tests/check-surface-duplication/good/VISION.md +6 -0
  166. package/payload/canon-kit/gate-tests/check-surface-duplication/good/expect.txt +1 -0
  167. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/TASK-QUEUE.md +19 -0
  168. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/bad.sh +5 -0
  169. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/expect.txt +1 -0
  170. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/TASK-QUEUE.md +23 -0
  171. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/expect.txt +1 -0
  172. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/good.sh +5 -0
  173. package/payload/canon-kit/gate-tests/check-tracking-claim/bad/README.md +4 -0
  174. package/payload/canon-kit/gate-tests/check-tracking-claim/bad/args +1 -0
  175. package/payload/canon-kit/gate-tests/check-tracking-claim/bad/expect.txt +1 -0
  176. package/payload/canon-kit/gate-tests/check-tracking-claim/bad/kept.txt +1 -0
  177. package/payload/canon-kit/gate-tests/check-tracking-claim/good/README.md +7 -0
  178. package/payload/canon-kit/gate-tests/check-tracking-claim/good/args +1 -0
  179. package/payload/canon-kit/gate-tests/check-tracking-claim/good/expect.txt +1 -0
  180. package/payload/canon-kit/gate-tests/check-tracking-claim/good/kept.txt +1 -0
  181. package/payload/canon-kit/gate-tests/check-tracking-claim/good/roster.list +1 -0
  182. package/payload/canon-kit/gate-tests/check-tracking-claim.test.sh +86 -0
  183. package/payload/canon-kit/lib/spec.sh +505 -0
  184. package/payload/canon-kit/smoke/install.sh +36 -0
  185. package/payload/canon-kit/smoke/violation.sh +22 -0
  186. package/payload/canon-kit/templates/SPEC-amendment.md +55 -0
  187. package/payload/canon-kit/templates/canon-config.sh +2 -0
  188. package/payload/context-kit/README.md +82 -0
  189. package/payload/context-kit/SPEC.md +790 -0
  190. package/payload/context-kit/bin/always-loaded.sh +86 -0
  191. package/payload/context-kit/bin/env-probe.sh +144 -0
  192. package/payload/context-kit/bin/footprint.sh +144 -0
  193. package/payload/context-kit/bin/md-index.sh +80 -0
  194. package/payload/context-kit/bin/md-section.sh +63 -0
  195. package/payload/context-kit/bin/pub-index.sh +90 -0
  196. package/payload/context-kit/bin/run-index-tests.sh +91 -0
  197. package/payload/context-kit/checks/check-brevity.sh +123 -0
  198. package/payload/context-kit/checks/check-footprint-fresh.sh +38 -0
  199. package/payload/context-kit/checks/check-memory-off.sh +112 -0
  200. package/payload/context-kit/checks/check-settings-pins.sh +110 -0
  201. package/payload/context-kit/gate-tests/check-brevity/bad/CLAUDE.md +14 -0
  202. package/payload/context-kit/gate-tests/check-brevity/bad/args +2 -0
  203. package/payload/context-kit/gate-tests/check-brevity/bad/expect.txt +1 -0
  204. package/payload/context-kit/gate-tests/check-brevity/good/CLAUDE.md +20 -0
  205. package/payload/context-kit/gate-tests/check-brevity/good/args +2 -0
  206. package/payload/context-kit/gate-tests/check-brevity/good/expect.txt +1 -0
  207. package/payload/context-kit/gate-tests/check-brevity.test.sh +89 -0
  208. package/payload/context-kit/gate-tests/check-footprint-fresh/bad/args +4 -0
  209. package/payload/context-kit/gate-tests/check-footprint-fresh/bad/emit.txt +12 -0
  210. package/payload/context-kit/gate-tests/check-footprint-fresh/bad/expect.txt +1 -0
  211. package/payload/context-kit/gate-tests/check-footprint-fresh/bad/projection.txt +11 -0
  212. package/payload/context-kit/gate-tests/check-footprint-fresh/good/args +4 -0
  213. package/payload/context-kit/gate-tests/check-footprint-fresh/good/emit.txt +12 -0
  214. package/payload/context-kit/gate-tests/check-footprint-fresh/good/expect.txt +1 -0
  215. package/payload/context-kit/gate-tests/check-footprint-fresh/good/projection.txt +12 -0
  216. package/payload/context-kit/gate-tests/check-memory-off/bad/args +1 -0
  217. package/payload/context-kit/gate-tests/check-memory-off/bad/expect.txt +1 -0
  218. package/payload/context-kit/gate-tests/check-memory-off/bad/memory/example-fact.md +6 -0
  219. package/payload/context-kit/gate-tests/check-memory-off/good/args +1 -0
  220. package/payload/context-kit/gate-tests/check-memory-off/good/expect.txt +1 -0
  221. package/payload/context-kit/gate-tests/check-memory-off/good/memory/.gitkeep +0 -0
  222. package/payload/context-kit/gate-tests/check-memory-off.test.sh +54 -0
  223. package/payload/context-kit/gate-tests/check-settings-pins/bad/args +1 -0
  224. package/payload/context-kit/gate-tests/check-settings-pins/bad/expect.txt +1 -0
  225. package/payload/context-kit/gate-tests/check-settings-pins/bad/settings-pins.conf +3 -0
  226. package/payload/context-kit/gate-tests/check-settings-pins/bad/settings.json +6 -0
  227. package/payload/context-kit/gate-tests/check-settings-pins/good/args +1 -0
  228. package/payload/context-kit/gate-tests/check-settings-pins/good/expect.txt +1 -0
  229. package/payload/context-kit/gate-tests/check-settings-pins/good/settings-pins.conf +3 -0
  230. package/payload/context-kit/gate-tests/check-settings-pins/good/settings.json +6 -0
  231. package/payload/context-kit/index-tests/corpus/baseline.txt +2 -0
  232. package/payload/context-kit/index-tests/corpus/hook-sample.txt +4 -0
  233. package/payload/context-kit/index-tests/corpus/sample.md +23 -0
  234. package/payload/context-kit/index-tests/corpus/sample.rs +24 -0
  235. package/payload/context-kit/index-tests/corpus/sample.ts +34 -0
  236. package/payload/context-kit/index-tests/corpus/surface.md +6 -0
  237. package/payload/context-kit/index-tests/expected/always-loaded.txt +1 -0
  238. package/payload/context-kit/index-tests/expected/md-index.txt +6 -0
  239. package/payload/context-kit/index-tests/expected/md-section.txt +6 -0
  240. package/payload/context-kit/index-tests/expected/pub-index-shadow.txt +2 -0
  241. package/payload/context-kit/index-tests/expected/pub-index-ts.txt +12 -0
  242. package/payload/context-kit/index-tests/expected/pub-index.txt +10 -0
  243. package/payload/context-kit/index-tests/expected/toolfloor.txt +14 -0
  244. package/payload/context-kit/index-tests/toolfloor-cases.sh +29 -0
  245. package/payload/context-kit/lib/pub-lang/rust.sh +26 -0
  246. package/payload/context-kit/lib/pub-lang/ts.sh +32 -0
  247. package/payload/context-kit/lib/toolfloor.sh +47 -0
  248. package/payload/context-kit/smoke/agents-md.sh +116 -0
  249. package/payload/context-kit/smoke/install.sh +60 -0
  250. package/payload/context-kit/smoke/violation.sh +21 -0
  251. package/payload/context-kit/templates/close-brevity.md +30 -0
  252. package/payload/context-kit/templates/context-config.sh +2 -0
  253. package/payload/context-kit/templates/session-context.sh +133 -0
  254. package/payload/context-kit/templates/settings-sessionstart.json +12 -0
  255. package/payload/delegation-kit/README.md +87 -0
  256. package/payload/delegation-kit/SPEC.md +792 -0
  257. package/payload/delegation-kit/bin/run-budget-guard-tests.sh +88 -0
  258. package/payload/delegation-kit/bin/run-trend-tests.sh +63 -0
  259. package/payload/delegation-kit/bin/run-usage-tests.sh +226 -0
  260. package/payload/delegation-kit/bin/usage-trend.sh +120 -0
  261. package/payload/delegation-kit/bin/usage-verdict.sh +144 -0
  262. package/payload/delegation-kit/checks/check-gate-tamper.sh +139 -0
  263. package/payload/delegation-kit/checks/check-rule-citation.sh +76 -0
  264. package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/args +1 -0
  265. package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/expect.txt +1 -0
  266. package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/staged-files +5 -0
  267. package/payload/delegation-kit/gate-tests/check-gate-tamper/good/added-exemptions +2 -0
  268. package/payload/delegation-kit/gate-tests/check-gate-tamper/good/args +1 -0
  269. package/payload/delegation-kit/gate-tests/check-gate-tamper/good/expect.txt +1 -0
  270. package/payload/delegation-kit/gate-tests/check-gate-tamper/good/staged-files +5 -0
  271. package/payload/delegation-kit/gate-tests/check-rule-citation/bad/args +1 -0
  272. package/payload/delegation-kit/gate-tests/check-rule-citation/bad/expect.txt +1 -0
  273. package/payload/delegation-kit/gate-tests/check-rule-citation/bad/spec.md +9 -0
  274. package/payload/delegation-kit/gate-tests/check-rule-citation/bad/tmpl.md +4 -0
  275. package/payload/delegation-kit/gate-tests/check-rule-citation/good/args +1 -0
  276. package/payload/delegation-kit/gate-tests/check-rule-citation/good/expect.txt +1 -0
  277. package/payload/delegation-kit/gate-tests/check-rule-citation/good/spec.md +20 -0
  278. package/payload/delegation-kit/gate-tests/check-rule-citation/good/tmpl.md +5 -0
  279. package/payload/delegation-kit/lib/delegation.sh +81 -0
  280. package/payload/delegation-kit/smoke/install.sh +61 -0
  281. package/payload/delegation-kit/smoke/violation.sh +16 -0
  282. package/payload/delegation-kit/templates/agent-budget-guard.sh +18 -0
  283. package/payload/delegation-kit/templates/agent-execution.md +136 -0
  284. package/payload/delegation-kit/templates/delegation-config.sh +2 -0
  285. package/payload/delegation-kit/templates/dispatch-checklists.md +60 -0
  286. package/payload/delegation-kit/templates/statusline-usage.sh +79 -0
  287. package/payload/delegation-kit/templates/usage-poller.sh +67 -0
  288. package/payload/delegation-kit/usage-tests/budget-guard-cases.tsv +20 -0
  289. package/payload/delegation-kit/usage-tests/cases.tsv +44 -0
  290. package/payload/delegation-kit/usage-tests/trend-history.log +20 -0
  291. package/payload/doctrine-kit/DOCTRINE.md +386 -0
  292. package/payload/doctrine-kit/README.md +70 -0
  293. package/payload/doctrine-kit/SPEC.md +233 -0
  294. package/payload/doctrine-kit/bin/install-doctrine.sh +44 -0
  295. package/payload/doctrine-kit/bin/stage-rules.sh +51 -0
  296. package/payload/doctrine-kit/checks/check-doctrine-registration.sh +216 -0
  297. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/bad/AGENT.md +14 -0
  298. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/bad/DOCTRINE.md +12 -0
  299. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/bad/args +1 -0
  300. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/bad/expect.txt +1 -0
  301. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/good/AGENT.md +15 -0
  302. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/good/DOCTRINE.md +12 -0
  303. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/good/args +1 -0
  304. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/good/expect.txt +1 -0
  305. package/payload/doctrine-kit/gate-tests/check-doctrine-registration.test.sh +208 -0
  306. package/payload/doctrine-kit/lib/doctrine.sh +29 -0
  307. package/payload/doctrine-kit/smoke/install.sh +24 -0
  308. package/payload/doctrine-kit/smoke/violation.sh +13 -0
  309. package/payload/drift-kit/README.md +115 -0
  310. package/payload/drift-kit/SPEC.md +881 -0
  311. package/payload/drift-kit/bin/drift-report.sh +155 -0
  312. package/payload/drift-kit/bin/kfric.sh +42 -0
  313. package/payload/drift-kit/bin/overhead-meter.sh +106 -0
  314. package/payload/drift-kit/bin/stage-economics.sh +311 -0
  315. package/payload/drift-kit/bin/trajectory.sh +242 -0
  316. package/payload/drift-kit/kpis/kpi-always-loaded.sh +39 -0
  317. package/payload/drift-kit/kpis/kpi-amendment-age.sh +33 -0
  318. package/payload/drift-kit/kpis/kpi-deferred-age.sh +46 -0
  319. package/payload/drift-kit/kpis/kpi-gate-backlog.sh +52 -0
  320. package/payload/drift-kit/kpis/kpi-gate-runtime.sh +31 -0
  321. package/payload/drift-kit/kpis/kpi-knowledge-friction.sh +21 -0
  322. package/payload/drift-kit/kpis/kpi-overhead.sh +44 -0
  323. package/payload/drift-kit/kpis/kpi-price-table-age.sh +68 -0
  324. package/payload/drift-kit/kpis/kpi-prompt-friction.sh +38 -0
  325. package/payload/drift-kit/kpis/kpi-queue-net-delta.sh +74 -0
  326. package/payload/drift-kit/kpis/kpi-settings-local.sh +21 -0
  327. package/payload/drift-kit/kpis/kpi-task-split.sh +43 -0
  328. package/payload/drift-kit/smoke/install.sh +348 -0
  329. package/payload/drift-kit/smoke/overhead-fixture.jsonl +4 -0
  330. package/payload/drift-kit/templates/close-knowledge.md +24 -0
  331. package/payload/drift-kit/templates/drift-config.sh +2 -0
  332. package/payload/drift-kit/templates/economics.md +45 -0
  333. package/payload/drift-kit/templates/kpi-deprecated-surface.sh +32 -0
  334. package/payload/drift-kit/templates/kpis.list +22 -0
  335. package/payload/drift-kit/templates/price-table.tsv +21 -0
  336. package/payload/evidence-kit/README.md +59 -0
  337. package/payload/evidence-kit/SPEC.md +261 -0
  338. package/payload/evidence-kit/bin/diff-baseline.sh +34 -0
  339. package/payload/evidence-kit/bin/run-validate.sh +82 -0
  340. package/payload/evidence-kit/checks/check-evidence-baseline.sh +103 -0
  341. package/payload/evidence-kit/checks/check-evidence-manifest.sh +104 -0
  342. package/payload/evidence-kit/gate-tests/check-evidence-baseline/bad/TASK-QUEUE.md +3 -0
  343. package/payload/evidence-kit/gate-tests/check-evidence-baseline/bad/args +2 -0
  344. package/payload/evidence-kit/gate-tests/check-evidence-baseline/bad/expect.txt +1 -0
  345. package/payload/evidence-kit/gate-tests/check-evidence-baseline/bad/validate-baseline.txt +3 -0
  346. package/payload/evidence-kit/gate-tests/check-evidence-baseline/good/TASK-QUEUE.md +3 -0
  347. package/payload/evidence-kit/gate-tests/check-evidence-baseline/good/args +2 -0
  348. package/payload/evidence-kit/gate-tests/check-evidence-baseline/good/expect.txt +1 -0
  349. package/payload/evidence-kit/gate-tests/check-evidence-baseline/good/validate-baseline.txt +3 -0
  350. package/payload/evidence-kit/gate-tests/check-evidence-baseline.test.sh +84 -0
  351. package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/TASK-QUEUE.md +1 -0
  352. package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/WORKFLOW-STATE.txt +3 -0
  353. package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/args +3 -0
  354. package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/expect.txt +1 -0
  355. package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/validate-evidence.txt +2 -0
  356. package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/TASK-QUEUE.md +1 -0
  357. package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/WORKFLOW-STATE.txt +3 -0
  358. package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/args +3 -0
  359. package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/expect.txt +1 -0
  360. package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/validate-evidence.txt +2 -0
  361. package/payload/evidence-kit/gate-tests/check-evidence-manifest.test.sh +107 -0
  362. package/payload/evidence-kit/gate-tests/evidence-lib.test.sh +82 -0
  363. package/payload/evidence-kit/lib/evidence.sh +173 -0
  364. package/payload/evidence-kit/smoke/install.sh +45 -0
  365. package/payload/evidence-kit/smoke/violation.sh +8 -0
  366. package/payload/evidence-kit/templates/evidence-config.sh +2 -0
  367. package/payload/gate-sdk/README.md +124 -0
  368. package/payload/gate-sdk/SPEC.md +1876 -0
  369. package/payload/gate-sdk/bin/enforcement-map.sh +272 -0
  370. package/payload/gate-sdk/bin/gen-pre-commit.sh +267 -0
  371. package/payload/gate-sdk/bin/install-hooks.sh +48 -0
  372. package/payload/gate-sdk/bin/run-consumer-smoke.sh +112 -0
  373. package/payload/gate-sdk/bin/run-gate-tests.sh +128 -0
  374. package/payload/gate-sdk/bin/run-gates.sh +147 -0
  375. package/payload/gate-sdk/bin/upgrade-smoke.sh +163 -0
  376. package/payload/gate-sdk/checks/check-action-pinning.sh +55 -0
  377. package/payload/gate-sdk/checks/check-action-run-shell.sh +219 -0
  378. package/payload/gate-sdk/checks/check-assertion-strength.sh +134 -0
  379. package/payload/gate-sdk/checks/check-commit-msg.sh +50 -0
  380. package/payload/gate-sdk/checks/check-commit-subject.sh +43 -0
  381. package/payload/gate-sdk/checks/check-core-files.sh +52 -0
  382. package/payload/gate-sdk/checks/check-enforcement-fresh.sh +37 -0
  383. package/payload/gate-sdk/checks/check-exec-bit.sh +76 -0
  384. package/payload/gate-sdk/checks/check-gate-assertions.sh +123 -0
  385. package/payload/gate-sdk/checks/check-gate-exemption-tasks.sh +106 -0
  386. package/payload/gate-sdk/checks/check-gate-fail-closed.sh +84 -0
  387. package/payload/gate-sdk/checks/check-gate-fixture-coverage.sh +92 -0
  388. package/payload/gate-sdk/checks/check-gate-output.sh +65 -0
  389. package/payload/gate-sdk/checks/check-graph.sh +632 -0
  390. package/payload/gate-sdk/checks/check-hook-exec-bit.sh +45 -0
  391. package/payload/gate-sdk/checks/check-identity.sh +134 -0
  392. package/payload/gate-sdk/checks/check-kit-enum.sh +94 -0
  393. package/payload/gate-sdk/checks/check-kit-registration.sh +68 -0
  394. package/payload/gate-sdk/checks/check-readme-roster.sh +102 -0
  395. package/payload/gate-sdk/checks/check-reads-couples.sh +148 -0
  396. package/payload/gate-sdk/checks/check-root-tiering.sh +66 -0
  397. package/payload/gate-sdk/checks/check-shellcheck.sh +55 -0
  398. package/payload/gate-sdk/checks/check-smoke-entry-guard.sh +53 -0
  399. package/payload/gate-sdk/checks/check-template-copy-parity.sh +126 -0
  400. package/payload/gate-sdk/checks/check-test-hermetic.sh +119 -0
  401. package/payload/gate-sdk/checks/check-tree-terms.sh +61 -0
  402. package/payload/gate-sdk/checks/check-workflow-tiering.sh +84 -0
  403. package/payload/gate-sdk/gate-tests/check-action-pinning/bad/args +1 -0
  404. package/payload/gate-sdk/gate-tests/check-action-pinning/bad/expect.txt +1 -0
  405. package/payload/gate-sdk/gate-tests/check-action-pinning/bad/tree/mutable.yml +11 -0
  406. package/payload/gate-sdk/gate-tests/check-action-pinning/bad/tree/nested/pinned.yml +5 -0
  407. package/payload/gate-sdk/gate-tests/check-action-pinning/good/args +1 -0
  408. package/payload/gate-sdk/gate-tests/check-action-pinning/good/expect.txt +1 -0
  409. package/payload/gate-sdk/gate-tests/check-action-pinning/good/tree/nested/deep.yml +5 -0
  410. package/payload/gate-sdk/gate-tests/check-action-pinning/good/tree/no-refs.yaml +8 -0
  411. package/payload/gate-sdk/gate-tests/check-action-pinning/good/tree/pinned.yml +10 -0
  412. package/payload/gate-sdk/gate-tests/check-action-run-shell/bad/args +3 -0
  413. package/payload/gate-sdk/gate-tests/check-action-run-shell/bad/expect.txt +1 -0
  414. package/payload/gate-sdk/gate-tests/check-action-run-shell/bad/tree/workflows/ci.yml +15 -0
  415. package/payload/gate-sdk/gate-tests/check-action-run-shell/good/args +3 -0
  416. package/payload/gate-sdk/gate-tests/check-action-run-shell/good/expect.txt +1 -0
  417. package/payload/gate-sdk/gate-tests/check-action-run-shell/good/tree/action.yml +14 -0
  418. package/payload/gate-sdk/gate-tests/check-action-run-shell/good/tree/not-actions.yml +16 -0
  419. package/payload/gate-sdk/gate-tests/check-action-run-shell/good/tree/workflows/ci.yml +106 -0
  420. package/payload/gate-sdk/gate-tests/check-action-run-shell.test.sh +88 -0
  421. package/payload/gate-sdk/gate-tests/check-assertion-strength/bad/args +3 -0
  422. package/payload/gate-sdk/gate-tests/check-assertion-strength/bad/bin/verdict.sh +5 -0
  423. package/payload/gate-sdk/gate-tests/check-assertion-strength/bad/expect.txt +1 -0
  424. package/payload/gate-sdk/gate-tests/check-assertion-strength/bad/smoke/install.sh +11 -0
  425. package/payload/gate-sdk/gate-tests/check-assertion-strength/good/args +3 -0
  426. package/payload/gate-sdk/gate-tests/check-assertion-strength/good/bin/verdict.sh +5 -0
  427. package/payload/gate-sdk/gate-tests/check-assertion-strength/good/expect.txt +1 -0
  428. package/payload/gate-sdk/gate-tests/check-assertion-strength/good/smoke/install.sh +16 -0
  429. package/payload/gate-sdk/gate-tests/check-commit-msg/bad/args +2 -0
  430. package/payload/gate-sdk/gate-tests/check-commit-msg/bad/expect.txt +1 -0
  431. package/payload/gate-sdk/gate-tests/check-commit-msg/bad/msg.txt +5 -0
  432. package/payload/gate-sdk/gate-tests/check-commit-msg/bad/patterns.list +5 -0
  433. package/payload/gate-sdk/gate-tests/check-commit-msg/good/args +2 -0
  434. package/payload/gate-sdk/gate-tests/check-commit-msg/good/expect.txt +1 -0
  435. package/payload/gate-sdk/gate-tests/check-commit-msg/good/msg.txt +5 -0
  436. package/payload/gate-sdk/gate-tests/check-commit-msg/good/patterns.list +5 -0
  437. package/payload/gate-sdk/gate-tests/check-commit-subject/bad/args +2 -0
  438. package/payload/gate-sdk/gate-tests/check-commit-subject/bad/expect.txt +1 -0
  439. package/payload/gate-sdk/gate-tests/check-commit-subject/bad/msg.txt +4 -0
  440. package/payload/gate-sdk/gate-tests/check-commit-subject/good/args +2 -0
  441. package/payload/gate-sdk/gate-tests/check-commit-subject/good/expect.txt +1 -0
  442. package/payload/gate-sdk/gate-tests/check-commit-subject/good/msg.txt +5 -0
  443. package/payload/gate-sdk/gate-tests/check-commit-subject.test.sh +73 -0
  444. package/payload/gate-sdk/gate-tests/check-core-files/bad/args +1 -0
  445. package/payload/gate-sdk/gate-tests/check-core-files/bad/core-files.list +3 -0
  446. package/payload/gate-sdk/gate-tests/check-core-files/bad/expect.txt +1 -0
  447. package/payload/gate-sdk/gate-tests/check-core-files/bad/present.txt +1 -0
  448. package/payload/gate-sdk/gate-tests/check-core-files/good/args +1 -0
  449. package/payload/gate-sdk/gate-tests/check-core-files/good/core-files.list +5 -0
  450. package/payload/gate-sdk/gate-tests/check-core-files/good/expect.txt +1 -0
  451. package/payload/gate-sdk/gate-tests/check-core-files/good/nested/also-present.txt +1 -0
  452. package/payload/gate-sdk/gate-tests/check-core-files/good/present.txt +1 -0
  453. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/bad/args +4 -0
  454. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/bad/emit.txt +14 -0
  455. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/bad/expect.txt +1 -0
  456. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/bad/projection.txt +7 -0
  457. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/good/args +4 -0
  458. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/good/emit.txt +14 -0
  459. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/good/expect.txt +1 -0
  460. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/good/projection.txt +14 -0
  461. package/payload/gate-sdk/gate-tests/check-exec-bit/bad/args +1 -0
  462. package/payload/gate-sdk/gate-tests/check-exec-bit/bad/dump.txt +7 -0
  463. package/payload/gate-sdk/gate-tests/check-exec-bit/bad/expect.txt +1 -0
  464. package/payload/gate-sdk/gate-tests/check-exec-bit/good/args +1 -0
  465. package/payload/gate-sdk/gate-tests/check-exec-bit/good/dump.txt +7 -0
  466. package/payload/gate-sdk/gate-tests/check-exec-bit/good/expect.txt +1 -0
  467. package/payload/gate-sdk/gate-tests/check-exec-bit.test.sh +46 -0
  468. package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/args +1 -0
  469. package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/expect.txt +1 -0
  470. package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/SPEC.md +13 -0
  471. package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/check-baz.sh +13 -0
  472. package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/check-foo.sh +10 -0
  473. package/payload/gate-sdk/gate-tests/check-gate-assertions/good/args +1 -0
  474. package/payload/gate-sdk/gate-tests/check-gate-assertions/good/expect.txt +1 -0
  475. package/payload/gate-sdk/gate-tests/check-gate-assertions/good/scripts/SPEC.md +20 -0
  476. package/payload/gate-sdk/gate-tests/check-gate-assertions/good/scripts/check-baz.sh +12 -0
  477. package/payload/gate-sdk/gate-tests/check-gate-assertions/good/scripts/check-foo.sh +9 -0
  478. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/TASK-QUEUE.md +9 -0
  479. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/args +1 -0
  480. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/expect.txt +1 -0
  481. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/gates/check-sample.sh +11 -0
  482. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/TASK-QUEUE.md +9 -0
  483. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/args +1 -0
  484. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/expect.txt +1 -0
  485. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/gates/check-sample.sh +11 -0
  486. package/payload/gate-sdk/gate-tests/check-gate-fail-closed/bad/args +1 -0
  487. package/payload/gate-sdk/gate-tests/check-gate-fail-closed/bad/expect.txt +1 -0
  488. package/payload/gate-sdk/gate-tests/check-gate-fail-closed/bad/gates/check-sample.sh +8 -0
  489. package/payload/gate-sdk/gate-tests/check-gate-fail-closed/good/args +1 -0
  490. package/payload/gate-sdk/gate-tests/check-gate-fail-closed/good/expect.txt +1 -0
  491. package/payload/gate-sdk/gate-tests/check-gate-fail-closed/good/gates/check-sample.sh +8 -0
  492. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/args +1 -0
  493. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/check-gamma.sh +4 -0
  494. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/expect.txt +1 -0
  495. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/gate-tests/check-alpha/bad/.keep +0 -0
  496. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/gate-tests/check-alpha/good/.keep +0 -0
  497. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/gates.list +4 -0
  498. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/args +1 -0
  499. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/check-beta.sh +5 -0
  500. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/expect.txt +1 -0
  501. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/gate-tests/check-alpha/bad/.keep +0 -0
  502. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/gate-tests/check-alpha/good/.keep +0 -0
  503. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/gates.list +5 -0
  504. package/payload/gate-sdk/gate-tests/check-gate-output/bad/args +1 -0
  505. package/payload/gate-sdk/gate-tests/check-gate-output/bad/check-sample.sh +4 -0
  506. package/payload/gate-sdk/gate-tests/check-gate-output/bad/expect.txt +1 -0
  507. package/payload/gate-sdk/gate-tests/check-gate-output/bad/gates.list +2 -0
  508. package/payload/gate-sdk/gate-tests/check-gate-output/good/args +1 -0
  509. package/payload/gate-sdk/gate-tests/check-gate-output/good/check-sample.sh +9 -0
  510. package/payload/gate-sdk/gate-tests/check-gate-output/good/expect.txt +1 -0
  511. package/payload/gate-sdk/gate-tests/check-gate-output/good/gates.list +3 -0
  512. package/payload/gate-sdk/gate-tests/check-graph/bad/SPEC-example-gate.md +12 -0
  513. package/payload/gate-sdk/gate-tests/check-graph/bad/args +1 -0
  514. package/payload/gate-sdk/gate-tests/check-graph/bad/expect.txt +1 -0
  515. package/payload/gate-sdk/gate-tests/check-graph/good/SPEC-example-gate.md +20 -0
  516. package/payload/gate-sdk/gate-tests/check-graph/good/args +3 -0
  517. package/payload/gate-sdk/gate-tests/check-graph/good/expect.txt +1 -0
  518. package/payload/gate-sdk/gate-tests/check-graph-cap.test.sh +51 -0
  519. package/payload/gate-sdk/gate-tests/check-graph-refs.test.sh +55 -0
  520. package/payload/gate-sdk/gate-tests/check-graph-theme.test.sh +63 -0
  521. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/bad/args +1 -0
  522. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/bad/expect.txt +1 -0
  523. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/bad/hooks/pre-commit +2 -0
  524. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/good/args +1 -0
  525. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/good/expect.txt +1 -0
  526. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/good/hooks/pre-commit +2 -0
  527. package/payload/gate-sdk/gate-tests/check-identity/bad/args +1 -0
  528. package/payload/gate-sdk/gate-tests/check-identity/bad/expect.txt +1 -0
  529. package/payload/gate-sdk/gate-tests/check-identity/bad/git-config-email +1 -0
  530. package/payload/gate-sdk/gate-tests/check-identity/bad/git-remotes +2 -0
  531. package/payload/gate-sdk/gate-tests/check-identity/bad/identity.conf +4 -0
  532. package/payload/gate-sdk/gate-tests/check-identity/good/args +1 -0
  533. package/payload/gate-sdk/gate-tests/check-identity/good/expect.txt +1 -0
  534. package/payload/gate-sdk/gate-tests/check-identity/good/git-config-email +1 -0
  535. package/payload/gate-sdk/gate-tests/check-identity/good/git-remotes +3 -0
  536. package/payload/gate-sdk/gate-tests/check-identity/good/identity.conf +5 -0
  537. package/payload/gate-sdk/gate-tests/check-kit-enum/bad/args +1 -0
  538. package/payload/gate-sdk/gate-tests/check-kit-enum/bad/check-sample.sh +5 -0
  539. package/payload/gate-sdk/gate-tests/check-kit-enum/bad/expect.txt +1 -0
  540. package/payload/gate-sdk/gate-tests/check-kit-enum/bad/gates.list +4 -0
  541. package/payload/gate-sdk/gate-tests/check-kit-enum/good/args +1 -0
  542. package/payload/gate-sdk/gate-tests/check-kit-enum/good/check-sample.sh +5 -0
  543. package/payload/gate-sdk/gate-tests/check-kit-enum/good/expect.txt +1 -0
  544. package/payload/gate-sdk/gate-tests/check-kit-enum/good/gates.list +3 -0
  545. package/payload/gate-sdk/gate-tests/check-kit-registration/bad/args +4 -0
  546. package/payload/gate-sdk/gate-tests/check-kit-registration/bad/expect.txt +1 -0
  547. package/payload/gate-sdk/gate-tests/check-kit-registration/bad/registry-doc.md +20 -0
  548. package/payload/gate-sdk/gate-tests/check-kit-registration/good/args +5 -0
  549. package/payload/gate-sdk/gate-tests/check-kit-registration/good/expect.txt +1 -0
  550. package/payload/gate-sdk/gate-tests/check-kit-registration.test.sh +75 -0
  551. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/alpha-kit/README.md +14 -0
  552. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/alpha-kit/checks/check-alpha-one.sh +3 -0
  553. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/alpha-kit/checks/check-alpha-two.sh +3 -0
  554. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/args +4 -0
  555. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/expect.txt +1 -0
  556. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/gamma-kit/README.md +5 -0
  557. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/gamma-kit/checks/check-gamma-one.sh +3 -0
  558. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/scripts/gate-sdk-config.sh +5 -0
  559. package/payload/gate-sdk/gate-tests/check-readme-roster/good/alpha-kit/README.md +16 -0
  560. package/payload/gate-sdk/gate-tests/check-readme-roster/good/alpha-kit/checks/check-alpha-one.sh +3 -0
  561. package/payload/gate-sdk/gate-tests/check-readme-roster/good/alpha-kit/checks/check-alpha-two.sh +3 -0
  562. package/payload/gate-sdk/gate-tests/check-readme-roster/good/args +6 -0
  563. package/payload/gate-sdk/gate-tests/check-readme-roster/good/beta-kit/smoke/install.sh +3 -0
  564. package/payload/gate-sdk/gate-tests/check-readme-roster/good/expect.txt +1 -0
  565. package/payload/gate-sdk/gate-tests/check-readme-roster/good/scripts/gate-sdk-config.sh +5 -0
  566. package/payload/gate-sdk/gate-tests/check-reads-couples/bad/args +2 -0
  567. package/payload/gate-sdk/gate-tests/check-reads-couples/bad/corpus/sub/deep.md +1 -0
  568. package/payload/gate-sdk/gate-tests/check-reads-couples/bad/corpus/top.md +1 -0
  569. package/payload/gate-sdk/gate-tests/check-reads-couples/bad/expect.txt +1 -0
  570. package/payload/gate-sdk/gate-tests/check-reads-couples/bad/sandbox-gate.sh +6 -0
  571. package/payload/gate-sdk/gate-tests/check-reads-couples/good/args +3 -0
  572. package/payload/gate-sdk/gate-tests/check-reads-couples/good/corpus/sub/deep.md +1 -0
  573. package/payload/gate-sdk/gate-tests/check-reads-couples/good/corpus/top.md +1 -0
  574. package/payload/gate-sdk/gate-tests/check-reads-couples/good/expect.txt +1 -0
  575. package/payload/gate-sdk/gate-tests/check-reads-couples/good/sandbox-gate.sh +8 -0
  576. package/payload/gate-sdk/gate-tests/check-root-tiering/bad/allow.list +1 -0
  577. package/payload/gate-sdk/gate-tests/check-root-tiering/bad/args +1 -0
  578. package/payload/gate-sdk/gate-tests/check-root-tiering/bad/expect.txt +1 -0
  579. package/payload/gate-sdk/gate-tests/check-root-tiering/bad/root/README.md +1 -0
  580. package/payload/gate-sdk/gate-tests/check-root-tiering/bad/root/stray.txt +1 -0
  581. package/payload/gate-sdk/gate-tests/check-root-tiering/good/allow.list +3 -0
  582. package/payload/gate-sdk/gate-tests/check-root-tiering/good/args +1 -0
  583. package/payload/gate-sdk/gate-tests/check-root-tiering/good/expect.txt +1 -0
  584. package/payload/gate-sdk/gate-tests/check-root-tiering/good/root/LICENSE +1 -0
  585. package/payload/gate-sdk/gate-tests/check-root-tiering/good/root/README.md +1 -0
  586. package/payload/gate-sdk/gate-tests/check-root-tiering/good/root/somedir/keep.txt +1 -0
  587. package/payload/gate-sdk/gate-tests/check-shellcheck/bad/args +1 -0
  588. package/payload/gate-sdk/gate-tests/check-shellcheck/bad/expect.txt +1 -0
  589. package/payload/gate-sdk/gate-tests/check-shellcheck/bad/warn.sh +5 -0
  590. package/payload/gate-sdk/gate-tests/check-shellcheck/good/args +1 -0
  591. package/payload/gate-sdk/gate-tests/check-shellcheck/good/expect.txt +1 -0
  592. package/payload/gate-sdk/gate-tests/check-shellcheck/good/ok.sh +4 -0
  593. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/bad/alpha-kit/smoke/install.sh +4 -0
  594. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/bad/alpha-kit/smoke/violation.sh +7 -0
  595. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/bad/args +4 -0
  596. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/bad/expect.txt +1 -0
  597. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/bad/scripts/gate-sdk-config.sh +5 -0
  598. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/good/alpha-kit/smoke/install.sh +4 -0
  599. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/good/alpha-kit/smoke/violation.sh +4 -0
  600. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/good/args +6 -0
  601. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/good/beta-kit/smoke/install.sh +4 -0
  602. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/good/expect.txt +1 -0
  603. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/good/scripts/gate-sdk-config.sh +5 -0
  604. package/payload/gate-sdk/gate-tests/check-template-copy-parity/bad/args +9 -0
  605. package/payload/gate-sdk/gate-tests/check-template-copy-parity/bad/delegation-kit/templates/agent-budget-guard.sh +16 -0
  606. package/payload/gate-sdk/gate-tests/check-template-copy-parity/bad/expect.txt +1 -0
  607. package/payload/gate-sdk/gate-tests/check-template-copy-parity/bad/scripts/agent-budget-guard.sh +17 -0
  608. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/args +8 -0
  609. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/delegation-kit/templates/agent-budget-guard.sh +16 -0
  610. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/delegation-kit/templates/delegation-config.sh +3 -0
  611. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/delegation-kit/templates/usage-poller.sh +6 -0
  612. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/expect.txt +1 -0
  613. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/scripts/agent-budget-guard.sh +16 -0
  614. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/scripts/delegation-config.sh +4 -0
  615. package/payload/gate-sdk/gate-tests/check-test-hermetic/bad/args +3 -0
  616. package/payload/gate-sdk/gate-tests/check-test-hermetic/bad/expect.txt +1 -0
  617. package/payload/gate-sdk/gate-tests/check-test-hermetic/bad/leaky.test.sh +5 -0
  618. package/payload/gate-sdk/gate-tests/check-test-hermetic/good/args +3 -0
  619. package/payload/gate-sdk/gate-tests/check-test-hermetic/good/exempt.test.sh +4 -0
  620. package/payload/gate-sdk/gate-tests/check-test-hermetic/good/expect.txt +1 -0
  621. package/payload/gate-sdk/gate-tests/check-test-hermetic/good/sourced.test.sh +5 -0
  622. package/payload/gate-sdk/gate-tests/check-test-hermetic-smoke.test.sh +84 -0
  623. package/payload/gate-sdk/gate-tests/check-tree-terms/bad/args +2 -0
  624. package/payload/gate-sdk/gate-tests/check-tree-terms/bad/expect.txt +1 -0
  625. package/payload/gate-sdk/gate-tests/check-tree-terms/bad/patterns.list +3 -0
  626. package/payload/gate-sdk/gate-tests/check-tree-terms/bad/tree/leak.txt +1 -0
  627. package/payload/gate-sdk/gate-tests/check-tree-terms/good/args +2 -0
  628. package/payload/gate-sdk/gate-tests/check-tree-terms/good/expect.txt +1 -0
  629. package/payload/gate-sdk/gate-tests/check-tree-terms/good/patterns.list +3 -0
  630. package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/clean.txt +1 -0
  631. package/payload/gate-sdk/gate-tests/check-workflow-tiering/bad/.workflow/payload.txt +1 -0
  632. package/payload/gate-sdk/gate-tests/check-workflow-tiering/bad/.workflow/projection.txt +1 -0
  633. package/payload/gate-sdk/gate-tests/check-workflow-tiering/bad/expect.txt +1 -0
  634. package/payload/gate-sdk/gate-tests/check-workflow-tiering/good/.workflow/projection.txt +1 -0
  635. package/payload/gate-sdk/gate-tests/check-workflow-tiering/good/.workflow/wire.txt +1 -0
  636. package/payload/gate-sdk/gate-tests/check-workflow-tiering/good/expect.txt +1 -0
  637. package/payload/gate-sdk/gate-tests/enforcement-map.test.sh +87 -0
  638. package/payload/gate-sdk/gate-tests/lib-gate.test.sh +78 -0
  639. package/payload/gate-sdk/gate-tests/run-for-path.test.sh +77 -0
  640. package/payload/gate-sdk/lib/consumer-smoke.sh +32 -0
  641. package/payload/gate-sdk/lib/gate.sh +216 -0
  642. package/payload/gate-sdk/lib/inject.sh +35 -0
  643. package/payload/gate-sdk/lib/test-hermetic.sh +11 -0
  644. package/payload/gate-sdk/smoke/install.sh +84 -0
  645. package/payload/gate-sdk/smoke/violation.sh +13 -0
  646. package/payload/gate-sdk/templates/check-skeleton.sh +23 -0
  647. package/payload/gate-sdk/templates/gates-workflow.yml +55 -0
  648. package/payload/gate-sdk/templates/msg-patterns.list +21 -0
  649. package/payload/guard-kit/README.md +65 -0
  650. package/payload/guard-kit/SPEC.md +590 -0
  651. package/payload/guard-kit/bin/compare-settings-allow.sh +58 -0
  652. package/payload/guard-kit/bin/run-guard-tests.sh +86 -0
  653. package/payload/guard-kit/bin/scan-prompts.sh +166 -0
  654. package/payload/guard-kit/bin/scratch-run.sh +34 -0
  655. package/payload/guard-kit/gate-tests/scan-prompts.test.sh +70 -0
  656. package/payload/guard-kit/gate-tests/scratch-run.test.sh +62 -0
  657. package/payload/guard-kit/guard-tests/cases.tsv +117 -0
  658. package/payload/guard-kit/guard-tests/escalation-cases.tsv +13 -0
  659. package/payload/guard-kit/lib/guard.sh +448 -0
  660. package/payload/guard-kit/smoke/install.sh +26 -0
  661. package/payload/guard-kit/templates/bash-guard.sh +18 -0
  662. package/payload/guard-kit/templates/close-triage.md +31 -0
  663. package/payload/guard-kit/templates/escalation-guard.sh +27 -0
  664. package/payload/guard-kit/templates/guard-config.sh +2 -0
  665. package/payload/guard-kit/templates/settings-hooks.json +19 -0
  666. package/payload/guard-kit/templates/wakeup-guard.sh +20 -0
  667. package/payload/lifecycle-kit/README.md +106 -0
  668. package/payload/lifecycle-kit/SPEC.md +1492 -0
  669. package/payload/lifecycle-kit/bin/close-surfaces.sh +94 -0
  670. package/payload/lifecycle-kit/bin/enter-stage.sh +215 -0
  671. package/payload/lifecycle-kit/bin/file-gap.sh +43 -0
  672. package/payload/lifecycle-kit/bin/install-lifecycle.sh +36 -0
  673. package/payload/lifecycle-kit/bin/session-id.sh +75 -0
  674. package/payload/lifecycle-kit/checks/check-close-surfaces.sh +63 -0
  675. package/payload/lifecycle-kit/checks/check-lesson-disposition.sh +98 -0
  676. package/payload/lifecycle-kit/checks/check-lifecycle-registration.sh +54 -0
  677. package/payload/lifecycle-kit/checks/check-merge-attrs.sh +69 -0
  678. package/payload/lifecycle-kit/checks/check-shim-restatement.sh +97 -0
  679. package/payload/lifecycle-kit/checks/check-skill-binding.sh +59 -0
  680. package/payload/lifecycle-kit/checks/check-stage-entry.sh +197 -0
  681. package/payload/lifecycle-kit/checks/check-stage-evidence.sh +81 -0
  682. package/payload/lifecycle-kit/checks/check-stage-skill-coverage.sh +47 -0
  683. package/payload/lifecycle-kit/gate-tests/boundary-scratch-wipe.test.sh +96 -0
  684. package/payload/lifecycle-kit/gate-tests/check-close-surfaces/bad/args +1 -0
  685. package/payload/lifecycle-kit/gate-tests/check-close-surfaces/bad/expect.txt +1 -0
  686. package/payload/lifecycle-kit/gate-tests/check-close-surfaces/bad/owners/inbox.md +5 -0
  687. package/payload/lifecycle-kit/gate-tests/check-close-surfaces/bad/scripts/lifecycle-config.sh +4 -0
  688. package/payload/lifecycle-kit/gate-tests/check-close-surfaces/good/args +1 -0
  689. package/payload/lifecycle-kit/gate-tests/check-close-surfaces/good/expect.txt +1 -0
  690. package/payload/lifecycle-kit/gate-tests/check-close-surfaces/good/owners/inbox.md +5 -0
  691. package/payload/lifecycle-kit/gate-tests/check-close-surfaces/good/scripts/lifecycle-config.sh +4 -0
  692. package/payload/lifecycle-kit/gate-tests/check-close-surfaces.test.sh +66 -0
  693. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/bad/args +2 -0
  694. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/bad/evidence.txt +2 -0
  695. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/bad/expect.txt +1 -0
  696. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/bad/queue-head.md +8 -0
  697. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/bad/queue-work.md +5 -0
  698. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/good/args +2 -0
  699. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/good/evidence.txt +3 -0
  700. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/good/expect.txt +1 -0
  701. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/good/queue-head.md +8 -0
  702. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/good/queue-work.md +5 -0
  703. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition.test.sh +56 -0
  704. package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration/bad/AGENT.md +11 -0
  705. package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration/bad/args +1 -0
  706. package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration/bad/expect.txt +1 -0
  707. package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration/good/AGENT.md +11 -0
  708. package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration/good/args +1 -0
  709. package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration/good/expect.txt +1 -0
  710. package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration.test.sh +59 -0
  711. package/payload/lifecycle-kit/gate-tests/check-merge-attrs/bad/.gitattributes +6 -0
  712. package/payload/lifecycle-kit/gate-tests/check-merge-attrs/bad/expect.txt +1 -0
  713. package/payload/lifecycle-kit/gate-tests/check-merge-attrs/good/.gitattributes +5 -0
  714. package/payload/lifecycle-kit/gate-tests/check-merge-attrs/good/expect.txt +1 -0
  715. package/payload/lifecycle-kit/gate-tests/check-merge-attrs.test.sh +113 -0
  716. package/payload/lifecycle-kit/gate-tests/check-shim-restatement/bad/args +2 -0
  717. package/payload/lifecycle-kit/gate-tests/check-shim-restatement/bad/commands/build.md +6 -0
  718. package/payload/lifecycle-kit/gate-tests/check-shim-restatement/bad/corpus.md +4 -0
  719. package/payload/lifecycle-kit/gate-tests/check-shim-restatement/bad/expect.txt +1 -0
  720. package/payload/lifecycle-kit/gate-tests/check-shim-restatement/good/args +2 -0
  721. package/payload/lifecycle-kit/gate-tests/check-shim-restatement/good/commands/build.md +5 -0
  722. package/payload/lifecycle-kit/gate-tests/check-shim-restatement/good/corpus.md +4 -0
  723. package/payload/lifecycle-kit/gate-tests/check-shim-restatement/good/expect.txt +1 -0
  724. package/payload/lifecycle-kit/gate-tests/check-shim-restatement.test.sh +80 -0
  725. package/payload/lifecycle-kit/gate-tests/check-skill-binding/bad/args +1 -0
  726. package/payload/lifecycle-kit/gate-tests/check-skill-binding/bad/commands/build.md +5 -0
  727. package/payload/lifecycle-kit/gate-tests/check-skill-binding/bad/expect.txt +1 -0
  728. package/payload/lifecycle-kit/gate-tests/check-skill-binding/bad/templates/build.md +7 -0
  729. package/payload/lifecycle-kit/gate-tests/check-skill-binding/good/args +1 -0
  730. package/payload/lifecycle-kit/gate-tests/check-skill-binding/good/commands/build.md +7 -0
  731. package/payload/lifecycle-kit/gate-tests/check-skill-binding/good/expect.txt +1 -0
  732. package/payload/lifecycle-kit/gate-tests/check-skill-binding/good/templates/build.md +7 -0
  733. package/payload/lifecycle-kit/gate-tests/check-skill-binding.test.sh +84 -0
  734. package/payload/lifecycle-kit/gate-tests/check-stage-entry/bad/.workflow/WORKFLOW-STATE.txt +7 -0
  735. package/payload/lifecycle-kit/gate-tests/check-stage-entry/bad/TASK-QUEUE.md +13 -0
  736. package/payload/lifecycle-kit/gate-tests/check-stage-entry/bad/expect.txt +1 -0
  737. package/payload/lifecycle-kit/gate-tests/check-stage-entry/good/.workflow/WORKFLOW-STATE.txt +7 -0
  738. package/payload/lifecycle-kit/gate-tests/check-stage-entry/good/TASK-QUEUE.md +13 -0
  739. package/payload/lifecycle-kit/gate-tests/check-stage-entry/good/expect.txt +1 -0
  740. package/payload/lifecycle-kit/gate-tests/check-stage-entry.test.sh +251 -0
  741. package/payload/lifecycle-kit/gate-tests/check-stage-evidence/bad/.workflow/WORKFLOW-STATE.txt +6 -0
  742. package/payload/lifecycle-kit/gate-tests/check-stage-evidence/bad/TASK-QUEUE.md +13 -0
  743. package/payload/lifecycle-kit/gate-tests/check-stage-evidence/bad/expect.txt +1 -0
  744. package/payload/lifecycle-kit/gate-tests/check-stage-evidence/good/.workflow/WORKFLOW-STATE.txt +6 -0
  745. package/payload/lifecycle-kit/gate-tests/check-stage-evidence/good/TASK-QUEUE.md +13 -0
  746. package/payload/lifecycle-kit/gate-tests/check-stage-evidence/good/expect.txt +1 -0
  747. package/payload/lifecycle-kit/gate-tests/check-stage-evidence.test.sh +115 -0
  748. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/args +1 -0
  749. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/commands/align.md +2 -0
  750. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/commands/build.md +2 -0
  751. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/commands/scope.md +2 -0
  752. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/commands/validate.md +2 -0
  753. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/expect.txt +1 -0
  754. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/args +1 -0
  755. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/commands/align.md +2 -0
  756. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/commands/build.md +2 -0
  757. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/commands/close.md +2 -0
  758. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/commands/scope.md +2 -0
  759. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/commands/validate.md +2 -0
  760. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/expect.txt +1 -0
  761. package/payload/lifecycle-kit/lib/stages.sh +179 -0
  762. package/payload/lifecycle-kit/smoke/install.sh +341 -0
  763. package/payload/lifecycle-kit/smoke/violation.sh +8 -0
  764. package/payload/lifecycle-kit/templates/lead.md +271 -0
  765. package/payload/lifecycle-kit/templates/lifecycle-config.sh +2 -0
  766. package/payload/lifecycle-kit/templates/release-sweep.md +39 -0
  767. package/payload/lifecycle-kit/templates/stages/align.md +65 -0
  768. package/payload/lifecycle-kit/templates/stages/build.md +78 -0
  769. package/payload/lifecycle-kit/templates/stages/close.md +122 -0
  770. package/payload/lifecycle-kit/templates/stages/scope.md +112 -0
  771. package/payload/lifecycle-kit/templates/stages/spec.md +91 -0
  772. package/payload/lifecycle-kit/templates/stages/validate.md +54 -0
  773. package/payload/lifecycle-kit/templates/upgrade.md +41 -0
  774. package/payload/queue-kit/README.md +78 -0
  775. package/payload/queue-kit/SPEC.md +797 -0
  776. package/payload/queue-kit/bin/lesson-sink.sh +28 -0
  777. package/payload/queue-kit/bin/queue-index.sh +182 -0
  778. package/payload/queue-kit/bin/roadmap.sh +76 -0
  779. package/payload/queue-kit/checks/check-queue-entry-budget.sh +104 -0
  780. package/payload/queue-kit/checks/check-queue-hygiene.sh +81 -0
  781. package/payload/queue-kit/checks/check-queue-prose-precondition.sh +63 -0
  782. package/payload/queue-kit/checks/check-queue-sections.sh +44 -0
  783. package/payload/queue-kit/checks/check-queue-slug-liveness.sh +63 -0
  784. package/payload/queue-kit/checks/check-queue-wrap.sh +56 -0
  785. package/payload/queue-kit/checks/check-roadmap-fresh.sh +110 -0
  786. package/payload/queue-kit/checks/check-tag-lead-line.sh +70 -0
  787. package/payload/queue-kit/checks/check-task-conservation.sh +50 -0
  788. package/payload/queue-kit/checks/check-task-names.sh +128 -0
  789. package/payload/queue-kit/gate-tests/check-queue-entry-budget/bad/TASK-QUEUE.md +33 -0
  790. package/payload/queue-kit/gate-tests/check-queue-entry-budget/bad/expect.txt +4 -0
  791. package/payload/queue-kit/gate-tests/check-queue-entry-budget/bad/scripts/queue-config.sh +6 -0
  792. package/payload/queue-kit/gate-tests/check-queue-entry-budget/good/TASK-QUEUE.md +35 -0
  793. package/payload/queue-kit/gate-tests/check-queue-entry-budget/good/scripts/queue-config.sh +6 -0
  794. package/payload/queue-kit/gate-tests/check-queue-hygiene/bad/TASK-QUEUE.md +17 -0
  795. package/payload/queue-kit/gate-tests/check-queue-hygiene/bad/expect.txt +1 -0
  796. package/payload/queue-kit/gate-tests/check-queue-hygiene/good/TASK-QUEUE.md +25 -0
  797. package/payload/queue-kit/gate-tests/check-queue-hygiene/good/expect.txt +1 -0
  798. package/payload/queue-kit/gate-tests/check-queue-prose-precondition/bad/TASK-QUEUE.md +15 -0
  799. package/payload/queue-kit/gate-tests/check-queue-prose-precondition/bad/expect.txt +1 -0
  800. package/payload/queue-kit/gate-tests/check-queue-prose-precondition/good/TASK-QUEUE.md +25 -0
  801. package/payload/queue-kit/gate-tests/check-queue-prose-precondition/good/expect.txt +1 -0
  802. package/payload/queue-kit/gate-tests/check-queue-sections/bad/TASK-QUEUE.md +13 -0
  803. package/payload/queue-kit/gate-tests/check-queue-sections/bad/expect.txt +1 -0
  804. package/payload/queue-kit/gate-tests/check-queue-sections/good/TASK-QUEUE.md +15 -0
  805. package/payload/queue-kit/gate-tests/check-queue-sections/good/expect.txt +1 -0
  806. package/payload/queue-kit/gate-tests/check-queue-slug-liveness/bad/TASK-QUEUE.md +17 -0
  807. package/payload/queue-kit/gate-tests/check-queue-slug-liveness/bad/docs/page.md +4 -0
  808. package/payload/queue-kit/gate-tests/check-queue-slug-liveness/bad/expect.txt +1 -0
  809. package/payload/queue-kit/gate-tests/check-queue-slug-liveness/bad/scripts/queue-config.sh +3 -0
  810. package/payload/queue-kit/gate-tests/check-queue-slug-liveness/good/TASK-QUEUE.md +19 -0
  811. package/payload/queue-kit/gate-tests/check-queue-slug-liveness/good/docs/page.md +5 -0
  812. package/payload/queue-kit/gate-tests/check-queue-slug-liveness/good/expect.txt +1 -0
  813. package/payload/queue-kit/gate-tests/check-queue-slug-liveness/good/scripts/queue-config.sh +3 -0
  814. package/payload/queue-kit/gate-tests/check-queue-wrap/bad/TASK-QUEUE.md +15 -0
  815. package/payload/queue-kit/gate-tests/check-queue-wrap/bad/expect.txt +1 -0
  816. package/payload/queue-kit/gate-tests/check-queue-wrap/good/TASK-QUEUE.md +25 -0
  817. package/payload/queue-kit/gate-tests/check-queue-wrap/good/expect.txt +1 -0
  818. package/payload/queue-kit/gate-tests/check-roadmap-fresh/bad/TASK-QUEUE.md +24 -0
  819. package/payload/queue-kit/gate-tests/check-roadmap-fresh/bad/args +5 -0
  820. package/payload/queue-kit/gate-tests/check-roadmap-fresh/bad/emit.txt +8 -0
  821. package/payload/queue-kit/gate-tests/check-roadmap-fresh/bad/expect.txt +1 -0
  822. package/payload/queue-kit/gate-tests/check-roadmap-fresh/bad/projection.txt +16 -0
  823. package/payload/queue-kit/gate-tests/check-roadmap-fresh/bad/scripts/queue-config.sh +6 -0
  824. package/payload/queue-kit/gate-tests/check-roadmap-fresh/good/TASK-QUEUE.md +22 -0
  825. package/payload/queue-kit/gate-tests/check-roadmap-fresh/good/args +5 -0
  826. package/payload/queue-kit/gate-tests/check-roadmap-fresh/good/emit.txt +7 -0
  827. package/payload/queue-kit/gate-tests/check-roadmap-fresh/good/expect.txt +1 -0
  828. package/payload/queue-kit/gate-tests/check-roadmap-fresh/good/projection.txt +16 -0
  829. package/payload/queue-kit/gate-tests/check-roadmap-fresh/good/scripts/queue-config.sh +6 -0
  830. package/payload/queue-kit/gate-tests/check-tag-lead-line/bad/TASK-QUEUE.md +25 -0
  831. package/payload/queue-kit/gate-tests/check-tag-lead-line/bad/expect.txt +2 -0
  832. package/payload/queue-kit/gate-tests/check-tag-lead-line/good/TASK-QUEUE.md +30 -0
  833. package/payload/queue-kit/gate-tests/check-tag-lead-line/good/expect.txt +1 -0
  834. package/payload/queue-kit/gate-tests/check-task-names/bad/TASK-QUEUE.md +18 -0
  835. package/payload/queue-kit/gate-tests/check-task-names/bad/expect.txt +1 -0
  836. package/payload/queue-kit/gate-tests/check-task-names/good/TASK-QUEUE.md +25 -0
  837. package/payload/queue-kit/gate-tests/check-task-names/good/expect.txt +1 -0
  838. package/payload/queue-kit/gate-tests/queue-index.test.sh +159 -0
  839. package/payload/queue-kit/gate-tests/roadmap.test.sh +197 -0
  840. package/payload/queue-kit/lib/queue.sh +193 -0
  841. package/payload/queue-kit/smoke/install.sh +22 -0
  842. package/payload/queue-kit/smoke/violation.sh +8 -0
  843. package/payload/queue-kit/templates/TASK-QUEUE.md +43 -0
  844. package/payload/queue-kit/templates/queue-config.sh +2 -0
  845. package/payload/site-kit/README.md +61 -0
  846. package/payload/site-kit/SPEC.md +269 -0
  847. package/payload/site-kit/checks/check-docs-cname-parity.sh +80 -0
  848. package/payload/site-kit/checks/check-docs-render-fidelity.sh +167 -0
  849. package/payload/site-kit/gate-tests/check-docs-cname-parity/bad/args +4 -0
  850. package/payload/site-kit/gate-tests/check-docs-cname-parity/bad/expect.txt +1 -0
  851. package/payload/site-kit/gate-tests/check-docs-cname-parity/bad/site-config.sh +7 -0
  852. package/payload/site-kit/gate-tests/check-docs-cname-parity/bad/tree/CNAME +1 -0
  853. package/payload/site-kit/gate-tests/check-docs-cname-parity/bad/tree/README.md +5 -0
  854. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/args +5 -0
  855. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/expect.txt +1 -0
  856. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/site-config.sh +7 -0
  857. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/tree/CNAME +1 -0
  858. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/tree/docs/posts/2026-01-01-legacy.md +4 -0
  859. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/tree/index.md +4 -0
  860. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/tree/pkg/gate-tests/fixture.md +5 -0
  861. package/payload/site-kit/gate-tests/check-docs-render-fidelity/bad/args +8 -0
  862. package/payload/site-kit/gate-tests/check-docs-render-fidelity/bad/expect.txt +1 -0
  863. package/payload/site-kit/gate-tests/check-docs-render-fidelity/bad/tree/docs/install.md +38 -0
  864. package/payload/site-kit/gate-tests/check-docs-render-fidelity/good/args +6 -0
  865. package/payload/site-kit/gate-tests/check-docs-render-fidelity/good/expect.txt +1 -0
  866. package/payload/site-kit/gate-tests/check-docs-render-fidelity/good/tree/docs/install.md +35 -0
  867. package/payload/site-kit/gate-tests/check-docs-render-fidelity-foreign.test.sh +87 -0
  868. package/payload/site-kit/gate-tests/check-docs-render-fidelity-span.test.sh +80 -0
  869. package/payload/site-kit/gate-tests/check-docs-render-fidelity-table.test.sh +90 -0
  870. package/payload/site-kit/lib/site.sh +29 -0
  871. package/payload/site-kit/smoke/install.sh +26 -0
  872. package/payload/site-kit/smoke/violation.sh +20 -0
  873. package/payload/site-kit/templates/site-health.yml +164 -0
  874. package/profiles.list +53 -0
@@ -0,0 +1,1410 @@
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 tag is a **checksum on the promotion move**, not a second source of the
83
+ state its section already carries. Its redundancy is the mechanism: a
84
+ promotion crosses a section boundary *and* swaps the tag, so
85
+ forbidden-in-active catches a move that dropped the swap and
86
+ `[spec:]`-in-design-pending catches a swap that dropped the move. That is
87
+ also the test a further tag has to pass: a tag marking a move that crosses no
88
+ pending/ready boundary adds a state name without adding a caught error class,
89
+ and is refused.
90
+
91
+ The feature/debt litmus is **new names**: a task that adds any name to a
92
+ governed surface — a script, a config knob, a file or directory convention,
93
+ a tag, a contract another component must honor — is a feature and needs the
94
+ amendment, however small the diff; debt converges behavior on names the
95
+ spec already carries. The tell for misfiling: a queue entry whose body
96
+ carries more than a few lines of design ruling is an amendment inlined
97
+ where this gate cannot see it — the entry format has no home for causal
98
+ completeness, and the rationale evaporates when the done section is
99
+ cleared. The gate cannot decide which section a task belongs in (that is
100
+ the semantic residue); it enforces the pairing once the section is chosen,
101
+ so the litmus runs at filing time, in the scope skill's triage.
102
+
103
+ ### The causal-completeness check
104
+
105
+ Before an amendment is ready, every new state, event, and interface it
106
+ introduces passes four points:
107
+
108
+ 1. **Producer named and reachable** — what code path, call, or timer
109
+ triggers it; a named producer whose enabling config no deployed
110
+ configuration actually sets is dead everywhere but unit tests.
111
+ 2. **Consumer named** — what component receives it, by what mechanism
112
+ (which stream, which call, which poll).
113
+ 3. **Existing integration sections updated** — any affected spec section
114
+ describing the prior flow is updated in the amendment itself.
115
+ 4. **Every field has a named reader** — for each field on a new message,
116
+ name the consumer that reads it and the transition where it is read; a
117
+ field with no reader is removed, and a field read at one transition is
118
+ not populated at others.
119
+
120
+ A cross-component causal gap that surfaces during build is not a deferred
121
+ TODO: stop, resolve it that session, update the spec before resuming.
122
+ lifecycle-kit's scope/build skill templates carry these hooks; canon-kit
123
+ supplies the checklist they invoke and the gate behind the promotion rule.
124
+
125
+ ### Merging an amendment (on task completion)
126
+
127
+ 1. Read the canonical spec fully, then the amendment.
128
+ 2. Integrate — do not append: each addition lands in its proper section,
129
+ and the merged spec reads as one coherent document a reader who never
130
+ saw the amendment can use alone. The merge separates by tier: design
131
+ rationale relocates into the spec's prose (its permanent home), and any
132
+ embedded wire-delta becomes a citation to the now-existing contract
133
+ file — the amendment's exemption is file-scoped, so once step 3 deletes
134
+ the file `check-spec-embedded-source` re-arms and a kept embed goes red.
135
+ 3. Delete the amendment file; verify none remain for the component.
136
+ 4. Move the queue entry to `## Done`, dropping its `[spec:]` tag — the
137
+ amendment it referenced is gone, and `check-amendment-queue` requires
138
+ every `[spec:]` ref to resolve to a file on disk.
139
+ 5. Propagate removals (grep every spec for names the change retired), file
140
+ discovered gaps as debt tasks, and commit the merge with the work.
141
+
142
+ The shipped amendment template ends in a Definition-of-Done checklist that
143
+ includes causal completeness, merged-with-no-information-lost, the
144
+ file-deleted assertions, and gap filing.
145
+
146
+ ## Content tiering — the star topology
147
+
148
+ Every governed prose surface owns exactly one content tier and *points to*
149
+ — never restates — a fact owned by another surface. Which surfaces exist
150
+ and what each owns is the consumer's tier contract (each consumer's is its
151
+ own instance); the kit's rules are the topology itself:
152
+
153
+ - **One owner per fact.** A parallel copy of a gated fact is the defect —
154
+ a second source no gate reads, drifting silently. The fix keeps each
155
+ surface's tier and replaces the foreign-tier slab with a pointer.
156
+ - **Definitions have one home.** A canonical bold-lead-in definition of a
157
+ glossary term belongs only to the glossary; another surface may *use*
158
+ the term, explain *why* it exists, or carry its local mechanism — never
159
+ the definition (`check-surface-duplication`, with per-site valves for a
160
+ surface that legitimately introduces a concept).
161
+ - **Quantitative literals are code-owned.** A count or enumerated set
162
+ transcribed into prose is a parallel copy; cite the owning source
163
+ instead (`check-manifest-count` bans a bare cardinal quantifying a
164
+ governed collection in a manifest — the collection is the count's owner).
165
+ A literal stays verbatim only when load-bearing, and then only
166
+ gate-coupled. A **user-facing** claim takes the same treatment when a reader
167
+ acts on it: `check-install-claim` gives the primary-install-path claim one
168
+ declared owner and holds every governed install section to it, so the topology
169
+ reaches beyond the internal facts the rules above are stated over.
170
+ A path's **version-control tracking status** is code-owned in
171
+ the same sense a count is — git owns it — so prose states the rule and
172
+ `check-tracking-claim` verifies it, rather than prose transcribing membership.
173
+ - **Comments cite, never restate.** The code surface is a tier too: a
174
+ full-line comment on a governed source is a machine or reason directive,
175
+ rides the contiguous run a directive opens, or is exempt — design
176
+ rationale lives in the owning SPEC section, not re-derived in a comment
177
+ block; the pointer names where the why lives and couples the code to it —
178
+ never relocating the why into the comment (`check-comment-tier`; the
179
+ FP-prone trailing-comment judgment stays a review tripwire).
180
+ - **Honest mechanizability.** Only the structural sub-rules gate (banned
181
+ headings, fence density, duplicate definitions, verbatim copies,
182
+ temporal-narration markers, restated collection totals); the core
183
+ judgment — is this sentence a definition or a narration, a why or a
184
+ mechanism — is FP-prone and stays a review tripwire, explicitly not a
185
+ blocking gate.
186
+
187
+ ## Layout and configuration
188
+
189
+ The kit is vendored beside gate-sdk (conventionally at `canon-kit/`); its
190
+ gates are registered in the consumer's `gates.list` by name — each
191
+ where its surface exists (a consumer with no glossary does not register
192
+ `check-surface-duplication`) — and resolve through gate-sdk's multi-kit
193
+ path.
194
+
195
+ Brand tokens and generic vocabulary sit on opposite sides of a seam. Brand
196
+ tokens carry the kit's identity and move with the kit name: the kit dir
197
+ (`canon-kit/`), the `CANON_KIT_` env-knob prefix, the discovered config
198
+ filename (`canon-config.sh`, the `<kit>-config.sh` convention), and the
199
+ docs-site page dir (`docs/canon-kit/`). Generic vocabulary names the spec
200
+ *artifact* discipline rather than the brand and is fixed regardless of the
201
+ kit's name: the `SPEC.md` canonical-spec filename, the `SPEC-*.md` amendment
202
+ glob, the `spec:` and `contract:` source directives, the `[spec:]` and
203
+ `[design-pending]` queue tags, the `check-spec-*` gate names, and the internal
204
+ `lib/spec.sh` loader (where "spec" names the discipline). The consumer gate
205
+ `check-kit-ref-liveness` (a check-skeleton copy in `scripts/` — the
206
+ dangling-reference hazard is a kit author's, so it is not templated into
207
+ gate-sdk) holds the brand-token side honest tree-wide: every slash- or
208
+ line-anchored `<name>-kit` / `gate-sdk` path segment must name a
209
+ `gate_kit_roots` dir, and every live-prefix kit knob must resolve to a tracked
210
+ kit knob (check-docs-cmd's resolver, reused so the non-uniform knob-prefix map
211
+ has one home). It valves the surfaces that legitimately name design-ahead or
212
+ frozen brands — `gate-tests/` fixture bodies, `docs/posts/*`, the generated
213
+ trajectory data, `SPEC-*.md` amendments, and the queue — so a rename cannot
214
+ leave a dangle without turning a gate red.
215
+
216
+ Config follows queue-kit's pattern: copy `templates/canon-config.sh` into
217
+ the gates dir as `canon-config.sh` (or point `CANON_KIT_CONFIG_FILE`
218
+ elsewhere) and override any knob; defaults fill what the consumer left
219
+ unset, and the loader exits 2 on a malformed config. Knobs:
220
+
221
+ - `CANON_KIT_SPEC_NAME` — canonical spec filename, default `SPEC.md`.
222
+ - `CANON_KIT_AMENDMENT_GLOB` — default `SPEC-*.md`.
223
+ - `CANON_KIT_QUEUE_FILE` — default `${GATE_SDK_QUEUE_FILE:-TASK-QUEUE.md}`.
224
+ - `CANON_KIT_FEATURE_SECTIONS` — array, default `("New Features")`: active
225
+ sections whose entries require `[spec:]`.
226
+ - `CANON_KIT_ACTIVE_SECTIONS` — array, default
227
+ `("New Features" "Technical Debt")`: sections where `[design-pending]` is a
228
+ violation.
229
+ - `CANON_KIT_DEFERRED_SECTION` — default `Deferred`: the section whose
230
+ every entry requires `[design-pending]`.
231
+ - `CANON_KIT_ICEBOX_SECTION` — scalar, default **empty**: the second
232
+ design-pending section, queue-kit's optional icebox tier. Empty means the
233
+ set is the deferred section alone. Naming the deferred section is malformed
234
+ config. What generalizes here is the section **set**, not the tag set — no
235
+ icebox-specific tag exists or is wanted.
236
+ - `CANON_KIT_DOD_HEADING` — default `Definition of Done`;
237
+ `CANON_KIT_DOD_MODE` — `exactly-one` (the default) or `at-most-one`
238
+ (a reference-spec corpus like this repo's kits carries no DoD).
239
+ - `CANON_KIT_SCAN_KIT_ROOTS` — `0` (default) or `1`. At `0` the shared finders
240
+ skip vendored kit roots (`gate_kit_roots`): a kit's `SPEC.md`/`SPEC-*.md` is
241
+ a dependency's documentation, not governed content, so the `exactly-one`
242
+ default holds out of the box on a tree that merely vendored the kits beside
243
+ gate-sdk. Set `1` when the kit SPECs are the consumer's own first-party
244
+ content (this repo does, and keeps `at-most-one` for them).
245
+ - `CANON_KIT_BANNED_HEADINGS` — array, default
246
+ `("Directory Structure" "Public API" "Cargo.toml Dependencies")`;
247
+ `CANON_KIT_DERIVABLE_DENSITY` — default `60` (percent fenced);
248
+ `CANON_KIT_DERIVABLE_POINTER_REGEX` — the index-pointer marker that exempts
249
+ a shed section, default `pub-index|proto-index` (consumer index tooling).
250
+ - `CANON_KIT_EMBED_THRESHOLD` / `CANON_KIT_EMBED_MINLINES` — defaults `0.70`
251
+ / `8`; `CANON_KIT_EMBED_LANGS` — the scanned fence-language → source
252
+ mapping, one `kind|fence-alias,…|file-glob,…` entry per language family,
253
+ default = the bundled list; `CANON_KIT_EMBED_ILLUSTRATIVE` — fences
254
+ illustrative-by-default, default `(json)`; `CANON_KIT_EMBED_WIRE_KIND` — the
255
+ one fence an amendment may embed as a not-yet-merged contract delta,
256
+ default `proto`.
257
+ - `CANON_KIT_GLOSSARY_FILE` — default `GLOSSARY.md`;
258
+ `CANON_KIT_DUP_SURFACES` — array of surfaces scanned for foreign
259
+ definitions, default `(VISION.md)` plus every component spec.
260
+ - `CANON_KIT_MANIFEST_FILES` — array of globs, default empty ⇒ derive the
261
+ manifest set (canonical specs, `README.md` at any depth, `CLAUDE.md`);
262
+ `CANON_KIT_PROSE_SURFACE_GLOBS` — array of candidate globs, default empty:
263
+ each matched file joins the manifest set **iff it is slot-free** (no
264
+ lifecycle-kit binding slot `*<name: …>*`, no `CONSUMER BINDING` header), so
265
+ slot-free kit-template markdown and agent definitions come under the manifest
266
+ doc gates while slot-bearing surfaces self-exclude — which surfaces a consumer
267
+ governs is their config, the discriminator is kit mechanism (§lib/spec.sh).
268
+ This repo sets `("*/templates/*.md" ".claude/agents/*.md")`.
269
+ `CANON_KIT_TEMPORAL_MARKERS` — the temporal-narration marker set scanned by
270
+ `check-manifest-temporal`, default a generic-English list (`previously`,
271
+ `formerly`, `renamed from`, …), matched case-insensitively;
272
+ `CANON_KIT_TEMPORAL_EXEMPT_SECTIONS` — array of heading names whose whole
273
+ section is exempt, default empty (this repo sets `Out of scope`).
274
+ - `CANON_KIT_MDREF_EXCLUDE` — array of globs, default empty: manifest-set docs
275
+ `check-md-refs` skips (a consumer's generated documentation whose links a
276
+ build tool owns).
277
+ - `CANON_KIT_COUNT_COLLECTIONS` — array of collection-noun plurals
278
+ `check-manifest-count` treats as growing governed sets, default
279
+ `("gates" "meta-gates" "checks" "kits" "stages" "rules" "KPIs")` (a consumer
280
+ appends its own governed plurals); `CANON_KIT_COUNT_WEDGE_WORDS` — how many
281
+ words may sit between the cardinal and the noun, default `2`;
282
+ `CANON_KIT_COUNT_ALLOWED_PHRASES` — exact-phrase allowlist for fixed named
283
+ sets a doc may cite inline, default empty (a consumer names its own fixed
284
+ sets, and only a phrase whose noun it governs needs the valve).
285
+ - `CANON_KIT_ENUM_SETS_CMD` — a consumer command emitting the governed sets
286
+ `check-prose-enum` holds, one `<set-name>`⇥`<member>` line per member,
287
+ default empty ⇒ clean skip (no declared sets). This repo sets
288
+ `bash scripts/enum-sets.sh`, which derives the queue tag sets from
289
+ queue-kit's own parser rather than restating them.
290
+ - `CANON_KIT_INSTALL_TRANSPORTS_CMD` — a consumer command emitting the install
291
+ transports `check-install-claim` holds, one `<transport-id>`⇥`<ERE>` line per
292
+ transport, default empty ⇒ clean skip. `CANON_KIT_INSTALL_SECTION_RE` — an ERE
293
+ matched against `##`-or-deeper heading text to select the sections that gate
294
+ scans, default empty ⇒ clean skip; either knob left empty skips the whole gate,
295
+ since neither assertion has a vocabulary to judge against without the other.
296
+ `CANON_KIT_INSTALL_CLAIM_EXCLUDE` — array of globs dropped from that gate's
297
+ scanned set on top of `CANON_KIT_MDREF_EXCLUDE`, default empty. A transport
298
+ vocabulary is one project's distribution model, so no spelling of it ships as a
299
+ kit literal (the provenance seam). This repo sets
300
+ `bash scripts/install-transports.sh`, `^(Quick start|Install)`, and
301
+ `("docs/posts/*")`.
302
+ - `CANON_KIT_COMMENT_MACHINE` / `CANON_KIT_COMMENT_REASON` — arrays, default
303
+ empty: extra directive prefixes appended to the built-in kit-mechanism
304
+ roster (a consumer's product vocabulary). `CANON_KIT_COMMENT_SURFACE` —
305
+ array of globs, default empty ⇒ derive: shell sources under the root (kit
306
+ roots per `CANON_KIT_SCAN_KIT_ROOTS`, `templates/` pruned) plus the
307
+ `${GATE_SDK_WORKFLOW_DIR:-.workflow}/*.txt` state files.
308
+ `CANON_KIT_COMMENT_POSITIONAL` — the language construct roster for
309
+ positional rescue, default empty (the kit is language-agnostic; a Rust
310
+ consumer sets `.unwrap( .expect( unsafe #[allow(`).
311
+ `CANON_KIT_COMMENT_WHITELIST` — array of globs, default empty: the
312
+ consumer's not-yet-swept sources, its array tagged `# exception-list:`
313
+ with a per-entry `# until: <drain-task>`. `CANON_KIT_COMMENT_RUN_CAP` —
314
+ positive integer, default 3: total physical comment lines a directive
315
+ blesses (its own line plus continuations, blank `#` lines counted).
316
+ - `CANON_KIT_PROSE_TELL_GLOBS` — array of repo-root-relative globs, default
317
+ empty ⇒ nothing scanned, a clean pass: the reader-facing prose surfaces
318
+ `check-prose-tells` reads. Which surfaces carry authored prose is the
319
+ consumer's editorial posture, and per the provenance seam it never lands as a
320
+ kit literal. The threshold knobs, each read by `check-prose-tells` alone:
321
+ `CANON_KIT_PROSE_TELL_EMDASH_MAX` — em-dashes a paragraph may carry, default
322
+ `2`; `CANON_KIT_PROSE_TELL_CONTRAST_MAX` — "not X, it's Y" contrast turns a
323
+ section may carry, default `1`; `CANON_KIT_PROSE_TELL_RHYTHM_MIN_SENTENCES` —
324
+ sentences a paragraph needs before its rhythm is judged, default `4`;
325
+ `CANON_KIT_PROSE_TELL_RHYTHM_CV_MIN` — the word-count coefficient-of-variation
326
+ floor beneath which a paragraph reads as metronomic, default `0.25`;
327
+ `CANON_KIT_PROSE_TELL_TRICOLON_MAX` — "A, B, and C" triples a section may
328
+ carry, default `2`. `CANON_KIT_PROSE_TELL_PHRASES` — array of throat-clearing
329
+ phrases matched case-insensitively, default a bundled generic-English set
330
+ (`It's worth noting`, `That said`, …); `CANON_KIT_PROSE_TELL_ABBR_ALLOW` —
331
+ array of abbreviations exempt from the undefined-abbreviation tell, default a
332
+ bundled universal set (`API`, `CLI`, `URL`, …). A consumer extends either
333
+ array with its own vocabulary through the matching `_EXTRA` knob —
334
+ `CANON_KIT_PROSE_TELL_PHRASES_EXTRA` and
335
+ `CANON_KIT_PROSE_TELL_ABBR_ALLOW_EXTRA`, both default empty — which the lib
336
+ unions onto the base after the base defaults resolve: the effective set is
337
+ base plus extra. Extension therefore costs one token, never a restatement of
338
+ the bundled default that would silently diverge from it. Assigning a base
339
+ array keeps its replace semantics, and that is the narrowing valve: a consumer
340
+ wanting a bundled member *gone* replaces the base array. Generic English is
341
+ kit-shippable; a consumer's own vocabulary never becomes a kit literal (the
342
+ provenance seam).
343
+
344
+ Cross-kit note: the section knobs carry the same defaults as queue-kit's;
345
+ the knobs are independent (either kit runs without the other), so a
346
+ consumer renaming its sections sets both — and the icebox section name spans
347
+ every kit that reads the tier on that same shape (queue-kit's
348
+ `QUEUE_KIT_ICEBOX_SECTION`, this knob, drift-kit's `DRIFT_KIT_ICEBOX_SECTION`),
349
+ 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 -->
350
+ (`[design-pending]`, `[spec:]`, `vision-introduces` / `spec-introduces`,
351
+ `spec-embedded-source-exempt: <reason>`) are mechanism, not config.
352
+
353
+ ## Per-component contracts
354
+
355
+ ### lib/spec.sh
356
+
357
+ The sourced config loader plus shared adapters — values and adapters only,
358
+ never gate structure. It centralizes the surfaces and vocabularies the
359
+ spec-scanning gates share, so a rule enters once and every sibling matches the
360
+ same shapes:
361
+
362
+ - **Section grammar and queue resolution:** the section-regex builders the
363
+ queue-facing gates use (queue-kit's rule — both sides of a section boundary
364
+ must parse identically), and the one queue walk that emits a live slug for a
365
+ bold lead-in bullet in an active or **design-pending** section — deferred
366
+ plus a configured icebox, built as one regex so the tag rule and the walk can
367
+ never disagree on the set — and a done slug for a bare-slug bullet outside
368
+ them; the single grammar `check-todo-task-liveness`
369
+ and `check-deprecation-task` resolve a `task: <slug>` binding through (each
370
+ caller builds its own live/done map and fail-closes on the walk status).
371
+ - **Finders:** the canonical-spec / amendment finders the spec-scanning gates
372
+ share, and the manifest-set finder the narration-gate family shares —
373
+ canonical specs plus `README.md`/`CLAUDE.md`, amendments excluded — so its
374
+ members read one identical set. The finder then folds in each
375
+ `CANON_KIT_PROSE_SURFACE_GLOBS` candidate that is **slot-free**: it bears no
376
+ lifecycle-kit binding slot (`*<name: …>*`, slot-name `[a-z][a-z0-9-]*` — the
377
+ grammar lifecycle-kit/SPEC.md §templates/stages/ owns) and no
378
+ `CONSUMER BINDING` header. A slot-bearing candidate is silently excluded — a template still
379
+ awaiting binding is a placeholder, not finished prose, and its coverage stays
380
+ the shim/binding gates (§Layout and configuration states the knob). The
381
+ canonical-spec / amendment finders skip a
382
+ `templates/` skeleton (a copyable stub, not governed content — the same
383
+ rationale as the gate-tests prune) and, unless `CANON_KIT_SCAN_KIT_ROOTS=1`,
384
+ any vendored kit root under the scan root (a dependency's docs; an ancestor
385
+ kit root — the case when a kit's own fixture dir is the scan root — never
386
+ prunes).
387
+ - **The count adapter** the restated-total gates share, so a consumer's
388
+ `CANON_KIT_COUNT_COLLECTIONS` vocabulary enters once and every such gate
389
+ matches the same total shapes — including a total whose cardinal and noun
390
+ straddle a prose wrap, reported at the cardinal's physical line. The boundary
391
+ rule and the mechanical exemptions live in one shared fragment, so no sibling
392
+ drifts from another in what it counts as a total (§check-manifest-count).
393
+ - **The enum sets** arrive through the consumer's `CANON_KIT_ENUM_SETS_CMD`,
394
+ validated and fail-closing (exit 2) on a command error or an unparsable line
395
+ (§check-prose-enum).
396
+ - **The install transports** arrive the same way, through
397
+ `CANON_KIT_INSTALL_TRANSPORTS_CMD`, and `spec_install_transports` carries the
398
+ same fail-closed contract its enum-set sibling does — a command error, an
399
+ unparsable line, an id that is not slug-shaped, or a repeated id is exit 2. The
400
+ duplicate check is what a bare emit grammar cannot express and the gate needs:
401
+ two lines claiming one id would give a transport two patterns and make its
402
+ match order arbitrary (§check-install-claim).
403
+ - **The comment-surface adapters:** the comment gates read *different* surfaces.
404
+ `check-spec-pointer` scans the template-pruned surface — a template's `spec:`
405
+ line is an unresolvable-by-design placeholder (§check-spec-pointer);
406
+ `check-comment-tier` scans the with-templates surface — a copied-out
407
+ template's `spec:` pointer resolves against the vendored kit path (kit SPECs
408
+ travel with the vendor-whole install), so its comments are governed like any
409
+ source (§check-comment-tier). Which finder a gate uses is kit contract, not
410
+ consumer config — a consumer wanting the old blanket exemption shadows the
411
+ gate.
412
+ - **The default-statement grammar** both knob gates share, so the rule for
413
+ what reads as a stated default has one home. `sk_literal_at` recognizes the
414
+ value literal opening a window (a backticked non-knob string, a quoted string,
415
+ or a number) and `sk_default_literal` returns the literal the word "default"
416
+ binds; a caller-supplied `sk_is_knobname` keeps a bare knob name from reading
417
+ as a value. `check-knob-citation` reads it to reject a restated value in prose;
418
+ `check-knob-default-coupling` reads it to confirm the SPEC states the source's
419
+ literal (§check-knob-default-coupling).
420
+
421
+ ### check-amendment-queue
422
+
423
+ Invariant: the bidirectional rule holds — (a) no feature-section entry
424
+ without `[spec:]`, no `[design-pending]` anywhere in the active sections
425
+ (entries or prose; a prose mention masks the tag's absence), and no
426
+ `[spec:]`-tagged entry in an active non-feature section (a spec-ready
427
+ entry is misfiled there — it belongs in a feature section); (b) every entry in
428
+ a **design-pending section** carries `[design-pending]`, and one already
429
+ carrying `[spec:]` must be promoted; (c) every amendment on disk pairs
430
+ with a `[spec:]` queue entry and every `[spec:]` ref resolves to a file.
431
+
432
+ Calibration: a ref is a bare amendment basename (searched tree-wide) or a
433
+ repo-relative path (resolved directly — the generalization that lets a
434
+ consumer point a task at any design artifact, e.g. this repo's kit-SPEC
435
+ drafts). Sub-bullets and prose notes are outside the entry grammar;
436
+ `precommit` tier.
437
+
438
+ Coverage limit, stated because the tag's section-wide reach invites the
439
+ stronger claim: any heading that is not a feature, active, or deferred
440
+ section classifies as `other` and skips every arm, so the **done section is
441
+ an exempt population** — an entry moved out of design-pending into it still
442
+ carrying the tag reds nowhere, and queue-kit's lead-line gate misses it too
443
+ (its scanned surface is the task sections alone). In practice the done
444
+ grammar is a bare slug line, so the tag is dropped by that grammar rather
445
+ than by a gate. The guard is total over the *promotion* moves it exists to
446
+ catch — design-pending → an active section — and silent on the disposition
447
+ move.
448
+
449
+ ### check-spec-dod-singleton
450
+
451
+ Invariant: no canonical spec carries the configured Definition-of-Done
452
+ heading more than once (a duplicate checklist is the two-sources defect on
453
+ the completion contract); under `exactly-one` mode a spec with none is
454
+ also flagged.
455
+
456
+ Calibration: heading match is level-insensitive within `##`–`####`;
457
+ `at-most-one` exists because a reference-spec corpus legitimately has no
458
+ DoD. The good/bad pair covers the DoD count; `check-spec-dod-singleton.test.sh`
459
+ covers the finder's kit-root scoping — a DoD-less vendored kit `SPEC.md` is
460
+ pruned by default (so `exactly-one` holds on a vendored tree) and re-included
461
+ by `CANON_KIT_SCAN_KIT_ROOTS=1`. `align-only` tier.
462
+
463
+ ### check-spec-derivable-section
464
+
465
+ Invariant: no canonical-spec section under a banned heading (the
466
+ configured code-derivable set) whose body exceeds the density budget in
467
+ fenced lines — such a section is a code dump that drifts; it sheds to a
468
+ one-line index pointer (which is exempt).
469
+
470
+ Calibration: density counts non-blank lines; the heading set and budget
471
+ are config because what is derivable depends on the consumer's index
472
+ tooling. `align-only` tier.
473
+
474
+ ### check-spec-embedded-source
475
+
476
+ Invariant: no fenced block in a canonical spec verbatim-copies a tracked
477
+ source file above the overlap threshold — cite the path instead. Overlap
478
+ detection needs no author opt-in; the two valves are the amendment
479
+ wire-delta exemption — an amendment is a short-lived design-to-code bridge,
480
+ so a not-yet-cite-able wire contract legitimately embeds there until merge
481
+ promotes it to a file the canonical spec cites — and the per-site
482
+ `spec-embedded-source-exempt: <reason>` marker.
483
+
484
+ Calibration: blocks shorter than `CANON_KIT_EMBED_MINLINES` are ignored;
485
+ languages in `CANON_KIT_EMBED_ILLUSTRATIVE` are skipped by default; the
486
+ threshold is calibrated against real specs, not synthetic fixtures.
487
+ `precommit` tier.
488
+
489
+ ### check-manifest-temporal
490
+
491
+ Invariant: no temporal-narration marker in governed manifest prose outside an
492
+ exempt site. A manifest states current behavior only — history is derivable
493
+ from git, and a `formerly…` line is standing context cost documenting the old
494
+ cost, taxing every session that reads it. This gate mechanizes the lexical
495
+ share of that judgment; context-kit's close-stage brevity pass keeps the
496
+ semantic residue (*is this sentence about the past?*); a by-eye
497
+ narration-marker KPI is superseded by this gate (drift-kit/SPEC.md
498
+ §Out of scope).
499
+
500
+ The scanned set is the shared `spec_manifest_files` finder (§lib/spec.sh):
501
+ canonical specs, `README.md` at any depth, and `CLAUDE.md`; amendments are
502
+ excluded by construction (a transition artifact describes change — that is its
503
+ nature). Markers are `CANON_KIT_TEMPORAL_MARKERS`, matched case-insensitively;
504
+ fenced code blocks are skipped and a marker inside an inline-code span is a
505
+ meta-reference, not narration — so a gate-output example or this section's own
506
+ vocabulary may name one. Three valves suppress a legitimately past line: a
507
+ per-site `manifest-temporal-exempt: <reason>` comment on the line or the one
508
+ above; `CANON_KIT_TEMPORAL_EXEMPT_SECTIONS` — heading names whose whole
509
+ section (subsections included) is exempt, this repo's config naming
510
+ `Out of scope` (a deliberate-absence ruling may narrate what the kit
511
+ excludes); and `CANON_KIT_TEMPORAL_EXEMPT_PATHS` — path
512
+ globs whose whole file is exempt, for an immutable dated-narrative surface a
513
+ heading name cannot address (this repo's config naming `docs/posts/*`, the
514
+ dated announcement posts, which take link and command resolution but not
515
+ narration governance). Producer: the generated pre-commit hook /
516
+ `run-gates.sh`; consumer: the committing operator via the output contract; each
517
+ marker hit is read at the single scan transition (file, line, marker in the
518
+ message), no persistent state. Fail-closed on an unreadable manifest.
519
+
520
+ Calibration: the marker set is tuned against this repo as the FP corpus — bare
521
+ `used to` is excluded (it collides with instrumental "used to build/filter").
522
+ At build every hit is dispositioned: reword (preferred — narration is standing
523
+ cost), section-exempt (provenance), or site-exempt with reason. `precommit`
524
+ tier.
525
+
526
+ ### check-manifest-count
527
+
528
+ Invariant: no bare cardinal quantifying a governed collection noun
529
+ in manifest prose outside an exempt site. A pinned total for a *growing*
530
+ collection — `six gates`, `seven meta-gates` — is a second source no gate reads:
531
+ the count's owner is the collection itself (`gates.list`, a `checks/` dir, the
532
+ stages config), and a restated total drifts the moment the collection grows.
533
+ Ban, don't validate — a validating gate carries
534
+ the standing token cost context-kit's brevity machinery rejects plus FP-prone
535
+ entity mapping; a lexical tripwire eliminates the copy. The motivating find: this
536
+ repo landed one gate and left the same total in four disagreeing copies (across
537
+ two READMEs and a SPEC), caught only by close-stage review.
538
+
539
+ The scanned set is the shared manifest-set finder (§lib/spec.sh) —
540
+ canonical specs, `README.md`, `CLAUDE.md`; amendments excluded, fenced blocks
541
+ skipped, an inline-code cardinal a meta-reference (so this section may name its
542
+ own examples). Both the grammar and the matcher come from the shared count
543
+ adapter, and the prose walk is the shared manifest-prose driver (§lib/spec.sh),
544
+ so this gate, its `check-prose-enum` sibling, and its comment-tier cousin
545
+ read one vocabulary and one exemption behavior, and a total wrapped across a
546
+ prose break is caught and reported at its first physical line; a blank line, a
547
+ fence, and a `manifest-count-exempt:` site each end the paragraph — an exempted
548
+ line cannot join its neighbours into a total. The cardinal
549
+ grammar is digit sequences and the spelled
550
+ `two`…`twelve`, case-insensitive; `one` is deliberately outside it — singleton and
551
+ cardinality-rule idioms ("one owner per fact", "one iteration per kit") are
552
+ invariants, not totals. Collection nouns are `CANON_KIT_COUNT_COLLECTIONS`
553
+ (default the plurals the kits themselves grow: `gates`, `meta-gates`, `checks`,
554
+ `kits`, `stages`, `rules`, `KPIs`) — the one place consumer vocabulary enters,
555
+ and it enters as config.
556
+
557
+ Two match shapes carry the cardinal to the noun: the *quantifier* shape, which
558
+ allows up to `CANON_KIT_COUNT_WEDGE_WORDS` (default `2`) modifiers wedged between
559
+ cardinal and noun (so `nine generic rules` pins a total as surely as the
560
+ adjacent `six gates`, adjacency being the zero-wedge case), and the
561
+ *noun-then-range* shape (`rules 1-8`), which pins both endpoints of an ordered
562
+ collection and rots on every append. The exempt contexts an author writes into:
563
+ a threshold or comparator on the same line (a bound is a rule, not a total); the
564
+ `all but <cardinal>` partition idiom; a partitive marker (`of`, `out of`) on
565
+ either side of the match (in `three of the twelve gates` neither cardinal is a
566
+ restated total); `CANON_KIT_COUNT_ALLOWED_PHRASES`, an exact-phrase allowlist for
567
+ fixed named sets a doc legitimately enumerates (default empty — fixed-set naming
568
+ is consumer judgment, config not mechanism, biting only on a phrase whose noun
569
+ the consumer governs); and the per-site `manifest-count-exempt: <reason>` marker
570
+ on the line or the one above. The exact operator and phrase tokens each context
571
+ recognizes are the check's own regex, generic-English mechanism rather than
572
+ config.
573
+ Producer: the generated pre-commit hook / `run-gates.sh`; consumer: the
574
+ committing operator via the output contract; each hit read at the single scan
575
+ transition (file, line, matched span in the message), no persistent state.
576
+ Fail-closed on an unreadable manifest.
577
+
578
+ Calibration shares the sibling's FP corpus and procedure
579
+ (§check-manifest-temporal): the default noun list is tuned against this tree,
580
+ every hit dispositioned — reword to cite the owning collection (preferred),
581
+ extend `CANON_KIT_COUNT_ALLOWED_PHRASES` (a genuinely fixed set), or site-exempt
582
+ with reason. The good/bad pair covers every match shape and the mechanical
583
+ exemptions;
584
+ `check-manifest-count.test.sh` covers the config-driven paths (a consumer-governed
585
+ noun and the allowlist containment) the stock defaults cannot reach. `precommit`
586
+ tier.
587
+
588
+ ### check-prose-enum
589
+
590
+ Invariant: within one manifest-prose paragraph, a delimited hand list naming two
591
+ or more members of one declared governed set must name every member of that set,
592
+ unless an exempt site holds; a member absent from the paragraph is reported as
593
+ omitted. This is the enumeration sibling of check-manifest-count's restated
594
+ totals and the prose analog of check-kit-enum's hand-list doctrine: the count
595
+ gate catches a bare cardinal over a growing collection, but a row that
596
+ *enumerates instead of counting* drifts just as silently when the set grows.
597
+ <!-- prose-enum-exempt: historical attested-drift citation — names the set as it stood when the drift occurred, deliberately not tracking growth -->
598
+ The attested drift: a README row's `blocked-by/needs-spec/spec` tag algebra went
599
+ incomplete when a sibling tag landed — same restatement, different surface form,
600
+ no scanner. Engagement mirrors check-kit-enum — two members are a list, a lone
601
+ member (or two scattered across a paragraph, not adjacent) is a mention, not a
602
+ list.
603
+
604
+ Set declarations are consumer config, never gate literals (the provenance seam):
605
+ `CANON_KIT_ENUM_SETS_CMD` (default empty — clean skip) names a consumer command
606
+ emitting one `<set-name>`⇥`<member>` line per member, loaded through
607
+ `spec_enum_sets` (§lib/spec.sh); a command that fails or a line that does not
608
+ parse is fail-closed (exit 2). A member matches word-bounded — bracketed
609
+ (`[spec:]`) or bare (`spec`), neither an alphanumeric nor a hyphen abutting, so a
610
+ stem never matches inside a longer tag — and the attested drift used bare stems.
611
+
612
+ The scanned set and the paragraph walk are the shared `spec_manifest_files`
613
+ finder and `spec_manifest_walk_awk` driver (§lib/spec.sh); this gate's
614
+ `sk_on_pflush` hook judges each flushed paragraph. Two or more members present
615
+ count as a *hand list* only when a run of them is chained by list separators
616
+ (comma, slash, brackets, whitespace, or `and`/`or`); members merely co-occurring
617
+ in one paragraph with prose between them stay mentions. Omitted members are set
618
+ members absent from the whole paragraph — the sibling that landed but never
619
+ joined the list. Exempt contexts follow the count gate's family shape,
620
+ mechanical markers first, per-site tag last: a subset marker in the window
621
+ (`e.g.`, `such as`, `among them` — the list declares itself partial), a
622
+ partitive marker on the match (`some of`, `one of`, `of the set` — a selection,
623
+ not an enumeration), and the per-site `prose-enum-exempt: <reason>` on the line
624
+ or the one above. The corrective names both legitimate fixes: cite the owning
625
+ set by name, or complete the enumeration — never trim to a silent subset.
626
+
627
+ Producer: the generated pre-commit hook / `run-gates.sh`, coupled to the
628
+ manifest set plus the consumer's config and kit sources (a set change re-fires
629
+ the gate over the docs). Consumer: the committing operator via the output
630
+ contract — file, line, set name, count, and the omitted members all read once at
631
+ the scan transition. `CANON_KIT_ENUM_SETS_CMD` is read at startup; both fields of
632
+ each emitted line are read at match time (set name in the report, member in the
633
+ matcher). This repo's consumer config is `scripts/enum-sets.sh`, which derives
634
+ the queue task-tag set and the Lessons-channel set from queue-kit's own
635
+ lead-line tag parser plus `QUEUE_KIT_LESSON_TAGS` — derived, not restated; the
636
+ two roles are separate sets because a paragraph naming one role's tags is not
637
+ enumerating the other. A set a consumer can only hand-list is that consumer's
638
+ own drift to own; the kit contract asks only for the emit grammar.
639
+
640
+ Calibration follows the count gate's procedure: tuned against this tree, every
641
+ hit dispositioned — cite the set, complete the list, or site-exempt with reason.
642
+ The good/bad pair covers a bare comma hand list dropping a member and the
643
+ marked-subset cases; `check-prose-enum.test.sh` covers the config-driven paths
644
+ (the empty-default skip, the fail-closed escapes, bracketed matching, multi-set
645
+ independence, the exempt escapes) the pair cannot reach. `precommit` tier.
646
+
647
+ ### check-knob-citation
648
+
649
+ Invariant: no kit knob stated *with its value* in governed manifest prose
650
+ outside the owning kit's SPEC. This is the enforcement half of the
651
+ de-literalization rule (doctrine-kit/DOCTRINE.md §Methodology-maintenance
652
+ rules): a knob default copied into a README or a sibling SPEC is a second source
653
+ no gate reads, and it drifts the moment the owner changes. Where the count and
654
+ enum siblings ban a restated *total* and a restated *enumeration*, this bans a
655
+ restated *knob value*.
656
+
657
+ The knob-token vocabulary is derived, never listed — the provenance seam holds
658
+ (a kit literal carrying a private vocabulary would publish it). Each
659
+ `gate_kit_roots` member yields two SCREAMING_SNAKE prefix forms: the dir name
660
+ uppercased with hyphens mapped to underscores (`gate-sdk` → `GATE_SDK_`,
661
+ `delegation-kit` → `DELEGATION_KIT_`), and for a `-kit`-suffixed dir the
662
+ suffix-dropped short form too (`lifecycle-kit` → `LIFECYCLE_`), so a knob on
663
+ either the long or the short form is governed. Both forms derive mechanically,
664
+ so adding a kit widens the vocabulary with no edit here and the gate ships no
665
+ term list. A SCREAMING_SNAKE token is a candidate
666
+ only when it starts with a derived prefix; the short form widens the token
667
+ space, and the value-marker leg below is what holds the false-positive rate.
668
+
669
+ A candidate fires on the value-marker triad, every leg required: a
670
+ derived-prefix token; a same-line value marker; and a surface that is not the
671
+ token's owning SPEC (`<owning-kit>/` joined to `CANON_KIT_SPEC_NAME`). The
672
+ marker is one of two shapes — `=` appended directly to the token
673
+ (`<KIT>_<KNOB>=<value>`), or the word "default" bound within a short window to a
674
+ value literal (a backticked value, a quoted string, or a number). Bare knob
675
+ names stay legal everywhere: prose cites the name and points at the owning
676
+ roster, the fixed instance the gate must never flag; a bare number with no knob
677
+ token in reach never fires — a tripwire left to human judgment, not a gate rule.
678
+ Code and config are out of scope: code owns values, and only the prose manifest
679
+ is scanned.
680
+
681
+ Two calibrations hold the false-positive rate against this tree, the corpus the
682
+ leg is tuned on. A token named inside a `${…}` shell parameter expansion is a
683
+ name citation — another knob's default *expression*, a fallback source — never a
684
+ value statement of itself, so expansions are blanked before the token scan. And
685
+ the "default" leg binds: the word must be followed within a short window by a
686
+ literal that is not itself a backticked knob name, so a stated default like
687
+ ``default `docs/CNAME` `` fires while a knob cited bare after the verb ("these
688
+ paths default through `<KIT>_<KNOB>`") does not.
689
+
690
+ The scanned set is the shared `spec_manifest_files` finder and the prose walk is
691
+ the shared `spec_manifest_walk_awk` driver (§lib/spec.sh); this gate supplies the
692
+ `sk_on_line` hook (the per-line triad) and leaves `sk_on_pflush` unused — the
693
+ marker is same-line, so no paragraph join is needed. Fences are skipped, and a
694
+ `knob-citation-exempt: <reason>` on the line or the one above is the per-site
695
+ valve for a genuine local restatement (a wiring example whose value is the
696
+ citing kit's own path). Producer: the generated pre-commit hook / `run-gates.sh`,
697
+ coupled to the manifest set and the kit SPECs; consumer: the committing operator
698
+ via the output contract — file, line, the knob token, and the owning SPEC the
699
+ value belongs in, each read once at the scan transition, no persistent state.
700
+ Fail-closed on the awk status.
701
+
702
+ Calibration follows the family procedure (§check-manifest-temporal): every hit
703
+ dispositioned — cite the knob by name and point at its SPEC roster (preferred),
704
+ or exempt a genuine local restatement with reason. The good/bad pair covers both
705
+ marker shapes, the short-derived prefix, the `${…}` name citation, the
706
+ default-as-verb non-hit, and the per-site valve; `check-knob-citation.test.sh`
707
+ covers the owning-SPEC exemption (a kit may state its own knob's value in its own
708
+ SPEC but not in its README) the fixture pair cannot reach. `precommit` tier.
709
+
710
+ This gate polices where a value is *placed* (prose may not restate it); its
711
+ sibling `check-knob-default-coupling` polices whether the value *agrees* between
712
+ the source fallback and the SPEC that owns it. The two share the
713
+ default-statement grammar (§lib/spec.sh) — one reads it to reject a value in
714
+ prose, the other to confirm the SPEC states the source's literal.
715
+
716
+ ### check-knob-default-coupling
717
+
718
+ Invariant, for every literal kit-knob default in kit executable source: the
719
+ literal (1) agrees across every site that supplies it and (2) equals the default
720
+ the owning kit's SPEC states. Where `check-knob-citation` bars a knob value
721
+ copied into prose *outside* the owning SPEC, this closes the channel that gate
722
+ leaves open — the `:-` fallback (or guarded assignment) in the source that
723
+ actually supplies the default is coupled to the SPEC statement, so the two
724
+ cannot drift silently.
725
+
726
+ Two default idioms are scanned: a `${PREFIX_KNOB:-value}` fallback expansion, and
727
+ the guarded assignment that is the dominant form in the kits' `lib/*.sh` — a
728
+ `[[ -v PREFIX_KNOB ]] || PREFIX_KNOB=value` scalar or a
729
+ `declare -p PREFIX_KNOB &>/dev/null || PREFIX_KNOB=(…)` array. The knob prefix is
730
+ derived, never listed — one SCREAMING_SNAKE form per `gate_kit_roots` member
731
+ (the dir uppercased, hyphens to underscores), so the gate ships no term list and
732
+ the provenance seam holds; a token is a candidate only when it opens with a
733
+ derived prefix. The scanned surface is the kit source under those roots (the
734
+ roster the meta-gates walk, `templates/` and fixtures pruned); a knob's owning
735
+ SPEC is resolved by its prefix, not the citing file's kit, so a `canon-kit`
736
+ source citing a `GATE_SDK_` knob couples to gate-sdk's SPEC.
737
+
738
+ Assertion 1 (source self-agreement): every literal site for one knob carries the
739
+ same literal; two disagreeing is drift inside the source before any SPEC is
740
+ read, and it suppresses the knob's assertion-2 check (fix the source first).
741
+ Assertion 2 (SPEC agreement): the owning SPEC states that same literal as the
742
+ knob's default, read through the default-statement grammar `check-knob-citation`
743
+ shares (§lib/spec.sh). A default stated as the same `${…:-tail}` deferral the
744
+ source uses is reduced tail-to-tail before the compare, so a knob inheriting
745
+ another kit's default reads as agreement. A knob whose SPEC carries no default
746
+ statement at all reds — the SPEC owns knob defaults.
747
+
748
+ The coupling is literal-to-literal, and the calibration draws the boundary of
749
+ what carries a single literal to couple. Skipped-and-counted, never coupled: a
750
+ computed default (any expansion, substitution, or arithmetic in the value), an
751
+ array default (no single literal), an empty fallback (`${X:-}` is the `set -u`
752
+ presence-guard idiom, not a value — the real default lives at the else-branch or
753
+ guarded-assignment site the gate reaches there), and a default the SPEC states
754
+ *descriptively* rather than as a literal (a regex, a phrase set, a bundled list —
755
+ code owns the complex value and the SPEC describes it, the widest-true tier). The
756
+ honest limit: agreement is confirmed by the source literal appearing as the
757
+ SPEC's stated default, so a value the SPEC never pins to a literal cannot be
758
+ coupled — only a literal disagreement or a wholly undocumented default reds.
759
+
760
+ Producer: the generated pre-commit hook / `run-gates.sh`, coupled to kit source
761
+ and the kit SPECs; consumer: the committing operator via the output contract —
762
+ file, the knob, the source literal, and the owning SPEC, each read once at the
763
+ scan transition, no persistent state. Fail-closed on the awk status. The good/bad
764
+ pair covers self-agreement, the SPEC disagreement, and both idioms;
765
+ `check-knob-default-coupling.test.sh` covers the cross-kit owning SPEC, the
766
+ absent-default red, and the descriptive/array/empty/deferral skips the pair
767
+ cannot reach. `precommit` tier.
768
+
769
+ ### check-surface-duplication
770
+
771
+ Invariant: no unvalved bold-lead-in definition of a glossary term on a
772
+ configured non-glossary surface — the canonical definition form belongs
773
+ only to the glossary; elsewhere it is a second definition that drifts.
774
+ Valves `vision-introduces:` / `spec-introduces:` (same line or the line
775
+ above) make a legitimate narrative or local introduction a reviewable
776
+ decision in the diff.
777
+
778
+ Calibration: a bold lead-in naming a component (a directory owning a
779
+ canonical spec) is never flagged — a component's definition lives in its
780
+ own spec, so there is nothing to restate; gate-test fixtures are excluded;
781
+ exits 2 when the glossary file is absent (register the gate only where the
782
+ topology exists). `align-only` tier.
783
+
784
+ ### check-comment-tier
785
+
786
+ Invariant: every full-line comment on a governed source is one of — a
787
+ machine directive (a comment a tool parses: `graph:`, `shellcheck`,
788
+ `contract:`), a reason directive (a spec pointer, usage synopsis, or
789
+ positional justification: `spec:`, `usage:`, `exception-list:`,
790
+ `no-fixture:`, `assertion`, `permanent:`, `TODO(task:`,
791
+ `TODO(spec-ambiguity)`, which blesses a bounded window — its own line plus
792
+ continuation lines up to `CANON_KIT_COMMENT_RUN_CAP` total physical comment
793
+ lines, blank `#` lines counted; a directive mid-run opens a fresh window
794
+ from its own line, and every comment line beyond a window classifies on its
795
+ own), `comment-tier-exempt: <reason>`, or the
796
+ comment immediately above a positional construct from the language roster.
797
+ Anything else is flagged. Code is the WHAT, its SPEC the WHY — the seam the
798
+ align stage checks each side against; a comment that restates the code, or
799
+ paraphrases the SPEC section it cites, is deleted, not blessed. A `spec:`
800
+ directive earns its place by the coupling it makes — a bare pointer binding
801
+ this code site to the requirement that governs it, as `contract:` / `assertion`
802
+ / `graph:` bind a site to a manifest contract, an enumerated assertion, or the
803
+ gate graph. The binding is the value: either side's drift breaks it visibly
804
+ (gate-checked both sides for `graph:` and `assertion`; for `spec:` /
805
+ `contract:` `check-spec-pointer` gate-checks the forward side — the target
806
+ resolves — leaving only the reverse, an uncovered requirement, a review
807
+ concern), which is why it blesses only its own one-line binding, never a
808
+ relocated block — restatement couples nothing, it just forks the why into a
809
+ second copy no gate reads. `comment-tier-exempt: <reason>` is the honest
810
+ directive for a genuinely-local fact below SPEC altitude that neither tier
811
+ owns.
812
+
813
+ One shape overrides the window: a full-line comment carrying a **restated
814
+ collection total** — the count grammar of §check-manifest-count, over the same
815
+ `CANON_KIT_COUNT_COLLECTIONS` vocabulary — is flagged even where a directive
816
+ blesses it, and positional rescue does not reach it either. A count is never
817
+ directive wording. A directive's blessing covers its own wording physically
818
+ wrapped, never a total pinned beside it, and such a total is exactly the second
819
+ source the manifest gate bans: `# rules 1-8` sat stale in this repo's own guard
820
+ while its ruleset grew past eight, invisible because no gate read comments for
821
+ counts. The fix is deleting the count or citing the owning collection; the sole
822
+ valve is `comment-tier-exempt: <reason>`, whose window suppresses the override
823
+ as it suppresses the tier rule. The override still catches a total hidden in a
824
+ directive's own wrapped wording — the wrap is exactly where one would escape a
825
+ line-at-a-time scan — and an exempt line cannot launder its neighbours into one.
826
+ The weighed alternative — a source-coupled
827
+ numeral scan with an allowlist — is rejected: legitimate numerals abound in
828
+ source (exit codes, indices, field positions) and the false-positive rate would
829
+ exceed the catch. Counts in *code* stay a review concern; counts in *prose*,
830
+ wherever the prose lives, are gated.
831
+
832
+ Calibration: the built-in roster is Checkwright's own kit-mechanism
833
+ directive names; `CANON_KIT_COMMENT_MACHINE` / `_REASON` append a consumer's
834
+ product vocabulary (the same split as `check-graph`'s vocab — the mechanism
835
+ ships, the rule content is config). The window cap is
836
+ `CANON_KIT_COMMENT_RUN_CAP` (default 3 — one wrapped sentence): a
837
+ within-window continuation is the directive's own wording physically
838
+ wrapped, blessed as such, while prose beyond the window is presumed
839
+ relocated restatement and deleted. `comment-tier-exempt:` is reserved for a
840
+ genuinely-local fact neither tier owns, and exempting a restatement rather
841
+ than deleting it is itself the defect — a long roster (a `usage:` option
842
+ list, a header) restructures into directive-anchored short paragraphs or
843
+ trims, never launders prose past the cap. The count-shape override reads the
844
+ shared count adapter (§lib/spec.sh) rather than a second grammar, so it
845
+ inherits that gate's carve-outs unchanged: a comparator bound or a `per`-phrase
846
+ in a directive is a rule and not a total, a partitive proportion exempts both
847
+ its cardinals, and a cardinal in inline code is a meta-reference — which is why
848
+ a directive may still say `at most three checks per run` or name a
849
+ `` `six gates` `` example. No knob is added: the noun vocabulary enters through
850
+ `CANON_KIT_COUNT_COLLECTIONS` and the wedge window through
851
+ `CANON_KIT_COUNT_WEDGE_WORDS`. The default surface is shell
852
+ (`#`) — `templates/` stubs included: a copied-out template's `spec:` line
853
+ resolves against the vendored kit path (kit SPECs travel with the
854
+ vendor-whole install), so its comments are directives like any source and
855
+ this gate governs them, where
856
+ `check-spec-pointer` exempts them as placeholders-by-design — with the
857
+ workflow directory's **tracked** members blessing only `contract:`/`see`,
858
+ whatever their extension (the capture tier is gitignored and headerless, so
859
+ tracking is the filter, not the suffix — gate-sdk/SPEC.md §The workflow
860
+ directory);
861
+ slash-comment parsing (`//`, `/* */`, doc-comments, heredoc skipping) ships
862
+ as mechanism and activates when a consumer widens `CANON_KIT_COMMENT_SURFACE`
863
+ to a language that needs it. Positional rescue is language-agnostic — its
864
+ construct roster (`CANON_KIT_COMMENT_POSITIONAL`) is consumer config, empty
865
+ by default so inert on the shell surface (a Rust consumer supplies the
866
+ `unwrap`/`allow`-class tokens; a consumer's language is not a kit
867
+ literal). Trailing inline comments are out of scope by construction — the
868
+ FP-prone half of the judgment stays a review tripwire. Not-yet-swept
869
+ sources ride `CANON_KIT_COMMENT_WHITELIST` (its array tagged
870
+ `# exception-list:`, each `# until:` a live drain task per
871
+ `check-gate-exemption-tasks`), draining kit by kit. `precommit` tier.
872
+
873
+ ### check-spec-pointer
874
+
875
+ Invariant, two passes, forward direction only: every `spec:` / `contract:`
876
+ pointer **directive** on a governed source resolves, and every free-prose
877
+ `<path>.md §<heading>` **citation** on a governed manifest resolves. The
878
+ directive set is exactly what `check-comment-tier` blesses by shape: full-line
879
+ `spec:` / `contract:` comments on the governed sources, plus the `# contract:`
880
+ headers on the workflow directory's **tracked** members (gate-sdk/SPEC.md §The
881
+ workflow directory owns that tier; a version-marker payload resolves as no path
882
+ and rides `CANON_KIT_COMMENT_WHITELIST`). A directive's target grammar is
883
+ `<path> [§<heading>]`: `<path>` (repo-relative) must be a tracked file, and when
884
+ a `§<heading>` fragment is present the file must carry a matching markdown
885
+ heading; a pointer without `§` resolves file-only. Reddens on a missing or
886
+ untracked target file, on a named heading the target lacks, and — fail-closed —
887
+ on a directive that matched the pointer shape but carries no target path.
888
+
889
+ The prose-citation pass closes the gap where a citation woven into a sentence
890
+ (`context-kit/SPEC.md §The memory-off doctrine`) resolved neither file nor
891
+ heading while the structured directive and the markdown-link anchor were both
892
+ verdict-checked. It scans the manifest set (`spec_manifest_files`, the same
893
+ surface the manifest-narration gate family reads) over a blank-line-delimited
894
+ paragraph join so a heading that wraps a line reassembles, and resolves the
895
+ heading through the one shared `heading_present` helper — one heading-resolution
896
+ path, two callers. Free prose runs on past the heading with no delimiter, so
897
+ the citation pass matches a heading as a boundary-anchored **prefix** of the
898
+ fragment where the directive pass matches it whole. A cited path that is not a
899
+ tracked file is out of this pass's scope — path liveness stays with the gates
900
+ that own it (`check-md-refs`, `check-kit-ref-liveness`); ruling only on headings
901
+ of resolvable files is what holds the false-positive rate at the directive
902
+ pass's level.
903
+
904
+ `check-comment-tier` owns the directive's *shape*; this gate adds *resolution*
905
+ on top, the binding a `spec:` pointer makes being only as good as its liveness
906
+ — a renamed or deleted heading leaves every inbound pointer or citation
907
+ dangling, otherwise caught only on review. Heading match tolerates a trailing
908
+ `(qualifier)` on either side: a pointer narrowing a section to a labelled point
909
+ (`§check-graph (assertion G)` → the `check-graph` heading) or a heading carrying
910
+ a locator the pointer omits (`§The guard framework` → `## The guard framework
911
+ (lib/guard.sh)`). Two `§` carve-outs keep the false-positive floor and must not
912
+ be conflated: a directive's em-dash *prose tail* (`spec: <path> §<h> — <gloss>`)
913
+ strips at the `` — `` so a `§` in the gloss is not read as a heading, while a
914
+ free-prose citation *is* a heading marker — the citation pass fires on a
915
+ tracked `.md` path immediately followed by `§`, and a bare `§` with no tracked
916
+ path before it (the deliberate non-citation use) never fires. Fenced code
917
+ blocks are skipped in both passes — a quoted example is not a citation.
918
+
919
+ Calibration: forward direction only. The reverse — flagging a requirement with
920
+ no inbound pointer as uncovered code — needs a "what counts as a requirement"
921
+ notion that risks false positives against the cheap-and-FP-free bar, so it is
922
+ ruled out (a separate task with its own ruling if ever wanted; this gate
923
+ reserves no syntax for it). Configuration is shared with `check-comment-tier` —
924
+ the `spec_comment_whitelisted` adapter in `lib/spec.sh` and the same
925
+ `CANON_KIT_COMMENT_*` knobs, so no new config knob — but this gate scans
926
+ `spec_comment_surface`, which prunes `templates/` shell sources where
927
+ `check-comment-tier` keeps them. The split is by design, not a "SPECs don't
928
+ travel" claim: a template's `spec: <your SPEC> §check-<area>` line is a
929
+ placeholder the consumer fills in, unresolvable *by design* in the kit's own
930
+ tree — resolving it there would check the consumer's homework against a stub.
931
+ The tier gate still governs those template comments by *shape* (they must be
932
+ directives), so each gate draws the `templates/` line where its own semantics
933
+ put it. `precommit` tier.
934
+
935
+ Retention ruling: the standing doubt — forward-only checking plus the
936
+ basename↔§heading convention make the pointer largely redundant, its gloss a
937
+ restatement risk — is answered and the roster slot kept. The convention
938
+ derives a section's *name*, never its liveness: absent an inbound pointer,
939
+ renaming or deleting a SPEC heading reddens nothing, and the pointer is the
940
+ only mechanized code→prose coupling (the reverse direction stays a review
941
+ concern per the paragraph above). Sites away from a file's header bind
942
+ sections no naming convention can derive. Narrowing the directive to a bare
943
+ pointer buys nothing: the gloss is already capped at the one-line binding
944
+ (§check-comment-tier), and a gloss restating the cited section is deleted
945
+ under that doctrine, not re-gated here. Dropping the slot would also orphan
946
+ the citation coverage the convention carries — the reason a dedicated
947
+ script↔doc citation gate stays unbuilt.
948
+
949
+ ### check-todo-task-liveness
950
+
951
+ Invariant: every `TODO(task: <slug>)` marker on a governed source resolves to a
952
+ live queue task. A `<slug>` naming an active or deferred task resolves; a slug
953
+ sitting in `Done` is **stale** (the work finished, the marker did not); a slug
954
+ absent from the queue is **unresolved** (a typo or an unfiled task). Stale and
955
+ unresolved both redden — a marker referencing nothing is a dangling forward
956
+ reference, the source-side twin of a `blocked-by` tag left pointing at a
957
+ completed task.
958
+
959
+ `check-comment-tier` owns the marker's *shape* — it blesses `TODO(task:` as a
960
+ reason directive — and this gate adds *resolution* on top, exactly as
961
+ `check-spec-pointer` adds resolution to the `spec:` shape the same tier gate
962
+ blesses. It closes the liveness gap those siblings already guard elsewhere:
963
+ `check-task-names` flags a `blocked-by` gone stale on a done slug and
964
+ `check-gate-exemption-tasks` resolves an exemption's `# until:` slug against the
965
+ live set, but a `TODO(task:)` bound to a cleared task passed forever because
966
+ nothing read the source side. The marker requires a resolvable slug after the
967
+ colon, so a tool carrying the bare roster literal (`check-comment-tier`'s own
968
+ directive name) never self-matches, and full-line versus trailing placement is
969
+ immaterial: resolution governs the referent, not the comment tier. Bare
970
+ `TODO`/`FIXME`/`HACK` markers are out of scope — trailing-comment scanning is a
971
+ separate ruling if the need attests.
972
+
973
+ Placement: the marker is a comment directive on the governed comment surface, so
974
+ it is canon-kit's, not queue-kit's (which disclaims source-file conventions in
975
+ its Out of scope). The gate scans `spec_comment_surface`, pruning `templates/`
976
+ as placeholders-by-design like `check-spec-pointer`, and reads the queue through
977
+ `CANON_KIT_QUEUE_FILE` with no new knob — the live/done split is the shared
978
+ `spec_queue_slugs` adapter (§lib/spec.sh), one queue walk reading a bare-slug
979
+ bullet outside the active and deferred sections as the queue's done shape. That
980
+ `task: <slug>` binding grammar — a `task:` key naming a slug that must resolve
981
+ to a live queue entry — is one grammar both liveness gates share:
982
+ `check-deprecation-task` is the twin, resolving the same binding on a
983
+ deprecation marker through the same adapter (§check-deprecation-task). Latent at landing: no such marker exists in
984
+ the tree yet — the gate ships before the first one, so a future `TODO(task:)`
985
+ cannot outlive its task silently. A queue-read failure is fail-closed (exit 2).
986
+ `precommit` tier.
987
+
988
+ ### check-deprecation-task
989
+
990
+ Invariant: every deprecation marker on a governed source binds a `task: <slug>`
991
+ that resolves to a live queue task. The marker vocabulary is consumer config —
992
+ `CANON_KIT_DEPRECATION_MARKERS`, a roster of regexes (one per element) matched
993
+ against the governed comment surface. A language's marker spelling is never a
994
+ kit literal: the roster ships empty, so a repo that sets none is clean-skipped
995
+ (the `check-graph`/`graph-vocab` seam — the kit ships the resolution mechanism,
996
+ the consumer names its own `#[deprecated]`, `@deprecated`, or `@Deprecated`).
997
+ The scan itself stays consumer toolchain — a clippy/ESLint-class linter already
998
+ inventories deprecation markers; this gate adds the governance coupling no
999
+ linter ships: a deprecated surface that names no decommission task, or names a
1000
+ done or absent one, has nothing tracking its removal.
1001
+
1002
+ A marker line carrying no `task: <slug>` is **unbound**; a bound slug sitting in
1003
+ `Done` is **stale** (the decommission finished, the marker did not); a bound
1004
+ slug absent from the queue is **unresolved**. All three redden — each finding
1005
+ names the file, the line, the matched marker, and the offending slug. The
1006
+ binding grammar and the queue-resolution pass are `check-todo-task-liveness`'s:
1007
+ the same `task: <slug>` key over the same `spec_queue_slugs` adapter
1008
+ (§check-todo-task-liveness, §lib/spec.sh), one grammar both liveness gates
1009
+ share. The gate scans `spec_comment_surface` (templates pruned as
1010
+ placeholders-by-design) and reads the queue through `CANON_KIT_QUEUE_FILE`, no
1011
+ new knob beyond the roster. An unreadable queue or source is fail-closed
1012
+ (exit 2); an empty roster is the clean skip, not an error.
1013
+
1014
+ This repo sets no roster, so the gate clean-skips here — the good/bad fixture
1015
+ pair and `check-deprecation-task.test.sh` carry the resolved and reddened paths
1016
+ under a fixture-local roster (the `check-manifest-count` config-path precedent).
1017
+ The release-boundary disposition walk over the standing marker inventory
1018
+ (decommission now, re-justify and carry the task forward, or un-deprecate) is
1019
+ lifecycle-kit's `release-sweep` skill template, and the between-major backlog
1020
+ trend over the same roster is drift-kit's `kpi-deprecated-surface` example
1021
+ (lifecycle-kit SPEC §templates, drift-kit SPEC §Out of scope). `precommit` tier.
1022
+
1023
+ ### check-tracking-claim
1024
+
1025
+ Invariant: every **tracking claim** on a governed manifest surface agrees with
1026
+ git. A tracking claim is a fixed-vocabulary predicate bound to the backticked
1027
+ repo-relative path token it follows:
1028
+
1029
+ | Predicate | Holds when |
1030
+ | --- | --- |
1031
+ | `is committed`, `is tracked` | the path has tracked members and no ignored ones |
1032
+ | `is gitignored`, `is local-only` | the path has ignored members and no tracked ones |
1033
+ | `is two-tier` | both classes are non-empty — the path holds tracked and ignored members |
1034
+
1035
+ It exists because the defect class it catches — an always-loaded surface
1036
+ asserting a directory is committed while part of it is gitignored — is invisible
1037
+ to every other gate the kit ships: `check-md-refs` resolves paths,
1038
+ `check-spec-pointer` resolves headings, and neither reads what the sentence
1039
+ *claims* about the path. Resolution: a path naming a directory expands to its
1040
+ members (`git ls-files` for the tracked side, `git check-ignore --no-index` on
1041
+ the path for the ignored side); a path naming a file is its own single member.
1042
+ The ignored side is read from the rules, not the working tree, so a gitignored
1043
+ runtime path with no file in a fresh checkout still resolves — a presence read
1044
+ (`ls-files --others --ignored`, which lists only files that exist) made the same
1045
+ claim verify locally and red in CI. `--no-index` is load-bearing for the mixed
1046
+ predicate: plain `check-ignore` refuses to report a directory that has a tracked
1047
+ member as ignored, and a two-tier directory always has one. The mixed predicate
1048
+ is what lets an honestly-mixed directory have a true sentence at all — without
1049
+ it, the always-loaded tier could only be given a false one. Its rule-based proof
1050
+ reaches only a directory the rules match whole (a `dir/` pattern) that also
1051
+ carries a tracked member; a directory whose ignored members are matched by file
1052
+ patterns, the directory itself matching no rule, has no rule-based two-tier proof
1053
+ and stays a prose description (the `runtime-dir-two-tier-detector` debt).
1054
+
1055
+ Reddens on a predicate whose verification fails, and — fail-closed — on a bound
1056
+ path that exists in neither the index, the ignore rules, nor the working tree,
1057
+ since an unresolvable path makes the claim unverifiable rather than true.
1058
+
1059
+ Surface: the manifest set (`spec_manifest_files`, the same surface the
1060
+ manifest-narration gate family reads). **No new knob**: the predicate vocabulary
1061
+ is kit-owned generic English, and which surfaces are governed is a knob that
1062
+ already exists. Fenced code blocks are skipped, matching `check-spec-pointer` —
1063
+ a quoted example is not a claim — and a predicate inside an inline code span is
1064
+ a meta-reference, not an assertion (`check-manifest-count`'s carve-out, same
1065
+ reason), which is what lets this section name its own vocabulary.
1066
+
1067
+ Calibration, stated as the gate's honest limit: **forward direction only, fixed
1068
+ vocabulary only, adjacency only.** The gate fires on the listed predicates and
1069
+ rules on nothing else; a claim phrased any other way ("the workflow directory
1070
+ ships in the repo") is out of scope and stays a review concern — the same
1071
+ forward-only bar `check-spec-pointer` holds, and for the same reason: widening to
1072
+ "any sentence asserting tracking" needs a notion of assertion that cannot hold
1073
+ the false-positive floor. **Adjacency is the binding**: only whitespace may sit
1074
+ between the path's closing backtick and the predicate, so a clause in between
1075
+ unbinds it (`` `core-files.list` `` *manifest exists in the worktree and* is
1076
+ tracked is correctly not a claim). That is deliberate under-detection, and it is
1077
+ what buys the false-positive floor: the fixture pair covers both directions.
1078
+
1079
+ The gate landed green over this repo — two claims (`.tmp/` and `.metric/`, both
1080
+ gitignored), each verified rule-based against the ignore rules; a third
1081
+ directory, `.workflow/`, is described in prose citing gate-sdk/SPEC.md §The
1082
+ workflow directory rather than as a bound claim, because its ignored members are
1083
+ file-pattern-matched and the directory itself matches no rule, so no rule-based
1084
+ two-tier proof exists for it (the `runtime-dir-two-tier-detector` debt). No
1085
+ backfill. That is the expected shape: it is a regression gate for a defect that already shipped on the
1086
+ always-loaded tier, not a discovery tool, and §When a gate earns its place in
1087
+ gate-sdk/SPEC.md governs that class. No per-site valve is taken: a claim that
1088
+ cannot be made true is a claim that must be reworded, and a valve would restore
1089
+ exactly the unverified-prose state the gate exists to end. Tier `precommit`; the
1090
+ `# graph:` manifest couples the manifest set and `.gitignore`.
1091
+
1092
+ ### check-spec-fence-balance
1093
+
1094
+ Invariant: every governed markdown file carries an even count of code-fence
1095
+ delimiters (lines opening with ```` ``` ````). The fence-skipping parsers across
1096
+ the kits — `check-spec-embedded-source`, `check-tag-lead-line`, the queue
1097
+ scanners — all toggle a fence flag line by line; an odd count leaves the flag
1098
+ stuck and the rest of the file is read *inside* a phantom fence, so every later
1099
+ finding silently fails open. This gate turns that silent hole into a red. The
1100
+ surface is the manifest set (`spec_manifest_files`) plus the configured queue
1101
+ file (`CANON_KIT_QUEUE_FILE`) — two motivating parsers (`check-tag-lead-line`,
1102
+ `check-queue-wrap`) scan the queue, which the manifest set excludes — with no
1103
+ new knob. A grep error (not a no-match) is fail-closed (exit 2).
1104
+
1105
+ ### check-md-refs
1106
+
1107
+ Invariant: every internal markdown link in the governed doc set resolves. A
1108
+ relative-path target (with the source file's directory as the base) must be a
1109
+ tracked file, or a directory holding tracked files; a `#anchor` — alone
1110
+ (same-file) or trailing a path — must match the GitHub heading slug of a
1111
+ heading in the target file. External URLs (`scheme://`, `mailto:`) are out of
1112
+ scope: the network is not a gate dependency. The doc set is the manifest set
1113
+ (kit READMEs and CLAUDE.md included) minus the `CANON_KIT_MDREF_EXCLUDE` globs
1114
+ (default empty, for a consumer's generated docs); the scan runs over tracked
1115
+ sources only, so an untracked local-only file (`BRIEF.local.md`) is a legitimate
1116
+ link *source* that is never scanned and, being git-ignored-and-present, a
1117
+ legitimate *target* that resolves without being tracked. A grep error is
1118
+ fail-closed (exit 2). The link extractor is purely syntactic — it matches the
1119
+ bracket-then-paren link shape (a `]` immediately followed by a parenthesized
1120
+ target) without stripping code spans, so a literal markdown link written in
1121
+ governed prose is scanned as a real link even inside inline backticks; to name
1122
+ such a link in prose without tripping the gate, separate the `]` and the `(`
1123
+ (a space, or a line break — the scan is per-line). The amendment `SPEC-*.md`
1124
+ files escape only by lying outside the scanned doc set, not by any code-span
1125
+ exemption. Links are this gate's charge; the sibling `check-docs-cmd` takes the
1126
+ invoked commands and env knobs written inside fences and backticks, over the
1127
+ same governed doc set (one shared set, no second knob).
1128
+
1129
+ **The self-repo blob-link pass.** An absolute link is normally out of scope —
1130
+ the network is not a gate dependency — with one exception: a link into this
1131
+ same repository's GitHub tree, which resolves against the working tree exactly
1132
+ as a relative link does. The repo identity is derived at gate runtime from
1133
+ `git remote get-url origin` through the shared `gate_self_repo_prefix` adapter
1134
+ (gate-sdk/SPEC.md §lib/gate.sh), so the resolver here and any reference-link
1135
+ *producer* draw one identity; the `git@host:owner/repo` and
1136
+ `https://host/owner/repo[.git]` remote forms normalize to one
1137
+ `https://host/owner/repo` identity, so the kit ships no repo name (the
1138
+ provenance seam holds) and CI's checkout and a local clone alike supply it. A
1139
+ link whose prefix is `<identity>/blob/<CANON_KIT_DOCS_BLOB_REF>/` (the ref
1140
+ default `master`) is a self-repo reference link: its `<path>` must be a
1141
+ git-tracked file, and a trailing `#anchor` must slug — under the same GitHub
1142
+ heading-slug rules the same-file anchors use — to a heading in that file. A
1143
+ repo with no `origin` skips the pass: a self-repo link cannot be identified, so
1144
+ it falls through to the external-URL skip. The ref is a knob rather than a
1145
+ literal because it is a policy choice, not a derived fact — the site is living
1146
+ documentation of the current tree, so a reference link pins to the default
1147
+ branch (this repo's `master`), and a tag-pinned reference copy would buy
1148
+ staleness, not stability.
1149
+
1150
+ ### The reference-link grammar
1151
+
1152
+ A docs-site page cites two kinds of in-repo target, and the grammar splits on
1153
+ which. A *rendered-document* reference — a kit's `SPEC.md`, `README.md`, or
1154
+ `DOCTRINE.md` — cites the on-site mirror of that document *relatively* when the
1155
+ site publishes one: a generated, freshness-gated projection under `docs/<kit>/`
1156
+ that keeps reference reading on the served site. The mirror preserves the
1157
+ documents' cross-citation topology one-to-one, so the relative shape a page
1158
+ uses is the same shape the source tree uses. A *source* reference — a script, a
1159
+ gate body, config, a directory: files the site does not render — cites the tree
1160
+ with an absolute GitHub blob link
1161
+ `https://<host>/<owner>/<repo>/blob/<ref>/<path>[#anchor]`, anchored when it
1162
+ names a section, because a relative link into the unrendered surrounding tree
1163
+ would 404 on a site that serves `docs/` alone. Both are the downward-citation
1164
+ shape of the tiering topology, one on-site and one off. Resolution of the blob
1165
+ form belongs to `check-md-refs`' self-repo pass (identity derivation and the
1166
+ ref knob live there); `check-docs-link-convention` owns the shape of the
1167
+ relative links that stay inside `docs/`. The mirror is what a site opts into,
1168
+ not a precondition of the grammar: absent a published mirror, rendered-document
1169
+ references fall back to the same off-site blob form as source references.
1170
+
1171
+ ### check-docs-link-convention
1172
+
1173
+ Invariant: every relative markdown link on a docs-site page obeys the
1174
+ downward-citation *shape* — the resolution of those links is `check-md-refs`'
1175
+ charge, and this gate owns shape alone. Absolute reference links (the off-site
1176
+ blob grammar above) are out of this gate's scope entirely: their resolution is
1177
+ `check-md-refs`' self-repo pass, and this gate turns only on the relative links
1178
+ that stay inside the tree. Each rule is scoped to the docs tree
1179
+ because the "kit page" it turns on (a `<root>/<kit>/index.md`) exists only
1180
+ there:
1181
+
1182
+ - **No directory-target link.** A relative link whose target names a directory
1183
+ (a trailing `/`, or a path that resolves to a tracked directory) must instead
1184
+ name the file — `kit/index.md`, never `kit/`. A bare directory link is
1185
+ ambiguous about what the page is citing and defeats anchor-level citation.
1186
+ - **Anchored kit back-links.** On a kit page (`<root>/<kit>/index.md`), a link
1187
+ back to that same kit's own `README.md` or `SPEC.md` must carry a `#section`
1188
+ anchor. A page cites downward into a *named* section, never at the whole spec —
1189
+ the anti-restatement doctrine expressed as a link shape.
1190
+
1191
+ The scanned tree is `CANON_KIT_LINK_ROOT` (default `docs`; the fixture pair
1192
+ overrides it with a positional arg pointing at a synthetic tree), walked for
1193
+ every `*.md`. The link extractor is the same syntactic bracket-then-paren match
1194
+ `check-md-refs` uses; `scheme://` and `mailto:` targets are out of scope, and a
1195
+ pure `#anchor` (no path) satisfies neither rule. Per-site valve: a
1196
+ `docs-link-exempt: <reason>` HTML comment on the link line or the one directly
1197
+ above suppresses that one finding — for the rare legitimate directory link a
1198
+ consumer's layout demands. A missing scan root is fail-closed (exit 2).
1199
+
1200
+ ### check-docs-cmd
1201
+
1202
+ Invariant: every invoked repo-relative `.sh` path and every kit-prefixed env
1203
+ knob written inside a fence or inline backticks in the governed doc set resolves
1204
+ against the tree — the command/knob analog of `check-md-refs`, since a broken
1205
+ `bash <path>` line or a retired knob name drifts silently where a broken link
1206
+ would be caught. Two assertions:
1207
+
1208
+ - **(A) invoked command paths.** Inside a fenced block, a `.sh` path in
1209
+ *invocation* position — the first word of a `;`/`|`/`&&`-separated segment, or
1210
+ the first non-flag argument when that word is `bash`/`sh`/`source`/`.` — must
1211
+ resolve to a tracked file, tried doc-directory-relative first (a kit SPEC's
1212
+ own `bin/x.sh`) then repo-root-relative (a cross-kit `gate-sdk/bin/x.sh`).
1213
+ Only invocations are checked, so a path in argument position — a `cp
1214
+ templates/x.sh scripts/x.sh` install *destination*, which the consumer
1215
+ creates and this repo need not track — is never a finding. That is the
1216
+ deliberate calibration: the invariant's failure mode is a broken invocation,
1217
+ and scoping to the two named forms (a bare `<dir>/…/<name>.sh` and the
1218
+ `bash <path>` form) drops the hypothetical-install-target class by
1219
+ construction, with no whole-file exemption.
1220
+ - **(B) env knobs.** Any backticked or fenced ALL-CAPS name carrying a kit
1221
+ prefix (the roster is each `gate_kit_roots` member's basename uppercased,
1222
+ hyphens to underscores, trailing `_`: `gate-sdk` → `GATE_SDK_`) must occur in
1223
+ the kits' tracked *code* — their shell sources and config templates, never
1224
+ their own prose, so a knob name-dropped only in markdown cannot self-satisfy.
1225
+ The corpus is the union across all kits, not the prefix owner alone: a
1226
+ namespaced knob may be read by a dependent kit (`GATE_SDK_LIB` is gate-sdk's,
1227
+ resolved in delegation-kit and evidence-kit), and the prefix marks scope, not
1228
+ location. A family stem — a caps run ending `_` because a placeholder or glob
1229
+ follows it (`EVIDENCE_KIT_RUN_<suite>`, `CANON_KIT_COMMENT_*`) — resolves when
1230
+ any code name extends it. Names with no kit prefix are out of scope, so
1231
+ generic shell vars never false-positive.
1232
+
1233
+ The governed doc set is exactly `check-md-refs`' — the manifest set minus
1234
+ `CANON_KIT_MDREF_EXCLUDE` — shared, with no gate-specific knob. Prose outside
1235
+ fences and backticks is never scanned; a hypothetical example path is written
1236
+ unfenced, or its whole doc joins the per-file `CANON_KIT_MDREF_EXCLUDE` valve.
1237
+ The knob set is built by a repo-root-anchored `git grep`, so it holds when the
1238
+ fixture runner invokes from a case directory. Not a git repository, or a
1239
+ `git grep` that errors, is fail-closed (exit 2). The `# graph:` manifest couples
1240
+ the doc set to `scripts/*.sh` and every kit's shell sources (`kit:*.sh`), so a
1241
+ script rename or a knob retirement re-fires the gate over the docs.
1242
+
1243
+ ### check-install-claim
1244
+
1245
+ Invariant: exactly one governed doc declares which install transport is primary,
1246
+ and no scanned install section leads with a different one. This is the star
1247
+ topology's first *user-facing* application — the same one-owner-per-fact rule the
1248
+ kit applies to internal facts, aimed at a claim a first-time reader acts on.
1249
+
1250
+ **What it does not attempt.** Whether a documented install command resolves
1251
+ against a live registry needs network egress at gate time and is out of a
1252
+ hermetic battery's reach. It is not built, and this paragraph says so rather than
1253
+ leaving a reader to over-read a green run: the command that drove this gate's
1254
+ filing was syntactically fine, and only a registry could have contradicted it.
1255
+ What is decidable from the tree alone is the consistency half — two surfaces
1256
+ cannot name different primary transports — and that is the whole of what runs.
1257
+
1258
+ The claim's machine-readable owner is a full-line
1259
+ `<!-- install-primary: <transport-id> -->` HTML comment. A marker rather than a
1260
+ visible sentence, because the reader-facing form of this claim already exists as
1261
+ prose and must stay prose; the marker is the tier beside it, not a replacement.
1262
+ The transport vocabulary is consumer config — one `<transport-id>`⇥`<ERE>` line
1263
+ per transport through `CANON_KIT_INSTALL_TRANSPORTS_CMD`, loaded by
1264
+ `spec_install_transports` (§lib/spec.sh) — because a kit literal spelling a
1265
+ transport publishes one project's distribution model as a kit fact.
1266
+
1267
+ The scanned set is `check-md-refs`' governed doc set (the manifest set minus
1268
+ `CANON_KIT_MDREF_EXCLUDE`) minus `CANON_KIT_INSTALL_CLAIM_EXCLUDE`. Two
1269
+ assertions:
1270
+
1271
+ - **(A) Singleton owner.** Exactly one declaration exists across the scanned set.
1272
+ Zero is the defect the gate was built for — nothing owns the claim, so two
1273
+ pages can drift apart with nothing watching — and two owners is that same
1274
+ defect wearing a different shape. An id outside the configured vocabulary is
1275
+ fail-closed (exit 2) rather than a violation: the gate then holds no primary to
1276
+ compare a section against, so it must not run rather than pass.
1277
+ - **(B) Leading transport.** Within each scanned document, for every
1278
+ `##`-or-deeper section whose heading text matches
1279
+ `CANON_KIT_INSTALL_SECTION_RE`, the **earliest** line matching any transport
1280
+ pattern must match the declared primary. Later matches are never flagged, and a
1281
+ section matching no transport pattern is silent. One line matching two patterns
1282
+ passes when either id is the primary — a sentence naming both transports is not
1283
+ leading with the secondary one. Fenced content is scanned, because a recipe is
1284
+ exactly where a transport shows, but a fenced line is never read as a heading;
1285
+ the declaration line is skipped, since a claim is not evidence for itself.
1286
+
1287
+ Assertion B is the answer to the leading-versus-mentioning question: naming a
1288
+ secondary transport is correct prose and must stay green, so the rule is
1289
+ positional. **The scope in which "leading" is well-defined is the install
1290
+ section, not the file**, and that calibration was verified rather than assumed —
1291
+ this repo's own install page names its npm path in the H1 preamble about 120
1292
+ lines above the tarball recipe, so a whole-file first-match rule would red the
1293
+ owner page on correct prose.
1294
+
1295
+ Three honest limits, each stated because a reader would otherwise over-trust a
1296
+ green run. Registry reachability is the first, above. **Pattern quality is the
1297
+ second, and it is the consumer's own drift to own:** the gate is only as sharp as
1298
+ the emitted EREs, and a loosely-written pattern wins matches by accident — the
1299
+ kit contract asks for the emit grammar, exactly as `check-prose-enum` says of a
1300
+ hand-listed set. **The third is bought by the section scope:** the prose tier of
1301
+ the declared claim may itself sit outside any scanned section, as this repo's
1302
+ does, in which case rewriting that prose to name a different transport while
1303
+ leaving the declaration alone stays green. That binding is documentary — held by
1304
+ this section and by a reader, not by the gate. It is the price of the scoping
1305
+ rather than an argument against it, since the alternative whole-file rule reds
1306
+ the owner page today, and the recurrence path that actually fired is unaffected:
1307
+ the drift was a `## Quick start` section leading with the wrong transport, which
1308
+ is in scope.
1309
+
1310
+ Producer: the maintainer editing the section that owns the claim, plus the
1311
+ consumer's transport command; both are live tracked configuration in this repo,
1312
+ not fixture-only. Consumer: the committing operator via the output contract —
1313
+ assertion B's report names the section, the offending line, and *which* transport
1314
+ it led with, because "wrong transport" alone would leave the reader grepping. The
1315
+ declaration carries exactly one field and both assertions read it; each emitted
1316
+ line's id is read at the membership check and in the report, its ERE at the
1317
+ per-line match.
1318
+
1319
+ The gate lands greenfield: the drift that filed it was fixed inline at the close
1320
+ that filed it, so this pins a currently-consistent claim and its value is
1321
+ recurrence. That claim drifted at two consecutive releases with nothing watching
1322
+ it, on the surface a first-time reader runs first. The good/bad pair covers the
1323
+ recurrence path itself — a quick-start section leading with the secondary
1324
+ transport — beside a silent no-transport section, a heading the regex does not
1325
+ select, and a published note the path valve keeps out of the scanned set. The
1326
+ `# graph:` manifest couples the gate to the doc set and `scripts/*.sh`, so a
1327
+ transport rename re-fires it over the docs. `precommit` tier.
1328
+
1329
+ ### check-prose-tells
1330
+
1331
+ The mechanical subset of the AI-prose tells — the machine-detectable patterns
1332
+ that mark agent-authored reader-facing prose — over the consumer-configured
1333
+ markdown surfaces (`CANON_KIT_PROSE_TELL_GLOBS`; empty ⇒ nothing scanned, the
1334
+ correct unconfigured-consumer no-op). Judgment-dependent tells (voice, argument
1335
+ shape, hedging) are out of scope permanently: the gate never grows heuristics
1336
+ that would make it probabilistic; that read stays human.
1337
+
1338
+ It runs six mechanical assertions over each surface, every one threshold-gated:
1339
+ em-dash density (A), throat-clearing phrases (B), contrast cadence (C),
1340
+ undefined abbreviations (D), sentence-rhythm variance (E), and tricolon density
1341
+ (F). A paragraph is a blank-line-delimited block and a section is a `##`-headed
1342
+ span, except that each markdown list item (`-`/`*`/`+`/`N.`) is its own unit for
1343
+ every paragraph and section assertion — a definition list carrying one em-dash
1344
+ per item is well-formed markdown, not flowing prose, so its items are never
1345
+ lumped into one block (the same structural holdout the non-prose surfaces below
1346
+ earn). Because the tells measure authored prose, three non-prose surfaces are
1347
+ held out before any assertion runs: inline `` `code` `` spans, markdown table
1348
+ rows, and generated `<!-- name:begin -->`…`<!-- name:end -->` regions (each
1349
+ byte-gated elsewhere — a prose gate that forced edits to generated content
1350
+ would contradict its generation, the same reasoning that keeps `docs/posts/`
1351
+ out of the opt-in). Fenced code the shared walk driver already drops.
1352
+
1353
+ - **A. Em-dash density** — a paragraph carrying more than
1354
+ `CANON_KIT_PROSE_TELL_EMDASH_MAX` em-dashes.
1355
+ - **B. Throat-clearing phrases** — a case-insensitive match of any
1356
+ `CANON_KIT_PROSE_TELL_PHRASES` member, the base array merged with
1357
+ `CANON_KIT_PROSE_TELL_PHRASES_EXTRA` (§Layout and configuration).
1358
+ - **C. Contrast cadence** — the "not X — it's Y" shape (a `not …` clause
1359
+ resolved across an em-dash or `, but` into `it's`/`it is`) more than
1360
+ `CANON_KIT_PROSE_TELL_CONTRAST_MAX` times in a section.
1361
+ - **D. Undefined abbreviations** — an all-caps token of length ≥ 3 the file
1362
+ never expands (no parenthesized expansion at any occurrence) and absent from
1363
+ `CANON_KIT_PROSE_TELL_ABBR_ALLOW` merged with
1364
+ `CANON_KIT_PROSE_TELL_ABBR_ALLOW_EXTRA` (§Layout and configuration).
1365
+ - **E. Sentence-rhythm variance** — a paragraph of at least
1366
+ `CANON_KIT_PROSE_TELL_RHYTHM_MIN_SENTENCES` sentences whose sentence
1367
+ word-count coefficient of variation falls below
1368
+ `CANON_KIT_PROSE_TELL_RHYTHM_CV_MIN` (metronomic cadence).
1369
+ - **F. Tricolon density** — more than `CANON_KIT_PROSE_TELL_TRICOLON_MAX`
1370
+ `A, B, and C` constructions in a section.
1371
+
1372
+ Exact detection regexes are implementation, owned by the gate source; the
1373
+ `good/`+`bad/` fixture pair is the executable statement of each boundary
1374
+ (`bad/` trips every assertion, `good/` passes all and demonstrates the valve).
1375
+ Thresholds are the `CANON_KIT_PROSE_TELL_*` knobs (§Layout and configuration).
1376
+
1377
+ **Valve** — an HTML comment `<!-- prose-tell-exempt: <reason> -->` on the
1378
+ flagged line or directly above it suppresses the tell at that site; it rides the
1379
+ shared exempt-window (§lib/spec.sh — the line or the one above), and the reason
1380
+ is mandatory (the `comment-tier-exempt:` convention — a deliberate stylistic
1381
+ keep carries its cause in-line, a reasonless valve is red). The gate is a
1382
+ producer of nothing but a verdict: the committing session reads the red and
1383
+ either fixes the prose or lands a reasoned valve (oracle-first), the fixture
1384
+ pair feeds `run-gate-tests.sh`, and every `CANON_KIT_PROSE_TELL_*` field is read
1385
+ by `check-prose-tells` at scan time and no other component.
1386
+
1387
+ ### templates/
1388
+
1389
+ `canon-config.sh` — the consumer config template documenting every knob.
1390
+ `SPEC-amendment.md` — the amendment skeleton: delta sections plus the
1391
+ Definition-of-Done checklist (causal completeness, no information lost on
1392
+ merge, amendment deleted, none remaining, gaps filed as debt).
1393
+
1394
+ ## Out of scope
1395
+
1396
+ A consumer's tier contract — which surfaces exist and what each owns — is its
1397
+ own instance; canon-kit ships the topology rules, not the table. Glossary and
1398
+ vision structural gates (`check-glossary-tiering`,
1399
+ `check-glossary-entry-types`, `check-vision-tiering`,
1400
+ `check-retired-term-coupling`) encode one instance's surface roles, entry
1401
+ taxonomy, and ubiquitous-language couplings — rule content; their generic
1402
+ cross-surface axis ships here as `check-surface-duplication`.
1403
+ `check-comment-tier` splits: a consumer's *product* directive vocabulary
1404
+ (`glossary:`, `diagram:`, `domain-enum`, …) is rule content, supplied as
1405
+ `CANON_KIT_COMMENT_*` config, while the classifier, the kit-mechanism directive
1406
+ roster, and the surface/positional parsing machinery ship here — the comment
1407
+ surface is one of the enforced tiering surfaces. A `check-root-tiering` is a
1408
+ pure consumer-filename allowlist with no mechanism residue. Global-constant
1409
+ literal gates (the pagination-literal pattern) are per-constant rule content.
1410
+ Diagram/spec annotation couplings are unclaimed, a later kit's scope.