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
@@ -94,6 +94,8 @@ classification or an explicit user decision.
94
94
 
95
95
  ## Trend Scan
96
96
 
97
+ A pack whose `01_Context.md` declares `design_direction: inherit` owes no Trend Scan.
98
+
97
99
  ### user expectation / market norm
98
100
 
99
101
  #### Entry 1
@@ -235,7 +237,9 @@ registered is held to all three fields either way.
235
237
  UI-bearing packs must register at least `uiux.competitive_refs_min` complete
236
238
  references (default: 3). Three blocks are pre-seeded below; copy another
237
239
  `### Reference:` block for each reference beyond that, and delete any block you
238
- do not use only if the remaining count still meets the minimum.
240
+ do not use only if the remaining count still meets the minimum. A pack that
241
+ declares `design_direction: inherit` owes no count; a reference it registers is
242
+ still complete.
239
243
 
240
244
  Each `reference` is a resolvable URL, repository path, or `SRC-ID`. Use a
241
245
  competitor to identify what this product should differ from. State adopted and
@@ -22,7 +22,10 @@ brand-level intent layer at all.
22
22
  ## Completeness Rule
23
23
 
24
24
  All three required files above must be present for every UI-bearing pack.
25
- Partial generation is not permitted.
25
+ Partial generation is not permitted. The one exception: a pack whose
26
+ classification declares `design_direction: inherit` may leave out
27
+ `40_screen_contracts.md` and `50_review_input_bundle.md`, under the conditions of
28
+ `.qfai/assistant/skill/qfai-discussion/references/ui-bearing-playbook.md#inheriting-the-current-designmd`.
26
29
 
27
30
  Root `DESIGN.md` is not one of them. `/qfai-sdd`'s `common-design-md` step authors it, and only
28
31
  on a visual-prototyping surface (`web`, `mobile`, `desktop`, `mixed`). A
@@ -85,12 +85,13 @@ When unsure, read inputs in this order:
85
85
  ## Sub-agent Delegation (MANDATORY)
86
86
 
87
87
  Follow `.qfai/assistant/rule/shared-skill-delegation-baseline.md`. The
88
- primitive's delegation rules apply unchanged: one thing is delegated, reading a
89
- fact the environment holds, and the questions are never delegated.
88
+ primitive's delegation rules apply unchanged: one thing may be delegated,
89
+ reading facts the environment holds as parallel lookups under the baseline's
90
+ gate, and the questions are never delegated.
90
91
 
91
- ### Orchestrator Protocol
92
+ ### Session Agent Protocol
92
93
 
93
- - The orchestrator reads the primitive, puts each round and reads the answers.
94
+ - The session agent reads the primitive, puts each round and reads the answers.
94
95
  - It must not decide a frontier question on the user's behalf, and must not
95
96
  self-approve the session's end condition.
96
97
 
@@ -119,9 +120,9 @@ table to the user. Use the shared schema from
119
120
  the `Agent instance` column. It is reported, not written: this skill produces no
120
121
  file.
121
122
 
122
- | Step | Role (sub-agent) | Agent instance | Task title | Input (refs) | Output (refs) | Status (PASS/REVISE/PENDING) |
123
- | ---- | ---------------- | --------------- | ------------------------------- | ------------------------------- | ------------------------------- | ---------------------------- |
124
- | 1 | Reviewer | `<instance id>` | Read the facts a round waits on | Decision and what it depends on | The fact, and where it was read | PASS/REVISE |
123
+ | Step | Agent (sub-agent) | Agent instance | Task title | Input (refs) | Output (refs) | Status (PASS/REVISE/PENDING) |
124
+ | ---- | -------------------- | --------------- | ------------------------------- | ------------------------------- | ------------------------------- | ---------------------------- |
125
+ | 1 | `fullstack-engineer` | `<instance id>` | Read the facts a round waits on | Decision and what it depends on | The fact, and where it was read | PASS/REVISE |
125
126
 
126
127
  ### Reviewer Gate
127
128
 
@@ -26,7 +26,7 @@ where its stage's gate reads it.
26
26
 
27
27
  **The invoking stage picks the session.** A stage whose work is the
28
28
  interview holds a user session; any other holds a delegated one, where a griller
29
- interviews the authors and only a critical decision reaches the user, and only
29
+ interviews the session agent and only a critical decision reaches the user, and only
30
30
  for a decision the repository cannot settle (`.agents/rules/grilling.md` § When
31
31
  a session is held). Without one, no griller starts. A stage that says nothing
