qfai 2.4.0 → 2.5.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 (163) hide show
  1. package/README.md +24 -16
  2. package/assets/defaults/workflows/apply-settled.yml +2 -0
  3. package/assets/defaults/workflows/decide-design.yml +1 -6
  4. package/assets/defaults/workflows/decompose-epic.yml +1 -1
  5. package/assets/init/.claude/settings.json +1 -1
  6. package/assets/init/.qfai/assistant/agent/architecture-reviewer.md +1 -0
  7. package/assets/init/.qfai/assistant/agent/fullstack-engineer.md +6 -9
  8. package/assets/init/.qfai/assistant/agent/implementation-reviewer.md +9 -1
  9. package/assets/init/.qfai/assistant/agent/product-surface-reviewer.md +70 -4
  10. package/assets/init/.qfai/assistant/agent/requirements-reviewer.md +1 -0
  11. package/assets/init/.qfai/assistant/rule/constitution.md +3 -2
  12. package/assets/init/.qfai/assistant/rule/drift-protocol.md +5 -5
  13. package/assets/init/.qfai/assistant/rule/references/deliberation-record-template.md +23 -0
  14. package/assets/init/.qfai/assistant/rule/references/deliberation-record.md +36 -0
  15. package/assets/init/.qfai/assistant/rule/references/griller-recommendations.md +3 -3
  16. package/assets/init/.qfai/assistant/rule/references/launcher-preflight.md +27 -0
  17. package/assets/init/.qfai/assistant/rule/references/reviewer-findings.md +9 -0
  18. package/assets/init/.qfai/assistant/rule/references/reviewer-remit.md +23 -15
  19. package/assets/init/.qfai/assistant/rule/references/visual-reference-survey.md +146 -0
  20. package/assets/init/.qfai/assistant/rule/references/worker-edit-boundary.md +2 -0
  21. package/assets/init/.qfai/assistant/rule/research-first-protocol.md +49 -11
  22. package/assets/init/.qfai/assistant/rule/review-convergence.md +15 -16
  23. package/assets/init/.qfai/assistant/rule/shared-skill-delegation-baseline.md +3 -0
  24. package/assets/init/.qfai/assistant/rule/shared-skill-operating-baseline.md +13 -25
  25. package/assets/init/.qfai/assistant/rule/test-layers.md +8 -0
  26. package/assets/init/.qfai/assistant/rule/thinking.md +10 -5
  27. package/assets/init/.qfai/assistant/rule/ui-definition-protocol.md +4 -4
  28. package/assets/init/.qfai/assistant/rule/ui-procurement.md +50 -10
  29. package/assets/init/.qfai/assistant/rule/workflow.md +4 -3
  30. package/assets/init/.qfai/assistant/skill/qfai-configure/SKILL.md +3 -1
  31. package/assets/init/.qfai/assistant/skill/qfai-discussion/SKILL.md +22 -56
  32. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/design-dna-intake.md +11 -14
  33. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/discussion-coverage-checklist.md +1 -1
  34. package/assets/init/.qfai/assistant/skill/qfai-grilling/SKILL.md +6 -4
  35. package/assets/init/.qfai/assistant/skill/qfai-grilling/references/discussion-delegation.md +46 -0
  36. package/assets/init/.qfai/assistant/skill/qfai-grilling/references/glossary-check.md +23 -0
  37. package/assets/init/.qfai/assistant/skill/qfai-grilling/references/session-check.md +25 -0
  38. package/assets/init/.qfai/assistant/skill/qfai-implement/SKILL.md +12 -1
  39. package/assets/init/.qfai/assistant/skill/qfai-implement/references/parallelization-policy.md +2 -3
  40. package/assets/init/.qfai/assistant/skill/qfai-implement/references/ui-affecting.md +47 -8
  41. package/assets/init/.qfai/assistant/skill/qfai-maintain/SKILL.md +2 -0
  42. package/assets/init/.qfai/assistant/skill/qfai-migration-v1-to-v2/SKILL.md +1 -1
  43. package/assets/init/.qfai/assistant/skill/qfai-prototyping/SKILL.md +6 -2
  44. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/generator-prompt.md +6 -9
  45. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/reviewer-prompt.md +24 -15
  46. package/assets/init/.qfai/assistant/skill/qfai-run/SKILL.md +2 -2
  47. package/assets/init/.qfai/assistant/skill/qfai-run/references/extraction.md +2 -1
  48. package/assets/init/.qfai/assistant/skill/qfai-run/references/operator-screens.md +7 -3
  49. package/assets/init/.qfai/assistant/skill/qfai-run/references/stage-points.md +4 -1
  50. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/business-ui-patterns.md +180 -0
  51. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/contract-artifact-rules.md +14 -3
  52. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/design-anti-patterns.md +14 -3
  53. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/design-md-authoring.md +39 -24
  54. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/design-md-brand-catalog.md +2 -2
  55. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/marketing-ui-patterns.md +194 -0
  56. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/requirements-decomposition.md +27 -3
  57. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-execution-playbook.md +29 -22
  58. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-phase-checklists.md +3 -3
  59. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-pre-draft-grilling.md +4 -4
  60. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-quality-gate.md +1 -1
  61. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-triage.md +4 -2
  62. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/spec-traceability-rules.md +6 -6
  63. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/ui-contract-guide.md +87 -4
  64. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/ui-design-contract-normalization.md +6 -7
  65. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/contracts/api-contract.sample.yaml +3 -0
  66. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/contracts/db-contract.sample.sql +3 -0
  67. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/contracts/ui-contract.sample.yaml +40 -1
  68. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/report/preflight_summary.md +10 -16
  69. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/01_policy/constraint.md +10 -0
  70. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/01_policy/initiative.md +5 -0
  71. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/03_contract/tech.md +1 -0
  72. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/decisions.md +8 -2
  73. package/assets/init/.qfai/assistant/skill/qfai-triage/SKILL.md +4 -0
  74. package/assets/init/.qfai/assistant/skill/qfai-verify/SKILL.md +4 -2
  75. package/assets/init/.qfai/assistant/skill/qfai-verify/references/context-load.md +2 -1
  76. package/assets/init/.qfai/assistant/skill/qfai-verify/references/verify-output-contract.md +4 -1
  77. package/assets/init/.qfai/assistant/step/common-design-md/STEP.md +11 -8
  78. package/assets/init/.qfai/assistant/step/common-gate-run/STEP.md +1 -1
  79. package/assets/init/.qfai/assistant/step/common-grilling-record/STEP.md +25 -60
  80. package/assets/init/.qfai/assistant/step/common-review-cycle/STEP.md +18 -6
  81. package/assets/init/.qfai/assistant/step/discussion-interview/STEP.md +45 -95
  82. package/assets/init/.qfai/assistant/step/discussion-research/STEP.md +11 -13
  83. package/assets/init/.qfai/assistant/step/implement-diagnose/STEP.md +2 -2
  84. package/assets/init/.qfai/assistant/step/implement-scaffold/STEP.md +52 -8
  85. package/assets/init/.qfai/assistant/step/implement-settled-edit/STEP.md +78 -0
  86. package/assets/init/.qfai/assistant/step/implement-sweep/STEP.md +3 -3
  87. package/assets/init/.qfai/assistant/step/implement-tdd/STEP.md +20 -2
  88. package/assets/init/.qfai/assistant/step/prototyping-grill/STEP.md +4 -0
  89. package/assets/init/.qfai/assistant/step/prototyping-handoff/STEP.md +3 -2
  90. package/assets/init/.qfai/assistant/step/prototyping-loop/STEP.md +6 -1
  91. package/assets/init/.qfai/assistant/step/sdd-contract/STEP.md +58 -11
  92. package/assets/init/.qfai/assistant/step/sdd-flow/STEP.md +41 -27
  93. package/assets/init/.qfai/assistant/step/sdd-story/STEP.md +2 -1
  94. package/assets/init/.qfai/assistant/step/sdd-triage/STEP.md +43 -26
  95. package/assets/init/.qfai/assistant/step/triage-answer/STEP.md +8 -3
  96. package/assets/init/.qfai/assistant/step/triage-close/STEP.md +12 -6
  97. package/assets/init/.qfai/assistant/step/triage-decompose/STEP.md +2 -1
  98. package/assets/init/.qfai/assistant/step/triage-operate/STEP.md +36 -6
  99. package/assets/init/.qfai/assistant/step/triage-security-intake/STEP.md +2 -0
  100. package/assets/init/.qfai/assistant/step/verify-commit/STEP.md +3 -1
  101. package/assets/init/.qfai/assistant/step/verify-context/STEP.md +3 -3
  102. package/assets/init/.qfai/assistant/step/verify-release-notes/STEP.md +11 -3
  103. package/assets/init/.qfai/assistant/step/verify-repo-gate/STEP.md +22 -0
  104. package/assets/init/root/.agents/rules/delegation-steering.md +4 -2
  105. package/assets/init/root/.agents/rules/distributed-surface.md +1 -1
  106. package/assets/init/root/.agents/rules/grilling.md +28 -76
  107. package/assets/init/root/.agents/rules/interface-clarity.md +98 -6
  108. package/assets/init/root/.gitattributes +7 -5
  109. package/assets/init/root/.github/workflows/qfai-docs.yml +1 -1
  110. package/assets/init/root/qfai.config.yaml +1 -1
  111. package/assets/mdschema/story/01_policy/constraint.mdschema.yml +46 -2
  112. package/assets/mdschema/story/01_policy/initiative.mdschema.yml +18 -0
  113. package/assets/mdschema/story/03_contract/tech.mdschema.yml +5 -2
  114. package/assets/uix-rev/strategy-review.md +1 -1
  115. package/dist/cli/index.cjs +3787 -7097
  116. package/dist/cli/index.cjs.map +1 -1
  117. package/dist/cli/index.mjs +3647 -6970
  118. package/dist/cli/index.mjs.map +1 -1
  119. package/dist/graph/cli.cjs +966 -222
  120. package/dist/graph/cli.cjs.map +1 -1
  121. package/dist/graph/cli.mjs +942 -198
  122. package/dist/graph/cli.mjs.map +1 -1
  123. package/dist/graph/hook.cjs +999 -88
  124. package/dist/graph/hook.cjs.map +1 -1
  125. package/dist/graph/hook.mjs +996 -85
  126. package/dist/graph/hook.mjs.map +1 -1
  127. package/dist/hook/turn-end.cjs +15 -45
  128. package/dist/hook/turn-end.cjs.map +1 -1
  129. package/dist/hook/turn-end.mjs +15 -45
  130. package/dist/hook/turn-end.mjs.map +1 -1
  131. package/dist/index.cjs +15398 -18327
  132. package/dist/index.cjs.map +1 -1
  133. package/dist/index.d.cts +32 -41
  134. package/dist/index.d.ts +32 -41
  135. package/dist/index.mjs +19276 -22214
  136. package/dist/index.mjs.map +1 -1
  137. package/package.json +2 -2
  138. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/discussion-artifact-rules.md +0 -53
  139. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/discussion-completion-matrix.md +0 -133
  140. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/example-mapping-guide.md +0 -18
  141. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/oq-and-deferred-rules.md +0 -84
  142. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/ui-bearing-playbook.md +0 -95
  143. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/ui_ux/platform_baselines.md +0 -118
  144. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/ui_ux/review_audit_playbook.md +0 -115
  145. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/ui_ux/trend_scan_playbook.md +0 -81
  146. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/ui_ux_best_practices.md +0 -184
  147. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/01_Context.md +0 -143
  148. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/03_Story-Workshop.md +0 -104
  149. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/04_Sources.md +0 -276
  150. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/05_Scope.md +0 -36
  151. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/06_REQ.md +0 -26
  152. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/07_NFR.md +0 -24
  153. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/08_Glossary.md +0 -23
  154. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/09_Constraints.md +0 -60
  155. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/11_OQ-Register.md +0 -38
  156. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/prototyping.yaml +0 -8
  157. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/uiux/00_index.md +0 -35
  158. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/uiux/40_screen_contracts.md +0 -62
  159. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/uiux/50_review_input_bundle.md +0 -38
  160. package/assets/init/.qfai/assistant/step/discussion-oq/STEP.md +0 -70
  161. package/assets/init/.qfai/assistant/step/discussion-pack/STEP.md +0 -199
  162. package/assets/init/.qfai/assistant/step/discussion-uiux/STEP.md +0 -82
  163. package/assets/uix-rev/contracts-review.md +0 -27
