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
@@ -3,14 +3,13 @@ name: common-gate-run
3
3
  owner: common
4
4
  purpose: "Run one gate — a qfai validate profile or a project command from the Standard commands — and record its command, result and revision, so a gate that did not run is never read as a pass."
5
5
  requires: []
6
- roles: []
7
6
  ---
8
7
 
9
8
  # common-gate-run
10
9
 
11
10
  The calling step names the gate and the scope. This step resolves the command,
12
11
  runs it and records what happened. Where a command comes from is
13
- `.qfai/assistant/rule/shared-skill-operating-baseline.md#standard-commands-mandatory`,
12
+ `.qfai/assistant/rule/shared-skill-operating-baseline.md#standard-commands`,
14
13
  and how a failure is handled is
15
14
  `.qfai/assistant/rule/shared-skill-operating-baseline.md#gate-failure-autorepair-protocol`.
16
15
  Neither is restated here.
@@ -25,7 +24,7 @@ Neither is restated here.
25
24
  - `qfai.config.yaml` for `paths.contractsDir`, `paths.outDir` and the test
26
25
  globs.
27
26
  - The launcher the preflight established, for a qfai command
28
- (`.qfai/assistant/rule/shared-skill-operating-baseline.md#canonical-qfai-launcher-mandatory`).
27
+ (`.qfai/assistant/rule/shared-skill-operating-baseline.md#canonical-qfai-launcher`).
29
28
  - `.agents/rules/temporary-files.md`, when this step writes captured output or a script to a
30
29
  file.
31
30
  - `.agents/rules/api-budget.md`, when this step reads CI state or the project's items through
@@ -3,7 +3,6 @@ name: common-grilling-record
3
3
  owner: common
4
4
  purpose: "Write the record of the discussion stage's grilling session in the stage report, so a session that ran and one that was skipped can be told apart."
5
5
  requires: []
6
- roles: []
7
6
  ---
8
7
 
9
8
  # common-grilling-record
@@ -36,10 +35,10 @@ reports what it settled in its final report.
36
35
  A settled decision is written where the story tree keeps it. Adopt a supported
37
36
  recommendation in the appropriate `decisions.md` row or in the authored
38
37
  artifact. Record an unresolved choice in `open-questions.md` with its next
39
- action. Record a rejected option as a REJECTED decision row, so it stays
40
- excluded on reruns.
38
+ action. Record a rejected option as a decision row whose Content opens `Declined:`, so
39
+ it stays excluded on reruns.
41
40
 
42
- Each decision record carries the four labelled Approach items stated at the top of
41
+ Each decision record is a short decision record in the form stated at the top of
43
42
  `.qfai/assistant/skill/qfai-sdd/templates/spec/decisions.md`.
44
43
 
45
44
  ## One session
@@ -3,14 +3,13 @@ name: common-policy-check
3
3
  owner: common
4
4
  purpose: "Once, at the start of a run, find the project facts in policy and technology that are missing or stale, fill the verified ones the run owns, and record what cannot be verified."
5
5
  requires: []
6
- roles: []
7
6
  ---
8
7
 
9
8
  # common-policy-check
10
9
 
11
10
  Design, tests and code fit a project only when its facts are current. The
12
11
  contract this step serves is
13
- `.qfai/assistant/rule/workflow.md#policy-check-mandatory`:
12
+ `.qfai/assistant/rule/workflow.md#policy-check`:
14
13
  it runs once per run, at the start, and no affected work continues on stale policy.
15
14
  The ultra-light routes `answer-in-session` and `run-operation` do not run it.
16
15
 
@@ -3,7 +3,6 @@ name: common-review-cycle
3
3
  owner: common
4
4
  purpose: "Run a review the route or the parent skill calls for: dispatch the independent reviewers once, fix or answer every finding, and report the result."
5
5
  requires: []
6
- roles: []
7
6
  ---
8
7
 
