@haposoft/cafekit 0.16.7 → 0.18.1

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 (231) hide show
  1. package/README.md +14 -22
  2. package/bin/__tests__/codex-hooks-ownership.test.js +2 -2
  3. package/bin/__tests__/codex-hooks.test.js +169 -272
  4. package/bin/__tests__/codex-native.test.js +100 -202
  5. package/bin/__tests__/develop-contract.test.js +122 -1413
  6. package/bin/__tests__/docs-sync-on-demand.test.js +93 -0
  7. package/bin/__tests__/grok-envelope.test.js +0 -56
  8. package/bin/__tests__/hook-payload.test.js +4 -6
  9. package/bin/__tests__/legacy-authority-decoupled.test.js +154 -0
  10. package/bin/__tests__/legacy-hooks-retired.test.js +221 -0
  11. package/bin/__tests__/omp-bridge.test.js +20 -17
  12. package/bin/__tests__/omp-hooks.test.js +0 -19
  13. package/bin/__tests__/optional-skill-inventory.test.js +112 -4
  14. package/bin/__tests__/orca-session.test.js +0 -2
  15. package/bin/__tests__/package-inventory.test.js +90 -925
  16. package/bin/__tests__/runtime-dir.test.js +0 -3
  17. package/bin/__tests__/runtime-schema.test.js +3 -2
  18. package/bin/__tests__/skill-routing-source.test.js +27 -15
  19. package/bin/__tests__/spec-narrowing.test.js +30 -161
  20. package/bin/__tests__/specs-v2-execution-closeout.test.js +0 -437
  21. package/bin/__tests__/test-runtime-dependency-closure.cjs +1 -2
  22. package/bin/__tests__/ui-ux-skill.test.js +101 -0
  23. package/bin/__tests__/usage-hook-retired.test.js +114 -0
  24. package/bin/__tests__/validator-grounding.test.js +18 -2949
  25. package/bin/lib/managed-writer.js +2 -3
  26. package/bin/phases/codex-runtime.js +27 -0
  27. package/bin/phases/copy-payload.js +13 -28
  28. package/bin/phases/omp-runtime.js +25 -0
  29. package/package.json +2 -3
  30. package/src/claude/CLAUDE.md +3 -10
  31. package/src/claude/agents/brainstormer.md +7 -3
  32. package/src/claude/agents/code-auditor.md +44 -56
  33. package/src/claude/agents/debugger.md +8 -88
  34. package/src/claude/agents/deployer.md +3 -5
  35. package/src/claude/agents/docs-keeper.md +6 -14
  36. package/src/claude/agents/git-ops.md +2 -4
  37. package/src/claude/agents/implementer.md +12 -16
  38. package/src/claude/agents/inspector.md +4 -3
  39. package/src/claude/agents/project-manager.md +9 -17
  40. package/src/claude/agents/researcher.md +9 -3
  41. package/src/claude/agents/spec-maker.md +15 -15
  42. package/src/claude/agents/test-runner.md +8 -11
  43. package/src/claude/agents/ui-ux-designer.md +0 -1
  44. package/src/claude/hooks/__tests__/fixtures/statusline-default.golden +1 -1
  45. package/src/claude/hooks/__tests__/spec-gate.test.js +244 -333
  46. package/src/claude/hooks/__tests__/spec-state-touched.test.js +160 -0
  47. package/src/claude/hooks/__tests__/state.test.js +68 -0
  48. package/src/claude/hooks/__tests__/statusline.test.js +140 -11
  49. package/src/claude/hooks/agent.cjs +2 -1
  50. package/src/claude/hooks/lib/hook-payload.cjs +2 -2
  51. package/src/claude/hooks/rules.cjs +2 -1
  52. package/src/claude/hooks/session.cjs +0 -1
  53. package/src/claude/hooks/spec-gate.cjs +17 -83
  54. package/src/claude/hooks/spec-state.cjs +142 -39
  55. package/src/claude/hooks/state.cjs +21 -2
  56. package/src/claude/migration-manifest.json +42 -22
  57. package/src/claude/output-styles/coding-level-0-eli5.md +9 -9
  58. package/src/claude/output-styles/coding-level-1-junior.md +3 -3
  59. package/src/claude/output-styles/coding-level-2-mid.md +3 -3
  60. package/src/claude/output-styles/coding-level-3-senior.md +2 -2
  61. package/src/claude/output-styles/coding-level-4-lead.md +5 -5
  62. package/src/claude/output-styles/coding-level-5-god.md +6 -6
  63. package/src/claude/rules/ai-dev-rules.md +2 -3
  64. package/src/claude/rules/hook-protocols.md +8 -15
  65. package/src/claude/rules/manage-docs.md +9 -23
  66. package/src/claude/rules/orchestrator.md +3 -4
  67. package/src/claude/rules/review-audit-self-decision.md +3 -3
  68. package/src/claude/rules/skill-domain-routing.md +1 -3
  69. package/src/claude/rules/skill-workflow-routing.md +4 -5
  70. package/src/claude/rules/state-sync.md +3 -12
  71. package/src/claude/rules/workflow.md +11 -19
  72. package/src/claude/runtime.schema.json +5 -3
  73. package/src/claude/scripts/generate-skill-catalog.cjs +7 -6
  74. package/src/claude/scripts/provenance.cjs +23 -5
  75. package/src/claude/scripts/spec-receipt.cjs +24 -121
  76. package/src/claude/scripts/spec-resolver.cjs +41 -458
  77. package/src/claude/scripts/workflow-policy.cjs +3 -1801
  78. package/src/claude/settings/settings.json +1 -32
  79. package/src/claude/skills/agent-browser/SKILL.md +1 -1
  80. package/src/claude/skills/{question → ask}/SKILL.md +9 -75
  81. package/src/claude/skills/brainstorm/SKILL.md +43 -131
  82. package/src/claude/skills/chrome-devtools/SKILL.md +14 -31
  83. package/src/claude/skills/code-review/SKILL.md +29 -81
  84. package/src/claude/skills/code-review/references/spec-compliance-review.md +4 -8
  85. package/src/claude/skills/debug/SKILL.md +29 -149
  86. package/src/claude/skills/develop/SKILL.md +26 -83
  87. package/src/claude/skills/develop/references/parallel-waves.md +0 -8
  88. package/src/claude/skills/develop/references/quality-gate.md +15 -13
  89. package/src/claude/skills/develop/references/subagent-patterns.md +0 -6
  90. package/src/claude/skills/docs/SKILL.md +2 -2
  91. package/src/claude/skills/docs/references/update-workflow.md +1 -1
  92. package/src/claude/skills/fix/SKILL.md +153 -0
  93. package/src/claude/skills/{hotfix → fix}/references/diagnosis-protocol.md +2 -2
  94. package/src/claude/skills/{hotfix → fix}/references/parallel-patterns.md +2 -2
  95. package/src/claude/skills/{hotfix → fix}/references/prevention-gate.md +3 -3
  96. package/src/claude/skills/{hotfix → fix}/references/review-cycle.md +1 -1
  97. package/src/claude/skills/git/SKILL.md +48 -9
  98. package/src/claude/skills/git/references/commit-protocols.md +35 -16
  99. package/src/claude/skills/git/references/worktree-blueprint.md +42 -6
  100. package/src/claude/skills/orca/SKILL.md +9 -8
  101. package/src/claude/skills/research/SKILL.md +17 -46
  102. package/src/claude/skills/scout/SKILL.md +61 -0
  103. package/src/claude/skills/{inspect → scout}/references/internal-inspection.md +26 -10
  104. package/src/claude/skills/specs/SKILL.md +22 -29
  105. package/src/claude/skills/specs/references/review.md +8 -6
  106. package/src/claude/skills/specs/references/templates.md +34 -41
  107. package/src/claude/skills/sync/SKILL.md +16 -45
  108. package/src/claude/skills/sync/references/rebind-and-audit.md +59 -0
  109. package/src/claude/skills/sync/references/sync-protocols.md +4 -13
  110. package/src/claude/skills/test/SKILL.md +39 -104
  111. package/src/claude/skills/test/references/execution-strategy.md +93 -21
  112. package/src/claude/skills/test/references/failure-triage.md +1 -1
  113. package/src/claude/skills/ui-ux/LICENSE +21 -0
  114. package/src/claude/skills/ui-ux/SKILL.md +497 -0
  115. package/src/claude/skills/ui-ux/references/brand-tokens.md +90 -0
  116. package/src/claude/skills/ui-ux/references/budgets.md +113 -0
  117. package/src/claude/skills/ui-ux/references/checklist.md +271 -0
  118. package/src/claude/skills/ui-ux/references/components/accordion.md +246 -0
  119. package/src/claude/skills/ui-ux/references/components/avatar.md +153 -0
  120. package/src/claude/skills/ui-ux/references/components/banner.md +43 -0
  121. package/src/claude/skills/ui-ux/references/components/breadcrumb.md +201 -0
  122. package/src/claude/skills/ui-ux/references/components/button.md +142 -0
  123. package/src/claude/skills/ui-ux/references/components/card.md +113 -0
  124. package/src/claude/skills/ui-ux/references/components/charts.md +376 -0
  125. package/src/claude/skills/ui-ux/references/components/chat.md +132 -0
  126. package/src/claude/skills/ui-ux/references/components/choice-controls.md +369 -0
  127. package/src/claude/skills/ui-ux/references/components/comment-thread.md +17 -0
  128. package/src/claude/skills/ui-ux/references/components/description-list.md +116 -0
  129. package/src/claude/skills/ui-ux/references/components/empty-state.md +98 -0
  130. package/src/claude/skills/ui-ux/references/components/file-upload.md +107 -0
  131. package/src/claude/skills/ui-ux/references/components/inline-edit.md +128 -0
  132. package/src/claude/skills/ui-ux/references/components/input.md +161 -0
  133. package/src/claude/skills/ui-ux/references/components/list-row.md +56 -0
  134. package/src/claude/skills/ui-ux/references/components/loading.md +198 -0
  135. package/src/claude/skills/ui-ux/references/components/logo.md +147 -0
  136. package/src/claude/skills/ui-ux/references/components/otp-input.md +43 -0
  137. package/src/claude/skills/ui-ux/references/components/quantity-input.md +100 -0
  138. package/src/claude/skills/ui-ux/references/components/range-slider.md +16 -0
  139. package/src/claude/skills/ui-ux/references/components/small-controls.md +340 -0
  140. package/src/claude/skills/ui-ux/references/components/sortable-header.md +86 -0
  141. package/src/claude/skills/ui-ux/references/components/tag-input.md +14 -0
  142. package/src/claude/skills/ui-ux/references/components/timeline.md +38 -0
  143. package/src/claude/skills/ui-ux/references/components/tree.md +30 -0
  144. package/src/claude/skills/ui-ux/references/design-process.md +650 -0
  145. package/src/claude/skills/ui-ux/references/layouts/app-kanban.html +303 -0
  146. package/src/claude/skills/ui-ux/references/layouts/app.md +1369 -0
  147. package/src/claude/skills/ui-ux/references/layouts/form.md +430 -0
  148. package/src/claude/skills/ui-ux/references/layouts/overlay.md +552 -0
  149. package/src/claude/skills/ui-ux/references/layouts/pricing.md +204 -0
  150. package/src/claude/skills/ui-ux/references/locked-rules.md +35 -0
  151. package/src/claude/skills/ui-ux/references/principles.md +408 -0
  152. package/src/claude/skills/ui-ux/references/refactor.md +245 -0
  153. package/src/claude/skills/ui-ux/references/responsive.md +195 -0
  154. package/src/claude/skills/ui-ux/references/review.md +528 -0
  155. package/src/claude/skills/ui-ux/references/rules-color.md +623 -0
  156. package/src/claude/skills/ui-ux/references/rules-form.md +235 -0
  157. package/src/claude/skills/ui-ux/references/rules-state.md +680 -0
  158. package/src/claude/skills/ui-ux/references/rules-type.md +369 -0
  159. package/src/claude/skills/ui-ux/references/styles.md +311 -0
  160. package/src/claude/skills/ui-ux/references/system.md +219 -0
  161. package/src/claude/skills/ui-ux/references/tailwind-v4-traps.md +237 -0
  162. package/src/claude/skills/ui-ux/references/tokens.css +362 -0
  163. package/src/claude/skills/ui-ux/scripts/lint-skill.mjs +216 -0
  164. package/src/claude/skills/ui-ux/scripts/package.json +9 -0
  165. package/src/claude/skills/ui-ux/scripts/probe.mjs +4447 -0
  166. package/src/claude/skills/ui-ux-pro-max/SKILL.md +25 -80
  167. package/src/claude/skills/web-testing/SKILL.md +2 -20
  168. package/src/claude/status.cjs +149 -144
  169. package/src/codex/AGENTS.md +8 -13
  170. package/src/codex/hooks/agent.cjs +2 -1
  171. package/src/codex/hooks/lib/spec-receipt.cjs +4 -32
  172. package/src/codex/hooks/lib/spec-utils.cjs +6 -52
  173. package/src/codex/hooks/rules.cjs +2 -1
  174. package/src/codex/hooks/session.cjs +0 -2
  175. package/src/codex/hooks/spec-gate.cjs +13 -81
  176. package/src/codex/hooks/spec-state.cjs +37 -41
  177. package/src/codex/hooks.json +0 -20
  178. package/src/codex/rules/state-sync.md +3 -12
  179. package/src/common/AGENTS.md +6 -12
  180. package/src/omp/extensions/cafekit-bridge.mjs +6 -6
  181. package/bin/__tests__/change-firewall.semantic-firewall.test.js +0 -2133
  182. package/bin/__tests__/finalizer-pass-gate.semantic-firewall.test.js +0 -342
  183. package/bin/__tests__/release-preflight.semantic-firewall.test.js +0 -586
  184. package/bin/__tests__/review-receipt-c2.semantic-firewall.test.js +0 -378
  185. package/bin/__tests__/specs-v2-policy-and-scaffold.test.js +0 -665
  186. package/bin/__tests__/specs-v2-validator-grounder-contract.test.js +0 -1132
  187. package/src/claude/hooks/__tests__/completion-authority.test.js +0 -990
  188. package/src/claude/hooks/__tests__/semantic-review-authority.test.js +0 -259
  189. package/src/claude/hooks/completion-authority-check.cjs +0 -56
  190. package/src/claude/hooks/completion-authority-state.cjs +0 -527
  191. package/src/claude/hooks/completion-authority.cjs +0 -163
  192. package/src/claude/hooks/lib/context.cjs +0 -616
  193. package/src/claude/hooks/lib/detect.cjs +0 -474
  194. package/src/claude/hooks/semantic-review-authority.cjs +0 -154
  195. package/src/claude/hooks/task-scaffold-guard.cjs +0 -114
  196. package/src/claude/hooks/usage.cjs +0 -197
  197. package/src/claude/scripts/change-firewall.cjs +0 -1748
  198. package/src/claude/scripts/spec-authoring-digest.cjs +0 -151
  199. package/src/claude/scripts/spec-authoring-validation.cjs +0 -126
  200. package/src/claude/scripts/spec-final-state.cjs +0 -290
  201. package/src/claude/scripts/spec-ground.cjs +0 -650
  202. package/src/claude/scripts/spec-readiness.cjs +0 -425
  203. package/src/claude/scripts/spec-scaffold.cjs +0 -2317
  204. package/src/claude/scripts/spec-semantic-model.cjs +0 -396
  205. package/src/claude/scripts/validate-spec-output.cjs +0 -3941
  206. package/src/claude/skills/code-review/references/verification-gate.md +0 -46
  207. package/src/claude/skills/delegate/SKILL.md +0 -124
  208. package/src/claude/skills/delegate/references/codex-delegation.md +0 -71
  209. package/src/claude/skills/delegate/references/grok-delegation.md +0 -84
  210. package/src/claude/skills/hotfix/SKILL.md +0 -289
  211. package/src/claude/skills/inspect/SKILL.md +0 -142
  212. package/src/claude/skills/loop/SKILL.md +0 -114
  213. package/src/claude/skills/loop/references/bounded-loop-protocol.md +0 -104
  214. package/src/claude/skills/loop/references/metric-and-guard-contract.md +0 -76
  215. package/src/claude/skills/route/SKILL.md +0 -94
  216. package/src/claude/skills/route/references/agent-timing.md +0 -46
  217. package/src/claude/skills/route/references/chaining-patterns.md +0 -53
  218. package/src/claude/skills/route/references/task-taxonomy.md +0 -48
  219. package/src/claude/skills/specs/templates/design.md +0 -82
  220. package/src/claude/skills/specs/templates/requirements-init.md +0 -8
  221. package/src/claude/skills/specs/templates/requirements.md +0 -42
  222. package/src/claude/skills/specs/templates/spec-state.json +0 -56
  223. package/src/claude/skills/specs/templates/task.md +0 -47
  224. package/src/codex/hooks/completion-authority-check.cjs +0 -67
  225. package/src/codex/hooks/completion-authority-state.cjs +0 -527
  226. package/src/codex/hooks/completion-authority.cjs +0 -109
  227. package/src/codex/hooks/semantic-review-authority.cjs +0 -130
  228. package/src/codex/hooks/task-scaffold-guard.cjs +0 -63
  229. /package/src/claude/skills/{question → ask}/templates/question.md +0 -0
  230. /package/src/claude/skills/{hotfix → fix}/references/escalation-tactics.md +0 -0
  231. /package/src/claude/skills/{hotfix → fix}/references/workflow-specialized.md +0 -0
