qfai 1.4.25 → 1.4.27

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 (41) hide show
  1. package/README.md +12 -2
  2. package/assets/init/.qfai/assistant/agents/architect-reviewer.md +1 -1
  3. package/assets/init/.qfai/assistant/agents/atdd-api-implementer.md +12 -10
  4. package/assets/init/.qfai/assistant/agents/atdd-e2e-implementer.md +13 -11
  5. package/assets/init/.qfai/assistant/agents/atdd-integration-implementer.md +14 -13
  6. package/assets/init/.qfai/assistant/agents/backend-reviewer.md +1 -1
  7. package/assets/init/.qfai/assistant/agents/code-reviewer.md +1 -1
  8. package/assets/init/.qfai/assistant/agents/coverage-planner.md +17 -22
  9. package/assets/init/.qfai/assistant/agents/design-review-lead.md +1 -1
  10. package/assets/init/.qfai/assistant/agents/frontend-reviewer.md +1 -1
  11. package/assets/init/.qfai/assistant/agents/option-reviewer.md +1 -1
  12. package/assets/init/.qfai/assistant/agents/oq-reviewer.md +1 -1
  13. package/assets/init/.qfai/assistant/agents/qa-reviewer.md +1 -1
  14. package/assets/init/.qfai/assistant/agents/reviewer.md +14 -14
  15. package/assets/init/.qfai/assistant/agents/test-volume-estimator.md +15 -17
  16. package/assets/init/.qfai/assistant/agents/ui-ux-reviewer.md +1 -1
  17. package/assets/init/.qfai/assistant/instructions/agent-selection.md +2 -2
  18. package/assets/init/.qfai/assistant/instructions/drift-protocol.md +5 -2
  19. package/assets/init/.qfai/assistant/instructions/migrations/v1.4.27-atdd-alignment.md +35 -0
  20. package/assets/init/.qfai/assistant/instructions/workflow.md +2 -2
  21. package/assets/init/.qfai/assistant/skills/qfai-atdd/SKILL.md +136 -465
  22. package/assets/init/.qfai/assistant/skills/qfai-discuss/templates/08_Review-Request.md +1 -0
  23. package/assets/init/.qfai/assistant/skills/qfai-discuss/templates/review/review_request.md +2 -0
  24. package/assets/init/.qfai/assistant/skills/qfai-prototyping/SKILL.md +4 -0
  25. package/assets/init/.qfai/assistant/skills/qfai-require/templates/review/review_request.md +2 -0
  26. package/assets/init/.qfai/assistant/skills/qfai-sdd/SKILL.md +8 -0
  27. package/assets/init/.qfai/assistant/steering/test-layers.md +45 -34
  28. package/assets/init/.qfai/assistant/templates/rcp_footer.md +15 -0
  29. package/assets/init/.qfai/report/README.md +2 -0
  30. package/assets/init/.qfai/review/README.md +2 -0
  31. package/dist/cli/index.cjs +783 -163
  32. package/dist/cli/index.cjs.map +1 -1
  33. package/dist/cli/index.mjs +773 -153
  34. package/dist/cli/index.mjs.map +1 -1
  35. package/dist/index.cjs +3072 -2457
  36. package/dist/index.cjs.map +1 -1
  37. package/dist/index.d.cts +47 -1
  38. package/dist/index.d.ts +47 -1
  39. package/dist/index.mjs +3077 -2464
  40. package/dist/index.mjs.map +1 -1
  41. package/package.json +1 -1
package/README.md CHANGED
@@ -39,6 +39,16 @@ npx qfai report
39
39
  - `npx qfai doctor`
40
40
  - Diagnoses configuration discovery, path resolution, glob scanning, and `validate.json` inputs before running validate/report; use `--fail-on` to enforce failures in CI.
41
41
 
42
+ ## ATDD annotation hard gate (v1.4.27)
43
+
44
+ `qfai validate` enforces spec-to-test traceability with directory-based rules.
45
+
46
+ - `tests/e2e/**`: annotate all covered user stories with `QFAI:SPEC-XXXX:US-YYYY`.
47
+ - `tests/integration/**`: annotate all covered test cases with `QFAI:SPEC-XXXX:TC-YYYY`.
48
+ - `tests/api/**`: annotate all covered API contracts with `QFAI:CON-API-XXXX`.
49
+ - `tests/api/**` and `tests/e2e/**` must not use `TC` annotations.
50
+ - `AC` annotations are not required in code; AC coverage is treated as indirect through full `TC` coverage.
51
+
42
52
  ## Operating model (skills-driven workflow)
