qfai 2.1.0 → 2.1.2

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 (184) hide show
  1. package/README.md +327 -55
  2. package/assets/defaults/agent-routing/qfai-triage.yml +9 -0
  3. package/assets/defaults/workflows/change-tooling.yml +0 -4
  4. package/assets/defaults/workflows/run-owned-cleanup.yml +12 -0
  5. package/assets/init/.claude/settings.json +27 -9
  6. package/assets/init/.codex/hooks.json +20 -8
  7. package/assets/init/.qfai/assistant/agent/frontend-engineer.md +5 -0
  8. package/assets/init/.qfai/assistant/agent/implementation-reviewer.md +14 -1
  9. package/assets/init/.qfai/assistant/agent/product-experience-architect.md +4 -0
  10. package/assets/init/.qfai/assistant/agent/product-surface-reviewer.md +7 -0
  11. package/assets/init/.qfai/assistant/agent/qa-gatekeeper.md +29 -0
  12. package/assets/init/.qfai/assistant/agent/requirements-analyst.md +8 -0
  13. package/assets/init/.qfai/assistant/rule/communication.md +18 -8
  14. package/assets/init/.qfai/assistant/rule/constitution.md +5 -4
  15. package/assets/init/.qfai/assistant/rule/drift-protocol.md +72 -5
  16. package/assets/init/.qfai/assistant/rule/references/asset-authoring.md +72 -0
  17. package/assets/init/.qfai/assistant/rule/references/context-summary.md +30 -0
  18. package/assets/init/.qfai/assistant/rule/references/gate-failure-autorepair.md +42 -0
  19. package/assets/init/.qfai/assistant/rule/references/griller-recommendations.md +23 -0
  20. package/assets/init/.qfai/assistant/rule/references/host-backstops.md +60 -0
  21. package/assets/init/.qfai/assistant/rule/references/placeholder-scan.md +25 -0
  22. package/assets/init/.qfai/assistant/rule/references/reviewer-findings.md +41 -0
  23. package/assets/init/.qfai/assistant/rule/references/reviewer-remit.md +35 -0
  24. package/assets/init/.qfai/assistant/rule/references/worker-edit-boundary.md +48 -0
  25. package/assets/init/.qfai/assistant/rule/shared-skill-delegation-baseline.md +39 -162
  26. package/assets/init/.qfai/assistant/rule/shared-skill-operating-baseline.md +14 -145
  27. package/assets/init/.qfai/assistant/rule/stage-cost.md +1 -1
  28. package/assets/init/.qfai/assistant/rule/test-layers.md +42 -0
  29. package/assets/init/.qfai/assistant/rule/ui-definition-protocol.md +6 -1
  30. package/assets/init/.qfai/assistant/skill/qfai-configure/SKILL.md +11 -45
  31. package/assets/init/.qfai/assistant/skill/qfai-configure/references/principles.md +25 -0
  32. package/assets/init/.qfai/assistant/skill/qfai-discussion/SKILL.md +1 -1
  33. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/discussion-completion-matrix.md +12 -9
  34. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/ui-bearing-playbook.md +2 -4
  35. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/ui_ux/platform_baselines.md +11 -0
  36. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/ui_ux/review_audit_playbook.md +11 -0
  37. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/ui_ux_best_practices.md +13 -42
  38. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/uiux/00_index.md +0 -16
  39. package/assets/init/.qfai/assistant/skill/qfai-grill/SKILL.md +1 -1
  40. package/assets/init/.qfai/assistant/skill/qfai-grilling/SKILL.md +16 -88
  41. package/assets/init/.qfai/assistant/skill/qfai-grilling/references/delegated-session.md +58 -0
  42. package/assets/init/.qfai/assistant/skill/qfai-grilling/references/session-record.md +42 -0
  43. package/assets/init/.qfai/assistant/skill/qfai-implement/SKILL.md +17 -4
  44. package/assets/init/.qfai/assistant/skill/qfai-implement/references/credential-reuse.md +9 -0
  45. package/assets/init/.qfai/assistant/skill/qfai-implement/references/cross-spec-ownership.md +41 -0
  46. package/assets/init/.qfai/assistant/skill/qfai-implement/references/oracle-strength.md +6 -1
  47. package/assets/init/.qfai/assistant/skill/qfai-implement/references/parallelization-policy.md +9 -1
  48. package/assets/init/.qfai/assistant/skill/qfai-implement/references/red-admissibility.md +47 -1
  49. package/assets/init/.qfai/assistant/skill/qfai-implement/references/ui-affecting.md +4 -3
  50. package/assets/init/.qfai/assistant/skill/qfai-maintain/SKILL.md +4 -4
  51. package/assets/init/.qfai/assistant/skill/qfai-migration-v1-to-v2/SKILL.md +16 -10
  52. package/assets/init/.qfai/assistant/skill/qfai-migration-v1-to-v2/references/migration-guide.md +10 -260
  53. package/assets/init/.qfai/assistant/skill/qfai-migration-v1-to-v2/references/migration-placement.md +273 -0
  54. package/assets/init/.qfai/assistant/skill/qfai-prototyping/SKILL.md +5 -4
  55. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/design-md-spec.md +14 -5
  56. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/generator-prompt.md +10 -0
  57. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/handoff.md +1 -1
  58. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/iteration-loop.md +3 -4
  59. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/review-payload-schema.md +12 -5
  60. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/reviewer-prompt.md +33 -4
  61. package/assets/init/.qfai/assistant/skill/qfai-run/SKILL.md +34 -36
  62. package/assets/init/.qfai/assistant/skill/qfai-run/references/evidence-delivery.md +322 -0
  63. package/assets/init/.qfai/assistant/skill/qfai-run/references/extraction.md +67 -24
  64. package/assets/init/.qfai/assistant/skill/qfai-run/references/operator-screens.md +246 -5
  65. package/assets/init/.qfai/assistant/skill/qfai-run/references/plan.md +29 -5
  66. package/assets/init/.qfai/assistant/skill/qfai-run/references/stage-points.md +43 -0
  67. package/assets/init/.qfai/assistant/skill/qfai-sdd/SKILL.md +5 -4
  68. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/concrete-abstract-cycle.md +10 -1
  69. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/contract-artifact-rules.md +22 -9
  70. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/design-anti-patterns.md +41 -6
  71. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/design-md-authoring.md +11 -5
  72. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/design-md-brand-catalog.md +17 -2
  73. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/requirements-decomposition.md +10 -2
  74. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-execution-playbook.md +34 -9
  75. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-phase-checklists.md +4 -4
  76. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-quality-gate.md +2 -2
  77. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-triage.md +177 -7
  78. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/spec-traceability-rules.md +29 -5
  79. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/ui-contract-guide.md +130 -1
  80. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/ui-design-contract-normalization.md +4 -30
  81. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/change-request.md +39 -2
  82. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/contracts/db-contract.sample.sql +2 -2
  83. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/contracts/ui-contract.sample.yaml +52 -5
  84. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/03_contract/cli/cli-NNNN-title.md +2 -2
  85. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/03_contract/tech.md +1 -1
  86. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/decisions.md +7 -0
  87. package/assets/init/.qfai/assistant/skill/qfai-triage/SKILL.md +30 -20
  88. package/assets/init/.qfai/assistant/skill/qfai-verify/SKILL.md +6 -5
  89. package/assets/init/.qfai/assistant/skill/qfai-verify/references/context-load.md +9 -6
  90. package/assets/init/.qfai/assistant/skill/qfai-verify/references/verify-output-contract.md +92 -13
  91. package/assets/init/.qfai/assistant/skill/web-research/SKILL.md +37 -31
  92. package/assets/init/.qfai/assistant/skill/web-research/mcp-templates/brave-search/config.toml +2 -4
  93. package/assets/init/.qfai/assistant/skill/web-research/mcp-templates/brave-search/mcp-config.json +9 -5
  94. package/assets/init/.qfai/assistant/skill/web-research/mcp-templates/firecrawl/.mcp.json +1 -2
  95. package/assets/init/.qfai/assistant/skill/web-research/mcp-templates/firecrawl/config.toml +3 -3
  96. package/assets/init/.qfai/assistant/skill/web-research/mcp-templates/firecrawl/mcp-config.json +11 -8
  97. package/assets/init/.qfai/assistant/skill/web-research/mcp-templates/playwright/config.toml +1 -1
  98. package/assets/init/.qfai/assistant/skill/web-research/mcp-templates/playwright/mcp-config.json +7 -3
  99. package/assets/init/.qfai/assistant/step/common-design-md/STEP.md +17 -7
  100. package/assets/init/.qfai/assistant/step/common-gate-run/STEP.md +126 -13
  101. package/assets/init/.qfai/assistant/step/common-review-cycle/STEP.md +3 -2
  102. package/assets/init/.qfai/assistant/step/discussion-pack/STEP.md +1 -0
  103. package/assets/init/.qfai/assistant/step/discussion-research/STEP.md +2 -0
  104. package/assets/init/.qfai/assistant/step/discussion-uiux/STEP.md +12 -4
  105. package/assets/init/.qfai/assistant/step/implement-backport/STEP.md +1 -1
  106. package/assets/init/.qfai/assistant/step/implement-benchmark/STEP.md +7 -4
  107. package/assets/init/.qfai/assistant/step/implement-dep-bump/STEP.md +11 -1
  108. package/assets/init/.qfai/assistant/step/implement-diagnose/STEP.md +2 -0
  109. package/assets/init/.qfai/assistant/step/implement-oracle-parity/STEP.md +2 -2
  110. package/assets/init/.qfai/assistant/step/implement-quarantine/STEP.md +3 -3
  111. package/assets/init/.qfai/assistant/step/implement-refactor/STEP.md +2 -2
  112. package/assets/init/.qfai/assistant/step/implement-regression-fix/STEP.md +4 -3
  113. package/assets/init/.qfai/assistant/step/implement-retire/STEP.md +6 -3
  114. package/assets/init/.qfai/assistant/step/implement-revert/STEP.md +4 -3
  115. package/assets/init/.qfai/assistant/step/implement-scaffold/STEP.md +3 -3
  116. package/assets/init/.qfai/assistant/step/implement-seam/STEP.md +9 -6
  117. package/assets/init/.qfai/assistant/step/implement-stress-harness/STEP.md +1 -1
  118. package/assets/init/.qfai/assistant/step/implement-sweep/STEP.md +4 -3
  119. package/assets/init/.qfai/assistant/step/implement-tdd/STEP.md +42 -6
  120. package/assets/init/.qfai/assistant/step/implement-test-fix/STEP.md +2 -0
  121. package/assets/init/.qfai/assistant/step/implement-tooling/STEP.md +22 -2
  122. package/assets/init/.qfai/assistant/step/maintain-edit/STEP.md +18 -14
  123. package/assets/init/.qfai/assistant/step/prototyping-grill/STEP.md +4 -3
  124. package/assets/init/.qfai/assistant/step/prototyping-loop/STEP.md +4 -0
  125. package/assets/init/.qfai/assistant/step/prototyping-preflight/STEP.md +1 -3
  126. package/assets/init/.qfai/assistant/step/sdd-contract/STEP.md +11 -0
  127. package/assets/init/.qfai/assistant/step/sdd-flow/STEP.md +4 -0
  128. package/assets/init/.qfai/assistant/step/sdd-gate/STEP.md +4 -0
  129. package/assets/init/.qfai/assistant/step/sdd-story/STEP.md +10 -0
  130. package/assets/init/.qfai/assistant/step/sdd-triage/STEP.md +37 -11
  131. package/assets/init/.qfai/assistant/step/triage-answer/STEP.md +5 -4
  132. package/assets/init/.qfai/assistant/step/triage-close/STEP.md +33 -23
  133. package/assets/init/.qfai/assistant/step/triage-cluster/STEP.md +5 -3
  134. package/assets/init/.qfai/assistant/step/triage-decompose/STEP.md +2 -0
  135. package/assets/init/.qfai/assistant/step/triage-dedupe/STEP.md +4 -0
  136. package/assets/init/.qfai/assistant/step/triage-handoff/STEP.md +13 -4
  137. package/assets/init/.qfai/assistant/step/triage-investigate/STEP.md +8 -5
  138. package/assets/init/.qfai/assistant/step/triage-owned-cleanup/STEP.md +86 -0
  139. package/assets/init/.qfai/assistant/step/triage-request-info/STEP.md +2 -0
  140. package/assets/init/.qfai/assistant/step/triage-security-intake/STEP.md +6 -3
  141. package/assets/init/.qfai/assistant/step/verify-change-note/STEP.md +9 -5
  142. package/assets/init/.qfai/assistant/step/verify-commit/STEP.md +39 -6
  143. package/assets/init/.qfai/assistant/step/verify-external/STEP.md +5 -2
  144. package/assets/init/.qfai/assistant/step/verify-qfai-gate/STEP.md +10 -2
  145. package/assets/init/.qfai/assistant/step/verify-release-notes/STEP.md +1 -0
  146. package/assets/init/.qfai/assistant/step/verify-repeat-run/STEP.md +7 -5
  147. package/assets/init/.qfai/assistant/step/verify-repo-gate/STEP.md +136 -28
  148. package/assets/init/.qfai/waivers.yml +1 -1
  149. package/assets/init/root/.agents/rules/ai-readable-markdown.md +98 -0
  150. package/assets/init/root/.agents/rules/api-budget.md +191 -13
  151. package/assets/init/root/.agents/rules/documentation-clarity.md +192 -35
  152. package/assets/init/root/.agents/rules/grilling.md +4 -4
  153. package/assets/init/root/.agents/rules/interface-clarity.md +5 -5
  154. package/assets/init/root/.agents/rules/minimal-implementation.md +11 -3
  155. package/assets/init/root/.agents/rules/reminders.json +27 -14
  156. package/assets/init/root/.agents/rules/session-feedback.md +136 -0
  157. package/assets/init/root/.agents/rules/temporary-files.md +47 -5
  158. package/assets/init/root/.agents/rules/untrusted-content.md +3 -3
  159. package/assets/init/root/.agents/rules/user-questions.md +74 -36
  160. package/assets/init/root/.gitattributes +9 -0
  161. package/assets/init/root/.github/workflows/qfai-docs.yml +44 -12
  162. package/assets/init/root/.github/workflows/qfai-tests.yml +58 -15
  163. package/assets/init/root/.github/workflows/qfai-validate.yml +49 -42
  164. package/assets/init/root/AGENTS.md +23 -21
  165. package/assets/mdschema/story/03_contract/tech.mdschema.yml +7 -3
  166. package/assets/sandbox-templates/default-deny.yaml +9 -5
  167. package/assets/schemas/workflow/extraction.schema.json +85 -5
  168. package/assets/schemas/workflow/plan.schema.json +9 -2
  169. package/assets/scripts/check-mdschema.mjs +172 -5
  170. package/assets/uix-rev/comparison-review.md +1 -1
  171. package/assets/uix-rev/contracts-review.md +1 -2
  172. package/dist/cli/index.cjs +6499 -7688
  173. package/dist/cli/index.cjs.map +1 -1
  174. package/dist/cli/index.mjs +6449 -7641
  175. package/dist/cli/index.mjs.map +1 -1
  176. package/dist/index.cjs +5548 -7823
  177. package/dist/index.cjs.map +1 -1
  178. package/dist/index.d.cts +40 -666
  179. package/dist/index.d.ts +40 -666
  180. package/dist/index.mjs +5397 -7648
  181. package/dist/index.mjs.map +1 -1
  182. package/docs/MIGRATION-2.0.0.md +1 -1
  183. package/package.json +5 -7
  184. package/assets/init/root/CLAUDE.md +0 -45