9
8
  # common-review-cycle
@@ -41,9 +40,11 @@ them; it is the procedure that applies them.
41
40
  this route or its pull request covered its commits. A resolution that adds
42
41
  content neither side had is not conflict-only. The stage report names the
43
42
  merge and why no reviewer ran. In the `resolve-conflicts` route, a
44
- resolution that touches a story-tree file, a contract, or `decisions.md` or
45
- `open-questions.md` is not exempt: it gets the code review, and
46
- `architecture-reviewer` too for a contract. A parent skill invoked by name
43
+ resolution that touches a story-tree file or a contract is not exempt: it
44
+ gets the code review, and `architecture-reviewer` too for a contract. A
45
+ conflict confined to `decisions.md`, its pages and `open-questions.md` is
46
+ resolved by merging the base, whose union merge keeps both sides' rows; that
47
+ merge edits no row and gets no reviewer. A parent skill invoked by name
47
48
  uses the reviewers its own `## Review` section names, such as `qfai-discussion`'s.
48
49
 
49
50
  In a route, a code review whose target replaces at most five lines, a
@@ -74,12 +75,12 @@ them; it is the procedure that applies them.
74
75
  1. **Build the request.** Name the scope, the target files and the review
75
76
  focus. Put the answers an earlier stage recorded on the same artifact into
76
77
  this review's request before dispatching reviewers, under
77
- `.qfai/assistant/rule/review-convergence.md#answered-demands-must`.
78
+ `.qfai/assistant/rule/review-convergence.md#answered-demands`.
78
79
  For the code review, name each test the run recorded `red: ci-deferred`:
79
80
  the reviewer reads it against the code before the fix and confirms that
80
81
  its assertion fails there
81
82
  (`.qfai/assistant/skill/qfai-implement/references/red-admissibility.md#ci-only-test-gate`).
82
- 2. **Dispatch.** The orchestrator sends each reviewer a work order in the
83
+ 2. **Dispatch.** The session agent sends each reviewer a work order in the
83
84
  shared template, never a stage worker. An agent that authored, edited or
84
85
  recommended a decision in the reviewed artifact is not its independent
85
86
  reviewer. The session report names its authors, editors and decision
@@ -114,7 +115,7 @@ them; it is the procedure that applies them.
114
115
 
115
116
  ## Gate
116
117
 
117
- Every routed reviewer responded once, each behaviour fix had its one focused
118
+ Every required reviewer responded once, each behaviour fix had its one focused
118
119
  re-review, every finding is fixed or answered, and
119
120
  the stage report names each verdict and each answer, or says why the review
120
121
  dispatched no reviewer. For a code review skipped as a small literal-only
@@ -3,8 +3,6 @@ name: discussion-interview
3
3
  owner: qfai-discussion
4
4
  purpose: "Interview the user as a grilling session and record how and when it ended."
5
5
  requires: [common-grilling-record]
6
- roles: [discovery-analyst, requirements-analyst, solution-architect, product-experience-architect]
7
- routing-profile: default
8
6
  ---
9
7
 
10
8
  # discussion-interview
@@ -85,13 +83,13 @@ Where each outcome is recorded is
85
83
  The default user session reaches four of the five endings. An explicitly
86
84
  delegated discussion may also end `adopted` under the master's conditions:
87
85
 