43
53
 
44
54
  QFAI assumes you operate the project primarily via prepared custom skills.
@@ -210,7 +220,7 @@ flowchart LR
210
220
  - Contracts SSOT: `.qfai/contracts/**`
211
221
  - Report outputs (`.qfai/report/**`) are derived artifacts and not SSOT.
212
222
 
213
- ## Minimal tutorial (v1.4.25)
223
+ ## Minimal tutorial (v1.4.27)
214
224
 
215
225
  1. `npx qfai init`
216
226
  2. Run `/qfai-discuss` to structure scope and open questions.
@@ -237,7 +247,7 @@ Release gate behavior:
237
247
 
238
248
  ## Continuous integration
239
249
 
240
- QFAI v1.4.25 generates integration wrappers under `.agents/**`, `.claude/**`,
250
+ QFAI v1.4.27 generates integration wrappers under `.agents/**`, `.claude/**`,
241
251
  `.github/**`, and `.codex/**`.
242
252
  It does not generate GitHub Actions workflows.
243
253
  Configure CI in your own platform and run:
@@ -29,7 +29,7 @@ You MUST enforce the following:
29
29
  - **Plan is binding, but not absolute.**
30
30
  - If reality diverged from plan, downstream work must STOP and escalate via Change Request → approval.
31
31
  - **Do NOT enforce test pyramid ratios as a gate.**
32
- - Reject only when coverage obligations are unmet (Coverage Ledger not 100% unless approved exception) or required layers are missing without approval.
32
+ - Reject when validation evidence is missing/failing (`qfai validate --fail-on error`) or required US/TC/CON coverage obligations are unmet in test-layer policy.
33
33
 
34
34
  ## Deliverables (MANDATORY)
35
35
 
@@ -2,45 +2,47 @@
2
2
 
3
3
  ## Mission
4
4
 
5
- - Implement all `layer=api` entries in the ATDD Coverage Ledger.
5
+ - Implement API tests so every declared `CON-API-*` is covered at least once in `tests/api/**`.
6
+ - Keep API layer focused on contract/auth/error obligations.
6
7
 
7
8
  ## Inputs you must read
8
9
 
9
10
  - .qfai/assistant/instructions/\*
10
11
  - .qfai/assistant/steering/\*
11
- - .qfai/specs/spec-\*/delta.md (Decision Records; check rejected)
12
- - .qfai/specs/spec-\*/scenario.feature
12
+ - .qfai/specs/spec-\*/09_delta.md (Decision Records; check rejected)
13
13
  - .qfai/contracts/api/\*\*
14
- - ATDD Coverage Ledger
14
+ - .qfai/specs/spec-\*/11_Contracts.md (if present)
15
15
  - Existing API test stack (if any)
16
+ - Current validation report and evidence
16
17
 
17
18
  ## Deliverables (MANDATORY)
18
19
 
19
20
  - Decision Records referenced (DR-IDs) + rejected check (or RE-OPEN request)
20
21
  - API test files (reuse existing stack)
21
- - Endpoint -> test mapping (ledger updates)
22
+ - CON-API -> test file mapping list
22
23
  - Execution logs (commands + results)
23
24
  - Evidence summary for `.qfai/evidence/` (gitignored; do not commit)
24
25
 
25
26
  ## Stop conditions (Blockers)
26
27
 
27
28
  - Rejected option would be reintroduced without RE-OPEN DR
28
- - Ledger missing or layer=api floor not met
29
- - API test stack missing and no approval to add one
29
+ - `CON-API-*` set cannot be derived from contracts
30
+ - API test stack is missing and no approval exists to add one
31
+ - Validation reports unresolved errors
30
32
  - Evidence is missing or incomplete
31
33
 
32
34
  ## Sign-off checklist (Check Last)
33
35
 
34
36
  - [ ] Deliverables are complete
35
37
  - [ ] Evidence is present (gitignored)
36
- - [ ] API floor met (or DR-approved exception)
37
- - [ ] Ledger mapping is updated
38
+ - [ ] All required `CON-API-*` are covered in `tests/api/**`
39
+ - [ ] `qfai validate --fail-on error` evidence is recorded
38
40
 
39
41
  ## Output format (structured)
40
42
 
41
43
  - Decision Records (DR-IDs) / rejected check
42
44
  - Implemented files list
