checkwright 0.0.1 → 0.17.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 (839) 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 +78 -0
  10. package/payload/canon-kit/SPEC.md +1264 -0
  11. package/payload/canon-kit/checks/check-amendment-queue.sh +115 -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-knob-citation.sh +117 -0
  17. package/payload/canon-kit/checks/check-knob-default-coupling.sh +239 -0
  18. package/payload/canon-kit/checks/check-manifest-count.sh +46 -0
  19. package/payload/canon-kit/checks/check-manifest-temporal.sh +83 -0
  20. package/payload/canon-kit/checks/check-md-refs.sh +115 -0
  21. package/payload/canon-kit/checks/check-prose-enum.sh +115 -0
  22. package/payload/canon-kit/checks/check-prose-tells.sh +207 -0
  23. package/payload/canon-kit/checks/check-spec-derivable-section.sh +69 -0
  24. package/payload/canon-kit/checks/check-spec-dod-singleton.sh +45 -0
  25. package/payload/canon-kit/checks/check-spec-embedded-source.sh +133 -0
  26. package/payload/canon-kit/checks/check-spec-fence-balance.sh +42 -0
  27. package/payload/canon-kit/checks/check-spec-pointer.sh +176 -0
  28. package/payload/canon-kit/checks/check-surface-duplication.sh +105 -0
  29. package/payload/canon-kit/checks/check-todo-task-liveness.sh +80 -0
  30. package/payload/canon-kit/checks/check-tracking-claim.sh +136 -0
  31. package/payload/canon-kit/gate-tests/check-amendment-queue/bad/SPEC-tidy.md +5 -0
  32. package/payload/canon-kit/gate-tests/check-amendment-queue/bad/TASK-QUEUE.md +15 -0
  33. package/payload/canon-kit/gate-tests/check-amendment-queue/bad/expect.txt +1 -0
  34. package/payload/canon-kit/gate-tests/check-amendment-queue/good/SPEC-widget.md +6 -0
  35. package/payload/canon-kit/gate-tests/check-amendment-queue/good/TASK-QUEUE.md +15 -0
  36. package/payload/canon-kit/gate-tests/check-amendment-queue/good/expect.txt +1 -0
  37. package/payload/canon-kit/gate-tests/check-comment-tier/bad/bad.sh +25 -0
  38. package/payload/canon-kit/gate-tests/check-comment-tier/bad/expect.txt +1 -0
  39. package/payload/canon-kit/gate-tests/check-comment-tier/good/expect.txt +1 -0
  40. package/payload/canon-kit/gate-tests/check-comment-tier/good/good.sh +32 -0
  41. package/payload/canon-kit/gate-tests/check-comment-tier.test.sh +146 -0
  42. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/TASK-QUEUE.md +19 -0
  43. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/bad.sh +6 -0
  44. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/expect.txt +1 -0
  45. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/scripts/canon-config.sh +5 -0
  46. package/payload/canon-kit/gate-tests/check-deprecation-task/good/TASK-QUEUE.md +21 -0
  47. package/payload/canon-kit/gate-tests/check-deprecation-task/good/expect.txt +1 -0
  48. package/payload/canon-kit/gate-tests/check-deprecation-task/good/good.sh +5 -0
  49. package/payload/canon-kit/gate-tests/check-deprecation-task/good/scripts/canon-config.sh +5 -0
  50. package/payload/canon-kit/gate-tests/check-deprecation-task.test.sh +98 -0
  51. package/payload/canon-kit/gate-tests/check-docs-cmd/bad/args +1 -0
  52. package/payload/canon-kit/gate-tests/check-docs-cmd/bad/doc.md +9 -0
  53. package/payload/canon-kit/gate-tests/check-docs-cmd/bad/expect.txt +1 -0
  54. package/payload/canon-kit/gate-tests/check-docs-cmd/good/args +1 -0
  55. package/payload/canon-kit/gate-tests/check-docs-cmd/good/bin/tool.sh +3 -0
  56. package/payload/canon-kit/gate-tests/check-docs-cmd/good/doc.md +18 -0
  57. package/payload/canon-kit/gate-tests/check-docs-cmd/good/expect.txt +1 -0
  58. package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/args +4 -0
  59. package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/docs/demokit/index.md +5 -0
  60. package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/docs/index.md +3 -0
  61. package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/expect.txt +1 -0
  62. package/payload/canon-kit/gate-tests/check-docs-link-convention/good/args +4 -0
  63. package/payload/canon-kit/gate-tests/check-docs-link-convention/good/docs/demokit/index.md +6 -0
  64. package/payload/canon-kit/gate-tests/check-docs-link-convention/good/docs/index.md +3 -0
  65. package/payload/canon-kit/gate-tests/check-docs-link-convention/good/docs/methodology.md +3 -0
  66. package/payload/canon-kit/gate-tests/check-docs-link-convention/good/expect.txt +1 -0
  67. package/payload/canon-kit/gate-tests/check-knob-citation/bad/SPEC.md +10 -0
  68. package/payload/canon-kit/gate-tests/check-knob-citation/bad/expect.txt +1 -0
  69. package/payload/canon-kit/gate-tests/check-knob-citation/good/SPEC.md +19 -0
  70. package/payload/canon-kit/gate-tests/check-knob-citation/good/expect.txt +1 -0
  71. package/payload/canon-kit/gate-tests/check-knob-citation.test.sh +71 -0
  72. package/payload/canon-kit/gate-tests/check-knob-default-coupling/bad/expect.txt +1 -0
  73. package/payload/canon-kit/gate-tests/check-knob-default-coupling/bad/scripts/gate-sdk-config.sh +4 -0
  74. package/payload/canon-kit/gate-tests/check-knob-default-coupling/bad/widget-kit/SPEC.md +4 -0
  75. package/payload/canon-kit/gate-tests/check-knob-default-coupling/bad/widget-kit/lib/widget-cli.sh +3 -0
  76. package/payload/canon-kit/gate-tests/check-knob-default-coupling/bad/widget-kit/lib/widget.sh +5 -0
  77. package/payload/canon-kit/gate-tests/check-knob-default-coupling/good/expect.txt +1 -0
  78. package/payload/canon-kit/gate-tests/check-knob-default-coupling/good/scripts/gate-sdk-config.sh +5 -0
  79. package/payload/canon-kit/gate-tests/check-knob-default-coupling/good/widget-kit/SPEC.md +7 -0
  80. package/payload/canon-kit/gate-tests/check-knob-default-coupling/good/widget-kit/lib/widget-cli.sh +3 -0
  81. package/payload/canon-kit/gate-tests/check-knob-default-coupling/good/widget-kit/lib/widget.sh +5 -0
  82. package/payload/canon-kit/gate-tests/check-knob-default-coupling.test.sh +73 -0
  83. package/payload/canon-kit/gate-tests/check-manifest-count/bad/SPEC.md +15 -0
  84. package/payload/canon-kit/gate-tests/check-manifest-count/bad/expect.txt +1 -0
  85. package/payload/canon-kit/gate-tests/check-manifest-count/good/SPEC.md +37 -0
  86. package/payload/canon-kit/gate-tests/check-manifest-count/good/expect.txt +1 -0
  87. package/payload/canon-kit/gate-tests/check-manifest-count.test.sh +104 -0
  88. package/payload/canon-kit/gate-tests/check-manifest-temporal/bad/SPEC.md +6 -0
  89. package/payload/canon-kit/gate-tests/check-manifest-temporal/bad/expect.txt +1 -0
  90. package/payload/canon-kit/gate-tests/check-manifest-temporal/good/SPEC.md +17 -0
  91. package/payload/canon-kit/gate-tests/check-manifest-temporal/good/expect.txt +1 -0
  92. package/payload/canon-kit/gate-tests/check-md-refs/bad/args +1 -0
  93. package/payload/canon-kit/gate-tests/check-md-refs/bad/doc.md +3 -0
  94. package/payload/canon-kit/gate-tests/check-md-refs/bad/expect.txt +1 -0
  95. package/payload/canon-kit/gate-tests/check-md-refs/good/args +1 -0
  96. package/payload/canon-kit/gate-tests/check-md-refs/good/doc.md +3 -0
  97. package/payload/canon-kit/gate-tests/check-md-refs/good/expect.txt +1 -0
  98. package/payload/canon-kit/gate-tests/check-md-refs/good/target.md +1 -0
  99. package/payload/canon-kit/gate-tests/check-md-refs.test.sh +82 -0
  100. package/payload/canon-kit/gate-tests/check-prose-enum/bad/SPEC.md +4 -0
  101. package/payload/canon-kit/gate-tests/check-prose-enum/bad/expect.txt +1 -0
  102. package/payload/canon-kit/gate-tests/check-prose-enum/bad/scripts/canon-config.sh +4 -0
  103. package/payload/canon-kit/gate-tests/check-prose-enum/good/SPEC.md +16 -0
  104. package/payload/canon-kit/gate-tests/check-prose-enum/good/expect.txt +1 -0
  105. package/payload/canon-kit/gate-tests/check-prose-enum/good/scripts/canon-config.sh +4 -0
  106. package/payload/canon-kit/gate-tests/check-prose-enum.test.sh +127 -0
  107. package/payload/canon-kit/gate-tests/check-prose-tells/bad/expect.txt +1 -0
  108. package/payload/canon-kit/gate-tests/check-prose-tells/bad/prose.md +15 -0
  109. package/payload/canon-kit/gate-tests/check-prose-tells/bad/scripts/canon-config.sh +8 -0
  110. package/payload/canon-kit/gate-tests/check-prose-tells/good/expect.txt +1 -0
  111. package/payload/canon-kit/gate-tests/check-prose-tells/good/prose.md +21 -0
  112. package/payload/canon-kit/gate-tests/check-prose-tells/good/scripts/canon-config.sh +8 -0
  113. package/payload/canon-kit/gate-tests/check-spec-derivable-section/bad/SPEC.md +20 -0
  114. package/payload/canon-kit/gate-tests/check-spec-derivable-section/bad/expect.txt +1 -0
  115. package/payload/canon-kit/gate-tests/check-spec-derivable-section/good/SPEC.md +13 -0
  116. package/payload/canon-kit/gate-tests/check-spec-derivable-section/good/expect.txt +1 -0
  117. package/payload/canon-kit/gate-tests/check-spec-dod-singleton/bad/SPEC.md +15 -0
  118. package/payload/canon-kit/gate-tests/check-spec-dod-singleton/bad/expect.txt +1 -0
  119. package/payload/canon-kit/gate-tests/check-spec-dod-singleton/good/SPEC.md +13 -0
  120. package/payload/canon-kit/gate-tests/check-spec-dod-singleton/good/expect.txt +1 -0
  121. package/payload/canon-kit/gate-tests/check-spec-dod-singleton.test.sh +63 -0
  122. package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/SPEC.md +16 -0
  123. package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/expect.txt +1 -0
  124. package/payload/canon-kit/gate-tests/check-spec-embedded-source/bad/widget.sh +9 -0
  125. package/payload/canon-kit/gate-tests/check-spec-embedded-source/good/SPEC.md +19 -0
  126. package/payload/canon-kit/gate-tests/check-spec-embedded-source/good/expect.txt +1 -0
  127. package/payload/canon-kit/gate-tests/check-spec-embedded-source/good/widget.sh +9 -0
  128. package/payload/canon-kit/gate-tests/check-spec-fence-balance/bad/args +1 -0
  129. package/payload/canon-kit/gate-tests/check-spec-fence-balance/bad/doc.md +8 -0
  130. package/payload/canon-kit/gate-tests/check-spec-fence-balance/bad/expect.txt +1 -0
  131. package/payload/canon-kit/gate-tests/check-spec-fence-balance/good/args +1 -0
  132. package/payload/canon-kit/gate-tests/check-spec-fence-balance/good/doc.md +9 -0
  133. package/payload/canon-kit/gate-tests/check-spec-fence-balance/good/expect.txt +1 -0
  134. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/README.md +4 -0
  135. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/SPEC-target.md +6 -0
  136. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/SPEC-widget.md +5 -0
  137. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/cand-tmpl.md +5 -0
  138. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/expect.txt +1 -0
  139. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/scripts/canon-config.sh +5 -0
  140. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/widget.sh +5 -0
  141. package/payload/canon-kit/gate-tests/check-spec-pointer/good/README.md +4 -0
  142. package/payload/canon-kit/gate-tests/check-spec-pointer/good/SPEC-target.md +6 -0
  143. package/payload/canon-kit/gate-tests/check-spec-pointer/good/SPEC-widget.md +5 -0
  144. package/payload/canon-kit/gate-tests/check-spec-pointer/good/cand-tmpl.md +7 -0
  145. package/payload/canon-kit/gate-tests/check-spec-pointer/good/expect.txt +1 -0
  146. package/payload/canon-kit/gate-tests/check-spec-pointer/good/scripts/canon-config.sh +5 -0
  147. package/payload/canon-kit/gate-tests/check-spec-pointer/good/widget.sh +6 -0
  148. package/payload/canon-kit/gate-tests/check-surface-duplication/bad/GLOSSARY.md +11 -0
  149. package/payload/canon-kit/gate-tests/check-surface-duplication/bad/VISION.md +6 -0
  150. package/payload/canon-kit/gate-tests/check-surface-duplication/bad/expect.txt +1 -0
  151. package/payload/canon-kit/gate-tests/check-surface-duplication/good/GLOSSARY.md +11 -0
  152. package/payload/canon-kit/gate-tests/check-surface-duplication/good/VISION.md +6 -0
  153. package/payload/canon-kit/gate-tests/check-surface-duplication/good/expect.txt +1 -0
  154. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/TASK-QUEUE.md +19 -0
  155. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/bad.sh +5 -0
  156. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/expect.txt +1 -0
  157. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/TASK-QUEUE.md +23 -0
  158. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/expect.txt +1 -0
  159. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/good.sh +5 -0
  160. package/payload/canon-kit/gate-tests/check-tracking-claim/bad/README.md +4 -0
  161. package/payload/canon-kit/gate-tests/check-tracking-claim/bad/args +1 -0
  162. package/payload/canon-kit/gate-tests/check-tracking-claim/bad/expect.txt +1 -0
  163. package/payload/canon-kit/gate-tests/check-tracking-claim/bad/kept.txt +1 -0
  164. package/payload/canon-kit/gate-tests/check-tracking-claim/good/README.md +7 -0
  165. package/payload/canon-kit/gate-tests/check-tracking-claim/good/args +1 -0
  166. package/payload/canon-kit/gate-tests/check-tracking-claim/good/expect.txt +1 -0
  167. package/payload/canon-kit/gate-tests/check-tracking-claim/good/kept.txt +1 -0
  168. package/payload/canon-kit/gate-tests/check-tracking-claim/good/roster.list +1 -0
  169. package/payload/canon-kit/gate-tests/check-tracking-claim.test.sh +86 -0
  170. package/payload/canon-kit/lib/spec.sh +475 -0
  171. package/payload/canon-kit/smoke/install.sh +36 -0
  172. package/payload/canon-kit/smoke/violation.sh +22 -0
  173. package/payload/canon-kit/templates/SPEC-amendment.md +55 -0
  174. package/payload/canon-kit/templates/canon-config.sh +2 -0
  175. package/payload/context-kit/README.md +82 -0
  176. package/payload/context-kit/SPEC.md +785 -0
  177. package/payload/context-kit/bin/always-loaded.sh +86 -0
  178. package/payload/context-kit/bin/env-probe.sh +144 -0
  179. package/payload/context-kit/bin/footprint.sh +144 -0
  180. package/payload/context-kit/bin/md-index.sh +80 -0
  181. package/payload/context-kit/bin/md-section.sh +63 -0
  182. package/payload/context-kit/bin/pub-index.sh +90 -0
  183. package/payload/context-kit/bin/run-index-tests.sh +91 -0
  184. package/payload/context-kit/checks/check-brevity.sh +123 -0
  185. package/payload/context-kit/checks/check-footprint-fresh.sh +38 -0
  186. package/payload/context-kit/checks/check-memory-off.sh +112 -0
  187. package/payload/context-kit/checks/check-settings-pins.sh +110 -0
  188. package/payload/context-kit/gate-tests/check-brevity/bad/CLAUDE.md +14 -0
  189. package/payload/context-kit/gate-tests/check-brevity/bad/args +2 -0
  190. package/payload/context-kit/gate-tests/check-brevity/bad/expect.txt +1 -0
  191. package/payload/context-kit/gate-tests/check-brevity/good/CLAUDE.md +20 -0
  192. package/payload/context-kit/gate-tests/check-brevity/good/args +2 -0
  193. package/payload/context-kit/gate-tests/check-brevity/good/expect.txt +1 -0
  194. package/payload/context-kit/gate-tests/check-brevity.test.sh +89 -0
  195. package/payload/context-kit/gate-tests/check-footprint-fresh/bad/args +4 -0
  196. package/payload/context-kit/gate-tests/check-footprint-fresh/bad/emit.txt +12 -0
  197. package/payload/context-kit/gate-tests/check-footprint-fresh/bad/expect.txt +1 -0
  198. package/payload/context-kit/gate-tests/check-footprint-fresh/bad/projection.txt +11 -0
  199. package/payload/context-kit/gate-tests/check-footprint-fresh/good/args +4 -0
  200. package/payload/context-kit/gate-tests/check-footprint-fresh/good/emit.txt +12 -0
  201. package/payload/context-kit/gate-tests/check-footprint-fresh/good/expect.txt +1 -0
  202. package/payload/context-kit/gate-tests/check-footprint-fresh/good/projection.txt +12 -0
  203. package/payload/context-kit/gate-tests/check-memory-off/bad/args +1 -0
  204. package/payload/context-kit/gate-tests/check-memory-off/bad/expect.txt +1 -0
  205. package/payload/context-kit/gate-tests/check-memory-off/bad/memory/example-fact.md +6 -0
  206. package/payload/context-kit/gate-tests/check-memory-off/good/args +1 -0
  207. package/payload/context-kit/gate-tests/check-memory-off/good/expect.txt +1 -0
  208. package/payload/context-kit/gate-tests/check-memory-off/good/memory/.gitkeep +0 -0
  209. package/payload/context-kit/gate-tests/check-memory-off.test.sh +54 -0
  210. package/payload/context-kit/gate-tests/check-settings-pins/bad/args +1 -0
  211. package/payload/context-kit/gate-tests/check-settings-pins/bad/expect.txt +1 -0
  212. package/payload/context-kit/gate-tests/check-settings-pins/bad/settings-pins.conf +3 -0
  213. package/payload/context-kit/gate-tests/check-settings-pins/bad/settings.json +6 -0
  214. package/payload/context-kit/gate-tests/check-settings-pins/good/args +1 -0
  215. package/payload/context-kit/gate-tests/check-settings-pins/good/expect.txt +1 -0
  216. package/payload/context-kit/gate-tests/check-settings-pins/good/settings-pins.conf +3 -0
  217. package/payload/context-kit/gate-tests/check-settings-pins/good/settings.json +6 -0
  218. package/payload/context-kit/index-tests/corpus/baseline.txt +2 -0
  219. package/payload/context-kit/index-tests/corpus/hook-sample.txt +4 -0
  220. package/payload/context-kit/index-tests/corpus/sample.md +23 -0
  221. package/payload/context-kit/index-tests/corpus/sample.rs +24 -0
  222. package/payload/context-kit/index-tests/corpus/sample.ts +34 -0
  223. package/payload/context-kit/index-tests/corpus/surface.md +6 -0
  224. package/payload/context-kit/index-tests/expected/always-loaded.txt +1 -0
  225. package/payload/context-kit/index-tests/expected/md-index.txt +6 -0
  226. package/payload/context-kit/index-tests/expected/md-section.txt +6 -0
  227. package/payload/context-kit/index-tests/expected/pub-index-shadow.txt +2 -0
  228. package/payload/context-kit/index-tests/expected/pub-index-ts.txt +12 -0
  229. package/payload/context-kit/index-tests/expected/pub-index.txt +10 -0
  230. package/payload/context-kit/index-tests/expected/toolfloor.txt +14 -0
  231. package/payload/context-kit/index-tests/toolfloor-cases.sh +29 -0
  232. package/payload/context-kit/lib/pub-lang/rust.sh +26 -0
  233. package/payload/context-kit/lib/pub-lang/ts.sh +32 -0
  234. package/payload/context-kit/lib/toolfloor.sh +47 -0
  235. package/payload/context-kit/smoke/agents-md.sh +116 -0
  236. package/payload/context-kit/smoke/install.sh +60 -0
  237. package/payload/context-kit/smoke/violation.sh +21 -0
  238. package/payload/context-kit/templates/close-brevity.md +30 -0
  239. package/payload/context-kit/templates/context-config.sh +2 -0
  240. package/payload/context-kit/templates/session-context.sh +133 -0
  241. package/payload/context-kit/templates/settings-sessionstart.json +12 -0
  242. package/payload/delegation-kit/README.md +87 -0
  243. package/payload/delegation-kit/SPEC.md +780 -0
  244. package/payload/delegation-kit/bin/run-budget-guard-tests.sh +88 -0
  245. package/payload/delegation-kit/bin/run-trend-tests.sh +63 -0
  246. package/payload/delegation-kit/bin/run-usage-tests.sh +226 -0
  247. package/payload/delegation-kit/bin/usage-trend.sh +120 -0
  248. package/payload/delegation-kit/bin/usage-verdict.sh +144 -0
  249. package/payload/delegation-kit/checks/check-gate-tamper.sh +139 -0
  250. package/payload/delegation-kit/checks/check-rule-citation.sh +76 -0
  251. package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/args +1 -0
  252. package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/expect.txt +1 -0
  253. package/payload/delegation-kit/gate-tests/check-gate-tamper/bad/staged-files +5 -0
  254. package/payload/delegation-kit/gate-tests/check-gate-tamper/good/added-exemptions +2 -0
  255. package/payload/delegation-kit/gate-tests/check-gate-tamper/good/args +1 -0
  256. package/payload/delegation-kit/gate-tests/check-gate-tamper/good/expect.txt +1 -0
  257. package/payload/delegation-kit/gate-tests/check-gate-tamper/good/staged-files +5 -0
  258. package/payload/delegation-kit/gate-tests/check-rule-citation/bad/args +1 -0
  259. package/payload/delegation-kit/gate-tests/check-rule-citation/bad/expect.txt +1 -0
  260. package/payload/delegation-kit/gate-tests/check-rule-citation/bad/spec.md +9 -0
  261. package/payload/delegation-kit/gate-tests/check-rule-citation/bad/tmpl.md +4 -0
  262. package/payload/delegation-kit/gate-tests/check-rule-citation/good/args +1 -0
  263. package/payload/delegation-kit/gate-tests/check-rule-citation/good/expect.txt +1 -0
  264. package/payload/delegation-kit/gate-tests/check-rule-citation/good/spec.md +20 -0
  265. package/payload/delegation-kit/gate-tests/check-rule-citation/good/tmpl.md +5 -0
  266. package/payload/delegation-kit/lib/delegation.sh +81 -0
  267. package/payload/delegation-kit/smoke/install.sh +61 -0
  268. package/payload/delegation-kit/smoke/violation.sh +16 -0
  269. package/payload/delegation-kit/templates/agent-budget-guard.sh +18 -0
  270. package/payload/delegation-kit/templates/agent-execution.md +136 -0
  271. package/payload/delegation-kit/templates/delegation-config.sh +2 -0
  272. package/payload/delegation-kit/templates/dispatch-checklists.md +60 -0
  273. package/payload/delegation-kit/templates/statusline-usage.sh +79 -0
  274. package/payload/delegation-kit/templates/usage-poller.sh +67 -0
  275. package/payload/delegation-kit/usage-tests/budget-guard-cases.tsv +20 -0
  276. package/payload/delegation-kit/usage-tests/cases.tsv +44 -0
  277. package/payload/delegation-kit/usage-tests/trend-history.log +20 -0
  278. package/payload/doctrine-kit/DOCTRINE.md +386 -0
  279. package/payload/doctrine-kit/README.md +70 -0
  280. package/payload/doctrine-kit/SPEC.md +233 -0
  281. package/payload/doctrine-kit/bin/install-doctrine.sh +44 -0
  282. package/payload/doctrine-kit/bin/stage-rules.sh +51 -0
  283. package/payload/doctrine-kit/checks/check-doctrine-registration.sh +216 -0
  284. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/bad/AGENT.md +14 -0
  285. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/bad/DOCTRINE.md +12 -0
  286. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/bad/args +1 -0
  287. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/bad/expect.txt +1 -0
  288. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/good/AGENT.md +15 -0
  289. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/good/DOCTRINE.md +12 -0
  290. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/good/args +1 -0
  291. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/good/expect.txt +1 -0
  292. package/payload/doctrine-kit/gate-tests/check-doctrine-registration.test.sh +208 -0
  293. package/payload/doctrine-kit/lib/doctrine.sh +29 -0
  294. package/payload/doctrine-kit/smoke/install.sh +24 -0
  295. package/payload/doctrine-kit/smoke/violation.sh +13 -0
  296. package/payload/drift-kit/README.md +115 -0
  297. package/payload/drift-kit/SPEC.md +828 -0
  298. package/payload/drift-kit/bin/drift-report.sh +152 -0
  299. package/payload/drift-kit/bin/kfric.sh +42 -0
  300. package/payload/drift-kit/bin/overhead-meter.sh +106 -0
  301. package/payload/drift-kit/bin/stage-economics.sh +311 -0
  302. package/payload/drift-kit/bin/trajectory.sh +242 -0
  303. package/payload/drift-kit/kpis/kpi-always-loaded.sh +39 -0
  304. package/payload/drift-kit/kpis/kpi-amendment-age.sh +33 -0
  305. package/payload/drift-kit/kpis/kpi-deferred-age.sh +44 -0
  306. package/payload/drift-kit/kpis/kpi-gate-backlog.sh +52 -0
  307. package/payload/drift-kit/kpis/kpi-gate-runtime.sh +31 -0
  308. package/payload/drift-kit/kpis/kpi-knowledge-friction.sh +21 -0
  309. package/payload/drift-kit/kpis/kpi-overhead.sh +44 -0
  310. package/payload/drift-kit/kpis/kpi-price-table-age.sh +68 -0
  311. package/payload/drift-kit/kpis/kpi-prompt-friction.sh +38 -0
  312. package/payload/drift-kit/kpis/kpi-settings-local.sh +21 -0
  313. package/payload/drift-kit/kpis/kpi-task-split.sh +43 -0
  314. package/payload/drift-kit/smoke/install.sh +348 -0
  315. package/payload/drift-kit/smoke/overhead-fixture.jsonl +4 -0
  316. package/payload/drift-kit/templates/close-knowledge.md +24 -0
  317. package/payload/drift-kit/templates/drift-config.sh +2 -0
  318. package/payload/drift-kit/templates/economics.md +45 -0
  319. package/payload/drift-kit/templates/kpi-deprecated-surface.sh +32 -0
  320. package/payload/drift-kit/templates/kpis.list +22 -0
  321. package/payload/drift-kit/templates/price-table.tsv +21 -0
  322. package/payload/evidence-kit/README.md +59 -0
  323. package/payload/evidence-kit/SPEC.md +261 -0
  324. package/payload/evidence-kit/bin/diff-baseline.sh +34 -0
  325. package/payload/evidence-kit/bin/run-validate.sh +82 -0
  326. package/payload/evidence-kit/checks/check-evidence-baseline.sh +103 -0
  327. package/payload/evidence-kit/checks/check-evidence-manifest.sh +104 -0
  328. package/payload/evidence-kit/gate-tests/check-evidence-baseline/bad/TASK-QUEUE.md +3 -0
  329. package/payload/evidence-kit/gate-tests/check-evidence-baseline/bad/args +2 -0
  330. package/payload/evidence-kit/gate-tests/check-evidence-baseline/bad/expect.txt +1 -0
  331. package/payload/evidence-kit/gate-tests/check-evidence-baseline/bad/validate-baseline.txt +3 -0
  332. package/payload/evidence-kit/gate-tests/check-evidence-baseline/good/TASK-QUEUE.md +3 -0
  333. package/payload/evidence-kit/gate-tests/check-evidence-baseline/good/args +2 -0
  334. package/payload/evidence-kit/gate-tests/check-evidence-baseline/good/expect.txt +1 -0
  335. package/payload/evidence-kit/gate-tests/check-evidence-baseline/good/validate-baseline.txt +3 -0
  336. package/payload/evidence-kit/gate-tests/check-evidence-baseline.test.sh +84 -0
  337. package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/TASK-QUEUE.md +1 -0
  338. package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/WORKFLOW-STATE.txt +3 -0
  339. package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/args +3 -0
  340. package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/expect.txt +1 -0
  341. package/payload/evidence-kit/gate-tests/check-evidence-manifest/bad/validate-evidence.txt +2 -0
  342. package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/TASK-QUEUE.md +1 -0
  343. package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/WORKFLOW-STATE.txt +3 -0
  344. package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/args +3 -0
  345. package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/expect.txt +1 -0
  346. package/payload/evidence-kit/gate-tests/check-evidence-manifest/good/validate-evidence.txt +2 -0
  347. package/payload/evidence-kit/gate-tests/check-evidence-manifest.test.sh +107 -0
  348. package/payload/evidence-kit/gate-tests/evidence-lib.test.sh +82 -0
  349. package/payload/evidence-kit/lib/evidence.sh +173 -0
  350. package/payload/evidence-kit/smoke/install.sh +45 -0
  351. package/payload/evidence-kit/smoke/violation.sh +8 -0
  352. package/payload/evidence-kit/templates/evidence-config.sh +2 -0
  353. package/payload/gate-sdk/README.md +124 -0
  354. package/payload/gate-sdk/SPEC.md +1861 -0
  355. package/payload/gate-sdk/bin/enforcement-map.sh +272 -0
  356. package/payload/gate-sdk/bin/gen-pre-commit.sh +267 -0
  357. package/payload/gate-sdk/bin/install-hooks.sh +48 -0
  358. package/payload/gate-sdk/bin/run-consumer-smoke.sh +112 -0
  359. package/payload/gate-sdk/bin/run-gate-tests.sh +128 -0
  360. package/payload/gate-sdk/bin/run-gates.sh +147 -0
  361. package/payload/gate-sdk/bin/upgrade-smoke.sh +163 -0
  362. package/payload/gate-sdk/checks/check-action-pinning.sh +55 -0
  363. package/payload/gate-sdk/checks/check-action-run-shell.sh +219 -0
  364. package/payload/gate-sdk/checks/check-assertion-strength.sh +134 -0
  365. package/payload/gate-sdk/checks/check-commit-msg.sh +50 -0
  366. package/payload/gate-sdk/checks/check-commit-subject.sh +43 -0
  367. package/payload/gate-sdk/checks/check-core-files.sh +52 -0
  368. package/payload/gate-sdk/checks/check-enforcement-fresh.sh +37 -0
  369. package/payload/gate-sdk/checks/check-exec-bit.sh +76 -0
  370. package/payload/gate-sdk/checks/check-gate-assertions.sh +123 -0
  371. package/payload/gate-sdk/checks/check-gate-exemption-tasks.sh +106 -0
  372. package/payload/gate-sdk/checks/check-gate-fail-closed.sh +84 -0
  373. package/payload/gate-sdk/checks/check-gate-fixture-coverage.sh +92 -0
  374. package/payload/gate-sdk/checks/check-gate-output.sh +65 -0
  375. package/payload/gate-sdk/checks/check-graph.sh +632 -0
  376. package/payload/gate-sdk/checks/check-hook-exec-bit.sh +45 -0
  377. package/payload/gate-sdk/checks/check-identity.sh +134 -0
  378. package/payload/gate-sdk/checks/check-kit-enum.sh +94 -0
  379. package/payload/gate-sdk/checks/check-kit-registration.sh +68 -0
  380. package/payload/gate-sdk/checks/check-readme-roster.sh +102 -0
  381. package/payload/gate-sdk/checks/check-reads-couples.sh +148 -0
  382. package/payload/gate-sdk/checks/check-root-tiering.sh +66 -0
  383. package/payload/gate-sdk/checks/check-shellcheck.sh +55 -0
  384. package/payload/gate-sdk/checks/check-smoke-entry-guard.sh +53 -0
  385. package/payload/gate-sdk/checks/check-template-copy-parity.sh +126 -0
  386. package/payload/gate-sdk/checks/check-test-hermetic.sh +119 -0
  387. package/payload/gate-sdk/checks/check-tree-terms.sh +61 -0
  388. package/payload/gate-sdk/checks/check-workflow-tiering.sh +84 -0
  389. package/payload/gate-sdk/gate-tests/check-action-pinning/bad/args +1 -0
  390. package/payload/gate-sdk/gate-tests/check-action-pinning/bad/expect.txt +1 -0
  391. package/payload/gate-sdk/gate-tests/check-action-pinning/bad/tree/mutable.yml +11 -0
  392. package/payload/gate-sdk/gate-tests/check-action-pinning/bad/tree/nested/pinned.yml +5 -0
  393. package/payload/gate-sdk/gate-tests/check-action-pinning/good/args +1 -0
  394. package/payload/gate-sdk/gate-tests/check-action-pinning/good/expect.txt +1 -0
  395. package/payload/gate-sdk/gate-tests/check-action-pinning/good/tree/nested/deep.yml +5 -0
  396. package/payload/gate-sdk/gate-tests/check-action-pinning/good/tree/no-refs.yaml +8 -0
  397. package/payload/gate-sdk/gate-tests/check-action-pinning/good/tree/pinned.yml +10 -0
  398. package/payload/gate-sdk/gate-tests/check-action-run-shell/bad/args +3 -0
  399. package/payload/gate-sdk/gate-tests/check-action-run-shell/bad/expect.txt +1 -0
  400. package/payload/gate-sdk/gate-tests/check-action-run-shell/bad/tree/workflows/ci.yml +15 -0
  401. package/payload/gate-sdk/gate-tests/check-action-run-shell/good/args +3 -0
  402. package/payload/gate-sdk/gate-tests/check-action-run-shell/good/expect.txt +1 -0
  403. package/payload/gate-sdk/gate-tests/check-action-run-shell/good/tree/action.yml +14 -0
  404. package/payload/gate-sdk/gate-tests/check-action-run-shell/good/tree/not-actions.yml +16 -0
  405. package/payload/gate-sdk/gate-tests/check-action-run-shell/good/tree/workflows/ci.yml +106 -0
  406. package/payload/gate-sdk/gate-tests/check-action-run-shell.test.sh +88 -0
  407. package/payload/gate-sdk/gate-tests/check-assertion-strength/bad/args +3 -0
  408. package/payload/gate-sdk/gate-tests/check-assertion-strength/bad/bin/verdict.sh +5 -0
  409. package/payload/gate-sdk/gate-tests/check-assertion-strength/bad/expect.txt +1 -0
  410. package/payload/gate-sdk/gate-tests/check-assertion-strength/bad/smoke/install.sh +11 -0
  411. package/payload/gate-sdk/gate-tests/check-assertion-strength/good/args +3 -0
  412. package/payload/gate-sdk/gate-tests/check-assertion-strength/good/bin/verdict.sh +5 -0
  413. package/payload/gate-sdk/gate-tests/check-assertion-strength/good/expect.txt +1 -0
  414. package/payload/gate-sdk/gate-tests/check-assertion-strength/good/smoke/install.sh +16 -0
  415. package/payload/gate-sdk/gate-tests/check-commit-msg/bad/args +2 -0
  416. package/payload/gate-sdk/gate-tests/check-commit-msg/bad/expect.txt +1 -0
  417. package/payload/gate-sdk/gate-tests/check-commit-msg/bad/msg.txt +5 -0
  418. package/payload/gate-sdk/gate-tests/check-commit-msg/bad/patterns.list +5 -0
  419. package/payload/gate-sdk/gate-tests/check-commit-msg/good/args +2 -0
  420. package/payload/gate-sdk/gate-tests/check-commit-msg/good/expect.txt +1 -0
  421. package/payload/gate-sdk/gate-tests/check-commit-msg/good/msg.txt +5 -0
  422. package/payload/gate-sdk/gate-tests/check-commit-msg/good/patterns.list +5 -0
  423. package/payload/gate-sdk/gate-tests/check-commit-subject/bad/args +2 -0
  424. package/payload/gate-sdk/gate-tests/check-commit-subject/bad/expect.txt +1 -0
  425. package/payload/gate-sdk/gate-tests/check-commit-subject/bad/msg.txt +4 -0
  426. package/payload/gate-sdk/gate-tests/check-commit-subject/good/args +2 -0
  427. package/payload/gate-sdk/gate-tests/check-commit-subject/good/expect.txt +1 -0
  428. package/payload/gate-sdk/gate-tests/check-commit-subject/good/msg.txt +5 -0
  429. package/payload/gate-sdk/gate-tests/check-commit-subject.test.sh +73 -0
  430. package/payload/gate-sdk/gate-tests/check-core-files/bad/args +1 -0
  431. package/payload/gate-sdk/gate-tests/check-core-files/bad/core-files.list +3 -0
  432. package/payload/gate-sdk/gate-tests/check-core-files/bad/expect.txt +1 -0
  433. package/payload/gate-sdk/gate-tests/check-core-files/bad/present.txt +1 -0
  434. package/payload/gate-sdk/gate-tests/check-core-files/good/args +1 -0
  435. package/payload/gate-sdk/gate-tests/check-core-files/good/core-files.list +5 -0
  436. package/payload/gate-sdk/gate-tests/check-core-files/good/expect.txt +1 -0
  437. package/payload/gate-sdk/gate-tests/check-core-files/good/nested/also-present.txt +1 -0
  438. package/payload/gate-sdk/gate-tests/check-core-files/good/present.txt +1 -0
  439. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/bad/args +4 -0
  440. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/bad/emit.txt +14 -0
  441. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/bad/expect.txt +1 -0
  442. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/bad/projection.txt +7 -0
  443. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/good/args +4 -0
  444. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/good/emit.txt +14 -0
  445. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/good/expect.txt +1 -0
  446. package/payload/gate-sdk/gate-tests/check-enforcement-fresh/good/projection.txt +14 -0
  447. package/payload/gate-sdk/gate-tests/check-exec-bit/bad/args +1 -0
  448. package/payload/gate-sdk/gate-tests/check-exec-bit/bad/dump.txt +7 -0
  449. package/payload/gate-sdk/gate-tests/check-exec-bit/bad/expect.txt +1 -0
  450. package/payload/gate-sdk/gate-tests/check-exec-bit/good/args +1 -0
  451. package/payload/gate-sdk/gate-tests/check-exec-bit/good/dump.txt +7 -0
  452. package/payload/gate-sdk/gate-tests/check-exec-bit/good/expect.txt +1 -0
  453. package/payload/gate-sdk/gate-tests/check-exec-bit.test.sh +46 -0
  454. package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/args +1 -0
  455. package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/expect.txt +1 -0
  456. package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/SPEC.md +13 -0
  457. package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/check-baz.sh +13 -0
  458. package/payload/gate-sdk/gate-tests/check-gate-assertions/bad/scripts/check-foo.sh +10 -0
  459. package/payload/gate-sdk/gate-tests/check-gate-assertions/good/args +1 -0
  460. package/payload/gate-sdk/gate-tests/check-gate-assertions/good/expect.txt +1 -0
  461. package/payload/gate-sdk/gate-tests/check-gate-assertions/good/scripts/SPEC.md +20 -0
  462. package/payload/gate-sdk/gate-tests/check-gate-assertions/good/scripts/check-baz.sh +12 -0
  463. package/payload/gate-sdk/gate-tests/check-gate-assertions/good/scripts/check-foo.sh +9 -0
  464. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/TASK-QUEUE.md +9 -0
  465. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/args +1 -0
  466. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/expect.txt +1 -0
  467. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/gates/check-sample.sh +11 -0
  468. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/TASK-QUEUE.md +9 -0
  469. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/args +1 -0
  470. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/expect.txt +1 -0
  471. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/gates/check-sample.sh +11 -0
  472. package/payload/gate-sdk/gate-tests/check-gate-fail-closed/bad/args +1 -0
  473. package/payload/gate-sdk/gate-tests/check-gate-fail-closed/bad/expect.txt +1 -0
  474. package/payload/gate-sdk/gate-tests/check-gate-fail-closed/bad/gates/check-sample.sh +8 -0
  475. package/payload/gate-sdk/gate-tests/check-gate-fail-closed/good/args +1 -0
  476. package/payload/gate-sdk/gate-tests/check-gate-fail-closed/good/expect.txt +1 -0
  477. package/payload/gate-sdk/gate-tests/check-gate-fail-closed/good/gates/check-sample.sh +8 -0
  478. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/args +1 -0
  479. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/check-gamma.sh +4 -0
  480. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/expect.txt +1 -0
  481. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/gate-tests/check-alpha/bad/.keep +0 -0
  482. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/gate-tests/check-alpha/good/.keep +0 -0
  483. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/bad/gates.list +4 -0
  484. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/args +1 -0
  485. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/check-beta.sh +5 -0
  486. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/expect.txt +1 -0
  487. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/gate-tests/check-alpha/bad/.keep +0 -0
  488. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/gate-tests/check-alpha/good/.keep +0 -0
  489. package/payload/gate-sdk/gate-tests/check-gate-fixture-coverage/good/gates.list +5 -0
  490. package/payload/gate-sdk/gate-tests/check-gate-output/bad/args +1 -0
  491. package/payload/gate-sdk/gate-tests/check-gate-output/bad/check-sample.sh +4 -0
  492. package/payload/gate-sdk/gate-tests/check-gate-output/bad/expect.txt +1 -0
  493. package/payload/gate-sdk/gate-tests/check-gate-output/bad/gates.list +2 -0
  494. package/payload/gate-sdk/gate-tests/check-gate-output/good/args +1 -0
  495. package/payload/gate-sdk/gate-tests/check-gate-output/good/check-sample.sh +9 -0
  496. package/payload/gate-sdk/gate-tests/check-gate-output/good/expect.txt +1 -0
  497. package/payload/gate-sdk/gate-tests/check-gate-output/good/gates.list +3 -0
  498. package/payload/gate-sdk/gate-tests/check-graph/bad/SPEC-example-gate.md +12 -0
  499. package/payload/gate-sdk/gate-tests/check-graph/bad/args +1 -0
  500. package/payload/gate-sdk/gate-tests/check-graph/bad/expect.txt +1 -0
  501. package/payload/gate-sdk/gate-tests/check-graph/good/SPEC-example-gate.md +20 -0
  502. package/payload/gate-sdk/gate-tests/check-graph/good/args +3 -0
  503. package/payload/gate-sdk/gate-tests/check-graph/good/expect.txt +1 -0
  504. package/payload/gate-sdk/gate-tests/check-graph-cap.test.sh +51 -0
  505. package/payload/gate-sdk/gate-tests/check-graph-refs.test.sh +55 -0
  506. package/payload/gate-sdk/gate-tests/check-graph-theme.test.sh +63 -0
  507. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/bad/args +1 -0
  508. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/bad/expect.txt +1 -0
  509. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/bad/hooks/pre-commit +2 -0
  510. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/good/args +1 -0
  511. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/good/expect.txt +1 -0
  512. package/payload/gate-sdk/gate-tests/check-hook-exec-bit/good/hooks/pre-commit +2 -0
  513. package/payload/gate-sdk/gate-tests/check-identity/bad/args +1 -0
  514. package/payload/gate-sdk/gate-tests/check-identity/bad/expect.txt +1 -0
  515. package/payload/gate-sdk/gate-tests/check-identity/bad/git-config-email +1 -0
  516. package/payload/gate-sdk/gate-tests/check-identity/bad/git-remotes +2 -0
  517. package/payload/gate-sdk/gate-tests/check-identity/bad/identity.conf +4 -0
  518. package/payload/gate-sdk/gate-tests/check-identity/good/args +1 -0
  519. package/payload/gate-sdk/gate-tests/check-identity/good/expect.txt +1 -0
  520. package/payload/gate-sdk/gate-tests/check-identity/good/git-config-email +1 -0
  521. package/payload/gate-sdk/gate-tests/check-identity/good/git-remotes +3 -0
  522. package/payload/gate-sdk/gate-tests/check-identity/good/identity.conf +5 -0
  523. package/payload/gate-sdk/gate-tests/check-kit-enum/bad/args +1 -0
  524. package/payload/gate-sdk/gate-tests/check-kit-enum/bad/check-sample.sh +5 -0
  525. package/payload/gate-sdk/gate-tests/check-kit-enum/bad/expect.txt +1 -0
  526. package/payload/gate-sdk/gate-tests/check-kit-enum/bad/gates.list +4 -0
  527. package/payload/gate-sdk/gate-tests/check-kit-enum/good/args +1 -0
  528. package/payload/gate-sdk/gate-tests/check-kit-enum/good/check-sample.sh +5 -0
  529. package/payload/gate-sdk/gate-tests/check-kit-enum/good/expect.txt +1 -0
  530. package/payload/gate-sdk/gate-tests/check-kit-enum/good/gates.list +3 -0
  531. package/payload/gate-sdk/gate-tests/check-kit-registration/bad/args +4 -0
  532. package/payload/gate-sdk/gate-tests/check-kit-registration/bad/expect.txt +1 -0
  533. package/payload/gate-sdk/gate-tests/check-kit-registration/bad/registry-doc.md +20 -0
  534. package/payload/gate-sdk/gate-tests/check-kit-registration/good/args +5 -0
  535. package/payload/gate-sdk/gate-tests/check-kit-registration/good/expect.txt +1 -0
  536. package/payload/gate-sdk/gate-tests/check-kit-registration.test.sh +75 -0
  537. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/alpha-kit/README.md +14 -0
  538. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/alpha-kit/checks/check-alpha-one.sh +3 -0
  539. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/alpha-kit/checks/check-alpha-two.sh +3 -0
  540. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/args +4 -0
  541. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/expect.txt +1 -0
  542. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/gamma-kit/README.md +5 -0
  543. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/gamma-kit/checks/check-gamma-one.sh +3 -0
  544. package/payload/gate-sdk/gate-tests/check-readme-roster/bad/scripts/gate-sdk-config.sh +5 -0
  545. package/payload/gate-sdk/gate-tests/check-readme-roster/good/alpha-kit/README.md +16 -0
  546. package/payload/gate-sdk/gate-tests/check-readme-roster/good/alpha-kit/checks/check-alpha-one.sh +3 -0
  547. package/payload/gate-sdk/gate-tests/check-readme-roster/good/alpha-kit/checks/check-alpha-two.sh +3 -0
  548. package/payload/gate-sdk/gate-tests/check-readme-roster/good/args +6 -0
  549. package/payload/gate-sdk/gate-tests/check-readme-roster/good/beta-kit/smoke/install.sh +3 -0
  550. package/payload/gate-sdk/gate-tests/check-readme-roster/good/expect.txt +1 -0
  551. package/payload/gate-sdk/gate-tests/check-readme-roster/good/scripts/gate-sdk-config.sh +5 -0
  552. package/payload/gate-sdk/gate-tests/check-reads-couples/bad/args +2 -0
  553. package/payload/gate-sdk/gate-tests/check-reads-couples/bad/corpus/sub/deep.md +1 -0
  554. package/payload/gate-sdk/gate-tests/check-reads-couples/bad/corpus/top.md +1 -0
  555. package/payload/gate-sdk/gate-tests/check-reads-couples/bad/expect.txt +1 -0
  556. package/payload/gate-sdk/gate-tests/check-reads-couples/bad/sandbox-gate.sh +6 -0
  557. package/payload/gate-sdk/gate-tests/check-reads-couples/good/args +3 -0
  558. package/payload/gate-sdk/gate-tests/check-reads-couples/good/corpus/sub/deep.md +1 -0
  559. package/payload/gate-sdk/gate-tests/check-reads-couples/good/corpus/top.md +1 -0
  560. package/payload/gate-sdk/gate-tests/check-reads-couples/good/expect.txt +1 -0
  561. package/payload/gate-sdk/gate-tests/check-reads-couples/good/sandbox-gate.sh +8 -0
  562. package/payload/gate-sdk/gate-tests/check-root-tiering/bad/allow.list +1 -0
  563. package/payload/gate-sdk/gate-tests/check-root-tiering/bad/args +1 -0
  564. package/payload/gate-sdk/gate-tests/check-root-tiering/bad/expect.txt +1 -0
  565. package/payload/gate-sdk/gate-tests/check-root-tiering/bad/root/README.md +1 -0
  566. package/payload/gate-sdk/gate-tests/check-root-tiering/bad/root/stray.txt +1 -0
  567. package/payload/gate-sdk/gate-tests/check-root-tiering/good/allow.list +3 -0
  568. package/payload/gate-sdk/gate-tests/check-root-tiering/good/args +1 -0
  569. package/payload/gate-sdk/gate-tests/check-root-tiering/good/expect.txt +1 -0
  570. package/payload/gate-sdk/gate-tests/check-root-tiering/good/root/LICENSE +1 -0
  571. package/payload/gate-sdk/gate-tests/check-root-tiering/good/root/README.md +1 -0
  572. package/payload/gate-sdk/gate-tests/check-root-tiering/good/root/somedir/keep.txt +1 -0
  573. package/payload/gate-sdk/gate-tests/check-shellcheck/bad/args +1 -0
  574. package/payload/gate-sdk/gate-tests/check-shellcheck/bad/expect.txt +1 -0
  575. package/payload/gate-sdk/gate-tests/check-shellcheck/bad/warn.sh +5 -0
  576. package/payload/gate-sdk/gate-tests/check-shellcheck/good/args +1 -0
  577. package/payload/gate-sdk/gate-tests/check-shellcheck/good/expect.txt +1 -0
  578. package/payload/gate-sdk/gate-tests/check-shellcheck/good/ok.sh +4 -0
  579. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/bad/alpha-kit/smoke/install.sh +4 -0
  580. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/bad/alpha-kit/smoke/violation.sh +7 -0
  581. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/bad/args +4 -0
  582. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/bad/expect.txt +1 -0
  583. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/bad/scripts/gate-sdk-config.sh +5 -0
  584. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/good/alpha-kit/smoke/install.sh +4 -0
  585. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/good/alpha-kit/smoke/violation.sh +4 -0
  586. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/good/args +6 -0
  587. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/good/beta-kit/smoke/install.sh +4 -0
  588. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/good/expect.txt +1 -0
  589. package/payload/gate-sdk/gate-tests/check-smoke-entry-guard/good/scripts/gate-sdk-config.sh +5 -0
  590. package/payload/gate-sdk/gate-tests/check-template-copy-parity/bad/args +9 -0
  591. package/payload/gate-sdk/gate-tests/check-template-copy-parity/bad/delegation-kit/templates/agent-budget-guard.sh +16 -0
  592. package/payload/gate-sdk/gate-tests/check-template-copy-parity/bad/expect.txt +1 -0
  593. package/payload/gate-sdk/gate-tests/check-template-copy-parity/bad/scripts/agent-budget-guard.sh +17 -0
  594. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/args +8 -0
  595. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/delegation-kit/templates/agent-budget-guard.sh +16 -0
  596. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/delegation-kit/templates/delegation-config.sh +3 -0
  597. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/delegation-kit/templates/usage-poller.sh +6 -0
  598. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/expect.txt +1 -0
  599. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/scripts/agent-budget-guard.sh +16 -0
  600. package/payload/gate-sdk/gate-tests/check-template-copy-parity/good/scripts/delegation-config.sh +4 -0
  601. package/payload/gate-sdk/gate-tests/check-test-hermetic/bad/args +3 -0
  602. package/payload/gate-sdk/gate-tests/check-test-hermetic/bad/expect.txt +1 -0
  603. package/payload/gate-sdk/gate-tests/check-test-hermetic/bad/leaky.test.sh +5 -0
  604. package/payload/gate-sdk/gate-tests/check-test-hermetic/good/args +3 -0
  605. package/payload/gate-sdk/gate-tests/check-test-hermetic/good/exempt.test.sh +4 -0
  606. package/payload/gate-sdk/gate-tests/check-test-hermetic/good/expect.txt +1 -0
  607. package/payload/gate-sdk/gate-tests/check-test-hermetic/good/sourced.test.sh +5 -0
  608. package/payload/gate-sdk/gate-tests/check-test-hermetic-smoke.test.sh +84 -0
  609. package/payload/gate-sdk/gate-tests/check-tree-terms/bad/args +2 -0
  610. package/payload/gate-sdk/gate-tests/check-tree-terms/bad/expect.txt +1 -0
  611. package/payload/gate-sdk/gate-tests/check-tree-terms/bad/patterns.list +3 -0
  612. package/payload/gate-sdk/gate-tests/check-tree-terms/bad/tree/leak.txt +1 -0
  613. package/payload/gate-sdk/gate-tests/check-tree-terms/good/args +2 -0
  614. package/payload/gate-sdk/gate-tests/check-tree-terms/good/expect.txt +1 -0
  615. package/payload/gate-sdk/gate-tests/check-tree-terms/good/patterns.list +3 -0
  616. package/payload/gate-sdk/gate-tests/check-tree-terms/good/tree/clean.txt +1 -0
  617. package/payload/gate-sdk/gate-tests/check-workflow-tiering/bad/.workflow/payload.txt +1 -0
  618. package/payload/gate-sdk/gate-tests/check-workflow-tiering/bad/.workflow/projection.txt +1 -0
  619. package/payload/gate-sdk/gate-tests/check-workflow-tiering/bad/expect.txt +1 -0
  620. package/payload/gate-sdk/gate-tests/check-workflow-tiering/good/.workflow/projection.txt +1 -0
  621. package/payload/gate-sdk/gate-tests/check-workflow-tiering/good/.workflow/wire.txt +1 -0
  622. package/payload/gate-sdk/gate-tests/check-workflow-tiering/good/expect.txt +1 -0
  623. package/payload/gate-sdk/gate-tests/enforcement-map.test.sh +87 -0
  624. package/payload/gate-sdk/gate-tests/lib-gate.test.sh +78 -0
  625. package/payload/gate-sdk/gate-tests/run-for-path.test.sh +77 -0
  626. package/payload/gate-sdk/lib/consumer-smoke.sh +32 -0
  627. package/payload/gate-sdk/lib/gate.sh +216 -0
  628. package/payload/gate-sdk/lib/inject.sh +35 -0
  629. package/payload/gate-sdk/lib/test-hermetic.sh +11 -0
  630. package/payload/gate-sdk/smoke/install.sh +84 -0
  631. package/payload/gate-sdk/smoke/violation.sh +13 -0
  632. package/payload/gate-sdk/templates/check-skeleton.sh +23 -0
  633. package/payload/gate-sdk/templates/gates-workflow.yml +55 -0
  634. package/payload/gate-sdk/templates/msg-patterns.list +21 -0
  635. package/payload/guard-kit/README.md +65 -0
  636. package/payload/guard-kit/SPEC.md +590 -0
  637. package/payload/guard-kit/bin/compare-settings-allow.sh +58 -0
  638. package/payload/guard-kit/bin/run-guard-tests.sh +86 -0
  639. package/payload/guard-kit/bin/scan-prompts.sh +166 -0
  640. package/payload/guard-kit/bin/scratch-run.sh +34 -0
  641. package/payload/guard-kit/gate-tests/scan-prompts.test.sh +70 -0
  642. package/payload/guard-kit/gate-tests/scratch-run.test.sh +62 -0
  643. package/payload/guard-kit/guard-tests/cases.tsv +117 -0
  644. package/payload/guard-kit/guard-tests/escalation-cases.tsv +13 -0
  645. package/payload/guard-kit/lib/guard.sh +448 -0
  646. package/payload/guard-kit/smoke/install.sh +26 -0
  647. package/payload/guard-kit/templates/bash-guard.sh +18 -0
  648. package/payload/guard-kit/templates/close-triage.md +31 -0
  649. package/payload/guard-kit/templates/escalation-guard.sh +27 -0
  650. package/payload/guard-kit/templates/guard-config.sh +2 -0
  651. package/payload/guard-kit/templates/settings-hooks.json +19 -0
  652. package/payload/guard-kit/templates/wakeup-guard.sh +20 -0
  653. package/payload/lifecycle-kit/README.md +106 -0
  654. package/payload/lifecycle-kit/SPEC.md +1469 -0
  655. package/payload/lifecycle-kit/bin/close-surfaces.sh +94 -0
  656. package/payload/lifecycle-kit/bin/enter-stage.sh +215 -0
  657. package/payload/lifecycle-kit/bin/file-gap.sh +43 -0
  658. package/payload/lifecycle-kit/bin/install-lifecycle.sh +36 -0
  659. package/payload/lifecycle-kit/bin/session-id.sh +75 -0
  660. package/payload/lifecycle-kit/checks/check-close-surfaces.sh +63 -0
  661. package/payload/lifecycle-kit/checks/check-lesson-disposition.sh +98 -0
  662. package/payload/lifecycle-kit/checks/check-lifecycle-registration.sh +54 -0
  663. package/payload/lifecycle-kit/checks/check-merge-attrs.sh +69 -0
  664. package/payload/lifecycle-kit/checks/check-shim-restatement.sh +97 -0
  665. package/payload/lifecycle-kit/checks/check-skill-binding.sh +59 -0
  666. package/payload/lifecycle-kit/checks/check-stage-entry.sh +197 -0
  667. package/payload/lifecycle-kit/checks/check-stage-evidence.sh +81 -0
  668. package/payload/lifecycle-kit/checks/check-stage-skill-coverage.sh +47 -0
  669. package/payload/lifecycle-kit/gate-tests/boundary-scratch-wipe.test.sh +96 -0
  670. package/payload/lifecycle-kit/gate-tests/check-close-surfaces/bad/args +1 -0
  671. package/payload/lifecycle-kit/gate-tests/check-close-surfaces/bad/expect.txt +1 -0
  672. package/payload/lifecycle-kit/gate-tests/check-close-surfaces/bad/owners/inbox.md +5 -0
  673. package/payload/lifecycle-kit/gate-tests/check-close-surfaces/bad/scripts/lifecycle-config.sh +4 -0
  674. package/payload/lifecycle-kit/gate-tests/check-close-surfaces/good/args +1 -0
  675. package/payload/lifecycle-kit/gate-tests/check-close-surfaces/good/expect.txt +1 -0
  676. package/payload/lifecycle-kit/gate-tests/check-close-surfaces/good/owners/inbox.md +5 -0
  677. package/payload/lifecycle-kit/gate-tests/check-close-surfaces/good/scripts/lifecycle-config.sh +4 -0
  678. package/payload/lifecycle-kit/gate-tests/check-close-surfaces.test.sh +66 -0
  679. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/bad/args +2 -0
  680. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/bad/evidence.txt +2 -0
  681. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/bad/expect.txt +1 -0
  682. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/bad/queue-head.md +8 -0
  683. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/bad/queue-work.md +5 -0
  684. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/good/args +2 -0
  685. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/good/evidence.txt +3 -0
  686. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/good/expect.txt +1 -0
  687. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/good/queue-head.md +8 -0
  688. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition/good/queue-work.md +5 -0
  689. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition.test.sh +56 -0
  690. package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration/bad/AGENT.md +11 -0
  691. package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration/bad/args +1 -0
  692. package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration/bad/expect.txt +1 -0
  693. package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration/good/AGENT.md +11 -0
  694. package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration/good/args +1 -0
  695. package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration/good/expect.txt +1 -0
  696. package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration.test.sh +59 -0
  697. package/payload/lifecycle-kit/gate-tests/check-merge-attrs/bad/.gitattributes +6 -0
  698. package/payload/lifecycle-kit/gate-tests/check-merge-attrs/bad/expect.txt +1 -0
  699. package/payload/lifecycle-kit/gate-tests/check-merge-attrs/good/.gitattributes +5 -0
  700. package/payload/lifecycle-kit/gate-tests/check-merge-attrs/good/expect.txt +1 -0
  701. package/payload/lifecycle-kit/gate-tests/check-merge-attrs.test.sh +113 -0
  702. package/payload/lifecycle-kit/gate-tests/check-shim-restatement/bad/args +2 -0
  703. package/payload/lifecycle-kit/gate-tests/check-shim-restatement/bad/commands/build.md +6 -0
  704. package/payload/lifecycle-kit/gate-tests/check-shim-restatement/bad/corpus.md +4 -0
  705. package/payload/lifecycle-kit/gate-tests/check-shim-restatement/bad/expect.txt +1 -0
  706. package/payload/lifecycle-kit/gate-tests/check-shim-restatement/good/args +2 -0
  707. package/payload/lifecycle-kit/gate-tests/check-shim-restatement/good/commands/build.md +5 -0
  708. package/payload/lifecycle-kit/gate-tests/check-shim-restatement/good/corpus.md +4 -0
  709. package/payload/lifecycle-kit/gate-tests/check-shim-restatement/good/expect.txt +1 -0
  710. package/payload/lifecycle-kit/gate-tests/check-shim-restatement.test.sh +80 -0
  711. package/payload/lifecycle-kit/gate-tests/check-skill-binding/bad/args +1 -0
  712. package/payload/lifecycle-kit/gate-tests/check-skill-binding/bad/commands/build.md +5 -0
  713. package/payload/lifecycle-kit/gate-tests/check-skill-binding/bad/expect.txt +1 -0
  714. package/payload/lifecycle-kit/gate-tests/check-skill-binding/bad/templates/build.md +7 -0
  715. package/payload/lifecycle-kit/gate-tests/check-skill-binding/good/args +1 -0
  716. package/payload/lifecycle-kit/gate-tests/check-skill-binding/good/commands/build.md +7 -0
  717. package/payload/lifecycle-kit/gate-tests/check-skill-binding/good/expect.txt +1 -0
  718. package/payload/lifecycle-kit/gate-tests/check-skill-binding/good/templates/build.md +7 -0
  719. package/payload/lifecycle-kit/gate-tests/check-skill-binding.test.sh +84 -0
  720. package/payload/lifecycle-kit/gate-tests/check-stage-entry/bad/.workflow/WORKFLOW-STATE.txt +7 -0
  721. package/payload/lifecycle-kit/gate-tests/check-stage-entry/bad/TASK-QUEUE.md +13 -0
  722. package/payload/lifecycle-kit/gate-tests/check-stage-entry/bad/expect.txt +1 -0
  723. package/payload/lifecycle-kit/gate-tests/check-stage-entry/good/.workflow/WORKFLOW-STATE.txt +7 -0
  724. package/payload/lifecycle-kit/gate-tests/check-stage-entry/good/TASK-QUEUE.md +13 -0
  725. package/payload/lifecycle-kit/gate-tests/check-stage-entry/good/expect.txt +1 -0
  726. package/payload/lifecycle-kit/gate-tests/check-stage-entry.test.sh +251 -0
  727. package/payload/lifecycle-kit/gate-tests/check-stage-evidence/bad/.workflow/WORKFLOW-STATE.txt +6 -0
  728. package/payload/lifecycle-kit/gate-tests/check-stage-evidence/bad/TASK-QUEUE.md +13 -0
  729. package/payload/lifecycle-kit/gate-tests/check-stage-evidence/bad/expect.txt +1 -0
  730. package/payload/lifecycle-kit/gate-tests/check-stage-evidence/good/.workflow/WORKFLOW-STATE.txt +6 -0
  731. package/payload/lifecycle-kit/gate-tests/check-stage-evidence/good/TASK-QUEUE.md +13 -0
  732. package/payload/lifecycle-kit/gate-tests/check-stage-evidence/good/expect.txt +1 -0
  733. package/payload/lifecycle-kit/gate-tests/check-stage-evidence.test.sh +115 -0
  734. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/args +1 -0
  735. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/commands/align.md +2 -0
  736. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/commands/build.md +2 -0
  737. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/commands/scope.md +2 -0
  738. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/commands/validate.md +2 -0
  739. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/bad/expect.txt +1 -0
  740. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/args +1 -0
  741. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/commands/align.md +2 -0
  742. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/commands/build.md +2 -0
  743. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/commands/close.md +2 -0
  744. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/commands/scope.md +2 -0
  745. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/commands/validate.md +2 -0
  746. package/payload/lifecycle-kit/gate-tests/check-stage-skill-coverage/good/expect.txt +1 -0
  747. package/payload/lifecycle-kit/lib/stages.sh +179 -0
  748. package/payload/lifecycle-kit/smoke/install.sh +341 -0
  749. package/payload/lifecycle-kit/smoke/violation.sh +8 -0
  750. package/payload/lifecycle-kit/templates/lead.md +271 -0
  751. package/payload/lifecycle-kit/templates/lifecycle-config.sh +2 -0
  752. package/payload/lifecycle-kit/templates/skills/align.md +65 -0
  753. package/payload/lifecycle-kit/templates/skills/build.md +78 -0
  754. package/payload/lifecycle-kit/templates/skills/close.md +122 -0
  755. package/payload/lifecycle-kit/templates/skills/release-sweep.md +39 -0
  756. package/payload/lifecycle-kit/templates/skills/scope.md +112 -0
  757. package/payload/lifecycle-kit/templates/skills/spec.md +91 -0
  758. package/payload/lifecycle-kit/templates/skills/upgrade.md +41 -0
  759. package/payload/lifecycle-kit/templates/skills/validate.md +54 -0
  760. package/payload/queue-kit/README.md +62 -0
  761. package/payload/queue-kit/SPEC.md +366 -0
  762. package/payload/queue-kit/bin/lesson-sink.sh +28 -0
  763. package/payload/queue-kit/bin/queue-index.sh +131 -0
  764. package/payload/queue-kit/checks/check-queue-hygiene.sh +81 -0
  765. package/payload/queue-kit/checks/check-queue-prose-precondition.sh +63 -0
  766. package/payload/queue-kit/checks/check-queue-sections.sh +44 -0
  767. package/payload/queue-kit/checks/check-queue-slug-liveness.sh +63 -0
  768. package/payload/queue-kit/checks/check-queue-wrap.sh +56 -0
  769. package/payload/queue-kit/checks/check-tag-lead-line.sh +66 -0
  770. package/payload/queue-kit/checks/check-task-conservation.sh +50 -0
  771. package/payload/queue-kit/checks/check-task-names.sh +128 -0
  772. package/payload/queue-kit/gate-tests/check-queue-hygiene/bad/TASK-QUEUE.md +17 -0
  773. package/payload/queue-kit/gate-tests/check-queue-hygiene/bad/expect.txt +1 -0
  774. package/payload/queue-kit/gate-tests/check-queue-hygiene/good/TASK-QUEUE.md +25 -0
  775. package/payload/queue-kit/gate-tests/check-queue-hygiene/good/expect.txt +1 -0
  776. package/payload/queue-kit/gate-tests/check-queue-prose-precondition/bad/TASK-QUEUE.md +15 -0
  777. package/payload/queue-kit/gate-tests/check-queue-prose-precondition/bad/expect.txt +1 -0
  778. package/payload/queue-kit/gate-tests/check-queue-prose-precondition/good/TASK-QUEUE.md +25 -0
  779. package/payload/queue-kit/gate-tests/check-queue-prose-precondition/good/expect.txt +1 -0
  780. package/payload/queue-kit/gate-tests/check-queue-sections/bad/TASK-QUEUE.md +13 -0
  781. package/payload/queue-kit/gate-tests/check-queue-sections/bad/expect.txt +1 -0
  782. package/payload/queue-kit/gate-tests/check-queue-sections/good/TASK-QUEUE.md +15 -0
  783. package/payload/queue-kit/gate-tests/check-queue-sections/good/expect.txt +1 -0
  784. package/payload/queue-kit/gate-tests/check-queue-slug-liveness/bad/TASK-QUEUE.md +17 -0
  785. package/payload/queue-kit/gate-tests/check-queue-slug-liveness/bad/docs/page.md +4 -0
  786. package/payload/queue-kit/gate-tests/check-queue-slug-liveness/bad/expect.txt +1 -0
  787. package/payload/queue-kit/gate-tests/check-queue-slug-liveness/bad/scripts/queue-config.sh +3 -0
  788. package/payload/queue-kit/gate-tests/check-queue-slug-liveness/good/TASK-QUEUE.md +19 -0
  789. package/payload/queue-kit/gate-tests/check-queue-slug-liveness/good/docs/page.md +5 -0
  790. package/payload/queue-kit/gate-tests/check-queue-slug-liveness/good/expect.txt +1 -0
  791. package/payload/queue-kit/gate-tests/check-queue-slug-liveness/good/scripts/queue-config.sh +3 -0
  792. package/payload/queue-kit/gate-tests/check-queue-wrap/bad/TASK-QUEUE.md +15 -0
  793. package/payload/queue-kit/gate-tests/check-queue-wrap/bad/expect.txt +1 -0
  794. package/payload/queue-kit/gate-tests/check-queue-wrap/good/TASK-QUEUE.md +25 -0
  795. package/payload/queue-kit/gate-tests/check-queue-wrap/good/expect.txt +1 -0
  796. package/payload/queue-kit/gate-tests/check-tag-lead-line/bad/TASK-QUEUE.md +22 -0
  797. package/payload/queue-kit/gate-tests/check-tag-lead-line/bad/expect.txt +1 -0
  798. package/payload/queue-kit/gate-tests/check-tag-lead-line/good/TASK-QUEUE.md +29 -0
  799. package/payload/queue-kit/gate-tests/check-tag-lead-line/good/expect.txt +1 -0
  800. package/payload/queue-kit/gate-tests/check-task-names/bad/TASK-QUEUE.md +18 -0
  801. package/payload/queue-kit/gate-tests/check-task-names/bad/expect.txt +1 -0
  802. package/payload/queue-kit/gate-tests/check-task-names/good/TASK-QUEUE.md +25 -0
  803. package/payload/queue-kit/gate-tests/check-task-names/good/expect.txt +1 -0
  804. package/payload/queue-kit/gate-tests/queue-index.test.sh +118 -0
  805. package/payload/queue-kit/lib/queue.sh +107 -0
  806. package/payload/queue-kit/smoke/install.sh +21 -0
  807. package/payload/queue-kit/smoke/violation.sh +8 -0
  808. package/payload/queue-kit/templates/TASK-QUEUE.md +43 -0
  809. package/payload/queue-kit/templates/queue-config.sh +2 -0
  810. package/payload/site-kit/README.md +61 -0
  811. package/payload/site-kit/SPEC.md +263 -0
  812. package/payload/site-kit/checks/check-docs-cname-parity.sh +80 -0
  813. package/payload/site-kit/checks/check-docs-render-fidelity.sh +167 -0
  814. package/payload/site-kit/gate-tests/check-docs-cname-parity/bad/args +4 -0
  815. package/payload/site-kit/gate-tests/check-docs-cname-parity/bad/expect.txt +1 -0
  816. package/payload/site-kit/gate-tests/check-docs-cname-parity/bad/site-config.sh +7 -0
  817. package/payload/site-kit/gate-tests/check-docs-cname-parity/bad/tree/CNAME +1 -0
  818. package/payload/site-kit/gate-tests/check-docs-cname-parity/bad/tree/README.md +5 -0
  819. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/args +5 -0
  820. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/expect.txt +1 -0
  821. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/site-config.sh +7 -0
  822. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/tree/CNAME +1 -0
  823. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/tree/docs/posts/2026-01-01-legacy.md +4 -0
  824. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/tree/index.md +4 -0
  825. package/payload/site-kit/gate-tests/check-docs-cname-parity/good/tree/pkg/gate-tests/fixture.md +5 -0
  826. package/payload/site-kit/gate-tests/check-docs-render-fidelity/bad/args +8 -0
  827. package/payload/site-kit/gate-tests/check-docs-render-fidelity/bad/expect.txt +1 -0
  828. package/payload/site-kit/gate-tests/check-docs-render-fidelity/bad/tree/docs/install.md +38 -0
  829. package/payload/site-kit/gate-tests/check-docs-render-fidelity/good/args +6 -0
  830. package/payload/site-kit/gate-tests/check-docs-render-fidelity/good/expect.txt +1 -0
  831. package/payload/site-kit/gate-tests/check-docs-render-fidelity/good/tree/docs/install.md +35 -0
  832. package/payload/site-kit/gate-tests/check-docs-render-fidelity-foreign.test.sh +87 -0
  833. package/payload/site-kit/gate-tests/check-docs-render-fidelity-span.test.sh +80 -0
  834. package/payload/site-kit/gate-tests/check-docs-render-fidelity-table.test.sh +90 -0
  835. package/payload/site-kit/lib/site.sh +29 -0
  836. package/payload/site-kit/smoke/install.sh +26 -0
  837. package/payload/site-kit/smoke/violation.sh +20 -0
  838. package/payload/site-kit/templates/site-health.yml +164 -0
  839. package/profiles.list +53 -0
