qfai 1.9.2 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/README.md +48 -2
  2. package/assets/init/.qfai/assistant/agents/acceptance-test-engineer.md +1 -0
  3. package/assets/init/.qfai/assistant/agents/backend-engineer.md +1 -0
  4. package/assets/init/.qfai/assistant/agents/completion-reviewer.md +13 -2
  5. package/assets/init/.qfai/assistant/agents/delivery-planner.md +9 -0
  6. package/assets/init/.qfai/assistant/agents/frontend-engineer.md +1 -0
  7. package/assets/init/.qfai/assistant/agents/implementation-reviewer.md +6 -0
  8. package/assets/init/.qfai/assistant/agents/orchestrator.md +2 -2
  9. package/assets/init/.qfai/assistant/agents/qa-gatekeeper.md +96 -3
  10. package/assets/init/.qfai/assistant/agents/test-design-analyst.md +20 -3
  11. package/assets/init/.qfai/assistant/catalog/cli-ux-guidelines.md +2 -2
  12. package/assets/init/.qfai/assistant/catalog/spec_required_files.json +2 -1
  13. package/assets/init/.qfai/assistant/catalog/test-layers.md +355 -14
  14. package/assets/init/.qfai/assistant/catalog/worklog-entry.schema.md +165 -0
  15. package/assets/init/.qfai/assistant/constitution/communication.md +1 -1
  16. package/assets/init/.qfai/assistant/constitution/drift-protocol.md +304 -10
  17. package/assets/init/.qfai/assistant/constitution/quality.md +35 -5
  18. package/assets/init/.qfai/assistant/constitution/requirements-decomposition.md +37 -0
  19. package/assets/init/.qfai/assistant/constitution/shared-skill-delegation-baseline.md +244 -8
  20. package/assets/init/.qfai/assistant/constitution/shared-skill-operating-baseline.md +122 -5
  21. package/assets/init/.qfai/assistant/constitution/workflow.md +53 -7
  22. package/assets/init/.qfai/assistant/manifest/agent-catalog.yml +316 -945
  23. package/assets/init/.qfai/assistant/manifest/agent-routing.yml +50 -4
  24. package/assets/init/.qfai/assistant/manifest/review-profiles.yml +9 -0
  25. package/assets/init/.qfai/assistant/process/migrations/v1.4.27-atdd-alignment.md +1 -1
  26. package/assets/init/.qfai/assistant/skills/qfai-atdd/SKILL.md +61 -21
  27. package/assets/init/.qfai/assistant/skills/qfai-atdd/references/test-case-depth-checklist.md +23 -4
  28. package/assets/init/.qfai/assistant/skills/qfai-configure/SKILL.md +15 -7
  29. package/assets/init/.qfai/assistant/skills/qfai-discussion/SKILL.md +8 -4
  30. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/design-md-brand-catalog.md +2 -2
  31. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/discussion-completion-matrix.md +17 -7
  32. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/rcp_footer.md +10 -4
  33. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/review-cycle-playbook.md +1 -1
  34. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/ui-bearing-playbook.md +4 -4
  35. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/ui_ux/review_audit_playbook.md +1 -1
  36. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/ui_ux/trend_scan_playbook.md +1 -1
  37. package/assets/init/.qfai/assistant/skills/qfai-discussion/references/ui_ux_best_practices.md +17 -7
  38. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/01_Context.md +1 -1
  39. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/02_Inception-Deck.md +1 -1
  40. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/03_Story-Workshop.md +11 -3
  41. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/05_Scope.md +5 -2
  42. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/07_NFR.md +1 -1
  43. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/09_Constraints.md +7 -4
  44. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/10_Policy.md +1 -1
  45. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/11_OQ-Register.md +1 -1
  46. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/12_OQ-Resolution-Log.md +1 -1
  47. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/14_Review-Request.md +14 -7
  48. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/99_delta.md +1 -1
  49. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/review/Rxx_reviewer.md +16 -7
  50. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/review/review_request.md +9 -6
  51. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/40_screen_contracts.md +3 -2
  52. package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/50_review_input_bundle.md +4 -2
  53. package/assets/init/.qfai/assistant/skills/qfai-implement/SKILL.md +250 -128
  54. package/assets/init/.qfai/assistant/skills/qfai-implement/references/change-request-reset.md +93 -0
  55. package/assets/init/.qfai/assistant/skills/qfai-implement/references/checkpoint-verification.md +106 -0
  56. package/assets/init/.qfai/assistant/skills/qfai-implement/references/cross-spec-ownership.md +73 -0
  57. package/assets/init/.qfai/assistant/skills/qfai-implement/references/evidence-revision.md +77 -0
  58. package/assets/init/.qfai/assistant/skills/qfai-implement/references/execution-ledger.md +303 -0
  59. package/assets/init/.qfai/assistant/skills/qfai-implement/references/final-checklist.md +19 -0
  60. package/assets/init/.qfai/assistant/skills/qfai-implement/references/finding-classification.md +49 -0
  61. package/assets/init/.qfai/assistant/skills/qfai-implement/references/ledger-preconditions.md +55 -0
  62. package/assets/init/.qfai/assistant/skills/qfai-implement/references/oracle-strength.md +81 -0
  63. package/assets/init/.qfai/assistant/skills/qfai-implement/references/parallelization-policy.md +235 -0
  64. package/assets/init/.qfai/assistant/skills/qfai-implement/references/red-admissibility.md +91 -0
  65. package/assets/init/.qfai/assistant/skills/qfai-implement/references/red-not-observable.md +70 -0
  66. package/assets/init/.qfai/assistant/skills/qfai-implement/references/relevant-test-suite.md +87 -0
  67. package/assets/init/.qfai/assistant/skills/qfai-implement/references/review-artifact-layout.md +31 -0
  68. package/assets/init/.qfai/assistant/skills/qfai-implement/references/round-evidence.md +102 -0
  69. package/assets/init/.qfai/assistant/skills/qfai-implement/references/selector-granularity.md +24 -0
  70. package/assets/init/.qfai/assistant/skills/qfai-implement/references/volume-policy.md +149 -0
  71. package/assets/init/.qfai/assistant/skills/qfai-prototyping/SKILL.md +35 -18
  72. package/assets/init/.qfai/assistant/skills/qfai-prototyping/references/evidence-requirements.md +1 -1
  73. package/assets/init/.qfai/assistant/skills/qfai-prototyping/references/generator-prompt.md +106 -7
  74. package/assets/init/.qfai/assistant/skills/qfai-prototyping/references/handoff.md +40 -11
  75. package/assets/init/.qfai/assistant/skills/qfai-prototyping/references/iteration-loop.md +48 -1
  76. package/assets/init/.qfai/assistant/skills/qfai-prototyping/templates/DESIGN.md.sample +6 -0
  77. package/assets/init/.qfai/assistant/skills/qfai-sdd/SKILL.md +82 -22
  78. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/contract-artifact-rules.md +148 -0
  79. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/rcp_footer.md +10 -4
  80. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/review-cycle-playbook.md +1 -1
  81. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/sdd-execution-playbook.md +4 -2
  82. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/sdd-phase-checklists.md +18 -0
  83. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/sdd-quality-gate.md +44 -3
  84. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/sdd-triage.md +60 -7
  85. package/assets/init/.qfai/assistant/skills/qfai-sdd/references/spec-traceability-rules.md +157 -5
  86. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/change-request.md +125 -0
  87. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/contracts/db-contract.sample.sql +6 -0
  88. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/evidence/sdd-spec.md +92 -0
  89. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/_policies/01_Objective.md +27 -0
  90. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/_policies/02_Initiative.md +30 -0
  91. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/_policies/05_Contracts.md +16 -6
  92. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/_policies/06_Glossary.md +19 -0
  93. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/_policies/07_Constraints.md +25 -0
  94. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/_policies/08_Decisions.md +22 -2
  95. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/_policies/11_Slice-Policy.md +37 -10
  96. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/02_User-stories.md +20 -0
  97. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/03_Acceptance-Criteria.md +19 -0
  98. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/04_Business-Rules.md +32 -3
  99. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/06_Test-Cases.md +56 -0
  100. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/07_Decisions.md +29 -2
  101. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/10_Plan.md +41 -0
  102. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/16_Traceability-ledger.md +58 -0
  103. package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/tdd/test-list.md +56 -0
  104. package/assets/init/.qfai/assistant/skills/qfai-verify/SKILL.md +57 -102
  105. package/assets/init/.qfai/assistant/skills/qfai-verify/references/articles.md +24 -0
  106. package/assets/init/.qfai/assistant/skills/qfai-verify/references/context-load.md +22 -0
  107. package/assets/init/.qfai/assistant/skills/qfai-verify/references/verify-output-contract.md +48 -0
  108. package/assets/init/.qfai/assistant/skills/qfai-verify/templates/verify-evidence.md +48 -0
  109. package/assets/init/.qfai/assistant/skills/web-research/SKILL.md +25 -7
  110. package/assets/init/.qfai/waivers.yml +11 -5
  111. package/assets/init/root/DESIGN.md +6 -0
  112. package/assets/init/root/qfai.config.yaml +15 -12
  113. package/dist/cli/index.cjs +11023 -7139
  114. package/dist/cli/index.cjs.map +1 -1
  115. package/dist/cli/index.mjs +10963 -7080
  116. package/dist/cli/index.mjs.map +1 -1
  117. package/dist/index.cjs +8782 -5257
  118. package/dist/index.cjs.map +1 -1
  119. package/dist/index.d.cts +280 -8
  120. package/dist/index.d.ts +280 -8
  121. package/dist/index.mjs +11776 -8264
  122. package/dist/index.mjs.map +1 -1
  123. package/package.json +18 -19
