@haposoft/cafekit 0.16.0-rc.7 → 0.16.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 (299) hide show
  1. package/README.md +116 -27
  2. package/bin/__tests__/codex-hooks-ownership.test.js +239 -0
  3. package/bin/__tests__/codex-hooks.test.js +295 -0
  4. package/bin/__tests__/codex-native.test.js +2289 -34
  5. package/bin/__tests__/develop-contract.test.js +400 -23
  6. package/bin/__tests__/installer-safety.test.js +3 -3
  7. package/bin/__tests__/optional-skill-inventory.test.js +249 -0
  8. package/bin/__tests__/output-styles.test.js +214 -0
  9. package/bin/__tests__/package-inventory.test.js +2131 -16
  10. package/bin/__tests__/runtime-schema.test.js +111 -0
  11. package/bin/__tests__/secret-output-guardrail.test.js +122 -0
  12. package/bin/__tests__/skill-routing-source.test.js +172 -0
  13. package/bin/__tests__/specs-v2-execution-closeout.test.js +1 -1
  14. package/bin/install.js +10 -0
  15. package/bin/lib/codex-install.js +170 -5
  16. package/bin/lib/context.js +14 -0
  17. package/bin/lib/i18n.js +12 -6
  18. package/bin/lib/skill-deps.js +5 -5
  19. package/bin/phases/claude-runtime.js +23 -0
  20. package/bin/phases/claude-settings.js +8 -0
  21. package/bin/phases/codex-hooks.js +156 -0
  22. package/bin/phases/codex-runtime.js +29 -38
  23. package/bin/phases/copy-payload.js +8 -2
  24. package/bin/phases/select-skill-bundles.js +96 -0
  25. package/bin/phases/skill-inventory.js +71 -0
  26. package/bin/phases/skills-setup.js +9 -2
  27. package/bin/phases/write-metadata.js +8 -5
  28. package/package.json +8 -2
  29. package/src/claude/CLAUDE.md +3 -3
  30. package/src/claude/agents/brainstormer.md +52 -69
  31. package/src/claude/agents/code-auditor.md +32 -14
  32. package/src/claude/agents/debugger.md +35 -20
  33. package/src/claude/agents/deployer.md +12 -5
  34. package/src/claude/agents/docs-keeper.md +11 -1
  35. package/src/claude/agents/implementer.md +25 -13
  36. package/src/claude/agents/inspector.md +6 -3
  37. package/src/claude/agents/project-manager.md +1 -1
  38. package/src/claude/agents/researcher.md +26 -55
  39. package/src/claude/agents/spec-maker.md +24 -13
  40. package/src/claude/agents/strategist.md +52 -0
  41. package/src/claude/agents/test-runner.md +117 -132
  42. package/src/claude/agents/ui-ux-designer.md +1 -1
  43. package/src/claude/hooks/__tests__/fixtures/statusline-default.golden +1 -0
  44. package/src/claude/hooks/__tests__/precompact.test.js +158 -0
  45. package/src/claude/hooks/__tests__/spec-gate.test.js +87 -4
  46. package/src/claude/hooks/__tests__/state.test.js +254 -3
  47. package/src/claude/hooks/__tests__/statusline.test.js +196 -0
  48. package/src/claude/hooks/agent.cjs +1 -1
  49. package/src/claude/hooks/docs-sync.cjs +12 -10
  50. package/src/claude/hooks/inspect-block.cjs +1 -1
  51. package/src/claude/hooks/lib/config.cjs +3 -0
  52. package/src/claude/hooks/lib/hook-state-dir.cjs +39 -0
  53. package/src/claude/hooks/lib/secret-keywords.cjs +42 -0
  54. package/src/claude/hooks/precompact.cjs +105 -0
  55. package/src/claude/hooks/rules.cjs +1 -1
  56. package/src/claude/hooks/secret-output-guardrail.cjs +43 -0
  57. package/src/claude/hooks/session.cjs +27 -1
  58. package/src/claude/hooks/spec-gate.cjs +3 -3
  59. package/src/claude/hooks/spec-state.cjs +32 -5
  60. package/src/claude/hooks/state.cjs +1 -1
  61. package/src/claude/hooks/task-scaffold-guard.cjs +1 -1
  62. package/src/claude/hooks/usage.cjs +1 -1
  63. package/src/claude/migration-manifest.json +29 -15
  64. package/src/claude/output-styles/coding-level-0-eli5.md +103 -0
  65. package/src/claude/output-styles/coding-level-1-junior.md +124 -0
  66. package/src/claude/output-styles/coding-level-2-mid.md +146 -0
  67. package/src/claude/output-styles/coding-level-3-senior.md +148 -0
  68. package/src/claude/output-styles/coding-level-4-lead.md +159 -0
  69. package/src/claude/output-styles/coding-level-5-god.md +91 -0
  70. package/src/claude/references/debugger/core-philosophy.md +5 -3
  71. package/src/claude/references/debugger/frontend-verification.md +2 -2
  72. package/src/claude/references/debugger/log-ci-analysis.md +13 -1
  73. package/src/claude/references/debugger/parallel-agent-hydration.md +19 -34
  74. package/src/claude/references/debugger/performance-diagnostics.md +2 -2
  75. package/src/claude/references/debugger/root-cause-tracing.md +37 -6
  76. package/src/claude/references/debugger/side-effect-gate.md +3 -1
  77. package/src/claude/references/debugger/verification-protocol.md +13 -12
  78. package/src/claude/rules/orchestrator.md +7 -1
  79. package/src/claude/rules/process-management.md +39 -0
  80. package/src/claude/rules/review-audit-self-decision.md +48 -0
  81. package/src/claude/rules/skill-domain-routing.md +26 -24
  82. package/src/claude/rules/skill-workflow-routing.md +22 -14
  83. package/src/claude/rules/workflow.md +3 -3
  84. package/src/claude/runtime.json +1 -0
  85. package/src/claude/runtime.schema.json +205 -0
  86. package/src/claude/scripts/generate-skill-catalog.cjs +156 -122
  87. package/src/claude/scripts/provenance.cjs +18 -5
  88. package/src/claude/scripts/spec-receipt.cjs +76 -21
  89. package/src/claude/scripts/spec-resolver.cjs +144 -4
  90. package/src/claude/scripts/workflow-policy.cjs +1 -1
  91. package/src/claude/settings/settings.json +16 -0
  92. package/src/claude/skills/agent-browser/SKILL.md +1 -1
  93. package/src/claude/skills/ai-multimodal/SKILL.md +1 -1
  94. package/src/claude/skills/brainstorm/SKILL.md +193 -172
  95. package/src/claude/skills/brainstorm/references/question-framework.md +105 -167
  96. package/src/claude/skills/chrome-devtools/SKILL.md +1 -1
  97. package/src/claude/skills/code-review/SKILL.md +43 -25
  98. package/src/claude/skills/code-review/references/spec-compliance-review.md +3 -4
  99. package/src/claude/skills/code-review/references/verification-gate.md +1 -1
  100. package/src/claude/skills/debug/SKILL.md +48 -19
  101. package/src/claude/skills/delegate/SKILL.md +1 -1
  102. package/src/claude/skills/develop/SKILL.md +92 -65
  103. package/src/claude/skills/develop/references/parallel-waves.md +36 -63
  104. package/src/claude/skills/develop/references/quality-gate.md +31 -4
  105. package/src/claude/skills/develop/references/subagent-patterns.md +21 -7
  106. package/src/claude/skills/docs/SKILL.md +42 -23
  107. package/src/claude/skills/docs/references/init-workflow.md +4 -4
  108. package/src/claude/skills/docs/references/reconstruct-workflow.md +6 -6
  109. package/src/claude/skills/docs/references/standard-docs-workflow.md +6 -2
  110. package/src/claude/skills/docs/references/summarize-workflow.md +2 -2
  111. package/src/claude/skills/docs/references/update-workflow.md +9 -7
  112. package/src/claude/skills/docs/templates/requirements-as-is.md +1 -1
  113. package/src/claude/skills/docx/SKILL.md +1 -1
  114. package/src/claude/skills/git/SKILL.md +1 -1
  115. package/src/claude/skills/git/references/commit-protocols.md +1 -1
  116. package/src/claude/skills/git/references/finish-branch.md +1 -1
  117. package/src/claude/skills/hotfix/SKILL.md +159 -170
  118. package/src/claude/skills/hotfix/references/diagnosis-protocol.md +14 -9
  119. package/src/claude/skills/hotfix/references/parallel-patterns.md +27 -13
  120. package/src/claude/skills/hotfix/references/prevention-gate.md +5 -0
  121. package/src/claude/skills/hotfix/references/review-cycle.md +21 -15
  122. package/src/claude/skills/hotfix/references/workflow-specialized.md +53 -21
  123. package/src/claude/skills/inspect/SKILL.md +55 -46
  124. package/src/claude/skills/inspect/references/internal-inspection.md +21 -5
  125. package/src/claude/skills/loop/SKILL.md +114 -0
  126. package/src/claude/skills/loop/references/bounded-loop-protocol.md +104 -0
  127. package/src/claude/skills/loop/references/metric-and-guard-contract.md +76 -0
  128. package/src/claude/skills/pdf/SKILL.md +1 -1
  129. package/src/claude/skills/pptx/SKILL.md +1 -1
  130. package/src/claude/skills/question/SKILL.md +16 -13
  131. package/src/claude/skills/research/SKILL.md +70 -43
  132. package/src/claude/skills/route/SKILL.md +94 -0
  133. package/src/claude/skills/route/references/agent-timing.md +46 -0
  134. package/src/claude/skills/route/references/chaining-patterns.md +53 -0
  135. package/src/claude/skills/route/references/task-taxonomy.md +48 -0
  136. package/src/claude/skills/specs/SKILL.md +48 -57
  137. package/src/claude/skills/specs/references/review.md +26 -8
  138. package/src/claude/skills/specs/references/templates.md +76 -31
  139. package/src/claude/skills/specs/templates/requirements-init.md +1 -1
  140. package/src/claude/skills/specs/templates/research.md +2 -2
  141. package/src/claude/skills/sync/SKILL.md +6 -6
  142. package/src/claude/skills/sync/references/sync-protocols.md +1 -1
  143. package/src/claude/skills/test/SKILL.md +120 -120
  144. package/src/claude/skills/test/references/execution-strategy.md +208 -361
  145. package/src/claude/skills/test/references/failure-triage.md +55 -121
  146. package/src/claude/skills/test/references/test-memory.md +20 -34
  147. package/src/claude/skills/ui-ux-pro-max/SKILL.md +1 -1
  148. package/src/claude/skills/web-testing/SKILL.md +1 -1
  149. package/src/claude/skills/xlsx/SKILL.md +1 -1
  150. package/src/claude/status.cjs +135 -33
  151. package/src/codex/AGENTS.md +14 -4
  152. package/src/codex/hooks/docs-sync.cjs +8 -3
  153. package/src/codex/hooks/lib/hook-context.cjs +18 -4
  154. package/src/codex/hooks/rules.cjs +29 -1
  155. package/src/codex/hooks/secret-output-guardrail.cjs +30 -0
  156. package/src/codex/hooks/spec-gate.cjs +3 -8
  157. package/src/codex/hooks/spec-state.cjs +34 -5
  158. package/src/codex/hooks.json +5 -0
  159. package/src/codex/runtime.json +2 -0
  160. package/src/common/.env.example +1 -1
  161. package/src/claude/skills/backend-development/SKILL.md +0 -101
  162. package/src/claude/skills/backend-development/references/backend-api-design.md +0 -495
  163. package/src/claude/skills/backend-development/references/backend-architecture.md +0 -454
  164. package/src/claude/skills/backend-development/references/backend-authentication.md +0 -338
  165. package/src/claude/skills/backend-development/references/backend-code-quality.md +0 -659
  166. package/src/claude/skills/backend-development/references/backend-debugging.md +0 -904
  167. package/src/claude/skills/backend-development/references/backend-devops.md +0 -491
  168. package/src/claude/skills/backend-development/references/backend-mindset.md +0 -387
  169. package/src/claude/skills/backend-development/references/backend-performance.md +0 -397
  170. package/src/claude/skills/backend-development/references/backend-security.md +0 -342
  171. package/src/claude/skills/backend-development/references/backend-technologies.md +0 -256
  172. package/src/claude/skills/backend-development/references/backend-testing.md +0 -429
  173. package/src/claude/skills/devops/.env.example +0 -76
  174. package/src/claude/skills/devops/SKILL.md +0 -102
  175. package/src/claude/skills/devops/references/browser-rendering.md +0 -305
  176. package/src/claude/skills/devops/references/cloudflare-d1-kv.md +0 -123
  177. package/src/claude/skills/devops/references/cloudflare-platform.md +0 -271
  178. package/src/claude/skills/devops/references/cloudflare-r2-storage.md +0 -280
  179. package/src/claude/skills/devops/references/cloudflare-workers-advanced.md +0 -312
  180. package/src/claude/skills/devops/references/cloudflare-workers-apis.md +0 -309
  181. package/src/claude/skills/devops/references/cloudflare-workers-basics.md +0 -418
  182. package/src/claude/skills/devops/references/docker-basics.md +0 -297
  183. package/src/claude/skills/devops/references/docker-compose.md +0 -292
  184. package/src/claude/skills/devops/references/gcloud-platform.md +0 -297
  185. package/src/claude/skills/devops/references/gcloud-services.md +0 -304
  186. package/src/claude/skills/devops/references/kubernetes-basics.md +0 -95
  187. package/src/claude/skills/devops/references/kubernetes-helm-advanced.md +0 -70
  188. package/src/claude/skills/devops/references/kubernetes-helm.md +0 -81
  189. package/src/claude/skills/devops/references/kubernetes-kubectl.md +0 -74
  190. package/src/claude/skills/devops/references/kubernetes-security-advanced.md +0 -94
  191. package/src/claude/skills/devops/references/kubernetes-security.md +0 -89
  192. package/src/claude/skills/devops/references/kubernetes-troubleshooting-advanced.md +0 -74
  193. package/src/claude/skills/devops/references/kubernetes-troubleshooting.md +0 -49
  194. package/src/claude/skills/devops/references/kubernetes-workflows-advanced.md +0 -75
  195. package/src/claude/skills/devops/references/kubernetes-workflows.md +0 -76
  196. package/src/claude/skills/devops/scripts/cloudflare_deploy.py +0 -269
  197. package/src/claude/skills/devops/scripts/docker_optimize.py +0 -332
  198. package/src/claude/skills/devops/scripts/requirements.txt +0 -20
  199. package/src/claude/skills/devops/scripts/tests/requirements.txt +0 -3
  200. package/src/claude/skills/devops/scripts/tests/test_cloudflare_deploy.py +0 -285
  201. package/src/claude/skills/devops/scripts/tests/test_docker_optimize.py +0 -436
  202. package/src/claude/skills/frontend-design/SKILL.md +0 -135
  203. package/src/claude/skills/frontend-design/references/ai-multimodal-overview.md +0 -165
  204. package/src/claude/skills/frontend-design/references/analysis-best-practices.md +0 -80
  205. package/src/claude/skills/frontend-design/references/analysis-prompts.md +0 -141
  206. package/src/claude/skills/frontend-design/references/analysis-techniques.md +0 -118
  207. package/src/claude/skills/frontend-design/references/animejs.md +0 -396
  208. package/src/claude/skills/frontend-design/references/anti-slop-rules.md +0 -103
  209. package/src/claude/skills/frontend-design/references/asset-generation.md +0 -337
  210. package/src/claude/skills/frontend-design/references/bento-motion-engine.md +0 -142
  211. package/src/claude/skills/frontend-design/references/design-extraction-overview.md +0 -71
  212. package/src/claude/skills/frontend-design/references/extraction-best-practices.md +0 -141
  213. package/src/claude/skills/frontend-design/references/extraction-output-templates.md +0 -162
  214. package/src/claude/skills/frontend-design/references/extraction-prompts.md +0 -127
  215. package/src/claude/skills/frontend-design/references/magicui-components.md +0 -129
  216. package/src/claude/skills/frontend-design/references/performance-guardrails.md +0 -169
  217. package/src/claude/skills/frontend-design/references/premium-design-patterns.md +0 -93
  218. package/src/claude/skills/frontend-design/references/redesign-audit-checklist.md +0 -114
  219. package/src/claude/skills/frontend-design/references/technical-accessibility.md +0 -119
  220. package/src/claude/skills/frontend-design/references/technical-best-practices.md +0 -97
  221. package/src/claude/skills/frontend-design/references/technical-optimization.md +0 -44
  222. package/src/claude/skills/frontend-design/references/technical-overview.md +0 -90
  223. package/src/claude/skills/frontend-design/references/technical-workflows.md +0 -150
  224. package/src/claude/skills/frontend-design/references/visual-analysis-overview.md +0 -95
  225. package/src/claude/skills/frontend-design/references/workflow-3d.md +0 -102
  226. package/src/claude/skills/frontend-design/references/workflow-describe.md +0 -87
  227. package/src/claude/skills/frontend-design/references/workflow-immersive.md +0 -87
  228. package/src/claude/skills/frontend-design/references/workflow-quick.md +0 -57
  229. package/src/claude/skills/frontend-design/references/workflow-screenshot.md +0 -63
  230. package/src/claude/skills/frontend-design/references/workflow-video.md +0 -74
  231. package/src/claude/skills/frontend-development/SKILL.md +0 -406
  232. package/src/claude/skills/frontend-development/resources/common-patterns.md +0 -331
  233. package/src/claude/skills/frontend-development/resources/complete-examples.md +0 -872
  234. package/src/claude/skills/frontend-development/resources/component-patterns.md +0 -502
  235. package/src/claude/skills/frontend-development/resources/data-fetching.md +0 -767
  236. package/src/claude/skills/frontend-development/resources/file-organization.md +0 -502
  237. package/src/claude/skills/frontend-development/resources/loading-and-error-states.md +0 -501
  238. package/src/claude/skills/frontend-development/resources/performance.md +0 -406
  239. package/src/claude/skills/frontend-development/resources/routing-guide.md +0 -364
  240. package/src/claude/skills/frontend-development/resources/styling-guide.md +0 -428
  241. package/src/claude/skills/frontend-development/resources/typescript-standards.md +0 -418
  242. package/src/claude/skills/mobile-development/SKILL.md +0 -218
  243. package/src/claude/skills/mobile-development/references/mobile-android.md +0 -604
  244. package/src/claude/skills/mobile-development/references/mobile-best-practices.md +0 -544
  245. package/src/claude/skills/mobile-development/references/mobile-debugging.md +0 -1089
  246. package/src/claude/skills/mobile-development/references/mobile-frameworks.md +0 -465
  247. package/src/claude/skills/mobile-development/references/mobile-ios.md +0 -496
  248. package/src/claude/skills/mobile-development/references/mobile-mindset.md +0 -542
  249. package/src/claude/skills/react-best-practices/AGENTS.md +0 -2249
  250. package/src/claude/skills/react-best-practices/README.md +0 -123
  251. package/src/claude/skills/react-best-practices/SKILL.md +0 -128
  252. package/src/claude/skills/react-best-practices/metadata.json +0 -15
  253. package/src/claude/skills/react-best-practices/rules/_sections.md +0 -46
  254. package/src/claude/skills/react-best-practices/rules/_template.md +0 -28
  255. package/src/claude/skills/react-best-practices/rules/advanced-event-handler-refs.md +0 -55
  256. package/src/claude/skills/react-best-practices/rules/advanced-use-latest.md +0 -49
  257. package/src/claude/skills/react-best-practices/rules/async-api-routes.md +0 -38
  258. package/src/claude/skills/react-best-practices/rules/async-defer-await.md +0 -80
  259. package/src/claude/skills/react-best-practices/rules/async-dependencies.md +0 -36
  260. package/src/claude/skills/react-best-practices/rules/async-parallel.md +0 -28
  261. package/src/claude/skills/react-best-practices/rules/async-suspense-boundaries.md +0 -99
  262. package/src/claude/skills/react-best-practices/rules/bundle-barrel-imports.md +0 -59
  263. package/src/claude/skills/react-best-practices/rules/bundle-conditional.md +0 -31
  264. package/src/claude/skills/react-best-practices/rules/bundle-defer-third-party.md +0 -49
  265. package/src/claude/skills/react-best-practices/rules/bundle-dynamic-imports.md +0 -35
  266. package/src/claude/skills/react-best-practices/rules/bundle-preload.md +0 -50
  267. package/src/claude/skills/react-best-practices/rules/client-event-listeners.md +0 -74
  268. package/src/claude/skills/react-best-practices/rules/client-swr-dedup.md +0 -56
  269. package/src/claude/skills/react-best-practices/rules/js-batch-dom-css.md +0 -82
  270. package/src/claude/skills/react-best-practices/rules/js-cache-function-results.md +0 -80
  271. package/src/claude/skills/react-best-practices/rules/js-cache-property-access.md +0 -28
  272. package/src/claude/skills/react-best-practices/rules/js-cache-storage.md +0 -70
  273. package/src/claude/skills/react-best-practices/rules/js-combine-iterations.md +0 -32
  274. package/src/claude/skills/react-best-practices/rules/js-early-exit.md +0 -50
  275. package/src/claude/skills/react-best-practices/rules/js-hoist-regexp.md +0 -45
  276. package/src/claude/skills/react-best-practices/rules/js-index-maps.md +0 -37
  277. package/src/claude/skills/react-best-practices/rules/js-length-check-first.md +0 -49
  278. package/src/claude/skills/react-best-practices/rules/js-min-max-loop.md +0 -82
  279. package/src/claude/skills/react-best-practices/rules/js-set-map-lookups.md +0 -24
  280. package/src/claude/skills/react-best-practices/rules/js-tosorted-immutable.md +0 -57
  281. package/src/claude/skills/react-best-practices/rules/rendering-activity.md +0 -26
  282. package/src/claude/skills/react-best-practices/rules/rendering-animate-svg-wrapper.md +0 -47
  283. package/src/claude/skills/react-best-practices/rules/rendering-conditional-render.md +0 -40
  284. package/src/claude/skills/react-best-practices/rules/rendering-content-visibility.md +0 -38
  285. package/src/claude/skills/react-best-practices/rules/rendering-hoist-jsx.md +0 -46
  286. package/src/claude/skills/react-best-practices/rules/rendering-hydration-no-flicker.md +0 -82
  287. package/src/claude/skills/react-best-practices/rules/rendering-svg-precision.md +0 -28
  288. package/src/claude/skills/react-best-practices/rules/rerender-defer-reads.md +0 -39
  289. package/src/claude/skills/react-best-practices/rules/rerender-dependencies.md +0 -45
  290. package/src/claude/skills/react-best-practices/rules/rerender-derived-state.md +0 -29
  291. package/src/claude/skills/react-best-practices/rules/rerender-functional-setstate.md +0 -74
  292. package/src/claude/skills/react-best-practices/rules/rerender-lazy-state-init.md +0 -58
  293. package/src/claude/skills/react-best-practices/rules/rerender-memo.md +0 -44
  294. package/src/claude/skills/react-best-practices/rules/rerender-transitions.md +0 -40
  295. package/src/claude/skills/react-best-practices/rules/server-after-nonblocking.md +0 -73
  296. package/src/claude/skills/react-best-practices/rules/server-cache-lru.md +0 -41
  297. package/src/claude/skills/react-best-practices/rules/server-cache-react.md +0 -26
  298. package/src/claude/skills/react-best-practices/rules/server-parallel-fetching.md +0 -79
  299. package/src/claude/skills/react-best-practices/rules/server-serialization.md +0 -38
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: hapo:test
2
+ name: cf:test
3
3
  description: "Execute the smallest adequate verification scope and own the canonical execution proof."
