qfai 2.1.0 → 2.1.2
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 +327 -55
- package/assets/defaults/agent-routing/qfai-triage.yml +9 -0
- package/assets/defaults/workflows/change-tooling.yml +0 -4
- package/assets/defaults/workflows/run-owned-cleanup.yml +12 -0
- package/assets/init/.claude/settings.json +27 -9
- package/assets/init/.codex/hooks.json +20 -8
- package/assets/init/.qfai/assistant/agent/frontend-engineer.md +5 -0
- package/assets/init/.qfai/assistant/agent/implementation-reviewer.md +14 -1
- package/assets/init/.qfai/assistant/agent/product-experience-architect.md +4 -0
- package/assets/init/.qfai/assistant/agent/product-surface-reviewer.md +7 -0
- package/assets/init/.qfai/assistant/agent/qa-gatekeeper.md +29 -0
- package/assets/init/.qfai/assistant/agent/requirements-analyst.md +8 -0
- package/assets/init/.qfai/assistant/rule/communication.md +18 -8
- package/assets/init/.qfai/assistant/rule/constitution.md +5 -4
- package/assets/init/.qfai/assistant/rule/drift-protocol.md +72 -5
- package/assets/init/.qfai/assistant/rule/references/asset-authoring.md +72 -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/references/worker-edit-boundary.md +48 -0
- package/assets/init/.qfai/assistant/rule/shared-skill-delegation-baseline.md +39 -162
- package/assets/init/.qfai/assistant/rule/shared-skill-operating-baseline.md +14 -145
- 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/rule/ui-definition-protocol.md +6 -1
- package/assets/init/.qfai/assistant/skill/qfai-configure/SKILL.md +11 -45
- 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 +12 -9
- package/assets/init/.qfai/assistant/skill/qfai-discussion/references/ui-bearing-playbook.md +2 -4
- 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 +13 -42
- package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/uiux/00_index.md +0 -16
- 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 +17 -4
- 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/parallelization-policy.md +9 -1
- package/assets/init/.qfai/assistant/skill/qfai-implement/references/red-admissibility.md +47 -1
- package/assets/init/.qfai/assistant/skill/qfai-implement/references/ui-affecting.md +4 -3
- package/assets/init/.qfai/assistant/skill/qfai-maintain/SKILL.md +4 -4
- package/assets/init/.qfai/assistant/skill/qfai-migration-v1-to-v2/SKILL.md +16 -10
- package/assets/init/.qfai/assistant/skill/qfai-migration-v1-to-v2/references/migration-guide.md +10 -260
- package/assets/init/.qfai/assistant/skill/qfai-migration-v1-to-v2/references/migration-placement.md +273 -0
- package/assets/init/.qfai/assistant/skill/qfai-prototyping/SKILL.md +5 -4
- 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 +12 -5
- package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/reviewer-prompt.md +33 -4
- package/assets/init/.qfai/assistant/skill/qfai-run/SKILL.md +34 -36
- package/assets/init/.qfai/assistant/skill/qfai-run/references/evidence-delivery.md +322 -0
- package/assets/init/.qfai/assistant/skill/qfai-run/references/extraction.md +67 -24
- package/assets/init/.qfai/assistant/skill/qfai-run/references/operator-screens.md +246 -5
- package/assets/init/.qfai/assistant/skill/qfai-run/references/plan.md +29 -5
- package/assets/init/.qfai/assistant/skill/qfai-run/references/stage-points.md +43 -0
- package/assets/init/.qfai/assistant/skill/qfai-sdd/SKILL.md +5 -4
- 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 +22 -9
- package/assets/init/.qfai/assistant/skill/qfai-sdd/references/design-anti-patterns.md +41 -6
- 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 +10 -2
- package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-execution-playbook.md +34 -9
- 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 +177 -7
- package/assets/init/.qfai/assistant/skill/qfai-sdd/references/spec-traceability-rules.md +29 -5
- package/assets/init/.qfai/assistant/skill/qfai-sdd/references/ui-contract-guide.md +130 -1
- package/assets/init/.qfai/assistant/skill/qfai-sdd/references/ui-design-contract-normalization.md +4 -30
- package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/change-request.md +39 -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/contracts/ui-contract.sample.yaml +52 -5
- 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 +7 -0
- package/assets/init/.qfai/assistant/skill/qfai-triage/SKILL.md +30 -20
- package/assets/init/.qfai/assistant/skill/qfai-verify/SKILL.md +6 -5
- package/assets/init/.qfai/assistant/skill/qfai-verify/references/context-load.md +9 -6
- package/assets/init/.qfai/assistant/skill/qfai-verify/references/verify-output-contract.md +92 -13
- package/assets/init/.qfai/assistant/skill/web-research/SKILL.md +37 -31
- package/assets/init/.qfai/assistant/skill/web-research/mcp-templates/brave-search/config.toml +2 -4
- package/assets/init/.qfai/assistant/skill/web-research/mcp-templates/brave-search/mcp-config.json +9 -5
- package/assets/init/.qfai/assistant/skill/web-research/mcp-templates/firecrawl/.mcp.json +1 -2
- package/assets/init/.qfai/assistant/skill/web-research/mcp-templates/firecrawl/config.toml +3 -3
- package/assets/init/.qfai/assistant/skill/web-research/mcp-templates/firecrawl/mcp-config.json +11 -8
- package/assets/init/.qfai/assistant/skill/web-research/mcp-templates/playwright/config.toml +1 -1
- package/assets/init/.qfai/assistant/skill/web-research/mcp-templates/playwright/mcp-config.json +7 -3
- package/assets/init/.qfai/assistant/step/common-design-md/STEP.md +17 -7
- package/assets/init/.qfai/assistant/step/common-gate-run/STEP.md +126 -13
- package/assets/init/.qfai/assistant/step/common-review-cycle/STEP.md +3 -2
- package/assets/init/.qfai/assistant/step/discussion-pack/STEP.md +1 -0
- package/assets/init/.qfai/assistant/step/discussion-research/STEP.md +2 -0
- package/assets/init/.qfai/assistant/step/discussion-uiux/STEP.md +12 -4
- package/assets/init/.qfai/assistant/step/implement-backport/STEP.md +1 -1
- package/assets/init/.qfai/assistant/step/implement-benchmark/STEP.md +7 -4
- package/assets/init/.qfai/assistant/step/implement-dep-bump/STEP.md +11 -1
- package/assets/init/.qfai/assistant/step/implement-diagnose/STEP.md +2 -0
- package/assets/init/.qfai/assistant/step/implement-oracle-parity/STEP.md +2 -2
- package/assets/init/.qfai/assistant/step/implement-quarantine/STEP.md +3 -3
- package/assets/init/.qfai/assistant/step/implement-refactor/STEP.md +2 -2
- package/assets/init/.qfai/assistant/step/implement-regression-fix/STEP.md +4 -3
- package/assets/init/.qfai/assistant/step/implement-retire/STEP.md +6 -3
- package/assets/init/.qfai/assistant/step/implement-revert/STEP.md +4 -3
- package/assets/init/.qfai/assistant/step/implement-scaffold/STEP.md +3 -3
- package/assets/init/.qfai/assistant/step/implement-seam/STEP.md +9 -6
- package/assets/init/.qfai/assistant/step/implement-stress-harness/STEP.md +1 -1
- package/assets/init/.qfai/assistant/step/implement-sweep/STEP.md +4 -3
- package/assets/init/.qfai/assistant/step/implement-tdd/STEP.md +42 -6
- package/assets/init/.qfai/assistant/step/implement-test-fix/STEP.md +2 -0
- package/assets/init/.qfai/assistant/step/implement-tooling/STEP.md +22 -2
- package/assets/init/.qfai/assistant/step/maintain-edit/STEP.md +18 -14
- package/assets/init/.qfai/assistant/step/prototyping-grill/STEP.md +4 -3
- package/assets/init/.qfai/assistant/step/prototyping-loop/STEP.md +4 -0
- package/assets/init/.qfai/assistant/step/prototyping-preflight/STEP.md +1 -3
- package/assets/init/.qfai/assistant/step/sdd-contract/STEP.md +11 -0
- package/assets/init/.qfai/assistant/step/sdd-flow/STEP.md +4 -0
- package/assets/init/.qfai/assistant/step/sdd-gate/STEP.md +4 -0
- package/assets/init/.qfai/assistant/step/sdd-story/STEP.md +10 -0
- package/assets/init/.qfai/assistant/step/sdd-triage/STEP.md +37 -11
- package/assets/init/.qfai/assistant/step/triage-answer/STEP.md +5 -4
- package/assets/init/.qfai/assistant/step/triage-close/STEP.md +33 -23
- package/assets/init/.qfai/assistant/step/triage-cluster/STEP.md +5 -3
- package/assets/init/.qfai/assistant/step/triage-decompose/STEP.md +2 -0
- package/assets/init/.qfai/assistant/step/triage-dedupe/STEP.md +4 -0
- package/assets/init/.qfai/assistant/step/triage-handoff/STEP.md +13 -4
- package/assets/init/.qfai/assistant/step/triage-investigate/STEP.md +8 -5
- package/assets/init/.qfai/assistant/step/triage-owned-cleanup/STEP.md +86 -0
- package/assets/init/.qfai/assistant/step/triage-request-info/STEP.md +2 -0
- package/assets/init/.qfai/assistant/step/triage-security-intake/STEP.md +6 -3
- package/assets/init/.qfai/assistant/step/verify-change-note/STEP.md +9 -5
- package/assets/init/.qfai/assistant/step/verify-commit/STEP.md +39 -6
- package/assets/init/.qfai/assistant/step/verify-external/STEP.md +5 -2
- package/assets/init/.qfai/assistant/step/verify-qfai-gate/STEP.md +10 -2
- package/assets/init/.qfai/assistant/step/verify-release-notes/STEP.md +1 -0
- package/assets/init/.qfai/assistant/step/verify-repeat-run/STEP.md +7 -5
- package/assets/init/.qfai/assistant/step/verify-repo-gate/STEP.md +136 -28
- 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 +191 -13
- package/assets/init/root/.agents/rules/documentation-clarity.md +192 -35
- 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 +11 -3
- package/assets/init/root/.agents/rules/reminders.json +27 -14
- package/assets/init/root/.agents/rules/session-feedback.md +136 -0
- package/assets/init/root/.agents/rules/temporary-files.md +47 -5
- package/assets/init/root/.agents/rules/untrusted-content.md +3 -3
- package/assets/init/root/.agents/rules/user-questions.md +74 -36
- package/assets/init/root/.gitattributes +9 -0
- package/assets/init/root/.github/workflows/qfai-docs.yml +44 -12
- 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 +23 -21
- package/assets/mdschema/story/03_contract/tech.mdschema.yml +7 -3
- package/assets/sandbox-templates/default-deny.yaml +9 -5
- package/assets/schemas/workflow/extraction.schema.json +85 -5
- package/assets/schemas/workflow/plan.schema.json +9 -2
- package/assets/scripts/check-mdschema.mjs +172 -5
- package/assets/uix-rev/comparison-review.md +1 -1
- package/assets/uix-rev/contracts-review.md +1 -2
- package/dist/cli/index.cjs +6499 -7688
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.mjs +6449 -7641
- package/dist/cli/index.mjs.map +1 -1
- package/dist/index.cjs +5548 -7823
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +40 -666
- package/dist/index.d.ts +40 -666
- package/dist/index.mjs +5397 -7648
- package/dist/index.mjs.map +1 -1
- package/docs/MIGRATION-2.0.0.md +1 -1
- package/package.json +5 -7
- package/assets/init/root/CLAUDE.md +0 -45
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Context Summary
|
|
2
|
+
|
|
3
|
+
Read when a context summary is written.
|
|
4
|
+
|
|
5
|
+
## Context Summary Contract
|
|
6
|
+
|
|
7
|
+
When context is summarized, preserve the requests, decisions and stage state
|
|
8
|
+
needed to continue.
|
|
9
|
+
|
|
10
|
+
Every summary that replaces earlier context keeps these six:
|
|
11
|
+
|
|
12
|
+
1. Difficulties that came up, and how each was resolved.
|
|
13
|
+
2. Options raised, tried or set aside, and why.
|
|
14
|
+
3. Everything asked for, decided, agreed, ruled out or established as a constraint — in the exact words.
|
|
15
|
+
4. Where things stand: what is covered, settled or complete.
|
|
16
|
+
5. What is still open, promised or expected next.
|
|
17
|
+
6. Details that are hard to reconstruct: names, numbers, dates, exact wording, references.
|
|
18
|
+
|
|
19
|
+
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.
|
|
20
|
+
|
|
21
|
+
| Stage state | What goes wrong when it is dropped |
|
|
22
|
+
| ----------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
|
|
23
|
+
| The execution ledger and the row in progress | Finished rows are worked again, or a row in `red` is taken for untouched |
|
|
24
|
+
| Every open question, with its ID and status | A question stays open with nobody tracking it, or is answered twice |
|
|
25
|
+
| 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 |
|
|
26
|
+
| 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 |
|
|
27
|
+
| 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`) |
|
|
28
|
+
| 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`) |
|
|
29
|
+
|
|
30
|
+
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.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Gate Failure Autorepair
|
|
2
|
+
|
|
3
|
+
Read when a gate fails.
|
|
4
|
+
|
|
5
|
+
## Gate Failure Autorepair Protocol
|
|
6
|
+
|
|
7
|
+
Follow this protocol when any of the validate, doctor, test, lint, typecheck, build, capture, or report gates fail. A reviewer's `REVISE` is not a gate failure and is not rerun: the author fixes or answers each finding once, as `.qfai/assistant/rule/review-convergence.md` sets out.
|
|
8
|
+
|
|
9
|
+
- 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`;
|
|
10
|
+
- classify each finding as skill-owned artifact, upstream spec/contract, code/test defect, environment/tooling, or user decision;
|
|
11
|
+
- fix skill-owned artifacts and code/test defects autonomously when the fix is local and non-destructive;
|
|
12
|
+
- **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.
|
|
13
|
+
Ownership, not size, decides;
|
|
14
|
+
- 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;
|
|
15
|
+
- 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;
|
|
16
|
+
- 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;
|
|
17
|
+
- do not weaken profiles, lower `--fail-on`, waive errors, invent evidence, or skip required reviewers;
|
|
18
|
+
- 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;
|
|
19
|
+
|
|
20
|
+
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**.
|
|
21
|
+
|
|
22
|
+
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
|
|
23
|
+
surrender. Blocked is a status, not a verdict on the run.
|
|
24
|
+
|
|
25
|
+
### Nondeterministic gates
|
|
26
|
+
|
|
27
|
+
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.
|
|
28
|
+
|
|
29
|
+
**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.
|
|
30
|
+
|
|
31
|
+
- **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.
|
|
32
|
+
- **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.
|
|
33
|
+
- **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.
|
|
34
|
+
- **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.
|
|
35
|
+
|
|
36
|
+
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.
|
|
37
|
+
|
|
38
|
+
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.
|
|
39
|
+
|
|
40
|
+
#### Selective reporting is invented evidence
|
|
41
|
+
|
|
42
|
+
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.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Griller Recommendations
|
|
2
|
+
|
|
3
|
+
Read when a griller's recommendation is used.
|
|
4
|
+
|
|
5
|
+
## A griller's recommendations, and what they disqualify
|
|
6
|
+
|
|
7
|
+
A grilling session puts a recommended answer beside each question (`.agents/rules/grilling.md`). Who settled the decision decides what happens next.
|
|
8
|
+
|
|
9
|
+
| The decision was settled | What follows |
|
|
10
|
+
| ----------------------------------------------------- | --------------------------------------------------------------------------------- |
|
|
11
|
+
| By the user, from the recommendation among the inputs | The decision is theirs. The griller may review the artifact |
|
|
12
|
+
| Agent to agent, not critical | The decision stands. The griller that recommended it does not review the artifact |
|
|
13
|
+
| Agent to agent, critical, with no user adjudication | The artifact is wrong, and no reviewer can clear it |
|
|
14
|
+
|
|
15
|
+
**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.
|
|
16
|
+
|
|
17
|
+
**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.
|
|
18
|
+
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.
|
|
19
|
+
|
|
20
|
+
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
|
|
21
|
+
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.
|
|
22
|
+
|
|
23
|
+
**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.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Host Backstops
|
|
2
|
+
|
|
3
|
+
Read when a host limit on agents is involved.
|
|
4
|
+
|
|
5
|
+
## Host backstops above the declared shape
|
|
6
|
+
|
|
7
|
+
The dispatch limits in this baseline and in each skill's own policy are read by
|
|
8
|
+
the agent doing the dispatch. A run that has lost its way is the one least likely
|
|
9
|
+
to apply them, so nothing here bounds a run that spawns more workers than it
|
|
10
|
+
declared, nests delegation deeper than the stage intended, or keeps spending.
|
|
11
|
+
|
|
12
|
+
Some hosts refuse delegation outside their limits. Each control below states
|
|
13
|
+
what it covers.
|
|
14
|
+
QFAI sets none of them, so the host defaults stand.
|
|
15
|
+
|
|
16
|
+
**A backstop sits above the declared shape, never at it.** Leave room for other
|
|
17
|
+
permitted agents sharing the host limit. The policy decides the ordinary case.
|
|
18
|
+
|
|
19
|
+
Claude Code 2.1.217 or later:
|
|
20
|
+
|
|
21
|
+
| Control | Default | What it bounds |
|
|
22
|
+
| ------------------------------------------------------------------------------------ | ---------------------------- | ---------------------------------------------------------- |
|
|
23
|
+
| `CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH` | 3 (1 in 2.1.217 and 2.1.218) | How deep delegation nests. `1` turns nesting off |
|
|
24
|
+
| `CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS` | 20 | When new Agent tool spawns are refused |
|
|
25
|
+
| `--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 |
|
|
26
|
+
|
|
27
|
+
The spawn limit has exceptions for ultracode, `/subtask` forks, and resuming an
|
|
28
|
+
exited agent.
|
|
29
|
+
|
|
30
|
+
Codex:
|
|
31
|
+
|
|
32
|
+
| Control | Default | What it bounds |
|
|
33
|
+
| ----------------------------------------------------------------------------------------- | -------------------------- | --------------------------------------------------------------------- |
|
|
34
|
+
| `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 |
|
|
35
|
+
|
|
36
|
+
No equivalent was confirmed for nesting depth or for a spend cap.
|
|
37
|
+
|
|
38
|
+
GitHub Copilot CLI:
|
|
39
|
+
|
|
40
|
+
| Control | Documented default | What it bounds |
|
|
41
|
+
| ---------------------------------- | ------------------------------------ | ---------------------------------------- |
|
|
42
|
+
| `subagents.maxDepth` setting | 6 in the limits table | How deep sub-agents nest |
|
|
43
|
+
| `COPILOT_SUBAGENT_MAX_DEPTH` | 4 in the environment-variable table | How deep sub-agents nest |
|
|
44
|
+
| `subagents.maxConcurrency` setting | set by the Copilot plan, 2 to 32 | How many sub-agents run at once |
|
|
45
|
+
| `COPILOT_SUBAGENT_MAX_CONCURRENT` | 32 in the environment-variable table | How many sub-agents run at once |
|
|
46
|
+
| `--max-ai-credits` | unset | AI credits per response, as a soft limit |
|
|
47
|
+
|
|
48
|
+
The two settings take effect only on usage-based billing plans.
|
|
49
|
+
|
|
50
|
+
The depth defaults disagree across the CLI documentation. Which control takes
|
|
51
|
+
precedence was not confirmed.
|
|
52
|
+
|
|
53
|
+
VS Code Local harness (`runSubagent`):
|
|
54
|
+
|
|
55
|
+
| Control | Default | What it bounds |
|
|
56
|
+
| ---------------------------------------------- | ------- | --------------------------------------------------------------------- |
|
|
57
|
+
| `chat.subagents.allowInvocationsFromSubagents` | `false` | Whether a sub-agent may start sub-agents. Nesting stops at depth five |
|
|
58
|
+
|
|
59
|
+
No equivalent was confirmed for concurrent sub-agents or for a spend cap. None
|
|
60
|
+
was confirmed for any of the three in the Copilot cloud agent.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Placeholder Scan
|
|
2
|
+
|
|
3
|
+
Read when the placeholder scan reports a hit.
|
|
4
|
+
|
|
5
|
+
## What the placeholder scan does not flag
|
|
6
|
+
|
|
7
|
+
**`OQ` and `OPEN QUESTION` are exempt only as tracking structure.** Exempt: the `Open Questions` heading, a register
|
|
8
|
+
table header, and a question row containing the fields required by its register. Story-tree `open-questions.md` uses
|
|
9
|
+
`ID | Content | Approach | Status`; an empty register contains the heading and table header without a question row.
|
|
10
|
+
Discussion registers use their own template fields. A register row's Status is structure too: `TODO` in the Status cell of a
|
|
11
|
+
`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
|
|
12
|
+
unverifiable fact by recording an Open Question, so the tracked record they prescribe must never be reported as an
|
|
13
|
+
unresolved placeholder. Everywhere else the two strings are still scanned: a bare `OQ` or `OPEN QUESTION` left as a
|
|
14
|
+
value in generated spec prose or a contract field, or a row missing a required field, is a hit like any other token.
|
|
15
|
+
|
|
16
|
+
**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
|
|
17
|
+
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.
|
|
18
|
+
|
|
19
|
+
## What a surviving hit obligates
|
|
20
|
+
|
|
21
|
+
A hit is **reported, not silently cleared**, and **cleared by a re-scan, not by assertion**. Fix what you can, then run the scan again over the same artifacts: _resolved_ is the verdict for a hit the re-run no longer reports, and that re-run is its evidence. It is not available for a hit still present at that file and line — a token still readable there is unresolved whatever the report
|
|
22
|
+
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.
|
|
23
|
+
|
|
24
|
+
**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
|
|
25
|
+
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.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Reviewer Findings
|
|
2
|
+
|
|
3
|
+
Read when a reviewer finding is written or judged.
|
|
4
|
+
|
|
5
|
+
## Finding provenance
|
|
6
|
+
|
|
7
|
+
- Every finding must declare a severity (`blocking` or `advisory`) and a `Traces to:` value.
|
|
8
|
+
- `Traces to:` names what the finding enforces. Legal values:
|
|
9
|
+
- an upstream obligation — a `BF-*`, `AC-*`, `EX-*`, `BR-*` or contract ID, or a named shared rule **that governs the product's behaviour**;
|
|
10
|
+
- `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;
|
|
11
|
+
- `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;
|
|
12
|
+
- `none` — reviewer-originated scope, i.e. a new product obligation upstream never asked for.
|
|
13
|
+
- `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:
|
|
14
|
+
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;
|
|
15
|
+
`record:unchecked` is never a substitute for the repair — a record rule worth a round is worth a validator code.
|
|
16
|
+
- **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,
|
|
17
|
+
so they stay `blocking` as `defect:code-quality` and are never filed as `record:*` — which covers an honestly produced record that is merely wrong.
|
|
18
|
+
- 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.
|
|
19
|
+
- 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.
|
|
20
|
+
- 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
|
|
21
|
+
(`.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`.
|
|
22
|
+
|
|
23
|
+
## What a reviewer may demand more of (MUST)
|
|
24
|
+
|
|
25
|
+
A finding that asks for more work — another item, more detail, a wider set — is admissible only on
|
|
26
|
+
the concrete artifacts.
|
|
27
|
+
|
|
28
|
+
| Admissible on | Inadmissible on |
|
|
29
|
+
| ----------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
|
|
30
|
+
| business flows, user stories, acceptance criteria, examples, test cases | business rules, non-functional requirements, policies and decisions, architecture |
|
|
31
|
+
|
|
32
|
+
Two demands stay admissible on any artifact:
|
|
33
|
+
|
|
34
|
+
- that an abstract item already recorded carry its mandatory pair, such as a quality floor naming
|
|
35
|
+
its verification method;
|
|
36
|
+
- that a safety-floor item be met: security, accessibility, data-loss handling, or validation at a
|
|
37
|
+
trust boundary (`.agents/rules/minimal-implementation.md` § 2).
|
|
38
|
+
|
|
39
|
+
This bounds what a reviewer may require, never what a reviewer may report. A demand the table does
|
|
40
|
+
not admit, such as one for another business rule, is recorded as `advisory` and cannot force
|
|
41
|
+
`REVISE`.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Reviewer Remit
|
|
2
|
+
|
|
3
|
+
Read when a reviewer is briefed.
|
|
4
|
+
|
|
5
|
+
## Reviewer remit (in scope per stage)
|
|
6
|
+
|
|
7
|
+
A finding outside the reviewing stage's remit is recorded and deferred, never blocking:
|
|
8
|
+
|
|
9
|
+
| Stage | In scope | Out of scope (record and defer) |
|
|
10
|
+
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------- |
|
|
11
|
+
| `/qfai-discussion` | Requirement clarity, scope boundary, decision traceability | Spec structure, runtime behavior |
|
|
12
|
+
| `/qfai-sdd` | Spec / contract consistency, testability, traceability edges, each document in its template's shape | Runtime enforcement correctness, code quality |
|
|
13
|
+
| `/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, and security across the same files and along every input the change adds or alters to where it is used | Upstream spec content, contract design, and a finding on code in a touched file that the change did not add or alter |
|
|
14
|
+
| `/qfai-prototyping` | The prototype against its UI contracts and the root `DESIGN.md`, loop evidence, the handoff | Spec and contract content, downstream implementation code |
|
|
15
|
+
| `/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 |
|
|
16
|
+
| `/qfai-configure` | Config / manifest validity and the surfaces the run generated | Spec content, implementation structure |
|
|
17
|
+
| `/qfai-verify` | Gate execution, evidence completeness, report / artifact fidelity | Authoring quality of the artifacts it verifies |
|
|
18
|
+
| `/web-research` | Source authority and freshness, citation accuracy, claim support | Spec content, implementation structure |
|
|
19
|
+
| `/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 |
|
|
20
|
+
| `/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 |
|
|
21
|
+
| `/qfai-maintain` | That the diff changes no behaviour, and the checks run over it | Whether the new wording is the better one |
|
|
22
|
+
| `/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 |
|
|
23
|
+
| `/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 |
|
|
24
|
+
|
|
25
|
+
Article VII excess in the reviewing stage's own artifacts is in scope;
|
|
26
|
+
quality of downstream implementation code is deferred at upstream stages.
|
|
27
|
+
|
|
28
|
+
Apply this route only where the installed Article VII governs the artifact.
|
|
29
|
+
A retained constitution does not gain newer authority from refreshed cards.
|
|
30
|
+
Report an unsupported Article VII route as advisory and follow the installed constitution.
|
|
31
|
+
|
|
32
|
+
A step's remit is its owner's row. A `common-*` step's work is reviewed under
|
|
33
|
+
the row of the skill whose stage ran it.
|
|
34
|
+
|
|
35
|
+
**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.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Worker edits and work orders
|
|
2
|
+
|
|
3
|
+
Read when assigning worker write paths or handling a refused edit.
|
|
4
|
+
|
|
5
|
+
## Edit boundary
|
|
6
|
+
|
|
7
|
+
The work order names the checkout assigned to the task by the host, the worker's
|
|
8
|
+
write paths and the permitted edit method. Creating a Git worktree does not
|
|
9
|
+
grant the host's tools permission to edit it. Even an assigned checkout can
|
|
10
|
+
receive a refusal; verify the actual edit result rather than claiming access.
|
|
11
|
+
|
|
12
|
+
If an edit is refused, stop writes to that target. Report the tool, working
|
|
13
|
+
directory, target path and refusal text, omitting secrets. Return the owned
|
|
14
|
+
paths and a reviewable diff that can be prepared within the worker's permitted
|
|
15
|
+
area. Do not bypass the refusal through a shell, script or another tool.
|
|
16
|
+
This does not forbid shell authoring where the host already permits it.
|
|
17
|
+
|
|
18
|
+
The orchestrator checks the diff against the current files in its own permitted
|
|
19
|
+
checkout before applying it. If that edit is refused too, leave the application
|
|
20
|
+
pending and continue only independent work. Follow the existing worktree or
|
|
21
|
+
shared-index mode in `.qfai/assistant/rule/workflow.md#concurrency-stage-independent-mandatory`
|
|
22
|
+
when assigning writers and integrating their paths.
|
|
23
|
+
|
|
24
|
+
## Work order template
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
Task title: <short>
|
|
28
|
+
Role: <sub-agent role>
|
|
29
|
+
Review series: <reviewed artifact> + <reviewer role> + <replacement ordinal> # review work orders only
|
|
30
|
+
Goal: <what to decide/produce>
|
|
31
|
+
Checkout: <absolute checkout assigned to this task by the host>
|
|
32
|
+
Write paths: <exact owned paths, or none for a read-only task>
|
|
33
|
+
Edit method: <host-permitted tool; worktree creation does not grant access>
|
|
34
|
+
If an edit is refused: stop that target; return tool, cwd, target, refusal text, owned paths and a reviewable diff
|
|
35
|
+
Inputs (refs):
|
|
36
|
+
- <file/section>
|
|
37
|
+
- .qfai/assistant/rule/drift-protocol.md#core-rule <!-- the protected set, in front of the agent -->
|
|
38
|
+
Constraints:
|
|
39
|
+
- must: enforce Drift Protocol
|
|
40
|
+
- must: follow applicable test-layer or validation policy
|
|
41
|
+
- must_not: patch upstream artifacts directly; every upstream change requires
|
|
42
|
+
STOP + Change Request + owner rerun per .qfai/assistant/rule/drift-protocol.md
|
|
43
|
+
Output format:
|
|
44
|
+
- <headings / bullet schema>
|
|
45
|
+
Time budget: none | <seconds> # advisory: nothing stops at it. See .qfai/assistant/rule/stage-cost.md
|
|
46
|
+
Elapsed line: end every message with `elapsed <seconds>s / <budget>s`, or `elapsed <seconds>s` when the budget is none
|
|
47
|
+
Acceptance bar: <accept when ...> | <rework when ...> # never `PASS`/`REVISE`: that is the reviewer's vocabulary and the completion gate matches on it, so a doer told to report in it emits a verdict on its own work
|
|
48
|
+
```
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Shared Skill Delegation Baseline
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Skills cite this baseline and add only role, stage or gate overrides.
|
|
4
4
|
|
|
5
5
|
## Sub-agent Delegation (MANDATORY)
|
|
6
6
|
|
|
7
|
-
This section binds every skill and
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
This section binds every skill and step. A skill or step repeats none of it
|
|
8
|
+
and adds no placeholder for a subsection it does not change. State only an
|
|
9
|
+
override, under the subsection it overrides.
|
|
10
10
|
|
|
11
11
|
Delegation is optional. The session agent, called the orchestrator below, may
|
|
12
12
|
author any artifact itself. It uses a sub-agent only for work that runs in
|
|
@@ -23,9 +23,32 @@ 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
|
+
- Give each reviewer a fixed commit. Leave the checkout alone until reviews
|
|
44
|
+
return. Only read-only fixed-SHA `git show` reviews permit clean switches.
|
|
45
|
+
Writers, local gates and reviews using live files or checkout-dependent
|
|
46
|
+
execution must finish first.
|
|
47
|
+
|
|
48
|
+
### Worker edit boundary
|
|
49
|
+
|
|
50
|
+
Before assigning write paths or handling a refused edit, read
|
|
51
|
+
`.qfai/assistant/rule/references/worker-edit-boundary.md`.
|
|
29
52
|
|
|
30
53
|
### Capability Probe (MUST)
|
|
31
54
|
|
|
@@ -95,68 +118,13 @@ has to do, and the class is `unavailable` or
|
|
|
95
118
|
### Commit Scoping
|
|
96
119
|
|
|
97
120
|
- 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.
|
|
121
|
+
- `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.
|
|
122
|
+
- 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
123
|
- Isolation requirements for concurrent stages are defined once in `.qfai/assistant/rule/workflow.md#concurrency-stage-independent-mandatory`.
|
|
103
124
|
|
|
104
125
|
### Host backstops above the declared shape
|
|
105
126
|
|
|
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.
|
|
127
|
+
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
128
|
|
|
161
129
|
## Work Orders Summary
|
|
162
130
|
|
|
@@ -201,26 +169,6 @@ use subagents to verify your own work" does not apply to this gate. The
|
|
|
201
169
|
definition above already excludes an agent reviewing its own output. The author
|
|
202
170
|
cannot accept its own output.
|
|
203
171
|
|
|
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
172
|
- Reviewers must verify Drift Protocol enforcement
|
|
225
173
|
(`.qfai/assistant/rule/drift-protocol.md`).
|
|
226
174
|
- Reviewers must verify test-layer policy enforcement when relevant
|
|
@@ -231,79 +179,25 @@ context removes the memory, not the disposition — which is why role name alone
|
|
|
231
179
|
- An in-scope blocking finding from a routed reviewer prevents DONE until it is fixed or answered; no reviewer is rerun.
|
|
232
180
|
- Every reviewer returning `REVISE` must include a concrete fix proposal.
|
|
233
181
|
|
|
182
|
+
#### A griller's recommendations, and what they disqualify
|
|
183
|
+
|
|
184
|
+
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.
|
|
185
|
+
|
|
234
186
|
### Review convergence
|
|
235
187
|
|
|
236
188
|
A stage is reviewed once, and the author fixes or answers every finding with no re-review: `.qfai/assistant/rule/review-convergence.md`.
|
|
237
189
|
|
|
238
190
|
### Reviewer remit (in scope per stage)
|
|
239
191
|
|
|
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.
|
|
192
|
+
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
193
|
|
|
270
194
|
### Finding provenance
|
|
271
195
|
|
|
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`.
|
|
196
|
+
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
197
|
|
|
288
198
|
### What a reviewer may demand more of (MUST)
|
|
289
199
|
|
|
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`.
|
|
200
|
+
What a reviewer may demand is in `.qfai/assistant/rule/references/reviewer-findings.md`, read under the condition above.
|
|
307
201
|
|
|
308
202
|
### Reviewer budget exhausted
|
|
309
203
|
|
|
@@ -325,25 +219,8 @@ A blocking review that cannot be delegated because the agent budget is spent is
|
|
|
325
219
|
|
|
326
220
|
## Work order template
|
|
327
221
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
Role: <sub-agent role>
|
|
331
|
-
Review series: <reviewed artifact> + <reviewer role> + <replacement ordinal> # review work orders only
|
|
332
|
-
Goal: <what to decide/produce>
|
|
333
|
-
Inputs (refs):
|
|
334
|
-
- <file/section>
|
|
335
|
-
- .qfai/assistant/rule/drift-protocol.md#core-rule <!-- the protected set, in front of the agent -->
|
|
336
|
-
Constraints:
|
|
337
|
-
- must: enforce Drift Protocol
|
|
338
|
-
- must: follow applicable test-layer or validation policy
|
|
339
|
-
- must_not: patch upstream artifacts directly; every upstream change requires
|
|
340
|
-
STOP + Change Request + owner rerun per .qfai/assistant/rule/drift-protocol.md
|
|
341
|
-
Output format:
|
|
342
|
-
- <headings / bullet schema>
|
|
343
|
-
Time budget: none | <seconds> # advisory: nothing stops at it. See .qfai/assistant/rule/stage-cost.md
|
|
344
|
-
Elapsed line: end every message with `elapsed <seconds>s / <budget>s`, or `elapsed <seconds>s` when the budget is none
|
|
345
|
-
Acceptance bar: <accept when ...> | <rework when ...> # never `PASS`/`REVISE`: that is the reviewer's vocabulary and the completion gate matches on it, so a doer told to report in it emits a verdict on its own work
|
|
346
|
-
```
|
|
222
|
+
When preparing a delegation, use the template in
|
|
223
|
+
`.qfai/assistant/rule/references/worker-edit-boundary.md#work-order-template`.
|
|
347
224
|
|
|
348
225
|
## Reviewer response template
|
|
349
226
|
|