package/README.md CHANGED
@@ -33,6 +33,28 @@ The agent reads the repository, produces the required artifacts, and iterates un
33
33
  `index.html`, or `interaction.json`.
34
34
  - Calibration SSOT is the calibration pack referenced by `calibrationRef.packPath`.
35
35
 
36
+ ## Installation
37
+
38
+ qfai is published on npm as **`qfai`**. Install it as a dev dependency:
39
+
40
+ ```bash
41
+ npm i -D qfai
42
+ # or: pnpm add -D qfai / yarn add -D qfai
43
+ ```
44
+
45
+ Let the package manager write the `devDependencies` entry. Do not hand-pin a version
46
+ here: `package.json#version` in the published package is the only version source, and a
47
+ number copied from prose goes stale on the next release.
48
+
49
+ > **Do not install from the GitHub repository.** A git specifier such as
50
+ > `"qfai": "github:aganesy/QFAI"` maps the dependency key `qfai` to the private monorepo
51
+ > root — the manifest `name` is irrelevant, so it lands in `node_modules/qfai` regardless.
52
+ > That root ships no `bin` and no built `dist`, so nothing would be runnable or
53
+ > importable. Under npm or yarn a `preinstall` guard refuses the install with an
54
+ > explanatory error rather than completing silently; under pnpm — or any package manager
55
+ > that reports no user agent — it is not caught, so the mistake is yours to avoid. Use the
56
+ > npm package, or run it without installing via `npx qfai@latest <command>`.
57
+
36
58
  ## Quick start