4
4
  user-invocable: true
5
5
  when_to_use: "Use after implementation, for a feature scope, or for an explicit test request."
@@ -12,174 +12,174 @@ metadata:
12
12
  ---
13
13
  # Test — execution proof owner
14
14
 
15
- `hapo:test` is the sole owner of canonical execution proof. It runs real
16
- commands, records what ran, and emits the receipt consumed by closeout and
17
- review. Review may consume that receipt but must not run tests, create a second
18
- receipt, or claim execution proof.
15
+ `cf:test` executes the smallest adequate real verification and owns the
16
+ canonical execution result. For process-first work it returns one typed proof
17
+ handoff to the controller; it never writes task state or the inline Receipt.
18
+ Review consumes validated proof and never invents or duplicates execution.
19
19
 
20
20
  ## Usage
21
21
 
22
22
  ```text
23
- /hapo:test
24
- /hapo:test --full
25
- /hapo:test <scope-or-path>
26
- /hapo:test <feature-name>
27
- /hapo:test specs/<feature>
28
- /hapo:test --ui <url>
29
- /hapo:test --ui-auth <url>
30
- /hapo:test --ui-flow <url>
23
+ /cf:test
24
+ /cf:test --full
25
+ /cf:test <scope-or-path>
26
+ /cf:test <feature-name>
27
+ /cf:test specs/<feature>
28
+ /cf:test specs/<feature>/task-NN-<slug>.md
29
+ /cf:test --ui <url>
30
+ /cf:test --ui-auth <url>
31
+ /cf:test --ui-flow <url>
31
32
  ```
