qfai 1.9.2 → 1.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +67 -6
- package/assets/init/.qfai/assistant/README.md +27 -0
- package/assets/init/.qfai/assistant/agents/acceptance-test-engineer.md +1 -0
- package/assets/init/.qfai/assistant/agents/backend-engineer.md +1 -0
- package/assets/init/.qfai/assistant/agents/completion-reviewer.md +29 -2
- package/assets/init/.qfai/assistant/agents/delivery-planner.md +17 -0
- package/assets/init/.qfai/assistant/agents/frontend-engineer.md +1 -0
- package/assets/init/.qfai/assistant/agents/implementation-reviewer.md +17 -0
- package/assets/init/.qfai/assistant/agents/orchestrator.md +2 -2
- package/assets/init/.qfai/assistant/agents/qa-gatekeeper.md +183 -5
- package/assets/init/.qfai/assistant/agents/test-design-analyst.md +22 -3
- package/assets/init/.qfai/assistant/catalog/cli-ux-guidelines.md +2 -2
- package/assets/init/.qfai/assistant/catalog/spec_required_files.json +2 -1
- package/assets/init/.qfai/assistant/catalog/test-layers-ci-lanes.md +60 -0
- package/assets/init/.qfai/assistant/catalog/test-layers.md +430 -13
- package/assets/init/.qfai/assistant/catalog/worklog-entry.schema.md +165 -0
- package/assets/init/.qfai/assistant/constitution/communication.md +1 -1
- package/assets/init/.qfai/assistant/constitution/constitution.md +1 -1
- package/assets/init/.qfai/assistant/constitution/drift-protocol.md +359 -10
- package/assets/init/.qfai/assistant/constitution/quality.md +35 -5
- package/assets/init/.qfai/assistant/constitution/requirements-decomposition.md +37 -0
- package/assets/init/.qfai/assistant/constitution/shared-skill-delegation-baseline.md +419 -8
- package/assets/init/.qfai/assistant/constitution/shared-skill-operating-baseline.md +122 -5
- package/assets/init/.qfai/assistant/constitution/workflow.md +53 -7
- package/assets/init/.qfai/assistant/manifest/agent-catalog.yml +439 -946
- package/assets/init/.qfai/assistant/manifest/agent-routing.yml +116 -4
- package/assets/init/.qfai/assistant/manifest/review-profiles.yml +9 -0
- package/assets/init/.qfai/assistant/process/migrations/v1.4.27-atdd-alignment.md +1 -1
- package/assets/init/.qfai/assistant/skills/qfai-atdd/SKILL.md +150 -53
- package/assets/init/.qfai/assistant/skills/qfai-atdd/references/credential-reuse.md +146 -0
- package/assets/init/.qfai/assistant/skills/qfai-atdd/references/red-provenance.md +456 -0
- package/assets/init/.qfai/assistant/skills/qfai-atdd/references/review-fix-rounds.md +128 -0
- package/assets/init/.qfai/assistant/skills/qfai-atdd/references/scaffolding.md +29 -0
- package/assets/init/.qfai/assistant/skills/qfai-atdd/references/shared-test-artifacts.md +96 -0
- package/assets/init/.qfai/assistant/skills/qfai-atdd/references/stale-manifest.md +34 -0
- package/assets/init/.qfai/assistant/skills/qfai-atdd/references/test-case-depth-checklist.md +52 -5
- package/assets/init/.qfai/assistant/skills/qfai-configure/SKILL.md +16 -8
- package/assets/init/.qfai/assistant/skills/qfai-discussion/SKILL.md +8 -4
- package/assets/init/.qfai/assistant/skills/qfai-discussion/references/design-md-brand-catalog.md +2 -2
- package/assets/init/.qfai/assistant/skills/qfai-discussion/references/discussion-completion-matrix.md +17 -7
- package/assets/init/.qfai/assistant/skills/qfai-discussion/references/rcp_footer.md +10 -4
- package/assets/init/.qfai/assistant/skills/qfai-discussion/references/review-cycle-playbook.md +5 -1
- package/assets/init/.qfai/assistant/skills/qfai-discussion/references/ui-bearing-playbook.md +4 -4
- package/assets/init/.qfai/assistant/skills/qfai-discussion/references/ui_ux/review_audit_playbook.md +1 -1
- package/assets/init/.qfai/assistant/skills/qfai-discussion/references/ui_ux/trend_scan_playbook.md +1 -1
- package/assets/init/.qfai/assistant/skills/qfai-discussion/references/ui_ux_best_practices.md +17 -7
- package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/01_Context.md +1 -1
- package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/02_Inception-Deck.md +1 -1
- package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/03_Story-Workshop.md +11 -3
- package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/05_Scope.md +5 -2
- package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/07_NFR.md +1 -1
- package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/09_Constraints.md +7 -4
- package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/10_Policy.md +1 -1
- package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/11_OQ-Register.md +1 -1
- package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/12_OQ-Resolution-Log.md +1 -1
- package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/14_Review-Request.md +14 -7
- package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/99_delta.md +1 -1
- package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/review/Rxx_reviewer.md +16 -7
- package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/review/review_request.md +9 -6
- package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/review/summary.json +2 -0
- package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/40_screen_contracts.md +3 -2
- package/assets/init/.qfai/assistant/skills/qfai-discussion/templates/uiux/50_review_input_bundle.md +4 -2
- package/assets/init/.qfai/assistant/skills/qfai-implement/SKILL.md +252 -130
- package/assets/init/.qfai/assistant/skills/qfai-implement/references/change-request-reset.md +93 -0
- package/assets/init/.qfai/assistant/skills/qfai-implement/references/checkpoint-verification.md +210 -0
- package/assets/init/.qfai/assistant/skills/qfai-implement/references/cross-spec-ownership.md +73 -0
- package/assets/init/.qfai/assistant/skills/qfai-implement/references/evidence-revision.md +291 -0
- package/assets/init/.qfai/assistant/skills/qfai-implement/references/execution-ledger.md +389 -0
- package/assets/init/.qfai/assistant/skills/qfai-implement/references/final-checklist.md +28 -0
- package/assets/init/.qfai/assistant/skills/qfai-implement/references/finding-classification.md +49 -0
- package/assets/init/.qfai/assistant/skills/qfai-implement/references/ledger-preconditions.md +55 -0
- package/assets/init/.qfai/assistant/skills/qfai-implement/references/oracle-strength.md +81 -0
- package/assets/init/.qfai/assistant/skills/qfai-implement/references/parallelization-policy.md +235 -0
- package/assets/init/.qfai/assistant/skills/qfai-implement/references/red-admissibility.md +91 -0
- package/assets/init/.qfai/assistant/skills/qfai-implement/references/red-not-observable.md +112 -0
- package/assets/init/.qfai/assistant/skills/qfai-implement/references/relevant-test-suite.md +87 -0
- package/assets/init/.qfai/assistant/skills/qfai-implement/references/review-artifact-layout.md +44 -0
- package/assets/init/.qfai/assistant/skills/qfai-implement/references/round-evidence.md +118 -0
- package/assets/init/.qfai/assistant/skills/qfai-implement/references/selector-granularity.md +24 -0
- package/assets/init/.qfai/assistant/skills/qfai-implement/references/upstream-artifact-ordering.md +33 -0
- package/assets/init/.qfai/assistant/skills/qfai-implement/references/volume-policy.md +149 -0
- package/assets/init/.qfai/assistant/skills/qfai-prototyping/SKILL.md +35 -18
- package/assets/init/.qfai/assistant/skills/qfai-prototyping/references/evidence-requirements.md +1 -1
- package/assets/init/.qfai/assistant/skills/qfai-prototyping/references/generator-prompt.md +106 -7
- package/assets/init/.qfai/assistant/skills/qfai-prototyping/references/handoff.md +40 -11
- package/assets/init/.qfai/assistant/skills/qfai-prototyping/references/iteration-loop.md +48 -1
- package/assets/init/.qfai/assistant/skills/qfai-prototyping/templates/DESIGN.md.sample +6 -0
- package/assets/init/.qfai/assistant/skills/qfai-sdd/SKILL.md +87 -22
- package/assets/init/.qfai/assistant/skills/qfai-sdd/references/contract-artifact-rules.md +148 -0
- package/assets/init/.qfai/assistant/skills/qfai-sdd/references/rcp_footer.md +10 -4
- package/assets/init/.qfai/assistant/skills/qfai-sdd/references/review-cycle-playbook.md +5 -1
- package/assets/init/.qfai/assistant/skills/qfai-sdd/references/sdd-execution-playbook.md +4 -2
- package/assets/init/.qfai/assistant/skills/qfai-sdd/references/sdd-phase-checklists.md +18 -0
- package/assets/init/.qfai/assistant/skills/qfai-sdd/references/sdd-quality-gate.md +44 -3
- package/assets/init/.qfai/assistant/skills/qfai-sdd/references/sdd-triage.md +60 -7
- package/assets/init/.qfai/assistant/skills/qfai-sdd/references/spec-traceability-rules.md +171 -6
- package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/change-request.md +125 -0
- package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/contracts/db-contract.sample.sql +6 -0
- package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/evidence/sdd-spec.md +92 -0
- package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/_policies/01_Objective.md +27 -0
- package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/_policies/02_Initiative.md +30 -0
- package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/_policies/05_Contracts.md +16 -6
- package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/_policies/06_Glossary.md +19 -0
- package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/_policies/07_Constraints.md +25 -0
- package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/_policies/08_Decisions.md +22 -2
- package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/_policies/11_Slice-Policy.md +37 -10
- package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/02_User-stories.md +20 -0
- package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/03_Acceptance-Criteria.md +19 -0
- package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/04_Business-Rules.md +32 -3
- package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/06_Test-Cases.md +56 -0
- package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/07_Decisions.md +29 -2
- package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/10_Plan.md +41 -0
- package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/16_Traceability-ledger.md +58 -0
- package/assets/init/.qfai/assistant/skills/qfai-sdd/templates/specs/spec/tdd/test-list.md +56 -0
- package/assets/init/.qfai/assistant/skills/qfai-verify/SKILL.md +57 -102
- package/assets/init/.qfai/assistant/skills/qfai-verify/references/articles.md +24 -0
- package/assets/init/.qfai/assistant/skills/qfai-verify/references/context-load.md +22 -0
- package/assets/init/.qfai/assistant/skills/qfai-verify/references/verify-output-contract.md +48 -0
- package/assets/init/.qfai/assistant/skills/qfai-verify/templates/verify-evidence.md +48 -0
- package/assets/init/.qfai/assistant/skills/web-research/SKILL.md +25 -7
- package/assets/init/.qfai/waivers.yml +11 -5
- package/assets/init/root/.github/workflows/qfai-tests.yml +318 -0
- package/assets/init/root/.github/workflows/qfai-validate.yml +327 -24
- package/assets/init/root/DESIGN.md +6 -0
- package/assets/init/root/qfai.config.yaml +15 -12
- package/dist/cli/index.cjs +20646 -13620
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.mjs +22101 -15061
- package/dist/cli/index.mjs.map +1 -1
- package/dist/index.cjs +13954 -8829
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +423 -14
- package/dist/index.d.ts +423 -14
- package/dist/index.mjs +9330 -4224
- package/dist/index.mjs.map +1 -1
- package/package.json +22 -19
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
# Execution Ledger: test-list.md
|
|
2
|
+
|
|
3
|
+
The execution ledger at `.qfai/specs/<spec-id>/tdd/test-list.md` is the single record of what
|
|
4
|
+
`/qfai-implement` has done and may still do. This file holds its schema and its status rules.
|
|
5
|
+
|
|
6
|
+
## Required columns
|
|
7
|
+
|
|
8
|
+
| Column | Description |
|
|
9
|
+
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
10
|
+
| TDD-ID | Unique identifier for the TDD item (e.g., TDD-0001) |
|
|
11
|
+
| TC-Refs | References to test cases from `06_Test-Cases.md`. Belongs on `Layer = Unit` / `Component` / `Integration` rows |
|
|
12
|
+
| Layer | Test layer. Legal values: `Unit`, `Component`, `Integration`, `API`, `E2E` |
|
|
13
|
+
| Test file | Path to the test file |
|
|
14
|
+
| Selector | Test selector(s) for targeted execution — one entry, a comma-separated list, or a glob pattern |
|
|
15
|
+
| Status | Current lifecycle status |
|
|
16
|
+
| DR-ID | Decision Record / Change Request IDs, comma-separated: a `DR-*` is required for `exception` rows, a `CR-*` for a row reset by an approved Change Request and is retained through that row's later statuses. A row swept out of `exception` by `exception -> todo` **keeps** the anomaly's `DR-*` — that is the only record of why it was parked. **A row that enters `exception` again records a new `DR-*` for the new anomaly**, appended, not substituted: the retained one documents an anomaly already resolved, and `TDDLIST_EXCEPTION_MISSING_DR` only asks that the cell be non-empty and its tokens resolvable, so the stale id alone would pass the gate while the current anomaly has no Decision Record at all. Blank otherwise |
|
|
17
|
+
| Evidence | The RED/GREEN outcome in one word each, plus an anchor into the evidence file this row's `Layer` owns — `.qfai/evidence/implement-<spec-id>.md`, or `.qfai/evidence/atdd-<spec-id>.md` for an `E2E` / `API` / `Integration` row (see "ATDD-owned rows"). **Not** the commands and output themselves — see "Evidence cell contract" below |
|
|
18
|
+
|
|
19
|
+
## Declared seam column (optional, required for parallel dispatch)
|
|
20
|
+
|
|
21
|
+
| Column | Description |
|
|
22
|
+
| ------------- | ------------------------------------------------------------------------------------------ |
|
|
23
|
+
| Owning module | The production module this row will write, as a repo-relative path or a dotted module path |
|
|
24
|
+
|
|
25
|
+
`Owning module` is a **declaration, not an observation**, and that is the whole
|
|
26
|
+
point: it exists before the code does.
|
|
27
|
+
|
|
28
|
+
The parallel-dispatch gate asks whether two items write the same source module.
|
|
29
|
+
Under RED-first the production module does not exist when `delivery-planner`
|
|
30
|
+
has to answer, and the only path-valued required column is `Test file` — two
|
|
31
|
+
items trivially have independent test files and land on the same production
|
|
32
|
+
module. So the planner had nothing to evaluate against, and
|
|
33
|
+
`parallelization-policy.md`'s "cannot be explained with concrete file/module
|
|
34
|
+
evidence" asked for exactly what test-first withholds.
|
|
35
|
+
|
|
36
|
+
- Fill it at ledger-authoring time (`/qfai-sdd` Phase 2b) from the TC's parent
|
|
37
|
+
`BR`, which already names the behaviour's home.
|
|
38
|
+
- One module per row. A row that would honestly need two is a row that should
|
|
39
|
+
be split — that is the same signal `selector-granularity.md` describes.
|
|
40
|
+
- `-` is legal and means "not declared". A row carrying `-` is **not eligible
|
|
41
|
+
for parallel dispatch**; it may still be executed serially.
|
|
42
|
+
- It is a claim the row is later measured against, not a lock. See
|
|
43
|
+
`parallelization-policy.md#seam-reconciliation-after-a-parallel-run`.
|
|
44
|
+
|
|
45
|
+
## Obligation columns (optional, required by layer)
|
|
46
|
+
|
|
47
|
+
A row's obligation lives in the column its `Layer` selects. `TC-Refs` is the one
|
|
48
|
+
every row has; the other two are optional columns that become required when the
|
|
49
|
+
row's layer cannot host a `TC-*`.
|
|
50
|
+
|
|
51
|
+
| Column | Description |
|
|
52
|
+
| ------------ | --------------------------------------------------------------------------------- |
|
|
53
|
+
| US-Refs | `US-*` obligations this row implements. Legal **only** on `Layer = E2E` rows |
|
|
54
|
+
| CON-API-Refs | `CON-API-*` obligations this row implements. Legal **only** on `Layer = API` rows |
|
|
55
|
+
| Blocked-By | What a `blocked` row is waiting on. Required on `blocked` rows, blank otherwise |
|
|
56
|
+
|
|
57
|
+
`Blocked-By` takes a Change Request ID (`CR-YYYYMMDD-NNNN`), a contract path
|
|
58
|
+
with line (`.qfai/contracts/db/CON-DB-0005.sql:2715`), or a cross-spec row
|
|
59
|
+
(`spec-0006:TDD-0034`). `DR-ID` is **not** widened to carry it: that column is
|
|
60
|
+
what distinguishes a parked `exception` from a row that never started, and
|
|
61
|
+
overloading it would merge the two states the `blocked` status exists to
|
|
62
|
+
separate.
|
|
63
|
+
|
|
64
|
+
`test-layers.md` forbids `TC-*` annotations in `tests/e2e/**` and `tests/api/**`,
|
|
65
|
+
so an E2E or API row has no legal `TC-Refs` value. Those rows carry `-` in
|
|
66
|
+
`TC-Refs` and record their obligation in `US-Refs` / `CON-API-Refs` instead.
|
|
67
|
+
|
|
68
|
+
The binding is enforced in both directions: a `TC-*` on an E2E/API row raises
|
|
69
|
+
`TDDLIST_OBLIGATION_LAYER_MISMATCH` and is **not** counted towards TC coverage,
|
|
70
|
+
so a forbidden placement cannot close a coverage-target TC.
|
|
71
|
+
`TDDLIST_OBLIGATION_LAYER_MISMATCH` likewise rejects a `US-Refs` /
|
|
72
|
+
`CON-API-Refs` value on a layer that does not own it.
|
|
73
|
+
|
|
74
|
+
A `Layer` outside the legal values raises `TDDLIST_UNKNOWN_LAYER` (warning) —
|
|
75
|
+
without a legal `Layer` the row has no obligation column. Coverage counting
|
|
76
|
+
excludes `API` and `E2E` specifically rather than allowlisting the other three,
|
|
77
|
+
so a mistyped layer keeps counting and is reported by that warning, which names
|
|
78
|
+
the real cause; an allowlist would instead drop the row silently and resurface
|
|
79
|
+
as a coverage error about a TC the author did cover.
|
|
80
|
+
|
|
81
|
+
Coverage measurement is otherwise unaffected: it reads `TC-*` tokens only, so
|
|
82
|
+
non-TC obligation IDs are inert to it by design.
|
|
83
|
+
|
|
84
|
+
## Evidence cell contract
|
|
85
|
+
|
|
86
|
+
The `Evidence` cell is a **pointer**, not the payload.
|
|
87
|
+
|
|
88
|
+
`.qfai/evidence/implement-<spec-id>.md` is the home — for every row this skill
|
|
89
|
+
runs itself; the E2E/API rows use `atdd-<spec-id>.md`, see "ATDD-owned rows"
|
|
90
|
+
below — of the per-item
|
|
91
|
+
evidence contract — the RED/GREEN commands, their output, and the reviewer
|
|
92
|
+
verdicts. The ledger cell records the outcome and says where to read the proof:
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
RED fail / GREEN pass — evidence at `.qfai/evidence/implement-spec-0001.md#tdd-0027`
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Why it cannot hold the payload
|
|
99
|
+
|
|
100
|
+
A GFM table row is **one physical line**, and `splitMarkdownRow` ends a cell at
|
|
101
|
+
every unescaped `|`. Pasting a command and its output into the cell has two
|
|
102
|
+
failure modes, both silent:
|
|
103
|
+
|
|
104
|
+
- a newline ends the row — `parseAllMarkdownTables` stops the table at the first
|
|
105
|
+
line that does not start with `|`, so every row below it disappears from the
|
|
106
|
+
ledger the validators read;
|
|
107
|
+
- a bare `|` — a shell pipe, a table in the output, a regex alternation — splits
|
|
108
|
+
the row into extra cells and misaligns every column after `Evidence`.
|
|
109
|
+
|
|
110
|
+
The column description used to read "RED/GREEN command+result pairs proving the
|
|
111
|
+
TDD cycle", so following it literally corrupted the evidence or destroyed the
|
|
112
|
+
ledger. None of the Evidence hard rules change: they now bind the evidence file,
|
|
113
|
+
which can hold what they ask for.
|
|
114
|
+
|
|
115
|
+
### Evidence cell encoding
|
|
116
|
+
|
|
117
|
+
When a cell must contain either character, encode it with
|
|
118
|
+
`specPackParsers.ts#escapeTableCell` — the exported encoder the parser inverts.
|
|
119
|
+
The left column is the character **in the value you want the cell to hold**;
|
|
120
|
+
the right column is what is **written into the row**. Both are shown as HTML
|
|
121
|
+
entities, because a literal pipe in this table would split its own row.
|
|
122
|
+
|
|
123
|
+
Exactly two rules:
|
|
124
|
+
|
|
125
|
+
| Character in the value | Written into the cell |
|
|
126
|
+
| ---------------------- | --------------------- |
|
|
127
|
+
| a pipe (|) | \| |
|
|
128
|
+
| CR / LF / CRLF | a single space |
|
|
129
|
+
|
|
130
|
+
A literal `\` is **not** escaped: the parser passes it through unchanged, so
|
|
131
|
+
doubling it would corrupt Windows paths and regex literals while keeping the
|
|
132
|
+
column count valid — a corruption no validator can see.
|
|
133
|
+
|
|
134
|
+
## Evidence cell rules (enforced)
|
|
135
|
+
|
|
136
|
+
`Evidence` is checked as content, not only as a header name. On a row whose
|
|
137
|
+
`Status` is `green`, `refactor`, `review-fix` or `done` — the statuses that
|
|
138
|
+
assert a cycle has run:
|
|
139
|
+
|
|
140
|
+
| Finding | Fires when | Severity |
|
|
141
|
+
| ------------------------------ | ------------------------------------------------------------------- | -------- |
|
|
142
|
+
| `TDDLIST_EVIDENCE_EMPTY` | the cell is empty or holds only dash placeholders (`-`, `–`, `—`) | error |
|
|
143
|
+
| `TDDLIST_EVIDENCE_STATUS_ONLY` | the cell claims a verdict (`PASS`, `looks good`, …) with no command | warning |
|
|
144
|
+
|
|
145
|
+
A command is recognised by shape, not from a list of known runners, so the rule
|
|
146
|
+
holds on any stack: a program name followed by an argument carrying a flag, a
|
|
147
|
+
path, a selector or an assignment. Backticked commands and the common runners
|
|
148
|
+
are accepted directly.
|
|
149
|
+
|
|
150
|
+
`TDDLIST_EVIDENCE_STATUS_ONLY` is a warning, waivable under `TDDLIST-004`: a
|
|
151
|
+
ledger written before the check exists carries prose verdicts, and failing a
|
|
152
|
+
build on them is a migration rather than a gate. An empty cell is unambiguous,
|
|
153
|
+
so `TDDLIST_EVIDENCE_EMPTY` stays at `error`.
|
|
154
|
+
|
|
155
|
+
Rows at `todo`, `red` and `exception` are not checked — the first two have
|
|
156
|
+
nothing to show yet, and a parked row records its reason in `DR-ID`, which
|
|
157
|
+
`TDDLIST_EXCEPTION_MISSING_DR` gates.
|
|
158
|
+
|
|
159
|
+
Freshness is **not** gated: the ledger records no run identity, so no validator
|
|
160
|
+
can distinguish a fresh command+result pair from a copied one. That rule stays
|
|
161
|
+
with the routed reviewer (`qfai-implement/SKILL.md` "Evidence hard rules").
|
|
162
|
+
|
|
163
|
+
A pointer cell satisfies these rules: the `evidence at <path>` form carries a
|
|
164
|
+
path, which is one of the command shapes the gate accepts. The rules reject a
|
|
165
|
+
bare verdict, not a pointer.
|
|
166
|
+
|
|
167
|
+
## Selector granularity (MUST)
|
|
168
|
+
|
|
169
|
+
`Selector` is **not** restricted to a single test function: a row may own several entries, written
|
|
170
|
+
as a comma-separated list or a glob. What is restricted is what a row may _conflate_ — **one
|
|
171
|
+
independently observable boundary per selector entry**, with RED observed per entry, and a
|
|
172
|
+
matrix-shaped `TC-*` decomposed across rows before RED begins (`TC-Refs` is many-to-many with
|
|
173
|
+
`TDD-ID`). A selector that accumulates unrelated boundaries invalidates the RED observation. Rules
|
|
174
|
+
and examples: `selector-granularity.md`.
|
|
175
|
+
|
|
176
|
+
## Status Lifecycle
|
|
177
|
+
|
|
178
|
+
Valid status values: `todo`, `blocked`, `red`, `green`, `refactor`, `review-fix`, `done`, `exception`.
|
|
179
|
+
|
|
180
|
+
### Allowed transitions
|
|
181
|
+
|
|
182
|
+
This list is the complete one. `qfai-implement/SKILL.md` summarises it and
|
|
183
|
+
`TDDLIST_EXCEPTION_PARKED` links here; both defer to what follows.
|
|
184
|
+
|
|
185
|
+
- `todo` -> `blocked` (the row cannot be started: an upstream defect, an
|
|
186
|
+
unresolved Change Request, or an unfinished row in another spec). Name the
|
|
187
|
+
blocker in `Blocked-By`; `TDDLIST_BLOCKED_MISSING_REF` errors without it.
|
|
188
|
+
- `blocked` -> `todo` (the blocker cleared). This is a **resumption, not a
|
|
189
|
+
backward transition**: the row never started, so nothing is being undone.
|
|
190
|
+
- `todo` -> `red` (write a failing test)
|
|
191
|
+
- `red` -> `green` (make the test pass with minimal code)
|
|
192
|
+
- `green` -> `refactor` (improve code quality while keeping tests green)
|
|
193
|
+
- `refactor` -> `done` (item complete)
|
|
194
|
+
- `refactor` -> `review-fix` (a blocking reviewer returned `REVISE`)
|
|
195
|
+
- `review-fix` -> `refactor` (rework complete; re-submit to the reviewer)
|
|
196
|
+
- Any active status -> `exception` (anomaly detected; record DR-ID in DR-ID column)
|
|
197
|
+
- **Any status** -> `todo` — **upstream reset**, the only legal reopen,
|
|
198
|
+
available from every status a row can hold, `blocked` and `review-fix`
|
|
199
|
+
included. This list is the complete one and an unlisted edge is prohibited,
|
|
200
|
+
so enumerating five sources here forbade the sweep
|
|
201
|
+
`constitution/drift-protocol.md` step 5 requires of exactly those two.
|
|
202
|
+
Permitted **only** when an approved upstream change (Drift Protocol step 4
|
|
203
|
+
rerun) invalidated the row's obligation. The invalidating CR/DR ID MUST be
|
|
204
|
+
recorded in the `DR-ID` column, and the reset MUST cite it in `Evidence`.
|
|
205
|
+
That ID MUST be retained as the row moves on through `red`, `green`,
|
|
206
|
+
`refactor` and `done` — clearing it on the next transition erases the only
|
|
207
|
+
record of why a completed row was reopened. A row swept out of `exception`
|
|
208
|
+
keeps the anomaly's DR-ID alongside the reset ID. A reset without a recorded
|
|
209
|
+
approval is a backward transition and is prohibited.
|
|
210
|
+
- `exception` -> `todo` — **anomaly resolved**, the item re-enters the cycle
|
|
211
|
+
from the start. This is the exit `exception` previously lacked; without it a
|
|
212
|
+
parked item could never be un-parked without a lifecycle violation. Distinct
|
|
213
|
+
from the upstream reset above: nothing upstream changed, so it needs no CR/DR
|
|
214
|
+
approval — the anomaly's own DR-ID stays in place.
|
|
215
|
+
- A reset row is at `todo`, so it owes no test file until it reaches `green`.
|
|
216
|
+
The `Test file` existence check is unchanged for `green` / `refactor` /
|
|
217
|
+
`done`: those statuses assert a test that ran.
|
|
218
|
+
|
|
219
|
+
- `refactor` -> `red` (**QA rejection recovery**): a routed
|
|
220
|
+
`qa-gatekeeper` returned `REVISE` on this row's RED/GREEN evidence because the
|
|
221
|
+
cycle itself was wrong. Batched (T1) review defers that confirmation until
|
|
222
|
+
after the row has left `red`, so without this edge a rejected row could never
|
|
223
|
+
redo the RED it was faulted for and could never reach `done`. Cite the verdict
|
|
224
|
+
in `Evidence`, re-run the micro-cycle; rules:
|
|
225
|
+
`volume-policy.md#group-formation-states-and-transitions`.
|
|
226
|
+
|
|
227
|
+
Any edge not listed above is prohibited. Attempting `green` -> `red` must
|
|
228
|
+
produce: `"Backward transition prohibited: green -> red"`.
|
|
229
|
+
|
|
230
|
+
**"Backward" is narrower than "moves to an earlier status".** All four edges
|
|
231
|
+
below return a row to an earlier state, and **three of them are not backward
|
|
232
|
+
transitions** — a resumption, an anomaly exit and the rework edge each restart
|
|
233
|
+
an earlier phase of the row's own cycle with nothing upstream changed. The
|
|
234
|
+
third, the approved Change Request reset, **is** the one sanctioned backward
|
|
235
|
+
transition: an upstream obligation moved and the row's completed work is
|
|
236
|
+
withdrawn. The column below therefore asks why each edge is _legal_, not why it
|
|
237
|
+
is not backward:
|
|
238
|
+
|
|
239
|
+
| Edge | Why it is legal | Approval needed |
|
|
240
|
+
| ----------------------------------------- | --------------------------------------------------- | --------------- |
|
|
241
|
+
| `blocked` -> `todo` | resumption — the row never started | none |
|
|
242
|
+
| `exception` -> `todo` | anomaly resolved — nothing upstream changed | none |
|
|
243
|
+
| **any status** -> `todo` (upstream reset) | owner-approved re-entry, cycle restarts from `todo` | approved `CR-*` |
|
|
244
|
+
| `refactor` -> `red` | QA rejection recovery on this row's own evidence | `qa-gatekeeper` |
|
|
245
|
+
|
|
246
|
+
The first, second and fourth rows are **re-entries, not backward transitions**:
|
|
247
|
+
they return a row to an earlier phase of its own cycle without any upstream
|
|
248
|
+
change. The approved Change Request reset is the one **sanctioned backward
|
|
249
|
+
transition** — an upstream obligation moved, so the row's completed work is
|
|
250
|
+
withdrawn. The distinction is the whole reason the column above asks why each
|
|
251
|
+
edge is _legal_ rather than why it is not backward: three of them are not, one
|
|
252
|
+
of them is and is authorised. `final-checklist.md` carries the same carve-out,
|
|
253
|
+
so a run that performs an approved reset can still tick it. Preconditions and
|
|
254
|
+
the reset procedure: `references/change-request-reset.md`.
|
|
255
|
+
|
|
256
|
+
**The reset admits every source status**, not the five a run is most likely to
|
|
257
|
+
be in. `constitution/drift-protocol.md` step 5 sweeps the ledger with
|
|
258
|
+
`any status -> todo`, and a row sitting at `blocked` or `review-fix` when the
|
|
259
|
+
upstream obligation moved is exactly a row that has to be swept. Enumerating
|
|
260
|
+
the sources here let this table forbid a transition the Protocol requires, so
|
|
261
|
+
a preflight that hit one had nothing legal left to do.
|
|
262
|
+
|
|
263
|
+
### Reviewer rework is not a backward transition
|
|
264
|
+
|
|
265
|
+
A blocking reviewer's `REVISE` moves the item `refactor -> review-fix`. While at
|
|
266
|
+
`review-fix` the item MAY re-enter the RED/GREEN cycle as many times as the
|
|
267
|
+
rework needs — write the new failing test, watch it fail, make it pass — without
|
|
268
|
+
any of those runs counting as a backward transition. The row's status does not
|
|
269
|
+
change during that cycle: `review-fix -> red` and `review-fix -> green` are not
|
|
270
|
+
allowed transitions. When the rework is done the item returns to `refactor` and
|
|
271
|
+
is re-submitted.
|
|
272
|
+
|
|
273
|
+
`review-fix` is not a completion state and appears in the completion-prohibition
|
|
274
|
+
list. Round-by-round evidence rules: `round-evidence.md`.
|
|
275
|
+
|
|
276
|
+
## ATDD-owned rows
|
|
277
|
+
|
|
278
|
+
A row whose `Layer` is `E2E`, `API` or `Integration` — Integration among them
|
|
279
|
+
because `QFAI-ATDD-112` covers every `L3` TC, and every TC with no declared
|
|
280
|
+
`Level`, from `tests/integration/**`, and that stage's P4 writes those tests.
|
|
281
|
+
These rows live in this ledger and follow
|
|
282
|
+
every rule above, but their tests are authored by `/qfai-atdd`
|
|
283
|
+
(`qfai-implement/SKILL.md` Non-goals). The two skills
|
|
284
|
+
therefore share one lifecycle, and the ordering that skill works in makes the
|
|
285
|
+
RED question different rather than absent.
|
|
286
|
+
|
|
287
|
+
`/qfai-atdd` does **not** write production code — `agent-routing.yml` gives its
|
|
288
|
+
implementation phase `acceptance-test-engineer`, who owns acceptance tests, and
|
|
289
|
+
no backend or frontend agent. The surface a journey needs is built by this
|
|
290
|
+
skill's Phase Green, from the RED that stage handed over. What makes the RED
|
|
291
|
+
question different there is ordering, not ownership: the work orders that build
|
|
292
|
+
a spec's surfaces often run before the journey is written, and a test written
|
|
293
|
+
after its surface passes on the first run. So:
|
|
294
|
+
|
|
295
|
+
- **There is no waiver here.** `todo -> red` still requires an admissible RED,
|
|
296
|
+
and a first-run pass is still not one.
|
|
297
|
+
- **The falsifiability path is the answer, not `exception`.**
|
|
298
|
+
`red-not-observable.md` already defines the substitute — record
|
|
299
|
+
`Satisfied-by`, mutate the predicate the journey asserts on, watch this row's
|
|
300
|
+
test fail, restore, and record `Falsifiability command` /
|
|
301
|
+
`Falsifiability result` beside the GREEN pair. It was written for an
|
|
302
|
+
obligation a sibling row had already satisfied; a journey whose surface the
|
|
303
|
+
same cycle just built is the same situation with the sibling being the
|
|
304
|
+
surface work. `qa-gatekeeper` accepts that form, and the row proceeds to
|
|
305
|
+
`green` and `done`.
|
|
306
|
+
- **`/qfai-atdd` also has a first branch this ledger cannot see**: writing the
|
|
307
|
+
journey against the tree _before_ the surface exists, which produces an
|
|
308
|
+
ordinary RED. Its stage gate P1b is where that happens.
|
|
309
|
+
- **The evidence file follows the stage that produced it.**
|
|
310
|
+
`implement-<spec-id>.md` holds the rows this skill runs itself;
|
|
311
|
+
`atdd-<spec-id>.md` holds `## Ledger rows advanced` for the E2E/API rows,
|
|
312
|
+
because that is the stage that ran the commands. The `Evidence` cell is a
|
|
313
|
+
pointer either way and its anchor names which file. Calling
|
|
314
|
+
`implement-<spec-id>.md` the single home was true while one stage produced
|
|
315
|
+
every pair; it stopped being true the moment another stage did.
|
|
316
|
+
`qfai-implement/SKILL.md`'s completion item 10 reads the same split, so an
|
|
317
|
+
E2E/API row whose anchor names the ATDD file reaches `done`; items 11 and the
|
|
318
|
+
matching prohibition condition append the two reviewer verdicts to **that**
|
|
319
|
+
file. This skill still runs `completion-reviewer` and
|
|
320
|
+
`implementation-reviewer` for every row it advances — only the RED provenance
|
|
321
|
+
came from elsewhere.
|
|
322
|
+
- **`exception` is for a row where both are unavailable** — an obligation with
|
|
323
|
+
no persisted form or no observable surface at L5, recorded with a `DR-*`
|
|
324
|
+
naming what is missing. It is not the routine outcome of surface-first
|
|
325
|
+
ordering. A spec whose ATDD rows are all `exception` has recorded that the
|
|
326
|
+
provenance step was skipped, not that the obligations were unverifiable.
|
|
327
|
+
|
|
328
|
+
## Blocked rows
|
|
329
|
+
|
|
330
|
+
`blocked` means **cannot be started**, not "not started yet" and not "anomaly".
|
|
331
|
+
|
|
332
|
+
- It is **completion-prohibiting**, exactly like `todo`. A spec must not close
|
|
333
|
+
over an unimplemented obligation, and naming the blocker does not discharge it.
|
|
334
|
+
- It is **not** selectable. Phase Red picks the first `todo` row and skips
|
|
335
|
+
`blocked` ones, so the loop head stops re-issuing rows that cannot proceed.
|
|
336
|
+
- It is **not** `exception`. `exception` is scoped to an anomaly, requires a
|
|
337
|
+
`DR-*`, and satisfies spec completion — filing a blocked row there would
|
|
338
|
+
silently close the obligation.
|
|
339
|
+
- `npx qfai report` counts it inside `open` but prints it separately
|
|
340
|
+
(`open: N (blocked: M)`), so "not started" and "cannot start" are readable
|
|
341
|
+
apart without changing what completion means.
|
|
342
|
+
|
|
343
|
+
## Exception Handling
|
|
344
|
+
|
|
345
|
+
`exception` means **anomaly, work paused** — not "accepted risk, closed". The
|
|
346
|
+
two are different states sharing one status today; the `DR-ID` distinguishes
|
|
347
|
+
them and only the accepted-risk form is completion-satisfying. Resolve a paused
|
|
348
|
+
item via `exception` -> `todo`.
|
|
349
|
+
|
|
350
|
+
When transitioning to `exception`:
|
|
351
|
+
|
|
352
|
+
- A DR-ID (Decision Record ID) must be recorded in the DR-ID column.
|
|
353
|
+
- A retained `CR-*` does not satisfy this: it records the approved reopen, not the anomaly. Add the `DR-*` alongside it (`DR-NNNN, CR-YYYYMMDD-NNNN`).
|
|
354
|
+
- If the DR-ID column is empty, or holds `CR-*` references only, emit error: `"exception status requires DR-ID in DR-ID column"`.
|
|
355
|
+
|
|
356
|
+
### Where the Decision Record is written
|
|
357
|
+
|
|
358
|
+
Write it to `.qfai/decisions/DR-<id>-<slug>.md`, beside the Change
|
|
359
|
+
Requests, using the same `DR-*` ID scheme those files declare. Do **not** write
|
|
360
|
+
`07_Decisions.md` or `09_delta.md`.
|
|
361
|
+
|
|
362
|
+
Those two are upstream SSOT (`constitution/drift-protocol.md#core-rule`) and
|
|
363
|
+
this skill carries `[DRIFT-PROTOCOL:MANDATORY]`, so a downstream write to either
|
|
364
|
+
is a protocol violation — while the `exception` transition itself is an ordinary
|
|
365
|
+
inline step of Phase Red that `TDDLIST_EXCEPTION_MISSING_DR` blocks at `error`
|
|
366
|
+
without a `DR-*`. `.qfai/decisions/` is the one home that satisfies both: the
|
|
367
|
+
protocol whitelists **creating** a record there
|
|
368
|
+
(`drift-protocol.md#allowed-exceptions-minimal-whitelist`), and the managed `.gitignore` block
|
|
369
|
+
already tracks it as a governance record.
|
|
370
|
+
|
|
371
|
+
The upstream cross-reference is a separate, later write. If the anomaly turns
|
|
372
|
+
out to change an approved obligation, that is drift: raise a Change Request per
|
|
373
|
+
`drift-protocol.md#when-drift-is-detected`, and the owner skill's rerun is what
|
|
374
|
+
records the reference in `07_Decisions.md` / `09_delta.md`. Parking the row does
|
|
375
|
+
not require that to have happened.
|
|
376
|
+
|
|
377
|
+
### Parked items and the `TDDLIST-001` waiver
|
|
378
|
+
|
|
379
|
+
Every `exception` row raises `TDDLIST_EXCEPTION_PARKED` (warning, rule
|
|
380
|
+
`TDDLIST-001`). The validator cannot read the DR to tell a paused defect from an
|
|
381
|
+
approved accepted risk, so the approval is recorded where QFAI already checks
|
|
382
|
+
approvals: a `TDDLIST-001` waiver in `.qfai/waivers.yml`.
|
|
383
|
+
|
|
384
|
+
The waiver carries `id` / `reason` / `expires` / `evidence` / `scope.paths`,
|
|
385
|
+
plus `match.dl_ids` listing the approved rows' `TDD-ID`s. `match.dl_ids` is not
|
|
386
|
+
optional — omit it and `QFAI-WAIVER-005` rejects the waiver, because a single
|
|
387
|
+
path-scoped entry would otherwise clear every parked row in the same ledger.
|
|
388
|
+
|
|
389
|
+
Without a matching waiver the warning stands, which is the intended signal.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Final Checklist
|
|
2
|
+
|
|
3
|
+
Check this list last, immediately before the completion message. Every box must be ticked; a box that
|
|
4
|
+
cannot be ticked is a reason not to declare completion, not a note to carry forward.
|
|
5
|
+
|
|
6
|
+
- [ ] CRITICAL CONSTRAINTS were followed.
|
|
7
|
+
- [ ] Each item was processed one test at a time, or inside an item-level parallel dispatch authorized by `SKILL.md#parallelization-policy`.
|
|
8
|
+
- [ ] Red phase: test was written and confirmed to fail — or, on the _RED not observable_ path,
|
|
9
|
+
the correct test was written first and the falsifiability trio replaces the natural RED
|
|
10
|
+
(`red-not-observable.md`).
|
|
11
|
+
- [ ] Green phase: minimal code was written and test confirmed to pass — waived on the _RED not
|
|
12
|
+
observable_ path, where the `Satisfied-by` row already implements the predicate.
|
|
13
|
+
- [ ] Refactor phase: code improved with tests still passing.
|
|
14
|
+
- [ ] `test-list.md` statuses are accurate.
|
|
15
|
+
- [ ] No backward transitions occurred — other than an approved Change Request reset, the
|
|
16
|
+
one the lifecycle sanctions (`execution-ledger.md#allowed-transitions`). A resumption, an
|
|
17
|
+
anomaly exit and the `qa-gatekeeper` rework edge are re-entries, not backward transitions,
|
|
18
|
+
and do not need to be declared here.
|
|
19
|
+
- [ ] Exception items have DR-IDs recorded.
|
|
20
|
+
- [ ] All tests pass.
|
|
21
|
+
- [ ] `npx qfai validate --profile tdd --fail-on error --spec <spec-id>` passes with zero
|
|
22
|
+
`QFAI-TEST-001` findings (no `it.todo` / `test.todo` / `describe.todo` stubs remain).
|
|
23
|
+
`--spec` scopes the **spec-owned** rules; `QFAI-TEST-001` is **not** one of them and
|
|
24
|
+
still fails this gate wherever the stub lives. It names a test file, which no spec
|
|
25
|
+
owns, so a sibling spec's `it.todo` exits 1 here. That is a real limit, not a
|
|
26
|
+
formality: record the finding, its owning spec and why it is not this run's work,
|
|
27
|
+
say so in the completion report, and do **not** claim the gate passed, weaken the
|
|
28
|
+
profile or lower `--fail-on`. The repo-wide run belongs to `/qfai-verify`.
|
package/assets/init/.qfai/assistant/skills/qfai-implement/references/finding-classification.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Blocking vs advisory findings
|
|
2
|
+
|
|
3
|
+
Provenance rules: `shared-skill-delegation-baseline.md#finding-provenance-must`.
|
|
4
|
+
|
|
5
|
+
## Blocking
|
|
6
|
+
|
|
7
|
+
A **blocking** finding cites either an upstream obligation (`AC-*`, `BR-*`,
|
|
8
|
+
`TC-*`, `CON-*`, or a named constitution/catalog rule) or a defect class
|
|
9
|
+
(`defect:correctness`, `defect:security`, `defect:code-quality`) in its
|
|
10
|
+
`Traces to:` field.
|
|
11
|
+
|
|
12
|
+
A defect demonstrable from the changed code — an unhandled rejection, a missing
|
|
13
|
+
validation on trusted input, a leak, a broken contract the code itself declares
|
|
14
|
+
— is blocking without needing an `AC-*`.
|
|
15
|
+
|
|
16
|
+
Only blocking findings force `REVISE`, and only blocking findings hold the item
|
|
17
|
+
out of `done`.
|
|
18
|
+
|
|
19
|
+
## Advisory
|
|
20
|
+
|
|
21
|
+
An **advisory** finding is one whose `Traces to:` is `none` — a new product
|
|
22
|
+
obligation upstream never asked for. It MUST NOT be implemented as production
|
|
23
|
+
code or pinned as a test assertion.
|
|
24
|
+
|
|
25
|
+
Route it per `drift-protocol.md#reviewer-originated-obligations`: record it in
|
|
26
|
+
the reviewer response under `Advisory / Change Request proposals`.
|
|
27
|
+
|
|
28
|
+
Do **not** edit `08_Open-questions.md` here. It is upstream SSOT under the Drift
|
|
29
|
+
Protocol, and creating spec artifacts is a non-goal of this skill; the owner
|
|
30
|
+
phase (`/qfai-sdd`) records and adjudicates it.
|
|
31
|
+
|
|
32
|
+
## What an advisory does to `done`
|
|
33
|
+
|
|
34
|
+
- A new advisory that does **not** change an already-approved obligation leaves
|
|
35
|
+
the item free to reach `done`.
|
|
36
|
+
- One that **does** change an approved obligation takes the Change Request path,
|
|
37
|
+
and `drift-protocol.md#when-drift-is-detected` applies: STOP, and no `done`
|
|
38
|
+
for items depending on the obligation under dispute until approval and the
|
|
39
|
+
owner rerun.
|
|
40
|
+
|
|
41
|
+
## The reviewer verdict is still required
|
|
42
|
+
|
|
43
|
+
`Do not declare DONE until Reviewer returns PASS` is never waived: the Reviewer
|
|
44
|
+
verdict is required on every item, including one whose review produced only
|
|
45
|
+
advisories.
|
|
46
|
+
|
|
47
|
+
What **blocking** findings change is the verdict itself — only they force
|
|
48
|
+
`REVISE` and hold `done`. An advisory-only review returns `PASS`, and that
|
|
49
|
+
`PASS` is still what releases `done`.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Ledger preconditions
|
|
2
|
+
|
|
3
|
+
`.qfai/specs/<spec-id>/tdd/test-list.md` is the execution ledger every step of
|
|
4
|
+
`/qfai-implement` reads. This file states where it comes from, how to recover it
|
|
5
|
+
when it is absent, and how to tell a truthfully empty ledger from an incomplete
|
|
6
|
+
one.
|
|
7
|
+
|
|
8
|
+
## Producer
|
|
9
|
+
|
|
10
|
+
`/qfai-sdd` Phase 2b seeds one row per coverage-target TC from
|
|
11
|
+
`06_Test-Cases.md`. `US-*` / `CON-API-*` are ATDD obligations traced by `QFAI:`
|
|
12
|
+
annotations, not ledger rows — they never appear as rows here.
|
|
13
|
+
|
|
14
|
+
## Recovery when it is missing
|
|
15
|
+
|
|
16
|
+
Rerun `/qfai-sdd <spec-id>` for the target spec, or copy
|
|
17
|
+
`.qfai/assistant/skills/qfai-sdd/templates/specs/spec/tdd/test-list.md` into the
|
|
18
|
+
spec directory and derive the rows from `06_Test-Cases.md`.
|
|
19
|
+
|
|
20
|
+
Do **not** proceed with an absent ledger, and do **not** invent rows that no TC
|
|
21
|
+
backs.
|
|
22
|
+
|
|
23
|
+
## An empty ledger is a fault only when `06_Test-Cases.md` disagrees
|
|
24
|
+
|
|
25
|
+
A header-only table has two very different causes and they need opposite
|
|
26
|
+
responses, so never treat "no rows" as "nothing to do" on its own.
|
|
27
|
+
|
|
28
|
+
Before exiting, read `06_Test-Cases.md` and confirm it declares **no**
|
|
29
|
+
coverage-target TC, judged exactly as the validator judges it
|
|
30
|
+
(`qfai-sdd/references/spec-traceability-rules.md#tdd-execution-ledger`).
|
|
31
|
+
|
|
32
|
+
### What counts as a coverage target
|
|
33
|
+
|
|
34
|
+
A TC is a target **unless** its `Level` names a non-coverage layer. Both
|
|
35
|
+
spellings the shipped artifacts use count: the words `integration` / `e2e` /
|
|
36
|
+
`system` / `acceptance` / `api`, and the codes `L3` / `L4` / `L5` that
|
|
37
|
+
`06_Test-Cases.md` writes. Matching is case-insensitive.
|
|
38
|
+
|
|
39
|
+
That is an exclusion list, not an allowlist:
|
|
40
|
+
|
|
41
|
+
- an empty or unrecognised `Level` makes the TC a target;
|
|
42
|
+
- a `06_Test-Cases.md` with no `Level` column at all makes **every** TC a target.
|
|
43
|
+
|
|
44
|
+
Never narrow this to a chosen pair of level names. Guidance that names a
|
|
45
|
+
narrower allowlist makes a header-only ledger look truthful and skips the whole
|
|
46
|
+
implementation.
|
|
47
|
+
|
|
48
|
+
### The two outcomes
|
|
49
|
+
|
|
50
|
+
- **No coverage-target TC is declared** — the ledger is truthfully empty. Report
|
|
51
|
+
"nothing to do" and exit. Rerunning `/qfai-sdd` derives the same empty table
|
|
52
|
+
and loops.
|
|
53
|
+
- **At least one is declared** — the ledger is incomplete (a partial copy or an
|
|
54
|
+
interrupted Phase 2b) and `npx qfai validate` reports `TDDLIST_TC_NOT_COVERED`.
|
|
55
|
+
Run the recovery above instead of exiting.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Oracle Strength
|
|
2
|
+
|
|
3
|
+
Whether a passing test's pass **depends on the behaviour the item owns**.
|
|
4
|
+
|
|
5
|
+
Nothing in qfai asked this. The completion gate and the per-item evidence contract
|
|
6
|
+
record a command that failed and a command that passed; GREEN is measured as
|
|
7
|
+
`exit code == 0`. Downstream, ATDD coverage is annotation presence, the strongest
|
|
8
|
+
content check on a `done` row is that the test file exists, and the Coverage
|
|
9
|
+
Depth Matrix counts **case categories**, never oracle strength. A test that
|
|
10
|
+
cannot fail therefore cleared RED, GREEN, refactor, all completion points,
|
|
11
|
+
`QFAI-ATDD-111/112/113` and `npx qfai validate`.
|
|
12
|
+
|
|
13
|
+
## `Oracle proof` — the evidence field
|
|
14
|
+
|
|
15
|
+
Per item, alongside the RED/GREEN pair:
|
|
16
|
+
|
|
17
|
+
1. Name the **smallest production change** that makes this item's test fail
|
|
18
|
+
again — one line, in the code the item owns.
|
|
19
|
+
2. Apply it, run the row's `Selector`, and record the command and its **failing**
|
|
20
|
+
output.
|
|
21
|
+
3. **Revert immediately.** The mutation is evidence, not a deliverable; it must
|
|
22
|
+
never appear in the commit.
|
|
23
|
+
|
|
24
|
+
One mutation per item. It is the only evidence that separates a discriminating
|
|
25
|
+
test from a vacuous one, and it costs one run.
|
|
26
|
+
|
|
27
|
+
A row on the _RED not observable_ path already carries
|
|
28
|
+
`Falsifiability command` / `Falsifiability result`, which is the same proof by
|
|
29
|
+
the same method. That satisfies `Oracle proof`; do not do it twice.
|
|
30
|
+
|
|
31
|
+
## Reject an `Oracle proof` when
|
|
32
|
+
|
|
33
|
+
- the mutation is outside the code the item owns — breaking a shared helper
|
|
34
|
+
proves the helper is used, not that this test discriminates;
|
|
35
|
+
- the mutation is a syntax error, a thrown "not implemented", or a deleted
|
|
36
|
+
export — that is a load failure, the same non-observation
|
|
37
|
+
`red-admissibility.md` rejects for RED;
|
|
38
|
+
- the failing output names a different selector than the row's;
|
|
39
|
+
- the recorded command differs from the `GREEN command`. Proving a different
|
|
40
|
+
test discriminates says nothing about this one.
|
|
41
|
+
|
|
42
|
+
## Weak-oracle shapes to look for
|
|
43
|
+
|
|
44
|
+
These are the failure modes seen in the wild. Each passes today's gates.
|
|
45
|
+
|
|
46
|
+
- **Truthiness where the value is available.** `expect(result).toBeTruthy()` when
|
|
47
|
+
the boundary's own value is in hand. Assert the value.
|
|
48
|
+
- **Round-tripping the fixture's own helper.** Comparing a stored value against
|
|
49
|
+
the same function that wrote it: the assertion holds for every implementation
|
|
50
|
+
of the function, including a wrong one.
|
|
51
|
+
- **Loops over a collection that is empty by construction.** A `for` over a
|
|
52
|
+
filtered set that no fixture can populate asserts nothing, and reports as a
|
|
53
|
+
pass.
|
|
54
|
+
- **Observations the transport discards.** Asserting on a field the client
|
|
55
|
+
strips, or a log the harness swallows, is an assertion against nothing.
|
|
56
|
+
- **Assertions on the mock.** Verifying that a stub was called with what the
|
|
57
|
+
test just passed it re-states the test's own input.
|
|
58
|
+
|
|
59
|
+
## The equivalent-mutant case
|
|
60
|
+
|
|
61
|
+
Sometimes no mutation can be found because the **upstream contract is weaker
|
|
62
|
+
than the obligation** — every implementation the contract permits passes the
|
|
63
|
+
test, so the test cannot discriminate without asserting something upstream never
|
|
64
|
+
promised.
|
|
65
|
+
|
|
66
|
+
That is not an implementer defect and must not be worked around by strengthening
|
|
67
|
+
the assertion past the contract: doing so encodes a reviewer-originated
|
|
68
|
+
obligation in a hard assertion, which
|
|
69
|
+
`constitution/drift-protocol.md#reviewer-originated-obligations` forbids in
|
|
70
|
+
exactly those terms.
|
|
71
|
+
|
|
72
|
+
The route:
|
|
73
|
+
|
|
74
|
+
1. Record `Oracle proof: equivalent-mutant`, naming the contract clause that is
|
|
75
|
+
weaker than the obligation.
|
|
76
|
+
2. Raise it as an advisory / Change Request per
|
|
77
|
+
`drift-protocol.md#when-drift-is-detected`. `/qfai-sdd` owns closing it, by
|
|
78
|
+
tightening the contract.
|
|
79
|
+
3. The row may reach `done` against its existing obligation with the advisory
|
|
80
|
+
recorded — the gap is upstream, and blocking the implementer on a finding
|
|
81
|
+
they are forbidden to act on would be a deadlock, not a gate.
|