qfai 2.1.2 → 2.2.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 (162) hide show
  1. package/README.md +46 -6
  2. package/assets/defaults/agent-routing/qfai-implement.yml +9 -0
  3. package/assets/defaults/agent-routing/qfai-triage.yml +9 -0
  4. package/assets/defaults/workflows/answer-in-session.yml +8 -0
  5. package/assets/defaults/workflows/bump-dependency.yml +4 -1
  6. package/assets/defaults/workflows/decide-design.yml +5 -1
  7. package/assets/defaults/workflows/quarantine-flaky.yml +3 -0
  8. package/assets/defaults/workflows/rename-concept.yml +30 -0
  9. package/assets/defaults/workflows/repair-consistency.yml +1 -0
  10. package/assets/defaults/workflows/resolve-conflicts.yml +14 -0
  11. package/assets/defaults/workflows/retire-feature.yml +26 -0
  12. package/assets/defaults/workflows/run-operation.yml +11 -0
  13. package/assets/defaults/workflows/run-release.yml +12 -0
  14. package/assets/defaults/workflows/write-procedure.yml +18 -0
  15. package/assets/graph/codegraph-native.mjs +174 -0
  16. package/assets/graph/graphify-native.py +72 -0
  17. package/assets/init/.claude/settings.json +11 -29
  18. package/assets/init/.codex/hooks.json +9 -21
  19. package/assets/init/.qfai/assistant/agent/backend-engineer.md +1 -1
  20. package/assets/init/.qfai/assistant/agent/frontend-engineer.md +1 -1
  21. package/assets/init/.qfai/assistant/agent/implementation-reviewer.md +5 -0
  22. package/assets/init/.qfai/assistant/agent/product-surface-reviewer.md +8 -3
  23. package/assets/init/.qfai/assistant/rule/constitution.md +36 -18
  24. package/assets/init/.qfai/assistant/rule/drift-protocol.md +80 -1
  25. package/assets/init/.qfai/assistant/rule/references/codex-delegation.md +27 -0
  26. package/assets/init/.qfai/assistant/rule/references/gate-failure-autorepair.md +1 -1
  27. package/assets/init/.qfai/assistant/rule/references/griller-recommendations.md +21 -9
  28. package/assets/init/.qfai/assistant/rule/review-convergence.md +34 -15
  29. package/assets/init/.qfai/assistant/rule/shared-skill-delegation-baseline.md +12 -2
  30. package/assets/init/.qfai/assistant/rule/shared-skill-operating-baseline.md +14 -7
  31. package/assets/init/.qfai/assistant/rule/ui-definition-protocol.md +2 -1
  32. package/assets/init/.qfai/assistant/rule/workflow.md +2 -1
  33. package/assets/init/.qfai/assistant/skill/qfai-discussion/SKILL.md +11 -2
  34. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/discussion-completion-matrix.md +32 -10
  35. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/ui-bearing-playbook.md +17 -0
  36. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/ui_ux/trend_scan_playbook.md +3 -1
  37. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/01_Context.md +4 -1
  38. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/04_Sources.md +5 -1
  39. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/uiux/00_index.md +4 -1
  40. package/assets/init/.qfai/assistant/skill/qfai-grilling/SKILL.md +30 -20
  41. package/assets/init/.qfai/assistant/skill/qfai-grilling/references/delegated-session.md +4 -3
  42. package/assets/init/.qfai/assistant/skill/qfai-grilling/references/session-record.md +8 -2
  43. package/assets/init/.qfai/assistant/skill/qfai-implement/SKILL.md +9 -2
  44. package/assets/init/.qfai/assistant/skill/qfai-implement/references/parallelization-policy.md +10 -0
  45. package/assets/init/.qfai/assistant/skill/qfai-implement/references/red-admissibility.md +35 -0
  46. package/assets/init/.qfai/assistant/skill/qfai-implement/references/test-runner-recipes.md +445 -0
  47. package/assets/init/.qfai/assistant/skill/qfai-implement/references/ui-affecting.md +3 -3
  48. package/assets/init/.qfai/assistant/skill/qfai-prototyping/SKILL.md +10 -9
  49. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/generator-prompt.md +33 -2
  50. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/handoff.md +77 -2
  51. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/iteration-loop.md +12 -3
  52. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/review-payload-schema.md +3 -1
  53. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/reviewer-prompt.md +31 -5
  54. package/assets/init/.qfai/assistant/skill/qfai-run/SKILL.md +48 -46
  55. package/assets/init/.qfai/assistant/skill/qfai-run/references/codex-cloud-install.md +80 -0
  56. package/assets/init/.qfai/assistant/skill/qfai-run/references/extraction.md +202 -126
  57. package/assets/init/.qfai/assistant/skill/qfai-run/references/operator-screens.md +38 -15
  58. package/assets/init/.qfai/assistant/skill/qfai-run/references/plan.md +48 -22
  59. package/assets/init/.qfai/assistant/skill/qfai-run/references/reached-step-observations.md +134 -0
  60. package/assets/init/.qfai/assistant/skill/qfai-run/references/stage-points.md +7 -4
  61. package/assets/init/.qfai/assistant/skill/qfai-run/scripts/codex-cloud-install.mjs +117 -0
  62. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/concrete-abstract-cycle.md +2 -1
  63. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/contract-artifact-rules.md +1 -1
  64. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/design-md-authoring.md +20 -7
  65. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-execution-playbook.md +2 -2
  66. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-phase-checklists.md +2 -2
  67. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-pre-draft-grilling.md +5 -1
  68. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-quality-gate.md +2 -2
  69. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-triage.md +111 -7
  70. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/spec-traceability-rules.md +1 -1
  71. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/ui-contract-guide.md +58 -8
  72. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/change-request.md +1 -1
  73. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/decisions/page-NNNN.md +6 -0
  74. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/decisions.md +18 -0
  75. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/open-questions.md +13 -0
  76. package/assets/init/.qfai/assistant/skill/qfai-triage/SKILL.md +10 -7
  77. package/assets/init/.qfai/assistant/skill/qfai-verify/references/verify-output-contract.md +22 -16
  78. package/assets/init/.qfai/assistant/skill/web-research/SKILL.md +1 -1
  79. package/assets/init/.qfai/assistant/step/common-design-md/STEP.md +33 -16
  80. package/assets/init/.qfai/assistant/step/common-gate-run/STEP.md +37 -8
  81. package/assets/init/.qfai/assistant/step/common-grilling-record/STEP.md +25 -4
  82. package/assets/init/.qfai/assistant/step/common-policy-check/STEP.md +1 -0
  83. package/assets/init/.qfai/assistant/step/common-review-cycle/STEP.md +68 -15
  84. package/assets/init/.qfai/assistant/step/discussion-interview/STEP.md +25 -10
  85. package/assets/init/.qfai/assistant/step/discussion-oq/STEP.md +17 -1
  86. package/assets/init/.qfai/assistant/step/discussion-pack/STEP.md +23 -3
  87. package/assets/init/.qfai/assistant/step/discussion-uiux/STEP.md +9 -1
  88. package/assets/init/.qfai/assistant/step/implement-acceptance/STEP.md +3 -0
  89. package/assets/init/.qfai/assistant/step/implement-credentials/STEP.md +4 -0
  90. package/assets/init/.qfai/assistant/step/implement-dep-bump/STEP.md +33 -3
  91. package/assets/init/.qfai/assistant/step/implement-diagnose/STEP.md +12 -3
  92. package/assets/init/.qfai/assistant/step/implement-procedure/STEP.md +98 -0
  93. package/assets/init/.qfai/assistant/step/implement-quarantine/STEP.md +21 -4
  94. package/assets/init/.qfai/assistant/step/implement-refactor/STEP.md +25 -5
  95. package/assets/init/.qfai/assistant/step/implement-regression-fix/STEP.md +3 -3
  96. package/assets/init/.qfai/assistant/step/implement-retire/STEP.md +26 -0
  97. package/assets/init/.qfai/assistant/step/implement-scaffold/STEP.md +28 -5
  98. package/assets/init/.qfai/assistant/step/implement-stress-harness/STEP.md +33 -2
  99. package/assets/init/.qfai/assistant/step/implement-tdd/STEP.md +20 -5
  100. package/assets/init/.qfai/assistant/step/maintain-edit/STEP.md +70 -6
  101. package/assets/init/.qfai/assistant/step/prototyping-grill/STEP.md +39 -6
  102. package/assets/init/.qfai/assistant/step/prototyping-handoff/STEP.md +12 -3
  103. package/assets/init/.qfai/assistant/step/prototyping-loop/STEP.md +56 -6
  104. package/assets/init/.qfai/assistant/step/prototyping-preflight/STEP.md +13 -0
  105. package/assets/init/.qfai/assistant/step/sdd-contract/STEP.md +8 -0
  106. package/assets/init/.qfai/assistant/step/sdd-cycle/STEP.md +9 -4
  107. package/assets/init/.qfai/assistant/step/sdd-story/STEP.md +22 -1
  108. package/assets/init/.qfai/assistant/step/sdd-triage/STEP.md +52 -14
  109. package/assets/init/.qfai/assistant/step/triage-answer/STEP.md +2 -2
  110. package/assets/init/.qfai/assistant/step/triage-close/STEP.md +7 -2
  111. package/assets/init/.qfai/assistant/step/triage-handoff/STEP.md +6 -0
  112. package/assets/init/.qfai/assistant/step/triage-operate/STEP.md +123 -0
  113. package/assets/init/.qfai/assistant/step/verify-commit/STEP.md +35 -10
  114. package/assets/init/.qfai/assistant/step/verify-qfai-gate/STEP.md +8 -1
  115. package/assets/init/.qfai/assistant/step/verify-repeat-run/STEP.md +40 -0
  116. package/assets/init/.qfai/assistant/step/verify-repo-gate/STEP.md +77 -7
  117. package/assets/init/root/.agents/rules/api-budget.md +8 -3
  118. package/assets/init/root/.agents/rules/document-schema.md +17 -0
  119. package/assets/init/root/.agents/rules/documentation-clarity.md +1 -1
  120. package/assets/init/root/.agents/rules/graph-exploration.md +164 -0
  121. package/assets/init/root/.agents/rules/grilling.md +100 -43
  122. package/assets/init/root/.agents/rules/reminders.json +20 -32
  123. package/assets/init/root/.agents/rules/session-feedback.md +6 -11
  124. package/assets/init/root/.agents/rules/untrusted-content.md +2 -2
  125. package/assets/init/root/.agents/rules/user-questions.md +24 -14
  126. package/assets/init/root/.gitattributes +2 -0
  127. package/assets/init/root/.github/workflows/qfai-docs.yml +2 -2
  128. package/assets/init/root/.github/workflows/qfai-tests.yml +88 -35
  129. package/assets/init/root/.github/workflows/qfai-validate.yml +2 -2
  130. package/assets/init/root/AGENTS.md +1 -0
  131. package/assets/mdschema/manifest.yml +3 -0
  132. package/assets/mdschema/story/03_contract/tech.mdschema.yml +1 -1
  133. package/assets/mdschema/story/decisions/page-NNNN.mdschema.yml +32 -0
  134. package/assets/mdschema/story/decisions.mdschema.yml +12 -0
  135. package/assets/schemas/workflow/extraction.schema.json +98 -2
  136. package/assets/schemas/workflow/plan.schema.json +34 -1
  137. package/assets/scripts/check-mdschema.mjs +497 -39
  138. package/dist/cli/index.cjs +7667 -3515
  139. package/dist/cli/index.cjs.map +1 -1
  140. package/dist/cli/index.mjs +8872 -4702
  141. package/dist/cli/index.mjs.map +1 -1
  142. package/dist/graph/cli.cjs +1568 -0
  143. package/dist/graph/cli.cjs.map +1 -0
  144. package/dist/graph/cli.d.cts +9 -0
  145. package/dist/graph/cli.d.ts +9 -0
  146. package/dist/graph/cli.mjs +1541 -0
  147. package/dist/graph/cli.mjs.map +1 -0
  148. package/dist/graph/hook.cjs +817 -0
  149. package/dist/graph/hook.cjs.map +1 -0
  150. package/dist/graph/hook.d.cts +9 -0
  151. package/dist/graph/hook.d.ts +9 -0
  152. package/dist/graph/hook.mjs +792 -0
  153. package/dist/graph/hook.mjs.map +1 -0
  154. package/dist/index.cjs +6436 -3012
  155. package/dist/index.cjs.map +1 -1
  156. package/dist/index.d.cts +185 -1
  157. package/dist/index.d.ts +185 -1
  158. package/dist/index.mjs +6620 -3197
  159. package/dist/index.mjs.map +1 -1
  160. package/dist/process-C21nTvkT.d.cts +12 -0
  161. package/dist/process-C21nTvkT.d.ts +12 -0
  162. package/package.json +1 -1
