qfai 1.9.2 → 1.10.1

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 (136) hide show
  1. package/README.md +67 -6
  2. package/assets/init/.qfai/assistant/README.md +27 -0
  3. package/assets/init/.qfai/assistant/agents/acceptance-test-engineer.md +1 -0
  4. package/assets/init/.qfai/assistant/agents/backend-engineer.md +1 -0
  5. package/assets/init/.qfai/assistant/agents/completion-reviewer.md +29 -2
  6. package/assets/init/.qfai/assistant/agents/delivery-planner.md +17 -0
  7. package/assets/init/.qfai/assistant/agents/frontend-engineer.md +1 -0
  8. package/assets/init/.qfai/assistant/agents/implementation-reviewer.md +17 -0
  9. package/assets/init/.qfai/assistant/agents/orchestrator.md +2 -2
  10. package/assets/init/.qfai/assistant/agents/qa-gatekeeper.md +183 -5
  11. package/assets/init/.qfai/assistant/agents/test-design-analyst.md +22 -3
  12. package/assets/init/.qfai/assistant/catalog/cli-ux-guidelines.md +2 -2
  13. package/assets/init/.qfai/assistant/catalog/spec_required_files.json +2 -1
  14. package/assets/init/.qfai/assistant/catalog/test-layers-ci-lanes.md +60 -0
  15. package/assets/init/.qfai/assistant/catalog/test-layers.md +430 -13
  16. package/assets/init/.qfai/assistant/catalog/worklog-entry.schema.md +165 -0
  17. package/assets/init/.qfai/assistant/constitution/communication.md +1 -1
  18. package/assets/init/.qfai/assistant/constitution/constitution.md +1 -1
  19. package/assets/init/.qfai/assistant/constitution/drift-protocol.md +359 -10
  20. package/assets/init/.qfai/assistant/constitution/quality.md +35 -5
  21. package/assets/init/.qfai/assistant/constitution/requirements-decomposition.md +37 -0
  22. package/assets/init/.qfai/assistant/constitution/shared-skill-delegation-baseline.md +419 -8
  23. package/assets/init/.qfai/assistant/constitution/shared-skill-operating-baseline.md +122 -5
  24. package/assets/init/.qfai/assistant/constitution/workflow.md +53 -7
  25. package/assets/init/.qfai/assistant/manifest/agent-catalog.yml +439 -946
  26. package/assets/init/.qfai/assistant/manifest/agent-routing.yml +116 -4
  27. package/assets/init/.qfai/assistant/manifest/review-profiles.yml +9 -0
  28. package/assets/init/.qfai/assistant/process/migrations/v1.4.27-atdd-alignment.md +1 -1
  29. package/assets/init/.qfai/assistant/skills/qfai-atdd/SKILL.md +150 -53
  30. package/assets/init/.qfai/assistant/skills/qfai-atdd/references/credential-reuse.md +146 -0
  31. package/assets/init/.qfai/assistant/skills/qfai-atdd/references/red-provenance.md +456 -0
  32. package/assets/init/.qfai/assistant/skills/qfai-atdd/references/review-fix-rounds.md +128 -0
  33. package/assets/init/.qfai/assistant/skills/qfai-atdd/references/scaffolding.md +29 -0
  34. package/assets/init/.qfai/assistant/skills/qfai-atdd/references/shared-test-artifacts.md +96 -0
  35. package/assets/init/.qfai/assistant/skills/qfai-atdd/references/stale-manifest.md +34 -0
  36. package/assets/init/.qfai/assistant/skills/qfai-atdd/references/test-case-depth-checklist.md +52 -5
  37. package/assets/init/.qfai/assistant/skills/qfai-configure/SKILL.md +16 -8
  38. package/assets/init/.qfai/assistant/skills/qfai-discussion/SKILL.md +8 -4
  39. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/design-md-brand-catalog.md +2 -2
  40. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/discussion-completion-matrix.md +17 -7
  41. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/rcp_footer.md +10 -4
  42. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/review-cycle-playbook.md +5 -1
  43. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/ui-bearing-playbook.md +4 -4
  44. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/ui_ux/review_audit_playbook.md +1 -1
  45. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/ui_ux/trend_scan_playbook.md +1 -1
  46. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/ui_ux_best_practices.md +17 -7
  47. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/01_Context.md +1 -1
  48. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/02_Inception-Deck.md +1 -1
  49. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/03_Story-Workshop.md +11 -3
  50. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/05_Scope.md +5 -2
  51. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/07_NFR.md +1 -1
  52. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/09_Constraints.md +7 -4
  53. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/10_Policy.md +1 -1
  54. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/11_OQ-Register.md +1 -1
  55. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/12_OQ-Resolution-Log.md +1 -1
  56. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/14_Review-Request.md +14 -7
  57. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/99_delta.md +1 -1
  58. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/review/Rxx_reviewer.md +16 -7
  59. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/review/review_request.md +9 -6
  60. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/review/summary.json +2 -0
  61. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/40_screen_contracts.md +3 -2
  62. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/50_review_input_bundle.md +4 -2
  63. package/assets/init/.qfai/assistant/skills/qfai-implement/SKILL.md +252 -130
  64. package/assets/init/.qfai/assistant/skills/qfai-implement/references/change-request-reset.md +93 -0
  65. package/assets/init/.qfai/assistant/skills/qfai-implement/references/checkpoint-verification.md +210 -0
  66. package/assets/init/.qfai/assistant/skills/qfai-implement/references/cross-spec-ownership.md +73 -0
  67. package/assets/init/.qfai/assistant/skills/qfai-implement/references/evidence-revision.md +291 -0
  68. package/assets/init/.qfai/assistant/skills/qfai-implement/references/execution-ledger.md +389 -0
  69. package/assets/init/.qfai/assistant/skills/qfai-implement/references/final-checklist.md +28 -0
  70. package/assets/init/.qfai/assistant/skills/qfai-implement/references/finding-classification.md +49 -0
  71. package/assets/init/.qfai/assistant/skills/qfai-implement/references/ledger-preconditions.md +55 -0
  72. package/assets/init/.qfai/assistant/skills/qfai-implement/references/oracle-strength.md +81 -0
  73. package/assets/init/.qfai/assistant/skills/qfai-implement/references/parallelization-policy.md +235 -0
  74. package/assets/init/.qfai/assistant/skills/qfai-implement/references/red-admissibility.md +91 -0
  75. package/assets/init/.qfai/assistant/skills/qfai-implement/references/red-not-observable.md +112 -0
  76. package/assets/init/.qfai/assistant/skills/qfai-implement/references/relevant-test-suite.md +87 -0
  77. package/assets/init/.qfai/assistant/skills/qfai-implement/references/review-artifact-layout.md +44 -0
  78. package/assets/init/.qfai/assistant/skills/qfai-implement/references/round-evidence.md +118 -0
  79. package/assets/init/.qfai/assistant/skills/qfai-implement/references/selector-granularity.md +24 -0
  80. package/assets/init/.qfai/assistant/skills/qfai-implement/references/upstream-artifact-ordering.md +33 -0
  81. package/assets/init/.qfai/assistant/skills/qfai-implement/references/volume-policy.md +149 -0
  82. package/assets/init/.qfai/assistant/skills/qfai-prototyping/SKILL.md +35 -18
  83. package/assets/init/.qfai/assistant/skills/qfai-prototyping/references/evidence-requirements.md +1 -1
  84. package/assets/init/.qfai/assistant/skills/qfai-prototyping/references/generator-prompt.md +106 -7
  85. package/assets/init/.qfai/assistant/skills/qfai-prototyping/references/handoff.md +40 -11
  86. package/assets/init/.qfai/assistant/skills/qfai-prototyping/references/iteration-loop.md +48 -1
  87. package/assets/init/.qfai/assistant/skills/qfai-prototyping/templates/DESIGN.md.sample +6 -0
  88. package/assets/init/.qfai/assistant/skills/qfai-sdd/SKILL.md +87 -22
  89. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/contract-artifact-rules.md +148 -0
  90. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/rcp_footer.md +10 -4
  91. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/review-cycle-playbook.md +5 -1
  92. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/sdd-execution-playbook.md +4 -2
  93. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/sdd-phase-checklists.md +18 -0
  94. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/sdd-quality-gate.md +44 -3
  95. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/sdd-triage.md +60 -7
  96. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/spec-traceability-rules.md +171 -6
  97. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/change-request.md +125 -0
  98. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/contracts/db-contract.sample.sql +6 -0
  99. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/evidence/sdd-spec.md +92 -0
  100. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/_policies/01_Objective.md +27 -0
  101. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/_policies/02_Initiative.md +30 -0
  102. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/_policies/05_Contracts.md +16 -6
  103. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/_policies/06_Glossary.md +19 -0
  104. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/_policies/07_Constraints.md +25 -0
  105. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/_policies/08_Decisions.md +22 -2
  106. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/_policies/11_Slice-Policy.md +37 -10
  107. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/02_User-stories.md +20 -0
  108. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/03_Acceptance-Criteria.md +19 -0
  109. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/04_Business-Rules.md +32 -3
  110. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/06_Test-Cases.md +56 -0
  111. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/07_Decisions.md +29 -2
  112. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/10_Plan.md +41 -0
  113. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/16_Traceability-ledger.md +58 -0
  114. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/tdd/test-list.md +56 -0
  115. package/assets/init/.qfai/assistant/skills/qfai-verify/SKILL.md +57 -102
  116. package/assets/init/.qfai/assistant/skills/qfai-verify/references/articles.md +24 -0
  117. package/assets/init/.qfai/assistant/skills/qfai-verify/references/context-load.md +22 -0
  118. package/assets/init/.qfai/assistant/skills/qfai-verify/references/verify-output-contract.md +48 -0
  119. package/assets/init/.qfai/assistant/skills/qfai-verify/templates/verify-evidence.md +48 -0
  120. package/assets/init/.qfai/assistant/skills/web-research/SKILL.md +25 -7
  121. package/assets/init/.qfai/waivers.yml +11 -5
  122. package/assets/init/root/.github/workflows/qfai-tests.yml +318 -0
  123. package/assets/init/root/.github/workflows/qfai-validate.yml +327 -24
  124. package/assets/init/root/DESIGN.md +6 -0
  125. package/assets/init/root/qfai.config.yaml +15 -12
  126. package/dist/cli/index.cjs +20646 -13620
  127. package/dist/cli/index.cjs.map +1 -1
  128. package/dist/cli/index.mjs +22101 -15061
  129. package/dist/cli/index.mjs.map +1 -1
  130. package/dist/index.cjs +13954 -8829
  131. package/dist/index.cjs.map +1 -1
  132. package/dist/index.d.cts +423 -14
  133. package/dist/index.d.ts +423 -14
  134. package/dist/index.mjs +9330 -4224
  135. package/dist/index.mjs.map +1 -1
  136. package/package.json +22 -19