32
33
 
33
34
  ## Hard gates
34
35
 
35
- - Never claim a pass without executing the relevant command.
36
- - Never mock, stub, delete, weaken, or skip a failing assertion to obtain green.
37
- - A missing runner, missing required command, or zero executed tests is not
38
- `PASS`; report the blocker and keep closeout unfinished.
39
- - A compile/typecheck failure is a precheck failure even if no test command is
40
- available.
41
- - Preserve the exact command, exit result, provenance, and artifact hashes
42
- required by the canonical receipt schema.
36
+ - Never claim a pass without executing the exact relevant command.
37
+ - Never mock, weaken, delete, or skip a failing assertion to obtain green.
38
+ - Missing tooling, a missing command, nonzero exit, or zero executed tests is
39
+ never `PASS`. Do not auto-install project-local tooling during proof.
40
+ - Preserve exact commands, counts, output, reachability, proof level, Base,
41
+ Head, artifact hashes, and redaction labels.
42
+ - Source, installed, and live proof are distinct. Live adherence is
43
+ `[UNVERIFIED]` without a host invocation.
44
+ - Use only `PASS | PASS_WITH_WARNINGS | FAIL | BLOCKED`. Unknown, malformed,
45
+ partial, contradictory, duplicate, skipped, or stale proof fails closed.
43
46
 