@@ -8,28 +8,34 @@ Use this sequence for /qfai-sdd. The shipped templates under ../templates/spec/
8
8
  `.qfai/assistant/rule/shared-skill-operating-baseline.md#canonical-qfai-launcher`.
9
9
  Record its resolved package path and version in the SDD report. Check that
10
10
  the installed Stage 0 instructions support the procedure being used.
11
- 2. Run `npx qfai sdd preflight` and read its `selectedInputPath` and `source`.
12
- Respect an explicitly selected discussion pack, including one older than the
13
- newest pack.
14
- 3. Read the selected pack, completed reviews that target it, explicit user
15
- requirements, and the existing story tree. A pack is reference and provenance
16
- material. Disposition its applicable review advice in the SDD report, a decision
17
- row, or an open question. A pack discrepancy does not itself block SDD. For
18
- the current request, read the existing purpose in
19
- `<paths.specsDir>/01_policy/objective.md` and inspect related flows and stories.
20
- 4. A missing discussion pack does not mean that specifications are missing. If
21
- an existing readable specification is authoritative for this request, run
22
- `npx qfai sdd preflight --import <path>` with that file. The fallback does
23
- not replace a selected pack or bypass unsafe pack names, unreadable files,
24
- invalid active pointers, config errors, or a mismatched tool.
11
+ 2. Name the deliberation record SDD consumes, in this order: the run's own
12
+ record, or the one the work order names; invoked by name with no work order,
13
+ the one the user names. When the user names none, ask which record under
14
+ `paths.deliberationDir` to use before anything is written. Run
15
+ `npx qfai sdd preflight --record <path>` and read its `selectedInputPath` and
16
+ `source`.
17
+ 3. Read every table of the record, completed reviews, explicit user
18
+ requirements, and the existing story tree. The record is history: where it
19
+ disagrees with the story tree, `decisions.md` or `open-questions.md`, they
20
+ win. State a discrepancy in the SDD report or as an open question, and never
21
+ edit the record. A record that leaves a question open or contradicts itself
22
+ does not block SDD. For the current request, read the existing purpose in
23
+ `<paths.specsDir>/01_policy/objective.md` and inspect related flows and
24
+ stories.
25
+ 4. No record does not mean that specifications are missing. If an existing
26
+ readable specification is authoritative for this request, run
27
+ `npx qfai sdd preflight --import <path>` with that file. A named record comes
28
+ first: the import never replaces it, and it does not bypass an unreadable
29
+ file, config errors, or a mismatched tool.
25
30
  5. Use an explicit user requirement as supplied and name it in the SDD report.