@@ -0,0 +1,128 @@
1
+ # A `review-fix` row comes back here for a new RED
2
+
3
+ `/qfai-implement` Phase Red step 3b sends a `review-fix` row back when the
4
+ blocking reviewer's REVISE asks for a change to the acceptance test itself: that
5
+ skill does not author these tests and its `red` phase has no
6
+ `acceptance-test-engineer`. The three branches above define the **first**
7
+ handoff of a `todo` row, so this one needs its own contract.
8
+
9
+ - **Invocation.** Named by `TDD-ID`, with the reviewer's REVISE and its round
10
+ number. The row stays at `review-fix` throughout — this stage writes no
11
+ ledger cell, and `review-fix -> red` is not a transition.
12
+ - **What this stage does.** Correct the test the REVISE names, then **run it and
13
+ let the result choose the path** — the same first-run check branch 1 makes,
14
+ for the same reason.
15
+ - **It fails.** Take that as the fresh RED, exactly as branch 1 does: record
16
+ the pair, the `RED revision` and the `RED test hash`, and get
17
+ `qa-gatekeeper` PASS on that run.
18
+ - **It passes.** Many REVISEs ask for no new behaviour at all — splitting a
19
+ selector, renaming a test, making an expectation explicit — so the corrected
20
+ test passes on the first run and there is no RED to take. Demanding one
21
+ stranded the row at `review-fix`. Record the run and its revision, and
22
+ take the **no-new-behaviour path** of
23
+ `../../qfai-implement/references/round-evidence.md`: no round is opened, and
24
+ the row returns on that basis.
25
+
26
+ **A changed test invalidates the proof — on either branch.** A row whose
27
+ branch was `falsifiability` carries a proof taken against the _old_ test, and
28
+ Phase Green step 2a skips the mutation on a RED-not-observable row as
29
+ already taken, so a fresh RED on the corrected test would go to re-review
30
+ without anyone checking that it still fails when the predicate breaks. Mark
31
+ the recorded proof `stale — test replaced` whenever this stage changed the
32
+ test, whichever branch follows, and `/qfai-implement` re-takes it under the
33
+ corrected selector before the GREEN.
34
+
35
+ **Name the new identity in the handback — on either branch.** A REVISE
36
+ can ask for real behaviour _and_ a split selector at once, so the failing
37
+ branch moves the row too; the rule below is not about whether a RED came
38
+ out of it. Splitting a selector or
39
+ renaming a test changes the row's `Selector` or `Test file`, and this stage
40
+ does not write the ledger — so leaving them is a ledger that cannot run the
41
+ corrected test, and letting `/qfai-implement` update the ledger alone leaves
42
+ the evidence entry's identity copy disagreeing with it, which gate item 10
43
+ fails by construction. Hand back the new values; `/qfai-implement` writes
44
+ them to **both** the ledger and the entry's copy before the re-review, so
45
+ the check compares two updated values rather than one.
46
+
47
+ **Re-address the test.** The REVISE changed the test, so the `RED test hash`
48
+ recorded at handoff still addresses the manifest before the edit, and the
49
+ consumer checks it against the current one before the reviews
50
+ (`../../qfai-implement/SKILL.md`, the field contract) — a mismatch is sent
51
+ back here for a fresh RED, which is this same passing no-round path, for
52
+ ever. Recompute the manifest and the hash over the corrected test and
53
+ **replace** the recorded pair, marked `test-only replacement` with the
54
+ reviewer verdict that asked for it. That is what the consumer accepts in
55
+ place of a fresh RED: the reviewer judged that no new production behaviour
56
+ is owed, so there is no RED to take, and the hash's job — telling "the test
57
+ moved under the RED" from "only production changed" — is discharged by
58
+ naming the verdict that moved it.
59
+
60
+ **The transient revision moves with it.** `RED revision` on an
61
+ `observed-red` row, and `Falsifiability revision` on a `falsifiability` one,
62
+ address the tree the observation was taken against — which included the
63
+ test as it was. `../../qfai-implement/references/evidence-revision.md` makes a later change to the test
64
+ invalidate exactly that evidence, so leaving them alone either stalls the
65
+ repair for ever or pairs an old observation with a new test hash. The revision of the tree that proof ran against is recorded **by the stage
66
+ that runs it**, in a field of its own — `Replacement proof revision` — and
67
+ **not over `RED revision`**. On an `observed-red` row that RED is the
68
+ natural failure taken before the production code existed, and the round
69
+ block still describes it; overwriting its revision with the tree a later
70
+ mutation ran against made the RED subject hash a pair and a revision from
71
+ two different trees as one observation, and the pre-edit RED then stood as
72
+ evidence for the current test. Mark the field `test-only replacement` with
73
+ the verdict that asked for it and hand it over empty; `/qfai-implement`
74
+ writes the value when it re-takes the proof, exactly as step 3c does on a
75
+ first pass — this stage owns no production mutation, so it cannot know it. Recording it here would
76
+ have named the tree **before** the mutation, which is not what the
77
+ gatekeeper judged. That is
78
+ what ties the replacement to the observation a consumer can check: one
79
+ verdict, one re-taken proof, one revision, one manifest.
80
+
81
+ **Re-take the proof as well, on a row that has one.** A new hash over the
82
+ old `Oracle proof` / falsifiability result says only that somebody edited
83
+ the test; it does not say the _edited_ test still fails when the predicate
84
+ `Satisfied-by` names is broken. Clarifying an expectation or splitting a
85
+ selector can weaken an assertion by accident, and the pair would then pass
86
+ the consumer's check with a proof taken against the assertion that is gone.
87
+ So the recorded proof is **stale**, and this stage says so rather than
88
+ re-taking it: the mutation rewrites a production predicate, which is the
89
+ one thing this stage owns no agent for — the paragraph below says exactly
90
+ that about the same operation. Mark the proof `stale — test replaced`
91
+ beside the new manifest and hash, and name it in the handback. Re-running
92
+ the same mutation under the corrected selector, and the GREEN after it,
93
+ happen in `/qfai-implement`'s rework, where the production owners are
94
+ routed and where the fix and the re-review already happen. Production
95
+ behaviour is unchanged — that is what keeps this a no-round path — and this
96
+ is the evidence that the corrected test still discriminates, which no hash
97
+ can carry.
98
+
99
+ **Not falsifiability.** That form needs a production mutation, which this
100
+ stage owns no agent for and cannot hand over either: Phase Red step 3b
101
+ excludes a `review-fix` row by name and step 3c is reachable only from a
102
+ `todo` falsifiability entry, so there is nobody to produce the trio and the
103
+ row would sit at `review-fix` again. A REVISE whose repair genuinely needs
104
+ new production behaviour is not this case — that one's corrected test fails,
105
+ and the branch above applies.
106
+
107
+ - **Where it goes.** A `### Round N` block in
108
+ `.qfai/evidence/atdd-<spec-id>.md`, in the shape
109
+ `../../qfai-implement/references/round-evidence.md` defines. Not a second
110
+ `## Ledger rows advanced` entry: that section is the record of a first
111
+ handoff, and appending to it would read as one.
112
+
113
+ **Which N.** The REVISE closed the round it was given on, so a fresh RED
114
+ opens the **next** one — round `N+1` where `N` is the round the reviewer
115
+ ruled on. Writing it into the reviewer's own round mixed the original
116
+ cycle and the rework into one block, and then no reader could tell which
117
+ RED/GREEN pair the next reviewer audited. The no-round path above opens
118
+ none, so it leaves the numbering where it is. Name the number in the
119
+ handback either way.
120
+
121
+ - **Handing back.** Return to `/qfai-implement` naming the round. The
122
+ production fix and the re-review happen there, and the row leaves
123
+ `review-fix` by that skill's own path. **A proof marked
124
+ `stale — test replaced` is part of that handback**: the mutation is re-run
125
+ under the corrected selector there, before the re-review.
126
+
127
+ A REVISE that does **not** touch the acceptance test never reaches this stage;
128
+ it is production rework and stays where it is.
@@ -0,0 +1,29 @@
1
+ # Scaffolding
2
+
3
+ `npx qfai atdd scaffold --spec <spec-id>` bulk-emits one placeholder test per
4
+ `TC-*` **this skill owns**, each carrying its `QFAI:SPEC-XXXX:TC-YYYY`
5
+ annotation. Skeletons land in `tests/integration/<spec-id>/` — the directory
6
+ `QFAI-ATDD-112` scans — so a filled-in skeleton counts as coverage. It is
7
+ idempotent: existing files are left untouched.
8
+
9
+ ## Which TCs are skipped, and why
10
+
11
+ Skeletons are integration-only, so two groups of TC are skipped, both named on
12
+ stderr.
13
+
14
+ `L1` / `Unit` and `L2` / `Component`: their skeleton would land in
15
+ `tests/integration/**`, the duplication the Coverage obligations section
16
+ forbids, and `QFAI-ATDD-112` would not count it — filling one in discharges
17
+ nothing. Their ledger row under `/qfai-implement` is where they are owed.
18
+
19
+ `L4` / `API` and `L5` / `E2E`: their home is `tests/api/**` / `tests/e2e/**`, so
20
+ an integration skeleton is both uncounted and a forbidden reference
21
+ (`QFAI-ATDD-123`). Author those by hand in their own directory — or re-file the
22
+ obligation as `CON-API-*` / `US-*`, which is what a `TC-*` at L4/L5 usually
23
+ means (`.qfai/assistant/catalog/test-layers.md#annotation-routing`).
24
+
25
+ ## A skeleton is not a discharge
26
+
27
+ A skeleton left in placeholder shape across repeated validate runs escalates
28
+ (`qfai.config.yaml#atdd.scaffoldEscalateCycles`), so scaffolding is a start, not
29
+ a discharge of the obligation.
@@ -0,0 +1,96 @@
1
+ # A shared test artifact outlives the row that recorded it
2
+
3
+ P1c closes one row before the next test is written, so the `RED test manifest`
4
+ of a `done` row addresses a fixture, snapshot or helper that a **later** row may
5
+ still edit. The hash then disagrees with the tree, and a `done` row has no
6
+ re-entry edge of its own — so the spec either accepts stale evidence or cannot
7
+ be closed.
8
+
9
+ **Stabilise first where the row can see it coming.** The artifacts an
10
+ acceptance test owns — fixtures, snapshots, helpers under the test tree — are
11
+ written in P2-P4 with every row's obligation in view, not grown one row at a
12
+ time. Where that holds, no later row edits them and the manifests stay true.
13
+
14
+ **Where a later row does have to edit one, it re-verifies the rows that read
15
+ it — and records that on itself.** The editing row already runs its own
16
+ selector; run the earlier rows' selectors in the same pass and record them in
17
+ **the editing row's** entry, under `Shared-artifact re-verify`: one line per
18
+ earlier row naming **its spec and `TDD-ID` together** (`spec-0002/TDD-0001`) and
19
+ the evidence file that row's anchor points at, then the selector re-run, its
20
+ result, and the artifact's new manifest and hash. A `TDD-ID` is unique within a
21
+ ledger, not across them, and one fixture is read by acceptance tests from
22
+ several specs — named by id alone, a re-verify could clear a hash mismatch on a
23
+ row in the wrong spec, or fail to clear the right one.
24
+
25
+ **When this stage has no row of its own, the record is stage-level.** A fresh
26
+ spec is the ordinary case here and can own no ATDD row at all, while still
27
+ creating and editing the fixtures a completed spec's handed-over rows read. With
28
+ the record tied to an "editing row" there was nowhere to put it: the re-run was
29
+ made and had no home, so the earlier row's `RED test hash` stayed mismatched
30
+ with nothing able to clear it, or the change was accepted unverified. Write the
31
+ same lines under `## Shared-artifact re-verify` in the stage evidence file
32
+ (`.qfai/evidence/coverage-depth-<spec-id>.md`, beside `## Final status`), with
33
+ the same identity — spec and `TDD-ID` together — and the same "a passing re-run
34
+ is not enough on a row that has a proof" rule below. A consumer clearing a
35
+ mismatch reads **both** places: the editing row's entry when one exists, and the
36
+ stage block of any stage that touched the artifact. `/qfai-implement`'s gate
37
+ item 10 does not run on a spec with no rows, so this block is checked where the
38
+ stage's own pack seal is: it is inside the sealed stage evidence, so a record
39
+ added after the fact moves the seal.
40
+
41
+ **A passing re-run is not enough on a row that has a proof.** Weakening an
42
+ assertion helper, a snapshot or an expected-value fixture leaves the earlier
43
+ row's selector passing while making it tautological — and its recorded
44
+ `Oracle proof` was taken against the artifact as it was, so it no longer shows
45
+ what `qa-gatekeeper` requires: that the **current** test fails when the
46
+ predicate the row owns is broken. For each affected row that carries one,
47
+ re-run its original mutation — the one its `Oracle proof` plan or
48
+ `Satisfied-by` names — under the changed artifact, capture the failure, revert,
49
+ and record the restored GREEN, in the same `Shared-artifact re-verify` block.
50
+ A row whose mutation no longer fails the test is the tautology this exists to
51
+ catch, and the editing row does not reach `done` until it is repaired.
52
+
53
+ **This stage owns no production agent, so on a zero-row stage the mutation is
54
+ handed over.** Every phase here authors tests; none edits production code, and
55
+ the rows being re-verified are already `done`, so `/qfai-implement`'s named-row,
56
+ `todo` and `review-fix` entry paths do not reach them either. Left as written,
57
+ the stage had two ways out and both were wrong: edit production in breach of its
58
+ own Non-goals, or leave the shared fixture's mismatch permanently unclearable.
59
+ So define the handoff explicitly, and keep it transient: hand
60
+ `/qfai-implement` a **mutation-only request** naming, per affected row, its
61
+ `spec/TDD-ID`, the mutation its `Oracle proof` plan or `Satisfied-by` names, and
62
+ the selector to run under the changed artifact. That skill applies the mutation,
63
+ captures the failure, **reverts it in the same step** and returns the pair. It
64
+ does **not** reopen the row: the status stays `done`, no round block is opened,
65
+ and nothing is written to that row's evidence — the returned proof is recorded
66
+ here, in this stage's `Shared-artifact re-verify` block, like every other line
67
+ in it. A `done` row has no legal transition that would let it re-observe
68
+ anything, which is exactly why the proof belongs to the stage that moved the
69
+ artifact rather than to the row that owns the test. **A row whose re-run fails is not
70
+ re-verified** — it is a regression the editing row introduced, and the editing
71
+ row does not reach `done` until it is fixed, exactly as any other failure in
72
+ its own checkpoint.
73
+
74
+ **The earlier rows' entries are not touched**, and that is deliberate on two
75
+ counts. There is no legal reopen for them: `done` has one exit, the upstream
76
+ reset, and it requires an approved upstream change — a sibling editing a fixture
77
+ is not one. And their evidence is a record of an observation, not a claim about
78
+ the present: a `RED test hash` addresses the manifest **as it was when that RED
79
+ was taken**, which is the only thing it can honestly say. Appending to them
80
+ would also break the very verdicts that closed them, since the audit hash covers
81
+ the entry.
82
+
83
+ **And the consumer has to accept that pairing.** The completion gate
84
+ recomputes `RED test hash` for every handed-over row from the current manifest,
85
+ so an earlier row whose shared artifact was edited mismatches **by
86
+ construction** — and the mismatch route sends it back here for a fresh RED,
87
+ which a `done` row cannot take. A mismatch is cleared instead by a
88
+ `Shared-artifact re-verify` entry on the editing row that names this `TDD-ID`,
89
+ records the re-run and the re-taken proof, and carries the artifact's new
90
+ manifest and hash: that is the evidence the recomputation was looking for, made
91
+ where a row is still open. Without such an entry the mismatch stands.
92
+
93
+ So the pairing is: the earlier row keeps the observation it made, and the row
94
+ that moved the ground under it carries the proof that the observation still
95
+ holds. The editing row's own reviewers and checkpoint audit that proof, which is
96
+ what makes it evidence rather than an assertion.
@@ -0,0 +1,34 @@
1
+ # A project whose manifest predates this contract
2
+
3
+ `npx qfai init --force` regenerates `assistant/skills/**` and `assistant/agents/**`
4
+ but leaves `assistant/manifest/**` alone: those are the declarative files
5
+ `qfai-configure` owns, and overwriting a project's adjusted agent taxonomy is
6
+ the worse failure. So an existing project can take this skill's update without
7
+ taking the `red` phase the update relies on.
8
+
9
+ **Two files are stale, not one.** `agent-routing.yml` is the obvious one, and
10
+ `agent-catalog.yml` carries each role's `developer_instructions` — the reviewer's
11
+ own contract — which `constitution/agent-selection.md` treats as SSOT alongside
12
+ routing. An old catalog's `qa-gatekeeper` does not know that `Satisfied-by` takes
13
+ a path and symbol, that an ATDD row's evidence lives in `atdd-<spec-id>.md`, that
14
+ a RED-time Oracle proof is a plan, or that an item cycle is exempt from the
15
+ completion inputs — so it REVISEs correct handoffs, and routing it by hand does
16
+ not help.
17
+
18
+ The gate still applies, and the remedy is to bring both files forward:
19
+
20
+ 1. **Diff the two files against the installed package** —
21
+ `node_modules/qfai/assets/init/.qfai/assistant/manifest/agent-catalog.yml` and
22
+ `agent-routing.yml` — and merge the shipped roles' contracts in, keeping the
23
+ project's own routing choices and any roles it added. This is the step that
24
+ actually moves the files. `/qfai-configure` owns these manifests as
25
+ artifacts, which is why `init --force` leaves them alone, but it edits what
26
+ the project has rather than reconciling it against the package: there is no
27
+ migration to invoke, so do not wait for one.
28
+ 2. **Until that merge has run**, route `qa-gatekeeper` for the branch-1 rows by
29
+ hand at P1b **and state in the evidence file that the catalog predates this
30
+ contract**, so a REVISE that cites a rule the current contract does not have
31
+ is read as the stale input it is rather than as a finding about the row.
32
+
33
+ A missing phase is a stale manifest, never the gate not applying — and the same
34
+ is true of the production owners `qfai-implement`'s red phase needs for step 3c.
@@ -3,6 +3,20 @@
3
3
  This checklist ensures test cases cover not only happy paths but also boundary values, error paths, edge cases, and combinatorial scenarios.
