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
@@ -4,11 +4,6 @@ owner: qfai-implement
4
4
  purpose: "Repair a defective test, at whatever layer, so that it checks what its business flow, criterion or example states and nothing else."
5
5
  requires:
6
6
  - common-gate-run
7
- roles:
8
- - frontend-engineer
9
- - backend-engineer
10
- - acceptance-test-engineer
11
- routing-profile: default
12
7
  ---
13
8
 
14
9
  # implement-test-fix
@@ -3,9 +3,6 @@ name: implement-tooling
3
3
  owner: qfai-implement
4
4
  purpose: "Change a workflow, a script or a development tool, record whether the change reaches the CI the project ships to others, and record any release-path check that has to wait for the next release."
5
5
  requires: [common-gate-run]
6
- roles:
7
- - devops-ci-engineer
8
- routing-profile: default
9
6
  ---
10
7
 
11
8
  # implement-tooling
@@ -3,8 +3,6 @@ name: maintain-edit
3
3
  owner: qfai-maintain
4
4
  purpose: "Change wording, a typo, a code comment or document prose inside the write scope, with no behaviour change, and stop before any edit that has a semantic effect."
5
5
  requires: [common-gate-run]
6
- roles: [doc-steward]
7
- routing-profile: default
8
6
  ---
9
7
 
10
8
  # maintain-edit
@@ -44,20 +42,16 @@ changes.
44
42
  In the `resolve-conflicts` route, the step merges the named base into the
45
43
  branch and keeps every record's meaning. `verify-commit` concludes the merge.
46
44
 
47
- 1. Fetch the base (`git fetch`), then on a clean tree, before the merge,
48
- renumber every `decisions.md` row the branch added, from the lowest one
49
- whose ID the fetched base now declares upward, lowest first, by the
50
- `npx qfai sdd renumber-decision` procedure in
51
- `.qfai/assistant/skill/qfai-sdd/references/sdd-triage.md` (two branches
52
- taking the same ID), and commit after each run. The union merge of
53
- `decisions.md` duplicates a colliding ID without a conflict, so this runs
54
- first. When a merge has already stopped with conflicts, run
55
- `git merge --abort`, renumber, and merge again.
56
- 2. Start or resume the merge with `git merge --no-commit <base>`.
57
- 3. Resolve each conflict. The base's item keeps its ID; never rename it. An
58
- item the branch added whose ID collides takes the next free ID of its scope,
59
- with every citation of it. Every other edit only keeps what one side already
60
- had: what each side added to a conflicting block.
45
+ 1. Fetch the base (`git fetch`).
46
+ 2. Start or resume the merge with `git merge --no-commit <base>`. The union
47
+ merge resolves `decisions.md`, its pages and `open-questions.md` by keeping
48
+ both sides' rows. Edit, move and renumber no register row, except that a
49
+ question row the union merge kept although one side deleted it is deleted
50
+ again, since that deletion settled the question.
51
+ 3. Resolve each other conflict. The base's item keeps its ID; never rename it.
52
+ A story-tree item the branch added whose ID collides takes the next free ID
53
+ of its scope, with every citation of it. Every other edit only keeps what
54
+ one side already had: what each side added to a conflicting block.
61
55
 
