checkwright 0.20.0 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. package/README.md +385 -19
  2. package/lib/common/digest.sh +18 -0
  3. package/lib/common/lock.sh +11 -0
  4. package/lib/common/recipe.sh +8 -11
  5. package/lib/doctor.sh +49 -0
  6. package/lib/init.sh +152 -29
  7. package/package.json +2 -2
  8. package/payload/artifact/targets.list +30 -0
  9. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates +0 -0
  10. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates.sha256 +1 -0
  11. package/payload/canon-kit/README.md +1 -0
  12. package/payload/canon-kit/SPEC.md +281 -26
  13. package/payload/canon-kit/checks/check-comment-tier.sh +7 -2
  14. package/payload/canon-kit/checks/check-docs-link-convention.sh +11 -4
  15. package/payload/canon-kit/checks/check-md-refs.sh +22 -9
  16. package/payload/canon-kit/checks/check-payload-claim.sh +133 -0
  17. package/payload/canon-kit/checks/check-prose-enum.sh +1 -1
  18. package/payload/canon-kit/checks/check-spec-pointer.sh +15 -4
  19. package/payload/canon-kit/gate-tests/check-comment-tier/good/good.sh +3 -0
  20. package/payload/canon-kit/gate-tests/check-comment-tier.test.sh +26 -3
  21. package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/OUTSIDE.md +4 -0
  22. package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/docs/index.md +3 -0
  23. package/payload/canon-kit/gate-tests/check-docs-link-convention/good/OUTSIDE.md +4 -0
  24. package/payload/canon-kit/gate-tests/check-docs-link-convention/good/docs/methodology.md +8 -0
  25. package/payload/canon-kit/gate-tests/check-docs-link-convention.test.sh +94 -0
  26. package/payload/canon-kit/gate-tests/check-manifest-count.test.sh +5 -3
  27. package/payload/canon-kit/gate-tests/check-payload-claim/bad/README.md +15 -0
  28. package/payload/canon-kit/gate-tests/check-payload-claim/bad/expect.txt +2 -0
  29. package/payload/canon-kit/gate-tests/check-payload-claim/bad/install.md +19 -0
  30. package/payload/canon-kit/gate-tests/check-payload-claim/bad/posts/note.md +6 -0
  31. package/payload/canon-kit/gate-tests/check-payload-claim/bad/scripts/canon-config.sh +8 -0
  32. package/payload/canon-kit/gate-tests/check-payload-claim/bad/scripts/payload-claims.sh +7 -0
  33. package/payload/canon-kit/gate-tests/check-payload-claim/good/README.md +15 -0
  34. package/payload/canon-kit/gate-tests/check-payload-claim/good/expect.txt +2 -0
  35. package/payload/canon-kit/gate-tests/check-payload-claim/good/install.md +20 -0
  36. package/payload/canon-kit/gate-tests/check-payload-claim/good/posts/note.md +6 -0
  37. package/payload/canon-kit/gate-tests/check-payload-claim/good/scripts/canon-config.sh +8 -0
  38. package/payload/canon-kit/gate-tests/check-payload-claim/good/scripts/payload-claims.sh +7 -0
  39. package/payload/canon-kit/gate-tests/check-prose-enum.test.sh +24 -1
  40. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/expect.txt +1 -0
  41. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/widget.sh +1 -0
  42. package/payload/canon-kit/gate-tests/check-spec-pointer/good/widget.sh +1 -0
  43. package/payload/canon-kit/lib/spec.sh +22 -12
  44. package/payload/canon-kit/smoke/install.sh +20 -1
  45. package/payload/canon-kit/templates/SPEC-amendment.md +5 -1
  46. package/payload/context-kit/SPEC.md +38 -7
  47. package/payload/context-kit/lib/toolfloor.sh +1 -1
  48. package/payload/context-kit/smoke/install.sh +3 -1
  49. package/payload/delegation-kit/README.md +2 -1
  50. package/payload/delegation-kit/SPEC.md +590 -48
  51. package/payload/delegation-kit/bin/run-dispatch-guard-tests.sh +97 -0
  52. package/payload/delegation-kit/checks/check-agent-tier-explicit.sh +61 -0
  53. package/payload/delegation-kit/checks/check-gate-tamper.sh +1 -1
  54. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/bad/agents/silent.md +7 -0
  55. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/bad/args +1 -0
  56. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/bad/expect.txt +1 -0
  57. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/good/agents/explicit-cheap.md +7 -0
  58. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/good/agents/explicit-inherit.md +8 -0
  59. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/good/args +1 -0
  60. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/good/expect.txt +1 -0
  61. package/payload/delegation-kit/lib/delegation.sh +3 -0
  62. package/payload/delegation-kit/smoke/install.sh +3 -1
  63. package/payload/delegation-kit/templates/agent-dispatch-guard.sh +61 -0
  64. package/payload/delegation-kit/templates/agent-execution.md +171 -15
  65. package/payload/delegation-kit/templates/delegation-config.sh +4 -0
  66. package/payload/delegation-kit/templates/dispatch-checklists.md +1 -1
  67. package/payload/delegation-kit/usage-tests/dispatch-guard-cases.tsv +30 -0
  68. package/payload/doctrine-kit/DOCTRINE.md +27 -0
  69. package/payload/doctrine-kit/README.md +5 -0
  70. package/payload/doctrine-kit/SPEC.md +62 -3
  71. package/payload/doctrine-kit/bin/install-doctrine.sh +84 -4
  72. package/payload/doctrine-kit/smoke/install.sh +77 -1
  73. package/payload/drift-kit/README.md +3 -2
  74. package/payload/drift-kit/SPEC.md +253 -20
  75. package/payload/drift-kit/bin/stage-economics.sh +157 -3
  76. package/payload/drift-kit/kpis/kpi-incident-recurrence.sh +42 -0
  77. package/payload/drift-kit/smoke/install.sh +155 -1
  78. package/payload/drift-kit/templates/economics.md +9 -0
  79. package/payload/drift-kit/templates/kpis.list +6 -1
  80. package/payload/evidence-kit/README.md +20 -6
  81. package/payload/evidence-kit/SPEC.md +355 -17
  82. package/payload/evidence-kit/bin/run-validate.sh +51 -9
  83. package/payload/evidence-kit/checks/check-battery-roster.sh +86 -0
  84. package/payload/evidence-kit/checks/check-producer-liveness.sh +34 -0
  85. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/args +1 -0
  86. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/expect.txt +1 -0
  87. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/runner.md +14 -0
  88. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/scripts/evidence-config.sh +7 -0
  89. package/payload/evidence-kit/gate-tests/check-battery-roster/good/args +1 -0
  90. package/payload/evidence-kit/gate-tests/check-battery-roster/good/expect.txt +1 -0
  91. package/payload/evidence-kit/gate-tests/check-battery-roster/good/runner.md +14 -0
  92. package/payload/evidence-kit/gate-tests/check-battery-roster/good/scripts/evidence-config.sh +7 -0
  93. package/payload/evidence-kit/gate-tests/check-battery-roster.test.sh +68 -0
  94. package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/args +1 -0
  95. package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/expect.txt +1 -0
  96. package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/run-validate.lock +1 -0
  97. package/payload/evidence-kit/gate-tests/check-producer-liveness/good/args +1 -0
  98. package/payload/evidence-kit/gate-tests/check-producer-liveness/good/expect.txt +2 -0
  99. package/payload/evidence-kit/gate-tests/check-producer-liveness/good/run-validate.lock +1 -0
  100. package/payload/evidence-kit/gate-tests/producer-lock.test.sh +109 -0
  101. package/payload/evidence-kit/lib/evidence.sh +18 -0
  102. package/payload/evidence-kit/smoke/install.sh +17 -3
  103. package/payload/gate-sdk/README.md +4 -1
  104. package/payload/gate-sdk/SPEC.md +1955 -79
  105. package/payload/gate-sdk/bin/gen-pre-commit.sh +13 -3
  106. package/payload/gate-sdk/bin/run-consumer-smoke.sh +121 -1
  107. package/payload/gate-sdk/bin/run-gate-tests.sh +40 -9
  108. package/payload/gate-sdk/bin/run-gates.sh +32 -3
  109. package/payload/gate-sdk/bin/upgrade-smoke.sh +3 -3
  110. package/payload/gate-sdk/checks/check-action-gh-repo.gate +2 -0
  111. package/payload/gate-sdk/checks/check-action-pinning.gate +2 -0
  112. package/payload/gate-sdk/checks/check-action-run-shell.sh +3 -1
  113. package/payload/gate-sdk/checks/check-core-files.sh +27 -4
  114. package/payload/gate-sdk/checks/check-exec-bit.sh +20 -1
  115. package/payload/gate-sdk/checks/check-gate-binary-fresh.sh +106 -0
  116. package/payload/gate-sdk/checks/check-gate-exemption-tasks.sh +6 -7
  117. package/payload/gate-sdk/checks/check-gate-output.sh +9 -1
  118. package/payload/gate-sdk/checks/check-gate-substrate-parity.sh +302 -0
  119. package/payload/gate-sdk/checks/check-graph.sh +7 -8
  120. package/payload/gate-sdk/checks/check-readme-roster.sh +5 -0
  121. package/payload/gate-sdk/checks/check-reads-couples.sh +73 -22
  122. package/payload/gate-sdk/checks/check-template-registry-parity.sh +81 -0
  123. package/payload/gate-sdk/checks/check-tree-terms.sh +11 -7
  124. package/payload/gate-sdk/gate-tests/check-action-run-shell.test.sh +16 -1
  125. package/payload/gate-sdk/gate-tests/check-core-files.test.sh +64 -0
  126. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/args +2 -0
  127. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/expect.txt +5 -0
  128. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/kitroot/checks/check-vendored.gate +2 -0
  129. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/check-ported.gate +2 -0
  130. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/gate-sdk-config.sh +2 -0
  131. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/gates.list +4 -0
  132. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/stamp.txt +1 -0
  133. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/stub-bin +6 -0
  134. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/args +2 -0
  135. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/expect.txt +5 -0
  136. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/kitroot/checks/check-vendored.gate +2 -0
  137. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/check-ported.gate +2 -0
  138. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/gate-sdk-config.sh +2 -0
  139. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/gates.list +4 -0
  140. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/stamp.txt +1 -0
  141. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/stub-bin +5 -0
  142. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh.test.sh +81 -0
  143. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/TASK-QUEUE.md +3 -1
  144. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/expect.txt +3 -1
  145. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/gates/check-sample.sh +3 -1
  146. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/expect.txt +1 -0
  147. package/payload/gate-sdk/gate-tests/check-gate-output/bad/check-sample.sh +1 -0
  148. package/payload/gate-sdk/gate-tests/check-gate-output/good/check-sample.sh +1 -0
  149. package/payload/gate-sdk/gate-tests/check-gate-output/good/expect.txt +1 -0
  150. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/args +2 -0
  151. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/conservation.md +7 -0
  152. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/expect.txt +12 -0
  153. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/impl/gate.rs +2 -0
  154. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/kitroot/check-orphan.rs +3 -0
  155. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/publish.yml +15 -0
  156. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-alpha.sh +3 -0
  157. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-dup.gate +1 -0
  158. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-dup.sh +3 -0
  159. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-orphan.gate +1 -0
  160. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gate-sdk-config.sh +6 -0
  161. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gates.list +3 -0
  162. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/stub-bin +3 -0
  163. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/targets.list +3 -0
  164. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/args +2 -0
  165. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/conservation.md +8 -0
  166. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/expect.txt +7 -0
  167. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/impl/gate.rs +2 -0
  168. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/kitroot/check-other.rs +3 -0
  169. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/publish.yml +15 -0
  170. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-alpha.sh +3 -0
  171. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-ported.gate +2 -0
  172. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gate-sdk-config.sh +6 -0
  173. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gates.list +2 -0
  174. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/stub-bin +3 -0
  175. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/targets.list +2 -0
  176. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity.test.sh +123 -0
  177. package/payload/gate-sdk/gate-tests/check-reads-couples.test.sh +139 -0
  178. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/templates/widgets.list +4 -0
  179. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/widgets/widget-one.sh +3 -0
  180. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/widgets/widget-two.sh +3 -0
  181. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/args +4 -0
  182. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/expect.txt +1 -0
  183. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/scripts/gate-sdk-config.sh +5 -0
  184. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/templates/widgets.list +4 -0
  185. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/widgets/widget-one.sh +3 -0
  186. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/widgets/widget-two.sh +3 -0
  187. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/args +8 -0
  188. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/beta-kit/templates/rules.list +5 -0
  189. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/beta-kit/templates/table.tsv +4 -0
  190. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/expect.txt +1 -0
  191. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/scripts/gate-sdk-config.sh +5 -0
  192. package/payload/gate-sdk/gate-tests/lib-declaration.test.sh +4 -4
  193. package/payload/gate-sdk/gate-tests/lib-gate.test.sh +41 -1
  194. package/payload/gate-sdk/gate-tests/run-gate-tests.test.sh +144 -0
  195. package/payload/gate-sdk/lib/consumer-smoke.sh +26 -1
  196. package/payload/gate-sdk/lib/gate.sh +104 -13
  197. package/payload/gate-sdk/lib/inject.sh +21 -1
  198. package/payload/gate-sdk/smoke/install.sh +19 -1
  199. package/payload/guard-kit/README.md +4 -3
  200. package/payload/guard-kit/SPEC.md +88 -10
  201. package/payload/guard-kit/bin/compare-settings-allow.sh +40 -7
  202. package/payload/guard-kit/gate-tests/compare-settings-allow.test.sh +64 -0
  203. package/payload/guard-kit/lib/guard.sh +1 -0
  204. package/payload/guard-kit/templates/close-triage.md +35 -7
  205. package/payload/guard-kit/templates/guard-config.sh +3 -0
  206. package/payload/lifecycle-kit/README.md +1 -0
  207. package/payload/lifecycle-kit/SPEC.md +589 -33
  208. package/payload/lifecycle-kit/bin/enter-stage.sh +13 -3
  209. package/payload/lifecycle-kit/bin/file-gap.sh +42 -1
  210. package/payload/lifecycle-kit/bin/file-survey.sh +50 -0
  211. package/payload/lifecycle-kit/checks/check-merge-attrs.sh +1 -1
  212. package/payload/lifecycle-kit/checks/check-skill-binding.sh +1 -1
  213. package/payload/lifecycle-kit/checks/check-survey-record.sh +102 -0
  214. package/payload/lifecycle-kit/gate-tests/check-merge-attrs/bad/.gitattributes +1 -0
  215. package/payload/lifecycle-kit/gate-tests/check-merge-attrs/good/.gitattributes +1 -0
  216. package/payload/lifecycle-kit/gate-tests/check-merge-attrs.test.sh +1 -0
  217. package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/args +2 -0
  218. package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/expect.txt +4 -0
  219. package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/record.md +18 -0
  220. package/payload/lifecycle-kit/gate-tests/check-survey-record/good/args +2 -0
  221. package/payload/lifecycle-kit/gate-tests/check-survey-record/good/expect.txt +1 -0
  222. package/payload/lifecycle-kit/gate-tests/check-survey-record/good/record.md +13 -0
  223. package/payload/lifecycle-kit/gate-tests/check-survey-record.test.sh +84 -0
  224. package/payload/lifecycle-kit/gate-tests/file-gap-recurrence.test.sh +94 -0
  225. package/payload/lifecycle-kit/gate-tests/survey-record-entry.test.sh +102 -0
  226. package/payload/lifecycle-kit/lib/stages.sh +8 -2
  227. package/payload/lifecycle-kit/smoke/install.sh +17 -1
  228. package/payload/lifecycle-kit/templates/consult.md +73 -0
  229. package/payload/lifecycle-kit/templates/lead.md +141 -10
  230. package/payload/lifecycle-kit/templates/stages/align.md +12 -0
  231. package/payload/lifecycle-kit/templates/stages/build.md +8 -0
  232. package/payload/lifecycle-kit/templates/stages/close.md +25 -4
  233. package/payload/lifecycle-kit/templates/stages/scope.md +34 -0
  234. package/payload/lifecycle-kit/templates/stages/spec.md +8 -0
  235. package/payload/lifecycle-kit/templates/stages/validate.md +8 -0
  236. package/payload/queue-kit/README.md +4 -1
  237. package/payload/queue-kit/SPEC.md +230 -6
  238. package/payload/queue-kit/bin/queue-edges.sh +78 -0
  239. package/payload/queue-kit/checks/check-queue-entry-budget.sh +5 -3
  240. package/payload/queue-kit/gate-tests/check-queue-hygiene/good/TASK-QUEUE.md +5 -0
  241. package/payload/queue-kit/gate-tests/queue-edges.test.sh +130 -0
  242. package/payload/queue-kit/smoke/install.sh +4 -1
  243. package/payload/queue-kit/templates/TASK-QUEUE.md +3 -0
  244. package/payload/site-kit/SPEC.md +135 -29
  245. package/payload/site-kit/checks/check-docs-render-fidelity.sh +100 -27
  246. package/payload/site-kit/gate-tests/check-docs-render-fidelity-batch.test.sh +158 -0
  247. package/payload/site-kit/lib/site.sh +16 -2
  248. package/payload/site-kit/smoke/install.sh +9 -1
  249. package/payload/gate-sdk/checks/check-action-gh-repo.sh +0 -321
  250. package/payload/gate-sdk/checks/check-action-pinning.sh +0 -55
@@ -17,9 +17,15 @@ override with `GATE_SDK_GATES_DIR`) holding:
17
17
 
18
18
  - `gates.list` — the registry: one gate name per line (`#` comments and blank
19
19
  lines ignored). A listed name resolves to `<gates-dir>/<name>.sh` first, then
20
- each vendored kit's `checks/<name>.sh` — so any kit's shipped gates are
20
+ `<gates-dir>/<name>.gate`, then each vendored kit's `checks/<name>.sh` and
21
+ `checks/<name>.gate` — `.sh` beating `.gate` **within** a dir, dirs tried
22
+ consumer-first. So any kit's shipped gates are
21
23
  registered by name alone, and a consumer can shadow one by dropping a
22
- same-named file in its own gates dir. The kit set defaults to gate-sdk plus
24
+ same-named file in its own gates dir — including shadowing a ported gate with
25
+ its own shell script. The `.gate` spelling is the non-executable declaration of
26
+ a gate whose implementation is a binary subcommand (§The `# graph:` manifest);
27
+ resolution returns it as a declaration path, while execution resolves
28
+ separately through `gate_command` (§lib/gate.sh). The kit set defaults to gate-sdk plus
23
29
  every sibling directory holding a `checks/` **or** a `smoke/` (a vendored
24
30
  Checkwright kit — a gateless kit is discovered by its `smoke/` alone);
25
31
  override with `GATE_SDK_KIT_DIRS` (space-separated kit roots).
@@ -50,7 +56,7 @@ Environment overrides, all optional: `GATE_SDK_GATES_DIR` (default `scripts`),
50
56
  (default `<gates-dir>/git-hooks`), `GATE_SDK_WORKFLOW_DIR` (default
51
57
  `.workflow`; the directory's two-tier membership rule, header form, and
52
58
  extension rule are §The workflow directory), `GATE_SDK_GRAPH_ARTIFACT` (default
53
- `<workflow-dir>/CHECK-GRAPH.html`; the emitted coupling-graph artifact's path,
59
+ `<gates-dir>/CHECK-GRAPH.html`; the emitted coupling-graph artifact's path,
54
60
  read by `check-graph` assertion E — set it to republish the artifact elsewhere,
55
61
  e.g. a served docs page), `GATE_SDK_TMP_DIR` (default `.tmp`), `GATE_SDK_VERBOSE`
56
62
  (default unset = quiet green; any non-empty value restores the full per-gate
@@ -91,7 +97,47 @@ the path segments whose subtrees `check-exec-bit` exempts — see there), `GATE_
91
97
  monitor-marker scan root — see §enforcement-map), and
92
98
  `GATE_SDK_LINT_EXTRA_DIRS` (default empty; space-separated directories whose
93
99
  direct `*.sh` members join `check-shellcheck`'s derived scan set — the seam for
94
- a shipped script that sits under no kit root — see §check-shellcheck). Paths are
100
+ a shipped script that sits under no kit root — see §check-shellcheck), and
101
+ `GATE_SDK_NATIVE_BIN` (default `native/target/release/checkwright-gates`; the
102
+ multi-call binary `gate_command` dispatches a `.gate`-declared member to — see
103
+ §lib/gate.sh; also the binary §check-gate-binary-fresh asks for its baked source
104
+ stamp). Its default is a **stable relative path** deliberately: the
105
+ generated pre-commit hook persists the emitted argv, and a machine-specific
106
+ absolute path baked into a tracked hook would make `check-graph`'s byte-freshness
107
+ comparison machine-dependent. **A vendored consumer's value is set for them**, to
108
+ the binary's place in their gates directory, by the installer writing this knob
109
+ into their `gate-sdk-config.sh` (installer/README.md §The gate binary) — the
110
+ config seam exists so a value can be relocated without the default moving.
111
+ Deriving the default from `GATE_SDK_GATES_DIR` instead was weighed and refused:
112
+ it would silently relocate the binary for every existing reader, and make this
113
+ repo's own layout the exception to a convention whose stated rule is that this
114
+ repo's layout *is* the default. And `GATE_SDK_NATIVE_SRC` (default `native/src`;
115
+ the implementation tree §check-gate-substrate-parity assertion D holds free of
116
+ manifest-class annotation — a **path, not a language**, so the knob assumes
117
+ nothing about what implements a ported gate). And `GATE_SDK_NATIVE_CRATE`
118
+ (default `native`; the crate root that owns the build manifest, held outside
119
+ every kit root by §check-gate-substrate-parity assertion E, and the tree whose
120
+ tracked source §check-gate-binary-fresh hashes into the stamp it compares. Read
121
+ through `gate_native_crate`, its one shell home — §lib/gate.sh). The two native
122
+ path knobs stay distinct because they answer different questions:
123
+ `GATE_SDK_NATIVE_SRC` names the implementation tree a gate's rule lives in,
124
+ `GATE_SDK_NATIVE_CRATE` the root that would carry that tree with it if it moved,
125
+ and only the second decides whether the implementation sits inside the vendoring
126
+ set (§Consumer payload). And `GATE_SDK_NATIVE_TARGETS_FILE` (default **derived**
127
+ from `GATE_SDK_NATIVE_CRATE` as `<crate>/targets.list`, exactly as
128
+ `GATE_SDK_NATIVE_SRC`'s default is, so the crate's location keeps one owner; the
129
+ target roster §Consumer payload rules the platform-support surface, read through
130
+ `gate_native_targets` — see §lib/gate.sh). And
131
+ `GATE_SDK_NATIVE_PUBLISH_WORKFLOW` (default `.github/workflows/publish.yml`; the
132
+ workflow §check-gate-substrate-parity assertion F holds roster-derived and
133
+ one-producer-per-digest — a consumer whose release rides elsewhere points the
134
+ knob at it, and a consumer with no such workflow is reported rather than red,
135
+ because a publish path that does not exist is not one to audit). The roster and
136
+ the workflow are **consumer config, never kit literals**: the knob, the line
137
+ grammar and the assertions are gate-sdk mechanism, while *which* platforms a
138
+ project commits to is that project's own support commitment — a kit literal
139
+ spelling one project's would ship it as everyone's (CLAUDE.md §The provenance
140
+ seam). Paths are
95
141
  repo-root-relative; every entry point `cd`s to `git rev-parse --show-toplevel`
96
142
  before resolving them.
97
143
 
@@ -158,6 +204,21 @@ it — so the requirement is the **prefix with a ruled payload**. Both payload
158
204
  forms are machine-recognizable, which is what keeps the rule a rule rather than
159
205
  a description.
160
206
 
207
+ **The coupling-graph artifact is not a member of this tier.** A rendered HTML
208
+ document opens with a doctype, so it can carry neither payload form and stay a
209
+ valid document; and it is tracked and freshness-gated, so local capture is not
210
+ open to it either. It fits no row of a partition this section calls total, which
211
+ makes its placement here a defect in the emitting default rather than a case the
212
+ partition widens for — `check-workflow-tiering` reddens on it, correctly, in any
213
+ consumer that registers the gate under kit defaults. Its home is the **gates
214
+ dir**, `<gates-dir>/CHECK-GRAPH.html`, on three grounds: `gen-pre-commit.sh`'s
215
+ hook is already a generated projection gate-sdk owns and already lives there, so
216
+ the two artifacts sit under one owner instead of straddling two directories; the
217
+ gates dir is a root entry every consumer allowlists anyway, so no adopter pays a
218
+ new root surface (§check-root-tiering); and it presumes no `docs/`, which a
219
+ published-site path would. A consumer wanting it on a site repoints
220
+ `GATE_SDK_GRAPH_ARTIFACT` (§check-graph), which is what that knob is for.
221
+
161
222
  **The extension rule keys on writer and reader, not on tier.** These are two
162
223
  independent axes, and conflating them is why the convention resisted statement:
163
224
  the directory holds tracked `.md` beside gitignored `.md`, so no extension
@@ -206,9 +267,20 @@ restatement of the violation. A gate with multiple distinct failure classes
206
267
  gives each its own `help:` line. Exit codes: **0** clean, **1** violation,
207
268
  **2** harness/usage error.
208
269
 
209
- Enforced by `check-gate-output` (the static half — it asserts each member's
210
- source carries both a `: clean` emission and a `help:` emission); the `good/`
211
- fixture is the behavioral half that catches a clean line that never executes.
270
+ Enforced **at runtime, on real output**, by the fixture runner: a `good/` case
271
+ must emit the canonical clean line and a `bad/` case a `help:` line
272
+ (§run-gate-tests owns the mechanism). That is the oracle for every fixtured
273
+ member, on either substrate — a source grep was only ever a proxy for the
274
+ behavior, and it reads nothing at all once a gate's rule is a compiled
275
+ subcommand.
276
+
277
+ `check-gate-output` keeps the **static** half for the one class the runtime
278
+ assertion cannot reach: a member carrying `# no-fixture:`, which has no
279
+ `good/`/`bad/` case for the runner to execute (§check-gate-fixture-coverage).
280
+ For those the source grep is the only oracle, so it stays. Retiring it outright
281
+ in favour of the runtime check would silently zero that member's
282
+ output-contract coverage — total coverage across the registry is the point, and
283
+ 94-of-95 dressed as complete is the failure this split avoids.
212
284
 
