qfai 2.3.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/README.md +23 -3
  2. package/assets/init/.claude/settings.json +35 -1
  3. package/assets/init/.codex/hooks.json +24 -0
  4. package/assets/init/.github/instructions/code-review.instructions.md +1 -1
  5. package/assets/init/.qfai/assistant/agent/architecture-reviewer.md +2 -2
  6. package/assets/init/.qfai/assistant/agent/fullstack-engineer.md +32 -4
  7. package/assets/init/.qfai/assistant/agent/implementation-reviewer.md +4 -4
  8. package/assets/init/.qfai/assistant/agent/product-surface-reviewer.md +7 -3
  9. package/assets/init/.qfai/assistant/agent/requirements-reviewer.md +2 -2
  10. package/assets/init/.qfai/assistant/rule/agent-selection.md +1 -1
  11. package/assets/init/.qfai/assistant/rule/communication.md +1 -1
  12. package/assets/init/.qfai/assistant/rule/constitution.md +77 -242
  13. package/assets/init/.qfai/assistant/rule/drift-protocol.md +30 -164
  14. package/assets/init/.qfai/assistant/rule/references/asset-authoring.md +3 -2
  15. package/assets/init/.qfai/assistant/rule/references/gate-failure-autorepair.md +2 -2
  16. package/assets/init/.qfai/assistant/rule/references/placeholder-scan.md +2 -3
  17. package/assets/init/.qfai/assistant/rule/references/reviewer-findings.md +3 -3
  18. package/assets/init/.qfai/assistant/rule/references/worker-edit-boundary.md +12 -3
  19. package/assets/init/.qfai/assistant/rule/review-convergence.md +6 -6
  20. package/assets/init/.qfai/assistant/rule/shared-skill-delegation-baseline.md +6 -6
  21. package/assets/init/.qfai/assistant/rule/shared-skill-operating-baseline.md +17 -17
  22. package/assets/init/.qfai/assistant/rule/test-layers.md +1 -1
  23. package/assets/init/.qfai/assistant/rule/thinking.md +2 -2
  24. package/assets/init/.qfai/assistant/rule/ui-definition-protocol.md +5 -5
  25. package/assets/init/.qfai/assistant/rule/ui-procurement.md +1 -1
  26. package/assets/init/.qfai/assistant/rule/workflow.md +12 -12
  27. package/assets/init/.qfai/assistant/skill/qfai-configure/SKILL.md +12 -14
  28. package/assets/init/.qfai/assistant/skill/qfai-discussion/SKILL.md +2 -4
  29. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/03_Story-Workshop.md +1 -2
  30. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/uiux/50_review_input_bundle.md +4 -3
  31. package/assets/init/.qfai/assistant/skill/qfai-grill/SKILL.md +1 -3
  32. package/assets/init/.qfai/assistant/skill/qfai-grilling/SKILL.md +30 -43
  33. package/assets/init/.qfai/assistant/skill/qfai-grilling/references/confirmation-sheet.md +71 -0
  34. package/assets/init/.qfai/assistant/skill/qfai-grilling/references/delegated-session.md +18 -1
  35. package/assets/init/.qfai/assistant/skill/qfai-implement/SKILL.md +2 -4
  36. package/assets/init/.qfai/assistant/skill/qfai-implement/references/parallelization-policy.md +3 -3
  37. package/assets/init/.qfai/assistant/skill/qfai-implement/references/ui-affecting.md +35 -2
  38. package/assets/init/.qfai/assistant/skill/qfai-maintain/SKILL.md +2 -4
  39. package/assets/init/.qfai/assistant/skill/qfai-migration-v1-to-v2/SKILL.md +0 -2
  40. package/assets/init/.qfai/assistant/skill/qfai-migration-v1-to-v2/references/migration-guide.md +2 -3
  41. package/assets/init/.qfai/assistant/skill/qfai-prototyping/SKILL.md +5 -6
  42. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/generator-prompt.md +75 -4
  43. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/handoff.md +2 -1
  44. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/iteration-loop.md +58 -3
  45. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/review-payload-schema.md +11 -2
  46. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/reviewer-prompt.md +41 -10
  47. package/assets/init/.qfai/assistant/skill/qfai-run/SKILL.md +7 -8
  48. package/assets/init/.qfai/assistant/skill/qfai-run/references/extraction.md +12 -7
  49. package/assets/init/.qfai/assistant/skill/qfai-run/references/stage-points.md +1 -1
  50. package/assets/init/.qfai/assistant/skill/qfai-sdd/SKILL.md +10 -12
  51. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/concrete-abstract-cycle.md +25 -27
  52. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/contract-artifact-rules.md +8 -10
  53. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/design-anti-patterns.md +36 -3
  54. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/design-md-authoring.md +8 -9
  55. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/requirements-decomposition.md +6 -6
  56. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-execution-playbook.md +6 -6
  57. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-phase-checklists.md +5 -5
  58. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-pre-draft-grilling.md +5 -5
  59. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-quality-gate.md +3 -3
  60. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-triage.md +115 -199
  61. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/spec-traceability-rules.md +25 -25
  62. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/ui-contract-guide.md +23 -113
  63. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/ui-design-contract-normalization.md +2 -2
  64. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/contracts/ui-contract.sample.yaml +8 -7
  65. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/03_contract/tech.md +1 -0
  66. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/decisions/page-NNNN.md +2 -2
  67. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/decisions.md +59 -31
  68. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/open-questions.md +15 -11
  69. package/assets/init/.qfai/assistant/skill/qfai-triage/SKILL.md +1 -3
  70. package/assets/init/.qfai/assistant/skill/qfai-verify/SKILL.md +2 -4
  71. package/assets/init/.qfai/assistant/skill/qfai-verify/references/verify-output-contract.md +1 -1
  72. package/assets/init/.qfai/assistant/skill/web-research/SKILL.md +1 -3
  73. package/assets/init/.qfai/assistant/step/common-design-md/STEP.md +9 -9
  74. package/assets/init/.qfai/assistant/step/common-gate-run/STEP.md +2 -2
  75. package/assets/init/.qfai/assistant/step/common-grilling-record/STEP.md +3 -3
  76. package/assets/init/.qfai/assistant/step/common-policy-check/STEP.md +1 -1
  77. package/assets/init/.qfai/assistant/step/common-review-cycle/STEP.md +6 -4
  78. package/assets/init/.qfai/assistant/step/discussion-interview/STEP.md +7 -7
  79. package/assets/init/.qfai/assistant/step/discussion-pack/STEP.md +43 -0
  80. package/assets/init/.qfai/assistant/step/implement-acceptance/STEP.md +1 -1
  81. package/assets/init/.qfai/assistant/step/implement-dep-bump/STEP.md +11 -13
  82. package/assets/init/.qfai/assistant/step/implement-procedure/STEP.md +1 -1
  83. package/assets/init/.qfai/assistant/step/implement-regression-fix/STEP.md +2 -2
  84. package/assets/init/.qfai/assistant/step/implement-scaffold/STEP.md +5 -5
  85. package/assets/init/.qfai/assistant/step/implement-tdd/STEP.md +7 -8
  86. package/assets/init/.qfai/assistant/step/maintain-edit/STEP.md +17 -17
  87. package/assets/init/.qfai/assistant/step/prototyping-grill/STEP.md +1 -1
  88. package/assets/init/.qfai/assistant/step/prototyping-loop/STEP.md +89 -12
  89. package/assets/init/.qfai/assistant/step/sdd-contract/STEP.md +16 -15
  90. package/assets/init/.qfai/assistant/step/sdd-cycle/STEP.md +7 -8
  91. package/assets/init/.qfai/assistant/step/sdd-flow/STEP.md +25 -4
  92. package/assets/init/.qfai/assistant/step/sdd-story/STEP.md +6 -6
  93. package/assets/init/.qfai/assistant/step/sdd-triage/STEP.md +66 -75
  94. package/assets/init/.qfai/assistant/step/triage-operate/STEP.md +29 -15
  95. package/assets/init/.qfai/assistant/step/verify-commit/STEP.md +2 -4
  96. package/assets/init/.qfai/assistant/step/verify-context/STEP.md +1 -1
  97. package/assets/init/root/.agents/rules/ai-readable-markdown.md +8 -1
  98. package/assets/init/root/.agents/rules/delegation-steering.md +69 -0
  99. package/assets/init/root/.agents/rules/grilling.md +72 -43
  100. package/assets/init/root/.agents/rules/minimal-implementation.md +5 -5
  101. package/assets/init/root/.agents/rules/reply-forms.md +191 -0
  102. package/assets/init/root/.agents/rules/session-feedback.md +104 -27
  103. package/assets/init/root/.agents/rules/user-questions.md +6 -1
  104. package/assets/init/root/.gitattributes +5 -6
  105. package/assets/init/root/AGENTS.md +4 -2
  106. package/assets/mdschema/story/03_contract/tech.mdschema.yml +1 -1
  107. package/assets/mdschema/story/decisions/page-NNNN.mdschema.yml +3 -3
  108. package/assets/mdschema/story/decisions.mdschema.yml +4 -4
  109. package/assets/mdschema/story/open-questions.mdschema.yml +3 -3
  110. package/assets/schemas/workflow/extraction.schema.json +0 -2
  111. package/dist/cli/index.cjs +3749 -3029
  112. package/dist/cli/index.cjs.map +1 -1
  113. package/dist/cli/index.mjs +3718 -3006
  114. package/dist/cli/index.mjs.map +1 -1
  115. package/dist/hook/turn-end.cjs +1022 -0
  116. package/dist/hook/turn-end.cjs.map +1 -0
  117. package/dist/hook/turn-end.d.cts +2 -0
  118. package/dist/hook/turn-end.d.ts +2 -0
  119. package/dist/hook/turn-end.mjs +998 -0
  120. package/dist/hook/turn-end.mjs.map +1 -0
  121. package/dist/index.cjs +3626 -3577
  122. package/dist/index.cjs.map +1 -1
  123. package/dist/index.d.cts +19 -3
  124. package/dist/index.d.ts +19 -3
  125. package/dist/index.mjs +3544 -3498
  126. package/dist/index.mjs.map +1 -1
  127. package/package.json +2 -2
  128. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/change-request.md +0 -52
