checkwright 0.21.0 → 0.23.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 (489) hide show
  1. package/README.md +1013 -50
  2. package/lib/common/digest.sh +18 -0
  3. package/lib/common/lock.sh +40 -0
  4. package/lib/common/profile.sh +33 -0
  5. package/lib/common/recipe.sh +56 -43
  6. package/lib/diff.sh +64 -0
  7. package/lib/doctor.sh +81 -7
  8. package/lib/init.sh +167 -52
  9. package/lib/uninstall.sh +212 -0
  10. package/lib/update.sh +34 -0
  11. package/package.json +2 -2
  12. package/payload/artifact/targets.list +30 -0
  13. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates +0 -0
  14. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates.sha256 +1 -0
  15. package/payload/canon-kit/README.md +2 -0
  16. package/payload/canon-kit/SPEC.md +666 -59
  17. package/payload/canon-kit/checks/check-amendment-queue.sh +1 -0
  18. package/payload/canon-kit/checks/check-comment-tier.gate +3 -0
  19. package/payload/canon-kit/checks/check-deprecation-task.gate +3 -0
  20. package/payload/canon-kit/checks/check-docs-cmd.gate +3 -0
  21. package/payload/canon-kit/checks/check-docs-link-convention.sh +12 -4
  22. package/payload/canon-kit/checks/check-install-claim.gate +3 -0
  23. package/payload/canon-kit/checks/check-knob-citation.gate +3 -0
  24. package/payload/canon-kit/checks/check-knob-default-coupling.sh +1 -0
  25. package/payload/canon-kit/checks/check-manifest-count.gate +3 -0
  26. package/payload/canon-kit/checks/check-manifest-temporal.gate +3 -0
  27. package/payload/canon-kit/checks/check-md-refs.gate +3 -0
  28. package/payload/canon-kit/checks/check-measured-claim.gate +3 -0
  29. package/payload/canon-kit/checks/check-payload-claim.gate +3 -0
  30. package/payload/canon-kit/checks/check-prose-enum.gate +3 -0
  31. package/payload/canon-kit/checks/check-prose-tells.sh +1 -0
  32. package/payload/canon-kit/checks/check-spec-derivable-section.gate +3 -0
  33. package/payload/canon-kit/checks/check-spec-dod-singleton.gate +3 -0
  34. package/payload/canon-kit/checks/check-spec-embedded-source.sh +1 -0
  35. package/payload/canon-kit/checks/check-spec-fence-balance.gate +3 -0
  36. package/payload/canon-kit/checks/check-spec-pointer.gate +3 -0
  37. package/payload/canon-kit/checks/check-surface-duplication.sh +1 -0
  38. package/payload/canon-kit/checks/check-todo-task-liveness.gate +3 -0
  39. package/payload/canon-kit/checks/check-tracking-claim.gate +3 -0
  40. package/payload/canon-kit/gate-tests/check-comment-tier/bad/.workflow/fixture-state.txt +4 -0
  41. package/payload/canon-kit/gate-tests/check-comment-tier/bad/bad.gate +4 -0
  42. package/payload/canon-kit/gate-tests/check-comment-tier/bad/bad.rs +5 -0
  43. package/payload/canon-kit/gate-tests/check-comment-tier/bad/expect.txt +4 -0
  44. package/payload/canon-kit/gate-tests/check-comment-tier/bad/templates/bad-tmpl.sh +4 -0
  45. package/payload/canon-kit/gate-tests/check-comment-tier/good/.workflow/fixture-state.txt +3 -0
  46. package/payload/canon-kit/gate-tests/check-comment-tier/good/expect.txt +1 -1
  47. package/payload/canon-kit/gate-tests/check-comment-tier/good/good.gate +4 -0
  48. package/payload/canon-kit/gate-tests/check-comment-tier/good/good.rs +5 -0
  49. package/payload/canon-kit/gate-tests/check-comment-tier/good/good.sh +3 -0
  50. package/payload/canon-kit/gate-tests/check-comment-tier/good/templates/good-tmpl.sh +5 -0
  51. package/payload/canon-kit/gate-tests/check-comment-tier.test.sh +29 -5
  52. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/.workflow/fixture-state.txt +3 -0
  53. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/bad.gate +2 -0
  54. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/bad.rs +4 -0
  55. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/expect.txt +3 -0
  56. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/scripts/canon-config.sh +6 -5
  57. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/templates/tmpl.sh +5 -0
  58. package/payload/canon-kit/gate-tests/check-deprecation-task/good/.workflow/fixture-state.txt +3 -0
  59. package/payload/canon-kit/gate-tests/check-deprecation-task/good/expect.txt +1 -1
  60. package/payload/canon-kit/gate-tests/check-deprecation-task/good/good.gate +2 -0
  61. package/payload/canon-kit/gate-tests/check-deprecation-task/good/good.rs +4 -0
  62. package/payload/canon-kit/gate-tests/check-deprecation-task/good/scripts/canon-config.sh +6 -5
  63. package/payload/canon-kit/gate-tests/check-deprecation-task/good/templates/tmpl.sh +5 -0
  64. package/payload/canon-kit/gate-tests/check-deprecation-task.test.sh +4 -3
  65. package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/OUTSIDE.md +4 -0
  66. package/payload/canon-kit/gate-tests/check-docs-link-convention/bad/docs/index.md +3 -0
  67. package/payload/canon-kit/gate-tests/check-docs-link-convention/good/OUTSIDE.md +4 -0
  68. package/payload/canon-kit/gate-tests/check-docs-link-convention/good/docs/methodology.md +8 -0
  69. package/payload/canon-kit/gate-tests/check-docs-link-convention.test.sh +94 -0
  70. package/payload/canon-kit/gate-tests/check-knob-citation.test.sh +2 -2
  71. package/payload/canon-kit/gate-tests/check-manifest-count/good/SPEC.md +4 -0
  72. package/payload/canon-kit/gate-tests/check-manifest-count.test.sh +32 -8
  73. package/payload/canon-kit/gate-tests/check-md-refs.test.sh +61 -9
  74. package/payload/canon-kit/gate-tests/check-measured-claim/bad/SPEC.md +12 -0
  75. package/payload/canon-kit/gate-tests/check-measured-claim/bad/expect.txt +3 -0
  76. package/payload/canon-kit/gate-tests/check-measured-claim/bad/scripts/canon-config.sh +6 -0
  77. package/payload/canon-kit/gate-tests/check-measured-claim/good/SPEC.md +23 -0
  78. package/payload/canon-kit/gate-tests/check-measured-claim/good/expect.txt +1 -0
  79. package/payload/canon-kit/gate-tests/check-measured-claim/good/scripts/canon-config.sh +6 -0
  80. package/payload/canon-kit/gate-tests/check-measured-claim.test.sh +90 -0
  81. package/payload/canon-kit/gate-tests/check-payload-claim/bad/README.md +15 -0
  82. package/payload/canon-kit/gate-tests/check-payload-claim/bad/expect.txt +2 -0
  83. package/payload/canon-kit/gate-tests/check-payload-claim/bad/install.md +19 -0
  84. package/payload/canon-kit/gate-tests/check-payload-claim/bad/posts/note.md +6 -0
  85. package/payload/canon-kit/gate-tests/check-payload-claim/bad/scripts/canon-config.sh +8 -0
  86. package/payload/canon-kit/gate-tests/check-payload-claim/bad/scripts/payload-claims.sh +7 -0
  87. package/payload/canon-kit/gate-tests/check-payload-claim/good/README.md +15 -0
  88. package/payload/canon-kit/gate-tests/check-payload-claim/good/expect.txt +2 -0
  89. package/payload/canon-kit/gate-tests/check-payload-claim/good/install.md +20 -0
  90. package/payload/canon-kit/gate-tests/check-payload-claim/good/posts/note.md +6 -0
  91. package/payload/canon-kit/gate-tests/check-payload-claim/good/scripts/canon-config.sh +8 -0
  92. package/payload/canon-kit/gate-tests/check-payload-claim/good/scripts/payload-claims.sh +7 -0
  93. package/payload/canon-kit/gate-tests/check-prose-enum.test.sh +27 -4
  94. package/payload/canon-kit/gate-tests/check-spec-dod-singleton.test.sh +21 -7
  95. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/.workflow/fixture-state.txt +2 -0
  96. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/bad.gate +2 -0
  97. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/bad.rs +4 -0
  98. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/expect.txt +4 -0
  99. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/templates/tmpl.sh +5 -0
  100. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/widget.sh +1 -0
  101. package/payload/canon-kit/gate-tests/check-spec-pointer/good/.workflow/fixture-state.txt +2 -0
  102. package/payload/canon-kit/gate-tests/check-spec-pointer/good/expect.txt +1 -1
  103. package/payload/canon-kit/gate-tests/check-spec-pointer/good/good.gate +2 -0
  104. package/payload/canon-kit/gate-tests/check-spec-pointer/good/good.rs +4 -0
  105. package/payload/canon-kit/gate-tests/check-spec-pointer/good/templates/tmpl.sh +5 -0
  106. package/payload/canon-kit/gate-tests/check-spec-pointer/good/widget.sh +1 -0
  107. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/.workflow/fixture-state.txt +3 -0
  108. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/bad.gate +2 -0
  109. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/bad.rs +4 -0
  110. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/expect.txt +3 -0
  111. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/templates/tmpl.sh +5 -0
  112. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/.workflow/fixture-state.txt +3 -0
  113. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/expect.txt +1 -1
  114. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/good.gate +2 -0
  115. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/good.rs +4 -0
  116. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/templates/tmpl.sh +5 -0
  117. package/payload/canon-kit/gate-tests/check-tracking-claim.test.sh +1 -2
  118. package/payload/canon-kit/lib/spec.sh +109 -70
  119. package/payload/canon-kit/smoke/install.sh +21 -1
  120. package/payload/canon-kit/templates/SPEC-amendment.md +9 -2
  121. package/payload/context-kit/README.md +4 -1
  122. package/payload/context-kit/SPEC.md +166 -9
  123. package/payload/context-kit/bin/env-probe.sh +19 -6
  124. package/payload/context-kit/checks/check-brevity.sh +1 -0
  125. package/payload/context-kit/checks/check-footprint-fresh.sh +1 -0
  126. package/payload/context-kit/checks/check-memory-off.sh +1 -0
  127. package/payload/context-kit/checks/check-settings-paths.sh +94 -0
  128. package/payload/context-kit/checks/check-settings-pins.sh +1 -0
  129. package/payload/context-kit/gate-tests/check-settings-paths/bad/args +1 -0
  130. package/payload/context-kit/gate-tests/check-settings-paths/bad/expect.txt +3 -0
  131. package/payload/context-kit/gate-tests/check-settings-paths/bad/settings.json +12 -0
  132. package/payload/context-kit/gate-tests/check-settings-paths/bad/tools/real-tool.sh +4 -0
  133. package/payload/context-kit/gate-tests/check-settings-paths/good/args +1 -0
  134. package/payload/context-kit/gate-tests/check-settings-paths/good/expect.txt +1 -0
  135. package/payload/context-kit/gate-tests/check-settings-paths/good/settings.json +16 -0
  136. package/payload/context-kit/gate-tests/check-settings-paths/good/tools/real-tool.sh +4 -0
  137. package/payload/context-kit/index-tests/expected/toolfloor.txt +9 -0
  138. package/payload/context-kit/index-tests/toolfloor-cases.sh +20 -0
  139. package/payload/context-kit/lib/toolfloor.sh +15 -4
  140. package/payload/context-kit/smoke/agents-md.sh +12 -1
  141. package/payload/context-kit/smoke/install.sh +4 -1
  142. package/payload/delegation-kit/README.md +3 -3
  143. package/payload/delegation-kit/SPEC.md +499 -26
  144. package/payload/delegation-kit/bin/run-dispatch-guard-tests.sh +97 -0
  145. package/payload/delegation-kit/checks/check-agent-tier-explicit.sh +1 -0
  146. package/payload/delegation-kit/checks/check-gate-tamper.sh +2 -1
  147. package/payload/delegation-kit/checks/check-rule-citation.sh +1 -0
  148. package/payload/delegation-kit/lib/delegation.sh +1 -0
  149. package/payload/delegation-kit/smoke/install.sh +2 -1
  150. package/payload/delegation-kit/templates/agent-dispatch-guard.sh +61 -0
  151. package/payload/delegation-kit/templates/agent-execution.md +127 -12
  152. package/payload/delegation-kit/templates/delegation-config.sh +4 -0
  153. package/payload/delegation-kit/templates/dispatch-checklists.md +1 -1
  154. package/payload/delegation-kit/templates/statusline-usage.sh +23 -1
  155. package/payload/delegation-kit/usage-tests/dispatch-guard-cases.tsv +30 -0
  156. package/payload/doctrine-kit/DOCTRINE.md +112 -11
  157. package/payload/doctrine-kit/README.md +12 -3
  158. package/payload/doctrine-kit/SPEC.md +163 -11
  159. package/payload/doctrine-kit/bin/install-doctrine.sh +167 -17
  160. package/payload/doctrine-kit/checks/check-doctrine-registration.sh +41 -11
  161. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/bad/DOCTRINE.md +3 -0
  162. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/good/DOCTRINE.md +3 -0
  163. package/payload/doctrine-kit/gate-tests/check-doctrine-registration.test.sh +82 -2
  164. package/payload/doctrine-kit/smoke/install.sh +167 -1
  165. package/payload/drift-kit/README.md +3 -2
  166. package/payload/drift-kit/SPEC.md +264 -22
  167. package/payload/drift-kit/bin/kfric.sh +21 -2
  168. package/payload/drift-kit/bin/stage-economics.sh +157 -3
  169. package/payload/drift-kit/kpis/kpi-incident-recurrence.sh +42 -0
  170. package/payload/drift-kit/smoke/install.sh +183 -1
  171. package/payload/drift-kit/templates/economics.md +9 -0
  172. package/payload/drift-kit/templates/kpis.list +6 -1
  173. package/payload/evidence-kit/README.md +20 -6
  174. package/payload/evidence-kit/SPEC.md +355 -17
  175. package/payload/evidence-kit/bin/run-validate.sh +51 -9
  176. package/payload/evidence-kit/checks/check-battery-roster.sh +87 -0
  177. package/payload/evidence-kit/checks/check-evidence-baseline.sh +1 -0
  178. package/payload/evidence-kit/checks/check-evidence-manifest.sh +1 -0
  179. package/payload/evidence-kit/checks/check-producer-liveness.sh +35 -0
  180. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/args +1 -0
  181. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/expect.txt +1 -0
  182. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/runner.md +14 -0
  183. package/payload/evidence-kit/gate-tests/check-battery-roster/bad/scripts/evidence-config.sh +7 -0
  184. package/payload/evidence-kit/gate-tests/check-battery-roster/good/args +1 -0
  185. package/payload/evidence-kit/gate-tests/check-battery-roster/good/expect.txt +1 -0
  186. package/payload/evidence-kit/gate-tests/check-battery-roster/good/runner.md +14 -0
  187. package/payload/evidence-kit/gate-tests/check-battery-roster/good/scripts/evidence-config.sh +7 -0
  188. package/payload/evidence-kit/gate-tests/check-battery-roster.test.sh +68 -0
  189. package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/args +1 -0
  190. package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/expect.txt +1 -0
  191. package/payload/evidence-kit/gate-tests/check-producer-liveness/bad/run-validate.lock +1 -0
  192. package/payload/evidence-kit/gate-tests/check-producer-liveness/good/args +1 -0
  193. package/payload/evidence-kit/gate-tests/check-producer-liveness/good/expect.txt +2 -0
  194. package/payload/evidence-kit/gate-tests/check-producer-liveness/good/run-validate.lock +1 -0
  195. package/payload/evidence-kit/gate-tests/producer-lock.test.sh +109 -0
  196. package/payload/evidence-kit/lib/evidence.sh +18 -0
  197. package/payload/evidence-kit/smoke/install.sh +17 -3
  198. package/payload/gate-sdk/README.md +17 -1
  199. package/payload/gate-sdk/SPEC.md +4427 -92
  200. package/payload/gate-sdk/bin/build-native.sh +38 -0
  201. package/payload/gate-sdk/bin/enforcement-map.sh +2 -1
  202. package/payload/gate-sdk/bin/gen-pre-commit.sh +32 -2
  203. package/payload/gate-sdk/bin/port-blockers.sh +445 -0
  204. package/payload/gate-sdk/bin/run-consumer-smoke.sh +129 -2
  205. package/payload/gate-sdk/bin/run-gate-tests.sh +61 -9
  206. package/payload/gate-sdk/bin/run-gates.sh +37 -2
  207. package/payload/gate-sdk/bin/upgrade-smoke.sh +55 -7
  208. package/payload/gate-sdk/checks/check-action-gh-repo.gate +3 -0
  209. package/payload/gate-sdk/checks/check-action-pinning.gate +3 -0
  210. package/payload/gate-sdk/checks/check-action-run-shell.sh +4 -1
  211. package/payload/gate-sdk/checks/check-assertion-strength.gate +3 -0
  212. package/payload/gate-sdk/checks/check-commit-msg.sh +1 -0
  213. package/payload/gate-sdk/checks/check-commit-subject.sh +1 -0
  214. package/payload/gate-sdk/checks/check-core-files.sh +28 -4
  215. package/payload/gate-sdk/checks/check-crate-arms.sh +61 -0
  216. package/payload/gate-sdk/checks/check-enforcement-fresh.sh +1 -0
  217. package/payload/gate-sdk/checks/check-exec-bit.sh +21 -1
  218. package/payload/gate-sdk/checks/check-gate-assertions.sh +31 -6
  219. package/payload/gate-sdk/checks/check-gate-binary-fresh.sh +107 -0
  220. package/payload/gate-sdk/checks/check-gate-exemption-tasks.sh +7 -7
  221. package/payload/gate-sdk/checks/check-gate-fail-closed.sh +1 -0
  222. package/payload/gate-sdk/checks/check-gate-fixture-coverage.sh +1 -0
  223. package/payload/gate-sdk/checks/check-gate-output.sh +41 -3
  224. package/payload/gate-sdk/checks/check-gate-substrate-parity.sh +333 -0
  225. package/payload/gate-sdk/checks/check-graph.sh +5 -5
  226. package/payload/gate-sdk/checks/check-hook-exec-bit.sh +1 -0
  227. package/payload/gate-sdk/checks/check-identity.sh +1 -0
  228. package/payload/gate-sdk/checks/check-install-disposition.sh +92 -0
  229. package/payload/gate-sdk/checks/check-kit-enum.sh +1 -0
  230. package/payload/gate-sdk/checks/check-kit-registration.gate +3 -0
  231. package/payload/gate-sdk/checks/check-readme-roster.sh +6 -0
  232. package/payload/gate-sdk/checks/check-reads-couples.sh +71 -21
  233. package/payload/gate-sdk/checks/check-root-tiering.sh +1 -0
  234. package/payload/gate-sdk/checks/check-shellcheck.sh +1 -0
  235. package/payload/gate-sdk/checks/check-smoke-entry-guard.gate +3 -0
  236. package/payload/gate-sdk/checks/check-template-copy-parity.sh +1 -0
  237. package/payload/gate-sdk/checks/check-template-registry-parity.gate +3 -0
  238. package/payload/gate-sdk/checks/check-test-hermetic.gate +3 -0
  239. package/payload/gate-sdk/checks/check-tree-terms.sh +1 -0
  240. package/payload/gate-sdk/checks/check-workflow-tiering.sh +2 -1
  241. package/payload/gate-sdk/gate-tests/check-action-run-shell.test.sh +16 -1
  242. package/payload/gate-sdk/gate-tests/check-core-files.test.sh +64 -0
  243. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/crate/Cargo.toml +7 -0
  244. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/crate/src/lib.rs +12 -0
  245. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/expect.txt +5 -0
  246. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/scripts/gate-sdk-config.sh +2 -0
  247. package/payload/gate-sdk/gate-tests/check-crate-arms/good/crate/Cargo.toml +7 -0
  248. package/payload/gate-sdk/gate-tests/check-crate-arms/good/crate/src/lib.rs +11 -0
  249. package/payload/gate-sdk/gate-tests/check-crate-arms/good/expect.txt +2 -0
  250. package/payload/gate-sdk/gate-tests/check-crate-arms/good/scripts/gate-sdk-config.sh +2 -0
  251. package/payload/gate-sdk/gate-tests/check-gate-assertions/good/expect.txt +1 -1
  252. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/args +2 -0
  253. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/expect.txt +5 -0
  254. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/kitroot/checks/check-vendored.gate +2 -0
  255. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/check-ported.gate +2 -0
  256. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/gate-sdk-config.sh +2 -0
  257. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/scripts/gates.list +4 -0
  258. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/stamp.txt +1 -0
  259. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/bad/stub-bin +6 -0
  260. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/args +2 -0
  261. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/expect.txt +5 -0
  262. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/kitroot/checks/check-vendored.gate +2 -0
  263. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/check-ported.gate +2 -0
  264. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/gate-sdk-config.sh +2 -0
  265. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/scripts/gates.list +4 -0
  266. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/stamp.txt +1 -0
  267. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh/good/stub-bin +5 -0
  268. package/payload/gate-sdk/gate-tests/check-gate-binary-fresh.test.sh +81 -0
  269. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/TASK-QUEUE.md +3 -1
  270. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/expect.txt +3 -1
  271. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/bad/gates/check-sample.sh +3 -1
  272. package/payload/gate-sdk/gate-tests/check-gate-exemption-tasks/good/expect.txt +1 -0
  273. package/payload/gate-sdk/gate-tests/check-gate-output/bad/check-native-sample.gate +3 -0
  274. package/payload/gate-sdk/gate-tests/check-gate-output/bad/check-sample.sh +1 -0
  275. package/payload/gate-sdk/gate-tests/check-gate-output/bad/expect.txt +3 -0
  276. package/payload/gate-sdk/gate-tests/check-gate-output/bad/gates.list +1 -0
  277. package/payload/gate-sdk/gate-tests/check-gate-output/bad/native/Cargo.toml +4 -0
  278. package/payload/gate-sdk/gate-tests/check-gate-output/bad/native/src/gates/native_sample.rs +7 -0
  279. package/payload/gate-sdk/gate-tests/check-gate-output/good/check-native-sample.gate +3 -0
  280. package/payload/gate-sdk/gate-tests/check-gate-output/good/check-sample.sh +1 -0
  281. package/payload/gate-sdk/gate-tests/check-gate-output/good/expect.txt +1 -0
  282. package/payload/gate-sdk/gate-tests/check-gate-output/good/gates.list +1 -0
  283. package/payload/gate-sdk/gate-tests/check-gate-output/good/native/Cargo.toml +4 -0
  284. package/payload/gate-sdk/gate-tests/check-gate-output/good/native/src/gates/native_sample.rs +11 -0
  285. package/payload/gate-sdk/gate-tests/check-gate-output.test.sh +111 -0
  286. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/args +2 -0
  287. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/conservation.md +7 -0
  288. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/expect.txt +12 -0
  289. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/impl/gate.rs +2 -0
  290. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/kitroot/check-orphan.rs +3 -0
  291. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/publish.yml +15 -0
  292. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-alpha.sh +3 -0
  293. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-dup.gate +1 -0
  294. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-dup.sh +3 -0
  295. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/check-orphan.gate +1 -0
  296. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gate-sdk-config.sh +6 -0
  297. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/scripts/gates.list +3 -0
  298. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/stub-bin +3 -0
  299. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/bad/targets.list +3 -0
  300. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/args +2 -0
  301. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/conservation.md +8 -0
  302. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/expect.txt +7 -0
  303. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/impl/gate.rs +2 -0
  304. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/kitroot/check-other.rs +3 -0
  305. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/publish.yml +15 -0
  306. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-alpha.sh +3 -0
  307. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/check-ported.gate +2 -0
  308. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gate-sdk-config.sh +6 -0
  309. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/scripts/gates.list +2 -0
  310. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/stub-bin +3 -0
  311. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/targets.list +2 -0
  312. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity.test.sh +184 -0
  313. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-alpha.sh +6 -0
  314. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-delta.sh +5 -0
  315. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-epsilon.sh +6 -0
  316. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/smoke/install.sh +7 -0
  317. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/args +6 -0
  318. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/expect.txt +1 -0
  319. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/installer/lib/common/recipe.sh +9 -0
  320. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/scripts/gate-sdk-config.sh +5 -0
  321. package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-alpha.sh +6 -0
  322. package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-beta.gate +3 -0
  323. package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-gamma.sh +6 -0
  324. package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/smoke/install.sh +8 -0
  325. package/payload/gate-sdk/gate-tests/check-install-disposition/good/args +6 -0
  326. package/payload/gate-sdk/gate-tests/check-install-disposition/good/expect.txt +1 -0
  327. package/payload/gate-sdk/gate-tests/check-install-disposition/good/installer/lib/common/recipe.sh +10 -0
  328. package/payload/gate-sdk/gate-tests/check-install-disposition/good/scripts/gate-sdk-config.sh +5 -0
  329. package/payload/gate-sdk/gate-tests/check-kit-registration.test.sh +6 -5
  330. package/payload/gate-sdk/gate-tests/check-reads-couples.test.sh +139 -0
  331. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/templates/widgets.list +4 -0
  332. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/widgets/widget-one.sh +3 -0
  333. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/alpha-kit/widgets/widget-two.sh +3 -0
  334. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/args +4 -0
  335. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/expect.txt +1 -0
  336. package/payload/gate-sdk/gate-tests/check-template-registry-parity/bad/scripts/gate-sdk-config.sh +5 -0
  337. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/templates/widgets.list +4 -0
  338. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/widgets/widget-one.sh +3 -0
  339. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/alpha-kit/widgets/widget-two.sh +3 -0
  340. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/args +8 -0
  341. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/beta-kit/templates/rules.list +5 -0
  342. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/beta-kit/templates/table.tsv +4 -0
  343. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/expect.txt +1 -0
  344. package/payload/gate-sdk/gate-tests/check-template-registry-parity/good/scripts/gate-sdk-config.sh +5 -0
  345. package/payload/gate-sdk/gate-tests/check-test-hermetic-smoke.test.sh +2 -3
  346. package/payload/gate-sdk/gate-tests/lib-declaration.test.sh +4 -4
  347. package/payload/gate-sdk/gate-tests/lib-gate.test.sh +151 -1
  348. package/payload/gate-sdk/gate-tests/run-dispatch-streams.test.sh +73 -0
  349. package/payload/gate-sdk/gate-tests/run-gate-tests.test.sh +144 -0
  350. package/payload/gate-sdk/lib/consumer-smoke.sh +41 -4
  351. package/payload/gate-sdk/lib/gate.sh +208 -9
  352. package/payload/gate-sdk/lib/inject.sh +46 -1
  353. package/payload/gate-sdk/lib/test-hermetic.sh +26 -0
  354. package/payload/gate-sdk/smoke/install.sh +61 -1
  355. package/payload/guard-kit/README.md +18 -14
  356. package/payload/guard-kit/SPEC.md +366 -72
  357. package/payload/guard-kit/bin/compare-settings-allow.sh +40 -7
  358. package/payload/guard-kit/bin/run-guard-tests.sh +1 -0
  359. package/payload/guard-kit/gate-tests/compare-settings-allow.test.sh +64 -0
  360. package/payload/guard-kit/gate-tests/guard-read-path.test.sh +52 -0
  361. package/payload/guard-kit/guard-tests/cases.tsv +49 -7
  362. package/payload/guard-kit/lib/guard.sh +277 -54
  363. package/payload/guard-kit/templates/close-triage.md +38 -10
  364. package/payload/guard-kit/templates/guard-config.sh +3 -0
  365. package/payload/guard-kit/templates/settings-hooks.json +7 -1
  366. package/payload/lifecycle-kit/README.md +12 -1
  367. package/payload/lifecycle-kit/SPEC.md +991 -41
  368. package/payload/lifecycle-kit/bin/cite-survey.sh +81 -0
  369. package/payload/lifecycle-kit/bin/enter-stage.sh +139 -13
  370. package/payload/lifecycle-kit/bin/file-gap.sh +60 -2
  371. package/payload/lifecycle-kit/bin/file-survey.sh +69 -0
  372. package/payload/lifecycle-kit/checks/check-close-surfaces.sh +1 -0
  373. package/payload/lifecycle-kit/checks/check-gap-inbox-neutrality.gate +3 -0
  374. package/payload/lifecycle-kit/checks/check-lesson-disposition.gate +3 -0
  375. package/payload/lifecycle-kit/checks/check-lifecycle-registration.gate +3 -0
  376. package/payload/lifecycle-kit/checks/check-merge-attrs.gate +3 -0
  377. package/payload/lifecycle-kit/checks/check-scratch-citation.gate +3 -0
  378. package/payload/lifecycle-kit/checks/check-shim-restatement.gate +3 -0
  379. package/payload/lifecycle-kit/checks/check-skill-binding.gate +3 -0
  380. package/payload/lifecycle-kit/checks/check-stage-entry.sh +1 -0
  381. package/payload/lifecycle-kit/checks/check-stage-evidence.gate +3 -0
  382. package/payload/lifecycle-kit/checks/check-stage-skill-coverage.gate +3 -0
  383. package/payload/lifecycle-kit/checks/check-survey-record.gate +3 -0
  384. package/payload/lifecycle-kit/gate-tests/check-close-surfaces.test.sh +1 -2
  385. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/args +2 -0
  386. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/expect.txt +3 -0
  387. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/gap-inbox.md +5 -0
  388. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/args +2 -0
  389. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/expect.txt +1 -0
  390. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/gap-inbox.md +4 -0
  391. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition.test.sh +2 -3
  392. package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration.test.sh +2 -3
  393. package/payload/lifecycle-kit/gate-tests/check-merge-attrs/bad/.gitattributes +1 -0
  394. package/payload/lifecycle-kit/gate-tests/check-merge-attrs/good/.gitattributes +1 -0
  395. package/payload/lifecycle-kit/gate-tests/check-merge-attrs.test.sh +3 -3
  396. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/expect.txt +1 -0
  397. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/scripts/lifecycle-config.sh +4 -0
  398. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/surfaces/queue.md +13 -0
  399. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/expect.txt +1 -0
  400. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/scripts/lifecycle-config.sh +4 -0
  401. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/surfaces/queue.md +31 -0
  402. package/payload/lifecycle-kit/gate-tests/check-shim-restatement.test.sh +2 -3
  403. package/payload/lifecycle-kit/gate-tests/check-skill-binding.test.sh +2 -3
  404. package/payload/lifecycle-kit/gate-tests/check-stage-entry.test.sh +2 -3
  405. package/payload/lifecycle-kit/gate-tests/check-stage-evidence.test.sh +9 -5
  406. package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/args +2 -0
  407. package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/expect.txt +4 -0
  408. package/payload/lifecycle-kit/gate-tests/check-survey-record/bad/record.md +18 -0
  409. package/payload/lifecycle-kit/gate-tests/check-survey-record/good/args +2 -0
  410. package/payload/lifecycle-kit/gate-tests/check-survey-record/good/expect.txt +1 -0
  411. package/payload/lifecycle-kit/gate-tests/check-survey-record/good/record.md +13 -0
  412. package/payload/lifecycle-kit/gate-tests/check-survey-record.test.sh +83 -0
  413. package/payload/lifecycle-kit/gate-tests/file-gap-recurrence.test.sh +122 -0
  414. package/payload/lifecycle-kit/gate-tests/rename-iteration.test.sh +142 -0
  415. package/payload/lifecycle-kit/gate-tests/survey-record-entry.test.sh +102 -0
  416. package/payload/lifecycle-kit/gate-tests/workflow-state-guard.test.sh +100 -0
  417. package/payload/lifecycle-kit/lib/stages.sh +12 -2
  418. package/payload/lifecycle-kit/smoke/install.sh +83 -4
  419. package/payload/lifecycle-kit/templates/consult.md +73 -0
  420. package/payload/lifecycle-kit/templates/lead.md +139 -7
  421. package/payload/lifecycle-kit/templates/stages/align.md +12 -0
  422. package/payload/lifecycle-kit/templates/stages/build.md +8 -0
  423. package/payload/lifecycle-kit/templates/stages/close.md +45 -5
  424. package/payload/lifecycle-kit/templates/stages/scope.md +42 -3
  425. package/payload/lifecycle-kit/templates/stages/spec.md +13 -1
  426. package/payload/lifecycle-kit/templates/stages/validate.md +8 -0
  427. package/payload/lifecycle-kit/templates/workflow-state-guard.sh +29 -0
  428. package/payload/queue-kit/README.md +6 -1
  429. package/payload/queue-kit/SPEC.md +350 -6
  430. package/payload/queue-kit/bin/queue-counts.sh +35 -0
  431. package/payload/queue-kit/bin/queue-edges.sh +78 -0
  432. package/payload/queue-kit/checks/check-queue-entry-budget.gate +3 -0
  433. package/payload/queue-kit/checks/check-queue-hygiene.gate +3 -0
  434. package/payload/queue-kit/checks/check-queue-prose-precondition.sh +1 -0
  435. package/payload/queue-kit/checks/check-queue-sections.gate +3 -0
  436. package/payload/queue-kit/checks/check-queue-slug-liveness.gate +3 -0
  437. package/payload/queue-kit/checks/check-queue-wrap.gate +3 -0
  438. package/payload/queue-kit/checks/check-roadmap-fresh.sh +1 -0
  439. package/payload/queue-kit/checks/check-tag-lead-line.gate +3 -0
  440. package/payload/queue-kit/checks/check-task-conservation.gate +4 -0
  441. package/payload/queue-kit/checks/check-task-names.gate +3 -0
  442. package/payload/queue-kit/gate-tests/check-queue-hygiene/good/TASK-QUEUE.md +5 -0
  443. package/payload/queue-kit/gate-tests/queue-counts.test.sh +116 -0
  444. package/payload/queue-kit/gate-tests/queue-edges.test.sh +130 -0
  445. package/payload/queue-kit/gate-tests/queue-lib-parity.test.sh +215 -0
  446. package/payload/queue-kit/lib/queue.sh +4 -19
  447. package/payload/queue-kit/smoke/install.sh +4 -1
  448. package/payload/queue-kit/templates/TASK-QUEUE.md +3 -0
  449. package/payload/site-kit/SPEC.md +64 -27
  450. package/payload/site-kit/checks/check-docs-cname-parity.sh +1 -0
  451. package/payload/site-kit/checks/check-docs-render-fidelity.sh +1 -0
  452. package/payload/site-kit/smoke/install.sh +9 -1
  453. package/profiles.list +36 -8
  454. package/payload/canon-kit/checks/check-comment-tier.sh +0 -211
  455. package/payload/canon-kit/checks/check-deprecation-task.sh +0 -90
  456. package/payload/canon-kit/checks/check-docs-cmd.sh +0 -153
  457. package/payload/canon-kit/checks/check-install-claim.sh +0 -146
  458. package/payload/canon-kit/checks/check-knob-citation.sh +0 -117
  459. package/payload/canon-kit/checks/check-manifest-count.sh +0 -46
  460. package/payload/canon-kit/checks/check-manifest-temporal.sh +0 -83
  461. package/payload/canon-kit/checks/check-md-refs.sh +0 -128
  462. package/payload/canon-kit/checks/check-prose-enum.sh +0 -115
  463. package/payload/canon-kit/checks/check-spec-derivable-section.sh +0 -69
  464. package/payload/canon-kit/checks/check-spec-dod-singleton.sh +0 -45
  465. package/payload/canon-kit/checks/check-spec-fence-balance.sh +0 -42
  466. package/payload/canon-kit/checks/check-spec-pointer.sh +0 -180
  467. package/payload/canon-kit/checks/check-todo-task-liveness.sh +0 -80
  468. package/payload/canon-kit/checks/check-tracking-claim.sh +0 -136
  469. package/payload/gate-sdk/checks/check-action-gh-repo.sh +0 -321
  470. package/payload/gate-sdk/checks/check-action-pinning.sh +0 -55
  471. package/payload/gate-sdk/checks/check-assertion-strength.sh +0 -134
  472. package/payload/gate-sdk/checks/check-kit-registration.sh +0 -68
  473. package/payload/gate-sdk/checks/check-smoke-entry-guard.sh +0 -53
  474. package/payload/gate-sdk/checks/check-test-hermetic.sh +0 -119
  475. package/payload/lifecycle-kit/checks/check-lesson-disposition.sh +0 -98
  476. package/payload/lifecycle-kit/checks/check-lifecycle-registration.sh +0 -54
  477. package/payload/lifecycle-kit/checks/check-merge-attrs.sh +0 -69
  478. package/payload/lifecycle-kit/checks/check-shim-restatement.sh +0 -97
  479. package/payload/lifecycle-kit/checks/check-skill-binding.sh +0 -59
  480. package/payload/lifecycle-kit/checks/check-stage-evidence.sh +0 -81
  481. package/payload/lifecycle-kit/checks/check-stage-skill-coverage.sh +0 -47
  482. package/payload/queue-kit/checks/check-queue-entry-budget.sh +0 -104
  483. package/payload/queue-kit/checks/check-queue-hygiene.sh +0 -81
  484. package/payload/queue-kit/checks/check-queue-sections.sh +0 -44
  485. package/payload/queue-kit/checks/check-queue-slug-liveness.sh +0 -63
  486. package/payload/queue-kit/checks/check-queue-wrap.sh +0 -56
  487. package/payload/queue-kit/checks/check-tag-lead-line.sh +0 -70
  488. package/payload/queue-kit/checks/check-task-conservation.sh +0 -50
  489. package/payload/queue-kit/checks/check-task-names.sh +0 -128