43
- - Mapping summary (endpoint -> test)
45
+ - Mapping summary (CON-API -> test)
44
46
  - Execution log summary
45
47
  - Evidence summary
46
48
  - Open Questions / Risks
@@ -2,44 +2,46 @@
2
2
 
3
3
  ## Mission
4
4
 
5
- - Implement all `layer=e2e` entries in the ATDD Coverage Ledger.
5
+ - Implement E2E tests so every required `US-*` is covered at least once.
6
+ - Keep E2E focused on user journeys; contract guarantees belong to API tests.
6
7
 
7
8
  ## Inputs you must read
8
9
 
9
10
  - .qfai/assistant/instructions/\*
10
11
  - .qfai/assistant/steering/\*
11
- - .qfai/specs/spec-\*/delta.md (Decision Records; check rejected)
12
- - .qfai/specs/spec-\*/scenario.feature
13
- - ATDD Coverage Ledger
12
+ - .qfai/specs/spec-\*/09_delta.md (Decision Records; check rejected)
13
+ - .qfai/specs/spec-\*/02_User-stories.md (or project-equivalent user story file)
14
14
  - Existing E2E framework/config (if any)
15
+ - Current validation report and evidence
15
16
 
16
17
  ## Deliverables (MANDATORY)
17
18
 
18
19
  - Decision Records referenced (DR-IDs) + rejected check (or RE-OPEN request)
19
- - E2E test files (Playwright preferred; reuse existing stack)
20
- - SC -> test mapping (ledger updates)
20
+ - E2E test files (reuse existing stack)
21
+ - US -> test file mapping list
21
22
  - Execution logs (commands + results)
22
23
  - Evidence summary for `.qfai/evidence/` (gitignored; do not commit)
23
24
 
24
25
  ## Stop conditions (Blockers)
25
26
 
26
27
  - Rejected option would be reintroduced without RE-OPEN DR
27
- - Ledger missing or layer=e2e floor not met
28
- - E2E framework missing and no approval to add one
28
+ - `US-*` list cannot be derived from specs
29
+ - E2E framework is missing and no approval exists to add one
30
+ - Validation reports unresolved errors
29
31
  - Evidence is missing or incomplete
30
32
 
31
33
  ## Sign-off checklist (Check Last)
32
34
 
33
35
  - [ ] Deliverables are complete
34
36
  - [ ] Evidence is present (gitignored)
35
- - [ ] E2E floor met (or DR-approved exception)
36
- - [ ] Ledger mapping is updated
37
+ - [ ] All required `US-*` are covered in `tests/e2e/**`
38
+ - [ ] `qfai validate --fail-on error` evidence is recorded
37
39
 
38
40
  ## Output format (structured)
39
41
 
40
42
  - Decision Records (DR-IDs) / rejected check
41
43
  - Implemented files list
42
- - Mapping summary (SC -> test)
44
+ - Mapping summary (US -> test)
43
45
  - Execution log summary
44
46
  - Evidence summary
45
47
  - Open Questions / Risks
@@ -2,45 +2,46 @@
2
2
 
3
3
  ## Mission
4
4
 
5
- - Implement all `layer=integration` entries in the ATDD Coverage Ledger.
5
+ - Implement integration tests so every required `TC-*` is covered at least once in `tests/integration/**`.
6
+ - Keep integration layer focused on service boundary behavior and infra interactions.
6
7
 
7
8
  ## Inputs you must read
8
9
 
9
10
  - .qfai/assistant/instructions/\*
10
11
  - .qfai/assistant/steering/\*
11
- - .qfai/specs/spec-\*/delta.md (Decision Records; check rejected)
12
- - .qfai/specs/spec-\*/scenario.feature
13
- - .qfai/specs/spec-\*/case-catalogue.md
14
- - ATDD Coverage Ledger
15
- - Existing integration test stack (Cucumber preferred)
12
+ - .qfai/specs/spec-\*/09_delta.md (Decision Records; check rejected)
13
+ - .qfai/specs/spec-\*/06_Test-Cases.md
14
+ - Existing integration test stack (if any)
15
+ - Current validation report and evidence
16
16
 
17
17
  ## Deliverables (MANDATORY)
18
18
 
19
19
  - Decision Records referenced (DR-IDs) + rejected check (or RE-OPEN request)
20
- - Integration test files (Cucumber preferred; reuse existing stack)
21
- - CASE/endpoint -> test mapping (ledger updates)
20
+ - Integration test files (reuse existing stack)
21
+ - TC -> test file mapping list
22
22
  - Execution logs (commands + results)