37
59
 
38
60
  > **Windows users:** `qfai init` creates symlinks internally.
@@ -220,7 +242,10 @@ Operational notes.
220
242
  - Skills should delegate work to multiple role-based sub-agents (Planner, Architect, Contract Designer, QA, Code Reviewer, etc.) to emulate a real delivery flow.
221
243
  - Change classification (Primary/Tags) is required in `09_delta.md` and recommended in PRs. See `.qfai/assistant/constitution/change-classification.md`.
222
244
  - Verification planning is recorded in `09_delta.md` (`Verification -> Plan`) and validated in CI (`VFY-*` rules).
223
- - Review gate policies (required/optional layers and reviewers) are defined in `.qfai/assistant/catalog/review-gate.rules.yml`.
245
+ - Review gate policies (required/optional layers, default reviewers, optional
246
+ review modes) are documented in `.qfai/assistant/catalog/review-gate.rules.yml`.
247
+ This catalog is reference material for agents; it is not machine-enforced.
248
+ - Review pack structure — `.qfai/review/review-<YYYYMMDDhhmmssSSS>/{review_request.md,R01_*.md,summary.json}` — is the one layout enforced by validation (`QFAI-REVIEW-*`).
224
249
  - Agent taxonomy and invocation SSOT are defined in `.qfai/assistant/manifest/agent-catalog.yml`, `.qfai/assistant/manifest/agent-routing.yml`, and `.qfai/assistant/manifest/review-profiles.yml`.
225
250
 
226
251
  ## Configuration
@@ -343,6 +368,11 @@ Recommended baseline.
343
368
 
344
369
  Waiver policy.
345
370
 
371
+ - A waiver's `rule:` is the finding's `code`, copied verbatim from
372
+ `.qfai/report/validate.json` — `QFAI-ATDD-112`, `TDDLIST_UNKNOWN_LEVEL`,
373
+ `E_TC_ORPHAN`. Do not strip the `QFAI-` prefix; the stripped form
374
+ (`ATDD-112`) is kept working only for waiver files written against older
375
+ releases.
346
376
  - Use waivers only for `warning` / `info` findings (false positives).