44
- ## Scope and policy
47
+ ## Target routing
45
48
 
46
- For a feature target, load `spec.json`, `requirements.md`, `design.md`, and
47
- the active task's exact seven v2.1 sections and typed coordination boundaries
48
- when that target exists. Compare actual execution against
49
- `scope_lock`, contracts, completion criteria, runtime reachability, and
50
- negative-path obligations.
49
+ Classify current filesystem bytes before selecting tests. Use `lstat` so broken
50
+ links count as markers. Never migrate or repair packet state while testing.
51
51
 
52
- Choose depth from `assurance_level`, risk, and blast radius. Lane is derived:
53
-
54
- - Direct: targeted commands and diff/runtime self-check;
55
- - Standard: bounded affected suite and feature receipt;
56
- - Critical: strict commands plus the independent evidence required by the
57
- persisted obligations.
52
+ | Observed state | Route |
53
+ |---|---|
54
+ | Valid regular `plan.md` with `Specs-Contract: process-first-ready-v1`, one or more valid regular flat `task-NN-*.md`, and no legacy marker | Process-first |
55
+ | Any flat marker that is orphaned, malformed, duplicated, symlinked, nonregular, or mixed with a legacy marker | `BLOCKED` |
56
+ | Valid regular legacy root resolving every nested task and separate receipt, with no flat marker | Legacy adapter |
57
+ | Orphan, malformed, symlinked, nonregular, identity-conflicting, or mixed legacy state | `BLOCKED` |
58
+ | No flat or legacy marker | Ordinary non-Spec testing |
58
59
 