213
285
  ### Fail-closed contract
214
286
 
@@ -239,8 +311,9 @@ When a gate is written or edited, it ships with — or updates — its
239
311
  `good/`+`bad/` fixture pair under `<tests-dir>/<gate>/`, run by
240
312
  `run-gate-tests.sh`. A gate that prints `clean` on broken input is invisible to
241
313
  every static check; the only proof it fails closed and that its error text is
242
- right is a known-bad input (the `bad/` case asserting exit 1 + an `expect.txt`
243
- substring), paired with a `good/` case asserting acceptance. Coverage is
314
+ right is a known-bad input (the `bad/` case asserting exit 1 + its `expect.txt`
315
+ line(s) — every one of them, §run-gate-tests owning the semantics), paired with
316
+ a `good/` case asserting acceptance. Coverage is
244
317
  enforced by `check-gate-fixture-coverage`: every registry member carries either
245
318
  a pair or a `# no-fixture: <reason>` header annotation — the honest, reviewable
246
319
  escape for whole-tree scanners whose state has no static-fixture representation
@@ -248,6 +321,39 @@ escape for whole-tree scanners whose state has no static-fixture representation
248
321
  a stopgap is filed as debt and fixtured, never given a dishonest "infeasible"
249
322
  reason.
250
323
 
324
+ **The pair is shipping-side, and under §Consumer payload it is the consumer's
325
+ whole verification oracle.** It vendors already — `installer/lib/init.sh`
326
+ enumerates a kit's payload with an unfiltered `find . -type f`, so the pair
327
+ arrives whole. What the ruling changes is its weight rather than its delivery:
328
+ with the predicate withheld it is **the only thing a consumer can independently
329
+ check**, where alongside readable source it was a convenience. The pair plus
330
+ `run-gate-tests.sh` is the entire answer to *does this
331
+ binary do what its SPEC section says*. `gate_command`'s substrate-blind dispatch
332
+ (§run-gate-tests) is what makes it work across substrates, so nothing new is
333
+ built here — only the statement that the property is a contract and may not be
334
+ dropped to slim a payload.
335
+
336
+ **What the pair is evidence *of* differs by tree, and the distinction is not
337
+ pedantry.** In this repo it is post-build verification. In a consumer tree it is
338
+ **post-install acceptance evidence**: nothing is built there, the artifact
339
+ arrives prebuilt and digest-verified, so the question is not *did my build come
340
+ out right* — that question does not exist for a consumer — but *does the
341
+ artifact I was given behave as the specification I was given says it behaves*,
342
+ answered against cases the publisher is held to by the same meta-gates. The
343
+ digest answers **which** artifact arrived; the pair answers **what it does**.
344
+ The payload ships an answer to both, which is the whole of what replaces reading
345
+ the rule. It is also the consumer-side answer to the honest limit §Meta-gate
346
+ conservation for the binary substrate records: the crate-side verification of a
347
+ gate's declared read-set runs where cargo runs, and that is never a consumer
348
+ tree.
349
+
350
+ **Ruled: the pair ships.** The open question was whether opacity extends to it,
351
+ since a `good/`+`bad/` pair shows an agent what passes and what fails. It does
352
+ not extend. Fixtures disclose a gate's **shape**, never its **predicate**, and
353
+ the pair is the consumer's only parity oracle for a binary they cannot read;
354
+ withholding it would spend the trust story to buy marginal opacity, since the
355
+ help text and the SPEC section ship regardless.
356
+
251
357
  ### Self-lint
252
358
 
253
359
  Every script in the family — the consumer's gates and the kit's own `lib/`,
@@ -338,7 +444,95 @@ Three concentric tiers, each an outer backstop for the one inside it:
338
444
 
339
445
  ## The `# graph:` manifest
340
446
 
341
- Every registered gate's header carries a one-line coupling manifest:
447
+ Every registered gate's **declaration path** carries a one-line coupling
448
+ manifest in its header. The declaration path has two spellings: the gate's own
449
+ `<name>.sh`, or — where the implementation is a compiled subcommand — the
450
+ `<name>.gate` descriptor beside it (§lib/gate.sh resolves between them). The
451
+ manifest grammar below is identical in both; every reader greps it out of the
452
+ declaration path as text and none requires that path to be shell.
453
+
454
+ **The `.gate` descriptor.** A gate whose implementation is a binary subcommand
455
+ keeps a **non-executable** declaration file `<dir>/<name>.gate` carrying only
456
+ the lines its readers need: the `# graph:` manifest (required), its `# spec:`
457
+ pointer, and an optional `# no-fixture:` opt-out. Nothing else. It is data — it
458
+ is never sourced and never run.
459
+
460
+ **Its existence is the dispatch declaration, and the subcommand name is the gate
461
+ name.** There is no dispatch field, no second registry and no mapping table,
462
+ because each would be a name that could drift from the thing it names. The one
463
+ fact is the file's presence; the subcommand is derived from the name that
464
+ already identifies the gate everywhere else. **The field roster is closed**, and
465
+ every field on it has a named reader — `# graph:` by the manifest readers below,
466
+ `# spec:` by canon-kit's `check-spec-pointer`, `# no-fixture:` by
467
+ §check-gate-fixture-coverage. The descriptor carries no field that lacks one,
468
+ reserving nothing against a future reader.
469
+
470
+ **One field is refused rather than merely absent, and the refusal is the design.**
471
+ A `# reads:` line declaring the gate's walk roots is the obvious cheap way to
472
+ answer §check-reads-couples, and it is rejected: nothing would hold it to the
473
+ implementation, so it is the removed `# reads-couples-exempt:` opt-out with more
474
+ words — a self-declaration whose would-be reader could not verify what it read.
475
+ The read set lives in the crate's registry instead, where a unit test runs the
476
+ member and compares the declaration against the roots it actually walked. This is
477
+ also why §check-gate-substrate-parity assertion D's manifest-class partition is
478
+ left unchanged deliberately: a roots declaration is *implementation data*, not
479
+ manifest-class, so it belongs in the implementation and not in the build-free
480
+ surface.
481
+
482
+ **The interface that answers is substrate-neutral; its placement is not settled
483
+ here.** The contract is *a declaration path's substrate answers what it reads* —
484
+ shell answers by parse, the binary answers by `--reads`. Whether a later authoring
485
+ SDK relocates that contract to a substrate-neutral surface stays
486
+ `gate-authoring-sdk-surface`'s question, narrowed by this and deliberately not
487
+ answered: one substrate's answer is added without adding a shape that would have to
488
+ be unbuilt to generalize.
489
+
490
+ **The descriptor is a durable surface, not port scaffolding, and it is in live
491
+ use.** The first cohort's two members declare this way — `check-action-pinning`
492
+ and `check-action-gh-repo` (§The first cohort, and the rule that selects the
493
+ next) — so the format below is specified against shipping files rather than
494
+ against an intended one. Its reason does
495
+ not expire with the port that introduced it: `installer/lib/init.sh` runs
496
+ `gen-pre-commit.sh --write` in the *consumer* tree, so the manifest must stay
497
+ readable **with no build and no execution**, and that constraint only
498
+ strengthens as more gates port.
499
+
500
+ **Annotations partition by reader, and the partition is a rule.**
501
+
502
+ - **Manifest-class** — the `# graph:` manifest, and anything else whose reader
503
+ must work without a build — lives in the descriptor **only**. It is never
504
+ emitted into, nor hand-written in, the implementation. Held by
505
+ §check-gate-substrate-parity assertion D.
506
+ - **Locality-class** — `# spec:` with its one-line binding, and the
507
+ comment-tier directives — binds to a *line of implementation*, so it **stays
508
+ in the implementation**: moving it to a companion file destroys the binding
509
+ that gives it meaning. The corpus primitive
510
+ `canon-kit/lib/spec.sh` reaches the implementation for exactly this reason
511
+ (canon-kit/SPEC.md §lib/spec.sh), so those assertions stay live on a ported
512
+ gate instead of going dark.
513
+
514
+ **The layer above the descriptor is substrate-blind.** Because the manifest sits
515
+ outside the implementation, the graph, hook, and meta-gate layers read a gate's
516
+ declaration without knowing what implements it — a gate could be implemented in
517
+ any language behind a descriptor, and nothing in this format or in the
518
+ resolution path assumes otherwise. Slice 1 neither builds nor claims that
519
+ generality; it only declines to foreclose it where a neutral choice cost the
520
+ same. The same property is what keeps the deferred consumer-payload question
521
+ tractable: a descriptor discloses a gate's *shape* without its *predicate*.
522
+
523
+ Two shapes were refused, each on a constraint rather than on taste. **The binary
524
+ emitting its own manifest** would make hook generation depend on executing the
525
+ binary, but `installer/lib/init.sh` runs `gen-pre-commit.sh --write` in the
526
+ *consumer* tree; keeping the manifest as tracked text is what makes the seam
527
+ payload-neutral by construction. **A shell stub carrying the manifest and
528
+ exec'ing the binary** would stay inside the `*.sh` corpora of `check-shellcheck`,
529
+ `check-comment-tier`, `check-gate-output` and the rest, which would then scan a
530
+ three-line file and report `clean` — coverage that reads as real and asserts
531
+ nothing. A `.gate` descriptor is *honestly outside* those corpora instead of
532
+ trivially passing inside them, and §Meta-gate conservation for the binary
533
+ substrate is what makes that honesty auditable.
534
+
535
+ The manifest grammar:
342
536
 
343
537
  ```
344
538
  # graph: couples=<globs> dir=bi|one valve=none|PROPOSED tier=precommit|align-only|commit-msg [mode=staged|whole-tree] [trigger=<globs>] [gen=manual]
@@ -346,8 +540,9 @@ Every registered gate's header carries a one-line coupling manifest:
346
540
 
347
541
  - `couples=` — the surfaces the gate binds (comma-separated globs). One token
348
542
  is special: `kit:<glob>`, which the shared manifest reader in `lib/gate.sh`
349
- (`gate_expand_couples`) expands to `<kit-root>/<glob>` — repo-root-relative —
350
- for every `gate_kit_roots` member at read time; the same reader feeds
543
+ (`gate_expand_couples_var`) expands to `<kit-root>/<glob>` —
544
+ repo-root-relative — for every `gate_kit_roots` member at read time; the same
545
+ reader feeds
351
546
  `gen-pre-commit` (hook emission), `check-graph` (freshness + the HTML
352
547
  projection), and `run-gates --for` (path-scoped selection §run-gates), so
353
548
  emitter, checker, and selector cannot desync on the kit set. A
@@ -391,6 +586,662 @@ Every registered gate's header carries a one-line coupling manifest:
391
586
  - `gen=manual` — the gate's hook block is bespoke and round-trips verbatim
392
587
  between `# >>> manual: <gate>` / `# <<< manual: <gate>` sentinels.
393
588
 