347
377
  - Waivers that target `error` findings are invalid and fail validation (`QFAI-WAIVER-002`).
348
378
  - Expired waivers are reported as warnings (`QFAI-WAIVER-003`) and must be renewed or removed with evidence.
@@ -434,7 +464,8 @@ Typical customizations.
434
464
  │ │ ├── structure.md
435
465
  │ │ ├── tech.md
436
466
  │ │ ├── test-layers.md
437
- │ │ └── ui-definition-protocol.md
467
+ │ │ ├── ui-definition-protocol.md
468
+ │ │ └── worklog-entry.schema.md
438
469
  │ └── waivers.yml
439
470
  └── qfai.config.yaml
440
471
  ```
@@ -443,6 +474,21 @@ Typical customizations.
443
474
  contracts, evidence, reports, reviews, placeholder spec directories, or artifact
444
475
  README files. Those files are created later by QFAI skills when real work exists.
445
476
 
477
+ ### AI work-log surface (`.qfai/steering/`)
478
+
479
+ `qfai init` also creates `.qfai/steering/`, the per-project work-log surface for
480
+ AI coding agents, with a `README.md` and `_templates/entry.md`. Each entry is a
481
+ markdown file with YAML frontmatter, and `npx qfai validate` polices the surface in
482
+ the `sdd` and full profiles via `W-WORKLOG-SCHEMA`, `W-WORKLOG-BROKEN-LINK`,
483
+ `W-WORKLOG-STALE`, `W-PENDING-PROMOTION` and `R-HANDOFF-INCOMPLETE`.
484
+
485
+ The frontmatter contract and the **per-kind write trigger** — which `kind` an
486
+ agent writes when — are in the seeded
487
+ `.qfai/assistant/catalog/worklog-entry.schema.md`.
488
+
489
+ Note that `.qfai/steering/` (the work-log surface) is a different directory from
490
+ the legacy `.qfai/assistant/steering/` (the pre-recut assistant path).
491
+
446
492
  Integration wrappers are also generated for immediate use:
447
493
 
448
494
  - Agents/Codex VS Code: `.agents/skills/**`
@@ -32,6 +32,7 @@ tools: [Read, Write, Edit, Glob, Grep, Bash]
32
32
  - Acceptance test plan and implemented coverage
33
33
  - Mapping from US / TC / CON-API to test assets
34
34
  - Execution proof and evidence summary
35
+ - TDD ledger Status + Evidence entry for each item processed, returned to the orchestrator (which owns the `test-list.md` write; do not edit that file directly)
35
36
  - Gaps and follow-up actions
36
37
 
37
38
  ## Stop conditions
@@ -35,6 +35,7 @@ tools: [Read, Write, Edit, Glob, Grep, Bash]
35
35
  - Backend implementation summary
36
36
  - Changed files and affected contracts
37
37
  - Local verification notes
38
+ - TDD ledger Status + Evidence entry for each item processed, returned to the orchestrator (which owns the `test-list.md` write; do not edit that file directly)
38
39
  - Evidence summary for `.qfai/evidence/`
39
40
  - Notes on invariants, validation, and why added abstractions/configuration are necessary now
40
41
 
@@ -12,7 +12,7 @@ tools: [Read, Glob, Grep, Bash]
12
12
 
13
13
  ## Domain Responsibilities
14
14
 
15
- - Return pass/fail only with actionable rework instructions.
15
+ - Return only PASS or REVISE, with actionable rework instructions on REVISE.
16
16
  - Enforce validate evidence, required coverage obligations, and no self-approval.
17
17
  - Verify rejected options are not reintroduced without RE-OPEN.
18
18
 
@@ -27,20 +27,31 @@ tools: [Read, Glob, Grep, Bash]
27
27
 
28
28
  ## Deliverables
29
29
 
30
- - PASS or FAIL with concrete rework list
30
+ - PASS or REVISE with concrete rework list
31
31
  - Evidence summary and gaps
32
32
  - Open risks or blocking assumptions
33
33
 
34
34
  ## Stop conditions
35
35
 
36
36
  - Required evidence, governing specs, or target artifacts are missing.
37
+ - "Required evidence" means the evidence this review audits — the phase-authored record produced
38
+ before the review was requested. A completion record that this review's own verdict will be
39
+ written into is not yet expected to be finalized; its missing verdict fields are not a stop
40
+ condition and not a blocking finding. Report an unfinalized completion record as a sequencing
41
+ note, not as a gap.
37
42
  - The request requires implementation or file editing instead of independent review.
38
43
  - The issue falls outside this review domain and must be rerouted to another specialist first.
44
+ - The finding would add a product obligation upstream never asked for. Do not raise it as blocking;
45
+ raise it as an advisory finding plus a Change Request proposal per
46
+ `.qfai/assistant/constitution/drift-protocol.md#reviewer-originated-obligations`. A defect you can
47
+ demonstrate from the changed artifacts (correctness, security / data integrity, or a repository
48
+ quality gate) is NOT in this category: it stays blocking and traces to its `defect:*` class.
39
49
 
40
50
  ## Sign-off
41
51
 
42
52
  - [ ] Review verdict is explicit
43
53
  - [ ] Findings cite concrete artifacts or evidence
54
+ - [ ] Every finding declares `Severity:` and `Traces to:`; no blocking finding has `Traces to: none`
44
55
  - [ ] Required gates and residual risks are recorded
45
56
 
46
57
  ## When to use
@@ -17,6 +17,13 @@ tools: [Read, Write, Edit, Glob, Grep, Bash]
17
17
  - Define parallel-safe slices and post-merge verification conditions.
18
18
  - Own schedule, priority, and risk trade-offs across roles.
19
19
  - Produce actionable work orders for workers and reviewers.
20
+ - Own **item selection and item scope** in a TDD micro-cycle, and Red-Green-Refactor phase ordering. Raise a scope REVISE **before** RED/GREEN evidence is submitted to `qa-gatekeeper`; do not
21
+ re-litigate item scope after `qa-gatekeeper` has passed the observation for that round — open a new ledger row instead.
22
+
23
+ ## Ownership boundaries
24
+
25
+ - `qa-gatekeeper` owns RED/GREEN **observation** evidence (did the test fail or pass for the expected reason). This role does not overrule that verdict, and that verdict does not widen item scope.
26
+ See `.qfai/assistant/skills/qfai-implement/SKILL.md#precedence-between-delivery-planner-and-qa-gatekeeper`.
20
27
 
21
28
  ## Inputs you must read
22
29
 
@@ -24,6 +31,8 @@ tools: [Read, Write, Edit, Glob, Grep, Bash]
24
31
  - .qfai/assistant/{manifest,catalog}/\*\*
25
32
  - .qfai/specs/spec-\*/09_delta.md