@@ -38,8 +38,8 @@ Do not use a sibling's in-flight findings to hold or clear the current flow. Rec
38
38
 
39
39
  ## Review and evidence
40
40
 
41
- - A pre-draft grilling checkpoint ran before the first write of every design-writing stage entered, and each critical decision it held was put to the user.
41
+ - A pre-draft grilling checkpoint ran before the first write of every design-writing stage entered. It held a grilling session only where it found a decision the repository cannot settle, and each critical decision it held was put to the user.
42
42
  - The final report lists each decision a checkpoint adopted, with its reason.
43
- - Reviewers are independent of authors, and every finding of the one review is fixed or answered under `.qfai/assistant/rule/review-convergence.md`, with no re-review.
43
+ - Reviewers are independent of authors, and every finding of the one review is fixed or answered under `.qfai/assistant/rule/review-convergence.md`.
44
44
  - Evidence records the source, changed IDs and files, contract executability, commands, reviewer verdicts, rejected options excluded, and remaining risks.
45
45
  - No approval-required operation is treated as approved from silence, --auto, or a generic instruction to continue.
@@ -8,9 +8,11 @@ Triage selects the smallest story-tree change that answers each incoming require
8
8
  - Operation choice
9
9
  - Decision and question rows
10
10
  - Published decision prefix recovery