589
+ ## Meta-gate conservation for the binary substrate
590
+
591
+ A gate's shell file carries five different things at once: the rule, the
592
+ `# graph:` manifest, the output-contract strings, its `# spec:`/`# assertion`
593
+ directives, and the greppable evidence that its reads stay inside its declared
594
+ couples. Porting the rule to a compiled subcommand removes the file the other
595
+ four are read from — so a port that records nothing **silently ends** the
596
+ assertions those readers make, and most of them end by finding nothing and
597
+ printing `clean`. A false green, not a red. This section is the contract that
598
+ stops that, and `check-gate-substrate-parity` assertion C is what makes it
599
+ machine-held rather than remembered.
600
+
601
+ **The substrate-sensitive set is derived, never maintained.** A registry member
602
+ is substrate-sensitive when its expanded `couples=` covers the **declaration
603
+ path of a registry member** — the derivation `check-gate-substrate-parity`
604
+ performs at runtime, so no count or roster here can rot. (The test is against
605
+ registry members' declaration paths specifically, not against every `*.sh`
606
+ under a resolve dir: `scripts/queue-config.sh` sits in the gates dir and is not
607
+ a gate, and matching it would over-report.) Every derived member takes exactly
608
+ one recorded disposition below, and a member the section does not name is red.
609
+
610
+ | Meta-gate | Disposition for a `.gate`-dispatched member |
611
+ |---|---|
612
+ | `check-shellcheck` | **Retired with cause** — no shell exists to lint. `cargo clippy` at deny-warnings is the substrate equivalent and runs in CI, not as a gate. |
613
+ | `check-gate-output` | **Ported and strengthened for the fixtured corpus; source-grep retained for the one member outside it.** The source-grep for `: clean`/`help:` was always a proxy for behavior; for the fixtured members the assertion now runs in `run-gate-tests.sh` (§run-gate-tests) against the case's real output, on **shell gates too**. The remaining member, `check-task-conservation` (`# no-fixture:` per queue-kit/SPEC.md §check-task-conservation — a HEAD-vs-worktree diff has no static-fixture representation), has no case for a runtime assertion to reach, so the source-grep stays its only oracle. Retiring the static half outright would zero out that member's output-contract coverage — the exact vacuity this table exists to close. |
614
+ | `check-gate-fail-closed` | **Retired with cause** — the defect (branching on a captured value's emptiness when the subprocess died) is unrepresentable once a fallible call returns a `Result` that cannot be ignored. A real substrate win, stated as one. |
615
+ | `check-reads-couples` | **Retained, with a binary-side equivalent.** Its shell parser finds no walks in a binary gate and would print `clean` — the single worst vacuity available here — so the substrate answers instead of the parser: the binary carries a `--reads <name>` arm printing one line per walk root, a repo-relative path or `?`, and the gate consumes that report into its existing coverage assertion (§check-reads-couples). The declaration is **registry data held to executed behavior**, which is what separates it from the unbound self-declaration this gate exists to refuse: each gate's roots are declared beside its dispatch entry in the crate's registry (an entry added without them fails to compile), the crate's single sanctioned walk implementation records the roots it is invoked with, and two unit tests close the loop — **A**, every member run over its own `gate-tests/<name>/{good,bad}/` cases with recording on, observed roots a subset of declared; **B**, no module outside that walk implementation names a filesystem-walk API or vendors a walker, because a direct walk would be invisible to the recorder and unverify A. The precedent is the `check-knob-default-coupling` row below: an executed assertion is the answer where a static gate would be vacuous. The refusal survives only where the gate still cannot see — an absent or non-executable binary, and a non-zero `--reads` — and there is deliberately no descriptor-level opt-out, which the consumption path does not reinstate: a port ends this assertion by answering it (§check-reads-couples). |
616
+ | `check-gate-assertions` | **Retained, corpus extended** to the gate's Rust module; the `# assertion` marker matches on its token, independent of the comment leader. |
617
+ | `check-gate-exemption-tasks` | **Retained, corpus extended** the same way. |
618
+ | `check-comment-tier` | **Retained, corpus extended** to the implementation module and the `.gate` descriptor, whose own lines are directives by construction. Mechanism: `canon-kit/lib/spec.sh`'s `spec_comment_surface_with_templates` gains `*.gate` **and `*.rs`** arms — the shared primitive, widened once (see the `check-spec-pointer` row). The implementation arm is the load-bearing one: locality-class directives stay in the implementation by the reader partition (§The `# graph:` manifest), so without it they would go dark exactly where they still apply. |
619
+ | `check-spec-pointer` | **Retained, and its corpus depends on the same widening** — not "unchanged" in mechanism, only in assertion logic. It calls the *same* shared `spec_comment_surface` in `canon-kit/lib/spec.sh`; absent that one shared fix a ported gate's `# spec:` line would silently stop being checked in both places it can live — the descriptor and the implementation. Once the primitive gains the `.gate` and `*.rs` arms its own probe logic needs no change. |
620
+ | `check-readme-roster` | **Retained, glob widened** to `*.sh` + `*.gate`. Without it a ported gate silently drops out of its kit README's roster in both directions. |
621
+ | `check-exec-bit` | **Retained, extended**: a `.gate` descriptor must be **non**-executable. Stated as an assertion so "not executable" cannot read as "not covered". |
622
+ | `check-todo-task-liveness`, `check-deprecation-task` | **Retained, corpus extended** to the Rust module and the descriptor, the same shape as `check-comment-tier`: both walk `spec_comment_surface` hunting `TODO(task:)`/deprecation markers, so a marker left in a ported gate's Rust source would otherwise stop being tracked. |
623
+ | `check-knob-default-coupling` | **Retained unchanged, and deliberately *not* corpus-extended** — the extension the shape of this table invites would be vacuous. Its two default idioms are shell (`${KNOB:-v}`, the guarded assignment) and its knob prefixes derive from `gate_kit_roots` members; `native/` is not a kit root and a Rust `const` matches neither idiom, so pointing it at `*.rs` would scan files whose grammar it cannot parse and add zero assertions while reading as coverage. The duplication it therefore cannot reach — the crate's prune-dir default against `lib/gate.sh`'s — is closed by an **executed** assertion instead: a unit test in the crate reads the shell library and compares the two literals, failing on drift. Recorded this way because a disposition that names a mechanism which cannot fire is the same defect as no disposition. |
624
+ | `check-gate-tamper` | **Retained, extended — and the extension is discharged, not pending.** The gate-file roster it recognises (`DELEGATION_KIT_GATE_FILES`) carries the `.gate` spelling on the **kit default** as of the first cohort's descriptors, or a consumer on that default would receive a ported gate whose edits escape the isolation rule (delegation-kit/SPEC.md §Layout and configuration). This repo's own config carried both spellings ahead of the port, which is exactly why the kit default had to be checked separately rather than inferred from a green battery here. Two known limits stand: its exemption reader parses a shell `# exception-list:` array literal and has no Rust-source equivalent, and its meta-layer path roster (`DELEGATION_KIT_META_PATHS`) **does not contain `native/`**, so a commit editing a gate's Rust implementation alongside its descriptor is refused. Neither binds the first cohort — neither ported gate carries an exemption list, and their Rust modules landed in commits separate from their descriptors. |
625
+ | `check-graph`, `check-kit-enum`, `check-gate-fixture-coverage`, `check-enforcement-fresh`, `check-value-rollup-fresh` | **Survive unchanged** — all five read the declaration path as text (directly, or through `enforcement-map.sh`/`footprint.sh`, which do), which the descriptor still is. |
626
+ | `check-gate-binary-fresh` | **Retained by construction — and recorded here before the derivation reaches it, deliberately.** It reads declaration paths as a *set*, to decide whether the binary is load-bearing, and never reads a gate's source, so a port is its trigger rather than its blind spot: a ported member is exactly the case that switches it on. Its couples name `kit:checks/*.gate` specifically, so with **zero descriptors on disk it is not yet substrate-sensitive by assertion C's runtime derivation** and this row is not yet owed — which is why it is written now rather than left to be discovered. The commit that lands the first descriptor makes the gate sensitive and would red on a missing disposition, and that commit's session is the worst possible one to be learning this table exists. Same reasoning as the gate itself: the oracle ahead of the hole (§check-gate-binary-fresh). |
627
+ | `check-gate-substrate-parity` | **Retained by construction** — it is substrate-sensitive by the same derivation it performs, and it reads declaration paths both as text and as a *set*, which is precisely what it exists to see. It stays a shell gate (§check-gate-substrate-parity), so the auditor never depends on the substrate it audits. Its own row is written out rather than left to the section's prose mention: assertion C is satisfied by any occurrence of a member's name in this section, and a gate passing its own assertion by being *discussed* is a coincidence, not a disposition. |
628
+ | `check-docs-cmd`, `check-install-claim`, `check-payload-claim`, `check-prose-enum`, `check-queue-slug-liveness` | **Survive unchanged — reverse triggers.** Each names `scripts/*.sh`/`kit:*.sh` in `couples=` only so that a script change re-runs it; the corpus each actually scans is the governed-doc set, and none reads a gate script's *content* as its assertion target. `check-docs-cmd` is worth naming: it will correctly — not vacuously — red on a doc still fencing a deleted `.sh` path after a port. That is real signal. |
629
+ | `check-spec-embedded-source` | **Survives unchanged — reverse trigger of the same shape.** Its `couples=` extension list (`*.rs`, `*.sh`, `*.toml`, …) is the roster of **languages it recognizes inside fenced blocks**, not a reference to gate declarations; its scanned corpus is the canonical specs and amendments. It already carries `*.rs`, so a ported gate's Rust module is inside its trigger set with no widening. |
630
+ | `check-template-copy-parity`, `check-template-registry-parity` | **Survive unchanged** — their corpus is kit templates and the template registry, not gate declarations; a gate's substrate does not reach either. |
631
+
632
+ **The declared read set's honest limit, stated rather than discovered.** Unit test
633
+ A's coverage is the fixture corpus. That is bounded by a contract rather than by
634
+ luck — every ported gate carries a `good/`+`bad/` pair (§Fixture-pair discipline),
635
+ enforced by §check-gate-fixture-coverage — but a walk reachable only on an input no
636
+ case exercises is observed by nothing, and the declaration for it rests on the
637
+ author. The `?` line exists for exactly that case: a gate whose author cannot bound
638
+ a root declares `?` rather than guessing, and the reader counts it as undecidable
639
+ instead of trusting it as empty. Test A holds a `?` to its arity, not to nothing —
640
+ each one absorbs a single unmatched observed root, so a second undeclared walk still
641
+ reds.
642
+
643
+ **Where that verification runs, and where it does not.** Both unit tests are
644
+ `cargo test`, so they run in this repo and in CI and **never in a consumer tree**:
645
+ `native/` ships no `checks/` and no `smoke/`, so it is not a kit root and no
646
+ consumer ever receives the crate source — there is nothing there to run them
647
+ against and nothing there to edit. That is not a weakening; it makes the division
648
+ explicit. The declaration is held to executed behavior **upstream**, and the
649
+ consumer's own independent check is the `good/`+`bad/` pair, which `init` vendors
650
+ along with every other kit file and which discloses a gate's *shape* without its
651
+ predicate. It also means the gate's consumption path assumes nothing about where
652
+ the binary came from: the invocation is through `GATE_SDK_NATIVE_BIN`, the knob
653
+ every other binary reader uses, and an installed artifact answers `--reads`
654
+ identically to one `cargo` produced.
655
+
656
+ Gates whose corpus is kit directories, smoke scripts or hooks
657
+ (`check-kit-registration`, `check-smoke-entry-guard`, `check-hook-exec-bit`,
658
+ `check-test-hermetic`, `check-assertion-strength`) are not substrate-sensitive
659
+ by the derivation above and are untouched.
660
+
661
+ **Reference-only implementations.** The section carries one further disposition,
662
+ in the other direction: an implementation the binary carries that **no descriptor
663
+ dispatches to**. Assertion B's default reading of that is "a gate nothing
664
+ declares" — dead code, or the residue of a half-finished port — and it is red.
665
+ The exception is an implementation deliberately kept ahead of any live port, so
666
+ that the substrate stays exercised by real tests rather than sitting unproven
667
+ until the next port needs it. That is a disposition, not a licence: naming it
668
+ here is what distinguishes it from the stranded implementation the assertion
669
+ exists to catch, and a subcommand not named here still reds.
670
+
671
+ **The reference-only roster is empty, and an empty roster is not a lapsed rule.**
672
+ It is written out as a sentence rather than left as a missing table, because a
673
+ table nobody can see is indistinguishable from a rule nobody kept. Each
674
+ first-cohort member held a `reference-only` disposition while its descriptor was
675
+ held; the descriptors are live, every implementation is dispatched to, and a
676
+ disposition whose subject is dispatched to would be false. What the emptiness
677
+ records is that **no such subcommand exists today** — never that the allowance
678
+ lapsed. The rule stands unchanged and un-weakened: assertion B still reds a
679
+ subcommand no descriptor dispatches to, and the next implementation carried ahead
680
+ of its port is named here, in this section, or reds. Reading the emptiness as
681
+ permission is the vacuity this section exists to refuse.
682
+
683
+ ## Porting a gate to the binary substrate
684
+
685
+ Slice 1 ported one gate end to end and then **reverted the port**, keeping
686
+ everything else it built. This section is the record of what that cost bought,
687
+ written here rather than left in a commit message because a later reader
688
+ deciding whether to port will read the spec and would otherwise re-attempt it
689
+ into the same wall.
690
+
691
+ **One of the grounds a port is argued on has changed since, and it changed by
692
+ ruling rather than by drift.** The slice was built under the constraint that
693
+ opacity is not claimed, so the case for a port rested on the seam and the
694
+ conservation contract alone. §Consumer payload now rules withholding a gate's
695
+ predicate a goal, which makes opacity a ground a port may argue on — bounded
696
+ exactly as that section bounds it, raised cost of analysis and never
697
+ confidentiality. A later session weighing a port weighs that ruling, not the
698
+ constraint set this record was written under.
699
+
700
+ ### The decisions this substrate already closed
701
+
702
+ Two questions behind the port are settled. Both are recorded here because the
703
+ only surface that ever held them was a queue entry, a compression dropped each,
704
+ and each was then restated from memory rather than read — so this subsection is
705
+ the two of them landing where the component that depends on them can be read
706
+ alone. Reading them does not reopen them. The project-wide register of closed
707
+ rulings is TRAJECTORY.md, which points here for these two rather than restating
708
+ them; the authoring rule that would have prevented both losses is stated where
709
+ it belongs, queue-kit/SPEC.md §check-queue-entry-budget, rather than here.
710
+
711
+ **The substrate language is Rust — ruled 2026-08-02, final.** The alternative
712
+ weighed and refused is **Go**, on three grounds: larger binaries, poorer memory
713
+ management under a primitive garbage collector, and a weaker compiler. The first
714
+ of those is not a matter of taste here, because footprint is a first-class cost
715
+ under the objectives the trajectory pivot records
716
+ (TRAJECTORY.md §The objectives) and the payload ships one prebuilt binary per
717
+ declared target
718
+ (§Consumer payload), so binary size is paid per target on every adopter's
719
+ machine. The comparison had been made in an earlier session and lost with the
720
+ compression that dropped it; it is written down rather than left to the next
721
+ session's judgement.
722
+
723
+ **A bash portability floor was costed and rejected — closed, not deferred.**
724
+ What was costed: shimming or dropping the GNU-only constructs the battery
725
+ depends on — the gate library's nameref and `realpath --relative-to`, gawk's
726
+ three-argument `match()`, `sort -V`, `date -d`, `stat -c`. The blast radius was
727
+ about 25 files, mostly single call sites, with two shared libraries carrying
728
+ most of the leverage, for an estimated two to four small units. It is rejected
729
+ because it cannot deliver the reach it would be bought for: stock macOS ships
730
+ bash 3.2, which no shim reaches, and `mapfile` / `declare -A` appeared
731
+ in 57 of the 96 checks counted that day — so the floor buys BSD-userland
732
+ tolerance and never a stock-macOS install.
733
+
734
+ **That rejection stands on the trajectory pivot, and deliberately not on this
735
+ section's own case for a port.** `native-gate-binary-port` ruled platform reach
736
+ out as a ground for porting, so an argument from reach would contradict the
737
+ entry it sits under. The pivot reinstates reach: it names every major operating
738
+ system and makes the non-technical adopter a design constraint (TRAJECTORY.md
739
+ §The objectives, cited above). Read against those, a floor reaching BSD
740
+ userlands but not a stock macOS install fails an objective rather than a
741
+ preference — and the pivot's own direction, shrinking the interpreter surface to
742
+ the unavoidable, is the one this costing already pointed, which makes the
743
+ costing a step on the trajectory rather than a casualty of it. The narrower
744
+ installer-and-probe trade this does **not** close stays
745
+ `install-path-gnu-userland-undeclared`'s.
746
+
747
+ The figures above are a **dated measurement, not a live claim** about this tree:
748
+ they record what the floor would have cost when it was rejected. A later session
749
+ must not refresh them against the current battery — a recount is a step toward
750
+ re-deciding, and only the operator reopens a closed ruling.
751
+
752
+ ### The port-candidate criteria
753
+
754
+ A gate is a candidate only if **all seven** hold. The first four were stated at
755
+ design time; the last three were paid for, and each is named with what it cost.
756
+
757
+ 1. **Registered** in `gates.list` — an unregistered gate proves no dispatch.
758
+ 2. **Carries a fixture pair** — parity between substrates is proved by running
759
+ both against the same cases, never asserted.
760
+ 3. **`tier=precommit`** — it lands in the generated hook, so a green
761
+ `check-graph` after the port is end-to-end proof the manifest survived the
762
+ substrate change.
763
+ 4. **Not itself substrate-sensitive** — porting a gate that audits gate sources
764
+ makes the parity proof self-referential.
765
+ 5. **Its vendored form stays runnable.** *Measured, not reasoned.* A `.gate`
766
+ descriptor under a vendoring kit root reaches every consumer; the binary does
767
+ not, because `native/` ships no `checks/` or `smoke/` and that predicate is
768
+ what makes a root directory a kit. `gate_command` is fail-closed on an absent
769
+ binary and its exit 2 is a **dispatch-harness** error, so it takes down the
770
+ *calling battery*, not just its own member. A freshly vendored consumer's
771
+ pre-commit battery therefore died on invocation. **The condition that
772
+ satisfies this criterion is ruled**: the payload carries a prebuilt binary
773
+ per declared target, built by the release and never from a working tree; the
774
+ installer resolves the host to a target, verifies the matching artifact
775
+ against a published digest, and copies it — no selection ever builds; and a
776
+ member the host's platform has no artifact for is left out of the consumer's
777
+ `gates.list` and recorded there as an omitted member rather than dispatched
778
+ into an absent binary. The producing half of that model is **built**: the
779
+ publish workflow's roster-derived build matrix emits one binary and one digest
780
+ sidecar per declared target, `scripts/pack-installer.sh` verifies each against
781
+ its sidecar and places them in the payload, and the Release publishes them
782
+ (§Consumer payload). The placing half is **built** too: `init` resolves the host
783
+ to a target, refuses on a digest mismatch rather than warning, and
784
+ omits-and-declares a member whose platform the roster carries no artifact for
785
+ (`native-artifact-install-path`). Both halves of the model therefore ship. What a
786
+ second port waits on is not a build: the first tag publishing binaries as Release
787
+ assets is the operator's call (TRAJECTORY.md), so no adopter can reach a prebuilt
788
+ binary until it is cut. The placement branch does not wait on that tag for its
789
+ evidence — `consumer-smoke-artifact-arm` gave the consumer smoke a leg that builds
790
+ the binary and packs it, so every invocation drives selection, pre-write digest
791
+ verification and placement against a real artifact
792
+ (installer/README.md §The consumer smoke).
793
+ 6. **Its corpus derivation is self-contained**, unless the duplication the port
794
+ creates is machine-held. Found at re-selection, one step earlier than
795
+ criterion 5: `check-spec-fence-balance`, which the amendment named, derives
796
+ its corpus from a config-driven shell derivation and is not `mode=staged`, so
797
+ a ported form must re-implement that derivation with nothing holding the two
798
+ copies together. `check-action-pinning` was selected instead.
799
+
800
+ The qualification the clause carries — *unless the duplication the port
801
+ creates is machine-held* — is what admits a shared-library corpus call like
802
+ `gate_find`, and the distinction is not the presence of a shared call but
803
+ whether a machine notices when the two sides diverge. The crate's single
804
+ sanctioned walk is the binary-side counterpart and its prune-dir default is
805
+ held against `lib/gate.sh`'s by an **executed** unit test (§Meta-gate
806
+ conservation for the binary substrate, the `check-knob-default-coupling`
807
+ row). `check-spec-fence-balance`, the counter-example the criterion was
808
+ written against, is a *config-driven* derivation with nothing holding its two
809
+ copies together at all.
810
+ 7. **Its rule invokes no external program the payload does not carry.** *Found
811
+ at first-cohort selection.* `check-action-run-shell` clears all six above and
812
+ is still unportable: it requires `shellcheck` on `PATH`, refusing when it is
813
+ absent and invoking it per extracted block, so a compiled form would move a
814
+ toolchain requirement from this repo's contributors onto every adopter — the
815
+ dependency floor TRAJECTORY.md objective 1 exists to collapse, against an
816
+ adopter objective 5 admits who will not install a toolchain. git is the one
817
+ sanctioned exception, because it is the floor. Recorded rather than left as a
818
+ silent skip, because every mechanical screen puts that gate *in*: it shares
819
+ the cohort's corpus family and its walk and reads no knob, and the fact that
820
+ excludes it is one none of the six criteria sees.
821
+
822
+ ### The first cohort, and the rule that selects the next
823
+
824
+ **Two members: `check-action-pinning` and `check-action-gh-repo`** — one cohort
825
+ rather than two coincidences, and the pairing is the whole reason. They share one
826
+ corpus derivation byte for byte (§check-action-gh-repo: *"The walk is
827
+ §check-action-pinning's"*), read no knob between them, and declare the same
828
+ single unbounded walk root. The substrate work is therefore done **once** and
829
+ proved **twice**. `check-action-pinning` needed no new implementation at all: the
830
+ crate already carried its rule as the `reference-only` disposition, kept live so
831
+ the substrate would stay exercised until a port needed it, and this cohort is
832
+ what that disposition was held for.
833
+
834
+ **The exclusions are recorded, because the next selector meets them again.**
835
+ `check-memory-off` fails criterion 2 decisively: its `--fixture <dir>` arm is a
836
+ different code path from its live arm, and the live arm's corpus is not in the
837
+ tree at all — it is the harness memory directory under `HOME`. A gate whose
838
+ fixture arm bypasses the derivation being ported has no parity oracle for the
839
+ part that matters, which is criterion 4's self-referential-parity hazard arriving
840
+ through another door. (It also word-splits an override into multiple globs and
841
+ reads four knobs — the weaker ground, recorded second so resting on it does not
842
+ leave the stronger one unwritten.) `check-action-run-shell` is the near miss and
843
+ is criterion 7's own case, above.
844
+
845
+ **The next cohort is the largest set of criteria-clearing gates sharing one
846
+ corpus derivation.** Shared derivation is the axis because it is what made this
847
+ cohort cheap — the walk is ported once and proved N times, and the parity
848
+ comparison is over one corpus shape rather than N. Selecting by kit, by profile,
849
+ or by whatever is easiest next all re-import work this cohort only paid once. Two
850
+ standing bounds the criteria do not carry: **criterion 4 is not relaxed** —
851
+ TRAJECTORY.md refuses that for the first cohort with a named re-entry condition
852
+ (the criterion-clearing corpus exhausted *and* the parity oracle held off the
853
+ shell substrate), and neither holds; and **criterion 7 binds** — a gate whose
854
+ rule shells out to anything but git is out until its dependency is designed away,
855
+ never ported and patched later.
856
+
857
+ **What this cohort landed.** Both rules ship as
858
+ compiled subcommands, proved byte-identical against the shell gates on each
859
+ fixture pair, the live tree and the edge roots — the comparison run **while both
860
+ implementations still existed**, which is the only order in which parity can be
861
+ proved at all, since §check-gate-substrate-parity assertion A forbids a
862
+ descriptor and a script coexisting in one dir. The **descriptors are live**: both
863
+ `.gate` files sit in `gate-sdk/checks/`, both members are registered in this
864
+ repo's `gates.list`, and the two shell scripts they replaced are deleted. **The
865
+ port is therefore proved and live**, and every consequence that follows from a
866
+ live descriptor has arrived with it — the dogfood settlement bites
867
+ (§What the dispatch seam does not settle), the stale-binary path is armed
868
+ (§check-gate-binary-fresh), and the disclosure claim is false and corrected.
869
+
870
+ **The premise the hold rested on was half wrong, and the correction shipped with
871
+ the descriptors rather than after them.** The hold's ground was that a vendored
872
+ `.gate` with no binary behind it reds a freshly installed consumer's battery and
873
+ that the first tag publishing binaries is what clears it. The first half was
874
+ true. **The second half was false**: both binary meta-gates derived their trigger
875
+ by globbing `*.gate` across the resolve dirs and read no registry, so no tag and
876
+ no registry edit could have cleared the red in a tree that legitimately has no
877
+ binary — most sharply every adopter on `init`'s own omit path, whose members are
878
+ dropped from the registry while the descriptors still vendor. The repair is the
879
+ load-bearing predicate §check-gate-binary-fresh states — a declaration is not a
880
+ dispatch — and it is what made these descriptors landable at all. Criterion 5's
881
+ own reasoning is unaffected and stands: a prebuilt binary is still how a
882
+ *dispatching* consumer gets one.
883
+
884
+ **The predicate was necessary and not sufficient, which is the part a later port
885
+ most needs.** It clears every tree that *declares* without dispatching. A tree
886
+ that legitimately **dispatches** and has no binary is a different problem and it
887
+ had a real instance: `run-consumer-smoke.sh` vendors kit roots by copy, and
888
+ site-kit's `smoke/install.sh` registers both members of this cohort because it
889
+ installs the workflow template they lint. No predicate can make that green — a
890
+ registered dispatch with no binary is exactly the harness error `gate_command`
891
+ exists to raise. That harness therefore receives the built artifact now
892
+ (§Consumer smoke), and `check-gate-binary-fresh` left its scratch registry,
893
+ because a consumer tree does not verify a build it did not make. A port that
894
+ lands descriptors checks both halves: which trees *declare*, and which trees
895
+ *register*.
896
+
897
+ ### What the reverted port established
898
+
899
+ Not nothing, and worth separating from what it broke:
900
+
901
+ - Both substrates were **byte-identical** on the fixture pair, on the live tree,
902
+ and on an edge-case tree (uppercase hex, a 39-hex near miss, quoted refs,
903
+ comment leaders, a non-matching dash). The seam carries a gate's rule without
904
+ changing its verdict.
905
+ - The manifest survived the substrate change: the generated hook, the graph
906
+ artifact, and every declaration-reading meta-gate kept working against a
907
+ descriptor.
908
+ - The conservation table was **exercised rather than imagined** — each
909
+ disposition ran against a real ported member.
910
+ - Two relaxations that a port makes tempting were found only because a live
911
+ instance existed: `check-reads-couples` acquired an undocumented
912
+ descriptor-level opt-out (§check-reads-couples), and
913
+ `check-gate-substrate-parity` assertion B turned out to go dark at zero
914
+ descriptors (§check-gate-substrate-parity). Both are fixed; neither would have
915
+ been visible without the port, and neither survives it.
916
+
917
+ ### What is retained, and where the second port stands
918
+
919
+ Retained: the crate at `native/`, the descriptor spelling and its
920
+ specification, the `gate_resolve` / `gate_command` split, the conservation
921
+ contract and its disposition table, `check-gate-substrate-parity` with every
922
+ assertion that section enumerates, the fixture-runner's substrate-blind
923
+ dispatch, the toolchain floor pin, and the CI crate build/clippy/test legs. The
924
+ crate carries **both** first-cohort rules — as **live dispatched** implementations
925
+ since their descriptors landed, having been `reference-only` while those were held
926
+ (§The first cohort, and the rule that selects the next) — so `cargo test` and the
927
+ `native_crate` evidence suite assert against real gate rules rather than going
928
+ green over an empty crate, and the read-declaration unit tests hold a `?` to its
929
+ arity across two members rather than one. Those properties came from the modules
930
+ existing, never from their disposition, so going live changed neither.
931
+
932
+ **The seam was the deliverable; the live port was the demonstration.** A second
933
+ port had two prerequisites, not follow-ups. **The `check-reads-couples` half is
934
+ satisfied:** the binary-side equivalent exists rather than being opted out of — a
935
+ `--reads` arm answering what a member walks, registry-declared and held to executed
936
+ behavior by two crate unit tests, consumed by the gate in place of its refusal
937
+ (§check-reads-couples, §Meta-gate conservation for the binary substrate). It was
938
+ built and proved **without a port**: against the reference-only implementation and
939
+ a hermetic fixture, so no `.gate` member had to be added to a kit to end the
940
+ refusal. **The criterion 5 half is now satisfied, not merely ruled:** how a
941
+ compiled gate arrives in a consumer tree is settled (criterion 5 above), and both
942
+ mechanism halves are built — `native-artifact-publish-path` produces the artifacts
943
+ and digests, `native-artifact-install-path` selects, verifies and places them.
944
+ Neither prerequisite is outstanding, and the second port has since been **built
945
+ and proved**: every member of the first cohort ships its rule as a compiled
946
+ subcommand, byte-identical to the shell gate it reproduces.
947
+
948
+ **What stands between that port and an adopter is narrower than it was read to
949
+ be, and getting the boundary right is what let the descriptors land.** The
950
+ operator-gated first tag that publishes binaries as Release assets
951
+ (TRAJECTORY.md) is a prerequisite to an adopter **dispatching** to the binary: a
952
+ `.gate` descriptor vendors and the binary does not, so a consumer that
953
+ *registers* a ported member before that tag has a member that cannot run
954
+ (§Consumer smoke). It is not a prerequisite to *declaring*, which is what the
955
+ cohort's hold was resting on. A vendored descriptor no consumer registry names
956
+ dispatches to nothing, and the load-bearing predicate
957
+ (§check-gate-binary-fresh) is what makes that distinction machine-held rather
958
+ than merely stated. So the descriptors are live and the tag governs the narrower
959
+ thing it always governed.
960
+
961
+ **What a landing descriptor *carries* is the freshness oracle — and it was already
962
+ in the tree.** A dispatch is what makes the binary load-bearing, and the moment
963
+ one is live, `gate_command` dispatching to a prebuilt binary with no rebuild and
964
+ no freshness check means a skipped rebuild runs the descriptor-named gate against
965
+ a stale implementation. §check-gate-binary-fresh closes that, and it landed
966
+ **ahead** of the first descriptor rather than beside it: with nothing dispatching
967
+ it reports zero and exits clean, so the commit that finally declared one was
968
+ already covered instead of depending on that session rediscovering the hole. The
969
+ oracle is now armed rather than dormant, and the arming cost this repo a
970
+ commit-time `cargo` (§What the dispatch seam does not settle) — which is the
971
+ settlement arriving, not a new prerequisite.
972
+
973
+ ## What the dispatch seam does not settle
974
+
975
+ Recorded because a deferral nobody wrote down is indistinguishable from a
976
+ question nobody asked — and this entry has already lost worked arguments to
977
+ compression once.
978
+
979
+ **Dogfooding is ruled, not deferred: this repo runs built artifacts.** It is
980
+ recorded here rather than left to the first live port because making a compiled
981
+ toolchain a precondition of this repo's own battery is a change to what the
982
+ contract *means*, and settling one in code first is the move
983
+ `init-claim-stickiness` ruled against (TRAJECTORY.md §The closed rulings). Both
984
+ halves hold at once — a port is what *determines* the answer, and the answer is
985
+ written down before the port lands.
986
+
987
+ **The mechanism, stated as a rule rather than as a count.** A registered member
988
+ dispatching to a compiled subcommand at `tier=precommit` puts `gate_command` on
989
+ the pre-commit path, and `gate_command` is fail-closed on an absent binary
990
+ (§lib/gate.sh) — so wherever a `.gate` descriptor is live in this tree, the repo
991
+ builds and runs the binary at commit time and `cargo` is a **commit-time**
992
+ requirement here rather than a build-and-CI one. That is true before and after
993
+ any particular descriptor lands, which is why it is a condition on descriptors
994
+ and not a claim about how many exist.
995
+
996
+ **Where the tree stands.** The rule above has bitten: every first-cohort member
997
+ is registered and resolves to a `.gate` descriptor, so **gates in `gates.list`
998
+ dispatch to the binary and `cargo` is required to commit here.** The toolchain floor pin
999
+ (context-kit/SPEC.md §bin/env-probe) has therefore sharpened from its
1000
+ build-and-CI tier to the **commit-time** tier, and a fresh clone cannot commit
1001
+ until it has run `cargo build --release --manifest-path native/Cargo.toml` once —
1002
+ which `cargo test` does not do (§check-gate-binary-fresh). CI still builds,
1003
+ clippies and tests the crate, and `check-gate-substrate-parity` still reads the
1004
+ binary's `--list` roster whenever it is built; what changed is that those are no
1005
+ longer the *only* things that need it.
1006
+
1007
+ **The trade, in both directions**, recorded because a ruling whose cost is not
1008
+ written down gets reopened by whoever first pays it. It **costs**: the battery
1009
+ depends on a compiled toolchain at every commit, `cargo` moves from a
1010
+ build-and-CI floor to a commit-time one for this tree, and a fresh clone cannot
1011
+ commit until it has built the crate once. It **buys** what the alternative
1012
+ forfeits: running the shell scripts here would keep that toolchain optional and
1013
+ keep the port's headline benefit unmeasurable in the one tree that exercises it
1014
+ daily.
1015
+
1016
+ **And the alternative is not actually available, which is the ground that stops
1017
+ this being re-argued as a preference.** A descriptor and its shell script cannot
1018
+ coexist in one resolve dir (§check-gate-substrate-parity assertion A), and the
1019
+ kit tree this repo runs its gates from *is* the tree that vendors to consumers.
1020
+ There is no arrangement in which a consumer dispatches to the binary while this
1021
+ repo runs the shell script. Ruling *no* would therefore not be "this repo
1022
+ dogfoods differently" — it would be refusing the port outright, against the
1023
+ PRIORITY DIRECTIVE (TRAJECTORY.md). The ruling is forced by mechanism, which is
1024
+ the durable form of the older reading that *porting one gate decides it*.
1025
+
1026
+ **Vendoring has left this section — it is ruled, not deferred.** The slice's
1027
+ claim that it "ships no artifact and changes nothing about how a kit installs"
1028
+ was false in its second half, and shipping no artifact is what made it false:
1029
+ the descriptor vendors and the binary does not, so the slice changed how a kit
1030
+ installs by making one kit's vendored form unrunnable. That is the correction
1031
+ the revert paid for, and the model that answers it is criterion 5's own text
1032
+ (§Porting a gate to the binary substrate) — a prebuilt per-target binary in the
1033
+ payload, digest-verified before it is written, omit-and-declare where the target
1034
+ roster carries no artifact for the host. The payload half of the claim stands
1035
+ unchanged: keeping the manifest as tracked text means hook generation runs
1036
+ consumer-side, so the seam works identically whichever way the payload question
1037
+ rules.
1038
+
1039
+ **The extensibility model has left this section too.** The slice recorded it as
1040
+ "genuinely unchanged", which with no reason stated is indistinguishable from
1041
+ unexamined — and this entry has lost two of its three options to exactly that
1042
+ once already. §The extensibility model rules it.
1043
+
1044
+ **Opacity has left this section — it is ruled, not deferred.** The slice was
1045
+ argued under the reading that opacity is *not* claimed, and that reading is void:
1046
+ §Consumer payload rules withholding a gate's predicate a goal, and states
1047
+ precisely what the claim is and is not. The narrower question the opacity ruling
1048
+ does not reach — whether *this* repo runs built artifacts rather than source —
1049
+ was sharpened by the pivot rather than answered by it, and is now ruled in its
1050
+ own right at the head of this section.
1051
+
1052
+ **The language-agnostic reading is visible and not built.** The layer above the
1053
+ descriptor is substrate-blind (§The `# graph:` manifest), which makes a
1054
+ gate-authoring SDK — the descriptor as the neutral surface of a gate, its
1055
+ predicate in any language — a coherent next thing rather than a wish. Slice 1
1056
+ declines to build or widen to it, and declines to foreclose it; the initiative
1057
+ is carried as its own queue entry so the framing outlives the session that saw
1058
+ it.
1059
+
1060
+ **One thing this slice did not defer.** The manifest-class/implementation
1061
+ SSOT split is *enforced*, not trusted to habit
1062
+ (§check-gate-substrate-parity assertion D) — noted here because the natural
1063
+ outcome for a rule stated only in prose is that the first tired session breaks
1064
+ it.
1065
+
1066
+ ## Consumer payload
1067
+
1068
+ What a gate on the binary substrate **discloses** to the consumer it judges.
1069
+ Its reach is exactly that: it rules what a *gate* ships, not whether this repo
1070
+ runs built artifacts — that is the same lever from the other end, and it is
1071
+ ruled at §What the dispatch seam does not settle. How a compiled gate *arrives*
1072
+ is ruled at §Porting a
1073
+ gate to the binary substrate (criterion 5) and implemented by
1074
+ `native-artifact-publish-path` and `native-artifact-install-path`; this section
1075
+ is what arrives with it.
1076
+
1077
+ **The payload withholds the predicate.** A gate on the binary substrate reaches
1078
+ a consumer as its `.gate` descriptor, its `# spec:` pointer and the SPEC section
1079
+ that pointer binds to, its `good/`+`bad/` fixture pair, and a prebuilt,
1080
+ digest-verified binary. **Its implementation source does not ship.** A consumer
1081
+ receives everything needed to run a gate, act on its verdict, and verify it
1082
+ behaves as specified, and does not receive the rule's text.
1083
+
1084
+ <!-- payload-discloses: predicate-withheld -->
1085
+
1086
+ That marker is the machine tier of the rule the paragraph above states, and this
1087
+ section is its one owner. canon-kit/SPEC.md §check-payload-claim owns what binds
1088
+ the two — a governed doc asserting a different disclosure class is a red rather
1089
+ than a discrepancy a reader has to notice.
1090
+
1091
+ This serves the objective TRAJECTORY.md §The objectives records in full — that
1092
+ opacity is a goal and not a side effect,
1093
+ because withholding a gate's implementation favours *execution* of it over
1094
+ *analysis* of it by the coding agents the gate exists to hold. It reverses the
1095
+ ground the dispatch seam was built under, where opacity was explicitly not
1096
+ claimed; the reversal is a ruled trajectory pivot, and the earlier reading is
1097
+ void wherever it survives.
1098
+
1099
+ **What the objective buys, stated precisely so it is not oversold.** The
1100
+ beneficiary is one failure mode: a coding agent told to make a battery green
1101
+ reads the gate blocking it and edits its way around the predicate instead of
1102
+ fixing the defect. Withholding the source removes the cheapest path to that. It
1103
+ does **not** make the rule secret — a binary is reverse-engineerable, the
1104
+ fixture pair discloses shape, and the SPEC section states the invariant on
1105
+ purpose. The claim is *raised cost of analysis relative to execution*, never
1106
+ confidentiality, and no governed surface may state it as the latter. That bound
1107
+ is what makes the claim honest; it is not a hedge to be softened later.
1108
+
1109
+ **What opacity does not extend to, and why each exclusion is load-bearing.** A
1110
+ withholding rule with no stated boundary grows until the tool is unusable. Four
1111
+ things ship, each because withholding it would break something the product
1112
+ needs:
1113
+
1114
+ - **The `.gate` descriptor**, because its manifest readers must work with no
1115
+ build and no execution — `installer/lib/init.sh` runs `gen-pre-commit.sh
1116
+ --write` in the consumer tree (§The `# graph:` manifest).
1117
+ - **The `# spec:` pointer and its SPEC section**, because a gate that goes red
1118
+ without an explicable invariant is an unactionable block, and an unactionable
1119
+ block is how a blocking gate turns into a bypassed one.
1120
+ - **The gate's own output and help text**, because the remedy line is the
1121
+ product. A gate that says only *no* is worse than no gate.
1122
+ - **The `good/`+`bad/` fixture pair**, which is shipping-side and is the
1123
+ consumer's whole verification oracle once the source is withheld
1124
+ (§Fixture-pair discipline owns what it is evidence of).
1125
+
1126
+ **The target roster is the surface that asserts platform support.** One Rust
1127
+ target triple per live line in the file `GATE_SDK_NATIVE_TARGETS_FILE` names
1128
+ (§Layout and configuration), with one owner and three readers: the publish
1129
+ workflow's roster job derives its build matrix from it, `scripts/pack-installer.sh`
1130
+ packs one artifact directory per line and copies the roster verbatim into the
1131
+ payload as its one publication, and the installer reads that payload copy to
1132
+ select the host's artifact. A hand-maintained platform list inside the workflow
1133
+ would be the maintained roster derivation-first refuses, and would leave the
1134
+ build's idea of the supported set and the installer's idea in two files to drift
1135
+ silently; **a target in the roster that no build leg produced fails the release**,
1136
+ which is the correct place for that failure.
1137
+
1138
+ The installer needs the roster rather than inferring support from a directory's
1139
+ presence because the two cases it must separate look identical without it:
1140
+ *this platform was never committed to* (omit and declare — a supported outcome)
1141
+ and *this platform was committed to and the artifact is missing* (a broken
1142
+ payload — a refusal). Collapsing them silently degrades a supported platform into
1143
+ a green battery over a smaller roster. A payload assembled with no artifacts at
1144
+ all carries no `artifact/` directory and no roster copy, so it reads as the first
1145
+ case and never as a payload whose every target went missing.
1146
+
1147
+ **A roster line is a support commitment, so it is bounded twice.** It may not
1148
+ exceed what the project's own install documentation already states, and a target
1149
+ joins only when a green run has produced and exercised its artifact — not when a
1150
+ platform is reasoned about. Widening is therefore mechanical and cheap by
1151
+ construction: because the build matrix is roster-derived, a new platform is one
1152
+ roster line plus one runner mapping, never a workflow rewrite.
1153
+
1154
+ **One payload carries every declared target, not one payload per target**, and
1155
+ the artifacts are never produced from a working tree: the pack step takes them
1156
+ from the run artifacts the build legs uploaded and builds nothing itself, so a
1157
+ locally-built binary can never substitute for a released one — the same reasoning
1158
+ the vendoring ruling applied to the crate source, arriving one layer out. The
1159
+ one-payload shape is ruled on the numbers: the *installed* footprint is one
1160
+ binary either way, since the installer writes only the matching target, so the
1161
+ difference against a per-target payload is download size alone and is bounded by
1162
+ the roster — while the per-target shape multiplies the publish path, the digest
1163
+ set and the attestation surface by the roster size. **The revisit trigger is a
1164
+ measurement rather than a taste:** the roster growing past what a CI matrix
1165
+ commits to, or one target's binary ceasing to be small.
1166
+
1167
+ **The obligation opacity buys.** A consumer who cannot read the gate has only
1168
+ the publisher's word for it, so the integrity story is the whole of what
1169
+ replaced reading the source. The achievable floor is a published per-target
1170
+ digest verified before the artifact is written (`native-artifact-install-path`).
1171
+ Each build leg writes `<binary>.sha256` beside its binary, in `sha256sum -c`
1172
+ format with a bare filename inside it — the same shape the release already uses
1173
+ for the tarball, and the shape the install page documents a reader verifying.
1174
+ **One producer, two publications, and no recomputation anywhere:** the bytes the
1175
+ build leg wrote are the bytes the payload carries *and* the bytes the Release
1176
+ attaches, because every later hop moves the file rather than re-deriving its
1177
+ contents. A second `sha256sum` on a later job is exactly what lets a published
1178
+ digest and an installed digest diverge while both look computed, so the rule is
1179
+ held mechanically by §check-gate-substrate-parity assertion F rather than by
1180
+ review. Per-artifact sidecars rather than a combined `SHA256SUMS` or a JSON
1181
+ manifest, because an attestation's subject list is `{name, digest}` pairs: a
1182
+ sidecar maps onto a subject one-to-one and `tarball-build-attestation` can later
1183
+ land *beside* these files with no migration and no digest value changing, where a
1184
+ manifest would mint a schema and a version key for the same information.
1185
+
1186
+ The Release publishes the per-target binaries and their sidecars alongside the
1187
+ tarball, renamed per target because Release assets are flat. The **content** of
1188
+ each sidecar is left alone — its bare filename is the name the file carries in
1189
+ the payload, where the machine verification happens, and rewriting it would mint
1190
+ a second spelling of one published fact. What that publication buys is that the
1191
+ digest an installer verifies against has a source outside the payload it travels
1192
+ in; a digest shipped only alongside its own artifact certifies nothing.
1193
+
1194
+ **What the digest proves, at its honest bound.** It is a transfer- and
1195
+ substitution-integrity claim: the artifact in the payload is byte-identical to
1196
+ the one the release built. It is **not** evidence the build host was
1197
+ uncompromised.
1198
+ What that floor does not provide is a reproducible build, and the queue holds
1199
+ that ground as `tarball-build-attestation`: the checksum proves transfer only.
1200
+ The pivot changes what that entry is worth rather than what it says — while
1201
+ sources shipped it was a supply-chain nicety, and with sources withheld it is
1202
+ the consumer's only remaining basis for trust.
1203
+
1204
+ **The rule is held by structure, not by discipline.** It is violated
1205
+ structurally — a ported gate's implementation source reaching the vendoring set,
1206
+ which is exactly the kit roots — so it is checked structurally, by
1207
+ §check-gate-substrate-parity assertion E. The gate a prior reading of this
1208
+ question proposed, a NUL-byte scan enforcing *no artifact ships*, is dropped
1209
+ with its reason on record rather than carried on momentum: it enforced the
1210
+ ruling under which shipping a binary was the violation, and under this one
1211
+ shipping a binary is the point.
1212
+
1213
+ ## The extensibility model
1214
+
1215
+ How a consumer extends the battery, ruled rather than deferred. Three shapes
1216
+ were ever on the table and two of them were dropped once with no rejection
1217
+ recorded, which is how a later session re-derives a settled question from
1218
+ nothing.
1219
+
1220
+ **The shell escape hatch stays first-class.** A consumer authors their own gates
1221
+ as shell in their own resolve dir; resolution stays consumer-first and `.sh`
1222
+ beats `.gate` within a dir (§lib/gate.sh), so a consumer shadowing a ported kit
1223
+ gate with their own script still wins. Withholding a gate's predicate does not
1224
+ narrow this, because it is a choice made on the consumer's own machine about the
1225
+ consumer's own code — it puts no interpreter into the *shipped payload's*
1226
+ dependency floor, which is the floor the trajectory governs. Forbidding it would
1227
+ strand every consumer-authored gate to buy nothing.
1228
+
1229
+ **A declarative check DSL is refused.** A DSL is a language carrying none of a
1230
+ language's tooling, and this repo's own battery is the evidence against its
1231
+ expressible set: the gates carrying real judgment are exactly the ones a rule
1232
+ language would not hold. The declarative half a DSL is wanted for already exists
1233
+ as the `# graph:` manifest, which every reader greps as text with no build
1234
+ (§The `# graph:` manifest).
1235
+
1236
+ **Native plugins are refused**, and §Consumer payload strengthens that refusal
1237
+ rather than weakening it. A dynamically loaded third-party plugin is a stability
1238
+ contract this project would own forever *and* an unattested execution path
1239
+ inside the one artifact whose integrity the pre-write digest verification exists
1240
+ to guarantee. Opacity any loaded object can step around is not opacity. The
1241
+ neutral authoring surface a plugin ABI would foreclose is
1242
+ `gate-authoring-sdk-surface`'s to design, and refusing the ABI is what keeps it
1243
+ open.
1244
+
394
1245
  ## Consumer smoke
395
1246
 
396
1247
  The fixture suites prove each gate in isolation on contrived case dirs, and a
@@ -410,7 +1261,8 @@ temp dir (`git init`, seed commit), vendors each kit root by copy (default:
410
1261
  then argument order. It then commits the installed baseline and asserts the
411
1262
  full battery is green under **zero consumer config** (the positive green token
412
1263
  `All N gates passed` — the defaults-on-a-vendored-tree assertion no fixture
413
- suite makes). Per kit shipping `smoke/violation.sh` it fires one crafted
1264
+ suite makes). It then runs the registration accounting (below) over the union of
1265
+ the vendored kits' gates. Per kit shipping `smoke/violation.sh` it fires one crafted
414
1266
  violation, re-runs the battery, asserts a non-zero exit **and** a `FAIL:`
415
1267
  line naming the expected gate, then restores the tree (`git reset --hard &&
416
1268
  git clean -fd` — a hard reset, not `git checkout`, so a violation that staged
@@ -418,14 +1270,81 @@ its shape is unstaged too: an index-reading gate like `check-gate-tamper` sees
418
1270
  only the index) before the next kit; it asserts green once more after the last
419
1271
  restore. Exit codes follow the gate convention (0 all hold, 1 an assertion
420
1272
  failed, 2 usage/environment); the success token is `CONSUMER-SMOKE: clean
421
- (<n> kits installed, <m> violations fired)`. `--keep` retains the temp dir and
1273
+ (<n> kits installed, <m> violations fired, <r> gates registered, <s>
1274
+ self-declared, <h> hand-declared)`. `--keep` retains the temp dir and
422
1275
  prints its path (the temp-dir write's named reclaim path).
423
1276
 
1277
+ **This harness does not run the installer, and that is what bounds what it
1278
+ proves.** It vendors kit roots **by copy**, so no payload, no digest and no
1279
+ `# omitted:` record are in play: its scratch consumer registers whatever each
1280
+ `smoke/install.sh` registers, and it asserts the **kit defaults** under **zero
1281
+ consumer config**. Proving the *install* path is the installer's own smoke
1282
+ (installer/README.md §The consumer smoke), the one caller that packs a payload
1283
+ and runs `init` against it. The two harnesses must not blur: this one answers
1284
+ *do the kits work when vendored*, that one answers *does the installer deliver
1285
+ them*.
1286
+
1287
+ **It does place the gate binary, and the rule is stated rather than left as an
1288
+ exception, because a reader will otherwise lean on the older
1289
+ no-binary-by-design sentence and find it gone.** The rule: **a vendored member
1290
+ that dispatches must be able to run, so the scratch consumer receives the
1291
+ invoking repo's already-built artifact** (`csmoke_place_binary`, §lib/consumer-smoke.sh).
1292
+ The ground is that a kit root vendoring a `.gate` descriptor is now the ordinary
1293
+ case — the first cohort ships two (§The first cohort, and the rule that selects
1294
+ the next) — and a kit's `smoke/install.sh` may legitimately register a ported
1295
+ member, which `site-kit`'s does: it copies `templates/site-health.yml` in, and
1296
+ that template is the only Actions-shaped surface any install writes, so
1297
+ §check-action-pinning and §check-action-gh-repo earn their scratch-battery slot
1298
+ under *The registration accounting* below. Refusing the binary would have made
1299
+ that registration permanently red and forced the coverage out, which is the
1300
+ opposite of what this harness exists for.
1301
+
1302
+ Three constraints keep the placement from becoming a second install path. It is
1303
+ a **copy, never a build** — the artifact comes from `GATE_SDK_NATIVE_BIN` in the
1304
+ invoking tree, which is already obliged to be current there
1305
+ (§check-gate-binary-fresh), so the harness acquires no toolchain of its own. It
1306
+ lands at the **kit default** path and writes **no consumer config**, deliberately
1307
+ unlike `init`, which places the artifact in the gates dir and points the knob at
1308
+ it — that is the install path and it belongs to the other harness. And it is
1309
+ **derived**: the vendored kit roots are scanned for `.gate` descriptors, so a kit
1310
+ set with no ported gate gets no binary and needs none, while descriptors present
1311
+ with no built artifact is an environment failure (exit 2) rather than a red
1312
+ battery. The placed artifact is **gitignored** in the scratch tree, because the
1313
+ violation phase restores with `git clean -fd`, which spares ignored paths and
1314
+ would otherwise delete it between kits.
1315
+
1316
+ **One registered meta-gate is deliberately not in the scratch battery.**
1317
+ `check-gate-substrate-parity` is registered — it needs no consumer config and a
1318
+ vendored tree is exactly where a descriptor with nothing behind it would land.
1319
+ `check-gate-binary-fresh` is **not**, and the ground is the one §check-gate-binary-fresh
1320
+ states: *a consumer tree does not verify a build it did not make*. Its subject is
1321
+ the crate the binary was built from, §Consumer payload keeps that crate outside
1322
+ every kit root, and no install writes one — so the gate's subject does not exist
1323
+ in a vendored tree at all. It carries **no `# smoke-unregistered:` declaration**,
1324
+ and the absence is the contract rather than an oversight: the probe below derives
1325
+ the exemption every run (exit 2 in the scratch consumer, exit 0 in the invoking
1326
+ repo, the surface genuinely absent), and a written reason where the probe already
1327
+ exempts is the inversion *The declaration valve* names as a finding. Recorded
1328
+ here because a reader finding an omission with no reason beside it will otherwise
1329
+ add one and redden the harness.
1330
+
1331
+ **What a ported gate a `smoke/install.sh` does *not* register looks like.** Its
1332
+ descriptor vendors with the kit root and nothing dispatches to it, so both binary
1333
+ meta-gates read the live registry and report clean, naming the descriptor count
1334
+ beside the dispatching count (§check-gate-binary-fresh). A member a
1335
+ `smoke/install.sh` *does* register while no binary exists still reds, through
1336
+ `gate_command`'s harness error (§lib/gate.sh) — that path is intact, which is
1337
+ why the placement above exists rather than a relaxation.
1338
+
424
1339
  The scratch-consumer build itself — temp dir, seed commit, vendor-by-copy, the
425
- `smoke/install.sh` loop, the installed-baseline commit — is factored into
426
- `lib/consumer-smoke.sh` (`csmoke_vendor_and_install`, which sets `SCRATCH` and
427
- `CSMOKE_INSTALLED`), so a second harness that needs the same green baseline
428
- before it diverges shares the mechanics rather than copying them. The caller
1340
+ binary placement, the `smoke/install.sh` loop, the installed-baseline commit — is
1341
+ factored into `lib/consumer-smoke.sh` (`csmoke_vendor_and_install`, which sets
1342
+ `SCRATCH` and `CSMOKE_INSTALLED`, and `csmoke_place_binary`, which it calls), so a
1343
+ second harness that needs the same green baseline before it diverges shares the
1344
+ mechanics rather than copying them. The placement lives in the shared builder
1345
+ rather than in `run-consumer-smoke.sh` for the reason the factoring exists at
1346
+ all: every caller builds a tree the vendored kits' descriptors are in, so a
1347
+ placement in one caller would leave the others reddening identically. The caller
429
1348
  owns its cleanup trap and every assertion after the baseline commit.
430
1349
  context-kit's `smoke/agents-md.sh` is that second caller: it builds the same
431
1350
  baseline, then converts the consumer to a nondefault agent file (`AGENTS.md`)
@@ -460,7 +1379,9 @@ enforcing it.
460
1379
  `SMOKE_KIT_ROOT` = the vendored copy of the installing kit. The executable
461
1380
  form of that kit's README install steps: register its gates in
462
1381
  `scripts/gates.list`, establish the minimal governed surface its gates need
463
- to be green, and regenerate the hook + graph artifacts. It may assume gate-sdk
1382
+ to be green, and regenerate the hook + graph artifacts. *Which* gates it
1383
+ registers is not the author's discretion — *The registration accounting*
1384
+ below rules on every omission. It may assume gate-sdk
464
1385
  is already installed (it runs first), nothing else. A non-zero exit aborts the
465
1386
  harness with exit 2 (a broken installer is an environment failure, not a gate
466
1387
  finding).
@@ -475,6 +1396,119 @@ enforcing it.
475
1396
  is rightly absent only where no battery-reddening violation is craftable —
476
1397
  a kit that registers no gates has nothing to redden.
477
1398
 
1399
+ **The registration accounting.** A gate earns a scratch-battery slot when it
1400
+ **reads a surface the install writes** — the rule that keeps the smoke proving a
1401
+ vendored kit installs and runs, instead of drifting toward a second copy of the
1402
+ host battery. A gate whose subject no install writes would either pass vacuously
1403
+ or fail-closed on an absent projection, and neither outcome is coverage. The rule
1404
+ binds every kit, and it is **evaluated, not transcribed**: on every run the
1405
+ harness accounts for each shipped-but-unregistered gate, so an omission is either
1406
+ derived-justified or declared, never silent. An unregistered gate is how a live
1407
+ contract violation survives — the harness cannot redden on a gate nothing runs.
1408
+
1409
+ The accounting is one pass in `run-consumer-smoke.sh`, between the green-battery
1410
+ assertion and the violation phase, over the **union**: every vendored kit's
1411
+ `checks/` basenames against the scratch consumer's `scripts/gates.list`. The tree
1412
+ is already built and green at that point, so the pass adds no install and no
1413
+ second tree. Each unregistered gate is run in the scratch consumer and its exit
1414
+ code read against §Output contract's three meanings — the authority here, and the
1415
+ only one (`check-gate-fail-closed` is a static lint over `awk`/`jq` captures and
1416
+ asserts nothing about a gate's behaviour on an absent surface).
1417
+
1418
+ **Both declaration spellings, and the probe dispatches rather than executing a
1419
+ path.** The union is over `check-*.sh` **and** `check-*.gate`, and each probe
1420
+ resolves its invocation through `gate_command` (§lib/gate.sh) instead of running
1421
+ `<dir>/<name>.sh`. Stated because the shell-only reading was live and silent: a
1422
+ gate whose implementation ported left this pass's universe entirely — not
1423
+ probed, not declared, not reported — so the one mechanism that catches an
1424
+ unregistered gate stopped seeing it at exactly the moment its substrate changed.
1425
+ That is the same silent-departure defect §Meta-gate conservation for the binary
1426
+ substrate exists to prevent, arriving through a `bin/` tool that assertion C's
1427
+ runtime derivation cannot reach because it is not a registry member. A ported
1428
+ gate earns or forfeits a scratch-battery slot on the same terms as any other.
1429
+
1430
+ **One reading is not enough, and the second probe is not redundant.** Exit 2 is
1431
+ usage/environment failure *generally* — a missing binary, a malformed config, a
1432
+ non-repo cwd, an empty roster, or an absent subject surface — and only the last
1433
+ is a justified omission. Because the exit-2 verdict grants a **permanent**
1434
+ exemption owing no written reason, ever, it is the one verdict nobody will
1435
+ re-examine; granting it off that ambiguous signal would turn the never-reviewed
1436
+ row into a false-exemption channel, silently and permanently justifying a gate
1437
+ that is merely broken here. So it is **corroborated**: the same gate is re-run in
1438
+ the invoking repo, where the kit's own surfaces exist. An absent-surface gate
1439
+ exits 2 only in the scratch consumer; an environmentally-broken one exits 2 in
1440
+ both. Removing the second probe as belt-and-braces re-opens the channel.
1441
+
1442
+ | probe (scratch consumer) | probe (invoking repo) | verdict |
1443
+ |---|---|---|
1444
+ | exit 2 | exit 0 or 1 | **Justified omission**, self-declaring: the surface it reads is genuinely absent. No written reason owed, now or ever. |
1445
+ | exit 2 | exit 2 | **Not exempt** — broken or environment-dependent, not surface-absent. Declare or red. |
1446
+ | exit 0 | — | Green here and registering costs nothing: an unexplained omission. Red unless declared. |
1447
+ | exit 1 | — | Green nowhere: the gate finds real violations and nothing runs it. **The hiding shape.** Red unless declared. |
1448
+
1449
+ Only the exit-2 rows reach the corroborating probe.
1450
+
1451
+ **Probe first, reasons second.** The exemption is *derived* — recomputed from the
1452
+ tree every run, so it cannot go stale, be forgotten, or be copied wrong. That is
1453
+ its worth, and its worth is not coverage: on a real sweep the derivation justifies
1454
+ only a minority of the unregistered gates and the rest owe a human disposition.
1455
+ What that minority buys is the row that matters most — the permanent exemption
1456
+ owing no written reason ever, the one nobody re-examines — taken out of human hands
1457
+ rather than left to a line written once. The written reason is the valve for the
1458
+ rest, never the mechanism, and an implementation that collects reasons for every
1459
+ unregistered gate and consults the probe afterwards has inverted this contract
1460
+ and is wrong however green it runs. The probe set is self-limiting: a gate that
1461
+ probes green gets registered, which moves it out of the probe set and into the
1462
+ battery, where it was going to run anyway — most of that remainder dispositions
1463
+ exactly that way, which is why the hand-declared count stays small even though the
1464
+ derivation's share of the sweep is a minority. The live figures are deliberately
1465
+ not restated here: the accounting line prints registered / self-declared /
1466
+ hand-declared / unaccounted on every run, and it is the only authority for them.
1467
+
1468
+ **Not derived from the README roster.** The kit's `<!-- gate-roster:begin -->`
1469
+ block already carries full `checks/` parity (`check-readme-roster`) and
1470
+ per-gate annotations naming each gate's subject surface, so deriving
1471
+ `smoke/install.sh`'s registration from it would unify the roster and its
1472
+ reasons on paper. Declined on a boundary, not on merit: it would turn
1473
+ `smoke/install.sh` from an executable install recipe into a derivation over a
1474
+ doc, which is what `kit-owned-install-recipe` (open, design-pending) asks
1475
+ whether a kit's install-time roster should look like at all — deciding that
1476
+ shape from inside this contract would pre-empt it sideways.
1477
+
1478
+ **The declaration valve.** Where a kit author judges an exit-0 or exit-1 omission
1479
+ legitimate — a vacuous pass that is not real coverage is the honest case — that
1480
+ kit's `smoke/install.sh` carries `# smoke-unregistered: <gate-name> — <reason>`
1481
+ beside its registration block: kit-local, sitting where a reader looking at
1482
+ registration already is, and readable off the vendored copy the harness has in
1483
+ hand. Both fields are read, the name to match and the reason into the harness's
1484
+ report. Three shapes of stale valve are findings, all caught at the same
1485
+ transition because a declaration surface's failure mode is going stale: a
1486
+ declaration naming a gate that *is* registered; one naming a gate that kit does
1487
+ not ship; and one naming a gate the probe already exempts — that last is the
1488
+ anti-inversion clause enforced, since a reason written where none is owed is a
1489
+ reason nobody reads and the beginning of a maintained roster. A declaration line
1490
+ missing either field is likewise a finding.
1491
+
1492
+ **The counts are permanent, and the cost is reported rather than cached.** The
1493
+ clean line carries three: gates registered, self-declared (the corroborated
1494
+ exit-2 set), and hand-declared. The hand-declared number is the one that says
1495
+ whether the derivation is decaying into a maintained roster, so it is printed
1496
+ every run rather than left to an audit. The phase's own wall-clock and verdict
1497
+ split ride a second line,
1498
+ `CONSUMER-SMOKE: accounting — <n> unregistered gate(s) probed in <ms>ms (<s> self-declared, <h> hand-declared, <u> unaccounted)`,
1499
+ printed
1500
+ on a red run as well as a green one, since a cost measured only when everything
1501
+ already passes is a cost nobody sees while fixing. If the added wall-clock is
1502
+ material, the sanctioned response is to report it — never to sample, and never to
1503
+ cache a verdict across runs, a cached exemption being a maintained exemption
1504
+ wearing a derivation's clothes.
1505
+
1506
+ **Never at pre-commit.** `run-consumer-smoke.sh` is a `bin/` tool, never a
1507
+ registered gate, so the accounting costs the pre-commit battery exactly nothing.
1508
+ The two sibling callers of `csmoke_vendor_and_install` do not run it: they build
1509
+ the same baseline for a different assertion, and charging them for a verdict they
1510
+ do not consume would be a cost with no reader.
1511
+
478
1512
  **CI tool provisioning.** A gate whose oracle shells out beyond the
479
1513
  checkout+bash baseline (a renderer, a language runtime) is provisioned in the CI
480
1514
  backstop (`gates.yml`), not just locally — a green pre-commit on a dev box that
@@ -491,7 +1525,12 @@ and the first combined tree is where a per-kit-clean template still reddens a
491
1525
  foreign kit's gate. The obligation is mechanical, not ritual: where a kit ships
492
1526
  such a template, its `smoke/install.sh` installs it **verbatim** (no fill-in)
493
1527
  as the governed surface, so a template regression against any kit reddens the
494
- harness instead of waiting for a hand-run validate proof. A template that
1528
+ harness instead of waiting for a hand-run validate proof. That "mechanical" claim
1529
+ is only as good as the scratch battery's coverage, which is why *The registration
1530
+ accounting* above is its enabling mechanism: a template installed verbatim but
1531
+ linted by a gate nothing registers is ritual wearing mechanism's clothes, and
1532
+ that is precisely how a starter queue shipped reddening its own kit's gate with
1533
+ no harness able to see it. A template that
495
1534
  composes with a downstream kit's contract carries that kit's inert scaffold —
496
1535
  queue-kit's starter queue ships lifecycle-kit's iteration header so the
497
1536
  verbatim copy clears the stage gates too, and a single-kit adopter deletes it.
@@ -504,6 +1543,22 @@ by the scripts to copy from their own kit; the harness verdict is consumed by
504
1543
  the validate-stage ritual (which gates on the success token) and is the natural
505
1544
  CI entry point (wiring CI is out of scope here).
506
1545
 
1546
+ The **accounting phase** is produced by `run-consumer-smoke.sh` on every
1547
+ invocation — no enabling knob, since the harness *is* a consumer's
1548
+ `consumer_smoke` validate suite, so the producer is reachable in the real
1549
+ configuration and not only under test. It reads the vendored kits' `checks/`
1550
+ directories, the scratch `scripts/gates.list`, and the vendored
1551
+ `smoke/install.sh` declarations, all present in the scratch tree once
1552
+ `csmoke_vendor_and_install` has run; its findings are consumed by the same
1553
+ harness verdict, adding to an existing channel rather than opening one. Its
1554
+ **three counts** are read on the clean line by the operator at the validate
1555
+ transition, and the hand-declared count specifically by whoever owns the
1556
+ iteration, as the number whose growth says the derivation is decaying into a
1557
+ maintained roster. The **gate exit contract** (§Output contract) gains a second
1558
+ reader in that phase, beside `run-gates.sh` — no gate is modified and none
1559
+ acquires an obligation it did not already carry; what the phase adds is the
1560
+ disambiguation of exit 2, which the contract deliberately leaves general.
1561
+
507
1562
  ## Per-component contracts
508
1563
 
509
1564
  ### lib/gate.sh
@@ -532,6 +1587,59 @@ reader needs outlive the refactor that renames a helper:
532
1587
  so adding a kit enrols its fixtures with no hand-list to drift.
533
1588
  - `gate_kit_roots_rel` emits the roots repo-root-relative — the anchor the
534
1589
  couples globs share.
1590
+ - `gate_native_targets` is the **target roster's single reader**: one Rust target
1591
+ triple per live line, `#`-comments and blank lines stripped by the same
1592
+ `gates_list_members` grammar `scripts/gates.list` uses. An absent roster emits
1593
+ nothing and returns 1, so a caller tells *no roster declared* from *a roster
1594
+ declaring nothing* rather than reading both as no targets — the distinction
1595
+ §Consumer payload's omit-and-declare path turns on. Its two path accessors,
1596
+ `gate_native_targets_file` and `gate_native_bin`, exist so each knob default has
1597
+ one home across the readers that gained one with the artifact path (the publish
1598
+ workflow, `scripts/pack-installer.sh`, §check-gate-substrate-parity).
1599
+ `gate_native_crate` is the third, holding `GATE_SDK_NATIVE_CRATE`'s default and
1600
+ its trailing-slash stripping in one place now that the knob has three shell
1601
+ readers rather than one.
1602
+ - `gate_native_source_stamp` is the **tree side of the source stamp**
1603
+ (§check-gate-binary-fresh) and the only shell spelling of it: the same three git
1604
+ invocations `native/build.rs` bakes into the binary, so the comparison is one
1605
+ algorithm rather than two implementations of one. It emits the stamp, and
1606
+ returns 1 emitting nothing when git cannot answer, so a caller fails closed
1607
+ rather than comparing against an empty string. Any edit here that is not the
1608
+ same edit in `build.rs` is the canonicalization drift git-as-hasher exists to
1609
+ prevent, which is why a crate unit test holds the two to agreement.
1610
+
1611
+ **Resolution splits into a declaration path and an invocation argv.** A gate's
1612
+ implementation may live in a compiled subcommand while its declaration stays a
1613
+ tracked text file, so the two jobs the one resolver used to serve stop having the
1614
+ same answer:
1615
+
1616
+ - `gate_resolve` returns the **declaration path** — the file whose text carries
1617
+ the `# graph:` manifest and the `# spec:`/`# assertion` directives. Within each
1618
+ search dir it tries `<name>.sh` first, then `<name>.gate` (§The `# graph:`
1619
+ manifest names the descriptor). Dir order stays consumer-first and `.sh` beats
1620
+ `.gate` **within a dir**, which is what preserves registry-plus-shadowing: a
1621
+ consumer shadowing a kit's ported gate with its own shell script still wins.
1622
+ Every text reader is unchanged by the second spelling, because
1623
+ `gate_manifest_field` greps the manifest out of whatever path it is handed and
1624
+ has never required the file to be shell. A dir carrying both spellings for one
1625
+ name is ambiguous dispatch and is red (§check-gate-substrate-parity assertion
1626
+ A), never resolved by ordering.
1627
+ - `gate_command` returns the **invocation argv**, one element per line: the
1628
+ one-element `<dir>/<name>.sh`, or the two-element `<binary> <name>`. Its
1629
+ callers are the execution sites — §run-gates, §run-gate-tests, and
1630
+ §gen-pre-commit, which does not execute the argv but *emits* it into the hook.
1631
+
1632
+ The binary's path is the knob `GATE_SDK_NATIVE_BIN` (§Layout and configuration),
1633
+ never a literal. An **absent or non-executable** binary when a registry member
1634
+ dispatches to it is a harness error — **exit 2, never a skip and never a pass**.
1635
+ This is §Fail-closed contract applied to dispatch: the failure a skip would
1636
+ create is a battery that silently stops running a gate whenever a build is
1637
+ missing, which is the worst available outcome. The ruled install model leaves
1638
+ this exactly as it is and makes it unreachable in a correctly installed tree —
1639
+ a member arrives either with its verified artifact or not at all, omitted from
1640
+ `gates.list` and recorded there (§Porting a gate to the binary substrate,
1641
+ criterion 5) — so exit 2 is the backstop for a tree whose binary was deleted or
1642
+ replaced, never the path an unsupported platform takes.
535
1643
 
536
1644
  `fail_closed` must be passed *only* a status that genuinely means the check
537
1645
  could not execute (an awk/jq/parser crash) — never `grep`'s exit 1, which is
@@ -539,21 +1647,41 @@ the expected "no match"; the caller draws that line at the capture site.
539
1647
 
540
1648
  ### lib/inject.sh
541
1649
 
542
- The marker-bounded insert/replace every kit's agent-file injector shares —
543
- one function, `inject_marker_block <file> <begin> <end>`, taking the inner
544
- block content on stdin. It writes `<begin>` + the piped content + `<end>` into
1650
+ The marker-bounded span mechanics every kit's agent-file injector shares — two
1651
+ functions over one notion of a well-formed block.
1652
+
1653
+ `inject_marker_block <file> <begin> <end>` takes the inner block content on
1654
+ stdin. It writes `<begin>` + the piped content + `<end>` into
545
1655
  the target: replacing the span between an existing marker pair (inclusive) in
546
1656
  place, or appending a fresh block when the markers are absent, so a re-run
547
1657
  never duplicates. A begin marker without its end is a malformed target — it
548
1658
  refuses (exit 2) rather than guess the bounds; a missing target file is exit
549
1659
  2. On success it echoes the action taken (`appended`|`replaced`) for the
550
- caller to report. Block-content *generation* stays with the caller (the
551
- lifecycle roster, the doctrine digest) — this helper owns only the placement
552
- mechanism, so a second injector adds no second copy of the awk replace logic:
553
- `doctrine-kit/bin/install-doctrine.sh` and
554
- `lifecycle-kit/bin/install-lifecycle.sh` both ride it. A sourced library, not
1660
+ caller to report.
1661
+
1662
+ `read_marker_block <file> <begin> <end>` is the retrieval half: it prints the
1663
+ existing block's inner content (markers exclusive) on stdout, prints nothing
1664
+ and exits 0 when the marker pair is absent, and refuses on the same two
1665
+ malformed targets its sibling refuses on — a begin marker without its end, and
1666
+ a missing file, both exit 2. The two agreeing on what a malformed target is, in
1667
+ one module, is the point of pairing them: a caller that reads a block before
1668
+ rewriting it must not meet two different answers to the same question.
1669
+
1670
+ The module owns **placement and retrieval, and nothing above them.** Block
1671
+ content *generation* stays with the caller (the lifecycle roster, the doctrine
1672
+ digest), and so does any rule about what to *preserve* out of a block that was
1673
+ read — doctrine-kit's declared-trim round-trip (doctrine-kit/SPEC.md
1674
+ §install-doctrine) is read-compute-emit in that installer, not a preserve rule
1675
+ pushed down here. A preservation parameter on `inject_marker_block` would ship
1676
+ one kit's marker vocabulary to every consumer of a generic injector, which is
1677
+ the provenance seam this split keeps intact; the caller-side shape is the one
1678
+ `bin/gen-pre-commit.sh` already uses for its `gen=manual` regions. So a second
1679
+ injector adds no second copy of the awk replace logic — every marker-bounded
1680
+ projection in the tree rides these two, `doctrine-kit/bin/install-doctrine.sh`
1681
+ and `lifecycle-kit/bin/install-lifecycle.sh` among them. A sourced library, not
555
1682
  a gate: exercised end-to-end wherever an installer that rides it runs
556
- (doctrine-kit and lifecycle-kit `smoke/install.sh`).
1683
+ (doctrine-kit and lifecycle-kit `smoke/install.sh`) — doctrine-kit's covers the
1684
+ read half, through the trim round-trip its acceptor drives.
557
1685
 
558
1686
  ### lib/declaration.sh
559
1687
 
@@ -593,24 +1721,27 @@ the artifact it claims to read. So the helper refuses, and the refusal is what
593
1721
  closes the class permanently: no future markup variant can disarm the assertion,
594
1722
  only red it.
595
1723
 
596
- Callers, all three named: `bin/upgrade-smoke.sh` at its declaration-resolve step
1724
+ Callers, all four named: `bin/upgrade-smoke.sh` at its declaration-resolve step
597
1725
  uses both arms (§upgrade-smoke); this repo's `check-tightened-gates-grammar`
598
- uses the markdown arm's verdict at each note it walks; and
599
- `scripts/check-release-bump.sh` uses the markdown arm's *container* alone,
600
- counting bullets across all three of the note's fixed sections. That third caller
601
- is why the container and the token predicate are separable rather than one pass:
602
- Behavior-changes lead tokens are legitimately prose phrases, so the bump
603
- derivation needs the bullets without the token predicate. Before this helper the
604
- container was stated three times and two of the statements already disagreed —
605
- `section_bullets` matched `- ` at column zero where the smoke matched an
606
- optionally-indented `-` or `*` — so the section a bump was derived from and the
607
- section an allowed-red set was parsed from were not guaranteed to be the same
608
- section. A sourced library, not a gate, so it owes no `good/`+`bad/` pair; its
609
- runtime lock-in is `gate-tests/lib-declaration.test.sh`, direct because the
610
- record arm has no caller fixture to ride. That arm's only caller is the smoke's
611
- untagged branch, and the smoke is a `bin/` tool that forgoes a pair — so a
612
- corpus fixture would leave the arm the standing pre-release assertion depends on
613
- entirely unexercised.
1726
+ uses the markdown arm's verdict at each note it walks; `scripts/check-tightened-gates-note-parity.sh`
1727
+ also uses both arms, comparing a note's `Tightened gates` section
1728
+ (`decl_section_tokens`) against its `DECL_FILE` argument's record set
1729
+ (`decl_record_tokens`); and `scripts/check-release-bump.sh` uses the markdown
1730
+ arm's *container* alone, counting bullets across the note's declaration-bearing
1731
+ sections. That last caller is why the container and the token predicate are
1732
+ separable rather than one pass: Behavior-changes lead tokens are legitimately
1733
+ prose phrases, so the bump derivation needs the bullets without the token
1734
+ predicate. Before this helper the container was stated three times and two of
1735
+ the statements already disagreed on whether a bullet marker could be indented,
1736
+ so the section a bump was derived from and the section an allowed-red set was
1737
+ parsed from were not guaranteed to be the same section. A sourced library, not
1738
+ a gate, so it owes no `good/`+`bad/` pair; its runtime lock-in is
1739
+ `gate-tests/lib-declaration.test.sh`. The record arm is also exercised through
1740
+ `scripts/gate-tests/check-tightened-gates-note-parity`'s own `good/`+`bad/`
1741
+ pair, whose `tightened-gates.txt` fixture drives `decl_record_tokens` via the
1742
+ gate's `DECL_FILE` argument. The direct unit test keeps its place — it is
1743
+ still the arm's runtime lock-in — standing on its own rather than on an
1744
+ absence that is not there.
614
1745
 
615
1746
  The helper carries no section name and no gate name of its own — both are the
616
1747
  caller's arguments, and it takes no configuration. That is where the seam falls:
@@ -648,7 +1779,21 @@ line alone, whose executed-gate count (`All N gates passed.`) is the
648
1779
  roster-collapse tripwire — a battery that silently shrank shows a smaller N. A
649
1780
  failing or erroring member prints its `===== <name> =====` banner and its
650
1781
  captured output verbatim, always — the red path is the feedback channel and
651
- never quiets. `GATE_SDK_VERBOSE` (any non-empty value) restores the full banner
1782
+ never quiets.
1783
+
1784
+ **A declared omission is what keeps that tripwire honest.** A member the
1785
+ installer omitted because no verified binary reached this platform is recorded
1786
+ in the registry as `# omitted: <name> <reason>` (installer/README.md §The gate
1787
+ binary) — a comment line, so `gates_list_members` strips it and N shrinks
1788
+ legitimately. The runner counts those lines and prints the count and its remedy
1789
+ beside the summary, one line per reason token present, so a declared omission
1790
+ stays distinguishable from the regression the tripwire exists to catch. **The
1791
+ line is separate from the summary and carries none of its text**, and that is
1792
+ load-bearing rather than tidy: `run-consumer-smoke.sh` and the installer's own
1793
+ smoke both match the green phrase against this output, so a remedy folded into
1794
+ the summary line would either break their assertion or make the phrase match on
1795
+ a run that omitted half the battery. A registry with no omission lines prints
1796
+ nothing extra, so the zero case adds no output at all. `GATE_SDK_VERBOSE` (any non-empty value) restores the full banner
652
1797
  roll, the on-demand reading for the vacuous-pass tripwire (a "0 files scanned"
653
1798
  clean line is visible only in the gate's own banner). Env over flag by the kit
654
1799
  convention: one mechanism serves the interactive run, the generated hooks, and
@@ -659,7 +1804,7 @@ contract); the runner captures it.
659
1804
  `run-gates.sh --for <path> [<path>...]` is the path-scoped selector, the
660
1805
  agent-callable half of the oracle-first rule: it resolves the registry exactly
661
1806
  as a bare run, then runs only the members whose *effective trigger* (`trigger=`
662
- else `couples=`, expanded through `gate_expand_couples`) glob-matches at least
1807
+ else `couples=`, expanded through `gate_expand_couples_var`) glob-matches at least
663
1808
  one given repo-relative path. Registry order and per-gate output are unchanged;