@@ -2,6 +2,18 @@
2
2
 
3
3
  The story tree makes business intent concrete before a rule is attached to an enforcing contract. The required chain is BF → US → AC → EX ← BR. A policy, index, or decision row cites an ID; it does not declare a second copy of the item.
4
4
 
5
+ ## Contents
6
+
7
+ - Layout and ownership
8
+ - Document shapes
9
+ - Architecture
10
+ - Identifier scopes
11
+ - Edge rules
12
+ - Contract forms and index
13
+ - Test-layer handoff
14
+ - Decision provenance and drift
15
+ - Gate
16
+
5
17
  ## Layout and ownership
6
18
 
7
19
  - <paths.specsDir>/01_policy/ owns objective, initiative, principles, constraints, and glossary.
@@ -48,7 +60,7 @@ A layer is a group of modules with a dependency direction. An upper layer may us
48
60
 
49
61
  The section holds two things, in this order:
50
62
 
51
- 1. One `mermaid` block, `flowchart TD`, with one node per layer and one `Upper --> Lower` edge per dependency, and nothing else. A node is an ID, or an ID with its label in square brackets when the layer's name is not an ID.
63
+ 1. One `mermaid` block, `flowchart TD`, with one node per layer and one `Upper --> Lower` edge per dependency, and nothing else. A node is an ID, or an ID with its label in square brackets and double quotes, as in `Upper["Domain (core)"]`, when the layer's name is not an ID.
52
64
  2. One table of Layer, Responsibility and Depends on, one row per layer, from the uppermost layer to the lowermost. Depends on names only layers in rows below its own, comma-separated, or `-` for none. Peers at the same height may come in any order.