59
- Do not infer depth from file count or from the legacy `execution_tier`. That
60
- field is a read-only compatibility adapter. A task bundle is not required for a
61
- small Standard feature.
60
+ A flat marker is a direct-child `plan.md` or `task-NN-*.md`. A legacy marker is
61
+ `spec.json`, a nested legacy task, or a separate legacy receipt. See
62
+ `references/execution-strategy.md` for the complete validation truth table.
62
63
 
63
64
  ## Spec-Aware Mode
64
65
 
65
66
  <SCOPE-GATE>
66
- For a feature target, test only the active scope, requirements, completion
67
- criteria, and reachable runtime surfaces. A missing or orphaned runtime surface
68
- is a failure even when the command exits successfully.
67
+ For a feature target, test only current accepted scope, the active task's exact
68
+ Verification Plan, and reachable runtime surfaces. Missing or orphaned
69
+ reachability fails even when a command exits successfully.
69
70
  </SCOPE-GATE>
70
71
 
71
- Use blast-radius selection by default; `--full` overrides selection, not proof
72
- requirements. Use UI checks only when a reachable UI surface is in scope.
72
+ For a process-first feature:
73
+
74
+ 1. Read current `plan.md` and flat task bytes. Select only a contained regular
75
+ task whose dependencies allow proof.
76
+ 2. Use the task's exact `Command`, exact unique `Named probes`, `Reachability`,
77
+ `Oracle`, `Counterexample`, required proof level, and artifact declaration.
78
+ 3. Run the smallest adequate proof. `--full` expands scope but cannot weaken
79
+ the Verification Plan or substitute unrelated green tests.
80
+ 4. Return exactly one canonical `test-proof-v1` object. Do not edit `plan.md`,
81
+ `Status:`, the task's `## Receipt`, or any sibling task.
82
+ 5. The Develop controller validates the payload, recomputes its digest, checks
83
+ current provenance, and alone writes process-first Status and inline Receipt.
73
84
 
