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.
Files changed (124) hide show
  1. package/README.md +272 -20
  2. package/assets/defaults/workflows/change-tooling.yml +0 -4
  3. package/assets/init/.claude/settings.json +8 -8
  4. package/assets/init/.codex/hooks.json +6 -6
  5. package/assets/init/.qfai/assistant/agent/implementation-reviewer.md +14 -1
  6. package/assets/init/.qfai/assistant/agent/qa-gatekeeper.md +29 -0
  7. package/assets/init/.qfai/assistant/rule/constitution.md +5 -4
  8. package/assets/init/.qfai/assistant/rule/drift-protocol.md +14 -3
  9. package/assets/init/.qfai/assistant/rule/references/asset-authoring.md +70 -0
  10. package/assets/init/.qfai/assistant/rule/references/context-summary.md +30 -0
  11. package/assets/init/.qfai/assistant/rule/references/gate-failure-autorepair.md +42 -0
  12. package/assets/init/.qfai/assistant/rule/references/griller-recommendations.md +23 -0
  13. package/assets/init/.qfai/assistant/rule/references/host-backstops.md +60 -0
  14. package/assets/init/.qfai/assistant/rule/references/placeholder-scan.md +25 -0
  15. package/assets/init/.qfai/assistant/rule/references/reviewer-findings.md +41 -0
  16. package/assets/init/.qfai/assistant/rule/references/reviewer-remit.md +35 -0
  17. package/assets/init/.qfai/assistant/rule/shared-skill-delegation-baseline.md +26 -139
  18. package/assets/init/.qfai/assistant/rule/shared-skill-operating-baseline.md +6 -137
  19. package/assets/init/.qfai/assistant/rule/stage-cost.md +1 -1
  20. package/assets/init/.qfai/assistant/rule/test-layers.md +42 -0
  21. package/assets/init/.qfai/assistant/skill/qfai-configure/SKILL.md +8 -42
  22. package/assets/init/.qfai/assistant/skill/qfai-configure/references/principles.md +25 -0
  23. package/assets/init/.qfai/assistant/skill/qfai-discussion/SKILL.md +1 -1
  24. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/discussion-completion-matrix.md +9 -2
  25. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/ui_ux/platform_baselines.md +11 -0
  26. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/ui_ux/review_audit_playbook.md +11 -0
  27. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/ui_ux_best_practices.md +12 -36
  28. package/assets/init/.qfai/assistant/skill/qfai-grill/SKILL.md +1 -1
  29. package/assets/init/.qfai/assistant/skill/qfai-grilling/SKILL.md +16 -88
  30. package/assets/init/.qfai/assistant/skill/qfai-grilling/references/delegated-session.md +58 -0
  31. package/assets/init/.qfai/assistant/skill/qfai-grilling/references/session-record.md +42 -0
  32. package/assets/init/.qfai/assistant/skill/qfai-implement/SKILL.md +8 -1
  33. package/assets/init/.qfai/assistant/skill/qfai-implement/references/credential-reuse.md +9 -0
  34. package/assets/init/.qfai/assistant/skill/qfai-implement/references/cross-spec-ownership.md +41 -0
  35. package/assets/init/.qfai/assistant/skill/qfai-implement/references/oracle-strength.md +6 -1
  36. package/assets/init/.qfai/assistant/skill/qfai-implement/references/red-admissibility.md +1 -1
  37. package/assets/init/.qfai/assistant/skill/qfai-implement/references/ui-affecting.md +1 -3
  38. package/assets/init/.qfai/assistant/skill/qfai-maintain/SKILL.md +1 -1
  39. package/assets/init/.qfai/assistant/skill/qfai-migration-v1-to-v2/SKILL.md +4 -4
  40. package/assets/init/.qfai/assistant/skill/qfai-migration-v1-to-v2/references/migration-guide.md +19 -5
  41. package/assets/init/.qfai/assistant/skill/qfai-prototyping/SKILL.md +1 -1
  42. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/design-md-spec.md +14 -5
  43. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/generator-prompt.md +10 -0
  44. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/handoff.md +1 -1
  45. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/iteration-loop.md +3 -4
  46. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/review-payload-schema.md +10 -2
  47. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/reviewer-prompt.md +16 -3
  48. package/assets/init/.qfai/assistant/skill/qfai-run/SKILL.md +6 -21
  49. package/assets/init/.qfai/assistant/skill/qfai-run/references/extraction.md +30 -10
  50. package/assets/init/.qfai/assistant/skill/qfai-run/references/operator-screens.md +34 -0
  51. package/assets/init/.qfai/assistant/skill/qfai-run/references/plan.md +28 -5
  52. package/assets/init/.qfai/assistant/skill/qfai-run/references/stage-points.md +29 -0
  53. package/assets/init/.qfai/assistant/skill/qfai-sdd/SKILL.md +1 -1
  54. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/concrete-abstract-cycle.md +10 -1
  55. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/contract-artifact-rules.md +21 -9
  56. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/design-anti-patterns.md +19 -2
  57. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/design-md-authoring.md +11 -5
  58. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/design-md-brand-catalog.md +17 -2
  59. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/requirements-decomposition.md +2 -2
  60. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-execution-playbook.md +5 -5
  61. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-phase-checklists.md +4 -4
  62. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-quality-gate.md +2 -2
  63. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-triage.md +47 -5
  64. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/spec-traceability-rules.md +15 -3
  65. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/ui-contract-guide.md +16 -1
  66. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/ui-design-contract-normalization.md +1 -2
  67. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/change-request.md +2 -2
  68. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/contracts/db-contract.sample.sql +2 -2
  69. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/03_contract/cli/cli-NNNN-title.md +2 -2
  70. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/03_contract/tech.md +1 -1
  71. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/decisions.md +4 -0
  72. package/assets/init/.qfai/assistant/skill/qfai-triage/SKILL.md +1 -1
  73. package/assets/init/.qfai/assistant/skill/qfai-verify/SKILL.md +1 -1
  74. package/assets/init/.qfai/assistant/skill/qfai-verify/references/verify-output-contract.md +22 -8
  75. package/assets/init/.qfai/assistant/skill/web-research/SKILL.md +2 -10
  76. package/assets/init/.qfai/assistant/step/common-design-md/STEP.md +17 -3
  77. package/assets/init/.qfai/assistant/step/common-gate-run/STEP.md +30 -7
  78. package/assets/init/.qfai/assistant/step/discussion-uiux/STEP.md +11 -1
  79. package/assets/init/.qfai/assistant/step/implement-dep-bump/STEP.md +7 -0
  80. package/assets/init/.qfai/assistant/step/implement-scaffold/STEP.md +3 -3
  81. package/assets/init/.qfai/assistant/step/implement-seam/STEP.md +3 -1
  82. package/assets/init/.qfai/assistant/step/implement-tdd/STEP.md +3 -1
  83. package/assets/init/.qfai/assistant/step/implement-test-fix/STEP.md +2 -0
  84. package/assets/init/.qfai/assistant/step/sdd-flow/STEP.md +2 -0
  85. package/assets/init/.qfai/assistant/step/sdd-gate/STEP.md +4 -0
  86. package/assets/init/.qfai/assistant/step/sdd-triage/STEP.md +7 -3
  87. package/assets/init/.qfai/assistant/step/verify-change-note/STEP.md +8 -5
  88. package/assets/init/.qfai/assistant/step/verify-commit/STEP.md +6 -1
  89. package/assets/init/.qfai/assistant/step/verify-qfai-gate/STEP.md +20 -3
  90. package/assets/init/.qfai/assistant/step/verify-repeat-run/STEP.md +1 -1
  91. package/assets/init/.qfai/assistant/step/verify-repo-gate/STEP.md +23 -6
  92. package/assets/init/.qfai/waivers.yml +1 -1
  93. package/assets/init/root/.agents/rules/ai-readable-markdown.md +98 -0
  94. package/assets/init/root/.agents/rules/api-budget.md +4 -5
  95. package/assets/init/root/.agents/rules/documentation-clarity.md +30 -2
  96. package/assets/init/root/.agents/rules/grilling.md +4 -4
  97. package/assets/init/root/.agents/rules/interface-clarity.md +5 -5
  98. package/assets/init/root/.agents/rules/minimal-implementation.md +8 -0
  99. package/assets/init/root/.agents/rules/reminders.json +2 -2
  100. package/assets/init/root/.agents/rules/temporary-files.md +14 -5
  101. package/assets/init/root/.agents/rules/untrusted-content.md +3 -3
  102. package/assets/init/root/.agents/rules/user-questions.md +34 -7
  103. package/assets/init/root/.gitattributes +9 -0
  104. package/assets/init/root/.github/workflows/qfai-docs.yml +43 -11
  105. package/assets/init/root/.github/workflows/qfai-tests.yml +58 -15
  106. package/assets/init/root/.github/workflows/qfai-validate.yml +49 -42
  107. package/assets/init/root/AGENTS.md +1 -0
  108. package/assets/init/root/CLAUDE.md +1 -0
  109. package/assets/mdschema/story/03_contract/tech.mdschema.yml +7 -3
  110. package/assets/sandbox-templates/default-deny.yaml +0 -2
  111. package/assets/schemas/workflow/plan.schema.json +9 -2
  112. package/assets/scripts/check-mdschema.mjs +172 -5
  113. package/dist/cli/index.cjs +3979 -3055
  114. package/dist/cli/index.cjs.map +1 -1
  115. package/dist/cli/index.mjs +3167 -2243
  116. package/dist/cli/index.mjs.map +1 -1
  117. package/dist/index.cjs +3024 -2500
  118. package/dist/index.cjs.map +1 -1
  119. package/dist/index.d.cts +23 -9
  120. package/dist/index.d.ts +23 -9
  121. package/dist/index.mjs +2881 -2358
  122. package/dist/index.mjs.map +1 -1
  123. package/docs/MIGRATION-2.0.0.md +1 -1
  124. package/package.json +3 -3