53
65
 
54
66
  `npx qfai validate` reports a Depends on that names a layer not below its row, and any node or edge the diagram and the table do not share.
@@ -77,14 +89,26 @@ The table holds no rule. A behaviour a layer must show is a BR in the contract t
77
89
 
78
90
  Use highest existing number plus one in the scope. Count IDs named in retired-item decisions, so deletion never frees an ID. Empty scopes begin at 0001 or, for AC and EX tails, 01. Directory names match their BF and US IDs. Do not add a CLI allocator.
79
91
 
92
+ AC/EX tails remain two digits with upper bound 99. Before planned additions,
93
+ compare requested additions with the retired-inclusive remaining 99-H. Stop an
94
+ over-capacity batch before partial declarations. For an approved capacity-only
95
+ sibling or actual move, apply the owning stage's capacity preflight and complete
96
+ map before writing; no larger ID or new product outcome is a substitute for the
97
+ required scope.
98
+
80
99
  Constraint IDs are the exception. `TC-NN`, `OC-NN` and `BC-NN` in constraint.md are positional: each section numbers its rows from 01 in table order. No other document cites one, so a removed row closes the gap and the rows after it are renumbered. `npx qfai validate` reports a constraint ID that is not its row's place.
81
100
 
82
- Moving a story to another flow changes its US ID and every child AC and EX ID. Update all indexes, contract citations, and decision references in the same change. Record the old IDs as retired so they cannot be issued again.
101
+ Moving a story to another flow changes its US ID and every child AC and EX ID
102
+ under its existing approval path. Preserve case meanings and assertions through
103
+ the complete fixed-source map, update approved active indexes, contract citations
104
+ and counted test references. Record the old IDs as retired in a new approved
105
+ record so they cannot be issued again. Inherited DEC ID, Content and Approach
106
+ cells and their old-ID references stay historical and unchanged.
83
107
 
84
108
  ## Edge rules
85
109
 
86
110
  1. business-flows.md cites each actual BF. Each business-flow.md states its BF in its H1, gives its purpose, and draws its main path as exactly one Mermaid flowchart or sequenceDiagram under `## Flow`.
87
- 2. user-stories.md cites each US under that flow. A user story declares its US in its H1. Its parent BF is the directory it sits in, and no line of the file restates it. Keep each observable outcome in its own story.
111
+ 2. user-stories.md cites each US under that flow. A user story declares its US in its H1. Its parent BF is the directory it sits in, and no line of the file restates it. Keep each observable outcome in its own story, except the explicitly approved same-BF, same-actor-goal capacity-only partition above.
88
112
  3. 02_Acceptance-Criteria.md states each AC under that US as an `# AC-NNNN-NNNN-NN` comment followed by exactly one Gherkin `Scenario:`.