664
1809
  a bare `run-gates.sh` keeps its behavior. The loop this buys — edit → run
665
1810
  coupled gates → read the verdict+help — is strictly cheaper than reading gate
@@ -672,7 +1817,7 @@ staged-path matching**: the glob step is `gate_staged_matches` in `lib/gate.sh`,
672
1817
  whose body `gen-pre-commit` emits verbatim as the hook's `staged_matches` (the
673
1818
  self-contained hook and the selector share one source, held in sync by
674
1819
  check-graph's freshness assertion §check-graph), and both draw the `# graph:`
675
- fields through `gate_manifest_field` + `gate_expand_couples` — the single reader
1820
+ fields through `gate_manifest_field` + `gate_expand_couples_var` — the single reader
676
1821
  §The `# graph:` manifest names. Two hook behaviors the selector reproduces
677
1822
  beyond that matcher: a `trigger=*` gate is selected for every path, and a
678
1823
  `mode=staged` gate — whose hook branch matches by git pathspec (exact path or
@@ -689,13 +1834,46 @@ non-zero).
689
1834
  ### run-gate-tests
690
1835
 
691
1836
  Golden-fixture runner. Each `<tests-dir>/<gate>/` holds `good/` + `bad/` case
692
- dirs; the runner `cd`s into the case dir and invokes the gate (resolved against
693
- the consumer gates dir, then each vendored kit's `checks/`) with the args in the case's
694
- `args` file (`#` lines stripped). `good/` must exit 0 (and, when
695
- `good/expect.txt` exists, print its substring); `bad/` must exit 1 and print
696
- `bad/expect.txt`'s substring — a rejection substring is required, so the *right*
697
- finding fired. Exit 2 from a gate marks the fixture malformed (harness error,
698
- distinct from logic failure). Fixture-pair hermeticity is the `cd` into the case
1837
+ dirs; the runner `cd`s into the case dir and invokes the gate with the args in
1838
+ the case's `args` file: `#` lines are stripped and the surviving text is
1839
+ word-split on whitespace into argv, **not** taken one argument per line — so an
1840
+ argument containing a space is unexpressible in this file, and any second
1841
+ implementation of the runner (the crate's own parity test among them) must
1842
+ reproduce the splitting rule, not guess it. `good/` must exit 0 (and, when
1843
+ `good/expect.txt` exists, satisfy it); `bad/` must exit 1 and satisfy
1844
+ `bad/expect.txt` — a rejection expectation is required, so the *right*
1845
+ finding fired.
1846
+
1847
+ **The case runs whatever the member dispatches to.** The invocation resolves
1848
+ through `gate_command` (§lib/gate.sh), so a case runs `<binary> <name>` for a
1849
+ `.gate`-declared member exactly where it runs the script for a shell one, and
1850
+ the executable guard applies to the resolved argv's first element. This is what
1851
+ makes the fixture pair an **executed** parity oracle across both substrates
1852
+ rather than a shell-only one — `check-gate-fixture-coverage` asserts a pair
1853
+ *exists* and never runs it, so without this the pair would be an unrun
1854
+ assertion the moment a gate ported. The ordering is binding: a ported gate's
1855
+ pair passes against the subcommand **before** the script it replaces is
1856
+ deleted, never after. argv[0] is absolutized before the `cd`, because the binary
1857
+ knob's default is deliberately a repo-relative path.
1858
+
1859
+ **The output contract is asserted here, at runtime** (§Output contract). A
1860
+ `good/` case must emit the canonical `^<NAME>: clean (<parenthetical>)$` line
1861
+ and a `bad/` case must emit a `help:` remedy line — on top of exit code and
1862
+ `expect.txt`. This applies to **every** fixtured member on either substrate, so
1863
+ it is a strengthening for shell gates too, not merely a replacement for a source
1864
+ grep that a ported gate leaves nothing to read. An `expect.txt` is a **conjunction**: every non-blank line must
1865
+ appear literally in the case's combined output, and the case fails when any one
1866
+ of them does not. So **a case pinning two findings writes two lines**, which is
1867
+ what the plural form is for — the semantics both files share, `good/`'s being
1868
+ optional to supply and identical once supplied. Matching stays
1869
+ **order-independent** (requiring the printed order would couple every fixture to
1870
+ a report ordering several gates do not fix and none contracts, and a fixture
1871
+ pinning two findings cares that both fired, not which printed first), and a
1872
+ blank or whitespace-only line asserts nothing — it is a separator, not a pin, a
1873
+ line `grep -F` would match against any output at all. A failing case names
1874
+ **every** missing line rather than the first, so one re-run resolves the case
1875
+ instead of revealing one absent pin per run. Exit 2 from a gate marks the
1876
+ fixture malformed (harness error, distinct from logic failure). Fixture-pair hermeticity is the `cd` into the case
699
1877
  dir: a gate resolving its `<KIT>_CONFIG_FILE` under the cwd finds only the case's
700
1878
  own files (and a fixture may ship its own cwd-relative config deliberately).
701
1879
  `<tests-dir>/*.test.sh` unit tests run after the pairs; each must exit 0 — and
@@ -717,18 +1895,26 @@ kit (`gate_kit_roots` keys on `checks/` **or** `smoke/` — §lib/gate.sh). A
717
1895
  unit-test-only dir prints `0 pairs` beside its unit count, so the shape reads as
718
1896
  deliberate rather than silent. This widens what a *tests dir* may contain, never
719
1897
  what a *gate* may omit: a registered gate still owes its `good/`+`bad/` pair
720
- (§check-fixture-pair). Rehoming such a test in the owning kit's own runner is
1898
+ (§check-gate-fixture-coverage). Rehoming such a test in the owning kit's own runner is
721
1899
  ruled out — `check-test-hermetic`'s assertion A enumerates
722
1900
  `<kit-root>/gate-tests/*.test.sh` only, so a test outside that directory silently
723
1901
  escapes the bootstrap-or-marker obligation that is the whole reason this lane
724
1902
  lives here. The runner is a
725
- test layer parallel to the gates, never a `gates.list` member.
1903
+ test layer parallel to the gates, never a `gates.list` member — so, like
1904
+ §upgrade-smoke's tool, it owes no `good/`+`bad/` pair of its own and a pair
1905
+ would sit outside `check-gate-fixture-coverage`'s registry authority set,
1906
+ audited by nothing. Its own coverage is the bespoke
1907
+ `gate-tests/run-gate-tests.test.sh`, which drives it over scratch fixture trees
1908
+ to pin the expect-line conjunction above; the inner invocation is bounded by
1909
+ handing it a tests dir holding fixture dirs and **no** `*.test.sh`, so it runs
1910
+ pairs and returns.
726
1911
 
727
1912
  ### run-consumer-smoke
728
1913
 
729
1914
  The scratch-consumer install+violation harness (§Consumer smoke): vendors the
730
1915
  kit roots into a fresh temp repo, drives each `smoke/install.sh`, asserts the
731
- full battery is green under zero config, then fires each `smoke/violation.sh`
1916
+ full battery is green under zero config, runs the registration accounting over
1917
+ every shipped-but-unregistered gate, then fires each `smoke/violation.sh`
732
1918
  and asserts the battery reddens at the named gate before restoring. A `bin/`
733
1919
  tool, never a `gates.list` member — it is pre-commit-unfit by runtime budget
734
1920
  and is the proof that the kit defaults hold on a vendored-kit tree.
@@ -762,6 +1948,26 @@ the `upgrade` validate suite running it (scripts/evidence-config.sh) is its
762
1948
  evidence, at ~2× run-consumer-smoke's cost since it runs the battery twice in
763
1949
  scratch (accepted as validate-stage cost, never pre-commit).
764
1950
 
1951
+ **What it does not cover.** The transition it proves is the *vendored kit
1952
+ directories* moving FROM→TO — phase A replaces them wholesale, in tree. It never
1953
+ re-runs an installer, so a consumer's **cross-version init path** is outside its
1954
+ reach entirely: a green `upgrade` suite is evidence about kit contents, not about
1955
+ whatever activation surface a consumer ships to deliver them. State it here
1956
+ rather than leaving it inferable from the phase-A step list, since the suite's
1957
+ name invites the wider reading.
1958
+
1959
+ **The gate binary sits on the far side of that same limit**, and it is recorded
1960
+ here rather than quietly folded into the determinism assertion. That assertion
1961
+ covers changes under the kit roots plus the two regenerated artifacts; phase A
1962
+ replaces the vendored directories in tree and never runs an installer, so the
1963
+ artifact write is outside its reach entirely and an installed binary is neither
1964
+ a determinism finding nor a determinism exemption. Widening the assertion to
1965
+ name it would claim coverage this tool cannot have. The install path's own
1966
+ idempotence proof is the installer's smoke (installer/README.md §The consumer
1967
+ smoke), which does re-run `init`, and the rule that satisfies it is the
1968
+ manifest's: an on-disk artifact that still verifies against the recorded digest
1969
+ is not rewritten (installer/README.md §The manifest).
1970
+
765
1971
  **The declaration resolves on two arms, both over §lib/declaration.sh's one
766
1972
  token predicate.** A **tagged TO** resolves its version from the `v*` tag
767
1973
  pointing at it and its declaration from the `docs/posts/` note whose front-matter
@@ -775,8 +1981,8 @@ that had to be empty — which no tightening iteration can be until the moment i
775
1981
  is tagged. The empty-declaration rule survives as the narrow case (an empty
776
1982
  declared set still forces an empty red set), not as the universal one.
777
1983
 
778
- **The declaration surface**, `<workflow-dir>/tightened-gates.txt`, is a tracked
779
- checked projection (§The workflow directory) whose path derives from
1984
+ **The tightened-gates declaration surface**, `<workflow-dir>/tightened-gates.txt`,
1985
+ is a tracked checked projection (§The workflow directory) whose path derives from
780
1986
  `GATE_SDK_WORKFLOW_DIR` — no knob of its own, since a knob naming this file would
781
1987
  add a way to configure the assertion away without adding a way to satisfy it
782
1988
  honestly. It always exists, header-only when the declared set is empty, so
@@ -833,7 +2039,7 @@ the script pre-upgrade; it is consumed by the validate session's evidence file
833
2039
  emitted by the script itself, so the zero-config run works here) and read only