32
32
  holds a delegated session where one is held. Read
@@ -149,10 +149,10 @@ host that cannot show it whole; it never makes two rounds, and
149
149
 
150
150
  ## Facts are not asked
151
151
 
152
- | Kind | Who settles it | How |
153
- | ---------------------------------------- | -------------- | ------------------------------------------- |
154
- | A fact the environment holds | The agent | Read it, or dispatch a sub-agent to read it |
155
- | A decision about what is wanted or worth | The user | Ask it, and wait |
152
+ | Kind | Who settles it | How |
153
+ | ---------------------------------------- | -------------- | ----------------------------------------- |
154
+ | A fact the environment holds | The agent | Read it, or run reads as parallel lookups |
155
+ | A decision about what is wanted or worth | The user | Ask it, and wait |
156
156
 
157
157
  Asking the user for a fact the repository already states spends the one thing a
158
158
  round is spending, which is the user's attention.
@@ -292,22 +292,22 @@ Follow `.qfai/assistant/rule/shared-skill-delegation-baseline.md`. The
292
292
  sections below add only what is specific to a session; where they and the
293
293
  baseline overlap, the baseline governs.
294
294
 
295
- One thing is delegated and one only: reading a fact the environment holds. The
296
- questions are never delegated — a round is put by the agent that holds the
295
+ One thing may be delegated: reading facts the environment holds, as parallel
296
+ lookups under the baseline's gate. The questions are
297
+ never delegated — a round is put by the agent that holds the
297
298
  session, to whoever is answering it.
298
299
 
299
300
  Who that is depends on the mode. In a session with a user, it is the user, and
300
301
  the agent they are talking to is the one that asks. In a session between agents
301
- there is no user to reach, so the griller puts the round to the authors and the
302
- orchestrator holds both. That is a different answerer, not a delegated question:
303
- nothing hands the asking to a third agent, and the orchestrator still answers
304
- nothing itself.
302
+ there is no user to reach, so the griller puts the round to the session agent,
303
+ the one author of the draft. That is a different answerer, not a delegated
304
+ question: nothing hands the asking to a third agent.
305
305
 
306
306
  ### Rounds between agents
307
307
 
308
- Read `references/delegated-session.md` when a griller puts the round to authors
309
- instead of a user. It holds how a round with several authors is held, which
310
- role puts the round, why a fact only the user holds goes to the user, and when
308
+ Read `references/delegated-session.md` when a griller puts the round to the session agent
309
+ instead of a user. It holds how the round is held, which
310
+ agent puts the round, why a fact only the user holds goes to the user, and when
311
311
  the griller's recommendation settles a decision. A session with a user does not
312
312
  need it.
313
313
 
@@ -365,7 +365,7 @@ rather than an entry added to the prototype.
365
365
 
366
366
  The buckets are the method, not a tuning surface. Moving a frontier decision to
367
367
  `auto-decide` is the agent answering its own question without the rounds. A
368
- delegated session's adoption is not that: the griller interviewed the authors
368
+ delegated session's adoption is not that: the griller interviewed the session agent
369
369
  first, and the record carries why.
370
370
 
371
371
  ## Related
@@ -1,25 +1,25 @@
1
1
  # Delegated session
2
2
 
3
3
  How the session agent runs a round between agents: who is asked, how the
4
- answers are held, and which role puts the round.
4
+ answers are held, and which agent puts the round.
5
5
 
6
- ## Several authors
6
+ ## The author
7
7
 
8
- A round between agents may have several authors, because one frontier can hold
9
- decisions belonging to different drafting roles.
8
+ The session agent authors every draft, so a round between agents has one
9
+ author: the session agent. The griller is a `requirements-reviewer`, or an
10
+ `architecture-reviewer` where the decision is a contract or architecture
11
+ decision, started from a fresh context and a black-box brief.
10
12
 
11
- - The round goes to **every author whose decisions it contains**, each seeing
12
- the whole round. A decision reads differently beside the ones next to it, and
13
- an author shown only its own share cannot say so.
13
+ - The round shows the author **the whole round**. A decision reads differently
14
+ beside the ones next to it.
14
15
  - **Every answer is collected before the frontier is recomputed.** Recomputing
15
16
  on the first reply settles the rest against a tree that moved under them.