88
- | Ended | What the user did | Authoring |
89
- | ------------- | ---------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
90
- | `confirmed` | Confirmed on the session's own condition: no node open — the frontier empty **and** no fact lookup still running | Starts |
91
- | `user-closed` | Said `proceed`, `done`, or words to that effect | Starts. Lookups already running are finished and each decision still open becomes a labelled assumption, except one a document requires the user to make and record |
92
- | `adopted` | Explicitly delegated judgment for this scope | Starts only after the recorded delegation conditions are met; no open node, lookup or unsupported human decision remains |
93
- | `no-question` | Nothing — `--auto` reached nobody | Starts. Every node still open is registered — a decision, and a fact only the user holds, which nothing else can supply, and the open count is then what blocks completion |
94
- | `stopped` | Said `stop` | **Does not start.** Report every open decision as open and end the run |
86
+ | Ended | What the user did | Authoring |
87
+ | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
88
+ | `confirmed` | Confirmed on the session's own condition: no node open — the frontier empty **and** no fact lookup still running — and a clean confirmation-sheet reply (`grilling.md` § The confirmation sheet) | Starts |
89
+ | `user-closed` | Said `proceed`, `done`, or words to that effect | Starts. Lookups already running are finished and each decision still open becomes a labelled assumption, except one a document requires the user to make and record |
90
+ | `adopted` | Explicitly delegated judgment for this scope | Starts only after the recorded delegation conditions are met; no open node, lookup or unsupported human decision remains |
91
+ | `no-question` | Nothing — `--auto` reached nobody | Starts. Every node still open is registered — a decision, and a fact only the user holds, which nothing else can supply, and the open count is then what blocks completion |
92
+ | `stopped` | Said `stop` | **Does not start.** Report every open decision as open and end the run |
95
93
 
96
94
  **No ending authorizes authoring while a `hard-required` input this invocation
97
95
  consumes is missing.** Those are excluded from both assumption paths: an
@@ -3,8 +3,6 @@ name: discussion-oq
3
3
  owner: qfai-discussion
4
4
  purpose: "Register every open question the discussion leaves, and drive the open count to zero."
5
5
  requires: []
6
- roles: [requirements-analyst]
7
- routing-profile: default
8
6
  ---
9
7
 
10
8
  # discussion-oq
@@ -3,8 +3,6 @@ name: discussion-pack
3
3
  owner: qfai-discussion
4
4
  purpose: "Author the discussion pack from what the interview settled."
5
5
  requires: []
6
- roles: [requirements-analyst, solution-architect, product-experience-architect]
7
- routing-profile: default
8
6
  ---
9
7
 
10
8
  # discussion-pack
@@ -131,6 +129,49 @@ finalize the design system here. The brand direction is the exception — which
131
129
  published theme the product is built on is the user's decision, and there is no
132
130
  later stage where they are asked.
133
131
 
132
+ ## Parse the diagrams
133
+
134
+ Before the gate, parse every Mermaid diagram the pack holds with Mermaid's own
135
+ grammar. `npx qfai validate` checks only that a diagram is there; a diagram that
136
+ does not parse is otherwise found by CI, after handoff.
137
+
138
+ 1. Where the project has no `node_modules/qfai`, install the release that
139
+ `npx qfai --version` prints into a directory of its own, and read
140
+ `tmp/qfai-release/node_modules/qfai/` wherever the steps below name
141
+ `node_modules/qfai/`.
142
+
143
+ ```bash
144
+ npm install --no-save --no-audit --no-fund --ignore-scripts --prefix=tmp/qfai-release qfai@<version>
145
+ ```
146
+
147
+ 2. Read the `mermaid@` and `jsdom@` versions from the install step of
148
+ `node_modules/qfai/assets/init/root/.github/workflows/qfai-docs.yml`, or of
149
+ `tmp/qfai-release/node_modules/qfai/assets/init/root/.github/workflows/qfai-docs.yml`,
150
+ the shipped copy of the installed release.
151
+ 3. Install them into a directory of their own, never into the project's
152
+ dependency tree.
153
+
154
+ ```bash
155
+ npm install --no-save --no-audit --no-fund --ignore-scripts --include=optional --prefix=tmp/qfai-mermaid mermaid@<version> jsdom@<version>
156
+ ```
157
+
158
+ 4. Run the parser over the pack directory.
159
+
160
+ ```bash
161
+ node node_modules/qfai/assets/scripts/check-mermaid.mjs --tools tmp/qfai-mermaid <pack directory>
162
+ ```
163
+
164
+ Where step 1 installed the release, run its checker instead:
165
+
166
+ ```bash
167
+ node tmp/qfai-release/node_modules/qfai/assets/scripts/check-mermaid.mjs --tools tmp/qfai-mermaid <pack directory>
168
+ ```
169
+
170
+ 5. Fix each diagram it rejects, and run it again until it exits 0.
171
+
172
+ When the install or the run fails for a reason other than a rejected diagram,
173
+ report the syntax check as not run, never as passed, and give the reason.
174
+
134
175
  ## Gate
