checkwright 0.0.1 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (874) hide show
  1. package/README.md +260 -4
  2. package/bin/checkwright.sh +53 -0
  3. package/lib/common/lock.sh +28 -0
  4. package/lib/common/profile.sh +58 -0
  5. package/lib/common/recipe.sh +93 -0
  6. package/lib/doctor.sh +90 -0
  7. package/lib/init.sh +289 -0
  8. package/package.json +15 -3
  9. package/payload/canon-kit/README.md +79 -0
  10. package/payload/canon-kit/SPEC.md +1410 -0
  11. package/payload/canon-kit/checks/check-amendment-queue.sh +116 -0
  12. package/payload/canon-kit/checks/check-comment-tier.sh +211 -0
  13. package/payload/canon-kit/checks/check-deprecation-task.sh +90 -0
  14. package/payload/canon-kit/checks/check-docs-cmd.sh +153 -0
  15. package/payload/canon-kit/checks/check-docs-link-convention.sh +71 -0
  16. package/payload/canon-kit/checks/check-install-claim.sh +146 -0
  17. package/payload/canon-kit/checks/check-knob-citation.sh +117 -0
  18. package/payload/canon-kit/checks/check-knob-default-coupling.sh +239 -0
  19. package/payload/canon-kit/checks/check-manifest-count.sh +46 -0
  20. package/payload/canon-kit/checks/check-manifest-temporal.sh +83 -0
  21. package/payload/canon-kit/checks/check-md-refs.sh +115 -0
  22. package/payload/canon-kit/checks/check-prose-enum.sh +115 -0
  23. package/payload/canon-kit/checks/check-prose-tells.sh +207 -0
  24. package/payload/canon-kit/checks/check-spec-derivable-section.sh +69 -0
  25. package/payload/canon-kit/checks/check-spec-dod-singleton.sh +45 -0
  26. package/payload/canon-kit/checks/check-spec-embedded-source.sh +133 -0
  27. package/payload/canon-kit/checks/check-spec-fence-balance.sh +42 -0
  28. package/payload/canon-kit/checks/check-spec-pointer.sh +176 -0
  29. package/payload/canon-kit/checks/check-surface-duplication.sh +105 -0
  30. package/payload/canon-kit/checks/check-todo-task-liveness.sh +80 -0
  31. package/payload/canon-kit/checks/check-tracking-claim.sh +136 -0
  32. package/payload/canon-kit/gate-tests/check-amendment-queue/bad/SPEC-tidy.md +5 -0
  33. package/payload/canon-kit/gate-tests/check-amendment-queue/bad/TASK-QUEUE.md +15 -0
  34. package/payload/canon-kit/gate-tests/check-amendment-queue/bad/expect.txt +1 -0
  35. package/payload/canon-kit/gate-tests/check-amendment-queue/good/SPEC-widget.md +6 -0
  36. package/payload/canon-kit/gate-tests/check-amendment-queue/good/TASK-QUEUE.md +15 -0
  37. package/payload/canon-kit/gate-tests/check-amendment-queue/good/expect.txt +1 -0
  38. package/payload/canon-kit/gate-tests/check-comment-tier/bad/bad.sh +25 -0
  39. package/payload/canon-kit/gate-tests/check-comment-tier/bad/expect.txt +1 -0
  40. package/payload/canon-kit/gate-tests/check-comment-tier/good/expect.txt +1 -0
  41. package/payload/canon-kit/gate-tests/check-comment-tier/good/good.sh +32 -0
  42. package/payload/canon-kit/gate-tests/check-comment-tier.test.sh +146 -0
  43. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/TASK-QUEUE.md +19 -0
  44. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/bad.sh +6 -0
  45. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/expect.txt +1 -0
  46. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/scripts/canon-config.sh +5 -0
  47. package/payload/canon-kit/gate-tests/check-deprecation-task/good/TASK-QUEUE.md +21 -0
  48. package/payload/canon-kit/gate-tests/check-deprecation-task/good/expect.txt +1 -0
  49. package/payload/canon-kit/gate-tests/check-deprecation-task/good/good.sh +5 -0
  50. package/payload/canon-kit/gate-tests/check-deprecation-task/good/scripts/canon-config.sh +5 -0
  51. package/payload/canon-kit/gate-tests/check-deprecation-task.test.sh +98 -0
  52. package/payload/canon-kit/gate-tests/check-docs-cmd/bad/args +1 -0
  53. package/payload/canon-kit/gate-tests/check-docs-cmd/bad/doc.md +9 -0
  54. package/payload/canon-kit/gate-tests/check-docs-cmd/bad/expect.txt +1 -0
  55. package/payload/canon-kit/gate-tests/check-docs-cmd/good/args +1 -0
  56. package/payload/canon-kit/gate-tests/check-docs-cmd/good/bin/tool.sh +3 -0
  57. package/payload/canon-kit/gate-tests/check-docs-cmd/good/doc.md +18 -0
  58. package/payload/canon-kit/gate-tests/check-docs-cmd/good/expect.txt +1 -0
  59. package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/args +4 -0
  60. package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/docs/demokit/index.md +5 -0
  61. package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/docs/index.md +3 -0
  62. package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/expect.txt +1 -0
  63. package/payload/canon-kit/gate-tests/check-docs-link-convention/good/args +4 -0
  64. package/payload/canon-kit/gate-tests/check-docs-link-convention/good/docs/demokit/index.md +6 -0
  65. package/payload/canon-kit/gate-tests/check-docs-link-convention/good/docs/index.md +3 -0
  66. package/payload/canon-kit/gate-tests/check-docs-link-convention/good/docs/methodology.md +3 -0
  67. package/payload/canon-kit/gate-tests/check-docs-link-convention/good/expect.txt +1 -0
  68. package/payload/canon-kit/gate-tests/check-install-claim/bad/README.md +12 -0
  69. package/payload/canon-kit/gate-tests/check-install-claim/bad/expect.txt +1 -0
  70. package/payload/canon-kit/gate-tests/check-install-claim/bad/install.md +24 -0
  71. package/payload/canon-kit/gate-tests/check-install-claim/bad/posts/note.md +7 -0
  72. package/payload/canon-kit/gate-tests/check-install-claim/bad/scripts/canon-config.sh +10 -0
  73. package/payload/canon-kit/gate-tests/check-install-claim/bad/scripts/install-transports.sh +7 -0
  74. package/payload/canon-kit/gate-tests/check-install-claim/good/README.md +12 -0
  75. package/payload/canon-kit/gate-tests/check-install-claim/good/expect.txt +1 -0
  76. package/payload/canon-kit/gate-tests/check-install-claim/good/install.md +24 -0
  77. package/payload/canon-kit/gate-tests/check-install-claim/good/posts/note.md +7 -0
  78. package/payload/canon-kit/gate-tests/check-install-claim/good/scripts/canon-config.sh +10 -0
  79. package/payload/canon-kit/gate-tests/check-install-claim/good/scripts/install-transports.sh +7 -0
  80. package/payload/canon-kit/gate-tests/check-knob-citation/bad/SPEC.md +10 -0
  81. package/payload/canon-kit/gate-tests/check-knob-citation/bad/expect.txt +1 -0
  82. package/payload/canon-kit/gate-tests/check-knob-citation/good/SPEC.md +19 -0
  83. package/payload/canon-kit/gate-tests/check-knob-citation/good/expect.txt +1 -0
  84. package/payload/canon-kit/gate-tests/check-knob-citation.test.sh +71 -0
  85. package/payload/canon-kit/gate-tests/check-knob-default-coupling/bad/expect.txt +1 -0
  86. package/payload/canon-kit/gate-tests/check-knob-default-coupling/bad/scripts/gate-sdk-config.sh +4 -0
  87. package/payload/canon-kit/gate-tests/check-knob-default-coupling/bad/widget-kit/SPEC.md +4 -0
  88. package/payload/canon-kit/gate-tests/check-knob-default-coupling/bad/widget-kit/lib/widget-cli.sh +3 -0
  89. package/payload/canon-kit/gate-tests/check-knob-default-coupling/bad/widget-kit/lib/widget.sh +5 -0
  90. package/payload/canon-kit/gate-tests/check-knob-default-coupling/good/expect.txt +1 -0
  91. package/payload/canon-kit/gate-tests/check-knob-default-coupling/good/scripts/gate-sdk-config.sh +5 -0
  92. package/payload/canon-kit/gate-tests/check-knob-default-coupling/good/widget-kit/SPEC.md +7 -0
  93. package/payload/canon-kit/gate-tests/check-knob-default-coupling/good/widget-kit/lib/widget-cli.sh +3 -0
  94. package/payload/canon-kit/gate-tests/check-knob-default-coupling/good/widget-kit/lib/widget.sh +5 -0
  95. package/payload/canon-kit/gate-tests/check-knob-default-coupling.test.sh +73 -0
  96. package/payload/canon-kit/gate-tests/check-manifest-count/bad/SPEC.md +15 -0
  97. package/payload/canon-kit/gate-tests/check-manifest-count/bad/expect.txt +1 -0
  98. package/payload/canon-kit/gate-tests/check-manifest-count/good/SPEC.md +37 -0
  99. package/payload/canon-kit/gate-tests/check-manifest-count/good/expect.txt +1 -0
  100. package/payload/canon-kit/gate-tests/check-manifest-count.test.sh +104 -0
  101. package/payload/canon-kit/gate-tests/check-manifest-temporal/bad/SPEC.md +6 -0
  102. package/payload/canon-kit/gate-tests/check-manifest-temporal/bad/expect.txt +1 -0
  103. package/payload/canon-kit/gate-tests/check-manifest-temporal/good/SPEC.md +17 -0
  104. package/payload/canon-kit/gate-tests/check-manifest-temporal/good/expect.txt +1 -0
  105. package/payload/canon-kit/gate-tests/check-md-refs/bad/args +1 -0
  106. package/payload/canon-kit/gate-tests/check-md-refs/bad/doc.md +3 -0
  107. package/payload/canon-kit/gate-tests/check-md-refs/bad/expect.txt +1 -0
  108. package/payload/canon-kit/gate-tests/check-md-refs/good/args +1 -0
  109. package/payload/canon-kit/gate-tests/check-md-refs/good/doc.md +3 -0
  110. package/payload/canon-kit/gate-tests/check-md-refs/good/expect.txt +1 -0
  111. package/payload/canon-kit/gate-tests/check-md-refs/good/target.md +1 -0
  112. package/payload/canon-kit/gate-tests/check-md-refs.test.sh +82 -0
  113. package/payload/canon-kit/gate-tests/check-prose-enum/bad/SPEC.md +4 -0
  114. package/payload/canon-kit/gate-tests/check-prose-enum/bad/expect.txt +1 -0
  115. package/payload/canon-kit/gate-tests/check-prose-enum/bad/scripts/canon-config.sh +4 -0
  116. package/payload/canon-kit/gate-tests/check-prose-enum/good/SPEC.md +16 -0
  117. package/payload/canon-kit/gate-tests/check-prose-enum/good/expect.txt +1 -0
  118. package/payload/canon-kit/gate-tests/check-prose-enum/good/scripts/canon-config.sh +4 -0
  119. package/payload/canon-kit/gate-tests/check-prose-enum.test.sh +127 -0
  120. package/payload/canon-kit/gate-tests/check-prose-tells/bad/expect.txt +1 -0
  121. package/payload/canon-kit/gate-tests/check-prose-tells/bad/prose.md +15 -0
  122. package/payload/canon-kit/gate-tests/check-prose-tells/bad/scripts/canon-config.sh +8 -0
  123. package/payload/canon-kit/gate-tests/check-prose-tells/good/expect.txt +1 -0
  124. package/payload/canon-kit/gate-tests/check-prose-tells/good/prose.md +21 -0
  125. package/payload/canon-kit/gate-tests/check-prose-tells/good/scripts/canon-config.sh +8 -0
  126. package/payload/canon-kit/gate-tests/check-spec-derivable-section/bad/SPEC.md +20 -0
  127. package/payload/canon-kit/gate-tests/check-spec-derivable-section/bad/expect.txt +1 -0
  128. package/payload/canon-kit/gate-tests/check-spec-derivable-section/good/SPEC.md +13 -0
  129. package/payload/canon-kit/gate-tests/check-spec-derivable-section/good/expect.txt +1 -0
  130. package/payload/canon-kit/gate-tests/check-spec-dod-singleton/bad/SPEC.md +15 -0
  131. package/payload/canon-kit/gate-tests/check-spec-dod-singleton/bad/expect.txt +1 -0
  132. package/payload/canon-kit/gate-tests/check-spec-dod-singleton/good/SPEC.md +13 -0
  133. package/payload/canon-kit/gate-tests/check-spec-dod-singleton/good/expect.txt +1 -0
  134. package/payload/canon-kit/gate-tests/check-spec-dod-singleton.test.sh +63 -0
  135. package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/SPEC.md +16 -0
  136. package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/expect.txt +1 -0
  137. package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/widget.sh +9 -0
  138. package/payload/canon-kit/gate-tests/check-spec-embedded-source/good/SPEC.md +19 -0
  139. package/payload/canon-kit/gate-tests/check-spec-embedded-source/good/expect.txt +1 -0
  140. package/payload/canon-kit/gate-tests/check-spec-embedded-source/good/widget.sh +9 -0
  141. package/payload/canon-kit/gate-tests/check-spec-fence-balance/bad/args +1 -0
  142. package/payload/canon-kit/gate-tests/check-spec-fence-balance/bad/doc.md +8 -0
  143. package/payload/canon-kit/gate-tests/check-spec-fence-balance/bad/expect.txt +1 -0
  144. package/payload/canon-kit/gate-tests/check-spec-fence-balance/good/args +1 -0
  145. package/payload/canon-kit/gate-tests/check-spec-fence-balance/good/doc.md +9 -0
  146. package/payload/canon-kit/gate-tests/check-spec-fence-balance/good/expect.txt +1 -0
  147. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/README.md +4 -0
  148. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/SPEC-target.md +6 -0
  149. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/SPEC-widget.md +5 -0
  150. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/cand-tmpl.md +5 -0
  151. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/expect.txt +1 -0
  152. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/scripts/canon-config.sh +5 -0
  153. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/widget.sh +5 -0
  154. package/payload/canon-kit/gate-tests/check-spec-pointer/good/README.md +4 -0
  155. package/payload/canon-kit/gate-tests/check-spec-pointer/good/SPEC-target.md +6 -0
  156. package/payload/canon-kit/gate-tests/check-spec-pointer/good/SPEC-widget.md +5 -0
  157. package/payload/canon-kit/gate-tests/check-spec-pointer/good/cand-tmpl.md +7 -0
  158. package/payload/canon-kit/gate-tests/check-spec-pointer/good/expect.txt +1 -0
  159. package/payload/canon-kit/gate-tests/check-spec-pointer/good/scripts/canon-config.sh +5 -0
  160. package/payload/canon-kit/gate-tests/check-spec-pointer/good/widget.sh +6 -0
  161. package/payload/canon-kit/gate-tests/check-surface-duplication/bad/GLOSSARY.md +11 -0
  162. package/payload/canon-kit/gate-tests/check-surface-duplication/bad/VISION.md +6 -0
  163. package/payload/canon-kit/gate-tests/check-surface-duplication/bad/expect.txt +1 -0
  164. package/payload/canon-kit/gate-tests/check-surface-duplication/good/GLOSSARY.md +11 -0
  165. package/payload/canon-kit/gate-tests/check-surface-duplication/good/VISION.md +6 -0
  166. package/payload/canon-kit/gate-tests/check-surface-duplication/good/expect.txt +1 -0
  167. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/TASK-QUEUE.md +19 -0
  168. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/bad.sh +5 -0
  169. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/expect.txt +1 -0
  170. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/TASK-QUEUE.md +23 -0
  171. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/expect.txt +1 -0
  172. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/good.sh +5 -0
  173. package/payload/canon-kit/gate-tests/check-tracking-claim/bad/README.md +4 -0
  174. package/payload/canon-kit/gate-tests/check-tracking-claim/bad/args +1 -0
  175. package/payload/canon-kit/gate-tests/check-tracking-claim/bad/expect.txt +1 -0
  176. package/payload/canon-kit/gate-tests/check-tracking-claim/bad/kept.txt +1 -0
  177. package/payload/canon-kit/gate-tests/check-tracking-claim/good/README.md +7 -0
  178. package/payload/canon-kit/gate-tests/check-tracking-claim/good/args +1 -0
  179. package/payload/canon-kit/gate-tests/check-tracking-claim/good/expect.txt +1 -0
  180. package/payload/canon-kit/gate-tests/check-tracking-claim/good/kept.txt +1 -0
  181. package/payload/canon-kit/gate-tests/check-tracking-claim/good/roster.list +1 -0
  182. package/payload/canon-kit/gate-tests/check-tracking-claim.test.sh +86 -0
  183. package/payload/canon-kit/lib/spec.sh +505 -0
  184. package/payload/canon-kit/smoke/install.sh +36 -0
  185. package/payload/canon-kit/smoke/violation.sh +22 -0
  186. package/payload/canon-kit/templates/SPEC-amendment.md +55 -0
  187. package/payload/canon-kit/templates/canon-config.sh +2 -0
  188. package/payload/context-kit/README.md +82 -0
  189. package/payload/context-kit/SPEC.md +790 -0
  190. package/payload/context-kit/bin/always-loaded.sh +86 -0
  191. package/payload/context-kit/bin/env-probe.sh +144 -0
  192. package/payload/context-kit/bin/footprint.sh +144 -0
  193. package/payload/context-kit/bin/md-index.sh +80 -0
  194. package/payload/context-kit/bin/md-section.sh +63 -0
  195. package/payload/context-kit/bin/pub-index.sh +90 -0
  196. package/payload/context-kit/bin/run-index-tests.sh +91 -0
  197. package/payload/context-kit/checks/check-brevity.sh +123 -0
  198. package/payload/context-kit/checks/check-footprint-fresh.sh +38 -0
  199. package/payload/context-kit/checks/check-memory-off.sh +112 -0
  200. package/payload/context-kit/checks/check-settings-pins.sh +110 -0
  201. package/payload/context-kit/gate-tests/check-brevity/bad/CLAUDE.md +14 -0
  202. package/payload/context-kit/gate-tests/check-brevity/bad/args +2 -0
  203. package/payload/context-kit/gate-tests/check-brevity/bad/expect.txt +1 -0
  204. package/payload/context-kit/gate-tests/check-brevity/good/CLAUDE.md +20 -0
  205. package/payload/context-kit/gate-tests/check-brevity/good/args +2 -0
  206. package/payload/context-kit/gate-tests/check-brevity/good/expect.txt +1 -0
  207. package/payload/context-kit/gate-tests/check-brevity.test.sh +89 -0
  208. package/payload/context-kit/gate-tests/check-footprint-fresh/bad/args +4 -0
  209. package/payload/context-kit/gate-tests/check-footprint-fresh/bad/emit.txt +12 -0
  210. package/payload/context-kit/gate-tests/check-footprint-fresh/bad/expect.txt +1 -0
  211. package/payload/context-kit/gate-tests/check-footprint-fresh/bad/projection.txt +11 -0
  212. package/payload/context-kit/gate-tests/check-footprint-fresh/good/args +4 -0
  213. package/payload/context-kit/gate-tests/check-footprint-fresh/good/emit.txt +12 -0
  214. package/payload/context-kit/gate-tests/check-footprint-fresh/good/expect.txt +1 -0
  215. package/payload/context-kit/gate-tests/check-footprint-fresh/good/projection.txt +12 -0
  216. package/payload/context-kit/gate-tests/check-memory-off/bad/args +1 -0
  217. package/payload/context-kit/gate-tests/check-memory-off/bad/expect.txt +1 -0
  218. package/payload/context-kit/gate-tests/check-memory-off/bad/memory/example-fact.md +6 -0
  219. package/payload/context-kit/gate-tests/check-memory-off/good/args +1 -0
  220. package/payload/context-kit/gate-tests/check-memory-off/good/expect.txt +1 -0
  221. package/payload/context-kit/gate-tests/check-memory-off/good/memory/.gitkeep +0 -0
  222. package/payload/context-kit/gate-tests/check-memory-off.test.sh +54 -0
  223. package/payload/context-kit/gate-tests/check-settings-pins/bad/args +1 -0
  224. package/payload/context-kit/gate-tests/check-settings-pins/bad/expect.txt +1 -0
  225. package/payload/context-kit/gate-tests/check-settings-pins/bad/settings-pins.conf +3 -0
  226. package/payload/context-kit/gate-tests/check-settings-pins/bad/settings.json +6 -0
  227. package/payload/context-kit/gate-tests/check-settings-pins/good/args +1 -0
  228. package/payload/context-kit/gate-tests/check-settings-pins/good/expect.txt +1 -0
  229. package/payload/context-kit/gate-tests/check-settings-pins/good/settings-pins.conf +3 -0
  230. package/payload/context-kit/gate-tests/check-settings-pins/good/settings.json +6 -0
  231. package/payload/context-kit/index-tests/corpus/baseline.txt +2 -0
  232. package/payload/context-kit/index-tests/corpus/hook-sample.txt +4 -0
  233. package/payload/context-kit/index-tests/corpus/sample.md +23 -0
  234. package/payload/context-kit/index-tests/corpus/sample.rs +24 -0
  235. package/payload/context-kit/index-tests/corpus/sample.ts +34 -0
  236. package/payload/context-kit/index-tests/corpus/surface.md +6 -0
  237. package/payload/context-kit/index-tests/expected/always-loaded.txt +1 -0
  238. package/payload/context-kit/index-tests/expected/md-index.txt +6 -0
  239. package/payload/context-kit/index-tests/expected/md-section.txt +6 -0
  240. package/payload/context-kit/index-tests/expected/pub-index-shadow.txt +2 -0
  241. package/payload/context-kit/index-tests/expected/pub-index-ts.txt +12 -0
  242. package/payload/context-kit/index-tests/expected/pub-index.txt +10 -0
  243. package/payload/context-kit/index-tests/expected/toolfloor.txt +14 -0
  244. package/payload/context-kit/index-tests/toolfloor-cases.sh +29 -0
  245. package/payload/context-kit/lib/pub-lang/rust.sh +26 -0
  246. package/payload/context-kit/lib/pub-lang/ts.sh +32 -0
  247. package/payload/context-kit/lib/toolfloor.sh +47 -0
  248. package/payload/context-kit/smoke/agents-md.sh +116 -0
  249. package/payload/context-kit/smoke/install.sh +60 -0
  250. package/payload/context-kit/smoke/violation.sh +21 -0
  251. package/payload/context-kit/templates/close-brevity.md +30 -0
  252. package/payload/context-kit/templates/context-config.sh +2 -0
  253. package/payload/context-kit/templates/session-context.sh +133 -0
  254. package/payload/context-kit/templates/settings-sessionstart.json +12 -0
  255. package/payload/delegation-kit/README.md +87 -0
  256. package/payload/delegation-kit/SPEC.md +792 -0
  257. package/payload/delegation-kit/bin/run-budget-guard-tests.sh +88 -0
  258. package/payload/delegation-kit/bin/run-trend-tests.sh +63 -0
  259. package/payload/delegation-kit/bin/run-usage-tests.sh +226 -0
  260. package/payload/delegation-kit/bin/usage-trend.sh +120 -0
  261. package/payload/delegation-kit/bin/usage-verdict.sh +144 -0
  262. package/payload/delegation-kit/checks/check-gate-tamper.sh +139 -0
  263. package/payload/delegation-kit/checks/check-rule-citation.sh +76 -0
  264. package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/args +1 -0
  265. package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/expect.txt +1 -0
  266. package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/staged-files +5 -0
  267. package/payload/delegation-kit/gate-tests/check-gate-tamper/good/added-exemptions +2 -0
  268. package/payload/delegation-kit/gate-tests/check-gate-tamper/good/args +1 -0
  269. package/payload/delegation-kit/gate-tests/check-gate-tamper/good/expect.txt +1 -0
  270. package/payload/delegation-kit/gate-tests/check-gate-tamper/good/staged-files +5 -0
  271. package/payload/delegation-kit/gate-tests/check-rule-citation/bad/args +1 -0
  272. package/payload/delegation-kit/gate-tests/check-rule-citation/bad/expect.txt +1 -0
  273. package/payload/delegation-kit/gate-tests/check-rule-citation/bad/spec.md +9 -0
  274. package/payload/delegation-kit/gate-tests/check-rule-citation/bad/tmpl.md +4 -0
  275. package/payload/delegation-kit/gate-tests/check-rule-citation/good/args +1 -0
  276. package/payload/delegation-kit/gate-tests/check-rule-citation/good/expect.txt +1 -0
  277. package/payload/delegation-kit/gate-tests/check-rule-citation/good/spec.md +20 -0
  278. package/payload/delegation-kit/gate-tests/check-rule-citation/good/tmpl.md +5 -0
  279. package/payload/delegation-kit/lib/delegation.sh +81 -0
  280. package/payload/delegation-kit/smoke/install.sh +61 -0
  281. package/payload/delegation-kit/smoke/violation.sh +16 -0
  282. package/payload/delegation-kit/templates/agent-budget-guard.sh +18 -0
  283. package/payload/delegation-kit/templates/agent-execution.md +136 -0
  284. package/payload/delegation-kit/templates/delegation-config.sh +2 -0
  285. package/payload/delegation-kit/templates/dispatch-checklists.md +60 -0
  286. package/payload/delegation-kit/templates/statusline-usage.sh +79 -0
  287. package/payload/delegation-kit/templates/usage-poller.sh +67 -0
  288. package/payload/delegation-kit/usage-tests/budget-guard-cases.tsv +20 -0
  289. package/payload/delegation-kit/usage-tests/cases.tsv +44 -0
  290. package/payload/delegation-kit/usage-tests/trend-history.log +20 -0
  291. package/payload/doctrine-kit/DOCTRINE.md +386 -0
  292. package/payload/doctrine-kit/README.md +70 -0
  293. package/payload/doctrine-kit/SPEC.md +233 -0
  294. package/payload/doctrine-kit/bin/install-doctrine.sh +44 -0
  295. package/payload/doctrine-kit/bin/stage-rules.sh +51 -0
  296. package/payload/doctrine-kit/checks/check-doctrine-registration.sh +216 -0
  297. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/bad/AGENT.md +14 -0
  298. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/bad/DOCTRINE.md +12 -0
  299. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/bad/args +1 -0
  300. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/bad/expect.txt +1 -0
  301. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/good/AGENT.md +15 -0
  302. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/good/DOCTRINE.md +12 -0
  303. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/good/args +1 -0
  304. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/good/expect.txt +1 -0
  305. package/payload/doctrine-kit/gate-tests/check-doctrine-registration.test.sh +208 -0
  306. package/payload/doctrine-kit/lib/doctrine.sh +29 -0
  307. package/payload/doctrine-kit/smoke/install.sh +24 -0
  308. package/payload/doctrine-kit/smoke/violation.sh +13 -0
  309. package/payload/drift-kit/README.md +115 -0
  310. package/payload/drift-kit/SPEC.md +881 -0
  311. package/payload/drift-kit/bin/drift-report.sh +155 -0
  312. package/payload/drift-kit/bin/kfric.sh +42 -0
  313. package/payload/drift-kit/bin/overhead-meter.sh +106 -0
  314. package/payload/drift-kit/bin/stage-economics.sh +311 -0
  315. package/payload/drift-kit/bin/trajectory.sh +242 -0
  316. package/payload/drift-kit/kpis/kpi-always-loaded.sh +39 -0
  317. package/payload/drift-kit/kpis/kpi-amendment-age.sh +33 -0
  318. package/payload/drift-kit/kpis/kpi-deferred-age.sh +46 -0
  319. package/payload/drift-kit/kpis/kpi-gate-backlog.sh +52 -0
  320. package/payload/drift-kit/kpis/kpi-gate-runtime.sh +31 -0
  321. package/payload/drift-kit/kpis/kpi-knowledge-friction.sh +21 -0
  322. package/payload/drift-kit/kpis/kpi-overhead.sh +44 -0
  323. package/payload/drift-kit/kpis/kpi-price-table-age.sh +68 -0
  324. package/payload/drift-kit/kpis/kpi-prompt-friction.sh +38 -0
  325. package/payload/drift-kit/kpis/kpi-queue-net-delta.sh +74 -0
  326. package/payload/drift-kit/kpis/kpi-settings-local.sh +21 -0
  327. package/payload/drift-kit/kpis/kpi-task-split.sh +43 -0
  328. package/payload/drift-kit/smoke/install.sh +348 -0
  329. package/payload/drift-kit/smoke/overhead-fixture.jsonl +4 -0
  330. package/payload/drift-kit/templates/close-knowledge.md +24 -0
  331. package/payload/drift-kit/templates/drift-config.sh +2 -0
  332. package/payload/drift-kit/templates/economics.md +45 -0
  333. package/payload/drift-kit/templates/kpi-deprecated-surface.sh +32 -0
  334. package/payload/drift-kit/templates/kpis.list +22 -0
  335. package/payload/drift-kit/templates/price-table.tsv +21 -0
  336. package/payload/evidence-kit/README.md +59 -0
  337. package/payload/evidence-kit/SPEC.md +261 -0
  338. package/payload/evidence-kit/bin/diff-baseline.sh +34 -0
  339. package/payload/evidence-kit/bin/run-validate.sh +82 -0
  340. package/payload/evidence-kit/checks/check-evidence-baseline.sh +103 -0
  341. package/payload/evidence-kit/checks/check-evidence-manifest.sh +104 -0
  342. package/payload/evidence-kit/gate-tests/check-evidence-baseline/bad/TASK-QUEUE.md +3 -0
  343. package/payload/evidence-kit/gate-tests/check-evidence-baseline/bad/args +2 -0
  344. package/payload/evidence-kit/gate-tests/check-evidence-baseline/bad/expect.txt +1 -0
  345. package/payload/evidence-kit/gate-tests/check-evidence-baseline/bad/validate-baseline.txt +3 -0
  346. package/payload/evidence-kit/gate-tests/check-evidence-baseline/good/TASK-QUEUE.md +3 -0
  347. package/payload/evidence-kit/gate-tests/check-evidence-baseline/good/args +2 -0
  348. package/payload/evidence-kit/gate-tests/check-evidence-baseline/good/expect.txt +1 -0
  349. package/payload/evidence-kit/gate-tests/check-evidence-baseline/good/validate-baseline.txt +3 -0
  350. package/payload/evidence-kit/gate-tests/check-evidence-baseline.test.sh +84 -0
  351. package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/TASK-QUEUE.md +1 -0
  352. package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/WORKFLOW-STATE.txt +3 -0
  353. package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/args +3 -0
  354. package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/expect.txt +1 -0
  355. package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/validate-evidence.txt +2 -0
  356. package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/TASK-QUEUE.md +1 -0
  357. package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/WORKFLOW-STATE.txt +3 -0
  358. package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/args +3 -0
  359. package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/expect.txt +1 -0
  360. package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/validate-evidence.txt +2 -0
  361. package/payload/evidence-kit/gate-tests/check-evidence-manifest.test.sh +107 -0
  362. package/payload/evidence-kit/gate-tests/evidence-lib.test.sh +82 -0
  363. package/payload/evidence-kit/lib/evidence.sh +173 -0
  364. package/payload/evidence-kit/smoke/install.sh +45 -0
  365. package/payload/evidence-kit/smoke/violation.sh +8 -0
  366. package/payload/evidence-kit/templates/evidence-config.sh +2 -0
  367. package/payload/gate-sdk/README.md +124 -0
  368. package/payload/gate-sdk/SPEC.md +1876 -0
  369. package/payload/gate-sdk/bin/enforcement-map.sh +272 -0
  370. package/payload/gate-sdk/bin/gen-pre-commit.sh +267 -0
  371. package/payload/gate-sdk/bin/install-hooks.sh +48 -0
  372. package/payload/gate-sdk/bin/run-consumer-smoke.sh +112 -0
  373. package/payload/gate-sdk/bin/run-gate-tests.sh +128 -0
  374. package/payload/gate-sdk/bin/run-gates.sh +147 -0
  375. package/payload/gate-sdk/bin/upgrade-smoke.sh +163 -0
  376. package/payload/gate-sdk/checks/check-action-pinning.sh +55 -0
  377. package/payload/gate-sdk/checks/check-action-run-shell.sh +219 -0
  378. package/payload/gate-sdk/checks/check-assertion-strength.sh +134 -0
  379. package/payload/gate-sdk/checks/check-commit-msg.sh +50 -0
  380. package/payload/gate-sdk/checks/check-commit-subject.sh +43 -0
  381. package/payload/gate-sdk/checks/check-core-files.sh +52 -0
  382. package/payload/gate-sdk/checks/check-enforcement-fresh.sh +37 -0
  383. package/payload/gate-sdk/checks/check-exec-bit.sh +76 -0
  384. package/payload/gate-sdk/checks/check-gate-assertions.sh +123 -0
  385. package/payload/gate-sdk/checks/check-gate-exemption-tasks.sh +106 -0
  386. package/payload/gate-sdk/checks/check-gate-fail-closed.sh +84 -0
  387. package/payload/gate-sdk/checks/check-gate-fixture-coverage.sh +92 -0
  388. package/payload/gate-sdk/checks/check-gate-output.sh +65 -0
  389. package/payload/gate-sdk/checks/check-graph.sh +632 -0
  390. package/payload/gate-sdk/checks/check-hook-exec-bit.sh +45 -0
  391. package/payload/gate-sdk/checks/check-identity.sh +134 -0
  392. package/payload/gate-sdk/checks/check-kit-enum.sh +94 -0
  393. package/payload/gate-sdk/checks/check-kit-registration.sh +68 -0
  394. package/payload/gate-sdk/checks/check-readme-roster.sh +102 -0
  395. package/payload/gate-sdk/checks/check-reads-couples.sh +148 -0
  396. package/payload/gate-sdk/checks/check-root-tiering.sh +66 -0
  397. package/payload/gate-sdk/checks/check-shellcheck.sh +55 -0
  398. package/payload/gate-sdk/checks/check-smoke-entry-guard.sh +53 -0
  399. package/payload/gate-sdk/checks/check-template-copy-parity.sh +126 -0
  400. package/payload/gate-sdk/checks/check-test-hermetic.sh +119 -0
  401. package/payload/gate-sdk/checks/check-tree-terms.sh +61 -0
  402. package/payload/gate-sdk/checks/check-workflow-tiering.sh +84 -0
  403. package/payload/gate-sdk/gate-tests/check-action-pinning/bad/args +1 -0
  404. package/payload/gate-sdk/gate-tests/check-action-pinning/bad/expect.txt +1 -0
  405. package/payload/gate-sdk/gate-tests/check-action-pinning/bad/tree/mutable.yml +11 -0
  406. package/payload/gate-sdk/gate-tests/check-action-pinning/bad/tree/nested/pinned.yml +5 -0
  407. package/payload/gate-sdk/gate-tests/check-action-pinning/good/args +1 -0
  408. package/payload/gate-sdk/gate-tests/check-action-pinning/good/expect.txt +1 -0
  409. package/payload/gate-sdk/gate-tests/check-action-pinning/good/tree/nested/deep.yml +5 -0
  410. package/payload/gate-sdk/gate-tests/check-action-pinning/good/tree/no-refs.yaml +8 -0
  411. package/payload/gate-sdk/gate-tests/check-action-pinning/good/tree/pinned.yml +10 -0
  412. package/payload/gate-sdk/gate-tests/check-action-run-shell/bad/args +3 -0
  413. package/payload/gate-sdk/gate-tests/check-action-run-shell/bad/expect.txt +1 -0
  414. package/payload/gate-sdk/gate-tests/check-action-run-shell/bad/tree/workflows/ci.yml +15 -0
  415. package/payload/gate-sdk/gate-tests/check-action-run-shell/good/args +3 -0
  416. package/payload/gate-sdk/gate-tests/check-action-run-shell/good/expect.txt +1 -0
  417. package/payload/gate-sdk/gate-tests/check-action-run-shell/good/tree/action.yml +14 -0
  418. package/payload/gate-sdk/gate-tests/check-action-run-shell/good/tree/not-actions.yml +16 -0
  419. package/payload/gate-sdk/gate-tests/check-action-run-shell/good/tree/workflows/ci.yml +106 -0
  420. package/payload/gate-sdk/gate-tests/check-action-run-shell.test.sh +88 -0
  421. package/payload/gate-sdk/gate-tests/check-assertion-strength/bad/args +3 -0
  422. package/payload/gate-sdk/gate-tests/check-assertion-strength/bad/bin/verdict.sh +5 -0
  423. package/payload/gate-sdk/gate-tests/check-assertion-strength/bad/expect.txt +1 -0
  424. package/payload/gate-sdk/gate-tests/check-assertion-strength/bad/smoke/install.sh +11 -0
  425. package/payload/gate-sdk/gate-tests/check-assertion-strength/good/args +3 -0
  426. package/payload/gate-sdk/gate-tests/check-assertion-strength/good/bin/verdict.sh +5 -0
  427. package/payload/gate-sdk/gate-tests/check-assertion-strength/good/expect.txt +1 -0
  428. package/payload/gate-sdk/gate-tests/check-assertion-strength/good/smoke/install.sh +16 -0
  429. package/payload/gate-sdk/gate-tests/check-commit-msg/bad/args +2 -0
  430. package/payload/gate-sdk/gate-tests/check-commit-msg/bad/expect.txt +1 -0
  431. package/payload/gate-sdk/gate-tests/check-commit-msg/bad/msg.txt +5 -0
  432. package/payload/gate-sdk/gate-tests/check-commit-msg/bad/patterns.list +5 -0
  433. package/payload/gate-sdk/gate-tests/check-commit-msg/good/args +2 -0
  434. package/payload/gate-sdk/gate-tests/check-commit-msg/good/expect.txt +1 -0
  435. package/payload/gate-sdk/gate-tests/check-commit-msg/good/msg.txt +5 -0
  436. package/payload/gate-sdk/gate-tests/check-commit-msg/good/patterns.list +5 -0
  437. package/payload/gate-sdk/gate-tests/check-commit-subject/bad/args +2 -0
  438. package/payload/gate-sdk/gate-tests/check-commit-subject/bad/expect.txt +1 -0
  439. package/payload/gate-sdk/gate-tests/check-commit-subject/bad/msg.txt +4 -0
  440. package/payload/gate-sdk/gate-tests/check-commit-subject/good/args +2 -0
  441. package/payload/gate-sdk/gate-tests/check-commit-subject/good/expect.txt +1 -0
  442. package/payload/gate-sdk/gate-tests/check-commit-subject/good/msg.txt +5 -0
  443. package/payload/gate-sdk/gate-tests/check-commit-subject.test.sh +73 -0
  444. package/payload/gate-sdk/gate-tests/check-core-files/bad/args +1 -0
  445. package/payload/gate-sdk/gate-tests/check-core-files/bad/core-files.list +3 -0
  446. package/payload/gate-sdk/gate-tests/check-core-files/bad/expect.txt +1 -0
  447. package/payload/gate-sdk/gate-tests/check-core-files/bad/present.txt +1 -0
  448. package/payload/gate-sdk/gate-tests/check-core-files/good/args +1 -0
  449. package/payload/gate-sdk/gate-tests/check-core-files/good/core-files.list +5 -0
  450. package/payload/gate-sdk/gate-tests/check-core-files/good/expect.txt +1 -0
  451. package/payload/gate-sdk/gate-tests/check-core-files/good/nested/also-present.txt +1 -0
  452. package/payload/gate-sdk/gate-tests/check-core-files/good/present.txt +1 -0
  453. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/bad/args +4 -0
  454. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/bad/emit.txt +14 -0
  455. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/bad/expect.txt +1 -0
  456. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/bad/projection.txt +7 -0
  457. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/good/args +4 -0
  458. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/good/emit.txt +14 -0
  459. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/good/expect.txt +1 -0
  460. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/good/projection.txt +14 -0
  461. package/payload/gate-sdk/gate-tests/check-exec-bit/bad/args +1 -0
  462. package/payload/gate-sdk/gate-tests/check-exec-bit/bad/dump.txt +7 -0
  463. package/payload/gate-sdk/gate-tests/check-exec-bit/bad/expect.txt +1 -0
  464. package/payload/gate-sdk/gate-tests/check-exec-bit/good/args +1 -0
  465. package/payload/gate-sdk/gate-tests/check-exec-bit/good/dump.txt +7 -0
  466. package/payload/gate-sdk/gate-tests/check-exec-bit/good/expect.txt +1 -0
  467. package/payload/gate-sdk/gate-tests/check-exec-bit.test.sh +46 -0
  468. package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/args +1 -0
  469. package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/expect.txt +1 -0
  470. package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/SPEC.md +13 -0
  471. package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/check-baz.sh +13 -0
  472. package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/check-foo.sh +10 -0
  473. package/payload/gate-sdk/gate-tests/check-gate-assertions/good/args +1 -0
  474. package/payload/gate-sdk/gate-tests/check-gate-assertions/good/expect.txt +1 -0
  475. package/payload/gate-sdk/gate-tests/check-gate-assertions/good/scripts/SPEC.md +20 -0
  476. package/payload/gate-sdk/gate-tests/check-gate-assertions/good/scripts/check-baz.sh +12 -0
  477. package/payload/gate-sdk/gate-tests/check-gate-assertions/good/scripts/check-foo.sh +9 -0
  478. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/TASK-QUEUE.md +9 -0
  479. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/args +1 -0
  480. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/expect.txt +1 -0
  481. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/gates/check-sample.sh +11 -0
  482. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/TASK-QUEUE.md +9 -0
  483. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/args +1 -0
  484. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/expect.txt +1 -0
  485. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/gates/check-sample.sh +11 -0
  486. package/payload/gate-sdk/gate-tests/check-gate-fail-closed/bad/args +1 -0
  487. package/payload/gate-sdk/gate-tests/check-gate-fail-closed/bad/expect.txt +1 -0
  488. package/payload/gate-sdk/gate-tests/check-gate-fail-closed/bad/gates/check-sample.sh +8 -0
  489. package/payload/gate-sdk/gate-tests/check-gate-fail-closed/good/args +1 -0
  490. package/payload/gate-sdk/gate-tests/check-gate-fail-closed/good/expect.txt +1 -0
  491. package/payload/gate-sdk/gate-tests/check-gate-fail-closed/good/gates/check-sample.sh +8 -0
  492. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/args +1 -0
  493. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/check-gamma.sh +4 -0
  494. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/expect.txt +1 -0
  495. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/gate-tests/check-alpha/bad/.keep +0 -0
  496. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/gate-tests/check-alpha/good/.keep +0 -0
  497. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/gates.list +4 -0
  498. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/args +1 -0
  499. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/check-beta.sh +5 -0
  500. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/expect.txt +1 -0
  501. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/gate-tests/check-alpha/bad/.keep +0 -0
  502. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/gate-tests/check-alpha/good/.keep +0 -0
  503. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/gates.list +5 -0
  504. package/payload/gate-sdk/gate-tests/check-gate-output/bad/args +1 -0
  505. package/payload/gate-sdk/gate-tests/check-gate-output/bad/check-sample.sh +4 -0
  506. package/payload/gate-sdk/gate-tests/check-gate-output/bad/expect.txt +1 -0
  507. package/payload/gate-sdk/gate-tests/check-gate-output/bad/gates.list +2 -0
  508. package/payload/gate-sdk/gate-tests/check-gate-output/good/args +1 -0
  509. package/payload/gate-sdk/gate-tests/check-gate-output/good/check-sample.sh +9 -0
  510. package/payload/gate-sdk/gate-tests/check-gate-output/good/expect.txt +1 -0
  511. package/payload/gate-sdk/gate-tests/check-gate-output/good/gates.list +3 -0
  512. package/payload/gate-sdk/gate-tests/check-graph/bad/SPEC-example-gate.md +12 -0
  513. package/payload/gate-sdk/gate-tests/check-graph/bad/args +1 -0
  514. package/payload/gate-sdk/gate-tests/check-graph/bad/expect.txt +1 -0
  515. package/payload/gate-sdk/gate-tests/check-graph/good/SPEC-example-gate.md +20 -0
  516. package/payload/gate-sdk/gate-tests/check-graph/good/args +3 -0
  517. package/payload/gate-sdk/gate-tests/check-graph/good/expect.txt +1 -0
  518. package/payload/gate-sdk/gate-tests/check-graph-cap.test.sh +51 -0
  519. package/payload/gate-sdk/gate-tests/check-graph-refs.test.sh +55 -0
  520. package/payload/gate-sdk/gate-tests/check-graph-theme.test.sh +63 -0
  521. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/bad/args +1 -0
  522. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/bad/expect.txt +1 -0
  523. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/bad/hooks/pre-commit +2 -0
  524. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/good/args +1 -0
  525. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/good/expect.txt +1 -0
  526. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/good/hooks/pre-commit +2 -0
  527. package/payload/gate-sdk/gate-tests/check-identity/bad/args +1 -0
  528. package/payload/gate-sdk/gate-tests/check-identity/bad/expect.txt +1 -0
  529. package/payload/gate-sdk/gate-tests/check-identity/bad/git-config-email +1 -0
  530. package/payload/gate-sdk/gate-tests/check-identity/bad/git-remotes +2 -0
  531. package/payload/gate-sdk/gate-tests/check-identity/bad/identity.conf +4 -0
  532. package/payload/gate-sdk/gate-tests/check-identity/good/args +1 -0
  533. package/payload/gate-sdk/gate-tests/check-identity/good/expect.txt +1 -0
  534. package/payload/gate-sdk/gate-tests/check-identity/good/git-config-email +1 -0
  535. package/payload/gate-sdk/gate-tests/check-identity/good/git-remotes +3 -0
  536. package/payload/gate-sdk/gate-tests/check-identity/good/identity.conf +5 -0
  537. package/payload/gate-sdk/gate-tests/check-kit-enum/bad/args +1 -0
  538. package/payload/gate-sdk/gate-tests/check-kit-enum/bad/check-sample.sh +5 -0
  539. package/payload/gate-sdk/gate-tests/check-kit-enum/bad/expect.txt +1 -0
  540. package/payload/gate-sdk/gate-tests/check-kit-enum/bad/gates.list +4 -0
  541. package/payload/gate-sdk/gate-tests/check-kit-enum/good/args +1 -0
  542. package/payload/gate-sdk/gate-tests/check-kit-enum/good/check-sample.sh +5 -0
  543. package/payload/gate-sdk/gate-tests/check-kit-enum/good/expect.txt +1 -0
  544. package/payload/gate-sdk/gate-tests/check-kit-enum/good/gates.list +3 -0
  545. package/payload/gate-sdk/gate-tests/check-kit-registration/bad/args +4 -0
  546. package/payload/gate-sdk/gate-tests/check-kit-registration/bad/expect.txt +1 -0
  547. package/payload/gate-sdk/gate-tests/check-kit-registration/bad/registry-doc.md +20 -0
  548. package/payload/gate-sdk/gate-tests/check-kit-registration/good/args +5 -0
  549. package/payload/gate-sdk/gate-tests/check-kit-registration/good/expect.txt +1 -0
  550. package/payload/gate-sdk/gate-tests/check-kit-registration.test.sh +75 -0
  551. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/alpha-kit/README.md +14 -0
  552. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/alpha-kit/checks/check-alpha-one.sh +3 -0
  553. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/alpha-kit/checks/check-alpha-two.sh +3 -0
  554. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/args +4 -0
  555. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/expect.txt +1 -0
  556. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/gamma-kit/README.md +5 -0
  557. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/gamma-kit/checks/check-gamma-one.sh +3 -0
  558. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/scripts/gate-sdk-config.sh +5 -0
  559. package/payload/gate-sdk/gate-tests/check-readme-roster/good/alpha-kit/README.md +16 -0
  560. package/payload/gate-sdk/gate-tests/check-readme-roster/good/alpha-kit/checks/check-alpha-one.sh +3 -0
  561. package/payload/gate-sdk/gate-tests/check-readme-roster/good/alpha-kit/checks/check-alpha-two.sh +3 -0
  562. package/payload/gate-sdk/gate-tests/check-readme-roster/good/args +6 -0
  563. package/payload/gate-sdk/gate-tests/check-readme-roster/good/beta-kit/smoke/install.sh +3 -0
  564. package/payload/gate-sdk/gate-tests/check-readme-roster/good/expect.txt +1 -0
  565. package/payload/gate-sdk/gate-tests/check-readme-roster/good/scripts/gate-sdk-config.sh +5 -0
  566. package/payload/gate-sdk/gate-tests/check-reads-couples/bad/args +2 -0
  567. package/payload/gate-sdk/gate-tests/check-reads-couples/bad/corpus/sub/deep.md +1 -0
  568. package/payload/gate-sdk/gate-tests/check-reads-couples/bad/corpus/top.md +1 -0
  569. package/payload/gate-sdk/gate-tests/check-reads-couples/bad/expect.txt +1 -0
  570. package/payload/gate-sdk/gate-tests/check-reads-couples/bad/sandbox-gate.sh +6 -0
  571. package/payload/gate-sdk/gate-tests/check-reads-couples/good/args +3 -0
  572. package/payload/gate-sdk/gate-tests/check-reads-couples/good/corpus/sub/deep.md +1 -0
  573. package/payload/gate-sdk/gate-tests/check-reads-couples/good/corpus/top.md +1 -0
  574. package/payload/gate-sdk/gate-tests/check-reads-couples/good/expect.txt +1 -0
  575. package/payload/gate-sdk/gate-tests/check-reads-couples/good/sandbox-gate.sh +8 -0
  576. package/payload/gate-sdk/gate-tests/check-root-tiering/bad/allow.list +1 -0
  577. package/payload/gate-sdk/gate-tests/check-root-tiering/bad/args +1 -0
  578. package/payload/gate-sdk/gate-tests/check-root-tiering/bad/expect.txt +1 -0
  579. package/payload/gate-sdk/gate-tests/check-root-tiering/bad/root/README.md +1 -0
  580. package/payload/gate-sdk/gate-tests/check-root-tiering/bad/root/stray.txt +1 -0
  581. package/payload/gate-sdk/gate-tests/check-root-tiering/good/allow.list +3 -0
  582. package/payload/gate-sdk/gate-tests/check-root-tiering/good/args +1 -0
  583. package/payload/gate-sdk/gate-tests/check-root-tiering/good/expect.txt +1 -0
  584. package/payload/gate-sdk/gate-tests/check-root-tiering/good/root/LICENSE +1 -0
  585. package/payload/gate-sdk/gate-tests/check-root-tiering/good/root/README.md +1 -0
  586. package/payload/gate-sdk/gate-tests/check-root-tiering/good/root/somedir/keep.txt +1 -0
  587. package/payload/gate-sdk/gate-tests/check-shellcheck/bad/args +1 -0
  588. package/payload/gate-sdk/gate-tests/check-shellcheck/bad/expect.txt +1 -0
  589. package/payload/gate-sdk/gate-tests/check-shellcheck/bad/warn.sh +5 -0
  590. package/payload/gate-sdk/gate-tests/check-shellcheck/good/args +1 -0
  591. package/payload/gate-sdk/gate-tests/check-shellcheck/good/expect.txt +1 -0
  592. package/payload/gate-sdk/gate-tests/check-shellcheck/good/ok.sh +4 -0
  593. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/bad/alpha-kit/smoke/install.sh +4 -0
  594. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/bad/alpha-kit/smoke/violation.sh +7 -0
  595. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/bad/args +4 -0
  596. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/bad/expect.txt +1 -0
  597. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/bad/scripts/gate-sdk-config.sh +5 -0
  598. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/good/alpha-kit/smoke/install.sh +4 -0
  599. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/good/alpha-kit/smoke/violation.sh +4 -0
  600. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/good/args +6 -0
  601. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/good/beta-kit/smoke/install.sh +4 -0
  602. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/good/expect.txt +1 -0
  603. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/good/scripts/gate-sdk-config.sh +5 -0
  604. package/payload/gate-sdk/gate-tests/check-template-copy-parity/bad/args +9 -0
  605. package/payload/gate-sdk/gate-tests/check-template-copy-parity/bad/delegation-kit/templates/agent-budget-guard.sh +16 -0
  606. package/payload/gate-sdk/gate-tests/check-template-copy-parity/bad/expect.txt +1 -0
  607. package/payload/gate-sdk/gate-tests/check-template-copy-parity/bad/scripts/agent-budget-guard.sh +17 -0
  608. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/args +8 -0
  609. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/delegation-kit/templates/agent-budget-guard.sh +16 -0
  610. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/delegation-kit/templates/delegation-config.sh +3 -0
  611. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/delegation-kit/templates/usage-poller.sh +6 -0
  612. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/expect.txt +1 -0
  613. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/scripts/agent-budget-guard.sh +16 -0
  614. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/scripts/delegation-config.sh +4 -0
  615. package/payload/gate-sdk/gate-tests/check-test-hermetic/bad/args +3 -0
  616. package/payload/gate-sdk/gate-tests/check-test-hermetic/bad/expect.txt +1 -0
  617. package/payload/gate-sdk/gate-tests/check-test-hermetic/bad/leaky.test.sh +5 -0
  618. package/payload/gate-sdk/gate-tests/check-test-hermetic/good/args +3 -0
  619. package/payload/gate-sdk/gate-tests/check-test-hermetic/good/exempt.test.sh +4 -0
  620. package/payload/gate-sdk/gate-tests/check-test-hermetic/good/expect.txt +1 -0
  621. package/payload/gate-sdk/gate-tests/check-test-hermetic/good/sourced.test.sh +5 -0
  622. package/payload/gate-sdk/gate-tests/check-test-hermetic-smoke.test.sh +84 -0
  623. package/payload/gate-sdk/gate-tests/check-tree-terms/bad/args +2 -0
  624. package/payload/gate-sdk/gate-tests/check-tree-terms/bad/expect.txt +1 -0
  625. package/payload/gate-sdk/gate-tests/check-tree-terms/bad/patterns.list +3 -0
  626. package/payload/gate-sdk/gate-tests/check-tree-terms/bad/tree/leak.txt +1 -0
  627. package/payload/gate-sdk/gate-tests/check-tree-terms/good/args +2 -0
  628. package/payload/gate-sdk/gate-tests/check-tree-terms/good/expect.txt +1 -0
  629. package/payload/gate-sdk/gate-tests/check-tree-terms/good/patterns.list +3 -0
  630. package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/clean.txt +1 -0
  631. package/payload/gate-sdk/gate-tests/check-workflow-tiering/bad/.workflow/payload.txt +1 -0
  632. package/payload/gate-sdk/gate-tests/check-workflow-tiering/bad/.workflow/projection.txt +1 -0
  633. package/payload/gate-sdk/gate-tests/check-workflow-tiering/bad/expect.txt +1 -0
  634. package/payload/gate-sdk/gate-tests/check-workflow-tiering/good/.workflow/projection.txt +1 -0
  635. package/payload/gate-sdk/gate-tests/check-workflow-tiering/good/.workflow/wire.txt +1 -0
  636. package/payload/gate-sdk/gate-tests/check-workflow-tiering/good/expect.txt +1 -0
  637. package/payload/gate-sdk/gate-tests/enforcement-map.test.sh +87 -0
  638. package/payload/gate-sdk/gate-tests/lib-gate.test.sh +78 -0
  639. package/payload/gate-sdk/gate-tests/run-for-path.test.sh +77 -0
  640. package/payload/gate-sdk/lib/consumer-smoke.sh +32 -0
  641. package/payload/gate-sdk/lib/gate.sh +216 -0
  642. package/payload/gate-sdk/lib/inject.sh +35 -0
  643. package/payload/gate-sdk/lib/test-hermetic.sh +11 -0
  644. package/payload/gate-sdk/smoke/install.sh +84 -0
  645. package/payload/gate-sdk/smoke/violation.sh +13 -0
  646. package/payload/gate-sdk/templates/check-skeleton.sh +23 -0
  647. package/payload/gate-sdk/templates/gates-workflow.yml +55 -0
  648. package/payload/gate-sdk/templates/msg-patterns.list +21 -0
  649. package/payload/guard-kit/README.md +65 -0
  650. package/payload/guard-kit/SPEC.md +590 -0
  651. package/payload/guard-kit/bin/compare-settings-allow.sh +58 -0
  652. package/payload/guard-kit/bin/run-guard-tests.sh +86 -0
  653. package/payload/guard-kit/bin/scan-prompts.sh +166 -0
  654. package/payload/guard-kit/bin/scratch-run.sh +34 -0
  655. package/payload/guard-kit/gate-tests/scan-prompts.test.sh +70 -0
  656. package/payload/guard-kit/gate-tests/scratch-run.test.sh +62 -0
  657. package/payload/guard-kit/guard-tests/cases.tsv +117 -0
  658. package/payload/guard-kit/guard-tests/escalation-cases.tsv +13 -0
  659. package/payload/guard-kit/lib/guard.sh +448 -0
  660. package/payload/guard-kit/smoke/install.sh +26 -0
  661. package/payload/guard-kit/templates/bash-guard.sh +18 -0
  662. package/payload/guard-kit/templates/close-triage.md +31 -0
  663. package/payload/guard-kit/templates/escalation-guard.sh +27 -0
  664. package/payload/guard-kit/templates/guard-config.sh +2 -0
  665. package/payload/guard-kit/templates/settings-hooks.json +19 -0
  666. package/payload/guard-kit/templates/wakeup-guard.sh +20 -0
  667. package/payload/lifecycle-kit/README.md +106 -0
  668. package/payload/lifecycle-kit/SPEC.md +1492 -0
  669. package/payload/lifecycle-kit/bin/close-surfaces.sh +94 -0
  670. package/payload/lifecycle-kit/bin/enter-stage.sh +215 -0
  671. package/payload/lifecycle-kit/bin/file-gap.sh +43 -0
  672. package/payload/lifecycle-kit/bin/install-lifecycle.sh +36 -0
  673. package/payload/lifecycle-kit/bin/session-id.sh +75 -0
  674. package/payload/lifecycle-kit/checks/check-close-surfaces.sh +63 -0
  675. package/payload/lifecycle-kit/checks/check-lesson-disposition.sh +98 -0
  676. package/payload/lifecycle-kit/checks/check-lifecycle-registration.sh +54 -0
  677. package/payload/lifecycle-kit/checks/check-merge-attrs.sh +69 -0
  678. package/payload/lifecycle-kit/checks/check-shim-restatement.sh +97 -0
  679. package/payload/lifecycle-kit/checks/check-skill-binding.sh +59 -0
  680. package/payload/lifecycle-kit/checks/check-stage-entry.sh +197 -0
  681. package/payload/lifecycle-kit/checks/check-stage-evidence.sh +81 -0
  682. package/payload/lifecycle-kit/checks/check-stage-skill-coverage.sh +47 -0
  683. package/payload/lifecycle-kit/gate-tests/boundary-scratch-wipe.test.sh +96 -0
  684. package/payload/lifecycle-kit/gate-tests/check-close-surfaces/bad/args +1 -0
  685. package/payload/lifecycle-kit/gate-tests/check-close-surfaces/bad/expect.txt +1 -0
  686. package/payload/lifecycle-kit/gate-tests/check-close-surfaces/bad/owners/inbox.md +5 -0
  687. package/payload/lifecycle-kit/gate-tests/check-close-surfaces/bad/scripts/lifecycle-config.sh +4 -0
  688. package/payload/lifecycle-kit/gate-tests/check-close-surfaces/good/args +1 -0
  689. package/payload/lifecycle-kit/gate-tests/check-close-surfaces/good/expect.txt +1 -0
  690. package/payload/lifecycle-kit/gate-tests/check-close-surfaces/good/owners/inbox.md +5 -0
  691. package/payload/lifecycle-kit/gate-tests/check-close-surfaces/good/scripts/lifecycle-config.sh +4 -0
  692. package/payload/lifecycle-kit/gate-tests/check-close-surfaces.test.sh +66 -0
  693. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/bad/args +2 -0
  694. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/bad/evidence.txt +2 -0
  695. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/bad/expect.txt +1 -0
  696. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/bad/queue-head.md +8 -0
  697. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/bad/queue-work.md +5 -0
  698. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/good/args +2 -0
  699. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/good/evidence.txt +3 -0
  700. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/good/expect.txt +1 -0
  701. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/good/queue-head.md +8 -0
  702. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/good/queue-work.md +5 -0
  703. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition.test.sh +56 -0
  704. package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration/bad/AGENT.md +11 -0
  705. package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration/bad/args +1 -0
  706. package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration/bad/expect.txt +1 -0
  707. package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration/good/AGENT.md +11 -0
  708. package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration/good/args +1 -0
  709. package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration/good/expect.txt +1 -0
  710. package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration.test.sh +59 -0
  711. package/payload/lifecycle-kit/gate-tests/check-merge-attrs/bad/.gitattributes +6 -0
  712. package/payload/lifecycle-kit/gate-tests/check-merge-attrs/bad/expect.txt +1 -0
  713. package/payload/lifecycle-kit/gate-tests/check-merge-attrs/good/.gitattributes +5 -0
  714. package/payload/lifecycle-kit/gate-tests/check-merge-attrs/good/expect.txt +1 -0
  715. package/payload/lifecycle-kit/gate-tests/check-merge-attrs.test.sh +113 -0
  716. package/payload/lifecycle-kit/gate-tests/check-shim-restatement/bad/args +2 -0
  717. package/payload/lifecycle-kit/gate-tests/check-shim-restatement/bad/commands/build.md +6 -0
  718. package/payload/lifecycle-kit/gate-tests/check-shim-restatement/bad/corpus.md +4 -0
  719. package/payload/lifecycle-kit/gate-tests/check-shim-restatement/bad/expect.txt +1 -0
  720. package/payload/lifecycle-kit/gate-tests/check-shim-restatement/good/args +2 -0
  721. package/payload/lifecycle-kit/gate-tests/check-shim-restatement/good/commands/build.md +5 -0
  722. package/payload/lifecycle-kit/gate-tests/check-shim-restatement/good/corpus.md +4 -0
  723. package/payload/lifecycle-kit/gate-tests/check-shim-restatement/good/expect.txt +1 -0
  724. package/payload/lifecycle-kit/gate-tests/check-shim-restatement.test.sh +80 -0
  725. package/payload/lifecycle-kit/gate-tests/check-skill-binding/bad/args +1 -0
  726. package/payload/lifecycle-kit/gate-tests/check-skill-binding/bad/commands/build.md +5 -0
  727. package/payload/lifecycle-kit/gate-tests/check-skill-binding/bad/expect.txt +1 -0
  728. package/payload/lifecycle-kit/gate-tests/check-skill-binding/bad/templates/build.md +7 -0
  729. package/payload/lifecycle-kit/gate-tests/check-skill-binding/good/args +1 -0
  730. package/payload/lifecycle-kit/gate-tests/check-skill-binding/good/commands/build.md +7 -0
  731. package/payload/lifecycle-kit/gate-tests/check-skill-binding/good/expect.txt +1 -0
  732. package/payload/lifecycle-kit/gate-tests/check-skill-binding/good/templates/build.md +7 -0
  733. package/payload/lifecycle-kit/gate-tests/check-skill-binding.test.sh +84 -0
  734. package/payload/lifecycle-kit/gate-tests/check-stage-entry/bad/.workflow/WORKFLOW-STATE.txt +7 -0
  735. package/payload/lifecycle-kit/gate-tests/check-stage-entry/bad/TASK-QUEUE.md +13 -0
  736. package/payload/lifecycle-kit/gate-tests/check-stage-entry/bad/expect.txt +1 -0
  737. package/payload/lifecycle-kit/gate-tests/check-stage-entry/good/.workflow/WORKFLOW-STATE.txt +7 -0
  738. package/payload/lifecycle-kit/gate-tests/check-stage-entry/good/TASK-QUEUE.md +13 -0
  739. package/payload/lifecycle-kit/gate-tests/check-stage-entry/good/expect.txt +1 -0
  740. package/payload/lifecycle-kit/gate-tests/check-stage-entry.test.sh +251 -0
  741. package/payload/lifecycle-kit/gate-tests/check-stage-evidence/bad/.workflow/WORKFLOW-STATE.txt +6 -0
  742. package/payload/lifecycle-kit/gate-tests/check-stage-evidence/bad/TASK-QUEUE.md +13 -0
  743. package/payload/lifecycle-kit/gate-tests/check-stage-evidence/bad/expect.txt +1 -0
  744. package/payload/lifecycle-kit/gate-tests/check-stage-evidence/good/.workflow/WORKFLOW-STATE.txt +6 -0
  745. package/payload/lifecycle-kit/gate-tests/check-stage-evidence/good/TASK-QUEUE.md +13 -0
  746. package/payload/lifecycle-kit/gate-tests/check-stage-evidence/good/expect.txt +1 -0
  747. package/payload/lifecycle-kit/gate-tests/check-stage-evidence.test.sh +115 -0
  748. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/args +1 -0
  749. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/commands/align.md +2 -0
  750. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/commands/build.md +2 -0
  751. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/commands/scope.md +2 -0
  752. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/commands/validate.md +2 -0
  753. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/expect.txt +1 -0
  754. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/args +1 -0
  755. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/commands/align.md +2 -0
  756. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/commands/build.md +2 -0
  757. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/commands/close.md +2 -0
  758. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/commands/scope.md +2 -0
  759. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/commands/validate.md +2 -0
  760. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/expect.txt +1 -0
  761. package/payload/lifecycle-kit/lib/stages.sh +179 -0
  762. package/payload/lifecycle-kit/smoke/install.sh +341 -0
  763. package/payload/lifecycle-kit/smoke/violation.sh +8 -0
  764. package/payload/lifecycle-kit/templates/lead.md +271 -0
  765. package/payload/lifecycle-kit/templates/lifecycle-config.sh +2 -0
  766. package/payload/lifecycle-kit/templates/release-sweep.md +39 -0
  767. package/payload/lifecycle-kit/templates/stages/align.md +65 -0
  768. package/payload/lifecycle-kit/templates/stages/build.md +78 -0
  769. package/payload/lifecycle-kit/templates/stages/close.md +122 -0
  770. package/payload/lifecycle-kit/templates/stages/scope.md +112 -0
  771. package/payload/lifecycle-kit/templates/stages/spec.md +91 -0
  772. package/payload/lifecycle-kit/templates/stages/validate.md +54 -0
  773. package/payload/lifecycle-kit/templates/upgrade.md +41 -0
  774. package/payload/queue-kit/README.md +78 -0
  775. package/payload/queue-kit/SPEC.md +797 -0
  776. package/payload/queue-kit/bin/lesson-sink.sh +28 -0
  777. package/payload/queue-kit/bin/queue-index.sh +182 -0
  778. package/payload/queue-kit/bin/roadmap.sh +76 -0
  779. package/payload/queue-kit/checks/check-queue-entry-budget.sh +104 -0
  780. package/payload/queue-kit/checks/check-queue-hygiene.sh +81 -0
  781. package/payload/queue-kit/checks/check-queue-prose-precondition.sh +63 -0
  782. package/payload/queue-kit/checks/check-queue-sections.sh +44 -0
  783. package/payload/queue-kit/checks/check-queue-slug-liveness.sh +63 -0
  784. package/payload/queue-kit/checks/check-queue-wrap.sh +56 -0
  785. package/payload/queue-kit/checks/check-roadmap-fresh.sh +110 -0
  786. package/payload/queue-kit/checks/check-tag-lead-line.sh +70 -0
  787. package/payload/queue-kit/checks/check-task-conservation.sh +50 -0
  788. package/payload/queue-kit/checks/check-task-names.sh +128 -0
  789. package/payload/queue-kit/gate-tests/check-queue-entry-budget/bad/TASK-QUEUE.md +33 -0
  790. package/payload/queue-kit/gate-tests/check-queue-entry-budget/bad/expect.txt +4 -0
  791. package/payload/queue-kit/gate-tests/check-queue-entry-budget/bad/scripts/queue-config.sh +6 -0
  792. package/payload/queue-kit/gate-tests/check-queue-entry-budget/good/TASK-QUEUE.md +35 -0
  793. package/payload/queue-kit/gate-tests/check-queue-entry-budget/good/scripts/queue-config.sh +6 -0
  794. package/payload/queue-kit/gate-tests/check-queue-hygiene/bad/TASK-QUEUE.md +17 -0
  795. package/payload/queue-kit/gate-tests/check-queue-hygiene/bad/expect.txt +1 -0
  796. package/payload/queue-kit/gate-tests/check-queue-hygiene/good/TASK-QUEUE.md +25 -0
  797. package/payload/queue-kit/gate-tests/check-queue-hygiene/good/expect.txt +1 -0
  798. package/payload/queue-kit/gate-tests/check-queue-prose-precondition/bad/TASK-QUEUE.md +15 -0
  799. package/payload/queue-kit/gate-tests/check-queue-prose-precondition/bad/expect.txt +1 -0
  800. package/payload/queue-kit/gate-tests/check-queue-prose-precondition/good/TASK-QUEUE.md +25 -0
  801. package/payload/queue-kit/gate-tests/check-queue-prose-precondition/good/expect.txt +1 -0
  802. package/payload/queue-kit/gate-tests/check-queue-sections/bad/TASK-QUEUE.md +13 -0
  803. package/payload/queue-kit/gate-tests/check-queue-sections/bad/expect.txt +1 -0
  804. package/payload/queue-kit/gate-tests/check-queue-sections/good/TASK-QUEUE.md +15 -0
  805. package/payload/queue-kit/gate-tests/check-queue-sections/good/expect.txt +1 -0
  806. package/payload/queue-kit/gate-tests/check-queue-slug-liveness/bad/TASK-QUEUE.md +17 -0
  807. package/payload/queue-kit/gate-tests/check-queue-slug-liveness/bad/docs/page.md +4 -0
  808. package/payload/queue-kit/gate-tests/check-queue-slug-liveness/bad/expect.txt +1 -0
  809. package/payload/queue-kit/gate-tests/check-queue-slug-liveness/bad/scripts/queue-config.sh +3 -0
  810. package/payload/queue-kit/gate-tests/check-queue-slug-liveness/good/TASK-QUEUE.md +19 -0
  811. package/payload/queue-kit/gate-tests/check-queue-slug-liveness/good/docs/page.md +5 -0
  812. package/payload/queue-kit/gate-tests/check-queue-slug-liveness/good/expect.txt +1 -0
  813. package/payload/queue-kit/gate-tests/check-queue-slug-liveness/good/scripts/queue-config.sh +3 -0
  814. package/payload/queue-kit/gate-tests/check-queue-wrap/bad/TASK-QUEUE.md +15 -0
  815. package/payload/queue-kit/gate-tests/check-queue-wrap/bad/expect.txt +1 -0
  816. package/payload/queue-kit/gate-tests/check-queue-wrap/good/TASK-QUEUE.md +25 -0
  817. package/payload/queue-kit/gate-tests/check-queue-wrap/good/expect.txt +1 -0
  818. package/payload/queue-kit/gate-tests/check-roadmap-fresh/bad/TASK-QUEUE.md +24 -0
  819. package/payload/queue-kit/gate-tests/check-roadmap-fresh/bad/args +5 -0
  820. package/payload/queue-kit/gate-tests/check-roadmap-fresh/bad/emit.txt +8 -0
  821. package/payload/queue-kit/gate-tests/check-roadmap-fresh/bad/expect.txt +1 -0
  822. package/payload/queue-kit/gate-tests/check-roadmap-fresh/bad/projection.txt +16 -0
  823. package/payload/queue-kit/gate-tests/check-roadmap-fresh/bad/scripts/queue-config.sh +6 -0
  824. package/payload/queue-kit/gate-tests/check-roadmap-fresh/good/TASK-QUEUE.md +22 -0
  825. package/payload/queue-kit/gate-tests/check-roadmap-fresh/good/args +5 -0
  826. package/payload/queue-kit/gate-tests/check-roadmap-fresh/good/emit.txt +7 -0
  827. package/payload/queue-kit/gate-tests/check-roadmap-fresh/good/expect.txt +1 -0
  828. package/payload/queue-kit/gate-tests/check-roadmap-fresh/good/projection.txt +16 -0
  829. package/payload/queue-kit/gate-tests/check-roadmap-fresh/good/scripts/queue-config.sh +6 -0
  830. package/payload/queue-kit/gate-tests/check-tag-lead-line/bad/TASK-QUEUE.md +25 -0
  831. package/payload/queue-kit/gate-tests/check-tag-lead-line/bad/expect.txt +2 -0
  832. package/payload/queue-kit/gate-tests/check-tag-lead-line/good/TASK-QUEUE.md +30 -0
  833. package/payload/queue-kit/gate-tests/check-tag-lead-line/good/expect.txt +1 -0
  834. package/payload/queue-kit/gate-tests/check-task-names/bad/TASK-QUEUE.md +18 -0
  835. package/payload/queue-kit/gate-tests/check-task-names/bad/expect.txt +1 -0
  836. package/payload/queue-kit/gate-tests/check-task-names/good/TASK-QUEUE.md +25 -0
  837. package/payload/queue-kit/gate-tests/check-task-names/good/expect.txt +1 -0
  838. package/payload/queue-kit/gate-tests/queue-index.test.sh +159 -0
  839. package/payload/queue-kit/gate-tests/roadmap.test.sh +197 -0
  840. package/payload/queue-kit/lib/queue.sh +193 -0
  841. package/payload/queue-kit/smoke/install.sh +22 -0
  842. package/payload/queue-kit/smoke/violation.sh +8 -0
  843. package/payload/queue-kit/templates/TASK-QUEUE.md +43 -0
  844. package/payload/queue-kit/templates/queue-config.sh +2 -0
  845. package/payload/site-kit/README.md +61 -0
  846. package/payload/site-kit/SPEC.md +269 -0
  847. package/payload/site-kit/checks/check-docs-cname-parity.sh +80 -0
  848. package/payload/site-kit/checks/check-docs-render-fidelity.sh +167 -0
  849. package/payload/site-kit/gate-tests/check-docs-cname-parity/bad/args +4 -0
  850. package/payload/site-kit/gate-tests/check-docs-cname-parity/bad/expect.txt +1 -0
  851. package/payload/site-kit/gate-tests/check-docs-cname-parity/bad/site-config.sh +7 -0
  852. package/payload/site-kit/gate-tests/check-docs-cname-parity/bad/tree/CNAME +1 -0
  853. package/payload/site-kit/gate-tests/check-docs-cname-parity/bad/tree/README.md +5 -0
  854. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/args +5 -0
  855. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/expect.txt +1 -0
  856. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/site-config.sh +7 -0
  857. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/tree/CNAME +1 -0
  858. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/tree/docs/posts/2026-01-01-legacy.md +4 -0
  859. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/tree/index.md +4 -0
  860. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/tree/pkg/gate-tests/fixture.md +5 -0
  861. package/payload/site-kit/gate-tests/check-docs-render-fidelity/bad/args +8 -0
  862. package/payload/site-kit/gate-tests/check-docs-render-fidelity/bad/expect.txt +1 -0
  863. package/payload/site-kit/gate-tests/check-docs-render-fidelity/bad/tree/docs/install.md +38 -0
  864. package/payload/site-kit/gate-tests/check-docs-render-fidelity/good/args +6 -0
  865. package/payload/site-kit/gate-tests/check-docs-render-fidelity/good/expect.txt +1 -0
  866. package/payload/site-kit/gate-tests/check-docs-render-fidelity/good/tree/docs/install.md +35 -0
  867. package/payload/site-kit/gate-tests/check-docs-render-fidelity-foreign.test.sh +87 -0
  868. package/payload/site-kit/gate-tests/check-docs-render-fidelity-span.test.sh +80 -0
  869. package/payload/site-kit/gate-tests/check-docs-render-fidelity-table.test.sh +90 -0
  870. package/payload/site-kit/lib/site.sh +29 -0
  871. package/payload/site-kit/smoke/install.sh +26 -0
  872. package/payload/site-kit/smoke/violation.sh +20 -0
  873. package/payload/site-kit/templates/site-health.yml +164 -0
  874. package/profiles.list +53 -0