11
+ - Merge-added identical decision copy recovery
11
12
  - Approval and no-question mode
12
13
  - Retiring an EX, AC or BR
13
14
  - ID allocation
15
+ - Conflicted story-tree documents
14
16
  - Completion of triage
15
17
 
16
18
  ## Inputs
@@ -35,7 +37,9 @@ Inspect the impact cascade: policy → BF → US → AC → EX → enforcing con
35
37
  ## Decision and question rows
36
38
 
37
39
  Use <paths.specsDir>/decisions.md and <paths.specsDir>/open-questions.md, each with exactly ID, Content, Approach, Status. Append a row; later only Status may change, including to `PARTLY SUPERSEDED (by DEC-NNNN)` when a later row narrows a decision without replacing it.
38
- Do not edit the first three cells or remove the row, except for explicit branch-added decision renumbering under ID allocation below or the bounded published decision prefix recovery below. Inherited rows retain those cells. Use the next highest ID in the table plus one. A retired item still reserves its BF or US ID.
40
+ Do not edit the first three cells or remove the row, except for explicit branch-added decision renumbering under ID allocation below
41
+ or the bounded published decision prefix recovery below, and remove a row only as a proven surplus copy under the merge-added
42
+ identical decision copy recovery below. Inherited rows retain those cells. Use the next highest ID in the table plus one; for DEC, include every listed page and the root tail. A retired item still reserves its BF or US ID.
39
43
 
40
44
  decisions.md records only what the user decided: each change request the user approved or declined,
41
45
  and each critical decision the user made. A row is appended once the user has decided what it records.
@@ -54,7 +58,8 @@ it and when; it authorizes no edit. Retiring a story removes its directory under
54
58
  change request that names it, with no separate retired-story file.
55
59
 
56
60
  An existing row at REJECTED is a rejected option. Open questions use OQ-NNNN rows; DEFERRED needs a
57
- specific future decision point. An unanswered critical product decision is an open-questions.md row
61
+ specific future decision point. When a decision settles an open question or makes its text wrong, the
62
+ `sdd-triage` step says when its Status becomes `DONE (by DEC-NNNN)` or `SUPERSEDED (by DEC-NNNN)`. An unanswered critical product decision is an open-questions.md row
58
63
  whose Content opens Unadjudicated:, at TODO until decided. A justified test exception opens a
59
64
  decision Content with Test exception:, names the exact BF, AC, or EX it exempts, and puts the reason
60
65
  in Approach. It takes effect only at DONE; it never exempts descendant items.
@@ -79,6 +84,36 @@ append an `Unadjudicated:` OQ at TODO. Name the affected IDs, expected versus
79
84
  actual behavior, implementation-change evidence, owner and required permission.
80
85
  Stop dependent AC, EX and BR edits; independent authorized work may continue.
81
86
 
87
+ ### Decision pages
88
+
89
+ The root may have one optional `## Decision pages` section before its unique
90
+ `## Decisions` section. Its body holds only unique direct
91
+ `- decisions/page-NNNN.md` entries with four digits; links, annotations, nested
92
+ paths, traversal and unrelated prose are invalid. A page has `# Decisions`,
93
+ one `## Decisions` section and one closed ID, Content, Approach, Status table.
94
+ It has no page index or other section. The root retains its own four-column table.
95
+
96
+ Read pages in list order, followed by the root table. This is one logical
97
+ register: ID allocation, duplicate detection, retirement references and Status
98
+ permissions include every row. Append new rows only to the root table.
99
+ A root without a page list remains a valid legacy register and is read in full.
100
+ Read errors or an incomplete inventory stop permission and allocation decisions.
101
+
102
+ Each physical root and page has at most 500 lines, including comments, blanks,
103
+ the index and table wrappers. Oversized files are reported without truncation.
104
+ Every entry in the decisions directory must be a listed direct page. Register
105
+ paths must be regular directories and files, without symbolic or hard links.
106
+ A formatter exclusion preserves reviewed bytes; it does not waive validation.
107
+ Use consumers that support the complete register before adopting pages; older
108
+ consumers are not assumed to read them.
109
+
110
+ Physical relocation needs a separately adopted execution change request and a
111
+ reviewed raw-byte receipt for the exact source and target. Preserve every raw
112
+ row occurrence, cell, Status, order and line ending; keep the current root tail.
113
+ A historical DONE row is not approval to run a later relocation. Do not rotate
114
+ automatically, repair Status, remove duplicates or normalize inherited cells.
115
+ A read-only proposal or a migration projection grants no permission to write.
116
+
82
117
  ## Published decision prefix recovery