26
33
  - .qfai/specs/spec-\*/01_Spec.md
34
+ - `.qfai/specs/spec-*/tdd/test-list.md` — the execution ledger this role selects
35
+ the next item from and whose Red-Green-Refactor ordering it enforces
27
36
  - .qfai/discussion/discussion-\*/04_Sources.md
28
37
  - .qfai/discussion/discussion-\*/06_REQ.md
29
38
  - .qfai/discussion/discussion-\*/11_OQ-Register.md
@@ -34,6 +34,7 @@ tools: [Read, Write, Edit, Glob, Grep, Bash]
34
34
  - Frontend implementation summary
35
35
  - Changed files and affected flows
36
36
  - Local verification notes
37
+ - TDD ledger Status + Evidence entry for each item processed, returned to the orchestrator (which owns the `test-list.md` write; do not edit that file directly)
37
38
  - Evidence summary for `.qfai/evidence/`
38
39
  - Notes on how simplicity, necessity, and reuse were preserved in the chosen implementation
39
40
 
@@ -45,11 +45,17 @@ tools: [Read, Glob, Grep, Bash]
45
45
  - The request requires implementation or file editing instead of independent review.
46
46
  - The issue falls outside this review domain and must be rerouted to another specialist first.
47
47
  - The review would rely on speculative future requirements instead of current scope and evidence.
48
+ - The finding would add a product obligation upstream never asked for. Do not raise it as blocking;
49
+ raise it as an advisory finding plus a Change Request proposal per
50
+ `.qfai/assistant/constitution/drift-protocol.md#reviewer-originated-obligations`. A defect you can
51
+ demonstrate from the changed artifacts (correctness, security / data integrity, or a repository
52
+ quality gate) is NOT in this category: it stays blocking and traces to its `defect:*` class.
48
53
 
49
54
  ## Sign-off
50
55
 
51
56
  - [ ] Review verdict is explicit
52
57
  - [ ] Findings cite concrete artifacts or evidence
58
+ - [ ] Every finding declares `Severity:` and `Traces to:`; no blocking finding has `Traces to: none`
53
59
  - [ ] Required gates and residual risks are recorded
54
60
 
55
61
  ## When to use