@@ -105,8 +105,9 @@ gates dir and naming it in the registry; shadow a bundled one with a same-named
105
105
  file. The bundled set (drift-kit/SPEC.md §Bundled KPIs) covers, as lead KPIs, the
106
106
  queue split and its per-iteration net delta, the gate backlog, amendment/deferred
107
107
  age, prompt friction, the always-loaded surface, the local permission overlay,
108
- gate runtime, session overhead, and the price table's age and expiry; and one lag
109
- KPI, `kpi-knowledge-friction`, fed by the loop below.
108
+ gate runtime, session overhead, and the price table's age and expiry; and as lag
109
+ KPIs, `kpi-knowledge-friction` (fed by the loop below) and
110
+ `kpi-incident-recurrence` (fed by the queue's `recurrence:` declarations).
110
111
 
111
112
  ## Test
112
113
 
@@ -207,6 +207,25 @@ Lag:
207
207
  line count of the knowledge-friction log (§The knowledge-friction loop).
208
208
  Lag by construction: only what a session *noticed and logged* is counted,
209
209
  so the value lower-bounds the real rate.
210
+ - **kpi-incident-recurrence** — re-filings of the same finding, summed over the
211
+ queue's `recurrence:` declarations (queue-kit/SPEC.md §The tag algebra owns the
212
+ grammar), plus the highest-count slug. Like `kpi-deferred-age` it re-implements
213
+ the read rather than sourcing queue-kit's lib, under the same accepted residual
214
+ — one owner doc, two implementations, both carrying a `spec:` line citing the
215
+ owner. **The lag label is a measurement claim, not a priority one.** A
216
+ recurrence nobody files is uncounted, exactly `kpi-knowledge-friction`'s
217
+ structure — and so is one no session **judged**, since each date records a
218
+ judgment rather than a derivation: the same lag structure, one step later in
219
+ the chain. So lag is the honest fidelity tier even though the metric is highly
220
+ actionable. **It is a judged count, so it is only comparable across a fixed
221
+ judging rule** — changing what counts as a recurrence breaks comparison across
222
+ the change, and a series spanning such a change is two series, not one.
223
+ Actionability rides lifecycle-kit's pre-emption rule and its
224
+ `LIFECYCLE_KIT_RECURRENCE_THRESHOLD`, never this report's weighting — which is
225
+ why the counter and the rule are two pieces and not one. A report-only signal
226
+ would have reproduced the defect the pair exists to fix: a faithful record no
227
+ ranking reads. `--trend` emits `recur <N>`; with no declaration anywhere it
228
+ degrades to `n/a (no recurrence declaration in the queue)`.
210
229
 
