checkwright 0.31.0 → 0.32.1

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 (496) hide show
  1. package/README.md +8 -7
  2. package/bin/checkwright.ps1 +3 -3
  3. package/bin/checkwright.sh +5 -1
  4. package/package.json +10 -3
  5. package/payload/artifact/aarch64-apple-darwin/checkwright-gates +0 -0
  6. package/payload/artifact/aarch64-apple-darwin/checkwright-gates.sha256 +1 -1
  7. package/payload/artifact/aarch64-pc-windows-msvc/checkwright-gates.exe +0 -0
  8. package/payload/artifact/aarch64-pc-windows-msvc/checkwright-gates.exe.sha256 +1 -1
  9. package/payload/artifact/aarch64-unknown-linux-gnu/checkwright-gates +0 -0
  10. package/payload/artifact/aarch64-unknown-linux-gnu/checkwright-gates.sha256 +1 -1
  11. package/payload/artifact/aarch64-unknown-linux-musl/checkwright-gates +0 -0
  12. package/payload/artifact/aarch64-unknown-linux-musl/checkwright-gates.sha256 +1 -1
  13. package/payload/artifact/targets.list +5 -5
  14. package/payload/artifact/x86_64-apple-darwin/checkwright-gates +0 -0
  15. package/payload/artifact/x86_64-apple-darwin/checkwright-gates.sha256 +1 -1
  16. package/payload/artifact/x86_64-pc-windows-msvc/checkwright-gates.exe +0 -0
  17. package/payload/artifact/x86_64-pc-windows-msvc/checkwright-gates.exe.sha256 +1 -1
  18. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates +0 -0
  19. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates.sha256 +1 -1
  20. package/payload/artifact/x86_64-unknown-linux-musl/checkwright-gates +0 -0
  21. package/payload/artifact/x86_64-unknown-linux-musl/checkwright-gates.sha256 +1 -1
  22. package/payload/canon-kit/README.md +8 -4
  23. package/payload/canon-kit/checks/check-amendment-queue.gate +1 -1
  24. package/payload/canon-kit/checks/check-comment-tier.gate +2 -2
  25. package/payload/canon-kit/checks/check-delta-agreement.gate +4 -0
  26. package/payload/canon-kit/checks/check-deprecation-task.gate +1 -1
  27. package/payload/canon-kit/checks/check-docs-page-length.gate +4 -0
  28. package/payload/canon-kit/checks/check-docs-page-repeat.gate +2 -2
  29. package/payload/canon-kit/checks/check-fence-command-head.gate +1 -1
  30. package/payload/canon-kit/checks/check-fence-paste-unit.gate +4 -0
  31. package/payload/canon-kit/checks/check-knob-default-coupling.gate +1 -1
  32. package/payload/canon-kit/checks/check-manifest-count.gate +3 -3
  33. package/payload/canon-kit/checks/check-manifest-temporal.gate +1 -1
  34. package/payload/canon-kit/checks/check-pendency-contradiction.gate +3 -0
  35. package/payload/canon-kit/checks/check-prose-tells.gate +1 -1
  36. package/payload/canon-kit/checks/check-spec-derivable-section.gate +1 -1
  37. package/payload/canon-kit/checks/check-spec-dod-singleton.gate +1 -1
  38. package/payload/canon-kit/checks/check-spec-embedded-source.gate +1 -1
  39. package/payload/canon-kit/checks/check-spec-pointer.gate +1 -1
  40. package/payload/canon-kit/checks/check-todo-task-liveness.gate +1 -1
  41. package/payload/canon-kit/gate-tests/check-amendment-queue/good/SPEC-widget.md +6 -0
  42. package/payload/canon-kit/gate-tests/check-amendment-retired-spelling/good/SPEC-widget.md +7 -0
  43. package/payload/canon-kit/gate-tests/check-amendment-update-target/good/SPEC-widget.md +7 -0
  44. package/payload/canon-kit/gate-tests/check-citation-link/bad/expect.txt +1 -0
  45. package/payload/canon-kit/gate-tests/check-citation-link/bad/site/unclosed.md +4 -0
  46. package/payload/canon-kit/gate-tests/check-citation-link/good/site/page.md +10 -0
  47. package/payload/canon-kit/gate-tests/check-comment-tier/bad/scripts/canon-config.knobs +4 -0
  48. package/payload/canon-kit/gate-tests/check-comment-tier/good/good.gate +2 -0
  49. package/payload/canon-kit/gate-tests/check-comment-tier/good/scripts/canon-config.knobs +4 -0
  50. package/payload/canon-kit/gate-tests/check-comment-tier.test.sh +9 -1
  51. package/payload/canon-kit/gate-tests/check-delta-agreement/bad/expect.txt +3 -0
  52. package/payload/canon-kit/gate-tests/check-delta-agreement/bad/scripts/canon-config.knobs +14 -0
  53. package/payload/canon-kit/gate-tests/check-delta-agreement/bad/work/base/notes/spec.md +9 -0
  54. package/payload/canon-kit/gate-tests/check-delta-agreement/bad/work/changes/one/deltas/notes/spec.md +7 -0
  55. package/payload/canon-kit/gate-tests/check-delta-agreement/bad/work/changes/two/deltas/cli/spec.md +3 -0
  56. package/payload/canon-kit/gate-tests/check-delta-agreement/good/expect.txt +1 -0
  57. package/payload/canon-kit/gate-tests/check-delta-agreement/good/scripts/canon-config.knobs +14 -0
  58. package/payload/canon-kit/gate-tests/check-delta-agreement/good/work/base/notes/spec.md +9 -0
  59. package/payload/canon-kit/gate-tests/check-delta-agreement/good/work/changes/one/deltas/notes/spec.md +19 -0
  60. package/payload/canon-kit/gate-tests/check-delta-agreement/good/work/changes/two/deltas/cli/spec.md +3 -0
  61. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/scripts/canon-config.knobs +4 -0
  62. package/payload/canon-kit/gate-tests/check-deprecation-task/good/scripts/canon-config.knobs +4 -0
  63. package/payload/canon-kit/gate-tests/check-docs-cmd.test.sh +20 -4
  64. package/payload/canon-kit/gate-tests/check-docs-page-length/bad/expect.txt +5 -0
  65. package/payload/canon-kit/gate-tests/check-docs-page-length/bad/scripts/canon-config.knobs +3 -0
  66. package/payload/canon-kit/gate-tests/check-docs-page-length/bad/site/item.md +5 -0
  67. package/payload/canon-kit/gate-tests/check-docs-page-length/bad/site/nested.md +7 -0
  68. package/payload/canon-kit/gate-tests/check-docs-page-length/bad/site/page.md +13 -0
  69. package/payload/canon-kit/gate-tests/check-docs-page-length/bad/site/short.md +3 -0
  70. package/payload/canon-kit/gate-tests/check-docs-page-length/bad/site/unclosed.md +4 -0
  71. package/payload/canon-kit/gate-tests/check-docs-page-length/good/expect.txt +1 -0
  72. package/payload/canon-kit/gate-tests/check-docs-page-length/good/scripts/canon-config.knobs +4 -0
  73. package/payload/canon-kit/gate-tests/check-docs-page-length/good/site/generated.md +3 -0
  74. package/payload/canon-kit/gate-tests/check-docs-page-length/good/site/page.md +15 -0
  75. package/payload/canon-kit/gate-tests/check-docs-page-repeat/bad/expect.txt +3 -0
  76. package/payload/canon-kit/gate-tests/check-docs-page-repeat/bad/scripts/canon-config.knobs +2 -1
  77. package/payload/canon-kit/gate-tests/check-docs-page-repeat/bad/site/_chrome/footer.html +4 -0
  78. package/payload/canon-kit/gate-tests/check-docs-page-repeat/bad/site/page.md +4 -0
  79. package/payload/canon-kit/gate-tests/check-docs-page-repeat/bad/site/unclosed.md +6 -0
  80. package/payload/canon-kit/gate-tests/check-docs-page-repeat/good/expect.txt +2 -1
  81. package/payload/canon-kit/gate-tests/check-docs-page-repeat/good/scripts/canon-config.knobs +2 -1
  82. package/payload/canon-kit/gate-tests/check-docs-page-repeat/good/site/_chrome/layout.html +8 -0
  83. package/payload/canon-kit/gate-tests/check-docs-page-repeat/good/site/page.md +13 -0
  84. package/payload/canon-kit/gate-tests/check-docs-restatement-parity/bad/expect.txt +1 -0
  85. package/payload/canon-kit/gate-tests/check-docs-restatement-parity/bad/kit/index.md +4 -0
  86. package/payload/canon-kit/gate-tests/check-fence-command-head/bad/doc.md +10 -0
  87. package/payload/canon-kit/gate-tests/check-fence-command-head/bad/expect.txt +2 -0
  88. package/payload/canon-kit/gate-tests/check-fence-command-head/good/doc.md +6 -0
  89. package/payload/canon-kit/gate-tests/check-fence-paste-unit/bad/expect.txt +3 -0
  90. package/payload/canon-kit/gate-tests/check-fence-paste-unit/bad/scripts/canon-config.knobs +2 -0
  91. package/payload/canon-kit/gate-tests/check-fence-paste-unit/bad/site/page.md +17 -0
  92. package/payload/canon-kit/gate-tests/check-fence-paste-unit/good/expect.txt +1 -0
  93. package/payload/canon-kit/gate-tests/check-fence-paste-unit/good/scripts/canon-config.knobs +2 -0
  94. package/payload/canon-kit/gate-tests/check-fence-paste-unit/good/site/page.md +39 -0
  95. package/payload/canon-kit/gate-tests/check-fence-run/good/doc.md +8 -0
  96. package/payload/canon-kit/gate-tests/check-install-claim/bad/README.md +4 -0
  97. package/payload/canon-kit/gate-tests/check-manifest-count/bad/SPEC.md +14 -0
  98. package/payload/canon-kit/gate-tests/check-manifest-count/bad/expect.txt +2 -0
  99. package/payload/canon-kit/gate-tests/check-manifest-count/good/SPEC.md +27 -0
  100. package/payload/canon-kit/gate-tests/check-manifest-count/good/expect.txt +1 -1
  101. package/payload/canon-kit/gate-tests/check-manifest-count/good/posts/note.md +7 -0
  102. package/payload/canon-kit/gate-tests/check-manifest-count/good/scripts/canon-config.knobs +4 -0
  103. package/payload/canon-kit/gate-tests/check-manifest-temporal/good/SPEC.md +7 -0
  104. package/payload/canon-kit/gate-tests/check-md-refs.test.sh +17 -1
  105. package/payload/canon-kit/gate-tests/check-md-unwrapped/bad/dotted.md +10 -0
  106. package/payload/canon-kit/gate-tests/check-md-unwrapped/bad/expect.txt +1 -0
  107. package/payload/canon-kit/gate-tests/check-md-unwrapped/good/dotted.md +6 -0
  108. package/payload/canon-kit/gate-tests/check-md-unwrapped/good/expect.txt +1 -1
  109. package/payload/canon-kit/gate-tests/check-measured-claim/good/SPEC.md +6 -0
  110. package/payload/canon-kit/gate-tests/check-pendency-contradiction/bad/SPEC.md +14 -0
  111. package/payload/canon-kit/gate-tests/check-pendency-contradiction/bad/expect.txt +1 -0
  112. package/payload/canon-kit/gate-tests/check-pendency-contradiction/good/README.md +3 -0
  113. package/payload/canon-kit/gate-tests/check-pendency-contradiction/good/SPEC.md +16 -0
  114. package/payload/canon-kit/gate-tests/check-pendency-contradiction/good/expect.txt +1 -0
  115. package/payload/canon-kit/gate-tests/check-prose-tells/bad/absence-unclosed.md +8 -0
  116. package/payload/canon-kit/gate-tests/check-prose-tells/bad/absence.md +13 -0
  117. package/payload/canon-kit/gate-tests/check-prose-tells/bad/expect.txt +4 -0
  118. package/payload/canon-kit/gate-tests/check-prose-tells/bad/scripts/canon-config.knobs +5 -1
  119. package/payload/canon-kit/gate-tests/check-prose-tells/good/absence.md +17 -0
  120. package/payload/canon-kit/gate-tests/check-prose-tells/good/prose.md +6 -0
  121. package/payload/canon-kit/gate-tests/check-prose-tells/good/scripts/canon-config.knobs +4 -1
  122. package/payload/canon-kit/gate-tests/check-spec-derivable-section/bad/SPEC.md +9 -0
  123. package/payload/canon-kit/gate-tests/check-spec-derivable-section/bad/expect.txt +2 -1
  124. package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/SPEC.md +14 -0
  125. package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/expect.txt +1 -0
  126. package/payload/canon-kit/gate-tests/check-spec-fence-balance/bad/args +1 -0
  127. package/payload/canon-kit/gate-tests/check-spec-fence-balance/bad/expect.txt +2 -1
  128. package/payload/canon-kit/gate-tests/check-spec-fence-balance/bad/long.md +7 -0
  129. package/payload/canon-kit/gate-tests/check-spec-fence-balance/good/doc.md +13 -0
  130. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/scripts/canon-config.knobs +7 -1
  131. package/payload/canon-kit/gate-tests/check-spec-pointer/good/README.md +8 -0
  132. package/payload/canon-kit/gate-tests/check-spec-pointer/good/SPEC-repeat.md +11 -0
  133. package/payload/canon-kit/gate-tests/check-spec-pointer/good/scripts/canon-config.knobs +6 -0
  134. package/payload/canon-kit/gate-tests/check-task-label-resolution/good/work/tasks.md +6 -0
  135. package/payload/canon-kit/gate-tests/check-task-path-claim/good/work/tasks.md +6 -0
  136. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/scripts/canon-config.knobs +4 -0
  137. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/scripts/canon-config.knobs +4 -0
  138. package/payload/canon-kit/gate-tests/check-tracking-claim/bad/README.md +4 -0
  139. package/payload/context-kit/README.md +5 -7
  140. package/payload/context-kit/checks/check-brevity.gate +1 -1
  141. package/payload/context-kit/gate-tests/check-brevity.test.sh +1 -0
  142. package/payload/context-kit/gate-tests/check-memory-off.test.sh +25 -1
  143. package/payload/context-kit/gate-tests/check-settings-paths/bad/expect.txt +3 -0
  144. package/payload/context-kit/gate-tests/check-settings-paths/bad/settings.json +16 -0
  145. package/payload/context-kit/gate-tests/check-settings-paths/bad/tools/checkwright-gates +2 -0
  146. package/payload/context-kit/gate-tests/check-settings-paths/good/expect.txt +2 -2
  147. package/payload/context-kit/gate-tests/check-settings-paths/good/settings.json +16 -0
  148. package/payload/context-kit/gate-tests/check-settings-paths/good/tools/checkwright-gates +2 -0
  149. package/payload/context-kit/gate-tests/session-context-spawn.test.sh +52 -0
  150. package/payload/context-kit/templates/nudge-delegation.txt +4 -0
  151. package/payload/context-kit/templates/settings-sessionstart.json +2 -2
  152. package/payload/delegation-kit/README.md +14 -8
  153. package/payload/delegation-kit/checks/check-agent-tier-explicit.gate +1 -0
  154. package/payload/delegation-kit/checks/check-gate-tamper.gate +1 -1
  155. package/payload/delegation-kit/close-surfaces.txt +3 -0
  156. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/bad/agents/stale-effort.md +10 -0
  157. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/bad/agents/stale.md +9 -0
  158. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/bad/agents/unbound.md +8 -0
  159. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/bad/expect.txt +3 -0
  160. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/bad/scripts/delegation-config.knobs +3 -0
  161. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/good/agents/explicit-cheap.md +3 -1
  162. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/good/agents/explicit-paired.md +10 -0
  163. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/good/expect.txt +1 -1
  164. package/payload/delegation-kit/gate-tests/check-agent-tier-explicit/good/scripts/delegation-config.knobs +3 -0
  165. package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/exception-arrays.sh +44 -0
  166. package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/expect.txt +12 -0
  167. package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/staged-files +12 -0
  168. package/payload/delegation-kit/gate-tests/check-gate-tamper/good/exception-arrays.sh +44 -0
  169. package/payload/delegation-kit/gate-tests/check-gate-tamper/good/staged-files +1 -0
  170. package/payload/delegation-kit/gate-tests/check-gate-tamper.test.sh +22 -1
  171. package/payload/delegation-kit/templates/agent-execution.md +7 -6
  172. package/payload/delegation-kit/templates/delegation-config.knobs +32 -0
  173. package/payload/delegation-kit/usage-tests/cases.tsv +35 -25
  174. package/payload/delegation-kit/usage-tests/dispatch-guard-cases.tsv +12 -3
  175. package/payload/doctrine-kit/DOCTRINE.md +109 -25
  176. package/payload/doctrine-kit/README.md +2 -2
  177. package/payload/drift-kit/README.md +15 -6
  178. package/payload/drift-kit/close-surfaces.txt +2 -0
  179. package/payload/drift-kit/templates/economics.md +7 -3
  180. package/payload/drift-kit/templates/kpis.list +1 -0
  181. package/payload/evidence-kit/README.md +3 -3
  182. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/expect.txt +1 -0
  183. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/runner.md +2 -1
  184. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/scripts/evidence-config.knobs +3 -1
  185. package/payload/evidence-kit/gate-tests/check-battery-roster/good/runner.md +1 -0
  186. package/payload/evidence-kit/gate-tests/check-battery-roster/good/scripts/evidence-config.knobs +3 -1
  187. package/payload/evidence-kit/gate-tests/check-evidence-baseline.test.sh +18 -2
  188. package/payload/evidence-kit/gate-tests/diff-baseline-status.test.sh +2 -3
  189. package/payload/evidence-kit/gate-tests/run-member-door.test.sh +50 -0
  190. package/payload/gate-sdk/README.md +9 -13
  191. package/payload/gate-sdk/bin/build-native.sh +11 -14
  192. package/payload/gate-sdk/bin/run-gates.ps1 +149 -24
  193. package/payload/gate-sdk/bin/run-gates.sh +57 -14
  194. package/payload/gate-sdk/checks/check-commit-msg.gate +1 -1
  195. package/payload/gate-sdk/checks/check-gate-substrate-parity.gate +1 -1
  196. package/payload/gate-sdk/checks/check-graph.gate +2 -2
  197. package/payload/gate-sdk/checks/check-install-disposition.gate +1 -1
  198. package/payload/gate-sdk/checks/check-path-dialect.gate +1 -1
  199. package/payload/gate-sdk/checks/check-psscriptanalyzer.gate +4 -0
  200. package/payload/gate-sdk/checks/check-shellcheck.gate +1 -1
  201. package/payload/gate-sdk/checks/check-template-copy-parity.gate +1 -1
  202. package/payload/gate-sdk/checks/check-tree-terms.gate +1 -1
  203. package/payload/gate-sdk/gate-tests/check-action-gh-repo/bad/args +2 -1
  204. package/payload/gate-sdk/gate-tests/check-action-gh-repo/bad/expect.txt +2 -0
  205. package/payload/gate-sdk/gate-tests/check-action-gh-repo/bad/tree/workflows/shapes.yml +29 -0
  206. package/payload/gate-sdk/gate-tests/check-action-permissions/bad/args +2 -1
  207. package/payload/gate-sdk/gate-tests/check-action-permissions/bad/expect.txt +2 -0
  208. package/payload/gate-sdk/gate-tests/check-action-permissions/bad/tree/workflows/shapes.yml +22 -0
  209. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/good/docs/demo-kit/index.md +3 -0
  210. package/payload/gate-sdk/gate-tests/check-gate-assertions.test.sh +17 -1
  211. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/expect.txt +12 -1
  212. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/scripts/check-array-axes.sh +44 -0
  213. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/scripts/check-descriptor.gate +2 -0
  214. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/expect.txt +2 -1
  215. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/scripts/check-array-axes.sh +46 -0
  216. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/scripts/check-descriptor.gate +2 -0
  217. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/expect.txt +1 -0
  218. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/scripts/check-psopt.gate +3 -0
  219. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/scripts/check-psopt.ps1 +1 -0
  220. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/scripts/gates.list +1 -0
  221. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/expect.txt +1 -0
  222. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/scripts/gates.list +3 -1
  223. package/payload/gate-sdk/gate-tests/check-gate-output/good/expect.txt +1 -0
  224. package/payload/gate-sdk/gate-tests/check-gate-output/good/gates.list +4 -2
  225. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/expect.txt +5 -0
  226. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/kitroot/checks/check-kitexec.gate +2 -0
  227. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/kitroot/checks/check-kitexec.ps1 +1 -0
  228. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-climb.gate +2 -0
  229. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-direxec.gate +2 -0
  230. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-twoexec.gate +3 -0
  231. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-txtexec.gate +2 -0
  232. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-txtexec.txt +1 -0
  233. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/expect.txt +2 -1
  234. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-psgood.gate +3 -0
  235. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-psgood.ps1 +1 -0
  236. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-rsgood.gate +3 -0
  237. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gates.list +2 -0
  238. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity.test.sh +42 -5
  239. package/payload/gate-sdk/gate-tests/check-graph/bad/SPEC-example-gate.md +1 -0
  240. package/payload/gate-sdk/gate-tests/check-graph/good/SPEC-example-gate.md +9 -1
  241. package/payload/gate-sdk/gate-tests/check-graph/good/SPEC-second-gate.md +2 -2
  242. package/payload/gate-sdk/gate-tests/check-graph-tree.test.sh +15 -29
  243. package/payload/gate-sdk/gate-tests/check-kit-enum/good/expect.txt +1 -1
  244. package/payload/gate-sdk/gate-tests/check-kit-enum/good/gates.list +3 -1
  245. package/payload/gate-sdk/gate-tests/check-portability-floor/bad/expect.txt +1 -0
  246. package/payload/gate-sdk/gate-tests/check-portability-floor/bad/tree/portability-patterns.notes.list +1 -0
  247. package/payload/gate-sdk/gate-tests/check-portability-floor/good/args +1 -1
  248. package/payload/gate-sdk/gate-tests/check-portability-floor/good/scripts/gate-sdk-config.knobs +1 -0
  249. package/payload/gate-sdk/gate-tests/check-portability-floor/good/tree/demo-kit/templates/portability-patterns.list +5 -0
  250. package/payload/gate-sdk/gate-tests/check-portability-floor/good/tree/rosters/constructs.list +6 -0
  251. package/payload/gate-sdk/gate-tests/check-portability-floor.test.sh +15 -2
  252. package/payload/gate-sdk/gate-tests/check-psscriptanalyzer/bad/expect.txt +2 -0
  253. package/payload/gate-sdk/gate-tests/check-psscriptanalyzer/bad/noisy.ps1 +1 -0
  254. package/payload/gate-sdk/gate-tests/check-psscriptanalyzer/bad/pwsh +8 -0
  255. package/payload/gate-sdk/gate-tests/check-psscriptanalyzer/bad/scripts/gate-sdk-config.knobs +1 -0
  256. package/payload/gate-sdk/gate-tests/check-psscriptanalyzer/good/clean.ps1 +1 -0
  257. package/payload/gate-sdk/gate-tests/check-psscriptanalyzer/good/expect.txt +1 -0
  258. package/payload/gate-sdk/gate-tests/check-psscriptanalyzer/good/pwsh +7 -0
  259. package/payload/gate-sdk/gate-tests/check-psscriptanalyzer/good/scripts/gate-sdk-config.knobs +2 -0
  260. package/payload/gate-sdk/gate-tests/check-shellcheck/bad/{warn.sh → alpha-kit/gate-tests/kit-warn.sh} +1 -1
  261. package/payload/gate-sdk/gate-tests/check-shellcheck/bad/expect.txt +2 -0
  262. package/payload/gate-sdk/gate-tests/check-shellcheck/bad/scripts/gate-sdk-config.knobs +2 -0
  263. package/payload/gate-sdk/gate-tests/check-shellcheck/bad/scripts/gate-tests/tests-warn.sh +5 -0
  264. package/payload/gate-sdk/gate-tests/check-shellcheck/good/{ok.sh → alpha-kit/gate-tests/kit-ok.sh} +1 -1
  265. package/payload/gate-sdk/gate-tests/check-shellcheck/good/expect.txt +1 -1
  266. package/payload/gate-sdk/gate-tests/check-shellcheck/good/scripts/gate-sdk-config.knobs +2 -0
  267. package/payload/gate-sdk/gate-tests/check-shellcheck/good/scripts/gate-tests/tests-ok.sh +4 -0
  268. package/payload/gate-sdk/gate-tests/check-template-copy-parity/bad/args +2 -0
  269. package/payload/gate-sdk/gate-tests/check-template-copy-parity/bad/scripts/gate-sdk-config.knobs +1 -0
  270. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/args +4 -1
  271. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/scripts/gate-sdk-config.knobs +1 -0
  272. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/stray/templates/session-note.sh +4 -0
  273. package/payload/gate-sdk/gate-tests/check-template-copy-parity.test.sh +6 -2
  274. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/drift-kit/templates/kpis.list +1 -0
  275. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/drift-kit/templates/kpis.list +1 -0
  276. package/payload/gate-sdk/gate-tests/check-tree-terms/bad/expect.txt +1 -0
  277. package/payload/gate-sdk/gate-tests/check-tree-terms/bad/tree/msg-patterns.old.list +1 -0
  278. package/payload/gate-sdk/gate-tests/check-tree-terms/good/args +2 -2
  279. package/payload/gate-sdk/gate-tests/check-tree-terms/good/scripts/gate-sdk-config.knobs +1 -0
  280. package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/demo-kit/templates/msg-patterns.list +2 -0
  281. package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/rosters/extra.list +2 -0
  282. package/payload/gate-sdk/gate-tests/check-tree-terms.test.sh +1 -0
  283. package/payload/gate-sdk/gate-tests/emit-arm-shape.test.sh +1 -1
  284. package/payload/gate-sdk/gate-tests/enforcement-map.test.sh +10 -2
  285. package/payload/gate-sdk/gate-tests/lib-gate.test.sh +29 -3
  286. package/payload/gate-sdk/gate-tests/lib-test-hermetic.test.sh +24 -0
  287. package/payload/gate-sdk/gate-tests/native-git-hooks.test.sh +261 -0
  288. package/payload/gate-sdk/gate-tests/native-rustflags.test.sh +20 -0
  289. package/payload/gate-sdk/gate-tests/run-arm-contract.test.sh +11 -4
  290. package/payload/gate-sdk/gate-tests/run-dispatch-streams.test.sh +2 -1
  291. package/payload/gate-sdk/gate-tests/run-for-path.test.sh +11 -1
  292. package/payload/gate-sdk/gate-tests/run-gate-tests.test.sh +64 -4
  293. package/payload/gate-sdk/lib/gate.sh +46 -6
  294. package/payload/gate-sdk/lib/test-hermetic.sh +16 -8
  295. package/payload/gate-sdk/templates/adopt.md +1 -1
  296. package/payload/gate-sdk/templates/msg-patterns.list +1 -1
  297. package/payload/gate-sdk/templates/portability-patterns.list +1 -1
  298. package/payload/guard-kit/README.md +12 -7
  299. package/payload/guard-kit/close-surfaces.txt +3 -0
  300. package/payload/guard-kit/gate-tests/check-door-binding/bad/alpha-kit/README.md +1 -1
  301. package/payload/guard-kit/gate-tests/check-door-binding/bad/expect.txt +1 -0
  302. package/payload/guard-kit/gate-tests/check-door-binding/bad/scripts/guard-config.knobs +2 -1
  303. package/payload/guard-kit/gate-tests/check-door-binding/bad/src/remedy.rs +3 -0
  304. package/payload/guard-kit/gate-tests/check-door-binding/good/expect.txt +1 -0
  305. package/payload/guard-kit/gate-tests/check-door-binding/good/scripts/guard-config.knobs +2 -1
  306. package/payload/guard-kit/gate-tests/check-door-binding/good/site/register.md +8 -0
  307. package/payload/guard-kit/gate-tests/check-door-binding/good/src/remedy.rs +13 -0
  308. package/payload/guard-kit/gate-tests/compare-settings-allow.test.sh +0 -1
  309. package/payload/guard-kit/gate-tests/consumer-rules.test.sh +105 -3
  310. package/payload/guard-kit/gate-tests/git-mutation-under-producer.test.sh +64 -2
  311. package/payload/guard-kit/gate-tests/guard-config-knobs.test.sh +18 -5
  312. package/payload/guard-kit/gate-tests/guard-verdict.test.sh +74 -0
  313. package/payload/guard-kit/gate-tests/worktree-confinement.test.sh +49 -5
  314. package/payload/guard-kit/guard-tests/background-cases.tsv +103 -1
  315. package/payload/guard-kit/guard-tests/cases.tsv +834 -64
  316. package/payload/guard-kit/guard-tests/powershell-cases.tsv +51 -2
  317. package/payload/guard-kit/guard-tests/variant-limits.tsv +14 -0
  318. package/payload/guard-kit/templates/close-triage.md +2 -2
  319. package/payload/guard-kit/templates/guard-config.knobs +9 -0
  320. package/payload/guard-kit/templates/settings-allow.json +1 -1
  321. package/payload/guard-kit/templates/settings-hooks.json +4 -4
  322. package/payload/lifecycle-kit/README.md +11 -6
  323. package/payload/lifecycle-kit/checks/check-disposed-findings.gate +3 -0
  324. package/payload/lifecycle-kit/checks/check-skill-binding.gate +1 -1
  325. package/payload/lifecycle-kit/checks/check-stage-skill-coverage.gate +1 -1
  326. package/payload/lifecycle-kit/close-surfaces.txt +2 -0
  327. package/payload/lifecycle-kit/gate-tests/boundary-set-record.test.sh +82 -0
  328. package/payload/lifecycle-kit/gate-tests/boundary-worktree-refusal.test.sh +11 -2
  329. package/payload/lifecycle-kit/gate-tests/check-close-surfaces.test.sh +11 -1
  330. package/payload/lifecycle-kit/gate-tests/check-disposed-findings/bad/args +2 -0
  331. package/payload/lifecycle-kit/gate-tests/check-disposed-findings/bad/disposed-findings.txt +5 -0
  332. package/payload/lifecycle-kit/gate-tests/check-disposed-findings/bad/expect.txt +5 -0
  333. package/payload/lifecycle-kit/gate-tests/check-disposed-findings/good/args +2 -0
  334. package/payload/lifecycle-kit/gate-tests/check-disposed-findings/good/disposed-findings.txt +3 -0
  335. package/payload/lifecycle-kit/gate-tests/check-disposed-findings/good/expect.txt +1 -0
  336. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/expect.txt +1 -0
  337. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/gap-inbox.md +1 -1
  338. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition.test.sh +27 -2
  339. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/surfaces/queue.md +6 -0
  340. package/payload/lifecycle-kit/gate-tests/check-stage-entry.test.sh +34 -2
  341. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/commands/align.md +3 -0
  342. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/expect.txt +1 -0
  343. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/scripts/lifecycle-config.knobs +3 -0
  344. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/commands/align.md +3 -0
  345. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/expect.txt +1 -0
  346. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/scripts/lifecycle-config.knobs +2 -0
  347. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage.test.sh +22 -2
  348. package/payload/lifecycle-kit/gate-tests/check-survey-record.test.sh +9 -2
  349. package/payload/lifecycle-kit/gate-tests/file-gap-recurrence.test.sh +27 -1
  350. package/payload/lifecycle-kit/gate-tests/journal-arm.test.sh +251 -0
  351. package/payload/lifecycle-kit/gate-tests/lead-journal-open.test.sh +46 -5
  352. package/payload/lifecycle-kit/gate-tests/stamp-before-write.test.sh +16 -2
  353. package/payload/lifecycle-kit/templates/consult.md +9 -5
  354. package/payload/lifecycle-kit/templates/frames/project-critique.md +18 -0
  355. package/payload/lifecycle-kit/templates/frames/stage-contract-sweep.md +18 -0
  356. package/payload/lifecycle-kit/templates/frames/stage-contract.md +15 -0
  357. package/payload/lifecycle-kit/templates/host-protocol.md +10 -0
  358. package/payload/lifecycle-kit/templates/lead.md +30 -25
  359. package/payload/lifecycle-kit/templates/stages/align.md +4 -0
  360. package/payload/lifecycle-kit/templates/stages/build.md +5 -3
  361. package/payload/lifecycle-kit/templates/stages/close.md +8 -6
  362. package/payload/lifecycle-kit/templates/stages/scope.md +6 -2
  363. package/payload/lifecycle-kit/templates/stages/spec.md +4 -0
  364. package/payload/lifecycle-kit/templates/stages/validate.md +4 -2
  365. package/payload/lifecycle-kit/templates/upgrade.md +1 -1
  366. package/payload/queue-kit/README.md +3 -2
  367. package/payload/queue-kit/close-surfaces.txt +3 -0
  368. package/payload/queue-kit/gate-tests/check-queue-sections/bad/expect.txt +1 -0
  369. package/payload/queue-kit/gate-tests/check-queue-sections/bad/scripts/queue-config.knobs +2 -0
  370. package/payload/queue-kit/gate-tests/check-queue-sections/good/TASK-QUEUE.md +1 -1
  371. package/payload/queue-kit/gate-tests/check-queue-sections/good/scripts/queue-config.knobs +2 -0
  372. package/payload/queue-kit/gate-tests/check-queue-sections.test.sh +65 -0
  373. package/payload/queue-kit/gate-tests/check-queue-slug-liveness.test.sh +10 -1
  374. package/payload/queue-kit/gate-tests/check-queue-wrap/good/TASK-QUEUE.md +4 -0
  375. package/payload/queue-kit/gate-tests/check-tag-lead-line/good/TASK-QUEUE.md +4 -0
  376. package/payload/queue-kit/gate-tests/check-task-conservation.test.sh +38 -0
  377. package/payload/queue-kit/gate-tests/check-task-names/bad/TASK-QUEUE.md +3 -0
  378. package/payload/queue-kit/gate-tests/check-task-names/bad/expect.txt +3 -0
  379. package/payload/queue-kit/gate-tests/check-task-names/good/TASK-QUEUE.md +8 -0
  380. package/payload/queue-kit/gate-tests/roadmap-lag.test.sh +137 -0
  381. package/payload/site-kit/README.md +3 -3
  382. package/payload/site-kit/gate-tests/check-docs-collapsible/bad/docs/unclosed.md +8 -0
  383. package/payload/site-kit/gate-tests/check-docs-collapsible/bad/expect.txt +1 -0
  384. package/payload/site-kit/gate-tests/check-docs-collapsible/good/docs/regions.md +7 -0
  385. package/payload/site-kit/gate-tests/check-docs-liquid-parse/bad/docs/dotted.md +9 -0
  386. package/payload/site-kit/gate-tests/check-docs-liquid-parse/bad/expect.txt +1 -0
  387. package/payload/site-kit/gate-tests/check-docs-liquid-parse/good/docs/dotted.md +7 -0
  388. package/payload/site-kit/gate-tests/check-docs-liquid-parse/good/expect.txt +1 -1
  389. package/payload/site-kit/gate-tests/site-health-probe.test.sh +219 -0
  390. package/payload/site-kit/templates/site-health.yml +181 -132
  391. package/profiles.list +11 -10
  392. package/recipes/openspec/canon-config.knobs +5 -0
  393. package/recipes/openspec-overlap/canon-config.knobs +12 -0
  394. package/recipes/openspec-overlap/unregister.list +1 -0
  395. package/payload/context-kit/checks/check-footprint-fresh.gate +0 -4
  396. package/payload/context-kit/gate-tests/check-footprint-fresh/bad/args +0 -4
  397. package/payload/context-kit/gate-tests/check-footprint-fresh/bad/emit.txt +0 -12
  398. package/payload/context-kit/gate-tests/check-footprint-fresh/bad/expect.txt +0 -1
  399. package/payload/context-kit/gate-tests/check-footprint-fresh/bad/projection.txt +0 -11
  400. package/payload/context-kit/gate-tests/check-footprint-fresh/good/CLAUDE.md +0 -6
  401. package/payload/context-kit/gate-tests/check-footprint-fresh/good/demo-kit/SPEC.md +0 -3
  402. package/payload/context-kit/gate-tests/check-footprint-fresh/good/demo-kit/templates/guide.md +0 -3
  403. package/payload/context-kit/gate-tests/check-footprint-fresh/good/docs/footprint.md +0 -32
  404. package/payload/context-kit/gate-tests/check-footprint-fresh/good/expect.txt +0 -1
  405. package/payload/context-kit/templates/session-context.sh +0 -148
  406. package/payload/delegation-kit/checks/check-rule-citation.gate +0 -3
  407. package/payload/delegation-kit/gate-tests/check-rule-citation/bad/args +0 -1
  408. package/payload/delegation-kit/gate-tests/check-rule-citation/bad/expect.txt +0 -1
  409. package/payload/delegation-kit/gate-tests/check-rule-citation/bad/spec.md +0 -9
  410. package/payload/delegation-kit/gate-tests/check-rule-citation/bad/tmpl.md +0 -4
  411. package/payload/delegation-kit/gate-tests/check-rule-citation/good/args +0 -1
  412. package/payload/delegation-kit/gate-tests/check-rule-citation/good/expect.txt +0 -1
  413. package/payload/delegation-kit/gate-tests/check-rule-citation/good/spec.md +0 -20
  414. package/payload/delegation-kit/gate-tests/check-rule-citation/good/tmpl.md +0 -5
  415. package/payload/drift-kit/templates/kpi-deprecated-surface.sh +0 -54
  416. package/payload/gate-sdk/checks/check-crate-arms.gate +0 -3
  417. package/payload/gate-sdk/checks/check-gate-binary-fresh.gate +0 -3
  418. package/payload/gate-sdk/checks/check-hook-exec-bit.gate +0 -3
  419. package/payload/gate-sdk/checks/check-kit-roots-dialect.gate +0 -3
  420. package/payload/gate-sdk/checks/check-packed-links.gate +0 -3
  421. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/crate/Cargo.toml +0 -7
  422. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/crate/src/lib.rs +0 -12
  423. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/expect.txt +0 -5
  424. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/scripts/gate-sdk-config.knobs +0 -3
  425. package/payload/gate-sdk/gate-tests/check-crate-arms/good/crate/Cargo.toml +0 -7
  426. package/payload/gate-sdk/gate-tests/check-crate-arms/good/crate/src/lib.rs +0 -11
  427. package/payload/gate-sdk/gate-tests/check-crate-arms/good/expect.txt +0 -2
  428. package/payload/gate-sdk/gate-tests/check-crate-arms/good/scripts/gate-sdk-config.knobs +0 -3
  429. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/args +0 -2
  430. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/expect.txt +0 -5
  431. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/kitroot/checks/check-vendored.gate +0 -2
  432. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/check-ported.gate +0 -2
  433. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/gate-sdk-config.knobs +0 -2
  434. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/gates.list +0 -4
  435. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/stamp.txt +0 -1
  436. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/stub-bin +0 -6
  437. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/args +0 -2
  438. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/expect.txt +0 -5
  439. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/kitroot/checks/check-vendored.gate +0 -2
  440. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/check-ported.gate +0 -2
  441. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/gate-sdk-config.knobs +0 -2
  442. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/gates.list +0 -4
  443. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/stamp.txt +0 -1
  444. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/stub-bin +0 -5
  445. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh.test.sh +0 -97
  446. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/bad/args +0 -1
  447. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/bad/expect.txt +0 -1
  448. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/bad/hooks/pre-commit +0 -2
  449. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/good/args +0 -1
  450. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/good/expect.txt +0 -1
  451. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/good/hooks/pre-commit +0 -2
  452. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/args +0 -5
  453. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/expect.txt +0 -1
  454. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/alpha-kit/checks/placeholder.txt +0 -3
  455. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/alpha-kit/gate-tests/alpha.test.sh +0 -3
  456. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/alpha-kit/lib/alpha.sh +0 -3
  457. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/beta-kit/checks/placeholder.txt +0 -3
  458. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/beta-kit/gate-tests/beta.test.sh +0 -3
  459. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/beta-kit/lib/beta.sh +0 -3
  460. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/gate-sdk/checks/placeholder.txt +0 -3
  461. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/gate-sdk/lib/gate.sh +0 -3
  462. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/scripts/gate-sdk-config.knobs +0 -7
  463. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/bad/tree/scripts/gates.list +0 -3
  464. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/args +0 -7
  465. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/expect.txt +0 -1
  466. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/alpha-kit/checks/placeholder.txt +0 -3
  467. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/alpha-kit/gate-tests/alpha.test.sh +0 -3
  468. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/alpha-kit/lib/alpha.sh +0 -3
  469. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/beta-kit/checks/placeholder.txt +0 -3
  470. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/beta-kit/gate-tests/beta.test.sh +0 -3
  471. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/beta-kit/lib/beta.sh +0 -3
  472. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/gate-sdk/checks/placeholder.txt +0 -3
  473. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/gate-sdk/lib/gate.sh +0 -3
  474. package/payload/gate-sdk/gate-tests/check-kit-roots-dialect/good/tree/scripts/gates.list +0 -3
  475. package/payload/gate-sdk/gate-tests/check-packed-links/bad/alpha-kit/README.md +0 -5
  476. package/payload/gate-sdk/gate-tests/check-packed-links/bad/args +0 -5
  477. package/payload/gate-sdk/gate-tests/check-packed-links/bad/beta-kit/README.md +0 -5
  478. package/payload/gate-sdk/gate-tests/check-packed-links/bad/expect.txt +0 -2
  479. package/payload/gate-sdk/gate-tests/check-packed-links/bad/scripts/gate-sdk-config.knobs +0 -4
  480. package/payload/gate-sdk/gate-tests/check-packed-links/good/alpha-kit/README.md +0 -5
  481. package/payload/gate-sdk/gate-tests/check-packed-links/good/args +0 -8
  482. package/payload/gate-sdk/gate-tests/check-packed-links/good/beta-kit/README.md +0 -9
  483. package/payload/gate-sdk/gate-tests/check-packed-links/good/expect.txt +0 -1
  484. package/payload/gate-sdk/gate-tests/check-packed-links/good/gamma-kit/SPEC.md +0 -4
  485. package/payload/gate-sdk/gate-tests/check-packed-links/good/scripts/gate-sdk-config.knobs +0 -6
  486. package/payload/gate-sdk/gate-tests/check-portability-floor/good/patterns.list +0 -5
  487. package/payload/gate-sdk/gate-tests/check-portability-floor/good/tree/portability-patterns.list +0 -5
  488. package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/msg-patterns.list +0 -2
  489. package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/msg-patterns.local.list +0 -3
  490. /package/payload/gate-sdk/gate-tests/{check-shellcheck → check-psscriptanalyzer}/bad/args +0 -0
  491. /package/payload/gate-sdk/gate-tests/{check-shellcheck → check-psscriptanalyzer}/good/args +0 -0
  492. /package/payload/gate-sdk/gate-tests/check-template-copy-parity/bad/{delegation-kit → vendor/delegation-kit}/templates/agent-budget-guard.sh +0 -0
  493. /package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/{delegation-kit → vendor/delegation-kit}/templates/agent-budget-guard.sh +0 -0
  494. /package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/{delegation-kit → vendor/delegation-kit}/templates/delegation-config.sh +0 -0
  495. /package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/{delegation-kit → vendor/delegation-kit}/templates/session-note.sh +0 -0
  496. /package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/{delegation-kit → vendor/delegation-kit}/templates/usage-poller.sh +0 -0