89
113
  4. Each EX row in 03_Example.md has exactly one AC-Ref. It names an AC in that story. Every AC has at least one EX.
90
114
  5. Each BR lives in an enforcing contract and cites one or more full EX IDs that already exist. Every EX is cited by at least one BR. Several BRs may cite an EX, and one BR may cite several EXs.
@@ -95,7 +119,7 @@ Do not substitute an AC for an EX in a BR citation. The examples are concrete ev
95
119
 
96
120
  ## Contract forms and index
97
121
 
98
- YAML and JSON contracts put rules under x-qfai-rules. SQL contracts use -- Rule and -- Examples: lines. Markdown contracts use a ## Business rules table. Each rule includes ID, statement, and full example IDs. Follow contract-artifact-rules.md and the contract's paired template for syntax.
122
+ YAML and JSON contracts put rules under x-qfai-rules. SQL contracts use -- Rule and -- Examples: lines. Markdown contracts use a ## Business rules table. Each rule includes ID, statement, and full example IDs. Follow the contract artifact rules and the contract's paired template for syntax.
99
123
 
100
124
  Each contract file written has a contracts.md row in the same change. The index cites the file and its ID; it is not another rule definition. Confirm that a contract can realize each persisted attribute in its cited AC and EX directly or through a stated join. Reconcile paired contracts' state and error vocabularies.
101
125
 
@@ -116,7 +140,7 @@ a later decision explicitly reopens it.
116
140
 
117
141
  A decisions.md row's Approach takes the form stated at the top of templates/spec/decisions.md.
118
142
 
119
- Use .qfai/assistant/rule/change-classification.md for Primary and Tags and references/requirements-decomposition.md for turning source requirements into concrete outcomes. Apply .qfai/assistant/rule/drift-protocol.md before accepting a direction that conflicts with a previous decision. Do not silently promote discussion material into a governing spec.
143
+ Use .qfai/assistant/rule/change-classification.md for Primary and Tags and the requirements decomposition procedure for turning source requirements into concrete outcomes. Apply .qfai/assistant/rule/drift-protocol.md before accepting a direction that conflicts with a previous decision. Do not silently promote discussion material into a governing spec.
120
144
 
121
145
  ## Gate
122
146
 
@@ -3,6 +3,22 @@
3
3
  Write UI contracts under `<paths.contractsDir>/ui/**/*.{yaml,yml}`, each named `ui-NNNN-<slug>.yaml` after its ID. A UI-bearing contract declares exactly one full `# QFAI-CONTRACT-ID: UI-NNNN` and a nonempty `screens[]` list. Add its row to `<paths.contractsDir>/contracts.md` in the same change.
4
4
  The flows a UI contract serves are the flows whose examples its rules cite; the file name does not select them.
5
5
 
6
+ ## Contents
7
+
8
+ - `screens[].primary_tasks` shape
9
+ - Recommended ceiling: at most 7
10
+ - `elements[].id` naming policy
11
+ - `elements[].label` is inspection-target text
12
+ - `data-qfai` marker convention
13
+ - Prototype metadata
14
+ - Purposeful copy: `supplements` and `structure`
15
+ - Screen contract rules
16
+ - Template
17
+ - Typical failures
18
+ - Prototyping coverage
19
+ - Root DESIGN.md
20
+ - Review checklist
21
+
6
22
  ## `screens[].primary_tasks` shape
7
23
 
8
24
  Each entry in `screens[]` must carry a `primary_tasks:` slot. Each
@@ -128,6 +144,110 @@ evidence records nothing against it — an entry is a note between the contract'
128
144
  author and whoever reviews the prototype. Follow the shape
129
145
  `templates/contracts/ui-contract.sample.yaml` shows.
130
146
 
147
+ ## Purposeful copy: `supplements` and `structure`
148
+
149
+ A screen states the words it shows, so that implementation adds none the contract
150
+ did not ask for and review can compare the rendered screen with what was agreed.
151
+ The words are the screen `title` (its one heading), the labels of `elements` and
152
+ `actions`, the group headings, and the supplements below. Two keys carry them,
153
+ beside `primary_tasks`, `elements` and `actions`, which stay as they are.
154
+
155
+ ### `supplements` (required)
156
+
157
+ Every text the screen shows beyond its `title`, group headings and labels: a
158
+ sentence under a field, a notice, an empty-state message, a disclosure, the result
159
+ of a save or a send, the instruction after a failure, the consequence of an action
160
+ that cannot be undone. Each is an entry with exactly these keys, all non-empty:
161
+
162
+ | Key | Holds |
163
+ | ------ | ----------------------------------------------------------------------------------------- |
164
+ | `id` | stable key, unique in the screen |
165
+ | `near` | the `id` of the element, action or structure group the text sits with |
166
+ | `when` | the state it shows in: `default`, `empty`, `loading`, `error` or `success` |
167
+ | `text` | the words as displayed |
168
+ | `why` | what the user could not know or do without it, and why a label or structure is not enough |
169
+
170
+ `supplements: []` says the screen shows none. Most screens need few, and a screen
171
+ need not have any. Two kinds of text are not supplements: the message of a field
172
+ rule is owned by the `validations` of its element, and data the product shows or
173
+ the user types is not copy the contract authors. A field message that says more
174
+ than its rule does is a supplement with `when: error`.
175
+
176
+ The list is the whole inventory in both directions. Text the screen shows that is
177
+ not listed is excess. A listed text the screen does not show is an unmet need, so
178
+ a necessary condition, cost, destination, result, recovery step or consequence
179
+ that is written here cannot be dropped by a later tidy-up; removing it is a
180
+ change to the contract, which goes back to `/qfai-sdd`.
181
+
182
+ Write `why` for the point of decision. "Explains the Save button" is a reason to
183
+ delete the text. "After the click the user cannot see where the draft went" is a
184
+ reason to keep it.
185
+
186
+ ### `structure` (optional)
187
+
188
+ The groups the screen is read in, in reading order. Each is an entry with exactly
189
+ `id`, `tasks`, `members` and, when the group shows a heading, `heading`:
190
+
191
+ | Key | Holds |
192
+ | --------- | ------------------------------------------------------------------ |
193
+ | `id` | stable key, unique in the screen |
194
+ | `tasks` | the `primary_tasks[].id` values the group serves, at least one |
195
+ | `members` | the `elements[].id` and `actions[].id` values it holds, in order |
196
+ | `heading` | the displayed heading; leave the key out when the group shows none |
197
+
198
+ An id belongs to one group, and an element or action may be left out of every
199
+ group. Without `structure` the screen shows no heading beyond its `title`, so a
200
+ heading that appears on the rendered screen has a group here. A group heading is
201
+ not the screen title: a second heading above or beside the real one repeats it.
202
+ A group that serves no task does not belong on the screen; name the task it
203
+ enables, or leave the heading and the group out.
204
+
205
+ ### A worked example
206
+
207
+ The sample at `templates/contracts/ui-contract.sample.yaml` shows a complete
208
+ screen. Its draft action reads "Save draft", and no paragraph says what Save draft
209
+ does. What the label cannot say is declared instead: `Saved to Drafts` after the
210
+ click, and `Not saved. Your entries are still here. Try again.` after a failure.
211
+ The user learns where the draft went and what a failure means, and nothing is
212
+ written twice.
213
+
214
+ ### What a necessary text looks like
215
+
216
+ Subtraction removes text that adds no meaning. It never removes:
217
+
218
+ - a condition, cost, storage or transmission destination, or the result of an
219
+ action that is not visible otherwise (a demo-data notice that is true and
220
+ shown where the user decides is one of these);
221
+ - error recovery, and the consequence of an action that cannot be undone;
222
+ - labels, accessible names, roles and states.
223
+
224
+ Moving such text into a tooltip or a placeholder does not keep it. A word or
225
+ character count never approves or rejects a screen; a count is an observation
226
+ a finding may cite.
227
+
228
+ ### What validate checks
229
+
230
+ `QFAI-CONTRACT-043` reports `supplements` absent, a key that is not a list, an
231
+ entry that is not a mapping, a missing, empty or extra key, a `when` outside the
232
+ five states, and a repeated `id`; the same for `structure` when it is written.
233
+ `QFAI-CONTRACT-044` reports a `members`, `tasks` or `near` that names an id
234
+ the screen does not declare, and an element or action in two groups.
235
+ `QFAI-CONTRACT-045` warns when a group heading is the screen title, or a
236
+ supplement's text is the title, a group heading, the label of what it sits near, or
237
+ another supplement's text near the same target in the same state; case, spacing and
238
+ closing punctuation do not make a text different. Whether a sentence is needed is
239
+ judged against the task by the reviewer; validate compares ids and exact wording
240
+ only.
241
+
242
+ A contract written before these keys was valid without them. Add
243
+ `supplements` to each screen: `supplements: []` is the answer for a screen that
244
+ shows nothing beyond its title and labels. Keep `structure` out until a group
245
+ heading is wanted.
246
+
247
+ Two contracts that state the same screen `id` each hold their own `supplements`
248
+ and `structure`; the project-wide screen list compares `title`, `route` and
249
+ `primary_tasks` only.
250
+
131
251
  ## Screen contract rules