211
230
  The lag section is expected to be sparse — most lag measurements (review
212
231
  finding rates, detection latency) are manual tallies, and the kit ships no
@@ -229,10 +248,14 @@ derivation. The loop mirrors guard-kit's, with capture moved to convention:
229
248
  gitignored per-iteration scratch, the prompt-friction.log pattern):
230
249
  `<date> <fact re-derived> ← <surface it was read from>`. One line,
231
250
  written at the moment of re-derivation — deferred capture is no capture.
232
- The affordance is `bin/kfric.sh "<fact>" "<surface>"`: it stamps that
251
+ The affordance is `bin/kfric.sh [--] "<fact>" "<surface>"`: it stamps that
233
252
  grammar (date from `date +%F`) into `DRIFT_KIT_KNOWLEDGE_LOG`, creating
234
253
  the log's parent dir if missing, and refuses with a usage message and
235
- exit 2 unless both arguments are present and non-empty. It exists so
254
+ exit 2 unless both arguments are present and non-empty. Both are free text,
255
+ so it also validates their **shape** — see
256
+ gate-sdk/SPEC.md §The bin/-tool contract —
257
+ scanning every positional rather than the first, two slots making arity
258
+ safe in neither. It exists so
236
259
  capture is prompt-free — the raw form is a shell redirect