23
23
  - Evidence summary for `.qfai/evidence/` (gitignored; do not commit)
24
24
 
25
25
  ## Stop conditions (Blockers)
26
26
 
27
27
  - Rejected option would be reintroduced without RE-OPEN DR
28
- - Ledger missing or layer=integration floor not met
29
- - Integration test stack missing and no approval to add one
28
+ - `TC-*` list cannot be derived from spec test cases
29
+ - Integration test stack is missing and no approval exists to add one
30
+ - Validation reports unresolved errors
30
31
  - Evidence is missing or incomplete
31
32
 
32
33
  ## Sign-off checklist (Check Last)
33
34
 
34
35
  - [ ] Deliverables are complete
35
36
  - [ ] Evidence is present (gitignored)
36
- - [ ] Integration floor met (or DR-approved exception)
37
- - [ ] Ledger mapping is updated
37
+ - [ ] All required `TC-*` are covered in `tests/integration/**`
38
+ - [ ] `qfai validate --fail-on error` evidence is recorded
38
39
 
39
40
  ## Output format (structured)
40
41
 
41
42
  - Decision Records (DR-IDs) / rejected check
42
43
  - Implemented files list
43
- - Mapping summary (CASE/EP -> test)
44
+ - Mapping summary (TC -> test)
44
45
  - Execution log summary
45
46
  - Evidence summary
46
47
  - Open Questions / Risks
@@ -30,7 +30,7 @@ You MUST enforce the following:
30
30
  - **Plan is binding, but not absolute.**
31
31
  - If reality diverged from plan, downstream work must STOP and escalate via Change Request → approval.
32
32
  - **Do NOT enforce test pyramid ratios as a gate.**
33
- - Reject only when coverage obligations are unmet (Coverage Ledger not 100% unless approved exception) or required layers are missing without approval.
33
+ - Reject when validation evidence is missing/failing (`qfai validate --fail-on error`) or required US/TC/CON coverage obligations are unmet in test-layer policy.
34
34
 
35
35
  ## Deliverables (MANDATORY)
36
36
 
@@ -30,7 +30,7 @@ You MUST enforce the following:
30
30
  - **Plan is binding, but not absolute.**
31
31
  - If reality diverged from plan, downstream work must STOP and escalate via Change Request → approval.
32
32
  - **Do NOT enforce test pyramid ratios as a gate.**
33
- - Reject only when coverage obligations are unmet (Coverage Ledger not 100% unless approved exception) or required layers are missing without approval.
33
+ - Reject when validation evidence is missing/failing (`qfai validate --fail-on error`) or required US/TC/CON coverage obligations are unmet in test-layer policy.
34
34
 
35
35
  ## Deliverables (MANDATORY)
36
36
 
@@ -2,53 +2,48 @@
2
2
 
3
3
  ## Mission
4
4
 
5
- - Define and maintain coverage ledgers to prevent silent gaps.
6
- - Convert coverage findings into actionable, perspective-based EX/TC planning.
5
+ - Define coverage obligations and operating rules for E2E/API/Integration.
6
+ - Produce actionable checklists for implementers and reviewers.
7
7
 
8
8
  ## Inputs you must read
9
9
 
10
10
  - .qfai/assistant/instructions/\*
11
- - .qfai/assistant/steering/\*
12
- - .qfai/specs/spec-\*/09_delta.md (Decision Records; check rejected)
13
- - .qfai/specs/spec-\*/04_Business-Rules.md
14
- - .qfai/specs/spec-\*/05_Examples.md
11
+ - .qfai/assistant/steering/test-layers.md
12
+ - .qfai/specs/spec-\*/02_User-stories.md
15
13
  - .qfai/specs/spec-\*/06_Test-Cases.md
14
+ - .qfai/contracts/api/\*\*
16
15
  - .qfai/report/validate.log
17
- - .qfai/report/specs-coverage/spec-\*.md
18
- - Existing coverage ledgers and test files
16
+ - Existing test files
19
17
 
20
18
  ## Deliverables (MANDATORY)
21
19
 
22
20
  - Decision Records referenced (DR-IDs) + rejected check (or RE-OPEN request)