@@ -2,6 +2,17 @@
2
2
 
3
3
  Use this file only when the current discussion needs platform-specific detail.
4
4
 
5
+ ## Contents
6
+
7
+ - Cross-Platform Baseline
8
+ - Web
9
+ - Mobile
10
+ - Desktop
11
+ - CLI
12
+ - States
13
+ - Dark Mode
14
+ - Motion
15
+
5
16
  ## Cross-Platform Baseline
6
17
 
7
18
  - Keep the same conceptual model across surfaces.
@@ -2,6 +2,17 @@
2
2
 
3
3
  Use this file when the core checklist is not enough.
4
4
 
5
+ ## Contents
6
+
7
+ - Heuristic Review Pass
8
+ - Layout And Information Architecture
9
+ - Forms And Actions
10
+ - Screen States
11
+ - Accessibility Audit
12
+ - Anti-Pattern Red Flags
13
+ - Documentation Expectations For QFAI
14
+ - Recommended Audit Order
15
+
5
16
  ## Heuristic Review Pass
6
17
 
7
18
  Review the design direction against these durable heuristics:
@@ -5,6 +5,15 @@ This file is the compact, durable core for `qfai-discussion`.
5
5
  It is intentionally not an encyclopedia. Keep this file short, decision-oriented, and stable.