83
118
 
84
119
  When an approved request names a published malformed decision added by the
@@ -98,6 +133,30 @@ automatic repair. Inherited records and open-question rows remain excluded.
98
133
  Rollback follows the recorded new-digest check and restores the original form
99
134
  failure; it never resets, amends or force pushes.
100
135
 
136
+ ## Merge-added identical decision copy recovery
137
+
138
+ When a merge left a second byte-identical copy of an inherited decision and the
139
+ duplicate-ID check rejects it, read
140
+ `.qfai/assistant/rule/drift-protocol.md#merge-added-identical-decision-copy-recovery`.
141
+ That rule defines the lineage, the raw-row proof and the stop conditions.
142
+ Approval of the generic protocol alone authorizes no target; append a separate
143
+ new target-specific change request using `templates/change-request.md`.
144
+
145
+ The request names the exact path, the ID, the bad merge, both parents, the
146
+ common ancestor, the base and its comparison ancestor, each occurrence's
147
+ location, the raw SHA-256 including the line ending and the retain/remove
148
+ mapping. Fresh evidence, reviewed independently after the request is appended,
149
+ fixes the actual write HEAD, the complete preimage and replacement hashes and
150
+ the current authority. Immediately before writing, recheck refs, path,
151
+ authority, counts, mapping and bytes; stale or changed proof stops the
152
+ recovery. Remove only the mapped surplus copies. Keep one original and every
153
+ other row, reference and byte. Open-question rows, rows that differ in any cell,
154
+ padding or line ending, and surplus the base already holds stay excluded.
155
+ Duplicate, drift and Status rules apply as before. The result is no whole-target
156
+ PASS, and the request stays WIP while any named action or required check is
157
+ unfinished. Rollback restores the recorded preimage only while the file still
158
+ equals the replacement; it never resets, amends or force pushes.
159
+
101
160
  ## Approval and no-question mode
102
161
 
103
162
  Use the shared user-question protocol for CREATE, DELETE, SPLIT, MERGE, SUPERSEDE, and UPDATE:REMOVE. Present the target and rationale. Do not self-approve. A request from the user in the session that names the operation and its effect is the approval, and no second question is asked.
@@ -121,7 +180,7 @@ A story-tree or contract file changes only on the user's approval:
121
180
  records who approved it, when, and the label of the option chosen.
122
181
  3. Move the row to DONE once every change it names is written.
123
182
 
124
- A row present before the stage started keeps its ID, Content and Approach, except for explicit branch-added decision renumbering under ID allocation below or published decision prefix recovery above. Inherited rows keep those cells without exception.
183
+ A row present before the stage started keeps its ID, Content and Approach, except for explicit branch-added decision renumbering under ID allocation below or published decision prefix recovery above. Inherited rows keep those cells without exception; the merge-added identical decision copy recovery above removes only surplus copies and keeps the original.
125
184
  Only a row this stage appended changes its Status.
126
185
 
127
186
  ## Retiring an EX, AC or BR
@@ -140,9 +199,17 @@ A retirement touches every place the ID is written. Do all of them in one change
140
199
 
141
200
  ## ID allocation
142
201
 
143
- Read all IDs of the kind in the relevant scope, including IDs named by retirement rows. The next ID is the highest plus one. A project that also counts the IDs its open pull requests add takes the highest across the tree and those pull requests, so a gap above the tree's own highest is allowed. BF spans the project. US is inside its BF. AC and EX are inside their US.
144
- A contract number spans every contract kind, and a BR is numbered inside its contract. DEC and OQ each span their table.
202
+ Read all IDs of the kind in the relevant scope, including IDs named by retirement rows. The next ID is the highest plus one. BF spans the project. US is inside its BF. AC and EX are inside their US.
203
+ A contract number spans every contract kind, and a BR is numbered inside its contract. DEC spans the complete ordered decision register; OQ spans its own table.
145
204
  Empty numeric scopes begin at 0001, and AC/EX tails begin at 01. Do not reuse an ID because its file was removed or a row was rejected.
205
+ Take the number from `npx qfai sdd next-id <kind> [<parent-ID>] --base <local-ref>` right before writing it: a US names its BF, an AC or EX its US, and a BR its contract.
206
+ It reads the working tree and the base ref's commit, a fetched ref such as `origin/main`, and prints the number after the highest of both, not after the last row. It writes nothing and does not see open pull requests.
207
+
208
+ Read the IDs open pull requests add before taking one. Fetch the base. Where a forge CLI is available, list the open pull requests once per session through its REST API, for example `gh api repos/{owner}/{repo}/pulls?state=open`, and reuse that listing for every ID the session takes.
209
+ Fetch each one's head ref, such as `refs/pull/<n>/head`, so a pull request from a fork is read too, and read the IDs it adds from `git diff <base>...<head>`. Take the highest across the base, the working tree and those heads, plus one. Without a forge CLI, read the base alone.
210
+ When merging the base into the branch, check each ID the branch adds against the fetched base. The base's item keeps its ID; the branch renumbers its own item and every reference to it, then runs the gates again.
211
+ Check a DEC or OQ row before the merge, and renumber a DEC row with `renumber-decision` as below, or an OQ row and its references by hand: the union merge of `decisions.md` and `open-questions.md` would duplicate a colliding ID without a conflict. Check any other ID after the merge.
212
+ Keep the change-request row last in `decisions.md`, so the rows the branch added stay in ascending order at the end of the register, where the merge-time renumbering works from the lowest colliding one upward.
146
213
 
147
214
  ### Capacity before writing
148
215
 
@@ -152,7 +219,8 @@ empty), remaining capacity 99-H and the number of requested additions. Count
152
219
  valid IDs in the tree and decisions, including retired IDs, plus observed
153
220
  published parallel heads and known reservations under the project's existing
154
221
  method. Name the fixed observation and what it did not cover. A snapshot
155
- reserves nothing and cannot cover unpublished concurrent work.
222
+ reserves nothing and cannot cover unpublished concurrent work. Read decisions as
223
+ the complete ordered register: every listed page followed by the root tail.
156
224
 
