qfai 2.1.0 → 2.1.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 +272 -20
- package/assets/defaults/workflows/change-tooling.yml +0 -4
- package/assets/init/.claude/settings.json +8 -8
- package/assets/init/.codex/hooks.json +6 -6
- package/assets/init/.qfai/assistant/agent/implementation-reviewer.md +14 -1
- package/assets/init/.qfai/assistant/agent/qa-gatekeeper.md +29 -0
- package/assets/init/.qfai/assistant/rule/constitution.md +5 -4
- package/assets/init/.qfai/assistant/rule/drift-protocol.md +14 -3
- package/assets/init/.qfai/assistant/rule/references/asset-authoring.md +70 -0
- package/assets/init/.qfai/assistant/rule/references/context-summary.md +30 -0
- package/assets/init/.qfai/assistant/rule/references/gate-failure-autorepair.md +42 -0
- package/assets/init/.qfai/assistant/rule/references/griller-recommendations.md +23 -0
- package/assets/init/.qfai/assistant/rule/references/host-backstops.md +60 -0
- package/assets/init/.qfai/assistant/rule/references/placeholder-scan.md +25 -0
- package/assets/init/.qfai/assistant/rule/references/reviewer-findings.md +41 -0
- package/assets/init/.qfai/assistant/rule/references/reviewer-remit.md +35 -0
- package/assets/init/.qfai/assistant/rule/shared-skill-delegation-baseline.md +26 -139
- package/assets/init/.qfai/assistant/rule/shared-skill-operating-baseline.md +6 -137
- package/assets/init/.qfai/assistant/rule/stage-cost.md +1 -1
- package/assets/init/.qfai/assistant/rule/test-layers.md +42 -0
- package/assets/init/.qfai/assistant/skill/qfai-configure/SKILL.md +8 -42
- package/assets/init/.qfai/assistant/skill/qfai-configure/references/principles.md +25 -0
- package/assets/init/.qfai/assistant/skill/qfai-discussion/SKILL.md +1 -1
- package/assets/init/.qfai/assistant/skill/qfai-discussion/references/discussion-completion-matrix.md +9 -2
- package/assets/init/.qfai/assistant/skill/qfai-discussion/references/ui_ux/platform_baselines.md +11 -0
- package/assets/init/.qfai/assistant/skill/qfai-discussion/references/ui_ux/review_audit_playbook.md +11 -0
- package/assets/init/.qfai/assistant/skill/qfai-discussion/references/ui_ux_best_practices.md +12 -36
- package/assets/init/.qfai/assistant/skill/qfai-grill/SKILL.md +1 -1
- package/assets/init/.qfai/assistant/skill/qfai-grilling/SKILL.md +16 -88
- package/assets/init/.qfai/assistant/skill/qfai-grilling/references/delegated-session.md +58 -0
- package/assets/init/.qfai/assistant/skill/qfai-grilling/references/session-record.md +42 -0
- package/assets/init/.qfai/assistant/skill/qfai-implement/SKILL.md +8 -1
- package/assets/init/.qfai/assistant/skill/qfai-implement/references/credential-reuse.md +9 -0
- package/assets/init/.qfai/assistant/skill/qfai-implement/references/cross-spec-ownership.md +41 -0
- package/assets/init/.qfai/assistant/skill/qfai-implement/references/oracle-strength.md +6 -1
- package/assets/init/.qfai/assistant/skill/qfai-implement/references/red-admissibility.md +1 -1
- package/assets/init/.qfai/assistant/skill/qfai-implement/references/ui-affecting.md +1 -3
- package/assets/init/.qfai/assistant/skill/qfai-maintain/SKILL.md +1 -1
- package/assets/init/.qfai/assistant/skill/qfai-migration-v1-to-v2/SKILL.md +4 -4
- package/assets/init/.qfai/assistant/skill/qfai-migration-v1-to-v2/references/migration-guide.md +19 -5
- package/assets/init/.qfai/assistant/skill/qfai-prototyping/SKILL.md +1 -1
- package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/design-md-spec.md +14 -5
- package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/generator-prompt.md +10 -0
- package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/handoff.md +1 -1
- package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/iteration-loop.md +3 -4
- package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/review-payload-schema.md +10 -2
- package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/reviewer-prompt.md +16 -3
- package/assets/init/.qfai/assistant/skill/qfai-run/SKILL.md +6 -21
- package/assets/init/.qfai/assistant/skill/qfai-run/references/extraction.md +30 -10
- package/assets/init/.qfai/assistant/skill/qfai-run/references/operator-screens.md +34 -0
- package/assets/init/.qfai/assistant/skill/qfai-run/references/plan.md +28 -5
- package/assets/init/.qfai/assistant/skill/qfai-run/references/stage-points.md +29 -0
- package/assets/init/.qfai/assistant/skill/qfai-sdd/SKILL.md +1 -1
- package/assets/init/.qfai/assistant/skill/qfai-sdd/references/concrete-abstract-cycle.md +10 -1
- package/assets/init/.qfai/assistant/skill/qfai-sdd/references/contract-artifact-rules.md +21 -9
- package/assets/init/.qfai/assistant/skill/qfai-sdd/references/design-anti-patterns.md +19 -2
- package/assets/init/.qfai/assistant/skill/qfai-sdd/references/design-md-authoring.md +11 -5
- package/assets/init/.qfai/assistant/skill/qfai-sdd/references/design-md-brand-catalog.md +17 -2
- package/assets/init/.qfai/assistant/skill/qfai-sdd/references/requirements-decomposition.md +2 -2
- package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-execution-playbook.md +5 -5
- package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-phase-checklists.md +4 -4
- package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-quality-gate.md +2 -2
- package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-triage.md +47 -5
- package/assets/init/.qfai/assistant/skill/qfai-sdd/references/spec-traceability-rules.md +15 -3
- package/assets/init/.qfai/assistant/skill/qfai-sdd/references/ui-contract-guide.md +16 -1
- package/assets/init/.qfai/assistant/skill/qfai-sdd/references/ui-design-contract-normalization.md +1 -2
- package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/change-request.md +2 -2
- package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/contracts/db-contract.sample.sql +2 -2
- package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/03_contract/cli/cli-NNNN-title.md +2 -2
- package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/03_contract/tech.md +1 -1
- package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/decisions.md +4 -0
- package/assets/init/.qfai/assistant/skill/qfai-triage/SKILL.md +1 -1
- package/assets/init/.qfai/assistant/skill/qfai-verify/SKILL.md +1 -1
- package/assets/init/.qfai/assistant/skill/qfai-verify/references/verify-output-contract.md +22 -8
- package/assets/init/.qfai/assistant/skill/web-research/SKILL.md +2 -10
- package/assets/init/.qfai/assistant/step/common-design-md/STEP.md +17 -3
- package/assets/init/.qfai/assistant/step/common-gate-run/STEP.md +30 -7
- package/assets/init/.qfai/assistant/step/discussion-uiux/STEP.md +11 -1
- package/assets/init/.qfai/assistant/step/implement-dep-bump/STEP.md +7 -0
- package/assets/init/.qfai/assistant/step/implement-scaffold/STEP.md +3 -3
- package/assets/init/.qfai/assistant/step/implement-seam/STEP.md +3 -1
- package/assets/init/.qfai/assistant/step/implement-tdd/STEP.md +3 -1
- package/assets/init/.qfai/assistant/step/implement-test-fix/STEP.md +2 -0
- package/assets/init/.qfai/assistant/step/sdd-flow/STEP.md +2 -0
- package/assets/init/.qfai/assistant/step/sdd-gate/STEP.md +4 -0
- package/assets/init/.qfai/assistant/step/sdd-triage/STEP.md +7 -3
- package/assets/init/.qfai/assistant/step/verify-change-note/STEP.md +8 -5
- package/assets/init/.qfai/assistant/step/verify-commit/STEP.md +6 -1
- package/assets/init/.qfai/assistant/step/verify-qfai-gate/STEP.md +20 -3
- package/assets/init/.qfai/assistant/step/verify-repeat-run/STEP.md +1 -1
- package/assets/init/.qfai/assistant/step/verify-repo-gate/STEP.md +23 -6
- package/assets/init/.qfai/waivers.yml +1 -1
- package/assets/init/root/.agents/rules/ai-readable-markdown.md +98 -0
- package/assets/init/root/.agents/rules/api-budget.md +4 -5
- package/assets/init/root/.agents/rules/documentation-clarity.md +30 -2
- package/assets/init/root/.agents/rules/grilling.md +4 -4
- package/assets/init/root/.agents/rules/interface-clarity.md +5 -5
- package/assets/init/root/.agents/rules/minimal-implementation.md +8 -0
- package/assets/init/root/.agents/rules/reminders.json +2 -2
- package/assets/init/root/.agents/rules/temporary-files.md +14 -5
- package/assets/init/root/.agents/rules/untrusted-content.md +3 -3
- package/assets/init/root/.agents/rules/user-questions.md +34 -7
- package/assets/init/root/.gitattributes +9 -0
- package/assets/init/root/.github/workflows/qfai-docs.yml +43 -11
- package/assets/init/root/.github/workflows/qfai-tests.yml +58 -15
- package/assets/init/root/.github/workflows/qfai-validate.yml +49 -42
- package/assets/init/root/AGENTS.md +1 -0
- package/assets/init/root/CLAUDE.md +1 -0
- package/assets/mdschema/story/03_contract/tech.mdschema.yml +7 -3
- package/assets/sandbox-templates/default-deny.yaml +0 -2
- package/assets/schemas/workflow/plan.schema.json +9 -2
- package/assets/scripts/check-mdschema.mjs +172 -5
- package/dist/cli/index.cjs +3979 -3055
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.mjs +3167 -2243
- package/dist/cli/index.mjs.map +1 -1
- package/dist/index.cjs +3024 -2500
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -9
- package/dist/index.d.ts +23 -9
- package/dist/index.mjs +2881 -2358
- package/dist/index.mjs.map +1 -1
- package/docs/MIGRATION-2.0.0.md +1 -1
- package/package.json +3 -3
|
@@ -23,9 +23,25 @@ classified by the taxonomy below before any response.
|
|
|
23
23
|
- The orchestrator may author any artifact itself, or give independent parts of
|
|
24
24
|
the work to sub-agents that run in parallel. It integrates and presents the
|
|
25
25
|
results.
|
|
26
|
+
- The orchestrator is not required to wait while a sub-agent runs. Where the
|
|
27
|
+
host starts a delegation and returns at once, delivers the finished result
|
|
28
|
+
later as a message, and lets the orchestrator wait for a result on purpose,
|
|
29
|
+
the orchestrator carries on with its own work meanwhile and waits only when
|
|
30
|
+
it has none. A host without all three keeps the orchestrator waiting.
|
|
31
|
+
- That work is planning, preparing the next work order, integrating results
|
|
32
|
+
already returned, and its own part of the task. It never repeats the work it
|
|
33
|
+
handed out. Starting another delegation needs the independence conditions of
|
|
34
|
+
`.qfai/assistant/skill/qfai-implement/references/parallelization-policy.md`.
|
|
35
|
+
Where the stage's ledger or a seam makes an ordering mandatory, carrying on
|
|
36
|
+
does not override it.
|
|
26
37
|
- A review is done by an agent that did not author what it reviews. The
|
|
27
38
|
orchestrator never reviews its own work and never approves it for
|
|
28
39
|
convenience.
|
|
40
|
+
- A read-only agent never runs `git checkout` or `git switch` in a worktree it
|
|
41
|
+
shares; it reads other revisions with `git show <rev>:<path>`. Each agent
|
|
42
|
+
writes scratch files only under a path of its own.
|
|
43
|
+
- Commit the change, or give each reviewer a fixed commit, before a review
|
|
44
|
+
starts, and leave the working tree alone until every review returns.
|
|
29
45
|
|
|
30
46
|
### Capability Probe (MUST)
|
|
31
47
|
|
|
@@ -95,68 +111,13 @@ has to do, and the class is `unavailable` or
|
|
|
95
111
|
### Commit Scoping
|
|
96
112
|
|
|
97
113
|
- A delegated agent stages only the paths it declared as deliverables in its work order: `git add <path> …`.
|
|
98
|
-
- `git add -A`, `git add .` and `git commit -a` are forbidden for delegated agents, in both isolation modes. In degraded / shared-index mode the concurrent agents share one index, so a sweeping stage command commits a sibling agent's in-flight files and misattributes work in the audit trail. Under worktree separation
|
|
99
|
-
|
|
100
|
-
- When the agent's deliverable paths are not known up front, it hands back an unstaged diff and the orchestrator commits — under the same rule. The orchestrator commits one handed-back diff at a time, stages that agent's declared paths only, and is equally forbidden from `git add -A` / `git add .` / `git commit -a` while a parallel stage is in flight. Being the committer does not exempt
|
|
101
|
-
it; in degraded mode it is the only committer, so a sweeping stage there mixes every sibling's work into one commit.
|
|
114
|
+
- `git add -A`, `git add .` and `git commit -a` are forbidden for delegated agents, in both isolation modes. In degraded / shared-index mode the concurrent agents share one index, so a sweeping stage command commits a sibling agent's in-flight files and misattributes work in the audit trail. Under worktree separation the command still stages whatever else is loose in that agent's own worktree.
|
|
115
|
+
- When the agent's deliverable paths are not known up front, it hands back an unstaged diff and the orchestrator commits — under the same rule. The orchestrator commits one handed-back diff at a time, stages that agent's declared paths only, and is equally forbidden from `git add -A` / `git add .` / `git commit -a` while a parallel stage is in flight. Being the committer does not exempt it.
|
|
102
116
|
- Isolation requirements for concurrent stages are defined once in `.qfai/assistant/rule/workflow.md#concurrency-stage-independent-mandatory`.
|
|
103
117
|
|
|
104
118
|
### Host backstops above the declared shape
|
|
105
119
|
|
|
106
|
-
|
|
107
|
-
the agent doing the dispatch. A run that has lost its way is the one least likely
|
|
108
|
-
to apply them, so nothing here bounds a run that spawns more workers than it
|
|
109
|
-
declared, nests delegation deeper than the stage intended, or keeps spending.
|
|
110
|
-
|
|
111
|
-
Some hosts refuse delegation outside their limits. Each control below states
|
|
112
|
-
what it covers.
|
|
113
|
-
QFAI sets none of them, so the host defaults stand.
|
|
114
|
-
|
|
115
|
-
**A backstop sits above the declared shape, never at it.** Leave room for other
|
|
116
|
-
permitted agents sharing the host limit. The policy decides the ordinary case.
|
|
117
|
-
|
|
118
|
-
Claude Code 2.1.217 or later:
|
|
119
|
-
|
|
120
|
-
| Control | Default | What it bounds |
|
|
121
|
-
| ------------------------------------------------------------------------------------ | ---------------------------- | ---------------------------------------------------------- |
|
|
122
|
-
| `CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH` | 3 (1 in 2.1.217 and 2.1.218) | How deep delegation nests. `1` turns nesting off |
|
|
123
|
-
| `CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS` | 20 | When new Agent tool spawns are refused |
|
|
124
|
-
| `--max-budget-usd` in print mode; `maxBudgetUsd` / `max_budget_usd` in the Agent SDK | none | What one run may spend, in US dollars, sub-agents included |
|
|
125
|
-
|
|
126
|
-
The spawn limit has exceptions for ultracode, `/subtask` forks, and resuming an
|
|
127
|
-
exited agent.
|
|
128
|
-
|
|
129
|
-
Codex:
|
|
130
|
-
|
|
131
|
-
| Control | Default | What it bounds |
|
|
132
|
-
| ----------------------------------------------------------------------------------------- | -------------------------- | --------------------------------------------------------------------- |
|
|
133
|
-
| `agents.max_concurrent_threads_per_session` in `config.toml` (alias `agents.max_threads`) | chosen by Codex when unset | How many spawned-agent threads are open at once, the primary excluded |
|
|
134
|
-
|
|
135
|
-
No equivalent was confirmed for nesting depth or for a spend cap.
|
|
136
|
-
|
|
137
|
-
GitHub Copilot CLI:
|
|
138
|
-
|
|
139
|
-
| Control | Documented default | What it bounds |
|
|
140
|
-
| ---------------------------------- | ------------------------------------ | ---------------------------------------- |
|
|
141
|
-
| `subagents.maxDepth` setting | 6 in the limits table | How deep sub-agents nest |
|
|
142
|
-
| `COPILOT_SUBAGENT_MAX_DEPTH` | 4 in the environment-variable table | How deep sub-agents nest |
|
|
143
|
-
| `subagents.maxConcurrency` setting | set by the Copilot plan, 2 to 32 | How many sub-agents run at once |
|
|
144
|
-
| `COPILOT_SUBAGENT_MAX_CONCURRENT` | 32 in the environment-variable table | How many sub-agents run at once |
|
|
145
|
-
| `--max-ai-credits` | unset | AI credits per response, as a soft limit |
|
|
146
|
-
|
|
147
|
-
The two settings take effect only on usage-based billing plans.
|
|
148
|
-
|
|
149
|
-
The depth defaults disagree across the CLI documentation. Which control takes
|
|
150
|
-
precedence was not confirmed.
|
|
151
|
-
|
|
152
|
-
VS Code Local harness (`runSubagent`):
|
|
153
|
-
|
|
154
|
-
| Control | Default | What it bounds |
|
|
155
|
-
| ---------------------------------------------- | ------- | --------------------------------------------------------------------- |
|
|
156
|
-
| `chat.subagents.allowInvocationsFromSubagents` | `false` | Whether a sub-agent may start sub-agents. Nesting stops at depth five |
|
|
157
|
-
|
|
158
|
-
No equivalent was confirmed for concurrent sub-agents or for a spend cap. None
|
|
159
|
-
was confirmed for any of the three in the Copilot cloud agent.
|
|
120
|
+
Read `.qfai/assistant/rule/references/host-backstops.md` when you set or read a host limit on agents, or a run stops at one. It holds the backstops each host applies above the declared shape and how to leave room for them. Not needed when no host limit is involved.
|
|
160
121
|
|
|
161
122
|
## Work Orders Summary
|
|
162
123
|
|
|
@@ -201,26 +162,6 @@ use subagents to verify your own work" does not apply to this gate. The
|
|
|
201
162
|
definition above already excludes an agent reviewing its own output. The author
|
|
202
163
|
cannot accept its own output.
|
|
203
164
|
|
|
204
|
-
#### A griller's recommendations, and what they disqualify
|
|
205
|
-
|
|
206
|
-
A grilling session puts a recommended answer beside each question (`.agents/rules/grilling.md`). Who settled the decision decides what happens next.
|
|
207
|
-
|
|
208
|
-
| The decision was settled | What follows |
|
|
209
|
-
| ----------------------------------------------------- | --------------------------------------------------------------------------------- |
|
|
210
|
-
| By the user, from the recommendation among the inputs | The decision is theirs. The griller may review the artifact |
|
|
211
|
-
| Agent to agent, not critical | The decision stands. The griller that recommended it does not review the artifact |
|
|
212
|
-
| Agent to agent, critical, with no user adjudication | The artifact is wrong, and no reviewer can clear it |
|
|
213
|
-
|
|
214
|
-
**The second row is how a delegated session is meant to end** (`.agents/rules/grilling.md`), not a finding. The reviewer checks that the decision is in the final report and is not critical. A reviewer that doubts its merit raises that as an ordinary finding against the artifact, under its own remit, as it would for any other content.
|
|
215
|
-
|
|
216
|
-
**The third row is not a routing problem.** A critical decision is the user's in every session, and a run that could not ask records it as an open question rather than adopting it. An agent-adopted critical decision is therefore an artifact carrying something nobody with the standing decided, and handing it to a different reviewer would launder it.
|
|
217
|
-
The reviewer must return `REVISE` and name the decision: it is reopened and put to the user, or recorded open where no question can be asked.
|
|
218
|
-
|
|
219
|
-
The first row needs a reason, because the intuitive one is wrong. A sub-agent starting with a reset context cannot defer to something it does not remember, so deference is not the risk. **Correlation** is: a fresh instance of the same agent, on the same model, over the same evidence, re-derives the preference that produced the recommendation and finds it good on the merits. Resetting the
|
|
220
|
-
context removes the memory, not the disposition — which is why role name alone never establishes independence either. Where the user chose, that disposition is one input among several and the decision is not the griller's to re-derive.
|
|
221
|
-
|
|
222
|
-
**The stage's final report is the record.** It lists every decision the agents adopted and the agent that recommended it, so a reviewer with a reset context reads the third row off the report rather than off recollection.
|
|
223
|
-
|
|
224
165
|
- Reviewers must verify Drift Protocol enforcement
|
|
225
166
|
(`.qfai/assistant/rule/drift-protocol.md`).
|
|
226
167
|
- Reviewers must verify test-layer policy enforcement when relevant
|
|
@@ -231,79 +172,25 @@ context removes the memory, not the disposition — which is why role name alone
|
|
|
231
172
|
- An in-scope blocking finding from a routed reviewer prevents DONE until it is fixed or answered; no reviewer is rerun.
|
|
232
173
|
- Every reviewer returning `REVISE` must include a concrete fix proposal.
|
|
233
174
|
|
|
175
|
+
#### A griller's recommendations, and what they disqualify
|
|
176
|
+
|
|
177
|
+
Read `.qfai/assistant/rule/references/griller-recommendations.md` when a griller's recommendation is offered as evidence for a decision, or when you check whether a griller may review the work it interviewed. Not needed otherwise.
|
|
178
|
+
|
|
234
179
|
### Review convergence
|
|
235
180
|
|
|
236
181
|
A stage is reviewed once, and the author fixes or answers every finding with no re-review: `.qfai/assistant/rule/review-convergence.md`.
|
|
237
182
|
|
|
238
183
|
### Reviewer remit (in scope per stage)
|
|
239
184
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
| Stage | In scope | Out of scope (record and defer) |
|
|
243
|
-
| -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
|
|
244
|
-
| `/qfai-discussion` | Requirement clarity, scope boundary, decision traceability | Spec structure, runtime behavior |
|
|
245
|
-
| `/qfai-sdd` | Spec / contract consistency, testability, traceability edges, each document in its template's shape | Runtime enforcement correctness, code quality |
|
|
246
|
-
| `/qfai-implement` | Code quality, spec alignment of the item, RED/GREEN evidence, silent failure and type design across the whole of every file the change touches | Upstream spec content, contract design, and a finding on code in a touched file that the change did not add or alter |
|
|
247
|
-
| `/qfai-prototyping` | The prototype against its UI contracts and the root `DESIGN.md`, loop evidence, the handoff | Spec and contract content, downstream implementation code |
|
|
248
|
-
| `/qfai-migration-v1-to-v2` | Migration plan and report fidelity, ID mapping, every deletion listed in the reports, each written document in its template's shape | New story content and downstream implementation quality |
|
|
249
|
-
| `/qfai-configure` | Config / manifest validity and the surfaces the run generated | Spec content, implementation structure |
|
|
250
|
-
| `/qfai-verify` | Gate execution, evidence completeness, report / artifact fidelity | Authoring quality of the artifacts it verifies |
|
|
251
|
-
| `/web-research` | Source authority and freshness, citation accuracy, claim support | Spec content, implementation structure |
|
|
252
|
-
| `/qfai-grilling` | Decisions asked rather than assumed, facts naming where they were read, the session's end condition | The merit of what the user decided, and the artifacts the invoking stage writes from it |
|
|
253
|
-
| `/qfai-grill` | The same, reported to the user rather than to a stage | The merit of what the user decided; there is no artifact to review |
|
|
254
|
-
| `/qfai-maintain` | That the diff changes no behaviour, and the checks run over it | Whether the new wording is the better one |
|
|
255
|
-
| `/qfai-triage` | That no tracked file changed, the recorded outcome, each follow-up, and the sources an answer cites | The work a follow-up request describes |
|
|
256
|
-
| `/qfai-run` | The artifacts the session writes, in the specification or code review the plan names after a stage | Whether the route the decision rules chose was the right one |
|
|
257
|
-
|
|
258
|
-
Article VII excess in the reviewing stage's own artifacts is in scope;
|
|
259
|
-
quality of downstream implementation code is deferred at upstream stages.
|
|
260
|
-
|
|
261
|
-
Apply this route only where the installed Article VII governs the artifact.
|
|
262
|
-
A retained constitution does not gain newer authority from refreshed cards.
|
|
263
|
-
Report an unsupported Article VII route as advisory and follow the installed constitution.
|
|
264
|
-
|
|
265
|
-
A step's remit is its owner's row. A `common-*` step's work is reviewed under
|
|
266
|
-
the row of the skill whose stage ran it.
|
|
267
|
-
|
|
268
|
-
**Fallback for any stage not listed.** A stage that references this baseline without a row above has, as its remit, the artifacts that stage itself produces; everything upstream of them is out of scope, recorded and deferred. Add the row when a new stage starts routing blocking reviewers, so the in/out split is not re-derived per run.
|
|
185
|
+
Read `.qfai/assistant/rule/references/reviewer-remit.md` when you brief a reviewer or judge whether a finding is in scope for the stage under review. It holds what each stage's reviewer may and may not examine. Not needed when no review runs.
|
|
269
186
|
|
|
270
187
|
### Finding provenance
|
|
271
188
|
|
|
272
|
-
-
|
|
273
|
-
- `Traces to:` names what the finding enforces. Legal values:
|
|
274
|
-
- an upstream obligation — a `BF-*`, `AC-*`, `EX-*`, `BR-*` or contract ID, or a named shared rule **that governs the product's behaviour**;
|
|
275
|
-
- `defect:correctness`, `defect:security`, or `defect:code-quality` — a defect demonstrable from the changed artifacts themselves, cited with the evidence that demonstrates it (see `.qfai/assistant/rule/drift-protocol.md#defect-or-new-scope-decide-this-first`). A reviewer who can show the deliverable is wrong on its own terms does not need an `AC-*` to say so;
|
|
276
|
-
- `record:<CODE>` — a defect in the run's own record rather than in the product: an evidence section, a round block, an anchor, or provenance prose. `<CODE>` names the record rule;
|
|
277
|
-
- `none` — reviewer-originated scope, i.e. a new product obligation upstream never asked for.
|
|
278
|
-
- `record:*` and `none` MUST be recorded as `advisory`; neither can be `blocking` or gate `DONE`. A `record:*` finding never re-runs the row: the orchestrator files it in the record-defect queue the reviewing stage's own completion contract names, and that contract is what drains it (`.qfai/assistant/rule/drift-protocol.md#the-record-defect-queue`). **The class needs a drain:
|
|
279
|
-
only a stage whose completion conditions require that queue drained may use it — today `/qfai-implement` alone, so `/qfai-sdd`, `/qfai-configure`, `/qfai-verify`, `/qfai-discussion` and `/web-research` reviewers must not, and there the finding keeps the class it would otherwise have had.** An entry closes only on a repaired record;
|
|
280
|
-
`record:unchecked` is a bug report against `validateTddList` and never a substitute for the repair — a record rule worth a round is worth a validator code.
|
|
281
|
-
- **Integrity is not record class.** Evidence copied from another round or a sibling row, an anchor resolving to a run other than the one it names, and a reviewer that authored what it reviews all claim work that was not done or independence that is missing. A `PASS` built on them is refused,
|
|
282
|
-
so they stay `blocking` as `defect:code-quality` and are never filed as `record:*` — which covers an honestly produced record that is merely wrong.
|
|
283
|
-
- A `none` advisory takes the Change Request / Open Question path (`.qfai/assistant/rule/drift-protocol.md#reviewer-originated-obligations`); a `record:*` advisory takes the queue above. Neither goes to the implementer.
|
|
284
|
-
- Only `blocking` findings force `REVISE`, and only a finding citing a behaviour-governing obligation or a defect class may be one. **The trace class bounds which findings may block; the severity is declared, and it settles whether one does.** Read as "an obligation trace is blocking", the same item was a discussion-blocking defect to one reviewer and carried advice to the next.
|
|
285
|
-
- An obligation-traced finding is recorded `advisory` where a named section places the work outside the reviewed stage. The discussion review's implementation precision is that section
|
|
286
|
-
(`.qfai/assistant/rule/review-convergence.md#discussion-review-precision`): the obligation is agreed, and what the advice is about is how a later stage implements it, so the finding is carried to that stage rather than demanded here. Nothing else lowers a behaviour-governing finding to `advisory`.
|
|
189
|
+
Read `.qfai/assistant/rule/references/reviewer-findings.md` when you write or judge a reviewer finding: where it comes from, and what a reviewer may demand more of. Not needed when no review runs.
|
|
287
190
|
|
|
288
191
|
### What a reviewer may demand more of (MUST)
|
|
289
192
|
|
|
290
|
-
|
|
291
|
-
the concrete artifacts.
|
|
292
|
-
|
|
293
|
-
| Admissible on | Inadmissible on |
|
|
294
|
-
| ----------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
|
|
295
|
-
| business flows, user stories, acceptance criteria, examples, test cases | business rules, non-functional requirements, policies and decisions, architecture |
|
|
296
|
-
|
|
297
|
-
Two demands stay admissible on any artifact:
|
|
298
|
-
|
|
299
|
-
- that an abstract item already recorded carry its mandatory pair, such as a quality floor naming
|
|
300
|
-
its verification method;
|
|
301
|
-
- that a safety-floor item be met: security, accessibility, data-loss handling, or validation at a
|
|
302
|
-
trust boundary (`.agents/rules/minimal-implementation.md` § 2).
|
|
303
|
-
|
|
304
|
-
This bounds what a reviewer may require, never what a reviewer may report. A demand the table does
|
|
305
|
-
not admit, such as one for another business rule, is recorded as `advisory` and cannot force
|
|
306
|
-
`REVISE`.
|
|
193
|
+
What a reviewer may demand is in `.qfai/assistant/rule/references/reviewer-findings.md`, read under the condition above.
|
|
307
194
|
|
|
308
195
|
### Reviewer budget exhausted
|
|
309
196
|
|
|
@@ -4,70 +4,11 @@ Use this document to keep SKILL bodies compact. Skill files should reference thi
|
|
|
4
4
|
|
|
5
5
|
## Asset Authoring Shape (Mandatory)
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
- **Keep in `SKILL.md`**: what the skill is for, its non-goals, its hard constraints, the phase/step order, and the gate conditions. Enough for an agent to know what it must do and when it is done.
|
|
10
|
-
- **Move out**: command sets, table schemas, field-by-field contracts, worked procedures, checklists and rationale. These go under the owning tree's own directory:
|
|
11
|
-
- `references/` — normative detail the body cites (`references/<topic>.md`)
|
|
12
|
-
- `templates/` — artifacts the file produces, as fillable skeletons
|
|
13
|
-
- `examples/` — worked instances that illustrate, and bind, nothing
|
|
14
|
-
- **One topic per file.** Do not replace an oversized `SKILL.md` with an oversized `references/everything.md`; that is the same problem one directory down. Split by topic and keep each file readable on its own — a reader who followed one pointer should not have to scan past three unrelated subjects to reach the one they came for.
|
|
15
|
-
- **Every pointer resolves.** A line that moves detail out must name the file (and anchor, when the file covers more than one topic) so the reader is never left guessing where the rule went.
|
|
16
|
-
|
|
17
|
-
A hard line ceiling backs this up: **800 lines per assistant asset file**, for every `.qfai/assistant/**/*.{md,yml,yaml}` file, counted as `content.split(/\r?\n/).length` — blank lines included. `npx qfai doctor` measures it and reports every file over the ceiling as `assets.lineBudget`. The ceiling is a backstop, not the rule: a file approaching it is a signal to move a section out, not
|
|
18
|
-
to raise the number.
|
|
19
|
-
|
|
20
|
-
It was raised from 500 once, and on measurement rather than on the "this file is long" claim the number exists to refuse: three skill bodies had converged on that ceiling, and the changes in flight against one of them added 161 lines to a body already at 498 — eleven of them crossing the ceiling on their own. The detail those bodies carry is required to sit in the body rather than behind
|
|
21
|
-
a pointer, so splitting could not absorb it. Converging on the limit was itself the signal — a body at the ceiling stops shedding topics and starts packing them into longer lines, and a line count cannot see that. Raise it again only against evidence of that kind.
|
|
22
|
-
|
|
23
|
-
**A width ceiling makes the count honest: 400 characters per line.** A count of lines bounds reading cost only while a line is a roughly constant unit of reading, and packing broke that — one line in the shipped tree ran 9,104 characters against a median of 118, and cost the budget one unit. The two are read together, because each permits what the other refuses: width alone allows a thin
|
|
24
|
-
file of a thousand short lines, and the count alone allows a packed one.
|
|
25
|
-
|
|
26
|
-
Two shapes are not measured, and for the same reason — the author cannot make them narrower:
|
|
27
|
-
|
|
28
|
-
| not measured | why |
|
|
29
|
-
| -------------- | --------------------------------------------------------- |
|
|
30
|
-
| a table row | markdown gives it no continuation, so it cannot wrap |
|
|
31
|
-
| a fenced block | its content is a command, a diagram or a sample, verbatim |
|
|
32
|
-
|
|
33
|
-
A table is found by its delimiter row, not by a leading pipe: that pipe is optional, so a table written without one is still a table, and a paragraph that opens with one is still a paragraph. Rows a blank line has cut off from their delimiter are prose, because that is how they render.
|
|
34
|
-
|
|
35
|
-
Some shipped files predate the ceiling and carry a recorded width of their own. It is the width each arrives with, so `npx qfai doctor` does not report a fresh tree for content you received rather than wrote. That record belongs to the package and shrinks there; it is not a per-project allowance, and it never loosens the ceiling on an asset you write. **Everything you author is held
|
|
36
|
-
at 400.**
|
|
37
|
-
|
|
38
|
-
The exemption from the line ceiling does not carry here. Its reason is about a file's length, not about how wide one line may be.
|
|
39
|
-
|
|
40
|
-
No shipped prose asset has a line-ceiling exemption. Agent definitions are
|
|
41
|
-
individual cards under `assistant/agent/`, so their count does not lengthen
|
|
42
|
-
one roster file.
|
|
43
|
-
|
|
44
|
-
### The owning tree is the one the file sits in
|
|
45
|
-
|
|
46
|
-
The ceiling applies to **every** shipped assistant prose asset, including
|
|
47
|
-
rules and cards. A rule at the ceiling moves topic detail to
|
|
48
|
-
`rule/references/<topic>.md`; a skill uses its own `references/` directory.
|
|
49
|
-
The tree that owns the file owns its detail.
|
|
50
|
-
|
|
51
|
-
For a prose asset, raising the ceiling or claiming an exemption is not the remedy. An exemption claims no split is possible, and a Markdown file whose tree has a `references/` home available cannot make that claim.
|
|
52
|
-
|
|
53
|
-
### Machine-readable assets split in their own format, or say why they cannot
|
|
54
|
-
|
|
55
|
-
The ceiling is measured over YAML assets too — package routing and review-profile defaults and the shipped contract templates. The split above is not open to them: a validator parses those files as structured data, or a skill copies one whole into a project, so an entry moved into a Markdown sibling under `references/` leaves the parsed document and stops meaning anything. Prose about the
|
|
56
|
-
file may move there; the file's own items may not.
|
|
57
|
-
|
|
58
|
-
So for a machine-readable asset at the ceiling the remedy is, in order:
|
|
59
|
-
|
|
60
|
-
1. **Split it in its own format** — a sibling of the same kind that the loader or schema already reads, so every item stays parsed.
|
|
61
|
-
2. **Record an exemption** where the document has to stay whole — a file generated from another asset, one the schema admits only as a single document — naming what makes the split impossible. "This file is long" is not that reason, and a prose asset may not use this step.
|
|
7
|
+
Read `.qfai/assistant/rule/references/asset-authoring.md` when you write or change a file under `.qfai/assistant/**` or another shipped asset, including its citation paths. It holds the shape every asset takes, which tree owns a file, how machine-readable assets split, and the form of a citation path. Not needed for a run that only reads assets or edits project files.
|
|
62
8
|
|
|
63
9
|
## Citation Path Form (Mandatory)
|
|
64
10
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
- **Cite a shared rule by its full path from the project root.** Write the path from the project root, with `#anchor` appended when one applies: `.qfai/assistant/rule/drift-protocol.md`. Not the bare filename, not a relative climb. That form resolves from every directory in the tree,
|
|
68
|
-
and the only one that still resolves when read with the cwd at the project root — which is where an agent's cwd is.
|
|
69
|
-
- **The same holds when a rule cites another one**, including a sibling in its own directory. A bare name works there only by accident of where the citing file sits; it stops working the moment the text is quoted elsewhere.
|
|
70
|
-
- **Within a skill's own directory, keep pointers relative to that directory**: `references/<topic>.md`, `templates/<name>.md`. Those name the skill's own parts, not a shared document, and the surrounding text already establishes which skill is meant.
|
|
11
|
+
The form of a citation path is in `.qfai/assistant/rule/references/asset-authoring.md`, read under the same condition as the section above.
|
|
71
12
|
|
|
72
13
|
## User Questions (AskUserQuestion Protocol)
|
|
73
14
|
|
|
@@ -351,69 +292,11 @@ can resolve stops at preflight.
|
|
|
351
292
|
|
|
352
293
|
## Gate Failure Autorepair Protocol
|
|
353
294
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
- inspect exit code, logs, `validate.json`, and cited files before reporting — in `validate.json`, read `counts` for the verdict and `issues[].code` for each finding; the array is `issues`, not `findings` (keys: `.qfai/assistant/skill/qfai-verify/references/validate-json-schema.md`);
|
|
357
|
-
- classify each finding as skill-owned artifact, upstream spec/contract, code/test defect, environment/tooling, or user decision;
|
|
358
|
-
- fix skill-owned artifacts and code/test defects autonomously when the fix is local and non-destructive;
|
|
359
|
-
- **upstream spec/contract findings: never repair.** STOP and follow `.qfai/assistant/rule/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.
|
|
360
|
-
Ownership, not size, decides;
|
|
361
|
-
- 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;
|
|
362
|
-
- 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;
|
|
363
|
-
- 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;
|
|
364
|
-
- do not weaken profiles, lower `--fail-on`, waive errors, invent evidence, or skip required reviewers;
|
|
365
|
-
- 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;
|
|
366
|
-
|
|
367
|
-
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**.
|
|
368
|
-
|
|
369
|
-
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 DB-0007` is a report of work done, and it is what makes STOP a credible answer rather than a
|
|
370
|
-
surrender. Blocked is a status, not a verdict on the run.
|
|
371
|
-
|
|
372
|
-
### Nondeterministic gates
|
|
373
|
-
|
|
374
|
-
A gate whose answer varies on identical inputs is a finding in its own right, not a run to discard. The protocol classifies it as `environment/tooling`; what follows is what that class obliges.
|
|
375
|
-
|
|
376
|
-
**When a gate fails and a rerun with no intervening change passes**, all of the following are REQUIRED. A clean rerun on its own is not evidence for that gate.
|
|
377
|
-
|
|
378
|
-
- **Record it as an `environment/tooling` finding.** Not as a pass, and not as a code/test defect — nothing was fixed between the two runs.
|
|
379
|
-
- **Disclose every run.** Report the results of all runs of that gate, in order, with their commands. Reporting only the run that passed is [selective reporting](#selective-reporting-is-invented-evidence) and is forbidden: the evidence rules are satisfied by a clean run's command and output, so nothing else stops it.
|
|
380
|
-
- **Re-run the failing selectors in isolation** and report that result too. A selector that passes alone and fails in the suite is the signature of shared state, not of a defect in that test.
|
|
381
|
-
- **Name the suspected cause**, concretely: a contended port, a shared database or schema, an `os.tmpdir()` path, an un-namespaced cache or queue, ordering between workers. "Flaky" is not a cause.
|
|
382
|
-
|
|
383
|
-
Do not fix the flake by rerunning until green, and do not fix it by weakening the test. Either the shared resource is isolated per worker or the run is serialised — both are real changes with a real cost, which is the point.
|
|
384
|
-
|
|
385
|
-
A gate reported this way has **not passed**. It is a blocker with a named cause, and it goes in the stop report like any other.
|
|
386
|
-
|
|
387
|
-
#### Selective reporting is invented evidence
|
|
388
|
-
|
|
389
|
-
Reporting the clean run and omitting the red ones satisfies every existing evidence rule — a real command, a real result, freshly obtained — and still misrepresents what happened. Which of N runs is reported is itself part of the evidence, so omitting runs of the same gate is on the same footing as inventing one.
|
|
295
|
+
Read `.qfai/assistant/rule/references/gate-failure-autorepair.md` when a gate command fails or its result cannot be trusted. It holds the repair loop (inspect, classify, fix, rerun), the findings that are never repaired, when to stop and what to report, and how a gate that does not give the same answer twice is handled. Not needed while every gate passes.
|
|
390
296
|
|
|
391
297
|
## Context Summary Contract
|
|
392
298
|
|
|
393
|
-
|
|
394
|
-
needed to continue.
|
|
395
|
-
|
|
396
|
-
Every summary that replaces earlier context keeps these six:
|
|
397
|
-
|
|
398
|
-
1. Difficulties that came up, and how each was resolved.
|
|
399
|
-
2. Options raised, tried or set aside, and why.
|
|
400
|
-
3. Everything asked for, decided, agreed, ruled out or established as a constraint — in the exact words.
|
|
401
|
-
4. Where things stand: what is covered, settled or complete.
|
|
402
|
-
5. What is still open, promised or expected next.
|
|
403
|
-
6. Details that are hard to reconstruct: names, numbers, dates, exact wording, references.
|
|
404
|
-
|
|
405
|
-
It also keeps the stage state. None of it can be recovered from the code, and a summary that keeps the six and drops it still misleads the next window.
|
|
406
|
-
|
|
407
|
-
| Stage state | What goes wrong when it is dropped |
|
|
408
|
-
| ----------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
|
|
409
|
-
| The execution ledger and the row in progress | Finished rows are worked again, or a row in `red` is taken for untouched |
|
|
410
|
-
| Every open question, with its ID and status | A question stays open with nobody tracking it, or is answered twice |
|
|
411
|
-
| The clarification budget spent in this invocation, and the questions it was spent on | The next window asks what the user already answered, or asks past the cap |
|
|
412
|
-
| Every assumption recorded under `--auto` or after the budget ran out, with its label | A labelled assumption is read back as a decision someone took |
|
|
413
|
-
| Whether the stage's review has run, and each finding's fix or answer | The review runs a second time, or an answered finding is raised again (`.qfai/assistant/rule/review-convergence.md`) |
|
|
414
|
-
| A grilling session's decision tree, its current frontier, and the answers already settled | An answered question is asked again, or a question is put before the one it depends on (`.agents/rules/grilling.md`) |
|
|
415
|
-
|
|
416
|
-
Keep what the user said close to their own words. Your own reasoning may be condensed to what it concluded, as long as nothing listed above is dropped. Be complete on these items even when that makes the summary longer.
|
|
299
|
+
Read `.qfai/assistant/rule/references/context-summary.md` when you hand work to a sub-agent or summarize a context for the next stage. It holds what a summary that replaces earlier context must keep. Not needed when no summary is written.
|
|
417
300
|
|
|
418
301
|
## Completion Contract (Shared)
|
|
419
302
|
|
|
@@ -433,22 +316,8 @@ report instead of the completion claim.
|
|
|
433
316
|
|
|
434
317
|
### What the placeholder scan does not flag
|
|
435
318
|
|
|
436
|
-
|
|
437
|
-
table header, and a question row containing the fields required by its register. Story-tree `open-questions.md` uses
|
|
438
|
-
`ID | Content | Approach | Status`; an empty register contains the heading and table header without a question row.
|
|
439
|
-
Discussion registers use their own template fields. A register row's Status is structure too: `TODO` in the Status cell of a
|
|
440
|
-
`decisions.md` or `open-questions.md` row is the row's state, not a placeholder. Article II and `.qfai/assistant/rule/workflow.md` both end an
|
|
441
|
-
unverifiable fact by recording an Open Question, so the tracked record they prescribe must never be reported as an
|
|
442
|
-
unresolved placeholder. Everywhere else the two strings are still scanned: a bare `OQ` or `OPEN QUESTION` left as a
|
|
443
|
-
value in generated spec prose or a contract field, or a row missing a required field, is a hit like any other token.
|
|
444
|
-
|
|
445
|
-
**A documented `TBD` is a compliant record.** `.qfai/assistant/rule/constitution.md` Article II and `.qfai/assistant/rule/thinking.md` require writing `TBD` together with a note of what evidence is missing, and `.qfai/assistant/rule/thinking.md` requires raising the matching Open Question for the same fact. Both halves together are the finished form, not an
|
|
446
|
-
unfinished one; do not report it and do not delete it — deleting it destroys the record of the missing evidence, which is the whole point of the marker. A `TBD` missing either half — no note, or no Open Question — is a hit.
|
|
319
|
+
Read `.qfai/assistant/rule/references/placeholder-scan.md` when the placeholder scan reports a hit or you decide a hit is not a defect. It lists what the scan does not flag and what a surviving hit obligates. Not needed while the scan reports nothing.
|
|
447
320
|
|
|
448
321
|
### What a surviving hit obligates
|
|
449
322
|
|
|
450
|
-
|
|
451
|
-
calls it. List every hit the re-scan still finds alongside the completion claim — file, line, token — and state for each one whether it is deferred with rationale or recorded as an Open Question. A completion claim that omits a surviving hit is invalid evidence under the rules above. Completion is blocked while a surviving hit is neither of the two.
|
|
452
|
-
|
|
453
|
-
**Severity floor on the verdict.** _Deferred with rationale_ and _recorded as an Open Question_ are NOT available for a hit that stands in for a concrete security defect, data loss or corruption, or a correctness defect that would break a released contract. Such a hit is cleared only by a named fix or by dropping the item from scope; recording it and declaring completion anyway is
|
|
454
|
-
prohibited, exactly as `.qfai/assistant/rule/shared-skill-delegation-baseline.md` withholds that same exit for that same class. While neither of the two remaining verdicts applies, completion stays blocked.
|
|
323
|
+
The obligation a surviving hit carries is in `.qfai/assistant/rule/references/placeholder-scan.md`, read under the condition above.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Stage Cost
|
|
2
2
|
|
|
3
|
-
What a stage costs, and the
|
|
3
|
+
What a stage costs, and the settings that change it: how deeply a model reasons
|
|
4
4
|
per step, how long the stage is given, and how much of a file an edit rewrites.
|
|
5
5
|
|
|
6
6
|
None of them is a cap. Where a hard limit is wanted, it is the per-request
|
|
@@ -26,6 +26,9 @@ locations; a file outside the selection does not establish coverage.
|
|
|
26
26
|
|
|
27
27
|
Exercise one unit's observable decisions without real infrastructure. A
|
|
28
28
|
`QFAI:EX-NNNN-NNNN-NN` annotation links a behavioral unit test to its example.
|
|
29
|
+
The annotation counts only on the comment line directly before the `it(`,
|
|
30
|
+
`test(` or `describe(` it marks, or the equivalent test declaration of another
|
|
31
|
+
framework; a file header or a comment inside a test body covers nothing.
|
|
29
32
|
|
|
30
33
|
### L2 Component
|
|
31
34
|
|
|
@@ -91,6 +94,45 @@ EX may need an additional focused test even when its parent AC or BF is
|
|
|
91
94
|
covered. Keep independently observable cases in separate tests so a failure
|
|
92
95
|
points to the behavior that changed.
|
|
93
96
|
|
|
97
|
+
## Test-suite sizing
|
|
98
|
+
|
|
99
|
+
Every source change still carries test coverage, and every obligation still
|
|
100
|
+
has its test. This section sizes that coverage. It never removes any.
|
|
101
|
+
|
|
102
|
+
- **Size a new test file like the ones next to it.** Aim for roughly one
|
|
103
|
+
focused test per stated behaviour.
|
|
104
|
+
- **Choose a process-per-case suite, never inherit one.** A suite that spawns a
|
|
105
|
+
process for every case is the shape that makes a CI lane expensive. Pick it
|
|
106
|
+
for the suite in hand, not because the file beside it has it.
|
|
107
|
+
- **A scratch check is not a deliverable.** Verify the work in progress any way
|
|
108
|
+
you like. Do not turn a scratch check into a permanent test file. Scratch
|
|
109
|
+
files go where `.agents/rules/temporary-files.md` puts them.
|
|
110
|
+
|
|
111
|
+
These are review signals, not gates. No validator reads them.
|
|
112
|
+
|
|
113
|
+
## End-to-end test cost
|
|
114
|
+
|
|
115
|
+
An end-to-end test is the slowest test a project runs, and a failing one costs
|
|
116
|
+
the most. A test that cannot find an element waits for its whole timeout, and
|
|
117
|
+
waits again for every retry. One failure costs the timeout times the attempts,
|
|
118
|
+
and a red suite with no limit runs until the job is killed. The number of
|
|
119
|
+
failures sets the bill more than the number of tests does.
|
|
120
|
+
|
|
121
|
+
- **Set a failure limit.** Stop the run after a small number of failures.
|
|
122
|
+
- **Set a job time limit** well below the CI platform's default.
|
|
123
|
+
- **Lower the test timeout** to what a passing test needs. Allow at most one
|
|
124
|
+
retry in CI.
|
|
125
|
+
- **Do not share one database across parallel workers.** Concurrent tests
|
|
126
|
+
change each other's data, so one commit gives different results and a
|
|
127
|
+
failure cannot be told from noise. Give each worker its own data, or run one
|
|
128
|
+
worker.
|
|
129
|
+
- **Record traces only on a retry in CI,** not on every test.
|
|
130
|
+
- **Hold a count ceiling that only moves down.** Count end-to-end tests per
|
|
131
|
+
business flow, not per story or example. Prove an acceptance criterion or an
|
|
132
|
+
example in a lower layer.
|
|
133
|
+
|
|
134
|
+
These are review signals, not gates. No validator reads them.
|
|
135
|
+
|
|
94
136
|
## Test stub detection
|
|
95
137
|
|
|
96
138
|
A test is incomplete if its body contains a placeholder, skips the
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: qfai-configure
|
|
3
3
|
title: QFAI Configure (Tune qfai.config.yaml)
|
|
4
|
-
description: "Analyze the repository and tune qfai.config.yaml test globs and project overrides."
|
|
4
|
+
description: "Analyze the repository and tune qfai.config.yaml test globs and project overrides. Use when asked to configure QFAI for a repository, or to fix test globs that match the wrong files or none."
|
|
5
5
|
argument-hint: "[--auto]"
|
|
6
6
|
allowed-tools: [Read, Glob, Write, Edit, TodoWrite, Task, Agent]
|
|
7
7
|
roles:
|
|
@@ -25,7 +25,7 @@ QFAI Skill Body (SSOT)
|
|
|
25
25
|
|
|
26
26
|
## /qfai-configure - Configure QFAI for this repository
|
|
27
27
|
|
|
28
|
-
[DRIFT-PROTOCOL:
|
|
28
|
+
[DRIFT-PROTOCOL:REQUIRED]
|
|
29
29
|
|
|
30
30
|
## User Questions (AskUserQuestion Protocol)
|
|
31
31
|
|
|
@@ -69,18 +69,6 @@ When unsure, read inputs in this order:
|
|
|
69
69
|
|
|
70
70
|
Follow `.qfai/assistant/rule/shared-skill-delegation-baseline.md`.
|
|
71
71
|
|
|
72
|
-
### Orchestrator Protocol
|
|
73
|
-
|
|
74
|
-
- No additional overrides.
|
|
75
|
-
|
|
76
|
-
### Capability Probe
|
|
77
|
-
|
|
78
|
-
- No additional overrides.
|
|
79
|
-
|
|
80
|
-
### Delegation Failure (Hard Stop)
|
|
81
|
-
|
|
82
|
-
- No additional overrides.
|
|
83
|
-
|
|
84
72
|
### Work Orders Summary (evidence)
|
|
85
73
|
|
|
86
74
|
Use the shared schema.
|
|
@@ -179,30 +167,13 @@ The final report includes:
|
|
|
179
167
|
- gaps and open risks ("none" is acceptable if justified)
|
|
180
168
|
- the final status (PASS/FAIL) and who confirmed it
|
|
181
169
|
|
|
182
|
-
##
|
|
183
|
-
|
|
184
|
-
These principles are inspired by "constitution / articles" patterns used by other agent frameworks, but adapted to QFAI.
|
|
185
|
-
|
|
186
|
-
1. **SDD First (Specification is the source of truth)**
|
|
187
|
-
If there is a conflict between code and spec, treat the spec as authoritative and either (a) fix code or (b) raise an explicit Open Question to change the spec.
|
|
170
|
+
## Working principles
|
|
188
171
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
4. **Minimize scope, but never hide gaps**
|
|
196
|
-
Keep changes minimal, but do not "paper over" missing decisions. If something blocks correctness, stop and ask.
|
|
197
|
-
|
|
198
|
-
5. **Quality gates are the decision mechanism**
|
|
199
|
-
Use tests/lint/typecheck/build/pack verification (whatever the repo defines) as the primary guardrail. Fix until PASS.
|
|
200
|
-
|
|
201
|
-
6. **Make it runnable**
|
|
202
|
-
Outputs must be executable in terminal/CI. Provide copy-paste commands.
|
|
203
|
-
|
|
204
|
-
7. **User time is expensive**
|
|
205
|
-
Ask only the questions that are truly blocking. Everything else: make reasonable assumptions and label them clearly.
|
|
172
|
+
Read `references/principles.md` when a choice is not settled by a step below.
|
|
173
|
+
It holds the seven principles the steps follow: the specification is the
|
|
174
|
+
source of truth, traceability, evidence over confidence, minimal scope without
|
|
175
|
+
hidden gaps, quality gates, runnable output, and the user's time. A choice a step
|
|
176
|
+
settles needs no reading of it.
|
|
206
177
|
|
|
207
178
|
## README Rule
|
|
208
179
|
|
|
@@ -244,11 +215,6 @@ Return:
|
|
|
244
215
|
- proposed globs + rationale + evidence refs
|
|
245
216
|
```
|
|
246
217
|
|
|
247
|
-
### Failure rule
|
|
248
|
-
|
|
249
|
-
- A delegation the orchestrator chose to make is its own capability check.
|
|
250
|
-
- A failed delegation is handled as `.qfai/assistant/rule/shared-skill-delegation-baseline.md` sets out. Do not simulate roles.
|
|
251
|
-
|
|
252
218
|
## Completion Separation (mandatory)
|
|
253
219
|
|
|
254
220
|
- Config changes (`devops-ci-engineer`) and their approval (`qa-gatekeeper`) must be separate.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Working principles
|
|
2
|
+
|
|
3
|
+
The seven principles behind the steps of this skill. Read them when a choice is
|
|
4
|
+
not settled by a step.
|
|
5
|
+
|
|
6
|
+
1. **SDD First (Specification is the source of truth)**
|
|
7
|
+
If there is a conflict between code and spec, treat the spec as authoritative and either (a) fix code or (b) raise an explicit Open Question to change the spec.
|
|
8
|
+
|
|
9
|
+
2. **Traceability is mandatory**
|
|
10
|
+
Every meaningful change must connect a business flow, story, acceptance criterion, example, test, code, and verification evidence. BF is covered by E2E tests, AC by integration or API tests, and EX by a selected non-E2E test. Full rule: `.qfai/assistant/rule/constitution.md` Article V.
|
|
11
|
+
|
|
12
|
+
3. **Evidence over confidence**
|
|
13
|
+
Prefer observable proof (logs, commands, file diffs, test results). If you cannot verify, say so and record it.
|
|
14
|
+
|
|
15
|
+
4. **Minimize scope, but never hide gaps**
|
|
16
|
+
Keep changes minimal, but do not "paper over" missing decisions. If something blocks correctness, stop and ask.
|
|
17
|
+
|
|
18
|
+
5. **Quality gates are the decision mechanism**
|
|
19
|
+
Use tests/lint/typecheck/build/pack verification (whatever the repo defines) as the primary guardrail. Fix until PASS.
|
|
20
|
+
|
|
21
|
+
6. **Make it runnable**
|
|
22
|
+
Outputs must be executable in terminal/CI. Provide copy-paste commands.
|
|
23
|
+
|
|
24
|
+
7. **User time is expensive**
|
|
25
|
+
Ask only the questions that are truly blocking. Everything else: make reasonable assumptions and label them clearly.
|
|
@@ -23,7 +23,7 @@ mode: interactive-by-default
|
|
|
23
23
|
|
|
24
24
|
## /qfai-discussion - Exploration Planner
|
|
25
25
|
|
|
26
|
-
[DRIFT-PROTOCOL:
|
|
26
|
+
[DRIFT-PROTOCOL:REQUIRED]
|
|
27
27
|
|
|
28
28
|
Run the entry check of
|
|
29
29
|
`.qfai/assistant/rule/shared-skill-operating-baseline.md#workflow-run-entry-check-mandatory`
|
package/assets/init/.qfai/assistant/skill/qfai-discussion/references/discussion-completion-matrix.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Use this file for the full completion logic behind `/qfai-discussion`.
|
|
4
4
|
|
|
5
|
+
## Contents
|
|
6
|
+
|
|
7
|
+
- All Packs
|
|
8
|
+
- UI-bearing Packs
|
|
9
|
+
- CLI Packs
|
|
10
|
+
- Non-UI Packs
|
|
11
|
+
- Notes
|
|
12
|
+
|
|
5
13
|
## All Packs
|
|
6
14
|
|
|
7
15
|
Blocking for every pack, UI-bearing or not:
|
|
@@ -88,8 +96,7 @@ so conditions 1 and 5 above do not apply to it:
|
|
|
88
96
|
- Conditions 2, 3, 4, 6 and 7 apply unchanged: all three canonical `uiux/` sidecars, the
|
|
89
97
|
full screen-contract schema, unranked exploration directions, no forbidden legacy
|
|
90
98
|
sidecar, and zero open OQs.
|
|
91
|
-
- `route:` on a `cli` screen contract names the command invocation, not a web path
|
|
92
|
-
`ui-bearing-playbook.md#visual-prototyping-surfaces-vs-cli`).
|
|
99
|
+
- `route:` on a `cli` screen contract names the command invocation, not a web path, as the `cli` section of the UI-bearing playbook sets out.
|
|
93
100
|
- No `prototyping.yaml`: `cli` is not a valid prototyping execution surface.
|
|
94
101
|
- `primary_surface: cli` with a visual `secondary_surfaces` entry is NOT a cli-only pack —
|
|
95
102
|
conditions 1 and 2 stay blocking for it.
|