@@ -4,159 +4,33 @@ This rule governs changes discovered after a specification or contract has been
4
4
 
5
5
  ## Decision-register pages
6
6
 
7
- Listed decision pages and their root index are protected project artifacts.
8
- Read pages in list order, followed by the root table, before interpreting a
9
- request. A page preserves the same row identity and Status permissions as the
10
- root. New rows are appended only to the root table. Missing, unsafe or unreadable
11
- members stop permission decisions; a partial history grants no authority.
12
-
13
- A historical DONE row is not permission to relocate the register again.
14
- Physical relocation requires a separately adopted execution change request and
15
- a reviewed raw-byte receipt for the exact source and target. Preserve every row
16
- occurrence, cell, Status, order and line ending, plus the current root tail.
17
- Relocation does not permit duplicate cleanup, Status repair or normalization of
18
- inherited cells. Relocation changes physical home only; it neither adds nor removes
19
- a logical row. A migration projection grants no write authority. Never rotate
20
- automatically. Each physical file still meets the inclusive 500-line limit;
21
- formatting exclusions preserve bytes and never waive schema or semantic checks.
7
+ Read listed decision pages in list order, followed by the root table, before
8
+ interpreting a request. A page row follows the same rules as a root row. New
9
+ rows are appended only to the root table, which has no line limit, and no row
10
+ moves between files. A missing, unsafe or unreadable member stops the reading
11
+ of the register; a partial register settles nothing.
22
12
 
23
13
  ## Core rule
24
14
 
25
15
  A downstream skill does not edit an approved specification, policy, contract, or QFAI-owned rule on its own authority. It records the discrepancy and returns the affected artifact to its owner. A discussion pack is discovery material; the story tree and contracts are the current specification.
26
16
 
27
- Protected project artifacts include the policy and business-flow trees under paths.specsDir, decisions.md,
17
+ Upstream artifacts include the policy and business-flow trees under paths.specsDir, decisions.md,
28
18
  open-questions.md, and every file under paths.contractsDir. Production code and tests that implement an approved