6
6
  Move volatile or bulky detail into the `ui_ux/` sidecar references and research current material at run time.
7
7
 
8
+ ## Contents
9
+
10
+ - Why This File Is Compact
11
+ - How To Use This Reference
12
+ - Core Decision Rules
13
+ - QFAI-Specific Authoring Guidance
14
+ - Compact Review Checklist
15
+ - Anti-Bloat Rules For Future Edits
16
+
8
17
  ## Why This File Is Compact
9
18
 
10
19
  - OpenAI recommends versioned prompts, variables, concise examples, and eval-backed iteration rather than piling all guidance into one prompt.
@@ -18,10 +27,7 @@ Move volatile or bulky detail into the `ui_ux/` sidecar references and research
18
27
  ## How To Use This Reference
19
28
 
20
29
  1. Read this file first for durable decision rules.
21
- 2. Open only the appendix you need:
22
- - `ui_ux/platform_baselines.md`
23
- - `ui_ux/review_audit_playbook.md`
24
- - `ui_ux/trend_scan_playbook.md`
30
+ 2. Open only the appendix the `discussion-uiux` step names for the current task.
25
31
  3. For trends, platform release details, or fast-moving conventions, do web research during the current discussion run and cite sources in `04_Sources.md`.
26
32
 
27
33
  ## Core Decision Rules
@@ -107,9 +113,8 @@ resolves through:
107
113
 
108
114
  Those three are the entire canonical sidecar family. Evaluation axes are global constants
109
115
  (4-step ordinal: weak / acceptable / strong / exceptional) fixed by the review validation the
110
- QFAI CLI applies — not by any file in this tree. The shipped
111
- `.qfai/assistant/skill/qfai-prototyping/references/reviewer-prompt.md` restates that axis set
112
- for the reviewer prompt; editing it does not change the set the CLI accepts. Axes are not
116
+ QFAI CLI applies — not by any file in this tree. The reviewer prompt that
117
+ `/qfai-prototyping` ships restates that axis set; editing it does not change the set the CLI accepts. Axes are not
113
118
  authored as discussion sidecars. Discussion is planner-first: it carries exploration directions
114
119
  unranked and does not select a single visual winner, so there is no strategy, taste-interview, scoring,
115
120
  override, option-comparison or selected-anchor sidecar. Do NOT create
@@ -175,29 +180,6 @@ Use this as the first-pass gate before deeper review.
175
180
  - Are comparisons and rejections traceable?
176
181
  - Can prototyping and SDD proceed without guessing the intended UX?
177
182
 
178
- ## When To Open The Appendices
179
-
180
- Open `ui_ux/platform_baselines.md` when you need:
181
-
182
- - touch target sizes
183
- - breakpoint heuristics
184
- - platform navigation baselines
185
- - dark mode and cross-platform adaptation notes
186
-
187
- Open `ui_ux/review_audit_playbook.md` when you need:
188
-
189
- - heuristic review structure
190
- - anti-pattern checklists
191
- - screen-spec documentation rules
192
- - audit/testing guidance
193
-
194
- Open `ui_ux/trend_scan_playbook.md` when you need:
195
-
196
- - trend-scan category coverage
197
- - freshness and citation rules
198
- - how to translate references into local decisions
199
- - how to keep trends from overwhelming product-specific needs
200
-
201
183
  ## Anti-Bloat Rules For Future Edits
202
184
 
203
185
  - Do not add long font-scale tables, full platform encyclopedias, or year-stamped trend lists to this file.
@@ -205,9 +187,3 @@ Open `ui_ux/trend_scan_playbook.md` when you need:
205
187
  - Do not repeat the same concept across multiple theoretical frameworks unless the duplication changes an actual QFAI decision.
206
188
  - Prefer one sharp rule plus a short verification cue over paragraph-heavy explanation.
207
189
  - If a section is mostly lookup material, move it to an appendix.
208
-
209
- ## Appendix Index
210
-
211
- - [Platform Baselines](ui_ux/platform_baselines.md)
212
- - [Review Audit Playbook](ui_ux/review_audit_playbook.md)
213
- - [Trend Scan Playbook](ui_ux/trend_scan_playbook.md)
@@ -10,7 +10,7 @@ mode: interactive-by-default
10
10
 
11
11
  ## qfai-grill - the session a user asks for
12
12
 
13
- [DRIFT-PROTOCOL:MANDATORY]
13
+ [DRIFT-PROTOCOL:REQUIRED]
14
14
 
15
15
  Run a grilling session on whatever the argument names. This skill holds no
16
16
  method of its own: it directs the run to `qfai-grilling`, which is the one
@@ -1,14 +1,14 @@
1
1
  ---
2
2
  name: qfai-grilling
3
3
  title: QFAI Grilling (Design interrogation)
4
- description: "Interrogate an unfixed design in rounds: a tree of open decisions, a frontier of the ones answerable now, facts read rather than asked, and an end condition the user holds."
4
+ description: "Interrogate an unfixed design in rounds: a tree of open decisions, a frontier of the ones answerable now, facts read rather than asked, and an end condition the user holds. Use when a stage calls for a grilling session, or when asked to grill or stress-test a design."
5
5
  allowed-tools: [Read, Glob, Grep, Bash, TodoWrite, Task, Agent]