74
85
  ## Execution
75
86
 
76
- 1. Detect the project runner and exact commands from repository files and task
77
- evidence. Do not invent commands.
78
- 2. Run a cheap compile/typecheck precheck where the project provides one.
79
- 3. Execute the smallest adequate unit, integration, UI, E2E, accessibility,
80
- performance, or security proof for the changed surface.
81
- 4. Inspect runtime reachability and declared artifacts when the task creates
82
- runtime-facing or generated output.
83
- 5. Preserve raw outcomes and, only after real execution, write one canonical
84
- receipt. For a task use `receipts/<task-basename>.md`; never append execution
85
- evidence to the task plan. A receipt must not contain secrets or placeholder
86
- provenance.
87
+ 1. Detect commands from task and repository files; never invent them.
88
+ 2. Run a cheap compile or typecheck precheck when the project provides one.
89
+ 3. Execute the exact task command and all named probes with real counts.
90
+ 4. Inspect negative paths, runtime reachability, and declared artifacts.
91
+ 5. Capture tracked, untracked, and ignored project-command drift separately
92
+ from runtime Head. Never silently clean or hide project changes.
93
+ 6. Redact sensitive material, validate the complete proof object, then return a
94
+ concise human report separately from the machine handoff.
87
95
 
88
- Required proof type follows the behavior, not ceremony:
96
+ Required proof follows the behavior:
89
97
 