237
260
  (`printf … >> <log>`) that no allowlist glob suppresses safely (a
238
261
  mid-pattern wildcard is the command-injection shape the bash guard
@@ -293,7 +316,10 @@ commit that is not a close. Each closed iteration N owns the commit range
293
316
  from the root up to its close commit); no range-scoped column reads HEAD, so an
294
317
  interstitial commit — filed or hotfixed after a close, before the next scope —
295
318
  falls into the *next* iteration's range and surfaces only when that iteration
296
- closes, leaving every published row byte-identical until a new close lands.
319
+ closes, leaving every published row byte-identical until a new close lands. That
320
+ sentence is range arithmetic: it is descriptive of a commit that happens, and
321
+ *when* one may legitimately be made is lifecycle-kit/SPEC.md §Deviation
322
+ transitions' interstitial-mitigation rule, which leaves this accounting unchanged.
297
323
  Totals conserve across rows: every commit up to the last close belongs to
298
324
  exactly one range. The extractor reads no now-relative field (no age-from-today)
299
325
  either, so re-emission over an unchanged closed history is byte-identical —
@@ -555,12 +581,21 @@ stamp**. A stage that continues in a new session (a credential swap mid-stage,
555
581
  any resume) leaves that session unstamped, so it matches no stamp and is never
