qfai 1.7.13 → 1.7.15

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 (74) hide show
  1. package/README.md +35 -8
  2. package/assets/init/.qfai/assistant/agents/frontend-engineer.md +2 -2
  3. package/assets/init/.qfai/assistant/agents/product-experience-architect.md +2 -2
  4. package/assets/init/.qfai/assistant/agents/product-surface-reviewer.md +1 -1
  5. package/assets/init/.qfai/assistant/instructions/agent-selection.md +2 -0
  6. package/assets/init/.qfai/assistant/instructions/shared-skill-delegation-baseline.md +88 -0
  7. package/assets/init/.qfai/assistant/instructions/shared-skill-operating-baseline.md +49 -0
  8. package/assets/init/.qfai/assistant/skills/qfai-atdd/SKILL.md +28 -88
  9. package/assets/init/.qfai/assistant/skills/qfai-configure/SKILL.md +50 -114
  10. package/assets/init/.qfai/assistant/skills/qfai-discussion/SKILL.md +137 -208
  11. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/design-md-brand-catalog.md +90 -0
  12. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/discussion-completion-matrix.md +26 -0
  13. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/discussion-coverage-checklist.md +20 -0
  14. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/example-mapping-guide.md +18 -0
  15. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/oq-and-deferred-rules.md +41 -0
  16. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/review-cycle-playbook.md +22 -0
  17. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/ui-bearing-playbook.md +50 -0
  18. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/ui_ux/platform_baselines.md +107 -0
  19. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/ui_ux/review_audit_playbook.md +104 -0
  20. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/ui_ux/trend_scan_playbook.md +76 -0
  21. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/ui_ux_best_practices.md +143 -1005
  22. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/01_Context.md +9 -0
  23. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/03_Story-Workshop.md +1 -1
  24. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/04_Sources.md +83 -32
  25. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/14_Review-Request.md +7 -7
  26. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/prototyping.yaml +12 -4
  27. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/review/Rxx_reviewer.md +2 -2
  28. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/review/review_request.md +2 -2
  29. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/10_implementation_strategy.md +31 -13
  30. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/12_design_system.md +115 -0
  31. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/21_design_eval_trend_derived.md +86 -24
  32. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/23_design_eval_aggregate.md +12 -0
  33. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/40_screen_contracts.md +1 -1
  34. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/50_review_input_bundle.md +2 -0
  35. package/assets/init/.qfai/assistant/skills/qfai-implement/SKILL.md +27 -27
  36. package/assets/init/.qfai/assistant/skills/qfai-prototyping/SKILL.md +145 -155
  37. package/assets/init/.qfai/assistant/skills/qfai-sdd/SKILL.md +118 -355
  38. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/review-cycle-playbook.md +30 -0
  39. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/sdd-execution-playbook.md +29 -0
  40. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/sdd-phase-checklists.md +37 -0
  41. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/sdd-quality-gate.md +32 -0
  42. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/spec-traceability-rules.md +33 -0
  43. package/assets/init/.qfai/assistant/skills/qfai-verify/SKILL.md +50 -115
  44. package/assets/init/.qfai/assistant/steering/agent-catalog.yml +1 -1
  45. package/assets/init/.qfai/assistant/steering/agent-routing.yml +20 -8
  46. package/assets/init/.qfai/assistant/steering/manifest.md +4 -7
  47. package/assets/init/.qfai/assistant/steering/product.md +6 -6
  48. package/assets/init/.qfai/assistant/steering/review-profiles.yml +3 -0
  49. package/assets/init/.qfai/assistant/steering/ui-definition-protocol.md +7 -7
  50. package/assets/init/.qfai/contracts/README.md +15 -8
  51. package/assets/init/.qfai/contracts/ui/README.md +24 -26
  52. package/assets/init/.qfai/discussion/README.md +35 -32
  53. package/assets/init/.qfai/evidence/README.md +65 -181
  54. package/assets/init/.qfai/evidence/calibration.yaml +26 -0
  55. package/assets/init/.qfai/review/README.md +56 -11
  56. package/assets/init/.qfai/specs/README.md +2 -2
  57. package/assets/init/root/qfai.config.yaml +5 -6
  58. package/assets/scripts/capture-screenshots.js +128 -0
  59. package/assets/uix-rev/comparison-review.md +3 -15
  60. package/assets/uix-rev/contracts-review.md +5 -2
  61. package/assets/uix-rev/scoring-review.md +10 -2
  62. package/assets/uix-rev/strategy-review.md +11 -7
  63. package/dist/cli/index.cjs +8532 -4204
  64. package/dist/cli/index.cjs.map +1 -1
  65. package/dist/cli/index.mjs +8599 -4271
  66. package/dist/cli/index.mjs.map +1 -1
  67. package/dist/index.cjs +9808 -5532
  68. package/dist/index.cjs.map +1 -1
  69. package/dist/index.d.cts +467 -277
  70. package/dist/index.d.ts +467 -277
  71. package/dist/index.mjs +8909 -4647
  72. package/dist/index.mjs.map +1 -1
  73. package/package.json +1 -1
  74. package/assets/uix-rev/migration-review.md +0 -17