@@ -23,7 +23,7 @@ tools: [Read, Write, Edit, Glob, Grep, Bash]
23
23
  - .qfai/assistant/constitution/\*\*
24
24
  - .qfai/assistant/{manifest,catalog}/\*\*
25
25
  - .qfai/assistant/catalog/test-layers.md (SSOT for hard coverage obligations)
26
- - .qfai/specs/spec-\*/09_delta.md (Decision Records; check rejected)
26
+ - .qfai/specs/spec-\*/07_Decisions.md and .qfai/specs/\_policies/08_Decisions.md (Decision Records, DR-\*; check rejected)
27
27
  - Prompt-specific artifacts (traceability, validation evidence, optional legacy scenario/ledger artifacts)
28
28
 
29
29
  ## Deliverables (MANDATORY)
@@ -37,7 +37,7 @@ tools: [Read, Write, Edit, Glob, Grep, Bash]
37
37
  ## Stop conditions
38
38
 
39
39
  - Subagent delegation missing when required
40
- - Validation gate evidence missing/failing (`qfai validate --fail-on error`)
40
+ - Validation gate evidence missing/failing (`npx qfai validate --fail-on error`)
41
41
  - Required hard obligations in `test-layers.md` are unmet
42
42
  - Reviewer sign-off missing
43
43
  - Rejected option would be reintroduced without RE-OPEN DR
@@ -17,16 +17,104 @@ tools: [Read, Glob, Grep, Bash]
17
17
  - Audit prototyping coverage evidence and unresolved spec coverage.
18
18
  - Treat density or volume smells as review signals, not standalone hard gates.
19
19
  - Verify test-case quality depth using the Coverage Depth Matrix (see below).
20
+ - Own RED/GREEN **observation** evidence in a TDD micro-cycle: did the test fail (or pass) for the expected reason.
21
+
22
+ ## Ownership boundaries
23
+
24
+ - `delivery-planner` owns **item selection and item scope** — whether a ledger row's selector is a sufficient slice of its `TC-*` obligation. Do not adjudicate item scope here; a PASS on observation
25
+ evidence is explicitly scoped to that observation and never widens or ratifies item scope. See `.qfai/assistant/skills/qfai-implement/SKILL.md#precedence-between-delivery-planner-and-qa-gatekeeper`.
26
+ - Refuse to evaluate RED/GREEN evidence while an unresolved `delivery-planner` scope REVISE is open on the same item.
27
+
28
+ ## Oracle Strength Check (MUST)
29
+
30
+ GREEN is `exit code == 0`. That does not say the pass depends on the behaviour
31
+ the item owns, and nothing downstream re-asks: coverage is annotation presence
32
+ and the Depth Matrix counts case categories. A test that cannot fail otherwise
33
+ clears every gate.
34
+
35
+ Require an `Oracle proof` on each item and **reject** it when:
36
+
37
+ - the mutation is outside the code the item owns — breaking a shared helper
38
+ proves the helper is used, not that this test discriminates;
39
+ - the mutation is a syntax error, a thrown "not implemented", or a deleted
40
+ export — that is a load failure, not a discriminating failure;
41
+ - the failing output names a selector other than the row's;
42
+ - the recorded command differs from the `GREEN command`.
43
+
44
+ `equivalent-mutant` is acceptable **only** when the named contract clause is
45
+ genuinely weaker than the obligation. It is an upstream gap: route it as an
46
+ advisory / Change Request, do not send the implementer to strengthen an
47
+ assertion past the contract — that is reviewer-originated scope, which
48
+ `drift-protocol.md` forbids. Full criteria and the weak-oracle shapes:
49
+ `.qfai/assistant/skills/qfai-implement/references/oracle-strength.md`.
50
+
51
+ ## RED/GREEN Observation Gate (MUST)
52
+
53
+ This is the gate `qfai-implement` routes here as blocking, per ledger row. Judge
54
+ the row's own evidence; nothing in the calling work order substitutes for it.
55
+
56
+ **Accept a RED** only when all hold:
57
+
58
+ - the test module loaded — the failure is not a collection, import, syntax,
59
+ missing-symbol or fixture error;
60
+ - an assertion (or expected-exception check) inside the row's own `Selector`
61
+ raised it, and the message names the predicate the row owns;
62
+ - the recorded output retains that assertion message and its location;
63
+ - when the `Selector` holds several entries, each entry's failure was observed
64
+ separately. One aggregate run is not a RED for several entries.
65
+
66
+ **Accept a GREEN** only when the same command shape ran after the production
67
+ change and the recorded output shows the row's own selector passing. A full-suite
68
+ pass that does not name the row's selector is not a GREEN for that row.
69
+
70
+ **Never accept as a substitute** for a captured failing run of the item's own
71
+ test:
72
+
73
+ - a narrative claim that the test failed, in any artifact, including a commit
74
+ message written by the implementing agent — that is self-attestation, which is
75
+ what this gate exists to prevent;
76
+ - a load error standing in for an assertion failure;
77
+ - evidence copied from a previous round or a sibling row;
78
+ - "the suite is green" in place of the row's own GREEN.
79
+
80
+ The one legitimate absence is the _RED not observable_ path: the obligation is
81
+ already satisfied by a sibling row, so the correct test passes first run. Then
82
+ require `Satisfied-by`, `Falsifiability command` and `Falsifiability result`
83
+ instead — never both forms, never neither. See
84
+ `.qfai/assistant/skills/qfai-implement/references/red-not-observable.md` and
85
+ `.qfai/assistant/skills/qfai-implement/references/red-admissibility.md`.
86
+
87
+ Verdict scope: a PASS covers the observation for that round and nothing else. It
88
+ does not ratify item scope and does not clear the completion gate.
20
89
 