157
225
  If requested additions exceed 99-H, stop before any partial allocation or
158
226
  invalid declaration. Never fill gaps, reuse retired IDs or emit tail 100.
@@ -207,7 +275,7 @@ approval and mapping procedure, not a relocation executor or mapping schema.
207
275
 
208
276
  Two branches can take the same next ID. When a merge leaves one ID on two items:
209
277
 
210
- 1. The merge target's item keeps the ID. Renumber the incoming item, the one the merge brings in.
278
+ 1. The base's item keeps the ID, whichever way the merge runs. Renumber the incoming item, the one the branch added.
211
279
  2. Give it the next ID of its scope.
212
280
  A renumbered BF or US takes its child IDs and its directory names with it, as a move to another BF does below.
213
281
  3. Change every citation belonging to the incoming item in the same commit.
@@ -226,6 +294,27 @@ For a unique decision added by the incoming branch, repair its ID before merging
226
294
  qfai sdd renumber-decision --from <old-DEC-ID> --to <new-DEC-ID> --base <local-ref>
227
295
  ```
228
296
 
297
+ Renumber once, at merge time. While the pull request is open, keep the
298
+ branch's decision IDs even when the base moves. The session that merges it
299
+ fetches the base and renumbers only when the fetched base now declares an ID
300
+ the branch added. Then it renumbers every row the branch added, from the lowest
301
+ colliding one upward and lowest first, so the rows stay in ascending order.
302
+ Run on a clean tree against the fetched ref, for example `origin/main`, commit
303
+ after each run, then merge the base.
304
+
305
+ Check the base before merging. The shipped `.gitattributes` merges
306
+ `decisions.md` with `merge=union`, so the ledger never conflicts: a colliding
307
+ ID merges silently into two rows with the same ID, and the command then
308
+ refuses that ledger as a duplicate. If such a merge is committed but not
309
+ pushed, run `git reset --merge ORIG_HEAD`, renumber, and merge again. If it was
310
+ pushed, the two records already share the ID: follow the change request rule
311
+ earlier in this section.
312
+
313
+ The command also refuses a ledger left dirty by a merge that stopped on
314
+ conflicts in other files, and writes nothing. Abort the merge with
315
+ `git merge --abort`, renumber, and merge again. Then redo any other conflict
316
+ resolutions after the second merge.
317
+
229
318
  The explicit base and HEAD must resolve locally and have one common ancestor
230
319
  that declares no source row. The base may already use that ID; the current
231
320
  tree must declare it only once. Choose an unused destination above both story trees'
@@ -248,6 +337,21 @@ These checks guarantee neither atomic concurrency nor power-loss safety.
248
337
 
249
338
  A move to another BF changes the story's US ID and all child AC and EX IDs. It follows the existing approval path, not the same-BF capacity exception. Apply the complete map above to approved active citations and retire old IDs in a new approved record; inherited DEC cells and their historical references stay unchanged.
250
339
 
340
+ ## Conflicted story-tree documents
341
+
342
+ When a merge leaves story-tree documents conflicted, run `npx qfai sdd merge-docs`
343
+ before resolving them by hand. It merges each unmerged document from the index by
344
+ table row, keyed by the first cell, and by sentence, so edits to different sentences
345
+ of one long row no longer conflict as a whole line. What it cannot settle stays
346
+ between conflict markers; it then reports the document-schema findings of the result.
347
+ A document already edited by hand, or by an earlier run, is left as it is.
348
+ Review the result and stage it with `git add`; it stages nothing itself.
349
+
251
350
  ## Completion of triage
252
351
 
253
352
  Every requirement has a target, an approved or approval-free operation, and a recorded impact path. Every product ambiguity has an OQ. The next stage may write only the approved scope. A rejected option stays excluded until an explicit reopening decision is appended.
353
+
354
+ The one exception: a change to shipped seed or sample data whose values no
355
+ story, BR or contract sets changes no story-tree file. Triage states that in one
356
+ line of its report and passes with no operation and no decision row, and the
357
+ later sdd steps then have nothing to write.
@@ -87,7 +87,7 @@ The table holds no rule. A behaviour a layer must show is a BR in the contract t
87
87
  | Decision | DEC-NNNN | decisions.md |
88
88
  | Open question | OQ-NNNN | open-questions.md |
89
89
 
90
- Use highest existing number plus one in the scope. Count IDs named in retired-item decisions, so deletion never frees an ID. Empty scopes begin at 0001 or, for AC and EX tails, 01. Directory names match their BF and US IDs. Do not add a CLI allocator.
90
+ Use highest existing number plus one in the scope. Count IDs named in retired-item decisions, so deletion never frees an ID. Empty scopes begin at 0001 or, for AC and EX tails, 01. Directory names match their BF and US IDs. Take the number from `npx qfai sdd next-id`, which reads the working tree and a fetched base and reserves no ID.
91
91
 
92
92
  AC/EX tails remain two digits with upper bound 99. Before planned additions,
93
93
  compare requested additions with the retired-inclusive remaining 99-H. Stop an
@@ -167,6 +167,9 @@ that cannot be undone. Each is an entry with exactly these keys, all non-empty:
167
167
  | `text` | the words as displayed |
168
168
  | `why` | what the user could not know or do without it, and why a label or structure is not enough |
169
169
 
170
+ A text shown in several states is listed once per state it shows in, each entry
171
+ with its own `id`.
172
+
170
173
  `supplements: []` says the screen shows none. Most screens need few, and a screen
171
174
  need not have any. Two kinds of text are not supplements: the message of a field
172
175
  rule is owned by the `validations` of its element, and data the product shows or
@@ -196,12 +199,44 @@ The groups the screen is read in, in reading order. Each is an entry with exactl
196
199
  | `heading` | the displayed heading; leave the key out when the group shows none |
197
200
 
198
201
  An id belongs to one group, and an element or action may be left out of every
199
- group. Without `structure` the screen shows no heading beyond its `title`, so a
200
- heading that appears on the rendered screen has a group here. A group heading is
202
+ group. `structure` is optional only for a screen that shows no heading beyond its
203
+ `title`. A screen that shows any other heading, at any level, has one group with a
204
+ `heading` for each, so a screen with several `h2` headings writes `structure`.
205
+ Leaving the key out says the screen shows no such heading; it never says the
206
+ screen may show one without a group. A group needs a task and a member, so the
207
+ heading must head something the user reads or acts on: declare the table or list
208
+ that shows data as an element, and the group holds it. A heading over prose or
209
+ supplements alone has neither a task nor a member, and does not belong on the
210
+ screen. `npx qfai validate` does not check this, so the
211
+ reviewer compares the rendered headings with the groups. A group heading is
201
212
  not the screen title: a second heading above or beside the real one repeats it.
202
213
  A group that serves no task does not belong on the screen; name the task it
203
214
  enables, or leave the heading and the group out.
204
215
 
216
+ ### Which key holds which text
217
+
218
+ Every text the screen shows has one home. The table applies the definitions above
219
+ to the text authors and reviewers most often disagree about:
220
+
221
+ | Rendered text | Home |
222
+ | ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
223
+ | The one page heading (`h1`) | `title` |
224
+ | A heading over a group of elements or actions (`h2`, `h3`) | `structure[].heading` of that group |
225
+ | A small line above or beside a heading (eyebrow, kicker) | a supplement with `near` set to the group; it is not a heading and not a label |
226
+ | The text of a field, button or other control | `label` of that element or action |
227
+ | Link text | `label` of a `navigate` action |
228
+ | A table column header | recommended: `label` of an element declared for that column, as elements are the display fields |
229
+ | A figure caption | a supplement with `near` set to the element it describes |
230
+ | An item of a list the product writes (a fixed checklist) | a supplement |
231
+ | An item of a list made of data the product shows | outside the contract: data is not copy the contract authors |
232
+ | Product or site-identity text (a name, a tagline) | `label` when it is a link or control, otherwise a supplement |
233
+ | The message of a field rule | `validations` of that element |
234
+
235
+ Nothing is outside the contract merely because it repeats across screens. Text that
236
+ repeats on every screen is listed on each, and when no `why` that names a decision
237
+ can be written for it, the text is a candidate for removal from the screen rather
238
+ than a reason to leave it unlisted.
239
+
205
240
  ### A worked example
206
241
 
207
242
  The sample at `templates/contracts/ui-contract.sample.yaml` shows a complete
@@ -239,10 +274,24 @@ closing punctuation do not make a text different. Whether a sentence is needed i
239
274
  judged against the task by the reviewer; validate compares ids and exact wording
240
275
  only.
241
276
 
277
+ `npx qfai validate --rendered <file>` compares what the screens rendered with
278
+ these lists. Your own browser run writes the file, and QFAI renders nothing:
279
+ `{ "screens": [{ "contract": "UI-0001", "screen": "order_create", "when": "default", "texts": ["..."] }] }`,
280
+ one entry per screen and state, holding the texts the screen showed. Leave out
281
+ data the product shows, text the user typed and the message of a field rule.
282
+ `QFAI-CONTRACT-047` names a rendered text that is no title, group heading, label
283
+ or supplement of that state, and `QFAI-CONTRACT-048` a supplement of that state
284
+ the screen did not render; `QFAI-CONTRACT-046` names a file or an entry out of
285
+ shape. A supplement counts only for its own `when`, so a text shown in several
286
+ states needs its entry for each. Only the screens and states the file holds are
287
+ compared, so a render of
288
+ the default state alone checks the default state.
289
+
242
290
  A contract written before these keys was valid without them. Add
243
- `supplements` to each screen: `supplements: []` is the answer for a screen that
244
- shows nothing beyond its title and labels. Keep `structure` out until a group
245
- heading is wanted.
291
+ `supplements` to each screen, listing each text it shows beyond its title, group
292
+ headings and labels; `supplements: []` is only for a screen that shows no such
293
+ text. Keep `structure` out while the screen
294
+ shows no heading beyond its title; the first such heading needs its group.
246
295
 
247
296
  Two contracts that state the same screen `id` each hold their own `supplements`
248
297
  and `structure`; the project-wide screen list compares `title`, `route` and
@@ -290,9 +339,10 @@ Render the element with that marker, or remove the marker from the contract.
290
339
  **A label does not match.** Update the contract label, then the rendered text or
291
340
  marker mapping. Updating one side leaves the two out of step.
292
341
 
293
- **`QFAI-CONTRACT-043` names a screen with no `supplements`.** Add `supplements: []`
294
- if the screen shows no text beyond its title, group headings and labels, or list each
295
- text with its `near`, `when`, `text` and `why`.
342
+ **`QFAI-CONTRACT-043` names a screen with no `supplements`.** List each text the
343
+ screen shows beyond its title, group headings and labels, one entry with `id`,
344
+ `near`, `when`, `text` and `why`; write `supplements: []` only if it shows no
345
+ such text.
296
346
 
297
347
  **`QFAI-CONTRACT-045` warns that a supplement repeats a label.** Delete the supplement,
298
348
  or word it so it tells the user something the label does not.
@@ -6,7 +6,7 @@ Record a change request as one row in `<paths.specsDir>/decisions.md`. The row h
6
6
  | ---------- | ------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | ------ |
7
7
  | `DEC-NNNN` | `Change request: <authorized repository-relative paths>; <conflicting fact and source reference>` | `<proposed change, reason, affected downstream work, owner rerun or validation required; approved by <who>, <when>, choosing <option>>` | `WIP` |
8
8
 
9
- - Allocate `DEC-NNNN` as the highest decision ID in this tree plus one. Never reuse an ID, including a retired one.
9
+ - Allocate `DEC-NNNN` by `.qfai/assistant/skill/qfai-sdd/references/sdd-triage.md#id-allocation`, which also reads the IDs open pull requests add. Never reuse an ID, including a retired one.
10
10
  - Begin `Content` with `Change request:` and name every repository-relative path the decision can change; an ID there authorizes nothing. A path mentioned only in a discussion or an alternative does not authorize an edit.