62
56
  Stop before the edit, as [A semantic effect](#a-semantic-effect) says, on any
63
57
  of these:
@@ -72,8 +66,11 @@ of these:
72
66
  file or a lockfile, stops: its owner route resolves or regenerates it.
73
67
  - A conflict in a pin or digest file, or in a file with an owner marker or a
74
68
  CODEOWNERS entry, stops.
75
- - After the merge, check each union-merged register, such as `decisions.md`,
76
- for an ID declared twice. A duplicate is a semantic effect: stop.
69
+ - After the merge, check each union-merged register for an ID declared twice.
70
+ Stop, and name the ID. A row the base holds is never renumbered: when the
71
+ branch's own unmerged row collides, the branch deletes that row and appends
72
+ it again under a new timestamp ID, updating the citations of it the branch
73
+ added.
77
74
 
78
75
  ### Several branches
79
76
 
@@ -102,8 +99,7 @@ own run of this route, one branch at a time, with every rule above.
102
99
 
103
100
  ## The edit
104
101
 
105
- `doc-steward` makes the edit and runs the checks. The orchestrator makes no edit
106
- itself.
102
+ The session agent makes the edit and runs the checks itself.
107
103
 
108
104
  1. Read the write scope. Edit nothing outside it.
109
105
  2. Before editing, judge whether each planned edit has a semantic effect: a
@@ -161,5 +157,6 @@ its reason, and every check run over the changed files exited 0. The review that
161
157
  follows (`implementation-reviewer`) confirms the diff changes no behaviour; the
162
158
  reviewer is never the agent that made the edit. In the `resolve-conflicts`
163
159
  route, that review runs as `common-review-cycle` says: a resolution that
164
- touches no story-tree file, contract or register row gets no reviewer. The
160
+ touches no story-tree file or contract gets no reviewer, and the union merge of
161
+ the registers adds none. The
165
162
  combined diff passes the added-line check before `verify-commit` commits.
@@ -3,8 +3,6 @@ name: prototyping-grill
3
3
  owner: qfai-prototyping
4
4
  purpose: "Settle by a delegated grilling session what the prototype is for, before the loop builds anything."
5
5
  requires: []
6
- roles: [orchestrator, product-experience-architect]
7
- routing-profile: default
8
6
  ---
9
7
 
10
8
  # prototyping-grill
@@ -125,9 +123,9 @@ user's behalf — with more evidence than before, and still not the user's answe
125
123
  that re-opens a frozen requirement produces an answer that drifts from it.
126
124
  What is left is what the session is for.
127
125
  3. Run the session. **It is delegated** (`.agents/rules/grilling.md` § Two
128
- kinds of session). The orchestrator starts the griller, never a stage
129
- worker. The griller interviews the agents that generate and review the
130
- prototype, and each decision that is not critical takes its
126
+ kinds of session). The session agent starts the griller, never a stage
127
+ worker. The griller interviews the session agent, which generates the
128
+ prototype; the evaluator is not interviewed. Each decision that is not critical takes its
131
129
  recommendation. `DESIGN.md` is frozen from the discussion stage's answers, so
132
130
  a question of taste or purpose it already answers is adopted from it. One it
133
131
  leaves open is product intent, which is critical, and goes to the user.
@@ -151,7 +149,7 @@ and name it.
151
149
  and `## Escalated` for a critical decision the user has yet to settle, plus