@@ -0,0 +1,261 @@
1
+ #!/usr/bin/env bash
2
+ # spec: gate-sdk/SPEC.md §git-hook — the binary under a served hook's name is that hook's launcher: git starts it with no interpreter, a clean commit lands on the summary line, a red member refuses the commit by gate name, a registry with no commit-msg member leaves that hook silent, a binary that cannot be started refuses naming the path and both remedies, a knob naming a hook's own name is refused at 2, a knob-file line naming any other knob is skipped unread while one setting the launcher's own knob as no scalar is refused at 2, and a registered member whose declaration resolves and cannot be read refuses either hook at 2
3
+ # spec: gate-sdk/SPEC.md §install-hooks — the arm places both hooks untracked in gate-hooks under the common git directory with an absolute core.hooksPath, so a linked worktree runs them; a re-run replaces both; an absent binary refuses at 2 and places nothing; a failed core.hooksPath write refuses at 2 ahead of the receipt; a failed blame.ignoreRevsFile write is reported with the status unmoved; a hook left behind by a replaced binary starts the binary now installed; --refresh re-places both hooks of an opted-in clone from a replaced binary with no config write, and places nothing off the work-tree top or in a clone not opted in
4
+ set -uo pipefail
5
+ source "$(dirname "${BASH_SOURCE[0]}")/../../gate-sdk/lib/test-hermetic.sh"
6
+
7
+ HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)"
8
+ # shellcheck source=../lib/gate.sh
9
+ source "$HERE/gate-sdk/lib/gate.sh"
10
+ PINNED="$GATE_SDK_NATIVE_BIN"
11
+ [[ -x "$PINNED" ]] || { echo "native-git-hooks.test: the gate binary $PINNED is absent — build it first"; exit 2; }
12
+ unset GATE_SDK_NATIVE_BIN GATE_SDK_GATES_DIR GATE_SDK_KIT_DIRS GATE_SDK_ROOT GATE_SDK_VERBOSE
13
+
14
+ SANDBOX="$(mktemp -d)"
15
+ trap 'rm -rf "$SANDBOX"' EXIT
16
+ sfx="$(gate_exe_suffix)"
17
+
18
+ fails=0
19
+ note() { echo " FAIL [$1]: $2"; fails=$((fails + 1)); }
20
+ g() { git -C "$repo" -c user.email=t@example.invalid -c user.name=t "$@"; }
21
+
22
+ repo="$SANDBOX/repo"
23
+ bin_rel="native/target/release/checkwright-gates$sfx"
24
+ mkdir -p "$repo/gate-sdk" "$repo/scripts" "$repo/${bin_rel%/*}"
25
+ cp -R "$HERE/gate-sdk/bin" "$HERE/gate-sdk/lib" "$repo/gate-sdk/"
26
+ cp "$PINNED" "$repo/$bin_rel"
27
+ printf 'native/target/\n' >"$repo/.gitignore"
28
+ printf 'check-probe-word\n' >"$repo/scripts/gates.list"
29
+ cat >"$repo/scripts/check-probe-word.sh" <<'EOF'
30
+ #!/bin/sh
31
+ # graph: couples=*.txt dir=one valve=none tier=precommit
32
+ if grep -l FORBIDDEN ./*.txt 2>/dev/null; then
33
+ echo "check-probe-word: a tracked note carries the forbidden word"
34
+ exit 1
35
+ fi
36
+ echo "PROBE-WORD: clean"
37
+ EOF
38
+ chmod +x "$repo/scripts/check-probe-word.sh"
39
+ git -C "$repo" init -q -b main
40
+ g add -A
41
+ g commit -qm seed
42
+
43
+ hooks="$repo/.git/gate-hooks"
44
+
45
+ # 1. an absent binary refuses the opt-in at 2 and places nothing
46
+ mv "$repo/$bin_rel" "$SANDBOX/held"
47
+ out="$( cd "$repo" && "$SANDBOX/held" --install-hooks 2>&1 )"; rc=$?
48
+ [[ "$rc" -eq 2 ]] || note absent-install-status "want exit 2 with no binary at the knob's path, got $rc -- $out"
49
+ grep -qF "no gate binary at $bin_rel" <<<"$out" || note absent-install-text "the refusal does not name the path: $out"
50
+ [[ -e "$hooks" ]] && note absent-install-wrote "a refused opt-in left a hooks directory"
51
+ [[ -z "$(git -C "$repo" config --get core.hooksPath)" ]] || note absent-install-config "a refused opt-in set core.hooksPath"
52
+ mv "$SANDBOX/held" "$repo/$bin_rel"
53
+
54
+ # 2. the opt-in places both hooks under the common git directory and points the clone at them
55
+ out="$( cd "$repo" && "./$bin_rel" --install-hooks 2>&1 )"; rc=$?
56
+ [[ "$rc" -eq 0 ]] || note install-status "want exit 0 from --install-hooks, got $rc -- $out"
57
+ for h in pre-commit commit-msg; do
58
+ [[ -x "$hooks/$h$sfx" ]] || note "placed-$h" "no executable $h$sfx in $hooks"
59
+ grep -qxF " $h$sfx" <<<"$out" || note "receipt-$h" "the receipt does not list $h$sfx: $out"
60
+ done
61
+ path="$(git -C "$repo" config --get core.hooksPath)"
62
+ gate_path_rooted "$path" || note hooks-path-absolute "core.hooksPath is not absolute: $path"
63
+ [[ "$(cd "$path" 2>/dev/null && pwd -P)" == "$(cd "$hooks" && pwd -P)" ]] || note hooks-path "core.hooksPath names $path, not $hooks"
64
+ [[ -z "$(g status --porcelain)" ]] || note untracked "the opt-in changed the work tree: $(g status --porcelain)"
65
+
66
+ # 3. a clean commit lands through the native hook, the commit-msg hook silent with no member at its tier
67
+ printf 'a note\n' >"$repo/a.txt"
68
+ g add a.txt
69
+ out="$(g commit -m 'docs: a clean note' 2>&1)"; rc=$?
70
+ [[ "$rc" -eq 0 ]] || note clean-status "a clean commit was refused ($rc): $out"
71
+ grep -qF 'pre-commit: 1 gate(s) passed.' <<<"$out" || note clean-summary "the pre-commit summary line is missing: $out"
72
+ grep -qF 'commit-msg:' <<<"$out" && note msg-silent "the commit-msg hook printed with no member at its tier: $out"
73
+
74
+ # 4. a violating commit is refused with the gate's name
75
+ printf 'FORBIDDEN\n' >"$repo/b.txt"
76
+ g add b.txt
77
+ out="$(g commit -m 'docs: a bad note' 2>&1)"; rc=$?
78
+ [[ "$rc" -ne 0 ]] || note red-status "a violating commit landed: $out"
79
+ grep -qF 'pre-commit: check-probe-word failed (see above).' <<<"$out" || note red-name "the refusal does not name the gate: $out"
80
+ g reset -q -- b.txt
81
+ rm -f "$repo/b.txt"
82
+
83
+ # 5. a linked worktree runs the same hooks, its own binary at the knob's path
84
+ wt="$SANDBOX/wt"
85
+ g worktree add -q -b side "$wt" HEAD
86
+ mkdir -p "$wt/${bin_rel%/*}"
87
+ cp "$PINNED" "$wt/$bin_rel"
88
+ printf 'FORBIDDEN\n' >"$wt/c.txt"
89
+ git -C "$wt" add c.txt
90
+ out="$(git -C "$wt" -c user.email=t@example.invalid -c user.name=t commit -m 'docs: from a worktree' 2>&1)"; rc=$?
91
+ [[ "$rc" -ne 0 ]] || note worktree-status "a violating commit landed from a linked worktree: $out"
92
+ grep -qF 'pre-commit: check-probe-word failed (see above).' <<<"$out" || note worktree-name "the worktree's refusal does not name the gate: $out"
93
+ g worktree remove --force "$wt"
94
+
95
+ # 6. a registered commit-msg member is reached with no re-install
96
+ cat >"$repo/scripts/check-probe-msg.sh" <<'EOF'
97
+ #!/bin/sh
98
+ # graph: couples=* dir=one valve=none tier=commit-msg
99
+ if grep -q WIP "$1"; then
100
+ echo "check-probe-msg: a WIP subject"
101
+ exit 1
102
+ fi
103
+ echo "PROBE-MSG: clean"
104
+ EOF
105
+ chmod +x "$repo/scripts/check-probe-msg.sh"
106
+ printf 'check-probe-word\ncheck-probe-msg\n' >"$repo/scripts/gates.list"
107
+ g add -A
108
+ out="$(g commit -m 'WIP: a subject' 2>&1)"; rc=$?
109
+ [[ "$rc" -ne 0 ]] || note msg-red-status "a commit-msg member's red did not refuse the commit: $out"
110
+ grep -qF 'commit-msg: check-probe-msg failed (see above).' <<<"$out" || note msg-red-name "the refusal does not name the commit-msg gate: $out"
111
+ out="$(g commit -m 'chore: register a message gate' 2>&1)"; rc=$?
112
+ [[ "$rc" -eq 0 ]] || note msg-green-status "a clean message was refused ($rc): $out"
113
+ grep -qF 'commit-msg: 1 gate(s) passed.' <<<"$out" || note msg-green-summary "the commit-msg summary line is missing: $out"
114
+
115
+ # 7. a hook left behind by a replaced binary starts the binary now installed
116
+ cat >"$SANDBOX/stub" <<'EOF'
117
+ #!/bin/sh
118
+ echo "stub started: $*"
119
+ exit 7
120
+ EOF
121
+ chmod +x "$SANDBOX/stub"
122
+ mv "$repo/$bin_rel" "$SANDBOX/held"
123
+ cp "$SANDBOX/stub" "$repo/$bin_rel"
124
+ if [[ -z "$sfx" ]]; then
125
+ out="$( cd "$repo" && "$hooks/commit-msg" some-file 2>&1 )"; rc=$?
126
+ [[ "$rc" -eq 7 ]] || note stale-status "the placed hook did not return the installed binary's status, got $rc -- $out"
127
+ grep -qxF 'stub started: --git-hook commit-msg some-file' <<<"$out" || note stale-argv "the placed hook did not start the installed binary on the arm with git's operands: $out"
128
+ fi
129
+
130
+ # 8. a binary that cannot be started refuses the commit, naming the path and both remedies
131
+ rm -f "$repo/$bin_rel"
132
+ printf 'another note\n' >"$repo/d.txt"
133
+ g add d.txt
134
+ out="$(g commit -m 'docs: with no binary' 2>&1)"; rc=$?
135
+ [[ "$rc" -ne 0 ]] || note absent-status "a commit landed with no gate binary to judge it: $out"
136
+ grep -qF "pre-commit: cannot start the gate binary at $bin_rel" <<<"$out" || note absent-path "the refusal does not name the resolved path: $out"
137
+ grep -qF 'place or build the binary GATE_SDK_NATIVE_BIN names' <<<"$out" || note absent-remedy "the refusal does not name the place-or-build remedy: $out"
138
+ grep -qF 'git commit --no-verify' <<<"$out" || note absent-bypass "the refusal does not name the bypass: $out"
139
+ out="$(g commit --no-verify -m 'docs: with no binary' 2>&1)" || note absent-bypass-works "the bypass did not land the commit: $out"
140
+ mv "$SANDBOX/held" "$repo/$bin_rel"
141
+
142
+ # 9. a knob naming a hook's own name is refused at 2, since the launcher would start itself
143
+ out="$( cd "$repo" && GATE_SDK_NATIVE_BIN="$hooks/pre-commit$sfx" "$hooks/pre-commit$sfx" 2>&1 )"; rc=$?
144
+ [[ "$rc" -eq 2 ]] || note self-status "want exit 2 on a knob naming a hook's own name, got $rc -- $out"
145
+ grep -qF 'the launcher would start itself' <<<"$out" || note self-text "the refusal does not say why: $out"
146
+
147
+ # 10. a re-run replaces both hooks and leaves the same two
148
+ rm -f "$hooks/commit-msg$sfx" "$hooks/pre-commit$sfx"
149
+ printf 'stale\n' >"$hooks/pre-commit$sfx"
150
+ out="$( cd "$repo" && "./$bin_rel" --install-hooks 2>&1 )"; rc=$?
151
+ [[ "$rc" -eq 0 ]] || note rerun-status "want exit 0 from a re-run, got $rc -- $out"
152
+ for h in pre-commit commit-msg; do
153
+ cmp -s "$hooks/$h$sfx" "$repo/$bin_rel" || note "rerun-$h" "a re-run did not replace $h$sfx with the binary"
154
+ done
155
+ [[ "$(find "$hooks" -type f | wc -l | tr -d ' ')" -eq 2 ]] || note rerun-count "a re-run left other than the two hooks: $(ls "$hooks")"
156
+
157
+ # 11. a failed core.hooksPath write refuses the opt-in at 2, ahead of the receipt
158
+ : >"$repo/.git/config.lock"
159
+ out="$( cd "$repo" && "./$bin_rel" --install-hooks 2>&1 )"; rc=$?
160
+ rm -f "$repo/.git/config.lock"
161
+ [[ "$rc" -eq 2 ]] || note unwired-status "want exit 2 when core.hooksPath cannot be written, got $rc -- $out"
162
+ grep -qF 'could not set core.hooksPath' <<<"$out" || note unwired-text "the refusal does not name the key: $out"
163
+ grep -qF 'Active hooks:' <<<"$out" && note unwired-receipt "a refused opt-in printed its receipt: $out"
164
+
165
+ # 13. a failed blame.ignoreRevsFile write is reported and moves no status; a key already holding two values fails that write alone
166
+ : >"$repo/.git-blame-ignore-revs"
167
+ git -C "$repo" config --add blame.ignoreRevsFile one
168
+ git -C "$repo" config --add blame.ignoreRevsFile two
169
+ out="$( cd "$repo" && "./$bin_rel" --install-hooks 2>&1 )"; rc=$?
170
+ git -C "$repo" config --unset-all blame.ignoreRevsFile
171
+ rm -f "$repo/.git-blame-ignore-revs"
172
+ [[ "$rc" -eq 0 ]] || note blame-status "want exit 0 when only blame.ignoreRevsFile cannot be written, got $rc -- $out"
173
+ grep -qF 'could not set blame.ignoreRevsFile' <<<"$out" || note blame-text "the failed write is not reported by key: $out"
174
+ grep -qF 'Active hooks:' <<<"$out" || note blame-receipt "the opt-in printed no receipt: $out"
175
+
176
+ # 12. a registered member that resolves and cannot be read refuses either hook at 2; a host that reads through the mode (an administrator, a filesystem with no mode bits) cannot build the case
177
+ printf 'subject\n' >"$SANDBOX/msg"
178
+ printf 'a staged note\n' >"$repo/e.txt"
179
+ g add e.txt
180
+ for pair in "commit-msg:check-probe-msg" "pre-commit:check-probe-word"; do
181
+ hook="${pair%%:*}"; member="$repo/scripts/${pair##*:}.sh"
182
+ chmod 000 "$member"
183
+ if ! head -c 1 "$member" >/dev/null 2>&1; then
184
+ if [[ "$hook" == commit-msg ]]; then
185
+ out="$( cd "$repo" && "./$bin_rel" --git-hook commit-msg "$SANDBOX/msg" 2>&1 )"; rc=$?
186
+ else
187
+ out="$( cd "$repo" && "./$bin_rel" --git-hook pre-commit 2>&1 )"; rc=$?
188
+ fi
189
+ [[ "$rc" -eq 2 ]] || note "unreadable-$hook-status" "want exit 2 over an unreadable resolved member, got $rc -- $out"
190
+ grep -qF "$hook: cannot read the declaration scripts/${pair##*:}.sh" <<<"$out" || note "unreadable-$hook-text" "the refusal does not name the declaration: $out"
191
+ fi
192
+ chmod 755 "$member"
193
+ done
194
+ g reset -q -- e.txt
195
+ rm -f "$repo/e.txt"
196
+
197
+ # 14. the launcher reads its one knob and judges no other line: a name no table holds refuses the installed build and not the hook, which starts the binary the same file names
198
+ if [[ -z "$sfx" ]]; then
199
+ cat >"$SANDBOX/pass" <<'EOF'
200
+ #!/bin/sh
201
+ echo "stub started: $*"
202
+ exit 0
203
+ EOF
204
+ chmod +x "$SANDBOX/pass"
205
+ # spec: gate-sdk/SPEC.md §lib/test-hermetic.sh — these cases read the sandbox repository's own overlay, so its pin is lifted for them
206
+ overlay_pin="$GATE_SDK_LOCAL_KNOB_FILE"
207
+ unset GATE_SDK_LOCAL_KNOB_FILE
208
+ printf 'GATE_SDK_MINTED_BY_A_LATER_BUILD = on\nGATE_SDK_NATIVE_BIN = %s\n' "$SANDBOX/pass" >"$repo/scripts/gate-sdk-config.local.knobs"
209
+ printf 'a later note\n' >"$repo/f.txt"
210
+ g add f.txt
211
+ out="$( cd "$repo" && "./$bin_rel" --git-hook pre-commit 2>&1 )"; rc=$?
212
+ [[ "$rc" -eq 2 ]] || note unknown-knob-build-status "want exit 2 from the installed build over a name its table lacks, got $rc -- $out"
213
+ grep -qF 'GATE_SDK_MINTED_BY_A_LATER_BUILD is not a gate-sdk knob' <<<"$out" || note unknown-knob-build-text "the installed build does not name the unknown knob: $out"
214
+ out="$(g commit -m 'docs: past a knob the launcher does not know' 2>&1)"; rc=$?
215
+ [[ "$rc" -eq 0 ]] || note unknown-knob-launcher-status "the launcher refused a commit over a knob-file line that is not its own ($rc): $out"
216
+ grep -qxF 'stub started: --git-hook pre-commit' <<<"$out" || note unknown-knob-launcher-start "the launcher did not start the binary the knob file names: $out"
217
+ printf 'GATE_SDK_NATIVE_BIN[] = %s\n' "$SANDBOX/pass" >"$repo/scripts/gate-sdk-config.local.knobs"
218
+ out="$( cd "$repo" && "$hooks/pre-commit" 2>&1 )"; rc=$?
219
+ [[ "$rc" -eq 2 ]] || note bin-line-status "want exit 2 from the launcher over a line setting its knob as no scalar, got $rc -- $out"
220
+ grep -qF 'scripts/gate-sdk-config.local.knobs:1: ' <<<"$out" || note bin-line-text "the refusal does not name the file and line: $out"
221
+ rm -f "$repo/scripts/gate-sdk-config.local.knobs"
222
+ export GATE_SDK_LOCAL_KNOB_FILE="$overlay_pin"
223
+ fi
224
+
225
+ # 15. --refresh re-places both hooks from a replaced binary and does nothing else; off the work-tree top it places nothing, and an absent binary refuses at 2
226
+ digest() { git hash-object --no-filters -- "$1"; }
227
+ stale_hooks() { for h in pre-commit commit-msg; do rm -f "$hooks/$h$sfx"; printf 'stale\n' >"$hooks/$h$sfx"; done; }
228
+ stale_hooks
229
+ cp "$repo/$bin_rel" "$SANDBOX/rebuilt"
230
+ mv -f "$SANDBOX/rebuilt" "$repo/$bin_rel"
231
+ out="$( cd "$repo/scripts" && "../$bin_rel" --install-hooks --refresh 2>&1 )"; rc=$?
232
+ [[ "$rc" -eq 0 && -z "$out" ]] || note refresh-subdir "want a silent exit 0 off the work-tree top, got $rc -- $out"
233
+ [[ "$(cat "$hooks/pre-commit$sfx")" == stale ]] || note refresh-subdir-placed "a refresh off the work-tree top re-placed a hook"
234
+ mv "$repo/$bin_rel" "$SANDBOX/held"
235
+ out="$( cd "$repo" && "$SANDBOX/held" --install-hooks --refresh 2>&1 )"; rc=$?
236
+ [[ "$rc" -eq 2 ]] || note refresh-absent-status "want exit 2 from a refresh with no binary at the knob's path, got $rc -- $out"
237
+ grep -qF "no gate binary at $bin_rel" <<<"$out" || note refresh-absent-text "the refusal does not name the path: $out"
238
+ mv "$SANDBOX/held" "$repo/$bin_rel"
239
+ before="$(git -C "$repo" config --list --local)"
240
+ out="$( cd "$repo" && "./$bin_rel" --install-hooks --refresh 2>&1 )"; rc=$?
241
+ [[ "$rc" -eq 0 ]] || note refresh-status "want exit 0 from --refresh in an opted-in clone, got $rc -- $out"
242
+ [[ "$out" == "install-hooks: refreshed $(git -C "$repo" config --get core.hooksPath)" ]] || note refresh-line "want the one refreshed line naming the hooks directory, got: $out"
243
+ for h in pre-commit commit-msg; do
244
+ [[ "$(digest "$hooks/$h$sfx")" == "$(digest "$repo/$bin_rel")" ]] || note "refresh-$h" "a refresh left $h$sfx other than the replaced binary's bytes"
245
+ [[ -x "$hooks/$h$sfx" ]] || note "refresh-exec-$h" "a refresh left $h$sfx not executable"
246
+ done
247
+ [[ "$(git -C "$repo" config --list --local)" == "$before" ]] || note refresh-config "a refresh changed the clone's git config"
248
+
249
+ # 16. --refresh never opts a clone in: with core.hooksPath unset it places nothing and leaves the key unset
250
+ git -C "$repo" config --unset core.hooksPath
251
+ rm -rf "$hooks"
252
+ out="$( cd "$repo" && "./$bin_rel" --install-hooks --refresh 2>&1 )"; rc=$?
253
+ [[ "$rc" -eq 0 && -z "$out" ]] || note refresh-unopted "want a silent exit 0 in a clone not opted in, got $rc -- $out"
254
+ [[ -e "$hooks" ]] && note refresh-unopted-placed "a refresh placed hooks in a clone not opted in"
255
+ [[ -z "$(git -C "$repo" config --get core.hooksPath)" ]] || note refresh-unopted-config "a refresh set core.hooksPath"
256
+ out="$( cd "$repo" && "./$bin_rel" --install-hooks --refresh extra 2>&1 )"; rc=$?
257
+ [[ "$rc" -eq 2 ]] || note refresh-operand "want exit 2 from --refresh with an operand, got $rc -- $out"
258
+
259
+ [[ "$fails" -eq 0 ]] || { echo "native-git-hooks.test: $fails assertion(s) failed"; exit 1; }
260
+ echo "native-git-hooks.test: clean (--install-hooks places both hooks untracked under the common git directory, absolute in core.hooksPath, refusing with nothing placed when the binary is absent; git starts the placed binary as each hook with no interpreter: a clean commit lands on the summary line, a red member refuses by gate name from the main checkout and from a linked worktree, the commit-msg hook is silent until a member registers at its tier and reaches one with no re-install; a hook outliving a replaced binary starts the installed one, an unstartable binary refuses naming the path and both remedies, a knob naming a hook is refused at 2, a re-run replaces both, a knob-file line naming a knob the launcher does not know is left to the installed build, --refresh re-places an opted-in clone's hooks and nothing else, a failed core.hooksPath write refuses at 2 with no receipt, a failed blame.ignoreRevsFile write is reported at exit 0, and an unreadable resolved member refuses either hook at 2)"
261
+ exit 0
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env bash
2
+ # spec: gate-sdk/SPEC.md §build-native — caller flags precede remaps, empty and root prefixes add nothing
3
+ set -uo pipefail
4
+ source "$(dirname "${BASH_SOURCE[0]}")/../../gate-sdk/lib/test-hermetic.sh"
5
+ source "$GATE_SDK_TEST_LIB_DIR/gate.sh"
6
+
7
+ check_flags() {
8
+ local got
9
+ got="$(gate_native_rustflags)"
10
+ [[ "$got" == "$1" ]] || { printf 'FAIL: expected <%s>, got <%s>\n' "$1" "$got"; return 1; }
11
+ }
12
+ RUSTFLAGS='-C opt-level=1' CARGO_HOME=/cache/ HOME=/builder-home/ \
13
+ check_flags '-C opt-level=1 --remap-path-prefix=/cache=/builder --remap-path-prefix=/builder-home=/builder' || exit 1
14
+ (
15
+ unset CARGO_HOME RUSTFLAGS
16
+ HOME=/builder-home check_flags '--remap-path-prefix=/builder-home/.cargo=/builder --remap-path-prefix=/builder-home=/builder'
17
+ ) || exit 1
18
+ RUSTFLAGS='' CARGO_HOME=/ HOME='' check_flags '' || exit 1
19
+ RUSTFLAGS='caller' CARGO_HOME=/ HOME=/ check_flags 'caller ' || exit 1
20
+ echo 'NATIVE-RUSTFLAGS: clean (caller flags, default cargo home, trailing slash, empty and root prefixes)'
@@ -50,7 +50,7 @@ assert_has contract ' FAIL: g_gone (unresolved)' "
50
50
  assert_has contract '2 of 3 gates FAILED: g_fail g_gone' "$out"
51
51
  assert_has contract '1 gate(s) omitted (local-policy)' "$out"
52
52
  # quiet green: a passing member's captured output is discarded unless the banner roll is on
53
- out="$(merged)"
53
+ out="$(GATE_SDK_VERBOSE='' merged)"
54
54
  assert_absent contract 'g_pass: a line of its own output' "$out"
55
55
  # spec: gate-sdk/SPEC.md §run-gates — the omission line carries none of the summary's text, because
56
56
  # the consumer smokes match the green phrase against this output
@@ -84,15 +84,22 @@ assert_has for-empty 'run-gates: --for needs at least one path' "$out"
84
84
  # spec: gate-sdk/SPEC.md §The bin/-tool contract — help on stdout at exit 0, an unrecognized leading-dash first argument as usage on stderr at exit 2
85
85
  battery --help > "$scratch/h.out" 2> "$scratch/h.err"; rc=$?
86
86
  assert_rc help "$rc" 0
87
- assert_has help 'usage: run-gates.sh' "$(<"$scratch/h.out")"
87
+ assert_has help 'usage: --run' "$(<"$scratch/h.out")"
88
88
  [[ -s "$scratch/h.err" ]] && { echo "FAIL [help]: the help arm wrote to stderr"; fails=$((fails + 1)); }
89
89
 
90
90
  battery --nope > "$scratch/u.out" 2> "$scratch/u.err"; rc=$?
91
91
  assert_rc unrecognized "$rc" 2
92
92
  assert_has unrecognized 'run-gates: unrecognized option: --nope' "$(<"$scratch/u.err")"
93
- assert_has unrecognized 'usage: run-gates.sh' "$(<"$scratch/u.err")"
93
+ assert_has unrecognized 'usage: --run' "$(<"$scratch/u.err")"
94
94
  [[ -s "$scratch/u.out" ]] && { echo "FAIL [unrecognized]: the refusal wrote to stdout"; fails=$((fails + 1)); }
95
95
 
96
+ # spec: gate-sdk/SPEC.md §run-gates — a gates-dir that is really a gate name steers to --only on the binary door
97
+ out="$(merged g_pass)"; rc=$?
98
+ assert_rc steer "$rc" 2
99
+ assert_has steer "run-gates: 'g_pass' is a gate registered in $scratch/gates.list, not a gates dir — run it with: " "$out"
100
+ assert_has steer ' --only g_pass' "$out"
101
+ assert_absent steer 'run-gates.sh --only' "$out"
102
+
96
103
  # spec: gate-sdk/SPEC.md §run-gates — an ungoverned path is a fact, not a failure: a note on stdout at exit 0
97
104
  mk_gate g_narrow 0
98
105
  { echo g_narrow; } > "$scratch/gates.list"
@@ -186,5 +193,5 @@ assert_has emit-miss 'gate-sdk/SPEC.md §The non-gate arm owns the arm contra
186
193
  assert_absent emit-miss 'check-shellcheck' "$out"
187
194
 
188
195
  [[ "$fails" -eq 0 ]] || { echo "run-arm-contract.test: $fails assertion(s) failed"; exit 1; }
189
- echo "run-arm-contract.test: clean (the three FAIL tails, the exact green phrase, the omission line beside the summary and not in it, the four argv refusals, the --only argv channel forwarded on a single-member selection and refused on a two-member one, the sole-name widening selected/refused/bounded, two default runs and a serial run byte-identical, and a mistyped --emit arm answered with the arm roster and no gate name)"
196
+ echo "run-arm-contract.test: clean (the three FAIL tails, the exact green phrase, the omission line beside the summary and not in it, the four argv refusals, the gates-dir steer onto the binary door, the --only argv channel forwarded on a single-member selection and refused on a two-member one, the sole-name widening selected/refused/bounded, two default runs and a serial run byte-identical, and a mistyped --emit arm answered with the arm roster and no gate name)"
190
197
  exit 0
@@ -27,7 +27,8 @@ printf '# graph: couples=cfg dir=one valve=none tier=precommit trigger=*\n' \
27
27
  > "$scratch/check-noisy.gate"
28
28
  cat > "$scratch/bin" <<'BIN'
29
29
  #!/usr/bin/env bash
30
- exit 0
30
+ [[ "$1 $2" == "--emit gate-argv" ]] || exit 9
31
+ printf '%s\n%s\n' "$0" check-noisy
31
32
  BIN
32
33
  chmod +x "$scratch/bin"
33
34
 
@@ -72,6 +72,16 @@ GATE_SDK_GATES_DIR="$scratch" GATE_SDK_KIT_DIRS="$scratch" \
72
72
  GATE_SDK_TMP_DIR="$scratch/.tmp" bash "$RUN" --for >/dev/null 2>&1
73
73
  [[ $? -eq 2 ]] || { echo "FAIL [usage]: --for with no path should exit 2"; fails=$((fails + 1)); }
74
74
 
75
+ # A member that resolves and cannot be read refuses the selection at exit 2, never a
76
+ # narrower one; a host that reads through the mode cannot build the case.
77
+ chmod 000 "$scratch/g_glob.sh"
78
+ if ! head -c 1 "$scratch/g_glob.sh" >/dev/null 2>&1; then
79
+ out="$(run_for alpha/foo.txt)"; rc=$?
80
+ [[ "$rc" -eq 2 ]] || { echo "FAIL [unreadable]: expected exit 2, got $rc -- $out"; fails=$((fails + 1)); }
81
+ assert_has unreadable "run-gates: --for cannot read the declaration" "$out"
82
+ fi
83
+ chmod 755 "$scratch/g_glob.sh"
84
+
75
85
  [[ "$fails" -eq 0 ]] || { echo "run-for-path.test: $fails assertion(s) failed"; exit 1; }
76
- echo "run-for-path.test: clean (--for selects by shared matcher; trigger='*' universal, mode=staged pathspec passes args, ungoverned path noted)"
86
+ echo "run-for-path.test: clean (--for selects by shared matcher; trigger='*' universal, mode=staged pathspec passes args, ungoverned path noted, an unreadable resolved member refused at 2)"
77
87
  exit 0
@@ -12,8 +12,8 @@
12
12
  # and the write-side row below drives the runner from a non-git sandbox cwd.
13
13
  #
14
14
  # The self-invocation is bounded by an inner tree that cannot reach the runner
15
- # again: rows below hand it fixture dirs and no *.test.sh at all, and the one
16
- # tree that ships a *.test.sh ships a leaf that reads its environment and exits.
15
+ # again: rows below hand it fixture dirs and no *.test.sh at all, and the two
16
+ # trees that ship a *.test.sh ship a leaf that reads its environment and exits.
17
17
  # A scratch *.test.sh that re-invokes the runner would not be bounded.
18
18
  #
19
19
  # Run by the --run-gate-tests arm (any <tests-dir>/*.test.sh; must exit 0).
@@ -86,7 +86,7 @@ assert_has both 'GATE-TESTS: clean' "$out"
86
86
  out="$(gate_arm_run --run-gate-tests --help 2>&1)"; rc=$?
87
87
  assert_rc help-flag "$rc" 2
88
88
  assert_has help-flag 'unrecognized option: --help' "$out"
89
- assert_has help-flag 'usage: run-gates.sh --run-gate-tests' "$out"
89
+ assert_has help-flag 'usage: --run-gate-tests' "$out"
90
90
  assert_absent help-flag 'no fixture tree at' "$out"
91
91
  out="$(gate_arm_run --run-gate-tests -- "$t" "$scratch/checks" 2>&1)"; rc=$?
92
92
  assert_rc separator "$rc" 0
@@ -208,6 +208,8 @@ chmod +x "$scratch/checks/stub-writer.sh"
208
208
  # through it exactly as it resolves a real .gate member.
209
209
  : >"$scratch/checks/stub-native.gate"
210
210
  { printf '#!/usr/bin/env bash\n'
211
+ # The stand-in answers its own member's invocation, as the real arm answers a declared one.
212
+ printf 'if [[ "$1 $2" == "--emit gate-argv" && "$3" == */stub-native.gate ]]; then printf "%%s\\n%%s\\n" "$0" stub-native; exit 0; fi\n'
211
213
  printf 'if [[ "$1" == stub-native ]]; then\n'