11
11
  - Describe the actual contradiction and its source in `Content`. In `Approach`, state the proposed correction, affected work, and the gate that proves it is applied, inside the form stated at the top of `templates/spec/decisions.md`. Keep both cells concise enough to review as a table row.
12
12
  - Append the row only once the user approves the change, at `WIP`, and record in `Approach` who approved it, when, and the option chosen. Move it to `DONE` only after the owner rerun, affected artifacts, and validation evidence are complete. Use `SUPERSEDED (by DEC-NNNN)` when a later decision replaces the row, and `PARTLY SUPERSEDED (by DEC-NNNN)` when it replaces only part of it.
@@ -0,0 +1,6 @@
1
+ # Decisions
2
+
3
+ ## Decisions
4
+
5
+ | ID | Content | Approach | Status |
6
+ | --- | ------- | -------- | ------ |
@@ -16,12 +16,30 @@ correction, goes inside these items. Write a `|` inside a cell as `\|`.
16
16
  Use this form for every new row. A passing validation result does not prove
17
17
  that every decision row follows it.
18
18
 
19
+ A release approval, with `<...>` standing for the project's values, has this
20
+ Content cell:
21
+
22
+ Release <X.Y.Z> approved by <name> on <date>, option "<label>"
23
+
24
+ and this Approach cell, written on one line and without backticks around it:
25
+
26
+ - Evidence: file:CHANGELOG.md; command:<the release checks> → <result> - Grounds: <why the checks support the release> - Residual risk: none — <reason> - Rollback: <the steps that retract the release>
27
+
19
28
  A row that records a spec change following from an earlier approval may name