132
252
 
133
253
  `screens[].elements[]` are the display fields:
@@ -170,6 +290,13 @@ Render the element with that marker, or remove the marker from the contract.
170
290
  **A label does not match.** Update the contract label, then the rendered text or
171
291
  marker mapping. Updating one side leaves the two out of step.
172
292
 
293
+ **`QFAI-CONTRACT-043` names a screen with no `supplements`.** Add `supplements: []`
294
+ if the screen shows no text beyond its title, group headings and labels, or list each
295
+ text with its `near`, `when`, `text` and `why`.
296
+
297
+ **`QFAI-CONTRACT-045` warns that a supplement repeats a label.** Delete the supplement,
298
+ or word it so it tells the user something the label does not.
299
+
173
300
  **The discussion pack already has screen contracts, so this looks redundant.**
174
301
  It is not. A discussion pack is discovery output and is non-normative; the
175
302
  downstream skills and every validate lane read `<paths.contractsDir>/ui/*.yaml`.
@@ -185,11 +312,13 @@ A malformed UI contract or an empty screen list is an authoring failure. Fix the
185
312
 
186
313
  ## Root DESIGN.md
187
314
 
188
- For a UI-bearing visual flow, the root `DESIGN.md` is authored and validated by `.qfai/assistant/step/common-design-md/STEP.md`. Normalize approved screen decisions with `ui-design-contract-normalization.md`. A CLI-only flow without a visual secondary surface does not need one.
315
+ For a UI-bearing visual flow, the root `DESIGN.md` is authored and validated by `.qfai/assistant/step/common-design-md/STEP.md`. Normalize approved screen decisions with the UI design contract normalization reference. A CLI-only flow without a visual secondary surface does not need one.
189
316
 
190
317
  ## Review checklist
191
318
 
192
319
  - [ ] Every UI-bearing contract has one full declared ID, at least one screen, and a matching `contracts.md` row.
193
320
  - [ ] Screen IDs, routes, primary tasks, labels, markers, and actions are stable and testable.
194
321
  - [ ] Every declared action has an observable effect, including relevant failure states.
322
+ - [ ] Every screen declares `supplements` (`[]` when none), each with the reason the text is needed, and its `structure` names every heading beyond the title.
323
+ - [ ] No supplement restates a label, heading or action the screen already shows, and none is development commentary.
195
324
  - [ ] Prototyping coverage uses full contract IDs and the current cycle-0 fields.
@@ -15,33 +15,6 @@ A cli-only target has no root `DESIGN.md`; it still normalizes
15
15
  `/qfai-prototyping` records its handoff in
16
16
  `.qfai/prototype/final/handoff.json`. SDD does not author it.
17
17
 
18
- ## Removed yaml contracts (permanent)
19
-
20
- The legacy per-aspect brand yaml contracts have been **removed**. The
21
- brand SSOT is now root `DESIGN.md` only, authored by `common-design-md`.
22
- Do not regenerate or reintroduce these files. Their content is subsumed by
23
- `DESIGN.md`:
24
-
25
- - brand archetype / voice / audience → `DESIGN.md` `brand` + `audience` +
26
- `# Brand Philosophy` body.
27
- - negative references / things-to-avoid →
28
- `audience.do_not_look_like` and the **Don't** subsection of
29
- `# Brand Philosophy`.
30
- - color / typography / spacing / radius / shadow tokens →
31
- `DESIGN.md` `visual.*` token tree.
32
-
33
- The following contracts MUST NOT be generated (the corresponding
34
- concepts do not exist in the current prototyping skill):
35
-
36
- - `evaluation-rubric.yaml` — evaluation axes are global constants; no
37
- per-project rubric.
38
- - `evaluator-calibration.yaml` — calibration is the ordinal scale plus
39
- a 200–500 word prose critique authored at review time.
40
- - `absorption-policy.yaml` — absorption / harvest concepts are not
41
- used.
42
- - `selected-direction.yaml` — winner selection is not used; the latest
43
- accepted iteration is always the artifact.
44
-
45
18
  ## Sidecar mapping
46
19
 
47
20
  The remaining UI-bearing sidecar maps to its contract as follows:
@@ -50,13 +23,14 @@ The remaining UI-bearing sidecar maps to its contract as follows:
50
23
 
