@skathio/somi 4.1.0 → 5.0.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 (372) hide show
  1. package/.claude-plugin/icon.png +0 -0
  2. package/.claude-plugin/marketplace.json +8 -3
  3. package/.claude-plugin/plugin.json +9 -10
  4. package/.copilot-extension/extension.json +32 -40
  5. package/.copilot-extension/marketplace.json +8 -3
  6. package/README.md +83 -228
  7. package/VERSION +1 -1
  8. package/agents/somi-reviewer.md +21 -40
  9. package/agents/somi-security-reviewer.md +16 -90
  10. package/agents/somi-worker-high.md +11 -0
  11. package/agents/somi-worker-low.md +11 -0
  12. package/agents/somi-worker-medium.md +11 -0
  13. package/agents/somi.md +8 -75
  14. package/commands/somi-config.md +5 -14
  15. package/commands/somi-deliver.md +11 -0
  16. package/commands/somi-quality.md +10 -0
  17. package/commands/somi-review.md +10 -0
  18. package/commands/somi-status.md +11 -0
  19. package/commands/somi.md +10 -0
  20. package/hooks/hooks.json +28 -23
  21. package/hooks/lib/common.mjs +45 -34
  22. package/hooks/pre-tool/apply-tier.mjs +31 -0
  23. package/hooks/pre-tool/block-dangerous-bash.mjs +15 -0
  24. package/hooks/pre-tool/gate-dep-install.mjs +2 -2
  25. package/hooks/pre-tool/guard-protected-paths.mjs +9 -16
  26. package/hooks/pre-tool/guard-tier-config.mjs +17 -0
  27. package/hooks/pre-tool/reviewers-read-only.mjs +11 -0
  28. package/hooks/session-start/inject-digest.mjs +51 -0
  29. package/hooks/stop/review-due.mjs +40 -0
  30. package/hooks/user-prompt/capture-prompt.mjs +17 -0
  31. package/library/lenses/architecture.md +1 -0
  32. package/library/lenses/test-strategy.md +1 -0
  33. package/library/roles/accessibility.md +1 -0
  34. package/library/roles/answer.md +1 -0
  35. package/library/roles/atlas.md +1 -0
  36. package/library/roles/build.md +1 -0
  37. package/library/roles/debug.md +6 -0
  38. package/library/roles/design.md +1 -0
  39. package/library/roles/discover.md +1 -0
  40. package/library/roles/incident.md +1 -0
  41. package/library/roles/migrate.md +1 -0
  42. package/library/roles/perf.md +1 -0
  43. package/library/roles/plan.md +1 -0
  44. package/library/roles/refactor.md +1 -0
  45. package/library/roles/review.md +1 -0
  46. package/library/roles/security-review.md +1 -0
  47. package/library/roles/upgrade.md +1 -0
  48. package/library/skills/accessibility.md +16 -0
  49. package/library/skills/ci-infra-gotchas.md +12 -0
  50. package/library/skills/perf-method.md +10 -0
  51. package/library/skills/secure-coding.md +18 -0
  52. package/library/skills/testing-checklist.md +16 -0
  53. package/library/skills/threat-modeling.md +10 -0
  54. package/package.json +12 -17
  55. package/profiles/claude.json +21 -0
  56. package/profiles/copilot.json +5 -0
  57. package/rules/digest.md +40 -0
  58. package/scripts/check-links.mjs +65 -76
  59. package/scripts/lib/advisor.mjs +207 -0
  60. package/scripts/lib/check.mjs +165 -0
  61. package/scripts/lib/copilot-workflow.mjs +41 -0
  62. package/scripts/lib/doctor.mjs +91 -0
  63. package/scripts/lib/gates.mjs +69 -0
  64. package/scripts/lib/git-tree.mjs +201 -0
  65. package/scripts/lib/init.mjs +23 -0
  66. package/scripts/lib/ledger.mjs +38 -0
  67. package/scripts/lib/mcp-project-root.mjs +63 -67
  68. package/scripts/lib/migrate.mjs +73 -0
  69. package/scripts/lib/path-facts.mjs +2 -2
  70. package/scripts/lib/path-safety.mjs +6 -134
  71. package/scripts/lib/plan.mjs +69 -0
  72. package/scripts/lib/policy.mjs +103 -0
  73. package/scripts/lib/pr.mjs +28 -0
  74. package/scripts/lib/prompt.mjs +72 -0
  75. package/scripts/lib/quality/clones.mjs +76 -0
  76. package/scripts/lib/quality/css.mjs +43 -0
  77. package/scripts/lib/quality/gate.mjs +230 -0
  78. package/scripts/lib/quality/limits.mjs +73 -0
  79. package/scripts/lib/quality/metrics.mjs +159 -0
  80. package/scripts/lib/quality/parse.mjs +73 -0
  81. package/scripts/lib/quality/repo.mjs +69 -0
  82. package/scripts/lib/quality/run.mjs +38 -0
  83. package/scripts/lib/reviews.mjs +132 -0
  84. package/scripts/lib/routes.mjs +108 -0
  85. package/scripts/lib/setup.mjs +34 -0
  86. package/scripts/lib/shards.mjs +166 -0
  87. package/scripts/lib/signals.mjs +110 -0
  88. package/scripts/lib/state.mjs +42 -0
  89. package/scripts/lib/tiers.mjs +42 -0
  90. package/scripts/lib/update-notice.mjs +48 -0
  91. package/scripts/lib/views.mjs +62 -0
  92. package/scripts/lib/workflows.mjs +56 -0
  93. package/scripts/somi-mcp.mjs +181 -323
  94. package/scripts/somi.mjs +208 -0
  95. package/scripts/vendor/tree-sitter/LICENSE.vscode-tree-sitter-wasm +21 -0
  96. package/scripts/vendor/tree-sitter/LICENSE.web-tree-sitter +21 -0
  97. package/scripts/vendor/tree-sitter/cgmanifest.vscode-tree-sitter-wasm.json +16 -0
  98. package/scripts/vendor/tree-sitter/manifest.json +59 -0
  99. package/scripts/vendor/tree-sitter/package.json +3 -0
  100. package/scripts/vendor/tree-sitter/tree-sitter-css.wasm +0 -0
  101. package/scripts/vendor/tree-sitter/tree-sitter-javascript.wasm +0 -0
  102. package/scripts/vendor/tree-sitter/tree-sitter-tsx.wasm +0 -0
  103. package/scripts/vendor/tree-sitter/tree-sitter-typescript.wasm +0 -0
  104. package/scripts/vendor/tree-sitter/web-tree-sitter.js +4081 -0
  105. package/scripts/vendor/tree-sitter/web-tree-sitter.wasm +0 -0
  106. package/skills/somi-expertise/SKILL.md +6 -0
  107. package/workflows/deliver-stages.js +81 -0
  108. package/.claude/settings.json +0 -131
  109. package/agents/somi-architecture-reviewer.md +0 -101
  110. package/agents/somi-atlas.md +0 -100
  111. package/agents/somi-coder.md +0 -60
  112. package/agents/somi-designer.md +0 -36
  113. package/agents/somi-discovery-analyst.md +0 -57
  114. package/agents/somi-flow.md +0 -47
  115. package/agents/somi-general.md +0 -36
  116. package/agents/somi-impact.md +0 -95
  117. package/agents/somi-incident.md +0 -94
  118. package/agents/somi-plan-reviewer.md +0 -68
  119. package/agents/somi-planner.md +0 -57
  120. package/agents/somi-pr.md +0 -99
  121. package/agents/somi-refactor-designer.md +0 -81
  122. package/agents/somi-refactorer.md +0 -99
  123. package/agents/somi-sdlc-reviewer.md +0 -67
  124. package/agents/somi-test-strategist.md +0 -87
  125. package/commands/adopt.md +0 -14
  126. package/commands/architecture-review.md +0 -19
  127. package/commands/atlas.md +0 -19
  128. package/commands/code-loop.md +0 -19
  129. package/commands/code-parallel.md +0 -19
  130. package/commands/code.md +0 -19
  131. package/commands/debug.md +0 -19
  132. package/commands/design.md +0 -19
  133. package/commands/discover.md +0 -19
  134. package/commands/impact.md +0 -19
  135. package/commands/incident.md +0 -19
  136. package/commands/plan-loop.md +0 -19
  137. package/commands/plan.md +0 -19
  138. package/commands/pr.md +0 -19
  139. package/commands/refactor-design.md +0 -19
  140. package/commands/refactor.md +0 -19
  141. package/commands/release-readiness.md +0 -19
  142. package/commands/review-panel.md +0 -19
  143. package/commands/review.md +0 -19
  144. package/commands/security-review.md +0 -19
  145. package/commands/ship-loop.md +0 -19
  146. package/commands/ship.md +0 -19
  147. package/commands/test-strategy.md +0 -19
  148. package/commands/upgrade.md +0 -19
  149. package/examples/README.md +0 -19
  150. package/examples/code-review-example.md +0 -88
  151. package/examples/discovery-example.md +0 -200
  152. package/examples/feature-plan-example.md +0 -377
  153. package/examples/full-pipeline-example.md +0 -188
  154. package/examples/sample-consumer/.claude/settings.json +0 -29
  155. package/examples/sample-consumer/CLAUDE.md +0 -78
  156. package/examples/sample-consumer/README.md +0 -102
  157. package/hooks/post-tool/lint-changed-files.mjs +0 -209
  158. package/hooks/pre-tool/guard-cost-lowering.mjs +0 -192
  159. package/hooks/session-start/detect-repo-instructions.mjs +0 -287
  160. package/hooks/session-start/ensure-default-config.mjs +0 -113
  161. package/hooks/user-prompt-submit/inject-workflow-context.mjs +0 -580
  162. package/rules/00-priorities.md +0 -48
  163. package/rules/10-solid.md +0 -87
  164. package/rules/20-clean-code.md +0 -62
  165. package/rules/30-security-owasp.md +0 -83
  166. package/rules/40-engineering-practices.md +0 -65
  167. package/rules/50-collaboration.md +0 -114
  168. package/rules/99-overrides.md +0 -52
  169. package/rules/CLAUDE.md +0 -200
  170. package/scripts/check-session-artefacts.mjs +0 -149
  171. package/scripts/check-size-budget.mjs +0 -137
  172. package/scripts/generate-digest.mjs +0 -176
  173. package/scripts/lib/agent-info.mjs +0 -85
  174. package/scripts/lib/agent-registry.mjs +0 -92
  175. package/scripts/lib/cost-ceiling.mjs +0 -328
  176. package/scripts/lib/cost-config-edit.mjs +0 -102
  177. package/scripts/lib/cost-config.mjs +0 -64
  178. package/scripts/lib/cost-defaults.mjs +0 -53
  179. package/scripts/lib/cost-lowering.mjs +0 -89
  180. package/scripts/lib/cost-model.mjs +0 -110
  181. package/scripts/lib/dispatch-resolver.mjs +0 -243
  182. package/scripts/lib/escalation-facts.mjs +0 -146
  183. package/scripts/lib/escalation.mjs +0 -129
  184. package/scripts/lib/findings-ledger.mjs +0 -241
  185. package/scripts/lib/install-text.mjs +0 -97
  186. package/scripts/lib/loop-caps.mjs +0 -140
  187. package/scripts/lib/loop-diff.mjs +0 -38
  188. package/scripts/lib/loop-dispatch.mjs +0 -19
  189. package/scripts/lib/loop-engine.mjs +0 -226
  190. package/scripts/lib/loop-escalate.mjs +0 -49
  191. package/scripts/lib/loop-exit.mjs +0 -47
  192. package/scripts/lib/loop-notes-compact.mjs +0 -72
  193. package/scripts/lib/loop-notes.mjs +0 -278
  194. package/scripts/lib/loop-review.mjs +0 -395
  195. package/scripts/lib/loop-state.mjs +0 -44
  196. package/scripts/lib/loop-step-close.mjs +0 -75
  197. package/scripts/lib/loop-step-kit.mjs +0 -179
  198. package/scripts/lib/loop-step-review.mjs +0 -140
  199. package/scripts/lib/loop-step-tool.mjs +0 -89
  200. package/scripts/lib/loop-step.mjs +0 -301
  201. package/scripts/lib/run-budget.mjs +0 -28
  202. package/scripts/lib/run-card.mjs +0 -73
  203. package/scripts/lib/size-tier.mjs +0 -184
  204. package/scripts/lib/tier-record.mjs +0 -82
  205. package/scripts/size-budget-overrides.json +0 -58
  206. package/scripts/somi-card.mjs +0 -39
  207. package/scripts/somi-check.mjs +0 -237
  208. package/scripts/somi-config.mjs +0 -421
  209. package/scripts/somi-dispatch.mjs +0 -141
  210. package/scripts/somi-findings.mjs +0 -100
  211. package/scripts/somi-loop.mjs +0 -128
  212. package/scripts/somi-tier.mjs +0 -393
  213. package/scripts/validate.sh +0 -653
  214. package/skills/api-design/SKILL.md +0 -147
  215. package/skills/clean-code/SKILL.md +0 -142
  216. package/skills/flow-adopt/SKILL.md +0 -92
  217. package/skills/flow-architecture-review/SKILL.md +0 -94
  218. package/skills/flow-atlas/SKILL.md +0 -34
  219. package/skills/flow-code/SKILL.md +0 -167
  220. package/skills/flow-code-loop/SKILL.md +0 -263
  221. package/skills/flow-code-parallel/SKILL.md +0 -160
  222. package/skills/flow-debug/SKILL.md +0 -141
  223. package/skills/flow-design/SKILL.md +0 -170
  224. package/skills/flow-discover/SKILL.md +0 -204
  225. package/skills/flow-impact/SKILL.md +0 -35
  226. package/skills/flow-incident/SKILL.md +0 -49
  227. package/skills/flow-plan/SKILL.md +0 -254
  228. package/skills/flow-plan-loop/SKILL.md +0 -254
  229. package/skills/flow-pr/SKILL.md +0 -34
  230. package/skills/flow-refactor/SKILL.md +0 -58
  231. package/skills/flow-refactor-design/SKILL.md +0 -97
  232. package/skills/flow-release-readiness/SKILL.md +0 -82
  233. package/skills/flow-review/SKILL.md +0 -193
  234. package/skills/flow-review-panel/SKILL.md +0 -154
  235. package/skills/flow-security-review/SKILL.md +0 -83
  236. package/skills/flow-ship/SKILL.md +0 -125
  237. package/skills/flow-ship-loop/SKILL.md +0 -274
  238. package/skills/flow-somi-config/SKILL.md +0 -142
  239. package/skills/flow-status/SKILL.md +0 -43
  240. package/skills/flow-test-strategy/SKILL.md +0 -83
  241. package/skills/flow-upgrade/SKILL.md +0 -82
  242. package/skills/market-research/SKILL.md +0 -125
  243. package/skills/observability/SKILL.md +0 -133
  244. package/skills/owasp-defense/SKILL.md +0 -141
  245. package/skills/plan-review/SKILL.md +0 -83
  246. package/skills/reasoning-craft/SKILL.md +0 -213
  247. package/skills/requirements-engineering/SKILL.md +0 -137
  248. package/skills/role-coder/SKILL.md +0 -247
  249. package/skills/role-designer/SKILL.md +0 -172
  250. package/skills/role-discovery-analyst/SKILL.md +0 -288
  251. package/skills/role-planner/SKILL.md +0 -353
  252. package/skills/role-reviewer/SKILL.md +0 -218
  253. package/skills/rules/SKILL.md +0 -47
  254. package/skills/sdlc-process/SKILL.md +0 -74
  255. package/skills/solid-principles/SKILL.md +0 -143
  256. package/skills/somi-checkpoint/SKILL.md +0 -95
  257. package/skills/somi-dispatch/SKILL.md +0 -259
  258. package/skills/somi-routing/SKILL.md +0 -158
  259. package/skills/testing-playbook/SKILL.md +0 -133
  260. package/skills/threat-modeling/SKILL.md +0 -117
  261. package/templates/ADR.md.tmpl +0 -73
  262. package/templates/ATLAS.md.tmpl +0 -75
  263. package/templates/BRD.md.tmpl +0 -68
  264. package/templates/BRIEF.md.tmpl +0 -119
  265. package/templates/CONTEXT.md.tmpl +0 -74
  266. package/templates/DECISIONS.md.tmpl +0 -105
  267. package/templates/DESIGN.md.tmpl +0 -83
  268. package/templates/DIARY.md.tmpl +0 -70
  269. package/templates/DOD.md.tmpl +0 -90
  270. package/templates/FRD.md.tmpl +0 -64
  271. package/templates/PHASE.md.tmpl +0 -80
  272. package/templates/PROGRESS.md.tmpl +0 -63
  273. package/templates/RCA.md.tmpl +0 -53
  274. package/templates/RD-README.md.tmpl +0 -70
  275. package/templates/RESEARCH.md.tmpl +0 -96
  276. package/templates/REVIEW.md.tmpl +0 -82
  277. package/templates/SDD.md.tmpl +0 -82
  278. package/templates/SOMI-README.md.tmpl +0 -83
  279. package/templates/SPEC.md.tmpl +0 -123
  280. package/templates/SRS.md.tmpl +0 -85
  281. package/templates/TDD.md.tmpl +0 -77
  282. package/tests/hooks/cases/audit-log.json +0 -21
  283. package/tests/hooks/cases/block-dangerous-bash.json +0 -166
  284. package/tests/hooks/cases/block-secret-writes.json +0 -140
  285. package/tests/hooks/cases/detect-repo-instructions.json +0 -105
  286. package/tests/hooks/cases/gate-dep-install.json +0 -42
  287. package/tests/hooks/cases/guard-protected-paths.json +0 -222
  288. package/tests/hooks/cases/inject-workflow-context.json +0 -239
  289. package/tests/hooks/cases/lint-changed-files.json +0 -120
  290. package/tests/hooks/run.sh +0 -392
  291. package/tests/scripts/agent-model-frontmatter.sh +0 -38
  292. package/tests/scripts/agent-names.sh +0 -77
  293. package/tests/scripts/check-frontmatter.sh +0 -37
  294. package/tests/scripts/check-links.sh +0 -105
  295. package/tests/scripts/check-session-artefacts.sh +0 -60
  296. package/tests/scripts/check-size-budget.sh +0 -71
  297. package/tests/scripts/checkpoint-gate.sh +0 -131
  298. package/tests/scripts/convergence-runner.sh +0 -1514
  299. package/tests/scripts/cost-ceiling.sh +0 -255
  300. package/tests/scripts/cost-defaults.sh +0 -130
  301. package/tests/scripts/cost-hardcap.sh +0 -338
  302. package/tests/scripts/cost-lowering.sh +0 -261
  303. package/tests/scripts/cost-model.sh +0 -196
  304. package/tests/scripts/dispatch-guard.sh +0 -108
  305. package/tests/scripts/dispatch-line-gate.sh +0 -61
  306. package/tests/scripts/dispatch-reference-gate.sh +0 -173
  307. package/tests/scripts/ensure-default-config.sh +0 -162
  308. package/tests/scripts/escalation.sh +0 -409
  309. package/tests/scripts/eval-runner.sh +0 -3692
  310. package/tests/scripts/evals-packaging.sh +0 -224
  311. package/tests/scripts/fact-sheet.sh +0 -296
  312. package/tests/scripts/fixtures/legacy-shard-no-schema.json +0 -50
  313. package/tests/scripts/fixtures/mock-stdin-read-throw.cjs +0 -18
  314. package/tests/scripts/fixtures/size-tier-cases.json +0 -87
  315. package/tests/scripts/generate-digest.sh +0 -180
  316. package/tests/scripts/global-config.sh +0 -167
  317. package/tests/scripts/goldens/loop-state-breach.json +0 -1
  318. package/tests/scripts/goldens/loop-state-done.json +0 -1
  319. package/tests/scripts/goldens/somi-findings.json +0 -336
  320. package/tests/scripts/goldens/somi-loop.json +0 -168
  321. package/tests/scripts/lib/adr-shape.mjs +0 -41
  322. package/tests/scripts/lib/agent-registry-tests.mjs +0 -95
  323. package/tests/scripts/lib/brief-only-guard.mjs +0 -27
  324. package/tests/scripts/lib/checkpoint-gate.mjs +0 -91
  325. package/tests/scripts/lib/digest-marker-coupling.mjs +0 -52
  326. package/tests/scripts/lib/dispatch-reference-gate.mjs +0 -121
  327. package/tests/scripts/lib/escalation-facts-tests.mjs +0 -140
  328. package/tests/scripts/lib/escalation-tests.mjs +0 -154
  329. package/tests/scripts/lib/findings-ledger-tests.mjs +0 -118
  330. package/tests/scripts/lib/loop-engine-tests.mjs +0 -287
  331. package/tests/scripts/lib/loop-escalate-tests.mjs +0 -356
  332. package/tests/scripts/lib/loop-flow-gate.mjs +0 -173
  333. package/tests/scripts/lib/loop-notes-tests.mjs +0 -371
  334. package/tests/scripts/lib/loop-step-cli-tests.mjs +0 -141
  335. package/tests/scripts/lib/loop-step-close-tests.mjs +0 -351
  336. package/tests/scripts/lib/loop-step-lenient-tests.mjs +0 -114
  337. package/tests/scripts/lib/loop-step-state-tests.mjs +0 -127
  338. package/tests/scripts/lib/loop-step-tests.mjs +0 -499
  339. package/tests/scripts/lib/loop-step-unwritten-tests.mjs +0 -55
  340. package/tests/scripts/lib/multipass-dependence.mjs +0 -192
  341. package/tests/scripts/lib/multipass-source-identity.mjs +0 -243
  342. package/tests/scripts/lib/path-facts-tests.mjs +0 -198
  343. package/tests/scripts/lib/path-safety-tests.mjs +0 -201
  344. package/tests/scripts/lib/reference-pair.mjs +0 -61
  345. package/tests/scripts/lib/retirement-gate.mjs +0 -172
  346. package/tests/scripts/lib/run-suites.mjs +0 -139
  347. package/tests/scripts/lib/shell-embedded-js.mjs +0 -47
  348. package/tests/scripts/lib/ship-loop-sizing-guard.mjs +0 -52
  349. package/tests/scripts/lib/site-roadmap-gate.mjs +0 -64
  350. package/tests/scripts/lib/size-tier-drift.mjs +0 -74
  351. package/tests/scripts/lib/sizing-score-tests.mjs +0 -210
  352. package/tests/scripts/lib/sizing-set-tests.mjs +0 -131
  353. package/tests/scripts/lib/somi-mcp-client.mjs +0 -102
  354. package/tests/scripts/lib/somi-mcp-config-tests.mjs +0 -92
  355. package/tests/scripts/lib/somi-mcp-loop-tests.mjs +0 -226
  356. package/tests/scripts/lib/somi-mcp-tests.mjs +0 -491
  357. package/tests/scripts/lib/somi-mcp-tier-tests.mjs +0 -64
  358. package/tests/scripts/lib/somi-mcp-tool-schema.mjs +0 -38
  359. package/tests/scripts/loop-engine.sh +0 -22
  360. package/tests/scripts/loop-flow-gate.sh +0 -11
  361. package/tests/scripts/retirement-gate.sh +0 -306
  362. package/tests/scripts/review-panel-seats.sh +0 -32
  363. package/tests/scripts/run-card.sh +0 -57
  364. package/tests/scripts/run-suites.sh +0 -74
  365. package/tests/scripts/run.sh +0 -689
  366. package/tests/scripts/site-roadmap-gate.sh +0 -76
  367. package/tests/scripts/size-tier.sh +0 -562
  368. package/tests/scripts/somi-agent-dispatch-contract.sh +0 -224
  369. package/tests/scripts/somi-config.sh +0 -286
  370. package/tests/scripts/somi-dispatch.sh +0 -465
  371. package/tests/scripts/somi-mcp.sh +0 -15
  372. package/tests/scripts/suite-plan.json +0 -20