6
6
  mode: interactive-by-default
7
7
  ---
8
8
 
9
9
  ## qfai-grilling - interrogate a design before it is fixed
10
10
 
11
- [DRIFT-PROTOCOL:MANDATORY]
11
+ [DRIFT-PROTOCOL:REQUIRED]
12
12
 
13
13
  The one implementation of the interview method. A skill that needs a design
14
14
  interrogated invokes this rather than writing rounds of its own, so there is one
@@ -296,57 +296,13 @@ orchestrator holds both. That is a different answerer, not a delegated question:
296
296
  nothing hands the asking to a third agent, and the orchestrator still answers
297
297
  nothing itself.
298
298
 
299
- A round between agents may have several authors, because one frontier can hold
300
- decisions belonging to different drafting roles.
301
-
302
- - The round goes to **every author whose decisions it contains**, each seeing
303
- the whole round. A decision reads differently beside the ones next to it, and
304
- an author shown only its own share cannot say so.
305
- - **Every answer is collected before the frontier is recomputed.** Recomputing
306
- on the first reply settles the rest against a tree that moved under them.
307
- - **Two authors answering one question differently is itself a decision**, and
308
- it joins the frontier rather than being averaged. If the budget ends with it
309
- open, it takes the griller's recommendation like any other non-critical
310
- decision, with both positions recorded.
311
- - **An addition an author proposes is asked what part of the request needs
312
- it.** One nobody can point to is dropped, not adopted.
313
- - **A fact only the user holds goes to the user, not to an author.** No author
314
- can answer an unpublished constraint or an intention nobody wrote down, and
315
- the convergence rules escalate decisions rather than facts — so without this
316
- the fact sits on the frontier until the budget ends, taking every decision
317
- waiting on it with it. It escalates immediately, as a request for the value
318
- rather than a choice. Under a no-question mode it reaches nobody, and what
319
- follows depends on the fact rather than on its kind: where the consuming
320
- document declares the value undefaultable the run stops and names it
321
- (`.qfai/assistant/rule/constitution.md` Article X, rule 4), and where
322
- the document has a default that default is recorded as a labelled assumption
323
- beside the open question, which is the ordinary no-question path. Stopping on
324
- every user-held fact would block a run over a defaultable date.
325
-
326
- ### Orchestrator Protocol
327
-
328
- - The orchestrator computes the frontier and reads the answers. It does not
329
- decide a frontier question on anyone's behalf.
330
- - **Who puts the round depends on the mode, and exactly one role does.** With a
331
- user, the orchestrator puts it. Between agents, the griller puts it and the
332
- orchestrator does not — a session where both do is one where an author is
333
- asked twice and the two answers have no tie-break.
334
- - It must not record an answer **as the user's** that the user did not give, and
335
- must not self-approve the session's end condition. An author's answer in an
336
- agent-to-agent round is recorded as that author's position, with whose it is:
337
- the round cannot be recomputed, a disagreement cannot be kept, and an
338
- escalation cannot carry the positions to the user unless the answers are
339
- held.
340
- - **In a delegated session the griller's recommendation settles a decision that
341
- is not critical.** Where the authors and the griller land on one answer, or
342
- the budget ends first, the recommendation is taken and the stage records it as
343
- `agents`, with the reason and every disagreeing position. The stage's final
344
- report lists it; nothing waits for the user to read it.
345
-
346
- A critical decision is the exception: agreement closes its node for the
347
- round, and only the user's answer settles it. Recording an agreed critical
348
- decision as settled is how a choice nobody with the standing made reaches a
349
- draft.
299
+ ### Rounds between agents
300
+
301
+ Read `references/delegated-session.md` when a griller puts the round to authors
302
+ instead of a user. It holds how a round with several authors is held, which
303
+ role puts the round, why a fact only the user holds goes to the user, and when
304
+ the griller's recommendation settles a decision. A session with a user does not
305
+ need it.
350
306
 
351
307
  ### Capability Probe
352
308
 
@@ -367,45 +323,17 @@ decisions belonging to different drafting roles.
367
323
 
368
324
  ## Work Orders Summary
369
325
 
370
- A session that dispatched any lookup must record a `## Work Orders Summary`
371
- table in the artifact its invoking stage writes. Use the shared schema from
372
- `.qfai/assistant/rule/shared-skill-delegation-baseline.md`, including
373
- the `Agent instance` column.
374
-
375
- | Step | Role (sub-agent) | Agent instance | Task title | Input (refs) | Output (refs) | Status (PASS/REVISE/PENDING) |
376
- | ---- | ---------------- | --------------- | ------------------------------- | ------------------------------- | ------------------------------- | ---------------------------- |
377
- | 1 | Reviewer | `<instance id>` | Read the facts a round waits on | Decision and what it depends on | The fact, and where it was read | PASS/REVISE |
326
+ A session that dispatched any lookup records a `## Work Orders Summary` table
327
+ in the artifact its invoking stage writes. Read `references/session-record.md`
328
+ for the table. It also lists what the invoking stage's reviewer confirms about
329
+ the session, so read it when reviewing one.
378
330
 
379
331
  ### Reviewer Gate
380
332
 
381
333
  This skill produces no artifact, so the gate that covers a session is the