135
176
 
136
177
  The reviewer confirms:
@@ -3,8 +3,6 @@ name: discussion-research
3
3
  owner: qfai-discussion
4
4
  purpose: "Record the research the interview reads."
5
5
  requires: []
6
- roles: [delivery-planner, discovery-analyst]
7
- routing-profile: default
8
6
  ---
9
7
 
10
8
  # discussion-research
@@ -3,8 +3,6 @@ name: discussion-uiux
3
3
  owner: qfai-discussion
4
4
  purpose: "Write the screen-level sidecars of a UI-bearing discussion pack."
5
5
  requires: []
6
- roles: [product-experience-architect]
7
- routing-profile: default
8
6
  ---
9
7
 
10
8
  # discussion-uiux
@@ -3,10 +3,6 @@ name: implement-acceptance
3
3
  owner: qfai-implement
4
4
  purpose: "Write the bodies of a business flow's empty acceptance tests, keeping each test's annotation and file."
5
5
  requires: [common-gate-run]
6
- roles:
7
- - acceptance-test-engineer
8
- - devops-ci-engineer
9
- routing-profile: default
10
6
  ---
11
7
 
12
8
  # implement-acceptance
@@ -58,7 +54,7 @@ contract IDs are not coverage annotations.
58
54
  mutation.
59
55
  4. A test that fails because the product is wrong is not repaired here: report
60
56
  it as a defect for `implement-tdd` or a fix route. A test that cannot be
61
- written because the story or contract is wrong is a change request under
57
+ written because the story or contract is wrong is a specification change under
62
58
  `.qfai/assistant/rule/drift-protocol.md`.
63
59
 
64
60
  ## Gate
@@ -3,11 +3,6 @@ name: implement-backport
3
3
  owner: qfai-implement
4
4
  purpose: "Check that a merged change meets the project's backport criteria and carry it onto the release branch it names, passing that branch's gates."
5
5
  requires: [common-gate-run]
6
- roles:
7
- - devops-ci-engineer
8
- - frontend-engineer
9
- - backend-engineer
10
- routing-profile: default
11
6
  ---
12
7
 
13
8
  # implement-backport
@@ -3,10 +3,6 @@ name: implement-benchmark
3
3
  owner: qfai-implement
4
4
  purpose: "Measure a slow path under fixed conditions, before a change as its baseline and after it for comparison, and record the numbers without changing any tracked file."
5
5
  requires: [common-gate-run]
6
- roles:
7
- - devops-ci-engineer
8
- - qa-strategist
9
- routing-profile: default
10
6
  ---
11
7
 
12
8
  # implement-benchmark
@@ -3,11 +3,6 @@ name: implement-bisect
3
3
  owner: qfai-implement
4
4
  purpose: "Find the change that broke a behaviour between a revision where it worked and one where it fails, without changing any tracked file."
5
5
  requires: [common-gate-run]
6
- roles:
7
- - devops-ci-engineer
8
- - frontend-engineer
9
- - backend-engineer
10
- routing-profile: default
11
6
  ---
12
7
 
13
8
  # implement-bisect
@@ -3,10 +3,6 @@ name: implement-credentials
3
3
  owner: qfai-implement
4
4
  purpose: "Set up per-worker sign-in reuse for acceptance tests that need an authenticated actor."
5
5
  requires: []