@@ -1,48 +0,0 @@
1
- # Task taxonomy
2
-
3
- Classify by the final deliverable the user expects, not by the first verb, file
4
- type, or tool mentioned. Choose exactly one class; use domains as modifiers.
5
-
6
- | Class | Final deliverable |
7
- |---|---|
8
- | `answer` | Evidence-backed explanation or factual response |
9
- | `discover` | Located files, call path, inventory, or blast-radius map |
10
- | `decide` | Chosen product, architecture, or technical direction |
11
- | `specify` | Approved bounded plan and executable task packet |
12
- | `change` | Working implementation or content change |
13
- | `diagnose` | Root cause and verification-ready repair plan |
14
- | `repair` | Cause-aligned fix plus regression proof |
15
- | `verify` | Test or review verdict with owned evidence |
16
- | `deliver` | Authorized commit, push, deploy, publish, or release result |
17
-
18
- When a request contains several verbs, classify by its terminal observable
19
- result. For example, “research options and implement the winner” is `change`,
20
- while research is a decision link. “Inspect this failure and tell me why” is
21
- `diagnose`, not `repair`.
22
-
23
- ## Size
24
-
25
- - `trivial`: one clear reversible outcome, normally one owner and one link.
26
- - `standard`: multiple dependent links or a bounded cross-file/domain change.
27
- - `epic`: three or more independently deliverable subsystems; split them into
28
- bounded routes instead of creating one oversized chain.
29
-
30
- ## Risk
31
-
32
- Risk is the maximum risk of any retained link, never an average:
33
-
34
- - `low`: local, reversible, no material compatibility or data boundary.
35
- - `elevated`: shared contract, integration, migration, sensitive data, or a
36
- meaningful regression surface.
37
- - `high`: security boundary, irreversible data/action, production delivery,
38
- public compatibility, or large blast radius.
39
-
40
- ## Domains and ambiguity
41
-
42
- Count only material domains that need distinct evidence or ownership. A file
43
- extension alone is not a domain. Ambiguity adds an understand or decide link
44
- only when unresolved information can change the final deliverable, authority,
45
- or verification; otherwise choose the shortest valid direct path.
46
-
47
- Modifiers constrain a route. They never grant mutation, external-action,
48
- commit, push, deploy, publish, or release authority.
@@ -1,82 +0,0 @@
1
- # Design
2
-
3
- <!-- Delete every optional section that is not relevant. Compact keeps only the four core sections. -->
4
-
5
- ## Boundary
6
-
7
- - **Owns:** {{Behavior/state this design owns}}
8
- - **Reads:** {{Relevant inputs or existing state, or none}}
9
- - **Writes/exposes:** {{Outputs, state, route, artifact, or none}}
10
- - **Outside boundary:** {{Explicit non-goal or delegated responsibility}}
11
-
12
- ## Typed Anchors
13
-
14
- <!-- Files-first. IDs are unique across the whole spec. Design-owned anchors use A-D-NN. Access/Action are machine authority; Role never implies lifecycle. -->
15
-
16
- | ID | Type | Target | Role | Access | Action |
17
- |---|---|---|---|---|---|
18
- | A-D-01 | file | `{{path/to/existing-or-planned-file}}` | {{owner / consumer / entrypoint / proof / constraint}} | {{read / write}} | {{read / create / modify / delete}} |
19
- <!-- For a typed proof boundary, add: | A-D-02 | artifact | `{{path/to/proof-artifact}}` | proof evidence owner | write | create | -->
20
-
21
- ## Decisions and Invariants
22
-
23
- <!-- Keep stable D/I/C IDs: every RN.M semantic-review counterexample cites one exact design reference. -->
24
-
25
- ### D1 — {{Decision name}}
26
-
27
- - **Decision:** {{Canonical behavior or boundary}}
28
- - **Rejects ambiguity:** {{Alternative interpretation implementers must not choose}}
29
- - **Negative path:** {{Failure/error behavior when relevant}}
30
- - **Anchors:** A-D-01
31
-
32
- ### I1 — {{Invariant name}}
33
-
34
- {{Property that must remain true across implementation and verification.}}
35
-
36
- ### Named Contracts (conditional)
37
-
38
- <!-- Define each implementation-significant contract once. Tasks reference IDs and never copy bodies. For any public, replay, or operator API contract, include method, route, auth, required headers, request schema, success response, error semantics, and idempotency/concurrency behavior. -->
39
-
40
- #### C1 — {{Contract name}}
41
-
42
- - **Owner:** {{boundary or future owner task}}
43
- - **Consumers:** {{boundaries or future consumer tasks}}
44
- - **Shape/behavior:** {{typed request, response, event, schema, state, or error contract}}
45
- - **Compatibility:** {{versioning or migration constraint when relevant}}
46
-
47
- ## Verification Definitions
48
-
49
- <!--
50
- Canonical parser syntax is one single-line definition per V ID. Keep every
51
- label on the same line; do not replace this with a table or a V heading.
52
- -->
53
-
54
- - **V1**: Criteria R{{SUBJECT_REQ}}.{{X}}; Owner A-D-01; Decision refs D1, I1, C1; Method command `{{exact command}}`; Expected {{concrete observable result}}; Negative/failure {{concrete rejected or recovery case}}; Reachability/grounding entrypoint `{{exact/repository/entrypoint}}` via A-D-01.
55
-
56
- <!-- Only for a typed proof boundary, insert after Owner: Proof criteria Rn.m; Proof owner <distinct owner>; Evidence anchor <proof-owned anchor>; -->
57
-
58
- <!-- Full-only conditional sections follow. Keep only those relevant to this feature. -->
59
-
60
- ## Flow (Full, conditional)
61
-
62
- {{Only multi-step, branching, asynchronous, or cross-boundary flow decisions.}}
63
-
64
- ## Data and Consistency (Full, conditional)
65
-
66
- {{Ownership, schema, constraints, concurrency, lifecycle, or idempotency. For any retention/lifecycle policy, state clock anchor, clock source, timezone/precision, cutoff comparator/inclusivity, enforcement boundary, and a wrong-clock/boundary counterexample.}}
67
-
68
- ## Errors and Recovery (Full, conditional)
69
-
70
- {{Trigger, error contract, retry/rollback/reconciliation, and terminal state.}}
71
-
72
- ## Security and Privacy (Full, conditional)
73
-
74
- {{Trust boundary, authorization, sensitive data, deletion, and retention decisions.}}
75
-
76
- ## Migration and Compatibility (Full, conditional)
77
-
78
- {{Ordering, compatibility window, rollback trigger, and migration proof.}}
79
-
80
- ## Unresolved Questions
81
-
82
- - None.
@@ -1,8 +0,0 @@
1
- # Requirements Document
2
-
3
- ## Project Description (Input)
4
- {{PROJECT_DESCRIPTION}}
5
-
6
- ## Requirements
7
- <!-- Will be generated during the cf:specs requirements phase -->
8
-
@@ -1,42 +0,0 @@
1
- # Requirements
2
-
3
- ## Outcomes
4
-
5
- - {{Observable product or system outcome}}
6
-
7
- ## Scope
8
-
9
- ### In scope
10
-
11
- - {{Approved behavior or boundary}}
12
-
13
- ### Non-goals
14
-
15
- - {{Explicit exclusion that prevents scope inference}}
16
-
17
- ## Requirements
18
-
19
- ### Requirement 1: {{Outcome area}}
20
-
21
- <!-- Keep Objective/User Story only when role and benefit remove ambiguity. -->
22
- {{Optional: **Objective:** As a <role>, I want <capability>, so that <benefit>.}}
23
-
24
- #### Acceptance Criteria
25
-
26
- - **R1.1** When {{event}}, the {{system}} shall {{measurable subject response}}.
27
-
28
- <!-- Add a separate proof criterion only when a typed proof boundary exists. -->
29
-
30
- <!-- Add state, optional-feature, or ubiquitous EARS criteria only when relevant. -->
31
- <!-- Add a concrete example only when values, order, boundaries, or transformation could be interpreted differently. -->
32
-
33
- #### Examples (conditional)
34
-
35
- - {{Input/state}} → {{expected output/state}}
36
-
37
- <!-- Repeat Requirement N with literal RN.M acceptance IDs. -->
38
- <!-- Add feature-specific NFRs in the same numeric sequence only when measurable and relevant. -->
39
-
40
- ## Unresolved Questions
41
-
42
- - None.
@@ -1,56 +0,0 @@
1
- {
2
- "schema_version": "2.1",
3
- "feature_name": "{{FEATURE_NAME}}",
4
- "created_at": "{{TIMESTAMP}}",
5
- "updated_at": "{{TIMESTAMP}}",
6
- "language": "en",
7
- "status": "in_progress",
8
- "scope_lock": {
9
- "source": "{{PROJECT_DESCRIPTION}}",
10
- "in_scope": [],
11
- "out_of_scope": [],
12
- "expansion_policy": "requires-user-approval"
13
- },
14
- "authoring": {
15
- "requirements": "draft",
16
- "design": "draft",
17
- "research": "absent",
18
- "tasks": "absent"
19
- },
20
- "coordination": {
21
- "boundaries": []
22
- },
23
- "validation": {
24
- "status": "not-run",
25
- "semantic_review": {
26
- "status": "not-run",
27
- "semantic_digest": null,
28
- "verdict": null,
29
- "lifecycle_disposition": null,
30
- "findings": [],
31
- "unresolved_decisions": [],
32
- "graph_coverage": [],
33
- "repair_round": 0,
34
- "reviewed_criteria": [],
35
- "counterexamples": [],
36
- "reviewer_evidence": null
37
- },
38
- "semantic_review_history": {
39
- "lineage_id": "{{LINEAGE_ID}}",
40
- "entries": []
41
- },
42
- "authoring_validation": null
43
- },
44
- "semantic_model": null,
45
- "ready_for_implementation": false,
46
- "workflow_policy": {
47
- "version": "2.1",
48
- "planning_depth": "Compact",
49
- "assurance_level": "Routine",
50
- "classified_minimum": {
51
- "planning_depth": "Compact",
52
- "assurance_level": "Routine"
53
- },
54
- "risks": []
55
- }
56
- }
@@ -1,47 +0,0 @@
1
- # Task R{{REQ_NUMBER}}-{{SEQ}}: {{TITLE}}
2
- **Status:** pending
3
-
4
- ## Outcome
5
-
6
- {{Concrete observable vertical outcome, named entrypoint, and resulting state delivered by this task.}}
7
-
8
- ## Scope
9
-
10
- - **In scope:** {{Exact behavior owned by this task}}
11
- - **Out of scope:** {{Explicit exclusions or delegated behavior}}
12
-
13
- ## Anchors and Ownership
14
-
15
- <!-- Compact core: one owned anchor is enough; proof artifact/owner exists only for a typed proof boundary (see Verification Plan). -->
16
- | ID | Type | Target | Role | Access | Action |
17
- |---|---|---|---|---|---|
18
- | A-R{{REQ_NUMBER}}-{{SEQ}}-01 | file | `{{exact/path/to/file}}` | owner | write | modify |
19
- <!-- For a typed proof boundary, add: | A-R{{REQ_NUMBER}}-{{SEQ}}-02 | file | `{{exact/path/to/test-file}}` | proof | write | create | and set Task role accordingly; otherwise omit. Every executable task must own a concrete test file/artifact anchor or share proof via that typed boundary; bare command is not ownership. -->
20
-
21
- ## Changes
22
-
23
- <!-- Every checkbox maps exact RN.M IDs; the set must equal Acceptance below. -->
24
- - [ ] {{Implement behavior at the exact owned boundary.}} _Requirements: {{REQ_NUMBER}}.{{X}}_
25
- - [ ] {{Handle the concrete negative or recovery path.}} _Requirements: {{REQ_NUMBER}}.{{Y}}_
26
-
27
- ## Acceptance
28
-
29
- <!-- Declare each mapped RN.M once with a measurable output/state and negative behavior. -->
30
- - **R{{REQ_NUMBER}}.{{X}}:** {{Measurable observable outcome}}
31
- - **R{{REQ_NUMBER}}.{{Y}}:** {{Concrete negative or recovery outcome}}
32
-
33
- ## Dependencies
34
-
35
- - {{DEPENDENCIES}}
36
-
37
- ## Verification Plan
38
-
39
- <!-- Ownership invariant: a bare npm test command without a concrete file/artifact anchor is not ownership; shared proof must use a typed proof boundary. -->
40
- - **Verification ref:** {{V reference whose structured subject/proof owner matches this task}}
41
- - **Task role:** {{subject | verifier}}
42
- - **Command:** `{{Exact project command}}`
43
- - **Expected:** {{Exit, output, state, artifact, or UI result}}
44
- - **Negative path:** {{Contract-preserving failure check}}
45
- - **Reachability:** `{{Real entrypoint/caller or generated artifact}}`
46
-
47
- <!-- The table above is the only task anchor/ownership table. Access read requires Action read. Access write requires create, modify, or delete. Targets are exact; globs and parent-directory claims are invalid. A verifier must not repeat the subject's Acceptance criterion. Specs-only never creates or updates docs and never fabricates execution proof; record doc impact as a brief recommendation only. -->
@@ -1,67 +0,0 @@
1
- 'use strict';
2
-
3
- const fs = require('fs');
4
- const path = require('path');
5
- const STATE = require('./completion-authority-state.cjs');
6
- const { checkFeatureReceipt, checkReceiptDetails } = require('./lib/spec-receipt.cjs');
7
- const RESOLVER = require('./lib/spec-utils.cjs');
8
-
9
- const installedScripts = path.join(__dirname, '..', 'scripts');
10
- const scripts = fs.existsSync(path.join(installedScripts, 'spec-final-state.cjs'))
11
- ? installedScripts
12
- : path.resolve(__dirname, '..', '..', 'claude', 'scripts');
13
-
14
- function runtimeModule(root, name) {
15
- const target = path.join(root, name);
16
- const stat = fs.lstatSync(target);
17
- if (stat.isSymbolicLink() || !stat.isFile()) throw new Error(`runtime dependency must be a regular non-symlink file: ${name}`);
18
- const canonicalRoot = fs.realpathSync(root);
19
- const canonical = fs.realpathSync(target);
20
- const relative = path.relative(canonicalRoot, canonical);
21
- if (relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) throw new Error(`runtime dependency escaped scripts root: ${name}`);
22
- return require(canonical);
23
- }
24
-
25
- const FINAL_STATE = runtimeModule(scripts, 'spec-final-state.cjs');
26
-
27
- function explicitTarget(payload) {
28
- for (const key of ['featureName', 'feature', 'explicitFeature']) {
29
- if (Object.prototype.hasOwnProperty.call(payload, key)) return { explicitFeature: payload[key] };
30
- }
31
- for (const key of ['specPath', 'spec_path', 'featurePath']) {
32
- if (Object.prototype.hasOwnProperty.call(payload, key)) return { explicitPath: payload[key] };
33
- }
34
- return null;
35
- }
36
-
37
- function resolveCandidate({ projectRoot, runtime, payload }) {
38
- const target = explicitTarget(payload);
39
- if (target) return RESOLVER.resolveActiveSpec({ projectRoot, runtime, ...target });
40
- // Delegate so both runtimes answer the same question; the count below stays only as a
41
- // fallback for an installed resolver older than this wrapper.
42
- const shared = RESOLVER.resolvePersistedSpec({ projectRoot, runtime });
43
- if (shared !== null) return shared;
44
- const candidates = RESOLVER.findAllSpecCandidates(projectRoot, runtime);
45
- if (candidates.length > 1) return { error: 'multiple_persisted', candidates: candidates.map((candidate) => candidate.featureName) };
46
- return candidates[0] || null;
47
- }
48
-
49
- function dependencies(overrides = {}) {
50
- if (!overrides.grounder) runtimeModule(scripts, 'spec-semantic-model.cjs');
51
- const grounder = overrides.grounder || runtimeModule(scripts, 'spec-ground.cjs');
52
- return {
53
- validator: overrides.validator || runtimeModule(scripts, 'validate-spec-output.cjs'),
54
- grounder,
55
- semanticAuthority: overrides.semanticAuthority || require('./semantic-review-authority.cjs'),
56
- };
57
- }
58
-
59
- module.exports = FINAL_STATE.createAuthority({
60
- state: STATE,
61
- resolveCandidate,
62
- dependencies,
63
- receipts: {
64
- task: (featureDir, taskPath, task, context) => checkReceiptDetails(featureDir, taskPath, task, context),
65
- feature: (featureDir, context) => checkFeatureReceipt(featureDir, context),
66
- },
67
- });