51
24
  Project-specific anti-pattern notes live in `audience.do_not_look_like`
52
25
  of `DESIGN.md`. Evaluator axes are fixed by the review validation the
53
- QFAI CLI applies (restated in
54
- `.qfai/assistant/skill/qfai-prototyping/references/reviewer-prompt.md`)
55
- and are no longer authored as sidecar files.
26
+ QFAI CLI applies.
56
27
 
57
28
  ## Normalization Rules
58
29
 
59
30
  - Preserve source IDs where available.
31
+ - Normalize the sidecar's notes on displayed text into the screen's `supplements`
32
+ and `structure`, as the UI contract guide shapes them. Notes for the author or
33
+ the reviewer are not displayed text and are not copied into either key.
60
34
  - Convert prose into machine-readable arrays or objects.
61
35
  - Reject placeholder text instead of copying it into contracts.
62
36
  - Frame negative references in `audience.do_not_look_like` as
@@ -9,7 +9,44 @@ Record a change request as one row in `<paths.specsDir>/decisions.md`. The row h
9
9
  - Allocate `DEC-NNNN` as the highest decision ID in this tree plus one. Never reuse an ID, including a retired one.
10
10
  - Begin `Content` with `Change request:` and name every repository-relative path the decision can change; an ID there authorizes nothing. A path mentioned only in a discussion or an alternative does not authorize an edit.
11
11
  - Describe the actual contradiction and its source in `Content`. In `Approach`, state the proposed correction, affected work, and the gate that proves it is applied, inside the form stated at the top of `templates/spec/decisions.md`. Keep both cells concise enough to review as a table row.
12
- - Append the row only once the user approves the change, at `WIP`, and record in `Approach` who approved it, when, and the option chosen. Move it to `DONE` only after the owner rerun, affected artifacts, and validation evidence are complete. Use `SUPERSEDED (by DEC-NNNN)` when a later decision replaces the row.
12
+ - Append the row only once the user approves the change, at `WIP`, and record in `Approach` who approved it, when, and the option chosen. Move it to `DONE` only after the owner rerun, affected artifacts, and validation evidence are complete. Use `SUPERSEDED (by DEC-NNNN)` when a later decision replaces the row, and `PARTLY SUPERSEDED (by DEC-NNNN)` when it replaces only part of it.
13
13
  - Append a declined change at `REJECTED`, recording in `Approach` who declined it and when. It authorizes no edit.
14
- - After appending, change only `Status`. Never rewrite `ID`, `Content`, or `Approach`, and never delete the row. If its scope or proposed correction changes, append a new decision row and supersede the old one.
14
+ - After appending, change only `Status`, apart from the drift protocol's
15
+ explicit branch-added decision renumbering or published decision prefix
16
+ recovery. Keep inherited ID, Content and Approach fixed, and never delete a
17
+ row. A row the base holds at DONE authorizes nothing at any Status, so a later
18
+ change needs a new row. If its scope or proposed correction changes, append a
19
+ new decision row and supersede the old one.
15
20
  - Keep open questions in `<paths.specsDir>/open-questions.md`. Use the same four columns there, with `OQ-NNNN` IDs and the statuses permitted by that template.
21
+
22
+ ## Published decision prefix recovery
23
+
24
+ Use the same four-cell row only after actual approval covers this specific
25
+ recovery. Read `.qfai/assistant/rule/drift-protocol.md#published-decision-prefix-recovery`
26
+ for eligibility, byte boundaries, pre-write checks and stop conditions. Generic
27
+ protocol approval and a diagnostic suggestion do not authorize a target.
28
+
29
+ - Content names the target's repository-relative file and the unique target
30
+ DEC ID. Approach records the published source commit, fixed base and unique
31
+ common ancestor, with evidence the target is absent from the latter two and
32
+ the source commit is a current-HEAD ancestor.
33
+ - Evidence names actual supporting files. Grounds records the recovery reason,
34
+ actual approval authority, old and new SHA-256 Approach digests, and the exact
35
+ approved `- Evidence: <actual file references> - Grounds: ` prefix, including
36
+ its trailing space. Use actual references in place of the placeholder.
37
+ - The old digest matches the raw published source cell; the new digest matches
38
+ the prefix plus the complete original Approach. State the single-line valid
39
+ UTF-8 cell boundary: exclude only delimiter pipes and exactly one ASCII
40
+ padding space at each end. Decode no escapes and trim or normalize nothing.
41
+ - State that original ordered, nonempty Residual risk and Rollback items are
42
+ valid. Preserve ID, Content, Status, the full original suffix and every other
43
+ row. Record the immediate pre-write uniqueness, unchanged-cell and old-digest
44
+ checks, and the required existing validation without an exemption.
45
+ - Residual risk states the remaining observation and concurrency limits.
46
+ Rollback removes only the recorded prefix when the current new digest still
47
+ matches; otherwise it preserves the row and stops. Removal restores the
48
+ original validation failure. Do not reset, amend or force push.
49
+
50
+ Inherited records, open-question rows, unavailable provenance, ambiguous byte
51
+ boundaries, duplicate IDs, stale digests and any unapproved change stop recovery.
52
+ Do not fill approval or execution fields with assumed answers or planned results.
@@ -1,9 +1,9 @@
1
- -- QFAI-CONTRACT-ID: DB-0002
1
+ -- QFAI-CONTRACT-ID: DB-0006
2
2
  -- Replace the sample IDs: the contract takes the next contract number, its
3
3
  -- rules are numbered under it, and its examples come from the story tree.
4
4
  -- Purpose: Sample order draft persistence contract
5
5
  -- Depends on: -
6
- -- Rule BR-0002-0001: An order draft stores a nonempty customer ID.
6
+ -- Rule BR-0006-0001: An order draft stores a nonempty customer ID.
7
7
  -- Examples: EX-0001-0001-02
8
8
  -- Apply-order dependencies as a comma-separated list of DB-* ids, or `-`
9
9
  -- when there are none. List only what must be applied BEFORE this file.
@@ -19,6 +19,8 @@ prototype:
19
19
  purpose: customer id field on the order create form
20
20
  screens:
21
21
  - id: order_create
22
+ # The one heading of the screen. A heading beyond it is a group heading
23
+ # under `structure`.
22
24
  title: Create Order
23
25
  route: /orders/new
24
26
  # primary_tasks: at least one entry required per screen (QFAI-AUD-001).
@@ -36,6 +38,9 @@ screens:
36
38
  label: Correct a rejected field
37
39
  acceptance: the field-level error clears and submit re-enables
38
40
  - id: t3
41
+ label: Keep the order for later
42
+ acceptance: the order appears under /orders/drafts and the form keeps what was entered
43
+ - id: t4
39
44
  label: Abandon the draft