90
98
  | Surface | Adequate proof |
91
99
  |---|---|
92
100
  | pure logic/parser/validator | unit plus negative path |
93
- | stateful UI or module wiring | component/integration and mounted path |
101
+ | stateful UI or module wiring | component/integration plus mounted path |
94
102
  | API, persistence, provider, or process boundary | real contract/state handoff |
95
103
  | complete user workflow | E2E or UI flow |
96
- | layout or responsive behavior | viewport/visual check |
97
- | interactive focus/labels/keyboard | accessibility check |
104
+ | layout, focus, labels, keyboard | viewport/visual/accessibility check |
98
105
  | regression | reproduction before fix plus passing regression |
99
106
  | security/performance | only when requirement, risk, or boundary requires it |
100
107
 
101
- ## Canonical receipt
102
-
103
- The receipt is execution evidence, not a status marker. It must contain the
104
- task identity and canonical `tasks/task-*.md` path for task receipts, the actual
105
- command, a successful exit/result, expected versus observed behavior, applicable
106
- negative-path and reachability proof, both provenance anchors (`Base` and
107
- `Head`, or their canonical aliases), and any declared artifact SHA-256. Reject
108
- `Exit: 1`, conflicting outcomes, empty commands, placeholders, missing
109
- provenance, zero execution, and failure summaries. No-artifact tasks remain
110
- compatible; declared artifacts require hashes.
111
-
112
- Closeout and flash callers must also provide an explicit runtime binding; a
113
- valid-length `Base`/`Head` pair alone is not identity proof. The minimal adapter
114
- contract is `const binding = policy.createReceiptBinding({ base, head })`, then
115
- pass `receipt_binding: binding` to `completionDecision` or include the binding's
116
- `expectedProvenance` in the flash task. The policy requires that binding and
117
- compares both receipt anchors before completion or flash promotion.
118
-
119
- For a normal closeout, emit a receipt that the shared policy validator accepts.
120
- Legacy task `## Evidence` remains readable, but prefer the separate receipt. If
121
- both exist and their proof identities conflict, report `FAIL` and do not choose
122
- one. After all task receipts pass, execute final integration and create
123
- `feature-receipt.md` exactly once. Taskless Compact/Full specs create that file
124
- only at final closeout; absence before closeout is normal.
125
- For `--flash`, emit proof for the current `FLASH_UNVERIFIED` task only. Only explicit trusted sync-finalize may promote it. The
126
- receipt may make the task eligible for trusted sync-finalize, but it must not
127
- promote the task, unblock dependents, or fabricate a done state.
108
+ ## Process-first proof handoff
128
109
 
129
- ## Verdict and handoff
110
+ The machine payload is canonical UTF-8 JSON with exact top-level keys:
130
111
 
131
- The shared workflow surface is:
132
-
133
- `PASS | PASS_WITH_WARNINGS | FAIL | BLOCKED`
112
+ ```text
113
+ schema_version, target, verdict, command, exit, counts, provenance,
114
+ proof_level, expected, observed, reachability, artifacts, branches,
115
+ raw_output, redactions, payload_sha256
116
+ ```
134
117
 