382
- invoking stage's. What it confirms about the session is:
383
-
384
- - no decision was recorded as the user's that the user did not answer, no
385
- critical decision was adopted without them, and none was assumed that the
386
- assumption path excludes;
387
- - every adopted decision has its `agents` row, and none of them adds what the
388
- request did not need;
389
- - a fact taken as settled names where it was read;
390
- - the session ended on its own condition or on the user's word, in one of the
391
- five endings `.agents/rules/grilling.md` names. Between agents a round budget
392
- bounds the rounds (`.qfai/assistant/rule/review-convergence.md`), and
393
- a session recorded as ended while a critical decision it escalated is still
394
- unanswered is the finding.
395
-
396
- - Reviewer independence is defined normatively in
397
- `.qfai/assistant/rule/shared-skill-delegation-baseline.md#definition-independent-reviewer-normative`.
398
- An agent that answered a lookup in this session is disqualified from reviewing
399
- the facts it supplied.
400
- - Reviewer checks the Drift Protocol, verifies alignment with `test-layers.md`,
401
- and treats ratios as signals, not gates.
402
- - Reviewer returns only `PASS` or `REVISE`, with a concrete fix proposal on
403
- `REVISE`. A gate that could not be run at all is recorded as `PENDING`, which
404
- never counts as `PASS`.
405
-
406
- A session run from the user-invoked entry point has no invoking stage. There the
407
- gate is the user reading the record, which is why that entry point writes no
408
- files.
334
+ invoking stage's. A session run from the user-invoked entry point has no
335
+ invoking stage. There the gate is the user reading the record, which is why that
336
+ entry point writes no files.
409
337
 
410
338
  ## Default Autopilot Policy
411
339
 
@@ -0,0 +1,58 @@
1
+ # Delegated session
2
+
3
+ How the session agent runs a round between agents: who is asked, how the
4
+ answers are held, and which role puts the round.
5
+
6
+ ## Several authors
7
+
8
+ A round between agents may have several authors, because one frontier can hold
9
+ decisions belonging to different drafting roles.
10
+
11
+ - The round goes to **every author whose decisions it contains**, each seeing
12
+ the whole round. A decision reads differently beside the ones next to it, and
13
+ an author shown only its own share cannot say so.
14
+ - **Every answer is collected before the frontier is recomputed.** Recomputing
15
+ on the first reply settles the rest against a tree that moved under them.
16
+ - **Two authors answering one question differently is itself a decision**, and
17
+ it joins the frontier rather than being averaged. If the budget ends with it
18
+ open, it takes the griller's recommendation like any other non-critical
19
+ decision, with both positions recorded.
20
+ - **An addition an author proposes is asked what part of the request needs
21
+ it.** One nobody can point to is dropped, not adopted.
22
+ - **A fact only the user holds goes to the user, not to an author.** No author
23
+ can answer an unpublished constraint or an intention nobody wrote down, and
24
+ the convergence rules escalate decisions rather than facts — so without this
25
+ the fact sits on the frontier until the budget ends, taking every decision
26
+ waiting on it with it. It escalates immediately, as a request for the value
27
+ rather than a choice. Under a no-question mode it reaches nobody, and what
28
+ follows depends on the fact rather than on its kind: where the consuming
29
+ document declares the value undefaultable the run stops and names it
30
+ (`.qfai/assistant/rule/constitution.md` Article X, rule 4), and where
31
+ the document has a default that default is recorded as a labelled assumption
32
+ beside the open question, which is the ordinary no-question path. Stopping on
33
+ every user-held fact would block a run over a defaultable date.
34
+
35
+ ## Orchestrator protocol
36
+
37
+ - The orchestrator computes the frontier and reads the answers. It does not
38
+ decide a frontier question on anyone's behalf.
39
+ - **Who puts the round depends on the mode, and exactly one role does.** With a
40
+ user, the orchestrator puts it. Between agents, the griller puts it and the
41
+ orchestrator does not — a session where both do is one where an author is
42
+ asked twice and the two answers have no tie-break.
43
+ - It must not record an answer **as the user's** that the user did not give, and
44
+ must not self-approve the session's end condition. An author's answer in an
45
+ agent-to-agent round is recorded as that author's position, with whose it is:
46
+ the round cannot be recomputed, a disagreement cannot be kept, and an
47
+ escalation cannot carry the positions to the user unless the answers are
48
+ held.
49
+ - **In a delegated session the griller's recommendation settles a decision that
50
+ is not critical.** Where the authors and the griller land on one answer, or
51
+ the budget ends first, the recommendation is taken and the stage records it as
52
+ `agents`, with the reason and every disagreeing position. The stage's final
53
+ report lists it; nothing waits for the user to read it.
54
+
55
+ A critical decision is the exception: agreement closes its node for the
56
+ round, and only the user's answer settles it. Recording an agreed critical
57
+ decision as settled is how a choice nobody with the standing made reaches a
58
+ draft.
@@ -0,0 +1,42 @@
1
+ # Recording a session
2
+
3
+ The work-orders table a session writes when it dispatched a lookup, and what
4
+ the reviewer of the invoking stage confirms about the session.
5
+
6
+ ## Work Orders Summary
7
+
8
+ Use the shared schema from
9
+ `.qfai/assistant/rule/shared-skill-delegation-baseline.md`, including the
10
+ `Agent instance` column.
11
+
12
+ | Step | Role (sub-agent) | Agent instance | Task title | Input (refs) | Output (refs) | Status (PASS/REVISE/PENDING) |
13
+ | ---- | ---------------- | --------------- | ------------------------------- | ------------------------------- | ------------------------------- | ---------------------------- |
14
+ | 1 | Reviewer | `<instance id>` | Read the facts a round waits on | Decision and what it depends on | The fact, and where it was read | PASS/REVISE |
15
+
16
+ ## What the reviewer confirms
17
+
18
+ The invoking stage's reviewer confirms this about the session:
19
+
20
+ - no decision was recorded as the user's that the user did not answer, no
21
+ critical decision was adopted without them, and none was assumed that the
22
+ assumption path excludes;
23
+ - every adopted decision has its `agents` row, and none of them adds what the
24
+ request did not need;
25
+ - a fact taken as settled names where it was read;
26
+ - the session ended on its own condition or on the user's word, in one of the
27
+ five endings `.agents/rules/grilling.md` names. Between agents a round budget
28
+ bounds the rounds (`.qfai/assistant/rule/review-convergence.md`), and
29
+ a session recorded as ended while a critical decision it escalated is still
30
+ unanswered is the finding.
31
+
32
+ The reviewer works under these rules:
33
+
34
+ - Reviewer independence is defined normatively in
35
+ `.qfai/assistant/rule/shared-skill-delegation-baseline.md#definition-independent-reviewer-normative`.
36
+ An agent that answered a lookup in this session is disqualified from reviewing
37
+ the facts it supplied.
38
+ - Reviewer checks the Drift Protocol, verifies alignment with `test-layers.md`,
39
+ and treats ratios as signals, not gates.
40
+ - Reviewer returns only `PASS` or `REVISE`, with a concrete fix proposal on
41
+ `REVISE`. A gate that could not be run at all is recorded as `PENDING`, which
42
+ never counts as `PASS`.
@@ -46,7 +46,7 @@ mode: approval-gated
46
46
 