4
4
  Reviewers MUST use this checklist when evaluating test case completeness during ATDD and SDD review gates.
5
5
 
6
+ ## Where the matrix lives
7
+
8
+ Re-running `/qfai-atdd` recomputes which cells are `❌`. It does not recompute
9
+ _why_ an uncoverable obligation was accepted, and that judgement is what
10
+ discharges the "no unjustified `❌`" gate — so the matrix is a **governance
11
+ record**, not a regenerable log.
12
+
13
+ Written only into the stage evidence file it would never reach a commit (stage
14
+ evidence is regenerable and uncommitted), and a later reviewer could not tell a
15
+ justified `❌` from an unjustified one. Write the matrix and one justification
16
+ per `❌` to `.qfai/evidence/coverage-depth-<spec-id>.md`, which the managed
17
+ `.gitignore` block negates for exactly this reason. The stage evidence file
18
+ links to it rather than restating it.
19
+
6
20
  ## 1. Equivalence Partitioning (同値分割)
7
21
 
8
22
  For each input parameter or condition:
@@ -56,6 +70,22 @@ When multiple conditions interact:
56
70
  - [ ] Every BR-\* referenced in 04_Business-Rules.md has at least one positive and one negative test case.
57
71
  - [ ] Conditional business rules have test cases for each branch.
