checkwright 0.22.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 (346) hide show
  1. package/README.md +687 -90
  2. package/lib/common/lock.sh +38 -9
  3. package/lib/common/profile.sh +33 -0
  4. package/lib/common/recipe.sh +49 -33
  5. package/lib/diff.sh +64 -0
  6. package/lib/doctor.sh +67 -42
  7. package/lib/init.sh +23 -31
  8. package/lib/uninstall.sh +212 -0
  9. package/lib/update.sh +34 -0
  10. package/package.json +2 -2
  11. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates +0 -0
  12. package/payload/artifact/x86_64-unknown-linux-gnu/checkwright-gates.sha256 +1 -1
  13. package/payload/canon-kit/README.md +1 -0
  14. package/payload/canon-kit/SPEC.md +410 -58
  15. package/payload/canon-kit/checks/check-amendment-queue.sh +1 -0
  16. package/payload/canon-kit/checks/check-comment-tier.gate +3 -0
  17. package/payload/canon-kit/checks/check-deprecation-task.gate +3 -0
  18. package/payload/canon-kit/checks/check-docs-cmd.gate +3 -0
  19. package/payload/canon-kit/checks/check-docs-link-convention.sh +1 -0
  20. package/payload/canon-kit/checks/check-install-claim.gate +3 -0
  21. package/payload/canon-kit/checks/check-knob-citation.gate +3 -0
  22. package/payload/canon-kit/checks/check-knob-default-coupling.sh +1 -0
  23. package/payload/canon-kit/checks/check-manifest-count.gate +3 -0
  24. package/payload/canon-kit/checks/check-manifest-temporal.gate +3 -0
  25. package/payload/canon-kit/checks/check-md-refs.gate +3 -0
  26. package/payload/canon-kit/checks/check-measured-claim.gate +3 -0
  27. package/payload/canon-kit/checks/check-payload-claim.gate +3 -0
  28. package/payload/canon-kit/checks/check-prose-enum.gate +3 -0
  29. package/payload/canon-kit/checks/check-prose-tells.sh +1 -0
  30. package/payload/canon-kit/checks/check-spec-derivable-section.gate +3 -0
  31. package/payload/canon-kit/checks/check-spec-dod-singleton.gate +3 -0
  32. package/payload/canon-kit/checks/check-spec-embedded-source.sh +1 -0
  33. package/payload/canon-kit/checks/check-spec-fence-balance.gate +3 -0
  34. package/payload/canon-kit/checks/check-spec-pointer.gate +3 -0
  35. package/payload/canon-kit/checks/check-surface-duplication.sh +1 -0
  36. package/payload/canon-kit/checks/check-todo-task-liveness.gate +3 -0
  37. package/payload/canon-kit/checks/check-tracking-claim.gate +3 -0
  38. package/payload/canon-kit/gate-tests/check-comment-tier/bad/.workflow/fixture-state.txt +4 -0
  39. package/payload/canon-kit/gate-tests/check-comment-tier/bad/bad.gate +4 -0
  40. package/payload/canon-kit/gate-tests/check-comment-tier/bad/bad.rs +5 -0
  41. package/payload/canon-kit/gate-tests/check-comment-tier/bad/expect.txt +4 -0
  42. package/payload/canon-kit/gate-tests/check-comment-tier/bad/templates/bad-tmpl.sh +4 -0
  43. package/payload/canon-kit/gate-tests/check-comment-tier/good/.workflow/fixture-state.txt +3 -0
  44. package/payload/canon-kit/gate-tests/check-comment-tier/good/expect.txt +1 -1
  45. package/payload/canon-kit/gate-tests/check-comment-tier/good/good.gate +4 -0
  46. package/payload/canon-kit/gate-tests/check-comment-tier/good/good.rs +5 -0
  47. package/payload/canon-kit/gate-tests/check-comment-tier/good/templates/good-tmpl.sh +5 -0
  48. package/payload/canon-kit/gate-tests/check-comment-tier.test.sh +3 -2
  49. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/.workflow/fixture-state.txt +3 -0
  50. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/bad.gate +2 -0
  51. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/bad.rs +4 -0
  52. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/expect.txt +3 -0
  53. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/scripts/canon-config.sh +6 -5
  54. package/payload/canon-kit/gate-tests/check-deprecation-task/bad/templates/tmpl.sh +5 -0
  55. package/payload/canon-kit/gate-tests/check-deprecation-task/good/.workflow/fixture-state.txt +3 -0
  56. package/payload/canon-kit/gate-tests/check-deprecation-task/good/expect.txt +1 -1
  57. package/payload/canon-kit/gate-tests/check-deprecation-task/good/good.gate +2 -0
  58. package/payload/canon-kit/gate-tests/check-deprecation-task/good/good.rs +4 -0
  59. package/payload/canon-kit/gate-tests/check-deprecation-task/good/scripts/canon-config.sh +6 -5
  60. package/payload/canon-kit/gate-tests/check-deprecation-task/good/templates/tmpl.sh +5 -0
  61. package/payload/canon-kit/gate-tests/check-deprecation-task.test.sh +4 -3
  62. package/payload/canon-kit/gate-tests/check-knob-citation.test.sh +2 -2
  63. package/payload/canon-kit/gate-tests/check-manifest-count/good/SPEC.md +4 -0
  64. package/payload/canon-kit/gate-tests/check-manifest-count.test.sh +27 -5
  65. package/payload/canon-kit/gate-tests/check-md-refs.test.sh +61 -9
  66. package/payload/canon-kit/gate-tests/check-measured-claim/bad/SPEC.md +12 -0
  67. package/payload/canon-kit/gate-tests/check-measured-claim/bad/expect.txt +3 -0
  68. package/payload/canon-kit/gate-tests/check-measured-claim/bad/scripts/canon-config.sh +6 -0
  69. package/payload/canon-kit/gate-tests/check-measured-claim/good/SPEC.md +23 -0
  70. package/payload/canon-kit/gate-tests/check-measured-claim/good/expect.txt +1 -0
  71. package/payload/canon-kit/gate-tests/check-measured-claim/good/scripts/canon-config.sh +6 -0
  72. package/payload/canon-kit/gate-tests/check-measured-claim.test.sh +90 -0
  73. package/payload/canon-kit/gate-tests/check-prose-enum.test.sh +3 -3
  74. package/payload/canon-kit/gate-tests/check-spec-dod-singleton.test.sh +21 -7
  75. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/.workflow/fixture-state.txt +2 -0
  76. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/bad.gate +2 -0
  77. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/bad.rs +4 -0
  78. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/expect.txt +3 -0
  79. package/payload/canon-kit/gate-tests/check-spec-pointer/bad/templates/tmpl.sh +5 -0
  80. package/payload/canon-kit/gate-tests/check-spec-pointer/good/.workflow/fixture-state.txt +2 -0
  81. package/payload/canon-kit/gate-tests/check-spec-pointer/good/expect.txt +1 -1
  82. package/payload/canon-kit/gate-tests/check-spec-pointer/good/good.gate +2 -0
  83. package/payload/canon-kit/gate-tests/check-spec-pointer/good/good.rs +4 -0
  84. package/payload/canon-kit/gate-tests/check-spec-pointer/good/templates/tmpl.sh +5 -0
  85. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/.workflow/fixture-state.txt +3 -0
  86. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/bad.gate +2 -0
  87. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/bad.rs +4 -0
  88. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/expect.txt +3 -0
  89. package/payload/canon-kit/gate-tests/check-todo-task-liveness/bad/templates/tmpl.sh +5 -0
  90. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/.workflow/fixture-state.txt +3 -0
  91. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/expect.txt +1 -1
  92. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/good.gate +2 -0
  93. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/good.rs +4 -0
  94. package/payload/canon-kit/gate-tests/check-todo-task-liveness/good/templates/tmpl.sh +5 -0
  95. package/payload/canon-kit/gate-tests/check-tracking-claim.test.sh +1 -2
  96. package/payload/canon-kit/lib/spec.sh +91 -62
  97. package/payload/canon-kit/smoke/install.sh +1 -0
  98. package/payload/canon-kit/templates/SPEC-amendment.md +4 -1
  99. package/payload/context-kit/README.md +4 -1
  100. package/payload/context-kit/SPEC.md +143 -10
  101. package/payload/context-kit/bin/env-probe.sh +19 -6
  102. package/payload/context-kit/checks/check-brevity.sh +1 -0
  103. package/payload/context-kit/checks/check-footprint-fresh.sh +1 -0
  104. package/payload/context-kit/checks/check-memory-off.sh +1 -0
  105. package/payload/context-kit/checks/check-settings-paths.sh +94 -0
  106. package/payload/context-kit/checks/check-settings-pins.sh +1 -0
  107. package/payload/context-kit/gate-tests/check-settings-paths/bad/args +1 -0
  108. package/payload/context-kit/gate-tests/check-settings-paths/bad/expect.txt +3 -0
  109. package/payload/context-kit/gate-tests/check-settings-paths/bad/settings.json +12 -0
  110. package/payload/context-kit/gate-tests/check-settings-paths/bad/tools/real-tool.sh +4 -0
  111. package/payload/context-kit/gate-tests/check-settings-paths/good/args +1 -0
  112. package/payload/context-kit/gate-tests/check-settings-paths/good/expect.txt +1 -0
  113. package/payload/context-kit/gate-tests/check-settings-paths/good/settings.json +16 -0
  114. package/payload/context-kit/gate-tests/check-settings-paths/good/tools/real-tool.sh +4 -0
  115. package/payload/context-kit/index-tests/expected/toolfloor.txt +9 -0
  116. package/payload/context-kit/index-tests/toolfloor-cases.sh +20 -0
  117. package/payload/context-kit/lib/toolfloor.sh +15 -4
  118. package/payload/context-kit/smoke/agents-md.sh +12 -1
  119. package/payload/context-kit/smoke/install.sh +1 -0
  120. package/payload/delegation-kit/README.md +3 -3
  121. package/payload/delegation-kit/SPEC.md +116 -13
  122. package/payload/delegation-kit/checks/check-agent-tier-explicit.sh +1 -0
  123. package/payload/delegation-kit/checks/check-gate-tamper.sh +1 -0
  124. package/payload/delegation-kit/checks/check-rule-citation.sh +1 -0
  125. package/payload/delegation-kit/templates/agent-execution.md +38 -14
  126. package/payload/delegation-kit/templates/statusline-usage.sh +23 -1
  127. package/payload/doctrine-kit/DOCTRINE.md +86 -12
  128. package/payload/doctrine-kit/README.md +7 -3
  129. package/payload/doctrine-kit/SPEC.md +102 -9
  130. package/payload/doctrine-kit/bin/install-doctrine.sh +83 -13
  131. package/payload/doctrine-kit/checks/check-doctrine-registration.sh +41 -11
  132. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/bad/DOCTRINE.md +3 -0
  133. package/payload/doctrine-kit/gate-tests/check-doctrine-registration/good/DOCTRINE.md +3 -0
  134. package/payload/doctrine-kit/gate-tests/check-doctrine-registration.test.sh +82 -2
  135. package/payload/doctrine-kit/smoke/install.sh +90 -0
  136. package/payload/drift-kit/SPEC.md +13 -4
  137. package/payload/drift-kit/bin/kfric.sh +21 -2
  138. package/payload/drift-kit/smoke/install.sh +28 -0
  139. package/payload/evidence-kit/checks/check-battery-roster.sh +1 -0
  140. package/payload/evidence-kit/checks/check-evidence-baseline.sh +1 -0
  141. package/payload/evidence-kit/checks/check-evidence-manifest.sh +1 -0
  142. package/payload/evidence-kit/checks/check-producer-liveness.sh +1 -0
  143. package/payload/gate-sdk/README.md +13 -0
  144. package/payload/gate-sdk/SPEC.md +2611 -151
  145. package/payload/gate-sdk/bin/build-native.sh +38 -0
  146. package/payload/gate-sdk/bin/enforcement-map.sh +2 -1
  147. package/payload/gate-sdk/bin/gen-pre-commit.sh +23 -3
  148. package/payload/gate-sdk/bin/port-blockers.sh +445 -0
  149. package/payload/gate-sdk/bin/run-consumer-smoke.sh +8 -1
  150. package/payload/gate-sdk/bin/run-gate-tests.sh +26 -5
  151. package/payload/gate-sdk/bin/run-gates.sh +8 -2
  152. package/payload/gate-sdk/bin/upgrade-smoke.sh +52 -4
  153. package/payload/gate-sdk/checks/check-action-gh-repo.gate +1 -0
  154. package/payload/gate-sdk/checks/check-action-pinning.gate +1 -0
  155. package/payload/gate-sdk/checks/check-action-run-shell.sh +1 -0
  156. package/payload/gate-sdk/checks/check-assertion-strength.gate +3 -0
  157. package/payload/gate-sdk/checks/check-commit-msg.sh +1 -0
  158. package/payload/gate-sdk/checks/check-commit-subject.sh +1 -0
  159. package/payload/gate-sdk/checks/check-core-files.sh +1 -0
  160. package/payload/gate-sdk/checks/check-crate-arms.sh +61 -0
  161. package/payload/gate-sdk/checks/check-enforcement-fresh.sh +1 -0
  162. package/payload/gate-sdk/checks/check-exec-bit.sh +1 -0
  163. package/payload/gate-sdk/checks/check-gate-assertions.sh +31 -6
  164. package/payload/gate-sdk/checks/check-gate-binary-fresh.sh +2 -1
  165. package/payload/gate-sdk/checks/check-gate-exemption-tasks.sh +1 -0
  166. package/payload/gate-sdk/checks/check-gate-fail-closed.sh +1 -0
  167. package/payload/gate-sdk/checks/check-gate-fixture-coverage.sh +1 -0
  168. package/payload/gate-sdk/checks/check-gate-output.sh +33 -3
  169. package/payload/gate-sdk/checks/check-gate-substrate-parity.sh +36 -5
  170. package/payload/gate-sdk/checks/check-graph.sh +1 -0
  171. package/payload/gate-sdk/checks/check-hook-exec-bit.sh +1 -0
  172. package/payload/gate-sdk/checks/check-identity.sh +1 -0
  173. package/payload/gate-sdk/checks/check-install-disposition.sh +92 -0
  174. package/payload/gate-sdk/checks/check-kit-enum.sh +1 -0
  175. package/payload/gate-sdk/checks/check-kit-registration.gate +3 -0
  176. package/payload/gate-sdk/checks/check-readme-roster.sh +1 -0
  177. package/payload/gate-sdk/checks/check-reads-couples.sh +3 -2
  178. package/payload/gate-sdk/checks/check-root-tiering.sh +1 -0
  179. package/payload/gate-sdk/checks/check-shellcheck.sh +1 -0
  180. package/payload/gate-sdk/checks/check-smoke-entry-guard.gate +3 -0
  181. package/payload/gate-sdk/checks/check-template-copy-parity.sh +1 -0
  182. package/payload/gate-sdk/checks/check-template-registry-parity.gate +3 -0
  183. package/payload/gate-sdk/checks/check-test-hermetic.gate +3 -0
  184. package/payload/gate-sdk/checks/check-tree-terms.sh +1 -0
  185. package/payload/gate-sdk/checks/check-workflow-tiering.sh +2 -1
  186. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/crate/Cargo.toml +7 -0
  187. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/crate/src/lib.rs +12 -0
  188. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/expect.txt +5 -0
  189. package/payload/gate-sdk/gate-tests/check-crate-arms/bad/scripts/gate-sdk-config.sh +2 -0
  190. package/payload/gate-sdk/gate-tests/check-crate-arms/good/crate/Cargo.toml +7 -0
  191. package/payload/gate-sdk/gate-tests/check-crate-arms/good/crate/src/lib.rs +11 -0
  192. package/payload/gate-sdk/gate-tests/check-crate-arms/good/expect.txt +2 -0
  193. package/payload/gate-sdk/gate-tests/check-crate-arms/good/scripts/gate-sdk-config.sh +2 -0
  194. package/payload/gate-sdk/gate-tests/check-gate-assertions/good/expect.txt +1 -1
  195. package/payload/gate-sdk/gate-tests/check-gate-output/bad/check-native-sample.gate +3 -0
  196. package/payload/gate-sdk/gate-tests/check-gate-output/bad/expect.txt +3 -0
  197. package/payload/gate-sdk/gate-tests/check-gate-output/bad/gates.list +1 -0
  198. package/payload/gate-sdk/gate-tests/check-gate-output/bad/native/Cargo.toml +4 -0
  199. package/payload/gate-sdk/gate-tests/check-gate-output/bad/native/src/gates/native_sample.rs +7 -0
  200. package/payload/gate-sdk/gate-tests/check-gate-output/good/check-native-sample.gate +3 -0
  201. package/payload/gate-sdk/gate-tests/check-gate-output/good/expect.txt +1 -1
  202. package/payload/gate-sdk/gate-tests/check-gate-output/good/gates.list +1 -0
  203. package/payload/gate-sdk/gate-tests/check-gate-output/good/native/Cargo.toml +4 -0
  204. package/payload/gate-sdk/gate-tests/check-gate-output/good/native/src/gates/native_sample.rs +11 -0
  205. package/payload/gate-sdk/gate-tests/check-gate-output.test.sh +111 -0
  206. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity/good/expect.txt +1 -1
  207. package/payload/gate-sdk/gate-tests/check-gate-substrate-parity.test.sh +65 -4
  208. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-alpha.sh +6 -0
  209. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-delta.sh +5 -0
  210. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/checks/check-epsilon.sh +6 -0
  211. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/alpha-kit/smoke/install.sh +7 -0
  212. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/args +6 -0
  213. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/expect.txt +1 -0
  214. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/installer/lib/common/recipe.sh +9 -0
  215. package/payload/gate-sdk/gate-tests/check-install-disposition/bad/scripts/gate-sdk-config.sh +5 -0
  216. package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-alpha.sh +6 -0
  217. package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-beta.gate +3 -0
  218. package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/checks/check-gamma.sh +6 -0
  219. package/payload/gate-sdk/gate-tests/check-install-disposition/good/alpha-kit/smoke/install.sh +8 -0
  220. package/payload/gate-sdk/gate-tests/check-install-disposition/good/args +6 -0
  221. package/payload/gate-sdk/gate-tests/check-install-disposition/good/expect.txt +1 -0
  222. package/payload/gate-sdk/gate-tests/check-install-disposition/good/installer/lib/common/recipe.sh +10 -0
  223. package/payload/gate-sdk/gate-tests/check-install-disposition/good/scripts/gate-sdk-config.sh +5 -0
  224. package/payload/gate-sdk/gate-tests/check-kit-registration.test.sh +6 -5
  225. package/payload/gate-sdk/gate-tests/check-test-hermetic-smoke.test.sh +2 -3
  226. package/payload/gate-sdk/gate-tests/lib-gate.test.sh +111 -1
  227. package/payload/gate-sdk/gate-tests/run-dispatch-streams.test.sh +73 -0
  228. package/payload/gate-sdk/lib/consumer-smoke.sh +24 -12
  229. package/payload/gate-sdk/lib/gate.sh +135 -11
  230. package/payload/gate-sdk/lib/inject.sh +25 -0
  231. package/payload/gate-sdk/lib/test-hermetic.sh +26 -0
  232. package/payload/gate-sdk/smoke/install.sh +42 -0
  233. package/payload/guard-kit/README.md +14 -11
  234. package/payload/guard-kit/SPEC.md +278 -62
  235. package/payload/guard-kit/bin/run-guard-tests.sh +1 -0
  236. package/payload/guard-kit/gate-tests/guard-read-path.test.sh +52 -0
  237. package/payload/guard-kit/guard-tests/cases.tsv +49 -7
  238. package/payload/guard-kit/lib/guard.sh +276 -54
  239. package/payload/guard-kit/templates/close-triage.md +5 -5
  240. package/payload/guard-kit/templates/settings-hooks.json +7 -1
  241. package/payload/lifecycle-kit/README.md +11 -1
  242. package/payload/lifecycle-kit/SPEC.md +441 -37
  243. package/payload/lifecycle-kit/bin/cite-survey.sh +81 -0
  244. package/payload/lifecycle-kit/bin/enter-stage.sh +126 -10
  245. package/payload/lifecycle-kit/bin/file-gap.sh +27 -10
  246. package/payload/lifecycle-kit/bin/file-survey.sh +21 -2
  247. package/payload/lifecycle-kit/checks/check-close-surfaces.sh +1 -0
  248. package/payload/lifecycle-kit/checks/check-gap-inbox-neutrality.gate +3 -0
  249. package/payload/lifecycle-kit/checks/check-lesson-disposition.gate +3 -0
  250. package/payload/lifecycle-kit/checks/check-lifecycle-registration.gate +3 -0
  251. package/payload/lifecycle-kit/checks/check-merge-attrs.gate +3 -0
  252. package/payload/lifecycle-kit/checks/check-scratch-citation.gate +3 -0
  253. package/payload/lifecycle-kit/checks/check-shim-restatement.gate +3 -0
  254. package/payload/lifecycle-kit/checks/check-skill-binding.gate +3 -0
  255. package/payload/lifecycle-kit/checks/check-stage-entry.sh +1 -0
  256. package/payload/lifecycle-kit/checks/check-stage-evidence.gate +3 -0
  257. package/payload/lifecycle-kit/checks/check-stage-skill-coverage.gate +3 -0
  258. package/payload/lifecycle-kit/checks/check-survey-record.gate +3 -0
  259. package/payload/lifecycle-kit/gate-tests/check-close-surfaces.test.sh +1 -2
  260. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/args +2 -0
  261. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/expect.txt +3 -0
  262. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/bad/gap-inbox.md +5 -0
  263. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/args +2 -0
  264. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/expect.txt +1 -0
  265. package/payload/lifecycle-kit/gate-tests/check-gap-inbox-neutrality/good/gap-inbox.md +4 -0
  266. package/payload/lifecycle-kit/gate-tests/check-lesson-disposition.test.sh +2 -3
  267. package/payload/lifecycle-kit/gate-tests/check-lifecycle-registration.test.sh +2 -3
  268. package/payload/lifecycle-kit/gate-tests/check-merge-attrs.test.sh +2 -3
  269. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/expect.txt +1 -0
  270. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/scripts/lifecycle-config.sh +4 -0
  271. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/bad/surfaces/queue.md +13 -0
  272. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/expect.txt +1 -0
  273. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/scripts/lifecycle-config.sh +4 -0
  274. package/payload/lifecycle-kit/gate-tests/check-scratch-citation/good/surfaces/queue.md +31 -0
  275. package/payload/lifecycle-kit/gate-tests/check-shim-restatement.test.sh +2 -3
  276. package/payload/lifecycle-kit/gate-tests/check-skill-binding.test.sh +2 -3
  277. package/payload/lifecycle-kit/gate-tests/check-stage-entry.test.sh +2 -3
  278. package/payload/lifecycle-kit/gate-tests/check-stage-evidence.test.sh +9 -5
  279. package/payload/lifecycle-kit/gate-tests/check-survey-record.test.sh +2 -3
  280. package/payload/lifecycle-kit/gate-tests/file-gap-recurrence.test.sh +54 -26
  281. package/payload/lifecycle-kit/gate-tests/rename-iteration.test.sh +142 -0
  282. package/payload/lifecycle-kit/gate-tests/workflow-state-guard.test.sh +100 -0
  283. package/payload/lifecycle-kit/lib/stages.sh +4 -0
  284. package/payload/lifecycle-kit/smoke/install.sh +67 -4
  285. package/payload/lifecycle-kit/templates/lead.md +36 -0
  286. package/payload/lifecycle-kit/templates/stages/close.md +30 -11
  287. package/payload/lifecycle-kit/templates/stages/scope.md +9 -4
  288. package/payload/lifecycle-kit/templates/stages/spec.md +5 -1
  289. package/payload/lifecycle-kit/templates/workflow-state-guard.sh +29 -0
  290. package/payload/queue-kit/README.md +3 -1
  291. package/payload/queue-kit/SPEC.md +123 -3
  292. package/payload/queue-kit/bin/queue-counts.sh +35 -0
  293. package/payload/queue-kit/checks/check-queue-entry-budget.gate +3 -0
  294. package/payload/queue-kit/checks/check-queue-hygiene.gate +3 -0
  295. package/payload/queue-kit/checks/check-queue-prose-precondition.sh +1 -0
  296. package/payload/queue-kit/checks/check-queue-sections.gate +3 -0
  297. package/payload/queue-kit/checks/check-queue-slug-liveness.gate +3 -0
  298. package/payload/queue-kit/checks/check-queue-wrap.gate +3 -0
  299. package/payload/queue-kit/checks/check-roadmap-fresh.sh +1 -0
  300. package/payload/queue-kit/checks/check-tag-lead-line.gate +3 -0
  301. package/payload/queue-kit/checks/check-task-conservation.gate +4 -0
  302. package/payload/queue-kit/checks/check-task-names.gate +3 -0
  303. package/payload/queue-kit/gate-tests/queue-counts.test.sh +116 -0
  304. package/payload/queue-kit/gate-tests/queue-lib-parity.test.sh +215 -0
  305. package/payload/queue-kit/lib/queue.sh +4 -19
  306. package/payload/site-kit/SPEC.md +23 -0
  307. package/payload/site-kit/checks/check-docs-cname-parity.sh +1 -0
  308. package/payload/site-kit/checks/check-docs-render-fidelity.sh +1 -0
  309. package/profiles.list +36 -8
  310. package/payload/canon-kit/checks/check-comment-tier.sh +0 -216
  311. package/payload/canon-kit/checks/check-deprecation-task.sh +0 -90
  312. package/payload/canon-kit/checks/check-docs-cmd.sh +0 -153
  313. package/payload/canon-kit/checks/check-install-claim.sh +0 -146
  314. package/payload/canon-kit/checks/check-knob-citation.sh +0 -117
  315. package/payload/canon-kit/checks/check-manifest-count.sh +0 -46
  316. package/payload/canon-kit/checks/check-manifest-temporal.sh +0 -83
  317. package/payload/canon-kit/checks/check-md-refs.sh +0 -128
  318. package/payload/canon-kit/checks/check-payload-claim.sh +0 -133
  319. package/payload/canon-kit/checks/check-prose-enum.sh +0 -115
  320. package/payload/canon-kit/checks/check-spec-derivable-section.sh +0 -69
  321. package/payload/canon-kit/checks/check-spec-dod-singleton.sh +0 -45
  322. package/payload/canon-kit/checks/check-spec-fence-balance.sh +0 -42
  323. package/payload/canon-kit/checks/check-spec-pointer.sh +0 -187
  324. package/payload/canon-kit/checks/check-todo-task-liveness.sh +0 -80
  325. package/payload/canon-kit/checks/check-tracking-claim.sh +0 -136
  326. package/payload/gate-sdk/checks/check-assertion-strength.sh +0 -134
  327. package/payload/gate-sdk/checks/check-kit-registration.sh +0 -68
  328. package/payload/gate-sdk/checks/check-smoke-entry-guard.sh +0 -53
  329. package/payload/gate-sdk/checks/check-template-registry-parity.sh +0 -81
  330. package/payload/gate-sdk/checks/check-test-hermetic.sh +0 -119
  331. package/payload/lifecycle-kit/checks/check-lesson-disposition.sh +0 -98
  332. package/payload/lifecycle-kit/checks/check-lifecycle-registration.sh +0 -54
  333. package/payload/lifecycle-kit/checks/check-merge-attrs.sh +0 -69
  334. package/payload/lifecycle-kit/checks/check-shim-restatement.sh +0 -97
  335. package/payload/lifecycle-kit/checks/check-skill-binding.sh +0 -59
  336. package/payload/lifecycle-kit/checks/check-stage-evidence.sh +0 -81
  337. package/payload/lifecycle-kit/checks/check-stage-skill-coverage.sh +0 -47
  338. package/payload/lifecycle-kit/checks/check-survey-record.sh +0 -102
  339. package/payload/queue-kit/checks/check-queue-entry-budget.sh +0 -106
  340. package/payload/queue-kit/checks/check-queue-hygiene.sh +0 -81
  341. package/payload/queue-kit/checks/check-queue-sections.sh +0 -44
  342. package/payload/queue-kit/checks/check-queue-slug-liveness.sh +0 -63
  343. package/payload/queue-kit/checks/check-queue-wrap.sh +0 -56
  344. package/payload/queue-kit/checks/check-tag-lead-line.sh +0 -70
  345. package/payload/queue-kit/checks/check-task-conservation.sh +0 -50
  346. package/payload/queue-kit/checks/check-task-names.sh +0 -128