834
2040
  at the resolve step. The declaration path is derived from `GATE_SDK_WORKFLOW_DIR`
835
2041
  at the same step. The tightened-gates declaration is produced by the build stage
836
- that lands or tightens a gate, appending to the declaration surface, and composed
2042
+ that lands or tightens a gate, appending to that surface, and composed
837
2043
  by close into the note at the release boundary; it is consumed at three named
838
2044
  transitions — here at the resolve step on either arm (the allowed-red-set parse),
839
2045
  by close when it composes and drains, and by the upgrade skill reading the note
@@ -842,7 +2048,10 @@ two-arm resolution: it reads the *note*, which is unchanged as an artifact, and
842
2048
  only the note's Tightened-gates section changed its source. The grammar's owner
843
2049
  is docs/install.md §The upgrade contract; its implementation is
844
2050
  §lib/declaration.sh, and this repo holds the corpus to it with
845
- `check-tightened-gates-grammar`.
2051
+ `check-tightened-gates-grammar`. The surface has a second consumer-side reader:
2052
+ `check-tightened-gates-note-parity` compares it against the note composed from it
2053
+ while that note is still untagged, so the compose-then-drain flow specified here
2054
+ is held equal at its one comparable moment rather than by review.
846
2055
 
847
2056
  ### gen-pre-commit
