qfai 2.2.1 → 2.4.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 (211) hide show
  1. package/README.md +37 -20
  2. package/assets/init/.claude/settings.json +35 -1
  3. package/assets/init/.codex/hooks.json +24 -0
  4. package/assets/init/.github/instructions/code-review.instructions.md +1 -1
  5. package/assets/init/.qfai/assistant/agent/architecture-reviewer.md +4 -4
  6. package/assets/init/.qfai/assistant/agent/fullstack-engineer.md +129 -0
  7. package/assets/init/.qfai/assistant/agent/implementation-reviewer.md +76 -4
  8. package/assets/init/.qfai/assistant/agent/product-surface-reviewer.md +9 -5
  9. package/assets/init/.qfai/assistant/agent/requirements-reviewer.md +13 -3
  10. package/assets/init/.qfai/assistant/rule/agent-selection.md +22 -42
  11. package/assets/init/.qfai/assistant/rule/communication.md +1 -1
  12. package/assets/init/.qfai/assistant/rule/constitution.md +77 -242
  13. package/assets/init/.qfai/assistant/rule/drift-protocol.md +31 -165
  14. package/assets/init/.qfai/assistant/rule/references/asset-authoring.md +4 -3
  15. package/assets/init/.qfai/assistant/rule/references/codex-delegation.md +4 -4
  16. package/assets/init/.qfai/assistant/rule/references/gate-failure-autorepair.md +2 -2
  17. package/assets/init/.qfai/assistant/rule/references/placeholder-scan.md +2 -3
  18. package/assets/init/.qfai/assistant/rule/references/reviewer-findings.md +3 -3
  19. package/assets/init/.qfai/assistant/rule/references/worker-edit-boundary.md +15 -6
  20. package/assets/init/.qfai/assistant/rule/research-first-protocol.md +7 -6
  21. package/assets/init/.qfai/assistant/rule/review-convergence.md +7 -7
  22. package/assets/init/.qfai/assistant/rule/shared-skill-delegation-baseline.md +82 -66
  23. package/assets/init/.qfai/assistant/rule/shared-skill-operating-baseline.md +19 -21
  24. package/assets/init/.qfai/assistant/rule/test-layers.md +1 -1
  25. package/assets/init/.qfai/assistant/rule/thinking.md +2 -2
  26. package/assets/init/.qfai/assistant/rule/ui-definition-protocol.md +5 -5
  27. package/assets/init/.qfai/assistant/rule/ui-procurement.md +1 -1
  28. package/assets/init/.qfai/assistant/rule/workflow.md +16 -16
  29. package/assets/init/.qfai/assistant/skill/qfai-configure/SKILL.md +27 -60
  30. package/assets/init/.qfai/assistant/skill/qfai-discussion/SKILL.md +3 -17
  31. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/03_Story-Workshop.md +1 -2
  32. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/uiux/50_review_input_bundle.md +4 -3
  33. package/assets/init/.qfai/assistant/skill/qfai-grill/SKILL.md +9 -10
  34. package/assets/init/.qfai/assistant/skill/qfai-grilling/SKILL.md +45 -58
  35. package/assets/init/.qfai/assistant/skill/qfai-grilling/references/confirmation-sheet.md +71 -0
  36. package/assets/init/.qfai/assistant/skill/qfai-grilling/references/delegated-session.md +35 -18
  37. package/assets/init/.qfai/assistant/skill/qfai-grilling/references/session-record.md +3 -3
  38. package/assets/init/.qfai/assistant/skill/qfai-implement/SKILL.md +2 -18
  39. package/assets/init/.qfai/assistant/skill/qfai-implement/references/parallelization-policy.md +53 -21
  40. package/assets/init/.qfai/assistant/skill/qfai-implement/references/ui-affecting.md +35 -2
  41. package/assets/init/.qfai/assistant/skill/qfai-maintain/SKILL.md +2 -5
  42. package/assets/init/.qfai/assistant/skill/qfai-migration-v1-to-v2/SKILL.md +2 -15
  43. package/assets/init/.qfai/assistant/skill/qfai-migration-v1-to-v2/references/migration-guide.md +10 -14
  44. package/assets/init/.qfai/assistant/skill/qfai-migration-v1-to-v2/references/migration-placement.md +0 -7
  45. package/assets/init/.qfai/assistant/skill/qfai-prototyping/SKILL.md +6 -15
  46. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/generator-prompt.md +76 -5
  47. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/handoff.md +2 -1
  48. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/iteration-loop.md +60 -5
  49. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/review-payload-schema.md +15 -6
  50. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/reviewer-prompt.md +42 -11
  51. package/assets/init/.qfai/assistant/skill/qfai-run/SKILL.md +8 -10
  52. package/assets/init/.qfai/assistant/skill/qfai-run/references/extraction.md +12 -7
  53. package/assets/init/.qfai/assistant/skill/qfai-run/references/operator-screens.md +4 -4
  54. package/assets/init/.qfai/assistant/skill/qfai-run/references/stage-points.md +1 -1
  55. package/assets/init/.qfai/assistant/skill/qfai-sdd/SKILL.md +10 -25
  56. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/concrete-abstract-cycle.md +27 -29
  57. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/contract-artifact-rules.md +13 -3
  58. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/design-anti-patterns.md +36 -3
  59. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/design-md-authoring.md +8 -9
  60. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/requirements-decomposition.md +6 -6
  61. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-execution-playbook.md +7 -7
  62. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-phase-checklists.md +5 -5
  63. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-pre-draft-grilling.md +7 -7
  64. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-quality-gate.md +3 -3
  65. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-triage.md +115 -199
  66. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/spec-traceability-rules.md +25 -25
  67. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/ui-contract-guide.md +23 -113
  68. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/ui-design-contract-normalization.md +2 -2
  69. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/contracts/ui-contract.sample.yaml +8 -7
  70. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/03_contract/tech.md +1 -0
  71. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/decisions/page-NNNN.md +2 -2
  72. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/decisions.md +59 -31
  73. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/open-questions.md +15 -11
  74. package/assets/init/.qfai/assistant/skill/qfai-triage/SKILL.md +1 -14
  75. package/assets/init/.qfai/assistant/skill/qfai-verify/SKILL.md +2 -13
  76. package/assets/init/.qfai/assistant/skill/qfai-verify/references/verify-output-contract.md +1 -1
  77. package/assets/init/.qfai/assistant/skill/web-research/SKILL.md +19 -21
  78. package/assets/init/.qfai/assistant/step/common-design-md/STEP.md +9 -11
  79. package/assets/init/.qfai/assistant/step/common-gate-run/STEP.md +2 -3
  80. package/assets/init/.qfai/assistant/step/common-grilling-record/STEP.md +3 -4
  81. package/assets/init/.qfai/assistant/step/common-policy-check/STEP.md +1 -2
  82. package/assets/init/.qfai/assistant/step/common-review-cycle/STEP.md +8 -7
  83. package/assets/init/.qfai/assistant/step/discussion-interview/STEP.md +7 -9
  84. package/assets/init/.qfai/assistant/step/discussion-oq/STEP.md +0 -2
  85. package/assets/init/.qfai/assistant/step/discussion-pack/STEP.md +43 -2
  86. package/assets/init/.qfai/assistant/step/discussion-research/STEP.md +0 -2
  87. package/assets/init/.qfai/assistant/step/discussion-uiux/STEP.md +0 -2
  88. package/assets/init/.qfai/assistant/step/implement-acceptance/STEP.md +1 -5
  89. package/assets/init/.qfai/assistant/step/implement-backport/STEP.md +0 -5
  90. package/assets/init/.qfai/assistant/step/implement-benchmark/STEP.md +0 -4
  91. package/assets/init/.qfai/assistant/step/implement-bisect/STEP.md +0 -5
  92. package/assets/init/.qfai/assistant/step/implement-credentials/STEP.md +0 -4
  93. package/assets/init/.qfai/assistant/step/implement-dep-bump/STEP.md +11 -18
  94. package/assets/init/.qfai/assistant/step/implement-diagnose/STEP.md +0 -6
  95. package/assets/init/.qfai/assistant/step/implement-minimize/STEP.md +0 -5
  96. package/assets/init/.qfai/assistant/step/implement-oracle-parity/STEP.md +0 -6
  97. package/assets/init/.qfai/assistant/step/implement-procedure/STEP.md +1 -3
  98. package/assets/init/.qfai/assistant/step/implement-quarantine/STEP.md +0 -4
  99. package/assets/init/.qfai/assistant/step/implement-refactor/STEP.md +0 -4
  100. package/assets/init/.qfai/assistant/step/implement-regression-fix/STEP.md +2 -6
  101. package/assets/init/.qfai/assistant/step/implement-retire/STEP.md +0 -6
  102. package/assets/init/.qfai/assistant/step/implement-revert/STEP.md +0 -4
  103. package/assets/init/.qfai/assistant/step/implement-scaffold/STEP.md +5 -7
  104. package/assets/init/.qfai/assistant/step/implement-seam/STEP.md +0 -4
  105. package/assets/init/.qfai/assistant/step/implement-stress-harness/STEP.md +0 -5
  106. package/assets/init/.qfai/assistant/step/implement-sweep/STEP.md +0 -5
  107. package/assets/init/.qfai/assistant/step/implement-tdd/STEP.md +10 -18
  108. package/assets/init/.qfai/assistant/step/implement-test-fix/STEP.md +0 -5
  109. package/assets/init/.qfai/assistant/step/implement-tooling/STEP.md +0 -3
  110. package/assets/init/.qfai/assistant/step/maintain-edit/STEP.md +18 -21
  111. package/assets/init/.qfai/assistant/step/prototyping-grill/STEP.md +4 -6
  112. package/assets/init/.qfai/assistant/step/prototyping-handoff/STEP.md +0 -2
  113. package/assets/init/.qfai/assistant/step/prototyping-loop/STEP.md +106 -31
  114. package/assets/init/.qfai/assistant/step/prototyping-preflight/STEP.md +0 -2
  115. package/assets/init/.qfai/assistant/step/sdd-contract/STEP.md +18 -19
  116. package/assets/init/.qfai/assistant/step/sdd-cycle/STEP.md +8 -11
  117. package/assets/init/.qfai/assistant/step/sdd-flow/STEP.md +25 -6
  118. package/assets/init/.qfai/assistant/step/sdd-gate/STEP.md +0 -1
  119. package/assets/init/.qfai/assistant/step/sdd-story/STEP.md +6 -8
  120. package/assets/init/.qfai/assistant/step/sdd-triage/STEP.md +71 -82
  121. package/assets/init/.qfai/assistant/step/triage-answer/STEP.md +0 -2
  122. package/assets/init/.qfai/assistant/step/triage-close/STEP.md +0 -2
  123. package/assets/init/.qfai/assistant/step/triage-cluster/STEP.md +0 -2
  124. package/assets/init/.qfai/assistant/step/triage-decompose/STEP.md +0 -2
  125. package/assets/init/.qfai/assistant/step/triage-dedupe/STEP.md +0 -2
  126. package/assets/init/.qfai/assistant/step/triage-handoff/STEP.md +0 -2
  127. package/assets/init/.qfai/assistant/step/triage-investigate/STEP.md +0 -2
  128. package/assets/init/.qfai/assistant/step/triage-operate/STEP.md +29 -17
  129. package/assets/init/.qfai/assistant/step/triage-owned-cleanup/STEP.md +0 -2
  130. package/assets/init/.qfai/assistant/step/triage-request-info/STEP.md +0 -2
  131. package/assets/init/.qfai/assistant/step/triage-security-intake/STEP.md +0 -2
  132. package/assets/init/.qfai/assistant/step/verify-advisory/STEP.md +0 -2
  133. package/assets/init/.qfai/assistant/step/verify-change-note/STEP.md +0 -2
  134. package/assets/init/.qfai/assistant/step/verify-commit/STEP.md +2 -6
  135. package/assets/init/.qfai/assistant/step/verify-context/STEP.md +7 -26
  136. package/assets/init/.qfai/assistant/step/verify-external/STEP.md +0 -2
  137. package/assets/init/.qfai/assistant/step/verify-manual/STEP.md +0 -2
  138. package/assets/init/.qfai/assistant/step/verify-qfai-gate/STEP.md +0 -2
  139. package/assets/init/.qfai/assistant/step/verify-release-notes/STEP.md +0 -2
  140. package/assets/init/.qfai/assistant/step/verify-repeat-run/STEP.md +0 -2
  141. package/assets/init/.qfai/assistant/step/verify-repo-gate/STEP.md +0 -2
  142. package/assets/init/root/.agents/rules/ai-readable-markdown.md +8 -1
  143. package/assets/init/root/.agents/rules/delegation-steering.md +69 -0
  144. package/assets/init/root/.agents/rules/grilling.md +81 -52
  145. package/assets/init/root/.agents/rules/minimal-implementation.md +5 -5
  146. package/assets/init/root/.agents/rules/reply-forms.md +191 -0
  147. package/assets/init/root/.agents/rules/session-feedback.md +104 -27
  148. package/assets/init/root/.agents/rules/user-questions.md +6 -1
  149. package/assets/init/root/.gitattributes +5 -6
  150. package/assets/init/root/AGENTS.md +4 -2
  151. package/assets/mdschema/story/03_contract/tech.mdschema.yml +1 -1
  152. package/assets/mdschema/story/decisions/page-NNNN.mdschema.yml +3 -3
  153. package/assets/mdschema/story/decisions.mdschema.yml +4 -4
  154. package/assets/mdschema/story/open-questions.mdschema.yml +3 -3
  155. package/assets/schemas/workflow/extraction.schema.json +0 -2
  156. package/dist/cli/index.cjs +3826 -3929
  157. package/dist/cli/index.cjs.map +1 -1
  158. package/dist/cli/index.mjs +3793 -3904
  159. package/dist/cli/index.mjs.map +1 -1
  160. package/dist/graph/cli.cjs +14 -2
  161. package/dist/graph/cli.cjs.map +1 -1
  162. package/dist/graph/cli.d.cts +1 -1
  163. package/dist/graph/cli.d.ts +1 -1
  164. package/dist/graph/cli.mjs +14 -2
  165. package/dist/graph/cli.mjs.map +1 -1
  166. package/dist/graph/hook.cjs.map +1 -1
  167. package/dist/graph/hook.mjs.map +1 -1
  168. package/dist/hook/turn-end.cjs +1022 -0
  169. package/dist/hook/turn-end.cjs.map +1 -0
  170. package/dist/hook/turn-end.d.cts +2 -0
  171. package/dist/hook/turn-end.d.ts +2 -0
  172. package/dist/hook/turn-end.mjs +998 -0
  173. package/dist/hook/turn-end.mjs.map +1 -0
  174. package/dist/index.cjs +3635 -4578
  175. package/dist/index.cjs.map +1 -1
  176. package/dist/index.d.cts +20 -21
  177. package/dist/index.d.ts +20 -21
  178. package/dist/index.mjs +3696 -4641
  179. package/dist/index.mjs.map +1 -1
  180. package/dist/process-qqX2Owgq.d.cts +18 -0
  181. package/dist/process-qqX2Owgq.d.ts +18 -0
  182. package/package.json +2 -2
  183. package/assets/defaults/agent-routing/_contract.yml +0 -77
  184. package/assets/defaults/agent-routing/common.yml +0 -14
  185. package/assets/defaults/agent-routing/qfai-discussion.yml +0 -57
  186. package/assets/defaults/agent-routing/qfai-implement.yml +0 -236
  187. package/assets/defaults/agent-routing/qfai-maintain.yml +0 -12
  188. package/assets/defaults/agent-routing/qfai-prototyping.yml +0 -48
  189. package/assets/defaults/agent-routing/qfai-sdd.yml +0 -56
  190. package/assets/defaults/agent-routing/qfai-triage.yml +0 -108
  191. package/assets/defaults/agent-routing/qfai-verify.yml +0 -92
  192. package/assets/defaults/agent-routing/skills.yml +0 -59
  193. package/assets/defaults/review-profiles.yml +0 -25
  194. package/assets/init/.qfai/assistant/agent/acceptance-test-engineer.md +0 -81
  195. package/assets/init/.qfai/assistant/agent/backend-engineer.md +0 -90
  196. package/assets/init/.qfai/assistant/agent/completion-reviewer.md +0 -88
  197. package/assets/init/.qfai/assistant/agent/delivery-planner.md +0 -85
  198. package/assets/init/.qfai/assistant/agent/devops-ci-engineer.md +0 -78
  199. package/assets/init/.qfai/assistant/agent/discovery-analyst.md +0 -81
  200. package/assets/init/.qfai/assistant/agent/doc-steward.md +0 -78
  201. package/assets/init/.qfai/assistant/agent/frontend-engineer.md +0 -94
  202. package/assets/init/.qfai/assistant/agent/orchestrator.md +0 -92
  203. package/assets/init/.qfai/assistant/agent/product-experience-architect.md +0 -101
  204. package/assets/init/.qfai/assistant/agent/qa-gatekeeper.md +0 -153
  205. package/assets/init/.qfai/assistant/agent/qa-strategist.md +0 -82
  206. package/assets/init/.qfai/assistant/agent/requirements-analyst.md +0 -96
  207. package/assets/init/.qfai/assistant/agent/solution-architect.md +0 -89
  208. package/assets/init/.qfai/assistant/agent/test-design-analyst.md +0 -132
  209. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/change-request.md +0 -52
  210. package/dist/process-C21nTvkT.d.cts +0 -12
  211. package/dist/process-C21nTvkT.d.ts +0 -12