29
- obligation may change in a later task, but the change must preserve or deliberately reapprove that obligation.
19
+ obligation may change in a later task, but the change must preserve that obligation or change it through its owner.
30
20
  QFAI-owned files under .qfai/assistant/rule/ are updated through the package, then synchronized by init.
31
21
 
32
- A new change-request row in decisions.md is permitted without an earlier change request.
33
- Existing rows are append-only records: a prior row may change its Status cell,
34
- while its ID, Content, and Approach stay fixed. The sole ID-change exception is
35
- explicit local renumbering of a unique branch-added decision absent from the
36
- unique common ancestor of HEAD and a required local base. That operation changes
37
- only its ID and provably branch-added exact references. Inherited row cells and
38
- references stay fixed. A changed obligation needs a new row, even when an older
39
- row discusses the same topic.
40
-
41
- The sole Approach-change exception is the published decision prefix recovery
42
- below. It preserves the target's ID, Content, Status and complete original
43
- Approach suffix. It excludes inherited rows and open-question rows.
44
-
45
- The sole row-removal exception is the merge-added identical decision copy
46
- recovery below. It removes only proven raw-identical surplus copies of a
47
- decision and keeps one original. It excludes open-question rows.
22
+ A decisions.md row keeps its ID and is never removed; its wording may be restated,
23
+ but a changed obligation needs a new row, even when an older row discusses the same topic. An open-questions.md
24
+ row is never edited; it is deleted when a decision settles it, or replaced by a
25
+ new row when it is deferred.
48
26
 
49
27
  ## Allowed exceptions (minimal whitelist)
50
28
 
51
29
  - A project may add a local overlay beside a shipped rule. The overlay adds project guidance; it does not repeal a shipped rule.
52
- - An owner skill may change its own upstream artifact after the required approval has been recorded. It then checks dependent tests before completion.
30
+ - An owner skill may change its own upstream artifact once any critical decision the change needs has been answered. It then checks dependent tests before completion.
53
31
 
54
32
  These exceptions do not authorize a downstream stage to rewrite an upstream row or a vendored rule.
55
33
 
56
- A change that touches no protected file needs no change request. A bugfix whose
57
- diff changes no file under `01_policy/`, `02_business-flow/` or
58
- paths.contractsDir appends no `Change request:` row. A row naming a story file
59
- the bugfix did not touch would state an upstream change that did not happen.
60
-
61
- ## Published decision prefix recovery
62
-
63
- The SDD owner may prepend only an approved Evidence/Grounds prefix to a
64
- published malformed decision added by the branch. Approval of this protocol
65
- does not authorize any target. First obtain a separate new in-force recovery
66
- change request naming the target and its repository-relative file.
67
-
68
- 1. Fix the explicit base commit and its unique common ancestor with current
69
- HEAD. The target ID must be absent from both. The documented published
70
- source commit must be an ancestor of current HEAD and expose the unique
71
- original row. Inherited records and open-question rows are excluded.
72
- 2. Read the original raw cell bytes. The row must be single-line valid UTF-8,
73
- with exactly one ASCII padding space at each Approach delimiter and no
74
- additional boundary whitespace. Hash the stored Approach bytes with
75
- SHA-256, excluding only the delimiter pipes and those two padding spaces.
76
- Do not decode escapes, trim text or normalize it. Ambiguous boundaries,
77
- additional padding or invalid UTF-8 stop recovery.
78
- 3. Confirm the original Residual risk and Rollback items already satisfy the
79
- required ordered, nonempty form. The new Approach must be exactly
80
- `- Evidence: <actual file references> - Grounds: `, including its trailing
81
- space, followed by the complete original Approach as a byte-identical
82
- suffix. Preserve the original wording, order, facts, authority and scope.
83
- The prefixed row must satisfy the existing form checks.
84
- 4. Record the target ID, published source commit, fixed base and common
85
- ancestor, old and new Approach digests, exact prefix, actual file evidence,
86
- approval authority, recovery reason, residual risk and rollback in the new
87
- request. The old digest must match the published source Approach; the new
88
- digest must match the exact prefix plus that source value. Record actual
89
- authority; do not invent a user answer or approval.
90
- 5. Immediately before writing, recheck the unique current target, its
91
- byte-identical ID, Content and Status, and its recorded old Approach digest.
92
- Unknown or unavailable provenance, inherited or duplicate targets, stale
93
- data or a change beyond the approved prefix stops recovery before writing.
94
- Apply only that prefix. Keep every other row byte-identical and run the existing
95
- validation without an exemption.
96
- 6. Rollback removes only the recorded prefix when the current new Approach
97
- digest still matches. Otherwise preserve the current row and stop. Removal
98
- restores the original Approach and its validation failure. Do not reset,
99
- amend or force push.
100
-
101
- Status changes, supersession and a diagnostic's rewrite suggestion supply no
102
- recovery authority and clear no form error. Inherited malformed records need a
103
- separate owning change request; this operation cannot repair them. These are
104
- owner instructions, not an automatic recovery command or a concurrency guarantee.
105
-
106
- ## Merge-added identical decision copy recovery
107
-
108
- The SDD owner may manually remove only raw-identical surplus copies of a
109
- decision row that an exact two-parent bad merge introduced. Approval of this
110
- protocol authorizes no target. First append a separate new in-force change
111
- request that names the exact `decisions.md` path and the decision ID.
112
-
113
- 1. Name the bad merge. It must be an available ancestor of current HEAD with
114
- exactly two parents, and it must expose the introduced surplus. Name both
115
- parents and their unique common ancestor. Each of the three must hold exactly
116
- one byte-identical original of the row. Fix the explicit base and its unique
117
- comparison ancestor; both must hold one original and no surplus selected for
118
- removal. A missing or non-ancestor merge, a third parent, a non-unique
119
- ancestor or a source that does not hold exactly one original stops recovery.
120
- 2. Read the complete stored UTF-8 raw row of every selected current occurrence:
121
- all four cells, delimiters, padding and line ending. Hash each with SHA-256,
122
- including the line ending. Do not trim, decode escapes or normalize endings.
123
- Nonidentical cells, padding or endings are a different collision and are
124
- outside this recovery.
125
- 3. Record in the request the path, the ID, the bad merge, both parents, the
126
- ancestor, the base and its comparison ancestor, the location of each
127
- occurrence, the raw hash, the retain/remove mapping, the actual authority,
128
- the residual risk and the rollback. Record actual authority; invent no
129
- answer. The request fixes input lineage only.
130
- 4. After the request is appended, have the evidence for the write reviewed
131
- independently and adopted. It fixes the actual write HEAD, base and
132
- comparison ancestor, the complete preimage and replacement bytes and hashes,
133
- the mapping and the current authority. The request does not name its own
134
- commit, so the actual write revision stays distinct from the lineage above.
135
- This adds no receipt grammar and no validator input.
136
- 5. Immediately before writing, recheck the refs, their availability, the path,
137
- the authority, the occurrence count, the mapping and the bytes. Stale,
138
- missing, ambiguous, conflicting or changed proof stops before writing.
139
- Changed observations need refreshed reviewed evidence. A changed target or
140
- operation needs a new request; do not rewrite the cells of an earlier one.
141
- 6. Remove only the mapped surplus occurrences. Keep one complete original, every
142
- distinct decision and reference, every unrelated current byte and the Git
143
- history. Do not change a Status, rewrite a reference or reorder other
144
- history. Open-question rows, nonidentical collisions, ordinary duplicate
145
- cleanup and surplus that the base or its comparison ancestor already holds
146
- are excluded.
147
- 7. Rollback restores the recorded complete preimage only while the current file
148
- is byte-identical to its owned replacement. Otherwise keep the current bytes,
149
- stop and name the unrestored path. Restoring brings back the duplicate
150
- failure. Do not reset, amend or force push.
151
-
152
- The existing duplicate check, positional drift, consumed-DONE authorization and
153
- valid Status-only rules keep applying without an exemption. Other drift that
154
- the file already has stays diagnosed; it is not a prerequisite for this
155
- correction. An actual required stage gate still stops dependent work. Correcting
156
- the copies is not a whole-target PASS, and the request stays at WIP while a named
157
- action or required check is unfinished. These are owner instructions, not a
158
- command, an executor or a concurrency, atomicity or power-loss guarantee.
159
-
160
34
  ## Drift classes