47
47
  ## /qfai-implement — Implement a business flow
48
48
 
49
- [DRIFT-PROTOCOL:MANDATORY]
49
+ [DRIFT-PROTOCOL:REQUIRED]
50
50
 
51
51
  Run the entry check of
52
52
  `.qfai/assistant/rule/shared-skill-operating-baseline.md#workflow-run-entry-check-mandatory`
@@ -124,6 +124,13 @@ review, by `implementation-reviewer`. The review also checks for code
124
124
  written only to pass a test: no value hard-coded to the test's inputs and no branch written only for the test, and a wrong test or infeasible task raised as a Change Request, not worked around
125
125
  (`.qfai/assistant/rule/test-layers.md#a-passing-test-is-not-the-solution`).
126
126
 
127
+ The review also checks that the
128
+ change adds test files sized like their neighbours, commits no scratch checks,
129
+ follows § 4 on unrequested fixes, including its exception for a necessary fix
130
+ and reporting requirement, and states any assumption it built on
131
+ (`.qfai/assistant/rule/test-layers.md#test-suite-sizing`,
132
+ `.agents/rules/minimal-implementation.md` § 4).
133
+
127
134
  ## Completion
128
135
 
129
136
  The invocation completes on the gate of its last step once
@@ -4,6 +4,15 @@ Acceptance tests that need an authenticated actor pay for the sign-in once per w
4
4
  per test. This file is the rule set. It is prose guidance — it adds no validator, no finding code,
5
5
  no test layer and no annotation token, and nothing here is checked by a tool.
6
6
 
7
+ ## Contents
8
+
9
+ - Scope
10
+ - Not dogfooded here
11
+ - The seven session-reuse rules
12
+ - The companion rule: a caller-injected environment is not the harness's to manage
13
+ - Script naming: adopter guidance
14
+ - A worked example, as one illustration among possible backends
15
+
7
16
  ## Scope
8
17
 
9
18
  These rules oblige the **E2E, API and Integration** layers only: the acceptance tests
@@ -6,6 +6,47 @@ Before changing a shared production module, test helper, fixture, contract, or p
6
6
 
7
7
  Do not use filename similarity as the only ownership signal. Follow imports, contract references, test fixtures, and call sites. A flow that merely happens to contain the same word is not a dependent flow.
8
8
 
9
+ ## Finding the dependents
10
+
11
+ Search from the changed files outward, not from the flows inward:
12
+
13
+ 1. Start from the files the step plans to edit. After the edit, reconcile that
14
+ list with the files changed since the branch diverged from the configured
15
+ base branch (the three-dot comparison, so a file changed only on the base
16
+ branch is not counted). List a renamed file under both its old and new path.
17
+ If the comparison cannot be computed (a shallow clone, a missing base ref,
18
+ an exported tree), the changed set is unknown: say so and treat the search
19
+ as unresolved. Never read that failure as an empty list.
20
+ 2. For a changed contract, read the `Examples` citations of its rules. Each
21
+ cited EX ID names a flow.
22
+ 3. For every other changed file, find its readers: static imports and
23
+ re-exports, followed importer by importer, and literal paths that a
24
+ production module, test or fixture loader reads. Continue through a runtime
25
+ entrypoint (a command line, an HTTP route, a spawned process) that a test
26
+ invokes by a literal name. Follow each chain until a test file is reached.
27
+ 4. Read the `QFAI:BF-`, `QFAI:AC-` and `QFAI:EX-` annotations in those test
28
+ files. A BF annotation names the flow. An AC or EX annotation names it
29
+ through its first four-digit segment: `AC-0007-0002-01` and
30
+ `EX-0007-0002-03` both give `BF-0007`. Deduplicate the flows.
31
+
32
+ Record each changed file, the readers or tests that reach it and the flows they
33
+ name.
34
+
35
+ ## When the search cannot finish
36
+
37
+ Some edges cannot be followed by reading: an import whose path is computed,
38
+ fixtures loaded by a glob, an asset read by a path built at run time, an
39
+ entrypoint reached by a computed name. Where one is left:
40
+ the dependent set is unknown, not empty.
41
+
42
+ Record each such edge with its file and the reason it could not be followed, as
43
+ an unresolved cross-flow obligation. The flows it may touch keep their evidence
44
+ until the consumers are identified and each one is revalidated below. Run the
45
+ full test suite once on the integrated tree as an additional check, and record
46
+ its command and result. A passing suite does not replace the per-flow
47
+ revalidation and does not make a stale proof current. Do not report the search
48
+ as complete while an edge is unresolved.
49
+
9
50
  ## Revalidation
