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,828 @@
1
+ # drift-kit — drift reporting with pluggable KPIs and lead/lag honesty labels
2
+
3
+ Gates block what is mechanically decidable per commit; drift is what
4
+ accumulates *between* commits — trends no single diff violates. A backlog
5
+ ages, an always-loaded surface swells, friction recurs, and every individual
6
+ session looks fine, because no stateless session ever sees the slope. The
7
+ kit is the trend surface: an advisory report that collates KPIs from the
8
+ other kits' governed surfaces, groups them under honest weight labels
9
+ (lead indicators act before drift compounds; lag indicators undercount by
10
+ construction), and emits a one-line trend summary the session-start hook
11
+ injects — so every session opens seeing the slope it cannot otherwise see.
12
+
13
+ Advisory by construction: the report never fails a session, never joins
14
+ `gates.list`, and reads *trend, not level* — a KPI's absolute value is
15
+ noise, its direction across sessions is the signal.
16
+
17
+ The kit carries the report skeleton, the KPI plugin contract, a bundled set
18
+ of kit-coupled generic KPIs, and the knowledge-friction loop; a consumer's
19
+ product- and toolchain-shaped KPIs stay in the consumer repo (§Out of scope).
20
+
21
+ ## The report skeleton
22
+
23
+ `bin/drift-report.sh` — the collator. It owns the frame; every measurement
24
+ lives in a plugin:
25
+
26
+ 1. Read the KPI registry (`kpis.list` — one plugin name per line, `#`
27
+ comments; the gates.list grammar) and resolve each name against the
28
+ consumer KPI dir first, then each vendored kit's `kpis/` (the gate-sdk
29
+ resolution pattern: a consumer shadows a bundled KPI by dropping a
30
+ same-named file in its own dir).
31
+ 2. Run each plugin, collect its rows, and group them into the two labeled
32
+ sections — the honesty labels are the frame's contract:
33
+ - header: `=== Drift KPIs (advisory — trend, not level) ===`, plus the
34
+ iteration-start commit when derivable;
35
+ - `--- Lead (weighted high — act before drift compounds) ---`;
36
+ - `--- Lag (weighted low — undercounts by construction) ---`;
37
+ - footer: `Read trend across sessions; lag KPIs lower-bound only.`
38
+ 3. `--trend` emits a single compact line instead — the fragment each plugin
39
+ volunteers, joined with `·` — consumed by context-kit's session-context
40
+ hook (`CONTEXT_KIT_DRIFT_REPORT`, already wired in its template).
41
+
42
+ Degrade discipline: exit is always 0. A plugin that exits non-zero or
43
+ prints nothing yields a visible `<name> n/a (plugin failed)` row in the
44
+ lead section — fail-visible, not fail-closed, because a silently vanishing
45
+ KPI is itself drift. A plugin whose *surface* is missing (no log yet, no
46
+ timings file) degrades to `n/a (<reason>)` in its own value, not by dying.
47
+
48
+ ## The KPI plugin contract
49
+
50
+ A plugin is `kpi-<name>.sh`, resolved through the registry and invoked
51
+ directly (`"$path"`, not `bash "$path"`) — so it must carry the execute bit or
52
+ the report degrades that row to its fail-visible read. Two modes:
53
+
54
+ - **Full (no args)** — one or more rows on stdout, each
55
+ `lead|lag<TAB><label><TAB><value>`: the section tag, a short human label,
56
+ and a freeform value that carries its own caveat parenthetical (reading
57
+ age, undercount note, pointer to the acting close-stage step). Multiple
58
+ rows are legitimate for one measurement with two axes.
59
+ - **`--trend`** — at most one compact `<key> <value>` fragment, or nothing
60
+ (a plugin may opt out of the trend line).
61
+
62
+ Plugins read **exported env only** — a plain assignment in the consumer
63
+ config reaches the collator's shell but never a child plugin. The collator
64
+ closes that gap structurally: before invoking plugins, `drift-report.sh`
65
+ exports every scalar `DRIFT_KIT_*` variable (`compgen` over the namespace;
66
+ arrays skipped — bash cannot export them, and array knobs like
67
+ `DRIFT_KIT_KPI_DIRS` are consumed inside the collator itself), so a config
68
+ override reaches writer and reader alike with no fixed export list to drift
69
+ out of parity. It also exports `DRIFT_KIT_KIT_ROOTS` — newline-separated kit
70
+ roots, `gate_kit_roots` when gate-sdk resolves, else the kit's parent; a
71
+ plugin needing sibling-kit surfaces reads it rather than re-deriving the
72
+ roster, and falls back to its own derivation when run standalone without it.
73
+ The driver's handoff, not a consumer knob: `drift-report.sh` recomputes it
74
+ every run.
75
+
76
+ Plugins never block and never write outside `$DRIFT_KIT_TMP_DIR` scratch;
77
+ a measurement needing state (a baseline, a log) reads a file some
78
+ *other* mechanism owns and stamps its reading-age caveat when the file is a
79
+ past measurement rather than live state (the gate-runtime pattern below).
80
+
81
+ ## Bundled KPIs
82
+
83
+ The generic set — each coupled to a kit-governed surface, each degrading to
84
+ `n/a` when the consumer lacks that surface. Lead:
85
+
86
+ - **kpi-task-split** — the feature↔debt split of the queue's Done slugs,
87
+ classified by their commit subjects (`feat` / `fix`+`refactor`); reads
88
+ the queue file and git. gate-sdk's check-commit-subject is the parse
89
+ guarantee this classification assumes — every subject carries a roster
90
+ type, so a mistyped prefix is a blocked commit, not a miscounted row.
91
+ A slug reaches its subject through `git log -1 --grep=<slug>`, so the
92
+ classification rests on the landing commit's *message naming the slug*;
93
+ a Done slug no commit message mentions counts as unclassified however
94
+ correctly that commit is typed, and a later `chore` commit naming the slug
95
+ wins the lookup over an earlier `fix` that did not.
96
+ - **kpi-gate-backlog** — proposed-but-absent gates: `check-*`/`scan-*`
97
+ names appearing anywhere in the queue with no file in any gate-resolution
98
+ dir, over the live gate count. A name with a file on disk is built and
99
+ drops out of the numerator.
100
+ - **kpi-amendment-age** — age in days of the oldest amendment on disk
101
+ (`SPEC-*.md`, git add-date; fixture and template paths excluded, matching the
102
+ published-evidence extractor's amendment-latency harvest); the pressure gauge
103
+ behind canon-kit's short-lived-amendment rule.
104
+ - **kpi-deferred-age** — age of the oldest `Surfaced <date>` mark
105
+ (queue-kit's ungated convention) in the queue's deferred section:
106
+ premise-rot pressure on design-pending work.
107
+ - **kpi-prompt-friction** — distinct/total prompting calls via guard-kit's
108
+ `scan-prompts.sh --count`; `n/a` when guard-kit or its log is absent.
109
+ - **kpi-always-loaded** — the standing per-session surface: level and
110
+ since-baseline delta via context-kit's `always-loaded.sh` meter.
111
+ - **kpi-settings-local** — entry count of the untracked local permission
112
+ overlay (`.claude/settings.local.json` allow/deny/ask, via `jq`); the
113
+ notice signal for guard-kit's close-stage prune/promote step.
114
+ - **kpi-gate-runtime** — full-battery runtime from the runner's timings
115
+ file (`<tmp-dir>/gate-timings.txt`): total, the slowest gates by runtime, and
116
+ the file's reading age — a *measurement*, not live state, so the age
117
+ caveat rides the value.
118
+ - **kpi-overhead** — governance and gate-output share over the overhead
119
+ meter's log (§The overhead meter): the governance share (`pct` averaged
120
+ across the recent window of sessions, carrying the session-count and
121
+ reading-age caveats) and the gate-output share (`gate`/`total` — the axis the
122
+ deferred economy levers target). `--trend` emits `ovh <pct>%`. Degrades
123
+ fail-visible to a "run bin/overhead-meter.sh" n/a row when the log is absent.
124
+ - **kpi-price-table-age** — two rows off the consumer price table
125
+ (`DRIFT_KIT_PRICE_TABLE`, §The stage-economics meter input 3): the age in days
126
+ of its `priced-as-of:` header, and the time to — or past — its optional
127
+ `prices-valid-through:` header. **Both, because at the moment that matters they
128
+ point opposite ways.** Age measures when someone last *typed* the numbers;
129
+ expiry is when the numbers *stop being true*, and nothing makes the first
130
+ predict the second. The failure is an inversion rather than a correlation gap:
131
+ a table retyped the day before a known introductory-pricing row lapses reads
132
+ `priced 1d ago` — freshest exactly when it is least trustworthy. An age-only
133
+ KPI would read reassuringly at the one moment it was built to flag, which is
134
+ why the expiry row exists. Full mode emits
135
+ `priced <N>d ago (as-of <date>)` and either
136
+ `expires in <N>d (through <date>)` or
137
+ `EXPIRED <N>d ago — re-verify (through <date>)`; `--trend` emits `price <N>d`
138
+ and nothing when the age is `n/a`. The expiry row volunteers no second
139
+ fragment — the trend line takes at most one per plugin (§The KPI plugin
140
+ contract) and staleness is the one already specified. Age counts from the
141
+ wall clock (the `kpi-deferred-age` idiom); expiry counts whole calendar days
142
+ against the through-date, which is a calendar claim: `expires in 0d` on the
143
+ last valid day, `EXPIRED 1d ago` the next. Degrades per row and fail-visible:
144
+ `n/a (no priced-as-of: header)`, `n/a (unparseable priced-as-of date)`, and
145
+ for the expiry row `n/a (no prices-valid-through: header)` /
146
+ `n/a (unparseable prices-valid-through date)`. With **no table at all** it
147
+ emits the single `n/a (no price table)` age row and no expiry row — a table
148
+ that is not there has no expiry to report, and one row per absent surface is
149
+ the report's row-count shape. Advisory like every KPI: it never joins
150
+ `gates.list`. A freshness *gate* is ruled out by construction — prices are a
151
+ dated literal with no machine-readable feed, so checking them would mean
152
+ fetching externally, which reds on causes no commit produced and breaks
153
+ hermeticity (site-kit/SPEC.md §The monitor boundary). Reading a date in-tree
154
+ needs no network. The mechanism is kit-generic; no model id, price, or roster
155
+ enters the kit (§The stage-economics meter, the provenance seam).
156
+
157
+ Lag:
158
+
159
+ - **kpi-knowledge-friction** — re-derivations captured this iteration: the
160
+ line count of the knowledge-friction log (§The knowledge-friction loop).
161
+ Lag by construction: only what a session *noticed and logged* is counted,
162
+ so the value lower-bounds the real rate.
163
+
164
+ The lag section is expected to be sparse — most lag measurements (review
165
+ finding rates, detection latency) are manual tallies, and the kit ships no
166
+ fake automation for them; a consumer with a structured source adds its own
167
+ plugin.
168
+
169
+ ## The knowledge-friction loop
170
+
171
+ guard-kit's friction loop catches *permission* friction — its log is fed by
172
+ a hook that fires on every command. Knowledge friction has no hook: a
173
+ session re-derives a fact no doc owns (reads it off an implementation, a
174
+ gate's source, a commit message, or a prior/sibling deliverable it consults
175
+ to shape a new one), gets the right answer, and moves on —
176
+ nothing prompts, nothing logs, and the next session re-pays the same
177
+ derivation. The loop mirrors guard-kit's, with capture moved to convention:
178
+
179
+ 1. **Capture (any session)** — the moment a session catches itself
180
+ re-deriving a fact from a non-owning surface, it appends one line to the
181
+ knowledge-friction log (`.workflow/knowledge-friction.log` by default;
182
+ gitignored per-iteration scratch, the prompt-friction.log pattern):
183
+ `<date> <fact re-derived> ← <surface it was read from>`. One line,
184
+ written at the moment of re-derivation — deferred capture is no capture.
185
+ The affordance is `bin/kfric.sh "<fact>" "<surface>"`: it stamps that
186
+ grammar (date from `date +%F`) into `DRIFT_KIT_KNOWLEDGE_LOG`, creating
187
+ the log's parent dir if missing, and refuses with a usage message and
188
+ exit 2 unless both arguments are present and non-empty. It exists so
189
+ capture is prompt-free — the raw form is a shell redirect
190
+ (`printf … >> <log>`) that no allowlist glob suppresses safely (a
191
+ mid-pattern wildcard is the command-injection shape the bash guard
192
+ catches, and a decorated write trips the guard's decoration rule
193
+ regardless), whereas the helper takes the fact as an argument with no
194
+ caller-side redirect, so its invocation is a safe end-wildcard prefix-glob
195
+ allowlist entry and a permission prompt never turns capture into deferred
196
+ capture. The raw append stays legal as the fallback — the grammar, not
197
+ the writer, is the log's contract; both consumers below read lines, not
198
+ provenance. The convention costs one always-loaded bullet in the
199
+ consumer's instructions file; that line is the loop's hook and must earn
200
+ its recurring cost by the log actually filling. **Seam:** kfric is the
201
+ narrow sensor for a *re-derived fact* only — a *work-shaped* mid-iteration
202
+ finding (a gap, a task, a defect) is not knowledge friction and routes to
203
+ the consumer's committed gap channel instead
204
+ (lifecycle-kit/SPEC.md §The committed gap inbox); overloading this log as a
205
+ backlog inbox dilutes the `kpi-knowledge-friction` signal it exists to carry.
206
+ The prior/sibling-deliverable cue does not relax that seam: consulting a
207
+ prior artifact to shape the next, the conclusion "this artifact's chrome
208
+ *should be owned or generated* rather than copied" is work-shaped and routes
209
+ to the gap inbox; what kfric captures is the narrower *fact re-derived* — the
210
+ specific value or structure reconstructed from the prior artifact because no
211
+ doc owns it.
212
+ 2. **Triage (close)** — `templates/close-knowledge.md`, spliced into the
213
+ consumer's close skill (the close-triage/close-brevity pattern): walk
214
+ the log; for each entry, the remediation is a **doc-owner edit** — give
215
+ the fact a home under the consumer's tier contract (canon-kit's star
216
+ topology: one owner per fact), or a pointer from where the session
217
+ looked to where the owner is. Never a standing session-start
218
+ instruction: that converts one re-derivation into a permanent
219
+ per-session tax, exactly what context-kit's brevity machinery rejects.
220
+ Then clear the log — its named reclaim path. Nothing refuses a close that
221
+ skips the walk, so the log declares itself advisory on the close-surface
222
+ roster (lifecycle-kit/SPEC.md §The close-surface roster) with that clear as
223
+ its reclaim command:
224
+
225
+ close-surface: .workflow/knowledge-friction.log advisory reclaim=: > .workflow/knowledge-friction.log
226
+ 3. **Aggregate (drift)** — `kpi-knowledge-friction` trends the per-iteration
227
+ count; it falls as the tier contract's holes fill. Detection is the
228
+ loop; elimination is a tiering edit.
229
+
230
+ The heavy alternative — periodic LLM-scan of session transcripts reduced to
231
+ each party's messages — is deliberately out of kit scope: it needs harness
232
+ transcript access no kit mechanism owns.
233
+
234
+ ## The published-evidence extractor
235
+
236
+ `bin/trajectory.sh` publishes this repo's own governed trajectory — the
237
+ evidence behind the docs evidence page. The benefits claim is
238
+ *self-referential* by ruling: the extractor emits the governed arm's real
239
+ history and states plainly that no controlled ungoverned baseline exists; a
240
+ synthetic controlled A/B experiment is the separate deferred
241
+ `benchmark-ab-experiment` rung, not this mechanism.
242
+
243
+ The extractor is a pure function of *closed* history — byte-stable across any
244
+ commit that is not a close. Each closed iteration N owns the commit range
245
+ `(close(N-1), close(N)]` (`close(0)` is the empty boundary — the first row runs
246
+ from the root up to its close commit); no range-scoped column reads HEAD, so an
247
+ interstitial commit — filed or hotfixed after a close, before the next scope —
248
+ falls into the *next* iteration's range and surfaces only when that iteration
249
+ closes, leaving every published row byte-identical until a new close lands.
250
+ Totals conserve across rows: every commit up to the last close belongs to
251
+ exactly one range. The extractor reads no now-relative field (no age-from-today)
252
+ either, so re-emission over an unchanged closed history is byte-identical —
253
+ exactly what the consumer freshness gate below byte-compares. It emits one row
254
+ per **closed** iteration (one carrying a
255
+ `close` stamp): an in-flight iteration's counts are still moving, so including
256
+ it would stale the committed projection at every commit — the closed-only rule
257
+ keeps the projection stable between iteration boundaries. Per closed iteration
258
+ it harvests:
259
+
260
+ - **iteration + stages run** — the stamp lines from `WORKFLOW-STATE.txt`'s git
261
+ history (the file truncates at each scope boundary; history keeps every
262
+ stamp), rendered as one slot per configured stage (`DRIFT_KIT_STAGES`, roster
263
+ order), each labelled by its shortest roster-unique prefix, so a skipped or
264
+ non-roster stage reads as a gap.
265
+ - **validate attestations** — the evidence-manifest lines
266
+ (`validate-evidence.txt` history): the per-iteration suite roll-up and any
267
+ non-clean verdict. This is the primary satisfiable-drift surface — a
268
+ commitment made an iteration earlier that silently broke a surface shows as
269
+ a failing suite, not a consistent-looking pass.
270
+ - **amendment latency** — per amendment file, git add-date to delete-date
271
+ (merge), the longest lag in the iteration: the commitment-to-merge gauge. An
272
+ amendment is attributed to the iteration whose range contains its delete
273
+ (merge) commit; its add-date may precede the range start, since latency gauges
274
+ commitment-to-merge wherever the commitment was made. Fixture and template
275
+ amendment paths are excluded from the harvest from day one
276
+ (`kpi-amendment-age` applies the same `*/gate-tests/*`/`*/templates/*`
277
+ exclusion).
278
+ - **commit shape** — the feature/debt split of the iteration's commit subjects
279
+ (`kpi-task-split`'s classification, applied over the same
280
+ `(close(N-1), close(N)]` range).
281
+ - **gate-roster growth** — the `gates.list` member count at the iteration's
282
+ close commit; with the queue's proposed-gate mentions this bounds the
283
+ named-but-unbuilt backlog.
284
+
285
+ Excluded, and stated as a limitation on the framing page: knowledge-friction
286
+ counts — their log is gitignored per-iteration scratch, not committed history,
287
+ so the extractor cannot harvest it and that KPI stays a session-local lower
288
+ bound.
289
+
290
+ Interface: `trajectory.sh --emit` writes the markdown table (one row per closed
291
+ iteration, stable columns) to stdout — the shape the committed projection
292
+ pins; bare invocation prepends a human-oriented header. The extractor degrades
293
+ per surface to an `n/a (<reason>)` cell and exits 0 — drift-kit's fail-visible
294
+ discipline, registering no gate. `DRIFT_KIT_TRAJECTORY_SURFACES` overrides the
295
+ harvested state-file paths (§Layout and configuration).
296
+
297
+ Consumer wiring (this repo, not kit mechanism): the emission is committed at
298
+ `docs/evidence-data.md`, and the consumer gate
299
+ `scripts/check-trajectory-fresh.sh` (registered in `gates.list`) re-emits and
300
+ byte-compares — the gen-pre-commit/check-graph freshness pattern — so a
301
+ hand-edited or stale number is red at commit. The gate carries its own
302
+ `# graph:` manifest coupling `docs/evidence-data.md` to the harvested state
303
+ files, and a `good/`+`bad/` fixture pair that exercises the byte-compare
304
+ hermetically: because the harvest reads real git history, the fixture supplies
305
+ a synthetic emission as a second argument rather than regenerating one.
306
+ `docs/evidence.md` — the framing page, owned by the docs site — carries the
307
+ narrative and cites the data file, hand-copying no numbers.
308
+
309
+ The freshness gate is blind at the enter-close commit by construction: the
310
+ extractor emits the closing iteration's row only once its `close` stamp is in
311
+ committed history, but during that commit's own pre-commit run the stamp is
312
+ not yet history, so the gate regenerates rowlessly and passes — the honest
313
+ limit of a pre-commit projection whose own close is an input. The consumer
314
+ contract closes the gap: the close ritual regenerates the projection in the
315
+ first commit *after* the close stamp lands — for a queue-clearing close, the
316
+ Done-clearing commit, where the regenerated file and the cleared queue ride
317
+ together. To make that commit fire the gate, the consumer freshness gate's
318
+ manifest names the queue file in `trigger=` (a trigger, not a coupled
319
+ surface — the projection's content derives from the state files, not the
320
+ queue, so `couples=` is unchanged and the couples⊆trigger parity holds); a
321
+ close that skipped the regeneration is then red at that commit. CI's full
322
+ battery stays the outer backstop (gate-sdk/SPEC.md §Enforcement tiers).
323
+
324
+ ## The overhead meter
325
+
326
+ `bin/overhead-meter.sh [transcript.jsonl]` measures the methodology's own cost,
327
+ so efficiency claims cut both ways: what fraction of a session's volume is
328
+ governance (gate output, hook payloads, stage ritual, governed-doc reads)
329
+ versus task work. A bare invocation resolves the newest transcript under
330
+ `DRIFT_KIT_SESSIONS_DIR`; the tool is advisory by construction — exit is always
331
+ 0 and it never joins `gates.list`, and a missing transcript is a 0-exit notice,
332
+ not a failure.
333
+
334
+ The measurement is a **byte-proxy at line granularity**, honesty first. Each
335
+ JSONL transcript line is classified whole by a fixed marker table in the script
336
+ — gate-verdict shapes to `gate`, hook/system-reminder blocks and stage-skill
337
+ loads and governed-doc reads to the rest of governance, everything unmatched to
338
+ task work — and its byte length lands in that category. The markers are
339
+ mechanism (kit names, gate-output shapes), never a private vocabulary, so the
340
+ table crosses no provenance seam. Bytes are not tokens and a line is not a
341
+ message: the only claim this buys is *proportion across sessions of the same
342
+ shape*, and every emitting surface carries that caveat parenthetical. No
343
+ transcript content is written out — the meter emits counts and percentages
344
+ only, and its log lives under the gitignored `DRIFT_KIT_METRIC_DIR` (the
345
+ persistent measurement home — an append-only trend must survive the scratch
346
+ wipes `DRIFT_KIT_TMP_DIR` invites), so the private transcript stays private.
347
+
348
+ One line is appended per measured session to `DRIFT_KIT_OVERHEAD_LOG`, grammar
349
+ `<date> <session8> total=<bytes> gov=<bytes> gate=<bytes> pct=<n>` where `pct`
350
+ is the governance share. `session8` is the dedup key the meter reads on append
351
+ — re-measuring a session replaces its line rather than double-counting it. The
352
+ per-category breakdown beyond `gate=` (hook, stage, governed-doc) stays on the
353
+ meter's stdout at measurement time; a log field with no reader is a field
354
+ removed. Field readers: `kpi-overhead` reads `pct`, `gate`, and `total`
355
+ (§Bundled KPIs), plus `date` for the reading-age caveat and the line count for
356
+ the session-count caveat.
357
+
358
+ The producer of the log is the consumer's close-stage binding — this repo's
359
+ `.claude/commands/close.md` invokes the meter on the closing session (consumer
360
+ config, not a lifecycle-kit change) — and any session may invoke it ad hoc.
361
+ Both knobs carry working defaults, so the enabling config ships on by default,
362
+ and the sessions-dir default matches the harness layout this repo already reads
363
+ for stage stamps.
364
+
365
+ The economy levers this meter exists to inform stay *behind* it: **commit-first**
366
+ (the generated hook already runs and prints the coupled gates, so a separate
367
+ pre-battery run duplicates that output) and **failures-only run-gates output**
368
+ (clean lines carry no decision value at battery scale) are evaluation targets,
369
+ not deliverables. Neither lands, and the consumer's always-loaded battery
370
+ wording does not change, until the meter shows gate-output share material over
371
+ several measured sessions — the wording changes *with* the measurement, not
372
+ ahead of it. Their design (a gate-sdk output-mode knob) is a future amendment
373
+ against that data.
374
+
375
+ Sibling meter: §The stage-economics meter prices the token draw this byte-proxy
376
+ does not — they share the `DRIFT_KIT_METRIC_DIR` retention contract and the
377
+ advisory exit-0 posture.
378
+
379
+ ## The stage-economics meter
380
+
381
+ `bin/stage-economics.sh` answers the one question no built-in surface prices:
382
+ **real spend by lifecycle stage × model × iteration**. The overhead meter
383
+ measures governance-versus-task *bytes* and delegation-kit's usage-trend the
384
+ rate-window *percentage*; neither converts a stage's token draw into money. This
385
+ tool does, so the operator can see close-over-close whether the posture that
386
+ rides every stage on Opus (the current all-stages-Opus posture recorded in the
387
+ lead command's ruling-config binding, not a scope-only choice) earns its cost.
388
+
389
+ It is advisory by the same contract as the overhead meter (§The overhead meter):
390
+ exit is always 0, it never joins `gates.list`, and a missing input is a 0-exit
391
+ notice, not a failure. It writes only under `DRIFT_KIT_METRIC_DIR` (the
392
+ gitignored, account-bearing persistent home) and **emits no account
393
+ identifiers** — the trend log carries stage, model, iteration, token counts, and
394
+ priced cost, never the account the tokens billed to.
395
+
396
+ **The join.** Three inputs, joined on the session:
397
+
398
+ 1. **Stamps** — the WORKFLOW-STATE data lines, one per stage-skill invocation,
399
+ grammar `<iteration> <stage> <session-id> <date>` (owned by
400
+ lifecycle-kit/SPEC.md §The state machine; this tool is a read-only consumer of
401
+ that contract, it changes nothing there). The `<session-id>` field is not a raw
402
+ transcript id: it is lifecycle's `session-id.sh` *normalization* of one — a
403
+ leading `agent-` stripped, then the first 8 chars (lifecycle-kit/SPEC.md
404
+ §bin/session-id.sh) — so this repo's stamps carry an 8-char value, `session8`
405
+ below. The stamp supplies the iteration↔stage↔session8 mapping. Read from
406
+ `DRIFT_KIT_STATE_FILE` (§Layout and configuration), defaulting to the same
407
+ state-file path the trajectory extractor already reads — and read as
408
+ **history ∪ live**: that path's *committed history* (added lines in its diff
409
+ across history, the technique §The published-evidence extractor already uses)
410
+ unioned with its *current content*, so a `/scope` boundary truncation of the
411
+ live file destroys no economics. Union rather than replacement because
412
+ replacement blinds the meter to a stage that has stamped but not yet committed
413
+ — precisely the in-flight stage whose economics are being read — and rather
414
+ than fallback because the live file is almost always present and almost always
415
+ truncated, so a fallback arm would never fire on the path that needs it. The
416
+ union costs nothing: the `iteration/stage/session8` dedup already collapses a
417
+ stamp seen in both arms. The reconstruction is **unbounded and carries no depth
418
+ knob**: the trajectory extractor sets the in-kit precedent, and the effective
419
+ bound is already self-enforcing from the transcript side — a stamp whose
420
+ session has aged out of `DRIFT_KIT_SESSIONS_DIR` takes the unmatched path below
421
+ and costs one skipped row. A depth knob would be a second bound with no reader.
422
+ Because unbounded history would turn a per-stamp skip notice into unbounded
423
+ output, unmatched stamps are **counted into one summary line** rather than
424
+ listed; the skipped rows were never logged and still are not.
425
+ **Diagnosing a stage absent from the trend log** — the union makes truncation
426
+ a *non-cause*, and saying so here is the point: a stage whose stamps were
427
+ truncated out of the live file still prices off history, so a missing
428
+ `(iteration, stage)` row means that stamp resolved no transcript (aged out of
429
+ `DRIFT_KIT_SESSIONS_DIR`, counted in the unmatched summary) or that the
430
+ transcript carried no assistant-turn usage — both reported at measurement
431
+ time — and never that the boundary truncation lost it. The standing
432
+ misdiagnosis runs the other way: the union backfills a truncated stage only
433
+ on the first run that reads far enough back, so a log sampled before that run
434
+ shows the stage missing and reads as permanent loss. It is not; re-run the
435
+ meter before concluding the history arm is lossy.
436
+ 2. **Transcripts** — under `DRIFT_KIT_SESSIONS_DIR` (the knob the overhead meter
437
+ already resolves). A stamp's `session8` selects a transcript by applying that
438
+ **same normalization** to each candidate basename and matching — not by a raw
439
+ filename prefix: this repo's stage sessions are subagent transcripts named
440
+ `agent-<hex>.jsonl` whose stamp is `<hex>` truncated to 8 chars, so a raw
441
+ prefix match against the `agent-` prefix would select nothing. Candidates are
442
+ two-tiered, because a subagent transcript is not a sibling of its lead's: a
443
+ lead session sits directly under the sessions dir, while the sessions it
444
+ dispatches sit two levels deep under `<lead-session-id>/subagents/`. The scan
445
+ globs both tiers, so a stage session dispatched by a live lead is found on the
446
+ nested tier and a stage run without one on the flat tier. The tool sums
447
+ the matched session's assistant-turn usage into four token categories —
448
+ `input`, `output`, `cache_read`, `cache_creation` — per model id seen on those
449
+ turns. A streaming transcript repeats a message id across lines (input/cache
450
+ constant, output growing), so the sum keeps the last usage per message id
451
+ before aggregating — summing raw lines would multi-count. Because this repo runs
452
+ one session per stage under `LIFECYCLE_KIT_SESSION_BOUNDARY` (lifecycle-kit/SPEC.md
453
+ §The state machine; its roster owns the setting), a session maps to exactly one
454
+ stage, so per-session usage *is* per-stage usage. Under an iteration-boundary
455
+ consumer a session may span stages, and then it bears **several stamps**. The
456
+ join therefore keys on the **session, not the stamp**: a session's usage is
457
+ summed once and attributed to the `(iteration, stage)` of its **last** stamp,
458
+ and every stamp it yielded takes no row at all, named in a caveat listing the
459
+ yielded pairs. Keying on the stamp is the over-count defect this rule exists to
460
+ forbid — it makes two stamps two keys, resolves the same transcript twice, and
461
+ bills one session's whole burn to both stages in full, so a per-stage figure
462
+ read off it compares one number against a copy of itself. *Assignment, not a
463
+ split*: apportioning a spanning session across its stages would need an
464
+ allocation key — relative effort per stage — that nothing in the join measures,
465
+ and a fabricated key folded into figures a tier decision is read off is worse
466
+ than a stated one, the same rule that decides supervision below (the reserved
467
+ `supervision` value, under The trend log). Last rather than first because the
468
+ stamp is a stage's *first* step, so
469
+ everything after the final stamp is that stage's; the honest limit is that the
470
+ yielded stages under-report, which is why the caveat names them and makes the
471
+ residue countable rather than invisible. Parsing the transcript
472
+ needs `jq`; its absence degrades to a token-less notice rather than a failure.
473
+ 3. **Price table** — a consumer-supplied data file mapping model id → per-token
474
+ price for each of the four categories. This is **consumer config, never a kit
475
+ literal** (the provenance seam, the `check-graph`/`graph-vocab` pattern): the
476
+ per-token prices are public facts, but the *roster of models a consumer runs*
477
+ is theirs, and a kit literal enumerating it would publish that roster. The kit
478
+ ships `templates/price-table.tsv` with placeholder rows and the column schema;
479
+ the consumer copies it and fills their roster. Resolved from
480
+ `DRIFT_KIT_PRICE_TABLE` (§Layout and configuration).
481
+ **Two dating headers, on the same consumer-owned header block.** Each is read
482
+ as the first line of the file matching
483
+ `^#[[:space:]]*<field>:[[:space:]]*<YYYY-MM-DD>`, trailing prose on the same
484
+ line ignored: `priced-as-of:` (when the numbers were last transcribed) and
485
+ `prices-valid-through:` (the last date every row is still true, **optional**).
486
+ Their reader is `kpi-price-table-age` (§Bundled KPIs), not this meter — the
487
+ KPI reads the table's header and never its rows, so an expired table still
488
+ prices, loudly rather than silently, and the meter's arithmetic is untouched
489
+ by either header. Where a row is time-boxed, `prices-valid-through:` **owns**
490
+ that date and the file's own prose cites the header rather than restating it;
491
+ a second copy of a date the day it becomes machine-read is the duplication
492
+ the header exists to remove (de-literalization).
493
+
494
+ **Degradation.** An absent live state file is a notice and the run continues to
495
+ the history arm — committed history can carry stamps for a file absent from the
496
+ working tree — and the 0-exit "nothing to read" notice fires only when *both*
497
+ sources yield no stamps. A price table that is absent, or that has no row for a
498
+ model the transcripts name, degrades that model's cost cell to `n/a` and the tool emits the
499
+ token counts alone — the same degradation contract the trajectory extractor
500
+ applies to an unreadable surface (§Bundled KPIs / §Layout and configuration). Cost
501
+ is additive over priced cells only; an `n/a` cell never poisons the total
502
+ silently — the output carries an "incomplete pricing" caveat when any contributing
503
+ cell degraded.
504
+
505
+ **The under-count bound.** The unmatched counter reports the *stamp with no
506
+ transcript* and is structurally blind to its inverse — the **transcript with no
507
+ stamp**. A stage that continues in a new session (a credential swap mid-stage,
508
+ any resume) leaves that session unstamped, so it matches no stamp and is never
509
+ sought; its burn is invisible rather than wrong. The meter therefore counts the
510
+ transcripts under `DRIFT_KIT_SESSIONS_DIR` that no row claimed and reports the
511
+ count. It is an **upper bound, never an attribution**: a transcript carries no
512
+ iteration and no stage, so nothing in the join could place it, and most
513
+ unstamped transcripts are ordinary non-lifecycle sessions. Sizing the blind spot
514
+ is the whole of what drift-kit can do alone — attributing a continuation would
515
+ need the *stamp* side to record it, which is lifecycle-kit's contract and no
516
+ part of this meter's read-only consumption of it.
517
+
518
+ **The trend log.** One line is appended per `(iteration, stage, model)` triple to
519
+ `DRIFT_KIT_STAGE_ECONOMICS_LOG`, grammar:
520
+
521
+ ```
522
+ <date> <iteration> <stage> <model> in=<tok> out=<tok> cr=<tok> cw=<tok> cost=<usd|n/a>
523
+ ```
524
+
525
+ `cr` is cache-read and `cw` is cache-creation. `cr` is the headline field: the
526
+ motivating dig showed cache-read of accumulated context — not model choice — is
527
+ the dominant burn (build ~73% of session cost, climbing 37M→86M cr-tokens per
528
+ session), so the field exists to keep that lever visible close-over-close. The
529
+ dedup key read on append is the `<iteration> <stage> <model>` triple —
530
+ re-measuring a triple replaces its line rather than double-counting, exactly as
531
+ the overhead meter dedups on `session8`. That key is also what makes the
532
+ history ∪ live read safe with no added mechanism: a history arm re-derives rows
533
+ already logged, and re-derivation replaces a triple's line rather than
534
+ double-counting it. Any per-model sub-breakdown beyond these
535
+ fields stays on stdout at measurement time; a log field with no reader is a field
536
+ removed. Field readers: the `/economics` narrative reads `cost` and the four token
537
+ fields (`cr` headline); the operator reads `cost` close-over-close; the deferred
538
+ `benchmark-ab-experiment` rung's measurement half consumes this log rather than
539
+ rebuilding it; `date` carries the reading-age caveat. `date` is the
540
+ **measurement** date, not the stage's — and under the history read the two can be
541
+ far apart, because re-deriving an old iteration restamps its row to the day it
542
+ was re-measured. The reading-age caveat stays correct (it ages the reading, which
543
+ is what it says), but the field may not be read as "when this stage ran": the
544
+ stage's own date is in the stamp, and the trajectory extractor is the surface
545
+ that renders it.
546
+
547
+ **The reserved `supervision` value — the lead's burn is its own row.** Under a
548
+ split-lead posture the lead session dispatches, verifies, and runs batteries
549
+ while carrying **no stamp**, so it appears in no row and every per-stage total
550
+ understates the iteration's true cost by the whole supervision line item. The
551
+ meter emits it as a distinct row instead, labelled by
552
+ `DRIFT_KIT_SUPERVISION_LABEL` (§Layout and configuration). *A row rather than an
553
+ apportionment across stages*: spreading the lead's burn over stages would need
554
+ an allocation key with no basis in anything measured — the lead's burn is not
555
+ proportional to any stage's tokens — and would fold a fabricated number into
556
+ figures a tier decision is read off, where a distinct row is a visible line item
557
+ the operator can accept, discount, or ignore. The meter's contract is that a
558
+ degraded or absent measurement is visible, never silently folded (§The report
559
+ skeleton); the same rule decides this.
560
+
561
+ - **The column's widened meaning.** `<stage>` reads **stage *or* cost-bearing
562
+ role**, not stage alone. A supervision row is a role that carries cost and no
563
+ stamp — never a lifecycle stage that dropped out of the roster. The column's
564
+ members were roster-closed until this value existed, and a reader who assumes
565
+ they still are would misdiagnose the row as roster drift.
566
+ - **The producer — derivation from the transcript path, not from a stamp.** The
567
+ two-tier scan above already resolves a dispatched stage session at
568
+ `<sessions-dir>/<lead-session-id>/subagents/<agent>.jsonl` while a lead sits
569
+ directly under the sessions dir. So for every stamp whose transcript resolved
570
+ on the **nested** tier, that path's `<lead-session-id>` component names the
571
+ supervisor and the stamp supplies the iteration. The meter collects
572
+ `(lead-session, iteration)` → dispatch count, resolves each lead's own
573
+ transcript on the flat tier, and sums its assistant-turn usage per model with
574
+ the same last-usage-per-message-id reader — no second parser. **No lifecycle
575
+ change**: the lead still stamps nothing and moves no cursor; the supervising
576
+ session is *derived*, which is what keeps this a read-only consumption of
577
+ lifecycle-kit/SPEC.md §The state machine.
578
+ - **The attribution invariant.** A transcript's usage is attributed to exactly
579
+ one `(iteration, stage)` pair — the rule the session-keyed join above enforces
580
+ for stage rows, and the reason a lead whose own transcript already carried a
581
+ stage row yields no supervision row. In the ordinary case a lead supervises one
582
+ iteration and its whole usage lands on that iteration's supervision row —
583
+ exact, no key. A lead spanning two or more iterations **apportions in
584
+ proportion to the number of stamped stage sessions it dispatched per
585
+ iteration**, integer-split with the remainder to the iteration holding the most
586
+ dispatches (ties broken by iteration name, so the split is deterministic and
587
+ the parts re-sum to the whole). The run's caveat names that key: a disclosed
588
+ key is honest and a silent one is not.
589
+ - **Collision rule.** If any stamp the run reads names a stage equal to the
590
+ label, the meter emits a visible notice naming `DRIFT_KIT_SUPERVISION_LABEL`
591
+ and emits **no** supervision rows that run. It is checkable from data the meter
592
+ already reads — its own stamps — so this adds no roster dependency and no
593
+ second bound to drift.
594
+ - **Degradation.** A run with no nested-tier match (a stage run without a live
595
+ lead) emits no supervision row and no notice: zero supervision burn is the
596
+ honest reading, not a missing measurement. A lead transcript aged out of the
597
+ sessions dir takes the existing unmatched-summary path.
598
+ - **No new field.** The four token fields, `cost`, and `date` carry a supervision
599
+ row exactly as they carry a stage row, and the dedup key, the
600
+ replace-on-re-measure behavior, and every existing reader work unchanged —
601
+ `supervision` is a value in an existing column, not a new field. The
602
+ apportionment key and the collision notice are **stdout caveats at measurement
603
+ time**, not log fields; a log field with no reader is a field removed, and
604
+ neither has one. The row's own named reader is the `/economics` narrative's
605
+ supervision line item (§The `/economics` skill).
606
+ - **Blast radius of the widened column.** The log has one parsing reader in
607
+ production code — this meter's own dedup grep — and one asserting reader in the
608
+ harness, `smoke/install.sh`, which counts log lines. No *gate* reads it (it
609
+ lives under the gitignored `DRIFT_KIT_METRIC_DIR`), and the `/economics`
610
+ narrative reads it as prose rather than parsing the stage column.
611
+ **`bin/trajectory.sh` does not parse this column at all** — the reader worth
612
+ naming, since it is the surface a hardcoded stage roster once broke; it reads
613
+ stamps and its own `DRIFT_KIT_STAGES` roster, never this log. So a non-stage
614
+ value in the column cannot silently fall out of a roster the way the
615
+ trajectory's stamps did.
616
+
617
+ ## The `/economics` skill
618
+
619
+ `/economics` is the customer-facing post-iteration narrative: run at close, it
620
+ chains `bin/overhead-meter.sh` → `bin/stage-economics.sh` into one report
621
+ answering "what did this iteration cost, where, and was the model posture worth
622
+ it". `stage-economics` is the sole cost-attribution surface — it prices
623
+ per-transcript, per-stage, per-model token draw (the token SSOT), while
624
+ `overhead-meter` contributes the governance share, not a cost figure. The
625
+ narrative deliberately excludes delegation-kit's usage-trend budget-%: that
626
+ rate-window footprint is account-wide — confounded by overlapping sessions and
627
+ by a second operator on the same account — so it is the wrong instrument for
628
+ per-iteration cost attribution, and carrying it beside the per-transcript token
629
+ SSOT put a confounded advisory number next to a clean one a reader could
630
+ over-trust as this iteration's cost. It ships as a drift-kit skill
631
+ template `templates/economics.md`, materialized in the consumer as the copy
632
+ `.claude/commands/economics.md` — the template↔consumer-copy split the guard/hook
633
+ skills use, its one bound slot the consumer's model posture. It is not a lifecycle
634
+ stage (it moves no cursor, stamps nothing) and so is outside
635
+ `check-stage-skill-coverage`'s stage roster; it is a reporting ritual the close
636
+ skill may invoke, never a gate.
637
+
638
+ ## Layout and configuration
639
+
640
+ ```
641
+ drift-kit/
642
+ bin/drift-report.sh
643
+ bin/trajectory.sh # the published-evidence extractor
644
+ bin/kfric.sh # the knowledge-friction capture affordance
645
+ bin/overhead-meter.sh # the governance-overhead byte-proxy meter
646
+ bin/stage-economics.sh # the stage × model × iteration spend pricer
647
+ kpis/kpi-*.sh # the bundled generic set
648
+ templates/drift-config.sh
649
+ templates/kpis.list # example registry (consumer copies + prunes)
650
+ templates/kpi-deprecated-surface.sh # example toolchain-shaped KPI (§Out of scope)
651
+ templates/close-knowledge.md
652
+ templates/price-table.tsv # placeholder + schema for the stage-economics price table (consumer fills the roster)
653
+ templates/economics.md # the /economics close-cadence skill template
654
+ smoke/install.sh
655
+ smoke/overhead-fixture.jsonl # synthetic transcript driving the classifier smoke
656
+ ```
657
+
658
+ Registers no gates (advisory; the guard-kit precedent), so no `checks/`,
659
+ `gate-tests/`, or `smoke/violation.sh`.
660
+
661
+ Config follows the established kit pattern: copy `templates/drift-config.sh`
662
+ into the gates dir (or point `DRIFT_KIT_CONFIG_FILE` elsewhere) and override
663
+ any knob; defaults fill what the consumer left unset, and a set-but-missing
664
+ `DRIFT_KIT_CONFIG_FILE` exits 2 rather than silently running on defaults.
665
+ Knobs (this repo's layout as defaults):
666
+
667
+ - `DRIFT_KIT_KPIS_FILE` — the registry; default
668
+ `${GATE_SDK_GATES_DIR:-scripts}/kpis.list`.
669
+ - `DRIFT_KIT_KPI_DIRS` — extra resolution roots searched before the
670
+ vendored kits' `kpis/` dirs; default: the consumer gates dir.
671
+ - `DRIFT_KIT_QUEUE_FILE` — default `${GATE_SDK_QUEUE_FILE:-TASK-QUEUE.md}`.
672
+ - `DRIFT_KIT_KNOWLEDGE_LOG` — default
673
+ `${GATE_SDK_WORKFLOW_DIR:-.workflow}/knowledge-friction.log`.
674
+ - `DRIFT_KIT_TIMINGS_FILE` — default
675
+ `${GATE_SDK_TMP_DIR:-.tmp}/gate-timings.txt`.
676
+ - `DRIFT_KIT_TMP_DIR` — plugin scratch root; default
677
+ `${GATE_SDK_TMP_DIR:-.tmp}`. Members are regenerated on every run, so a
678
+ scratch wipe is harmless.
679
+ - `DRIFT_KIT_METRIC_DIR` — the persistent measurement home, distinct from
680
+ `DRIFT_KIT_TMP_DIR` by retention contract: metric-dir members are
681
+ append-only trend logs that survive scratch wipes. Default `.metric`. The
682
+ dir must be gitignored and never committed — trend samples carry account
683
+ identifiers and per-session refs, so committing it publishes them (the
684
+ retention/privacy contract is kit-generic; a consumer's provenance seam
685
+ makes the gitignore load-bearing).
686
+ - `DRIFT_KIT_SESSIONS_DIR` — the agent transcript directory the overhead
687
+ meter reads for a bare invocation; default
688
+ `${CLAUDE_CONFIG_DIR:-$HOME/.claude}/projects/<cwd-slug>`, where `<cwd-slug>`
689
+ is the working directory with every non-alphanumeric replaced by `-` (the
690
+ derivation lifecycle-kit's stage stamps already apply; drift-kit re-derives
691
+ with its own knob rather than importing a sibling kit's bin contract).
692
+ - `DRIFT_KIT_OVERHEAD_LOG` — the overhead meter's append log; default
693
+ `$DRIFT_KIT_METRIC_DIR/overhead-log.txt` (gitignored, so the private
694
+ transcript's derived counts never enter version control; the meter
695
+ `mkdir -p`s the log's dirname). All three resolvers — the meter,
696
+ `kpi-overhead`, and the collator's namespace export — compute this same
697
+ default, and the smoke's writer/reader assertion holds them together
698
+ (§Testing).
699
+ - `DRIFT_KIT_DONE_SECTION` / `DRIFT_KIT_DEFERRED_SECTION` — queue section
700
+ headings the task-split and deferred-age KPIs scan; defaults `Done` /
701
+ `Deferred` (queue-kit's).
702
+ - `DRIFT_KIT_TRAJECTORY_SURFACES` — the state-file paths the trajectory
703
+ extractor harvests, given as `<state-file> <evidence-file>`; default
704
+ `${GATE_SDK_WORKFLOW_DIR:-.workflow}/WORKFLOW-STATE.txt` and its
705
+ `validate-evidence.txt` sibling. A surface it cannot read degrades that
706
+ iteration's cell to `n/a`.
707
+ - `DRIFT_KIT_GATES_FILE` — the registry whose member count the trajectory
708
+ extractor reads at each close commit (gate-roster growth); default
709
+ `${GATE_SDK_GATES_DIR:-scripts}/gates.list`.
710
+ - `DRIFT_KIT_STAGES` — the ordered stage roster the trajectory extractor
711
+ renders (one slot per stage, labelled by its shortest roster-unique prefix);
712
+ default `(scope align build validate close)`, which reduces to the frozen
713
+ single-letter header. A consumer running a wider roster derives this from its
714
+ sole roster owner — this repo's `scripts/drift-config.sh` sources
715
+ `scripts/lifecycle-config.sh` and copies `LIFECYCLE_KIT_STAGES`, the SSOT
716
+ activation — rather than re-listing. Third instance of drift-kit re-deriving a
717
+ cross-kit fact with its own knob rather than importing a sibling kit's bin
718
+ contract (alongside `DRIFT_KIT_SESSIONS_DIR` and `DRIFT_KIT_STATE_FILE`).
719
+ - `DRIFT_KIT_STAGE_ECONOMICS_LOG` — the stage-economics append trend log; default
720
+ `$DRIFT_KIT_METRIC_DIR/stage-economics-log.txt` (gitignored; the meter
721
+ `mkdir -p`s the dirname).
722
+ - `DRIFT_KIT_PRICE_TABLE` — the consumer-owned model→price roster the
723
+ stage-economics meter prices through; default
724
+ `${GATE_SDK_GATES_DIR:-scripts}/price-table.tsv` (beside `graph-vocab.sh`, the
725
+ consumer-config precedent). Absent, cost degrades to `n/a` and tokens still report.
726
+ - `DRIFT_KIT_SUPERVISION_LABEL` — the reserved value the stage-economics meter
727
+ writes into the trend log's `<stage>` column for a lead's own burn
728
+ (§The stage-economics meter, the reserved `supervision` value); default
729
+ `supervision`. A consumer whose
730
+ lifecycle roster already carries that word renames it here; a stamp naming the
731
+ label collides and suppresses the rows for that run rather than blending two
732
+ meanings into one column value.
733
+ - `DRIFT_KIT_STATE_FILE` — the WORKFLOW-STATE path whose *committed history and
734
+ live content* the stage-economics join reads for stamps (§The stage-economics
735
+ meter, history ∪ live); default `${GATE_SDK_WORKFLOW_DIR:-.workflow}/WORKFLOW-STATE.txt` (the
736
+ same default the trajectory extractor's surface list computes — drift-kit
737
+ re-derives with its own knob rather than importing a sibling kit's bin contract,
738
+ the established `DRIFT_KIT_SESSIONS_DIR` precedent).
739
+
740
+ Per-KPI couplings (which meter, which log, which scan flag) are the
741
+ plugins' own headers, not knobs — a consumer retargeting one edits its copy
742
+ in the consumer dir (registry shadowing), the guard/hook consumer-copy
743
+ precedent.
744
+
745
+ ## Testing
746
+
747
+ The report and every bundled plugin are advisory plain text over live git
748
+ state — not fixture-stable, so no expected-output corpus (the gate
749
+ contracts do not fit; context-kit's reasoning). `smoke/install.sh` builds
750
+ the throwaway consumer, registers the bundled set, and asserts: exit 0 with
751
+ both section headers and one row per registered KPI; a registry naming a
752
+ missing plugin yields its visible `n/a` row without failing; `--trend`
753
+ emits exactly one line. The trajectory extractor needs committed history the
754
+ throwaway consumer lacks, so `smoke/install.sh` proves it against a hermetic
755
+ fake-history repo — one closed, range-bounded iteration — and asserts the
756
+ table parses, that iteration's row is emitted, and the in-flight iteration's
757
+ is not. The overhead meter has a fixed classifier, so it *is* fixture-stable:
758
+ `smoke/overhead-fixture.jsonl` carries known category bytes, and
759
+ `smoke/install.sh` drives the meter over it and asserts the log-line grammar,
760
+ that the task line is excluded from governance, that `gate` is a proper subset
761
+ of `gov`, that `pct` is the rounded governance share, and that a re-measure
762
+ replaces the session's line rather than doubling it; kpi-overhead is exercised
763
+ over that log (its two lead rows and the `ovh` trend fragment) and in its
764
+ log-absent degradation. The writer/reader-divergence assertion runs meter and
765
+ KPI under one `DRIFT_KIT_METRIC_DIR` override with no explicit
766
+ `DRIFT_KIT_OVERHEAD_LOG` and asserts the reader finds the log the writer
767
+ wrote — the surviving divergence surface the namespace export cannot guard:
768
+ writer and reader computing *defaults* independently. The stage-economics meter
769
+ is likewise fixture-driven: `smoke/install.sh` drives the join over a synthetic
770
+ fixture set — a small WORKFLOW-STATE stamp file, a synthetic transcript carrying
771
+ usage records for the stamped `session8`, and a placeholder price table — and
772
+ asserts the emitted trend line's fields (the `<iteration> <stage> <model>`
773
+ grouping and the `in`/`out`/`cr`/`cw`/`cost` values), that a re-measure replaces
774
+ the triple's line rather than doubling it, and the `n/a` cost cell plus the
775
+ incomplete-pricing caveat when the priced model has no row (the price-table-absent
776
+ degradation). Its **history ∪ live** read is proved against the same hermetic
777
+ fake-history repo the trajectory extractor uses, which already carries the
778
+ truncation shape: that repo's live WORKFLOW-STATE was overwritten with the
779
+ in-flight iteration's stamp, so the closed iteration's stamps survive only in
780
+ committed history. One run asserts both arms — the history-only stamp prices
781
+ (replacement would lose it) and the live-only stamp prices (a history-only read
782
+ would lose the uncommitted tail). Two further stage-economics fixtures each get
783
+ **their own sessions dir, state file, and log**, because the flat fixture set's
784
+ log is asserted to hold exactly one line and a second row there would red that
785
+ assertion rather than the behavior under test. (i) A *two-stamp* fixture — one
786
+ session stamped into a further stage — asserts the log holds exactly one line, that
787
+ the row names the **last** stamp's stage, and that the yielded stamp is named in
788
+ the collapsed caveat; a transcript matching no stamp sits in the same dir and
789
+ asserts the unstamped-transcript bound reports it. (ii) A *nested-tier* fixture —
790
+ a synthetic `<lead>/subagents/<agent>.jsonl` beside a flat `<lead>.jsonl` —
791
+ asserts exactly one supervision row is emitted for the iteration carrying the
792
+ lead transcript's own usage, that the dispatched session keeps its own stage row,
793
+ that the row's label is `DRIFT_KIT_SUPERVISION_LABEL`'s value rather than a
794
+ literal, and that a stamp naming the label suppresses the row with the collision
795
+ notice. `kpi-price-table-age` is fixture-stable in the same way — it reads two
796
+ dates out of a file the fixture writes — so `smoke/install.sh` drives it over
797
+ purpose-built tables and asserts the age row, the `price <N>d` trend fragment,
798
+ each header's absence degrading its own row independently, and — **the
799
+ inversion the KPI exists for** — that a table whose `priced-as-of:` is *today*
800
+ and whose `prices-valid-through:` has passed reads a fresh age row and an
801
+ `EXPIRED` expiry row in the same breath. A fixture that pins only the age row
802
+ has not tested the feature: the age row is reassuring in exactly that case,
803
+ which is the defect. The no-table degradation is asserted to emit its single
804
+ `n/a (no price table)` row, and the report-wide one-row-per-registered-KPI
805
+ assertion covers that shape from the other side. Gate-sdk's `check-shellcheck`
806
+ lints all kit sources as usual.
807
+
808
+ ## Out of scope
809
+
810
+ Toolchain-shaped KPIs are consumer content: orphan-crate and bare-`#[allow]`
811
+ scans (Rust-specific dead-surface detection) and a `TODO(spec-ambiguity)`
812
+ marker count (a marker convention is consumer vocabulary; generalize the
813
+ convention first if it ever ships). A deprecated-surface trend is the same
814
+ shape — it counts markers over the consumer's `CANON_KIT_DEPRECATION_MARKERS`
815
+ roster (canon-kit's `check-deprecation-task` vocabulary), so it ships as
816
+ `templates/kpi-deprecated-surface.sh`, an **example** the consumer registers in
817
+ its `kpis.list` rather than a bundled plugin under `kpis/`: the marker spelling
818
+ is a consumer literal, and the kit stays deprecation-neutral. Registered, it
819
+ trends the live-marker backlog between majors so it surfaces gradually instead
820
+ of at one release; it degrades to `n/a` when the roster is unset (the bundled
821
+ plugins' fail-visible discipline). The release-boundary disposition walk over
822
+ the same roster is lifecycle-kit's `release-sweep` skill template. So are product-workflow KPIs: gate
823
+ exemptions (a `scan-exceptions` disposition split) and backlog-aging finding
824
+ counts — both read consumer gates. A narration-marker by-eye count is
825
+ superseded by canon-kit's `check-manifest-temporal`, which gates the same axis
826
+ instead of trending it. The always-loaded baseline mechanics are context-kit's
827
+ surface; drift-kit ships only the `kpi-always-loaded` plugin that reads its
828
+ meter.