848
2057
 
@@ -867,7 +2076,7 @@ failure report as before) or when `GATE_SDK_VERBOSE` is set, and a fully green
867
2076
  hook run prints one summary line carrying its executed-invocation count. The
868
2077
  wrapper lives in the emitter's heredoc, so the freshness assertion carries any
869
2078
  change into the committed hooks. A `trigger=`/`couples=` `kit:<glob>` token is emitted *expanded*
870
- (via `gate_expand_couples`), so adding a kit later reddens `check-graph`
2079
+ (via `gate_expand_couples_var`), so adding a kit later reddens `check-graph`
871
2080
  (committed hook ≠ `--emit`) until regeneration — the freshness gate keeps the
872
2081
  static hooks honest across a kit-set change.
873
2082
 
@@ -892,6 +2101,10 @@ named in `GATE_SDK_LINT_EXTRA_DIRS` passes ShellCheck at `-S warning` (the
892
2101
  self-lint contract). A missing `shellcheck` binary is exit 2 — a gate that
893
2102
  cannot run is not clean.
894
2103
 
2104
+ A `.gate`-dispatched member is outside this corpus **with cause** — there is no
2105
+ shell to lint, and `cargo clippy` at deny-warnings is the substrate equivalent
2106
+ (§Meta-gate conservation for the binary substrate, which owns the reasoning).
2107
+
895
2108
  That derivation is also the answer to "does anything lint my workflows?", and on
896
2109
  its own the answer is no: `.github/workflows/*.yml` sits under no kit root and
897
2110
  under no gates dir, so it is unreached here by construction. §check-action-run-shell
@@ -940,6 +2153,12 @@ expected, here-string captures read data already in memory, and arithmetic
940
2153
  `$((…))` is never matched. A parser wrapped inside a shell function is not
941
2154
  visible to this static scan; the opt-out covers residual false positives.
942
2155
 
2156
+ A `.gate`-dispatched member is outside this corpus **with cause**: the defect —
2157
+ branching on a captured value's emptiness when the subprocess died — is
2158
+ unrepresentable once a fallible call returns a `Result` that cannot be ignored
2159
+ (§Meta-gate conservation for the binary substrate). A real substrate win, not a
2160
+ gap.
2161
+
943
2162
  ### check-gate-fixture-coverage
944
2163
 
945
2164
  Invariant: every `gates.list` member either ships a `{good,bad}/` fixture pair
@@ -973,6 +2192,377 @@ its marker and the contract. A first paragraph that embeds the literal pattern
973
2192
  in example prose self-matches — the failure is loud (a false positive forcing
974
2193
  a reword), never a silent miss, so it is accepted. Requires GNU awk.
975
2194
 