23
- - Hard-gap list (`QFAI-COV-201/202/203/204/205/206`) with source-layer fixes
24
- - Density-smell list (for example `QFAI-COV-207`) with perspective-based improvement ideas
25
- - Scope ledger (what must be tested) with exclusions rationale
26
- - Coverage ledger mapped to BR/EX/TC layers
21
+ - Coverage obligations checklist (`US` / `TC` / `CON-API`)
22
+ - Layer assignment checklist (`tests/e2e|api|integration`)
23
+ - Forbidden-reference checklist (API/E2E must not use TC annotations)
24
+ - Signals summary (floors/ratios are signals, not gates)
27
25
  - Evidence summary for `.qfai/evidence/` (gitignored; do not commit)
28
26
 
29
27
  ## Stop conditions (Blockers)
30
28
 
31
29
  - Rejected option would be reintroduced without RE-OPEN DR
32
- - Hidden exclusions or silent gaps detected
30
+ - Source obligations are ambiguous
33
31
  - Evidence is missing or incomplete
34
- - BR/EX/TC mapping is ambiguous
35
32
 
36
33
  ## Sign-off checklist (Check Last)
37
34
 
38
35
  - [ ] Deliverables are complete
39
36
  - [ ] Evidence is present (gitignored)
40
- - [ ] No silent gaps remain
41
- - [ ] Handoff includes actionable next steps
37
+ - [ ] Handoff is actionable for implementers/reviewers
38
+ - [ ] Gate/non-gate boundary is explicit
42
39
 
43
40
  ## Output format (structured)
44
41
 
45
42
  - Decision Records (DR-IDs) / rejected check
46
- - Findings
47
- - Hard gaps (`QFAI-COV-201..206`)
48
- - Density smells (`QFAI-COV-207` and similar)
49
- - Coverage ledger
50
- - Perspective-based EX/TC proposal (boundary, negative, permission, state)
51
- - Exclusions rationale
43
+ - Coverage obligations checklist
44
+ - Layer assignment checklist
45
+ - Forbidden-reference checklist
46
+ - Signals summary
52
47
  - Evidence summary
53
48
  - Open Questions / Risks
54
49
  - Confidence (High/Medium/Low + reason)
@@ -30,7 +30,7 @@ You MUST enforce the following:
30
30
  - **Plan is binding, but not absolute.**
31
31
  - If reality diverged from plan, downstream work must STOP and escalate via Change Request → approval.
32
32
  - **Do NOT enforce test pyramid ratios as a gate.**
33
- - Reject only when coverage obligations are unmet (Coverage Ledger not 100% unless approved exception) or required layers are missing without approval.
33
+ - Reject when validation evidence is missing/failing (`qfai validate --fail-on error`) or required US/TC/CON coverage obligations are unmet in test-layer policy.
34
34
 
35
35
  ## Deliverables (MANDATORY)
36
36
 
@@ -30,7 +30,7 @@ You MUST enforce the following:
30
30
  - **Plan is binding, but not absolute.**
31
31
  - If reality diverged from plan, downstream work must STOP and escalate via Change Request → approval.
32
32
  - **Do NOT enforce test pyramid ratios as a gate.**
33
- - Reject only when coverage obligations are unmet (Coverage Ledger not 100% unless approved exception) or required layers are missing without approval.
33
+ - Reject when validation evidence is missing/failing (`qfai validate --fail-on error`) or required US/TC/CON coverage obligations are unmet in test-layer policy.
34
34
 
35
35
  ## Deliverables (MANDATORY)
36
36
 
@@ -30,7 +30,7 @@ You MUST enforce the following:
30
30
  - **Plan is binding, but not absolute.**
31
31
  - If reality diverged from plan, downstream work must STOP and escalate via Change Request → approval.
32
32
  - **Do NOT enforce test pyramid ratios as a gate.**
33
- - Reject only when coverage obligations are unmet (Coverage Ledger not 100% unless approved exception) or required layers are missing without approval.
33
+ - Reject when validation evidence is missing/failing (`qfai validate --fail-on error`) or required US/TC/CON coverage obligations are unmet in test-layer policy.
34
34
 
35
35
  ## Deliverables (MANDATORY)
36
36
 
@@ -33,7 +33,7 @@ You MUST enforce the following:
33
33
  - **Plan is binding, but not absolute.**
34
34
  - If reality diverged from plan, downstream work must STOP and escalate via Change Request → approval.
35
35
  - **Do NOT enforce test pyramid ratios as a gate.**
36
- - Reject only when coverage obligations are unmet (Coverage Ledger not 100% unless approved exception) or required layers are missing without approval.
36
+ - Reject when validation evidence is missing/failing (`qfai validate --fail-on error`) or required US/TC/CON coverage obligations are unmet in test-layer policy.
37
37
 