6
- roles:
7
- - acceptance-test-engineer
8
- - devops-ci-engineer
9
- routing-profile: default
10
6
  ---
11
7
 
12
8
  # implement-credentials
@@ -3,11 +3,6 @@ name: implement-dep-bump
3
3
  owner: qfai-implement
4
4
  purpose: "Raise a dependency to a new version and check that the runtime, the version floors the project declares, and every call into it still hold."
5
5
  requires: [common-gate-run]
6
- roles:
7
- - devops-ci-engineer
8
- - frontend-engineer
9
- - backend-engineer
10
- routing-profile: default
11
6
  ---
12
7
 
13
8
  # implement-dep-bump
@@ -54,31 +49,29 @@ finding that names a spec contract moves the work as the next section says.
54
49
  When `validate`, or another check the update runs, reports a finding that
55
50
  names a spec contract to change, leave the contract unchanged. Finish every
56
51
  other part of the update first, so the contract finding is the only open item.
57
- Then get the change approved as `.qfai/assistant/rule/drift-protocol.md`
52
+ Then put the change to the operator as `.qfai/assistant/rule/drift-protocol.md`
58
53
  describes:
59
54
 
60
55
  1. Put the finding, the contract it names and the fix it states to the
61
56
  operator as a critical decision: return `awaiting_input` and change nothing
62
57
  more. The attempt holding the answer carries on.
63
- 2. On approval, append one `Change request:` row to `decisions.md` under
64
- `paths.specsDir`. Its Content names the contract's path, and its Approach
65
- records the finding, the fix, who approved it and when. The row starts at
66
- WIP.
67
- 3. Report `branch: { outcome: contract-finding }` citing that row's DEC ID.
68
- The work moves to `apply-settled`, whose `spec` stage edits the contract
69
- under its change request. Its settled triage applies the cited row.
58
+ 2. On approval, report `branch: { outcome: contract-finding }` naming the
59
+ contract's path, the finding, the fix, who approved it and when. The work
60
+ moves to `apply-settled`, whose `spec` stage edits the contract as approved.
61
+ The approval is a `decisions.md` row only when it meets the recording test
62
+ of the `qfai-sdd` decisions template.
70
63
 
71
- On a decline, append the row at REJECTED, leave the contract as it is and
72
- report the finding as unresolved, with no branch. When the operator cannot be
73
- asked, write no row and report the change as the decision still needed.
64
+ On a decline, leave the contract as it is, append a `Declined:` row naming the
65
+ contract change and who declined it and when, and report the finding as
66
+ unresolved, with no branch. When the operator cannot be asked, report the
67
+ change as the decision still needed.
74
68
 
75
69
  ## What it writes
76
70
 
77
71
  - The actual changed paths for the manifest, lockfile and any adapted call,
78
72
  listed in the stage report. When the dependency is `qfai` itself, they also
79
73
  include a new key in `qfai.config.yaml`.
80
- - On a contract finding the operator answered, the change request row in
81
- `decisions.md`, and its DEC ID in the stage report.
74
+ - On a contract finding the operator answered, the answer in the stage report.
82
75
  - A record of the versions, the breaking changes read and how each was met, in the stage report.
83
76
 
84
77
  ## Gate
@@ -3,12 +3,6 @@ name: implement-diagnose
3
3
  owner: qfai-implement
4
4
  purpose: "Reproduce a reported failure in one business flow, find its cause and give the one verdict that decides what the run does next. On a fix route the reproduction is a failing test."
5
5
  requires: [common-gate-run]
6
- roles:
7
- - test-design-analyst
8
- - frontend-engineer
9
- - backend-engineer
10
- - devops-ci-engineer
11
- routing-profile: default
12
6
  ---
13
7
 
14
8
  # implement-diagnose
@@ -3,11 +3,6 @@ name: implement-minimize
3
3
  owner: qfai-implement
4
4
  purpose: "Shrink the input that makes a program crash to the smallest one that still crashes the same way, without changing any tracked file."