2195
+ ### check-gate-substrate-parity
2196
+
2197
+ Holds the dispatch seam honest: a gate's implementation may move to a compiled
2198
+ subcommand, but not by quietly deleting the declaration other gates read or the
2199
+ record of what that move costs. Usage
2200
+ `check-gate-substrate-parity.sh [gates-dir] [conservation-doc]`; the two-arg form
2201
+ steers the fixture pair onto hermetic copies of each surface. Six assertions.
2202
+
2203
+ - **assertion A — declaration uniqueness.** Each `gates.list` member resolves to
2204
+ exactly one declaration. A dir carrying both `<name>.sh` and `<name>.gate` is
2205
+ ambiguous dispatch and is red, rather than being silently settled by
2206
+ `gate_resolve`'s within-dir precedence: that precedence exists so a consumer
2207
+ can *shadow* a kit's gate, and using it to paper over a half-finished port
2208
+ would hide the state a port passes through.
2209
+ - **assertion B — subcommand parity, both directions.** The set of `.gate`
2210
+ descriptors across the resolve dirs equals the binary's reported subcommand
2211
+ roster (`--list`). A descriptor naming no subcommand is a gate that cannot
2212
+ run; a subcommand with no descriptor is a gate nothing declares — unless the
2213
+ conservation section dispositions it `reference-only`, the one allowance and
2214
+ the reason it is recorded there rather than in the crate (§Meta-gate
2215
+ conservation for the binary substrate). With the binary **load-bearing** and
2216
+ absent or non-executable the gate exits 2, never 0 — the §Fail-closed
2217
+ contract, since "cannot verify" and "verified equal" must not share an exit
2218
+ code. Load-bearing is the predicate §check-gate-binary-fresh states: a
2219
+ registered member resolving to a `.gate`, never a descriptor's mere presence
2220
+ on disk. **What that arm deliberately does not weaken** is the roster half.
2221
+ **The two halves are gated separately, and that is the correction the
2222
+ reverted port paid for**: the roster half runs whenever the binary is
2223
+ *readable*, descriptor count and registry both irrelevant. Collapsing the two
2224
+ onto one predicate is the obvious simplification and it re-opens the exact
2225
+ hole the revert closed — the roster half is what catches a stranded
2226
+ implementation, and it must not go dark because nothing happens to dispatch. Under the original single guard —
2227
+ the whole assertion behind `descriptors > 0` — a tree with zero descriptors
2228
+ skipped both directions, which is precisely the state an unported tree is in
2229
+ and the one a stranded implementation hides in. The remaining gap is stated
2230
+ rather than closed: with no descriptors *and* no built binary there is nothing
2231
+ to read, so the assertion counts zero and says so in its clean line. Demanding
2232
+ a build artifact from every reader would re-import, into the auditor, the
2233
+ build-time coupling the revert removed. **The roster is over subcommands
2234
+ alone**: the binary's top-level flags (`--list`, `--reads`, `--source-stamp`)
2235
+ are outside it by construction, handled in the top-level dispatch and never
2236
+ entering the gate registry. Stated because the assertion's behavior does not
2237
+ change but a reader adding a fourth flag needs to know it is not a parity
2238
+ violation — a flag that *leaked* into `--list` would read here as a subcommand
2239
+ with no descriptor and red as a stranded implementation.
2240
+ - **assertion C — disposition coverage.** Every substrate-sensitive member
2241
+ carries a disposition line in §Meta-gate conservation for the binary
2242
+ substrate. The set is **derived at runtime** — a member whose expanded
2243
+ `couples=` covers the declaration path of a registry member — so it cannot
2244
+ drift from a maintained roster. **This is the anti-vacuity assertion**: a new
2245
+ meta-gate over gate source, added later by a session that never read the
2246
+ conservation section, reds until its disposition is recorded.
2247
+ - **assertion D — one writable home for the manifest.** No file under the
2248
+ implementation tree (`GATE_SDK_NATIVE_SRC`, default `native/src`) carries a
2249
+ manifest-class annotation. The comment leader is matched as `#`, `//` or
2250
+ `/*`, so the assertion is **language-agnostic**: it holds for whatever
2251
+ language sits behind a descriptor, not for Rust alone. This enforces the
2252
+ reader partition below, and it is a live assertion rather than a convention —
2253
+ two writable sources of one truth drift silently, and this is the truth every
2254
+ build-free reader depends on.
2255
+ - **assertion E — no implementation source inside the vendoring set.** The
2256
+ ruling of §Consumer payload is withholding a gate's predicate, and what a
2257
+ consumer receives is exactly the kit roots (`gate_kit_roots`), so the ruling
2258
+ is violated structurally and is checked structurally in two halves. **No
2259
+ implementation sibling:** for every `<name>.gate` the resolve dirs declare, no
2260
+ file named `<name>.<ext>` exists anywhere under any kit root — the natural
2261
+ mistake of putting a ported gate's implementation beside its descriptor, where
2262
+ it vendors. **The crate root is outside every kit root:**
2263
+ `GATE_SDK_NATIVE_CRATE` resolves to no path under any `gate_kit_roots` member.
2264
+ That half is the non-vacuous one in an unported tree, and it reds on the single
2265
+ edit that would silently undo the whole ruling — relocating the crate to give
2266
+ it a ride into the payload. It is folded into this gate rather than shipped as
2267
+ its own because the descriptor set it reads is the one this gate already
2268
+ derives, and a separate gate would duplicate that derivation to add nothing.
2269
+
2270
+ Three calibrations, each drawing a boundary rather than trimming for
2271
+ convenience. The extension test is **extension-agnostic**: any extension but
2272
+ the two spoken for reds, because a roster of implementation languages is a
2273
+ maintained set that rots and would contradict assertion D's own
2274
+ language-agnosticism. `.gate` is spoken for by the descriptor itself and `.sh`
2275
+ by assertion A, which owns within-dir ambiguity and by §Layout and
2276
+ configuration sanctions a consumer's shell shadow of a ported gate. And an
2277
+ **extensionless** name is deliberately out of reach: a built artifact named
2278
+ after its gate is an artifact-placement question this section does not own, and
2279
+ an assertion that reds on it would prejudge one. The honest residual, stated
2280
+ rather than discovered: with no descriptors declared the sibling half scans
2281
+ nothing and says so in its clean line — an unported tree has no ported gate's
2282
+ source to misplace, and the crate half stays live throughout.
2283
+ - **assertion F — one owner for the target roster.** §Consumer payload rules the
2284
+ roster the single surface asserting platform support, and prose cannot hold
2285
+ *no second spelling* — so the three ways that ownership breaks are checked
2286
+ here rather than at review. **The roster is well formed:** every live line of
2287
+ `GATE_SDK_NATIVE_TARGETS_FILE` is a `<arch>-<vendor>-<os>[-<env>]` triple and
2288
+ the file is non-empty, because a roster asserting no platform support cannot be
2289
+ the surface that asserts it. **The build matrix is roster-derived:** every value
2290
+ in a `matrix:` declaration of `GATE_SDK_NATIVE_PUBLISH_WORKFLOW` is a GitHub
2291
+ expression, never a literal — a hand-written platform there is a second
2292
+ spelling of the support commitment. The runner mapping is untouched by this and
2293
+ deliberately so: it is a *runner selection*, not a support declaration, and it
2294
+ is the one place a platform name may appear in the workflow. **Each digest has
2295
+ one producer:** a step *computes* a digest when it invokes `sha256sum` without
2296
+ `-c`; no job may compute more than one, and a job that downloads a run artifact
2297
+ and uploads none may compute none at all. Verification (`sha256sum -c`) is
2298
+ unrestricted — it is what `pack-installer.sh` and the installer do, and it is
2299
+ the opposite of the failure being prevented.
2300
+
2301
+ Two absences are reported rather than red, and each for a stated reason. A
2302
+ **missing publish workflow** is not a publish path to audit: a consumer whose
2303
+ release rides elsewhere points the knob at it, and one with no release at all
2304
+ has nothing here to get wrong. A **missing roster** is red only in a
2305
+ **publishing** tree that also **dispatches** — both conditions, and each one
2306
+ removes a different false red. Dispatch, because a *declaration* needs no
2307
+ prebuilt binary and a descriptor-count trigger would red every vendored tree
2308
+ the moment the first cohort's descriptors ship. Publishing, because declaring
2309
+ platform support is the act of the tree that *builds and publishes* the
2310
+ artifact: a consumer receives the kit roots and never the crate, so its roster
2311
+ is absent **by construction** (§Consumer payload) while it may perfectly well
2312
+ dispatch to a binary it was given. The publishing test is *the crate's tracked
2313
+ source is here* — step 1 of §check-gate-binary-fresh's source stamp, reused
2314
+ rather than spelled a second time, and deliberately **source** rather than
2315
+ directory presence, so build output or a placed artifact under the crate root
2316
+ cannot make a consumer look like a publisher. Together they keep the assertion
2317
+ from being either vacuous in this repo (which has a roster, registers both
2318
+ ported members, and is checked in full) or hostile to a consumer that has no
2319
+ crate.
2320
+
2321
+ It stays a **shell** gate: a gate that audits the port is not a gate the port
2322
+ may consume, or assertion B would be checking a roster through the very binary
2323
+ whose roster is in question.
2324
+
2325
+ Its coverage is split across two oracles because the descriptor configurations
2326
+ cannot all live in one fixture pair — a pair is one invocation each — and naming
2327
+ where each is proved is what keeps the split from reading as a hole. The
2328
+ `good/`+`bad/` pair covers **descriptors and a binary** (parity both ways, the
2329
+ reference-only allowance, and each refusal). The bespoke
2330
+ `gate-tests/check-gate-substrate-parity.test.sh` holds the rest, each case a
2331
+ sandbox rather than a live tree: **no descriptors, binary present** — the
2332
+ post-revert tree, where the roster half is the only live half; **no descriptors,
2333
+ no binary** — a vendored tree, where the gate must run clean rather than
2334
+ fail-close, the configuration the reverted port made unreachable; **descriptors
2335
+ present, none dispatching, and no roster** — every vendored tree once the first
2336
+ cohort's descriptors ship, where the fail-closed arm *and* assertion F's
2337
+ missing-roster arm must both stay quiet; and the near miss, **a registered member
2338
+ resolving to a descriptor with no binary**, which must still exit 2. The last two
2339
+ are the corrected predicate's own boundary, and a too-loose predicate passes the
2340
+ `good/` case and reds only there.
2341
+
2342
+ **Why those configurations are held in fixtures rather than assigned to live
2343
+ trees.** A coverage claim naming a tree is only as durable as that tree's
2344
+ configuration, and a landing cohort changes configurations: this repo registers
2345
+ every ported member, and the smoke consumer carries their descriptors. A claim
2346
+ that quietly stops being true is worse than none, so each configuration lives
2347
+ where nothing but an edit to the test can change it.
2348
+
2349
+ **Assertion E's couples were widened for it, and the widening is the finding.**
2350
+ The manifest carried `kit:checks/*.sh,kit:checks/*.gate`, which covers neither
2351
+ subject assertion E reads: not a non-shell file dropped beside a descriptor, and
2352
+ not the crate root at all. An assertion that never re-fires is an assertion that
2353
+ never runs, so the couple became `kit:checks/*` — the one location the sibling
2354
+ mistake lands — plus `native/*` for the crate root a relocation stages away
2355
+ from. What stays uncoupled is the recursive sweep of every kit root: coupling a
2356
+ whole kit root recursively would fire this gate on nearly every commit to buy a
2357
+ trigger for a case the full battery already reaches, and the sweep reads file
2358
+ *names*, never file content, so there is no content surface to bind.
2359
+
2360
+ It is registered in gate-sdk's consumer-smoke install: it needs no consumer
2361
+ config, and a vendored tree is exactly where a descriptor with nothing behind it
2362
+ would land.
2363
+
2364
+ ### check-gate-binary-fresh
2365
+
2366
+ Invariant: **whenever a `.gate` descriptor makes the binary load-bearing, the
2367
+ binary was built from the source now in the tree.** Usage
2368
+ `check-gate-binary-fresh.sh [gates-dir] [tree-stamp-file]`.
2369
+
2370
+ **What makes the binary load-bearing — the predicate both binary meta-gates
2371
+ share.** A `.gate` file on disk is a **declaration**. A **registered member
2372
+ resolving to** a `.gate` file is a **dispatch**. Only the second makes the binary
2373
+ load-bearing, and only the second can run stale. This is not a new rule but this
2374
+ section's own zero-descriptor reasoning applied at the right granularity: the
2375
+ clean report below is grounded on *no gate dispatches to the binary*, and reading
2376
+ "a descriptor exists" as "a gate dispatches" is what was wrong. A member
2377
+ `gates.list` does not carry — never registered, or registered and then commented
2378
+ out by `init`'s `# omitted:` record, which the runner already strips from the live
2379
+ set — dispatches to nothing.
2380
+
2381
+ It needs **no new field, no marker file and no new knob**: the omission record
2382
+ `init` already writes removes the member from the live registry, so one predicate
2383
+ covers the omit path, the unregistered-in-a-vendored-tree case, and the
2384
+ fully-registered case, with nothing to keep in sync. The registry is read at one
2385
+ decision — is any live member's declaration a `.gate` — and both counts are named
2386
+ in every report, because *no descriptors* and *descriptors nothing dispatches to*
2387
+ are different tree states that must not share a report line. An **absent**
2388
+ registry is exit 2 rather than a clean report: the live member set is what the
2389
+ verdict turns on, so a tree that cannot produce one is "cannot verify".
2390
+
2391
+ **Getting this predicate wrong fails silently in both directions, which is why it
2392
+ is stated rather than left to the code.** Too loose and a stale binary passes
2393
+ unnoticed; too tight and every tree that vendors a descriptor it does not
2394
+ register reds — including a real adopter on `init`'s own omit path, whose battery
2395
+ would exit 2 on every run and defeat that design's promise that a re-run on a
2396
+ machine that has since gained a hasher converts the member back into a live one
2397
+ with no hand edit.
2398
+
2399
+ **This gate is not a consumer gate: a consumer tree does not verify a build it
2400
+ did not make.** Its subject is the crate the binary was built from, and the
2401
+ tree-side stamp is `git -C <crate> ls-files` over that crate's tracked source.
2402
+ §Consumer payload keeps the crate outside every kit root, so it is never
2403
+ vendored and **no consumer tree has one** — the gate's subject does not exist
2404
+ there, and it exits 2 ("cannot verify") however the binary arrived. That is the
2405
+ right verdict rather than a defect to patch: §Fixture-pair discipline already
2406
+ rules that a consumer's question "is not *did my build come out right* — that
2407
+ question does not exist for a consumer", and the consumer's own oracle is the
2408
+ digest (which artifact arrived) plus the fixture pair (what it does). So the gate
2409
+ runs in a **building** tree, this repo and CI, and is deliberately absent from
2410
+ the consumer smoke's scratch registry, where the accounting derives its exemption
2411
+ every run rather than accepting a written one (§Consumer smoke).
2412
+
2413
+ §check-gate-substrate-parity assertion B diffs the descriptor set against the
2414
+ binary's `--list` roster — set membership only, never the binary's *content*
2415
+ against the source it was built from. `gate_command` dispatches a
2416
+ `.gate`-declared member straight to the prebuilt binary with no rebuild and no
2417
+ freshness check, so editing a gate's Rust source, skipping the rebuild, and
2418
+ committing runs the descriptor-named gate **against the stale binary**, where it
2419
+ passes on the old implementation. A gate reporting clean on code that is not what
2420
+ is committed is the vacuous green the whole battery exists to refuse.
2421
+
2422
+ **git is the hasher, and that is the ruling the design turns on.** The crate
2423
+ declares no dependencies at all, so a content digest is not free: adding a digest
2424
+ crate puts a first dependency into the artifact every adopter's machine carries,
2425
+ and hand-rolling SHA-256 puts a cryptographic primitive into a crate whose point
2426
+ is being small and auditable-by-fixture. Hashing is also the classic place two
2427
+ implementations drift — a Rust digest and a shell digest over "the same" input set
2428
+ are one canonicalization disagreement away from a permanent false red. git is
2429
+ already the sole runtime dependency the trajectory commits to, shelled out rather
2430
+ than embedded, and content-addressed hashing is its native operation. So both
2431
+ sides call **the same tool with the same arguments**: one algorithm, rather than
2432
+ two implementations of one algorithm.
2433
+
2434
+ **The source stamp.** git's content identity for the crate's tracked source set,
2435
+ computed by three invocations that are identical on both sides:
2436
+
2437
+ 1. `git -C <crate> ls-files` — the input set is **derived, never maintained**.
2438
+ Neither side carries a roster of which files matter, so neither can carry a
2439
+ stale one. The honest cost is named rather than discovered: an edit to a
2440
+ non-code tracked file such as the target roster changes the stamp and asks for
2441
+ a rebuild although it changes no code. Rare, harmless, and strictly better than
2442
+ a hand-maintained roster that silently omits the file that mattered. The
2443
+ ordering is `ls-files`' own index order, which is byte-sorted by path — taken
2444
+ rather than re-derived, because a `sort` on either side would be a
2445
+ locale-sensitive second canonicalization of exactly the kind this design
2446
+ refuses.
2447
+ 2. `git -C <crate> hash-object -- <path>…` — each input's blob hash over the
2448
+ **worktree** content, not the index, because the worktree is what `cargo`
2449
+ compiled and an index-derived stamp would go green on a build made from
2450
+ unstaged edits.
2451
+ 3. Those hashes joined with their paths into one listing, hashed again by
2452
+ `git -C <crate> hash-object --stdin`.
2453
+
2454
+ **Its honest limit, stated rather than discovered:** an **untracked** new source
2455
+ file is invisible to `git ls-files`, so it is compiled but not stamped. This is
2456
+ bounded by the same fact that makes the stamp worth having — an untracked file is
2457
+ not in the commit either, so the state the gate governs is exactly the state the
2458
+ stamp describes. A file added and staged in the same commit is tracked at the
2459
+ gate's read and is covered.
2460
+
2461
+ **The two sides.** The producer is `native/build.rs`, which bakes the stamp in as
2462
+ a compile-time constant and is re-run by `cargo:rerun-if-changed=` on exactly the
2463
+ two events that can change it: each tracked input's own path, for a content edit;
2464
+ and the git index, because the index is the only way a file enters or leaves
2465
+ `git ls-files`. Deliberately no directory sweep — one would drag `target/` in and
2466
+ rebuild the crate against its own output. A build that cannot compute the stamp
2467
+ **fails the build** rather than emitting a sentinel: a binary with no stamp is
2468
+ exactly the artifact no freshness oracle can hold, and the crate builds inside its
2469
+ own git checkout by construction (§Consumer payload keeps it out of every kit
2470
+ root, so it is never vendored). The tree side is `gate_native_source_stamp`
2471
+ (§lib/gate.sh), the one shell home of the same three invocations.
2472
+
2473
+ **The comparison.** With ≥1 descriptor the gate runs `<binary> --source-stamp`
2474
+ (§Porting a gate to the binary substrate), computes the tree-side stamp, and reds
2475
+ on a mismatch. The failure text names both stamps, the descriptors that dispatch
2476
+ to the binary, and the rebuild command, so the remedy is in the output rather than
2477
+ in a reader's memory.
2478
+
2479
+ **Running the crate's tests does not discharge the rebuild, and this is measured
2480
+ rather than reasoned.** `cargo test` compiles its own harness — a different
2481
+ artifact from the binary `GATE_SDK_NATIVE_BIN` names, which is what this gate
2482
+ reads. A full `cargo test --release` can pass every test in the crate, including
2483
+ the one proving both substrates compute the source stamp identically, and leave
2484
+ this gate red on the stamp baked into a stale binary. So the obligation is
2485
+ `cargo build --release` as **its own named step**: a tree with a live descriptor
2486
+ must build the binary before it commits, and a contributor routine that states a
2487
+ `cargo test` line has not stated that step. Recorded here because the omission is
2488
+ invisible from a green test run — the exact shape of vacuous green the section
2489
+ above exists to refuse.
2490
+
2491
+ **Trigger coupling: nothing dispatching is a clean report, not a skipped
2492
+ assertion.** No gate dispatches to the binary, so nothing can run stale — the same
2493
+ coupling shape assertion F uses for the target roster, reused rather than
2494
+ re-invented, and since this unit both arms read the same predicate rather than
2495
+ merely the same shape: a consumer with no crate is not a consumer with a defect.
2496
+ With ≥1 **dispatching** member an absent or non-executable binary is **exit 2**,
2497
+ not a violation — the §Fail-closed contract, and the same verdict `gate_command`
2498
+ already gives, since "cannot verify" and "verified fresh" must not share an exit
2499
+ code.
2500
+
2501
+ **Why this is deliberately *not* assertion B's split-halves shape, which a reader
2502
+ one section away will otherwise think is owed here.** Assertion B was corrected to
2503
+ run its roster half whenever the binary is merely *readable*, descriptor count
2504
+ irrelevant, because a single `descriptors > 0` guard made the whole assertion go
2505
+ dark in precisely the unported state. That correction does not transfer, on two
2506
+ grounds this section states rather than leaves to be re-derived. A stranded
2507
+ subcommand is a defect whatever the descriptor count; a stale binary **nothing
2508
+ dispatches to** is not a defect at all — it is an unbuilt artifact. And comparing
2509
+ whenever a binary happens to be readable would make the verdict depend on whether
2510
+ a given clone ever ran `cargo build` — green on a machine that never built, red on
2511
+ one that did — which is the build-time coupling the revert removed, re-imported
2512
+ into the auditor through the back door (§check-gate-substrate-parity).
2513
+
2514
+ **Why a new gate rather than a seventh assertion on
2515
+ `check-gate-substrate-parity`.** Not for its trigger: `native/*` is a bash pattern
2516
+ in which `*` spans `/` (§run-gates), so the parity gate already re-fires on every
2517
+ crate edit and folding this in would buy no trigger it lacks. The reason is the
2518
+ dependency. Parity **stays a shell gate that never consumes the substrate it
2519
+ audits** — its own section says so, because assertion B checking a roster through
2520
+ the very binary whose roster is in question is circular. Freshness must invoke the
2521
+ binary to get its verdict, by construction. Acquiring that dependency is precisely
2522
+ what parity's rule forbids, so the two cannot be one gate. The subjects differ to
2523
+ match: parity audits what a port *declares*, this audits whether a build is
2524
+ *current*.
2525
+
2526
+ Knobs: `GATE_SDK_NATIVE_BIN` and `GATE_SDK_NATIVE_CRATE`, both existing
2527
+ (§Layout and configuration) — the gate introduces none, and a knob selecting the
2528
+ registry would be a second spelling of `GATE_SDK_GATES_DIR`. The registry is a new
2529
+ **input** rather than a new knob: it is `<gates-dir>/gates.list`, the path the
2530
+ positional argument already determines, so the fixture pair stays hermetic.
2531
+ `# graph:` manifest: `tier=precommit`, coupling the crate root (the source tree is
2532
+ the subject), `kit:checks/*.gate` (the descriptor set) and `scripts/gates.list`
2533
+ (the registry — a registration edit alone can flip the verdict, so it is a trigger
2534
+ like any other subject).
2535
+
2536
+ Its coverage is split across three oracles, and naming where each is proved is
2537
+ what keeps the split from reading as a hole. The `good/`+`bad/` pair covers
2538
+ **descriptors present and registered, binary readable** — the comparison reached
2539
+ and agreeing, and the mismatch red, with the descriptor set derived across both a
2540
+ gates dir and a kit resolve dir. It is hermetic through the second positional
2541
+ argument, which supplies the tree-side stamp from a file instead of computing it,
2542
+ the shape §check-exec-bit uses for the same reason: a fixture tree cannot carry a
2543
+ git index, and a fixture crate would break in a vendored tree whose files are not
2544
+ yet committed. The bespoke `gate-tests/check-gate-binary-fresh.test.sh` covers the
2545
+ predicate's boundary, which a pair cannot hold: **zero descriptors** — the
2546
+ standing state of an unported tree, held in a fixture rather than assigned to a
2547
+ live tree for the reason §check-gate-substrate-parity's own split states; **descriptors
2548
+ present, none dispatching** — every vendored tree once the first cohort ships, and
2549
+ the configuration the corrected predicate exists for; the **near miss**, a
2550
+ registered member resolving to a descriptor with no binary, which must still exit
2551
+ 2; and an **absent registry**. And the
2552
+ git computation itself is held by an **executed** assertion rather than a static
2553
+ one: a crate unit test compares the baked constant against
2554
+ `gate_native_source_stamp`'s output over the real crate, failing on any drift
2555
+ between the two substrates' invocations. That test is the precedent the
2556
+ `check-knob-default-coupling` disposition sets (§Meta-gate conservation for the
2557
+ binary substrate). **Its standing changed with this cohort and the change is
2558
+ recorded rather than left to a reader to notice.** It was load-bearing because a
2559
+ hermetic fixture plus a zero-descriptor tree meant *nothing in the gate battery
2560
+ ever executed the tree-side computation*; this repo now registers both first-cohort
2561
+ members, so the battery reaches that computation on every run and the test is no
2562
+ longer the only executor. It is kept, on the narrower ground that it fails at
2563
+ `cargo test` time — inside the crate's own suite, before any binary is placed —
2564
+ where the battery's verdict arrives only once a build exists to compare against.
2565
+
976
2566
  ### check-test-hermetic
977
2567
 
978
2568
  Two assertions guard a run against ambient state: (A) every bespoke
@@ -1087,7 +2677,9 @@ kit-roots derivation, as `check-test-hermetic`'s do.
1087
2677
  Invariant: every element of an `# exception-list:`-tagged array in a
1088
2678
  `check-*.sh` gate carries exactly one of two disposition annotations —
1089
2679
  `# until: <slug>` (temporary; must resolve to a live task in the queue file's
1090
- New Features / Technical Debt / Deferred sections) or `# permanent: <reason>`
2680
+ New Features / Technical Debt / Deferred sections — *live* meaning the slug on a
2681
+ **bullet lead line** within that span, one per entry, never every bold token in
2682
+ it) or `# permanent: <reason>`
1091
2683
  (structural out-of-scope). An element with neither, a `# until:` slug that is
1092
2684
  Done-only or missing, or elements sharing the array's opening `=(` line are
1093
2685
  violations. Scope is in-script exemption arrays only; inline per-site
@@ -1108,6 +2700,62 @@ slugs from the live set. The same-shaped scan in drift-kit's `kpi-deferred-age`
1108
2700
  *does* reset on an unknown heading and so excludes the tier; same shape,
1109
2701
  opposite behavior, both wanted.
1110
2702
 
2703
+ **The live slug of an entry is the bold lead-in of its bullet lead line**, one
2704
+ per entry — the line predicate
2705
+ `^[[:space:]]*-[[:space:]]+\*\*[a-z0-9][a-z0-9-]*\*\*`, from which the first
2706
+ bold token is the slug. Reading every bold token on every line of the span
2707
+ instead is a fail-open, and the loud kind of one: entry prose bolds ordinary
2708
+ words, so any bolded lowercase word joins the live set, an `# until:` resolves
2709
+ against no task at all, and the gate's clean line still claims every element
2710
+ declares until-with-live-task. The whitespace tolerance is the format rather
2711
+ than a tolerance — an indented bold lead-in is a sub-task, and sub-task slugs
2712
+ share the one global namespace an `# until:` may name (queue-kit/SPEC.md §The
2713
+ queue format), so a column-0 anchor would drop that class and fail *closed* at
2714
+ the other end. A holder that wants entries only is entitled to that narrower
2715
+ anchor; the level is the reader's choice, the predicate is not.
2716
+
2717
+ The seam is the one the section set above already takes: **gate-sdk cannot
2718
+ depend on queue-kit for the lead-line format, so the coupling is carried by both
2719
+ SPECs rather than by code.** Sourcing `lib/queue.sh` from gate-sdk is refused on
2720
+ layering — gate-sdk is the substrate every kit vendors, and a queue format must
2721
+ not become a precondition for running any gate; a consumer vendoring gate-sdk
2722
+ and no queue-kit still gets a working exemption gate. Re-implement and cite from
2723
+ both ends is not a new ruling: queue-kit/SPEC.md §The queue format already
2724
+ states it for drift-kit, with a cycle rather than a layering inversion as the
2725
+ reason. No knob: the lead-line shape is not a consumer's posture but the one
2726
+ format the `# until:` contract is written against, and a consumer free to
2727
+ redefine it could redefine it back into the fail-open this closes.
2728
+
2729
+ **The honest cost, stated with its size: eight independent holders now carry
2730
+ that predicate and no gate enforces their agreement** — `queue_live_slugs` and
2731
+ `queue_roadmap_entries` (queue-kit/lib/queue.sh), `spec_queue_slugs`
2732
+ (canon-kit/lib/spec.sh), the inline scans in queue-kit's `check-task-names` and
2733
+ `check-queue-entry-budget`, `bin/queue-index.sh` (which carries it twice, in the
2734
+ `--extent` and `--icebox-candidates` walks), the section-pool builder inside
2735
+ drift-kit's `kpi-queue-net-delta`, and this gate. Only the public
2736
+ library functions are named; the rest are cited by the surface that owns them,
2737
+ because naming another kit's private helper here would couple this
2738
+ count to an identifier no gate holds. They are cited at all because a grep for the *function* names
2739
+ finds two of them and the rest are inline scans no naming convention surfaces —
2740
+ which is how the count was twice under-stated before it was surveyed. The risk
2741
+ and the cost do not sit in the same place: a **set builder** with a wrong
2742
+ predicate fails silently, in wrong membership, which is this gate's own defect
2743
+ class, while a **per-bullet extractor** fails loudly and locally — a missing
2744
+ index row, an extent measured wrong. So a format change costs all eight edits
2745
+ and endangers only the few that build sets. Accepted on the same ground as the
2746
+ section-set residue above: a cross-kit code dependency would cost more than the
2747
+ divergence risk. Whether eight hand-coupled parsers earn a shared derivation, a
2748
+ conformance test, or a gate is a real question and a **different unit**; this
2749
+ section neither answers it nor forecloses it.
2750
+
2751
+ Clean-line contract: the line reports the exemption-array count **and** the
2752
+ derived live-slug count. Both are §run-gates' vacuous-pass tripwire applied to
2753
+ this gate's two sets, and they read in opposite directions — an empty array set
2754
+ means the gate ranged over nothing, while an absurdly *large* slug set is the
2755
+ fail-open above, silent by construction because every `# until:` then resolves.
2756
+ A number on the line is what makes the second readable without an audit, and its
2757
+ drift is the signal that the predicate has come loose from a reformatted queue.
2758
+
1111
2759
  ### check-graph
1112
2760
 
1113
2761
  Invariant: the `# graph:` manifest on every `gates.list` member is well-formed
@@ -1124,7 +2772,7 @@ the check derives its guarantees — each `couples=` surface is covered by the
1124
2772
  gate's `trigger=` globs (trigger defaulting to couples), so editing a coupled
1125
2773
  surface always fires the gate; and the committed pre-commit hook, the commit-msg
1126
2774
  hook (when any gate is `tier=commit-msg`), and the coupling-graph projection at
1127
- `GATE_SDK_GRAPH_ARTIFACT` (default `<workflow-dir>/CHECK-GRAPH.html`) each equal
2775
+ `GATE_SDK_GRAPH_ARTIFACT` (default `<gates-dir>/CHECK-GRAPH.html`) each equal
1128
2776
  their generator's `--emit` output, down to every emitted asset href resolving
1129
2777
  under the artifact's own directory. The remedy lines print the resolved artifact
1130
2778
  path, so a consumer that republishes it (this repo serves `docs/check-graph.html`)
@@ -1137,7 +2785,7 @@ parity re-fires through the normal registry path once the gate lands.
1137
2785
  Dual-couple manifest: the artifact path is a knob, but check-graph's own