21
90
  ## Test Case Quality Depth Check (MUST)
22
91
 
23
92
  In addition to traceability-based coverage (US/TC/CON-API existence), verify the **depth** of test cases:
24
93
 
25
- - Confirm a Coverage Depth Matrix exists (produced by `test-design-analyst`). If missing, return FAIL.
94
+ - Confirm a Coverage Depth Matrix exists (produced by `test-design-analyst`). Missing matrix: REVISE from the ATDD review cycle onward; on an SDD review cycle record it as a finding. See the scope note.
26
95
  - Check that each US/TC has test cases for at minimum: normal path AND error/failure path.
27
96
  - Flag any US/TC that has only normal-path test cases as a coverage gap.
28
97
  - Reference: `.qfai/assistant/skills/qfai-atdd/references/test-case-depth-checklist.md`
29
- - This check is a review signal (not a hard gate that blocks validation), but unjustified gaps MUST be documented as findings.
98
+ - Which verdict applies depends on the review cycle, per the scope note below.
99
+ On an **SDD** cycle this check is a review signal, not a hard gate that blocks validation.
100
+ From the **ATDD** cycle onward a missing matrix — or one whose ❌ cells are unjustified — is a REVISE.
101
+ Either way, unjustified gaps MUST be documented as findings.
102
+
103
+ ### Scope of this check
104
+
105
+ The Coverage Depth Matrix is an **ATDD-stage artifact**: it is defined in
106
+ `.qfai/assistant/skills/qfai-atdd/references/test-case-depth-checklist.md`, listed as an ATDD
107
+ Mandatory Output,
108
+ and written into `.qfai/evidence/atdd-<spec-id>.md`. `qfai-sdd` neither defines its layout nor
109
+ ships a section for it, so:
110
+
111
+ - Apply this check from the **ATDD review cycle onward**, where
112
+ `.qfai/assistant/skills/qfai-atdd/SKILL.md` lists
113
+ the matrix under both Mandatory Outputs and Not-done criteria. A missing matrix is a REVISE there,
114
+ and so is one whose ❌ cells are unjustified.
115
+ - Do NOT evaluate it against an SDD spec pack that has no tests yet. On an SDD review cycle,
116
+ assess depth directly from `06_Test-Cases.md` (normal path plus error/boundary coverage per
117
+ AC) and record any gap as a finding, without requiring the matrix format.
30
118
 
31
119
  ## Inputs you must read
32
120
 
@@ -35,13 +123,18 @@ In addition to traceability-based coverage (US/TC/CON-API existence), verify the
35
123
  - .qfai/assistant/{manifest,catalog}/\*\*
36
124
  - .qfai/assistant/catalog/test-layers.md
37
125
  - .qfai/specs/spec-\*/09_delta.md