16
- - **Two authors answering one question differently is itself a decision**, and
17
- it joins the frontier rather than being averaged. If the budget ends with it
18
- open, it takes the griller's recommendation like any other non-critical
19
- decision, with both positions recorded.
20
- - **An addition an author proposes is asked what part of the request needs
17
+ - **An author answer that differs from the griller's recommendation is kept**,
18
+ with both positions recorded. If the budget ends with it open, it takes the
19
+ griller's recommendation like any other non-critical decision.
20
+ - **An addition the author proposes is asked what part of the request needs
21
21
  it.** One nobody can point to is dropped, not adopted.
22
- - **A fact only the user holds goes to the user, not to an author.** No author
22
+ - **A fact only the user holds goes to the user, not to the author.** No author
23
23
  can answer an unpublished constraint or an intention nobody wrote down, and
24
24
  the convergence rules escalate decisions rather than facts — so without this
25
25
  the fact sits on the frontier until the budget ends, taking every decision
@@ -32,13 +32,13 @@ decisions belonging to different drafting roles.
32
32
  beside the open question, which is the ordinary no-question path. Stopping on
33
33
  every user-held fact would block a run over a defaultable date.
34
34
 
35
- ## Orchestrator protocol
35
+ ## Session agent protocol
36
36
 
37
- - The orchestrator computes the frontier and reads the answers. It does not
37
+ - The session agent computes the frontier and reads the answers. It does not
38
38
  decide a frontier question on anyone's behalf.
39
39
  - **Who puts the round depends on the mode, and exactly one role does.** With a
40
- user, the orchestrator puts it. Between agents, the griller puts it and the
41
- orchestrator does not — a session where both do is one where an author is
40
+ user, the session agent puts it. Between agents, the griller puts it and the
41
+ session agent does not — a session where both do is one where an author is
42
42
  asked twice and the two answers have no tie-break.
43
43
  - It must not record an answer **as the user's** that the user did not give, and
44
44
  must not self-approve the session's end condition. An author's answer in an
@@ -47,7 +47,7 @@ decisions belonging to different drafting roles.
47
47
  escalation cannot carry the positions to the user unless the answers are
48
48
  held.
49
49
  - **In a delegated session the griller's recommendation settles a decision that
50
- is not critical.** Where the authors and the griller land on one answer, or
50
+ is not critical.** Where the session agent and the griller land on one answer, or
51
51
  the budget ends first, the recommendation is taken and the stage records it as
52
52
  `agents`, with the reason and every disagreeing position. The stage's final
53
53
  report lists it; nothing waits for the user to read it.
@@ -9,9 +9,9 @@ Use the shared schema from
9
9
  `.qfai/assistant/rule/shared-skill-delegation-baseline.md`, including the
10
10
  `Agent instance` column.
11
11
 
12
- | Step | Role (sub-agent) | Agent instance | Task title | Input (refs) | Output (refs) | Status (PASS/REVISE/PENDING) |
13
- | ---- | ---------------- | --------------- | ------------------------------- | ------------------------------- | ------------------------------- | ---------------------------- |
14
- | 1 | Reviewer | `<instance id>` | Read the facts a round waits on | Decision and what it depends on | The fact, and where it was read | PASS/REVISE |
12
+ | Step | Agent (sub-agent) | Agent instance | Task title | Input (refs) | Output (refs) | Status (PASS/REVISE/PENDING) |
13
+ | ---- | -------------------- | --------------- | ------------------------------- | ------------------------------- | ------------------------------- | ---------------------------- |
14
+ | 1 | `fullstack-engineer` | `<instance id>` | Read the facts a round waits on | Decision and what it depends on | The fact, and where it was read | PASS/REVISE |
15
15
 
16
16
  ## What the reviewer confirms
17
17
 
@@ -4,20 +4,6 @@ title: QFAI Implement (TDD micro-cycle)
4
4
  description: "Use when invoked by name or handed a QFAI work order to implement, diagnose or repair the examples of one business flow."
5
5
  argument-hint: "<BF-ID> [EX-ID...]"
6
6
  allowed-tools: [Read, Write, Edit, Bash, Grep, Glob, TodoWrite, Task, Agent]
7
- roles:
8
- [
9
- orchestrator,
10
- delivery-planner,
11
- test-design-analyst,
12
- qa-strategist,
13
- acceptance-test-engineer,
14
- frontend-engineer,
15
- backend-engineer,
16
- devops-ci-engineer,
17
- implementation-reviewer,
18
- product-surface-reviewer,
19
- doc-steward,
20
- ]
21
7
  steps:
22
8
  - implement-scaffold
23
9
  - implement-credentials
@@ -120,8 +106,8 @@ Read the `STEP.md` of the current step only, run it, then move to the next.
120
106
  Each step names the common steps it runs in `requires`; read those when the
121
107
  step reaches them.
122
108
 
123
- Inside an `npx qfai workflow` run, the work order lists the steps to run and
124
- this file adds nothing to it.
109
+ Inside an `npx qfai workflow` run, the plan's stage lists the steps to run, and
110
+ its work order names the flow; this file adds nothing.
125
111
 
126
112
  ### Reviewer Gate
127
113
 
@@ -2,28 +2,70 @@
2
2
 
3
3
  ## Default
4
4
 
5
- Process one open EX at a time in ascending ID order within the selected BF flow. Parallel item work requires explicit user approval and a delivery-planner PASS on concrete independence. Parallel role review of one item does not require parallel item authorization.
5
+ Process one open EX at a time in ascending ID order within the selected BF
6
+ flow. The session agent does the work itself. Work orders for several flows run
7
+ one at a time, in ascending flow ID order; the stage's review runs once, after
8
+ the last.
6
9
 
7
- ## Independence gate
10
+ ## Units
8
11
 
9
- For each candidate item, name its production files, test files, contracts, fixtures, schema or database objects, and shared resources such as ports. Disjoint filenames alone are insufficient: compare read and write sets, imports, shared fixtures, persistence, generated assets, and external process state. If any dependency is uncertain, use serial execution.
12
+ Two kinds of unit may run in parallel, each on its own `fullstack-engineer`:
10
13
 
11
- Deny parallel dispatch when two items write the same shared fixture or mock file, or mutate the same fixture instance. A shared fixture module that both items only read as-is does not by itself deny parallel dispatch.
14
+ | Unit | Where | What the worker does |
15
+ | ------ | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
16
+ | Story | An implement stage only | Runs the stage's steps for one user story no EX of which a test annotates yet, in ascending EX ID order, writing only its owned paths |
17
+ | Lookup | Discussion research, a grilling session, the web-research search, fetch and verify stages | Answers one self-contained question from the repository or the web, writes nothing, and returns the answer with its sources |
12
18
 
13
- Give each worker an exact file ownership list and a checkout assigned by the host.
14
- Use separate worktrees when the host supports editing them; otherwise use the
15
- existing shared-index mode in
19
+ Everything else runs in the session agent: the specification, the discussion
20
+ interview and pack, prototyping, triage, verify, maintenance, the framing of
21
+ research and the reading of its answers, and every change to a story that is
22
+ already implemented.
23
+
24
+ ## Parallel-unit gate
25
+
26
+ The session agent fans out only when every condition holds for every pair of
27
+ units. It decides alone, records the result in the stage report, and asks the
28
+ user nothing.
29
+
30
+ | # | Condition |
31
+ | --- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
32
+ | G1 | Each unit is a story unit or a lookup unit, as above |
33
+ | G2 | There are two or more units, and the stage report records that each is large enough to be worth a brief |
34
+ | G3 | Written artifacts hold everything a unit needs: step files, story-tree IDs, contracts, `decisions.md`. A unit whose brief would retell the conversation runs in the session agent |
35
+ | G4 | Writes are disjoint, compared by read and write sets rather than by file name: production files, test files, fixtures, schema or database objects, generated assets, and shared resources such as ports |
36
+ | G5 | No unit needs another unit's output |
37
+ | G6 | Each unit returns a small result: a diff on its owned paths with its selectors' results, or a cited answer |
38
+
39
+ Two units that write the same shared fixture or mock file, or mutate the same
40
+ fixture instance, fail G4. A shared fixture module that both only read as-is
41
+ does not fail it on its own. Where any condition is uncertain, the units run
42
+ serially.
43
+
44
+ ## Briefing a unit
45
+
46
+ Give each worker a self-contained brief, never a fork of the session's
47
+ conversation: the step files to run, the story-tree IDs, the exact owned-path
48
+ list (empty for a lookup), the checks to run and the shape of its answer.
49
+ Give each a checkout assigned by the host. Use separate worktrees when the host
50
+ supports editing them; otherwise use the existing shared-index mode in
16
51
  `.qfai/assistant/rule/workflow.md#concurrency-stage-independent-mandatory`.