@@ -0,0 +1 @@
1
+ Install notes: clone into /home/bob/projects and run the setup script.
@@ -0,0 +1,2 @@
1
+ # <scan-root> <pattern-file>
2
+ tree patterns.list
@@ -0,0 +1 @@
1
+ TREE-TERMS: clean
@@ -0,0 +1,3 @@
1
+ # banned-pattern fixture (grep -E, one per line; '#' + blank ignored)
2
+ /(home|Users)/[A-Za-z0-9._-]+
3
+ claude\.com/claude-code
@@ -0,0 +1 @@
1
+ A tracked file with no local paths and no promo URL — nothing to leak here.
@@ -0,0 +1 @@
1
+ # contract: not a pointer and not a version marker
@@ -0,0 +1 @@
1
+ # a descriptive header, not a ruled contract payload
@@ -0,0 +1 @@
1
+ is not a '# contract: ' header
@@ -0,0 +1 @@
1
+ # contract: gate-sdk/SPEC.md §The workflow directory — the pointer payload form, with its grammar riding the em-dash tail
@@ -0,0 +1 @@
1
+ # contract: fixture-format v3
@@ -0,0 +1 @@
1
+ WORKFLOW-TIERING: clean
@@ -0,0 +1,87 @@
1
+ #!/usr/bin/env bash
2
+ # spec: gate-sdk/SPEC.md §enforcement-map — degraded-registry coverage the hermetic fixtures cannot reach: a knob unset with its default absent drops exactly its own section (the gate registry — gate-sdk's core — always remains), while a knob explicitly set to a missing path refuses (exit 2, empty stdout, stderr names the knob)
3
+ set -uo pipefail
4
+ source "$(dirname "${BASH_SOURCE[0]}")/../../gate-sdk/lib/test-hermetic.sh"
5
+
6
+ ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
7
+ cd "$ROOT" || exit 2
8
+ EMIT="gate-sdk/bin/enforcement-map.sh"
9
+ [[ -x "$EMIT" ]] || { echo "enforcement-map.test: emitter not found: $EMIT"; exit 2; }
10
+
11
+ emptydir="$(mktemp -d)"; scandir="$(mktemp -d)"; scratch="$(mktemp -d)"
12
+ trap 'rm -rf "$emptydir" "$scandir" "$scratch"' EXIT
13
+
14
+ fails=0
15
+ assert_has() { grep -qF -- "$2" <<<"$3" || { echo "FAIL [$1]: expected present: $2"; fails=$((fails + 1)); }; }
16
+ assert_absent() { grep -qF -- "$2" <<<"$3" && { echo "FAIL [$1]: expected absent: $2"; fails=$((fails + 1)); }; return 0; }
17
+
18
+ # The baseline asserts every real registry projects its section. Evidence
19
+ # routes through EVIDENCE_KIT_CONFIG_FILE, which the hermetic bootstrap pins to
20
+ # an empty file; drop that pin here so the emitter resolves this repo's real
21
+ # evidence-config.sh (the other registries already read their real defaults).
22
+ base="$(env -u EVIDENCE_KIT_CONFIG_FILE bash "$EMIT" --emit)"
23
+ for section in "## Blocking gates" "## Advisory KPIs" "## Guards" "## Session warnings" "## Validate suites" "## Monitors"; do
24
+ assert_has baseline "$section" "$base"
25
+ done
26
+
27
+ # spec: gate-sdk/SPEC.md §enforcement-map — adopted-but-broken refuses: a knob
28
+ # explicitly set to a missing path exits 2 before the first stdout byte, the
29
+ # stderr line naming the knob; the settings knob also refuses a set file jq
30
+ # cannot parse.
31
+ errfile="$scratch/stderr"
32
+ assert_strict() { # $1=case $2=knob-name $3=knob-value
33
+ local out rc
34
+ out="$(env "$2=$3" bash "$EMIT" --emit 2>"$errfile")"; rc=$?
35
+ [[ "$rc" -eq 2 ]] || { echo "FAIL [$1]: expected exit 2, got $rc"; fails=$((fails + 1)); }
36
+ [[ -z "$out" ]] || { echo "FAIL [$1]: expected empty stdout"; fails=$((fails + 1)); }
37
+ grep -qF -- "$2" "$errfile" || { echo "FAIL [$1]: stderr does not name $2"; fails=$((fails + 1)); }
38
+ }
39
+ assert_strict strict-kpis DRIFT_KIT_KPIS_FILE /nonexistent/kpis.list
40
+ assert_strict strict-settings CONTEXT_KIT_SETTINGS_FILE /nonexistent/settings.json
41
+ assert_strict strict-evidence EVIDENCE_KIT_CONFIG_FILE /nonexistent/evidence-config.sh
42
+ assert_strict strict-scandir GATE_SDK_ENFORCE_SCAN_DIR /nonexistent/scandir
43
+ printf '{ not json\n' > "$scratch/bad-settings.json"
44
+ assert_strict strict-settings-unparseable CONTEXT_KIT_SETTINGS_FILE "$scratch/bad-settings.json"
45
+
46
+ # spec: gate-sdk/SPEC.md §enforcement-map — not-adopted degrades: an unset knob
47
+ # whose default path is absent drops exactly its own section. A scratch
48
+ # GATE_SDK_GATES_DIR holding only a gates.list copy leaves the kpis.list and
49
+ # evidence-config.sh defaults absent; adding kpis.list back restores only the
50
+ # KPI section, so the sections drop independently.
51
+ mkdir -p "$scratch/gates"
52
+ cp "scripts/gates.list" "$scratch/gates/gates.list"
53
+ deg="$(env -u DRIFT_KIT_KPIS_FILE -u EVIDENCE_KIT_CONFIG_FILE GATE_SDK_GATES_DIR="$scratch/gates" bash "$EMIT" --emit)"
54
+ assert_absent degrade-both "## Advisory KPIs" "$deg"
55
+ assert_absent degrade-both "## Validate suites" "$deg"
56
+ assert_has degrade-both "## Blocking gates" "$deg"
57
+ cp "scripts/kpis.list" "$scratch/gates/kpis.list"
58
+ deg2="$(env -u DRIFT_KIT_KPIS_FILE -u EVIDENCE_KIT_CONFIG_FILE GATE_SDK_GATES_DIR="$scratch/gates" bash "$EMIT" --emit)"
59
+ assert_has degrade-independent "## Advisory KPIs" "$deg2"
60
+ assert_absent degrade-independent "## Validate suites" "$deg2"
61
+ assert_has degrade-independent "## Blocking gates" "$deg2"
62
+
63
+ # The settings default (.claude/settings.json) is cwd-relative: run from a cwd
64
+ # without one, the unset knob degrades — both hook sections drop, the gate
65
+ # registry (reached through an absolute GATE_SDK_GATES_DIR) remains.
66
+ nohooks="$(cd "$emptydir" && env -u CONTEXT_KIT_SETTINGS_FILE -u DRIFT_KIT_KPIS_FILE -u EVIDENCE_KIT_CONFIG_FILE GATE_SDK_GATES_DIR="$scratch/gates" bash "$ROOT/$EMIT" --emit)"
67
+ assert_absent no-hooks "## Guards" "$nohooks"
68
+ assert_absent no-hooks "## Session warnings" "$nohooks"
69
+ assert_has no-hooks "## Blocking gates" "$nohooks"
70
+
71
+ nomon="$(GATE_SDK_ENFORCE_SCAN_DIR="$emptydir" bash "$EMIT" --emit)"
72
+ assert_absent no-monitors "## Monitors" "$nomon"
73
+ assert_has no-monitors "## Blocking gates" "$nomon"
74
+
75
+ # spec: gate-sdk/SPEC.md §enforcement-map — a marker is dormant in a template
76
+ # (an inert copy-source) and activates only where a consumer copies it live: a
77
+ # live marker projects a row, an identical one under templates/ does not.
78
+ mkdir -p "$scandir/live" "$scandir/templates"
79
+ printf '# enforce: class=monitor live-surface-alpha\n' > "$scandir/live/probe.yml"
80
+ printf '# enforce: class=monitor template-surface-beta\n' > "$scandir/templates/probe.yml"
81
+ tmpl="$(GATE_SDK_ENFORCE_SCAN_DIR="$scandir" bash "$EMIT" --emit)"
82
+ assert_has template-inert "live-surface-alpha" "$tmpl"
83
+ assert_absent template-inert "template-surface-beta" "$tmpl"
84
+
85
+ [[ "$fails" -eq 0 ]] || { echo "enforcement-map.test: $fails assertion(s) failed"; exit 1; }
86
+ echo "enforcement-map.test: clean (set-but-missing knobs refuse; unset-with-default-absent sections drop independently; gate registry always present)"
87
+ exit 0
@@ -0,0 +1,78 @@
1
+ #!/usr/bin/env bash
2
+ # Direct unit test of gate-sdk/lib/gate.sh — the runtime lock-in for the
3
+ # fail-closed contract. A green static check cannot prove fail-closed; this
4
+ # exercises both branches of the helper directly.
5
+ #
6
+ # Why a direct test and not per-gate input fixtures: a well-formed awk cannot be
7
+ # crashed on present, readable input, and a *missing* input trips each gate's
8
+ # pre-`-f` guard before reaching the capture fail_closed protects. So the helper
9
+ # is where the fail-closed contract is actually verifiable. Per-gate *wiring*
10
+ # (does the gate call fail_closed after its capture) is a structural property,
11
+ # verified by check-gate-fail-closed + check-shellcheck.
12
+ #
13
+ # Run by run-gate-tests.sh (any <tests-dir>/*.test.sh; must exit 0).
14
+ set -uo pipefail
15
+ source "$(dirname "${BASH_SOURCE[0]}")/../../gate-sdk/lib/test-hermetic.sh"
16
+
17
+ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" # gate-sdk/
18
+ # shellcheck source=../lib/gate.sh
19
+ source "$DIR/lib/gate.sh"
20
+
21
+ fails=0
22
+
23
+ # Branch 1: zero status -> no-op (returns 0, does NOT exit the caller).
24
+ fail_closed 0 check-x awk
25
+ reached=yes
26
+ [[ "$reached" == yes ]] || { echo " FAIL: fail_closed 0 aborted the caller"; fails=$((fails + 1)); }
27
+
28
+ # Branch 2: non-zero status -> exit 2 + diagnostic on stderr (run in a subshell
29
+ # so the exit doesn't abort this test).
30
+ out="$( ( fail_closed 2 check-x awk ) 2>&1 )"; rc=$?
31
+ [[ "$rc" -eq 2 ]] || { echo " FAIL: fail_closed 2 should exit 2, exited $rc"; fails=$((fails + 1)); }
32
+ grep -qF 'the check could not run' <<<"$out" \
33
+ || { echo " FAIL: fail_closed 2 missing 'the check could not run': $out"; fails=$((fails + 1)); }
34
+
35
+ # --- discovery prune set: gate_path_pruned (pure predicate) ------------------
36
+ for p in 'a/target/b' './node_modules/x' 'kit/gate-tests/g/SPEC.md' '.tmp/s'; do
37
+ gate_path_pruned "$p" || { echo " FAIL: gate_path_pruned missed '$p'"; fails=$((fails + 1)); }
38
+ done
39
+ for p in 'src/main.rs' 'a/targets/b' 'some-service/proto/x.proto'; do
40
+ gate_path_pruned "$p" && { echo " FAIL: gate_path_pruned over-pruned '$p'"; fails=$((fails + 1)); }
41
+ done
42
+
43
+ # --- GATE_GREP_EXCLUDES: one --exclude-dir per pruned dir --------------------
44
+ for d in target gate-tests node_modules; do
45
+ printf '%s\n' "${GATE_GREP_EXCLUDES[@]}" | grep -qxF -- "--exclude-dir=$d" \
46
+ || { echo " FAIL: GATE_GREP_EXCLUDES missing $d"; fails=$((fails + 1)); }
47
+ done
48
+
49
+ # --- gate_find: prunes the set, returns everything else ----------------------
50
+ sandbox="$(mktemp -d)"; trap 'rm -rf "$sandbox"' EXIT
51
+ mkdir -p "$sandbox/sub" "$sandbox/target" "$sandbox/gate-tests/x" "$sandbox/node_modules"
52
+ : >"$sandbox/a.proto"; : >"$sandbox/sub/b.proto"
53
+ : >"$sandbox/target/c.proto"; : >"$sandbox/gate-tests/x/d.proto"; : >"$sandbox/node_modules/e.proto"
54
+ got="$(gate_find "$sandbox" -name '*.proto' | sed "s#^$sandbox/##" | sort | paste -sd, -)"
55
+ [[ "$got" == 'a.proto,sub/b.proto' ]] \
56
+ || { echo " FAIL: gate_find returned '$got' (want 'a.proto,sub/b.proto')"; fails=$((fails + 1)); }
57
+
58
+ # --- registry + resolution (gate-sdk additions) -------------------------------
59
+ list="$sandbox/gates.list"
60
+ printf '# comment\n\ncheck-one\ncheck-two\n' > "$list"
61
+ got="$(gates_list_members "$list" | paste -sd, -)"
62
+ [[ "$got" == 'check-one,check-two' ]] \
63
+ || { echo " FAIL: gates_list_members returned '$got' (want 'check-one,check-two')"; fails=$((fails + 1)); }
64
+
65
+ mkdir -p "$sandbox/a" "$sandbox/b"
66
+ : >"$sandbox/b/check-one.sh"
67
+ got="$(gate_resolve check-one "$sandbox/a" "$sandbox/b")"
68
+ [[ "$got" == "$sandbox/b/check-one.sh" ]] \
69
+ || { echo " FAIL: gate_resolve returned '$got' (want '$sandbox/b/check-one.sh')"; fails=$((fails + 1)); }
70
+ gate_resolve check-missing "$sandbox/a" "$sandbox/b" >/dev/null \
71
+ && { echo " FAIL: gate_resolve found a nonexistent gate"; fails=$((fails + 1)); }
72
+
73
+ if [[ "$fails" -gt 0 ]]; then
74
+ echo "lib-gate.test: $fails assertion(s) failed"
75
+ exit 1
76
+ fi
77
+ echo "lib-gate.test: ok (fail_closed branches; gate_path_pruned; GATE_GREP_EXCLUDES; gate_find prune; registry + resolution)"
78
+ exit 0
@@ -0,0 +1,77 @@
1
+ #!/usr/bin/env bash
2
+ # spec: gate-sdk/SPEC.md §run-gates — end-to-end lock-in for `run-gates.sh --for`
3
+ # selection over a hermetic scratch registry: the two behaviors the live gate
4
+ # set cannot exercise (the no-match note on an ungoverned path, a mode=staged
5
+ # gate's git-pathspec exact-or-subtree match with its matching paths passed as
6
+ # args) plus the trigger='*'/plain-glob cases. Run by run-gate-tests.sh.
7
+ set -uo pipefail
8
+ source "$(dirname "${BASH_SOURCE[0]}")/../../gate-sdk/lib/test-hermetic.sh"
9
+
10
+ ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
11
+ RUN="$ROOT/gate-sdk/bin/run-gates.sh"
12
+ [[ -x "$RUN" ]] || { echo "run-for-path.test: runner not found: $RUN"; exit 2; }
13
+
14
+ scratch="$(mktemp -d)"
15
+ trap 'rm -rf "$scratch"' EXIT
16
+
17
+ # A trivial gate: prints its name + any args, exits 0.
18
+ mk_gate() {
19
+ local name="$1" manifest="$2"
20
+ { printf '#!/usr/bin/env bash\n'
21
+ printf '%s\n' "$manifest"
22
+ printf 'echo "%s ran args=[$*]"\n' "$name"
23
+ } > "$scratch/$name.sh"
24
+ chmod +x "$scratch/$name.sh"
25
+ }
26
+
27
+ # Registry with a trigger='*' gate, a plain-glob gate, and a mode=staged gate.
28
+ mk_gate g_star '# graph: couples=cfg dir=one valve=none tier=precommit trigger=*'
29
+ mk_gate g_glob '# graph: couples=alpha/*.txt dir=one valve=none tier=precommit'
30
+ mk_gate g_staged '# graph: couples=beta dir=one valve=none tier=precommit mode=staged'
31
+ { echo g_star; echo g_glob; echo g_staged; } > "$scratch/gates.list"
32
+
33
+ # Isolate the runner onto the scratch registry: no kit roots, tmp off-tree.
34
+ # Verbose: selection is observed through each stub gate's echoed banner output.
35
+ run_for() {
36
+ GATE_SDK_GATES_DIR="$scratch" GATE_SDK_KIT_DIRS="$scratch" \
37
+ GATE_SDK_TMP_DIR="$scratch/.tmp" GATE_SDK_VERBOSE=1 bash "$RUN" --for "$@" 2>&1
38
+ }
39
+
40
+ fails=0
41
+ assert_has() { grep -qF -- "$2" <<<"$3" || { echo "FAIL [$1]: expected present: $2"; fails=$((fails + 1)); }; }
42
+ assert_absent() { grep -qF -- "$2" <<<"$3" && { echo "FAIL [$1]: expected absent: $2"; fails=$((fails + 1)); }; return 0; }
43
+
44
+ # A plain-glob path: g_glob (alpha/*.txt) selected, g_star always, g_staged not.
45
+ out="$(run_for alpha/foo.txt)"
46
+ assert_has glob "g_glob ran" "$out"
47
+ assert_has glob "g_star ran" "$out"
48
+ assert_absent glob "g_staged ran" "$out"
49
+ assert_absent glob "no registered gate couples to" "$out"
50
+
51
+ # A mode=staged gate matches by git pathspec (exact-or-subtree) and receives its
52
+ # matching paths as args; a plain-glob gate would not match the subtree path.
53
+ out="$(run_for beta/inner/x)"
54
+ assert_has staged "g_staged ran args=[beta/inner/x]" "$out"
55
+ assert_has staged "g_star ran" "$out"
56
+ assert_absent staged "g_glob ran" "$out"
57
+
58
+ # An ungoverned path with a trigger='*' gate present: g_star covers it, so no note.
59
+ out="$(run_for zzz/nowhere.md)"
60
+ assert_has covered "g_star ran" "$out"
61
+ assert_absent covered "no registered gate couples to" "$out"
62
+
63
+ # Registry with no trigger='*' gate: an ungoverned path yields the note + nothing.
64
+ { echo g_glob; echo g_staged; } > "$scratch/gates.list"
65
+ out="$(run_for zzz/nowhere.md)"; rc=$?
66
+ assert_has nomatch "no registered gate couples to zzz/nowhere.md" "$out"
67
+ assert_has nomatch "nothing to run" "$out"
68
+ [[ "$rc" -eq 0 ]] || { echo "FAIL [nomatch]: expected exit 0, got $rc"; fails=$((fails + 1)); }
69
+
70
+ # --for with no path is a usage error (exit 2).
71
+ GATE_SDK_GATES_DIR="$scratch" GATE_SDK_KIT_DIRS="$scratch" \
72
+ GATE_SDK_TMP_DIR="$scratch/.tmp" bash "$RUN" --for >/dev/null 2>&1
73
+ [[ $? -eq 2 ]] || { echo "FAIL [usage]: --for with no path should exit 2"; fails=$((fails + 1)); }
74
+
75
+ [[ "$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)"
77
+ exit 0
@@ -0,0 +1,32 @@
1
+ # shellcheck shell=bash
2
+ # spec: gate-sdk/SPEC.md §Consumer smoke — the shared scratch-consumer builder both smoke harnesses vendor through (run-consumer-smoke.sh and context-kit/smoke/agents-md.sh)
3
+
4
+ # spec: gate-sdk/SPEC.md §Consumer smoke — csmoke_vendor_and_install: from the kit roots (gate-sdk first) sets SCRATCH + CSMOKE_INSTALLED; returns 2 on an environment failure; the caller owns cleanup and every post-baseline assertion
5
+ csmoke_vendor_and_install() {
6
+ local roots=("$@") r kit
7
+ SCRATCH="$(mktemp -d "${TMPDIR:-/tmp}/consumer-smoke.XXXXXX")" || return 2
8
+
9
+ git -C "$SCRATCH" init -q
10
+ printf '.tmp/\n' > "$SCRATCH/.gitignore"
11
+ git -C "$SCRATCH" add -A
12
+ git -C "$SCRATCH" -c user.email=smoke@example.invalid -c user.name=smoke \
13
+ commit -q --allow-empty -m "seed"
14
+
15
+ for r in "${roots[@]}"; do
16
+ cp -R "$r" "$SCRATCH/$(basename "$r")"
17
+ done
18
+
19
+ CSMOKE_INSTALLED=0
20
+ for r in "${roots[@]}"; do
21
+ kit="$(basename "$r")"
22
+ if ! ( cd "$SCRATCH" && SMOKE_KIT_ROOT="$SCRATCH/$kit" bash "$SCRATCH/$kit/smoke/install.sh" ); then
23
+ echo "csmoke: $kit/smoke/install.sh failed (a broken installer is an environment failure)" >&2
24
+ return 2
25
+ fi
26
+ CSMOKE_INSTALLED=$((CSMOKE_INSTALLED + 1))
27
+ done
28
+
29
+ git -C "$SCRATCH" add -A
30
+ git -C "$SCRATCH" -c user.email=smoke@example.invalid -c user.name=smoke \
31
+ commit -q --no-verify -m "installed baseline"
32
+ }
@@ -0,0 +1,216 @@
1
+ # shellcheck shell=bash
2
+ # spec: gate-sdk/SPEC.md §lib/gate.sh — sourced library: values + adapters, never gate structure
3
+
4
+ # spec: gate-sdk/SPEC.md §Layout and configuration — auto-source the consumer config seam so a layout knob's override persists past the shell that set it; GATE_SDK_CONFIG_FILE wins, else <gates-dir>/gate-sdk-config.sh (GATE_SDK_GATES_DIR stays env-or-default — a config file cannot name its own directory)
5
+ _gate_sdk_config="${GATE_SDK_CONFIG_FILE:-}"
6
+ if [[ -n "$_gate_sdk_config" ]]; then
7
+ [[ -f "$_gate_sdk_config" ]] || {
8
+ echo "gate-sdk: GATE_SDK_CONFIG_FILE not found: $_gate_sdk_config" >&2
9
+ exit 2
10
+ }
11
+ # shellcheck disable=SC1090 # consumer-supplied config, path is a knob
12
+ source "$_gate_sdk_config"
13
+ else
14
+ _gate_sdk_config="${GATE_SDK_GATES_DIR:-scripts}/gate-sdk-config.sh"
15
+ if [[ -f "$_gate_sdk_config" ]]; then
16
+ # shellcheck disable=SC1090 # consumer-supplied config, path is a knob
17
+ source "$_gate_sdk_config"
18
+ fi
19
+ fi
20
+ unset _gate_sdk_config
21
+
22
+ # spec: gate-sdk/SPEC.md §Fail-closed contract — non-zero capture status means the check could not run; exit 2, never a false clean
23
+ fail_closed() {
24
+ if [[ "$1" -ne 0 ]]; then
25
+ printf '%s: %s exited %s — the check could not run; treating as ' \
26
+ "$2" "$3" "$1" >&2
27
+ printf 'failure (not clean)\n' >&2
28
+ exit 2
29
+ fi
30
+ }
31
+
32
+ if [[ -n "${GATE_SDK_PRUNE_DIRS:-}" ]]; then
33
+ read -r -a GATE_PRUNE_DIRS <<<"$GATE_SDK_PRUNE_DIRS"
34
+ else
35
+ GATE_PRUNE_DIRS=(target .git node_modules .tmp gate-tests)
36
+ fi
37
+
38
+ gate_find() {
39
+ local prune=() d
40
+ for d in "${GATE_PRUNE_DIRS[@]}"; do prune+=(-name "$d" -o); done
41
+ unset 'prune[${#prune[@]}-1]'
42
+ find "$1" \( "${prune[@]}" \) -prune -o "${@:2}" -print
43
+ }
44
+
45
+ # shellcheck disable=SC2034 # consumed by sourcing gates, never within this lib
46
+ GATE_GREP_EXCLUDES=()
47
+ for _gpd in "${GATE_PRUNE_DIRS[@]}"; do GATE_GREP_EXCLUDES+=(--exclude-dir="$_gpd"); done
48
+ unset _gpd
49
+
50
+ gate_path_pruned() {
51
+ local p="$1" d
52
+ for d in "${GATE_PRUNE_DIRS[@]}"; do
53
+ [[ "$p" == "$d/"* || "$p" == "./$d/"* || "$p" == */"$d"/* ]] && return 0
54
+ done
55
+ return 1
56
+ }
57
+
58
+ gate_sdk_root() {
59
+ ( cd "${BASH_SOURCE[0]%/*}/.." && pwd )
60
+ }
61
+
62
+ gate_sdk_gates_dir() {
63
+ printf '%s\n' "${GATE_SDK_GATES_DIR:-scripts}"
64
+ }
65
+
66
+ gates_list_members() {
67
+ grep -Ev '^[[:space:]]*(#|$)' "$1" || true
68
+ }
69
+
70
+ gate_resolve() {
71
+ local g="$1" d
72
+ shift
73
+ for d in "$@"; do
74
+ if [[ -f "$d/$g.sh" ]]; then
75
+ printf '%s\n' "$d/$g.sh"
76
+ return 0
77
+ fi
78
+ done
79
+ return 1
80
+ }
81
+
82
+ gate_kit_roots() {
83
+ local d kit
84
+ if [[ -n "${GATE_SDK_KIT_DIRS:-}" ]]; then
85
+ for d in $GATE_SDK_KIT_DIRS; do printf '%s\n' "$d"; done
86
+ return 0
87
+ fi
88
+ local sdk parent
89
+ sdk="$(gate_sdk_root)"
90
+ printf '%s\n' "$sdk"
91
+ parent="${sdk%/*}"
92
+ for d in "$parent"/*/; do
93
+ kit="${d%/}"
94
+ [[ "$kit" == "$sdk" ]] && continue
95
+ [[ -d "$kit/checks" || -d "$kit/smoke" ]] || continue
96
+ printf '%s\n' "$kit"
97
+ done
98
+ return 0
99
+ }
100
+
101
+ gate_check_dirs() {
102
+ gate_sdk_gates_dir
103
+ local k
104
+ while IFS= read -r k; do
105
+ printf '%s/checks\n' "$k"
106
+ done < <(gate_kit_roots)
107
+ }
108
+
109
+ # spec: gate-sdk/SPEC.md §lib/gate.sh — the fixture-suite derivation shared by CI and evidence-kit's validate config: every dir with a gate-tests/ tree (the kit roots plus the gates dir), one tab-separated '<suite> <tests-dir> <checks-dir-or-empty>' row per suite in kit-roots-then-gates-dir order. suite = the dir basename with '-'→'_' (a valid var suffix + scenario name); checks-dir is the sibling checks/ when present, else empty so run-gate-tests falls back to consumer-first resolution. A new kit's gate-tests/ enrols with no hand-list to drift.
110
+ gate_fixture_suites() {
111
+ local anchor base suite
112
+ anchor="${GATE_SDK_ROOT:-$(gate_sdk_root)}"; anchor="${anchor%/*}"
113
+ { gate_kit_roots_rel; gate_sdk_gates_dir; } | while IFS= read -r base; do
114
+ base="${base%/}"
115
+ [[ -d "$anchor/$base/gate-tests" ]] || continue
116
+ suite="${base##*/}"; suite="${suite//-/_}"
117
+ if [[ -d "$anchor/$base/checks" ]]; then
118
+ printf '%s\t%s\t%s\n' "$suite" "$base/gate-tests" "$base/checks"
119
+ else
120
+ printf '%s\t%s\t\n' "$suite" "$base/gate-tests"
121
+ fi
122
+ done
123
+ }
124
+
125
+ # spec: gate-sdk/SPEC.md §lib/gate.sh — gate_kit_roots as repo-root-relative dirs (the anchor the couples globs share); absolute roots resolve against the kits' parent, relative roots (a GATE_SDK_KIT_DIRS override) pass through
126
+ gate_kit_roots_rel() {
127
+ local anchor root
128
+ anchor="${GATE_SDK_ROOT:-$(gate_sdk_root)}"; anchor="${anchor%/*}"
129
+ while IFS= read -r root; do
130
+ if [[ "$root" == /* ]]; then
131
+ realpath --relative-to="$anchor" "$root" 2>/dev/null || printf '%s\n' "$root"
132
+ else
133
+ printf '%s\n' "$root"
134
+ fi
135
+ done < <(gate_kit_roots)
136
+ }
137
+
138
+ # spec: gate-sdk/SPEC.md §check-graph — expand each kit:<glob> token in a comma-joined couples/trigger field to <kit-root>/<glob> for every gate_kit_roots_rel member; non-kit tokens pass through verbatim. The single reader gen-pre-commit, check-graph, and the hook share, so emitter and checker cannot desync.
139
+ gate_expand_couples() {
140
+ local field="$1"
141
+ local -a roots=() parts=() out=()
142
+ mapfile -t roots < <(gate_kit_roots_rel)
143
+ IFS=',' read -ra parts <<<"$field"
144
+ local tok r glob
145
+ for tok in "${parts[@]}"; do
146
+ if [[ "$tok" == kit:* ]]; then
147
+ glob="${tok#kit:}"
148
+ for r in "${roots[@]}"; do out+=("${r%/}/$glob"); done
149
+ else
150
+ out+=("$tok")
151
+ fi
152
+ done
153
+ local IFS=','
154
+ printf '%s\n' "${out[*]}"
155
+ }
156
+
157
+ # spec: gate-sdk/SPEC.md §The `# graph:` manifest — read one field from a resolved gate's `# graph:` line; the shared field reader gen-pre-commit and run-gates --for selection draw the manifest through (the couples-token expansion stays gate_expand_couples, the reader check-graph also shares). Emits the value, empty when the field is absent; never fails on a missing field.
158
+ gate_manifest_field() {
159
+ local src="$1" key="$2" man kv
160
+ man="$(grep -m1 '^# graph: ' "$src" 2>/dev/null || true)"
161
+ for kv in ${man#\# graph: }; do
162
+ [[ "$kv" == "$key="* ]] && { printf '%s' "${kv#"$key"=}"; return 0; }
163
+ done
164
+ return 0
165
+ }
166
+
167
+ # spec: gate-sdk/SPEC.md §run-gates — the path/glob matcher shared by run-gates --for selection and the emitted pre-commit hook: true when a path in the caller's staged_all array matches one of the given globs (bash glob, `*` spans '/'). gen-pre-commit emits this body verbatim into the hook's staged_matches; check-graph's freshness assertion holds the two in sync.
168
+ # shellcheck disable=SC2154 # staged_all is the caller's array: the hook's staged set, the selector's --for paths
169
+ gate_staged_matches() {
170
+ local f pat
171
+ for f in "${staged_all[@]}"; do
172
+ for pat in "$@"; do
173
+ # shellcheck disable=SC2053
174
+ [[ "$f" == $pat ]] && return 0
175
+ done
176
+ done
177
+ return 1
178
+ }
179
+
180
+ # spec: gate-sdk/SPEC.md §check-commit-msg — resolve the banned-pattern file set shared by check-commit-msg and check-tree-terms: explicit positional args win; otherwise GATE_SDK_MSG_PATTERN_FILES (tracked, must exist — fail-closed) plus GATE_SDK_MSG_PATTERN_FILES_LOCAL (gitignored, skipped when absent). Emits one existing readable file path per line; returns 2 when a required tracked file is missing.
181
+ gate_msg_pattern_files() {
182
+ if [[ $# -gt 0 ]]; then
183
+ printf '%s\n' "$@"
184
+ return 0
185
+ fi
186
+ local f gd
187
+ gd="$(gate_sdk_gates_dir)"
188
+ for f in ${GATE_SDK_MSG_PATTERN_FILES:-$gd/msg-patterns.list}; do
189
+ [[ -f "$f" ]] || { echo "gate_msg_pattern_files: required tracked pattern file missing: $f" >&2; return 2; }
190
+ [[ -r "$f" ]] || { echo "gate_msg_pattern_files: pattern file not readable: $f" >&2; return 2; }
191
+ printf '%s\n' "$f"
192
+ done
193
+ for f in ${GATE_SDK_MSG_PATTERN_FILES_LOCAL:-$gd/msg-patterns.local.list}; do
194
+ [[ -f "$f" && -r "$f" ]] && printf '%s\n' "$f"
195
+ done
196
+ return 0
197
+ }
198
+
199
+ # spec: gate-sdk/SPEC.md §check-commit-subject — the single home of the commit-type roster (check-commit-subject's type alternation; trajectory.sh and kpi-task-split classify over the same tokens). Emits the space-separated roster on one line: GATE_SDK_COMMIT_TYPES when set, else the shipped default.
200
+ gate_commit_types() {
201
+ printf '%s\n' "${GATE_SDK_COMMIT_TYPES:-feat fix refactor perf docs test build ci chore style}"
202
+ }
203
+
204
+ # spec: gate-sdk/SPEC.md §lib/gate.sh — the self-repo blob-link prefix `<identity>/blob/<ref>/`, shared by check-md-refs' resolver and the reference-link producers (the enforcement map) so an emitted link and the pass that validates it derive one identity. Identity comes from `git remote get-url origin`; the git@ and https remote forms normalize to one https identity, so no kit ships a repo name (the provenance seam holds). Empty output ⇒ no origin or an unrecognized remote form, and the caller skips the self-repo pass. The ref is the caller's policy arg, never a literal here.
205
+ gate_self_repo_prefix() {
206
+ local ref="$1" origin id rest
207
+ origin="$(git remote get-url origin 2>/dev/null)" || return 0
208
+ [[ -n "$origin" ]] || return 0
209
+ id="${origin%.git}"; id="${id%/}"
210
+ case "$id" in
211
+ git@*:*) rest="${id#git@}"; id="https://${rest/:/\/}" ;;
212
+ https://*|http://*) ;;
213
+ *) return 0 ;;
214
+ esac
215
+ printf '%s/blob/%s/\n' "$id" "$ref"
216
+ }
@@ -0,0 +1,35 @@
1
+ # shellcheck shell=bash
2
+ # spec: gate-sdk/SPEC.md §lib/inject.sh — the marker-bounded insert/replace shared by every kit's agent-file injector; block-content generation stays with the caller
3
+
4
+ # spec: gate-sdk/SPEC.md §lib/inject.sh — inject_marker_block <file> <begin> <end>; inner block content on stdin. Replaces the span between an existing marker pair (inclusive) or appends a fresh block when absent; a begin marker without its end is malformed (exit 2); the file must exist (exit 2). Echoes the action taken (appended|replaced).
5
+ inject_marker_block() {
6
+ (
7
+ set -euo pipefail
8
+ file="$1"; begin="$2"; end="$3"
9
+ [[ -f "$file" ]] \
10
+ || { echo "inject_marker_block: target file not found: $file" >&2; exit 2; }
11
+
12
+ tmp="$(mktemp)"; block="$(mktemp)"
13
+ trap 'rm -f "$tmp" "$block"' EXIT
14
+ { printf '%s\n' "$begin"; cat; printf '%s\n' "$end"; } >"$block"
15
+
16
+ if grep -qF -- "$begin" "$file"; then
17
+ grep -qF -- "$end" "$file" \
18
+ || { echo "inject_marker_block: begin marker present but end marker missing in $file — refusing to guess the block bounds" >&2; exit 2; }
19
+ awk -v b="$begin" -v e="$end" -v blockfile="$block" '
20
+ $0 == b { skip = 1; while ((getline line < blockfile) > 0) print line; close(blockfile); next }
21
+ $0 == e { skip = 0; next }
22
+ !skip { print }
23
+ ' "$file" >"$tmp"
24
+ action="replaced"
25
+ else
26
+ cp "$file" "$tmp"
27
+ printf '\n' >>"$tmp"
28
+ cat "$block" >>"$tmp"
29
+ action="appended"
30
+ fi
31
+
32
+ cp "$tmp" "$file"
33
+ printf '%s\n' "$action"
34
+ )
35
+ }
@@ -0,0 +1,11 @@
1
+ # shellcheck shell=bash
2
+ # spec: gate-sdk/SPEC.md §lib/test-hermetic.sh — pin every kit's <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)
3
+ _th_root="$(cd "${BASH_SOURCE[0]%/*}/../.." && pwd)"
4
+ _th_empty="${TMPDIR:-/tmp}/gate-sdk-hermetic-empty.sh"
5
+ : >"$_th_empty"
6
+ for _th_kit in "$_th_root"/gate-sdk "$_th_root"/*-kit; do
7
+ [[ -d "$_th_kit" ]] || continue
8
+ _th_var="$(printf '%s' "${_th_kit##*/}" | tr '[:lower:]-' '[:upper:]_')_CONFIG_FILE"
9
+ export "${_th_var}=${_th_empty}"
10
+ done
11
+ unset _th_root _th_empty _th_kit _th_var