126
+ - `.qfai/specs/spec-*/tdd/test-list.md` — the ledger row under review
127
+ - `.qfai/evidence/implement-<spec-id>.md` — the per-item RED/GREEN evidence this
128
+ role adjudicates. Both are listed because the Stop condition below ("target
129
+ artifacts are missing") is not checkable against an artifact this role was
130
+ never told to open.
38
131
  - `.qfai/report/validate.log`
39
132
  - `.qfai/report/specs-coverage/spec-*.md`
40
133
  - Runtime evidence and prototyping evidence artifacts
41
134
 
42
135
  ## Deliverables
43
136
 
44
- - Gate decision (PASS / FAIL) with rationale
137
+ - Gate decision (PASS / REVISE) with rationale
45
138
  - Hard gate status and required fixes
46
139
  - Evidence summary and unresolved quality gaps
47
140
 
@@ -17,16 +17,30 @@ tools: [Read, Write, Edit, Glob, Grep, Bash]
17
17
  - Estimate test volume as a planning signal, not a hard gate.
18
18
  - Prevent unit/component scope creep and ambiguous layer ownership.
19
19
  - Evaluate test-case depth using the structured checklist (see reference below).
20
- - Produce a Coverage Depth Matrix for each spec to expose gaps in boundary values, error paths, edge cases, and combinatorial scenarios.
20
+ - Produce a Coverage Depth Matrix per spec from the ATDD stage onward, exposing gaps in boundary values, error paths, edge cases,
21
+ and combinatorial scenarios. During SDD, report the same gaps as findings instead — see the stage split below.
21
22
 
22
23
  ## Test Case Quality Depth (MUST)
23
24
 
24
25
  When reviewing or producing test cases, apply the checklist in `.qfai/assistant/skills/qfai-atdd/references/test-case-depth-checklist.md`.
25
26
 
27
+ Read the stage split first: the checklist's full category set and the Coverage Depth Matrix are ATDD-stage obligations. `qfai-sdd` neither
28
+ defines the matrix layout nor ships an artifact that holds it, and the tests do not exist yet, so the SDD rules below replace them.
29
+
30
+ From the ATDD stage onward:
31
+
26
32
  - For each US/TC, verify that test cases exist for: normal path, error path, boundary values, special values, state transitions, and combinatorial scenarios.
27
33
  - Produce the Coverage Depth Matrix as a required deliverable. Flag any ❌ cells as gaps.
28
34
  - Test cases covering only normal (happy) paths are INCOMPLETE. Return REVISE with specific missing scenarios.
29
- - When business rules (BR-\*) exist, verify each BR has at least one positive and one negative test case.
35
+
36
+ During SDD:
37
+
38
+ - Require normal path plus error/boundary coverage per AC, read directly from `06_Test-Cases.md`.
39
+ - Record any further depth gap (special values, state transitions, combinatorial) as a finding.
40
+ - Do NOT produce the matrix, and do NOT return REVISE solely because the matrix is absent or because
41
+ special / state-transition / combinatorial cases are not yet enumerated.
42
+
43
+ At both stages: when business rules (BR-\*) exist, verify each BR has at least one positive and one negative test case.
30
44
 
31
45
  ## Inputs you must read
32
46
 
@@ -43,7 +57,10 @@ When reviewing or producing test cases, apply the checklist in `.qfai/assistant/
43
57
 
44
58
  - Coverage plan and layer ownership
45
59
  - Test-case quality and traceability findings
46
- - **Coverage Depth Matrix** (per spec, using the template in the depth checklist reference)
60
+ - **Coverage Depth Matrix** (per spec, using the template in the depth checklist reference).
61
+ Destination: `.qfai/evidence/atdd-<spec-id>.md` from the ATDD stage onward. During SDD there is
62
+ no evidence artifact that holds it, so report depth gaps as findings instead of producing the
63
+ matrix format.
47
64
  - Volume estimate and risk notes
48
65
  - Scope-boundary decisions for tests
49
66
 
@@ -1,11 +1,11 @@
1
1
  # CLI UX Guidelines
2
2
 
3
- QFAI が定義する、`qfai validate` の UI/UX 関連出力ガイドライン。
3
+ QFAI が定義する、`npx qfai validate` の UI/UX 関連出力ガイドライン。
4
4
 
5
5
  ## Output Format
6
6
 
7
7
  - Issue メッセージにタイムスタンプやランダム値を含めない(冪等性確保)
8
- - `## Auto Check Results` — `qfai validate` による自動チェック結果セクション
8
+ - `## Auto Check Results` — `npx qfai validate` による自動チェック結果セクション
9
9
  - `## Manual Review Results` — product-surface-reviewer による手動レビュー結果セクション
10
10
 
11
11
  ## Error Message Format
@@ -21,6 +21,7 @@
21
21
  "07_Constraints.md",
22
22
  "08_Decisions.md",
23
23
  "09_Open-questions.md",
24
- "10_delta.md"
24
+ "10_delta.md",
25
+ "11_Slice-Policy.md"
25
26
  ]
26
27
  }