17
52
  Creating a worktree does not grant edit permission. For a refused edit, follow
18
53
  `.qfai/assistant/rule/shared-skill-delegation-baseline.md#worker-edit-boundary`.
19
- Workers do not change another worker's files or the story tree. The orchestrator
20
- integrates their results and resolves every overlap before judging either item
21
- complete.
54
+ Workers do not change another worker's files or the story tree.
22
55
 
23
56
  ## Integration gate
24
57
 
25
- After integration, rerun every item selector on the merged tree, the relevant suites, and qfai validate --profile tdd --fail-on error --flow BF-NNNN. Retake evidence whose source revision changed and request the required reviews on that revision. A worker's isolated PASS is not an integrated PASS.
58
+ The session agent integrates the results and resolves every overlap before
59
+ judging any story complete. It reruns every story unit's selectors and
60
+ `npx qfai validate --profile tdd --fail-on error --flow BF-NNNN` on the merged
61
+ tree; the suites run once, in the verify stage. A worker's isolated PASS is not
62
+ an integrated PASS.
26
63
 
27
- On an integration failure, assign the defect to the owning item when the dependency is known. When the combination itself causes the failure, stop parallel dispatch and repair serially. Record the decision and results in the flow evidence. The decision's record carries the four labelled Approach items stated at the top of `.qfai/assistant/skill/qfai-sdd/templates/spec/decisions.md`.
64
+ On an integration failure, assign the defect to the owning story when the
65
+ dependency is known. When the combination itself causes the failure, stop the
66
+ fan-out and repair serially. Record the gate's result and the integration
67
+ results in the stage report. The decision's record carries the four labelled
68
+ Approach items stated at the top of
69
+ `.qfai/assistant/skill/qfai-sdd/templates/spec/decisions.md`.
28
70
 
29
71
  Host limits above this policy: `.qfai/assistant/rule/shared-skill-delegation-baseline.md#host-backstops-above-the-declared-shape`.
@@ -52,6 +52,41 @@ The normal verify run establishes full collection coverage; no extra full suite
52
52
  required for each focused cycle. This receipt adds no ledger, JSON field,
53
53
  gate status, runtime parser or runner.
54
54
 
55
+ ## CI-only Test gate
56
+
57
+ Where the Standard commands entry for the Test gate is written
58
+ `CI only: <check name>`, the project runs its tests in CI alone, and no focused
59
+ Red, Green or Refactor invocation runs locally. The same holds when the user's
60
+ instruction for this run delegates that gate to a named CI check: that
61
+ delegation holds for this run only. Record those phases `ci-deferred` instead:
62
+
63
+ - Write the test before any production code, as for an observed Red, and do
64
+ not run it.
65
+ - In the example's `### EX-NNNN-NNNN-NN` section, the stage report says
66
+ `red: ci-deferred`, `green: ci-deferred` and `refactor: ci-deferred`, with
67
+ the test path, its selector and the check name.
68
+ This is a report label, not a gate status: no gate counts it, and it is not
69
+ a pass. The Test gate stays DELEGATED to that check in the verify stage.
70
+ - For a delegation by instruction, the stage report quotes the instruction word
71
+ for word and says where it came from: this request, an answer to a question,
72
+ or the project's agent instructions. A standing instruction in the project's
73
+ agent instructions counts for each run it is in force. A delegation requires
74
+ an actual CI check that runs this test; local environment failure alone
75
+ creates no delegation. Without an instruction that can be quoted, nothing is
76
+ deferred and the focused phases run locally; the agent never defers them on
77
+ its own judgment.
78
+ - The route's code review reads the test against the code before the fix and
79
+ confirms that its assertion fails there on the stated behavior. A test that
80
+ would pass both before and after the fix is a finding.
81
+
82
+ Where the run has authority to push and open a pull request, from the user's
83
+ instruction or the project's policy, it may observe Red in CI instead: push a
84
+ commit that holds only the test, for example on a draft pull request, confirm
85
+ that the named check fails on the new test's assertion, and record the run URL
86
+ as the Red. A run without that authority does not push to observe Red. Under a
87
+ delegation by instruction, that test-only commit is the expected way to observe
88
+ Red whenever the run has that authority.
89
+
55
90
  ## Assertion control
56
91
 
57
92
  Temporarily neutralize only the example assertion while keeping the test compilable and runnable. The same command must pass. Capture the changed lines and result, then restore the assertion before recording RED. This control shows that the reported failure came from the assertion.