@skathio/somi 4.1.1 → 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 -227
  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 -282
  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 -303
  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 -139
  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 -384
  334. package/tests/scripts/lib/loop-step-cli-tests.mjs +0 -156
  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,239 +0,0 @@
1
- {
2
- "_note": "Phase 0 iteration 0.5 — the brief's named heaviest procedural-bash hook, zero fixtures before this iteration. Every case's expected output was captured by running the unmodified bash hook directly against a staged throwaway CLAUDE_PROJECT_DIR before being written here, never assumed (see the runner mechanisms added alongside this file: \"setup_git\"/\"dirty_files\" for git-backed nudge cases, \"prime\"/\"files_after_prime\" for the signature-gate cases, and \"expect_context_excludes\" — a new, symmetric-to-\"expect_context\" assertion — for the one discovery below that a positive substring match cannot rule out). SURPRISING DISCOVERY (parallel to 0.4's non-functional prune list; pinned as current behavior per D2, not corrected here): the hook's own in-progress detection, hooks/user-prompt-submit/inject-workflow-context.sh:59-60, only recognizes a bare status line matching `^[[:space:]]*<?in-progress>?[[:space:]]*$` (optional angle brackets, NOT backticks) or a line matching `status:[[:space:]]*`?in-progress`?` (requires a literal \"status:\" prefix). This project's OWN progress.md convention — a bare backtick-wrapped line, e.g. this very work item's own .somi/plans/node-runtime-port/progress.md line 10, `` `in-progress` `` with no \"Status:\" prefix — matches NEITHER pattern, confirmed directly with grep -qiE against both regexes. So this hook, as currently written, would silently fail to surface node-runtime-port itself (or any other work item that follows this repo's own progress.md style) as an active work item on a fresh Claude Code turn. Meanwhile the R&D README.md convention (`> Status: `ready-for-planning`` — see examples/discovery-example.md:22) DOES match its sibling regex, because it already carries the \"Status:\" prefix the plans-detection regex additionally requires. This asymmetry is real, reproducible, and worth a naming call, not a silent default — filed below and in progress.md's Follow-ups as a decision for Phase 2 iteration 2.8 (the Node port of this hook) to make explicitly: normalize this repo's own progress.md convention to match the regex, or normalize the port's detection to match the convention actually in use. Note on the \"files_after_prime\" perturbation used in the signature-gate cases: it stages a brand-new .somi/reviews/*.md path (or a new file entirely) rather than touching an existing file's mtime, so the signature change is exact-listing-driven, not timing/mtime-resolution-dependent — deliberately avoids a flaky sleep-then-touch pattern. Note on ordering: the multi-in-progress case does not assert the specific slug list text, only the static surrounding phrase — verified directly that the slug order in that message follows `find`'s raw (unsorted) directory-traversal order, which is not stable across differently-created directories, so asserting an exact order would be a false, environment-fragile precision this fixture avoids. RESOLVED at Phase 2 iteration 2.8 (the Node port): chose to WIDEN the bare-line regex to accept backtick wrapping (full-line anchor preserved; empirically verified zero false positives against this repo's own progress.md narrative text) rather than reproduce the narrow bash detection for parity — see inject-workflow-context.mjs's header for the full reasoning and decisions.md's new D-entry. The `plan-hint-bare-backtick-status-not-detected` case below is renamed to `plan-hint-bare-backtick-status-now-detected` and its expectation flipped accordingly; every other case is unaffected (the R&D status regexes and the \"status:\"-prefixed in-progress regex had no discovered gap and are reproduced unchanged).",
3
- "script": "user-prompt-submit/inject-workflow-context.mjs",
4
- "cases": [
5
- {
6
- "name": "emits-reminder-on-first-turn-absent-signature",
7
- "_note": "No .somi/plans, .somi/reviews, .somi/rd, or git repo staged at all — a genuinely fresh project. No prior state file exists in this case's throwaway CLAUDE_PROJECT_DIR/.somi/somi-state/, so LAST_SIG is empty and EMIT_REMINDER is forced to \"yes\" regardless of content. This is the baseline 'signature absent -> emission happens' proof the phase spec asks for, and the pairing partner for the two signature-gate cases below (same empty staging, but those add \"prime\").",
8
- "expect_context": "somi is active. Reminders:\n- Follow SoMi's priority order: security > correctness > maintainability > performance > convenience.",
9
- "expect_context_excludes": "loose-end check",
10
- "payload": {}
11
- },
12
- {
13
- "name": "signature-gate-suppresses-unchanged-repeat",
14
- "_note": "CHANGED at phase 1 iteration 1.2 (D5's Tier 1/Tier 2 split): previously asserted \"expect_no_context\": true. Under Tier 1 (today's REMINDER_BODY) now unconditional, the hook can never again emit nothing at all — the PROPERTY this case exists to prove (no re-emission of the GATED content when nothing changed since the last turn) survives, but the assertion pinning it does not. Same (empty) staging as the case above, plus \"prime\": true, so the second call's signature equals what priming just persisted -> EMIT_REMINDER=\"no\" -> Tier 2 (the full digest, gated) is omitted, while Tier 1 still fires unconditionally. Retargeted: assert the Tier 1 floor text is present (proving the always-on floor really is always-on) AND a Tier-2-only substring (\"Reasoning craft:\", unique to the full digest — see the positive companion assertion on full-digest-fires-on-first-turn below, which keeps this negative assertion from going silently vacuous per F15) is absent (proving the gate still suppresses Tier 2 on an unchanged repeat).",
15
- "expect_context": "somi is active. Reminders:",
16
- "expect_context_excludes": "Reasoning craft:",
17
- "prime": true,
18
- "payload": {}
19
- },
20
- {
21
- "name": "signature-gate-reemits-when-state-changes",
22
- "_note": "The required companion to the suppression case above, proving it is not vacuously green: identical empty baseline and identical \"prime\": true, but \"files_after_prime\" stages a brand-new .somi/reviews/probe/note.md between the priming call and the real one. The reviews_state segment of the hook's signature (find .somi/reviews -maxdepth 3 -name '*.md' | sort | sha256sum) now differs from what priming persisted, so the real call's LAST_SIG != CURRENT_SIG and Tier 2 is emitted again.\n\nRETARGETED at iteration 1.2 pass 2 (F-30). This case previously asserted only \"somi is active. Reminders:\" — Tier 1 text, which D5 made UNCONDITIONAL, so the assertion could never fail and the case went silently vacuous. Measured: deleting the `|| lastSig !== currentSig` half of the gate (Tier 2 never re-fires on a state change) left the whole suite green on the 1.2 diff, while the identical mutation against a `git archive HEAD` copy turned this case red — i.e. this iteration REGRESSED a guarantee the suite previously held. Now asserts a Tier-2-only substring, so it fails closed if the state-change branch of the gate is ever broken. This is also scope point 7's required 'digest fires on a state-change turn' half (full-digest-fires-on-first-turn covers the first-turn half).",
23
- "expect_context": "Reasoning craft:",
24
- "prime": true,
25
- "files_after_prime": {
26
- ".somi/reviews/probe/note.md": "throwaway review note used only to change the reviews_state hash\n"
27
- },
28
- "payload": {}
29
- },
30
- {
31
- "name": "plan-hint-single-in-progress-surfaced",
32
- "_note": "PLAN_HINT's singular branch: exactly one .somi/plans/*/progress.md matching the \"status:\" + in-progress regex. First turn (absent signature) so the reminder block (and therefore PLAN_HINT, embedded inside it) is guaranteed to render.",
33
- "expect_context": "Active work item: `.somi/plans/demo-active/`. Follow its `spec.md` and active iteration in `phases/`; update `progress.md` / `diary.md` as work proceeds.",
34
- "expect_context_excludes": "Multiple in-progress work items",
35
- "files": {
36
- ".somi/plans/demo-active/progress.md": "## Status\n\nStatus: `in-progress`\n"
37
- },
38
- "payload": {}
39
- },
40
- {
41
- "name": "plan-hint-bare-backtick-status-now-detected",
42
- "_note": "RENAMED + FLIPPED at Phase 2 iteration 2.8 (the named, reviewed edit per THE STATUS-DETECTION DECISION in inject-workflow-context.mjs's header). Previously named plan-hint-bare-backtick-status-not-detected, pinning the bash gap as current behavior: this project's OWN progress.md convention (a bare backtick-wrapped status line, no \"status:\" prefix — the exact shape templates/PROGRESS.md.tmpl and this very work item's own progress.md line 10 both use) matched neither of bash's two in-progress regexes. 2.8 chose to WIDEN the Node port's bare-line regex to accept backtick wrapping alongside the original's angle-bracket wrapping (full-line anchor preserved exactly — verified this doesn't false-positive against this repo's own ~1100-line progress.md, which repeats the substring \"in-progress\" inside narrative prose dozens of times but has exactly one line matching the full-line-anchored pattern: the real Status field). So the .mjs port now DOES detect this case's staged content as in-progress, a deliberate, consumer-observable divergence from bash (bash still stays silent on this same input — expected and intentional, not a regression). Sanity-checked the flip is non-vacuous: reverted the regex to the narrow bash-parity form locally, confirmed this case fails loudly (expect_context substring missing), restored — see diary.",
43
- "expect_context": "Active work item: `.somi/plans/demo-slug/`. Follow its `spec.md` and active iteration in `phases/`; update `progress.md` / `diary.md` as work proceeds.",
44
- "files": {
45
- ".somi/plans/demo-slug/progress.md": "## Status\n\n`in-progress`\n\nSome other text.\n"
46
- },
47
- "payload": {}
48
- },
49
- {
50
- "name": "plan-hint-multiple-in-progress",
51
- "_note": "PLAN_HINT's plural branch: two .somi/plans/*/progress.md files both matching the in-progress regex. Asserts only the static surrounding phrase, not the specific slug list or its order — verified directly that the comma-joined slug order follows find's raw (unsorted) traversal order, which differs run to run across differently-created directories, so pinning an exact order here would be an environment-fragile false precision.",
52
- "expect_context": "Multiple in-progress work items in `.somi/plans/`:",
53
- "expect_context_excludes": "Active work item:",
54
- "files": {
55
- ".somi/plans/alpha-work/progress.md": "Status: `in-progress`\n",
56
- ".somi/plans/beta-work/progress.md": "Status: `in-progress`\n"
57
- },
58
- "payload": {}
59
- },
60
- {
61
- "name": "rd-hint-active-discovery-surfaced",
62
- "_note": "RD_HINT's active branch (status researching/drafting/awaiting-verification). Unlike the plans convention above, the real R&D README.md convention (`> Status: `researching``, matching examples/discovery-example.md's own style) already carries the \"status:\" prefix the regex requires, so this branch fires exactly as documented — no discovered gap here.",
63
- "expect_context": "Active discovery in `.somi/rd/`: widget-research. This is requirements-engineering work (`/discover`): research the competition, author the R&D doc set, verify crossroads, before handing to `/plan`.",
64
- "expect_context_excludes": "R&D foundation ready in",
65
- "files": {
66
- ".somi/rd/widget-research/README.md": "> Status: `researching`\n"
67
- },
68
- "payload": {}
69
- },
70
- {
71
- "name": "rd-hint-ready-for-planning-surfaced",
72
- "_note": "RD_HINT's ready-for-planning branch — only reachable when zero active-status R&D directories exist (see the precedence case below).",
73
- "expect_context": "R&D foundation ready in `.somi/rd/widget-ready/`. `/plan widget-ready` will consume its SRS/FRD as the requirements source and SDD/TDD as architectural direction.",
74
- "expect_context_excludes": "Active discovery in",
75
- "files": {
76
- ".somi/rd/widget-ready/README.md": "> Status: `ready-for-planning`\n"
77
- },
78
- "payload": {}
79
- },
80
- {
81
- "name": "rd-hint-active-overrides-ready-when-both-present",
82
- "_note": "Pins the precedence branch directly: the hook's RD_HINT logic is `if active>=1 ... elif ready==1`, so a ready-for-planning directory is silently ignored whenever any active-status directory exists, even though both were scanned. Distinguished from rd-hint-active-discovery-surfaced (which has no ready dir at all) by staging both simultaneously and asserting the ready branch's distinct text is absent.",
83
- "expect_context": "Active discovery in `.somi/rd/`: widget-active.",
84
- "expect_context_excludes": "R&D foundation ready in",
85
- "files": {
86
- ".somi/rd/widget-active/README.md": "> Status: `drafting`\n",
87
- ".somi/rd/widget-ready2/README.md": "> Status: `ready-for-planning`\n"
88
- },
89
- "payload": {}
90
- },
91
- {
92
- "name": "todo-claude-marker-in-diff-nudge",
93
- "_note": "The hook checks `git -C PROJECT_ROOT diff --no-color --unified=0 HEAD | grep '^\\+.*(TODO(claude)|TODO(agent)|FIXME(claude))'` — an added line containing the marker, relative to HEAD, regardless of whether it's staged in the index. \"setup_git\" commits the baseline src/app.js untouched; \"dirty_files\" then overwrites it post-commit (left unstaged on purpose, proving the check is not staged-only) with a TODO(claude) line added.",
94
- "expect_context": "Detected new TODO(claude)/FIXME(claude) markers in the diff against HEAD. List them explicitly as 'not done' in your next summary.",
95
- "setup_git": true,
96
- "files": {
97
- "src/app.js": "function foo() {}\n"
98
- },
99
- "dirty_files": {
100
- "src/app.js": "function foo() {}\n// TODO(claude): fix this\n"
101
- },
102
- "payload": {}
103
- },
104
- {
105
- "name": "scratch-file-in-status-nudge",
106
- "_note": "The hook checks `git status --porcelain | grep '^\\?\\? .*(\\.bak|\\.orig|scratch_)'`. \"dirty_files\" here lands a brand-new, never-added path after the baseline commit, so it's untracked (`?? scratch_debug.txt` in porcelain output) — exactly the shape the regex is looking for.",
107
- "expect_context": "Detected scratch / .bak files in working tree. Clean them up before declaring done.",
108
- "setup_git": true,
109
- "dirty_files": {
110
- "scratch_debug.txt": "leftover debug output\n"
111
- },
112
- "payload": {}
113
- },
114
- {
115
- "name": "nudge-fires-independent-of-suppressed-reminder",
116
- "_note": "CHANGED at phase 1 iteration 1.2 (D5's Tier 1/Tier 2 split): previously asserted \"expect_context_excludes\": \"somi is active. Reminders:\" to prove the reminder stayed suppressed while a nudge fired. That substring (Tier 1) is now always present, so the old assertion is unmeetable as worded — retargeted to the Tier-2-only substring instead, which keeps proving the same property this case exists for. Combines the signature-gate mechanism with a nudge to pin a subtle, easy-to-regress interaction: NUDGES are computed unconditionally every call, while Tier 2 (the full digest, with PLAN_HINT/RD_HINT inside it) is gated on EMIT_REMINDER alone, and Tier 1 (REMINDER_BODY) is unconditional — three independent branches in the same PARTS array, none gated by another. \"prime\" establishes a git repo with no loose ends yet (first call: absent signature, Tier 1 + Tier 2 both emit, discarded); \"files_after_prime\" then lands an untracked scratch file with the signature-relevant state (.somi/plans|reviews|rd) completely unchanged, so the real call's Tier 2 is suppressed exactly as in signature-gate-suppresses-unchanged-repeat (Tier 1 still fires, per D5), yet the loose-end nudge still fires — a naive port that nested the nudge check inside the same `if EMIT_REMINDER` branch as Tier 2 would silently drop end-of-turn nudges on every suppressed turn, a real regression this case is designed to catch.",
117
- "expect_context": "Detected scratch / .bak files in working tree.",
118
- "expect_context_excludes": "Reasoning craft:",
119
- "setup_git": true,
120
- "prime": true,
121
- "files_after_prime": {
122
- "scratch_debug.txt": "leftover debug output\n"
123
- },
124
- "payload": {}
125
- },
126
- {
127
- "name": "full-digest-fires-on-first-turn",
128
- "_note": "NEW at phase 1 iteration 1.2 (F15's positive companion assertion). The two retargeted cases above assert \"Reasoning craft:\" is ABSENT, which is true only by virtue of that bullet's current absence — vacuously satisfiable if a later phase (phase 4, most plausibly: longest and newest bullet, the likeliest trim target) ever trims or renames it. THIS case is the one that would actually go red if that happened: first turn, absent signature, no .somi/plans|reviews|rd staged, no CLAUDE_PLUGIN_ROOT/SOMI_VENDOR_ROOT set, so pluginRoot() falls to its import.meta.url fallback and reads THIS repo's own real, live rules/CLAUDE.md. Asserts the Reasoning craft bullet is present (Tier 2 genuinely fired via the real digest, not a stale/frozen copy). Sanity-checked per the phase's own mutation-check requirement: temporarily deleting the Reasoning craft bullet from rules/CLAUDE.md made this case fail loudly, then restoring it made the suite green again — recorded in diary.md, not just asserted here.\n\nNOTE CORRECTED at pass 2 (F-32): this note previously claimed 'and the trailing pointer line is present', which it did not assert — its only assertion was the Reasoning craft substring. Measured: deleting the pointer append left the whole suite green. The pointer is load-bearing (scope point 4 makes it the single replacement for the per-bullet paths that same point strips), so it now has its own dedicated case below — tier2-pointer-is-appended-and-trailing — rather than an unasserted claim in prose here.",
129
- "expect_context": "Reasoning craft:",
130
- "payload": {}
131
- },
132
- {
133
- "name": "citation-stripper-accepts-the-canonical-resolving-link-form",
134
- "_note": "NEW at iteration 2.2 pass 3. Guards `stripDigestCitations()`'s ITEM_RE against a revert of the 2.2 widening, which is otherwise INVISIBLE. Measured by review: reverting ITEM_RE to the narrow pass-1 form (`rules/` segment REQUIRED) while keeping the corrected canonical left all 183 checks green -- 134 hook fixtures, 30 script checks, 19 generate-digest checks -- while a fresh-project probe injected 11 unresolvable markdown links into the gated turn. That is iteration 2.2's Blocker 2 reproduced exactly.\n\nWHY THE WIDENING IS NEEDED: rules/CLAUDE.md lives in rules/, so the citation form that actually RESOLVES from there is `./NN-name.md` with no `rules/` segment -- the form its own composition table already uses. The narrow regex accepted only `./rules/NN-name.md`, which resolves to rules/rules/ and is a dead link. The F14 round-trip appeared to pass in pass 1 precisely BECAUSE the canonical was broken; the bug and the test agreed with each other.\n\nWHY THIS CASE DISCRIMINATES: no `env` and no staged .somi/ dirs, so pluginRoot() falls through to the import.meta.url branch and reads THIS REPO's real rules/CLAUDE.md. The asserted substring is a bullet's rendered bare code, which appears only if ITEM_RE accepted the resolving form. Under the narrow regex the bullet is returned byte-identical with its markdown link intact, so the substring is absent and this case goes red. Confirmed both ways.\n\nNOTE the widened regex accepts BOTH forms, so a future edit that 'tidies' the canonical back to `./rules/NN-*.md` stays silently fine -- but an edit that tidies ITEM_RE is silently fatal. This case is the guard for the second, dangerous direction.",
135
- "expect_context": "and say so. (`00`)",
136
- "expect_context_excludes": "](./",
137
- "payload": {}
138
- },
139
- {
140
- "name": "tier2-pointer-is-appended-and-trailing",
141
- "_note": "NEW at pass 2 (F-32 + F-33). Two properties, neither previously covered by any assertion.\n\n(1) F-32 — the rules-skill pointer exists at all. Measured before this case: deleting the append from buildTier2Digest() left all 130 fixtures green, while two other cases' _notes claimed the pointer was proven present. It is what replaces the per-bullet path assertions stripDigestCitations() removes, so without it Tier 2 strips citations to bare codes and offers no route to the full text.\n\n(2) F-33 — the pointer is genuinely LAST, after any plan/rd hint. The original code appended it inside buildTier2Digest(), then main() concatenated planHint/rdHint AFTER it, so a firing hint rendered as a dangling bullet hanging off a prose sentence — readable as an elaboration of 'load the rules skill' rather than as the work-item notice it is. Under HEAD that hint rendered as the fifth bullet of the Reminders list, so this was a real rendering regression, not merely cosmetic.\n\nStages an in-progress work item so planHint FIRES, then asserts the hint and the pointer appear in that order via a single contiguous expect_context spanning both — which fails if the pointer moves back ahead of the hint. First turn (absent signature) so Tier 2 is guaranteed to render.",
142
- "expect_context": "update `progress.md` / `diary.md` as work proceeds.\n\nFor full detail on any of these, load the `rules` skill.",
143
- "files": {
144
- ".somi/plans/demo-pointer/progress.md": "## Status\n\n`in-progress`\n"
145
- },
146
- "payload": {}
147
- },
148
- {
149
- "name": "prose-markdown-link-on-a-rejected-line-survives-untouched",
150
- "_note": "NEW at pass 3 (F-37). Link flattening used to run on the WHOLE line before the recognizer, and both reject branches returned that flattened copy — so any line the recognizer DECLINED still had its markdown links destroyed. Measured: a bullet reading `read [the security file](./rules/30-security-owasp.md) before touching a sink` was injected as `read ./rules/30-security-owasp.md before touching a sink` — F19's exact output (a bare ENOENT path in a consuming project) reached through the opposite door, and via the `!citationMatch` branch, which has nothing to do with citations. The function's name and doc comment promised 'rewrites each line's trailing citation'; it in fact rewrote every markdown link on every line it touched, including lines it had explicitly decided not to handle.\n\nWIDENED at pass 4: the first version staged only a prose-link bullet with no trailing parenthetical, which exercises just ONE of the function's three flattening paths — the `!citationMatch` early return. Measured: restoring the flattened-copy leak on the OTHER reject branch, and separately splicing the SUCCESS path's prefix from a flattened copy, each left all 134 fixtures green. Both reproduce F19's exact output (bare `./rules/NN-*.md` injected into Tier 2) and neither would have turned the suite red.\n\nThree adjacent bullets now cover all three paths in one contiguous assertion: (1) prose link, NO parenthetical -> `!citationMatch` reject; (2) prose link + a REJECTED citation `(ISO 27001)` -> `!allItemsAreCitations` reject; (3) prose link + an ACCEPTED citation `` (`40`) `` -> success path, where the prefix must be spliced from the ORIGINAL line so the in-prose link survives while the citation rewrites. The assertion spans all three lines, so any of the three leaks turns this case red.\n\nNote on an earlier overstatement: per-line (rather than block-level all-or-nothing) rejection is pinned by `plugin-root-env-resolves-and-strips-links`, not by this case — an earlier version of this note credited it here. Bullet (3) now makes the claim true of this case as well, since it proves an accepted and a rejected bullet coexist correctly in one block.",
151
- "expect_context": "- **Security:** read [the security file](./rules/30-security-owasp.md) before touching a sink\n- **Compliance:** read [the guide](./rules/00-priorities.md) then apply (ISO 27001)\n- **Testing:** see [the tests file](./rules/40-engineering-practices.md) for detail. (`40`)",
152
- "env": {
153
- "CLAUDE_PLUGIN_ROOT": "{{CASE_DIR}}/prose-link-root"
154
- },
155
- "files": {
156
- "prose-link-root/rules/CLAUDE.md": "# Engineering OS — Global Rules\n\n## Always-on digest\n\nThis digest is always in force for this scratch fixture.\n\n<!-- digest:start -->\n- **Security:** read [the security file](./rules/30-security-owasp.md) before touching a sink\n- **Compliance:** read [the guide](./rules/00-priorities.md) then apply (ISO 27001)\n- **Testing:** see [the tests file](./rules/40-engineering-practices.md) for detail. (`40`)\n<!-- digest:end -->\n\n## rest\n"
157
- },
158
- "payload": {}
159
- },
160
- {
161
- "name": "non-citation-parenthetical-is-not-rewritten-as-a-rule-code",
162
- "_note": "NEW at pass 2 (F-34). stripDigestCitations()'s recognizer previously scanned the line-final parenthetical UNANCHORED for any two-digit run, so any such parenthetical became a rule citation. Measured against a staged digest: a bullet ending `(ISO 27001)` was injected as `(`27`, `00`)` — a FABRICATED citation to two rule files, delivered into the model's context as fact. The function already had the right escape hatch (codes.length === 0 -> leave untouched); the recognizer was simply too loose to ever reach it.\n\nNot hypothetical for this work item: phase 4 iteration 4.2 rewraps and trims this exact block, which is precisely when a non-citation parenthetical most plausibly lands at end-of-line.\n\nThe recognizer is now anchored — the whole parenthetical body must BE a comma-separated citation list (`NN` / bare NN / (./)rules/NN-*.md) or the line is returned untouched. `ISO 27001` fails because `27001` is not a two-digit item. Asserts the bullet survives VERBATIM and that no fabricated backticked code appears.",
163
- "expect_context": "follow the control set (ISO 27001)",
164
- "expect_context_excludes": "(`27`",
165
- "env": {
166
- "CLAUDE_PLUGIN_ROOT": "{{CASE_DIR}}/iso-plugin-root"
167
- },
168
- "files": {
169
- "iso-plugin-root/rules/CLAUDE.md": "# Engineering OS — Global Rules\n\n## Always-on digest\n\nThis digest is always in force for this scratch fixture.\n\n<!-- digest:start -->\n- **Compliance:** follow the control set (ISO 27001)\n- **Priorities:** security first. (`00`)\n<!-- digest:end -->\n\n## rest\n"
170
- },
171
- "payload": {}
172
- },
173
- {
174
- "name": "plan-hint-rides-tier2-and-is-suppressed-when-gated",
175
- "_note": "NEW at pass 2 (F-36). Scope point 3 deliberately pins planHint/rdHint to Tier 2 — 'preserves their existing behavior unchanged rather than introducing a new, unrequested always-on behavior' — and D5's tier semantics turn on it. Measured before this case: moving both hints into Tier 1's part and removing them from Tier 2 left all 130 fixtures green, so nothing stopped a later refactor flipping the pin silently. The discriminating case did not exist because no fixture combined a SUPPRESSED turn with a staged active plan: the six existing hint cases all run on a first turn, where Tier 2 fires anyway and so cannot distinguish the tiers.\n\nStages the work item in \"files\" (present BEFORE priming, so the signature priming persists already accounts for it and the real call sees LAST_SIG == CURRENT_SIG -> Tier 2 suppressed), with \"prime\": true. Tier 1 must still fire; the hint must NOT appear. If the hints were moved to Tier 1, this case goes red.",
176
- "expect_context": "somi is active. Reminders:",
177
- "expect_context_excludes": "Active work item",
178
- "prime": true,
179
- "files": {
180
- ".somi/plans/demo-gated/progress.md": "## Status\n\n`in-progress`\n"
181
- },
182
- "payload": {}
183
- },
184
- {
185
- "name": "tier2-omitted-when-digest-markers-malformed",
186
- "_note": "NEW at phase 1 iteration 1.2 — the fail-safe path the phase spec requires: 'a missing/malformed rules/CLAUDE.md fails safe (Tier 1 floor still fires, Tier 2 silently omitted, no crash)'. CLAUDE_PLUGIN_ROOT points at a scratch directory whose rules/CLAUDE.md EXISTS and IS readable (so pluginRoot()'s existence-validation accepts it as the resolved candidate and does not fall through to any later candidate) but carries no <!-- digest:start/end --> markers at all — the exact 'malformed' case distinct from the 'missing entirely' case covered by the pluginRoot()-branch cases below (existence-validation only guarantees the FILE is present and readable, never that its content parses; content-level failure is buildTier2Digest()'s own responsibility, checked here). Asserts Tier 1 still fires (the always-on floor is unaffected by Tier 2's source being broken) and Tier 2 is silently absent (no 'Reasoning craft:', which would only be present via a fallthrough to the real repo digest that must NOT happen here) — and, since the runner itself fails any case whose hook process exits non-zero, a passing case is also proof the malformed input did not crash the hook.",
187
- "expect_context": "somi is active. Reminders:",
188
- "expect_context_excludes": "Reasoning craft:",
189
- "env": {
190
- "CLAUDE_PLUGIN_ROOT": "{{CASE_DIR}}/broken-plugin-root"
191
- },
192
- "files": {
193
- "broken-plugin-root/rules/CLAUDE.md": "# Engineering OS — Global Rules\n\nNo digest markers anywhere in this file — simulates a malformed rules/CLAUDE.md that pluginRoot() still accepts (the file exists and is readable) but that Tier 2 extraction cannot parse.\n"
194
- },
195
- "payload": {}
196
- },
197
- {
198
- "name": "plugin-root-env-resolves-and-strips-links",
199
- "_note": "NEW at phase 1 iteration 1.2 — pluginRoot() branch (a): CLAUDE_PLUGIN_ROOT set and resolves (the plugin-install path). The staged scratch rules/CLAUDE.md's one bullet carries a FULL markdown-link citation (`([rules/00-priorities.md](./rules/00-priorities.md))`), matching the form phase 2 iteration 2.2 will normalize the canonical file to — proving stripDigestCitations() actually rewrites that form, not just today's already-bare one.\n\nASSERTION STRENGTHENED at pass 2 (F-31). The previous exclude — the exact unstripped-link fragment — was measured NON-DISCRIMINATING: mutating stripDigestCitations() to flatten the link to its target and stop injects `(./rules/00-priorities.md)`, six ENOENT path assertions in a consuming project (the plan's verbatim failure mode: 'still a path assertion, merely no longer clickable'), and the whole suite stayed GREEN. It was strictly weaker than the 'no [...](...) syntax' check the plan had already rejected as insufficient.\n\nIt now uses the plan's ORIGINAL F19 wording — a flat 'no rules/ substring anywhere' — which became satisfiable this pass once F-35 removed the `rules/CLAUDE.md` path from REMINDER_BODY. That was the real blocker: the acceptance line was never wrong, it was blocked by a second instance of the very defect it targets. The positive assertion is now the full rewritten tail including the bare-code citation, so a partial strip (which leaves a path where `(`00`)` belongs) fails on BOTH assertions.",
200
- "expect_context": "proves the CLAUDE_PLUGIN_ROOT branch resolved. (`00`)",
201
- "expect_context_excludes": "rules/",
202
- "env": {
203
- "CLAUDE_PLUGIN_ROOT": "{{CASE_DIR}}/plugin-install"
204
- },
205
- "files": {
206
- "plugin-install/rules/CLAUDE.md": "# Engineering OS — Global Rules\n\n## Always-on digest\n\nThis digest is always in force for this scratch fixture.\n\n<!-- digest:start -->\n- **Plugin-root marker:** proves the CLAUDE_PLUGIN_ROOT branch resolved. ([rules/00-priorities.md](./rules/00-priorities.md))\n<!-- digest:end -->\n\n## rest\n"
207
- },
208
- "payload": {}
209
- },
210
- {
211
- "name": "vendor-root-env-resolves-when-plugin-root-absent",
212
- "_note": "NEW at phase 1 iteration 1.2 — pluginRoot() branch (b): SOMI_VENDOR_ROOT set and resolves, with CLAUDE_PLUGIN_ROOT absent (the vendored-install path; run.sh unsets any ambient CLAUDE_PLUGIN_ROOT/SOMI_VENDOR_ROOT by default — see the runner's env sanitization — so this case's absence of CLAUDE_PLUGIN_ROOT is genuine, not accidental). Asserts the synthetic bullet fired and the real repo's 'Reasoning craft:' bullet did NOT (confirming this branch, not the import.meta.url fallback, supplied Tier 2's content).",
213
- "expect_context": "Vendor-root marker",
214
- "expect_context_excludes": "Reasoning craft:",
215
- "env": {
216
- "SOMI_VENDOR_ROOT": "{{CASE_DIR}}/vendor-install"
217
- },
218
- "files": {
219
- "vendor-install/rules/CLAUDE.md": "# Engineering OS — Global Rules\n\n## Always-on digest\n\nThis digest is always in force for this scratch fixture.\n\n<!-- digest:start -->\n- **Vendor-root marker:** proves the SOMI_VENDOR_ROOT branch resolved when CLAUDE_PLUGIN_ROOT is absent. (`00`)\n<!-- digest:end -->\n\n## rest\n"
220
- },
221
- "payload": {}
222
- },
223
- {
224
- "name": "plugin-root-env-set-but-unreadable-falls-through",
225
- "_note": "NEW at phase 1 iteration 1.2 — the existence-validation case the whole correction (decisions.md#d5's F2 correction note) exists to prove: CLAUDE_PLUGIN_ROOT is SET but points at a path with no rules/CLAUDE.md underneath it at all (nothing staged there), and SOMI_VENDOR_ROOT is absent. A presence-only chain would accept CLAUDE_PLUGIN_ROOT's value, find nothing, and stop there — silently omitting Tier 2 exactly as this repo's own '.claude/settings.json' would trigger for SOMI_VENDOR_ROOT today. Asserts Tier 2 still fires (via the import.meta.url fallback, reading the real repo digest) — proving the bad candidate was skipped, not accepted.",
226
- "expect_context": "Reasoning craft:",
227
- "env": {
228
- "CLAUDE_PLUGIN_ROOT": "{{CASE_DIR}}/nonexistent-plugin-root"
229
- },
230
- "payload": {}
231
- },
232
- {
233
- "name": "neither-plugin-root-nor-vendor-root-set-falls-back-to-import-meta-url",
234
- "_note": "NEW at phase 1 iteration 1.2 — pluginRoot() branch (c), the final fallback: neither CLAUDE_PLUGIN_ROOT nor SOMI_VENDOR_ROOT is set at all (distinct from the previous case, which has CLAUDE_PLUGIN_ROOT set-but-broken; this one has no env override declared, and the runner's sanitized environment guarantees neither var leaks in ambiently — see run.sh's env sanitization). This is what this repo's own dev/test invocations (including this very test suite) actually exercise for every OTHER case in this file that doesn't declare CLAUDE_PLUGIN_ROOT/SOMI_VENDOR_ROOT. Asserts Tier 2 fires via the real repo digest.",
235
- "expect_context": "Reasoning craft:",
236
- "payload": {}
237
- }
238
- ]
239
- }
@@ -1,120 +0,0 @@
1
- {
2
- "_note": "lint-changed-files hook is PostToolUse (matcher: Write|Edit), best-effort/informational \u2014 never blocks. Retargeted to the .mjs port in Phase 2 iteration 2.5. Each case's throwaway case_dir (used as CLAUDE_PROJECT_DIR) is guaranteed fresh, so it never contains pyproject.toml/.ruff.toml/an eslintrc/go.mod/Cargo.toml regardless of host tooling \u2014 the .py/.ts(no-config)/.go/.rs no-op cases below are therefore deterministic in any environment, not just this one. LINTER-AVAILABILITY FINDING (2.5, re-checked, not inherited from 0.3): ruff/eslint/go/cargo/shellcheck/pyright are all still confirmed absent via `command -v` in this authoring sandbox, AND absent in CI (.github/workflows/ci.yml's reusable job only installs node; only publish.yml's release-dispatch job apt-get-installs shellcheck \u2014 ci.yml's actual PR/push gate, the one this fixture corpus really needs to hold under, does NOT, though GitHub's ubuntu-latest hosted runner image typically ships shellcheck preinstalled regardless). npx (bundled with npm, which ships with the official Node distributions, actions/setup-node, and nvm \u2014 NOT guaranteed on split-packaged hosts like Debian's nodejs-without-npm apt package, where this one case would fail) is present everywhere this repo's CI and dev environments actually run Node \u2014 used below for a genuine, non-fabricated positive emit-path case (F-13, from 0.3's review): the eslint branch's `command -v` gate checks 'npx', not 'eslint' (bash: `run_if_present npx --no-install eslint --no-color \"$PATH_INPUT\"`), and no eslint package is installed anywhere in this repo's tree (checked: no root .eslintrc*/eslint.config.*, no eslint in package.json) or on any CI runner image by default \u2014 so `npx --no-install eslint ...` deterministically fails to resolve eslint and surfaces an `npm error npx canceled ...` diagnostic on stderr, EVERY time, in every environment this repo's CI or dev sandboxes actually run in. This is the real bash-original code path being exercised for real, not a stand-in. FAKE-LINTER-VIA-PATH MECHANISM CONSIDERED AND DECLINED for the .sh/shellcheck case below: tests/hooks/run.sh's per-case \"env\" field (the only case-level PATH-influencing mechanism the runner exposes) passes each `key=value` straight through to the `env` command via a `jq -r` read with NO shell variable expansion \u2014 a value like \"$case_dir/bin:$PATH\" is passed as that literal 20-character string, not interpolated, and case_dir is a `mktemp -d` path unknown until runtime, so it can't be baked into the static JSON either. There is no way, with the runner's CURRENT field semantics, to prepend a fake-binary directory onto PATH while still preserving whatever PATH entry the host actually needs to resolve `node` itself (verified this would break: this authoring sandbox's `node` lives under an nvm path, not any hardcodable /usr/bin-style default) \u2014 so a case authored to rely on that mechanism would not actually run, on this host or any other. Not fabricated; instead the .sh gap (previously zero coverage of any kind, per 0.3's deferral note) is filled with 0.3's other explicitly pre-approved option: a shellcheck-CLEAN sample script, staged as a deterministic no-op that holds identically whether shellcheck is real (clean input -> empty stdout, exit 0) or absent (`command -v` gate no-ops) \u2014 verified against the actual hook, both branches converge on `expect_no_context`. SHELLCHECK-CLEAN CLAIM SCOPE (2.5 review): neither the authoring sandbox nor the review environment had a shellcheck binary, so sample.sh's cleanliness is verified by inspection only (trivially clean POSIX: quoted echo, valid shebang, no expansions) \u2014 on CI hosts that ship shellcheck (GitHub ubuntu-latest does) the case runs it for real and the no-op determinism rests on that inspection; if shellcheck ever flags it, fix the SAMPLE, not the assertion.",
3
- "script": "post-tool/lint-changed-files.mjs",
4
- "cases": [
5
- {
6
- "name": "no-file-path-noop",
7
- "expect_no_context": true,
8
- "payload": {
9
- "tool_name": "Write",
10
- "tool_input": {}
11
- }
12
- },
13
- {
14
- "name": "file-not-found-noop",
15
- "expect_no_context": true,
16
- "payload": {
17
- "tool_name": "Write",
18
- "tool_input": {
19
- "file_path": "{{CASE_DIR}}/does-not-exist.py"
20
- }
21
- }
22
- },
23
- {
24
- "name": "python-no-linter-config-noop",
25
- "expect_no_context": true,
26
- "files": {
27
- "sample.py": "x = 1\n"
28
- },
29
- "payload": {
30
- "tool_name": "Write",
31
- "tool_input": {
32
- "file_path": "{{CASE_DIR}}/sample.py"
33
- }
34
- }
35
- },
36
- {
37
- "name": "typescript-no-eslint-config-noop",
38
- "expect_no_context": true,
39
- "files": {
40
- "sample.ts": "const x = 1;\n"
41
- },
42
- "payload": {
43
- "tool_name": "Write",
44
- "tool_input": {
45
- "file_path": "{{CASE_DIR}}/sample.ts"
46
- }
47
- }
48
- },
49
- {
50
- "name": "go-no-gomod-noop",
51
- "expect_no_context": true,
52
- "files": {
53
- "sample.go": "package main\n"
54
- },
55
- "payload": {
56
- "tool_name": "Write",
57
- "tool_input": {
58
- "file_path": "{{CASE_DIR}}/sample.go"
59
- }
60
- }
61
- },
62
- {
63
- "name": "rust-no-cargotoml-noop",
64
- "expect_no_context": true,
65
- "files": {
66
- "sample.rs": "fn main() {}\n"
67
- },
68
- "payload": {
69
- "tool_name": "Write",
70
- "tool_input": {
71
- "file_path": "{{CASE_DIR}}/sample.rs"
72
- }
73
- }
74
- },
75
- {
76
- "name": "unhandled-extension-noop",
77
- "expect_no_context": true,
78
- "files": {
79
- "sample.md": "# hi\n"
80
- },
81
- "payload": {
82
- "tool_name": "Write",
83
- "tool_input": {
84
- "file_path": "{{CASE_DIR}}/sample.md"
85
- }
86
- }
87
- },
88
- {
89
- "name": "typescript-eslint-config-present-delegate-emits-context",
90
- "_note": "Positive emit-path case (F-13, mandatory per this iteration): a real .eslintrc.json config gates the eslint branch open; the branch's command-presence gate checks 'npx' (bundled with Node, always present here), not 'eslint' (never installed in this repo). `npx --no-install eslint ...` therefore always fails to resolve eslint and surfaces a real npm/npx diagnostic on stderr \u2014 a genuine subprocess run through the real capture/wrap/emit path, not a stand-in. sample.ts is also deliberately invalid syntax so that IF a real eslint were ever reachable in some other environment, a parse error would still guarantee non-empty lint output (deterministic either way, not just deterministic in THIS sandbox's specific absence of eslint).",
91
- "expect": "allow",
92
- "expect_context": "Lint output for the file just changed:",
93
- "files": {
94
- ".eslintrc.json": "{}\n",
95
- "sample.ts": "const x = ;\n"
96
- },
97
- "payload": {
98
- "tool_name": "Write",
99
- "tool_input": {
100
- "file_path": "{{CASE_DIR}}/sample.ts"
101
- }
102
- }
103
- },
104
- {
105
- "name": "shell-shellcheck-clean-noop",
106
- "_note": "Deferred .sh/shellcheck case (from 0.3's review follow-up). The shellcheck branch has no config-file gate (command-presence only), so unlike the other extensions a 'clean case_dir' alone doesn't guarantee determinism \u2014 it depends on whether shellcheck itself is reachable, which differs between this sandbox (absent) and some CI hosts (may be preinstalled). Staged sample.sh is deliberately shellcheck-clean (correct shebang, no unquoted expansions, no deprecated constructs) so this case holds identically under EITHER a real, clean-passing shellcheck (exit 0, empty stdout -> no context) OR no shellcheck at all (command-presence gate no-ops -> no context) \u2014 see the file-level _note for why a fake-binary-via-PATH mechanism was considered and declined instead of this approach.",
107
- "expect": "allow",
108
- "expect_no_context": true,
109
- "files": {
110
- "sample.sh": "#!/bin/sh\necho \"example\"\n"
111
- },
112
- "payload": {
113
- "tool_name": "Write",
114
- "tool_input": {
115
- "file_path": "{{CASE_DIR}}/sample.sh"
116
- }
117
- }
118
- }
119
- ]
120
- }