161
35
 
162
36
  Intent drift means an approved obligation should change. Record the current obligation, the proposed behavior, realistic
@@ -164,41 +38,35 @@ options, their costs, and the recommendation. Defect drift means an artifact con
164
38
  declared behavior. Record a reproduction: the command and output, or the two conflicting artifact excerpts. A defect
165
39
  with one sound repair needs one proposed repair, without invented alternatives.
166
40
 
167
- Both classes use the same approval and owner-rerun path.
41
+ Both classes use the same decision and owner-rerun path.
168
42
 
169
43
  ## When drift is detected
170
44
 
171
45
  1. Stop work on the affected obligation and its dependents. Other flows continue. Name the affected BF, US, AC, EX, BR, and contract references where they exist, plus the code or tests that consume the disputed artifact. Do not claim a repository-wide stop without a repository-wide dependency.
172
- 2. Prepare the change request for the SDD owner: the affected repository-relative paths, the drift class,
46
+ 2. Prepare the proposed change for the SDD owner: the affected repository-relative paths, the drift class,
173
47
  the evidence or reproduction, the proposed change, the impacted items, and the owner rerun.
174
- 3. Obtain the user's explicit answer. Either answer makes the SDD owner append one DEC-NNNN row to decisions.md under
175
- paths.specsDir. Its four columns are ID, Content, Approach, and Status. Content starts with Change request: followed
176
- by the affected repository-relative paths, separated by commas. Only a path authorizes an edit; an ID written there
177
- authorizes nothing. Approach records the proposed change.
178
- - Approved: Approach also records who approved it, when, and the option chosen, and the row starts at WIP.
179
- - Declined: Approach also records who declined it and when, and the row is appended at REJECTED. It authorizes no
180
- edit, and the artifact stays as it is.
48
+ 3. Decide the change. A change that contradicts a specification, a contract or a recorded decision, that cannot
49
+ be taken back, or that rests on product intent nothing written states is a critical decision: put it to the
50
+ user and wait for the answer. The owner takes any other change itself and lists it with its reason in its
51
+ report. A decision becomes a decisions.md row only when it is hard to reverse, would surprise a reader
52
+ without context, and was the result of a real trade-off; the row takes the short form of the `qfai-sdd`
53
+ decisions template. Otherwise the stage report states it. An option the user rejects is a row whose
54
+ Content opens `Declined:`, whatever the recording test says, so it stays excluded on reruns.
181
55
 
182
56
  When the user cannot be asked, write no row to either table: report the proposed change as the decision still
183
- needed and keep the affected items stopped. A WIP Change request: row is the in-force authorization that the drift gate reads.
184
- TODO is not authorization. A DONE row authorizes only on the branch that appended it or moved it from WIP. A row
185
- the base already holds at DONE records a change already applied and authorizes nothing at any Status, so setting it back to WIP
186
- reopens nothing and a later edit to the same path needs a row of its own.
57
+ needed and keep the affected items stopped.
187
58
 
188
- 4. Rerun the owner skill against the affected artifact. The owner names the approved decision row, the input revision, and whether it is confirming existing content or changing it.
59
+ 4. Rerun the owner skill against the affected artifact. The owner names the decision, the input revision, and whether it is confirming existing content or changing it.
189
60
  A contract with a contract ID, such as `API-0002`, is selected by its full ID; a contract without one is selected by its repository-relative path.
190
61
  The owner updates the specification and its tests together, then validates the relevant flow.
191
62
  5. Recheck every dependent BF, AC, and EX test obligation and every affected contract reference. Rewrite tests where their former expectation is invalid. Report any uncovered obligation. No execution ledger, TC row, or status reset substitutes for this check.
192
- 6. Complete the decision row by changing Status from WIP to DONE only after the owner artifact and dependent checks are complete.
193
- A row has one Status, so DONE claims every action its Approach lists. While one of them is deferred, keep the row at WIP.
194
- Cite the DEC ID in the stage report.
195
- A second open request on the same artifact waits for the first outcome and is restated if its premise changed.
63
+ Cite the DEC ID, when a row was written, in the stage report. A second open change on the same artifact waits for the first outcome and is restated if its premise changed.
196
64
 