20
29
  that earlier decision by its ID in `Grounds:`, in place of a new answer from
21
30
  the user. Its `Evidence:` still lists what supports the change.
22
31
 
23
32
  A stage that does not own this file records its decisions in its own final
24
33
  report, with the same four items under the same rules.
34
+ A legacy root has only the Decisions section. When reviewed historical pages
35
+ are adopted, insert an optional '## Decision pages' section before '## Decisions',
36
+ with only unique direct '- decisions/page-NNNN.md' entries in read order.
37
+ Each page uses the same closed four-column table and has no page index.
38
+ Read listed pages before this root table; append new rows only to this root.
39
+ Every physical root and page, including comments and blank lines, stays within
40
+ 500 lines. Rotation is never automatic; use the separately approved relocation
41
+ procedure in the SDD triage reference.
42
+
25
43
  -->
26
44
 
27
45
  # Decisions
@@ -1,3 +1,16 @@
1
+ <!--
2
+ Each row records one open question. After a row is added, only its Status
3
+ changes. Status is TODO, WIP, DONE, DEFERRED, `DONE (by DEC-NNNN)` or
4
+ `SUPERSEDED (by DEC-NNNN)`.
5
+
6
+ When a decision row answers the question, set `DONE (by DEC-NNNN)`, naming that
7
+ row. When a decision makes what the row states wrong before the question is
8
+ answered, set `SUPERSEDED (by DEC-NNNN)` and append a new row for the question
9
+ that remains. A reader of the row then finds the decision that overrides its
10
+ text. Validation reports a named decision that no decisions row declares,
11
+ and warns on a plain DONE, because it names no decision.
12
+ -->
13
+
1
14
  # Open Questions
2
15
 
3
16
  ## Open Questions
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: qfai-triage
3
3
  title: QFAI Triage (Requests that end without a tracked change)
4
- description: "Use when invoked by name or handed a QFAI work order for a request that ends without a tracked change: a question, a duplicate, missing information, a split, automated reports, a security report, an operation only a person can run, or authorized cleanup of current-task temporary directories."
4
+ description: "Use when invoked by name or handed a QFAI work order for a request that ends without a tracked change: a question, a duplicate, missing information, a split, automated reports, a security report, an operation only a person can run, an operation the user named on finished work, or authorized cleanup of current-task temporary directories."
5
5
  argument-hint: "<the request, as it was reported>"
6
6
  allowed-tools: [Read, Glob, Grep, Write, Bash, TodoWrite, Task, Agent]
7
7
  roles:
@@ -25,6 +25,7 @@ steps:
25
25
  - triage-security-intake
26
26
  - triage-handoff
27
27
  - triage-owned-cleanup
28
+ - triage-operate
28
29
  - triage-close
29
30
  requires: []
30
31
  mode: execution-focused
@@ -38,12 +39,13 @@ Run the entry check of
38
39
  `.qfai/assistant/rule/shared-skill-operating-baseline.md#workflow-run-entry-check-mandatory`
39
40
  first.
40
41
 
41
- This skill answers, closes, splits or hands over a request, and changes no
42
- file git tracks. Work the request needs is recorded as a follow-up request,
42
+ This skill answers, closes, splits or hands over a request, or carries out an
43
+ operation the user named, and changes no file git tracks. Work the request needs is recorded as a follow-up request,
43
44
  never done here except the exact current-task temporary cleanup that
44
- `triage-owned-cleanup` permits. That step rechecks existing user authority and
45
- repository-local scope before any deletion. No other triage step executes an
46
- operation, and `triage-handoff` still waits for the person's reported result.
45
+ `triage-owned-cleanup` permits, after rechecking existing user authority and
46
+ repository-local scope, and the named operation `triage-operate` runs. No other
47
+ triage step executes an operation, and `triage-handoff` still waits for the
48
+ person's reported result.
47
49
 
48
50
  ## Inputs
49
51
 
@@ -74,6 +76,7 @@ run it, then move to the next.
74
76
  | `triage-security-intake` | Takes a vulnerability report in privately | The request reports no exploitable weakness |
75
77
  | `triage-handoff` | Gives a person the steps of an operation only they can run | The request needs no operation that only a person can run |
76
78
  | `triage-owned-cleanup` | Removes authorized current-task temporary directories and verifies absence | The request is not the specific repository-local cleanup the step permits |
79
+ | `triage-operate` | Runs the operation the user named on finished work, and reports its result | The request names no operation |
77
80
  | `triage-close` | Records the outcome and each follow-up, and closes | Only `triage-security-intake` ran: the fix follows it, so the request stays open |
78
81
 
79
82
  Invoked by name, the skill ends at this stage. It starts no other stage and
@@ -114,7 +117,7 @@ list any remaining actions instead.
114
117
 
115
118
  project_memory:
116
119
 
117
- - Triage changes no tracked file; only `triage-owned-cleanup` executes its bounded cleanup.
120
+ - Triage changes no tracked file; only `triage-owned-cleanup` and `triage-operate` execute an operation.
118
121
  - Other work it finds is a follow-up request.