556
582
  sought; its burn is invisible rather than wrong. The meter therefore counts the
557
583
  transcripts under `DRIFT_KIT_SESSIONS_DIR` that no row claimed and reports the
558
- count. It is an **upper bound, never an attribution**: a transcript carries no
559
- iteration and no stage, so nothing in the join could place it, and most
560
- unstamped transcripts are ordinary non-lifecycle sessions. Sizing the blind spot
561
- is the whole of what drift-kit can do alone — attributing a continuation would
562
- need the *stamp* side to record it, which is lifecycle-kit's contract and no
563
- part of this meter's read-only consumption of it.
584
+ count.
585
+
586
+ The bound is **tighter than the stamp side alone**, because a dispatched
587
+ transcript *can* now be placed — through its anchor, by the fan-out row below.
588
+ What remains in the count is the transcript that resolved **no anchor**, and for
589
+ that residue it is still an **upper bound, never an attribution**: an unanchored
590
+ transcript carries no iteration and no stage *and descends from no session that
591
+ does*, so nothing in the join could place it. The reading that most of the
592
+ residue is ordinary non-lifecycle sessions becomes **more** true rather than
593
+ less, since the fan-out pass drains the lifecycle subtrees out of it. The one
594
+ case the fan-out row cannot reach is the unstamped **continuation**: it is a
595
+ resumption rather than a dispatch, so it has no parent edge to walk. Sizing that
596
+ blind spot is the whole of what drift-kit can do alone — attributing a
597
+ continuation would need the *stamp* side to record it, which is lifecycle-kit's
598
+ contract and no part of this meter's read-only consumption of it.
564
599
 