5
5
  requires: [common-gate-run]
6
- roles:
7
- - devops-ci-engineer
8
- - frontend-engineer
9
- - backend-engineer
10
- routing-profile: default
11
6
  ---
12
7
 
13
8
  # implement-minimize
@@ -3,12 +3,6 @@ name: implement-oracle-parity
3
3
  owner: qfai-implement
4
4
  purpose: "Build a check that runs the same inputs through the project and through the outside reference it should match, and lists every difference."
5
5
  requires: [common-gate-run]
6
- roles:
7
- - test-design-analyst
8
- - frontend-engineer
9
- - backend-engineer
10
- - devops-ci-engineer
11
- routing-profile: default
12
6
  ---
13
7
 
14
8
  # implement-oracle-parity
@@ -3,8 +3,6 @@ name: implement-procedure
3
3
  owner: qfai-implement
4
4
  purpose: Write an authorized operational procedure within existing policy.
5
5
  requires: [common-gate-run]
6
- roles: [doc-steward]
7
- routing-profile: default
8
6
  ---
9
7
 
10
8
  # implement-procedure
@@ -95,4 +93,4 @@ no checker covers the changed files, the stage report records "no applicable
95
93
  checker", which neither passes nor blocks the gate.
96
94
  A changed named script passes its existing tests and checks, with coverage
97
95
  added where the repository has tests for it.
98
- Protected edits and uncovered actions were stopped before writing or acting.
96
+ Edits to upstream artifacts and uncovered actions were stopped before writing or acting.
@@ -3,10 +3,6 @@ name: implement-quarantine
3
3
  owner: qfai-implement
4
4
  purpose: "Take a test that passes and fails on the same code out of the gating suite, with a record of why and of what lets it back in."
5
5
  requires: [common-gate-run]
6
- roles:
7
- - devops-ci-engineer
8
- - qa-strategist
9
- routing-profile: default
10
6
  ---
11
7
 
12
8
  # implement-quarantine
@@ -4,10 +4,6 @@ owner: qfai-implement
4
4
  purpose: "Move code into a better structure while every test stays green, adding no example and changing no behaviour."
5
5
  requires:
6
6
  - common-gate-run
7
- roles:
8
- - frontend-engineer
9
- - backend-engineer
10
- routing-profile: default
11
7
  ---
12
8
 
13
9
  # implement-refactor
@@ -4,10 +4,6 @@ owner: qfai-implement
4
4
  purpose: "Fix the production code behind a regression that an existing, correct test catches, and confirm the fix by that test turning GREEN again."
5
5
  requires:
6
6
  - common-gate-run
7
- roles:
8
- - frontend-engineer
9
- - backend-engineer
10
- routing-profile: default
11
7
  ---
12
8
 
13
9
  # implement-regression-fix
@@ -36,8 +32,8 @@ The route's code review judges the fix. A fix that changes a screen, as
36
32
  to that review. The full suite and the
37
33
  project gates run once, in the verify stage.
38
34
 
39
- The example stays annotated by the same test. No `Change request:` row is
40
- appended and no evidence entry is removed. A contradiction or obstacle found
35
+ The example stays annotated by the same test. No story or contract changes,
36
+ and no evidence entry is removed. A contradiction or obstacle found
41
37
  here stops the work under Article IX of
42
38
  `.qfai/assistant/rule/constitution.md`.
43
39
 
@@ -4,12 +4,6 @@ owner: qfai-implement
4
4
  purpose: "Delete a mechanism the project decided to retire: its code, its tests, its configuration and its documents, with no test added to prove it is gone."
5
5
  requires:
6
6
  - common-gate-run
7
- roles:
8
- - frontend-engineer
9
- - backend-engineer
10
- - devops-ci-engineer
11
- - doc-steward
12
- routing-profile: default
13
7
  ---
14
8
 