26
31
  Do not invent an import file from conversation. Without a file, CLI preflight
27
32
  can remain blocked while SDD assesses that explicit requirement.
28
- 6. Use `/qfai-discussion` only when no usable source exists; stop SDD until one
29
- is available. Stop on an unresolved product decision that cannot safely be
30
- inferred; record the question in `open-questions.md`. Do not manufacture or
31
- regenerate a past discussion pack, or regenerate the existing purpose,
32
- merely to clear preflight.
33
+ 6. Use `/qfai-discussion` only when no usable source exists: no record of the
34
+ run or named for it, no import-lite input and no explicit user requirement.
35
+ Stop SDD until one is available. Stop on an unresolved product decision that
36
+ cannot safely be inferred; record the question in `open-questions.md`. Do
37
+ not write or edit a record, or regenerate the existing purpose, merely to
38
+ clear preflight.
33
39
  7. Import-lite readiness identifies the input source. It does not establish
34
40
  complete requirements or a validation PASS. Keep the existing purpose and
35
41
  current request while updating only affected flow and story content.
@@ -43,13 +49,14 @@ record unresolved questions in open-questions.md. In --auto, ask nothing and sto
43
49
 
44
50
  ## Stage 2: policy and flow
45
51
 
46
- 1. Write affected 01_policy/ files from their paired templates. Each fact has one home among objective.md, initiative.md, principle.md, glossary.md, constraint.md, and tech.md. Policy states criteria; a definition or a business rule belongs to the contract that owns it.
52
+ 1. Write affected 01_policy/ files from their paired templates. Each answer of the record goes to the one file that owns it.
53
+ Each fact has one home among objective.md, initiative.md, principle.md, glossary.md, constraint.md, and tech.md. Policy states criteria; a definition or a business rule belongs to the contract that owns it.
47
54
  A constraint is a limit in plain words; its ID is its place in its section, so removing a row renumbers the rows after it.
48
- A layer boundary is a row of tech.md `## Architecture`, written from the technical decisions the pack records and, in an existing codebase, its module layout and import directions: what each layer does and the layers below it that it may import from.
55
+ A layer boundary is a row of tech.md `## Architecture`, written from the technical decisions the record settles and, in an existing codebase, its module layout and import directions: what each layer does and the layers below it that it may import from.
49
56
  A layer is a group of modules whose dependencies point one way: down. The section draws the layers as one `flowchart TD`, then lists them in the table from the uppermost down, and the two name the same layers and edges.
50
57
  Implementation places new code by that table and reviewers judge a change against it, as the `Architecture` section of the spec traceability rules states.
51
58
  2. Write 02_business-flow/business-flows.md and the affected business-flow-NNNN/business-flow.md files. Each flow's `## Flow` section is exactly one Mermaid flowchart or sequenceDiagram.
52
- 3. Allocate BF and US IDs from the highest existing ID in their scopes, counting retired IDs named in decisions rows and the IDs open pull requests add. Add rows to the flow and story indexes.
59
+ 3. Allocate BF and US IDs from the highest existing ID in their scopes, counting retired IDs named in decisions rows and the IDs open pull requests add, unless the project checks that IDs run without gaps. Add rows to the flow and story indexes.
53
60
 
54
61
  ## Stage 3: concrete stories
55
62
 
@@ -5,12 +5,12 @@ Use these checkpoints with the ordered stages of the SDD steps. A checked item r
5
5
  ## Source and triage
6
6
 
7
7
  - The selected source is the preflight result's selectedInputPath, or an explicit user requirement named in the SDD report.
8
- - The selected discussion pack and applicable completed reviews were read and dispositioned. A disagreement was resolved in an SDD-owned artifact.
8
+ - The deliberation record SDD consumes and applicable completed reviews were read and dispositioned, and the record was left unchanged. A disagreement was resolved in an SDD-owned artifact.
9
9
  - Every requirement has an affected policy, BF, US, EX, or contract path, or an open question that prevents a dependent write.