119
122
  - A follow-up is recorded, never routed inside the run that found it.
120
123
  - A security report stays private until the fix is ready to disclose.
@@ -4,7 +4,7 @@
4
4
 
5
5
  - Verdict file
6
6
  - Per-gate results
7
- - CI-only checks
7
+ - Delegated checks
8
8
  - Scope
9
9
  - Example and rules
10
10
 
@@ -36,30 +36,36 @@ completion rules stay unchanged.
36
36
 
37
37
  Each entry of `gates` is `{ name, status, command }`, plus these optional fields:
38
38
 
39
- | Field | Type | Meaning |
40
- | ---------- | ------ | --------------------------------------------------------------------------------------------------------------------------------- |
41
- | `status` | string | `"PASS"`, `"FAIL"`, `"UNRUN"` or `"DELEGATED"`. `"UNRUN"` is a gate with no command, launcher or environment; it is never a pass. |
42
- | `baseline` | string | On a `"FAIL"`: `"same"` when the base commit fails identically, `"different"` when it does not, `"unrun"` when it cannot run. |
43
- | `reason` | string | On an `"UNRUN"` gate, or a `baseline` of `"unrun"`: what is missing. |
44
- | `check` | string | On a `"DELEGATED"` gate: the CI check that runs it. |
45
- | `ci` | string | On a `"DELEGATED"` gate: `"green"`, `"red"` or `"pending"`, the state of that check when the file is written. |
39
+ | Field | Type | Meaning |
40
+ | ---------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
41
+ | `status` | string | `"PASS"`, `"FAIL"`, `"UNRUN"` or `"DELEGATED"`. `"UNRUN"` is a gate with no command, launcher or environment; it is never a pass. |
42
+ | `baseline` | string | On a `"FAIL"`: `"same"` when the base commit fails identically, `"different"` when it does not, `"unrun"` when it cannot run. |
43
+ | `reason` | string | On an `"UNRUN"` gate, or a `baseline` of `"unrun"`: what is missing. On a `baseline` of `"same"`: the failing test identifiers and the environment, in one or two sentences (see `verify-repo-gate`). |
44
+ | `check` | string | On a `"DELEGATED"` gate: the CI check that runs it. |
45
+ | `ci` | string | On a `"DELEGATED"` gate: `"green"`, `"red"` or `"pending"`, the state of that check when the file is written. |
46
46
 
47
- ## CI-only checks
47
+ ## Delegated checks
48
48
 
49
- A gate the project's Standard commands declare `CI only: <check name>` is
50
- recorded `"DELEGATED"` with its `check` and `ci` for the candidate being evaluated.
49
+ A gate the project's Standard commands declare `CI only: <check name>`, or a
50
+ gate where the user's instruction for this run delegates that gate to a named CI check,
51
+ is recorded `"DELEGATED"` with its `check` and `ci` for the candidate being evaluated.
51
52
  `check` names the actual CI check and `ci` its observed state.
52
53
  A `"red"` check makes the top-level `status` `"FAIL"` for that candidate.
53
54
  A `"pending"` one does not, and `summary` names it. A runnable local gate is
54
- never delegated to avoid running it. Retain an observed FAIL or
55
- UNRUN; neither becomes PASS or DELEGATED because a verification commit is wanted.
55
+ never delegated to avoid running it on the agent's own judgment. Retain an
56
+ observed FAIL or UNRUN; neither becomes PASS or DELEGATED because a verification commit is wanted.
57
+
58
+ A delegation by instruction needs the instruction quoted word for word in the
59
+ stage report, with where it came from. `verify.json` carries only `check` and
60
+ `ci` for it, and `summary` says "delegated by user instruction". Without an
61
+ instruction that can be quoted, the gate is not delegated.
56
62
 
57
63
  A `"PASS"` verdict with pending delegated checks supports only the existing
58
64
  verification-commit allowance under a user instruction or project policy
59
65
  covering that commit and its paths. It does not establish formal completion or
60
66
  permission to push, create a pull request or merge. Every nondelegated gate
61
67
  must pass. A delegated red check stops transport of the same unchanged candidate.
62
- Explicit CI-only delegation covering a transport commit may instead carry actual
68
+ Explicit delegation (CI-only or by instruction) covering a transport commit may instead carry actual
63
69
  changes addressing that failure through the existing planned fix into a new
64
70
  candidate, while HEAD still names the failed commit. Preserve the prior head,
65
71
  check, run and observed result as FAIL; never relabel that evidence pending.
@@ -85,7 +91,7 @@ states to this contract.
85
91
  ## Scope
86
92
 
87
93
  `scope` is a closed enum. Write the gate set this invocation covers through
88
- execution or an explicitly declared matching CI-only check. Delegation never
94
+ execution or a matching delegated (CI-only or by instruction) check. Delegation never
89
95
  claims that the profile already ran; its check must perform the required scan
90
96
  and profile. A whole-repository scope still requires full validation. Write the
91
97
  one that matches the stage you were invoked for:
@@ -120,7 +126,7 @@ Rules:
120
126
  commit described above. A `FAIL` verdict is a legitimate output; downstream
121
127
  work stops as its gate requires.
122
128
  - Never write a `scope` this invocation does not cover by execution or its
123
- declared matching CI-only check. Writing `"prototyping"` for a `full` gate set
129
+ matching delegated (CI-only or by instruction) check. Writing `"prototyping"` for a `full` gate set
124
130
  is a false verdict, not a workaround. A `--profile verify` gate is
125
131
  `scope: "full"`, not `scope: "atdd"`; `atdd` covers the ATDD gate set only.
126
132
  - Do not add a `version` / `schemaVersion` field. No reader validates one, and a second version series in a distributed artifact is exactly what the distributed-surface rule forbids: the npm package version is the only version this surface has.
@@ -350,4 +350,4 @@ Create lightweight evidence that records:
350
350
  - Need more evidence:
351
351
  Action: rerun the pipeline with refined query, allowlist, or `--max-depth` settings.
352
352
  - Reviewer returned REVISE:
353
- Action: fix or answer each cited gap and record it before reuse; no second review runs.
353
+ Action: fix or answer each cited gap and record it before reuse; a fix that changes behaviour gets the one re-review `common-review-cycle` sets.