@@ -1,69 +0,0 @@
1
- #!/usr/bin/env bash
2
- # graph: couples=*SPEC*.md dir=one valve=none tier=align-only
3
- # spec: canon-kit/SPEC.md §check-spec-derivable-section — a banned-heading section may not be a fenced code dump above the density budget
4
- set -uo pipefail
5
-
6
- KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
7
- SDK="${GATE_SDK_ROOT:-$KIT/../gate-sdk}"
8
- # shellcheck source=../../gate-sdk/lib/gate.sh
9
- source "$SDK/lib/gate.sh"
10
- # shellcheck source=../lib/spec.sh
11
- source "$KIT/lib/spec.sh"
12
-
13
- ROOT="${1:-.}"
14
- [[ -d "$ROOT" ]] || { echo "check-spec-derivable-section: not a directory: $ROOT" >&2; exit 2; }
15
-
16
- mapfile -t specs < <(spec_canonical_specs "$ROOT" | sort)
17
- [[ ${#specs[@]} -eq 0 ]] && { echo "SPEC-DERIVABLE-SECTION: clean (0 $CANON_KIT_SPEC_NAME found)"; exit 0; }
18
-
19
- banned=""
20
- for h in "${CANON_KIT_BANNED_HEADINGS[@]}"; do
21
- banned+=$'\x01'"$(printf '%s' "$h" | tr '[:upper:]' '[:lower:]')"
22
- done
23
- banned+=$'\x01'
24
-
25
- out="$(awk -v banned="$banned" -v density="$CANON_KIT_DERIVABLE_DENSITY" \
26
- -v pointer="$CANON_KIT_DERIVABLE_POINTER_REGEX" '
27
- function flush( dens) {
28
- if (cur_heading == "") return
29
- if (is_banned && !has_pointer && body_nonblank > 0) {
30
- dens = int(fenced_nonblank * 100 / body_nonblank)
31
- if (fenced_nonblank * 100 > density * body_nonblank)
32
- printf "%s: section \"%s\" (line %d) is %d%% fenced (banned heading, budget %d%%) — shed to a one-line index pointer\n", \
33
- cur_file, cur_heading, cur_line, dens, density
34
- }
35
- cur_heading = ""; is_banned = 0; has_pointer = 0; body_nonblank = 0; fenced_nonblank = 0
36
- }
37
- FNR == 1 { flush(); in_fence = 0 }
38
- {
39
- if ($0 ~ /^```/) {
40
- in_fence = !in_fence
41
- if (cur_heading != "") { body_nonblank++; fenced_nonblank++ }
42
- next
43
- }
44
- if (!in_fence && $0 ~ /^#{1,6}[[:space:]]/) {
45
- flush()
46
- h = $0; sub(/^#{1,6}[[:space:]]+/, "", h); sub(/[[:space:]]+$/, "", h)
47
- cur_heading = h; cur_file = FILENAME; cur_line = FNR
48
- is_banned = (index(banned, "\x01" tolower(h) "\x01") > 0)
49
- next
50
- }
51
- if (cur_heading != "" && $0 ~ /[^[:space:]]/) {
52
- body_nonblank++
53
- if (in_fence) fenced_nonblank++
54
- if ($0 ~ pointer) has_pointer = 1
55
- }
56
- }
57
- END { flush() }
58
- ' "${specs[@]}")"; st=$?
59
- fail_closed "$st" check-spec-derivable-section awk
60
-
61
- if [[ -n "$out" ]]; then
62
- n="$(printf '%s\n' "$out" | grep -c .)"
63
- echo "SPEC-DERIVABLE-SECTION: ${n} violation(s):"
64
- printf '%s\n' "$out" | sed 's/^/ /'
65
- echo " help: a banned-heading section (${CANON_KIT_BANNED_HEADINGS[*]}) that is mostly a code dump drifts — shed the body to a one-line index pointer (cite the code), keeping the prose that owns semantics"
66
- exit 1
67
- fi
68
- echo "SPEC-DERIVABLE-SECTION: clean (${#specs[@]} $CANON_KIT_SPEC_NAME, no banned-heading section exceeds the ${CANON_KIT_DERIVABLE_DENSITY}% fenced budget)"
69
- exit 0
@@ -1,45 +0,0 @@
1
- #!/usr/bin/env bash
2
- # graph: couples=*SPEC*.md dir=one valve=none tier=align-only
3
- # spec: canon-kit/SPEC.md §check-spec-dod-singleton — a canonical spec carries the Definition-of-Done heading the configured number of times
4
- set -uo pipefail
5
-
6
- KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
7
- SDK="${GATE_SDK_ROOT:-$KIT/../gate-sdk}"
8
- # shellcheck source=../../gate-sdk/lib/gate.sh
9
- source "$SDK/lib/gate.sh"
10
- # shellcheck source=../lib/spec.sh
11
- source "$KIT/lib/spec.sh"
12
-
13
- ROOT="${1:-.}"
14
- [[ -d "$ROOT" ]] || { echo "check-spec-dod-singleton: not a directory: $ROOT" >&2; exit 2; }
15
-
16
- mapfile -t specs < <(spec_canonical_specs "$ROOT" | sort)
17
- [[ ${#specs[@]} -eq 0 ]] && { echo "SPEC-DOD-SINGLETON: clean (0 $CANON_KIT_SPEC_NAME found)"; exit 0; }
18
-
19
- dod_lc="$(printf '%s' "$CANON_KIT_DOD_HEADING" | tr '[:upper:]' '[:lower:]')"
20
-
21
- errors=()
22
- for f in "${specs[@]}"; do
23
- n="$(awk -v want="$dod_lc" '
24
- /^#{2,4}[[:space:]]/ {
25
- h = tolower($0); sub(/^#{2,4}[[:space:]]+/, "", h)
26
- if (index(h, want) > 0) c++
27
- }
28
- END { print c + 0 }
29
- ' "$f")"; st=$?
30
- fail_closed "$st" check-spec-dod-singleton awk
31
- if [[ "$CANON_KIT_DOD_MODE" == "exactly-one" && "$n" -ne 1 ]]; then
32
- errors+=("$f has $n \"$CANON_KIT_DOD_HEADING\" heading(s) (need exactly 1)")
33
- elif [[ "$CANON_KIT_DOD_MODE" == "at-most-one" && "$n" -gt 1 ]]; then
34
- errors+=("$f has $n \"$CANON_KIT_DOD_HEADING\" heading(s) (need at most 1)")
35
- fi
36
- done
37
-
38
- if [[ ${#errors[@]} -gt 0 ]]; then
39
- echo "SPEC-DOD-SINGLETON: ${#errors[@]} violation(s) ($CANON_KIT_DOD_MODE):"
40
- printf ' %s\n' "${errors[@]}"
41
- echo " help: a duplicate Definition-of-Done checklist is two sources on the completion contract — fold the doubled/appended one into the canonical '## $CANON_KIT_DOD_HEADING' heading${CANON_KIT_DOD_MODE:+ (add one if missing under exactly-one)}"
42
- exit 1
43
- fi
44
- echo "SPEC-DOD-SINGLETON: clean (${#specs[@]} $CANON_KIT_SPEC_NAME scanned, $CANON_KIT_DOD_MODE)"
45
- exit 0
@@ -1,42 +0,0 @@
1
- #!/usr/bin/env bash
2
- # graph: couples=*SPEC*.md,*README.md,CLAUDE.md,TASK-QUEUE.md dir=one valve=none tier=precommit
3
- # spec: canon-kit/SPEC.md §check-spec-fence-balance — every governed markdown file has an even fence-delimiter count, so the fence-skipping parsers never desync and fail open
4
- #
5
- # usage: check-spec-fence-balance.sh [file...]
6
- # Defaults to the manifest set (lib/spec.sh) plus the configured queue file.
7
- set -uo pipefail
8
-
9
- KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
10
- SDK="${GATE_SDK_ROOT:-$KIT/../gate-sdk}"
11
- # shellcheck source=../../gate-sdk/lib/gate.sh
12
- source "$SDK/lib/gate.sh"
13
- # shellcheck source=../lib/spec.sh
14
- source "$KIT/lib/spec.sh"
15
-
16
- if [[ $# -gt 0 ]]; then
17
- files=("$@")
18
- else
19
- mapfile -t files < <(spec_manifest_files ".")
20
- [[ -f "$CANON_KIT_QUEUE_FILE" ]] && files+=("$CANON_KIT_QUEUE_FILE")
21
- fi
22
-
23
- bad=(); scanned=0
24
- for f in "${files[@]}"; do
25
- [[ -f "$f" ]] || continue
26
- scanned=$((scanned + 1))
27
- n="$(grep -cE '^[[:space:]]*```' "$f")"; gst=$?
28
- [[ "$gst" -ge 2 ]] && { echo "check-spec-fence-balance: grep failed on $f (exit $gst)" >&2; exit 2; }
29
- (( n % 2 == 0 )) || bad+=("$f ($n fence delimiters — odd)")
30
- done
31
-
32
- if [[ ${#bad[@]} -gt 0 ]]; then
33
- echo "check-spec-fence-balance: markdown file(s) with an odd fence-delimiter count —"
34
- echo "the fence-skipping parsers (embedded-source, tag-lead-line, the queue scanners)"
35
- echo "toggle a fence flag; an odd count desyncs it and the rest of the file fails open:"
36
- printf ' %s\n' "${bad[@]}"
37
- echo " help: close the unbalanced code fence, or delete the stray delimiter line."
38
- exit 1
39
- fi
40
-
41
- echo "SPEC-FENCE-BALANCE: clean ($scanned governed markdown file(s), all even fence counts)"
42
- exit 0
@@ -1,187 +0,0 @@
1
- #!/usr/bin/env bash
2
- # graph: couples=*SPEC*.md,*README.md,CLAUDE.md,scripts/*.sh,kit:*.sh,.workflow/* dir=one valve=none tier=precommit
3
- # spec: canon-kit/SPEC.md §check-spec-pointer — every spec:/contract: directive on a governed source and every free-prose <path>.md §<heading> citation on a governed manifest resolves: the target file is tracked and a §heading fragment names a heading the file carries
4
- #
5
- # usage: check-spec-pointer.sh [scan-root] (default '.')
6
- set -uo pipefail
7
-
8
- KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
9
- SDK="${GATE_SDK_ROOT:-$KIT/../gate-sdk}"
10
- # shellcheck source=../../gate-sdk/lib/gate.sh
11
- source "$SDK/lib/gate.sh"
12
- # shellcheck source=../lib/spec.sh
13
- source "$KIT/lib/spec.sh"
14
-
15
- ROOT="${1:-.}"
16
- [[ -d "$ROOT" ]] || { echo "check-spec-pointer: not a directory: $ROOT" >&2; exit 2; }
17
- git -C "$ROOT" rev-parse --git-dir >/dev/null 2>&1 || {
18
- echo "check-spec-pointer: $ROOT is not a git repository — cannot verify tracked targets" >&2; exit 2; }
19
-
20
- # spec: canon-kit/SPEC.md §check-spec-pointer — shape-only extraction of the
21
- # spec:/contract: directive lines across the hash (# / .txt) and slash (// , block
22
- # *) comment surfaces; resolution happens in the shell below.
23
- read -r -d '' EXTRACT <<'AWK' || true
24
- {
25
- L = $0
26
- # the colon needs trailing whitespace (a real "<keyword>: <path>" directive) or
27
- # end-of-line (a degenerate empty directive, flagged downstream); this parts a
28
- # pointer from prose that merely opens with "spec:/contract:".
29
- if (L ~ /^[ \t]*#+[ \t]*(spec|contract):([ \t]|$)/) sub(/^[ \t]*#+[ \t]*/, "", L)
30
- else if (L ~ /^[ \t]*\/\/+[ \t]*(spec|contract):([ \t]|$)/) sub(/^[ \t]*\/\/+[ \t]*/, "", L)
31
- else if (L ~ /^[ \t]*\*[ \t]*(spec|contract):([ \t]|$)/) sub(/^[ \t]*\*[ \t]*/, "", L)
32
- else next
33
- print FILENAME "\t" FNR "\t" L
34
- }
35
- AWK
36
-
37
- heading_present() { # $1=target file $2=heading fragment [$3=exact(default)|prefix] -> 0 when a heading matches
38
- local file="$1" frag="$2" mode="${3:-exact}" res st
39
- # spec: canon-kit/SPEC.md §check-spec-pointer — one resolver, two callers:
40
- # the directive pass matches the fragment whole (exact), the prose pass as
41
- # a boundary-anchored prefix (prefix); both tolerate a trailing "(qualifier)".
42
- res="$(awk -v a="$frag" -v mode="$mode" '
43
- function strippar(s) { sub(/[[:space:]]*\([^)]*\)[[:space:]]*$/, "", s); return s }
44
- function isprefix(text, h, L, nc) {
45
- L = length(h)
46
- if (substr(text, 1, L) != h) return 0
47
- if (length(text) == L) return 1
48
- nc = substr(text, L + 1, 1)
49
- return (nc !~ /[[:alnum:]]/)
50
- }
51
- BEGIN { as = strippar(a) }
52
- /^#{1,6}[[:space:]]/ {
53
- h = $0; sub(/^#{1,6}[[:space:]]+/, "", h); sub(/[[:space:]]+$/, "", h)
54
- hs = strippar(h)
55
- if (mode == "prefix") {
56
- if (isprefix(a, h) || isprefix(a, hs)) found = 1
57
- } else if (h == a || hs == a || h == as || hs == as) {
58
- found = 1
59
- }
60
- }
61
- END { print found + 0 }
62
- ' "$file")"; st=$?
63
- fail_closed "$st" SPEC-POINTER "awk heading match"
64
- [[ "$res" == "1" ]]
65
- }
66
-
67
- # spec: canon-kit/SPEC.md §check-spec-pointer — shape-only extraction of prose
68
- # <path>.md § citations over the blank-line paragraph join; fenced code skipped,
69
- # resolution and the tracked-file carve-out happen in the shell below.
70
- read -r -d '' PROSE_EXTRACT <<'AWK' || true
71
- function flush( i, joined, mstart, mend, seg, path, post, li, s) {
72
- if (np == 0) return
73
- joined = ""
74
- for (i = 1; i <= np; i++) { lstart[i] = length(joined) + 1; joined = joined (i > 1 ? " " : "") ptext[i] }
75
- scanpos = 1
76
- while (1) {
77
- s = substr(joined, scanpos)
78
- if (match(s, /[A-Za-z0-9._\/-]+\.md[[:space:]]*§/) == 0) break
79
- mstart = scanpos + RSTART - 1
80
- mend = mstart + RLENGTH - 1
81
- seg = substr(joined, mstart, RLENGTH)
82
- path = seg; sub(/[[:space:]]*§$/, "", path)
83
- post = substr(joined, mend + 1)
84
- li = 1
85
- for (i = 1; i <= np; i++) if (lstart[i] <= mstart) li = i
86
- printf "%s\t%d\t%s\t%s\n", cf, pfnr[li], path, post
87
- scanpos = mend + 1
88
- }
89
- np = 0
90
- }
91
- FNR == 1 { flush(); fence = 0 }
92
- {
93
- cf = FILENAME
94
- if ($0 ~ /^[[:space:]]*```/) { flush(); fence = !fence; next }
95
- if (fence) { flush(); next }
96
- if ($0 ~ /^[[:space:]]*$/) { flush(); next }
97
- np++; pfnr[np] = FNR; ptext[np] = $0
98
- }
99
- END { flush() }
100
- AWK
101
-
102
- # spec: canon-kit/SPEC.md §check-spec-pointer — the tracked-file membership set, filled once from a single git ls-files pass rather than a per-pointer `git ls-files --error-unmatch` exec
103
- declare -A TRACKED=()
104
- while IFS= read -r -d '' _tf; do TRACKED["$_tf"]=1; done < <(git -C "$ROOT" ls-files -z)
105
-
106
- errors=()
107
- scanned=0
108
- pointers=0
109
- markers=0
110
- while IFS= read -r f; do
111
- [[ -n "$f" ]] || continue
112
- rel="${f#"$ROOT"/}"; rel="${rel#./}"
113
- spec_comment_whitelisted "$rel" && continue
114
- scanned=$((scanned + 1))
115
- out="$(awk "$EXTRACT" "$f")"; st=$?
116
- fail_closed "$st" SPEC-POINTER "awk extract ($rel)"
117
- while IFS=$'\t' read -r _file lineno body; do
118
- [[ -n "$body" ]] || continue
119
- if [[ "$body" == spec:* ]]; then after="${body#spec:}"; else after="${body#contract:}"; fi
120
- # spec: gate-sdk/SPEC.md §The workflow directory — contract: rules two payloads, and the version-marker form is a wire-format version its owning gate parses rather than a doc pointer, so it names no path to resolve
121
- payload="${after#"${after%%[![:space:]]*}"}"; payload="${payload%"${payload##*[![:space:]]}"}"
122
- if [[ "$body" == contract:* && "$payload" =~ ^[a-z0-9-]+\ v[0-9]+$ ]]; then
123
- markers=$((markers + 1))
124
- continue
125
- fi
126
- pointers=$((pointers + 1))
127
- # comment-tier-exempt: a § inside the em-dash prose tail is not a heading marker
128
- sig="${after%% — *}"; sig="${sig%% -- *}"
129
- read -r path prest <<< "$sig"
130
- frag=""
131
- if [[ "$path" == *§* ]]; then
132
- frag="${path#*§}"; path="${path%%§*}"
133
- elif [[ "$prest" == *§* ]]; then
134
- frag="${prest#*§}"
135
- fi
136
- frag="${frag#"${frag%%[![:space:]]*}"}"
137
- frag="${frag%"${frag##*[![:space:]]}"}"
138
-
139
- if [[ -z "$path" || "$path" == §* ]]; then
140
- errors+=("$rel:$lineno: pointer directive carries no target path: $body")
141
- continue
142
- fi
143
- if [[ ! -f "$ROOT/$path" ]]; then
144
- errors+=("$rel:$lineno: target file not found: $path")
145
- continue
146
- fi
147
- if [[ -z "${TRACKED[$path]:-}" ]]; then
148
- errors+=("$rel:$lineno: target file untracked: $path")
149
- continue
150
- fi
151
- if [[ -n "$frag" ]] && ! heading_present "$ROOT/$path" "$frag"; then
152
- errors+=("$rel:$lineno: §heading not found in $path: §$frag")
153
- fi
154
- done <<< "$out"
155
- done < <(spec_comment_surface "$ROOT")
156
-
157
- # spec: canon-kit/SPEC.md §check-spec-pointer — the prose-citation pass:
158
- # heading_present in prefix mode over the manifest set; an untracked cited path
159
- # is out of scope (path liveness stays with check-md-refs / check-kit-ref-liveness).
160
- mapfile -t manifest_files < <(spec_manifest_files "$ROOT")
161
- prose_cites=0
162
- manifests=0
163
- if [[ ${#manifest_files[@]} -gt 0 ]]; then
164
- manifests=${#manifest_files[@]}
165
- prose_out="$(awk "$PROSE_EXTRACT" "${manifest_files[@]}")"; st=$?
166
- fail_closed "$st" SPEC-POINTER "awk prose extract"
167
- while IFS=$'\t' read -r pfile plineno ppath pfrag; do
168
- [[ -n "$ppath" ]] || continue
169
- [[ -f "$ROOT/$ppath" ]] || continue
170
- [[ -n "${TRACKED[$ppath]:-}" ]] || continue
171
- prose_cites=$((prose_cites + 1))
172
- [[ -n "$pfrag" ]] || continue
173
- if ! heading_present "$ROOT/$ppath" "$pfrag" prefix; then
174
- prel="${pfile#"$ROOT"/}"; prel="${prel#./}"
175
- errors+=("$prel:$plineno: §heading not found in $ppath: §${pfrag:0:50}")
176
- fi
177
- done <<< "$prose_out"
178
- fi
179
-
180
- if [[ ${#errors[@]} -gt 0 ]]; then
181
- echo "SPEC-POINTER: ${#errors[@]} dangling pointer(s):"
182
- printf ' %s\n' "${errors[@]}"
183
- echo " help: a spec:/contract: directive and a free-prose <path>.md §<heading> citation each bind a site to the requirement that governs it — the binding is only live if it resolves. Fix the <path> (repo-relative, tracked) or the §<heading> to name the current target, or drop the § fragment for a file-only pointer. A renamed heading updates every inbound pointer and citation in the same commit."
184
- exit 1
185
- fi
186
- echo "SPEC-POINTER: clean ($pointers directive pointer(s) across $scanned governed source(s), $markers version-marker header(s) skipped as naming no path; $prose_cites prose citation(s) across $manifests manifest file(s); every target file tracked and named §heading present)"
187
- exit 0
@@ -1,80 +0,0 @@
1
- #!/usr/bin/env bash
2
- # graph: couples=scripts/*.sh,kit:*.sh,.workflow/*.txt,TASK-QUEUE.md dir=one valve=none tier=precommit
3
- # spec: canon-kit/SPEC.md §check-todo-task-liveness — every TODO(task: <slug>) marker on a governed source resolves to a live queue task, stale-flagged on a done slug
4
- #
5
- # usage: check-todo-task-liveness.sh [scan-root [queue-file]]
6
- # Scans the governed comment surface under scan-root (default '.') for
7
- # TODO(task: <slug>) markers and resolves each slug against the queue
8
- # (default $CANON_KIT_QUEUE_FILE): live task resolves, done task is stale,
9
- # absent slug is unresolved.
10
- set -uo pipefail
11
-
12
- KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
13
- SDK="${GATE_SDK_ROOT:-$KIT/../gate-sdk}"
14
- # shellcheck source=../../gate-sdk/lib/gate.sh
15
- source "$SDK/lib/gate.sh"
16
- # shellcheck source=../lib/spec.sh
17
- source "$KIT/lib/spec.sh"
18
-
19
- ROOT="${1:-.}"
20
- QUEUE="${2:-$CANON_KIT_QUEUE_FILE}"
21
- [[ -d "$ROOT" ]] || { echo "check-todo-task-liveness: not a directory: $ROOT" >&2; exit 2; }
22
- [[ -f "$QUEUE" ]] || { echo "check-todo-task-liveness: queue file not found: $QUEUE" >&2; exit 2; }
23
-
24
- # spec: canon-kit/SPEC.md §check-todo-task-liveness — the queue-resolution pass is
25
- # the shared lib adapter both liveness gates read: live slug versus done slug.
26
- qout="$(spec_queue_slugs "$QUEUE")"; st=$?
27
- fail_closed "$st" TODO-TASK-LIVENESS "queue awk"
28
-
29
- declare -A IS_LIVE=() IS_DONE=()
30
- while IFS=$'\t' read -r kind slug; do
31
- [[ -n "$slug" ]] || continue
32
- case "$kind" in
33
- live) IS_LIVE["$slug"]=1 ;;
34
- done) IS_DONE["$slug"]=1 ;;
35
- esac
36
- done <<< "$qout"
37
-
38
- declare -a SURFACE=()
39
- while IFS= read -r f; do
40
- [[ -n "$f" ]] && SURFACE+=("$f")
41
- done < <(spec_comment_surface "$ROOT")
42
-
43
- stale=(); unresolved=(); scanned=0
44
- for f in "${SURFACE[@]}"; do
45
- rel="${f#"$ROOT"/}"; rel="${rel#./}"
46
- scanned=$((scanned + 1))
47
- # spec: canon-kit/SPEC.md §check-todo-task-liveness — the marker needs a
48
- # resolvable slug after the colon, so the bare roster literal a tool
49
- # carries (check-comment-tier's own directive name) never self-matches.
50
- mout="$(awk '
51
- {
52
- s = $0
53
- while (match(s, /TODO\(task:[[:space:]]*[a-z0-9][a-z0-9-]*/)) {
54
- m = substr(s, RSTART, RLENGTH); sub(/TODO\(task:[[:space:]]*/, "", m)
55
- printf "%d\t%s\n", FNR, m
56
- s = substr(s, RSTART + RLENGTH)
57
- }
58
- }
59
- ' "$f")"; st=$?
60
- fail_closed "$st" TODO-TASK-LIVENESS "marker awk ($rel)"
61
- while IFS=$'\t' read -r ln slug; do
62
- [[ -n "$slug" ]] || continue
63
- [[ -n "${IS_LIVE[$slug]:-}" ]] && continue
64
- if [[ -n "${IS_DONE[$slug]:-}" ]]; then
65
- stale+=("$rel:$ln: TODO(task: $slug) — task '$slug' is done; drop the completed TODO")
66
- else
67
- unresolved+=("$rel:$ln: TODO(task: $slug) — no live task '$slug' in $QUEUE")
68
- fi
69
- done <<< "$mout"
70
- done
71
-
72
- if (( ${#stale[@]} + ${#unresolved[@]} > 0 )); then
73
- echo "TODO-TASK-LIVENESS: $(( ${#stale[@]} + ${#unresolved[@]} )) violation(s):"
74
- (( ${#stale[@]} )) && printf ' %s\n' "${stale[@]}"
75
- (( ${#unresolved[@]} )) && printf ' %s\n' "${unresolved[@]}"
76
- echo " help: a TODO(task: <slug>) binds a code site to a live queue task — point it at an active or deferred slug, or resolve the code and delete the marker once the task is done (a done or absent slug leaves the marker referencing nothing)."
77
- exit 1
78
- fi
79
- echo "TODO-TASK-LIVENESS: clean ($scanned governed source(s); every TODO(task: <slug>) marker resolves to a live queue task)"
80
- exit 0
@@ -1,136 +0,0 @@
1
- #!/usr/bin/env bash
2
- # graph: couples=*SPEC*.md,*README.md,CLAUDE.md,.gitignore dir=one valve=none tier=precommit
3
- # spec: canon-kit/SPEC.md §check-tracking-claim — every fixed-vocabulary tracking claim on a governed manifest surface agrees with git
4
- #
5
- # usage: check-tracking-claim.sh [scan-root] (default '.')
6
- set -uo pipefail
7
-
8
- KIT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
9
- SDK="${GATE_SDK_ROOT:-$KIT/../gate-sdk}"
10
- # shellcheck source=../../gate-sdk/lib/gate.sh
11
- source "$SDK/lib/gate.sh"
12
- # shellcheck source=../lib/spec.sh
13
- source "$KIT/lib/spec.sh"
14
-
15
- ROOT="${1:-.}"
16
- [[ -d "$ROOT" ]] || { echo "check-tracking-claim: not a directory: $ROOT" >&2; exit 2; }
17
- git -C "$ROOT" rev-parse --git-dir >/dev/null 2>&1 || {
18
- echo "check-tracking-claim: $ROOT is not a git repository — a tracking claim is unverifiable" >&2; exit 2; }
19
-
20
- # spec: canon-kit/SPEC.md §check-tracking-claim — shape-only extraction over the
21
- # blank-line paragraph join: a predicate outside inline code, bound by adjacency
22
- # to the backticked path it follows; verification happens in the shell below.
23
- read -r -d '' EXTRACT <<'AWK' || true
24
- function blank_code(s, out, i, c, incode) {
25
- out = ""; incode = 0
26
- for (i = 1; i <= length(s); i++) {
27
- c = substr(s, i, 1)
28
- if (c == "`") { incode = !incode; out = out " "; continue }
29
- out = out (incode ? " " : c)
30
- }
31
- return out
32
- }
33
- function is_pathish(t) {
34
- if (t !~ /^[A-Za-z0-9._~-]+(\/[A-Za-z0-9._~-]+)*\/?$/) return 0
35
- return (index(t, "/") > 0 || index(t, ".") > 0)
36
- }
37
- function bound_path(prefix, p, i, tok) {
38
- # the binding is adjacency: only whitespace may sit between the path's
39
- # closing backtick and the predicate, so an intervening clause unbinds it
40
- p = prefix
41
- sub(/[[:space:]]+$/, "", p)
42
- if (substr(p, length(p), 1) != "`") return ""
43
- p = substr(p, 1, length(p) - 1)
44
- i = length(p)
45
- while (i >= 1 && substr(p, i, 1) != "`") i--
46
- if (i < 1) return ""
47
- tok = substr(p, i + 1)
48
- return is_pathish(tok) ? tok : ""
49
- }
50
- function flush( i, joined, scan, rest, off, ms, me, pred, prefix, path, li) {
51
- if (np == 0) return
52
- joined = ""
53
- for (i = 1; i <= np; i++) { lstart[i] = length(joined) + 1; joined = joined (i > 1 ? " " : "") ptext[i] }
54
- scan = blank_code(joined)
55
- rest = scan; off = 0
56
- while (match(rest, PRED) > 0) {
57
- ms = off + RSTART; me = ms + RLENGTH - 1
58
- pred = substr(scan, ms, RLENGTH)
59
- sub(/^[^A-Za-z]*is[[:space:]]+/, "", pred)
60
- sub(/[^A-Za-z-]+$/, "", pred)
61
- prefix = substr(joined, 1, ms - 1)
62
- path = bound_path(prefix)
63
- if (path != "") {
64
- li = 1
65
- for (i = 1; i <= np; i++) if (lstart[i] <= ms) li = i
66
- printf "%s\t%d\t%s\t%s\n", cf, pfnr[li], path, pred
67
- }
68
- off = me; rest = substr(scan, me + 1)
69
- }
70
- np = 0
71
- }
72
- FNR == 1 { flush(); fence = 0 }
73
- {
74
- cf = FILENAME
75
- if ($0 ~ /^[[:space:]]*```/) { flush(); fence = !fence; next }
76
- if (fence) { flush(); next }
77
- if ($0 ~ /^[[:space:]]*$/) { flush(); next }
78
- np++; pfnr[np] = FNR; ptext[np] = $0
79
- }
80
- END { flush() }
81
- AWK
82
-
83
- PRED='(^|[^A-Za-z])is[[:space:]]+(committed|tracked|gitignored|local-only|two-tier)([^A-Za-z]|$)'
84
-
85
- mapfile -t manifest_files < <(spec_manifest_files "$ROOT")
86
- if [[ ${#manifest_files[@]} -eq 0 ]]; then
87
- echo "TRACKING-CLAIM: clean (0 governed manifest surface(s))"
88
- exit 0
89
- fi
90
-
91
- out="$(awk -v PRED="$PRED" "$EXTRACT" "${manifest_files[@]}")"; st=$?
92
- fail_closed "$st" TRACKING-CLAIM "awk claim extract"
93
-
94
- errors=()
95
- claims=0
96
- while IFS=$'\t' read -r file lineno path pred; do
97
- [[ -n "$path" ]] || continue
98
- claims=$((claims + 1))
99
- rel="${file#"$ROOT"/}"; rel="${rel#./}"
100
-
101
- tracked="$(git -C "$ROOT" ls-files -- "$path")"; gst=$?
102
- [[ "$gst" -eq 0 ]] || { echo "check-tracking-claim: git ls-files failed for '$path'" >&2; exit 2; }
103
- ntracked=0; [[ -n "$tracked" ]] && ntracked=1
104
-
105
- # spec: canon-kit/SPEC.md §check-tracking-claim — the ignored side is
106
- # rule-based (check-ignore --no-index), not presence-based, so it resolves
107
- # in a fresh checkout; that section owns why --no-index is load-bearing.
108
- nignored=0
109
- git -C "$ROOT" check-ignore -q --no-index -- "$path" && nignored=1
110
-
111
- if [[ "$ntracked" == 0 && "$nignored" == 0 && ! -e "$ROOT/$path" ]]; then
112
- errors+=("$rel:$lineno: '$path is $pred' — the path is in neither the index nor the ignore rules nor the working tree, so the claim is unverifiable")
113
- continue
114
- fi
115
-
116
- case "$pred" in
117
- committed|tracked)
118
- [[ "$ntracked" == 1 && "$nignored" == 0 ]] \
119
- || errors+=("$rel:$lineno: '$path is $pred' is false — tracked members: $ntracked, ignored members: $nignored") ;;
120
- gitignored|local-only)
121
- [[ "$ntracked" == 0 && "$nignored" == 1 ]] \
122
- || errors+=("$rel:$lineno: '$path is $pred' is false — tracked members: $ntracked, ignored members: $nignored") ;;
123
- two-tier)
124
- [[ "$ntracked" == 1 && "$nignored" == 1 ]] \
125
- || errors+=("$rel:$lineno: '$path is $pred' is false — tracked members: $ntracked, ignored members: $nignored") ;;
126
- esac
127
- done <<<"$out"
128
-
129
- if [[ ${#errors[@]} -gt 0 ]]; then
130
- echo "check-tracking-claim: ${#errors[@]} prose claim(s) git disagrees with:"
131
- printf ' %s\n' "${errors[@]}"
132
- echo " help: git owns a path's tracking status, so prose states the rule and this gate verifies it. Reword the sentence to the predicate git actually supports — 'is committed'/'is tracked' (every member tracked, none ignored), 'is gitignored'/'is local-only' (no member tracked), or 'is two-tier' (both classes non-empty) — or fix the tracking. There is no per-site valve: a claim that cannot be made true is a claim that must be reworded."
133
- exit 1
134
- fi
135
- echo "TRACKING-CLAIM: clean ($claims tracking claim(s) across ${#manifest_files[@]} manifest surface(s); every predicate agrees with git)"
136
- exit 0