10
10
  - Only a decision the user made that passes the recording test, approvals included, and a justified `Test exception:` row are decision rows; a rejected option is a `Declined:` row. Open questions are open-questions.md rows.
11
11
  - Both tables have exactly ID, Content, Approach. New rows take timestamp IDs; existing decision rows keep their IDs and are never removed, though their wording may be restated, and a question row was only deleted when a decision or a replacing question names it.
12
12
  - Critical decisions have the user's answer before any dependent write. Under --auto, pending decisions stopped the run without an invented answer.
13
- - New IDs use highest-in-scope plus one, including retired IDs and the IDs open pull requests add.
13
+ - New IDs use highest-in-scope plus one, including retired IDs and the IDs open pull requests add, unless the project checks that IDs run without gaps.
14
14
 
15
15
  ## Policy and business flow
16
16
 
@@ -56,7 +56,7 @@ Follow the cycle the `sdd-cycle` step sets out.
56
56
  - Every affected BF passed npx qfai validate --profile sdd --fail-on error --flow BF-NNNN with error=0.
57
57
  - Every document written passes its document schema. A failure was fixed by reshaping the document, not by adding to it.
58
58
  - The log path and result for each BF are in the SDD report.
59
- - Each entered design-writing stage has a pre-draft grilling checkpoint before its first mutation. A checkpoint that finds no open decision holds no session. The final report lists each decision a checkpoint adopted; unanswered critical decisions remain open and block completion.
59
+ - Each entered design-writing stage has a pre-draft grilling checkpoint before its first mutation. A checkpoint that finds no open decision holds no session. Each decision a checkpoint adopted is an Agent decisions row of the run's deliberation record; unanswered critical decisions remain open and block completion.
60
60
  - Reviewers are independent of the authors, and every finding of the one review is fixed or answered.
61
61
  - Rejected options remain excluded, or a documented reopening decision exists.
62
62
  - Remaining risks and next actions are explicit in the SDD report.
@@ -3,7 +3,7 @@
3
3
  Before an SDD stage makes a design decision, the session agent gathers the stage's open decisions into one frontier.
4
4
  When the frontier holds a design decision the repository cannot settle, the agent settles the frontier in a delegated grilling session under `.qfai/assistant/rule/review-convergence.md#agent-to-agent-grilling`, using the `qfai-grilling` method. It asks the user each critical decision the frontier holds.
5
5
 
6
- When the request, the story tree, the contracts and the recorded decisions already settle every decision of the stage, the frontier is empty. Then no session is held and no griller starts. The stage writes what is settled, and its final report lists no adopted decision for the checkpoint.
6
+ When the request, the story tree, the contracts and the recorded decisions already settle every decision of the stage, the frontier is empty. Then no session is held and no griller starts. The stage writes what is settled, and the run's deliberation record holds no Agent decisions row for the checkpoint.
7
7
 
8
8
  ## Checkpoints
9
9
 
@@ -20,12 +20,12 @@ The checkpoint occurs before this invocation's first design mutation in that sta
20
20
 
21
21
  - The session agent starts the griller.
22
22
  - One frontier holds every decision the stage's drafts need. Keep grilling and the final review apart: the reviewer reviews no decision it recommended.
23
- - Read existing policy, decisions, open questions, discussion provenance, and current contracts before asking. Do not ask the user for facts already recorded there.
23
+ - Read existing policy, decisions, open questions, the deliberation record SDD consumes, and current contracts before asking. Do not ask the user for facts already recorded there.
24
24
  - The session identifies options and failure cases and gives an evidence-based recommendation. A critical product decision goes to the user; an agent's preference cannot supply the user's answer.
25
25
  - Settle a critical question before the affected author writes.
26
- - The stage's final report lists each decision a checkpoint adopted, with its reason. A skipped checkpoint fails the gate; it is not an implicit answer.
26
+ - Each decision a checkpoint adopted is an Agent decisions row of the run's deliberation record, its reason in the row's Background. A skipped checkpoint fails the gate; it is not an implicit answer.
27
27
 
28
- Each decision record is a short decision record in the form stated at the top of
28
+ A decision the user made that passes the recording test is a `decisions.md` row, in the form stated at the top of
29
29
  `.qfai/assistant/skill/qfai-sdd/templates/spec/decisions.md`.
30
30
 
31
31
  Pre-draft grilling settles a premise before drafting. The independent reviewer gate then checks the written artifact, its traceability, and its validation evidence. Both are required.
@@ -39,7 +39,7 @@ Do not use a sibling's in-flight findings to hold or clear the current flow. Rec
39
39
  ## Review and evidence
40
40
 
41
41
  - A pre-draft grilling checkpoint ran before the first write of every design-writing stage entered. It held a grilling session only where it found a decision the repository cannot settle, and each critical decision it held was put to the user.
42
- - The final report lists each decision a checkpoint adopted, with its reason.
42
+ - Each decision a checkpoint adopted is an Agent decisions row of the run's deliberation record, with its reason.
43
43
  - Reviewers are independent of authors, and every finding of the one review is fixed or answered under `.qfai/assistant/rule/review-convergence.md`.
44
44
  - Evidence records the source, changed IDs and files, contract executability, commands, reviewer verdicts, rejected options excluded, and remaining risks.
45
45
  - No critical decision is treated as answered from silence, --auto, or a generic instruction to continue.
@@ -1,6 +1,6 @@
1
1
  # SDD Triage
2
2
 
3
- Triage selects the smallest story-tree change that answers each incoming requirement. The source may be the discussion pack selected by preflight, an imported specification, or the user's explicit requirement. Treat the pack as reference material and resolve a conflict in an SDD-owned artifact.
3
+ Triage selects the smallest story-tree change that answers each incoming requirement. The source may be the deliberation record of the run or the one named for it, an imported specification, or the user's explicit requirement. The record is history: resolve a conflict in an SDD-owned artifact and leave the record unchanged.
4
4
 
5
5
  ## Contents
6
6
 