40
45
  acceptance: navigating away discards the draft and returns to /orders
41
46
  elements:
@@ -51,13 +56,55 @@ screens:
51
56
  required: true
52
57
  validations:
53
58
  - must be non-empty
54
- - id: submit_button
55
- label: Submit
56
- type: button
57
- required: true
58
- validations: []
59
59
  actions:
60
60
  - id: submit_order
61
61
  label: Submit order
62
62
  kind: submit
63
63
  effect: navigates to /orders and shows the created row
64
+ - id: save_draft
65
+ label: Save draft
66
+ kind: submit
67
+ effect: stores the order under /orders/drafts, stays on the form and keeps what was entered
68
+ - id: discard_draft
69
+ label: Discard draft
70
+ kind: navigate
71
+ effect: navigates to /orders without storing the order
72
+ # structure (optional): the groups the screen is read in, in reading order.
73
+ # `tasks` are primary_tasks ids, `members` are elements/actions ids, and
74
+ # `heading` is the displayed heading of the group; leave it out for a group
75
+ # that shows none. Without `structure` the screen shows no heading beyond
76
+ # its title. An id belongs to one group.
77
+ structure:
78
+ - id: g_customer
79
+ heading: Customer
80
+ tasks: [t1, t2]
81
+ members: [customer_id_input]
82
+ - id: g_items
83
+ heading: Items
84
+ tasks: [t1, t2]
85
+ members: [item_code_input]
86
+ - id: g_commit
87
+ tasks: [t1, t3, t4]
88
+ members: [submit_order, save_draft, discard_draft]
89
+ # supplements (required): every text the screen shows beyond its title,
90
+ # group headings and labels. Field validation messages are the exception;
91
+ # they belong to the element's `validations`. `[]` says the screen shows
92
+ # none. `near` is an elements/actions/structure id, `when` is one of
93
+ # default, empty, loading, error, success, and `why` says what the user
94
+ # could not know or do without the text, and why a label or the structure
95
+ # cannot carry it.
96
+ #
97
+ # There is no supplement that restates what "Save draft" does: the label
98
+ # says it. What the label cannot say is where the draft went and what a
99
+ # failed save means, so those two are declared.
100
+ supplements:
101
+ - id: sp_draft_saved
102
+ near: save_draft
103
+ when: success
104
+ text: Saved to Drafts
105
+ why: After the click the user cannot see where the order went; the label names the action, not the place its result is kept.
106
+ - id: sp_draft_not_saved
107
+ near: save_draft
108
+ when: error
109
+ text: Not saved. Your entries are still here. Try again.
110
+ why: A failed save leaves the user unsure whether work was lost and what to do; the label says nothing about failure.
@@ -1,4 +1,4 @@
1
- # CLI-0001: Example command
1
+ # CLI-0006: Example command
2
2
 
3
3
  ## Ownership boundary
4
4
 
@@ -8,4 +8,4 @@
8
8
 
9
9
  | BR-ID | Statement | Examples |
10
10
  | ------------ | ------------ | --------------- |
11
- | BR-0001-0001 | Example rule | EX-0001-0001-01 |
11
+ | BR-0006-0001 | Example rule | EX-0001-0001-01 |
@@ -19,7 +19,7 @@
19
19
 
20
20
  ```mermaid
21
21
  flowchart TD
22
- Upper[<upper layer>] --> Lower[<lower layer>]
22
+ Upper["<upper layer>"] --> Lower["<lower layer>"]
23
23
  ```
24
24
 
25
25
  | Layer | Responsibility | Depends on |
@@ -13,6 +13,13 @@ No item is empty, and only the last two may take `none — <reason>`. What a
13
13
  kind of row must state in its Approach, such as a change request's proposed
14
14
  correction, goes inside these items. Write a `|` inside a cell as `\|`.
15
15
 
16
+ Use this form for every new row. A passing validation result does not prove
17
+ that every decision row follows it.
18
+
19
+ A row that records a spec change following from an earlier approval may name
20
+ that earlier decision by its ID in `Grounds:`, in place of a new answer from
21
+ the user. Its `Evidence:` still lists what supports the change.
22
+
16
23
  A stage that does not own this file records its decisions in its own final
17
24
  report, with the same four items under the same rules.
18
25
  -->
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: qfai-triage
3
- title: QFAI Triage (Requests that end without a change)
4
- description: "Use when invoked by name or handed a QFAI work order for a request that ends without a change to the project: a question to answer, a duplicate, missing information, a request to split, automated reports, a security report to take in, or an operation only a person can run."
3
+ title: QFAI Triage (Requests that end without a tracked change)
4
+ description: "Use when invoked by name or handed a QFAI work order for a request that ends without a tracked change: a question, a duplicate, missing information, a split, automated reports, a security report, an operation only a person can run, or authorized cleanup of current-task temporary directories."
5
5
  argument-hint: "<the request, as it was reported>"
6
6
  allowed-tools: [Read, Glob, Grep, Write, Bash, TodoWrite, Task, Agent]
7
7
  roles:
@@ -24,14 +24,15 @@ steps:
24
24
  - triage-cluster
25
25
  - triage-security-intake
26
26
  - triage-handoff
27
+ - triage-owned-cleanup
27
28
  - triage-close
28
29
  requires: []
29
30
  mode: execution-focused
30
31
  ---
31
32
 
32
- ## /qfai-triage - Requests that end without a change
33
+ ## /qfai-triage - Requests that end without a tracked change
33
34
 
34
- [DRIFT-PROTOCOL:MANDATORY]
35
+ [DRIFT-PROTOCOL:REQUIRED]
35
36
 
36
37
  Run the entry check of
37
38
  `.qfai/assistant/rule/shared-skill-operating-baseline.md#workflow-run-entry-check-mandatory`
@@ -39,7 +40,10 @@ first.
39
40
 
40
41
  This skill answers, closes, splits or hands over a request, and changes no
41
42
  file git tracks. Work the request needs is recorded as a follow-up request,
42
- never done here.
43
+ never done here except the exact current-task temporary cleanup that
44
+ `triage-owned-cleanup` permits. That step rechecks existing user authority and
45
+ repository-local scope before any deletion. No other triage step executes an
46
+ operation, and `triage-handoff` still waits for the person's reported result.
43
47
 
44
48
  ## Inputs
45
49
 
@@ -59,17 +63,18 @@ Invoked by name, run the steps in this order, as
59
63
  states: read `.qfai/assistant/step/<name>/STEP.md` for the current step only,
60
64
  run it, then move to the next.
61
65
 