@@ -1,105 +0,0 @@
1
- #!/usr/bin/env bash
2
- # End-to-end tests for scripts/check-links.mjs.
3
- #
4
- # This work item has produced a fix-without-a-guard five separate times, so a new checker ships with
5
- # its own regression suite. Fixtures are real `git init` repos, not bare directories, because the
6
- # walker enumerates via `git ls-files` — and one case depends on `.gitignore` actually being
7
- # honoured, which a bare directory cannot demonstrate.
8
- #
9
- # NEGATIVE cases are as load-bearing as positive ones here. The walker's pass-1 regex silently
10
- # passed five dead-link forms, and every staged failure used the single form it was authored
11
- # against — the same sample-selection defect. The forms below are
12
- # chosen to be ones a naive implementation gets WRONG.
13
-
14
- set -euo pipefail
15
- ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
16
- CHECK="$ROOT/scripts/check-links.mjs"
17
- TMP="$(mktemp -d)"; trap 'rm -rf "$TMP"' EXIT
18
- failures=0; total=0
19
- expect_exit() { local name="$1" want="$2" got=0; shift 2; "$@" >/dev/null 2>&1 || got=$?
20
- [[ "$got" == "$want" ]] || { echo "FAIL: $name — expected exit $want, got $got" >&2; failures=$((failures+1)); }
21
- total=$((total+1)); }
22
- check() { total=$((total+1)); [[ "$2" == "0" ]] || { echo "FAIL: $1" >&2; failures=$((failures+1)); }; }
23
-
24
- mkrepo() { rm -rf "$TMP/r"; mkdir -p "$TMP/r/docs" "$TMP/r/examples" "$TMP/r/scripts"
25
- cp "$CHECK" "$TMP/r/scripts/check-links.mjs"
26
- printf '# t\n' > "$TMP/r/docs/real.md"
27
- (cd "$TMP/r" && git init -q -b main && git config user.email t@t && git config user.name t); }
28
- commit() { (cd "$TMP/r" && git add -A && git commit -qm x); }
29
- run() { (cd "$TMP/r" && node scripts/check-links.mjs); }
30
-
31
- # --- baseline -------------------------------------------------------------------
32
- mkrepo; printf '[ok](./real.md)\n' > "$TMP/r/docs/a.md"; commit
33
- expect_exit "resolving relative link passes" 0 run
34
- printf '[dead](./nope.md)\n' >> "$TMP/r/docs/a.md"; commit
35
- expect_exit "dead relative link fails" 1 run
36
-
37
- # --- FENCED AND INLINE CODE ARE NOT LINKS ---------------------------------------
38
- # The pass-1 walker had no fence awareness. Four fenced sample links in
39
- # examples/feature-plan-example.md read as real, and "fixing" them wrote a CI token into the
40
- # canonical example that ships to npm. This is the case that must never regress.
41
- mkrepo
42
- printf '# t\n\n```markdown\n[sample](./does-not-exist.md)\n```\n\nInline: `[x](./nope.md)`\n' > "$TMP/r/docs/a.md"
43
- commit
44
- expect_exit "links inside a fenced block are not checked" 0 run
45
- printf '\n~~~md\n[t](./nope2.md)\n~~~\n' >> "$TMP/r/docs/a.md"; commit
46
- expect_exit "tilde fences are honoured too" 0 run
47
- printf '\n[after](./nope4.md)\n' >> "$TMP/r/docs/a.md"; commit
48
- expect_exit "a dead link AFTER a fence is still caught" 1 run
49
-
50
- # --- FENCE FORMS THE PASS-2 REWRITE MISSED ---------------------------------------
51
- # Both reproduce the Blocker's outcome (displayed source flagged as a real link), and both shipped
52
- # unguarded until code review measured them.
53
- # (1) A fence indented 4+ spaces is legal inside a list item.
54
- mkrepo
55
- printf '# t\n\n1. Step:\n\n ```markdown\n [sample](./nope-listfence.md)\n ```\n' > "$TMP/r/docs/a.md"
56
- commit
57
- expect_exit "a list-indented fence (4+ spaces) is honoured" 0 run
58
- # (2) CommonMark requires the closer be at least as long as the opener, so a ``` inside a ````
59
- # block does not close it.
60
- mkrepo
61
- printf '# t\n\n````markdown\n```\n[inner](./nope-quad.md)\n```\n````\n' > "$TMP/r/docs/a.md"
62
- commit
63
- expect_exit "a shorter fence run does not close a longer one" 0 run
64
-
65
- # --- FORMS THE PASS-1 REGEX SILENTLY PASSED -------------------------------------
66
- mkrepo; printf '# t\n\nRef: [text][r]\n\n[r]: ./nope-ref.md\n' > "$TMP/r/docs/a.md"; commit
67
- expect_exit "reference-style link with a dead target is caught" 1 run
68
- mkrepo; printf '# t\n\n[link text that\nwraps](./nope-wrap.md)\n' > "$TMP/r/docs/a.md"; commit
69
- expect_exit "line-wrapped link text is caught" 1 run
70
- mkrepo; printf '# t\n\n[t](<./nope-angle.md>)\n' > "$TMP/r/docs/a.md"; commit
71
- expect_exit "angle-bracket destination is caught" 1 run
72
- mkrepo; printf '# t\n\nRef: [text][r]\n\n```\n[r]: ./real.md\n```\n' > "$TMP/r/docs/a.md"; commit
73
- expect_exit "a reference definition inside a fence is not honoured" 0 run
74
-
75
- # --- illustrative-path hatch: scoped, and self-invalidating ---------------------
76
- mkrepo; printf '# t\n<!-- illustrative-path -->[dead](./nope.md)\n' > "$TMP/r/examples/e.md"; commit
77
- expect_exit "same-line marker exempts, inside examples/" 0 run
78
- check "the exemption is reported on success" \
79
- "$( (cd "$TMP/r" && node scripts/check-links.mjs) | grep -q '1 illustrative-path exemption'; echo $?)"
80
- # The success line is F5's whole remedy — the number that makes hatch growth visible. An earlier
81
- # form incremented `checked` before the resolving branch, so it reported exempted (non-resolving)
82
- # links as resolving: "2 relative link(s) resolve" when zero did. A false claim in the output of
83
- # the tool built to remove false claims.
84
- check "an exempted link is NOT counted as resolving" \
85
- "$( (cd "$TMP/r" && node scripts/check-links.mjs) | grep -q '^check-links: 0 relative link(s) resolve; 1 illustrative-path exemption'; echo $?)"
86
- mkrepo; printf '# t\n<!-- illustrative-path -->[dead](./nope.md)\n' > "$TMP/r/docs/a.md"; commit
87
- expect_exit "a marker OUTSIDE examples/ fails rather than exempts" 1 run
88
- mkrepo; printf '# t\n<!-- illustrative-path -->\n[dead](./nope.md)\n' > "$TMP/r/examples/e.md"; commit
89
- expect_exit "preceding-line marker does NOT exempt (pinned placement)" 1 run
90
- mkrepo; printf '# t\n<!-- illustrative-path -->[ok](../docs/real.md)\n' > "$TMP/r/examples/e.md"; commit
91
- expect_exit "marker on a RESOLVING link fails as stale" 1 run
92
-
93
- # --- exclusions and skipped link kinds ------------------------------------------
94
- mkrepo
95
- printf '.somi/\n' > "$TMP/r/.gitignore" # mirrors this repo: .somi is gitignored, so untracked
96
- mkdir -p "$TMP/r/.somi"; printf '[x](./nope.md)\n' > "$TMP/r/.somi/plan.md"
97
- printf '[x](./nope.md)\n' > "$TMP/r/CHANGELOG.md"
98
- printf '[a](https://e.com/x.md)\n[b](#frag)\n[c](./real.md#frag)\n[d](mailto:a@b.c)\n[e](HTTPS://e.com/y.md)\n' > "$TMP/r/docs/a.md"
99
- commit
100
- expect_exit "gitignored .somi/ and CHANGELOG.md skipped; external/anchor/mailto ignored" 0 run
101
- printf '[f](./nope.md#frag)\n' >> "$TMP/r/docs/a.md"; commit
102
- expect_exit "a fragment on a DEAD target is still caught" 1 run
103
-
104
- echo "check-links tests: $((total - failures)) of $total checks passed."
105
- [[ "$failures" -eq 0 ]] || exit 1
@@ -1,60 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Tests for scripts/check-session-artefacts.mjs. Fixtures are plain directories (the checker walks
3
- # the filesystem, not git). Each case plants one line in an otherwise clean tree and asserts the
4
- # exit code.
5
-
6
- set -euo pipefail
7
- ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
8
- CHECK="$ROOT/scripts/check-session-artefacts.mjs"
9
- TMP="$(mktemp -d)"; trap 'rm -rf "$TMP"' EXIT
10
- failures=0; total=0
11
- expect_exit() { local name="$1" want="$2" got=0; shift 2; "$@" >/dev/null 2>&1 || got=$?
12
- [[ "$got" == "$want" ]] || { echo "FAIL: $name -- expected exit $want, got $got" >&2; failures=$((failures+1)); }
13
- total=$((total+1)); }
14
-
15
- mktree() { rm -rf "$TMP/r"; mkdir -p "$TMP/r/hooks" "$TMP/r/scripts" "$TMP/r/agents" "$TMP/r/commands" "$TMP/r/skills/s" "$TMP/r/tests"
16
- printf '// A clean comment explaining why.\nconst x = 1;\n' > "$TMP/r/hooks/h.mjs"
17
- printf '# A clean comment.\necho ok\n' > "$TMP/r/scripts/s.sh"
18
- printf -- '---\nname: a\n---\nPlan with `D1:` sample, phase 1, iteration 1, and F-3.\n' > "$TMP/r/agents/a.md"; }
19
- run() { node "$CHECK" --root "$TMP/r"; }
20
-
21
- mktree
22
- expect_exit "clean tree passes" 0 run
23
-
24
- mktree; printf '// guards F-29 from the plan\n' >> "$TMP/r/hooks/h.mjs"
25
- expect_exit "finding id in a hook comment fails" 1 run
26
-
27
- mktree; printf '# see decisions.md#d5\n' >> "$TMP/r/scripts/s.sh"
28
- expect_exit "decision anchor in a shell comment fails" 1 run
29
-
30
- mktree; printf 'const y = 2; // phase 2 iteration 2.1 port\n' >> "$TMP/r/hooks/h.mjs"
31
- expect_exit "trailing comment with iteration number fails" 1 run
32
-
33
- mktree; printf 'const msg = "D5 is a string, not a comment";\n' >> "$TMP/r/hooks/h.mjs"
34
- expect_exit "tag inside a string literal (not a comment) passes" 0 run
35
-
36
- mktree; printf '// Appends a dated entry to the diary and reads the phase file.\n' >> "$TMP/r/hooks/h.mjs"
37
- expect_exit "product mention of the diary or a phase file in a comment passes" 0 run
38
-
39
- mktree; printf '// see the diary for why this changed\n' >> "$TMP/r/hooks/h.mjs"
40
- expect_exit "a 'see the diary' pointer in a comment fails" 1 run
41
-
42
- mktree; printf 'Decided in (D3).\n' >> "$TMP/r/commands/c.md"
43
- expect_exit "decision tag in command markdown fails" 1 run
44
-
45
- mktree; printf 'Same fix as F-29.\n' >> "$TMP/r/skills/s/SKILL.md"
46
- expect_exit "finding id in skill markdown fails" 1 run
47
-
48
- mktree; printf 'The product has a work item and phases; see D1: sample.\n' >> "$TMP/r/commands/c.md"
49
- expect_exit "product vocabulary and sample ids in markdown pass" 0 run
50
-
51
- # --- exclusions hold -----------------------------------------------------------------
52
- mktree; printf '// F-29 D5 iteration 2.1\n' >> "$TMP/r/tests/t.sh"; printf 'F-29\n' > "$TMP/r/CHANGELOG.md"
53
- mkdir -p "$TMP/r/tests/evals/results"; printf '// F-29\n' > "$TMP/r/tests/evals/results/x.mjs"
54
- expect_exit "tests/, CHANGELOG.md and eval results are not scanned" 0 run
55
-
56
- mktree; cp "$CHECK" "$TMP/r/scripts/check-session-artefacts.mjs"
57
- expect_exit "the checker's own pattern definition is excluded" 0 run
58
-
59
- if (( failures > 0 )); then echo "$failures of $total check-session-artefacts case(s) FAILED" >&2; exit 1; fi
60
- echo " ok: $total check-session-artefacts cases"
@@ -1,71 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Tests for scripts/check-size-budget.mjs. Each case builds a throwaway git repo (the checker
3
- # enumerates tracked files) and asserts the exit code, never touching the real tree.
4
-
5
- set -euo pipefail
6
- ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
7
- CHECK="$ROOT/scripts/check-size-budget.mjs"
8
- TMP="$(mktemp -d)"; trap 'rm -rf "$TMP"' EXIT
9
- failures=0; total=0
10
- expect_exit() { local name="$1" want="$2" got=0; shift 2; "$@" >/dev/null 2>&1 || got=$?
11
- [[ "$got" == "$want" ]] || { echo "FAIL: $name -- expected exit $want, got $got" >&2; failures=$((failures+1)); }
12
- total=$((total+1)); }
13
-
14
- R="$TMP/r"
15
- lines() { local n="$1" i; for ((i=0;i<n;i++)); do echo "line $i"; done; }
16
- mktree() { rm -rf "$R"; mkdir -p "$R/agents" "$R/scripts" "$R/tests/evals/results"
17
- git -C "$R" init -q; lines 10 > "$R/agents/small.md"; lines 10 > "$R/scripts/s.mjs"; }
18
- ledger() { printf '[{"file":"%s","budget":%s,"current_size":%s,"source":"abc1234","at":"2026-10-01","reason":"test"}]\n' "$1" "$2" "$3" > "$R/scripts/size-budget-overrides.json"; }
19
- run() { git -C "$R" add -A; node "$CHECK" --root "$R"; }
20
-
21
- mktree
22
- expect_exit "within-budget tree passes" 0 run
23
-
24
- mktree; lines 301 > "$R/agents/big.md"
25
- expect_exit "un-ledgered prompt file over 300 fails" 1 run
26
-
27
- mktree; lines 501 > "$R/scripts/big.mjs"
28
- expect_exit "un-ledgered .mjs over 500 fails" 1 run
29
-
30
- mktree; lines 801 > "$R/scripts/big.sh"
31
- expect_exit "un-ledgered .sh over 800 fails" 1 run
32
-
33
- mktree; lines 500 > "$R/scripts/edge.mjs"; lines 300 > "$R/agents/edge.md"; lines 800 > "$R/scripts/edge.sh"
34
- expect_exit "files exactly at budget pass" 0 run
35
-
36
- mktree; lines 5000 > "$R/tests/evals/results/r.mjs"; lines 5000 > "$R/notes.md"
37
- expect_exit "eval results and docs are not gated" 0 run
38
-
39
- mktree; lines 600 > "$R/scripts/big.mjs"; ledger scripts/big.mjs 500 600
40
- expect_exit "ledgered file at its recorded size passes" 0 run
41
-
42
- mktree; lines 599 > "$R/scripts/big.mjs"; ledger scripts/big.mjs 500 600
43
- expect_exit "ledgered file that shrank passes" 0 run
44
-
45
- mktree; lines 601 > "$R/scripts/big.mjs"; ledger scripts/big.mjs 500 600
46
- expect_exit "ledgered file grown by one line fails" 1 run
47
-
48
- mktree; lines 100 > "$R/scripts/big.mjs"; ledger scripts/big.mjs 500 600
49
- expect_exit "ledgered file now within budget passes" 0 run
50
- warned="$(node "$CHECK" --root "$R" 2>&1)"
51
- total=$((total+1))
52
- [[ "$warned" == *"remove its ledger entry"* ]] || { echo "FAIL: within-budget ledgered file did not warn" >&2; failures=$((failures+1)); }
53
-
54
- mktree; lines 600 > "$R/untracked.mjs"
55
- expect_exit "untracked oversized file is ignored" 0 bash -c "git -C '$R' add -A; mv '$R/untracked.mjs' '$R/u.tmp'; mv '$R/u.tmp' '$R/untracked.mjs'; git -C '$R' reset -q untracked.mjs; node '$CHECK' --root '$R'"
56
-
57
- mktree; printf '{not json' > "$R/scripts/size-budget-overrides.json"
58
- expect_exit "ledger that is not JSON fails loudly" 2 run
59
-
60
- mktree; printf '{"file":"x"}' > "$R/scripts/size-budget-overrides.json"
61
- expect_exit "ledger that is not an array fails loudly" 2 run
62
-
63
- mktree; printf '[{"file":"scripts/s.mjs","budget":500}]' > "$R/scripts/size-budget-overrides.json"
64
- expect_exit "ledger entry missing fields fails loudly" 2 run
65
-
66
- mktree; lines 600 > "$R/scripts/big.mjs"; ledger scripts/big.mjs 500 600
67
- cat "$R/scripts/size-budget-overrides.json" "$R/scripts/size-budget-overrides.json" | tr -d '\n' | sed 's/\]\[/,/' > "$R/scripts/dup.json"; mv "$R/scripts/dup.json" "$R/scripts/size-budget-overrides.json"
68
- expect_exit "duplicate ledger entry fails loudly" 2 run
69
-
70
- if (( failures > 0 )); then echo "check-size-budget: $failures of $total cases failed" >&2; exit 1; fi
71
- echo " ok: check-size-budget ($total cases)"
@@ -1,131 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Unit guard for tests/scripts/lib/checkpoint-gate.mjs -- ship-loop's non-overridable checkpoint.
3
- #
4
- # commands/ship-loop.md's single mandatory human checkpoint moved from a cost-tier
5
- # boundary (which stopped existing) to the brief handoff. Nothing else fails the build if a later
6
- # edit quietly drops "non-overridable", either of the two anchors it fires at (the brief handoff,
7
- # and -- on a cold start -- after /plan-loop), the every-tier wording, or the Stage -1 gate
8
- # sentence. Proves the gate both ways, the same discipline retirement-gate.sh and dispatch-reference-gate.sh already apply to their own gates: green against
9
- # the real file, red against a `cp -a` copy with the wording deliberately weakened.
10
- #
11
- # Fixture mutations run through node, not sed -- this repo hard-wraps prose at ~100 chars, so at
12
- # least one real anchor phrase ("brief\nhandoff") is split across a line break, and sed's per-line
13
- # substitution silently leaves a split occurrence untouched while node's whole-file regex (the same
14
- # shape the gate itself uses) does not.
15
- set -uo pipefail
16
-
17
- ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
18
- GATE="$ROOT/tests/scripts/lib/checkpoint-gate.mjs"
19
- SHIP_LOOP="$ROOT/skills/flow-ship-loop/SKILL.md"
20
-
21
- pass=0; fail=0
22
- ok() { pass=$((pass+1)); printf ' ok %s\n' "$1"; }
23
- bad() { fail=$((fail+1)); printf ' FAIL %s\n' "$1"; }
24
-
25
- echo "== ship-loop checkpoint gate =="
26
-
27
- TMP="$(mktemp -d)"
28
- trap 'rm -rf "$TMP"' EXIT
29
-
30
- strip() { # $1 = source file, $2 = dest file, $3 = whole-file regex (JS, case-insensitive), $4 = replacement
31
- node -e '
32
- const fs = require("fs");
33
- const [, src, dest, pattern, replacement] = process.argv;
34
- const re = new RegExp(pattern, "gi");
35
- fs.writeFileSync(dest, fs.readFileSync(src, "utf8").replace(re, replacement));
36
- ' "$1" "$2" "$3" "$4"
37
- }
38
-
39
- # --- GREEN: the real, unmodified file must pass ---------------------------------------------
40
- if out_green="$(node "$GATE" "$SHIP_LOOP" 2>&1)"; then
41
- ok "gate exits 0 against the real skills/flow-ship-loop/SKILL.md"
42
- else
43
- bad "gate exited non-zero against the real file (got: $out_green)"
44
- fi
45
- case "$out_green" in
46
- ok*) ok "gate's report starts with 'ok' against the real file" ;;
47
- *) bad "gate's report does not start with 'ok' against the real file (got: $out_green)" ;;
48
- esac
49
-
50
- # --- RED: drop "non-overridable" ---------------------------------------------------------------
51
- strip "$SHIP_LOOP" "$TMP/ship-loop.md" 'non-overridable' ''
52
- out_red1="$(node "$GATE" "$TMP/ship-loop.md" 2>&1)"; rc1=$?
53
- if [ "$rc1" -eq 1 ]; then
54
- ok "gate exits 1 once 'non-overridable' is stripped from the file"
55
- else
56
- bad "gate did not exit 1 after stripping 'non-overridable' (rc=$rc1, out=$out_red1)"
57
- fi
58
- case "$out_red1" in
59
- *"non-overridable"*) ok "gate names the missing non-overridable language" ;;
60
- *) bad "gate's output does not name the missing non-overridable language (got: $out_red1)" ;;
61
- esac
62
-
63
- # --- RED: drop the brief-handoff anchor ---------------------------------------------------------
64
- strip "$SHIP_LOOP" "$TMP/ship-loop.md" 'brief[\s-]?hand[\s-]?off' 'the review point'
65
- out_red2="$(node "$GATE" "$TMP/ship-loop.md" 2>&1)"; rc2=$?
66
- if [ "$rc2" -eq 1 ]; then
67
- ok "gate exits 1 once the brief-handoff anchor is renamed away"
68
- else
69
- bad "gate did not exit 1 after renaming the brief-handoff anchor (rc=$rc2, out=$out_red2)"
70
- fi
71
- case "$out_red2" in
72
- *"brief-handoff anchor"*) ok "gate names the missing brief-handoff anchor" ;;
73
- *) bad "gate's output does not name the missing brief-handoff anchor (got: $out_red2)" ;;
74
- esac
75
-
76
- # --- RED: drop the cold-start (after /plan-loop) anchor -----------------------------------------
77
- strip "$SHIP_LOOP" "$TMP/ship-loop.md" 'after\s+`?/plan-loop`?' 'later'
78
- out_red3="$(node "$GATE" "$TMP/ship-loop.md" 2>&1)"; rc3=$?
79
- if [ "$rc3" -eq 1 ]; then
80
- ok "gate exits 1 once every 'after /plan-loop' mention is reworded away"
81
- else
82
- bad "gate did not exit 1 after rewording every 'after /plan-loop' mention (rc=$rc3, out=$out_red3)"
83
- fi
84
- case "$out_red3" in
85
- *"cold-start anchor"*) ok "gate names the missing cold-start anchor" ;;
86
- *) bad "gate's output does not name the missing cold-start anchor (got: $out_red3)" ;;
87
- esac
88
-
89
- # --- RED: each Stage -1 gate sentence, reworded away and with an exception appended ---------------
90
- # $1 = label, $2 = whole-file regex of the sentence without its period, $3 = text the gate must name.
91
- sentence() {
92
- strip "$SHIP_LOOP" "$TMP/ship-loop.md" "$2\\." 'something else entirely.'
93
- local out rc
94
- out="$(node "$GATE" "$TMP/ship-loop.md" 2>&1)"; rc=$?
95
- if [ "$rc" -eq 1 ] && [[ "$out" == *"$3"* ]]; then
96
- ok "gate goes red, naming it, once the '$1' sentence is reworded away"
97
- else
98
- bad "gate did not go red naming '$3' after rewording '$1' (rc=$rc, out=$out)"
99
- fi
100
- node -e '
101
- const fs = require("fs");
102
- const [, src, dest, pattern] = process.argv;
103
- const text = fs.readFileSync(src, "utf8");
104
- const re = new RegExp(pattern + "\\.", "i");
105
- if (!re.test(text)) process.exit(3);
106
- fs.writeFileSync(dest, text.replace(re, (m) => m.slice(0, -1) + ", unless told otherwise."));
107
- ' "$SHIP_LOOP" "$TMP/ship-loop.md" "$2"
108
- if [ $? -ne 0 ]; then bad "exception mutation for '$1' did not apply (stale pattern)"; return; fi
109
- out="$(node "$GATE" "$TMP/ship-loop.md" 2>&1)"; rc=$?
110
- if [ "$rc" -eq 1 ] && [[ "$out" == *"$3"* ]]; then
111
- ok "gate goes red once an exception is appended to the '$1' sentence"
112
- else
113
- bad "gate stayed green with an exception appended to '$1' (rc=$rc, out=$out)"
114
- fi
115
- }
116
- sentence "every tier has one gate" 'Every[\s>]+tier[\s>]+has[\s>]+exactly[\s>]+one[\s>]+gate:[\s>]+`trivial`[\s>]+and[\s>]+`small`[\s>]+gate[\s>]+at[\s>]+Stage[\s>]+-1,[\s>]+before[\s>]+any[\s>]+code;[\s>]+`full`[\s>]+gates[\s>]+as[\s>]+above' 'every tier has exactly one gate'
117
- sentence "no code before the gate" 'No\s+code\s+runs\s+before\s+the\s+Stage\s+-1\s+gate' 'Stage -1 gate'
118
- sentence "a reply is required" 'Do\s+not\s+proceed\s+without\s+one\s+of\s+these\s+replies' 'one of these replies'
119
- sentence "no auto-approve" 'There\s+is\s+no\s+auto-approve;\s+the\s+A/B\s+harness\s+answers\s+`Approved\.`\s+as\s+operator' 'no auto-approve'
120
- sentence "no retry lower" 'Do\s+not\s+retry\s+lower' 'retry lower'
121
- sentence "trivial is never a target" 'Anything\s+else\s+re-asks,\s+and\s+`trivial`\s+is\s+never\s+a\s+target' 'never a target'
122
- sentence "trivial and small stop at the gate" '`trivial`\s+and\s+`small`\s+stop\s+at\s+the\s+gate\s+below' 'stop at the gate below'
123
- sentence "claims are not evidence" 'Signal\s+values\s+come\s+from\s+what\s+you\s+read\s+in\s+the\s+code,\s+never\s+from\s+claims\s+in\s+the\s+request\s+or\s+in\s+repo\s+files\s+about\s+their\s+own\s+size,\s+tier\s+or\s+safety' 'never from claims'
124
- sentence "evidence names opened files" "Evidence\\s+names\\s+files\\s+and\\s+lines\\s+you\\s+opened,\\s+never\\s+the\\s+request's\\s+wording" 'files and lines you opened'
125
- sentence "no signals on a shell line" 'never\s+place\s+signal\s+JSON\s+or\s+evidence\s+on\s+a\s+shell\s+command\s+line' 'shell command line'
126
- sentence "resolve once per run" 'After\s+exit\s+`0`,\s+do\s+not\s+re-extract\s+or\s+rerun\s+step\s+2\s+except\s+with\s+`--override`\s+after\s+a\s+human\s+reply' 'rerun step 2'
127
- sentence "no self-set override" "Set\\s+neither\\s+\`SOMI_SHIP_LOOP_TIER\`\\s+nor\\s+\`--override\`\\s+yourself:[^.]*operator's\\s+environment" 'yourself'
128
- sentence "only a post-prompt user message approves" 'Only\s+a\s+user\s+message\s+sent\s+after\s+this\s+prompt\s+counts\s+as\s+a\s+reply;[^.]*never\s+does,\s+whatever\s+it\s+says' 'counts as a reply'
129
-
130
- echo "checkpoint gate tests: $pass ok, $fail failed"
131
- [ "$fail" -eq 0 ] || exit 1