15
9
  # implement-retire
@@ -3,10 +3,6 @@ name: implement-revert
3
3
  owner: qfai-implement
4
4
  purpose: "Undo the change a bisection named as the cause of a failure, and confirm the failure is gone and nothing else broke."
5
5
  requires: [common-gate-run]
6
- roles:
7
- - frontend-engineer
8
- - backend-engineer
9
- routing-profile: default
10
6
  ---
11
7
 
12
8
  # implement-revert
@@ -3,8 +3,6 @@ name: implement-scaffold
3
3
  owner: qfai-implement
4
4
  purpose: "Write, with `npx qfai atdd scaffold` or, in a project with purpose-named test files, by hand, the E2E test of each business flow and the integration test of each acceptance criterion the flow lacks, each with an empty body."
5
5
  requires: [common-gate-run]
6
- roles: [test-design-analyst]
7
- routing-profile: default
8
6
  ---
9
7
 
10
8
  # implement-scaffold
@@ -35,8 +33,8 @@ the system's shape has settled.
35
33
 
36
34
  1. Run `npx qfai validate --profile atdd --flow BF-NNNN --fail-on never` as
37
35
  `common-gate-run` says, and list the BF and AC items no test annotates.
38
- Drop from that list each item a `Test exception:` row at DONE names: it is
39
- owed no test.
36
+ Drop from that list each item a `Test exception:` row names: it is owed no
37
+ test.
40
38
  2. Unless § Purpose-named test files applies, when the flow is still on that
41
39
  list, run `npx qfai atdd scaffold --flow BF-NNNN`. It writes
42
40
  `<testsDir>/e2e/<BF-ID>.test.<ext>`.
@@ -78,12 +76,12 @@ apply.
78
76
  ## Passes when
79
77
 
80
78
  Read first: the BF and AC items of the flow that no `Test exception:` row
81
- at DONE names, and the tests that annotate them. The step passes when every one
79
+ names, and the tests that annotate them. The step passes when every one
82
80
  already has an annotating test at its layer. The pass names the test for each item.
83
81
 
84
82
  ## Gate
85
83
 
86
- PASS when every BF and AC of the flow that no `Test exception:` row at DONE
87
- names has an annotating test at its layer, and
84
+ PASS when every BF and AC of the flow that no `Test exception:` row names
85
+ has an annotating test at its layer, and
88
86
  `npx qfai validate --profile atdd --flow BF-NNNN --fail-on error` reports no
89
87
  error owned by this flow.
@@ -3,10 +3,6 @@ name: implement-seam
3
3
  owner: qfai-implement
4
4
  purpose: "Land the minimal connection an acceptance test needs to reach its assertion, and leave that test failing at the assertion."
5
5
  requires: [common-gate-run]
6
- roles:
7
- - frontend-engineer
8
- - backend-engineer
9
- routing-profile: default
10
6
  ---
11
7
 
12
8
  # implement-seam
@@ -3,11 +3,6 @@ name: implement-stress-harness
3
3
  owner: qfai-implement
4
4
  purpose: "Build a harness that makes an intermittent failure appear on demand, under load or under a controlled schedule, and record how often it appears."
5
5
  requires: [common-gate-run]
6
- roles:
7
- - devops-ci-engineer
8
- - frontend-engineer
9
- - backend-engineer
10
- routing-profile: default
11
6
  ---
12
7
 
13
8
  # implement-stress-harness
@@ -4,11 +4,6 @@ owner: qfai-implement
4
4
  purpose: "Run a widened check over the whole tree and either fix each new finding or record it in the check's baseline with its reason."
5
5
  requires:
6
6
  - common-gate-run
7
- roles:
8
- - devops-ci-engineer
9
- - frontend-engineer
10
- - backend-engineer
11
- routing-profile: default
12
7
  ---
13
8
 
14
9
  # implement-sweep
