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.
- package/README.md +48 -2
- 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 +13 -2
- package/assets/init/.qfai/assistant/agents/delivery-planner.md +9 -0
- package/assets/init/.qfai/assistant/agents/frontend-engineer.md +1 -0
- package/assets/init/.qfai/assistant/agents/implementation-reviewer.md +6 -0
- package/assets/init/.qfai/assistant/agents/orchestrator.md +2 -2
- package/assets/init/.qfai/assistant/agents/qa-gatekeeper.md +96 -3
- package/assets/init/.qfai/assistant/agents/test-design-analyst.md +20 -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.md +355 -14
- 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/drift-protocol.md +304 -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 +244 -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 +316 -945
- package/assets/init/.qfai/assistant/manifest/agent-routing.yml +50 -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 +61 -21
- package/assets/init/.qfai/assistant/skills/qfai-atdd/references/test-case-depth-checklist.md +23 -4
- package/assets/init/.qfai/assistant/skills/qfai-configure/SKILL.md +15 -7
- 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 +1 -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/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 +250 -128
- 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 +106 -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 +77 -0
- package/assets/init/.qfai/assistant/skills/qfai-implement/references/execution-ledger.md +303 -0
- package/assets/init/.qfai/assistant/skills/qfai-implement/references/final-checklist.md +19 -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 +70 -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 +31 -0
- package/assets/init/.qfai/assistant/skills/qfai-implement/references/round-evidence.md +102 -0
- package/assets/init/.qfai/assistant/skills/qfai-implement/references/selector-granularity.md +24 -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 +82 -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 +1 -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 +157 -5
- 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/DESIGN.md +6 -0
- package/assets/init/root/qfai.config.yaml +15 -12
- package/dist/cli/index.cjs +11023 -7139
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.mjs +10963 -7080
- package/dist/cli/index.mjs.map +1 -1
- package/dist/index.cjs +8782 -5257
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +280 -8
- package/dist/index.d.ts +280 -8
- package/dist/index.mjs +11776 -8264
- package/dist/index.mjs.map +1 -1
- package/package.json +18 -19
|
@@ -15,37 +15,248 @@ Skill files should reference this baseline and only add role-, stage-, or gate-s
|
|
|
15
15
|
|
|
16
16
|
1. Attempt the first required delegation at stage start using the platform's native delegation mechanism.
|
|
17
17
|
2. Treat that first real delegation attempt as the capability check. Do not gate execution on preflight availability questions or synthetic probe-only checks.
|
|
18
|
-
3. If the delegation fails,
|
|
18
|
+
3. If the delegation fails, classify the failure first (see `Delegation Failure Taxonomy`), then apply the response for that class. Never simulate roles and never continue with self-execution, whatever the class.
|
|
19
|
+
|
|
20
|
+
### Delegation Failure Taxonomy (MUST)
|
|
21
|
+
|
|
22
|
+
Every delegation failure belongs to exactly one of two classes.
|
|
23
|
+
|
|
24
|
+
| Class | Meaning | Sanctioned response |
|
|
25
|
+
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------- |
|
|
26
|
+
| `unavailable` | The host has no usable delegation mechanism, the role is unknown, or the failure is a configuration / tooling / quota gap only the user can close — including a limit that waiting cannot clear. | Hard stop. |
|
|
27
|
+
| `saturated` | The host can delegate but is momentarily out of budget — `agent thread limit reached`, concurrency cap, queue full, rate limit, busy pool. The identical call would succeed later with no change by anyone. | Bounded wait-and-retry on the same stage. |
|
|
28
|
+
|
|
29
|
+
- Classify from the raw failure reason, and classify `saturated` only when the reason states or
|
|
30
|
+
plainly implies that the identical call would succeed later **with no change by anyone**: a queue
|
|
31
|
+
or pool that is currently full, a rate limit with a retry window, a concurrency cap that is
|
|
32
|
+
momentarily reached, an explicit "try again later".
|
|
33
|
+
- A limit or quota that only a user can lift is `unavailable`, not `saturated` — a configured
|
|
34
|
+
concurrency cap of 0, a maximum delegation depth, an input-size limit, an exhausted account
|
|
35
|
+
quota or plan. Waiting cannot clear those, so the retry loop would burn 30/60/120 seconds and
|
|
36
|
+
then report "no user action needed" about a condition that needs exactly that.
|
|
37
|
+
- When retryability is not explicit, default to `unavailable`. The two classes are not
|
|
38
|
+
symmetric: mis-classifying as `unavailable` costs one unnecessary stop the user can act on,
|
|
39
|
+
while mis-classifying as `saturated` hides an actionable failure behind a pointless wait.
|
|
40
|
+
- `saturated` never authorises self-execution of a primary artifact or of a blocking review, and never authorises discarding stage progress.
|
|
41
|
+
- When the `saturated` retry budget is exhausted, fall through to the hard stop and report the class as `saturated (retry budget exhausted)`.
|
|
42
|
+
|
|
43
|
+
### Delegation Failure — `saturated` (Bounded Retry)
|
|
44
|
+
|
|
45
|
+
- Retry the identical delegation with backoff: 30s, then 60s, then 120s. Attempt cap: 3 retries per work order.
|
|
46
|
+
- Do not re-scope, re-plan, or re-route the work order between retries — same role, same task.
|
|
47
|
+
- The stage stays open and resumable across the wait; completed work orders keep their `PASS` status.
|
|
48
|
+
- Report on entering the retry loop and on its outcome:
|
|
49
|
+
- `Delegation deferred: <raw reason or concise summary>`
|
|
50
|
+
- `Failure class: saturated`
|
|
51
|
+
- `Attempted role: <role>`
|
|
52
|
+
- `Attempted task: <task title>`
|
|
53
|
+
- `Retry condition: retry after <N> seconds / when a delegation slot frees`
|
|
54
|
+
- `Attempts used: <n>/3`
|
|
55
|
+
- `Stage state: held open and resumable — no stage progress discarded`
|
|
19
56
|
|
|
20
57
|
### Delegation Failure (Hard Stop)
|
|
21
58
|
|
|
59
|
+
Applies to `unavailable`, and to `saturated` once the retry budget is exhausted.
|
|
60
|
+
|
|
22
61
|
- Report all of:
|
|
23
62
|
- `Delegation failure: <raw reason or concise summary>`
|
|
63
|
+
- `Failure class: unavailable | saturated (retry budget exhausted)`
|
|
24
64
|
- `Attempted role: <role>`
|
|
25
65
|
- `Attempted task: <task title>`
|
|
26
66
|
- `Why stopped: QFAI requires real sub-agent delegation in this environment.`
|
|
27
|
-
- `User action needed: <settings or tooling changes required>`
|
|
67
|
+
- `User action needed: <settings or tooling changes required — or "none; wait for a delegation slot to free" when the class is saturated>`
|
|
28
68
|
- `Retry condition: rerun after the required delegation succeeds`
|
|
29
69
|
|
|
70
|
+
### Commit Scoping (MUST)
|
|
71
|
+
|
|
72
|
+
- A delegated agent stages only the paths it declared as deliverables in its
|
|
73
|
+
work order: `git add <path> …`.
|
|
74
|
+
- `git add -A`, `git add .` and `git commit -a` are forbidden for delegated
|
|
75
|
+
agents, in both isolation modes. In degraded / shared-index mode the
|
|
76
|
+
concurrent agents share one index, so a sweeping stage command commits a
|
|
77
|
+
sibling agent's in-flight files and misattributes work in the audit trail.
|
|
78
|
+
Under worktree separation there is no shared index and no sibling file to
|
|
79
|
+
sweep, but the command still stages everything else loose in that agent's own
|
|
80
|
+
worktree, so the commit still stops matching its declared deliverables.
|
|
81
|
+
- When the agent's deliverable paths are not known up front, it hands back an
|
|
82
|
+
unstaged diff and the orchestrator commits — under the same rule. The
|
|
83
|
+
orchestrator commits one handed-back diff at a time, stages that agent's
|
|
84
|
+
declared paths only, and is equally forbidden from `git add -A` / `git add .`
|
|
85
|
+
/ `git commit -a` while a parallel stage is in flight. Being the committer
|
|
86
|
+
does not exempt it; in degraded mode it is the only committer, so a sweeping
|
|
87
|
+
stage there mixes every sibling's work into one commit.
|
|
88
|
+
- Isolation requirements for concurrent stages are defined once in
|
|
89
|
+
`constitution/workflow.md#concurrency-stage-independent-mandatory`.
|
|
90
|
+
|
|
30
91
|
## Work Orders Summary
|
|
31
92
|
|
|
32
93
|
Every major artifact in the stage should include this table schema:
|
|
33
94
|
|
|
34
|
-
| Step | Role (sub-agent) | Task title | Input (refs) | Output (refs) | Status (PASS/REVISE) |
|
|
35
|
-
| ---- | ---------------- | ---------- | ------------ | ------------- |
|
|
36
|
-
| 1 | <role> | <task> | <refs> | <refs> | PASS/REVISE |
|
|
95
|
+
| Step | Role (sub-agent) | Agent instance | Task title | Input (refs) | Output (refs) | Status (PASS/REVISE/PENDING) |
|
|
96
|
+
| ---- | ---------------- | -------------- | ---------- | ------------ | ------------- | ---------------------------- |
|
|
97
|
+
| 1 | <role> | <instance id> | <task> | <refs> | <refs> | PASS/REVISE/PENDING |
|
|
37
98
|
|
|
38
99
|
- `Output (refs)` should point to in-file anchors or relative evidence paths.
|
|
100
|
+
- `Agent instance` is a run-stable identifier for the sub-agent that actually performed the step
|
|
101
|
+
(platform-supplied id where available, otherwise `<role>#<n>` assigned in order of first use).
|
|
102
|
+
It exists so an author→reviewer collision is detectable after the fact from the evidence alone;
|
|
103
|
+
the same instance appearing in an authoring step and in a review step over the same artifact is
|
|
104
|
+
a reviewer-independence violation.
|
|
105
|
+
- `PENDING` records a gate that could not be run — the only honest status for the exhausted-budget
|
|
106
|
+
branch below, which mandates it. It is never a substitute for `PASS`: DONE stays blocked while
|
|
107
|
+
any row is `PENDING`, and the stage stays resumable. A skill that allows only `PASS`/`REVISE`
|
|
108
|
+
would force an agent on that path to either break the schema or mislabel an unrun gate.
|
|
39
109
|
|
|
40
110
|
## Reviewer Gate Baseline
|
|
41
111
|
|
|
42
112
|
- Final completion gate must be delegated to an independent reviewer.
|
|
113
|
+
|
|
114
|
+
### Definition: independent reviewer (NORMATIVE)
|
|
115
|
+
|
|
116
|
+
An **independent reviewer** is a sub-agent that did **not** author or edit any artifact under
|
|
117
|
+
review in this run.
|
|
118
|
+
|
|
119
|
+
- The protected invariant is independence from authorship, not reviewer instance identity.
|
|
120
|
+
An agent that produced or modified none of the artifacts under review is independent even if
|
|
121
|
+
it filled another role earlier in the run; an agent that drafted or edited one of them is not
|
|
122
|
+
independent, however it is routed.
|
|
123
|
+
- Independence is judged per review target, over the whole run — not per phase. Authoring in an
|
|
124
|
+
earlier phase disqualifies the agent from reviewing that artifact in a later one.
|
|
125
|
+
- Role name alone never establishes independence. Routing dispatches by role; independence is a
|
|
126
|
+
separate constraint the routed agent must satisfy and attest to.
|
|
127
|
+
- A reviewer that discovers it authored or edited a review target MUST stop, declare the
|
|
128
|
+
conflict, and hand the same evidence set to a non-participating reviewer. It MUST NOT return
|
|
129
|
+
`PASS` on an artifact it authored.
|
|
130
|
+
- This definition governs every skill. Skill-local wording (e.g. `qfai-configure`'s "a reviewer
|
|
131
|
+
who did not modify the config") is an instance of it, not a competing rule.
|
|
132
|
+
|
|
43
133
|
- Reviewers must verify Drift Protocol enforcement.
|
|
44
134
|
- Reviewers must verify test-layer policy enforcement when relevant.
|
|
45
135
|
- Do not treat test volume ratios or floors as hard gates unless the skill explicitly says so.
|
|
46
136
|
- Do not declare DONE until all routed blocking reviewers return `PASS`.
|
|
47
137
|
- Every reviewer returning `FAIL` or `REVISE` must include a concrete fix proposal.
|
|
48
138
|
|
|
139
|
+
### Round budget (MUST)
|
|
140
|
+
|
|
141
|
+
- **Two rounds per reviewer per artifact.** Round 1 is the initial review;
|
|
142
|
+
round 2 reviews the fixes. **The budget is spent the moment round 2 returns
|
|
143
|
+
`REVISE`**: the orchestrator MUST NOT start a third review, and MUST stop and
|
|
144
|
+
escalate to the user with the open findings, the fixes already applied, and a
|
|
145
|
+
recommendation. The decision point is round 2's verdict, never a prediction
|
|
146
|
+
about a review that must not run.
|
|
147
|
+
- Escalation is not failure. The artifact stays at its current status and the
|
|
148
|
+
user decides: accept with the finding recorded as an Open Question, apply a
|
|
149
|
+
named fix, or drop the item from scope.
|
|
150
|
+
- **Completion after escalation.** The user's decision is the exception to
|
|
151
|
+
"no DONE until all blocking reviewers `PASS`", so the escalation has an exit:
|
|
152
|
+
- _Accept as Open Question_ or _drop from scope_ — the artifact may reach
|
|
153
|
+
DONE with the finding recorded; the reviewer's outstanding `REVISE` is
|
|
154
|
+
superseded by the recorded user decision. Cite the decision where the
|
|
155
|
+
stage records decisions (`*_delta.md` / `07_Decisions.md` / a Change
|
|
156
|
+
Request).
|
|
157
|
+
- _Apply a named fix_ — one **verification review** of exactly that fix is
|
|
158
|
+
permitted and does not consume budget (it is round 2b, not round 3). Its
|
|
159
|
+
remit is the named fix only. It may not raise findings unrelated to that
|
|
160
|
+
fix, but a defect the fix **introduced or exposed** is in remit and MUST be
|
|
161
|
+
reported rather than passed over: verifying only the named lines and
|
|
162
|
+
returning `PASS` while a regression sits next to them is a false `PASS`.
|
|
163
|
+
Such a finding escalates immediately (see the severity floor below) and
|
|
164
|
+
still does not start a round 3. The review returns `PASS` or escalates
|
|
165
|
+
again.
|
|
166
|
+
- **One 2b per artifact, total.** The verification review is free of budget,
|
|
167
|
+
not unbounded: a second escalation on the same artifact MUST NOT be
|
|
168
|
+
answered with another _apply a named fix_ + 2b cycle. Without this cap the
|
|
169
|
+
two rules compose into a loop — 2b costs nothing, and escalating again is
|
|
170
|
+
always allowed — so the gate has no guaranteed end. At the second
|
|
171
|
+
escalation the user is offered only _accept as Open Question_ or _drop the
|
|
172
|
+
item from scope_ (subject to the severity floor below); if the floor
|
|
173
|
+
withholds both, the artifact does not reach DONE and the stage stops with
|
|
174
|
+
the finding recorded.
|
|
175
|
+
- **Severity floor on the exit.** _Accept as Open Question_ is NOT available
|
|
176
|
+
for a finding that names a concrete security defect, data loss or
|
|
177
|
+
corruption, or a correctness defect that would break a released contract.
|
|
178
|
+
Present the user only _apply a named fix_ or _drop the item from scope_ for
|
|
179
|
+
those, and say why the third option is withheld. Without this the general
|
|
180
|
+
exit is a route around "deferring such a finding to an Open Question so a
|
|
181
|
+
`PASS` can be returned is prohibited" — one that needs no lateness and no
|
|
182
|
+
reviewer consent, only a user click.
|
|
183
|
+
- The round number MUST be recorded on each reviewer response
|
|
184
|
+
(`Round:` in the shared response template).
|
|
185
|
+
|
|
186
|
+
### Convergence (MUST)
|
|
187
|
+
|
|
188
|
+
- A finding first raised in round N > 1 MUST state why it was not raisable in
|
|
189
|
+
round N-1 — the fix introduced it, or the fix exposed it. A finding that was
|
|
190
|
+
raisable in round 1 and was not raised is **out of budget**: record it as an
|
|
191
|
+
Open Question or a `*_delta.md` Decision Record for the owning stage, do not
|
|
192
|
+
block on it.
|
|
193
|
+
- A reviewer MUST NOT open a new blocking _class_ of finding after the artifact
|
|
194
|
+
under review has been declared stable. New classes go to the owning stage.
|
|
195
|
+
- **Severity overrides lateness.** The out-of-budget rule is about review
|
|
196
|
+
discipline, not about shipping known harm. A late finding that names a
|
|
197
|
+
concrete security defect, data loss or corruption, or a correctness defect
|
|
198
|
+
that would break a released contract is **not** deferrable: the orchestrator
|
|
199
|
+
stops and escalates to the user immediately, exactly as it does when the
|
|
200
|
+
round budget is spent. It is still not a third round — no further review is
|
|
201
|
+
started, the finding goes straight to the user with its evidence. Deferring
|
|
202
|
+
such a finding to an Open Question so a `PASS` can be returned is prohibited.
|
|
203
|
+
That prohibition does not depend on lateness or on who proposes the deferral:
|
|
204
|
+
the escalation exit in the round budget withholds _Accept as Open Question_
|
|
205
|
+
for this same class, so a user choice cannot supersede it either.
|
|
206
|
+
|
|
207
|
+
### Reviewer remit (in scope per stage)
|
|
208
|
+
|
|
209
|
+
A finding outside the reviewing stage's remit is recorded and deferred, never
|
|
210
|
+
blocking:
|
|
211
|
+
|
|
212
|
+
| Stage | In scope | Out of scope (record and defer) |
|
|
213
|
+
| ------------------ | ----------------------------------------------------------------- | ---------------------------------------------- |
|
|
214
|
+
| `/qfai-discussion` | Requirement clarity, scope boundary, decision traceability | Spec structure, runtime behavior |
|
|
215
|
+
| `/qfai-sdd` | Spec / contract consistency, testability, traceability edges | Runtime enforcement correctness, code quality |
|
|
216
|
+
| `/qfai-atdd` | Obligation coverage, layer placement, annotation validity | Implementation structure |
|
|
217
|
+
| `/qfai-implement` | Code quality, spec alignment of the item, RED/GREEN evidence | Upstream spec content, contract design |
|
|
218
|
+
| `/qfai-configure` | Config / manifest validity and the surfaces the run generated | Spec content, implementation structure |
|
|
219
|
+
| `/qfai-verify` | Gate execution, evidence completeness, report / artifact fidelity | Authoring quality of the artifacts it verifies |
|
|
220
|
+
| `/web-research` | Source authority and freshness, citation accuracy, claim support | Spec content, implementation structure |
|
|
221
|
+
|
|
222
|
+
**Fallback for any stage not listed.** A stage that references this baseline
|
|
223
|
+
without a row above has, as its remit, the artifacts that stage itself
|
|
224
|
+
produces; everything upstream of them is out of scope, recorded and deferred.
|
|
225
|
+
Add the row when a new stage starts routing blocking reviewers, so the
|
|
226
|
+
in/out split is not re-derived per run.
|
|
227
|
+
|
|
228
|
+
### Finding provenance (MUST)
|
|
229
|
+
|
|
230
|
+
- Every finding must declare a severity (`blocking` or `advisory`) and a `Traces to:` value.
|
|
231
|
+
- `Traces to:` names what the finding enforces. Legal values:
|
|
232
|
+
- an upstream obligation — an `AC-*`, `BR-*`, `TC-*`, `CON-*` ID, or a named
|
|
233
|
+
constitution/catalog rule;
|
|
234
|
+
- `defect:correctness`, `defect:security`, or `defect:code-quality` — a defect demonstrable from
|
|
235
|
+
the changed artifacts themselves, cited together with the evidence that demonstrates it. See
|
|
236
|
+
`drift-protocol.md#defect-or-new-scope-decide-this-first`. A reviewer who can show the
|
|
237
|
+
deliverable is wrong on its own terms does not need an `AC-*` to say so;
|
|
238
|
+
- `none` — reviewer-originated scope, i.e. a new product obligation upstream never asked for.
|
|
239
|
+
- A finding whose `Traces to:` is `none` MUST be recorded as `advisory`. It cannot be `blocking`,
|
|
240
|
+
and it cannot gate `DONE`.
|
|
241
|
+
- An advisory finding is routed to the Change Request / Open Question path defined in
|
|
242
|
+
`drift-protocol.md#reviewer-originated-obligations`, not to the implementer.
|
|
243
|
+
- Only `blocking` findings — those citing an upstream obligation or a defect class — force
|
|
244
|
+
`REVISE`.
|
|
245
|
+
|
|
246
|
+
### Reviewer budget exhausted
|
|
247
|
+
|
|
248
|
+
A blocking review that cannot be delegated because the agent budget is spent is a `saturated`
|
|
249
|
+
failure, not a licence to skip the gate or to self-review.
|
|
250
|
+
|
|
251
|
+
- First apply the `saturated` bounded retry. A freed slot is the preferred outcome.
|
|
252
|
+
- If retries are exhausted, a reviewer role MAY be reused sequentially with a cleared context,
|
|
253
|
+
provided the reviewer did not author or edit any artifact under review in this run. The
|
|
254
|
+
protected invariant is independence from authorship, not reviewer instance identity.
|
|
255
|
+
- Record the reuse in the Work Orders Summary (`Task title` prefixed `re-review (sequential reuse)`).
|
|
256
|
+
- If even sequential reuse is impossible, hard stop with the review gate recorded as `PENDING`
|
|
257
|
+
rather than `PASS`. `PENDING` is not `PASS`; DONE stays blocked and the stage stays resumable.
|
|
258
|
+
- Never record a waived or self-performed review as `PASS`.
|
|
259
|
+
|
|
49
260
|
## Work order template
|
|
50
261
|
|
|
51
262
|
```text
|
|
@@ -54,10 +265,12 @@ Role: <sub-agent role>
|
|
|
54
265
|
Goal: <what to decide/produce>
|
|
55
266
|
Inputs (refs):
|
|
56
267
|
- <file/section>
|
|
268
|
+
- constitution/drift-protocol.md#core-rule <!-- the protected set, in front of the agent -->
|
|
57
269
|
Constraints:
|
|
58
270
|
- must: enforce Drift Protocol
|
|
59
271
|
- must: follow applicable test-layer or validation policy
|
|
60
|
-
- must_not: patch upstream artifacts directly
|
|
272
|
+
- must_not: patch upstream artifacts directly; every upstream change requires
|
|
273
|
+
STOP + Change Request + owner rerun per constitution/drift-protocol.md
|
|
61
274
|
Output format:
|
|
62
275
|
- <headings / bullet schema>
|
|
63
276
|
Quality bar:
|
|
@@ -68,15 +281,38 @@ Quality bar:
|
|
|
68
281
|
## Reviewer response template
|
|
69
282
|
|
|
70
283
|
```text
|
|
284
|
+
Round: 1 | 2 | 2b
|
|
71
285
|
Result: PASS | REVISE
|
|
286
|
+
Reviewed revision: <git rev> | working-tree+<porcelain digest>
|
|
287
|
+
Authored/edited under review: none | <artifact refs this reviewer authored or edited in this run>
|
|
72
288
|
Findings:
|
|
73
|
-
- <issue>
|
|
289
|
+
- <issue> | Severity: blocking|advisory | Traces to: <AC-*/BR-*/TC-*/CON-*/rule-name|defect:correctness|defect:security|defect:code-quality|none>
|
|
74
290
|
Required fixes:
|
|
75
|
-
- <action>
|
|
291
|
+
- <action> # blocking findings only
|
|
292
|
+
Advisory / Change Request proposals:
|
|
293
|
+
- <proposal> # findings with `Traces to: none`; not a DONE gate
|
|
76
294
|
Evidence checked:
|
|
77
295
|
- <refs>
|
|
78
296
|
```
|
|
79
297
|
|
|
298
|
+
`Round` is required — the round budget above is counted from it. `2b` is the
|
|
299
|
+
post-escalation verification review of a user-named fix.
|
|
300
|
+
|
|
301
|
+
- `Reviewed revision` is REQUIRED. It names the state the verdict describes — a `git rev-parse HEAD`
|
|
302
|
+
value, or `working-tree+<digest of git status --porcelain>` when the tree is uncommitted. Without
|
|
303
|
+
it a verdict cannot be re-checked, cannot be invalidated by a later commit, and cannot be told
|
|
304
|
+
apart from a stale one, so "stale evidence MUST NOT be reused" has nothing to compare against.
|
|
305
|
+
Reviewers are dispatched against the integrated tree by design, so the tree is legitimately
|
|
306
|
+
allowed to move under them: an honest, independent verdict on a tree that no longer exists is the
|
|
307
|
+
normal failure this field addresses. If the tree changed mid-review, say so and name the revision
|
|
308
|
+
the ruling is pinned to.
|
|
309
|
+
- `Authored/edited under review` is REQUIRED. A response omitting it is not a valid review verdict.
|
|
310
|
+
- Anything other than `none` is a declared independence conflict: the verdict cannot be `PASS`,
|
|
311
|
+
and the review must be handed to a non-participating reviewer (see
|
|
312
|
+
`Definition: independent reviewer`).
|
|
313
|
+
- `Result: REVISE` is legal only when at least one finding is `Severity: blocking`. A response
|
|
314
|
+
whose findings are all advisory returns `Result: PASS` with the proposals attached.
|
|
315
|
+
|
|
80
316
|
### Verdict vocabulary
|
|
81
317
|
|
|
82
318
|
- Reviewer responses in-flight use `Result: PASS | REVISE` (this file).
|
|
@@ -3,6 +3,32 @@
|
|
|
3
3
|
Use this document to keep SKILL bodies compact.
|
|
4
4
|
Skill files should reference this baseline and only restate skill-specific additions or overrides.
|
|
5
5
|
|
|
6
|
+
## SKILL.md Authoring Shape (Mandatory)
|
|
7
|
+
|
|
8
|
+
A `SKILL.md` states the contract and points at the file that carries the detail.
|
|
9
|
+
It is not where the detail lives.
|
|
10
|
+
|
|
11
|
+
- **Keep in `SKILL.md`**: what the skill is for, its non-goals, its hard
|
|
12
|
+
constraints, the phase/step order, and the gate conditions. Enough for an
|
|
13
|
+
agent to know what it must do and when it is done.
|
|
14
|
+
- **Move out**: command sets, table schemas, field-by-field contracts, worked
|
|
15
|
+
procedures, checklists and rationale. These go under the skill's own
|
|
16
|
+
directory:
|
|
17
|
+
- `references/` — normative detail the skill body cites (`references/<topic>.md`)
|
|
18
|
+
- `templates/` — artifacts the skill produces, as fillable skeletons
|
|
19
|
+
- `examples/` — worked instances that illustrate, and bind, nothing
|
|
20
|
+
- **One topic per file.** Do not replace an oversized `SKILL.md` with an
|
|
21
|
+
oversized `references/everything.md`; that is the same problem one directory
|
|
22
|
+
down. Split by topic and keep each file readable on its own — a reader who
|
|
23
|
+
followed one pointer should not have to scan past three unrelated subjects to
|
|
24
|
+
reach the one they came for.
|
|
25
|
+
- **Every pointer resolves.** A `SKILL.md` line that moves detail out must name
|
|
26
|
+
the file (and anchor, when the file covers more than one topic) so the reader
|
|
27
|
+
is never left guessing where the rule went.
|
|
28
|
+
|
|
29
|
+
A hard line ceiling backs this up in the asset tests, but it is a backstop, not
|
|
30
|
+
the rule. A skill approaching it is a signal to move a section out.
|
|
31
|
+
|
|
6
32
|
## User Questions (AskUserQuestion Protocol)
|
|
7
33
|
|
|
8
34
|
- When a question to the user is needed, use AskUserQuestion if the tool is available.
|
|
@@ -11,6 +37,53 @@ Skill files should reference this baseline and only restate skill-specific addit
|
|
|
11
37
|
- Preserve structured choice semantics when falling back.
|
|
12
38
|
- State why AskUserQuestion was unavailable.
|
|
13
39
|
|
|
40
|
+
## Canonical qfai Launcher (Mandatory)
|
|
41
|
+
|
|
42
|
+
- **Launcher preflight — run once, before the first gate.** Confirm the project
|
|
43
|
+
resolves qfai from its own dependencies. Either proof is sufficient:
|
|
44
|
+
- **A local binary at `node_modules/.bin/qfai`.** The normal case for npm,
|
|
45
|
+
pnpm and Yarn configured with `nodeLinker: node-modules`.
|
|
46
|
+
- **A Plug'n'Play install.** Yarn Berry's default `nodeLinker: pnp` writes no
|
|
47
|
+
`node_modules/.bin`, so the file check alone would report a correctly
|
|
48
|
+
installed project as UNRUN forever. Accept it when the project has a
|
|
49
|
+
`.pnp.cjs` / `.pnp.loader.mjs` at its root and lists `qfai` in
|
|
50
|
+
`package.json` `dependencies` / `devDependencies`; `yarn exec qfai --help`
|
|
51
|
+
exiting 0 is the direct confirmation.
|
|
52
|
+
|
|
53
|
+
If neither proof holds, every gate below is UNRUN: report it as a blocker and
|
|
54
|
+
stop. The fix is to install the dependency (`npm i -D qfai`, or the pnpm /
|
|
55
|
+
yarn equivalent). `qfai` does not add itself to `package.json` on init, so a
|
|
56
|
+
project bootstrapped with `npx qfai init` alone has no local dependency yet.
|
|
57
|
+
|
|
58
|
+
- Once the preflight passes, invoke every gate through the launcher that proof
|
|
59
|
+
established:
|
|
60
|
+
- local binary -> `npx qfai …`, which resolves to it.
|
|
61
|
+
`node_modules/.bin/qfai …` is the same thing spelled out; prefer it when
|
|
62
|
+
PATH reachability is uncertain.
|
|
63
|
+
- Plug'n'Play -> `yarn exec qfai …` (equivalently `yarn qfai …`), which sets
|
|
64
|
+
up the PnP environment for the child process. Do **not** fall back to
|
|
65
|
+
`npx qfai` there: outside the PnP runtime it cannot see the workspace
|
|
66
|
+
dependency and would fetch a remote copy instead.
|
|
67
|
+
|
|
68
|
+
Read every `npx qfai …` example in the shipped docs as "the launcher the
|
|
69
|
+
preflight established", not as a literal command for a PnP project.
|
|
70
|
+
|
|
71
|
+
- Never launch a gate as a bare `qfai` command: qfai is a project dependency,
|
|
72
|
+
not a global one, so that is `command not found` on a normal local install —
|
|
73
|
+
and a gate that cannot run is a gate that silently passes.
|
|
74
|
+
- The preflight is the guard, not a flag. `npx` runs "a command from a local
|
|
75
|
+
**or remote** npm package": with nothing resolvable locally it downloads and
|
|
76
|
+
runs one (non-interactive shells do this without prompting), and
|
|
77
|
+
`npx --no-install` still executes a copy already sitting in the npx cache.
|
|
78
|
+
Neither spelling can tell you the qfai that ran was this project's; only the
|
|
79
|
+
preflight can.
|
|
80
|
+
- If the launcher cannot be resolved at any point, the gate is UNRUN, not PASS.
|
|
81
|
+
Report it as a blocker instead of completing the stage.
|
|
82
|
+
- The same launcher is documented in `.qfai/assistant/catalog/tech.md` and
|
|
83
|
+
`.qfai/assistant/catalog/structure.md`. The CI workflow generated by
|
|
84
|
+
`npx qfai init` is the one deliberate exception: it runs before any project
|
|
85
|
+
install can be assumed and must still be able to bootstrap.
|
|
86
|
+
|
|
14
87
|
## FORMAT SSOT (Mandatory)
|
|
15
88
|
|
|
16
89
|
- Before writing or editing `.qfai/**`, read the relevant README/template/sample for the target artifact.
|
|
@@ -41,16 +114,60 @@ Rules:
|
|
|
41
114
|
|
|
42
115
|
## Gate Failure Autorepair Protocol
|
|
43
116
|
|
|
44
|
-
When validate, doctor, test, lint, typecheck, build, capture, or report gates fail:
|
|
117
|
+
When validate, doctor, test, lint, typecheck, build, capture, or report gates fail — **or when a blocking reviewer returns `REVISE`** (the in-flight verdict; `status: "FAIL"` is only what a review pack's `summary.json` serializes — see `shared-skill-delegation-baseline.md#verdict-vocabulary`):
|
|
45
118
|
|
|
46
119
|
- inspect exit code, logs, `validate.json`, and cited files before reporting;
|
|
47
120
|
- classify each finding as skill-owned artifact, upstream spec/contract, code/test defect, environment/tooling, or user decision;
|
|
48
121
|
- fix skill-owned artifacts and code/test defects autonomously when the fix is local and non-destructive;
|
|
49
|
-
- rerun the
|
|
122
|
+
- **upstream spec/contract findings: never repair.** STOP and follow `.qfai/assistant/constitution/drift-protocol.md` (Change Request + owner-skill rerun) — **even when the fix looks local and non-destructive, and even when it is one token and obviously correct**. "Local and non-destructive" is a permission for the two classes above it; it is not a test that upstream artifacts can pass. Ownership, not size, decides;
|
|
123
|
+
- environment/tooling findings: repair the environment when it is yours to repair (install a missing dev dependency, regenerate a lockfile, create a scratch directory). Stop for anything needing credentials, network access you do not have, or a change to CI configuration or the host machine;
|
|
124
|
+
- user decision findings: never decide by default. Record the question, state the option you would take and why, and stop — a decision taken silently to keep a gate green is the same failure as repairing upstream, one layer up;
|
|
125
|
+
- rerun the same failing gate after each fix batch, **and once with no intervening change** when the failure looks nondeterministic — see `#nondeterministic-gates` below. The confirmation rerun is bounded at one: after it the finding is classified, not re-rolled;
|
|
50
126
|
- do not weaken profiles, lower `--fail-on`, waive errors, invent evidence, or skip required reviewers;
|
|
51
|
-
- stop
|
|
52
|
-
|
|
53
|
-
|
|
127
|
+
- stop for destructive changes, **any upstream spec/contract finding**, ambiguous product/spec decisions, missing permissions/tools, or repeated no-progress failures — the stop list is closed over the classification above, so every class the agent is told to use has a defined next action;
|
|
128
|
+
- stop on **round count** as well as on lack of progress: a reviewer gate that would enter its third round escalates to the user, even when every round has made progress. See `shared-skill-delegation-baseline.md#round-budget-must`.
|
|
129
|
+
|
|
130
|
+
When stopping, report: cause, attempted fixes, remaining blocker, user action, retry gate, and **the work counts — how many items are complete, how many are blocked, and by which finding**.
|
|
131
|
+
|
|
132
|
+
The counts are not decoration. Restating the ownership rule does not change the incentive that breaks it: an agent facing "repair five upstream defects or report most of the batch as blocked" reaches for the repair because the alternative reads as failure. `26 items: 21 complete, 5 blocked on CON-DB-0007` is a report of work done, and it is what makes STOP a credible answer rather than a surrender. Blocked is a status, not a verdict on the run.
|
|
133
|
+
|
|
134
|
+
### Nondeterministic gates
|
|
135
|
+
|
|
136
|
+
A gate whose answer varies on identical inputs is a finding in its own right,
|
|
137
|
+
not a run to discard. The protocol classifies it as `environment/tooling`; what
|
|
138
|
+
follows is what that class obliges.
|
|
139
|
+
|
|
140
|
+
**When a gate fails and a rerun with no intervening change passes**, all of the
|
|
141
|
+
following are REQUIRED. A clean rerun on its own is not evidence for that gate.
|
|
142
|
+
|
|
143
|
+
- **Record it as an `environment/tooling` finding.** Not as a pass, and not as
|
|
144
|
+
a code/test defect — nothing was fixed between the two runs.
|
|
145
|
+
- **Disclose every run.** Report the results of all runs of that gate, in order,
|
|
146
|
+
with their commands. Reporting only the run that passed is
|
|
147
|
+
[selective reporting](#selective-reporting-is-invented-evidence) and is
|
|
148
|
+
forbidden: the evidence rules are satisfied by a clean run's command and
|
|
149
|
+
output, so nothing else stops it.
|
|
150
|
+
- **Re-run the failing selectors in isolation** and report that result too. A
|
|
151
|
+
selector that passes alone and fails in the suite is the signature of shared
|
|
152
|
+
state, not of a defect in that test.
|
|
153
|
+
- **Name the suspected cause**, concretely: a contended port, a shared database
|
|
154
|
+
or schema, an `os.tmpdir()` path, an un-namespaced cache or queue, ordering
|
|
155
|
+
between workers. "Flaky" is not a cause.
|
|
156
|
+
|
|
157
|
+
Do not fix the flake by rerunning until green, and do not fix it by weakening
|
|
158
|
+
the test. Either the shared resource is isolated per worker or the run is
|
|
159
|
+
serialised — both are real changes with a real cost, which is the point.
|
|
160
|
+
|
|
161
|
+
A gate reported this way has **not passed**. It is a blocker with a named cause,
|
|
162
|
+
and it goes in the stop report like any other.
|
|
163
|
+
|
|
164
|
+
#### Selective reporting is invented evidence
|
|
165
|
+
|
|
166
|
+
Reporting the clean run and omitting the red ones satisfies every existing
|
|
167
|
+
evidence rule — a real command, a real result, freshly obtained — and still
|
|
168
|
+
misrepresents what happened. Which of N runs is reported is itself part of the
|
|
169
|
+
evidence, so omitting runs of the same gate is on the same footing as inventing
|
|
170
|
+
one.
|
|
54
171
|
|
|
55
172
|
## Completion Contract (Shared)
|
|
56
173
|
|
|
@@ -35,12 +35,13 @@ Do not proceed without a declared Change Type.
|
|
|
35
35
|
- Read and enforce `.qfai/assistant/constitution/drift-protocol.md`.
|
|
36
36
|
- Downstream phases must not edit upstream SSOT artifacts without explicit user approval.
|
|
37
37
|
- If drift is required, STOP and raise a Change Request (3 options + recommendation), then wait for approval and rerun the owner skill.
|
|
38
|
+
- The STOP is scoped: it halts the affected upstream artifact and every downstream item that depends on it, which the Change Request enumerates. Unaffected items continue, and more than one Change Request may be open at once — see `drift-protocol.md#multiple-open-change-requests`.
|
|
38
39
|
|
|
39
40
|
## Test-layer policy (Mandatory)
|
|
40
41
|
|
|
41
42
|
- Read and enforce `.qfai/assistant/catalog/test-layers.md`.
|
|
42
43
|
- Treat floors/ratios as signals, not completion gates.
|
|
43
|
-
- Completion gate is `qfai validate --fail-on error` with evidence.
|
|
44
|
+
- Completion gate is `npx qfai validate --fail-on error` with evidence.
|
|
44
45
|
|
|
45
46
|
---
|
|
46
47
|
|
|
@@ -52,7 +53,8 @@ Do not proceed without a declared Change Type.
|
|
|
52
53
|
3. Specification (SDD): unified preflight + `_policies` / `spec-*/01..10`
|
|
53
54
|
4. Prototyping (optional): contract-aligned implementation skeleton
|
|
54
55
|
5. Acceptance tests (ATDD): runnable E2E/API/Integration tests derived from specs/contracts obligations (`US` / `TC` / `CON-API`)
|
|
55
|
-
6.
|
|
56
|
+
6. Implementation (TDD): `/qfai-implement` drives the Red/Green/Refactor micro-cycle one `test-list.md` row at a time
|
|
57
|
+
7. Verify: run quality gates and provide evidence
|
|
56
58
|
|
|
57
59
|
Stage 3 (`/qfai-sdd`) target policy:
|
|
58
60
|
|
|
@@ -64,23 +66,67 @@ Stage 3 (`/qfai-sdd`) target policy:
|
|
|
64
66
|
Prototyping stage policy:
|
|
65
67
|
|
|
66
68
|
- `/qfai-prototyping` scope is fixed to **ALL specs** discovered from `.qfai/specs/spec-*`.
|
|
67
|
-
- Completion requires prototyping evidence (markdown + json in `.qfai/evidence/`) and `qfai validate --fail-on error` pass.
|
|
69
|
+
- Completion requires prototyping evidence (markdown + json in `.qfai/evidence/`) and `npx qfai validate --profile prototyping --fail-on error` pass. The profile is explicit on purpose: an omitted `--profile` defaults to `full`, which runs the ATDD traceability rules (`QFAI-ATDD-111/112/113`) at severity `error` — obligations of stage 5, which has not run yet at stage 4.
|
|
70
|
+
- The `/qfai-verify` run that feeds `npx qfai prototyping certify` writes `.qfai/output/verify.json` with `scope: "prototyping"`; certify accepts no other scope. See the Verify Output Contract in `.qfai/assistant/skills/qfai-verify/SKILL.md`.
|
|
68
71
|
- Coverage gaps (missing spec rows, unresolved declared checks, API 404) are blocking.
|
|
69
72
|
|
|
70
73
|
Implementation stage:
|
|
71
74
|
|
|
72
75
|
- `/qfai-implement` orchestrates the full TDD micro-cycle (Red/Green/Refactor) one test at a time using `test-list.md` as the execution ledger.
|
|
73
|
-
- Each item requires watch it fail (RED observation confirmed), watch it pass
|
|
76
|
+
- Each item requires watch it fail (RED observation confirmed), watch it pass
|
|
77
|
+
(GREEN observation confirmed), and fresh evidence (command+result pairs, not
|
|
78
|
+
status-only). A RED is admissible only when an assertion — or an
|
|
79
|
+
expected-exception check — inside the row's own `Selector` raised the failure;
|
|
80
|
+
a collection, import, syntax or fixture error, or an unasserted throw, is a
|
|
81
|
+
missing seam, not a RED
|
|
82
|
+
(`skills/qfai-implement/references/red-admissibility.md`).
|
|
83
|
+
- **Exception — RED not observable.** When the obligation is already satisfied
|
|
84
|
+
by a sibling row, the RED cannot be observed. The row then carries
|
|
85
|
+
falsifiability evidence in place of the RED pair; see
|
|
86
|
+
`.qfai/assistant/skills/qfai-implement/references/red-not-observable.md`.
|
|
87
|
+
- Weakening a correct test to manufacture a RED is forbidden.
|
|
74
88
|
- Completion requires independent spec review and code quality review gates — both must PASS before an item is marked done.
|
|
75
|
-
- Parallel execution is allowed only for independent slices with no shared state
|
|
89
|
+
- Parallel execution is allowed only for independent slices with no shared state.
|
|
76
90
|
|
|
77
91
|
Legacy note:
|
|
78
92
|
|
|
79
93
|
- The three legacy TDD skills were abolished. Use `/qfai-implement` instead.
|
|
80
94
|
|
|
95
|
+
### Concurrency (stage-independent, mandatory)
|
|
96
|
+
|
|
97
|
+
This subsection binds **every** stage that delegates in parallel, including
|
|
98
|
+
`/qfai-sdd` no-argument batch runs and `/qfai-implement` slice execution. It is
|
|
99
|
+
a real heading so `workflow.md#concurrency-stage-independent-mandatory` resolves
|
|
100
|
+
from the skills and baselines that cite it.
|
|
101
|
+
|
|
102
|
+
- Worktree separation is required whenever two or more delegated agents write
|
|
103
|
+
files concurrently. One agent per worktree; no shared index.
|
|
104
|
+
- If worktree separation is not available, parallel delegation degrades to
|
|
105
|
+
"one agent commits at a time; the others hand back an unstaged diff to the
|
|
106
|
+
orchestrator". State which of the two modes is in force in the stage
|
|
107
|
+
evidence.
|
|
108
|
+
- Commit scoping is mandatory in both modes and binds **every** committer —
|
|
109
|
+
delegated agent and orchestrator alike. Stage only the paths belonging to the
|
|
110
|
+
task being committed (`git add <paths>`). `git add -A`, `git add .` and
|
|
111
|
+
`git commit -a` are forbidden while any parallel stage is in flight.
|
|
112
|
+
- In **degraded / shared-index** mode the damage is immediate: the siblings
|
|
113
|
+
share one index, so a sweeping stage commits their in-flight files into an
|
|
114
|
+
unrelated commit and misattributes work in the audit trail the Drift
|
|
115
|
+
Protocol depends on.
|
|
116
|
+
- Under **worktree separation** there is no shared index, so no sibling file
|
|
117
|
+
can be swept in. The ban still holds: a sweeping stage commits whatever
|
|
118
|
+
else is loose in that agent's own worktree — build output, scratch files, a
|
|
119
|
+
half-finished edit outside the work order — so the commit still stops
|
|
120
|
+
matching its declared deliverables, which is what the audit trail reads.
|
|
121
|
+
- Degraded mode makes this the **orchestrator's** obligation above all, since
|
|
122
|
+
it is the one holding the commit: it commits one handed-back diff at a time,
|
|
123
|
+
staging that agent's declared deliverable paths only, and never blanket-stages
|
|
124
|
+
the shared worktree. A diff whose paths it cannot enumerate is not
|
|
125
|
+
committable — ask the agent for its path list first.
|
|
126
|
+
|
|
81
127
|
### Stage 0 — Steering refresh contract (mandatory)
|
|
82
128
|
|
|
83
|
-
At the beginning of each stage (`qfai-discussion`, `qfai-sdd`, `qfai-prototyping`, `qfai-atdd`, `qfai-verify`):
|
|
129
|
+
At the beginning of each stage (`qfai-discussion`, `qfai-sdd`, `qfai-prototyping`, `qfai-atdd`, `qfai-implement`, `qfai-verify`):
|
|
84
130
|
|
|
85
131
|
1. Check these steering files:
|
|
86
132
|
- `.qfai/assistant/catalog/manifest.md`
|
|
@@ -128,7 +174,7 @@ Typical minimum:
|
|
|
128
174
|
- typecheck
|
|
129
175
|
- tests
|
|
130
176
|
- pack/verify (if distributed)
|
|
131
|
-
- In CI, use default/full validation (`qfai validate --fail-on error`); `--phase refinement` is local-only.
|
|
177
|
+
- In CI, use default/full validation (`npx qfai validate --fail-on error`); `--phase refinement` is local-only.
|
|
132
178
|
- Waivers are for `warning` / `info` findings only. Waivers targeting `error` findings are treated as configuration errors and must fail.
|
|
133
179
|
|
|
134
180
|
---
|