qfai 2.2.0 → 2.3.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 (206) hide show
  1. package/README.md +60 -23
  2. package/assets/defaults/workflows/bump-dependency.yml +4 -1
  3. package/assets/defaults/workflows/decide-design.yml +5 -1
  4. package/assets/defaults/workflows/rename-concept.yml +30 -0
  5. package/assets/defaults/workflows/resolve-conflicts.yml +14 -0
  6. package/assets/defaults/workflows/retire-feature.yml +26 -0
  7. package/assets/defaults/workflows/run-release.yml +12 -0
  8. package/assets/init/.claude/settings.json +11 -11
  9. package/assets/init/.codex/hooks.json +9 -9
  10. package/assets/init/.qfai/assistant/agent/architecture-reviewer.md +2 -2
  11. package/assets/init/.qfai/assistant/agent/fullstack-engineer.md +101 -0
  12. package/assets/init/.qfai/assistant/agent/implementation-reviewer.md +78 -1
  13. package/assets/init/.qfai/assistant/agent/product-surface-reviewer.md +10 -5
  14. package/assets/init/.qfai/assistant/agent/requirements-reviewer.md +12 -2
  15. package/assets/init/.qfai/assistant/rule/agent-selection.md +22 -42
  16. package/assets/init/.qfai/assistant/rule/constitution.md +5 -3
  17. package/assets/init/.qfai/assistant/rule/drift-protocol.md +19 -1
  18. package/assets/init/.qfai/assistant/rule/references/asset-authoring.md +1 -1
  19. package/assets/init/.qfai/assistant/rule/references/codex-delegation.md +4 -4
  20. package/assets/init/.qfai/assistant/rule/references/gate-failure-autorepair.md +1 -1
  21. package/assets/init/.qfai/assistant/rule/references/reviewer-findings.md +1 -1
  22. package/assets/init/.qfai/assistant/rule/references/worker-edit-boundary.md +3 -3
  23. package/assets/init/.qfai/assistant/rule/research-first-protocol.md +7 -6
  24. package/assets/init/.qfai/assistant/rule/review-convergence.md +10 -4
  25. package/assets/init/.qfai/assistant/rule/shared-skill-delegation-baseline.md +81 -56
  26. package/assets/init/.qfai/assistant/rule/shared-skill-operating-baseline.md +8 -8
  27. package/assets/init/.qfai/assistant/rule/ui-definition-protocol.md +2 -1
  28. package/assets/init/.qfai/assistant/rule/workflow.md +4 -4
  29. package/assets/init/.qfai/assistant/skill/qfai-configure/SKILL.md +15 -46
  30. package/assets/init/.qfai/assistant/skill/qfai-discussion/SKILL.md +6 -15
  31. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/discussion-completion-matrix.md +15 -2
  32. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/ui-bearing-playbook.md +17 -0
  33. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/ui_ux/trend_scan_playbook.md +3 -1
  34. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/01_Context.md +4 -1
  35. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/04_Sources.md +5 -1
  36. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/uiux/00_index.md +4 -1
  37. package/assets/init/.qfai/assistant/skill/qfai-grill/SKILL.md +8 -7
  38. package/assets/init/.qfai/assistant/skill/qfai-grilling/SKILL.md +15 -15
  39. package/assets/init/.qfai/assistant/skill/qfai-grilling/references/delegated-session.md +18 -18
  40. package/assets/init/.qfai/assistant/skill/qfai-grilling/references/session-record.md +3 -3
  41. package/assets/init/.qfai/assistant/skill/qfai-implement/SKILL.md +2 -16
  42. package/assets/init/.qfai/assistant/skill/qfai-implement/references/parallelization-policy.md +54 -12
  43. package/assets/init/.qfai/assistant/skill/qfai-implement/references/red-admissibility.md +35 -0
  44. package/assets/init/.qfai/assistant/skill/qfai-implement/references/test-runner-recipes.md +445 -0
  45. package/assets/init/.qfai/assistant/skill/qfai-implement/references/ui-affecting.md +2 -2
  46. package/assets/init/.qfai/assistant/skill/qfai-maintain/SKILL.md +0 -1
  47. package/assets/init/.qfai/assistant/skill/qfai-migration-v1-to-v2/SKILL.md +2 -13
  48. package/assets/init/.qfai/assistant/skill/qfai-migration-v1-to-v2/references/migration-guide.md +8 -11
  49. package/assets/init/.qfai/assistant/skill/qfai-migration-v1-to-v2/references/migration-placement.md +0 -7
  50. package/assets/init/.qfai/assistant/skill/qfai-prototyping/SKILL.md +11 -18
  51. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/generator-prompt.md +34 -3
  52. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/handoff.md +77 -2
  53. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/iteration-loop.md +14 -5
  54. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/review-payload-schema.md +7 -5
  55. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/reviewer-prompt.md +32 -6
  56. package/assets/init/.qfai/assistant/skill/qfai-run/SKILL.md +17 -18
  57. package/assets/init/.qfai/assistant/skill/qfai-run/references/extraction.md +194 -129
  58. package/assets/init/.qfai/assistant/skill/qfai-run/references/operator-screens.md +33 -18
  59. package/assets/init/.qfai/assistant/skill/qfai-run/references/plan.md +46 -22
  60. package/assets/init/.qfai/assistant/skill/qfai-run/references/reached-step-observations.md +2 -0
  61. package/assets/init/.qfai/assistant/skill/qfai-run/references/stage-points.md +7 -4
  62. package/assets/init/.qfai/assistant/skill/qfai-sdd/SKILL.md +0 -13
  63. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/concrete-abstract-cycle.md +3 -2
  64. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/contract-artifact-rules.md +13 -1
  65. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-execution-playbook.md +2 -2
  66. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-phase-checklists.md +1 -1
  67. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-pre-draft-grilling.md +2 -1
  68. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-quality-gate.md +1 -1
  69. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-triage.md +83 -6
  70. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/spec-traceability-rules.md +1 -1
  71. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/ui-contract-guide.md +23 -5
  72. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/change-request.md +1 -1
  73. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/decisions/page-NNNN.md +6 -0
  74. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/decisions.md +9 -0
  75. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/open-questions.md +13 -0
  76. package/assets/init/.qfai/assistant/skill/qfai-triage/SKILL.md +0 -11
  77. package/assets/init/.qfai/assistant/skill/qfai-verify/SKILL.md +0 -9
  78. package/assets/init/.qfai/assistant/skill/qfai-verify/references/verify-output-contract.md +15 -9
  79. package/assets/init/.qfai/assistant/skill/web-research/SKILL.md +19 -19
  80. package/assets/init/.qfai/assistant/step/common-design-md/STEP.md +0 -2
  81. package/assets/init/.qfai/assistant/step/common-gate-run/STEP.md +11 -9
  82. package/assets/init/.qfai/assistant/step/common-grilling-record/STEP.md +15 -3
  83. package/assets/init/.qfai/assistant/step/common-policy-check/STEP.md +0 -1
  84. package/assets/init/.qfai/assistant/step/common-review-cycle/STEP.md +48 -12
  85. package/assets/init/.qfai/assistant/step/discussion-interview/STEP.md +11 -5
  86. package/assets/init/.qfai/assistant/step/discussion-oq/STEP.md +12 -2
  87. package/assets/init/.qfai/assistant/step/discussion-pack/STEP.md +18 -4
  88. package/assets/init/.qfai/assistant/step/discussion-research/STEP.md +0 -2
  89. package/assets/init/.qfai/assistant/step/discussion-uiux/STEP.md +4 -2
  90. package/assets/init/.qfai/assistant/step/implement-acceptance/STEP.md +3 -4
  91. package/assets/init/.qfai/assistant/step/implement-backport/STEP.md +0 -5
  92. package/assets/init/.qfai/assistant/step/implement-benchmark/STEP.md +0 -4
  93. package/assets/init/.qfai/assistant/step/implement-bisect/STEP.md +0 -5
  94. package/assets/init/.qfai/assistant/step/implement-credentials/STEP.md +4 -4
  95. package/assets/init/.qfai/assistant/step/implement-dep-bump/STEP.md +31 -12
  96. package/assets/init/.qfai/assistant/step/implement-diagnose/STEP.md +12 -9
  97. package/assets/init/.qfai/assistant/step/implement-minimize/STEP.md +0 -5
  98. package/assets/init/.qfai/assistant/step/implement-oracle-parity/STEP.md +0 -6
  99. package/assets/init/.qfai/assistant/step/implement-procedure/STEP.md +35 -8
  100. package/assets/init/.qfai/assistant/step/implement-quarantine/STEP.md +0 -4
  101. package/assets/init/.qfai/assistant/step/implement-refactor/STEP.md +25 -9
  102. package/assets/init/.qfai/assistant/step/implement-regression-fix/STEP.md +0 -4
  103. package/assets/init/.qfai/assistant/step/implement-retire/STEP.md +26 -6
  104. package/assets/init/.qfai/assistant/step/implement-revert/STEP.md +0 -4
  105. package/assets/init/.qfai/assistant/step/implement-scaffold/STEP.md +28 -7
  106. package/assets/init/.qfai/assistant/step/implement-seam/STEP.md +0 -4
  107. package/assets/init/.qfai/assistant/step/implement-stress-harness/STEP.md +0 -5
  108. package/assets/init/.qfai/assistant/step/implement-sweep/STEP.md +0 -5
  109. package/assets/init/.qfai/assistant/step/implement-tdd/STEP.md +23 -15
  110. package/assets/init/.qfai/assistant/step/implement-test-fix/STEP.md +0 -5
  111. package/assets/init/.qfai/assistant/step/implement-tooling/STEP.md +0 -3
  112. package/assets/init/.qfai/assistant/step/maintain-edit/STEP.md +71 -10
  113. package/assets/init/.qfai/assistant/step/prototyping-grill/STEP.md +39 -8
  114. package/assets/init/.qfai/assistant/step/prototyping-handoff/STEP.md +12 -5
  115. package/assets/init/.qfai/assistant/step/prototyping-loop/STEP.md +71 -23
  116. package/assets/init/.qfai/assistant/step/prototyping-preflight/STEP.md +5 -2
  117. package/assets/init/.qfai/assistant/step/sdd-contract/STEP.md +10 -4
  118. package/assets/init/.qfai/assistant/step/sdd-cycle/STEP.md +9 -6
  119. package/assets/init/.qfai/assistant/step/sdd-flow/STEP.md +0 -2
  120. package/assets/init/.qfai/assistant/step/sdd-gate/STEP.md +0 -1
  121. package/assets/init/.qfai/assistant/step/sdd-story/STEP.md +22 -3
  122. package/assets/init/.qfai/assistant/step/sdd-triage/STEP.md +54 -20
  123. package/assets/init/.qfai/assistant/step/triage-answer/STEP.md +0 -2
  124. package/assets/init/.qfai/assistant/step/triage-close/STEP.md +7 -4
  125. package/assets/init/.qfai/assistant/step/triage-cluster/STEP.md +0 -2
  126. package/assets/init/.qfai/assistant/step/triage-decompose/STEP.md +0 -2
  127. package/assets/init/.qfai/assistant/step/triage-dedupe/STEP.md +0 -2
  128. package/assets/init/.qfai/assistant/step/triage-handoff/STEP.md +6 -2
  129. package/assets/init/.qfai/assistant/step/triage-investigate/STEP.md +0 -2
  130. package/assets/init/.qfai/assistant/step/triage-operate/STEP.md +76 -5
  131. package/assets/init/.qfai/assistant/step/triage-owned-cleanup/STEP.md +0 -2
  132. package/assets/init/.qfai/assistant/step/triage-request-info/STEP.md +0 -2
  133. package/assets/init/.qfai/assistant/step/triage-security-intake/STEP.md +0 -2
  134. package/assets/init/.qfai/assistant/step/verify-advisory/STEP.md +0 -2
  135. package/assets/init/.qfai/assistant/step/verify-change-note/STEP.md +0 -2
  136. package/assets/init/.qfai/assistant/step/verify-commit/STEP.md +35 -12
  137. package/assets/init/.qfai/assistant/step/verify-context/STEP.md +7 -26
  138. package/assets/init/.qfai/assistant/step/verify-external/STEP.md +0 -2
  139. package/assets/init/.qfai/assistant/step/verify-manual/STEP.md +0 -2
  140. package/assets/init/.qfai/assistant/step/verify-qfai-gate/STEP.md +0 -2
  141. package/assets/init/.qfai/assistant/step/verify-release-notes/STEP.md +0 -2
  142. package/assets/init/.qfai/assistant/step/verify-repeat-run/STEP.md +0 -2
  143. package/assets/init/.qfai/assistant/step/verify-repo-gate/STEP.md +65 -9
  144. package/assets/init/root/.agents/rules/api-budget.md +8 -3
  145. package/assets/init/root/.agents/rules/graph-exploration.md +18 -4
  146. package/assets/init/root/.agents/rules/grilling.md +9 -9
  147. package/assets/init/root/.agents/rules/reminders.json +20 -28
  148. package/assets/init/root/.agents/rules/user-questions.md +21 -11
  149. package/assets/init/root/.gitattributes +2 -0
  150. package/assets/init/root/AGENTS.md +1 -1
  151. package/assets/mdschema/manifest.yml +3 -0
  152. package/assets/mdschema/story/03_contract/tech.mdschema.yml +1 -1
  153. package/assets/mdschema/story/decisions/page-NNNN.mdschema.yml +32 -0
  154. package/assets/mdschema/story/decisions.mdschema.yml +12 -0
  155. package/assets/schemas/workflow/extraction.schema.json +94 -2
  156. package/assets/schemas/workflow/plan.schema.json +34 -1
  157. package/assets/scripts/check-mdschema.mjs +434 -45
  158. package/dist/cli/index.cjs +4991 -3148
  159. package/dist/cli/index.cjs.map +1 -1
  160. package/dist/cli/index.mjs +4780 -2929
  161. package/dist/cli/index.mjs.map +1 -1
  162. package/dist/graph/cli.cjs +14 -2
  163. package/dist/graph/cli.cjs.map +1 -1
  164. package/dist/graph/cli.d.cts +1 -1
  165. package/dist/graph/cli.d.ts +1 -1
  166. package/dist/graph/cli.mjs +14 -2
  167. package/dist/graph/cli.mjs.map +1 -1
  168. package/dist/graph/hook.cjs.map +1 -1
  169. package/dist/graph/hook.mjs.map +1 -1
  170. package/dist/index.cjs +4359 -3843
  171. package/dist/index.cjs.map +1 -1
  172. package/dist/index.d.cts +60 -21
  173. package/dist/index.d.ts +60 -21
  174. package/dist/index.mjs +3594 -3080
  175. package/dist/index.mjs.map +1 -1
  176. package/dist/process-qqX2Owgq.d.cts +18 -0
  177. package/dist/process-qqX2Owgq.d.ts +18 -0
  178. package/package.json +1 -1
  179. package/assets/defaults/agent-routing/_contract.yml +0 -77
  180. package/assets/defaults/agent-routing/common.yml +0 -14
  181. package/assets/defaults/agent-routing/qfai-discussion.yml +0 -57
  182. package/assets/defaults/agent-routing/qfai-implement.yml +0 -236
  183. package/assets/defaults/agent-routing/qfai-maintain.yml +0 -12
  184. package/assets/defaults/agent-routing/qfai-prototyping.yml +0 -48
  185. package/assets/defaults/agent-routing/qfai-sdd.yml +0 -56
  186. package/assets/defaults/agent-routing/qfai-triage.yml +0 -108
  187. package/assets/defaults/agent-routing/qfai-verify.yml +0 -92
  188. package/assets/defaults/agent-routing/skills.yml +0 -59
  189. package/assets/defaults/review-profiles.yml +0 -25
  190. package/assets/init/.qfai/assistant/agent/acceptance-test-engineer.md +0 -81
  191. package/assets/init/.qfai/assistant/agent/backend-engineer.md +0 -90
  192. package/assets/init/.qfai/assistant/agent/completion-reviewer.md +0 -88
  193. package/assets/init/.qfai/assistant/agent/delivery-planner.md +0 -85
  194. package/assets/init/.qfai/assistant/agent/devops-ci-engineer.md +0 -78
  195. package/assets/init/.qfai/assistant/agent/discovery-analyst.md +0 -81
  196. package/assets/init/.qfai/assistant/agent/doc-steward.md +0 -78
  197. package/assets/init/.qfai/assistant/agent/frontend-engineer.md +0 -94
  198. package/assets/init/.qfai/assistant/agent/orchestrator.md +0 -92
  199. package/assets/init/.qfai/assistant/agent/product-experience-architect.md +0 -101
  200. package/assets/init/.qfai/assistant/agent/qa-gatekeeper.md +0 -153
  201. package/assets/init/.qfai/assistant/agent/qa-strategist.md +0 -82
  202. package/assets/init/.qfai/assistant/agent/requirements-analyst.md +0 -96
  203. package/assets/init/.qfai/assistant/agent/solution-architect.md +0 -89
  204. package/assets/init/.qfai/assistant/agent/test-design-analyst.md +0 -132
  205. package/dist/process-C21nTvkT.d.cts +0 -12
  206. package/dist/process-C21nTvkT.d.ts +0 -12