@@ -3,9 +3,9 @@
3
3
  ## Purpose
4
4
 
5
5
  Define UI surface contracts for prototyping and E2E selection.
6
- The contract must describe both screen structure and minimum mockable behavior.
6
+ The contract must describe screen structure, action coverage targets, and inspection anchors for full-harness evidence.
7
7
 
8
- > **Note:** UI contracts are **supporting input** that supplements the discussion sidecar artifacts (`discussion-*/uiux/*`), which remain the primary truth for UI/UX definitions. Screen contract YAML files are read **only when present**; after `qfai init`, this directory may contain only this README that is the normal initial state.
8
+ > **Note:** UI contracts are supporting input that supplements the discussion sidecar artifacts (`discussion-*/uiux/*`), which remain the primary truth for UI/UX definitions. In `packages/qfai` v1.7.15, prototyping execution is `full-harness` only; therefore, running the prototype harness requires both canonical screen contracts and matching `CON-UI-*` YAML contracts.
9
9
 
10
10
  ## File rules
11
11
 
@@ -35,34 +35,33 @@ The contract must describe both screen structure and minimum mockable behavior.
35
35
 
36
36
  ### `data-qfai` marker convention
37
37
 
38
- - Recommended marker value: `CONTRACT_ID:ELEMENT_ID` (example: `data-qfai="CON-UI-0001:search_input"`).
38
+ - Canonical marker value: `CONTRACT_ID:ELEMENT_ID` (example: `data-qfai="CON-UI-0001:search_input"`).
39
39
  - Use `elements[].id` (stable ID) for the marker suffix, not `elements[].label`.
40
40
  - Even when label text is not visible in the UI, markers ensure fidelity coverage.
41
41
  - autogen generates expected markers from `elements[].id` automatically.
42
- - Legacy format (`CONTRACT_ID:ELEMENT_LABEL`) is accepted for backward compatibility but new implementations should use the id-based format.
42
+ - The id-based format (`CONTRACT_ID:ELEMENT_ID`) is the canonical format for new and updated contracts.
43
+ - Legacy label-based markers may still exist in older contracts or downstream tooling; when updating those flows, migrate them to the id-based format and verify any selector/evidence wiring that still depends on label-based markers.
43
44
 
44
- ## Mockable prototype minimum (L2)
45
+ ## Prototype metadata
45
46
 
46
47
  Add `prototype` at the top level.
47
48
 
48
- - `mode`: `skeleton | interactive` (`interactive` is the recommended default)
49
- - `mockPaths`: minimum happy-path checks to validate mock behavior
49
+ - `mode`: `interactive`
50
+ - `mockPaths`: negative-only review ledger derived from real browser QA findings
50
51
  - `markers`: selector/marker convention for runtime inspection and future automation
51
52
 
52
- ### `prototype.mode` and `mockPaths[]` examples
53
+ ### `prototype.mode` and `mockPaths[]` example
54
+
55
+ The `mockPaths[]` entry is a **negative-only review ledger** — only populate it when a Browser QA finding or review outcome has identified a failure/gap in the mockable path. Do **not** populate it with expected success flows; those belong in `screens[].actions[]` (contracts) and the discussion sidecar.
53
56
 
54
57
  ```yaml
55
58
  prototype:
56
59
  mode: interactive
57
60
  mockPaths:
58
- - id: mp_create_to_list
59
- flow: create -> list reflects
60
- ```
61
-
62
- ```yaml
63
- prototype:
64
- mode: skeleton
65
- mockPaths: []
61
+ - id: mp_create_to_list_mobile_reflow
62
+ finding_ref: "BQ-2026-04-18-014"
63
+ failure_condition: "Mobile viewport: created row not reflected in list within 2s (browser QA: stale cache)."
64
+ status: open
66
65
  ```
67
66
 
68
67
  ## Screen contract rules
@@ -82,7 +81,7 @@ prototype:
82
81
  ### L2 `actions[]` minimum set
83
82
 
84
83
  - For each interactive primary route, define at least one action that changes UI state (`navigate`, `submit`, `toggle`, ...).
85
- - Tie at least one action to a `prototype.mockPaths[]` flow so reviewers can trace mockable behavior.
84
+ - Tie at least one action to observed browser QA findings so reviewers can trace action coverage.
86
85
  - Keep `effect` concrete and testable (`navigates to /orders`, `shows success toast`, ...).
87
86
 
88
87
  ## Template (YAML)
@@ -91,9 +90,10 @@ prototype:
91
90
  # QFAI-CONTRACT-ID: CON-UI-0001
92
91
  prototype:
93
92
  mode: interactive
94
- mockPaths:
95
- - id: mp_create_to_list
96
- flow: create -> list reflects
93
+ # mockPaths is a negative-only ledger: leave it empty when there are no
94
+ # open Browser QA findings against this contract's mockable paths. Only
95
+ # add entries that cite a finding or review outcome.
96
+ mockPaths: []
97
97
  markers:
98
98
  - id: mk_order_form
99
99
  selector: "[data-qfai='order-form']"
@@ -148,11 +148,9 @@ screens:
148
148
 
149
149
  ### Q3. "Can I treat this as a static screen?"
150
150
 
151
- - Use static/skeleton handling only when the screen has no meaningful interactive behavior yet.
152
- - Configuration options:
153
- - Temporary L1: `uiFidelity.mode: skeleton` with `screens: []`
154
- - L2 target: keep `mode: interactive`, but define actionable routes with minimum `actions[]` and `mockPaths[]`
155
- - Move back to `interactive` before ATDD to avoid hidden behavior drift.
151
+ - No. `packages/qfai` v1.7.15 prototyping is `full-harness` only.
152
+ - `uiFidelity.mode: skeleton` is not a valid prototyping execution target.
153
+ - Define actionable routes and `actions[]`, then collect real render and Browser QA evidence.
156
154
 
157
155
  ## Checklist
158
156
 
@@ -160,4 +158,4 @@ screens:
160
158
  - [ ] `elements[].id` follows stable naming policy and change policy is respected.
161
159
  - [ ] `elements[].label` matches runtime-visible inspection text or documented marker mapping.
162
160
  - [ ] `elements` and `actions` include the minimum fields above.
163
- - [ ] `prototype.mode/mockPaths/markers` are defined for L2 mockable flow.
161
+ - [ ] `prototype.mode` is `interactive` and `mockPaths` is treated as a negative-only issue ledger.
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Purpose
4
4
 
5
- `discussion/` stores the unified discussion pack that merges interview outputs (discuss) and requirement intake (require). Discussion packs use 15 required markdown files plus required prototyping.yaml.
5
+ `discussion/` stores the unified discussion pack that merges interview outputs (discuss) and requirement intake (require). Discussion packs use 15 required markdown files. When the latest pack is `ui_bearing: true`, it must also include `prototyping.yaml`; when `ui_bearing: false`, `prototyping.yaml` is not required.
6
6
 
7
7
  This directory does not directly update `specs/`; it prepares decisions, requirements, open questions, and rationale as inputs for `/qfai-sdd`.
8
8
 
@@ -29,7 +29,7 @@ discussion/
29
29
  ├── 13_Deferred.md
30
30
  ├── 14_Review-Request.md
31
31
  ├── 99_delta.md