1138
2786
  `# graph:` manifest is kit-shipped static text a consumer never edits, so it
1139
2787
  cannot read the knob. It lists **both** artifact homes as couples — the
1140
- workflow-dir default and `docs/check-graph.html` — so the generated hook
2788
+ gates-dir default and `docs/check-graph.html` — so the generated hook
1141
2789
  re-fires on whichever a consumer publishes to. For a default consumer the docs
1142
2790
  path is simply an inert trigger pattern that never stages; couples↔trigger
1143
2791
  parity holds because the hook derives from the same manifest.
@@ -1222,7 +2870,76 @@ H).
1222
2870
  Invariant: for every registered gate, every **statically resolvable recursive
1223
2871
  walk** in its source has its tracked read-set covered by the gate's expanded
1224
2872
  `couples=` — the reads⊆couples half `check-graph` leaves to the author
1225
- (§The `# graph:` manifest). This is check-graph's coverage sibling: check-graph
2873
+ (§The `# graph:` manifest).
2874
+
2875
+ **A member resolving to a `.gate` is answered by the substrate, not parsed.** Its
2876
+ walk parser reads shell, so a binary gate yields zero walks and the gate would
2877
+ print `clean` — the single worst vacuity available at the substrate seam, because
2878
+ the absence of findings is indistinguishable from an absence of coverage. The way
2879
+ past that is to give the gate an answer, never to give the port an exemption: for a
2880
+ `.gate` member the gate invokes `"$GATE_SDK_NATIVE_BIN" --reads "<name>"`
2881
+ (§Layout and configuration) and feeds the reported roots into the same coverage
2882
+ assertion the shell arm uses.
2883
+
2884
+ **The `--reads` report.** One line per walk root and nothing else — no count line
2885
+ and no header, because the count is derivable from the lines and a transcribed
2886
+ total would be a second source for it. Each line is either a repo-relative
2887
+ directory path, for a root the gate declares, or a single `?`, for a root it cannot
2888
+ bound statically. Both line kinds have a named reader at a named transition: a path
2889
+ is read by the tracked-file enumeration below, at the per-root coverage loop; a `?`
2890
+ by the skip counter, at the clean-line parenthetical — the same reader the shell
2891
+ arm's unresolvable roots already have. There is no third line kind because there is
2892
+ no third reader. The producer is the binary's `--reads` arm, printing the declared
2893
+ roots each registry member carries — data held to what the code actually walks by
2894
+ two crate-side unit tests (§Meta-gate conservation for the binary substrate).
2895
+
2896
+ **The coverage assertion itself is unchanged; only the source of the roots
2897
+ differs** — a shell parse for a `.sh` member, the substrate's own report for a
2898
+ `.gate` one. Two calibrations follow from what a binary does *not* report, and both
2899
+ err toward demanding more coverage rather than less. A reported root is filtered by
2900
+ the prune list exactly as a `gate_find` walk is, because the crate's single
2901
+ sanctioned walk prunes on the same `GATE_SDK_PRUNE_DIRS` knob (§lib/gate.sh). And
2902
+ no literal `-name` primary is extractable from a binary, so the enumeration is
2903
+ unfiltered — the same answer the shell arm already gives a walk whose pattern is a
2904
+ variable. A ported gate therefore narrows by declaring a tighter root, never by
2905
+ declaring a pattern.
2906
+
2907
+ **The refusal survives, narrowed to the two cases where the gate still cannot
2908
+ see.** The binary absent or not executable while a `.gate` member is registered is
2909
+ exit 2 — the same fail-closed shape §check-gate-substrate-parity assertion B uses
2910
+ for the same condition. `--reads` exiting non-zero for a declared member is exit 2,
2911
+ so a descriptor naming a subcommand the binary does not carry cannot read as "reads
2912
+ nothing". Both are the §Fail-closed contract applied to a corpus the gate cannot
2913
+ see: "cannot verify" and "verified covered" must not share an exit code.
2914
+
2915
+ **There is deliberately no descriptor-level exemption.** The live port briefly
2916
+ shipped one — a `# reads-couples-exempt:` line in the descriptor bought the
2917
+ member a pass — on the argument that the one ported gate's single walk was
2918
+ already undecidable, so the exemption converted a counted skip into a counted
2919
+ exemption and ended no assertion. That was true of that gate and false as a
2920
+ rule: the *next* port has resolvable walks, and an opt-out written in one
2921
+ sentence is how a port ends the assertion it was supposed to replace rather
2922
+ than replacing it. The allowance was also never written here, so the refusal
2923
+ this section states and the behavior the gate had disagreed — the divergence
2924
+ that makes "land it then relax" hard to see. Removed with the port, and not
2925
+ reinstated by the consumption path above: a port ends this assertion by
2926
+ **answering** it, never by opting out of it.
2927
+
2928
+ Because no `.gate` member exists anywhere in the tree, this arm has no live
2929
+ instance and its clean line reports a counted zero.
2930
+ `gate-tests/check-reads-couples.test.sh` is what keeps that a counted zero rather
2931
+ than an untested branch, and it is what **proves the mechanism without a port**.
2932
+ It drives the consumption path against a stub binary — a reported root whose
2933
+ tracked reads its couples cover, one whose couples stop a level short, and one
2934
+ reporting `?` — both surviving refusals, a descriptor still claiming the removed
2935
+ exemption (which buys it nothing, so the opt-out cannot return unnoticed), and the
2936
+ shell arm alongside so no case can be passing for a parse failure. One case runs
2937
+ the **real** binary rather than a stub, so the grammar under test is the one the
2938
+ substrate actually emits; it is skipped and named in the test's own summary line
2939
+ when the binary is not built, because the file is hermetic and never builds one.
2940
+ Naming the skip is what keeps it from reading as a silent pass.
2941
+
2942
+ This is check-graph's coverage sibling: check-graph
1226
2943
  proves editing a *coupled* surface fires the gate; check-reads-couples proves
1227
2944
  the couples name every surface a resolvable walk *reads*, so no recursion hides
1228
2945
  a surface the couple never listed.
@@ -1257,9 +2974,14 @@ remainder. Manifest `tier=precommit trigger=*`: the unconditional trigger is
1257
2974
  load-bearing, not laziness — the invariant breaks two ways, a gate edit that
1258
2975
  changes a walk *or* a new subdirectory grown under a walked root, and no couple
1259
2976
  glob can name a directory that does not exist yet. Its own `couples=` names what
1260
- it reads as content (every `checks/` dir plus `gates.list`); the tracked-file
1261
- enumeration is `git ls-files` metadata, not a content read, so it needs no
1262
- couple. The hermetic fixture affordance: positional gate-source arguments make
2977
+ it reads as content (every `checks/` dir, `gates.list`, and the crate's source —
2978
+ an edit to a gate's implementation changes what it walks, so without that couple
2979
+ the assertion would be live and unreachable, coupled to shell sources only on a
2980
+ rule whose subject had moved); the tracked-file enumeration is `git ls-files`
2981
+ metadata, not a content read, so it needs no couple. The crate couple fires **in
2982
+ this repo**, where the implementation is tracked; a consumer tree receives no
2983
+ crate source by ruling, so there is no edit for it to catch and a glob matching
2984
+ nothing is the correct outcome rather than a hole. The hermetic fixture affordance: positional gate-source arguments make
1263
2985
  the gate analyze the given source(s) with `git ls-files` anchored to the case
1264
2986
  dir, instead of walking the real `gates.list`.
1265
2987
 
@@ -1377,7 +3099,23 @@ line** — every kit root with
1377
3099
  tracked `gate-tests/` files (`git ls-files <kit>/gate-tests/`) has a line in the
1378
3100
  runner doc naming `<kit>/gate-tests` (the documented fixture-runner
1379
3101
  invocation), so a kit whose fixtures never entered the battery is red. A kit
1380
- without `gate-tests/` (guard-kit, drift-kit) owes nothing under B.
3102
+ shipping no tracked `gate-tests/` files (drift-kit) owes nothing under B — the
3103
+ carve-out is derived from the tree per run, not a standing list, so a kit that
3104
+ grows fixtures loses it the moment they are tracked.
3105
+
3106
+ B is deliberately redundant with evidence-kit's `check-battery-roster`
3107
+ (evidence-kit/SPEC.md §check-battery-roster), whose assertion (A) holds the same
3108
+ runner doc against the configured suite roster and, where that config derives
3109
+ the fixture suites from the `gate-tests/` roots, supersets B. The redundancy is
3110
+ kept on a dependency direction: **a gate-sdk gate may not require evidence-kit
3111
+ config**. The line is between reading it opportunistically and asserting over
3112
+ it — §enforcement-map reads that config where a consumer has one and emits no
3113
+ suite rows where it does not, which an assertion cannot do, since a gate with
3114
+ nothing to compare against is either fail-closed or a false clean. So B is the
3115
+ arm that survives a gate-sdk-only adoption — the more common shape — and
3116
+ retiring it would trade a duplicate finding for a coverage hole. One omission
3117
+ named differently from each side (a kit root here, a suite there) is a duplicate
3118
+ finding, not a contradiction.
1381
3119
 
1382
3120
  Config, the standard kit shape: `GATE_SDK_REGISTRY_DOC` (default `README.md`)
1383
3121
  is A's doc, `GATE_SDK_RUNNER_DOC` (default `README.md`) is B's; both resolve
@@ -1393,7 +3131,10 @@ step to the un-gated remainder (row descriptions, per-kit READMEs).
1393
3131
  ### check-readme-roster
1394
3132
 
1395
3133
  Invariant: every kit README's register-the-gates block holds name-set parity
1396
- with the kit's shipped `checks/` basenames, both directions. This is the
3134
+ with the kit's shipped `checks/` basenames, both directions — over **both**
3135
+ declaration spellings, `*.sh` and `*.gate`, since a ported gate is still a gate
3136
+ the kit ships and would otherwise drop out of its README roster in both
3137
+ directions at once. This is the
1397
3138
  `check-install-toolchain` fork applied a second time: the roster names are
1398
3139
  derivable (the `checks/` script basenames, extension stripped), the per-gate
1399
3140
  annotation clauses beside them are hand prose, so a gate asserts parity over a
@@ -1466,16 +3207,54 @@ plain `rm`, a `git rm`, and a listed-but-never-added path alike, with no
1466
3207
  The manifest is optional consumer config (the `graph-vocab.sh` pattern): the
1467
3208
  path knob is `GATE_SDK_CORE_FILES_FILE` (default
1468
3209
  `<gates-dir>/core-files.list`), registry-style — one repo-relative path per
1469
- line, `#` comments and blanks ignored. An absent manifest is clean with a note;
3210
+ line **or** a `kit:<path>` token, `#` comments and blanks ignored. An absent
3211
+ manifest is clean with a note;
1470
3212
  an empty or comment-only manifest is clean; a present-but-unreadable manifest
1471
3213
  is fail-closed (exit 2). Calibration: the intentional-removal valve is the
1472
3214
  manifest itself — retiring a surface means deleting its line in the same commit
1473
3215
  that removes the file, a diff-visible edit that needs no exemption tag, so the
1474
- gate is re-scoped in the open, never weakened to pass. The gate's `# graph:`
1475
- couples the manifest (`tier=precommit`), so an edit to `core-files.list`
1476
- re-fires it; the whole-tree `run-gates.sh` battery is the backstop for a
3216
+ gate is re-scoped in the open, never weakened to pass.
3217
+
3218
+ A `kit:<path>` line derives one `<kit-root>/<path>` entry per `gate_kit_roots`
3219
+ member through `gate_expand_couples_var` — the same expansion, the same root
3220
+ set, and the same spelling `# graph:` `couples=` fields already use (§check-graph
3221
+ owns them; nothing about them is re-specified here). What is new is only that
3222
+ `check-core-files` is a second reader of it. A manifest with no `kit:` line
3223
+ behaves exactly as before, so no consumer's manifest changes meaning.
3224
+
3225
+ **One restriction, and it is fail-closed.** The expansion is unconditional: it
3226
+ emits `<root>/<path>` per root with no existence test. In a `couples=` field the
3227
+ result is matched as a glob against tracked files, so a wildcard is meaningful
3228
+ there. This reader instead *requires* each expanded path to exist and be tracked,
3229
+ and "every kit has at least one file matching `checks/*.sh`" is a different
3230
+ invariant from "this path exists". A `kit:` token carrying a wildcard is
3231
+ therefore refused with exit 2 and a message naming the limit — one expansion, two
3232
+ readers, one stated restriction, never divergent semantics.
3233
+
3234
+ Because a derived line makes a **new kit** change the checked set without any
3235
+ manifest edit, the gate's `# graph:` couples the manifest *and* the derived
3236
+ basenames (`kit:SPEC.md,kit:README.md`, `tier=precommit`): staging a twelfth
3237
+ kit's spec or README on the commit that creates it re-fires the gate, so the
3238
+ guarantee holds at the perturbation rather than one tier out at the whole-tree
3239
+ battery. That battery stays the backstop for a
1477
3240
  pure-deletion commit the `ACMR` pre-commit filter would skip.
1478
3241
 
3242
+ **What a consumer derives, and what it hand-lists.** The manifest derives a
3243
+ surface that is uniform across kit roots and hand-lists everything else, and
3244
+ uniformity is decidable by running the expansion rather than by taste: a basename
3245
+ every kit root carries expands to a set that wholly exists and is therefore
3246
+ derivable, while a single-kit deliverable would expand to one existing path and
3247
+ N-1 missing ones — proving it is a hand line rather than a derivation someone
3248
+ failed to spot. Surfaces with no kit-root shape at all (a queue, repo-root
3249
+ chrome, workflows, an installer entry point) stay an honest hand list.
3250
+
3251
+ **A derived line is worth taking even where another gate looks like it covers
3252
+ the same surface, unless that coverage is direct.** The discriminator is whether
3253
+ the other gate asserts the surface's existence *as its subject* or merely trips
3254
+ over its absence while checking something else. Incidental coverage keys on a
3255
+ property that can change for unrelated reasons, and it vanishes the moment that
3256
+ property does — which is exactly the failure a core-file pin exists to prevent.
3257
+
1479
3258
  ### check-identity
1480
3259
 
1481
3260
  Invariant: every expectation in the `identity.conf` manifest matches this
@@ -1537,7 +3316,12 @@ the backstop for a mode-only change no `ACMR` content filter would surface.
1537
3316
  ### check-exec-bit
1538
3317
 
1539
3318
  Invariant: every tracked `*.sh` path matching an exec-glob carries git *index*
1540
- mode `100755`. The class is by-path-invoked kit scripts — gate-sdk's runner
3319
+ mode `100755`, **and every tracked `*.gate` descriptor carries `100644`**. The
3320
+ second is stated as an assertion rather than left implicit so that "a descriptor
3321
+ is not executable" cannot read as "a descriptor is not covered": the descriptor
3322
+ is data — a manifest and directives, never sourced and never run — and an
3323
+ executable one invites a reader to run a file carrying no interpreter line. The
3324
+ first class is by-path-invoked kit scripts — gate-sdk's runner
1541
3325
  (`run-gates.sh`), drift-kit's collator (`drift-report.sh`), and lifecycle-kit's
1542
3326
  entry preflight all invoke kit scripts **by path**, and a shebang'd `bin/` tool
1543
3327
  is by-convention path-invocable — so a script committed `100644` degrades
@@ -1660,6 +3444,15 @@ convention for review. The currency limit the pin does *not* buy is
1660
3444
  Tier `precommit`; the `# graph:` couples the scanned YAML surfaces, `dir=one` —
1661
3445
  a one-way audit.
1662
3446
 
3447
+ **Its implementation is a compiled subcommand.** The declaration path is
3448
+ `check-action-pinning.gate` — a `.gate` descriptor carrying the manifest above and
3449
+ nothing else (§The `# graph:` manifest); the rule runs out of the gate binary,
3450
+ proved byte-identical to the shell gate it replaced before that gate was deleted
3451
+ (§The first cohort, and the rule that selects the next). Everything this section
3452
+ specifies is substrate-independent and was written against the shell
3453
+ implementation, which is the point: the seam carries a gate's rule without
3454
+ changing its verdict, so nothing above is restated per substrate.
3455
+
1663
3456
  ### check-action-run-shell
1664
3457
 
1665
3458
  Invariant: every GitHub Actions `run:` **literal block scalar** in a scanned YAML
@@ -1947,6 +3740,15 @@ place's demand that a higher-false-positive
1947
3740
  gate wait for a real miss is met by a fixture that *is* the miss rather than an
1948
3741
  invention of one.
1949
3742
 
3743
+ **Its implementation is a compiled subcommand**, on §check-action-pinning's terms
3744
+ and for the same reason the two form one cohort: the declaration path is
3745
+ `check-action-gh-repo.gate`, the rule runs out of the gate binary, and it was
3746
+ proved byte-identical to the deleted shell gate. One consequence is worth naming
3747
+ because the deleted file was where it was recorded: the shell implementation
3748
+ required GNU awk's 3-argument `match()`, and the compiled one requires no awk at
3749
+ all. The residual `gawk` floor is §check-gate-assertions' and
3750
+ §check-action-run-shell's, not this gate's (docs/install.md §Requirements).
3751
+
1950
3752
  ### check-commit-msg
1951
3753
 
1952
3754
  Invariant: the prospective commit message (the `commit-msg` hook's `$1`) matches
@@ -2041,7 +3843,12 @@ with **no** same-named file under the gates dir is silently skipped, not failed.
2041
3843
  An unpaired template was never vendored out and has no copy to be in parity
2042
3844
  with; running a template in place (this repo wires two from the template path
2043
3845
  itself) is a legitimate adoption mode, so failing closed there would red a tree
2044
- for six files that are working as designed.
3846
+ for six files that are working as designed. The same principle applies one axis
3847
+ over in `check-template-registry-parity` (§check-template-registry-parity),
3848
+ which derives *its* population from layout too — so a reader arriving at either
3849
+ meets both. They do not overlap: this gate compares a template to a **consumer
3850
+ copy** of itself, that one compares a template to the **kit directory it
3851
+ registers**.
2045
3852
 
2046
3853
  **Byte parity is ruled out, on measurement**, and so is containment in either
2047
3854
  direction. Every executable pair diverges deliberately: the consumer copies add
@@ -2106,6 +3913,75 @@ already repaired, so `good/` proves green-on-a-sanctioned-`spec:`-prose-differen
2106
3913
  scope exclusions) and `bad/` proves all three assertions red on a hand-edited
2107
3914
  copy. Tier `precommit`.
2108
3915
 
3916
+ ### check-template-registry-parity
3917
+
3918
+ Invariant: a kit's shipped `.list` registry template names exactly the artifacts
3919
+ of the sibling directory it registers. Two assertions, per registry: (A) every
3920
+ shipped artifact is registered — a bundled plugin absent from the template is
3921
+ red, the finding this gate landed on; and (B) every registry line resolves to a
3922
+ shipped artifact — a line naming no file is red, so a retired plugin cannot
3923
+ leave a line that installs a broken registry into every consumer. Each finding
3924
+ names the kit, the template, and the member.
3925
+
3926
+ **A kit template that registers artifacts the kit itself ships names every one
3927
+ of them.** The consumer's *copy* is the consumer's to prune — drift-kit's
3928
+ `templates/kpis.list` header already says so — but the shipped template is the
3929
+ kit's claim about what it bundles, and the kit's SPEC roster, its README, and
3930
+ its smoke's coverage assertions are all stated over that set. A deliberate
3931
+ starter subset is refused because nothing distinguishes it from an omission: it
3932
+ is exactly what a dropped line looks like, which is how drift-kit's missing
3933
+ `kpi-queue-net-delta` line survived a shipped registry, a smoke that copies it,
3934
+ and a SPEC that named the KPI.
3935
+
3936
+ **Scope derives from layout, never a roster** — §check-template-copy-parity's
3937
+ rule, applied one axis over. A template enters the population when
3938
+ `<kit>/templates/<name>.list` has a sibling **directory** `<kit>/<name>/`
3939
+ holding the artifacts the list registers; a `.list` with no such sibling is
3940
+ skipped-and-counted, not failed, the same silent-skip exclusion its sibling gate
3941
+ gives an unpaired template. Shipped members are the basenames of that
3942
+ directory's `*.sh` files, extension stripped, read from `git ls-files` so an
3943
+ untracked scratch file forces no registry line; registry members are the
3944
+ non-comment, non-blank lines — the `gates.list` grammar `gates_list_members`
3945
+ reads, the same grammar `drift-kit/bin/drift-report.sh` resolves its registry
3946
+ through, so the gate calls a name registered exactly when the consumer's
3947
+ resolver would.
3948
+
3949
+ **The population predicate carries the provenance seam, and that is why it is
3950
+ structural.** The flat form of the rule — *a kit's `templates/` registry must be
3951
+ the full bundled set* — is unsafe as stated: applied to
3952
+ `drift-kit/templates/price-table.tsv` it would force a kit literal enumerating a
3953
+ model roster, which is precisely the seam (CLAUDE.md §The provenance seam). Two
3954
+ kinds of template are out of population, both by construction and in this order:
3955
+ one that is not a `.list` at all never reaches the sibling test (`price-table.tsv`
3956
+ exits there, on its extension); one that is a `.list` whose rows are consumer
3957
+ rule content the kit stubs generically — `gate-sdk/templates/msg-patterns.list`,
3958
+ whose rows are `grep -E` patterns — has no sibling directory of kit artifacts,
3959
+ because having no kit-shipped artifacts to register *is* the same fact as having
3960
+ no sibling directory of them. This is deliberately **not a per-file exception
3961
+ list**, and that is the whole point of the shape: an exception list re-arms on
3962
+ the next template of this kind, since someone must remember to extend it, and
3963
+ the failure mode of forgetting is a kit literal publishing a private vocabulary.
3964
+
3965
+ A second structural consequence, stated so it is not read as an omission:
3966
+ `drift-kit/templates/kpi-deprecated-surface.sh` is an example plugin shipped *as
3967
+ a template* for a consumer to adapt. It is not in `drift-kit/kpis/`, so it is
3968
+ not a bundled artifact and is not required in the registry — the shipped set is
3969
+ the sibling directory's contents and nothing else.
3970
+
3971
+ Sweep: kit roots come from `gate_kit_roots` (the `GATE_SDK_KIT_DIRS` knob —
3972
+ §Layout and configuration), the sibling roster meta-gates' shape; config adds
3973
+ **no new knob**. Positional form `check-template-registry-parity.sh [root]`
3974
+ resolves relative kit roots against a fixture tree (the case dir's
3975
+ `gate-sdk-config.sh` names the fixture kits); bare, it sweeps against the git
3976
+ toplevel. Fail-closed: a non-repo cwd with no root argument, an empty kit
3977
+ roster, an unreadable template or sibling directory, or a failed `git ls-files`
3978
+ is exit 2, never a false clean. `dir=bi` — either side going stale is the
3979
+ defect, which is what (A) and (B) split between them — tier `precommit`. The
3980
+ fixture pair synthesizes both sides at once: `good/` proves green on a registry
3981
+ in parity while carrying both structural exclusions (a `.list` with no sibling,
3982
+ and a non-`.list` template), and `bad/` proves a registry that is one-sided in
3983
+ each direction at the same time.
3984
+
2109
3985
  ### templates/check-skeleton.sh
2110
3986
 
2111
3987
  The copy-paste reference skeleton — the canonical "how to write a gate"