58
72
 
73
+ ## 8. Oracle Strength (オラクル強度)
74
+
75
+ The seven sections above count **case categories**. This one asks whether each
76
+ case's assertion can fail. A test that cannot fail satisfies every category.
77
+
78
+ - [ ] No assertion uses truthiness where the boundary's own value is available
79
+ (`toBeTruthy()` on a result whose expected value is in hand).
80
+ - [ ] No assertion compares a stored value against the same helper the fixture
81
+ wrote it with — that holds for every implementation, including a wrong one.
82
+ - [ ] No loop asserts over a collection that is empty by construction.
83
+ - [ ] No assertion observes a field the transport discards or a log the harness
84
+ swallows.
85
+ - [ ] No assertion merely verifies a mock was called with what the test passed it.
86
+ - [ ] Each case has a named production mutation that makes it fail, or a recorded
87
+ `equivalent-mutant` with the weaker contract clause named.
88
+
59
89
  ---
60
90
 
61
91
  ## Coverage Depth Matrix (テンプレート)
@@ -63,18 +93,35 @@ When multiple conditions interact:
63
93
  Reviewers and test-design-analysts MUST produce this matrix for each spec under review.
64
94
  Mark each cell: ✅ covered, ⚠️ partial, ❌ missing.
65
95
 