32
- └── prototyping.yaml
32
+ └── prototyping.yaml # required only when ui_bearing: true
33
33
  ```
34
34
 
35
35
  ## File responsibilities
@@ -37,7 +37,7 @@ discussion/
37
37
  - `01_Context.md` – Background, purpose, stakeholders, assumptions, and issues.
38
38
  - `02_Inception-Deck.md` – Inception Deck (10 questions) for ambiguity removal and alignment.
39
39
  - `03_Story-Workshop.md` – Story workshop with user stories, user flows, and Mermaid diagrams.
40
- - `04_Sources.md` – Input sources (primary info, evidence, links) with `SRC-XXXX` IDs.
40
+ - `04_Sources.md` – Source registry, trend scan, competitive reference registry, and traceability. This is the canonical location for trend translation, competitive analysis, and source-to-requirement traceability (`SRC-XXXX` IDs).
41
41
  - `05_Scope.md` – Scope, out-of-scope, constraints, and success criteria.
42
42
  - `06_REQ.md` – Functional requirements list (`REQ-0001` format).
43
43
  - `07_NFR.md` – Non-functional requirements list (`NFR-0001` format).
@@ -50,6 +50,19 @@ discussion/
50
50
  - `14_Review-Request.md` – Review request for review artifact generation.
51
51
  - `99_delta.md` – Change history (adopted, rejected, drift, recurrence prevention).
52
52
 
53
+ ## UI/UX canonical family
54
+
55
+ For UI-bearing packs, the canonical design-evaluation source-of-truth is:
56
+
57
+ - `04_Sources.md` for trend translation and competitive reference registry
58
+ - `uiux/20_design_eval_invariant.md`
59
+ - `uiux/21_design_eval_trend_derived.md`
60
+ - `uiux/22_design_eval_product_specific.md`
61
+ - `uiux/23_design_eval_aggregate.md`
62
+ - `uiux/40_screen_contracts.md`
63
+
64
+ `05_Scope.md` is not a trend source-of-truth for L2 scoring, and fallback scans such as `uiux/*trend*` or `uiux/*competitive*` must not replace these canonical files.
65
+
53
66
  ## OQ Register rules
54
67
 
55
68
  `11_OQ-Register.md` must include these mandatory columns:
@@ -103,48 +116,38 @@ discussion/
103
116
  - Use timestamp directory naming for new outputs: `discussion-YYYYMMDDhhmmssSSS`.
104
117
  - `14_Review-Request.md` must reference routing SSOT: `.qfai/assistant/steering/agent-routing.yml` and `.qfai/assistant/steering/review-profiles.yml`.
105
118
 
106
- ## prototyping.yaml (Required Recommendation Artifact)
119
+ ## prototyping.yaml (Classification-aware Recommendation Artifact)
107
120
 
108
- Each discussion pack **must** include a `prototyping.yaml` file that recommends the prototyping mode for the project. This is a required side artifact of the 15-file discussion pack plus required prototyping.yaml completion contract.
121
+ Each UI-bearing discussion pack (`ui_bearing: true`) **must** include a `prototyping.yaml` file that recommends the prototyping mode for the project. Non-UI discussion packs (`ui_bearing: false`) do not require `prototyping.yaml`.
109
122
 
110
- ### Canonical namespaced schema (recommended)
123
+ ### Canonical namespaced schema (required)
111
124
 
112
125
  ```yaml
113
126
  prototyping:
114
- recommended_mode: standard
115
- rationale: UI validation is recommended but full-harness is not justified by default.
127
+ recommended_mode: full-harness
128
+ rationale: UI validation requires the full-harness runtime loop in packages/qfai.
116
129
  allowed_modes:
117
- - low-cost
118
- - standard
119
130
  - full-harness
120
- surface: web-ui
121
- ```
122
-
123
- ### Legacy top-level schema (deprecated — read-only backward compatibility)
124
-
125
- The following top-level form is accepted by the parser for backward compatibility but produces a deprecation warning (`QFAI-PROT-231`). New artifacts MUST NOT emit this form; use the namespaced canonical schema above.
126
-
127
- ```yaml
128
- recommended_mode: standard
129
- rationale: ...
130
- allowed_modes:
131
- - low-cost
132
- - standard
133
- surface: web-ui
131
+ surface: web
134
132
  ```
135
133
 
136
- If both forms are present in the same file, the namespaced form takes precedence and a conflict warning (`QFAI-PROT-232`) is emitted.
137
-
138
134
  ### Field reference
139
135
 
140
136
  All 4 fields are **required**. An artifact missing any field will fail validation.
141
137
 
142
- | Field | Required | Description |
143
- | ------------------ | -------- | ------------------------------------------------------------ |
144
- | `recommended_mode` | yes | `low-cost`, `standard`, or `full-harness` |
145
- | `rationale` | yes | Non-empty string explaining the recommendation |
146
- | `allowed_modes` | yes | Unique array of valid modes; must include `recommended_mode` |
147
- | `surface` | yes | `web-ui`, `mobile-ui`, `desktop-ui`, `mixed`, or `non-ui` |
138
+ | Field | Required | Description |
139
+ | ------------------ | -------- | ---------------------------------------------- |
140
+ | `recommended_mode` | yes | `full-harness` |
141
+ | `rationale` | yes | Non-empty string explaining the recommendation |
142
+ | `allowed_modes` | yes | Unique array; must contain only `full-harness` |
143
+ | `surface` | yes | `web`, `mobile`, `desktop`, or `mixed` |
144
+
145
+ ### Validation rules
146
+
147
+ - Only the canonical namespaced schema under the `prototyping:` key is accepted. Top-level recommendation keys (`recommended_mode`, `rationale`, `allowed_modes`, `surface` at root level) are not supported and will cause validation failure.
148
+ - Coexistence of top-level recommendation keys with the namespaced `prototyping:` block is invalid.
149
+ - `recommended_mode` must be included in `allowed_modes`. In packages/qfai, this means `recommended_mode` must be `full-harness` and `allowed_modes` must only contain `full-harness`.
150
+ - An artifact that does not conform to the canonical namespaced schema is invalid and will be rejected by both validation and execution/CLI. No fallback to explicit mode or default mode is performed for invalid artifacts.
148
151
 
149
152
  ## Suggested naming
150
153
 
@@ -2,194 +2,78 @@
2
2
 
3
3
  ## Purpose
4
4
 
5
- Evidence files record what was actually executed, observed, skipped, or deferred.
5
+ Evidence files record what was actually executed and observed.
6
+ `packages/qfai` v1.7.15 treats prototyping as `full-harness` only and UI-only.
6
7
 
7
- ## Prototyping stage required artifacts
8
+ ## Prototyping artifacts
8
9
 
9
- `/qfai-prototyping` uses these canonical files:
10
+ Canonical files:
10
11
 
11
12
  - `.qfai/evidence/prototyping.md`
12
13
  - `.qfai/evidence/prototyping.json`
13
- - `.qfai/evidence/render.json` (when render evidence is emitted)
14
- - `.qfai/evidence/browser-qa.json` (when browser QA is emitted)
14
+ - `.qfai/evidence/render.json`
15
+ - `.qfai/evidence/browser-qa.json`
16
+ - `.qfai/evidence/fullHarness.exit.json`
17
+ - `.qfai/evidence/fullHarness.handoff.json`
18
+ - `.qfai/evidence/fullHarness.fakeUiDetection.json`
15
19
 
16
- ## prototyping.json minimum schema
20
+ ## Execution contract
17
21
 
18
- Always required:
19
-
20
- - `specs[]`
21
- - `meta.generatedAt`
22
- - `meta.toolVersion`
23
- - `meta.commands[]`
24
- - `mode.effective`
25
- - `mode.source`
26
- - `mode.rationale`
27
-
28
- Optional:
29
-
30
- - `surface`
31
- - `mode.requested`
32
- - `mode.discussionRecommendation`
33
- - `runtimeGate`
34
- - `uiFidelity`
35
- - `renderEvidence`
36
- - `browserQa`
37
- - `fullHarness`
22
+ Supported prototyping surfaces are `web`, `mobile`, `desktop`, and `mixed`.
23
+ `cli`, API-only, backend-only, and `ui_bearing: false` classifications are not prototyping execution targets.
38
24
 
39
25
  ## Obligation matrix
40
26
 
41
- | surface / mode | specs | runtimeGate | uiFidelity | render evidence | browser QA | fullHarness |
42
- | ------------------------- | -------- | ----------- | ----------------------------- | --------------- | ---------- | ----------- |
43
- | non-ui / low-cost | required | optional | n/a | n/a | n/a | absent |
44
- | non-ui / standard | required | optional | n/a | n/a | n/a | absent |
45
- | non-ui / full-harness | required | optional | n/a | n/a | n/a | required |
46
- | ui-bearing / low-cost | required | optional | optional (`skeleton` allowed) | optional | optional | absent |
47
- | ui-bearing / standard | required | optional | required | optional | optional | absent |
48
- | ui-bearing / full-harness | required | required | required | required | required | required |
49
-
50
- Interpretation:
51
-
52
- - `required`: schema and completeness are enforced
53
- - `optional`: if present, schema must be valid
54
- - `n/a`: absent is normal success
55
-
56
- ## non-ui canonical semantics
57
-
58
- For `surface: non-ui`, the following are normal success when absent:
59
-
60
- - `uiFidelity`
61
- - render evidence bundle
62
- - browser QA bundle
63
- - `runtimeGate.ui`
64
-
65
- Contradictory UI-only payloads on `non-ui` are validation errors.
66
-
67
- ## uiFidelity notes
68
-
69
- - `uiFidelity` is the canonical UI evidence block.
70
- - `mode: interactive` is the default when a working UI flow is exercised.
71
- - `mode: skeleton` is allowed for low-cost UI proof where structure exists but wiring is intentionally partial.
72
- - Keep `"version": "0.1"` in the `uiFidelity` payload until the schema version changes.
73
-
74
- ## fullHarness minimum completeness
75
-
76
- When `mode.effective = "full-harness"`:
77
-
78
- - `fullHarness.enabled = true`
79
- - `fullHarness.available`
80
- - `fullHarness.runId`
81
- - `fullHarness.iterationCount >= 1`
82
- - `fullHarness.bestIteration >= 1`
83
- - `fullHarness.terminationReason`
84
- - `fullHarness.reviewerSignoff`
85
- - `fullHarness.scoringTrace.length >= 1`
86
-
87
- ## Render evidence bundle conventions
88
-
89
- Canonical path: `.qfai/evidence/render.json`
90
-
91
- ```json
92
- {
93
- "renderEvidence": {
94
- "status": "captured",
95
- "requested": true,
96
- "viewports": ["desktop", "mobile"],
97
- "outputPath": ".qfai/evidence/render.json"
98
- },
99
- "screens": [
100
- {
101
- "route": "/orders",
102
- "viewport": "desktop",
103
- "status": "captured",
104
- "width": 1440,
105
- "height": 900,
106
- "imagePath": ".qfai/evidence/render/orders.desktop.png",
107
- "htmlPath": ".qfai/evidence/render/orders.desktop.html"
108
- },
109
- {
110
- "route": "/orders",
111
- "viewport": "mobile",
112
- "status": "skipped",
113
- "skippedReason": "path-only review for non-blocking mobile check"
114
- }
115
- ]
116
- }
117
- ```
118
-
119
- Rules:
120
-
121
- - `status`: `captured | skipped | failed`
122
- - `captured`: `imagePath` and `htmlPath` required (QFAI-PROT-252)
123
- - `skipped`: `skippedReason` required (QFAI-PROT-252)
124
- - `failed`: `error` required (QFAI-PROT-252)
125
- - external bundle is the source of truth
126
- - in-band `uiFidelity.screens[].renders[]` is summary/projection only
127
- - render evidence must remain `path-only`; `data:` URIs, `base64,` payloads, and inline HTML are invalid (QFAI-PROT-251)
128
- - extremely long single-line payloads (>500 chars) are treated as inline payload violations
129
- - top-level `renderEvidence.status` and individual `screens[].status` must not contradict (QFAI-PROT-253)
130
-
131
- ## browser-qa.json canonical contract
132
-
133
- ```json
134
- {
135
- "browserQa": {
136
- "executed": true,
137
- "status": "completed",
138
- "mode": "full-harness",
139
- "summary": {
140
- "smoke": { "passed": 3, "failed": 0 },
141
- "interaction": { "passed": 4, "failed": 1 }
142
- }
143
- },
144
- "findings": [
145
- {
146
- "category": "interaction",
147
- "severity": "error",
148
- "route": "/orders",
149
- "message": "Save button submits duplicate request"
150
- }
151
- ]
152
- }
153
- ```
154
-
155
- Rules:
156
-
157
- - required only for `ui-bearing / full-harness` (QFAI-PROT-263)
158
- - optional for `ui-bearing / low-cost|standard`
159
- - n/a for `non-ui`
160
- - `executed=true` requires `status=completed`; `executed=false` permits `status=skipped|failed` only
161
- - `status=completed` without `summary` or `findings` produces a warning (QFAI-PROT-262)
162
- - `browserQa.mode` must match `prototyping.json.mode.effective` (QFAI-PROT-261)
163
- - `summary.*.passed/failed` must be non-negative integers
164
- - each finding requires `category`, `severity`, and `message`
165
-
166
- ## Example prototyping.json
167
-
168
- ```json
169
- {
170
- "surface": "web-ui",
171
- "specs": [
172
- {
173
- "specId": "spec-0001",
174
- "declared": { "uiRoutes": 1, "apiEndpoints": 1, "dbObjects": 1 },
175
- "checked": { "uiOk": 1, "apiNon404": 1, "dbPresent": 1 },
176
- "missing": { "uiRoutes": [], "apiEndpoints": [], "dbObjects": [] }
177
- }
178
- ],
179
- "mode": {
180
- "effective": "standard",
181
- "source": "default",
182
- "rationale": "No explicit request or discussion recommendation was provided."
183
- },
184
- "meta": {
185
- "generatedAt": "2026-04-04T00:00:00.000Z",
186
- "toolVersion": "<current-tool-version>",
187
- "commands": ["qfai validate --fail-on error"]
188
- },
189
- "uiFidelity": {
190
- "version": "0.1",
191
- "mode": "interactive",
192
- "screens": []
193
- }
194
- }
195
- ```
27
+ | surface / mode | specs | runtimeGate | uiFidelity | render evidence | browser QA | fullHarness |
28
+ | ---------------------- | -------- | ----------- | ---------- | --------------- | ---------- | ----------- |
29
+ | web / full-harness | required | required | required | required | required | required |
30
+ | mobile / full-harness | required | required | required | required | required | required |
31
+ | desktop / full-harness | required | required | required | required | required | required |
32
+ | mixed / full-harness | required | required | required | required | required | required |
33
+
34
+ `low-cost` and `standard` are unsupported in `packages/qfai` v1.7.15.
35
+
36
+ ## Truthfulness rules
37
+
38
+ - `mode.effective` must be `full-harness`.
39
+ - `uiFidelity.mode` must be `interactive`.
40
+ - Canonical screen contracts in `discussion-*/uiux/40_screen_contracts.md` are mandatory.
41
+ - Browser QA is mandatory per screen.
42
+ - Calibration is resolved from `fullHarness.calibrationRef.packPath`; scalar caller overrides are invalid.
43
+ - `runtimeGate.evidenceRefs` must contain concrete render/browser QA/spec refs only.
44
+ - `specCoverage` refs must use concrete declared refs plus concrete observed refs. Self-reference and synthetic strings are invalid.
45
+ - `mockPaths` is a negative-only ledger. Allowed values are `fail|finding` only.
46
+
47
+ ## fullHarness semantics
48
+
49
+ Required fields:
50
+
51
+ - `enabled = true`
52
+ - `runId`
53
+ - `calibrationRef.configPath`
54
+ - `calibrationRef.packPath`
55
+ - `calibrationRef.packVersion`
56
+ - `iterationCount`
57
+ - `bestIteration`
58
+ - `status`
59
+ - `reviewerSignoff`
60
+ - `reviewerLogs`
61
+ - `iterations`
62
+ - `scoringTrace`
63
+ - `limitations`
64
+
65
+ Review semantics:
66
+
67
+ - `finalDecision = accepted` -> `reviewerSignoff.status = approved`
68
+ - `finalDecision = rejected` -> `reviewerSignoff.status = rejected`
69
+ - `finalDecision = abandoned` -> `reviewerSignoff.status = abandoned`
70
+ - `reviewerLogs[last].verdict` must align with the final decision and termination semantics.
71
+
72
+ ## Prohibited patterns
73
+
74
+ - `low-cost` or `standard` prototyping metadata
75
+ - `cli` prototyping execution
76
+ - self-reference such as `prototyping.json#/runtimeGate`
77
+ - synthetic refs such as `specs: ...`
78
+ - synthetic `mockPaths.status="pass"`
79
+ - hardcoded calibration pack version
@@ -0,0 +1,26 @@
1
+ # QFAI default calibration pack.
2
+ #
3
+ # The full-harness loader (`packages/qfai/src/core/calibration/loader.ts`)
4
+ # requires a calibration pack at the path declared in
5
+ # `qfai.config.yaml > prototyping.calibration.packPath`. This file ships as
6
+ # the zero-configuration default so `qfai init` projects can run full-harness
7
+ # without a manual setup step. Edit the values below to tune iteration limits
8
+ # and score thresholds for your team's review cadence.
9
+
10
+ version: "1.0.0-default"
11
+
12
+ thresholds:
13
+ accept: 0.8
14
+ refine: 0.5
15
+
16
+ maxIterations: 5
17
+ plateauDelta: 0.02
18
+ plateauLookback: 3
19
+
20
+ examples:
21
+ - input: "Example UI surface with clear primary call-to-action and WCAG AA contrast."
22
+ expectedScore: 0.9
23
+ rationale: "High-quality example: explicit primary action, accessible contrast, no layout clutter."
24
+ - input: "Placeholder layout with lorem-ipsum copy and no primary action."
25
+ expectedScore: 0.3
26
+ rationale: "Low-quality example: placeholder content and absent decision path."
@@ -19,7 +19,6 @@ Routing SSOT:
19
19
 