@@ -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
@@ -18,6 +16,8 @@ settles, by talking, the questions that do not need a prototype to answer.
18
16
  - The specs in the story tree, the UI contracts in scope (see [Scope](#scope))
19
17
  and root `DESIGN.md`.
20
18
  - `.qfai/prototype/grilling.md`, where an earlier run left one.
19
+ - `.qfai/prototype/final/index.html` and `final/handoff.json`, when the request
20
+ scopes the run (see [Run scope](#run-scope)).
21
21
 
22
22
  ## Writes
23
23
 
@@ -48,8 +48,34 @@ Inside an `npx qfai workflow` run the work order narrows that set:
48
48
 
49
49
  A standalone invocation still resolves every UI-bearing UI contract.
50
50
 
51
- The scope floor is unchanged: which UI contracts the loop covers is decided by
52
- their declared IDs and screens, and no session narrows it.
51
+ The scope floor is unchanged, and no session narrows it: its single home is
52
+ `.qfai/assistant/rule/constitution.md` Article VII § Prototyping exception
53
+ (scope floor).
54
+
55
+ ### Run scope
56
+
57
+ A run can rebuild part of a prototype the user already confirmed. The record's
58
+ optional `## Run scope` section names what the run changes, one entry per
59
+ line: a screen as `<ui-contract-id>/<screen>`, or a shared component by its
60
+ repository path or by the `item` that `final/handoff.json` `procurement`
61
+ names for it. Take the entries from the request, settle them in the session,
62
+ and write them afresh each run: a `## Run scope` an earlier run left does not
63
+ carry over.
64
+
65
+ The run covers the whole product, and the session report says so, when:
66
+
67
+ - the record has no `## Run scope`, or an empty one;
68
+ - `.qfai/prototype/final/index.html` is missing, or `final/handoff.json` is
69
+ missing or lacks `finalArtifact` or `procurement`, as the restyle short
70
+ form does;
71
+ - the run is a `restyle` loop.
72
+
73
+ Write no `## Run scope` in any of these cases.
74
+
75
+ Check the earlier `final/` against every declared screen outside the scope: it
76
+ needs a route in `final/index.html` and a `procurement` row. Add each screen
77
+ that lacks either to the scope; when the scope would then hold every screen,
78
+ run the whole product instead.
53
79
 
54
80
  ## What is grilled, and what is prototyped
55
81
 
@@ -97,8 +123,9 @@ user's behalf — with more evidence than before, and still not the user's answe
97
123
  that re-opens a frozen requirement produces an answer that drifts from it.
98
124
  What is left is what the session is for.
99
125
  3. Run the session. **It is delegated** (`.agents/rules/grilling.md` § Two
100
- kinds of session): a griller interviews the agents that generate and review
101
- the 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
102
129
  recommendation. `DESIGN.md` is frozen from the discussion stage's answers, so
103
130
  a question of taste or purpose it already answers is adopted from it. One it
104
131
  leaves open is product intent, which is critical, and goes to the user.
@@ -119,7 +146,8 @@ and name it.
119
146
  **The session's answers are written down, and the loop reads them.** They go to
120
147
  `.qfai/prototype/grilling.md`, under `## Session` for the decisions
121
148
  — an adopted one names the agent that recommended it and why it was taken —
122
- and `## Escalated` for a critical decision the user has yet to settle. The
149
+ and `## Escalated` for a critical decision the user has yet to settle, plus
150
+ `## Run scope` when the run is scoped (see [Run scope](#run-scope)). The
123
151
  generator and the reviewer both take that file as an input — named in
124
152
  `prototyping-loop`'s `## Evaluator Inputs (Mandatory)` and in the generator's
125
153
  contract set — because a decision the loop cannot read is one it will
@@ -169,4 +197,7 @@ this gate's subject — those are what the loop exists to make answerable, and
169
197
  they are open by design until the user has something to react to.
170
198
 
171
199
  Otherwise the step passes when `.qfai/prototype/grilling.md` exists
172
- with both sections and every row carries a `Scope`.
200
+ with both sections and every row carries a `Scope`. Every `## Run scope`
201
+ entry names a declared screen, or a component (by existing path or
202
+ `procurement` item) that at least one screen in `final/index.html` renders.
203
+ Any other entry stops the run before the first iteration, naming it.
@@ -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
@@ -18,22 +16,30 @@ Runs only after the user confirmed the prototype in `prototyping-loop`.
18
16
  - `.qfai/assistant/skill/qfai-prototyping/references/handoff.md` — the handoff
19
17
  fields.
20
18
  - `.qfai/prototype/grilling.md`, for the completion report.
19
+ - `.qfai/prototype/progress.md`, for `iterationKind` and any `runScope`.
20
+ - In a scoped run, the `final/index.html` and `final/handoff.json` an earlier
21
+ run confirmed, which the merge keeps outside the scope.
21
22
 
22
23
  ## Writes
23
24
 
24
25
  - `.qfai/prototype/final/index.html` — a copy, not a symlink, of the confirmed
25
- iteration.
26
+ iteration, or in a scoped run its in-scope parts merged in, except in a
27
+ `restyle` loop.
26
28
  - `.qfai/prototype/final/handoff.json`, a CLI-HANDOFF record.
27
29
 
28
30
  ## Procedure
29
31
 
30
32
  1. Copy the confirmed iteration to `.qfai/prototype/final/index.html`.
33
+ In a `restyle` loop, copy nothing: the iteration is the live app. In a
34
+ scoped run, replace only the in-scope parts and keep the rest, as the
35
+ handoff reference's Scoped handoff says.
31
36
  2. Write `.qfai/prototype/final/handoff.json` per the handoff reference.
32
37
  3. Write the completion report.
33
38
 
34
39
  ## Gate
35
40
 
36
- The step passes when both files exist. Only `npx qfai validate --profile
41
+ The step passes when both files exist,
42
+ or, in a `restyle` loop, when `handoff.json` exists. Only `npx qfai validate --profile
37
43
  saas-package` checks the handoff record; nothing certifies the prototype.
38
44
 
39
45
  The completion report names:
@@ -41,6 +47,7 @@ The completion report names:
41
47
  - every blocking finding, layout anti-pattern and `DESIGN.md` violation the
42
48
  latest review still lists;
43
49
  - every decision a session adopted, from the `## Session` rows of
44
- `.qfai/prototype/grilling.md`, with why each was taken.
50
+ `.qfai/prototype/grilling.md`, with why each was taken;
51
+ - in a scoped run, the scope the user confirmed.
45
52
 
46
53
  It does not wait for an answer.
@@ -3,8 +3,6 @@ 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
@@ -22,10 +20,11 @@ answer. No command, score or check decides that the loop is done.
22
20
 
23
21
  ## Writes
24
22
 
25
- - `.qfai/prototype/iter-NN/index.html` (the generator).
23
+ - `.qfai/prototype/iter-NN/index.html` (the generator), and in a `restyle`
24
+ loop the project's stylesheet and motion files it restyles.
26
25
  - `.qfai/prototype/iter-NN/review.json` and
27
26
  `iter-NN/<ui-contract-id>/<screen>.review.json` (the reviewer).
28
- - `.qfai/prototype/progress.md` (the orchestrator).
27
+ - `.qfai/prototype/progress.md` (the session agent).
29
28
  - The session rows of `.qfai/prototype/grilling.md`.
30
29
 
31
30
  ## Required References
@@ -46,37 +45,85 @@ answer. No command, score or check decides that the loop is done.
46
45
 
47
46
  ## Delegation Scope Table
48
47
 
49
- Generation and review use two distinct sub-agent identities. The reviewer
50
- operates Playwright during the assessment and returns its review payloads;
51
- it has no write access, so the orchestrator writes them. There is
52
- no fixed capture identity: a screenshot is taken by whoever needs it. The build
53
- owner is separate from this identity rule.
48
+ The session agent generates, implements and builds; `product-surface-reviewer`
49
+ reviews, started from a fresh context and a black-box brief, never with the
50
+ session's conversation. The reviewer operates Playwright during the assessment
51
+ and returns its review payloads; it has no write access, so the session agent
52
+ writes them. There is no fixed capture identity: a screenshot is taken by
53
+ whoever needs it.
54
54
 
55
- | Work | Allowed Role |
56
- | --------------------------------------------- | ------------------------------------ |
57
- | Generation and implementation | product-experience-architect |
58
- | Live Playwright review and evaluation scoring | product-surface-reviewer |
59
- | Build | devops-ci-engineer, backend-engineer |
55
+ | Work | Owner |
56
+ | --------------------------------------------- | -------------------------- |
57
+ | Generation and implementation | The session agent |
58
+ | Live Playwright review and evaluation scoring | `product-surface-reviewer` |
59
+ | Build | The session agent |
60
60
 
61
61
  Record `targetIterations`, `evaluationAxesSource`, `delegationMap` and
62
62
  `plannedAt` in `.qfai/prototype/progress.md` before the first review.
63
63
  `targetIterations` is an estimate of the iterations before the user confirms;
64
64
  the loop does not stop at it. Report an
65
- assignment that gives generation and review to one identity before either
66
- runs.
65
+ assignment that gives review scoring to the session agent, or generation to
66
+ the reviewer, before either runs.
67
+
68
+ ## Iteration kind
69
+
70
+ Record `iterationKind` in `progress.md` beside `targetIterations` and the
71
+ other planning fields. The kind comes from the request, as preflight took it:
72
+ `prototype`, the default, or `restyle` when the request changes only the
73
+ styles and motion of screens the project already runs, keeping their screens,
74
+ fields and behaviour. A `restyle` iteration is the live app restyled in place.
75
+ The generator edits the project's stylesheet and motion entry points and
76
+ writes `iter-NN/index.html` as a list of the live routes in scope, one link
77
+ per declared screen. Each link carries the route's absolute URL and the setup
78
+ it needs, such as a login or seed data. The live app is already running at
79
+ preflight, and the build owner keeps it running, so each link answers and the
80
+ reviewer drives those routes directly.
81
+
82
+ A restyle's edits are product code. The route's implement stage carries them:
83
+ there they are change-noted, gated, tested and committed. So a restyle needs a
84
+ scope that includes the implement stage. A request extracted with the
85
+ qualifier `restyle` is planned with only such scopes.
86
+
87
+ If the route's scope has no implement stage, stop and ask the user to re-plan
88
+ before iteration 00.
89
+
90
+ ## Run scope
91
+
92
+ Each run records `runScope` in `progress.md` afresh, beside `iterationKind`,
93
+ before its first iteration, overwriting any earlier one. When `grilling.md`
94
+ has a non-empty `## Run scope`, it holds three lists: the in-scope screens, the in-scope
95
+ components, and the render-check screens, each the other screen that renders
96
+ an in-scope component, named `<ui-contract-id>/<screen>` with that component.
97
+ Find them in the `final/handoff.json` `procurement` rows and in
98
+ `final/index.html`. Otherwise `runScope` is recorded as absent.
99
+
100
+ The run's first iteration is the first one after that record. It treats no
101
+ earlier run's review or confirmation as its prior review or the user's last
102
+ answer: those start with this run.
103
+
104
+ - The run's first iteration starts from a copy of `final/index.html`. Each
105
+ later one builds on the previous iteration, whose out-of-scope parts are
106
+ still `final/`'s. Either way only the in-scope screens and components change,
107
+ and a `pivot` applies only inside the scope.
108
+ - The reviewer reviews the in-scope screens in full and, on a render-check
109
+ screen, only that the component renders there. No other screen is opened.
110
+
111
+ With `runScope` absent, every screen is in scope and nothing here applies.
67
112
 
68
113
  ## Procedure
69
114
 
70
115
  Run these for iteration `NN`: the next index after the iterations already
71
116
  under `.qfai/prototype/`, or `00` when there are none.
72
117
 
73
- 1. **Generator** (product-experience-architect). Reads the contracts,
118
+ 1. **Generator** (the session agent). Reads the contracts,
74
119
  `.qfai/prototype/grilling.md`, the generator prompt, the `DESIGN.md` tokens
75
- and, from the second iteration on, the latest reviews and the user's last
76
- answer. It starts from the primary UI contract preflight resolved: the one
77
- the request names, else `prototyping.primaryUiContract`. Writes
120
+ and, from the run's second iteration on, this run's latest reviews and the
121
+ user's last answer. In a scoped run it also reads `runScope` in `progress.md` and
122
+ `.qfai/prototype/final/index.html`, every iteration. It starts from the
123
+ primary UI contract preflight resolved: the one the request names, else
124
+ `prototyping.primaryUiContract`. Writes
78
125
  `.qfai/prototype/iter-NN/index.html`.
79
- 2. **Build** (devops-ci-engineer). Serves `.qfai/prototype/` at the URL
126
+ 2. **Build** (the session agent). Serves `.qfai/prototype/` at the URL
80
127
  preflight checked, starting the server on the first iteration and keeping it
81
128
  running for the loop, and hands `<url>/iter-NN/` to the reviewer.
82
129
  3. **Reviewer** (product-surface-reviewer). Opens that URL, operates
@@ -85,7 +132,7 @@ under `.qfai/prototype/`, or `00` when there are none.
85
132
  prompt: the four ordinal UX axes, a critique of at most 500 words,
86
133
  `blockingFindings`, `layoutAntiPatternsDetected[]`,
87
134
  `designMdViolations[]` and `pivotDirective`.
88
- 4. **Orchestrator.** Writes each payload to
135
+ 4. **Session agent.** Writes each payload to
89
136
  `iter-NN/<ui-contract-id>/<screen>.review.json` and the summary to
90
137
  `iter-NN/review.json`. Each payload is checked against the closed schema
91
138
  before it is written, and one that does not conform is asked for again. A
@@ -139,7 +186,8 @@ confirmation.
139
186
 
140
187
  - The live prototype, opened in the reviewer's own Playwright session.
141
188
  - Root `DESIGN.md` (read-only), `axisDefs`, `previousScore` and
142
- `designSystemChecklist`.
189
+ `designSystemChecklist`. `previousScore` and the prior reviews come from
190
+ this run's own iterations; the run's first iteration has none.
143
191
  - The prior `review.json` files and `progress.md`.
144
192
  - The layout anti-pattern registry the package ships.
145
193
  - `.qfai/prototype/grilling.md` — what the prototype is for, what counts as
@@ -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
@@ -42,6 +40,11 @@ Nothing. The CLI checks are read-only.
42
40
  - Confirm a dev server or a static file server can serve
43
41
  `.qfai/prototype/` at the URL passed to
44
42
  `npx qfai doctor --profile prototyping --target-url <url>`.
43
+ - Take the iteration kind from the request: `restyle` when it changes only
44
+ the styles and motion of screens the project already runs.
45
+ - For a `restyle` request, the live app must already be running. Also run
46
+ `npx qfai doctor --profile prototyping --target-url <url>` against the live
47
+ app's URL, so the running app answers before the first iteration.
45
48
  - Doctor sends one `GET` to exactly the URL it is given, without following a
46
49
  redirect, and waits 3 seconds. A status from 200 to 399 passes; a 404 or any
47
50
  other status fails the check, and so does no answer. It probes that one URL,
@@ -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
@@ -63,6 +61,10 @@ states.
63
61
  attributes, and run the executable DB contract checks
64
62
  `contract-artifact-rules.md` requires. Record the command and result under
65
63
  Contract executability in the SDD report.
64
+ 7. Where a decision replaced a claim, such as an input, a threshold or a
65
+ count, search the whole story tree and the contracts for the old claim
66
+ before finishing. List each hit in the stage report, with what it now
67
+ says or why it stays.
66
68
 
67
69
  ## UI contracts
68
70
 
@@ -103,8 +105,8 @@ the run.
103
105
 
104
106
  ## Gate
105
107
 
106
- `solution-architect` accepts the connected BF → US → AC → EX ← BR design and
107
- its contract realization before `sdd-gate` runs.
108
+ The connected BF → US → AC → EX ← BR design and its contract realization hold
109
+ before `sdd-gate` runs; the specification review checks both.
108
110
 
109
111
  ## Passes when
110
112
 
@@ -112,3 +114,7 @@ Read first: the triage decisions, the examples `sdd-story` wrote or kept, and th
112
114
  contracts whose rules cite them. The step passes when the change writes no BR
113
115
  and changes no contract or `contracts.md` row. The pass names the contracts it
114
116
  read.
117
+
118
+ A pass is refused while an example `sdd-story` wrote or kept is cited by no
119
+ BR, an example this run added included: that example is owed a rule, which
120
+ this step writes.
@@ -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,10 +17,11 @@ 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. It raises findings of five
23
- kinds: a case the rule implies that no example states, a redundant example,
24
- an example no rule explains, a rule its examples do not support, and a flow,
25
- story or criterion split the rules show to be wrong.
20
+ cite and the EXs this invocation wrote or changed. The session agent starts
21
+ it, never a stage worker. It raises findings of five kinds: a case the rule
22
+ implies that no example states, a redundant example, an example no rule
23
+ explains, a rule its examples do not support, and a flow, story or criterion
24
+ split the rules show to be wrong.
26
25
  - **Deciding.** The session agent decides each finding that is not critical. A
27
26
  finding resting on product intent nothing written states goes to the user.
28
27
  - **Scope.** A proposed EX must be implied by an existing BR, an existing AC or
@@ -45,3 +44,7 @@ rules against their examples. Follow
45
44
  Read first: what `sdd-contract` wrote in this stage. The step passes when
46
45
  `sdd-contract` wrote or changed no BR Statement and no Examples cell, which is
47
46
  when no cycle runs. The pass names the contracts it read.
47
+
48
+ A step whose first cycle adopted a finding is not a pass. It ends only after
49
+ the second cycle has run, and the review treats a missing second cycle as a
50
+ failure.
@@ -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
@@ -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
@@ -31,6 +29,8 @@ Stage 3 of the story tree: stories and examples.
31
29
  - Each affected `user-story-NNNN-NNNN/` with exactly `01_User-story.md`,
32
30
  `02_Acceptance-Criteria.md`, and `03_Example.md`, from their paired templates.
33
31
  Do not create another document inside a story directory.
32
+ - The `// QFAI:EX-NNNN-NNNN-NN` annotation line that maps an example to an
33
+ existing test, as procedure item 9 states, and nothing else in a test file.
34
34
 
35
35
  Write only what the user approved, as
36
36
  `.qfai/assistant/skill/qfai-sdd/references/sdd-triage.md#a-change-to-the-story-tree`
@@ -60,13 +60,32 @@ states.
60
60
  4. Give each EX exactly one existing AC in its `AC-Ref` cell, and give each AC
61
61
  at least one EX. `Input` and `Expected` hold plain values, not Gherkin
62
62
  steps.
63
+ For each EX added, name in the stage report the contract rule that will
64
+ cite it, or the contract that needs a new rule for it. `sdd-contract`
65
+ writes the rule.
63
66
  5. Preserve normal outcomes and meaningful failure boundaries.
64
67
  6. Follow `.qfai/assistant/skill/qfai-sdd/references/spec-traceability-rules.md`
65
68
  and `.qfai/assistant/rule/test-layers.md` when deriving the later BF/E2E,
66
69
  AC/API or Integration, and EX/other test obligations. Do not author
67
- acceptance tests in this step.
70
+ acceptance tests in this step. Item 9's annotation line is not test
71
+ authoring.
68
72
  7. Retire a story by removing its directory under the change request that names
69
73
  it, and never recycle its IDs.
74
+ 8. Where a decision replaced a claim, such as an input, a threshold or a
75
+ count, search the whole story tree and the contracts for the old claim
76
+ before finishing. List each hit in the stage report, with what it now
77
+ says or why it stays. A hit in a contract is left to `sdd-contract`,
78
+ which reports it.
79
+ 9. Where an existing assertion already proves an example this step added or
80
+ renumbered, add that example's `// QFAI:EX-NNNN-NNNN-NN` line to the test's
81
+ annotation lines, directly before the test declaration it marks, in a
82
+ selected non-E2E test file. Replace an old ID only on the test that proves
83
+ the renumbered example, the incoming item a merge collision renumbered; a
84
+ test of the item that kept the ID keeps its annotation. This is
85
+ specification metadata, not a test repair: change no assertion body, add or
86
+ remove no case, and keep the case count.
87
+ List each annotated test in the stage report. An example no existing
88
+ assertion proves stays unannotated for the implementation stage.
70
89
 
71
90
  ## Passes when
72
91
 
@@ -3,8 +3,6 @@ name: sdd-triage
3
3
  owner: qfai-sdd
4
4
  purpose: "Select the requirement source, classify each requirement against the story tree, and record the decisions, questions and approvals the later writes depend on."
5
5
  requires: []
6
- roles: [delivery-planner, requirements-analyst]
7
- routing-profile: default
8
6
  ---
9
7
 
10
8
  # sdd-triage
@@ -14,7 +12,7 @@ changes, and record that decision before anything depends on it.
14
12
 
15
13
  ## Reads
16
14
 
17
- - The applicable `.qfai/assistant/rule/` files and the routed agent cards.
15
+ - The applicable `.qfai/assistant/rule/` files.
18
16
  - `.qfai/assistant/skill/qfai-sdd/references/sdd-triage.md`: the operation set,
19
17
  the approval boundary and the decision-row format.
20
18
  - `.qfai/assistant/skill/qfai-sdd/references/requirements-decomposition.md` and
@@ -22,7 +20,7 @@ changes, and record that decision before anything depends on it.
22
20
  - `.qfai/assistant/rule/change-classification.md`, the classification
23
21
  authority.
24
22
  - The existing story tree: `01_policy/`, `02_business-flow/`, `03_contract/`,
25
- `decisions.md` and `open-questions.md` under `<paths.specsDir>`.
23
+ `decisions.md`, every page it lists in order, and `open-questions.md` under `<paths.specsDir>`; read decision pages before the root tail.
26
24
 
27
25
  ## Scope of the request
28
26
 
@@ -66,6 +64,13 @@ descendants when it still represents the requirement. Create a flow or story
66
64
  only when the existing tree cannot represent it. Trace impact through BF → US →
67
65
  AC → EX and every enforcing contract.
68
66
 
67
+ Read the complete decision register using the Decision pages rules in the triage
68
+ reference before allocating IDs or relying on an in-force decision. Append new
69
+ rows only to the root table. Listed pages preserve the same row identity and
70
+ Status permissions; an unreadable or incomplete register stops this stage.
71
+ No automatic rotation is permitted. A physical relocation requires a separately
72
+ adopted execution change request and reviewed raw-byte receipt.
73
+
69
74
  Record in `<paths.specsDir>/decisions.md` only what the user decided: each
70
75
  change request the user approved or declined, and each critical decision the
71
76
  user made. Record unresolved
@@ -77,9 +82,16 @@ Content begins `Change request:` and names the
77
82
  affected repository-relative paths; its Approach names the operation, the affected BF or US,
78
83
  its source as `discussion-<id>#REQ-NNNN` when that source exists, and who
79
84
  approved it, when, and the option chosen. A declined change request is appended at
80
- REJECTED, recording who declined it and when. A decision the agent took
85
+ REJECTED, recording who declined it and when. When a later decision replaces a
86
+ row, change that row's Status to `SUPERSEDED (by DEC-NNNN)`, naming the later
87
+ row, or to `PARTLY SUPERSEDED (by DEC-NNNN)` when it replaces only part of it.
88
+ When a decision answers an open question, change that row's Status to
89
+ `DONE (by DEC-NNNN)`; when a decision makes what the row states wrong before the
90
+ question is answered, change it to `SUPERSEDED (by DEC-NNNN)` and append a new
91
+ row for the question that remains. Either names the decision row.
92
+ A decision the agent took
81
93
  appends no row. Do not write a second decision-record
82
- directory or a retired story file.
94
+ directory or a retired story file. Listed pages are members of the same register, not a second decision home.
83
95
 
84
96
  For a published malformed branch-added decision, follow
85
97
  `.qfai/assistant/rule/drift-protocol.md#published-decision-prefix-recovery`
@@ -100,9 +112,9 @@ before the dependent write and report pending approvals.
100
112
 
101
113
  UI-bearing is a property of the affected flow, not of the files this run
102
114
  happened to edit. Resolve it from the source's surface classification and the UI
103
- contracts linked to that flow, and record it for each affected flow. Route
104
- `product-experience-architect` during design whenever either signal identifies
105
- the flow as UI-bearing. `product-surface-reviewer` joins a review in a route
115
+ contracts linked to that flow, and record it for each affected flow; the
116
+ session agent designs the screens of a UI-bearing flow itself.
117
+ `product-surface-reviewer` joins a review in a route
106
118
  only for a screen change, as `common-review-cycle`'s reviewer set says;
107
119
  `qfai-sdd` invoked by name keeps the reviewers its own `## Review` section names.
108
120
 
@@ -176,21 +188,43 @@ this step took it or the operator answered it.
176
188
  ## ID allocation
177
189
 
178
190
  Allocate each new ID from the highest ID of its kind in scope plus one,
179
- including retired IDs named in decisions rows. A project that also counts the
180
- IDs its open pull requests add takes the highest across the tree and those pull
181
- requests, so a gap above the tree's own highest is allowed. BF scope is project-wide; US
191
+ including retired IDs named in decisions rows. BF scope is project-wide; US
182
192
  scope is its BF; AC and EX scope is their US; a contract number's scope is every
183
193
  contract of every kind; BR scope is its contract, whose number the BR carries
184
- (`BR-0006-0001` belongs to `API-0006`); DEC and OQ scope is their own table.
185
- Empty scopes begin at `0001`, or `01` for AC and EX tails. This is a reading
186
- rule over the tree, not a new command.
194
+ (`BR-0006-0001` belongs to `API-0006`); DEC scope is the complete ordered register; OQ scope is its own table.
195
+ Empty scopes begin at `0001`, or `01` for AC and EX tails. Take each new ID from
196
+ `npx qfai sdd next-id <kind> [<parent-ID>] --base <local-ref>` with a fetched
197
+ base: it prints the number after the highest of the working tree and the base.
198
+
199
+ Parallel branches pick the same next ID unless each reads the others first:
200
+
201
+ 1. Before taking an ID, fetch the base. Where a forge CLI is available, list the
202
+ open pull requests once per session through its REST API, for example
203
+ `gh api repos/{owner}/{repo}/pulls?state=open`, and reuse that listing for
204
+ every ID the session takes. Fetch each one's head ref, such as
205
+ `refs/pull/<n>/head`, so a pull request from a fork is read too, and read
206
+ the IDs it adds from `git diff <base>...<head>`. Take the highest across the
207
+ base, the working tree and those heads, plus one. Without a forge CLI, read
208
+ the base alone.
209
+ 2. When merging the base into the branch, check each ID the branch adds against
210
+ the fetched base. The base's item keeps its ID; the branch renumbers its own
211
+ item and every reference to it, then runs the gates again.
212
+ - A DEC or OQ row: check before the merge, and renumber a DEC row with
213
+ `npx qfai sdd renumber-decision` as the triage reference's ID allocation
214
+ section says, or an OQ row and its references by hand. The union merge of `decisions.md` and `open-questions.md`
215
+ would duplicate a colliding ID without a conflict.
216
+ - Any other ID: check after the merge.
217
+ 3. Keep the change-request row last in `decisions.md`, so the rows the branch
218
+ added stay in ascending order at the end of the register, where the
219
+ merge-time renumbering works from the lowest colliding one upward.
187
220
 
188
221
  ## Pre-draft grilling
189
222
 
190
223
  Before this step's first mutation, run the checkpoint for `Triage and records`
191
- in `.qfai/assistant/skill/qfai-sdd/references/sdd-pre-draft-grilling.md`. Put
192
- each critical decision it holds to the user, and list each decision it adopted
193
- in the final report. Each later design-writing step runs its own checkpoint the
224
+ in `.qfai/assistant/skill/qfai-sdd/references/sdd-pre-draft-grilling.md`. The
225
+ session agent starts the griller, never a stage worker. Put each critical
226
+ decision it holds to the user, and list each decision it adopted in the final
227
+ report. Each later design-writing step runs its own checkpoint the
194
228
  same way.
195
229
 
196
230
  ## A change to the story tree
@@ -201,8 +235,8 @@ sets out. Every later step of the stage writes under that rule.
201
235
 
202
236
  ## Gate
203
237
 
204
- `delivery-planner` accepts the affected-flow scope and approval state before any
205
- drafting step starts. Every requirement has a target, an approved or
238
+ The affected-flow scope and approval state are recorded before any drafting
239
+ step starts. Every requirement has a target, an approved or
206
240
  approval-free operation and a recorded impact path, as
207
241
  `.qfai/assistant/skill/qfai-sdd/references/sdd-triage.md#completion-of-triage`
208
242
  states.
@@ -3,8 +3,6 @@ name: triage-answer
3
3
  owner: qfai-triage
4
4
  purpose: "Answer the request's question, citing the documents, code or diagnosis evidence that shows the answer, without changing any tracked file."
5
5
  requires: []
6
- roles: [discovery-analyst]
7
- routing-profile: default
8
6
  ---
9
7
 
10
8
  # triage-answer
@@ -3,8 +3,6 @@ name: triage-close
3
3
  owner: qfai-triage
4
4
  purpose: "Record how a request ended and every follow-up request it found, and close it without changing any tracked file."
5
5
  requires: []
6
- roles: [requirements-analyst]
7
- routing-profile: default
8
6
  ---
9
7
 
10
8
  # triage-close
@@ -66,6 +64,11 @@ Any other route closes here.
66
64
  - No file git tracks. Name any ignored record's location in the stage
67
65
  report, separately from tracked changes.
68
66
  - The stage report states the outcome and each follow-up's goal and reason.
67
+ When the release change is produced outside this run (by a release workflow
68
+ or bot), the stage report records the release approval with what was
69
+ approved, who approved it, when, and the chosen option's label, and lists
70
+ the row as a pending follow-up; the next change that touches `decisions.md`
71
+ appends its row.
69
72
  For a re-route, retain the plan's branch outcome, the selected route and
70
73
  the request extraction in the session handoff. A re-route does not close
71
74
  the request.
@@ -79,5 +82,5 @@ triage step. The report never says a tracked change is done. The `cleaned`
79
82
  outcome confirms only the temporary cleanup's completed gate.
80
83
 
81
84
  Outside triage steps, the only tracked-file changes allowed are the records
82
- the route's discussion stage names and the required approval row that
83
- `qfai-run` writes in `decisions.md` before `triage-handoff` runs.
85
+ the route's discussion stage names and the approval row, if any, that
86
+ `qfai-run` writes in `decisions.md` under its step 7 before `triage-handoff` runs.
@@ -3,8 +3,6 @@ name: triage-cluster
3
3
  owner: qfai-triage
4
4
  purpose: "Group automated reports by the signature of their failure, and separate the groups caused by an environment from those caused by the product."
5
5
  requires: []
6
- roles: [devops-ci-engineer, frontend-engineer, backend-engineer]
7
- routing-profile: default
8
6
  ---
9
7
 
10
8
  # triage-cluster
@@ -3,8 +3,6 @@ name: triage-decompose
3
3
  owner: qfai-triage
4
4
  purpose: "Split a request into child requests, each with its goal and the children it depends on, for triage-close to record as follow-ups."
5
5
  requires: []
6
- roles: [requirements-analyst, delivery-planner]
7
- routing-profile: default
8
6
  ---
9
7
 
10
8
  # triage-decompose