@@ -23,6 +23,7 @@ naming the pattern is what works.
23
23
  - Motion and transitions
24
24
  - Copy in the UI
25
25
  - Copy that adds no meaning
26
+ - Claims nobody has confirmed
26
27
  - Information architecture and flow
27
28
  - States and accessibility
28
29
  - Implementation defaults
@@ -39,6 +40,16 @@ naming the pattern is what works.
39
40
  - **Replacing a pattern.** Its usual substitute is in
40
41
  [Displacement](#displacement). Moving from one to the other is the same
41
42
  defect.
43
+ - **Checking product fit.** Where the design direction, root `DESIGN.md` or a
44
+ screen is reviewed, ask one more question: if another product's name
45
+ replaced this one, would the screen still fit? A yes is a finding that names
46
+ where the direction should become specific to this product: the copy, the
47
+ one distinctive element, or the visual. It is a reviewer's judgement, not a
48
+ detection, and it adds no `lap-*` entry.
49
+ - **A claim nobody has confirmed.** Whether writing root `DESIGN.md`, building
50
+ a screen or reviewing one, follow
51
+ [Claims nobody has confirmed](#claims-nobody-has-confirmed) before deleting
52
+ or rewriting one.
42
53
  - Within each aspect, the pattern named most often comes first.
43
54
 
44
55
  ## Where the list stops
@@ -59,6 +70,9 @@ naming the pattern is what works.
59
70
  through the criterion on explanatory text, because those patterns are about
60
71
  what the text tells the user, not about a brand. No entry here is a `lap-*`
61
72
  detection.
73
+ - The audit that opens a restyle applies every section, identity included: it
74
+ reads screens the project already runs, which root `DESIGN.md` did not
75
+ produce.
62
76
 
63
77
  ## Color and background
64
78
 
@@ -274,9 +288,9 @@ naming the pattern is what works.
274
288
 
275
289
  ## Copy that adds no meaning
276
290
 
277
- These patterns are judged against the screen's tasks and the `supplements` its UI
278
- contract declares, in SDD, in implementation and in every surface review. A chosen
279
- visual direction does not exempt them. A disclosure about demo data, cost, storage
291
+ These patterns are judged against the screen's tasks, in SDD, in implementation
292
+ and in every surface review; in UI source, also against the `qfai-text` reason
293
+ each plain text carries. A chosen visual direction does not exempt them. A disclosure about demo data, cost, storage
280
294
  or transmission that is true and shown where the user decides is not one of them:
281
295
  judge where it sits and what it lets the user do, not the word.
282
296
 
@@ -287,6 +301,25 @@ judge where it sits and what it lets the user do, not the word.
287
301
  - Production copy carries a development instruction, implementation commentary,
288
302
  or a demo note repeated on screen after screen.
289
303
 
304
+ ## Claims nobody has confirmed
305
+
306
+ A metric, a customer count, a testimonial or a "trusted by" row that is
307
+ already on the screen, or in material the user supplied, and that the
308
+ project's documents do not support is not deleted and not rewritten into
309
+ something more specific: deleting it can lose a real fact, and rewriting it
310
+ invents one. A claim an agent writes itself stays the _invented proof_
311
+ pattern in _Copy in the UI_: never write one.
312
+
313
+ - Put each such claim to the user under the question protocol.
314
+ - A claim the user confirms keeps its wording, or becomes specific with the
315
+ facts the user gives. A claim the user rejects is removed.
316
+ - With no user present, the claim stays as it is, becomes one row in
317
+ `open-questions.md` under `paths.specsDir`, and the final report lists it.
318
+ - Inside the prototyping loop, the claim and the user's answer go to the final
319
+ report instead of `open-questions.md`. A `prototype` iteration applies the
320
+ answer to the prototype. A restyle changes no displayed text, so there a
321
+ claim to remove or reword is reported as a change the contract needs.
322
+
290
323
  ## Information architecture and flow
291
324
 
292
325
  - Sections follow the stock order: hero, logos, three features, stats or
@@ -121,15 +121,14 @@ to touch a colour has nothing to be consistent with.
121
121
  skill template. A root file that exists was authored by `common-design-md` or
122
122
  copied from that template on purpose, and a project may have authored its own.
123
123
  Write a missing file from the recorded direction. Repair an existing file only when SDD triage names its exact path
124
- and the requested change, and a new WIP change request authorizes both. Apply
125
- only the authorized change; preserve existing brand and tokens unless their
126
- change is authorized and supported by recorded direction or named theme
127
- values. Record the source of each changed value and leave unrelated content
128
- unchanged. Stop without writing a value neither source supplies. Without that
129
- authorization, validate the existing file without an overwrite; an inherited
130
- DONE row authorizes no new change. An unreplaced sample is refused.
131
-
132
- For an existing valid file, validation and authorized repairs that preserve
124
+ and the requested change. Apply only that change; preserve existing brand and
125
+ tokens unless the user decided their change and it is supported by recorded
126
+ direction or named theme values. Record the source of each changed value and
127
+ leave unrelated content unchanged. Stop without writing a value neither source
128
+ supplies. Without such a triaged change, validate the existing file without an
129
+ overwrite. An unreplaced sample is refused.
130
+
131
+ For an existing valid file, validation and triaged repairs that preserve
133
132
  its brand and tokens require no new brand selection. An authorized brand or
134
133
  token change still needs recorded direction or named theme values for each
135
134
  changed value; without either source, stop without writing the change.
@@ -11,7 +11,7 @@ Use source-backed discussion requirements to write one connected, testable story
11
11
  ## Source and ownership
12
12
 
13
13
  1. Read the selected discussion pack's source registry, requirement index, open questions, decision record, and completed reviews. Each requirement must trace to a source ID. Record a missing source or unresolved product choice in `<paths.specsDir>/open-questions.md` and stop the dependent write.
14
- 2. Reuse an existing policy, business flow, or story when it still expresses the requirement. Put a create, update, or retirement operation to the user, and record the approved one as a `Change request:` row of `<paths.specsDir>/decisions.md` naming the affected BF or US and `discussion-<id>#REQ-NNNN`.
14
+ 2. Reuse an existing policy, business flow, or story when it still expresses the requirement. Put an operation that is a critical decision to the user, as the triage reference says, and record the decision in `<paths.specsDir>/decisions.md` only when it passes the recording test.
15
15
  3. Write broad intent in `01_policy/` as criteria, then each observable process in `02_business-flow/business-flow-NNNN/business-flow.md`. Keep each flow's story index and three-file story directories beneath it. Every file takes its template's shape exactly, as the `Document shapes` section of the spec traceability rules sets out.
16
16
  4. Write one observable outcome per AC, as one named Gherkin `Scenario:` under its ID comment. Give each AC at least one concrete EX, and give each EX exactly one AC reference. Include normal, failure, boundary, and authorization paths relevant to the requirement.
17
17
  5. Once the examples exist, write independently falsifiable BRs in the contracts that enforce them. Each BR cites at least one full EX ID; every EX has a BR. A shared BR is defined once, in the contract that enforces it, and no other contract cites it.
@@ -28,13 +28,13 @@ Use source-backed discussion requirements to write one connected, testable story
28
28
  A capacity-only sibling may represent the same actual actor goal within the
29
29
  same BF when requested AC or EX additions exceed the source story's remaining
30
30
  capacity. Prefer preserving published cases and IDs, and place only new,
31
- cohesive incoming cases under their own covering change request. Confirm
32
- retired-inclusive capacity and the owning approval before writing; this
33
- exception invents no new product outcome and grants no future creation or move
34
- permission.
31
+ cohesive incoming cases there, once the user has decided the partition. Confirm
32
+ retired-inclusive capacity before writing; this exception invents no new
33
+ product outcome and decides no future creation or move.
35
34
 
36
35
  Allocate each ID as the highest ID of its kind in its defined scope plus one, counting retired IDs. Never reuse an ID. The scopes and widths are in the `ID allocation` section of the triage reference.
37
36
 
38
37
  ## Ambiguity
39
38
 
40
- Leave unresolved choices in `open-questions.md` with an owner and a next action in Approach. Append decisions and questions once, then change only their Status. Do not silently turn discussion alternatives into requirements or duplicate a fact across policy, story, and contract files.
39
+ Leave unresolved choices in `open-questions.md` with an owner and a next action in Approach. Append decisions and questions once; a decision row keeps its ID and is never removed, though its wording may be restated, and a question row is never edited; delete a question row when a decision settles it.
40
+ Do not silently turn discussion alternatives into requirements or duplicate a fact across policy, story, and contract files.
@@ -5,7 +5,7 @@ Use this sequence for /qfai-sdd. The shipped templates under ../templates/spec/
5
5
  ## Stage 0: source inventory
6
6
 
7
7
  1. Use the launcher established by
8
- `.qfai/assistant/rule/shared-skill-operating-baseline.md#canonical-qfai-launcher-mandatory`.
8
+ `.qfai/assistant/rule/shared-skill-operating-baseline.md#canonical-qfai-launcher`.
9
9
  Record its resolved package path and version in the SDD report. Check that
10
10
  the installed Stage 0 instructions support the procedure being used.
11
11
  2. Run `npx qfai sdd preflight` and read its `selectedInputPath` and `source`.
@@ -37,9 +37,9 @@ Use this sequence for /qfai-sdd. The shipped templates under ../templates/spec/
37
37
  ## Stage 1: triage and decisions
38
38
 
39
39
  Follow the triage reference. Classify each requirement against existing policy, flow, story, example, and contract content.
40
- Identify every affected flow. Put each approval-required operation to the user through the shared user-question
41
- protocol before a dependent write, and append its change request row to decisions.md once approved; record unresolved
42
- questions in open-questions.md. In --auto, ask nothing and stop dependent work. A declined change request is appended at REJECTED.
40
+ Identify every affected flow. Put each critical decision to the user through the shared user-question
41
+ protocol before a dependent write, and append a decisions.md row only when the decision passes the recording test;
42
+ record unresolved questions in open-questions.md. In --auto, ask nothing and stop dependent work.
43
43
 
44
44
  ## Stage 2: policy and flow
45
45
 
@@ -67,7 +67,7 @@ questions in open-questions.md. In --auto, ask nothing and stop dependent work.
67
67
 
68
68
  ## Concrete-abstract cycle
69
69
 
70
- When Stage 4 wrote or changed a BR Statement or Examples cell, run the concrete-abstract cycle before the gate: a sub-agent that wrote none of the BRs, started by the orchestrator and never by a stage worker, raises findings against the tree, the session agent decides them, the adopted changes are applied, and the affected BRs are rewritten. At most two cycles run.
70
+ When Stage 4 wrote or changed a BR Statement or Examples cell, run the concrete-abstract cycle before the gate: a sub-agent that wrote none of the BRs, started by the session agent and never by a stage worker, raises findings against the tree, the session agent decides them, the adopted changes are applied, and the affected BRs are rewritten. At most two cycles run.
71
71
 
72
72
  ## Stage 5: gate, review, and completion
73
73
 
@@ -82,9 +82,9 @@ For a contract-scoped change, apply the same gate to every existing BF whose obl
82
82
 
83
83
  The --contract selector accepts an existing contract ID or a repository-relative path under <paths.contractsDir>. Stop
84
84
  on an unknown target. Read the named contract, its paired contracts, and the AC and EX of every flow that cites them.
85
- Reconcile those existing obligations with the changed contract. After each authorized contract write, expand the
85
+ Reconcile those existing obligations with the changed contract. After each contract write, expand the
86
86
  affected-flow set and repeat until no new flow or contract write appears. Do not edit a story to make a contract-only
87
- change appear valid; widen the approved change request first. A confirm-only request checks without repair. If an
87
+ change appear valid; put the story change to the user first. A confirm-only request checks without repair. If an
88
88
  activated API contract still has no owning flow, leave it planned and report the gap.
89
89
 
90
90
  ## Parallel work
@@ -7,10 +7,10 @@ Use these checkpoints with the ordered stages of the SDD steps. A checked item r
7
7
  - The selected source is the preflight result's selectedInputPath, or an explicit user requirement named in the SDD report.
8
8
  - The selected discussion pack and applicable completed reviews were read and dispositioned. A disagreement was resolved in an SDD-owned artifact.
9
9
  - Every requirement has an affected policy, BF, US, EX, or contract path, or an open question that prevents a dependent write.
10
- - Only an approved change request, a declined change request, a critical decision the user made, and a justified `Test exception:` row are decision rows; a declined change request is a REJECTED `Change request:` row. Open questions are open-questions.md rows. An existing REJECTED row stays as it is.
11
- - Both tables have exactly ID, Content, Approach, Status. Existing rows are unchanged except Status.
12
- - Approval-required rows have the user's decision before any dependent write. Under --auto, pending approvals stopped the run without an invented approval.
13
- - New IDs use highest-in-scope plus one, including retired IDs in decision rows and the IDs open pull requests add.
10
+ - Only a decision the user made that passes the recording test, approvals included, and a justified `Test exception:` row are decision rows; a rejected option is a `Declined:` row. Open questions are open-questions.md rows.
11
+ - Both tables have exactly ID, Content, Approach. New rows take timestamp IDs; existing decision rows keep their IDs and are never removed, though their wording may be restated, and a question row was only deleted when a decision or a replacing question names it.
12
+ - Critical decisions have the user's answer before any dependent write. Under --auto, pending decisions stopped the run without an invented answer.
13
+ - New IDs use highest-in-scope plus one, including retired IDs and the IDs open pull requests add.
14
14
 
15
15
  ## Policy and business flow
16
16
 
@@ -49,7 +49,7 @@ Follow the cycle the `sdd-cycle` step sets out.
49
49
  - A finding resting on product intent nothing written states went to the user. A proposed EX that no existing BR, existing AC or the request implies was dropped.
50
50
  - Each adopted change took the route its target's age allows, and the affected BRs were rewritten from their updated EXs.
51
51
  - No more than two cycles ran, and a cycle that adopted nothing ended the loop. A finding still undecided at the end is one `Unadjudicated:` open-question row, and no other record was written.
52
- - No decided finding, and none a declined change request answers, was raised again.
52
+ - No decided finding, and none a declined change answers, was raised again.
53
53
 
54
54
  ## Validation and review
55
55
 
@@ -1,7 +1,7 @@
1
1
  # Pre-draft Grilling
2
2
 
3
3
  Before an SDD stage makes a design decision, the session agent gathers the stage's open decisions into one frontier.
4
- When the frontier holds a design decision the repository cannot settle, the agent settles the frontier in a delegated grilling session under `.qfai/assistant/rule/review-convergence.md#agent-to-agent-grilling-must`, using the `qfai-grilling` method. It asks the user each critical decision the frontier holds.
4
+ When the frontier holds a design decision the repository cannot settle, the agent settles the frontier in a delegated grilling session under `.qfai/assistant/rule/review-convergence.md#agent-to-agent-grilling`, using the `qfai-grilling` method. It asks the user each critical decision the frontier holds.
5
5
 
6
6
  When the request, the story tree, the contracts and the recorded decisions already settle every decision of the stage, the frontier is empty. Then no session is held and no griller starts. The stage writes what is settled, and its final report lists no adopted decision for the checkpoint.
7
7
 
@@ -9,7 +9,7 @@ When the request, the story tree, the contracts and the recorded decisions alrea
9
9
 
10
10
  | Stage | Decisions to settle before the write |
11
11
  | -------------------- | -------------------------------------------------------------------------------------------------------------------- |
12
- | Triage and records | Which existing BF or US expresses the request, which operation is justified, and which approval is needed. |
12
+ | Triage and records | Which existing BF or US expresses the request, which operation is justified, and which critical decisions it holds. |
13
13
  | Policy and flows | Which objective, principle, boundary, or process outcome belongs in each file. |
14
14
  | Stories and examples | Which actor outcome, failure, boundary, and concrete example is required. |
15
15
  | Contracts and rules | Which contract owns each BR, whether its EX is already written, and whether the contract can realize the obligation. |
@@ -18,14 +18,14 @@ The checkpoint occurs before this invocation's first design mutation in that sta
18
18
 
19
19
  ## Roles and disposition
20
20
 
21
- - The orchestrator starts the griller; a stage worker starts none.
22
- - Include the decisions of every role routed to draft the stage's artifacts in one frontier. Keep grilling and the final review apart: the reviewer reviews no decision it recommended.
21
+ - The session agent starts the griller.
22
+ - One frontier holds every decision the stage's drafts need. Keep grilling and the final review apart: the reviewer reviews no decision it recommended.
23
23
  - Read existing policy, decisions, open questions, discussion provenance, and current contracts before asking. Do not ask the user for facts already recorded there.
24
- - The session identifies options and failure cases and gives an evidence-based recommendation. A critical product decision goes to the user; an agent's preference cannot supply approval.
24
+ - The session identifies options and failure cases and gives an evidence-based recommendation. A critical product decision goes to the user; an agent's preference cannot supply the user's answer.
25
25
  - Settle a critical question before the affected author writes.
26
- - The stage's final report lists each decision a checkpoint adopted, with its reason. A skipped checkpoint fails the gate; it is not an implicit approval.
26
+ - The stage's final report lists each decision a checkpoint adopted, with its reason. A skipped checkpoint fails the gate; it is not an implicit answer.
27
27
 
28
- Each decision record carries the four labelled Approach items stated at the top of
28
+ Each decision record is a short decision record in the form stated at the top of
29
29
  `.qfai/assistant/skill/qfai-sdd/templates/spec/decisions.md`.
30
30
 
31
31
  Pre-draft grilling settles a premise before drafting. The independent reviewer gate then checks the written artifact, its traceability, and its validation evidence. Both are required.
@@ -9,8 +9,8 @@ The gate checks the story-tree files against their shipped templates, the docume
9
9
  - 02_business-flow/business-flows.md indexes real BF directories. Each business-flow.md has exactly one Mermaid flowchart or sequenceDiagram, in `## Flow`.
10
10
  - Each story directory holds exactly 01_User-story.md, 02_Acceptance-Criteria.md, and 03_Example.md.
11
11
  - The story tree was written from its paired templates under ../templates/spec/ and holds no heading, section, content kind or history they do not show, as the `Document shapes` section of the spec traceability rules sets out.
12
- - decisions.md and open-questions.md have four cells per row: ID, Content, Approach, Status. Existing rows changed only in Status.
13
- - Each change the user approved, retirement included, has its `Change request:` decision row recording who approved it, when, and the option chosen. No row records a decision the agent took. Unanswered critical decisions have open-question rows and prevent completion.
12
+ - decisions.md and open-questions.md have three cells per row: ID, Content, Approach. No existing decision row was removed or renumbered (its wording may be restated), and no existing question row was edited.
13
+ - A decision row records a decision the user made that passes the recording test, with who decided it, when, and the option chosen. No row records a decision the agent took. Unanswered critical decisions have open-question rows and prevent completion.
14
14
 
15
15
  ## Traceability and contracts
16
16
 
@@ -42,4 +42,4 @@ Do not use a sibling's in-flight findings to hold or clear the current flow. Rec
42
42
  - The final report lists each decision a checkpoint adopted, with its reason.
43
43
  - Reviewers are independent of authors, and every finding of the one review is fixed or answered under `.qfai/assistant/rule/review-convergence.md`.
44
44
  - Evidence records the source, changed IDs and files, contract executability, commands, reviewer verdicts, rejected options excluded, and remaining risks.
45
- - No approval-required operation is treated as approved from silence, --auto, or a generic instruction to continue.
45
+ - No critical decision is treated as answered from silence, --auto, or a generic instruction to continue.