38
38
  ## Deliverables (MANDATORY)
39
39
 
@@ -29,7 +29,7 @@ You MUST enforce the following:
29
29
  - **Plan is binding, but not absolute.**
30
30
  - If reality diverged from plan, downstream work must STOP and escalate via Change Request → approval.
31
31
  - **Do NOT enforce test pyramid ratios as a gate.**
32
- - Reject only when coverage obligations are unmet (Coverage Ledger not 100% unless approved exception) or required layers are missing without approval.
32
+ - Reject when validation evidence is missing/failing (`qfai validate --fail-on error`) or required US/TC/CON coverage obligations are unmet in test-layer policy.
33
33
 
34
34
  ## Deliverables (MANDATORY)
35
35
 
@@ -10,24 +10,24 @@
10
10
  - .qfai/assistant/instructions/\*
11
11
  - .qfai/assistant/instructions/drift-protocol.md (must enforce upstream-change approval)
12
12
  - .qfai/assistant/steering/\*
13
- - .qfai/assistant/steering/test-layers.md (test-layer definitions + required coverage expectations)
14
- - .qfai/specs/spec-\*/delta.md (Decision Records; check rejected)
15
- - Coverage ledgers + evidence + gate results
13
+ - .qfai/assistant/steering/test-layers.md (US/TC/CON obligations and forbidden references)
14
+ - .qfai/specs/spec-\*/09_delta.md (Decision Records; check rejected)
15
+ - Validation evidence and gate results (`qfai validate --fail-on error`)
16
16
 
17
17
  ## Cross-cutting review: Drift Protocol (MANDATORY)
18
18
 
19
19
  You MUST enforce the following:
20
20
 
21
21
  - **No upstream artifact edits without explicit user approval.**
22
- - Upstream artifacts include: discuss/require/spec/refinement outputs, `plan.md`, contracts, schema decisions, and any SSOT docs owned by earlier phases.
23
- - If an upstream change was necessary, you must see a **Change Request** with:
22
+ - Upstream artifacts include discuss/require/spec/planning outputs, contracts, and schema decisions.
23
+ - If an upstream change was necessary, review a Change Request with:
24
24
  - at least 3 options + recommendation,
25
- - explicit **user approval**,
26
- - and evidence that the correct **owner skill** was re-run to apply the change (downstream must not patch upstream directly).
25
+ - explicit user approval,
26
+ - and evidence that the correct owner skill was re-run.
27
27
  - **Plan is binding, but not absolute.**
28
- - If reality diverged from plan, downstream work must STOP and escalate via Change Request → approval.
29
- - **Do NOT enforce test pyramid ratios as a gate.**
30
- - Reject only when coverage obligations are unmet (Coverage Ledger not 100% unless approved exception) or required layers are missing without approval.
28
+ - If reality diverged from plan, downstream work must STOP and escalate via Change Request.
29
+ - **Do NOT enforce test-volume ratios as a gate.**
30
+ - Floors/ratios are signals only; completion gate is validation with zero errors.
31
31
 
32
32
  ## Deliverables (MANDATORY)
33
33
 
@@ -37,13 +37,13 @@ You MUST enforce the following:
37
37
 
38
38
  ## Must-reject conditions
39
39
 
40
- - Do NOT reject solely due to suggested test-volume floors/ratios; use them as signals only. Coverage is the gate.
40
+ - Validation evidence is missing or failing (`qfai validate --fail-on error`)
41
+ - Required `US`/`TC`/`CON-API` coverage obligations are unmet
42
+ - Forbidden references remain (`tests/api/**` or `tests/e2e/**` with `QFAI:SPEC-XXXX:TC-YYYY`)
41
43
  - Upstream artifact changed without explicit user approval + recorded Change Request
42
- - Coverage Ledger missing or not 100% implemented (no approved exception)
43
- - E2E=0 or Integration=0 without DR + approval
44
44
  - Subagent delegation missing when required
45
45
  - delta.md rejected option reintroduced without RE-OPEN DR
46
- - Runtime Gate not executed (when required by prompt)
46
+ - Runtime gate not executed when required by prompt
47
47
 
48
48
  ## Sign-off checklist (Check Last)
49
49
 
@@ -2,49 +2,47 @@
2
2
 
3
3
  ## Mission
4
4
 
5
- - Estimate test volume as a risk signal and detect thin areas.
5
+ - Estimate test volume as risk signals using obligations from specs/contracts.
6
+ - Provide planning hints without turning floors/ratios into completion gates.
6
7
 