20
20
  ```text
21
21
  .qfai/review/
22
- ├── README.md
23
22
  └── review-YYYYMMDDhhmmssSSS/
24
23
  ├── review_request.md
25
24
  ├── R01_<reviewer>.md
@@ -27,15 +26,59 @@ Routing SSOT:
27
26
  └── summary.json
28
27
  ```
29
28
 
30
- ## summary.json (minimum schema)
29
+ Git ignore management: `review-*/` packs are ignored via the QFAI managed
30
+ block in the **repo-root `.gitignore`** (added/updated by `qfai init`).
31
+ `.qfai/review/` itself does **not** contain a nested `.gitignore`; the
32
+ single managed block in the repo root is the SSOT.
33
+
34
+ ## summary.json (minimum schema; prefer v2.0 for new packs)
35
+
36
+ > **Accepted schema versions:** the active validator
37
+ > (`packages/qfai/src/core/validators/reviewArtifacts.ts`) accepts
38
+ > `version: "1.0"` and `version: "2.0"` as `ALLOWED_VERSIONS`. Both
39
+ > versions share the top-level envelope (`version`, `created_at`,
40
+ > `target: { kind, path }`, `overall_status`) but carry reviewer entries
41
+ > under different keys:
42
+ >
43
+ > - **v1.0** uses a `roster` array of reviewer entries.
44
+ > - **v2.0** uses a `reviewers` array plus required `routing_profile`
45
+ > (string) and optional `conditional_reviewers` array. v2.0 is the
46
+ > canonical choice for new packs.
47
+ >
48
+ > Reviewer entry fields validated in both versions:
49
+ > `{ reviewer: string, status: "PASS" | "FAIL" | "NA", feedback_count?: integer }`.
50
+ > No future-only keys are required. If `summary.json` drifts from this
51
+ > schema, `QFAI-REVIEW-007` fires with the failing field list.
52
+ >
53
+ > **Verdict vocabulary:** `summary.json` uses `PASS|FAIL` historically (the
54
+ > validator above enforces that set). The in-flight reviewer response
55
+ > template in `shared-skill-delegation-baseline.md` uses
56
+ > `Result: PASS | REVISE` — this is the same concept viewed from two
57
+ > angles (reviewer-side verdict vs. serialised summary). A reviewer
58
+ > `REVISE` maps to `status: "FAIL"` in summary.json until the validator
59
+ > schema is broadened in a future release.
60
+
61
+ ### v1.0 example
62
+
63
+ ```json
64
+ {
65
+ "version": "1.0",
66
+ "created_at": "2026-02-18T12:34:56+09:00",
67
+ "target": { "kind": "spec|discussion", "path": "..." },
68
+ "roster": [{ "reviewer": "name-or-id", "status": "PASS|FAIL|NA", "feedback_count": 0 }],
69
+ "overall_status": "PASS|FAIL"
70
+ }
71
+ ```
72
+
73
+ ### v2.0 example (preferred)
31
74
 