@@ -155,8 +155,10 @@ Take the number from `npx qfai sdd next-id <kind> [<parent-ID>] --base <local-re
155
155
  It reads the working tree and the base ref's commit, a fetched ref such as `origin/main`, and prints the number after the highest of both, wherever a row sits. It writes nothing and does not see open pull requests.
156
156
  A decisions.md or open-questions.md row takes its timestamp ID from the time it is written instead; no count and no other branch decides it.
157
157
 
158
- Read the IDs open pull requests add before taking a BF, US, AC, EX or BR ID. Fetch the base. Where a forge CLI is available, list the open pull requests once per session through its REST API, for example `gh api repos/{owner}/{repo}/pulls?state=open`, and reuse that listing for every ID the session takes.
158
+ Read the IDs open pull requests add before taking a BF, US, AC, EX or BR ID, unless the project checks that IDs run without gaps (below). Fetch the base. Where a forge CLI is available, list the open pull requests once per session through its REST API, for example `gh api repos/{owner}/{repo}/pulls?state=open`, and reuse that listing for every ID the session takes.
159
159
  Fetch each one's head ref, such as `refs/pull/<n>/head`, so a pull request from a fork is read too, and read the IDs it adds from `git diff <base>...<head>`. Take the highest across the base, the working tree and those heads, plus one. Without a forge CLI, read the base alone.
160
+ Where the project checks that IDs of a kind run without gaps, for example a CI check that fails on a missing number, an ID taken past an open head leaves a gap on the branch until that pull request merges, and that check fails.
161
+ There, skip the open heads and take the number `next-id` prints. It reads only the base and the working tree. Leave a collision with an open head to the renumbering at merge time below.
160
162
  When merging the base into the branch, check each such ID the branch adds against the merged base. The base's item keeps its ID; the branch renumbers its own item and every reference to it, then runs the gates again.
161
163
 
162
164
  ### Register conflicts
@@ -65,12 +65,12 @@ The section holds two things, in this order:
65
65
 
66
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.
67
67
 
68
- | Question | Answer |
69
- | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
70
- | Written from | The technical decisions the discussion pack records and, in an existing codebase, its actual module layout and import directions. `/qfai-configure` fills it from the codebase; `/qfai-sdd` from the pack. |
71
- | Read by | `/qfai-implement`, to place new code and choose its imports; the architecture and implementation reviewers, to judge a change; `/qfai-sdd`, to add a layer when a contract needs one. |
72
- | What it does | Every new module belongs to one layer and imports only from the layers its row lists. A change that crosses a boundary is a review finding. |
73
- | What it may enforce | A project may add an automated check of import directions that reads this table. |
68
+ | Question | Answer |
69
+ | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
70
+ | Written from | The technical decisions the deliberation record settles and, in an existing codebase, its actual module layout and import directions. `/qfai-configure` fills it from the codebase; `/qfai-sdd` from the record. |
71
+ | Read by | `/qfai-implement`, to place new code and choose its imports; the architecture and implementation reviewers, to judge a change; `/qfai-sdd`, to add a layer when a contract needs one. |
72
+ | What it does | Every new module belongs to one layer and imports only from the layers its row lists. A change that crosses a boundary is a review finding. |
73
+ | What it may enforce | A project may add an automated check of import directions that reads this table. |
74
74
 
75
75
  The table holds no rule. A behaviour a layer must show is a BR in the contract that enforces it; the table says only where code lives and what it may depend on.
76
76
 
@@ -5,12 +5,16 @@ The flows a UI contract serves are the flows whose examples its rules cite; the
5
5
 
6
6
  ## Contents
7
7
 
8
+ - The contract is a floor
8
9
  - `screens[].primary_tasks` shape
9
10
  - Recommended ceiling: at most 7
11
+ - Screen purpose and navigation: `purpose` and `navigation`
12
+ - Surface kind: `surface`
10
13
  - `elements[].id` naming policy
11
14
  - `elements[].label` is inspection-target text
12
15
  - `data-qfai` marker convention
13
16
  - Prototype metadata
17
+ - Screen states: `states`
14
18
  - Purposeful copy: `supplements` and `structure`
15
19
  - Screen contract rules
16
20
  - Template
@@ -19,6 +23,25 @@ The flows a UI contract serves are the flows whose examples its rules cite; the
19
23
  - Root DESIGN.md
20
24
  - Review checklist
21
25
 
26
+ ## The contract is a floor
27
+
28
+ A UI contract lists what must be verifiable on a screen: its tasks, the
29
+ elements and actions tests reach, and the copy that needs a reason. It is the
30
+ minimum, not the inventory of the screen.
31
+
32
+ The built screen also carries the parts that
33
+ `.agents/rules/interface-clarity.md` lists under "What a business screen
34
+ always has": the app shell and its navigation, list search, sort and
35
+ pagination where a list can outgrow one screen, feedback after every change,
36
+ and the loading, empty, error and success states. The contract need not repeat
37
+ these parts, and their absence from the contract is no reason to leave them
38
+ out of the screen. Leaving one out needs a reason recorded in the screen's UI
39
+ contract, as that rule says.
40
+
41
+ That list is for application screens. A marketing screen, declared with
42
+ `surface: marketing`, carries the parts of its section entries in the marketing
43
+ pattern reference instead.
44
+
22
45
  ## `screens[].primary_tasks` shape
23
46
 
24
47
  Each entry in `screens[]` must carry a `primary_tasks:` slot. Each
@@ -70,6 +93,41 @@ this ceiling exists to protect, so it passes silently like any other.
70
93
  The ceiling of 7 reflects multi-screen SaaS and dashboard workloads,
71
94
  where 5 or 6 primary tasks per surface is common.
72
95
 
96
+ ## Screen purpose and navigation: `purpose` and `navigation`
97
+
98
+ Every screen states why it exists and where it sits in the app, so it is built
99
+ inside the app rather than as a standalone page reached through a list of
100
+ links.
101
+
102
+ | Key | Holds |
103
+ | ------------------------- | -------------------------------------------------------------- |
104
+ | `purpose` | why the screen exists, in one sentence |
105
+ | `navigation.shell` | the app frame the screen renders inside, such as the app shell |
106
+ | `navigation.entry_points` | the screens, menus or actions that lead to it, at least one |
107
+ | `navigation.back_to` | the route the user returns to from it |
108
+
109
+ A screen with no frame, such as a sign-in page, says so in `shell`. A top-level
110
+ screen with nowhere to return to says so in `back_to`. `npx qfai validate` does
111
+ not check these keys; they describe the screen for the implementer and the
112
+ reviewer.
113
+
114
+ ## Surface kind: `surface`
115
+
116
+ A screen states which surface it belongs to, because the two are built and
117
+ reviewed against different patterns.
118
+
119
+ | Value | The screen |
120
+ | ------------- | -------------------------------------------------------------------------------------------- |
121
+ | `application` | is used by a member after signing in; the default when the key is left out |
122
+ | `marketing` | is seen by a visitor before signing in and exists to explain, persuade or inform the visitor |
123
+
124
+ Marketing screens are the home page, audience pages, how it works, pricing, a
125
+ guide, an about page with a contact form, and legal notices. An application
126
+ screen is checked against the business-screen list and its business type; a
127
+ marketing screen against its section entries in the marketing pattern
128
+ reference. `npx qfai validate` reports any other value as `QFAI-CONTRACT-051`,
129
+ at error.
130
+
73
131
  ## `elements[].id` naming policy
74
132
 
75
133
  IDs are referenced by flows, stories, evidence and tests, so they have to survive a copy
@@ -144,6 +202,26 @@ evidence records nothing against it — an entry is a note between the contract'
144
202
  author and whoever reviews the prototype. Follow the shape
145
203
  `templates/contracts/ui-contract.sample.yaml` shows.
146
204
 
205
+ ## Screen states: `states`
206
+
207
+ Every screen lists `states`, one entry for each of `default`, `empty`,
208
+ `loading`, `error` and `success`, in that order, so an implementer builds each
209
+ state rather than assuming it. The rule behind `next` is
210
+ `.agents/rules/interface-clarity.md`: an empty state says what to do next. Each entry uses these keys:
211
+
212
+ | Key | Holds |
213
+ | --------- | ----------------------------------------------------------------------- |
214
+ | `id` | the state: `default`, `empty`, `loading`, `error` or `success` |
215
+ | `renders` | what the screen shows in that state |
216
+ | `next` | the action the user takes next from that state |
217
+ | `none` | instead of `renders` and `next`: why the screen cannot be in that state |
218
+
219
+ A state is never left out: one the screen cannot reach, such as `empty` on a
220
+ form that starts blank, carries `none` with the reason. "The design system
221
+ default" is not a `renders`; name what the user sees. A supplement's `when`
222
+ names one of these states. `npx qfai validate` does not check this key; it
223
+ describes the screen for the implementer and the reviewer.
224
+
147
225
  ## Purposeful copy: `supplements` and `structure`
148
226
 
149
227
  Two optional keys, beside `primary_tasks`, `elements` and `actions`, describe the
@@ -163,7 +241,7 @@ that cannot be undone. Each entry uses these keys:
163
241
  | ------ | ----------------------------------------------------------------------------------------- |
164
242
  | `id` | stable key, unique in the screen |
165
243
  | `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` |
244
+ | `when` | the `states` id it shows in: `default`, `empty`, `loading`, `error` or `success` |
167
245
  | `text` | the words as displayed |
168
246
  | `why` | what the user could not know or do without it, and why a label or structure is not enough |
169
247
 
@@ -209,6 +287,8 @@ Subtraction removes text that adds no meaning. It never removes:
209
287
  action that is not visible otherwise (a demo-data notice that is true and
210
288
  shown where the user decides is one of these);
211
289
  - error recovery, and the consequence of an action that cannot be undone;
290
+ - the next step an empty state offers: the action, or a short sentence naming
291
+ it, that leads out of it;
212
292
  - labels, accessible names, roles and states.
213
293
 
214
294
  Moving such text into a tooltip or a placeholder does not keep it. A word or
@@ -258,8 +338,8 @@ Render the element with that marker, or remove the marker from the contract.
258
338
  **A label does not match.** Update the contract label, then the rendered text or
259
339
  marker mapping. Updating one side leaves the two out of step.
260
340
 
261
- **The discussion pack already has screen contracts, so this looks redundant.**
262
- It is not. A discussion pack is discovery output and is non-normative; the
341
+ **The deliberation record already settles the screens, so this looks redundant.**
342
+ It is not. A record is history and is non-normative; the
263
343
  downstream skills and every validate lane read `<paths.contractsDir>/ui/*.yaml`.
264
344
  `/qfai-sdd` is what keeps the two in step.
265
345
 
@@ -269,7 +349,7 @@ downstream skills and every validate lane read `<paths.contractsDir>/ui/*.yaml`.
269
349
 
270
350
  The review of a screen is scoped beneath `.qfai/prototype/iter-NN/UI-NNNN/<screen>.review.json`.
271
351
 
272
- A malformed UI contract or an empty screen list is an authoring failure. Fix the declared contract and its index row, then refresh the affected flow's SDD validation and downstream evidence. Discussion UI/UX sidecars are source material; the contract is the execution authority.
352
+ A malformed UI contract or an empty screen list is an authoring failure. Fix the declared contract and its index row, then refresh the affected flow's SDD validation and downstream evidence. Where a run's deliberation record discusses the screens, it is history; the UI contract is the execution authority.
273
353
 
274
354
  ## Root DESIGN.md
275
355
 
@@ -278,7 +358,10 @@ For a UI-bearing visual flow, the root `DESIGN.md` is authored and validated by
278
358
  ## Review checklist
279
359
 
280
360
  - [ ] Every UI-bearing contract has one full declared ID, at least one screen, and a matching `contracts.md` row.
361
+ - [ ] Every screen states its `purpose` and its `navigation`: shell, entry points and where back leads.
362
+ - [ ] Every screen a visitor sees before signing in declares `surface: marketing`; every other screen leaves the key out or writes `application`.
281
363
  - [ ] Screen IDs, routes, primary tasks, labels, markers, and actions are stable and testable.
282
364
  - [ ] Every declared action has an observable effect, including relevant failure states.
365
+ - [ ] Every screen lists all five `states`, each with what renders and the next action, or `none` with a reason.
283
366
  - [ ] No supplement restates a label, heading or action the screen already shows, and none is development commentary.
284
367
  - [ ] Prototyping coverage uses full contract IDs and the current cycle-0 fields.
@@ -1,6 +1,7 @@
1
1
  # UI Design Contract Normalization
2
2
 
3
- `/qfai-sdd` reads discussion-pack UI/UX sidecars to author contracts.
3
+ `/qfai-sdd` reads the screens and their behaviour obligations from the
4
+ deliberation record it consumes and writes them into the UI contracts.
4
5
  Downstream skills read the story tree, contracts, and evidence.
5
6
 
6
7
  ## DESIGN.md SSOT
@@ -15,11 +16,10 @@ A cli-only target has no root `DESIGN.md`; it still normalizes
15
16
  `/qfai-prototyping` records its handoff in
16
17
  `.qfai/prototype/final/handoff.json`. SDD does not author it.
17
18
 
18
- ## Sidecar mapping
19
+ ## Record mapping
19
20
 
20
- The remaining UI-bearing sidecar maps to its contract as follows:
21
-
22
- - `40_screen_contracts.md` → `<paths.contractsDir>/ui/*.yaml`
21
+ Each screen the record settles, with its behaviour obligations, maps to
22
+ `<paths.contractsDir>/ui/*.yaml`.
23
23
 
24
24
  Project-specific anti-pattern notes live in `audience.do_not_look_like`
25
25
  of `DESIGN.md`. Evaluator axes are fixed by the review validation the
@@ -27,8 +27,7 @@ QFAI CLI applies.
27
27
 
28
28
  ## Normalization Rules
29
29
 
30
- - Preserve source IDs where available.
31
- - Normalize the sidecar's notes on displayed text into the screen's optional
30
+ - Normalize the record's notes on displayed text into the screen's optional
32
31
  `supplements` and `structure`, as the UI contract guide shapes them. Notes for the author or
33
32
  the reviewer are not displayed text and are not copied into either key.
34
33
  - Convert prose into machine-readable arrays or objects.
@@ -1,6 +1,9 @@
1
1
  # QFAI-CONTRACT-ID: API-0001
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
+ # API, DB and UI share one number sequence: take one more than the highest
5
+ # number of any kind in contracts.md and the contract file names, not of this
6
+ # kind alone.
4
7
  x-qfai-depends-on: []
5
8
  x-qfai-rules:
6
9
  - id: BR-0001-NNNN
@@ -1,6 +1,9 @@
1
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
+ -- API, DB and UI share one number sequence: take one more than the highest
5
+ -- number of any kind in contracts.md and the contract file names, not of this
6
+ -- kind alone.
4
7
  -- Purpose: Sample order draft persistence contract
5
8
  -- Depends on: -
6
9
  -- Rule BR-0006-0001: An order draft stores a nonempty customer ID.
@@ -1,6 +1,9 @@
1
1
  # QFAI-CONTRACT-ID: UI-0003
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
+ # API, DB and UI share one number sequence: take one more than the highest
5
+ # number of any kind in contracts.md and the contract file names, not of this
6
+ # kind alone.
4
7
  x-qfai-depends-on: []
5
8
  x-qfai-rules:
6
9
  - id: BR-0003-NNNN
@@ -23,6 +26,23 @@ screens:
23
26
  # under `structure`.
24
27
  title: Create Order
25
28
  route: /orders/new
29
+ # purpose: why the screen exists, in one sentence the user would agree with.
30
+ # navigation: where the screen sits in the app. `shell` names the app frame
31
+ # it renders inside, `entry_points` the screens or menus that lead to it,
32
+ # and `back_to` the route the user returns to. These keys describe the
33
+ # screen; validate does not check them.
34
+ # surface: `application` for a screen a member uses after signing in (the
35
+ # default when the key is left out), `marketing` for a page a visitor sees
36
+ # before signing in that explains, persuades or informs. Any other value is
37
+ # QFAI-CONTRACT-051.
38
+ surface: application
39
+ purpose: Record a customer's order so it can be fulfilled or finished later.
40
+ navigation:
41
+ shell: main app shell with the role's navigation
42
+ entry_points:
43
+ - New order button on /orders
44
+ - Orders item in the main navigation
45
+ back_to: /orders
26
46
  # primary_tasks: at least one entry required per screen (QFAI-AUD-001).
27
47
  # Recommended ceiling: at most 7 entries per screen (QFAI-AUD-020).
28
48
  # More than 7 warns at validate time. The required minimum is one: a screen
@@ -69,6 +89,25 @@ screens:
69
89
  label: Discard draft
70
90
  kind: navigate
71
91
  effect: navigates to /orders without storing the order
92
+ # states: what the screen renders in each of the five states, and the
93
+ # user's next action there. Every state is listed: one the screen cannot be
94
+ # in carries `none` with the reason instead of `renders` and `next`. This
95
+ # key describes the screen; validate does not check it.
96
+ states:
97
+ - id: default
98
+ renders: the empty form with Submit order disabled until both fields hold a value
99
+ next: fill in the customer and the item, then submit or save a draft
100
+ - id: empty
101
+ none: the form starts empty by design; there is no list on this screen to be empty
102
+ - id: loading
103
+ renders: the submit and save actions show progress and are disabled; the entries stay visible
104
+ next: wait; nothing on the form can be changed until the request returns
105
+ - id: error
106
+ renders: each rejected field shows its validation message, and a failed save shows sp_draft_not_saved
107
+ next: correct the field or retry the save; nothing entered is lost
108
+ - id: success
109
+ renders: a submit navigates to /orders with the created row; a saved draft shows sp_draft_saved
110
+ next: continue on /orders, or keep editing the draft
72
111
  # structure (optional): the groups the screen is read in, in reading order.
73
112
  # `tasks` are primary_tasks ids, `members` are elements/actions ids, and
74
113
  # `heading` is the displayed heading of the group; leave it out for a group
@@ -91,7 +130,7 @@ screens:
91
130
  # `validations`. This key describes the copy; validate does not check it.
92
131
  # Validate checks the UI source instead: every plain text there carries a
93
132
  # `qfai-text` reason comment. `near` is an elements/actions/structure id, `when` is one of
94
- # default, empty, loading, error, success, and `why` says what the user
133
+ # the `states` ids (default, empty, loading, error, success), and `why` says what the user
95
134
  # could not know or do without the text, and why a label or the structure
96
135
  # cannot carry it.
97
136
  #
@@ -3,35 +3,29 @@
3
3
  Output shape of `npx qfai sdd preflight` (Stage 0 of `/qfai-sdd`). The command
4
4
  writes this file; re-run it instead of filling the form in by hand. `blocked`
5
5
  runs emit Status / Blockers / Open Questions / Next Commands, `ready` runs emit
6
- Status / Requirement Intake / Pack Gaps / Open Questions. Only a missing or
7
- misnamed pack blocks: what a present pack lacks or contradicts is listed under
8
- Pack Gaps, to be recorded in the SDD-owned delta or evidence, and the run
9
- continues. Carry-over entries come from `--assume <text>` and are preserved
10
- across re-runs, so findings the command does not compute can still live here.
6
+ Status / Open Questions. The source is the deliberation record `--record`
7
+ names, else the imported specification `--import` names. Only a missing or
8
+ unreadable source blocks: a record that leaves a question open or contradicts
9
+ itself is still read, and SDD states each gap in its report. Carry-over entries
10
+ come from `--assume <text>` and are preserved across re-runs, so findings the
11
+ command does not compute can still live here.
11
12
 
12
13
  ## Status
13
14
 
14
15
  - status: <ready | blocked>
15
16
  - run id: run-<timestamp>
16
- - source: <discussion-pack | import-lite>
17
- - selected <discussion-pack | import-lite>: <path | (not found)>
17
+ - source: <ready only: deliberation-record | import-lite>
18
+ - selected <deliberation-record | import-lite>: <ready only: path>
19
+ - selected input: <blocked only: (none)>
18
20
 
19
21
  ## Blockers
20
22
 
21
23
  - <blocked only: blocker item>
22
24
 
23
- ## Requirement Intake
24
-
25
- - Imported REQ count: <ready only: number>
26
-
27
- ## Pack Gaps
28
-
29
- - <ready only: what the selected pack lacks or contradicts | none>
30
-
31
25
  ## Open Questions (Carry-over)
32
26
 
33
27
  - <carried-over assumption | none>
34
28
 
35
29
  ## Next Commands
36
30
 
37
- - /qfai-discussion
31
+ - <blocked only: `qfai sdd preflight --record <path>` when records exist, `qfai sdd preflight --import <path>` for an unreadable import, /qfai-discussion otherwise>
@@ -14,3 +14,13 @@
14
14
 
15
15
  | ID | Constraint | Rationale |
16
16
  | --- | ---------- | --------- |
17
+
18
+ ## Quality targets
19
+
20
+ | ID | Constraint | Rationale |
21
+ | --- | ---------- | --------- |
22
+
23
+ ## Legal and Compliance Constraints
24
+
25
+ | ID | Constraint | Rationale |
26
+ | --- | ---------- | --------- |
@@ -16,3 +16,8 @@
16
16
 
17
17
  | Milestone | Description |
18
18
  | --------- | ----------- |
19
+
20
+ ## Risks
21
+
22
+ | Risk | Mitigation |
23
+ | ---- | ---------- |
@@ -6,6 +6,7 @@
6
6
  | ------------------- | ------------------------------------------ |
7
7
  | Runtime | `<language runtime and supported version>` |
8
8
  | Platform | `<supported operating systems>` |
9
+ | Surface | `<surfaces the product targets>` |
9
10
  | CI | `<CI service>` |
10
11
  | Language | `<language and version>` |
11
12
  | Package manager | `<package manager and version>` |
@@ -6,8 +6,9 @@ decisions only; a question not yet decided goes to open-questions.md.
6
6
 
7
7
  A decision, an approval of a critical decision or a release included, becomes
8
8
  a row only when it is hard to reverse, would surprise a reader without
9
- context, and was the result of a real trade-off. The stage report states
10
- every other decision.
9
+ context, and was the result of a real trade-off. Every other decision a stage
10
+ records is a row of the run's deliberation record: an answer the user gave is
11
+ an Interview row, and a decision an agent took is an Agent decisions row.
11
12
 
12
13
  A new row's ID is DEC-yyyymmddhhMMss: the UTC time the row is written, as 14
13
14
  digits. When a row of this register already holds that second, take the next
@@ -46,6 +47,11 @@ after any opening citation above:
46
47
  - `Consequences:` what the decision makes easier or harder.
47
48
  - `Rollback:` the steps that undo it, when they are not obvious.
48
49
 
50
+ When the question showed the chosen option's label in a language other than
51
+ the one this file is written in, quote a rendering of the label in this
52
+ file's language followed by `(translated)`, as in
53
+ `option "Remove it" (translated)`.
54
+
49
55
  Content and Approach together stay within 600 characters; validation warns
50
56
  on a longer row. Write a `|` inside a cell as `\|`.
51
57
 
@@ -39,11 +39,15 @@ person's reported result.
39
39
  - The request, as it was reported, and any item it names.
40
40
  - The project's documents, code and history, read only.
41
41
  - `.qfai/assistant/rule/*`.
42
+ - Before an agent decision, search the records for a turned-down option, as
43
+ `.qfai/assistant/rule/references/deliberation-record.md` says.
42
44
 
43
45
  Every step follows `.qfai/assistant/rule/shared-skill-operating-baseline.md`
44
46
  and `.qfai/assistant/rule/shared-skill-delegation-baseline.md`. Questions to
45
47
  the user follow
46
48
  `.qfai/assistant/rule/shared-skill-operating-baseline.md#user-questions-askuserquestion-protocol`.
49
+ A step whose `What it writes` says "No file git tracks" still writes the run's
50
+ deliberation record when it asks the user a question or takes an agent decision.
47
51
 
48
52
  ## Steps
49
53
 
@@ -33,6 +33,7 @@ first.
33
33
  - The scope: `full` by default, or `prototyping` for the prototyping profile
34
34
  alone. `verify-context` fixes it.
35
35
  - The change, and the story tree, contracts, tests and evidence it touches.
36
+ - No deliberation record: this stage opens no file under `paths.deliberationDir`.
36
37
 
37
38
  The run is reported in the stage report, and its verdict is
38
39
  `.qfai/report/verify.json`.
@@ -94,8 +95,9 @@ the owner phase (`/qfai-sdd`) as an advisory / proposed specification change per
94
95
  Questions about this skill's own inputs or settings stay in its own output for
95
96
  the user to answer. This skill does not write `open-questions.md`.
96
97
 
97
- The completion message lists each decision the agents adopted, with its
98
- reason and any disagreeing position. None of them is put as a question. Ask for
98
+ Each decision the agents adopted is an Agent decisions row of the run's
99
+ deliberation record, with its reason and any disagreeing position. The
100
+ completion message does not list them. None of them is put as a question. Ask for
99
101
  the next action only when proceeding requires the user's answer, as
100
102
  `.agents/rules/user-questions.md` § 6 sets out. A completion-only report needs
101
103
  no question. Under a no-question mode, list any remaining actions instead.