@@ -0,0 +1,785 @@
1
+ # context-kit — token-economics-aware context management
2
+
3
+ A stateless agent session pays for context twice. On-demand cost: opening a
4
+ large SPEC or source file whole when only one section was needed. Standing
5
+ cost: the always-loaded surface — everything injected into *every* session
6
+ (the instructions file, the session-start hook output) — where each added
7
+ line is a recurring per-session tax that grows silently, because no single
8
+ session ever sees the trend. The kit attacks both: an index-first reading
9
+ toolset, a session-start hook template that assembles a compact brief, a
10
+ meter that tracks the always-loaded surface against a per-iteration
11
+ baseline, a brevity gate over the densest always-loaded section, the
12
+ close-stage brevity pass that reacts to the meter's delta, and a memory-off
13
+ gate pair that keeps the ungoverned harness-memory surface disabled rather
14
+ than left to accrete.
15
+
16
+ The kit carries the index mechanism, the hook skeleton, the meter, the
17
+ brevity machinery, and the memory-off enforcement; a consumer's product-shaped
18
+ surfaces (proto and diagram indexes, its doc roster, its harvest pipeline)
19
+ stay in the consumer repo (§Out of scope).
20
+
21
+ ## Index-first reading
22
+
23
+ "Index, then read the one you need" — the pattern every tool serves. All
24
+ three are advisory `bin/` tools; none joins `gates.list`.
25
+
26
+ - **`md-index.sh [paths…]`** — compact structural index for Markdown:
27
+ heading hierarchy with line numbers, each heading followed by its
28
+ section's first sentence, plus a per-file line count (the cost signal —
29
+ whether to read whole or by section). Defaults to the whole tree,
30
+ skipping `.git/`, `node_modules/`, and build dirs.
31
+ - **`md-section.sh <file> <heading>`** — prints one section, from the
32
+ matched heading to the next heading of the same or higher level. Match
33
+ is case-insensitive and tolerates a leading `§` (so a spec citation
34
+ pastes directly); headings inside fenced code blocks are not mistaken
35
+ for structure. The companion: find the heading in the index, extract
36
+ just that body.
37
+ - **`pub-index.sh [paths…]`** — compact public API surface: every public
38
+ item with kind, name, and line, sorted by kind then name, in a per-file
39
+ block headed by a count. It is a **dispatcher over per-language
40
+ extractors**: the dispatcher owns traversal (the prune set is `.git`,
41
+ `target`, `node_modules`, `dist`, `build`), the kind-then-name sort, and
42
+ the row formatting (the index-tests goldens assert the exact shape); each
43
+ extractor is a sourced bash file
44
+ defining exactly two names — a `PUB_LANG_GLOBS` array (the find globs, e.g.
45
+ `*.rs`) and a `pub_lang_extract <file>` function emitting unsorted
46
+ `kind name lineno` rows. Two names, both read every run; no other
47
+ extractor-file surface is contract.
48
+
49
+ Extractors resolve registry-style (the `gates.list` consumer-first
50
+ precedent): a shipped extractor lives at `lib/pub-lang/<lang>.sh`, and a
51
+ consumer extractor of the same basename under `CONTEXT_KIT_PUB_LANG_DIR`
52
+ (default `${GATE_SDK_GATES_DIR:-scripts}/pub-lang`) shadows it. The enabled
53
+ set is `CONTEXT_KIT_PUB_LANGS`, whose default is every shipped extractor,
54
+ derived from the `lib/pub-lang/` roster at run time — never maintained as a
55
+ list (derivation-first). Both knobs are read through the consumer config
56
+ seam (`context-config.sh`), which the tool sources like the meter and the
57
+ footprint do.
58
+
59
+ Two extractors ship: `rust.sh` (every `pub`/`pub(crate)`/`pub(super)` item —
60
+ the grep-grade grammar the tool has always carried) and `ts.sh`
61
+ (TypeScript: `export`-declared `function`/`class`/`interface`/`type`/`enum`/
62
+ `const`/`let`/`var`, `const enum`, and `export default`, over `*.ts` and
63
+ `*.tsx` with `.d.ts` included as public surface by construction). Both are
64
+ grep-grade: re-exports (`export { x } from`) and multi-line declarations are
65
+ stated honest limits, not parsed. The dispatcher shipped when demand named
66
+ it — a second adopter's tree carries a TypeScript surface its Rust-only copy
67
+ could not index — not before: an unrequested plugin framework would have
68
+ been scaffolding, and AST/tree-sitter parsing is above the tool's grep-grade
69
+ portability altitude (bare bash + coreutils, Tier one).
70
+
71
+ ## The session-context hook (template)
72
+
73
+ `templates/session-context.sh` is a consumer copy (the `bash-guard.sh`
74
+ pattern): wired as the harness's session-start hook via
75
+ `templates/settings-sessionstart.json`, it assembles the session brief.
76
+ Every step is guarded and degrades silently — the hook never fails a
77
+ session. Steps, in order:
78
+
79
+ 1. **Queue index** — via queue-kit's `queue-index.sh`, collapsing the
80
+ Deferred section to a tally except on the close and scope stages. The stage
81
+ it routes on comes from the cursor — `CONTEXT_KIT_STATE_FILE`'s last data
82
+ line — with an empty cursor (no such file, or one truncated to its preamble
83
+ at an iteration boundary) taking the collapsed branch every non-close,
84
+ non-scope stage already takes, so the no-cursor window needs no branch of
85
+ its own and can never fail the session.
86
+ Deferred is unpickable and only scope (promotion) acts on it; the full
87
+ board additionally serves close's backlog review, and — by the
88
+ cursor-lag rule below — firing on close is what hands the full board to
89
+ the first scope session, which reads `close` at session start. On any
90
+ other stage the full listing is pure recurring cost.
91
+ 2. **Dirty-surface pre-run** — for each component with uncommitted
92
+ changes, pre-run the matching surface index (default: `pub-index` over
93
+ top-level dirs containing `src/`), so a resumed session's editing
94
+ surface is already in context. Component detection and the index
95
+ command live in a marked consumer section of the template — they are
96
+ layout assumptions, not mechanism.
97
+ 3. **Drift line** — one `drift-report --trend` summary line when the
98
+ consumer has a drift report; silently absent otherwise (drift-kit owns
99
+ the report; the seam is this optional line).
100
+ 4. **Stage-conditioned nudges** — short reminders keyed on a stage set
101
+ read from the header (this repo's delegation nudge is the exemplar).
102
+ Each keys on {predecessor, own stage} (the cursor-lag rule below) so a
103
+ first-of-stage session and a restarted one both receive it. Marked
104
+ consumer section: which stages get which nudge is consumer judgment.
105
+ Suppressed when the session-role signal (below) marks the session `lead`
106
+ — the nudges are executor-facing.
107
+ 5. **Memory-off backstop** — one warning line when the harness memory dir
108
+ (`CONTEXT_KIT_MEMORY_DIRS`) holds content, pointing the durable fact at its
109
+ tracked home (§The memory-off doctrine). `check-memory-off` fires only at
110
+ commit; this surfaces pollution at session start, between commits. Silent
111
+ when the dir is empty or absent.
112
+ 6. **Scratch sweep** — reclaim `${GATE_SDK_TMP_DIR:-.tmp}` entries older
113
+ than a day, depth-first (`-mindepth 1 -depth`) so stray directories are
114
+ reclaimed too, never touching `.gitkeep`. Age-guarded so a concurrent
115
+ same-checkout session's in-flight scratch survives.
116
+ 7. **Index-reminder footer** — the "index first" ritual with the
117
+ consumer's actual index commands listed (consumer-edited).
118
+ 8. **Stage-routed craft-rule pointers** — when `CONTEXT_KIT_STAGE_RULES`
119
+ names a present emitter (doctrine-kit's `stage-rules.sh`), the current
120
+ stage's craft-rule pointer block, so a stage session is reminded of the
121
+ craft rules bearing on it before the matching action. Silently absent
122
+ when the emitter is unset or the stage routes no rules (doctrine-kit owns
123
+ the emitter and its tag grammar; the seam is this optional step, the
124
+ drift-line precedent). Keyed on the derived stage directly, not a
125
+ {predecessor, own stage} set: the pointers are advisory reminders, so
126
+ over-firing to an adjacent stage costs only a few lines, and the
127
+ cursor-lag rule below is about *conditioning*, not about which stage's
128
+ rules to show. Suppressed when the session-role signal marks the
129
+ session `lead` — the craft rules are executor-facing.
130
+ 9. **Env profile** — when the consumer-local profile file
131
+ (`CONTEXT_KIT_ENV_PROFILE_FILE`, §bin/env-probe) exists, the step first runs
132
+ `bin/env-probe.sh` to re-probe it (output suppressed so no status line
133
+ reaches the brief), then emits its whole body verbatim so the session adapts
134
+ its commands to the box as it is now. The re-probe sits inside the same
135
+ file-present guard, so producer and consumer co-locate here and the probe
136
+ never auto-seeds a profile the operator did not opt into. Silent when the
137
+ file is absent — the harness's own `Platform:` line is the fallback, no
138
+ re-probe fires, and no always-loaded cost is paid where no profile was
139
+ seeded. The consumer owns the file's brevity (they author the gotchas half),
140
+ the drift-line precedent.
141
+
142
+ **The cursor-lag rule.** The hook runs at session start, before the
143
+ arriving skill stamps its entry (its first step) — and that stamp is what
144
+ moves the cursor. So a first-of-stage session reads the *predecessor's* stage.
145
+ The lag is structural and survives any change of cursor source: the hook reads
146
+ a value written after it fires. Stage-conditioned
147
+ output therefore keys on a stage *set* spanning {predecessor, own stage} —
148
+ guaranteeing the first-of-stage session is served, at the accepted cost of
149
+ over-firing to the other sessions that share a cursor value (a restarted
150
+ session of a keyed stage, or the first session of the stage after it).
151
+
152
+ **The session-role signal.** The hook keys every stage-conditioned injection
153
+ off the lifecycle stage cursor, which says nothing about whether the
154
+ *reading* session is a lead, a stage session, or a manual run — so without a
155
+ role signal a lead draws executor-facing craft rules at every hook fire
156
+ (startup, plus each compact/resume re-fire, the recurring cost). The signal
157
+ is a marker file, **session-id-scoped**: `/lead`'s first step writes one line
158
+ `lead <id>` — `<id>` being `session-id.sh`'s value — to
159
+ `CONTEXT_KIT_SESSION_ROLE_FILE` (gitignored scratch, default
160
+ `${GATE_SDK_TMP_DIR:-.tmp}/session-role`). The hook treats the session as
161
+ `lead` only when the marker's id equals the 8-char prefix of **its own
162
+ payload's session id** — read from the hook payload, never from
163
+ `CLAUDE_CODE_SESSION_ID`, because a subagent is handed its *parent's* id in
164
+ that variable (the named assumption: were the harness ever to fire
165
+ `SessionStart` in subagents, an env-var read would match every stage session
166
+ to its lead's marker and invert the suppression onto exactly its intended
167
+ audience; revisit if subagent hook-fire lands). So a concurrent or later
168
+ top-level session never bleeds, and a stale marker self-invalidates when the
169
+ id rotates. The payload arrives on the hook's stdin, consumable exactly once,
170
+ so the single read here is its sole consumer — a later payload-derived signal
171
+ (a stage derivation, say) must hoist that one read ahead of this guard, never
172
+ add a second. Top-level scoping is sufficient because both producer and
173
+ consumer are top-level by construction — `SessionStart` does not fire for
174
+ Task-spawned subagents, so the only sessions the hook fires in are leads and
175
+ manual runs, and the identity match discriminates exactly those. When the
176
+ signal marks the session `lead`, steps 4 and 8 are suppressed; everything
177
+ else emits unchanged. Signal absent ⇒ byte-identical to the signal-free
178
+ hook; the read is guarded like every step — the hook never fails a session.
179
+ Accepted limits (not defects): the initial startup fire precedes `/lead` by
180
+ construction, a bounded one-per-lead-session cost against the
181
+ per-compact/resume recurrence that is the actual waste; the marker ages out
182
+ with the day-horizon scratch sweep (step 6), degrading to absent-signal
183
+ behavior; the marker's lifetime is the **lead session's, not the iteration's**,
184
+ so a consumer boundary ritual that wipes gitignored scratch (a scope
185
+ evidence-reset, say) must spare the marker file — a lead outliving an iteration
186
+ boundary otherwise reverts silently to absent-signal behavior until it rewrites
187
+ it; and the producer inherits `session-id.sh`'s
188
+ `CLAUDE_CODE_SESSION_ID` dependency — unset, the newest-transcript fallback
189
+ in a lead with live subagents returns an `agent-` prefix the payload can
190
+ never match, and the signal silently no-ops to absent-signal behavior (the
191
+ failure costs a suppression, never a correctness property). Rejected
192
+ alternatives, recorded so they are not re-derived: a launch-env var (a
193
+ perpetual operator ritual whose forgotten export degrades silently with no
194
+ signal it happened) and both-producers-with-precedence (two producers plus a
195
+ precedence rule to spec and gate, for a gap one hook fire wide).
196
+
197
+ **Ruled out — lifecycle stamp-id injection.** The hook payload carries the
198
+ harness session id, and **in a top-level session** its 8-char prefix equals
199
+ what lifecycle-kit's `session-id.sh` computes, so the hook *could* inject the
200
+ canonical stamp id with no shell-out. The parity is top-level-only and holds
201
+ only while the harness sets `CLAUDE_CODE_SESSION_ID`: a subagent is handed its
202
+ *parent's* id in that variable, while `session-id.sh` deliberately derives the
203
+ subagent's own transcript id instead (its `CLAUDE_CODE_CHILD_SESSION` branch),
204
+ so the two quantities diverge there by design. The hook does not inject: lifecycle-kit owns its id derivation
205
+ end-to-end (the stage-entry ritual derives it via `session-id.sh`,
206
+ whatever invokes that script), and having the stage skills
207
+ read a context-kit-injected value would wire an upstream kit's protocol to
208
+ a downstream kit's hook for ergonomics only — the trust model gains
209
+ nothing, since `check-stage-evidence` already enforces that the stamped id
210
+ is current. A consumer may add a local informational echo; the template
211
+ ships none.
212
+
213
+ ## bin/env-probe
214
+
215
+ `bin/env-probe.sh` derives a local machine profile so a session adapts to the
216
+ box it runs on — package manager, toolchain versions, absent tools — without
217
+ those machine facts ever landing in the public tree. It writes a
218
+ marker-bounded generated block (`<!-- context-kit:env:begin -->` /
219
+ `:end`, via gate-sdk's shared `inject_marker_block` helper) into the file named
220
+ by `CONTEXT_KIT_ENV_PROFILE_FILE` (default `ENV.local.md`), replacing an
221
+ existing block or appending a fresh one — but only when the probed content
222
+ actually changed (Cadence, below), so the block's probe date marks the last
223
+ real change, not the last run. The probed half is derivation-first — never
224
+ hand-maintained.
225
+
226
+ **What it probes.** OS/distro (`uname`, `/etc/os-release`); the package manager
227
+ (first present of an ordered detection walk over the known managers); each
228
+ roster member's version and its floor verdict (below); the absent-tools list
229
+ (roster members `command -v` cannot resolve); and the below-contract list. The
230
+ roster itself is owned by `lib/toolfloor.sh` and never restated here.
231
+
232
+ **The roster and its floor axis (`lib/toolfloor.sh`).** The roster lives in a
233
+ sourceable library rather than in the script, because `env-probe.sh` does its
234
+ work on execution: a second reader cannot obtain the roster by running it, which
235
+ is why the parity gate greps the array out of a file instead of sourcing it, and
236
+ why a reader that runs before any consumer file exists — an installer's `doctor`
237
+ reading its own payload copy — needs an owner it can source. The library defines
238
+ the array `PROBE_SET` and the predicate below and executes nothing else. It
239
+ carries no knob, deliberately: the roster is the kit's own dependency set, and a
240
+ consumer who could override it could only make the contract lie.
241
+
242
+ A roster element reads `<name>[:<min-version>[:<impl-token>]]`. A bare name keeps
243
+ the original meaning — must be present, no version constraint — so the floor axis
244
+ is **per-member** rather than a number demanded of every member. The fields are
245
+ positional, so a member constrained by implementation alone carries an empty
246
+ min-version field (`awk::GNU`), and an empty field means what an omitted trailing
247
+ field means: `awk`, `awk:`, and `awk::` are one unconstrained member. **A member
248
+ gains a floor only where a construct the battery actually runs forces one**, and
249
+ the forcing construct is recorded with it — a floor nobody's code forces is not
250
+ pinned, which is what stops a version number from rotting into an aspiration
251
+ (de-literalization applied to a version: the value is owned where the constraint
252
+ is provable).
253
+
254
+ The constrained members and what forces each:
255
+
256
+ - `bash:4.0` — three independent bash-4.0 constructs: `declare -A` (gate-sdk,
257
+ guard-kit, delegation-kit, evidence-kit checks), `mapfile` (widespread across
258
+ the kits), and the `${x,,}` case expansion (canon-kit's `lib/spec.sh` and
259
+ checks, a delegation-kit template).
260
+ - `awk::GNU` — no version floor, one implementation constraint: the 3-arg
261
+ `match()` in `check-gate-assertions`, whose dependency gate-sdk/SPEC.md
262
+ §check-gate-assertions already owns.
263
+ - `sort::coreutils` — no version floor, one implementation constraint, and one
264
+ member standing for a whole package family: GNU coreutils is forced by
265
+ `realpath --relative-to` and its `-m` form (gate-sdk's shared gate library and
266
+ hook emitter, canon-kit's link and command resolvers), `sort -V`
267
+ (`check-release-bump`), `date -d` (drift-kit's KPIs and trajectory), and
268
+ `stat -c` (delegation-kit's usage verdict). None is BSD-portable, and the
269
+ first sits in the library every gate sources — so a box without it cannot run
270
+ the battery at all rather than failing one gate. The representative member is
271
+ the binary carrying a forcing construct, which is also the floor predicate's
272
+ own comparison tool.
273
+ Every other member is a bare name — no construct in the battery forces a version
274
+ on it (the `jq` usage is 1.5-era throughout), so none is pinned.
275
+
276
+ An implementation token is matched as a **substring of the tool's own version
277
+ banner** — gawk prints `GNU Awk`, GNU sort prints `sort (GNU coreutils)` — so the
278
+ constraint is checked against the binary actually on `PATH` rather than against a
279
+ package name nothing can probe. Its honest limit is the same one: the roster
280
+ asserts what `PATH` resolves at probe time, so an installed-but-not-`PATH`-ordered
281
+ GNU userland probes as below contract, correctly, since that is what the gates
282
+ will invoke.
283
+
284
+ **The floor predicate.** `tool_floor_check <element> <banner>` returns one verdict
285
+ from a closed set — `ok`, `absent` (an empty banner), `below <found> <floor>`,
286
+ `wrong-impl <found>`, `uncomparable`. Numeric comparison is `sort -V`.
287
+ `<found>` is the banner's first dotted-version token for `below` and its
288
+ first word — the implementation's own name — for `wrong-impl`. `uncomparable` is
289
+ the fail-closed arm: a banner the predicate cannot parse, or a `sort` without
290
+ `-V`, is reported unverified and never silently as `ok` — the posture
291
+ gate-sdk/SPEC.md §The gate model requires of a gate, applied to a probe that is
292
+ not one.
293
+
294
+ **The rendered verdict.** Each toolchain bullet carries the probed banner and,
295
+ for a constrained member, the constraint and its verdict — `` (floor 4.0, ok) ``,
296
+ `` (requires GNU — below contract) ``, `` (floor 4.0 — unverified) ``; an
297
+ unconstrained member carries no parenthetical. A `**Below contract:**` line joins
298
+ the existing `**Absent:**` line, reading `none` when clean and otherwise naming
299
+ each failing member through the verdict's own fields: `below` and `wrong-impl`
300
+ are distinguished because the remedies differ — upgrade versus install a
301
+ different implementation — and `uncomparable` is listed as explicitly unverified
302
+ rather than folded into the clean state. Both version probes read from
303
+ `/dev/null`: `-V` prints a version banner for most tools but is an ordinary flag
304
+ for some — GNU sort's version-*sort* — so a tool that rejects `--version` would
305
+ otherwise fall through to a `-V` that reads inherited stdin and hangs the probe.
306
+
307
+ **The content seam (consumer-local, gitignored).** Hand-authored gotchas — the
308
+ "no `dig`/`host`; use `getent`/DoH" class a probe cannot know — live *outside*
309
+ the markers in the same file and survive every re-probe; when the file is
310
+ absent the probe seeds that scaffold once, then only ever rewrites the block.
311
+ The per-session re-probe (Cadence, below) does not trigger that seeding: it
312
+ runs only against a file that already exists, so seeding stays a
313
+ first-run/on-demand action.
314
+ The file is `BRIEF.local.md`-class: local-only, gitignored (this repo's
315
+ `.gitignore` and the CLAUDE.md housekeeping line carry it), so machine facts
316
+ stay private.
317
+
318
+ **Cadence — per-session auto-refresh.** The session-context hook re-probes
319
+ once per session, at its step-9 profile emit (§The session-context hook), so a
320
+ session always adapts to the box as it is now — the install step seeds the
321
+ profile once, and every session thereafter refreshes it. Change-detection keeps
322
+ this cheap and the date honest: the probe rewrites the block only when the
323
+ probed content differs from what is on disk (the `Probed` date line excluded
324
+ from the comparison), so an unchanged box writes nothing and the date marks the
325
+ last real change, not the last run. Still no freshness gate — env truth is not
326
+ cheaply machine-verifiable and the probe is already the derivation (the
327
+ enforcement-first carve-out; the per-session re-probe is now the enforcement,
328
+ replacing the install-step-only cadence). The hook re-probes only when the
329
+ profile file already exists, so a never-seeded consumer pays no cost and seeds
330
+ nothing unbidden.
331
+
332
+ ## The always-loaded meter
333
+
334
+ `bin/always-loaded.sh` measures the standing surface: the summed line
335
+ count of the configured surface files (default `CLAUDE.md`) plus the
336
+ steady-state hook body, approximated by the configured hook-body command
337
+ (default: queue-kit's `queue-index.sh --collapse-deferred` when
338
+ resolvable). The approximation is deliberate: the meter must never run the
339
+ session-context hook itself — the hook emits this meter's own output line,
340
+ so self-measurement would recurse and inflate.
341
+
342
+ The meter lives here, not in `drift-report.sh`, because the *metric* is
343
+ context economics and the *report* is drift reporting — drift-kit's
344
+ `kpi-always-loaded` consumes this script for its row instead of re-embedding
345
+ the measurement.
346
+
347
+ - **Default invocation** prints one line: total, per-part breakdown, and
348
+ the delta against the baseline when one exists.
349
+ - **`--update-baseline`** rewrites the baseline file — a close-stage act,
350
+ because the brevity pass reacts to the *delta*, not the level (close is
351
+ net-additive by design; only growth since the iteration started is
352
+ actionable).
353
+ - **Baseline file** (`${GATE_SDK_WORKFLOW_DIR:-.workflow}/`
354
+ `always-loaded-baseline.txt`, committed): a `# contract:` header
355
+ pointing here, then one data line
356
+ `<total-lines> <surface-lines> <baseline-commit>`. Trailing extra
357
+ fields are tolerated and preserved-ignored — a consumer's file may carry
358
+ a fourth (a settings-local count, say, a guard-kit-adjacent KPI owned by
359
+ its drift report), and the kit reads such a file unchanged. The baseline is
360
+ the consumer-side floor-holder for the footprint contract
361
+ (§The consumer footprint): its delta is what the close-stage brevity pass
362
+ reacts to.
363
+
364
+ ## bin/footprint
365
+
366
+ `bin/footprint.sh` publishes the kits' measured context footprint — the
367
+ adoption-cost evidence a consumer weighs before vendoring, the concrete form of
368
+ the token-economics positioning. Where the meter reads one consumer's live
369
+ always-loaded total, this reads the tracked kit surfaces and attributes the cost
370
+ per kit, split by when it lands.
371
+
372
+ The measured set is the kit roster, **derived not maintained**: the top-level
373
+ directories carrying a `SPEC.md`. No knob names the set — a new kit joins the
374
+ page by existing.
375
+
376
+ Each kit is measured in the always-loaded and load-triggered tiers:
377
+
378
+ - **Always-loaded** — the block a kit generates between its own
379
+ `begin`/`end` markers in the configured surface files
380
+ (`CONTEXT_KIT_SURFACES`), the agent-file text the kit injects into every
381
+ session's context. This reuses the always-loaded meter's surface set; most
382
+ kits inject nothing and score zero here.
383
+ - **Load-triggered** — the skill and template markdown the kit ships under its
384
+ `templates/` tree, pulled into context only when its trigger fires. Gate-test
385
+ fixtures sit outside `templates/`, so they never enter the count.
386
+
387
+ **Numbers ruling.** Line counts are exact. The token column is a
388
+ *labeled estimate* — a bytes/4 heuristic, carried with a leading `~` and stated
389
+ inline as model-tokenizer-dependent, never a false-precision figure.
390
+
391
+ **Attribution ruling: kit share only.** A kit's advertised cost is what the kit
392
+ ships. Consumer bindings (the skill shims pointing at a vendored template),
393
+ consumer config, the on-demand SPEC/README pages, this repo's own `CLAUDE.md`
394
+ residue, and the session hook's dynamic body (consumer state, not fixed kit
395
+ text) are all excluded, and the page states the exclusion so the number is
396
+ honest. The exclusion is also a determinism requirement: the freshness gate
397
+ byte-compares the emission, so every measured surface must be a static tracked
398
+ file — a live hook run, being state-dependent, could never be byte-gated.
399
+
400
+ **Emission.** Bare invocation prints a human header plus the per-kit table;
401
+ `--emit` prints the committed `docs/footprint.md` page whole (front matter,
402
+ method and exclusion prose, then the table with a totals row) — the `--emit`
403
+ symmetry the sibling emitters (`always-loaded.sh`, drift-kit's `trajectory.sh`)
404
+ share. Advisory by construction: exit is always zero and the script never joins
405
+ `gates.list`; the freshness gate (§check-footprint-fresh) is what blocks a stale
406
+ page.
407
+
408
+ ## The brevity gate
409
+
410
+ `checks/check-brevity.sh` — a section-agnostic name: the governed section
411
+ is a knob, so no section name binds the gate (a consumer's
412
+ `check-convention-brevity` would be its section-specific counterpart). It scans one designated
413
+ always-loaded file for a bulleted section where each `- **name:**` bullet
414
+ carries a line budget, and flags a bullet that is **over budget and cites
415
+ a deeper doc** (carries a `§` pointer) — over-long while admitting its
416
+ detail already has a home elsewhere. Under-budget bullets and over-budget
417
+ bullets with no pointer pass (the latter may genuinely own their content);
418
+ `<!-- brevity-exempt: <reason> -->` on the bullet's first line or the line
419
+ above blesses a bullet whose every line is load-bearing.
420
+
421
+ Section resolution fails closed: a `CONTEXT_KIT_BREVITY_SECTION` matching no
422
+ heading in the governed file exits 2, never a clean 0. The knob and the heading
423
+ are a coupling no other gate holds, so a renamed or deleted section would
424
+ otherwise disarm the gate while it reported an empty section as clean — a gate
425
+ whose target vanished is a broken machine, not a clean tree. A section that
426
+ resolves and holds no bullets is clean: resolution is what fails closed, not
427
+ emptiness.
428
+
429
+ The pointer default is any `§`, not a single doc name like `HANDBOOK §`:
430
+ "cites a deeper doc" is the mechanism-level meaning and a consumer's handbook
431
+ is one instance of it, so the superset matches every such pointer. Ships with
432
+ a `good/`+`bad/` fixture pair and registers in the
433
+ consumer's `gates.list` (this repo's included).
434
+
435
+ ## The close-stage brevity pass
436
+
437
+ `templates/close-brevity.md` is the recurring close-stage step a consumer
438
+ splices into its close skill (the guard-kit `close-triage.md` pattern).
439
+ The procedure: run `always-loaded.sh`; walk the growth since baseline
440
+ asking two distinct questions — staleness (*is it still true?*) and
441
+ brevity (*is each block worth its standing per-session token cost?*);
442
+ resolve by rewording or deleting, never by annotating (outdated context
443
+ <!-- manifest-temporal-exempt: names the "formerly…" note as the anti-pattern this pass forbids, not written as narration -->
444
+ goes to git history, not to a "formerly…" note); on-demand files (SPECs,
445
+ handbooks) are exempt — their cost is paid only when opened; finish with
446
+ `always-loaded.sh --update-baseline` and commit the baseline.
447
+
448
+ The lexical share of this narration judgment — a fixed set of `formerly…`-class
449
+ markers in the manifest set — is a blocking gate
450
+ (canon-kit/SPEC.md §check-manifest-temporal); this pass keeps the semantic
451
+ residue (*is this sentence about the past?*) that no marker set can decide.
452
+
453
+ ## The consumer footprint
454
+
455
+ A consumer project pursues its own objectives; the tooling must stay
456
+ near-invisible in its context budget. This section states and holds the kits'
457
+ consumer-resident footprint — what checkwright asks a consumer's always-loaded
458
+ surface to carry — owned in one place, with the always-loaded meter's baseline
459
+ as the consumer-side floor-holder. It is prose contract only: no new state,
460
+ event, knob, or gate. Its producer is the kit author at kit-landing time (the
461
+ kit-landing checklist gains no step; the review seam is the roster row); its
462
+ readers are a consumer evaluating adoption cost before vendoring and this
463
+ repo's own close-stage brevity pass, which reads the roster when judging
464
+ whether a new resident line is a kit ask or repo content.
465
+
466
+ **The budget rule.** A kit's resident ask is at most one pointer line on the
467
+ consumer's always-loaded surface — the load-trigger-residency and
468
+ always-loaded-shape doctrine rules applied to kit shipping. The one sanctioned
469
+ block-sized ask is doctrine-kit's digest, itself bounded by its one-line-per-rule
470
+ shape (the always-loaded-shape rule); its name-lockstep with the doctrine is
471
+ held separately (the doctrine-rule-lockstep unit), because a re-vendor upgrade
472
+ stales the digest by construction.
473
+
474
+ **The roster, by citation.** Each kit's resident ask is named by citing the kit
475
+ SPEC section that owns it, never by restating it here — so the roster cannot
476
+ drift out of lockstep with what the kit actually ships. A kit adding a resident
477
+ ask adds its row below, which is the review seam:
478
+
479
+ - **delegation-kit** — the pre-authorization sentence plus skill pointer:
480
+ delegation-kit/SPEC.md §One template, a resident pointer.
481
+ - **doctrine-kit** — the doctrine link plus the digest block: doctrine-kit/SPEC.md.
482
+ - **drift-kit** — the knowledge-friction capture bullet:
483
+ drift-kit/SPEC.md §The knowledge-friction loop, which already states the
484
+ one-bullet cost and its earn-back condition.
485
+ - **every other kit** — none: their hooks, skills, gates, and SPECs are load-
486
+ or event-triggered, so they cost nothing until opened.
487
+
488
+ **The floor-holder ruling.** The meter plus its committed baseline
489
+ (§The always-loaded meter) ship as the consumer's floor-holder: the consumer
490
+ install (§Layout and configuration) seeds `always-loaded-baseline.txt`, so
491
+ growth of the resident surface is a visible delta at every close-stage brevity
492
+ pass. The hold is *advisory by design*. A hard total-line gate cannot attribute
493
+ growth — the consumer's own content shares the file and is theirs to grow — so
494
+ a level gate would be a noisy check breeding exemptions, the high-false-positive
495
+ case the enforcement-first rule sanctions for keeping a class as stated manual
496
+ duty rather than a gate. The mechanical holds that do exist stay: `check-brevity`
497
+ bounds the one bulleted section its knob designates (§The brevity gate; this
498
+ repo points it at the conventions block, not the digest), and the meter delta
499
+ feeds `kpi-always-loaded`.
500
+
501
+ The measured counterpart to this budget doctrine is the published footprint page
502
+ (§bin/footprint): this section owns the budget rule, the page owns the measured
503
+ per-kit numbers, and the two never restate each other.
504
+
505
+ ## The memory-off doctrine
506
+
507
+ Harness memory — the per-session store the harness offers to persist facts
508
+ across sessions — is an always-loaded surface the meter cannot read and no
509
+ gate scans: standing per-session context that accretes outside the tier
510
+ contract, ungoverned by construction. The methodology already routes durable
511
+ knowledge through a star topology, and those routes are the replacement —
512
+ durable facts to their doc owner (the knowledge-friction loop), iteration-
513
+ scoped attention to the lesson channels, private context to the operator's
514
+ local brief. So the kit disables harness memory and enforces it off rather
515
+ than governing its content.
516
+
517
+ The banned class is *harness-side silent accumulation*, not every local file: an
518
+ explicit, derived, operator-curated local file is config, not memory.
519
+ `ENV.local.md` (§bin/env-probe) sits with `BRIEF.local.md` on the config side of
520
+ that line — its probed half is a re-runnable derivation, its gotchas half is
521
+ hand-curated, and both are gitignored operator surfaces the operator chose to
522
+ keep, never a store the harness wrote to behind the tier contract.
523
+
524
+ Blast-radius honesty rides the doctrine: the gates hold the tree regardless of
525
+ a polluted session, so a memory that quietly re-accumulated degrades one
526
+ session's judgment, never the committed baselines. This is therefore a
527
+ lightweight gate pair — a hermetic pin and a local-environment scan — not
528
+ machinery. Enforcement splits on the tree-vs-environment seam: what a commit
529
+ can carry (the tracked settings file) is hermetic and CI-real
530
+ (§check-settings-pins); what only the operator's machine holds (the memory
531
+ dir, the untracked local settings) is a local-environment scan, CI-neutral
532
+ (§check-memory-off).
533
+
534
+ ## check-settings-pins
535
+
536
+ `checks/check-settings-pins.sh` (hermetic, `precommit`) is the identity.conf
537
+ pattern pointed at harness config. Every pin in `CONTEXT_KIT_SETTINGS_PINS`
538
+ (default `${GATE_SDK_GATES_DIR:-scripts}/settings-pins.conf`) holds against
539
+ the tracked settings file `CONTEXT_KIT_SETTINGS_FILE` (default
540
+ `.claude/settings.json`). Grammar: one `<jq path> = <expected JSON>` per line,
541
+ `#` comments and blanks ignored; the expected side is the exact `jq -c`
542
+ rendering (`false`, `"1"`, `{"k":1}`). General-purpose by construction — any
543
+ settings key is pinnable — this consumer's first pins hold the
544
+ auto-memory-disabling keys.
545
+
546
+ Dispositions: a pin whose path resolves to the expected value passes; a path
547
+ present with a different value is the legible violation (exit 1, each finding
548
+ reading path, expected, and actual). Fail-closed (exit 2) on an unreadable or
549
+ non-JSON settings file, no `jq`, a malformed pin line, or a pin naming a key
550
+ **absent** from the settings file — an absent key is a desynced manifest (the
551
+ pins and the settings are one repo's tracked config, edited together), not the
552
+ legible drift a red is for. Absent pins file: the opt-in-off state, a clean
553
+ skip. Ships a `good/`+`bad/` fixture pair and registers in the consumer's
554
+ `gates.list` (this repo's included).
555
+
556
+ ## check-memory-off
557
+
558
+ `checks/check-memory-off.sh` (local-environment class, the check-identity
559
+ precedent) scans the operator's machine, not the tree — its `# graph:`
560
+ manifest couples the pins file it reads and triggers on `*`, because the
561
+ surfaces it guards (the memory dir and the untracked local settings) never
562
+ stage. Two red conditions:
563
+
564
+ - the harness's per-project memory dir holds content — any regular file that
565
+ is not the dir-preserving `.gitkeep`;
566
+ - the untracked local settings file (`settings.local.json` beside the settings
567
+ file) sets a pinned key to a value other than its pin — the override the
568
+ hermetic gate cannot see, since it reads only the tracked file.
569
+
570
+ `CONTEXT_KIT_MEMORY_DIRS` (a space-separated glob list) names the dirs to
571
+ scan; its default derives the current project's dir from the harness layout
572
+ (§Layout and configuration). CI-neutral: where the surface is absent the gate
573
+ is clean, and the clean line states the fail-open caveat — an absent dir
574
+ proves nothing about another clone. It fails closed only when it cannot read
575
+ what is present to check: a local settings file with no `jq`.
576
+
577
+ ## check-footprint-fresh
578
+
579
+ `checks/check-footprint-fresh.sh` (hermetic, `precommit`) byte-compares the
580
+ committed `docs/footprint.md` against `footprint.sh --emit`, the
581
+ `check-docs-mirror-fresh`/`check-trajectory-fresh` posture: a generated,
582
+ freshness-gated projection is Derivation-first's sanctioned copy, so the
583
+ maintainer re-runs the emitter after any change to a measured surface and a
584
+ stale page reddens the battery. Its `# graph:` manifest couples the measured
585
+ surfaces — the configured agent file and each kit's `templates/` tree — so an
586
+ edit to what the page counts re-fires the gate.
587
+
588
+ Bare, it runs the live emitter; a two-argument form
589
+ (`check-footprint-fresh.sh <projection> <emit>`) compares two pre-baked files,
590
+ the hermetic mode the `good/`+`bad/` fixture pair drives. Fail-closed (exit 2)
591
+ on a missing projection or emit source; the stale byte-compare is the exit-1
592
+ violation. The page's generated numbers ride the `docs/evidence-data.md`
593
+ precedent past the prose gates on content, not a named valve — the figures live
594
+ in table cells the count gate does not read as prose, and the method prose names
595
+ no bare collection total.
596
+
597
+ ## Layout and configuration
598
+
599
+ ```
600
+ context-kit/
601
+ bin/md-index.sh
602
+ bin/md-section.sh
603
+ bin/pub-index.sh # dispatcher over the per-language extractors
604
+ lib/toolfloor.sh # sourceable owner: the probe roster + the floor predicate
605
+ lib/pub-lang/rust.sh # shipped extractor: Rust public items
606
+ lib/pub-lang/ts.sh # shipped extractor: TypeScript export surface
607
+ bin/always-loaded.sh
608
+ bin/footprint.sh # per-kit two-tier footprint; --emit is docs/footprint.md
609
+ bin/env-probe.sh # derives the marker-bounded local env profile
610
+ bin/run-index-tests.sh # expected-output runner for the bin tools
611
+ checks/check-brevity.sh
612
+ checks/check-settings-pins.sh # hermetic: pins hold against the settings file
613
+ checks/check-memory-off.sh # local-environment: memory dir + local overrides
614
+ checks/check-footprint-fresh.sh # hermetic: docs/footprint.md byte-fresh vs the emitter
615
+ gate-tests/check-brevity/{good,bad}/
616
+ gate-tests/check-settings-pins/{good,bad}/
617
+ gate-tests/check-memory-off/{good,bad}/
618
+ gate-tests/check-footprint-fresh/{good,bad}/
619
+ gate-tests/check-memory-off.test.sh # the local-override axis the pair cannot hold
620
+ index-tests/ # fixture corpus + expected outputs
621
+ templates/session-context.sh # consumer copy: marked consumer sections
622
+ templates/settings-sessionstart.json
623
+ templates/context-config.sh
624
+ templates/close-brevity.md
625
+ smoke/install.sh
626
+ smoke/violation.sh
627
+ smoke/agents-md.sh # the AGENTS.md adapter smoke (its own validate suite)
628
+ ```
629
+
630
+ The install also seeds the committed baseline the footprint contract holds
631
+ (§The consumer footprint): after wiring the hook it runs
632
+ `always-loaded.sh --update-baseline` once to write
633
+ `always-loaded-baseline.txt`, and `smoke/install.sh` asserts that step by
634
+ running the meter and checking the baseline lands. Install also seeds the local
635
+ env profile — `env-probe.sh` writes the first `ENV.local.md` block
636
+ (§bin/env-probe); being an operator-local, gitignored surface, no smoke asserts
637
+ it (the stated install step is its enforcement).
638
+
639
+ Config follows the established kit pattern: copy
640
+ `templates/context-config.sh` into the gates dir (or point
641
+ `CONTEXT_KIT_CONFIG_FILE` elsewhere) and override any knob; defaults fill
642
+ what the consumer left unset, and a set-but-missing `CONTEXT_KIT_CONFIG_FILE`
643
+ exits 2 rather than silently running on defaults. Knobs (this repo's layout
644
+ as defaults):
645
+
646
+ - `CONTEXT_KIT_SURFACES` — array of always-loaded files; default
647
+ `("CLAUDE.md")`. The measured surface is agent-file-name-agnostic: a consumer
648
+ whose harness reads `AGENTS.md` (or any other always-loaded agent file) sets
649
+ this to that file and the meter, the footprint, and `check-brevity` all follow
650
+ — no kit mechanism resolves the agent file by literal. The
651
+ `smoke/agents-md.sh` adapter smoke exercises exactly that: an `AGENTS.md`
652
+ scratch consumer whose battery is green and whose meter and footprint measure
653
+ `AGENTS.md`.
654
+ - `CONTEXT_KIT_PUB_LANGS` — array naming the `pub-index` extractors to
655
+ enable; default every shipped extractor, derived from the `lib/pub-lang/`
656
+ roster at run time (never a maintained list).
657
+ - `CONTEXT_KIT_PUB_LANG_DIR` — the consumer extractor dir searched before the
658
+ kit's `lib/pub-lang/` (a same-basename file shadows the shipped one);
659
+ default `${GATE_SDK_GATES_DIR:-scripts}/pub-lang`.
660
+ - `CONTEXT_KIT_HOOK_CMD` — command whose output line count approximates
661
+ the steady-state hook body; default queue-kit's
662
+ `queue-index.sh --collapse-deferred` when resolvable, else empty
663
+ (surfaces only).
664
+ - `CONTEXT_KIT_DRIFT_REPORT` — path to the consumer's drift-report script;
665
+ the session-context hook runs it with `--trend` for the brief's drift
666
+ line; default empty (the line is omitted).
667
+ - `CONTEXT_KIT_STAGE_RULES` — path to a stage→craft-rule pointer emitter
668
+ (doctrine-kit's `stage-rules.sh`); the session-context hook runs it with the
669
+ current stage for the brief's craft-rule block; default empty (the block is
670
+ omitted).
671
+ - `CONTEXT_KIT_STATE_FILE` — the lifecycle evidence file whose **last data
672
+ line** carries the stage cursor the hook routes on (§The session-context
673
+ hook); default `${GATE_SDK_WORKFLOW_DIR:-.workflow}/WORKFLOW-STATE.txt`. Read
674
+ as a named file, never through stdin — the session-role signal consumes stdin
675
+ exactly once, and a second reader there would starve it.
676
+ - `CONTEXT_KIT_ENV_PROFILE_FILE` — the consumer-local env profile file
677
+ `bin/env-probe.sh` writes and the session-context hook's step 9 emits (§bin/
678
+ env-probe); default `ENV.local.md`.
679
+ - `CONTEXT_KIT_SESSION_ROLE_FILE` — the session-role marker `/lead` writes and
680
+ the session-context hook's identity match reads (§The session-context hook);
681
+ default `${GATE_SDK_TMP_DIR:-.tmp}/session-role` (gitignored scratch).
682
+ - `CONTEXT_KIT_BASELINE_FILE` — default
683
+ `${GATE_SDK_WORKFLOW_DIR:-.workflow}/always-loaded-baseline.txt`.
684
+ - `CONTEXT_KIT_BREVITY_FILE` — default `CLAUDE.md`.
685
+ - `CONTEXT_KIT_BREVITY_SECTION` — heading of the budgeted bullet section;
686
+ default `## Shared conventions`.
687
+ - `CONTEXT_KIT_BREVITY_BUDGET` — lines per bullet; default `4`.
688
+ - `CONTEXT_KIT_BREVITY_POINTER_RE` — the "cites a deeper doc" pattern;
689
+ default `§`.
690
+ - `CONTEXT_KIT_SETTINGS_FILE` — the tracked harness settings file
691
+ check-settings-pins verifies and whose `.local.json` sibling check-memory-off
692
+ scans; default `.claude/settings.json`.
693
+ - `CONTEXT_KIT_SETTINGS_PINS` — the pins manifest; default
694
+ `${GATE_SDK_GATES_DIR:-scripts}/settings-pins.conf`.
695
+ - `CONTEXT_KIT_MEMORY_DIRS` — space-separated glob list of harness memory dirs
696
+ check-memory-off scans; default the current project's dir under the operator's
697
+ home, `$HOME/.claude/projects/<slug>/memory`, where `<slug>` is the project's
698
+ absolute path with every `/` and `.` folded to `-` (the harness's own
699
+ encoding). A knob because the layout moves (the plugin-marketplace ruling:
700
+ design against the live layout, keep it config).
701
+
702
+ The hook template itself is consumer-edited rather than knob-driven (the
703
+ guard-kit guard precedent): its variation points are layout judgment,
704
+ and a template with a dozen knobs is harder to own than a marked section.
705
+
706
+ ## Testing
707
+
708
+ The three index tools and the meter are advisory and speak plain text, so
709
+ the gate contracts do not fit; the kit ships an expected-output runner
710
+ instead: `index-tests/` holds a small fixture corpus (Markdown with nested
711
+ headings, fences, and link-bearing first sentences; Rust with the pub-item
712
+ kinds; TypeScript with every kind the `ts.sh` grammar claims — including
713
+ `const enum` and `export default` — beside re-export and non-export lines it
714
+ must skip; a baseline file) beside expected outputs, and
715
+ `bin/run-index-tests.sh` runs each tool over the corpus and asserts exact
716
+ output, failing on any diff. The Rust golden is the no-regression assertion
717
+ for the extractor-dispatcher refactor: it stays byte-identical across it. A
718
+ consumer-shadowing case points `CONTEXT_KIT_PUB_LANG_DIR` at a scratch dir
719
+ whose `rust.sh` emits a marker row, exercising the consumer-first resolution
720
+ order (the shadow's output, not the shipped grammar's, is what the golden
721
+ records). The floor predicate rides the same runner rather than a fixture pair —
722
+ it is a sourced function, not a gate: `index-tests/toolfloor-cases.sh` sources
723
+ `lib/toolfloor.sh` and prints one line per (element, banner) pair, so the closed
724
+ verdict set, the three spellings of an unconstrained member, and the
725
+ `uncomparable` fail-closed arm are asserted against a golden rather than assumed.
726
+ The runner registers as its own evidence-kit validate suite
727
+ (`index_tests`, the `demo` precedent): the golden the refactor leans on now
728
+ has an automated validate-stage consumer. `footprint.sh` is advisory the same way, but its
729
+ projection is gated rather than runner-tested: `check-footprint-fresh` byte-holds
730
+ `docs/footprint.md` against `--emit`. `check-brevity`, `check-settings-pins`,
731
+ `check-memory-off`, and `check-footprint-fresh` are gates and carry the standard
732
+ fixture pair; the footprint pair drives the hermetic two-argument mode
733
+ (`<projection> <emit>`), the `check-trajectory-fresh` precedent. Both
734
+ memory-off gates take a `--fixture <dir>` injection (the check-identity
735
+ precedent): the settings-pins pair reads `<dir>/settings.json` against
736
+ `<dir>/settings-pins.conf`; the memory-off pair scans `<dir>/memory` for
737
+ content. The memory-off local-override axis — an untracked
738
+ `settings.local.json` that re-enables a pinned key past an empty dir — cannot
739
+ be a good/bad pair (the pair fixes the dir axis), so `check-memory-off.test.sh`
740
+ holds it.
741
+
742
+ `smoke/install.sh` copies the templates into the scratch consumer (config
743
+ into the gates dir, hook wiring into the harness settings), runs the hook
744
+ end-to-end asserting it exits zero (and, when queue-kit is co-vendored,
745
+ emits the queue index — the installer assumes only gate-sdk, so the queue
746
+ integration is exercised only alongside queue-kit), and runs
747
+ `always-loaded.sh --update-baseline` asserting the baseline file appears.
748
+ `smoke/violation.sh` crafts an over-budget pointered bullet in the scratch
749
+ consumer's brevity file and asserts the battery reddens via
750
+ `check-brevity`. It inserts the bullet inside the budgeted section rather than
751
+ appending at end-of-file: a co-vendored kit may append a trailing section (the
752
+ doctrine-kit installer adds one), and an EOF-appended bullet would land outside
753
+ `check-brevity`'s scanned section and silently disarm the smoke.
754
+
755
+ `smoke/agents-md.sh` is the agent-file adapter smoke — the exercise behind the
756
+ Tier-two compatibility claim (docs/positioning.md §The tiered compatibility
757
+ claim). It vendors a scratch consumer through the shared consumer-smoke
758
+ mechanics (gate-sdk/SPEC.md §Consumer smoke), converts its agent file from
759
+ `CLAUDE.md` to `AGENTS.md`, sets the agent-file knobs in the consumer's config
760
+ seams (`GATE_SDK_AGENT_FILE`, `LIFECYCLE_KIT_AGENT_FILE`, `DOCTRINE_KIT_AGENT_FILE`,
761
+ `CANON_KIT_MANIFEST_FILES`, `CONTEXT_KIT_SURFACES`, `CONTEXT_KIT_BREVITY_FILE`),
762
+ then asserts the battery is green, `always-loaded.sh` and `footprint.sh` measure
763
+ the `AGENTS.md` surface, and `check-root-tiering`'s built-in allowlist accepts
764
+ `AGENTS.md` at root while rejecting a stray second agent file. It is a standalone
765
+ harness — not driven by `run-consumer-smoke.sh`, which asserts the kit defaults
766
+ under zero config — and registers as its own evidence-kit validate suite
767
+ (`agents_md_smoke`, the `demo` precedent).
768
+
769
+ ## Out of scope
770
+
771
+ Product-shaped indexes — a `proto-index` over a proto layout, a
772
+ `diagram-index` over architecture HTML — are consumer surfaces; a consumer
773
+ names its own extra indexes in the hook template's footer. `check-md-refs`
774
+ (an orientation-doc roster is rule content; the link-resolution mechanism is
775
+ unclaimed, not this kit's) and `check-md-sections` (a required-heading map is
776
+ rule content, and the queue surface it guards is already gated by queue-kit).
777
+ A close-stage harvest pipeline (`[pub]` lessons, publication paths) is
778
+ product workflow, not context mechanism. `drift-report.sh` itself is
779
+ drift-kit's surface — only the always-loaded KPI lives here. A consumer's
780
+ session-context content — its delegation nudge wording, component roster,
781
+ and extra index commands — stays in its own copied hook. Memory **content**
782
+ is out of scope by construction: the memory-off gates govern presence (the
783
+ dir stays empty) and pins (the disabling keys hold), never a live session's
784
+ context, which is not a scannable surface — a session polluted mid-flight is
785
+ caught by the tree the gates hold, not by reading the session.