32
75
  ```json
33
76
  {
34
77
  "version": "2.0",
35
78
  "created_at": "2026-02-18T12:34:56+09:00",
36
- "target": { "kind": "spec|require|discussion", "path": "..." },
79
+ "target": { "kind": "spec|discussion", "path": "..." },
37
80
  "routing_profile": "default",
38
- "reviewers": [{ "reviewer": "name-or-id", "status": "PASS|FAIL", "feedback_count": 0 }],
81
+ "reviewers": [{ "reviewer": "name-or-id", "status": "PASS|FAIL|NA", "feedback_count": 0 }],
39
82
  "conditional_reviewers": [],
40
83
  "overall_status": "PASS|FAIL"
41
84
  }
@@ -44,7 +87,9 @@ Routing SSOT:
44
87
  Rules:
45
88
 
46
89
  - Execute only the reviewers routed for the current skill/phase.
47
- - If any reviewer returns `FAIL`, return/fix and rerun only failed reviewers and reviewers **affected by the changed scope**.
90
+ - If any reviewer returns `FAIL` (equivalent to `REVISE` in the in-flight
91
+ reviewer response template; see the vocabulary note above), return/fix
92
+ and rerun only failed reviewers and reviewers **affected by the changed scope**.
48
93
  - "changed scope" is defined as the set of file paths affected by the latest fix and the scope tags (component, domain, layer, etc.) associated with those files.
49
94
  - An "affected reviewer" is any reviewer matching either of the following:
50
95
  - Its assigned scope (path prefix or scope tag) in `.qfai/assistant/steering/agent-routing.yml` or `review-profiles.yml` intersects the changed scope.
@@ -54,11 +99,11 @@ Rules:
54
99
  2. Resolve the corresponding scope tags, components, and domains via `agent-routing.yml` / `review-profiles.yml` to enumerate the changed scope.
55
100
  3. For each reviewer, check whether its assigned scope intersects the changed scope or whether its routing definition was modified; mark matching reviewers as "affected".
56
101
  4. Rerun only "previously FAIL reviewers" + "affected reviewers"; carry forward previous results for all others.
57
- - Validation evidence for each review pack must archive the latest
58
- `.qfai/report/validate.log` and ATDD traceability report
59
- (`.qfai/report/atdd-traceability/summary.{json,md}`) by copying them from
60
- `.qfai/report` into the corresponding `review-*/evidence/` directory
61
- (since `.qfai/report` may be git-ignored).
102
+ - Both `.qfai/report` and `.qfai/review/review-*/` are git-ignored by default
103
+ (managed by `qfai init`). Review packs are therefore local-only unless a
104
+ project opts in by adding explicit negation rules to its `.gitignore` (e.g.
105
+ `!.qfai/review/review-<timestamp>/`) or by archiving packs to an external
106
+ store before cleanup.
62
107
  - Reviewers must confirm no unresolved ATDD hard gates (`QFAI-ATDD-101/102/103/111/112/113/121/122`).
63
108
 
64
109
  ## Prototyping review quick checklist
@@ -73,5 +118,5 @@ Diagnosis flow:
73
118
 
74
119
  1. Read validator `code/rule/refs` and capture `contract_id` + `route`.
75
120
  2. Check required `elements[].label` and `actions[]` in the contract.
76
- 3. Verify `uiFidelity.screens[]` coverage and `mockPaths.status=pass`.
121
+ 3. Verify `uiFidelity.screens[]` coverage and that `mockPaths` contains only negative findings (`fail|finding`).
77
122
  4. Confirm UI renders labels or has stable `data-qfai` markers before resolving the review thread.
@@ -72,9 +72,9 @@ Each `spec-XXXX/` must satisfy:
72
72
 
73
73
  Each `spec-XXXX/tdd/test-list.md` is the execution ledger for the TDD micro-cycle.
74
74
 
75
- - **8 required columns**: TDD-ID, TC-Refs, Layer, Test file, Selector, Status, DR-ID, Evidence
75
+ - **8 required columns** (in `tdd/test-list.md`): TDD-ID, TC-Refs, Layer, Test file, Selector, Status, DR-ID, Evidence
76
76
  - **Coverage** is measured as unit/component TC references from `06_Test-Cases.md` appearing in TC-Refs
77
- - **Level column fallback**: when `06_Test-Cases.md` has no `Level` column, all TCs are treated as coverage targets (equivalent to all being unit/component)
77
+ - **Test-case classification fallback** (for `06_Test-Cases.md`, which uses its own classification column — typically named `Level`): when that file has no test-case classification column, every TC is treated as a coverage target (equivalent to all being unit/component). This fallback does **not** apply to the `tdd/test-list.md` `Layer` column, which remains required.
78
78
  - **Status=exception** rows must have a non-empty DR-ID (Decision Record reference)
79
79
  - **Status in {green, refactor, done}** rows must have an existing Test file (resolved relative to project root)
80
80
  - **TDD-ID** must match `TDD-NNNN` format and be unique within the spec (case-insensitive)
@@ -21,9 +21,14 @@ validation:
21
21
  testFileGlobs:
22
22
  - tests/**/*.test.ts
23
23
  - tests/**/*.spec.ts
24
+ - packages/*/tests/**/*.test.ts
25
+ - packages/*/tests/**/*.spec.ts
24
26
  - src/**/*.test.ts
25
27
  - src/**/*.spec.ts
28
+ - packages/*/src/**/*.test.ts
29
+ - packages/*/src/**/*.spec.ts
26
30
  - features/**/*.feature
31
+ - packages/*/features/**/*.feature
27
32
  testFileExcludeGlobs: []
28
33
  scNoTestSeverity: error
29
34
  orphanContractsPolicy: error
@@ -33,12 +38,6 @@ output:
33
38
  prototyping:
34
39
  calibration:
35
40
  packPath: .qfai/evidence/calibration.yaml
36
- thresholds:
37
- accept: 0.8
38
- refine: 0.5
39
- maxIterations: 15
40
- plateauDelta: 0.02
41
- plateauLookback: 3
42
41
  execution:
43
42
  targetUrl: null
44
43
  browserProvider: playwright