565
600
  **The trend log.** One line is appended per `(iteration, stage, model)` triple to
566
601
  `DRIFT_KIT_STAGE_ECONOMICS_LOG`, grammar:
@@ -569,7 +604,10 @@ part of this meter's read-only consumption of it.
569
604
  <date> <iteration> <stage> <model> in=<tok> out=<tok> cr=<tok> cw=<tok> cost=<usd|n/a>
570
605
  ```
571
606
 
572
- `cr` is cache-read and `cw` is cache-creation. `cr` is the headline field: the
607
+ `<stage>` is the **stage-or-role** column — a lifecycle stage, a cost-bearing
608
+ role, or either of those with the fan-out suffix appended (the reserved
609
+ `supervision` value and the fan-out row, below). `cr` is cache-read and `cw` is
610
+ cache-creation. `cr` is the headline field: the
573
611
  motivating dig showed cache-read of accumulated context — not model choice — is
574
612
  the dominant burn (build ~73% of session cost, climbing 37M→86M cr-tokens per
575
613
  session), so the field exists to keep that lever visible close-over-close. The
@@ -609,7 +647,9 @@ skeleton); the same rule decides this.
609
647
  role**, not stage alone. A supervision row is a role that carries cost and no
610
648
  stamp — never a lifecycle stage that dropped out of the roster. The column's
611
649
  members were roster-closed until this value existed, and a reader who assumes
612
- they still are would misdiagnose the row as roster drift.
650
+ they still are would misdiagnose the row as roster drift. The column widens
651
+ once more for the fan-out row below, which admits *either* member with a
652
+ suffix appended.
613
653
  - **The producer — derivation from the transcript path, not from a stamp.** The
614
654
  two-tier scan above already resolves a dispatched stage session at
615
655
  `<sessions-dir>/<lead-session-id>/subagents/<agent>.jsonl` while a lead sits
@@ -623,9 +663,12 @@ skeleton); the same rule decides this.
623
663
  session is *derived*, which is what keeps this a read-only consumption of
624
664
  lifecycle-kit/SPEC.md §The state machine.
625
665
  - **The attribution invariant.** A transcript's usage is attributed to exactly
626
- one `(iteration, stage)` pair — the rule the session-keyed join above enforces
627
- for stage rows, and the reason a lead whose own transcript already carried a
628
- stage row yields no supervision row. In the ordinary case a lead supervises one
666
+ **one row key** — either an `(iteration, stage-or-role)` pair or that pair's
667
+ fan-out value. That is the rule the session-keyed join above enforces for stage
668
+ rows, the reason a lead whose own transcript already carried a stage row yields
669
+ no supervision row, and (below) the reason a dispatched transcript resolves
670
+ exactly one anchor. One guard serves all three: a transcript already claimed by
671
+ a row is never a candidate for another. In the ordinary case a lead supervises one
629
672
  iteration and its whole usage lands on that iteration's supervision row —
630
673
  exact, no key. A lead spanning two or more iterations **apportions in
631
674
  proportion to the number of stamped stage sessions it dispatched per
@@ -637,7 +680,11 @@ skeleton); the same rule decides this.
637
680
  label, the meter emits a visible notice naming `DRIFT_KIT_SUPERVISION_LABEL`
638
681
  and emits **no** supervision rows that run. It is checkable from data the meter
639
682
  already reads — its own stamps — so this adds no roster dependency and no
640
- second bound to drift.
683
+ second bound to drift. **A suppressed anchor suppresses its fan-out**: with no
684
+ supervision row emitted the lead is no anchor, so its direct fan-out finds none
685
+ and emits nothing. A fan-out row for a role that emitted no row of its own
686
+ would be an orphan the reader cannot place, and the suppression is structural
687
+ rather than a second rule — the anchor registers only where the row did.
641
688
  - **Degradation.** A run with no nested-tier match (a stage run without a live
642
689
  lead) emits no supervision row and no notice: zero supervision burn is the
643
690
  honest reading, not a missing measurement. A lead transcript aged out of the
@@ -659,7 +706,140 @@ skeleton); the same rule decides this.
659
706
  naming, since it is the surface a hardcoded stage roster once broke; it reads
660
707
  stamps and its own `DRIFT_KIT_STAGES` roster, never this log. So a non-stage
661
708
  value in the column cannot silently fall out of a roster the way the
662
- trajectory's stamps did.
709
+ trajectory's stamps did. The same three readers were re-verified when the
710
+ column widened again for the fan-out value, and the conclusion is unchanged.
711
+
712
+ **The fan-out row — a stage's dispatched subtree is its own line item.** A stage
713
+ session that dispatches agents pays for their whole subtree, yet every dispatched
714
+ transcript carries no stamp of its own, so its burn lands in no row and each
715
+ per-stage figure understates that stage by its entire fan-out. The meter bills the
716
+ subtree to a row whose `<stage>` value is the **anchor's stage-or-role with
717
+ `DRIFT_KIT_FANOUT_SUFFIX` appended** (§Layout and configuration) — `build+fanout`,
718
+ `close+fanout`, `supervision+fanout`.
719
+
720
+ - **A suffixed value rather than a bare reserved label.** A bare `fanout` label —
721
+ the shape `supervision` takes — would answer "what did fan-out cost this
722
+ iteration" and lose *which stage's* fan-out it was, the question the motivating
723
+ measurement asked. The suffix keeps the `(iteration, stage)` join intact and
724
+ sorts the subtree row adjacent to its own stage row.
725
+ - **A separate row rather than a fold into the stage row.** Separability *is* the
726
+ deliverable: a folded total answers the operator's question only through a
727
+ stdout caveat the trend log does not carry, so the close-over-close series — the
728
+ log's whole purpose — would be blind to the split it was extended to show. A
729
+ fold would also silently redefine a value already logged, a `close` row written
730
+ before this change and one written after meaning different things under one
731
+ name, which is the drift the dedup key exists to prevent rather than to hide.
732
+ - **What it is not: a dispatch-type breakdown.** The row carries **no
733
+ dispatch-type dimension** — a fork's spend and a typed dispatch's spend fold
734
+ into one anchor total. It is an aggregate proxy for "what this stage's
735
+ delegation cost", never an isolation of fork cost, and a reader who splits a
736
+ posture decision on fork-versus-dispatch cannot get that split from this row.
737
+ - **The anchor set.** An anchor is a transcript that already holds a row of its
738
+ own: every **stamped stage session whose transcript resolved**, anchoring its
739
+ subtree to that stamp's `(iteration, stage)`; and every **lead that emitted a
740
+ supervision row**, anchoring its own direct fan-out to
741
+ `(iteration, DRIFT_KIT_SUPERVISION_LABEL)` — a lead's audit sweeps are as
742
+ unbilled as a stage's, and omitting them would fix half the tier. The two
743
+ conditions differ deliberately: a stage anchors on its stamp **resolving**,
744
+ because a stamped stage whose transcript carries no usage is still a real,
745
+ placeable `(iteration, stage)` for its subtree, while a supervision role that
746
+ emitted no row is not a role at all. A lead that already carried a stage row
747
+ yields no supervision row (the invariant above) and its fan-out anchors to that
748
+ **stage** row instead — the anchor lookup finds it and needs no special case.
749
+ - **The producer — the parent walk, nearest anchor wins.** A dispatched
750
+ transcript's *path* names only the root session: a grandchild sits flat in the
751
+ same `<root>/subagents/` directory as a child, so the path cannot carry the
752
+ parent edge. The harness writes it one file over, as a `.meta.json` sibling of
753
+ each nested transcript, whose `parentAgentId` names the parent agent — a **bare**
754
+ id, resolved against `agent-<id>.jsonl` in the same directory (the bare spelling
755
+ `<id>.jsonl` is accepted as a fallback, so neither spelling is guessed). A record
756
+ with no `parentAgentId` is a direct child of the root session that names the
757
+ directory. For each `subagents/` transcript that is neither an anchor nor
758
+ already holding a row, the meter walks parents by that rule until an anchor is
759
+ reached and gives the **nearest** anchor the transcript's usage; intermediate
760
+ non-anchor agents are transparent, which is what puts a deep fork under the
761
+ stage session that ultimately caused it rather than under the sweep that
762
+ happened to spawn it. A walk reaching the root session without meeting an anchor
763
+ emits **no** row and the transcript stays in the under-count bound — the correct
764
+ reading, since an ordinary non-lifecycle session's fan-out belongs to no
765
+ iteration and no stage. The walk is **bounded by the transcript population and
766
+ by a visited set**, so a cycle or a dangling `parentAgentId` costs a counted
767
+ notice rather than a loop. The parent forest is read with one pass per
768
+ `subagents/` directory rather than one per hop; the usage itself is the same
769
+ last-usage-per-message-id reader the stage rows use, so the pass costs one
770
+ transcript parse per attributed subtree member and no second parser.
771
+ - **Reading a harness-private artifact — why the coupling is admissible.** The
772
+ meta sibling is under no contract, and the meter reads it anyway on one ground:
773
+ it is the **same coupling class the meter already runs on**, one file over from
774
+ the transcript JSONL usage schema and the `<root>/subagents/` layout it already
775
+ depends on, and the failure mode of the shape changing is bounded to a *visible
776
+ no-op* rather than a wrong figure. That is the difference between coupling to a
777
+ shape for an **enrichment** and coupling to it for the pricing arithmetic; the
778
+ ruling is yes here and would be no there. The rejected alternative — taking the
779
+ key from a dispatcher-minted path instead — fails on the axis that decides it: a
780
+ convention a dispatcher can forget produces a **silent** under-count in the exact
781
+ tier this row exists to stop under-counting, it relocates the harness coupling
782
+ rather than removing it (parsing a child's first user message for a string the
783
+ meter must then trust), and it cannot reach a **fork** at all, since a fork
784
+ inherits context rather than receiving an authored prompt.
785
+ - **Apportionment.** Where a lead spans several iterations, its fan-out
786
+ apportions by the **same dispatch-count key, with the same integer split**, that
787
+ apportions its supervision row. Reusing the key rather than minting a second one
788
+ is the point: two keys over one lead would let the supervision row and its
789
+ fan-out row disagree about which iteration the lead belonged to.
790
+ - **Several anchors, one row — the fold, not a race.** One `(iteration, stage)`
791
+ can hold **several** anchors: a stage run as several sessions in one iteration
792
+ (a batch split) stamps once per session, and each session anchors its own
793
+ subtree. Their subtrees **sum into the single fan-out row** for that pair. This
794
+ follows from the invariant above rather than adding to it — the attribution unit
795
+ is the *row key*, not the anchor — and the alternative is not a second row but a
796
+ **lost** one: two appends under one `<iteration> <stage> <model>` triple make
797
+ the dedup key replace the first with the second, stranding its transcripts
798
+ attributed to a row the replacement erased. Apportionment happens **first and the
799
+ fold second**, since the dispatch-count split is a property of the anchor while
800
+ the row is not. The stdout caveat names the contributing anchor count where it
801
+ exceeds one, so a folded row is never read as one session's.
802
+ - **Collision rule.** The default suffix is collision-proof by construction — the
803
+ stamp reader's stage-field alphabet is lowercase alphanumerics and hyphens, so a
804
+ `+` can never appear in a stamped stage name. A consumer overriding the knob can
805
+ break that, so the check mirrors the supervision label's: if any stamp the run
806
+ reads names a stage **ending in** the suffix, the meter emits a visible notice
807
+ naming `DRIFT_KIT_FANOUT_SUFFIX` and emits **no** fan-out rows that run. It is
808
+ checkable from the stamps the meter already reads, so it adds no roster
809
+ dependency and no second bound to drift.
810
+ - **Degradation — the contract that bounds the coupling.** Every arm degrades to a
811
+ visible absence, never to a wrong figure, and never to a non-zero exit:
812
+
813
+ | what is missing | behavior |
814
+ | --- | --- |
815
+ | the meta layer entirely | no fan-out rows; one notice; every existing row unchanged — the meter's behavior before this row existed |
816
+ | one transcript's meta record | that transcript takes no fan-out row and stays in the under-count bound; counted in the unresolved notice |
817
+ | `parentAgentId` naming an agent with no transcript | same — counted, never guessed |
818
+ | a cycle or an over-long chain | same — the walk is bounded and the transcript counted |
819
+ | `jq` absent | already fatal to the whole join upstream; the fan-out pass never runs |
820
+ | the price table absent or missing a model row | the row's `cost` degrades to `n/a` and raises the existing incomplete-pricing caveat, exactly as a stage row's does |
821
+
822
+ - **No new field.** The four token fields, `cost`, and `date` carry a fan-out row
823
+ exactly as they carry a supervision row; the dedup key stays the
824
+ `<iteration> <stage> <model>` triple and a re-measure replaces the row's line
825
+ like any other. The split, the transcript count, and every degradation stay
826
+ **stdout caveats at measurement time** — a log field with no reader is a field
827
+ removed, and none of these has one. The row's own named readers are the
828
+ `/economics` narrative's fan-out line item (§The `/economics` skill), the
829
+ operator reading the trend log close-over-close, and the deferred
830
+ `benchmark-ab-experiment` rung's measurement half, which consumes this log
831
+ rather than rebuilding it and inherits the row with no change.
832
+ **No dispatch-type dimension either, and that is the answer to a question the
833
+ row invites.** A fork is distinguishable at the meta layer — its record carries
834
+ `isFork` beside an `agentType` naming the fork type, and carries no `model` —
835
+ but the row folds a stage's whole subtree into one line, so "what did forking
836
+ cost" is not a query this log answers. It is re-derived by walking
837
+ `parentAgentId` and pricing the fork transcripts directly, which is the honest
838
+ cost of leaving the dimension out until a reader for it exists.
839
+ - **No lifecycle change.** No stamp is added, no cursor moves, no stage-skill
840
+ template changes. The fan-out edge is *derived*, exactly as the supervision edge
841
+ is, which is what keeps this a read-only consumption of lifecycle-kit/SPEC.md
842
+ §The state machine.
663
843
 
664
844
  ## The `/economics` skill
665
845
 
@@ -693,7 +873,7 @@ drift-kit/
693
873
  bin/stage-economics.sh # the stage × model × iteration spend pricer
694
874
  kpis/kpi-*.sh # the bundled generic set
695
875
  templates/drift-config.sh
696
- templates/kpis.list # example registry (consumer copies + prunes)
876
+ templates/kpis.list # the shipped registry: every bundled KPI (consumer copies + prunes)
697
877
  templates/kpi-deprecated-surface.sh # example toolchain-shaped KPI (§Out of scope)
698
878
  templates/close-knowledge.md
699
879
  templates/price-table.tsv # placeholder + schema for the stage-economics price table (consumer fills the roster)
@@ -705,6 +885,15 @@ drift-kit/
705
885
  Registers no gates (advisory; the guard-kit precedent), so no `checks/`,
706
886
  `gate-tests/`, or `smoke/violation.sh`.
707
887
 
888
+ `templates/kpis.list` names every plugin in `kpis/`, never a starter subset: it
889
+ is the kit's claim about what it bundles, which the roster above, this SPEC, and
890
+ the smoke's per-KPI row assertion are all stated over. Pruning is the
891
+ *consumer's* act on its own copy, and the template's header says so.
892
+ `gate-sdk/SPEC.md §check-template-registry-parity` holds the two in parity both
893
+ ways — the sibling-directory pairing is what puts this template in that gate's
894
+ population, and `templates/kpi-deprecated-surface.sh`, an example a consumer
895
+ adapts rather than a bundled plugin, out of it.
896
+
708
897
  Config follows the established kit pattern: copy `templates/drift-config.sh`
709
898
  into the gates dir (or point `DRIFT_KIT_CONFIG_FILE` elsewhere) and override
710
899
  any knob; defaults fill what the consumer left unset, and a set-but-missing
@@ -783,6 +972,17 @@ Knobs (this repo's layout as defaults):
783
972
  lifecycle roster already carries that word renames it here; a stamp naming the
784
973
  label collides and suppresses the rows for that run rather than blending two
785
974
  meanings into one column value.
975
+ - `DRIFT_KIT_FANOUT_SUFFIX` — the suffix the stage-economics meter appends to an
976
+ anchor's stage-or-role value to name its dispatched subtree's row
977
+ (§The stage-economics meter, the fan-out row); default `+fanout`. The default is
978
+ collision-proof by construction (`+` is outside the stamp's stage alphabet); an
979
+ override that a stamped stage name ends in collides and suppresses the fan-out
980
+ rows for that run. Deliberately the *only* new knob: a meta-filename or
981
+ field-name knob would imply a portability the mechanism does not have (a
982
+ consumer on a different harness has a different artifact, not a differently
983
+ named one), and an opt-out for reading the meta layer would either default on
984
+ and be set by nobody or default off and ship the feature as dead code — the
985
+ degradation contract already gives a consumer the only thing an opt-out buys.
786
986
  - `DRIFT_KIT_STATE_FILE` — the WORKFLOW-STATE path whose *committed history and
787
987
  live content* the stage-economics join reads for stamps (§The stage-economics
788
988
  meter, history ∪ live); default `${GATE_SDK_WORKFLOW_DIR:-.workflow}/WORKFLOW-STATE.txt` (the
@@ -801,9 +1001,24 @@ The report and every bundled plugin are advisory plain text over live git
801
1001
  state — not fixture-stable, so no expected-output corpus (the gate
802
1002
  contracts do not fit; context-kit's reasoning). `smoke/install.sh` builds
803
1003
  the throwaway consumer, registers the bundled set, and asserts: exit 0 with
804
- both section headers and one row per registered KPI; a registry naming a
805
- missing plugin yields its visible `n/a` row without failing; `--trend`
806
- emits exactly one line. The trajectory extractor needs committed history the
1004
+ both section headers and **at least** one row per registered KPI; a registry
1005
+ naming a missing plugin yields its visible `n/a` row without failing; `--trend`
1006
+ emits exactly one line; and, per registered name resolving to a bundled plugin,
1007
+ that **the plugin itself emits a row when invoked directly**.
1008
+
1009
+ A floor, not equality, because a plugin owns one *or more* rows —
1010
+ `kpi-queue-net-delta` (§Bundled KPIs) emits two by design — so equality would red
1011
+ the moment the bundled set contains a multi-row plugin. The per-plugin probe
1012
+ beside it is what carries the bite the floor cannot: the report substitutes its
1013
+ own `n/a (plugin failed)` row for a plugin that exits non-zero or emits nothing,
1014
+ so the row count holds even where every plugin is silent, and a multi-row plugin
1015
+ would in any case offset a sibling contributing none. Contribution is the
1016
+ property, not health — an `n/a` row is a row — and a name resolving to no plugin
1017
+ is skipped, that row being the report's own and asserted separately. The probe
1018
+ asserts it probed something, so a resolution change cannot make it vacuous.
1019
+ Residual limit, stated because it is real: neither assertion pins *which* plugin
1020
+ emitted a given row, so a plugin emitting the wrong number of rows is not caught.
1021
+ The trajectory extractor needs committed history the
807
1022
  throwaway consumer lacks, so `smoke/install.sh` proves it against a hermetic
808
1023
  fake-history repo — one closed, range-bounded iteration — and asserts the
809
1024
  table parses, that iteration's row is emitted, and the in-flight iteration's
@@ -845,7 +1060,28 @@ asserts exactly one supervision row is emitted for the iteration carrying the
845
1060
  lead transcript's own usage, that the dispatched session keeps its own stage row,
846
1061
  that the row's label is `DRIFT_KIT_SUPERVISION_LABEL`'s value rather than a
847
1062
  literal, and that a stamp naming the label suppresses the row with the collision
848
- notice. `kpi-price-table-age` is fixture-stable in the same way — it reads two
1063
+ notice. (iii) A *fan-out* fixture — a synthetic three-level tree: a flat
1064
+ `<lead>.jsonl`, and under `<lead>/subagents/` a stamped stage transcript with a
1065
+ `spawnDepth` 1 meta record, a child at `spawnDepth` 2 naming it as
1066
+ `parentAgentId`, and a grandchild at `spawnDepth` 3 naming the child; plus a
1067
+ **second session stamped into the same `(iteration, stage)`** carrying no
1068
+ assistant usage, with a child of its own — the batch-split shape, which is also
1069
+ the one that proves a stage anchors on its stamp *resolving* rather than on
1070
+ emitting a row. It asserts exactly one fan-out row for the stamped stage whose
1071
+ tokens are the **sum over the whole subtree** (so both a walk that stopped at
1072
+ depth 2 and two anchors racing under the dedup key instead of folding red), that
1073
+ the contributing anchor count is named where it exceeds one, that the stage
1074
+ row still carries only the stage session's own usage (so a fold reds), that the
1075
+ suffix comes from `DRIFT_KIT_FANOUT_SUFFIX` rather than a literal, that a stamp
1076
+ whose stage ends in the suffix raises the collision notice and suppresses the row,
1077
+ and that the under-count bound excludes every transcript the pass attributed.
1078
+ Its two **degradation** assertions are what make the coupling's bounded failure
1079
+ testable rather than asserted, and neither may be dropped for brevity: deleting
1080
+ the grandchild's meta record moves it back into the under-count bound and raises
1081
+ the counted unresolved notice while every row the pass does not own stays
1082
+ byte-identical, and deleting the whole meta layer emits zero fan-out rows plus the
1083
+ single notice with — again — every other row byte-identical.
1084
+ `kpi-price-table-age` is fixture-stable in the same way — it reads two
849
1085
  dates out of a file the fixture writes — so `smoke/install.sh` drives it over
850
1086
  purpose-built tables and asserts the age row, the `price <N>d` trend fragment,
851
1087
  each header's absence degrading its own row independently, and — **the
@@ -855,7 +1091,13 @@ and whose `prices-valid-through:` has passed reads a fresh age row and an
855
1091
  has not tested the feature: the age row is reassuring in exactly that case,
856
1092
  which is the defect. The no-table degradation is asserted to emit its single
857
1093
  `n/a (no price table)` row, and the report-wide one-row-per-registered-KPI
858
- assertion covers that shape from the other side. Gate-sdk's `check-shellcheck`
1094
+ assertion covers that shape from the other side. `kpi-incident-recurrence` is
1095
+ fixture-stable on the same grounds — it reads declarations out of a queue file the
1096
+ fixture writes — so `smoke/install.sh` drives it over a purpose-built queue and
1097
+ asserts the single lag row, that the count **sums dates across declarations**
1098
+ rather than counting declarations, the highest-count slug, the `recur <N>` trend
1099
+ fragment, and both degradations (a queue with no declaration, and no queue file at
1100
+ all) including the trend's silence under the first. Gate-sdk's `check-shellcheck`
859
1101
  lints all kit sources as usual.
860
1102
 
861
1103
  ## Out of scope
@@ -28,11 +28,30 @@ unset _ds_cfg
28
28
  : "${DRIFT_KIT_KNOWLEDGE_LOG:=${GATE_SDK_WORKFLOW_DIR:-.workflow}/knowledge-friction.log}"
29
29
 
30
30
  usage() {
31
- printf 'usage: %s "<fact re-derived>" "<surface it was read from>"\n' "$(basename "$0")" >&2
31
+ printf 'usage: %s [-h|--help] [--] "<fact re-derived>" "<surface it was read from>"\n' "$(basename "$0")"
32
+ printf ' appends one dated line to %s; "--" files a field beginning with "-"\n' \
33
+ "$DRIFT_KIT_KNOWLEDGE_LOG"
32
34
  }
33
35
 
34
- if [[ $# -ne 2 || -z "$1" || -z "$2" ]]; then
36
+ # spec: gate-sdk/SPEC.md §The bin/-tool contract — free-text positionals validate shape, not only arity: the refusal scans every positional, since arity alone leaves a flag safe in no slot but the first
37
+ if [[ "${1:-}" == "-h" || "${1:-}" == "--help" ]]; then
35
38
  usage
39
+ exit 0
40
+ fi
41
+ if [[ "${1:-}" == "--" ]]; then
42
+ shift
43
+ else
44
+ for _kf_arg in "$@"; do
45
+ [[ "$_kf_arg" == -* ]] || continue
46
+ printf '%s: unrecognized option: %s — a field beginning with "-" is filed after a "--" separator\n' \
47
+ "$(basename "$0")" "$_kf_arg" >&2
48
+ usage >&2
49
+ exit 2
50
+ done
51
+ fi
52
+
53
+ if [[ $# -ne 2 || -z "$1" || -z "$2" ]]; then
54
+ usage >&2
36
55
  exit 2
37
56
  fi
38
57