66
- | US/TC ID | Normal path | Error path | Boundary values | Special values | State transitions | Combinatorial | Status |
67
- | -------- | ----------- | ---------- | --------------- | -------------- | ----------------- | ------------- | ------ |
68
- | US-0001 | ✅/⚠️/❌ | ✅/⚠️/❌ | ✅/⚠️/❌ | ✅/⚠️/❌ | ✅/⚠️/❌ | ✅/⚠️/❌ | — |
69
- | TC-0001 | ✅/⚠️/❌ | ✅/⚠️/❌ | ✅/⚠️/❌ | ✅/⚠️/❌ | ✅/⚠️/❌ | ✅/⚠️/❌ | — |
96
+ **Home: `.qfai/evidence/coverage-depth-<spec-id>.md`.** That path is negated in
97
+ the managed `.gitignore` block, so the matrix and the justifications below it
98
+ are committed. The rest of `.qfai/evidence/**` is not: a matrix written into
99
+ `atdd-<spec-id>.md` is deleted from history by the ignore rule, and with it
100
+ every reason a `❌` was accepted — which is the input the PASS/REVISE criteria
101
+ below read. Write it once, in its own file, and link it from the stage evidence.
102
+
103
+ | US/TC ID | Normal path | Error path | Boundary values | Special values | State transitions | Combinatorial | Oracle strength | Status |
104
+ | -------- | ----------- | ---------- | --------------- | -------------- | ----------------- | ------------- | --------------- | ------ |
105
+ | US-0001 | ✅/⚠️/❌ | ✅/⚠️/❌ | ✅/⚠️/❌ | ✅/⚠️/❌ | ✅/⚠️/❌ | ✅/⚠️/❌ | ✅/⚠️/❌ | — |
106
+ | TC-0001 | ✅/⚠️/❌ | ✅/⚠️/❌ | ✅/⚠️/❌ | ✅/⚠️/❌ | ✅/⚠️/❌ | ✅/⚠️/❌ | ✅/⚠️/❌ | — |
70
107
 