152
150
  `## Run scope` when the run is scoped (see [Run scope](#run-scope)). The
153
151
  generator and the reviewer both take that file as an input — named in
154
- `prototyping-loop`'s `## Evaluator Inputs (Mandatory)` and in the generator's
152
+ `prototyping-loop`'s `## Evaluator Inputs` and in the generator's
155
153
  contract set — because a decision the loop cannot read is one it will
156
154
  contradict on the next iteration, and the user will be asked to re-settle what they
157
155
  already settled.
@@ -3,8 +3,6 @@ name: prototyping-handoff
3
3
  owner: qfai-prototyping
4
4
  purpose: "Publish the prototype the user confirmed and record the handoff for implementation."
5
5
  requires: []
6
- roles: [orchestrator, product-experience-architect, devops-ci-engineer]
7
- routing-profile: default
8
6
  ---
9
7
 
10
8
  # prototyping-handoff
@@ -3,16 +3,15 @@ name: prototyping-loop
3
3
  owner: qfai-prototyping
4
4
  purpose: "Build and review one prototype lineage per UI contract and screen, and put each reviewed prototype to the user until they confirm it."
5
5
  requires: []
6
- roles: [orchestrator, product-experience-architect, product-surface-reviewer, devops-ci-engineer]
7
- routing-profile: default
8
6
  ---
9
7
 
10
8
  # prototyping-loop
11
9
 
12
10
  The build and review loop. Each iteration builds a prototype under root
13
11
  `DESIGN.md`, has it reviewed, and puts it to the user. The loop ends when the
14
- user confirms the prototype; until then it runs another iteration on the user's
15
- answer. No command, score or check decides that the loop is done.
12
+ user confirms the prototype, or when a restyle with nothing to fix stops before
13
+ iteration 00; until then it runs another iteration on the user's answer. No
14
+ command, score or check decides that the loop is done.
16
15
 
17
16
  ## Reads
18
17
 
@@ -25,8 +24,12 @@ answer. No command, score or check decides that the loop is done.
25
24
  - `.qfai/prototype/iter-NN/index.html` (the generator), and in a `restyle`
26
25
  loop the project's stylesheet and motion files it restyles.
27
26
  - `.qfai/prototype/iter-NN/review.json` and
28
- `iter-NN/<ui-contract-id>/<screen>.review.json` (the reviewer).
29
- - `.qfai/prototype/progress.md` (the orchestrator).
27
+ `iter-NN/<ui-contract-id>/<screen>.review.json` (the reviewer); in an
28
+ iteration with variants, the same files under `iter-NN/variant-<id>/`.
29
+ - `.qfai/prototype/progress.md` (the session agent).
30
+ - In a `restyle` loop, `.qfai/prototype/baseline/<ui-contract-id>/<screen>.txt`
31
+ (the session agent), before iteration 00, and the audit lines and
32
+ `restyleLevel` in `progress.md`.
30
33
  - The session rows of `.qfai/prototype/grilling.md`.
31
34
 
32
35
  ## Required References
@@ -47,25 +50,25 @@ answer. No command, score or check decides that the loop is done.
47
50
 
48
51
  ## Delegation Scope Table
49
52
 
50
- Generation and review use two distinct sub-agent identities. The reviewer
51
- operates Playwright during the assessment and returns its review payloads;
52
- it has no write access, so the orchestrator writes them. There is
53
- no fixed capture identity: a screenshot is taken by whoever needs it. The build
54
- owner is separate from this identity rule. The orchestrator starts every role
55
- in the table below, the generator included, and never a stage worker.
53
+ The session agent generates, implements and builds; `product-surface-reviewer`
54
+ reviews, started from a fresh context and a black-box brief, never with the
55
+ session's conversation. The reviewer operates Playwright during the assessment
56
+ and returns its review payloads; it has no write access, so the session agent
57
+ writes them. There is no fixed capture identity: a screenshot is taken by
58
+ whoever needs it.
56
59
 
57
- | Work | Allowed Role |
58
- | --------------------------------------------- | ------------------------------------ |
59
- | Generation and implementation | product-experience-architect |
60
- | Live Playwright review and evaluation scoring | product-surface-reviewer |
61
- | Build | devops-ci-engineer, backend-engineer |
60
+ | Work | Owner |
61
+ | --------------------------------------------- | -------------------------- |
62
+ | Generation and implementation | The session agent |
63
+ | Live Playwright review and evaluation scoring | `product-surface-reviewer` |
64
+ | Build | The session agent |
62
65
 
63
66
  Record `targetIterations`, `evaluationAxesSource`, `delegationMap` and
64
67
  `plannedAt` in `.qfai/prototype/progress.md` before the first review.
65
68
  `targetIterations` is an estimate of the iterations before the user confirms;
66
69
  the loop does not stop at it. Report an
67
- assignment that gives generation and review to one identity before either
68
- runs.
70
+ assignment that gives review scoring to the session agent, or generation to
71
+ the reviewer, before either runs.
69
72
 
70
73
  ## Iteration kind
71
74
 
@@ -89,6 +92,45 @@ qualifier `restyle` is planned with only such scopes.
89
92
  If the route's scope has no implement stage, stop and ask the user to re-plan
90
93
  before iteration 00.
91
94
 
95
+ ### Before a restyle edits anything
96
+
97
+ The session agent does two things before iteration 00 changes a file:
98
+
99
+ 1. **Baseline.** Open each in-scope live route with the setup its link names
100
+ and save the text the screen shows to
101
+ `.qfai/prototype/baseline/<ui-contract-id>/<screen>.txt`. Capture it twice
102
+ and leave out only text that differs between the two captures, such as a
103
+ clock. The reviewer of every restyle iteration compares the route with it.
104
+ 2. **Audit.** Read the rendered routes against
105
+ `.qfai/assistant/skill/qfai-sdd/references/design-anti-patterns.md` and
106
+ root `DESIGN.md`, one line per finding with the screen and the place it
107
+ sits. Record `restyleLevel` in `progress.md` beside `iterationKind`, with
108
+ the audit lines under it. The level is the session agent's judgement of
109
+ those lines:
110
+
111
+ | Level | When | What the restyle changes |
112
+ | ---------- | ------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
113
+ | `full` | Many patterns across several aspects | Every aspect the stylesheet and motion reach |
114
+ | `targeted` | A few patterns on screens that are otherwise deliberate | Only what the audit found; the palette, type and layout stay, and larger ideas go to the report as suggestions |
115
+ | `none` | No pattern | At most three refinements, each with exact values; only those the user accepts, listed in `progress.md` |
116
+
117
+ Every level stays within the root `DESIGN.md` tokens: a fix that needs a
118
+ value `DESIGN.md` does not declare is reported as a `DESIGN.md` change, not
119
+ made.
120
+
121
+ Put the audit and the level to the user before the first edit, so they can
122
+ steer it. A screen that is already good is not changed to be different: at
123
+ `none`, iteration 00 applies only the refinements the user accepted, and
124
+ when the user accepts none, the run ends there as **Stopped**, with no edit
125
+ and no handoff; the route's later stages then change nothing, and the final
126
+ report says the screens were left as they were. Under a no-question mode, the
127
+ level is taken as an assumption the report names; at `none` nobody can accept
128
+ a refinement, so the run stops before iteration 00.
129
+
130
+ The baseline is written afresh each run, replacing the files of the last one.
131
+ It holds the live app's text, which can be real customer data: like the rest
132
+ of `.qfai/prototype/`, it is a working file and is not committed.
133
+
92
134
  ## Run scope
93
135
 
94
136
  Each run records `runScope` in `progress.md` afresh, beside `iterationKind`,
@@ -112,31 +154,45 @@ answer: those start with this run.
112
154
 
113
155
  With `runScope` absent, every screen is in scope and nothing here applies.
114
156
 
157
+ ## Variants
158
+
159
+ Record `variants` in `progress.md` with the planning fields above, before the
160
+ run's first iteration: `A, B` or `A, B, C` when the direction is open, else
161
+ `none`. The iteration loop reference's First-iteration variants section says
162
+ when it is open and where each variant's review goes. Only that first
163
+ iteration has variants: set `variants` to `none` before the next iteration,
164
+ which builds one prototype from the user's answer.
165
+
115
166
  ## Procedure
116
167
 
117
168
  Run these for iteration `NN`: the next index after the iterations already
118
169
  under `.qfai/prototype/`, or `00` when there are none.
119
170
 
120
- 1. **Generator** (product-experience-architect). Reads the contracts,
171
+ 1. **Generator** (the session agent). Reads the contracts,
121
172
  `.qfai/prototype/grilling.md`, the generator prompt, the `DESIGN.md` tokens
122
173
  and, from the run's second iteration on, this run's latest reviews and the
123
174
  user's last answer. In a scoped run it also reads `runScope` in `progress.md` and
124
175
  `.qfai/prototype/final/index.html`, every iteration. It starts from the
125
176
  primary UI contract preflight resolved: the one the request names, else
126
177
  `prototyping.primaryUiContract`. Writes
127
- `.qfai/prototype/iter-NN/index.html`.
128
- 2. **Build** (devops-ci-engineer). Serves `.qfai/prototype/` at the URL
178
+ `.qfai/prototype/iter-NN/index.html`, holding every variant when this is
179
+ the run's first iteration and `variants` is not `none`.
180
+ 2. **Build** (the session agent). Serves `.qfai/prototype/` at the URL
129
181
  preflight checked, starting the server on the first iteration and keeping it
130
- running for the loop, and hands `<url>/iter-NN/` to the reviewer.
182
+ running for the loop, and hands `<url>/iter-NN/` to the reviewer. In an
183
+ iteration with variants it starts one fresh reviewer per variant and hands
184
+ each only `<url>/iter-NN/?variant=<id>`.
131
185
  3. **Reviewer** (product-surface-reviewer). Opens that URL, operates
132
186
  Playwright live and returns the payload for each UI contract and screen
133
187
  pair, and the per-iteration summary aggregated from them, per the reviewer
134
188
  prompt: the four ordinal UX axes, a critique of at most 500 words,
135
189
  `blockingFindings`, `layoutAntiPatternsDetected[]`,
136
- `designMdViolations[]` and `pivotDirective`.
137
- 4. **Orchestrator.** Writes each payload to
190
+ `designMdViolations[]` and `pivotDirective`. A variant's reviewer reviews
191
+ that variant alone and never opens another.
192
+ 4. **Session agent.** Writes each payload to
138
193
  `iter-NN/<ui-contract-id>/<screen>.review.json` and the summary to
139
- `iter-NN/review.json`. Each payload is checked against the closed schema
194
+ `iter-NN/review.json`. Each variant's files go under `iter-NN/variant-<id>/`.
195
+ Each payload is checked against the closed schema
140
196
  before it is written, and one that does not conform is asked for again. A
141
197
  summary whose `layoutAntiPatternsDetected[]` is not empty scores
142
198
  `informationArchitecture` at most `acceptable`; a higher score is written as
@@ -160,6 +216,15 @@ Show the user where the prototype is, the four scores, and every blocking
160
216
  finding, layout anti-pattern and `DESIGN.md` violation the review lists. The
161
217
  review informs the answer; it does not replace it.
162
218
 
219
+ With variants, the reaction is put as one compare sheet, not through
220
+ `AskUserQuestion`: the sheet follows `.agents/rules/reply-forms.md`, in its
221
+ carrier order and reply text, and shows each variant's `?variant=<id>`
222
+ address, scores, blocking findings, layout anti-patterns and `DESIGN.md`
223
+ violations. A reply whose `keep from` line names another variant is a
224
+ combination. A reply with no `pick:` whose `why:` turns down every variant is
225
+ a rejection. Neither the agent nor a review's scores pick a variant. The sheet
226
+ recommends only as `.agents/rules/reply-forms.md` § 1 permits.
227
+
163
228
  Record the answer in `.qfai/prototype/grilling.md` under `## Session`,
164
229
  **replacing any row with the same `Scope` and decision rather than adding beside
165
230
  it, and removing its row from `## Escalated`** — the file is the current state
@@ -167,6 +232,10 @@ of the tree, not its history.
167
232
 
168
233
  How the session ends decides the route:
169
234
 
235
+ - **A pick, a combination or a rejection** — the answer to an iteration with
236
+ variants — runs the next iteration as one prototype: the variant picked, the
237
+ parts combined, or a pivot carrying the rejection. An iteration with
238
+ variants is never confirmed as it stands, so its handoff does not run.
170
239
  - **Confirmed** — the user says the prototype is done — goes to
171
240
  `prototyping-handoff`. A blocking finding the latest review still lists does
172
241
  not stop it; the final report names it.
@@ -178,18 +247,23 @@ How the session ends decides the route:
178
247
  every other open decision as a labelled assumption and asks this question
179
248
  again. It is what the loop exists to answer, so a closure cannot assume it.
180
249
  - **Stopped** — the user said `stop` — ends the run there and reports every
181
- open decision as open.
250
+ open decision as open. A restyle at `none` with no refinement accepted ends
251
+ the same way, as _Before a restyle edits anything_ says.
182
252
 
183
253
  Under a no-question mode nobody can answer, so the question is written to
184
254
  `## Escalated` and the run stops there. A reviewer's scores are not the user's
185
255
  confirmation.
186
256
 
187
- ## Evaluator Inputs (Mandatory)
257
+ ## Evaluator Inputs
188
258
 
189
259
  - The live prototype, opened in the reviewer's own Playwright session.
260
+ - In a `restyle` iteration, each route's baseline at
261
+ `.qfai/prototype/baseline/<ui-contract-id>/<screen>.txt`.
190
262
  - Root `DESIGN.md` (read-only), `axisDefs`, `previousScore` and
191
263
  `designSystemChecklist`. `previousScore` and the prior reviews come from
192
- this run's own iterations; the run's first iteration has none.
264
+ this run's own iterations; the run's first iteration has none. After an
265
+ iteration with variants they are read as the iteration loop reference's
266
+ First-iteration variants section says.
193
267
  - The prior `review.json` files and `progress.md`.
194
268
  - The layout anti-pattern registry the package ships.
195
269
  - `.qfai/prototype/grilling.md` — what the prototype is for, what counts as
@@ -201,8 +275,9 @@ confirmation.
201
275
 
202
276
  ## Critical Constraints
203
277
 
204
- - One lineage only — no parallel candidates, no best-of-history; the latest
205
- iteration is always the one put to the user.
278
+ - One prototype per iteration, except the variants of a run's first iteration
279
+ while the direction is open; no best-of-history; the latest iteration is
280
+ always the one put to the user.
206
281
  - Token-only colors, fonts, radii and shadows — a value `DESIGN.md` does not
207
282
  declare lands in `designMdViolations[]`.
208
283
  - No `mode / round / polish / branch / concept-fit` artifacts.
@@ -3,8 +3,6 @@ name: prototyping-preflight
3
3
  owner: qfai-prototyping
4
4
  purpose: "Confirm the UI contracts, the root DESIGN.md and the Playwright environment the loop needs."
5
5
  requires: [common-design-md]
6
- roles: [orchestrator, devops-ci-engineer, product-experience-architect]
7
- routing-profile: default
8
6
  ---
9
7
 
10
8
  # prototyping-preflight
@@ -3,8 +3,6 @@ name: sdd-contract
3
3
  owner: qfai-sdd
4
4
  purpose: "Write the contracts and business rules the flow's examples need, or repair one named contract."
5
5
  requires: []
6
- roles: [solution-architect, test-design-analyst, product-experience-architect]
7
- routing-profile: default
8
6
  ---
9
7
 
10
8
  # sdd-contract
@@ -40,8 +38,8 @@ number is never reused. The file is `<kind>-NNNN-<slug>.<ext>`, and it declares
40
38
  its ID once: in the H1 of a Markdown contract (`# CLI-0001: <title>`), or on a
41
39
  `QFAI-CONTRACT-ID: API-0002` line in YAML or SQL.
42
40
 
43
- Write only what the user approved, as
44
- `.qfai/assistant/skill/qfai-sdd/references/sdd-triage.md#a-change-to-the-story-tree`
41
+ Write only the triaged scope, as
42
+ `.qfai/assistant/skill/qfai-sdd/references/sdd-triage.md#critical-decisions-and-no-question-mode`
45
43
  states.
46
44
 
47
45
  ## Procedure
@@ -76,14 +74,14 @@ surface also needs the root `DESIGN.md`, which `common-design-md` writes and
76
74
  validates after this step. A CLI-only surface does not require one. Do not
77
75
  adopt a sample design.
78
76
 
79
- Each screen records its copy decisions in the contract: `supplements` and, for any
80
- heading beyond the title, `structure`. Check every text element the discussion or
81
- the story proposes against the screen's tasks and the information the user needs at
82
- that point. A text that repeats a heading, an action, or a condition the user already
83
- has is left out; one that carries a condition, cost, destination, result, recovery
84
- step or consequence stays, with its reason. Fix a control that needs explaining
85
- before adding text for it. The discussion sidecar stays an input; the contract is
86
- the one place the decision is written.
77
+ Check every text element the discussion or the story proposes against the
78
+ screen's tasks and the information the user needs at that point. A text that
79
+ repeats a heading, an action, or a condition the user already has is left out;
80
+ one that carries a condition, cost, destination, result, recovery step or
81
+ consequence stays, with its reason. Fix a control that needs explaining before
82
+ adding text for it. A screen may describe the copy that stays in its optional
83
+ `supplements` and `structure`; `npx qfai validate` does not check them, and the
84
+ reason that counts is the `qfai-text` comment written in the UI source.
87
85
 
88
86
  ## A named contract
89
87
 
@@ -94,21 +92,22 @@ the run.
94
92
  1. Scope the work to the named contract, its paired contracts, and the existing
95
93
  flows whose AC, EX, or BR depend on them.
96
94
  2. Read every affected flow's existing AC and EX and the paired contracts, then
97
- repair only the contract scope approved by the change request. No previous
98
- triage approval can substitute for approval of a new change-request row.
95
+ repair only the triaged contract scope. A repair outside it that is a
96
+ critical decision goes to the user first; an earlier answer covers only the
97
+ change it described.
99
98
  3. Recompute affected flows after each contract change until no new flow or
100
99
  contract write is found. Gather the newly exposed decisions and grill again
101
100
  before the next mutation.
102
- 4. Do not silently rewrite a story in this mode; ask for a wider change request
103
- when only the story can move.
104
- 5. A `confirm-only` change request stays read-only and stops on a mismatch.
101
+ 4. Do not silently rewrite a story in this mode; put the story change to the
102
+ user as a critical decision when only the story can move.
103
+ 5. A `confirm-only` request stays read-only and stops on a mismatch.
105
104
  6. An activated API contract without an owning flow remains planned until an
106
105
  owner is established.
107
106
 
108
107
  ## Gate
109
108
 
110
- `solution-architect` accepts the connected BF → US → AC → EX ← BR design and
111
- its contract realization before `sdd-gate` runs.
109
+ The connected BF → US → AC → EX ← BR design and its contract realization hold
110
+ before `sdd-gate` runs; the specification review checks both.
112
111
 
113
112
  ## Passes when
114
113
 
@@ -3,8 +3,6 @@ name: sdd-cycle
3
3
  owner: qfai-sdd
4
4
  purpose: "Check the business rules against the examples they generalize, and apply what at most two cycles adopt."
5
5
  requires: []
6
- roles: [test-design-analyst, requirements-analyst, solution-architect]
7
- routing-profile: default
8
6
  ---
9
7
 
10
8
  # sdd-cycle
@@ -19,7 +17,7 @@ rules against their examples. Follow
19
17
  the Examples cell of a BR. No cycle runs when it changed none, even if an AC
20
18
  or EX changed, or in an append stage.
21
19
  - **Finder.** A sub-agent that wrote none of those BRs reads them, the EXs they
22
- cite and the EXs this invocation wrote or changed. The orchestrator starts
20
+ cite and the EXs this invocation wrote or changed. The session agent starts
23
21
  it, never a stage worker. It raises findings of five kinds: a case the rule
24
22
  implies that no example states, a redundant example, an example no rule
25
23
  explains, a rule its examples do not support, and a flow, story or criterion
@@ -29,17 +27,16 @@ rules against their examples. Follow
29
27
  - **Scope.** A proposed EX must be implied by an existing BR, an existing AC or
30
28
  the request; otherwise the session drops it.
31
29
  - **Applying.** An item this invocation wrote changes directly. An item that
32
- existed before changes only under an in-force `Change request:` row whose
33
- approved change covers the change, or on the user's approval. A BF or US
34
- split, merge, creation or retirement is put to the user. Under `--contract`,
35
- a story change asks for a wider change request. Rewrite the affected BRs
36
- afterwards.
30
+ existed before changes directly when the user's request names the change, and
31
+ otherwise is put to the user as a critical decision. A BF or US split, merge,
32
+ creation or retirement is put to the user. Under `--contract`, a story change
33
+ is put to the user. Rewrite the affected BRs afterwards.
37
34
  - **Stop.** At most two cycles; a cycle that adopts nothing ends the loop. A
38
- finding still undecided at the end becomes one `open-questions.md` row at
39
- TODO whose Content opens `Unadjudicated:`. No other record is written.
35
+ finding still undecided at the end becomes one `open-questions.md` row
36
+ whose Content opens `Unadjudicated:`. No other record is written.
40
37
  - **Not raised again.** A finding matching one the session decided, by kind,
41
38
  target IDs and an equal, including or included case, is not raised again,
42
- nor one a declined change request already answers.
39
+ nor one a declined change already answers.
43
40
 
44
41
  ## Passes when
45
42
 
@@ -3,8 +3,6 @@ name: sdd-flow
3
3
  owner: qfai-sdd
4
4
  purpose: "Write the policy and technology facts and the business flows the triage decided to change."
5
5
  requires: []
6
- roles: [requirements-analyst, solution-architect, product-experience-architect]
7
- routing-profile: default
8
6
  ---
9
7
 
10
8
  # sdd-flow
@@ -13,7 +11,7 @@ Stage 2 of the story tree: policy and business flows.
13
11
 
14
12
  ## Reads
15
13
 
16
- - The triage decisions `sdd-triage` made, and the scope the user approved.
14
+ - The triage decisions `sdd-triage` made, and the scope it triaged.
17
15
  Write only that scope.
18
16
  - The paired templates under
19
17
  `.qfai/assistant/skill/qfai-sdd/templates/spec/01_policy/`,
@@ -34,8 +32,8 @@ Stage 2 of the story tree: policy and business flows.
34
32
  - `02_business-flow/business-flows.md` and each affected
35
33
  `business-flow-NNNN/business-flow.md`.
36
34
 
37
- Use the paired template for every file. Write only what the user approved, as
38
- `.qfai/assistant/skill/qfai-sdd/references/sdd-triage.md#a-change-to-the-story-tree`
35
+ Use the paired template for every file. Write only the triaged scope, as
36
+ `.qfai/assistant/skill/qfai-sdd/references/sdd-triage.md#critical-decisions-and-no-question-mode`
39
37
  states.
40
38
 
41
39
  ## Procedure
@@ -98,9 +96,30 @@ states.
98
96
  8. Allocate BF IDs as
99
97
  `.qfai/assistant/skill/qfai-sdd/references/sdd-triage.md#id-allocation`
100
98
  states, and add the new rows to the flow index.
99
+ 9. Parse the diagrams in the Markdown files this step wrote, as
100
+ `.qfai/assistant/step/discussion-pack/STEP.md#parse-the-diagrams` says, with
101
+ those files in place of the pack directory:
102
+ - First do steps 1 to 3 there. Where the project has no `node_modules/qfai`,
103
+ they install the release and read the parser versions from it. They
104
+ install the parser into `tmp/qfai-mermaid`, never into the project's
105
+ dependency tree.
106
+ - Then run the checker:
107
+
108
+ ```bash
109
+ node node_modules/qfai/assets/scripts/check-mermaid.mjs --tools tmp/qfai-mermaid <files written>
110
+ ```
111
+
112
+ Where step 1 installed the release, run its checker instead:
113
+
114
+ ```bash
115
+ node tmp/qfai-release/node_modules/qfai/assets/scripts/check-mermaid.mjs --tools tmp/qfai-mermaid <files written>
116
+ ```
117
+
118
+ - Fix each diagram it rejects. When the install or the run fails for
119
+ another reason, report the syntax check as not run, never as passed.
101
120
 
102
121
  ## Passes when
103
122
 
104
- Read first: the triage decisions and the scope the user approved. The step passes when
123
+ Read first: the triage decisions and the triaged scope. The step passes when
105
124
  that scope changes no policy fact, no `tech.md` entry and no flow document. The
106
125
  pass names the triage decisions it read.
@@ -3,7 +3,6 @@ name: sdd-gate
3
3
  owner: qfai-sdd
4
4
  purpose: "Validate each affected business flow on its own and report its result."
5
5
  requires: [common-gate-run]
6
- roles: []
7
6
  ---
8
7
 
9
8
  # sdd-gate
@@ -3,8 +3,6 @@ name: sdd-story
3
3
  owner: qfai-sdd
4
4
  purpose: "Write the stories, acceptance criteria and examples of each affected flow."
5
5
  requires: []
6
- roles: [requirements-analyst, test-design-analyst, qa-strategist, product-experience-architect]
7
- routing-profile: default
8
6
  ---
9
7
 
10
8
  # sdd-story
@@ -13,7 +11,7 @@ Stage 3 of the story tree: stories and examples.
13
11
 
14
12
  ## Reads
15
13
 
16
- - The triage decisions `sdd-triage` made and the scope the user approved, and
14
+ - The triage decisions `sdd-triage` made and the scope it triaged, and
17
15
  the flows `sdd-flow` wrote.
18
16
  - The paired templates under
19
17
  `.qfai/assistant/skill/qfai-sdd/templates/spec/02_business-flow/business-flow-NNNN/`.
@@ -34,8 +32,8 @@ Stage 3 of the story tree: stories and examples.
34
32
  - The `// QFAI:EX-NNNN-NNNN-NN` annotation line that maps an example to an
35
33
  existing test, as procedure item 9 states, and nothing else in a test file.
36
34
 
37
- Write only what the user approved, as
38
- `.qfai/assistant/skill/qfai-sdd/references/sdd-triage.md#a-change-to-the-story-tree`
35
+ Write only the triaged scope, as
36
+ `.qfai/assistant/skill/qfai-sdd/references/sdd-triage.md#critical-decisions-and-no-question-mode`
39
37
  states.
40
38
 
41
39
  ## Procedure
@@ -47,7 +45,7 @@ states.
47
45
  `.qfai/assistant/skill/qfai-sdd/references/sdd-triage.md#capacity-before-writing`.
48
46
  Report the retired-inclusive remaining capacity and requested count, and
49
47
  stop an over-capacity batch before any dependent declaration.
50
- For an approved capacity-only sibling or actual move, read
48
+ For a capacity-only sibling or actual move the user decided, read
51
49
  `.qfai/assistant/skill/qfai-sdd/references/sdd-triage.md#capacity-partition`
52
50
  and its following complete-map procedure before the affected write.
53
51
  2. Write the story index and the three files of each affected story, each in
@@ -71,8 +69,8 @@ states.
71
69
  AC/API or Integration, and EX/other test obligations. Do not author
72
70
  acceptance tests in this step. Item 9's annotation line is not test
73
71
  authoring.
74
- 7. Retire a story by removing its directory under the change request that names
75
- it, and never recycle its IDs.
72
+ 7. Retire a story, once the user has decided it, by removing its directory, and
73
+ never recycle its IDs.
76
74
  8. Where a decision replaced a claim, such as an input, a threshold or a
77
75
  count, search the whole story tree and the contracts for the old claim
78
76
  before finishing. List each hit in the stage report, with what it now