197
- The decision table has no separate Applied at field and no standalone CR file. Approval alone does not certify a change as applied.
65
+ No step removes or renumbers a decision row afterwards; its wording may be restated. The decision table has no Status or Applied at field, and no standalone change file exists. A decision alone does not certify a change as applied.
198
66
 
199
- ### Multiple open change requests
67
+ ### Multiple open changes
200
68
 
201
- Open requests have independent affected sets. Their union is the set of work paused. A later request against the same artifact names the earlier DEC ID and the premise it assumes. Report outstanding requests and their age so unresolved decisions remain visible.
69
+ Open changes have independent affected sets. Their union is the set of work paused. A later change against the same artifact names the earlier decision and the premise it assumes. Report outstanding changes and their age so unresolved decisions remain visible.
202
70
 
203
71
  ## Reviewer-originated obligations
204
72
 
@@ -243,10 +111,8 @@ copy of a locked file before deciding its lock is wrong.
243
111
 
244
112
  ## Non-negotiable constraints
245
113
 
246
- - Downstream stages do not patch protected upstream artifacts before an in-force Change request: decision row authorizes the path. The drift profile compares the branch against baseBranch and reports QFAI-DRIFT-001 for an unapproved protected change. The SDD owner may create the request row itself without a prior row.
114
+ - Downstream stages do not patch upstream artifacts: the owner changes them as When drift is detected says.
247
115
  QFAI-DRIFT-003 is a warning that nothing was compared, because baseBranch does not resolve.
248
- QFAI-DRIFT-004 is a warning that an uncommitted edit to a protected file is not compared:
249
- record the Change request row before you commit the change.
250
- - Existing decisions.md and open-questions.md rows retain their ID, Content, and Approach, except for the explicit branch-added decision renumbering, published decision prefix recovery and merge-added identical decision copy recovery above. Inherited rows retain those cells without exception. A former row may change Status; new content is appended as a new row.
116
+ - An existing decisions.md row keeps its ID and is never removed, though its wording may be restated, and an existing open-questions.md row is never edited; a changed decision is appended as a new row. The drift profile compares the base and the branch by row ID, so the order of rows means nothing.
251
117
  - Vendored assistant rules are changed in the package and synchronized into projects by `npx qfai init --force`, which overwrites a local edit. A project rule lives in a `*.local.md` overlay beside the vendored one.
252
- - When approval is unavailable, keep the affected items stopped and report the decision needed. Continue unrelated work.
118
+ - When a critical decision cannot be put to the user, keep the affected items stopped and report the decision needed. Continue unrelated work.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Read when you write or change a shipped asset.
4
4
 
5
- ## Asset Authoring Shape (Mandatory)
5
+ ## Asset Authoring Shape
6
6
 
7
7
  A `SKILL.md` states the contract and points at the file that carries the detail. It is not where the detail lives.
8
8
 
@@ -16,6 +16,7 @@ A `SKILL.md` states the contract and points at the file that carries the detail.
16
16
 
17
17
  A hard line ceiling backs this up: **500 lines per Markdown assistant asset file** and **800 lines per YAML assistant asset file**, for every `.qfai/assistant/**/*.{md,yml,yaml}` file, counted as `content.split(/\r?\n/).length` — blank lines included.
18
18
  `npx qfai doctor` measures it and reports every file over its ceiling as `assets.lineBudget`.
19
+ The same check reports a `SKILL.md` whose body after the YAML frontmatter exceeds **20,000 characters**; a skill's reference files are not held to that limit.
19
20
  The ceiling is a backstop, not the rule: a file approaching it is a signal to move a section out, not to raise the number.
20
21
 
21
22
  The Markdown ceiling is the limit an agent can follow in one file: it follows fewer instructions as its context grows, and follows those in the middle of a long file worst. A Markdown file has a `references/` home to move detail into. A YAML asset is parsed as data and cannot be split that way (see below), which is why its ceiling is higher.
@@ -62,7 +63,7 @@ So for a machine-readable asset at the ceiling the remedy is, in order:
62
63
  1. **Split it in its own format** — a sibling of the same kind that the loader or schema already reads, so every item stays parsed.
63
64
  2. **Record an exemption** where the document has to stay whole — a file generated from another asset, one the schema admits only as a single document — naming what makes the split impossible. "This file is long" is not that reason, and a prose asset may not use this step.
64
65
 
65
- ## Citation Path Form (Mandatory)
66
+ ## Citation Path Form
66
67
 
67
68
  A pointer only resolves if the reader knows what base to resolve it against. There is one base, and it is the project root.
68
69
 
@@ -9,7 +9,7 @@ Follow this protocol when any of the validate, doctor, test, lint, typecheck, bu
9
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
10
  - classify each finding as skill-owned artifact, upstream spec/contract, code/test defect, environment/tooling, or user decision;