10
51
 
11
52
  Run the changed example selector and the relevant tests of each dependent flow against the integrated tree. Run the scoped validation gate for each affected BF ID. Ask implementation-reviewer to judge any changed obligation and shared-code risk. A flow whose assertions or contract moved needs its own new evidence and review.
@@ -16,7 +16,12 @@ The path is relative to the project root, and the original text is copied exactl
16
16
 
17
17
  A missing import, syntax error, fixture failure, or deliberate unimplemented throw does not prove the oracle. The failure must name the example's observable behavior. A mutation in an unrelated helper only proves that helper is used.
18
18
 
19
- The falsifiability run in red-not-observable.md already supplies this proof when it tests the same predicate and selector. Reuse that run instead of mutating twice.
19
+ A proof belongs to one example.
20
+ When a mutation fails tests annotated with different examples, record each failing assertion and check which boundary it proves.
21
+ Narrow an assertion that proves another example's boundary, or have `/qfai-sdd` settle an unclear boundary in the examples.
22
+ A shared predicate may fail several tests whose assertions independently prove their own examples.
23
+
24
+ The falsifiability run recorded for an example that production already satisfies already supplies this proof when it tests the same predicate and selector. Reuse that run instead of mutating twice.
20
25
 
21
26
  ## Weak oracles
22
27
 
@@ -10,4 +10,4 @@ A collection error, import error, syntax error, missing fixture, timeout before
10
10
 
11
11
  Temporarily neutralize only the example assertion while keeping the test compilable and runnable. The same command must pass. Capture the changed lines and result, then restore the assertion before recording RED. This control shows that the reported failure came from the assertion.
12
12
 
13
- If a seam is needed to reach the assertion, add only that seam and record its limit. A seam cannot implement the behavior that the example is intended to test. Where production already satisfies the example, use red-not-observable.md and its falsifiability proof.
13
+ If a seam is needed to reach the assertion, add only that seam and record its limit. A seam cannot implement the behavior that the example is intended to test. Where production already satisfies the example, use the falsifiability route for existing behavior and its falsifiability proof.
@@ -13,9 +13,7 @@ production or test change implements behavior described by a UI contract, or a c
13
13
  surface path. Follow imports, component use, and contract references to check a changed path. A change to a shared
14
14
  component is UI affecting when a rendered surface consumes it.
15
15
 
16
- Match declared paths after normalizing separators to forward slashes. A pattern with two stars spans zero or more path
17
- segments; one star stays in one segment; a question mark matches one character. Matching is case-sensitive, including
18
- dot-prefixed segments. If `uiux.surfacePaths` is absent or the path relationship is uncertain, use the observed
16
+ If `uiux.surfacePaths` is absent or the path relationship is uncertain, use the observed
19
17
  behavior and UI contracts; route an unresolved case as UI affecting and record the uncertainty for
20
18
  product-surface-reviewer. Do not infer that a change has no UI effect from its directory name alone.
21
19
 
@@ -12,7 +12,7 @@ mode: execution-focused
12
12
 
13
13
  ## /qfai-maintain - Non-normative edits
14
14
 
15
- [DRIFT-PROTOCOL:MANDATORY]
15
+ [DRIFT-PROTOCOL:REQUIRED]
16
16
 
17
17
  Run the entry check of
18
18
  `.qfai/assistant/rule/shared-skill-operating-baseline.md#workflow-run-entry-check-mandatory`
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: qfai-migration-v1-to-v2
3
3
  title: QFAI 1.x to 2.x Migration
4
- description: "Move an existing QFAI 1.x spec-pack project to the 2.x story-based spec tree using the bundled steps, then install and check the free-text entry."
4
+ description: "Move an existing QFAI 1.x spec-pack project to the 2.x story-based spec tree using the bundled steps, then install and check the free-text entry. Use when asked to migrate a project that still holds QFAI 1.x spec packs."
5
5
  allowed-tools: [Read, Glob, Write, Edit, Bash]
6
6
  roles:
7
7
  [
@@ -16,7 +16,7 @@ routing-profile: architecture-heavy
16
16
 
17
17
  ## /qfai-migration-v1-to-v2
18
18
 
19
- [DRIFT-PROTOCOL:MANDATORY]
19
+ [DRIFT-PROTOCOL:REQUIRED]
20
20
 
21
21
  ## User Questions (AskUserQuestion Protocol)
22
22
 
@@ -60,7 +60,7 @@ names the directory and leaves the check to the person.
60
60
 
61
61
  Complete the launcher preflight in `.qfai/assistant/rule/shared-skill-operating-baseline.md`
62
62
  before running a CLI command.
63
- Use `rule/shared-skill-delegation-baseline.md` to route the declared roles and
63
+ Use `.qfai/assistant/rule/shared-skill-delegation-baseline.md` to route the declared roles and
64
64
  keep authors separate from reviewers.
65
65
 
66
66
  ### Procedure
@@ -175,7 +175,7 @@ saying it is already done. The complete write boundary is in
175
175
  The architecture reviewer checks the old-to-new mapping and preservation of
176
176
  unplaced content. The reviewer checks the twelve reports, rerun
177
177
  behavior, and validation result. Enforce the Drift Protocol and
178
- `rule/test-layers.md` when reviewing test obligations. Counts and effort
178
+ `.qfai/assistant/rule/test-layers.md` when reviewing test obligations. Counts and effort
179
179
  estimates are signals, not gates. Record PASS or REVISE on the final tree.
180
180
 
181
181
  ## Default Autopilot Policy
@@ -5,6 +5,20 @@ QFAI 2.x does not read the old spec-pack layout. A project that keeps spec packs
5
5
  must stay on a pinned 1.x release. To upgrade, migrate the project before using
6
6
  the 2.x validation and authoring workflow.
7
7
 
8
+ ## Contents
9
+
10
+ - Prepare
11
+ - Place stories and rules
12
+ - Retired configuration keys
13
+ - Contract IDs
14
+ - Business rules
15
+ - Documents in their template's shape
16
+ - Run the bundled steps
17
+ - Write boundary
18
+ - Resolve the reports
19
+ - Install and check the free-text entry
20
+ - Former migration memos
21
+
8
22
  ## Prepare
9
23
 
10
24
  1. Commit the current project state. The migration deletes every 1.x file
@@ -82,11 +96,11 @@ examples:
82
96
  - id: EX-0001-0002
83
97
  criterion: AC-0001-0001
84
98
  rules:
85
- - id: BR-0001-0001
99
+ - id: BR-0006-0001
86
100
  contract: api/orders.yaml
87
- - id: BR-0001-0002
101
+ - id: BR-0006-0002
88
102
  binds: none
89
- - id: BR-0001-0003
103
+ - id: BR-0006-0003
90
104
  retire: The payment provider enforces this limit.
91
105
  ```
92
106
 
@@ -200,14 +214,14 @@ the 2.x skills declare.
200
214
  ## Business rules
201
215
 
202
216
  Rules are numbered per contract, `BR-<contract number>-NNNN` from `0001` in plan
203
- order: the first rule step 4 places in API-0002 is BR-0002-0001. Step 7 writes
217
+ order: the first rule step 4 places in API-0006 is BR-0006-0001. Step 7 writes
204
218
  each rule into its contract in the form the contract's format takes:
205
219
 
206
220
  | Contract format | Where the rule goes |
207
221
  | --------------- | ----------------------------------------------------------------------- |
208
222
  | Markdown | A row of the `## Business rules` table: BR-ID, Statement and Examples |
209
223
  | YAML or JSON | An entry `{ id, statement, examples }` of the top-level `x-qfai-rules:` |
210
- | SQL | A `-- Rule BR-0002-0001: <statement>` line, then an `-- Examples:` line |
224
+ | SQL | A `-- Rule BR-0006-0001: <statement>` line, then an `-- Examples:` line |
211
225
 
212
226
  A Markdown contract without a `## Business rules` section gets one as its last
213
227
  section. A rule's examples are the new IDs of the examples that cited it. A
@@ -19,7 +19,7 @@ mode: execution-focused
19
19
 
20
20
  ## /qfai-prototyping
21
21
 
22
- [DRIFT-PROTOCOL:MANDATORY]
22
+ [DRIFT-PROTOCOL:REQUIRED]
23
23
 
24
24
  Run the entry check of
25
25
  `.qfai/assistant/rule/shared-skill-operating-baseline.md#workflow-run-entry-check-mandatory`
@@ -10,6 +10,16 @@ every color, font, radius or shadow an iteration uses outside this file.
10
10
  A reference copy is shipped in this skill at
11
11
  `templates/DESIGN.md.sample`.
12
12
 
13
+ ## Contents
14
+
15
+ - File shape
16
+ - Front-matter schema
17
+ - `brand.archetype` allowed values
18
+ - `brand.theme`
19
+ - `accessibility` allowed keys
20
+ - Validation rules
21
+ - Issue shape
22
+
13
23
  ## File shape
14
24
 
15
25
  ```markdown
@@ -72,11 +82,10 @@ accessibility:
72
82
 
73
83
  ## `brand.archetype` allowed values
74
84
 
75
- The 8-archetype catalog is the SSOT in
76
- `.qfai/assistant/skill/qfai-sdd/references/design-md-brand-catalog.md`:
77
- `minimal | bold | corporate | playful | organic | tech | elegant |
78
- casual`. Read that reference for archetype semantics, do not duplicate
79
- here.
85
+ The 8-archetype catalog is the SSOT in the brand catalog that
86
+ `/qfai-sdd`'s `common-design-md` step names: `minimal | bold | corporate |
87
+ playful | organic | tech | elegant | casual`. Read the catalog for
88
+ archetype semantics, do not duplicate here.
80
89
 
81
90
  ## `brand.theme`
82
91
 
@@ -5,6 +5,16 @@ Brand identity is locked by root `DESIGN.md`. Iterate on **information
5
5
  architecture**, **navigation flow**, and **usability** — not visual
6
6
  identity.
7
7
 
8
+ ## Contents
9
+
10
+ - Read order
11
+ - HTML envelope (mandatory on every iter)
12
+ - Hard constraints
13
+ - Output layout
14
+ - The first iteration (seed)
15
+ - Later iterations
16
+ - Pivot guidance (what changes vs what does not)
17
+
8
18
  ## Read order
9
19
 
10
20
  1. Root `DESIGN.md` (front-matter tokens + `# Brand Philosophy` body).