135
- Warnings describe residual, non-blocking concerns; they never replace missing
136
- execution proof. A legacy diagnostic result such as `NO_TESTS` is normalized by
137
- the shared adapter to an unfinished outcome and is never treated as `PASS`.
118
+ `schema_version` is exactly `test-proof-v1`; unknown keys block. Branch IDs map
119
+ one-to-one to exact unique Named probes. The digest is lowercase SHA-256 of
120
+ stable JSON excluding only `payload_sha256`. Exact field shapes, nullable
121
+ pre-execution `BLOCKED` rules, and aggregation live in
122
+ `references/execution-strategy.md`.
123
+
124
+ Only all required branches passing with exact command, exit 0, executed > 0,
125
+ failed/skipped 0, matching Base/Head, `reachability.status: PASS`, valid artifact
126
+ hashes, and safe redaction can aggregate `PASS`. Aggregate in this order:
127
+ `FAIL` > `BLOCKED` > `PASS_WITH_WARNINGS` > `PASS`.
128
+
129
+ ## Persistent-write and authentication boundary
130
+
131
+ - `.hapo/test-memory.json` is optional read-only context. Hash absent/present
132
+ bytes before and after; never create, merge, or update it during proof.
133
+ - Put only Test-owned temporary files outside the project and clean them.
134
+ Never create Test-owned reports, caches, lazy installs, or auth state.
135
+ - For authenticated UI proof, prefer the project's own auth helper. Otherwise
136
+ use only an explicitly selected user-controlled profile bound to a confirmed
137
+ HTTPS or localhost origin, identity, permissions, and action scope.
138
+ - Block cross-origin redirects and destructive production actions without fresh
139
+ consent. Never ask for, export, paste, or persist cookies or tokens.
140
+ - Redact Authorization, Cookie, Set-Cookie, session tokens, credentials, and
141
+ scoped PII from commands, headers/bodies, logs, screenshots, and reports.
142
+ If safe proof is impossible, return `BLOCKED`.
143
+
144
+ ## Verdict and report
138
145
 
139
146
  ```markdown
140
147
  ## Test Verdict
141
148
 
142
149
  **Status:** PASS | PASS_WITH_WARNINGS | FAIL | BLOCKED
143
- **Scope:** [target and selection]
144
- **Commands:** [exact commands]
150
+ **Scope:** [target and selected proof]
151
+ **Commands:** [exact redacted commands]
145
152
  **Exit:** [actual result]
146
- **Duration:** [measured time]
147
- **Receipt:** [path or inline canonical receipt]
148
153
 
149
154
  ### Results
150
155
  - Passed: N | Failed: N | Skipped: N | Executed: N
151
-
152
- ### Scope / reachability
153
- - Requirements: [covered/uncovered]
154
- - Runtime reachability: PASS | FAIL | BLOCKED
155
- - Artifact/provenance checks: PASS | FAIL | BLOCKED
156
+ - Reachability: PASS | FAIL | BLOCKED
157
+ - Proof level: source | installed | live
158
+ - Project-command drift: [tracked/untracked/ignored, or none]
156
159
 
157
160
  ### Action
158
- - PASS → give the receipt to the single closeout owner; only literal `PASS` can
159
- complete a task.
160
- - PASS_WITH_WARNINGS → give the receipt to the closeout owner, but keep the
161
- task unfinished until a literal `PASS` decision is recorded.
162
- - FAIL → list exact failures; implementation remains unfinished.
163
- - BLOCKED → state the changed prerequisite; do not blind-retry.
161
+ - [controller handoff, exact failure, or changed prerequisite]
164
162
  ```
165
163
 
166
- The closeout owner calls this workflow once for the current task or feature.
167
- Do not trigger review from inside the test workflow and do not run a duplicate
168
- test pass merely because review is requested. Review evaluates correctness,
169
- security, and spec compliance against this proof.
164
+ Do not place the full JSON payload, secrets, verbose raw logs, or screenshots in
165
+ the concise report. `PASS_WITH_WARNINGS` remains unfinished; only literal
166
+ validated `PASS` may be synchronized by the controller.
167
+
168
+ ## Legacy workflow compatibility
170
169
 
171
- ## Flash proof
170
+ A valid legacy packet keeps the v2.1 adapter, legacy task resolution, and its
171
+ separate receipt path. Do not write process-first inline proof into it. If
172
+ legacy proof identities conflict or the packet is mixed/malformed, return
173
+ `BLOCKED`; never choose one source or migrate it during unrelated testing.
172
174
 
173
- When the target contains an in-progress `FLASH_UNVERIFIED` task, test only its
174
- exact Verification Plan and reachability obligations. On pass, keep the task
175
- `in_progress`, keep `FLASH_UNVERIFIED`, `dependencyBlocked: true`, and
176
- `unblocks: false`; return canonical proof to trusted sync-finalize. On failure,
177
- blocker, or no tests, do not promote any task.
175
+ Flash legacy behavior remains proof-only: testing may make a current
176
+ `FLASH_UNVERIFIED` task eligible for trusted sync-finalize, but never promotes
177
+ state or unblocks dependents itself. Only explicit trusted sync-finalize may
178
+ promote it.
178
179
 
179
180
  ## References
180
181
 
181
- - `references/execution-strategy.md` — blast-radius and UI selection, loaded
182
- only when the default strategy needs detail.
183
- - `references/failure-triage.md` — failure classification, loaded on failure.
184
- - `references/test-memory.md` — optional historical context; current receipt
185
- evidence always wins.
182
+ - `references/execution-strategy.md` — routing, payload schema, aggregation,
183
+ blast radius, UI safety, and report separation.
184
+ - `references/failure-triage.md` — failure classification and four verdicts.
185
+ - `references/test-memory.md` — optional read-only historical context.