11
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.
12
+ - **upstream spec/contract findings: never repair.** STOP and follow `.qfai/assistant/rule/drift-protocol.md` (proposed change to the owner + 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
13
  Ownership, not size, decides;
14
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
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;
@@ -26,7 +26,7 @@ surrender. Blocked is a status, not a verdict on the run.
26
26
 
27
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
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.
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
30
 
31
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
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.
@@ -6,9 +6,8 @@ Read when the placeholder scan reports a hit.
6
6
 
7
7
  **`OQ` and `OPEN QUESTION` are exempt only as tracking structure.** Exempt: the `Open Questions` heading, a register
8
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
9
+ `ID | Content | Approach`; an empty register contains the heading and table header without a question row.
10
+ Discussion registers use their own template fields. Article II and `.qfai/assistant/rule/workflow.md` both end an
12
11
  unverifiable fact by recording an Open Question, so the tracked record they prescribe must never be reported as an
13
12
  unresolved placeholder. Everywhere else the two strings are still scanned: a bare `OQ` or `OPEN QUESTION` left as a
14
13
  value in generated spec prose or a contract field, or a row missing a required field, is a hit like any other token.
@@ -10,17 +10,17 @@ Read when a reviewer finding is written or judged.
10
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
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
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 session agent 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:
13
+ - `record:*` and `none` are recorded as `advisory`; neither can be `blocking` or gate `DONE`. A `record:*` finding never re-runs the row: the session agent 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
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
15
  `record:unchecked` is never a substitute for the repair — a record rule worth a round is worth a validator code.
16
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
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.
18
+ - A `none` advisory takes the specification-owner / 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
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
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
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
22
 
23
- ## What a reviewer may demand more of (MUST)
23
+ ## What a reviewer may demand more of
24
24
 
25
25
  A finding that asks for more work — another item, more detail, a wider set — is admissible only on
26
26
  the concrete artifacts.
@@ -18,11 +18,18 @@ This does not forbid shell authoring where the host already permits it.
18
18
  The session agent checks the diff against the current files in its own permitted
19
19
  checkout before applying it. If that edit is refused too, leave the application
20
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`
21
+ shared-index mode in `.qfai/assistant/rule/workflow.md#concurrency-every-stage`
22
22
  when assigning writers and integrating their paths.
23
23
 
24
24
  ## Work order template
25
25
 
26
+ A unit work order also names what the worker cannot read from the files and the
27
+ paths it leaves alone. That context is a few lines; a unit that needs the
28
+ conversation retold is not a unit. A judgement work order, such as a review, leaves both
29
+ fields out: its brief stays black-box, as
30
+ `.qfai/assistant/rule/shared-skill-delegation-baseline.md#session-agent-protocol`
31
+ says.
32
+
26
33
  ```text
27
34
  Task title: <short>
28
35
  Agent: <card name>
@@ -30,16 +37,18 @@ Review series: <reviewed artifact> + <reviewer card> + <replacement ordinal> #
30
37
  Goal: <what to decide/produce>
31
38
  Checkout: <absolute checkout assigned to this task by the host>
32
39
  Write paths: <exact owned paths, or none for a read-only task>
40
+ Do not touch: <paths outside the unit that the worker leaves as they are> # unit work orders only
33
41
  Edit method: <host-permitted tool; worktree creation does not grant access>
34
42
  If an edit is refused: stop that target; return tool, cwd, target, refusal text, owned paths and a reviewable diff
35
43
  Inputs (refs):
36
44
  - <file/section>
37
- - .qfai/assistant/rule/drift-protocol.md#core-rule <!-- the protected set, in front of the agent -->
45
+ - .qfai/assistant/rule/drift-protocol.md#core-rule <!-- the upstream set, in front of the agent -->
46
+ Context not in the repository: <a few lines: decisions, procedures or reasons the files do not record> # unit work orders only
38
47
  Constraints:
39
48
  - must: enforce Drift Protocol
40
49
  - must: follow applicable test-layer or validation policy
41
50
  - must_not: patch upstream artifacts directly; every upstream change requires
42
- STOP + Change Request + owner rerun per .qfai/assistant/rule/drift-protocol.md
51
+ STOP + proposed change to the owner + owner rerun per .qfai/assistant/rule/drift-protocol.md
43
52
  Output format:
44
53
  - <headings / bullet schema>
45
54
  Time budget: none | <seconds> # advisory: nothing stops at it. See .qfai/assistant/rule/stage-cost.md
@@ -26,7 +26,7 @@ which owns the delegation rules these sit beside.
26
26
  names a concrete security defect, data loss or corruption, or a correctness
27
27
  defect that would break a released contract; it is never only reported.
28
28
 
29
- ## Answered demands (MUST)
29
+ ## Answered demands
30
30
 
31
31
  Within a stage there is one review, so no demand comes back in it. The rules
32
32
  below are for a later, separate stage whose own one review reads an artifact an
@@ -41,7 +41,7 @@ Evidence cells. When a later stage reviews the same artifact, its
41
41
  finding source, demand, response and evidence. When there are none, write
42
42
  `None`.
43
43
 
44
- In that later review an answered demand MUST NOT be re-raised under another wording.
44
+ In that later review an answered demand is not raised again under another wording.
45
45
  Close a repeat by citing its recorded answer. This bounds what a reviewer may
46
46
  require, not what a reviewer may report.
47
47
 
@@ -68,7 +68,7 @@ just placed elsewhere.
68
68
  `Severity: advisory`, and `Traces to:` **the obligation whose implementation the
69
69
  advice is about** — which the pack carries, since the subject is how a later
70
70
  stage implements something already agreed. Never `none`: that value means
71
- reviewer-originated scope, takes the Change Request path and reaches no
71
+ reviewer-originated scope, goes to the specification owner and reaches no
72
72
  implementer, and advice about an agreed obligation proposes no new one. Where an
73
73
  item genuinely names nothing the pack carries it is reviewer-originated scope,
74
74
  and the baseline's `none` path is the right one for it.
@@ -100,7 +100,7 @@ Wrong repository facts, missing decision traceability, scope contradictions and
100
100
  defects in the pack's own safety obligations remain in remit. Non-normative
101
101
  status is not permission to pass those.
102
102
 
103
- ## Agent-to-agent grilling (MUST)
103
+ ## Agent-to-agent grilling
104
104
 
105
105
  A grilling session between agents is a **delegated session**
106
106
  (`.agents/rules/grilling.md`): a griller interviews the session agent, and the user is
@@ -119,7 +119,7 @@ fluency rather than a better answer.
119
119
  Where the authors disagreed, the recommendation is still taken, and each
120
120
  position is recorded beside it with whose it is. The stage reports every adopted
121
121
  decision at its end without waiting for an answer. A user who disagrees
122
- overturns one through a change request or a rerun.
122
+ overturns one through a specification change or a rerun.
123
123
 
124
124
  **A critical decision without an actual answer or recorded applicable user
125
125
  authority goes to the user at once when asking is permitted**, without spending
@@ -127,7 +127,7 @@ a round. Agent agreement and round exhaustion supply no authority.
127
127
 
128
128
  | Critical decision | Why it goes to the user |
129
129
  | --------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
130
- | It contradicts a spec, a contract or a recorded decision | Changing settled input is a Change Request, not a design round |
130
+ | It contradicts a spec, a contract or a recorded decision | Changing settled input is the user's decision, not a design round |
131
131
  | Its effect cannot be taken back: security, lost or corrupted data, a broken released contract, spending, a legal commitment, a public release | A wrong recommendation here is not repaired by the next run |
132
132
  | It rests on product or business intent that the request, the discussion pack, the specs and the contracts all leave unstated | Two agents reasoning past the evidence converge on the more fluent argument |
133
133
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Skills cite this baseline and add only stage or gate overrides.
4
4
 
5
- ## Sub-agent Delegation (MANDATORY)
5
+ ## Sub-agent Delegation
6
6
 
7
7
  This section binds every skill and step. A skill or step repeats none of it
8
8
  and adds no placeholder for a subsection it does not change. State only an
@@ -77,7 +77,7 @@ classified by the taxonomy below before any response.
77
77
  Before assigning write paths or handling a refused edit, read
78
78
  `.qfai/assistant/rule/references/worker-edit-boundary.md`.
79
79
 
80
- ### Capability Probe (MUST)
80
+ ### Capability Probe
81
81
 
82
82
  1. No delegation attempt is required at the start of a stage. The session agent
83
83
  delegates only when it chooses to.
@@ -88,7 +88,7 @@ Before assigning write paths or handling a refused edit, read
88
88
  `Delegation Failure Taxonomy`), then apply the response for that class.
89
89
  Never simulate an agent.
90
90
 
91
- ### Delegation Failure Taxonomy (MUST)
91
+ ### Delegation Failure Taxonomy
92
92
 
93
93
  Every delegation failure belongs to exactly one of two classes.
94
94
 
@@ -146,7 +146,7 @@ is `unavailable` or `saturated (retry budget exhausted)`.
146
146
  - A delegated agent stages only the paths it declared as deliverables in its work order: `git add <path> …`.
147
147
  - `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.
148
148
  - When the agent's deliverable paths are not known up front, it hands back an unstaged diff and the session agent commits — under the same rule. The session agent 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.
149
- - Isolation requirements for concurrent stages are defined once in `.qfai/assistant/rule/workflow.md#concurrency-stage-independent-mandatory`.
149
+ - Isolation requirements for concurrent stages are defined once in `.qfai/assistant/rule/workflow.md#concurrency-every-stage`.
150
150
 
151
151
  ### Host backstops above the declared shape
152
152
 
@@ -173,7 +173,7 @@ signals-not-gates bullets below, and the `PASS` / `REVISE` vocabulary, are not
173
173
  restated. A skill with no check of its own carries no reviewer gate section. A
174
174
  stage that runs several steps is reviewed once, after its last step, by the one
175
175
  review its parent names
176
- (`.qfai/assistant/rule/shared-skill-operating-baseline.md#running-steps-mandatory`).
176
+ (`.qfai/assistant/rule/shared-skill-operating-baseline.md#running-steps`).
177
177
 
178
178
  - Final completion gate must be delegated to an independent reviewer, except where the skill runs no review: `qfai-triage` invoked by name, and a `qfai-verify` run that wrote nothing.
179
179
  - Each reviewer records an explicit PASS or REVISE for the reviewed revision.
@@ -221,7 +221,7 @@ Read `.qfai/assistant/rule/references/reviewer-remit.md` when you brief a review
221
221
 
222
222
  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.
223
223
 
224
- ### What a reviewer may demand more of (MUST)
224
+ ### What a reviewer may demand more of
225
225
 
226
226
  What a reviewer may demand is in `.qfai/assistant/rule/references/reviewer-findings.md`, read under the condition above.
227
227
 
@@ -2,11 +2,11 @@
2
2
 
3
3
  Use this document to keep SKILL bodies compact. Skill files should reference this baseline and only restate skill-specific additions or overrides.
4
4
 
5
- ## Asset Authoring Shape (Mandatory)
5
+ ## Asset Authoring Shape
6
6
 
7
7
  Read `.qfai/assistant/rule/references/asset-authoring.md` when you write or change a file under `.qfai/assistant/**` or another shipped asset, including its citation paths. It holds the shape every asset takes, which tree owns a file, how machine-readable assets split, and the form of a citation path. Not needed for a run that only reads assets or edits project files.
8
8
 
9
- ## Citation Path Form (Mandatory)
9
+ ## Citation Path Form
10
10
 
11
11
  The form of a citation path is in `.qfai/assistant/rule/references/asset-authoring.md`, read under the same condition as the section above.
12
12
 
@@ -116,7 +116,7 @@ Route every `ask-user` and `hard-required` item through
116
116
  including its `--auto` rule. What each bucket needs inside a workflow run is
117
117
  [Default Autopilot Policy inside a run](#default-autopilot-policy-inside-a-run).
118
118
 
119
- ## Canonical qfai Launcher (Mandatory)
119
+ ## Canonical qfai Launcher
120
120
 
121
121
  - **Launcher preflight — run once, before the first `npx qfai` call**, a gate or a run's `workflow plan` alike. Confirm the project resolves qfai from its own dependencies. Either proof is sufficient:
122
122
  - **A local binary at `node_modules/.bin/qfai`.** The normal case for npm, pnpm and Yarn configured with `nodeLinker: node-modules`.
@@ -138,9 +138,9 @@ including its `--auto` rule. What each bucket needs inside a workflow run is
138
138
  - Never launch a gate as a bare `qfai` command: qfai is a project dependency, not a global one, so that is `command not found` on a normal local install — and a gate that cannot run is a gate that silently passes.
139
139
  - The preflight is the guard, not a flag. `npx` runs "a command from a local **or remote** npm package": with nothing resolvable locally it downloads and runs one (non-interactive shells do this without prompting), and `npx --no-install` still executes a copy already sitting in the npx cache. Neither spelling can tell you the qfai that ran was this project's; only the preflight can.
140
140
  - If the launcher cannot be resolved at any point, that call, a gate included, is UNRUN, not PASS. Report it as a blocker instead of completing the stage.
141
- - The project's gate commands belong in the Standard commands section of `<paths.contractsDir>/tech.md` ([Standard Commands](#standard-commands-mandatory) below). The CI workflow generated by `npx qfai init` is the one deliberate exception: it runs before any project install can be assumed and must still be able to bootstrap.
141
+ - The project's gate commands belong in the Standard commands section of `<paths.contractsDir>/tech.md` ([Standard Commands](#standard-commands) below). The CI workflow generated by `npx qfai init` is the one deliberate exception: it runs before any project install can be assumed and must still be able to bootstrap.
142
142
 
143
- ## Standard Commands (Mandatory)
143
+ ## Standard Commands
144
144
 
145
145
  A project's gate commands have one home:
146
146
  `<paths.contractsDir>/tech.md#standard-commands-copy-paste`. The directory comes
@@ -161,23 +161,23 @@ from `qfai.config.yaml`.
161
161
 
162
162
  The `common-gate-run` step runs a gate from this section and records it.
163
163
 
164
- ## FORMAT SSOT (Mandatory)
164
+ ## FORMAT SSOT
165
165
 
166
166
  - Before writing or editing `.qfai/**`, read the template or sample for the target artifact.
167
167
  - Do not copy templates or samples into prompt markdown.
168
168
  - Generated artifacts match their template's headings, ordering, content kinds and table columns, and add no section, including no history section. Under `<paths.specsDir>` a document schema rejects anything else; `.qfai/assistant/skill/qfai-sdd/references/spec-traceability-rules.md#document-shapes` states what a template cannot show.
169
169
  - Completion requires a format self-check in evidence.
170
170
 
171
- ## Policy check (mandatory)
171
+ ## Policy check
172
172
 
173
173
  A run, an exempt route aside, starts with the policy check once and does not
174
174
  continue affected work on stale policy. The contract is
175
- `.qfai/assistant/rule/workflow.md#policy-check-mandatory`.
175
+ `.qfai/assistant/rule/workflow.md#policy-check`.
176
176
  The procedure — which files, what counts as incomplete, how a fact is filled
177
177
  and where an unverifiable one goes — is the `common-policy-check` step. A
178
178
  skill or step cites the step and restates none of it.
179
179
 
180
- ## Workflow Run Entry Check (Mandatory)
180
+ ## Workflow Run Entry Check
181
181
 
182
182
  A skill that a built-in workflow plan names runs this check first, before
183
183
  the policy check. The mode is `workflow.mode` in `qfai.config.yaml`. An absent key means
@@ -203,7 +203,7 @@ the policy check. The mode is `workflow.mode` in `qfai.config.yaml`. An absent k
203
203
  independent reviewer.
204
204
  - These statements add to the constitution. They except no article.
205
205
 
206
- ## Running Steps (Mandatory)
206
+ ## Running Steps
207
207
 
208
208
  A step is one part of a parent skill's procedure, kept at
209
209
  `.qfai/assistant/step/<name>/STEP.md`. No host lists a step as a skill; a step
@@ -219,9 +219,9 @@ runs only from its parent or from the plan `qfai-run` follows.
219
219
 
220
220
  ### A parent skill invoked by name
221
221
 
222
- 1. Run the [entry check](#workflow-run-entry-check-mandatory).
222
+ 1. Run the [entry check](#workflow-run-entry-check).
223
223
  2. Run `common-policy-check` once, as the
224
- [policy check](#policy-check-mandatory) says.
224
+ [policy check](#policy-check) says.
225
225
  3. Take the steps from the parent's `steps:` list, in that order. Skip a step
226
226
  only where the parent's body names the condition that skips it.
227
227
  4. For each step: read that step's `STEP.md` and no other, run it, and pass its
@@ -288,12 +288,12 @@ work order's target names the flow, so the skill does not ask for it. With no
288
288
  binding, the flow stays `hard-required`: a direct invocation with no flow it
289
289
  can resolve stops at preflight.
290
290
 
291
- ## Rejected Option Guard (Mandatory)
291
+ ## Rejected Option Guard
292
292
 
293
- - Do not reintroduce an option whose row in `<paths.specsDir>/decisions.md` has Status `REJECTED`.
294
- - To reconsider it, ask the user. Only on approval append a new `DEC-NNNN` row. Its Content begins `Change request:` and names the authorized repository-relative paths, the rejected row's full `DEC-NNNN` ID, and the option being reopened. Its Approach states the changed evidence, the intended story or contract change, and who approved it, when, and the option chosen. Leave the rejected row intact.
295
- - The new row starts at `WIP` and becomes `DONE` only after the owning SDD rerun and dependent checks. A PR description or completion report alone does not reopen the option.
296
- - The reviewer checks the new row and approval provenance before accepting a formerly rejected option. `npx qfai validate` checks the four-column decision-table shape, status vocabulary, and append-only cells; it does not infer that two differently worded options are the same.
293
+ - Do not reintroduce an option whose row in `<paths.specsDir>/decisions.md` has Content opening `Declined:`, or `Declined change request:` in a row written before change requests were retired.
294
+ - To reconsider it, ask the user. Only on approval append a new `DEC-yyyymmddhhMMss` row whose Approach opens `Reopens DEC-…` with the declined row's full ID, then states the changed evidence and who approved it, when, and the option chosen. Leave the declined row intact.
295
+ - A PR description or completion report alone does not reopen the option.
296
+ - The reviewer checks the new row and approval provenance before accepting a formerly rejected option. `npx qfai validate` checks the three-column decision-table shape and that no existing row was removed or renumbered; it does not infer that two differently worded options are the same.
297
297
 
298
298
  ## Gate Failure Autorepair Protocol
299
299
 
@@ -152,7 +152,7 @@ read.
152
152
  - Do not let a helper script or a workaround stand in for the standard tools
153
153
  the task calls for.
154
154
  - Where the task cannot be done as specified, or a test case is itself wrong,
155
- stop and report it. The route is a Change Request against the specification
155
+ stop and report it. The route is a specification change through its owner
156
156
  (`.qfai/assistant/rule/drift-protocol.md`), never an edit that makes the
157
157
  wrong case pass.
158
158
 
@@ -18,8 +18,8 @@ The stage that owns `<paths.specsDir>/decisions.md`, `qfai-sdd`, records each
18
18
  decision as one row there. Every other stage records each decision in its own
19
19
  final report.
20
20
 
21
- Either record carries the four labelled Approach items, under the rules stated
22
- at the top of `.qfai/assistant/skill/qfai-sdd/templates/spec/decisions.md`.
21
+ Either record is a short decision record: what was decided and why, in the
22
+ form stated at the top of `.qfai/assistant/skill/qfai-sdd/templates/spec/decisions.md`.
23
23
 
24
24
  ## When to stop and ask
25
25