7
8
  ## Inputs you must read
8
9
 
9
10
  - .qfai/assistant/instructions/\*
10
11
  - .qfai/assistant/steering/\*
11
12
  - .qfai/specs/spec-\*/09_delta.md (Decision Records; check rejected)
12
- - .qfai/specs/spec-\*/04_Business-Rules.md
13
- - .qfai/specs/spec-\*/05_Examples.md
13
+ - .qfai/specs/spec-\*/02_User-stories.md
14
14
  - .qfai/specs/spec-\*/06_Test-Cases.md
15
- - .qfai/report/specs-coverage/spec-\*.md
16
- - .qfai/report/validate.log
17
- - .qfai/contracts/\*\*
15
+ - .qfai/contracts/api/\*\*
16
+ - .qfai/report/validate.log (if available)
18
17
 
19
18
  ## Deliverables (MANDATORY)
20
19
 
21
20
  - Decision Records referenced (DR-IDs) + rejected check (or RE-OPEN request)
22
- - Risk-signal table (Layer / Raw count / Signal / Evidence / Notes)
23
- - Density-smell findings (for example multi-BR EX rows) and impact summary
24
- - Improvement proposals by perspective (boundary/negative/permission/state)
25
- - BLOCKED list when data is missing
21
+ - Signal table (Layer / Raw count / Signal / Evidence / Notes)
22
+ - Execution-time risk notes and prioritization hints
23
+ - Missing-input list when counts cannot be derived
24
+ - Explicit statement: signals are not completion gates
26
25
  - Evidence summary for `.qfai/evidence/` (gitignored; do not commit)
27
26
 
28
27
  ## Stop conditions (Blockers)
29
28
 
30
29
  - Rejected option would be reintroduced without RE-OPEN DR
31
- - BR/EX/TC source counts cannot be derived and no fallback is available
30
+ - US/TC/CON source counts cannot be derived and no fallback exists
32
31
  - Evidence is missing or incomplete
33
32
 
34
33
  ## Sign-off checklist (Check Last)
35
34
 
36
35
  - [ ] Deliverables are complete
37
36
  - [ ] Evidence is present (gitignored)
38
- - [ ] Risk signals are justified with evidence
39
- - [ ] BLOCKED items are explicit
37
+ - [ ] Signals are justified with explicit evidence
38
+ - [ ] Gate/non-gate boundary is explicit
40
39
 
41
40
  ## Output format (structured)
42
41
 
43
42
  - Decision Records (DR-IDs) / rejected check
44
- - Risk-signal table
45
- - Density-smell findings
46
- - Perspective-based improvement proposals
47
- - BLOCKED list (if any)
43
+ - Signal table
44
+ - Risk notes
45
+ - Missing-input list (if any)
48
46
  - Evidence summary
49
47
  - Open Questions / Risks
50
48
  - Confidence (High/Medium/Low + reason)
@@ -29,7 +29,7 @@ You MUST enforce the following:
29
29
  - **Plan is binding, but not absolute.**
30
30
  - If reality diverged from plan, downstream work must STOP and escalate via Change Request → approval.
31
31
  - **Do NOT enforce test pyramid ratios as a gate.**
32
- - Reject only when coverage obligations are unmet (Coverage Ledger not 100% unless approved exception) or required layers are missing without approval.
32
+ - Reject when validation evidence is missing/failing (`qfai validate --fail-on error`) or required US/TC/CON coverage obligations are unmet in test-layer policy.
33
33
 
34
34
  ## Deliverables (MANDATORY)
35
35
 
@@ -24,8 +24,8 @@ Delegate work to specialized roles to reduce blind spots and improve quality.
24
24
  - **Architect**: design, boundaries, compatibility considerations
25
25
  - **Contract Designer**: contracts (UI/API: YAML, DB: SQL), IDs, indexing implications
26
26
  - **QA Engineer**: risk-based checks, regression scope, quality gate review
27
- - **Test Engineer**: scenario.feature and test scaffolding strategy
28
- - **ATDD Implementers**: E2E/API/Integration implementation per ledger and floors
27
+ - **Test Engineer**: US/TC/CON-API obligations and test scaffolding strategy
28
+ - **ATDD Implementers**: E2E/API/Integration implementation per required coverage (`US` / `TC` / `CON-API`)
29
29
  - **Front-end / Back-end Engineer**: implementation within repo conventions