71
108
  ### Evaluation criteria
72
109
 
73
110
  - **PASS**: All cells are ✅ or ⚠️ with documented rationale for partial coverage.
111
+ - **Oracle strength is not waivable by category coverage.** A row whose six
112
+ category cells are ✅ and whose Oracle strength cell is ❌ is a REVISE: it has
113
+ cases in every category and no evidence that any of them can fail.
74
114
  - **REVISE**: Any cell is ❌ without an explicit justification (e.g., Decision Record).
115
+ - **A justification counts only where it survives.** It goes under the matrix in
116
+ `.qfai/evidence/coverage-depth-<spec-id>.md`, naming the cell, why the
117
+ obligation is not coverable at this layer, and the `DR-*` or `CR-*` that
118
+ carries the decision when one exists. A justification recorded anywhere else
119
+ under `.qfai/evidence/**` is ignored by Git and cannot be read at review time.
75
120
 
76
121
  ### Usage
77
122
 
78
123
  - `test-design-analyst`: Produce this matrix when defining coverage obligations. Flag ❌ cells as gaps.
79
- - `qa-gatekeeper`: Verify the matrix exists and no unjustified ❌ cells remain.
124
+ - `qa-gatekeeper`: Verify the matrix exists and no unjustified ❌ cells remain. Read
125
+ `.qfai/evidence/coverage-depth-<spec-id>.md`; a matrix that exists only in an
126
+ uncommitted stage-evidence file is a missing matrix.
80
127
  - `completion-reviewer`: Confirm the matrix was reviewed and any ⚠️ cells have rationale.
@@ -52,7 +52,7 @@ When unsure, read inputs in this order:
52
52
 
53
53
  - P1: `.qfai/assistant/constitution/*`
54
54
  - P2: `.qfai/assistant/manifest/*` + `.qfai/assistant/catalog/*`
55
- - P3: `.qfai/specs/<spec-id>/09_delta.md` (Decision Records; if no spec yet, state "not applicable")
55
+ - P3: `.qfai/specs/<spec-id>/07_Decisions.md` + `.qfai/specs/_policies/08_Decisions.md` (Decision Records, `DR-*`; if no spec yet, state "not applicable")
56
56
  - P4: other artifacts (01_Spec.md, contracts, evidence, optional legacy `scenario.feature` / coverage ledgers)
57
57
 
58
58
  ## Sub-agent Delegation (MANDATORY)
@@ -70,7 +70,7 @@ Follow `.qfai/assistant/constitution/shared-skill-delegation-baseline.md`.
70
70
  ### Delegation Failure (Hard Stop)
71
71
 
72
72
  - No additional overrides.
73
- - Do not simulate roles. If the first required delegation fails, stop the stage and report remediation.
73
+ - Do not simulate roles. Classify the failure per the baseline taxonomy first: `unavailable` stops the stage with a remediation report; `saturated` uses the bounded retry branch and keeps the stage open.
74
74
 
75
75
  ### Work Orders Summary (MANDATORY evidence)
76
76
 
@@ -88,7 +88,7 @@ Use the shared schema.
88
88
  - Follow `.qfai/assistant/constitution/shared-skill-delegation-baseline.md#reviewer-gate-baseline`.
89
89
  - Reviewer checks:
90
90
  - required roles were delegated;
91
- - doctor evidence exists: `qfai doctor --fail-on error` completed without failing checks;
91
+ - doctor evidence exists: `npx qfai doctor --fail-on error` completed without failing checks;
92
92
  - Drift Protocol enforced;
93
93
  - test-layer policy enforced against `.qfai/assistant/catalog/test-layers.md`;
94
94
  - tool-count heuristics are signals, not gates.
@@ -106,7 +106,7 @@ Use the shared template.
106
106
 
107
107
  Use the shared template.
108
108
 