212
214
  # Falling back to the relative default is what makes an unpinned case
213
215
  # observable as a write inside the case dir.
@@ -244,6 +246,64 @@ seen="$(cat "$scratch/env-probe.seen" 2>/dev/null)"
244
246
  fails=$((fails + 1))
245
247
  }
246
248
 
249
+ # spec: gate-sdk/SPEC.md §run-gate-tests — case-file scalars outrank exports, while unset scalars inherit
250
+ cat >"$scratch/checks/stub-knobs.sh" <<'EOF'
251
+ #!/usr/bin/env bash
252
+ source "$GATE_SDK_ROOT/lib/gate.sh"
253
+ IFS=$'\t' read -r _ _ value < <(gate_knob_values GATE_SDK_QUEUE_FILE)
254
+ printf 'scalar=%s inherited=%s\n' "$value" "${CANON_KIT_PROBE-unset}"
255
+ if [[ "$PWD" == */bad ]]; then echo 'help: fixture'; exit 1; fi
256
+ echo 'STUB-KNOBS: clean (case pins)'
257
+ EOF
258
+ chmod +x "$scratch/checks/stub-knobs.sh"
259
+ for side in good bad; do
260
+ mkdir -p "$scratch/knobs/stub-knobs/$side/scripts"
261
+ printf 'GATE_SDK_QUEUE_FILE = case-value\n' >"$scratch/knobs/stub-knobs/$side/scripts/gate-sdk-config.knobs"
262
+ printf 'scalar=case-value inherited=seat-value\n' >"$scratch/knobs/stub-knobs/$side/expect.txt"
263
+ done
264
+ : >"$scratch/empty.knobs"
265
+ for override in scalar gates-dir knob-file; do
266
+ out="$(
267
+ export CANON_KIT_PROBE=seat-value
268
+ case "$override" in
269
+ scalar) export GATE_SDK_QUEUE_FILE=foreign ;;
270
+ gates-dir) export GATE_SDK_GATES_DIR="$scratch/foreign" ;;
271
+ knob-file) export GATE_SDK_KNOB_FILE="$scratch/empty.knobs" ;;
272
+ esac
273
+ gate_arm_run --run-gate-tests "$scratch/knobs" "$scratch/checks" 2>&1
274
+ )"; rc=$?
275
+ assert_rc "case-knobs-$override" "$rc" 0
276
+ assert_has "case-knobs-$override" 'GATE-TESTS: clean' "$out"
277
+ done
278
+
279
+ # spec: gate-sdk/SPEC.md §run-gate-tests — a bespoke test's TMPDIR lies under the invoker's tmp dir, the run scratch heads its git ceiling, and the scratch is gone once the runner exits
280
+ mkdir -p "$scratch/ceiling"
281
+ cat >"$scratch/ceiling/probe.test.sh" <<'EOF'
282
+ #!/usr/bin/env bash
283
+ sep=:
284
+ case "${OSTYPE:-}" in msys* | cygwin* | win32*) sep=';' ;; esac
285
+ head="${GIT_CEILING_DIRECTORIES%%"$sep"*}"
286
+ { (cd -P "$TMPDIR" && pwd -P); (cd -P "$head" && pwd -P); } >"$PWD/ceiling-probe.seen"
287
+ exit 0
288
+ EOF
289
+ out="$( cd "$scratch" && export GATE_SDK_TMP_DIR=run-tmp \
290
+ && gate_arm_run --run-gate-tests "$scratch/ceiling" "$scratch/checks" 2>&1 )"; rc=$?
291
+ assert_rc ceiling "$rc" 0
292
+ root="$(cd -P "$scratch" && pwd -P)/run-tmp"
293
+ { IFS= read -r seen_tmp; IFS= read -r seen_head; } <"$scratch/ceiling-probe.seen"
294
+ case "$seen_head" in
295
+ "$root"/checkwright-run.*) ;;
296
+ *) echo "FAIL [ceiling]: the git ceiling is headed by '$seen_head', not a run scratch under $root"; fails=$((fails + 1)) ;;
297
+ esac
298
+ [[ "${seen_tmp%/*}" == "$seen_head" ]] || {
299
+ echo "FAIL [ceiling]: the suite's TMPDIR '$seen_tmp' is no private dir directly under the run scratch '$seen_head'"
300
+ fails=$((fails + 1))
301
+ }
302
+ compgen -G "$root/checkwright-run.*" >/dev/null && {
303
+ echo "FAIL [ceiling]: a run scratch survived the runner under $root"
304
+ fails=$((fails + 1))
305
+ }
306
+
247
307
  [[ "$fails" -eq 0 ]] || { echo "run-gate-tests.test: $fails assertion(s) failed"; exit 1; }