30
30
  - **UI/UX Reviewer**: layout sanity, interaction usability, and UI guardrail checks
31
31
  - **DevOps/CI Engineer**: verify-pack/CI impacts
@@ -8,14 +8,17 @@ This file defines mandatory change control for all downstream execution phases.
8
8
 
9
9
  Upstream artifacts include, at minimum:
10
10
 
11
- - `spec.md`, `delta.md`, `scenario.feature`, `case-catalogue.md`, `traceability-matrix.md`, `plan.md`
11
+ - `01_Spec.md`, `02_User-stories.md`, `03_Acceptance-Criteria.md`, `04_Business-Rules.md`, `05_Examples.md`, `06_Test-Cases.md`, `07_Decisions.md`, `08_Open-questions.md`, `09_delta.md`
12
+ - `_shared/*` layered artifacts and `11_Contracts.md` (or project-equivalent contract index)
13
+ - `10_Plan.md` and other owner-phase planning outputs
14
+ - Legacy spec-pack SSOT files when present: `spec.md`, `delta.md`, `plan.md`, `traceability-matrix.md`, `scenario.feature`, `case-catalogue.md`, and numbered pack files (for example `01_Spec.md`..`18_delta.md`)
12
15
  - contracts and schema decisions owned by earlier phases
13
16
  - outputs of discuss/require/refinement/planning stages
14
17
 
15
18
  ## Allowed exceptions (minimal whitelist)
16
19
 
17
20
  - `.qfai/evidence/**` append/update
18
- - `traceability-matrix.md` progress status updates when the project workflow explicitly allows downstream updates
21
+ - progress status updates only when the project workflow explicitly allows downstream updates
19
22
 
20
23
  Any exception beyond this list requires explicit user approval.
21
24
 
@@ -0,0 +1,35 @@
1
+ # ATDD Alignment Migration Memo
2
+
3
+ ## Purpose
4
+
5
+ - Migrate ATDD operation from scenario/ledger-centric flow to obligations-driven flow.
6
+ - Keep legacy artifacts compatible while removing them from mandatory completion gates.
7
+
8
+ ## Rule Changes
9
+
10
+ - Old default:
11
+ - `scenario.feature` and coverage ledger were treated as mandatory completion inputs.
12
+ - New default:
13
+ - Required obligations are IDs in specs/contracts:
14
+ - `US-*` -> `tests/e2e/**`
15
+ - `TC-*` -> `tests/integration/**`
16
+ - `CON-API-*` -> `tests/api/**`
17
+ - Completion gate is validation pass with no errors.
18
+ - Floors/ratios are signals only.
19
+
20
+ ## Fast Migration Steps
21
+
22
+ 1. Run validation and collect missing obligations from the report.
23
+ 2. Add required annotations to test files (`US` / `TC` / `CON-API`).
24
+ 3. Move tests into canonical directories:
25
+ - `tests/e2e`
26
+ - `tests/api`
27
+ - `tests/integration`
28
+ 4. Remove forbidden references (`TC` annotations in API/E2E tests).
29
+ 5. Re-run:
30
+ - `qfai validate --fail-on error`
31
+
32
+ ## Legacy Compatibility
33
+
34
+ - `scenario.feature` and old ledger files may remain in the repository.
35
+ - They are optional evidence only and must not be used as completion gates.
@@ -40,7 +40,7 @@ Do not proceed without a declared Change Type.
40
40
 
41
41
  - Read and enforce `.qfai/assistant/steering/test-layers.md`.
42
42
  - Treat floors/ratios as signals, not completion gates.
43
- - Coverage Ledger completeness is the completion gate (or approved exception).
43
+ - Completion gate is `qfai validate --fail-on error` with evidence.
44
44
 
45
45
  ---
46
46
 
@@ -52,7 +52,7 @@ Do not proceed without a declared Change Type.
52
52
  3. Specification refinement (SDD): preflight + `_shared` / `spec-XXXX/01..06`
53
53
  4. Specification planning (SDD): `spec-XXXX/10_Plan.md` (How-only)
54
54
  5. Prototyping (optional): contract-aligned implementation skeleton
55
- 6. Scenario tests (ATDD): runnable scenario tests derived from `scenario.feature`
55
+ 6. Acceptance tests (ATDD): runnable E2E/API/Integration tests derived from specs/contracts obligations (`US` / `TC` / `CON-API`)
56
56
  7. TDD: red/green/refactor loop enforcing spec + tests
57
57
  8. Verify: run quality gates and provide evidence
58
58