109
- - Required field: `Status (PASS/REVISE)`.
109
+ - Required field: `Status (PASS/REVISE/PENDING)`. `PENDING` marks a gate that could not be run (see the baseline's reviewer-budget branch); it never counts as `PASS`.
110
110
 
111
111
  ## Stage 0 — Steering completion refresh (mandatory)
112
112
 
@@ -120,9 +120,9 @@ Follow `.qfai/assistant/constitution/shared-skill-operating-baseline.md#delta-re
120
120
 
121
121
  ## CRITICAL CONSTRAINTS (Read First)
122
122
 
123
- - Only update `qfai.config.yaml`, `.qfai/assistant/manifest/*` + `.qfai/assistant/catalog/*`, and `.qfai/evidence/configure-<run-id>.md` unless explicitly asked.
123
+ - Only update `qfai.config.yaml`, `.qfai/assistant/manifest/*` + `.qfai/assistant/catalog/*`, `.qfai/assistant/constitution/quality.md` (gate capabilities only — never the surrounding rules), and `.qfai/evidence/configure-<run-id>.md` unless explicitly asked.
124
124
  - You MUST produce the required evidence file: `.qfai/evidence/configure-<run-id>.md`.
125
- - `.qfai/evidence/` is intentionally NOT tracked by Git (it ships with a local `.gitignore`).
125
+ - `.qfai/evidence/` is intentionally NOT tracked by Git. The mechanism is the QFAI-managed block `npx qfai init` writes into the **project root** `.gitignore` (marker `# ── QFAI managed (generated by qfai init) ──`), which carries `.qfai/evidence/*`. A project generated by `npx qfai init` has no per-directory `.qfai/evidence/.gitignore`: nothing under the init asset set ships one, so an operator who needs to change what is tracked edits the root file, not a directory-local one. (qfai's own repository does carry that file, as a working-tree file outside the init assets — which is why the claim above used to read the other way.)
126
126
  - Do NOT commit evidence files; summarize key outcomes in the PR description instead.
127
127
  - You MUST run the mandatory checks listed below and record outcomes.
128
128
  - You MUST stop and escalate if tooling choices or runnable path remain ambiguous.
@@ -144,6 +144,10 @@ Note: /qfai-sdd includes a preflight step that bootstraps missing config/steerin
144
144
 
145
145
  - `qfai.config.yaml` is updated with a **minimal diff** focused on traceability globs.
146
146
  - `validation.traceability.testFileGlobs` reflects the real test layout.
147
+ - `npx qfai init` ships this empty on purpose. Detect the stack before setting it — `pyproject.toml` / `setup.cfg` (Python), `go.mod` (Go), `pom.xml` / `build.gradle` (JVM), `Cargo.toml` (Rust), `package.json` (JS/TS), `Gemfile` (Ruby), `composer.json` (PHP) — and derive globs from the test paths that actually exist, not from the language's convention alone.
148
+ - Cross-check against the test paths the spec ledgers declare (`.qfai/specs/*/tdd/test-list.md`, `06_Test-Cases.md`). Globs that do not cover the declared paths leave the traceability gate reporting success while covering nothing.
149
+ - The evidence file MUST show at least one matched file per declared test layer (unit / integration / api / e2e / component as applicable). A layer with zero matched files is a blocking gap, not a note.
150
+ - `npx qfai validate` emits `QFAI-TRACE-124` while the globs are unset or match zero files; the run is not done until it is gone.
147
151
  - `validation.traceability.testFileExcludeGlobs` is added only when needed.
148
152
  - If strict spec sections are explicitly requested, `validation.require.specSections` is updated with a minimal, evidence-based list.
149
153
  - A validation checklist with evidence (sample matched files) is produced.
@@ -219,7 +223,7 @@ Evidence must include:
219
223
 
220
224
  ## Non-Negotiable Principles (QFAI Articles)
221
225
 
222
- These principles are inspired by "constitution / articles" patterns used by other agent frameworks, but tailored to QFAI.
226
+ These principles are inspired by "constitution / articles" patterns used by other agent frameworks, but adapted to QFAI.
223
227
 
224
228
  1. **SDD First (Specification is the source of truth)**
225
229
  If there is a conflict between code and spec, treat the spec as authoritative and either (a) fix code or (b) raise an explicit Open Question to change the spec.
@@ -304,7 +308,7 @@ Every 5 major actions, pause and restate:
304
308
 
305
309
  ## Constraints
306
310
 
307
- - Only update `qfai.config.yaml`, `.qfai/assistant/manifest/*` + `.qfai/assistant/catalog/*`, and `.qfai/evidence/configure-<run-id>.md` unless explicitly asked.
311
+ - Only update `qfai.config.yaml`, `.qfai/assistant/manifest/*` + `.qfai/assistant/catalog/*`, `.qfai/assistant/constitution/quality.md` (gate capabilities only — never the surrounding rules), and `.qfai/evidence/configure-<run-id>.md` unless explicitly asked.
308
312
  - Do **not** modify tests or source code.
309
313
  - Avoid overly broad globs (e.g., `**/*`).
310
314
  - Exclude generated/output directories (`node_modules`, `.git`, `.qfai`, `dist`, `build`, `coverage`, `.next`, `out`, etc.).
@@ -321,6 +325,10 @@ Every 5 major actions, pause and restate:
321
325
  2. Read **project constitution / instructions** (if present):
322
326
  - `.qfai/assistant/constitution/constitution.md`
323
327
  - `.qfai/assistant/constitution/workflow.md` (or equivalent)
328
+ - `.qfai/assistant/constitution/quality.md` — the gate capability list. This
329
+ skill is its owner: reconcile it against the toolchain detected in step 3,
330
+ and record the discovered commands in `catalog/tech.md`. It had no reader
331
+ and no owner, so a stale statement there survived every configure pass.
324
332
 
325
333
  3. Inspect repo conventions:
326
334
  - package manager (pnpm/npm/yarn), test runner, lint/typecheck scripts, CI definitions
@@ -73,6 +73,10 @@ For UI-bearing targets, follow `references/design-dna-intake.md` while authoring
73
73
 
74
74
  Follow `.qfai/assistant/constitution/shared-skill-operating-baseline.md#gate-failure-autorepair-protocol` for validate, doctor, and quality-gate failures.
75
75
 
76
+ The full completion logic, including the UI-bearing blocking conditions, is in
77
+ `references/discussion-completion-matrix.md`. It must stay consistent with the canonical
78
+ sidecar family declared above and with `templates/uiux/00_index.md#Forbidden Legacy Files`.
79
+
76
80
  Before declaring completion, you MUST:
77
81
 
78
82
  - verify all 15 mandatory output files exist and are populated;
@@ -80,7 +84,7 @@ Before declaring completion, you MUST:
80
84
  - ensure every deferred item has full metadata in `13_Deferred.md`;
81
85
  - ensure `02_Inception-Deck.md` and `03_Story-Workshop.md` include Mermaid diagrams;
82
86
  - ensure the UI-bearing sidecar family is complete and the root `DESIGN.md` draft exists at the consuming-project root and parses as valid front-matter;
83
- - run `qfai validate --profile discussion --fail-on error` and fix discussion-owned findings;
87
+ - run `npx qfai validate --profile discussion --fail-on error` and fix discussion-owned findings;
84
88
  - avoid selecting a single visual winner in discussion artifacts.
85
89
 
86
90
  ### Reviewer Gate (MUST)
@@ -92,7 +96,7 @@ Reviewer checks must confirm:
92
96
  - discussion stayed planner-first and did not choose a single visual winner;
93
97
  - Drift Protocol is enforced; review policy is checked against `.qfai/assistant/catalog/test-layers.md`;
94
98
  - planning and coverage heuristics are signals, not gates;
95
- - review findings end with `Status (PASS/REVISE)` and Reviewer result is explicit as `PASS` or `REVISE`.
99
+ - review findings end with `Status (PASS/REVISE/PENDING)` and Reviewer result is explicit as `PASS` or `REVISE` (`PENDING` marks a gate that could not be run and never counts as `PASS`).
96
100
 
97
101
  ## Sub-agent Delegation (MANDATORY)
98
102
 
@@ -109,11 +113,11 @@ Follow `.qfai/assistant/constitution/shared-skill-delegation-baseline.md`.
109
113
  ### Delegation Failure (Hard Stop)
110
114
 
111
115
  - No additional overrides.
112
- - Do not simulate roles. If the first required delegation fails, stop the stage and report remediation.
116
+ - Do not simulate roles. Classify the failure per the baseline taxonomy first: `unavailable` stops the stage with a remediation report; `saturated` uses the bounded retry branch and keeps the stage open.
113
117
 
114
118
  ## Work Orders Summary
115
119
 
116
- Use the shared schema (per-row `Status (PASS/REVISE)` column, reviewer response `Result: PASS | REVISE`).
120
+ Use the shared schema (per-row `Status (PASS/REVISE/PENDING)` column, reviewer response `Result: PASS | REVISE`).
117
121
 
118
122
  ## Completion Message & Next Actions (MUST)
119
123
 
@@ -83,8 +83,8 @@ Each archetype supplies defaults that the agent maps to the project's design sys
83
83
 
84
84
  Use this catalog during Step 11.3 Phase A:
85
85
 
86
- 1. Score each archetype against the taste-interview results from `uiux/11_design_taste_interview.md`.
86
+ 1. Score each archetype against the brand intent captured in root `DESIGN.md` front-matter (`brand.voice`, `audience.emotion`, `audience.do_not_look_like`).
87
87
  2. Apply the archetype tie-breaker when two archetypes tie: highest visual-theme weight wins, then alphabetical name.
88
- 3. Record the selected archetype in `uiux/12_design_system.md` under `## Visual Theme`.
88
+ 3. Record the selected archetype in root `DESIGN.md` front-matter as `brand.archetype`.
89
89
  4. The selected archetype's `aesthetic_properties` become the defaults for Color Palette, Typography, Spacing, and Animation sections.
90
90
  5. Step 11.3 Phase B then customizes those defaults to project-specific overrides.
@@ -6,17 +6,27 @@ Use this file for the full completion logic behind `/qfai-discussion`.
6
6
 
7
7
  Completion is blocked until all are true:
8
8
 
9
- 1. Strategy selected
10
- 2. Design taste interview completed
11
- 3. 3-layer scoring family completed
12
- 4. Dynamic overrides documented
13
- 5. Option comparison completed
14
- 6. Selected anchor documented
15
- 7. Screen contracts drafted
9
+ 1. Root `DESIGN.md` exists at the consuming-project root and parses as valid front-matter
10
+ (`brand`, `audience`, and the full `visual.*` token tree).
11
+ 2. `# Brand Philosophy` body documents do/don't, brand signals, and exploration references
12
+ framed as **deviate-from** inputs.
13
+ 3. The canonical `uiux/` family is complete: `00_index.md`, `40_screen_contracts.md`,
14
+ `50_review_input_bundle.md`.
15
+ 4. Every screen contract in `40_screen_contracts.md` carries the full template schema.
16
+ 5. Exploration directions are carried unranked — no single visual winner is selected and the
17
+ design system is not finalized here (discussion is planner-first).
18
+ 6. No forbidden legacy sidecar exists under `uiux/` (see
19
+ `templates/uiux/00_index.md#Forbidden Legacy Files`).
20
+ 7. `Disposition: open` count is zero in `11_OQ-Register.md`.
21
+
22
+ Evaluation axes are global constants (4-step ordinal: weak / acceptable / strong /
23
+ exceptional) and are NOT authored as discussion sidecars, so no scoring, override, strategy,
24
+ taste-interview, option-comparison or selected-anchor sidecar is required or permitted.
16
25
 
17
26
  ## Non-UI Packs
18
27
 
19
28
  - No uiux sidecars required
29
+ - No root `DESIGN.md` required
20
30
  - No additional UI-bearing completion conditions apply
21
31
  - `prototyping.yaml` is not required
22
32
 
@@ -21,15 +21,21 @@
21
21
  - 条件付き reviewer:
22
22
  - `architecture-reviewer` — architecture-affecting decision がある場合
23
23
  - `product-surface-reviewer` — UI-bearing の場合
24
- - 各レビューは `PASS` / `FAIL` を返す
25
- - `FAIL` が出たら、失敗 reviewer と修正影響を受ける reviewer のみ再実行する
24
+ - 各レビューは `PASS` / `REVISE` を返す(in-flight のレビュアー応答の語彙。SSOT は
25
+ `.qfai/assistant/constitution/shared-skill-delegation-baseline.md` の `## Reviewer response template`)
26
+ - `REVISE` は review pack の `summary.json` を書き出す際に `status: "FAIL"` へ対応付けられる(同ファイルの
27
+ `### Verdict vocabulary` を参照)。第3の判定値を作らないこと
28
+ - `REVISE` が出たら、失敗 reviewer と修正影響を受ける reviewer のみ再実行する
26
29
 
27
30
  ---
28
31
 
29
32
  ## Validate Hard Gate(必須)
30
33
 
31
- - 各 review cycle で `qfai validate --profile discussion --fail-on error --format github` を実行していること
32
- - `.qfai/report/validate.log` が存在し、最新の成果物に対応していること
34
+ - 各 review cycle で `npx qfai validate --profile discussion --fail-on error --format github` を実行していること
35
+ - `<paths.outDir>/validate.log`(既定 `.qfai/report/validate.log`)が存在し、最新の成果物に対応していること
36
+ - このファイルは `npx qfai validate` が実行のたびに自動で書き出す。`| tee` などのシェルリダイレクトは不要(PowerShell では動作しないため使用しない)
37
+ - `<paths.outDir>` は `qfai.config.yaml` の `paths.outDir`。既定以外に変更したプロジェクトでは `<paths.outDir>/validate.log` と `<paths.outDir>/run-*/` を見ること
38
+ - 最新性は `validate.log` の `run_log:` 行が最新の `run-*/` を指しているかで確認する
33
39
 
34
40
  ---
35
41
 
@@ -13,10 +13,14 @@ Use this file for detailed review-pack handling in `/qfai-discussion`.
13
13
  1. Create a new review pack for each cycle.
14
14
  2. Apply the footer SSOT from `rcp_footer.md`.
15
15
  3. Run only the routed reviewers for the current phase and conditions.
16
- 4. On `FAIL`, rerun only the failed reviewer and any reviewer whose scope changed.
16
+ 4. On `REVISE`, rerun only that reviewer and any reviewer whose scope changed. `REVISE` is the in-flight verdict (`.qfai/assistant/constitution/shared-skill-delegation-baseline.md#reviewer-response-template`); it becomes `status: "FAIL"` only when the pack's `summary.json` is written.
17
17
  5. Mark fixed only when all routed blocking reviewers are `PASS`.
18
18
 
19
19
  ## summary.json
20
20
 
21
21
  - `target.kind` must be `"discussion"`.
22
+ - `revision_form: "content-hash"` and `revision` are written here too — the state these verdicts
23
+ describe, as a git rev or `working-tree+<content hash>`
24
+ (`../../qfai-implement/references/evidence-revision.md`). A pack without them fails the repo-wide
25
+ `/qfai-verify --fail-on error` even where the stage profile passed.
22
26
  - Keep rerun history append-only.
@@ -39,7 +39,7 @@ the screen-level UX inputs:
39
39
 
40
40
  Trend Scan is **not** a sidecar file. Trend Scan lives at
41
41
  `04_Sources.md#Trend Scan` (part of the core 15-file discussion pack).
42
- The legacy `uiux/20_trend_scan.md` template was removed; `uiux/20_design_eval_invariant.md`
43
- is a different axis family (design evaluation invariant criteria) and does
44
- not own Trend Scan content. UI-bearing completion checks read Trend Scan
45
- from `04_Sources.md`.
42
+ The legacy `uiux/20_trend_scan.md` template and the whole `uiux/20-24`
43
+ design-evaluation family were removed; evaluation axes are now global
44
+ constants and are not authored as discussion sidecars. UI-bearing
45
+ completion checks read Trend Scan from `04_Sources.md`.
@@ -97,7 +97,7 @@ A good discussion artifact should make these reviewable without guesswork:
97
97
  ## Recommended Audit Order
98
98
 
99
99
  1. Validate user goal and flow.
100
- 2. Validate option comparison and anchor choice.
100
+ 2. Validate that root `DESIGN.md` is authored and that exploration directions stay unranked (no winner selected here).
101
101
  3. Validate state coverage and contracts.
102
102
  4. Validate accessibility and platform fit.
103
103
  5. Validate anti-pattern absence.