248
- echo "run-gate-tests.test: clean (a leading flag and an absent named checks dir are refused, -- admits a path; expect.txt is a per-line conjunction, order-independent, blanks inert, all missing lines named; the output contract is asserted at runtime on both cases; scratch writes land outside the case dir on both dispatch spellings)"
308
+ echo "run-gate-tests.test: clean (a leading flag and an absent named checks dir are refused, -- admits a path; expect.txt is a per-line conjunction, order-independent, blanks inert, all missing lines named; the output contract is asserted at runtime on both cases; scratch writes land outside the case dir on both dispatch spellings; a suite's temporaries lie in a run scratch under the tmp dir, heading its git ceiling, removed on exit)"
249
309
  exit 0
@@ -57,14 +57,14 @@ _gate_prebinary_file_value() { # <file> <NAME> <outvar>
57
57
  return 1
58
58
  }
59
59
 
60
- # spec: gate-sdk/SPEC.md §lib/gate.sh — a pre-binary knob over the static precedence: the environment, the local overlay, the tracked file, then the default its caller derives as the table does; an empty value takes the default, as each of these rows does
60
+ # spec: gate-sdk/SPEC.md §lib/gate.sh — a pre-binary knob over the static precedence: the environment, the local overlay, the tracked file, each file at its locator where one is set, then the default its caller derives as the table does; an empty value takes the default, as each of these rows does
61
61
  _gate_prebinary_knob() { # <NAME> <default>
62
62
  local _gpk_name="$1" _gpk_dir="${GATE_SDK_GATES_DIR:-scripts}" _gpk_v=""
63
63
  if [[ -n "${!_gpk_name:-}" ]]; then
64
64
  printf '%s\n' "${!_gpk_name}"
65
65
  return 0
66
66
  fi
67
- if _gate_prebinary_file_value "$_gpk_dir/gate-sdk-config.local.knobs" "$_gpk_name" _gpk_v && [[ -n "$_gpk_v" ]]; then
67
+ if _gate_prebinary_file_value "${GATE_SDK_LOCAL_KNOB_FILE:-$_gpk_dir/gate-sdk-config.local.knobs}" "$_gpk_name" _gpk_v && [[ -n "$_gpk_v" ]]; then
68
68
  printf '%s\n' "$_gpk_v"
69
69
  return 0
70
70
  fi
@@ -90,6 +90,35 @@ gate_path_rooted() { # <path> — 0 when rooted in either dialect, walk::path_r
90
90
  return 1
91
91
  }
92
92
 
93
+ # spec: gate-sdk/SPEC.md §lib/gate.sh — the crosser's nested mark from the starting directory: the nearest .git entry of any type along the prefix's leading runs beneath <top>, printed; returns 1 emitting nothing where there is none, under a non-empty GIT_DIR, or where the entry is the repository git selected
94
+ gate_skipped_mark() { # <top> <prefix>
95
+ local top="$1" run="${2%/}" m t line g
96
+ [[ -n "${GIT_DIR:-}" ]] && return 1
97
+ while [[ -n "$run" ]]; do
98
+ m="$top/$run/.git"
99
+ if [[ -e "$m" || -L "$m" ]]; then
100
+ t="$m"
101
+ if [[ -f "$m" ]]; then
102
+ line=''
103
+ IFS= read -r line <"$m" || true
104
+ t=''
105
+ if [[ "$line" == "gitdir: "* ]]; then
106
+ t="${line#gitdir: }"
107
+ while [[ "$t" == *$'\r' ]]; do t="${t%$'\r'}"; done
108
+ gate_path_rooted "$t" || t="$top/$run/$t"
109
+ fi
110
+ fi
111
+ g="$( { cd -P "$(git rev-parse --absolute-git-dir 2>/dev/null || echo /dev/null)" && pwd -P; } 2>/dev/null )"
112
+ [[ -n "$t" && -n "$g" && "$g" == "$( { cd -P "$t" && pwd -P; } 2>/dev/null )" ]] && return 1
113
+ printf '%s\n' "$m"
114
+ return 0
115
+ fi
116
+ [[ "$run" == */* ]] || return 1
117
+ run="${run%/*}"
118
+ done
119
+ return 1
120
+ }
121
+
93
122
  # spec: gate-sdk/SPEC.md §lib/gate.sh — GATE_SDK_NATIVE_BIN's value as a COMMAND TOKEN rather than as a path: a relative value takes the `./` prefix, because a token carrying no `.` or `/` anchor is a PATH lookup to sh and no command at all to PowerShell. An already-anchored value — rooted by gate_path_rooted, or already `./` or `../` — is returned unchanged, so the prefix is applied once and never twice
94
123
  gate_native_bin_spelled() {
95
124
  local b
@@ -107,8 +136,8 @@ gate_native_bin_spelled() {
107
136
  # spec: gate-sdk/SPEC.md §lib/gate.sh — inside a linked worktree whose common dir is <main>/.git, the main checkout's own resolution of the knob, rooted; returns 1 emitting nothing anywhere else
108
137
  _gate_main_checkout_bin() {
109
138
  local git_dir common main b
110
- git_dir="$( { cd "$(git rev-parse --git-dir 2>/dev/null || echo /dev/null)" && pwd -P; } 2>/dev/null )"
111
- common="$( { cd "$(git rev-parse --git-common-dir 2>/dev/null || echo /dev/null)" && pwd -P; } 2>/dev/null )"
139
+ git_dir="$( { set -P; cd "$(git rev-parse --git-dir 2>/dev/null || echo /dev/null)" && pwd -P; } 2>/dev/null )"
140
+ common="$( { set -P; cd "$(git rev-parse --git-common-dir 2>/dev/null || echo /dev/null)" && pwd -P; } 2>/dev/null )"
112
141
  [[ -n "$common" && "$git_dir" != "$common" && "${common##*/}" == .git ]] || return 1
113
142
  main="${common%/*}"
114
143
  b="$(cd "$main" && gate_native_bin)"
@@ -239,7 +268,7 @@ gate_resolve() {
239
268
  return 1
240
269
  }
241
270
 
242
- # spec: gate-sdk/SPEC.md §lib/gate.sh — resolve a gate name to its *invocation argv*, one element per line: `<dir>/<name>.sh` for a shell gate, `<binary> <name>` for a `.gate`-dispatched one. An absent or non-executable binary when a member dispatches to it is a harness error — exit 2, never a skip and never a pass (§Fail-closed contract).
271
+ # spec: gate-sdk/SPEC.md §lib/gate.sh — resolve a gate name to its *invocation argv*, one element per line; a `.gate` declaration's is the binary's `--emit gate-argv` answer. An absent or non-executable binary, or the arm's refusal, is a harness error — exit 2, never a skip and never a pass (§Fail-closed contract).
243
272
  gate_command() {
244
273
  local g="$1" d bin
245
274
  shift
@@ -256,7 +285,7 @@ gate_command() {
256
285
  printf 'failure (not clean). Build it: bash gate-sdk/bin/build-native.sh\n' >&2
257
286
  exit 2
258
287
  fi
259
- printf '%s\n%s\n' "$bin" "$g"
288
+ "$bin" --emit gate-argv "$d/$g.gate" || exit 2
260
289
  return 0
261
290
  fi
262
291
  done
@@ -369,3 +398,14 @@ gate_self_repo_prefix() {
369
398
  esac
370
399
  printf '%s/blob/%s/\n' "$id" "$ref"
371
400
  }
401
+
402
+ # spec: gate-sdk/SPEC.md §lib/gate.sh — the build and crate arms read one remapped RUSTFLAGS value
403
+ gate_native_rustflags() {
404
+ local _nr_from
405
+ local -a _nr_flags=()
406
+ for _nr_from in "${CARGO_HOME:-$HOME/.cargo}" "${HOME:-}"; do
407
+ [[ -n "$_nr_from" && "$_nr_from" != / ]] || continue
408
+ _nr_flags+=("--remap-path-prefix=${_nr_from%/}=/builder")
409
+ done
410
+ printf '%s\n' "${RUSTFLAGS:+$RUSTFLAGS }${_nr_flags[*]}"
411
+ }
@@ -1,5 +1,5 @@
1
1
  # shellcheck shell=bash
2
- # spec: gate-sdk/SPEC.md §lib/test-hermetic.sh — pin every kit's <KIT>_KNOB_FILE (and its retired <KIT>_CONFIG_FILE) to one shared empty file so a bespoke gate-tests/*.test.sh runs on kit defaults, never the invoker's cwd config; knob-free by design (a config-pinning tool cannot be configured by the surface it pins)
2
+ # spec: gate-sdk/SPEC.md §lib/test-hermetic.sh — clear inherited kit-prefixed variables except GATE_SDK_NATIVE_BIN, then pin every kit's <KIT>_KNOB_FILE, <KIT>_LOCAL_KNOB_FILE and retired <KIT>_CONFIG_FILE to one shared empty file each so a bespoke gate-tests/*.test.sh runs on kit defaults, never the invoker's cwd config; knob-free by design (a config-pinning tool cannot be configured by the surface it pins)
3
3
  # no-port: gate-sdk/SPEC.md §lib/test-hermetic.sh — this library's whole API is three shell functions, gate_env, gate_run and gate_arm_run, called *inside* the caller's own shell, and a binary arm cannot be sourced into bash: the */gate-tests/*.test.sh suites source this file as their first act, and there is no in-crate arm a source line can name. gate_env exists rather than an env prefix because env cannot invoke a shell function. It resolves no knob of its own and computes no default. Structural, not a sizing judgment.
4
4
  # spec: gate-sdk/SPEC.md §The path-dialect contract — anchor the sourcing shell's cwd before the two roots below are derived and composed
5
5
  # shellcheck disable=SC2164 # the anchor is the contract's bare builtin, which check-path-dialect clears only as the whole line; a failed chdir leaves the cwd where it was
@@ -12,13 +12,18 @@ _th_empty_knobs="${TMPDIR:-/tmp}/gate-sdk-hermetic-empty.knobs"
12
12
  for _th_kit in "$_th_root"/gate-sdk "$_th_root"/*-kit; do
13
13
  [[ -d "$_th_kit" ]] || continue
14
14
  _th_var="$(printf '%s' "${_th_kit##*/}" | tr '[:lower:]-' '[:upper:]_')"
15
+ while IFS= read -r _th_name; do
16
+ [[ "$_th_name" == GATE_SDK_NATIVE_BIN ]] || unset "$_th_name"
17
+ done < <(compgen -A variable "${_th_var}_")
15
18
  export "${_th_var}_CONFIG_FILE=${_th_empty}"
16
19
  export "${_th_var}_KNOB_FILE=${_th_empty_knobs}"
20
+ [[ "$_th_var" == GATE_SDK ]] || export "${_th_var}_LOCAL_KNOB_FILE=${_th_empty_knobs}"
17
21
  done
18
- # spec: gate-sdk/SPEC.md §lib/test-hermetic.sh — neutralizes an ambient absolute path knob so a
19
- # sourcing test resolves both to their relative kit defaults against its own sandbox cwd; runs
20
- # before a test's own explicit pin, which by construction sits after this library's source line
21
- unset GATE_SDK_TMP_DIR GATE_SDK_WORKFLOW_DIR
22
+ # spec: gate-sdk/SPEC.md §lib/test-hermetic.sh — the temp dir the suite is handed heads the git ceiling list
23
+ _th_sep=:
24
+ case "${OSTYPE:-}" in msys* | cygwin* | win32*) _th_sep=';' ;; esac
25
+ _th_tmp="$(cd -P "${TMPDIR:-/tmp}" && pwd -P)"
26
+ export GIT_CEILING_DIRECTORIES="${_th_tmp}${GIT_CEILING_DIRECTORIES:+${_th_sep}${GIT_CEILING_DIRECTORIES}}"
22
27
  GATE_SDK_TEST_LIB_DIR="$(cd "${BASH_SOURCE[0]%/*}" && pwd)"
23
28
  # spec: gate-sdk/SPEC.md §lib/test-hermetic.sh — the gate-sdk root locator, absolute from this library's own anchor, because a suite drives its subject from a sandbox cwd the default cannot reach
24
29
  export GATE_SDK_ROOT="${GATE_SDK_TEST_LIB_DIR%/lib}"
@@ -32,7 +37,9 @@ if [[ -z "${GATE_SDK_NATIVE_BIN:-}" ]]; then
32
37
  gate_path_rooted "$_th_bin" || _th_bin="$_th_root/$_th_bin"
33
38
  export GATE_SDK_NATIVE_BIN="$_th_bin"
34
39
  fi
35
- unset _th_root _th_empty _th_empty_knobs _th_kit _th_var _th_bin
40
+ # spec: gate-sdk/SPEC.md §lib/test-hermetic.sh — gate-sdk's overlay is pinned after the binary read above, outside its already-set guard
41
+ export GATE_SDK_LOCAL_KNOB_FILE="$_th_empty_knobs"
42
+ unset _th_name _th_root _th_empty _th_empty_knobs _th_kit _th_var _th_bin _th_sep _th_tmp
36
43
 
37
44
  # spec: gate-sdk/SPEC.md §run-gate-tests — invoke a gate through its declared dispatch rather
38
45
  # than by script path, so a bespoke test names a gate and never a substrate: gate_command
@@ -56,12 +63,13 @@ gate_arm_run() { # $1=arm flag $2.. = the arm's own argv
56
63
  gate_run() { # $1=gate-name $2=checks-dir (absolute) $3.. = gate args
57
64
  local _gr_gate="$1" _gr_dir="$2"
58
65
  shift 2
66
+ local _gr_out
59
67
  local -a _gr_argv=()
60
68
  # shellcheck source=./gate.sh
61
69
  source "$GATE_SDK_TEST_LIB_DIR/gate.sh"
62
- mapfile -t _gr_argv < <(gate_command "$_gr_gate" "$_gr_dir")
63
70
  # spec: gate-sdk/SPEC.md §Fail-closed contract — an argv gate_command refused to build is
64
71
  # exit 2, the same verdict the dispatcher gives it, never a skipped assertion
65
- [[ ${#_gr_argv[@]} -gt 0 ]] || return 2
72
+ _gr_out="$(gate_command "$_gr_gate" "$_gr_dir")" && [[ -n "$_gr_out" ]] || return 2
73
+ mapfile -t _gr_argv <<<"$_gr_out"
66
74
  "${_gr_argv[@]}" "$@"
67
75
  }
@@ -4,7 +4,7 @@ The `adopt` walk — fitting an installed Checkwright to this repository and tri
4
4
 
5
5
  1. **Confirm the install.** `checkwright.lock` exists at the repository root and the worktree is clean. If the lock is missing, Checkwright is not installed here: say so, and stop. Read the lock for the profile, the kits and any selection.
6
6
  2. **Find the work.** Run `doctor` the way `init` was run. Each `disarmed` line names a gate that asserts nothing until the knob it names is set: a configuration item. Then run the battery on the gate binary `GATE_SDK_NATIVE_BIN` names, the one `init`'s `next:` block runs, with `--run` and `GATE_SDK_VERBOSE` set to any non-empty value so every gate prints its line, and keep the output. Each red is a triage item. Each clean line counting zero files, pages or entries names a gate that reads nothing on this tree, and is a configuration item too.
7
- 3. **Fit the knobs to the layout.** For each configuration item, and each red whose finding names a path the gate should not read, find the knob that sets its corpus or its exemptions: `--reads <gate>` names the knobs a gate reads, `--emit knob-roster` lists every knob with its type and default, and `--emit knob-values <NAME>` gives its resolved value here. Survey the tree for where its specs, docs, sources, and generated or third-party directories are. Tell the user each change and the paths that ground it, then write it into the `*-config.knobs` file in the gates directory named for the knob's kit: one `NAME = value` line for a scalar, one `NAME[] = element` line per element for an `indexed` knob. Never edit a vendored kit file.
7
+ 3. **Fit the knobs to the layout.** For each configuration item, and each red whose finding names a path the gate should not read, find the knob that sets its corpus or its exemptions: `--reads <gate>` names the knobs a gate reads, `--emit knob-roster` lists every knob with its type and default, and `--emit knob-values <NAME>` gives its resolved value here. Survey the tree for where its specs, docs, sources, and generated or third-party directories are. Tell the user each change and the paths that ground it. Rehearse it first: copy the `*-config.knobs` file in the gates directory named for the knob's kit into a scratch directory under `.tmp/`, make the change there (one `NAME = value` line for a scalar, one `NAME[] = element` line per element for an `indexed` knob), and run `--run-config-variant` on that directory. Its rows name each gate the change arms, disarms or reds. Then write the change into the gates directory's file. Never edit a vendored kit file.
8
8
  4. **Triage each red that remains.** Read the finding, its `help:` line and the section its `spec:` pointer names. Then give it one disposition, in this order of preference:
9
9
  - a defect in the tree: fix the tree;
10
10
  - a legitimate exception the gate provides a valve for, which its `help:` line or its section names: apply the valve, with its reason;