62
- | Step | What it does | Skipped when |
63
- | ------------------------ | -------------------------------------------------------------- | -------------------------------------------------------------------------------- |
64
- | `triage-dedupe` | Finds the same or a successor item, and links it | The request neither may repeat an existing item nor rests on a premise that aged |
65
- | `triage-request-info` | Asks for the facts the request is missing | The request states every fact its handling needs |
66
- | `triage-investigate` | Reads internals, history and outside facts to find the answer | The documents and code as they stand answer the question |
67
- | `triage-answer` | Answers, citing what shows the answer | The request asks no question |
68
- | `triage-decompose` | Splits the request into child requests with their dependencies | The request is one piece of work |
69
- | `triage-cluster` | Groups automated reports by signature | The request is not a set of automated reports |
70
- | `triage-security-intake` | Takes a vulnerability report in privately | The request reports no exploitable weakness |
71
- | `triage-handoff` | Gives a person the steps of an operation only they can run | The request needs no operation that only a person can run |
72
- | `triage-close` | Records the outcome and each follow-up, and closes | Only `triage-security-intake` ran: the fix follows it, so the request stays open |
66
+ | Step | What it does | Skipped when |
67
+ | ------------------------ | -------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
68
+ | `triage-dedupe` | Finds the same or a successor item, and links it | The request neither may repeat an existing item nor rests on a premise that aged |
69
+ | `triage-request-info` | Asks for the facts the request is missing | The request states every fact its handling needs |
70
+ | `triage-investigate` | Reads internals, history and outside facts to find the answer | The documents and code as they stand answer the question |
71
+ | `triage-answer` | Answers, citing what shows the answer | The request asks no question |
72
+ | `triage-decompose` | Splits the request into child requests with their dependencies | The request is one piece of work |
73
+ | `triage-cluster` | Groups automated reports by signature | The request is not a set of automated reports |
74
+ | `triage-security-intake` | Takes a vulnerability report in privately | The request reports no exploitable weakness |
75
+ | `triage-handoff` | Gives a person the steps of an operation only they can run | The request needs no operation that only a person can run |
76
+ | `triage-owned-cleanup` | Removes authorized current-task temporary directories and verifies absence | The request is not the specific repository-local cleanup the step permits |
77
+ | `triage-close` | Records the outcome and each follow-up, and closes | Only `triage-security-intake` ran: the fix follows it, so the request stays open |
73
78
 
74
79
  Invoked by name, the skill ends at this stage. It starts no other stage and
75
80
  routes no follow-up: a request to carry a follow-up out goes to `qfai-run`.
@@ -94,9 +99,13 @@ Follow `.qfai/assistant/rule/shared-skill-operating-baseline.md#completion-contr
94
99
  find changed when it started.
95
100
 
96
101
  The report states the outcome `triage-close` recorded and lists each follow-up
97
- request. It never says a change is done. It ends with a question listing the
98
- next actions, as `.agents/rules/user-questions.md` § 6 sets out; under a
99
- no-question mode, list them in the report instead.
102
+ request. It never says a tracked change is done. `cleaned` says only that the
103
+ named temporary targets were removed and their absence and unchanged tracked
104
+ contents and index were verified; unfinished cleanup cannot use it.
105
+ Ask for the next action only when
106
+ proceeding requires the user's answer, as `.agents/rules/user-questions.md`
107
+ § 6 sets out. A closure-only report needs no question. Under a no-question mode,
108
+ list any remaining actions instead.
100
109
 
101
110
  ## Default Autopilot Policy
102
111
 
@@ -105,6 +114,7 @@ no-question mode, list them in the report instead.
105
114
 
106
115
  project_memory:
107
116
 
108
- - Triage changes no tracked file; work it finds is a follow-up request.
117
+ - Triage changes no tracked file; only `triage-owned-cleanup` executes its bounded cleanup.
118
+ - Other work it finds is a follow-up request.
109
119
  - A follow-up is recorded, never routed inside the run that found it.
110
120
  - A security report stays private until the fix is ready to disclose.
@@ -32,7 +32,7 @@ mode: evidence-focused
32
32
 
33
33
  ## /qfai-verify — Quality Gates and Evidence
34
34
 
35
- [DRIFT-PROTOCOL:MANDATORY]
35
+ [DRIFT-PROTOCOL:REQUIRED]
36
36
 
37
37
  Run the entry check of
38
38
  `.qfai/assistant/rule/shared-skill-operating-baseline.md#workflow-run-entry-check-mandatory`
@@ -106,10 +106,11 @@ Questions about this skill's own inputs or settings stay in its own output for
106
106
  the user to answer. This skill does not write `open-questions.md`.
107
107
 
108
108
  The completion message lists each decision the agents adopted, with its
109
- reason and any disagreeing position. None of them is put as a question. The
110
- message then ends with a question listing every next action, as
111
- `.agents/rules/user-questions.md` § 6 sets out; under a no-question mode it lists
112
- them in the report instead:
109
+ reason and any disagreeing position. None of them is put as a question. Ask for
110
+ the next action only when proceeding requires the user's answer, as
111
+ `.agents/rules/user-questions.md` § 6 sets out. A completion-only report needs
112
+ no question. Under a no-question mode, list any remaining actions instead.
113
+ The applicable next actions are:
113
114
 
114
115
  - Proceed (recommended): create a PR on your hosting platform, with the
115
116
  verification report as its description.
@@ -1,9 +1,12 @@
1
1
  # Step 0 — Load context
2
2
 
3
+ `<paths.specsDir>` and `<paths.contractsDir>` are the directories `qfai.config.yaml` sets.
4
+
3
5
  1. Read relevant **project policy** (if present):
4
- - `.qfai/spec/01_policy/objective.md`
5
- - `.qfai/spec/01_policy/initiative.md`
6
- - `.qfai/spec/03_contract/tech.md`
6
+ - `<paths.specsDir>/01_policy/objective.md`
7
+ - `<paths.specsDir>/01_policy/initiative.md`
8
+ - `<paths.specsDir>/01_policy/principle.md`
9
+ - `<paths.contractsDir>/tech.md`
7
10
  - `.qfai/assistant/rule/agent-selection.md`. From
8
11
  `.qfai/assistant/rule/agent-selection.md` read the acting role's entry
9
12
  when a role needs one, not the whole file
@@ -14,9 +17,9 @@
14
17
  - `.qfai/assistant/rule/workflow.md` (or equivalent)
15
18
 
16
19
  3. Read existing artifacts for the current work item (if present):
17
- - `.qfai/spec/02_business-flow/`
18
- - `.qfai/spec/03_contract/`
19
- - `.qfai/spec/decisions.md`
20
+ - `<paths.specsDir>/02_business-flow/`
21
+ - `<paths.contractsDir>/`
22
+ - `<paths.specsDir>/decisions.md`
20
23
 
21
24
  Do not use discussion-pack artifacts as verification inputs. Verify reads normalized specs, contracts, tests and code only.
22
25