@@ -4,14 +4,6 @@ owner: qfai-implement
4
4
  purpose: "Take each example of one business flow that no test annotates through an observed Red, Green and Refactor cycle, appending the one example a diagnosed missing test needs, and align every surface that does not own the truth."
5
5
  requires:
6
6
  - common-gate-run
7
- roles:
8
- - delivery-planner
9
- - test-design-analyst
10
- - qa-strategist
11
- - frontend-engineer
12
- - backend-engineer
13
- - devops-ci-engineer
14
- routing-profile: default
15
7
  ---
16
8
 
17
9
  # implement-tdd
@@ -44,9 +36,9 @@ Green and Refactor cycle. The pass names the examples and their tests.
44
36
  ## Scope
45
37
 
46
38
  Send a decision, a question for the user or an out-of-scope discovery to
47
- `/qfai-sdd` as a change request. An out-of-scope discovery does not stop the
39
+ `/qfai-sdd` as a specification change. An out-of-scope discovery does not stop the
48
40
  current flow. A diagnosed missing test on behaviour an existing AC states is
49
- the one scope gap that raises no change request: an EX that states the case is
41
+ the one scope gap that goes to no specification change: an EX that states the case is
50
42
  worked as an EX no test annotates, and where none does, this step appends it,
51
43
  as [A diagnosed missing example](#a-diagnosed-missing-example) states.
52
44
 
@@ -60,7 +52,7 @@ as [A diagnosed missing example](#a-diagnosed-missing-example) states.
60
52
  `.qfai/assistant/rule/drift-protocol.md` before dependent work resumes.
61
53
  2. Read the **Standard commands** section of
62
54
  `<paths.contractsDir>/tech.md`, as
63
- `.qfai/assistant/rule/shared-skill-operating-baseline.md#standard-commands-mandatory`
55
+ `.qfai/assistant/rule/shared-skill-operating-baseline.md#standard-commands`
64
56
  states. Obtain the Test command only from that section. Lint, Typecheck
65
57
  and Build run once, in the verify stage. Read its
66
58
  `## Architecture` table too: place each new module in one layer, and
@@ -112,9 +104,8 @@ requires, so the step asks the user nothing:
112
104
  - Add the new EX ID to the selected rule's Examples cell. Its Statement is
113
105
  unchanged. This choice of equivalent rules asks no extra question.
114
106
  - Change no story, AC, rule statement or existing EX.
115
- - Append no `decisions.md` row: the drift gate needs no `Change request:` row
116
- for appended example rows and the new EX ID in the citing rule's Examples
117
- cell.
107
+ - Append no `decisions.md` row for the appended example row and the new EX ID
108
+ in the citing rule's Examples cell.
118
109
  - List the EX, chosen BR and the reason for choosing it in the run's final
119
110
  report.
120
111
  - No concrete-abstract cycle runs.
@@ -134,15 +125,16 @@ Work the examples in this order:
134
125
  3. Otherwise the flow's EX IDs that no test annotates, in EX ID order. A test
135
126
  annotating an example is what says the example is done.
136
127
 
137
- An EX that a `decisions.md` row opening `Test exception:` names, with Status
138
- DONE, is exempt and is not selected.
128
+ An EX that a `decisions.md` row opening `Test exception:` names is exempt while
129
+ that row exists, and is not selected.
139
130
 
140
131
  See `.qfai/assistant/skill/qfai-implement/references/cross-spec-ownership.md`
141
132
  for changes that touch another flow and
142
133
  `.qfai/assistant/skill/qfai-implement/references/parallelization-policy.md`
143
134
  for independently owned
144
- slices. Work one EX at a time by default. Parallel work requires disjoint
145
- writes, a passing technical gate, and the required user consent.
135
+ story units. Work one EX at a time by default. Stories with no test yet may
136
+ run in parallel only when the parallel-unit gate passes, which the session
137
+ agent decides and records.
146
138
 
147
139
  ## Red, Green, Refactor
148
140