@garygentry/feature-forge 0.3.1 → 0.3.4

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 (421) hide show
  1. package/adapters/claude/.feature-forge-bundle.json +1 -1
  2. package/adapters/claude/agents/forge-verifier.md +3 -1
  3. package/adapters/claude/references/decisions/single-writer-threat-model.md +53 -0
  4. package/adapters/claude/references/epic-manifest-schema.json +6 -1
  5. package/adapters/claude/references/epic-state-schema.json +50 -0
  6. package/adapters/claude/references/forge-config-schema.json +19 -1
  7. package/adapters/claude/references/forge-decisions-schema.json +33 -0
  8. package/adapters/claude/references/pipeline-state-schema.json +38 -4
  9. package/adapters/claude/references/ralph-loop-contract.md +6 -3
  10. package/adapters/claude/references/shared-conventions.md +77 -3
  11. package/adapters/claude/references/stage-exit-protocol.md +391 -143
  12. package/adapters/claude/scripts/epic-manifest.py +495 -91
  13. package/adapters/claude/scripts/fix-sweep.py +1180 -0
  14. package/adapters/claude/scripts/forge-bootstrap.py +57 -5
  15. package/adapters/claude/scripts/forge-session.py +4241 -146
  16. package/adapters/claude/scripts/validate-traceability.py +86 -5
  17. package/adapters/claude/skills/forge/SKILL.md +10 -9
  18. package/adapters/claude/skills/forge/references/pipeline-state-schema.json +38 -4
  19. package/adapters/claude/skills/forge/references/shared-conventions.md +77 -3
  20. package/adapters/claude/skills/forge/references/stage-exit-protocol.md +391 -143
  21. package/adapters/claude/skills/forge-0-epic/SKILL.md +7 -2
  22. package/adapters/claude/skills/forge-0-epic/references/edit-mode.md +29 -25
  23. package/adapters/claude/skills/forge-0-epic/references/epic-manifest-subcommands.md +5 -0
  24. package/adapters/claude/skills/forge-0-epic/references/pipeline-state-schema.json +38 -4
  25. package/adapters/claude/skills/forge-0-epic/references/shared-conventions.md +77 -3
  26. package/adapters/claude/skills/forge-0-epic/references/stage-exit-protocol.md +391 -143
  27. package/adapters/claude/skills/forge-1-prd/SKILL.md +17 -4
  28. package/adapters/claude/skills/forge-1-prd/references/shared-conventions.md +77 -3
  29. package/adapters/claude/skills/forge-1-prd/references/stage-exit-protocol.md +391 -143
  30. package/adapters/claude/skills/forge-2-tech/SKILL.md +18 -4
  31. package/adapters/claude/skills/forge-2-tech/references/shared-conventions.md +77 -3
  32. package/adapters/claude/skills/forge-2-tech/references/stage-exit-protocol.md +391 -143
  33. package/adapters/claude/skills/forge-3-specs/SKILL.md +9 -3
  34. package/adapters/claude/skills/forge-3-specs/references/shared-conventions.md +77 -3
  35. package/adapters/claude/skills/forge-3-specs/references/spec-archetypes.md +9 -0
  36. package/adapters/claude/skills/forge-3-specs/references/stage-exit-protocol.md +391 -143
  37. package/adapters/claude/skills/forge-4-backlog/SKILL.md +56 -5
  38. package/adapters/claude/skills/forge-4-backlog/references/shared-conventions.md +77 -3
  39. package/adapters/claude/skills/forge-4-backlog/references/stage-exit-protocol.md +391 -143
  40. package/adapters/claude/skills/forge-5-loop/SKILL.md +67 -69
  41. package/adapters/claude/skills/forge-5-loop/references/agent-selection.md +16 -0
  42. package/adapters/claude/skills/forge-5-loop/references/ralph-loop-contract.md +6 -3
  43. package/adapters/claude/skills/forge-5-loop/references/recovery-procedure.md +349 -0
  44. package/adapters/claude/skills/forge-5-loop/references/result-reporting.md +101 -33
  45. package/adapters/claude/skills/forge-5-loop/references/runner-contract.md +26 -6
  46. package/adapters/claude/skills/forge-5-loop/references/shared-conventions.md +77 -3
  47. package/adapters/claude/skills/forge-5-loop/references/stage-exit-protocol.md +391 -143
  48. package/adapters/claude/skills/forge-6-docs/SKILL.md +75 -8
  49. package/adapters/claude/skills/forge-6-docs/references/shared-conventions.md +77 -3
  50. package/adapters/claude/skills/forge-6-docs/references/stage-exit-protocol.md +516 -0
  51. package/adapters/claude/skills/forge-fix/SKILL.md +119 -33
  52. package/adapters/claude/skills/forge-fix/references/shared-conventions.md +77 -3
  53. package/adapters/claude/skills/forge-fix/references/stage-exit-protocol.md +391 -143
  54. package/adapters/claude/skills/forge-guide/references/forge-config-schema.json +19 -1
  55. package/adapters/claude/skills/forge-guide/references/ralph-loop-contract.md +6 -3
  56. package/adapters/claude/skills/forge-guide/references/shared-conventions.md +77 -3
  57. package/adapters/claude/skills/forge-verify/SKILL.md +82 -51
  58. package/adapters/claude/skills/forge-verify/references/decisions/single-writer-threat-model.md +53 -0
  59. package/adapters/claude/skills/forge-verify/references/findings-template.md +69 -49
  60. package/adapters/claude/skills/forge-verify/references/shared-conventions.md +77 -3
  61. package/adapters/claude/skills/forge-verify/references/stage-exit-protocol.md +516 -0
  62. package/adapters/claude/skills/forge-verify/references/verification-checklists/backlog.md +73 -0
  63. package/adapters/claude/skills/forge-verify/references/verification-checklists/epic.md +4 -3
  64. package/adapters/claude/skills/forge-verify/references/verification-checklists/impl.md +85 -0
  65. package/adapters/claude/skills/forge-verify/references/verification-checklists/specs.md +45 -1
  66. package/adapters/codex/.feature-forge-bundle.json +1 -1
  67. package/adapters/codex/agents/forge-verifier.toml +3 -1
  68. package/adapters/codex/references/decisions/single-writer-threat-model.md +53 -0
  69. package/adapters/codex/references/epic-manifest-schema.json +6 -1
  70. package/adapters/codex/references/epic-state-schema.json +50 -0
  71. package/adapters/codex/references/forge-config-schema.json +19 -1
  72. package/adapters/codex/references/forge-decisions-schema.json +33 -0
  73. package/adapters/codex/references/pipeline-state-schema.json +38 -4
  74. package/adapters/codex/references/process-overview.md +2 -2
  75. package/adapters/codex/references/ralph-loop-contract.md +6 -3
  76. package/adapters/codex/references/shared-conventions.md +102 -28
  77. package/adapters/codex/references/stage-exit-protocol.md +395 -147
  78. package/adapters/codex/scripts/epic-manifest.py +495 -91
  79. package/adapters/codex/scripts/fix-sweep.py +1180 -0
  80. package/adapters/codex/scripts/forge-bootstrap.py +57 -5
  81. package/adapters/codex/scripts/forge-session.py +4241 -146
  82. package/adapters/codex/scripts/validate-traceability.py +86 -5
  83. package/adapters/codex/skills/forge/SKILL.md +13 -12
  84. package/adapters/codex/skills/forge/references/pipeline-state-schema.json +38 -4
  85. package/adapters/codex/skills/forge/references/process-overview.md +2 -2
  86. package/adapters/codex/skills/forge/references/shared-conventions.md +102 -28
  87. package/adapters/codex/skills/forge/references/stage-exit-protocol.md +395 -147
  88. package/adapters/codex/skills/forge-0-epic/SKILL.md +7 -2
  89. package/adapters/codex/skills/forge-0-epic/references/edit-mode.md +37 -33
  90. package/adapters/codex/skills/forge-0-epic/references/epic-manifest-subcommands.md +8 -3
  91. package/adapters/codex/skills/forge-0-epic/references/pipeline-state-schema.json +38 -4
  92. package/adapters/codex/skills/forge-0-epic/references/shared-conventions.md +102 -28
  93. package/adapters/codex/skills/forge-0-epic/references/stage-exit-protocol.md +395 -147
  94. package/adapters/codex/skills/forge-1-prd/SKILL.md +17 -4
  95. package/adapters/codex/skills/forge-1-prd/references/shared-conventions.md +102 -28
  96. package/adapters/codex/skills/forge-1-prd/references/stage-exit-protocol.md +395 -147
  97. package/adapters/codex/skills/forge-2-tech/SKILL.md +18 -4
  98. package/adapters/codex/skills/forge-2-tech/references/shared-conventions.md +102 -28
  99. package/adapters/codex/skills/forge-2-tech/references/stage-exit-protocol.md +395 -147
  100. package/adapters/codex/skills/forge-3-specs/SKILL.md +9 -3
  101. package/adapters/codex/skills/forge-3-specs/references/shared-conventions.md +102 -28
  102. package/adapters/codex/skills/forge-3-specs/references/spec-archetypes.md +9 -0
  103. package/adapters/codex/skills/forge-3-specs/references/stage-exit-protocol.md +395 -147
  104. package/adapters/codex/skills/forge-4-backlog/SKILL.md +56 -5
  105. package/adapters/codex/skills/forge-4-backlog/references/shared-conventions.md +102 -28
  106. package/adapters/codex/skills/forge-4-backlog/references/stage-exit-protocol.md +395 -147
  107. package/adapters/codex/skills/forge-5-loop/SKILL.md +67 -69
  108. package/adapters/codex/skills/forge-5-loop/references/agent-selection.md +17 -1
  109. package/adapters/codex/skills/forge-5-loop/references/ralph-loop-contract.md +6 -3
  110. package/adapters/codex/skills/forge-5-loop/references/recovery-procedure.md +349 -0
  111. package/adapters/codex/skills/forge-5-loop/references/result-reporting.md +101 -33
  112. package/adapters/codex/skills/forge-5-loop/references/runner-contract.md +30 -10
  113. package/adapters/codex/skills/forge-5-loop/references/shared-conventions.md +102 -28
  114. package/adapters/codex/skills/forge-5-loop/references/stage-exit-protocol.md +395 -147
  115. package/adapters/codex/skills/forge-6-docs/SKILL.md +75 -8
  116. package/adapters/codex/skills/forge-6-docs/references/shared-conventions.md +102 -28
  117. package/adapters/codex/skills/forge-6-docs/references/stage-exit-protocol.md +516 -0
  118. package/adapters/codex/skills/forge-fix/SKILL.md +118 -32
  119. package/adapters/codex/skills/forge-fix/references/shared-conventions.md +102 -28
  120. package/adapters/codex/skills/forge-fix/references/stage-exit-protocol.md +395 -147
  121. package/adapters/codex/skills/forge-guide/SKILL.md +1 -1
  122. package/adapters/codex/skills/forge-guide/references/forge-config-schema.json +19 -1
  123. package/adapters/codex/skills/forge-guide/references/process-overview.md +2 -2
  124. package/adapters/codex/skills/forge-guide/references/ralph-loop-contract.md +6 -3
  125. package/adapters/codex/skills/forge-guide/references/shared-conventions.md +102 -28
  126. package/adapters/codex/skills/forge-init/SKILL.md +1 -1
  127. package/adapters/codex/skills/forge-verify/SKILL.md +82 -51
  128. package/adapters/codex/skills/forge-verify/references/decisions/single-writer-threat-model.md +53 -0
  129. package/adapters/codex/skills/forge-verify/references/findings-template.md +70 -50
  130. package/adapters/codex/skills/forge-verify/references/shared-conventions.md +102 -28
  131. package/adapters/codex/skills/forge-verify/references/stage-exit-protocol.md +516 -0
  132. package/adapters/codex/skills/forge-verify/references/verification-checklists/backlog.md +73 -0
  133. package/adapters/codex/skills/forge-verify/references/verification-checklists/epic.md +5 -4
  134. package/adapters/codex/skills/forge-verify/references/verification-checklists/impl.md +85 -0
  135. package/adapters/codex/skills/forge-verify/references/verification-checklists/specs.md +45 -1
  136. package/adapters/copilot/.feature-forge-bundle.json +1 -1
  137. package/adapters/copilot/agents/forge-verifier.md +3 -1
  138. package/adapters/copilot/references/decisions/single-writer-threat-model.md +53 -0
  139. package/adapters/copilot/references/epic-manifest-schema.json +6 -1
  140. package/adapters/copilot/references/epic-state-schema.json +50 -0
  141. package/adapters/copilot/references/forge-config-schema.json +19 -1
  142. package/adapters/copilot/references/forge-decisions-schema.json +33 -0
  143. package/adapters/copilot/references/pipeline-state-schema.json +38 -4
  144. package/adapters/copilot/references/process-overview.md +2 -2
  145. package/adapters/copilot/references/ralph-loop-contract.md +6 -3
  146. package/adapters/copilot/references/shared-conventions.md +102 -28
  147. package/adapters/copilot/references/stage-exit-protocol.md +395 -147
  148. package/adapters/copilot/scripts/epic-manifest.py +495 -91
  149. package/adapters/copilot/scripts/fix-sweep.py +1180 -0
  150. package/adapters/copilot/scripts/forge-bootstrap.py +57 -5
  151. package/adapters/copilot/scripts/forge-session.py +4241 -146
  152. package/adapters/copilot/scripts/validate-traceability.py +86 -5
  153. package/adapters/copilot/skills/forge/forge.md +13 -12
  154. package/adapters/copilot/skills/forge/references/pipeline-state-schema.json +38 -4
  155. package/adapters/copilot/skills/forge/references/process-overview.md +2 -2
  156. package/adapters/copilot/skills/forge/references/shared-conventions.md +102 -28
  157. package/adapters/copilot/skills/forge/references/stage-exit-protocol.md +395 -147
  158. package/adapters/copilot/skills/forge-0-epic/forge-0-epic.md +7 -2
  159. package/adapters/copilot/skills/forge-0-epic/references/edit-mode.md +37 -33
  160. package/adapters/copilot/skills/forge-0-epic/references/epic-manifest-subcommands.md +8 -3
  161. package/adapters/copilot/skills/forge-0-epic/references/pipeline-state-schema.json +38 -4
  162. package/adapters/copilot/skills/forge-0-epic/references/shared-conventions.md +102 -28
  163. package/adapters/copilot/skills/forge-0-epic/references/stage-exit-protocol.md +395 -147
  164. package/adapters/copilot/skills/forge-1-prd/forge-1-prd.md +17 -4
  165. package/adapters/copilot/skills/forge-1-prd/references/shared-conventions.md +102 -28
  166. package/adapters/copilot/skills/forge-1-prd/references/stage-exit-protocol.md +395 -147
  167. package/adapters/copilot/skills/forge-2-tech/forge-2-tech.md +18 -4
  168. package/adapters/copilot/skills/forge-2-tech/references/shared-conventions.md +102 -28
  169. package/adapters/copilot/skills/forge-2-tech/references/stage-exit-protocol.md +395 -147
  170. package/adapters/copilot/skills/forge-3-specs/forge-3-specs.md +9 -3
  171. package/adapters/copilot/skills/forge-3-specs/references/shared-conventions.md +102 -28
  172. package/adapters/copilot/skills/forge-3-specs/references/spec-archetypes.md +9 -0
  173. package/adapters/copilot/skills/forge-3-specs/references/stage-exit-protocol.md +395 -147
  174. package/adapters/copilot/skills/forge-4-backlog/forge-4-backlog.md +56 -5
  175. package/adapters/copilot/skills/forge-4-backlog/references/shared-conventions.md +102 -28
  176. package/adapters/copilot/skills/forge-4-backlog/references/stage-exit-protocol.md +395 -147
  177. package/adapters/copilot/skills/forge-5-loop/forge-5-loop.md +67 -69
  178. package/adapters/copilot/skills/forge-5-loop/references/agent-selection.md +17 -1
  179. package/adapters/copilot/skills/forge-5-loop/references/ralph-loop-contract.md +6 -3
  180. package/adapters/copilot/skills/forge-5-loop/references/recovery-procedure.md +349 -0
  181. package/adapters/copilot/skills/forge-5-loop/references/result-reporting.md +101 -33
  182. package/adapters/copilot/skills/forge-5-loop/references/runner-contract.md +30 -10
  183. package/adapters/copilot/skills/forge-5-loop/references/shared-conventions.md +102 -28
  184. package/adapters/copilot/skills/forge-5-loop/references/stage-exit-protocol.md +395 -147
  185. package/adapters/copilot/skills/forge-6-docs/forge-6-docs.md +75 -8
  186. package/adapters/copilot/skills/forge-6-docs/references/shared-conventions.md +102 -28
  187. package/adapters/copilot/skills/forge-6-docs/references/stage-exit-protocol.md +516 -0
  188. package/adapters/copilot/skills/forge-fix/forge-fix.md +118 -32
  189. package/adapters/copilot/skills/forge-fix/references/shared-conventions.md +102 -28
  190. package/adapters/copilot/skills/forge-fix/references/stage-exit-protocol.md +395 -147
  191. package/adapters/copilot/skills/forge-guide/forge-guide.md +1 -1
  192. package/adapters/copilot/skills/forge-guide/references/forge-config-schema.json +19 -1
  193. package/adapters/copilot/skills/forge-guide/references/process-overview.md +2 -2
  194. package/adapters/copilot/skills/forge-guide/references/ralph-loop-contract.md +6 -3
  195. package/adapters/copilot/skills/forge-guide/references/shared-conventions.md +102 -28
  196. package/adapters/copilot/skills/forge-init/forge-init.md +1 -1
  197. package/adapters/copilot/skills/forge-verify/forge-verify.md +82 -51
  198. package/adapters/copilot/skills/forge-verify/references/decisions/single-writer-threat-model.md +53 -0
  199. package/adapters/copilot/skills/forge-verify/references/findings-template.md +70 -50
  200. package/adapters/copilot/skills/forge-verify/references/shared-conventions.md +102 -28
  201. package/adapters/copilot/skills/forge-verify/references/stage-exit-protocol.md +516 -0
  202. package/adapters/copilot/skills/forge-verify/references/verification-checklists/backlog.md +73 -0
  203. package/adapters/copilot/skills/forge-verify/references/verification-checklists/epic.md +5 -4
  204. package/adapters/copilot/skills/forge-verify/references/verification-checklists/impl.md +85 -0
  205. package/adapters/copilot/skills/forge-verify/references/verification-checklists/specs.md +45 -1
  206. package/adapters/cursor/.feature-forge-bundle.json +1 -1
  207. package/adapters/cursor/agents/forge-verifier.mdc +3 -1
  208. package/adapters/cursor/references/decisions/single-writer-threat-model.md +53 -0
  209. package/adapters/cursor/references/epic-manifest-schema.json +6 -1
  210. package/adapters/cursor/references/epic-state-schema.json +50 -0
  211. package/adapters/cursor/references/forge-config-schema.json +19 -1
  212. package/adapters/cursor/references/forge-decisions-schema.json +33 -0
  213. package/adapters/cursor/references/pipeline-state-schema.json +38 -4
  214. package/adapters/cursor/references/process-overview.md +2 -2
  215. package/adapters/cursor/references/ralph-loop-contract.md +6 -3
  216. package/adapters/cursor/references/shared-conventions.md +102 -28
  217. package/adapters/cursor/references/stage-exit-protocol.md +395 -147
  218. package/adapters/cursor/scripts/epic-manifest.py +495 -91
  219. package/adapters/cursor/scripts/fix-sweep.py +1180 -0
  220. package/adapters/cursor/scripts/forge-bootstrap.py +57 -5
  221. package/adapters/cursor/scripts/forge-session.py +4241 -146
  222. package/adapters/cursor/scripts/validate-traceability.py +86 -5
  223. package/adapters/cursor/skills/forge/forge.mdc +13 -12
  224. package/adapters/cursor/skills/forge/references/pipeline-state-schema.json +38 -4
  225. package/adapters/cursor/skills/forge/references/process-overview.md +2 -2
  226. package/adapters/cursor/skills/forge/references/shared-conventions.md +102 -28
  227. package/adapters/cursor/skills/forge/references/stage-exit-protocol.md +395 -147
  228. package/adapters/cursor/skills/forge-0-epic/forge-0-epic.mdc +7 -2
  229. package/adapters/cursor/skills/forge-0-epic/references/edit-mode.md +37 -33
  230. package/adapters/cursor/skills/forge-0-epic/references/epic-manifest-subcommands.md +8 -3
  231. package/adapters/cursor/skills/forge-0-epic/references/pipeline-state-schema.json +38 -4
  232. package/adapters/cursor/skills/forge-0-epic/references/shared-conventions.md +102 -28
  233. package/adapters/cursor/skills/forge-0-epic/references/stage-exit-protocol.md +395 -147
  234. package/adapters/cursor/skills/forge-1-prd/forge-1-prd.mdc +17 -4
  235. package/adapters/cursor/skills/forge-1-prd/references/shared-conventions.md +102 -28
  236. package/adapters/cursor/skills/forge-1-prd/references/stage-exit-protocol.md +395 -147
  237. package/adapters/cursor/skills/forge-2-tech/forge-2-tech.mdc +18 -4
  238. package/adapters/cursor/skills/forge-2-tech/references/shared-conventions.md +102 -28
  239. package/adapters/cursor/skills/forge-2-tech/references/stage-exit-protocol.md +395 -147
  240. package/adapters/cursor/skills/forge-3-specs/forge-3-specs.mdc +9 -3
  241. package/adapters/cursor/skills/forge-3-specs/references/shared-conventions.md +102 -28
  242. package/adapters/cursor/skills/forge-3-specs/references/spec-archetypes.md +9 -0
  243. package/adapters/cursor/skills/forge-3-specs/references/stage-exit-protocol.md +395 -147
  244. package/adapters/cursor/skills/forge-4-backlog/forge-4-backlog.mdc +56 -5
  245. package/adapters/cursor/skills/forge-4-backlog/references/shared-conventions.md +102 -28
  246. package/adapters/cursor/skills/forge-4-backlog/references/stage-exit-protocol.md +395 -147
  247. package/adapters/cursor/skills/forge-5-loop/forge-5-loop.mdc +67 -69
  248. package/adapters/cursor/skills/forge-5-loop/references/agent-selection.md +17 -1
  249. package/adapters/cursor/skills/forge-5-loop/references/ralph-loop-contract.md +6 -3
  250. package/adapters/cursor/skills/forge-5-loop/references/recovery-procedure.md +349 -0
  251. package/adapters/cursor/skills/forge-5-loop/references/result-reporting.md +101 -33
  252. package/adapters/cursor/skills/forge-5-loop/references/runner-contract.md +30 -10
  253. package/adapters/cursor/skills/forge-5-loop/references/shared-conventions.md +102 -28
  254. package/adapters/cursor/skills/forge-5-loop/references/stage-exit-protocol.md +395 -147
  255. package/adapters/cursor/skills/forge-6-docs/forge-6-docs.mdc +75 -8
  256. package/adapters/cursor/skills/forge-6-docs/references/shared-conventions.md +102 -28
  257. package/adapters/cursor/skills/forge-6-docs/references/stage-exit-protocol.md +516 -0
  258. package/adapters/cursor/skills/forge-fix/forge-fix.mdc +118 -32
  259. package/adapters/cursor/skills/forge-fix/references/shared-conventions.md +102 -28
  260. package/adapters/cursor/skills/forge-fix/references/stage-exit-protocol.md +395 -147
  261. package/adapters/cursor/skills/forge-guide/forge-guide.mdc +1 -1
  262. package/adapters/cursor/skills/forge-guide/references/forge-config-schema.json +19 -1
  263. package/adapters/cursor/skills/forge-guide/references/process-overview.md +2 -2
  264. package/adapters/cursor/skills/forge-guide/references/ralph-loop-contract.md +6 -3
  265. package/adapters/cursor/skills/forge-guide/references/shared-conventions.md +102 -28
  266. package/adapters/cursor/skills/forge-init/forge-init.mdc +1 -1
  267. package/adapters/cursor/skills/forge-verify/forge-verify.mdc +82 -51
  268. package/adapters/cursor/skills/forge-verify/references/decisions/single-writer-threat-model.md +53 -0
  269. package/adapters/cursor/skills/forge-verify/references/findings-template.md +70 -50
  270. package/adapters/cursor/skills/forge-verify/references/shared-conventions.md +102 -28
  271. package/adapters/cursor/skills/forge-verify/references/stage-exit-protocol.md +516 -0
  272. package/adapters/cursor/skills/forge-verify/references/verification-checklists/backlog.md +73 -0
  273. package/adapters/cursor/skills/forge-verify/references/verification-checklists/epic.md +5 -4
  274. package/adapters/cursor/skills/forge-verify/references/verification-checklists/impl.md +85 -0
  275. package/adapters/cursor/skills/forge-verify/references/verification-checklists/specs.md +45 -1
  276. package/adapters/gemini/.feature-forge-bundle.json +1 -1
  277. package/adapters/gemini/agents/forge-verifier.md +3 -1
  278. package/adapters/gemini/gemini-extension.json +1 -1
  279. package/adapters/gemini/references/decisions/single-writer-threat-model.md +53 -0
  280. package/adapters/gemini/references/epic-manifest-schema.json +6 -1
  281. package/adapters/gemini/references/epic-state-schema.json +50 -0
  282. package/adapters/gemini/references/forge-config-schema.json +19 -1
  283. package/adapters/gemini/references/forge-decisions-schema.json +33 -0
  284. package/adapters/gemini/references/pipeline-state-schema.json +38 -4
  285. package/adapters/gemini/references/process-overview.md +2 -2
  286. package/adapters/gemini/references/ralph-loop-contract.md +6 -3
  287. package/adapters/gemini/references/shared-conventions.md +102 -28
  288. package/adapters/gemini/references/stage-exit-protocol.md +395 -147
  289. package/adapters/gemini/scripts/epic-manifest.py +495 -91
  290. package/adapters/gemini/scripts/fix-sweep.py +1180 -0
  291. package/adapters/gemini/scripts/forge-bootstrap.py +57 -5
  292. package/adapters/gemini/scripts/forge-session.py +4241 -146
  293. package/adapters/gemini/scripts/validate-traceability.py +86 -5
  294. package/adapters/gemini/skills/forge/forge.md +13 -12
  295. package/adapters/gemini/skills/forge/references/pipeline-state-schema.json +38 -4
  296. package/adapters/gemini/skills/forge/references/process-overview.md +2 -2
  297. package/adapters/gemini/skills/forge/references/shared-conventions.md +102 -28
  298. package/adapters/gemini/skills/forge/references/stage-exit-protocol.md +395 -147
  299. package/adapters/gemini/skills/forge-0-epic/forge-0-epic.md +7 -2
  300. package/adapters/gemini/skills/forge-0-epic/references/edit-mode.md +37 -33
  301. package/adapters/gemini/skills/forge-0-epic/references/epic-manifest-subcommands.md +8 -3
  302. package/adapters/gemini/skills/forge-0-epic/references/pipeline-state-schema.json +38 -4
  303. package/adapters/gemini/skills/forge-0-epic/references/shared-conventions.md +102 -28
  304. package/adapters/gemini/skills/forge-0-epic/references/stage-exit-protocol.md +395 -147
  305. package/adapters/gemini/skills/forge-1-prd/forge-1-prd.md +17 -4
  306. package/adapters/gemini/skills/forge-1-prd/references/shared-conventions.md +102 -28
  307. package/adapters/gemini/skills/forge-1-prd/references/stage-exit-protocol.md +395 -147
  308. package/adapters/gemini/skills/forge-2-tech/forge-2-tech.md +18 -4
  309. package/adapters/gemini/skills/forge-2-tech/references/shared-conventions.md +102 -28
  310. package/adapters/gemini/skills/forge-2-tech/references/stage-exit-protocol.md +395 -147
  311. package/adapters/gemini/skills/forge-3-specs/forge-3-specs.md +9 -3
  312. package/adapters/gemini/skills/forge-3-specs/references/shared-conventions.md +102 -28
  313. package/adapters/gemini/skills/forge-3-specs/references/spec-archetypes.md +9 -0
  314. package/adapters/gemini/skills/forge-3-specs/references/stage-exit-protocol.md +395 -147
  315. package/adapters/gemini/skills/forge-4-backlog/forge-4-backlog.md +56 -5
  316. package/adapters/gemini/skills/forge-4-backlog/references/shared-conventions.md +102 -28
  317. package/adapters/gemini/skills/forge-4-backlog/references/stage-exit-protocol.md +395 -147
  318. package/adapters/gemini/skills/forge-5-loop/forge-5-loop.md +67 -69
  319. package/adapters/gemini/skills/forge-5-loop/references/agent-selection.md +17 -1
  320. package/adapters/gemini/skills/forge-5-loop/references/ralph-loop-contract.md +6 -3
  321. package/adapters/gemini/skills/forge-5-loop/references/recovery-procedure.md +349 -0
  322. package/adapters/gemini/skills/forge-5-loop/references/result-reporting.md +101 -33
  323. package/adapters/gemini/skills/forge-5-loop/references/runner-contract.md +30 -10
  324. package/adapters/gemini/skills/forge-5-loop/references/shared-conventions.md +102 -28
  325. package/adapters/gemini/skills/forge-5-loop/references/stage-exit-protocol.md +395 -147
  326. package/adapters/gemini/skills/forge-6-docs/forge-6-docs.md +75 -8
  327. package/adapters/gemini/skills/forge-6-docs/references/shared-conventions.md +102 -28
  328. package/adapters/gemini/skills/forge-6-docs/references/stage-exit-protocol.md +516 -0
  329. package/adapters/gemini/skills/forge-fix/forge-fix.md +118 -32
  330. package/adapters/gemini/skills/forge-fix/references/shared-conventions.md +102 -28
  331. package/adapters/gemini/skills/forge-fix/references/stage-exit-protocol.md +395 -147
  332. package/adapters/gemini/skills/forge-guide/forge-guide.md +1 -1
  333. package/adapters/gemini/skills/forge-guide/references/forge-config-schema.json +19 -1
  334. package/adapters/gemini/skills/forge-guide/references/process-overview.md +2 -2
  335. package/adapters/gemini/skills/forge-guide/references/ralph-loop-contract.md +6 -3
  336. package/adapters/gemini/skills/forge-guide/references/shared-conventions.md +102 -28
  337. package/adapters/gemini/skills/forge-init/forge-init.md +1 -1
  338. package/adapters/gemini/skills/forge-verify/forge-verify.md +82 -51
  339. package/adapters/gemini/skills/forge-verify/references/decisions/single-writer-threat-model.md +53 -0
  340. package/adapters/gemini/skills/forge-verify/references/findings-template.md +70 -50
  341. package/adapters/gemini/skills/forge-verify/references/shared-conventions.md +102 -28
  342. package/adapters/gemini/skills/forge-verify/references/stage-exit-protocol.md +516 -0
  343. package/adapters/gemini/skills/forge-verify/references/verification-checklists/backlog.md +73 -0
  344. package/adapters/gemini/skills/forge-verify/references/verification-checklists/epic.md +5 -4
  345. package/adapters/gemini/skills/forge-verify/references/verification-checklists/impl.md +85 -0
  346. package/adapters/gemini/skills/forge-verify/references/verification-checklists/specs.md +45 -1
  347. package/adapters/pi/.feature-forge-bundle.json +1 -1
  348. package/adapters/pi/agents/forge-verifier.md +3 -1
  349. package/adapters/pi/references/decisions/single-writer-threat-model.md +53 -0
  350. package/adapters/pi/references/epic-manifest-schema.json +6 -1
  351. package/adapters/pi/references/epic-state-schema.json +50 -0
  352. package/adapters/pi/references/forge-config-schema.json +19 -1
  353. package/adapters/pi/references/forge-decisions-schema.json +33 -0
  354. package/adapters/pi/references/pipeline-state-schema.json +38 -4
  355. package/adapters/pi/references/process-overview.md +2 -2
  356. package/adapters/pi/references/ralph-loop-contract.md +6 -3
  357. package/adapters/pi/references/shared-conventions.md +91 -17
  358. package/adapters/pi/references/stage-exit-protocol.md +395 -147
  359. package/adapters/pi/scripts/epic-manifest.py +495 -91
  360. package/adapters/pi/scripts/fix-sweep.py +1180 -0
  361. package/adapters/pi/scripts/forge-bootstrap.py +57 -5
  362. package/adapters/pi/scripts/forge-session.py +4241 -146
  363. package/adapters/pi/scripts/validate-traceability.py +86 -5
  364. package/adapters/pi/skills/forge/SKILL.md +10 -9
  365. package/adapters/pi/skills/forge/references/pipeline-state-schema.json +38 -4
  366. package/adapters/pi/skills/forge/references/process-overview.md +2 -2
  367. package/adapters/pi/skills/forge/references/shared-conventions.md +91 -17
  368. package/adapters/pi/skills/forge/references/stage-exit-protocol.md +395 -147
  369. package/adapters/pi/skills/forge-0-epic/SKILL.md +7 -2
  370. package/adapters/pi/skills/forge-0-epic/references/edit-mode.md +31 -27
  371. package/adapters/pi/skills/forge-0-epic/references/epic-manifest-subcommands.md +6 -1
  372. package/adapters/pi/skills/forge-0-epic/references/pipeline-state-schema.json +38 -4
  373. package/adapters/pi/skills/forge-0-epic/references/shared-conventions.md +91 -17
  374. package/adapters/pi/skills/forge-0-epic/references/stage-exit-protocol.md +395 -147
  375. package/adapters/pi/skills/forge-1-prd/SKILL.md +17 -4
  376. package/adapters/pi/skills/forge-1-prd/references/shared-conventions.md +91 -17
  377. package/adapters/pi/skills/forge-1-prd/references/stage-exit-protocol.md +395 -147
  378. package/adapters/pi/skills/forge-2-tech/SKILL.md +18 -4
  379. package/adapters/pi/skills/forge-2-tech/references/shared-conventions.md +91 -17
  380. package/adapters/pi/skills/forge-2-tech/references/stage-exit-protocol.md +395 -147
  381. package/adapters/pi/skills/forge-3-specs/SKILL.md +9 -3
  382. package/adapters/pi/skills/forge-3-specs/references/shared-conventions.md +91 -17
  383. package/adapters/pi/skills/forge-3-specs/references/spec-archetypes.md +9 -0
  384. package/adapters/pi/skills/forge-3-specs/references/stage-exit-protocol.md +395 -147
  385. package/adapters/pi/skills/forge-4-backlog/SKILL.md +56 -5
  386. package/adapters/pi/skills/forge-4-backlog/references/shared-conventions.md +91 -17
  387. package/adapters/pi/skills/forge-4-backlog/references/stage-exit-protocol.md +395 -147
  388. package/adapters/pi/skills/forge-5-loop/SKILL.md +67 -69
  389. package/adapters/pi/skills/forge-5-loop/references/agent-selection.md +16 -0
  390. package/adapters/pi/skills/forge-5-loop/references/ralph-loop-contract.md +6 -3
  391. package/adapters/pi/skills/forge-5-loop/references/recovery-procedure.md +349 -0
  392. package/adapters/pi/skills/forge-5-loop/references/result-reporting.md +101 -33
  393. package/adapters/pi/skills/forge-5-loop/references/runner-contract.md +29 -9
  394. package/adapters/pi/skills/forge-5-loop/references/shared-conventions.md +91 -17
  395. package/adapters/pi/skills/forge-5-loop/references/stage-exit-protocol.md +395 -147
  396. package/adapters/pi/skills/forge-6-docs/SKILL.md +75 -8
  397. package/adapters/pi/skills/forge-6-docs/references/shared-conventions.md +91 -17
  398. package/adapters/pi/skills/forge-6-docs/references/stage-exit-protocol.md +516 -0
  399. package/adapters/pi/skills/forge-fix/SKILL.md +118 -32
  400. package/adapters/pi/skills/forge-fix/references/shared-conventions.md +91 -17
  401. package/adapters/pi/skills/forge-fix/references/stage-exit-protocol.md +395 -147
  402. package/adapters/pi/skills/forge-guide/references/forge-config-schema.json +19 -1
  403. package/adapters/pi/skills/forge-guide/references/process-overview.md +2 -2
  404. package/adapters/pi/skills/forge-guide/references/ralph-loop-contract.md +6 -3
  405. package/adapters/pi/skills/forge-guide/references/shared-conventions.md +91 -17
  406. package/adapters/pi/skills/forge-verify/SKILL.md +81 -50
  407. package/adapters/pi/skills/forge-verify/references/decisions/single-writer-threat-model.md +53 -0
  408. package/adapters/pi/skills/forge-verify/references/findings-template.md +69 -49
  409. package/adapters/pi/skills/forge-verify/references/shared-conventions.md +91 -17
  410. package/adapters/pi/skills/forge-verify/references/stage-exit-protocol.md +516 -0
  411. package/adapters/pi/skills/forge-verify/references/verification-checklists/backlog.md +73 -0
  412. package/adapters/pi/skills/forge-verify/references/verification-checklists/epic.md +5 -4
  413. package/adapters/pi/skills/forge-verify/references/verification-checklists/impl.md +85 -0
  414. package/adapters/pi/skills/forge-verify/references/verification-checklists/specs.md +45 -1
  415. package/package.json +1 -1
  416. package/adapters/claude/skills/forge-verify/references/pipeline-state-schema.json +0 -191
  417. package/adapters/codex/skills/forge-verify/references/pipeline-state-schema.json +0 -191
  418. package/adapters/copilot/skills/forge-verify/references/pipeline-state-schema.json +0 -191
  419. package/adapters/cursor/skills/forge-verify/references/pipeline-state-schema.json +0 -191
  420. package/adapters/gemini/skills/forge-verify/references/pipeline-state-schema.json +0 -191
  421. package/adapters/pi/skills/forge-verify/references/pipeline-state-schema.json +0 -191
@@ -0,0 +1,516 @@
1
+ # Stage Exit Protocol
2
+
3
+ The single source of truth for how every forge stage closes. **One** scripted contract
4
+ covers all **nine** covered direct exits — the seven production stages `forge-0-epic`
5
+ through `forge-6-docs`, plus direct `forge-verify` and direct `forge-fix`. It replaces the
6
+ old ad-hoc "Next steps:" bullet lists with one fixed, correctly-ordered sequence:
7
+ **verify (if missing or stale) → `/new` → run the next command.**
8
+
9
+ Two principles this protocol encodes (do not relitigate — they are locked product
10
+ decisions):
11
+
12
+ 1. **Clearing is recommended on its own merits at every stage boundary** — a clean
13
+ start for the next stage — *not* as a proxy for a full context window. Window
14
+ fullness only changes *how emphatically* the clear is recommended, never *whether*
15
+ it is.
16
+ 2. **Verify happens before the clear, never after** — in the authoring session, whether
17
+ manual **or** auto. Verify's clean-room subagent is dispatched from the *current*
18
+ session, so the findings digest and any fix decision land where the context to act on
19
+ them still exists. This holds for auto-verify too: the stage skill dispatches the
20
+ clean-room verify (and any autoFix) at stage end, in-session, before the exit — it is
21
+ **not** deferred to the navigator, which runs *after* the `/new` with none of the
22
+ authoring context. Clearing first throws that context away.
23
+
24
+ ## How this file is used
25
+
26
+ Every covered exit closes with the **Scripted Stage Exit**: the single stamped block
27
+ below, which runs `forge-session.py stage-exit`, obeys the DIRECTIVES it prints per the
28
+ **directive contract** in this file, and — only when this call owns the terminal block —
29
+ prints the script-emitted NEXT-STEPS block verbatim as the absolute last output. All the
30
+ conditional logic the old prose blocks asked the model to compute (effective auto-verify,
31
+ freshness collapse, gate selection, host wording, branch rejoin, loop and docs routing)
32
+ now lives in the script, deterministically; only genuinely interactive work (clean-room
33
+ subagent dispatch, question-tool gates) remains prose — specified once here, not per
34
+ stage.
35
+
36
+ A drift-guard test (`tests/test_stage_exit_protocol.py`) asserts each stamp site still
37
+ contains the canonical block, so an edit here must be mirrored into every stamp site (and
38
+ vice-versa).
39
+
40
+ ### The nine covered exits and their stage-specific flags
41
+
42
+ Every caller passes the same identity and capability flags — `--feature`, `--stage`,
43
+ `--specs-dir`, `--host`, `--verify-capability`, plus `--epic "{epic}"` when the feature is
44
+ an epic member. Only the flags below are stage-specific; pass no others.
45
+
46
+ | Caller | `--stage` | Stage-specific typed flags |
47
+ |---|---|---|
48
+ | `forge-0-epic` | `forge-0-epic` | `--next-feature "{member}"` when a concrete member exists |
49
+ | `forge-1-prd` … `forge-4-backlog` | that stage's own id | none beyond identity/capability |
50
+ | `forge-5-loop` | `forge-5-loop` | `--outcome` — one of `complete`, `partial`, `blocked`, `needs-human`, `deferred`, `resolved`; optional `--cause dependency-starvation` with `--outcome partial` |
51
+ | `forge-6-docs` | `forge-6-docs` | `--outcome` — `complete`, `blocked`, or `skipped` (deliberate docs skip, persisted via `state-skip` before the exit; routes like `complete` with honest wording) |
52
+ | direct `forge-verify` | `forge-verify` | `--owner direct`, `--outcome` (`passed`, `findings`, `skipped`, `failed`), and served-stage metadata |
53
+ | nested `forge-verify` | `forge-verify` | `--owner nested`, plus the same outcome and served-stage metadata |
54
+ | direct/nested `forge-fix` | `forge-fix` | the matching `--owner`, a `FixOutcome` (`no-findings`, `decisions`, `failed`, `applied`, `reverified`, `reverify-findings`, `deferred`), and served-stage metadata |
55
+
56
+ "Served-stage metadata" means `--served-stage` (the production stage this diversion
57
+ served) and/or `--verify-mode` (`epic`, `prd`, `tech`, `specs`, `backlog`, `impl`), which
58
+ maps to a served stage when unambiguous. If both are supplied they must agree; if neither
59
+ is, the script exits 2 rather than guessing. Conversational context and `currentStage` are
60
+ never valid inference sources.
61
+
62
+ An invalid or missing enum, a conflicting served-stage mapping, or an unresolvable
63
+ identity is surfaced as the script's `Error:` line on stderr with exit 2. The skill
64
+ surfaces that line and **stops without inventing next steps** — there is no payload and no
65
+ sentinel to print.
66
+
67
+ An exit 2 from `stage-exit` itself is **not** a no-write guarantee: the
68
+ `auto-verify-pending` debt marker is persisted at the scheduling boundary *before* the
69
+ payload is built, deliberately, so an interrupted exit still leaves the verification
70
+ obligation durable on disk. Do not retry on the assumption that nothing landed — the
71
+ marker is idempotent and the re-run will read it. (The narrower "nothing was recorded"
72
+ guarantee belongs to `state-verify`, whose validation all precedes its single atomic
73
+ write.)
74
+
75
+ ### Stamp sites
76
+
77
+ | Stamp site | Block |
78
+ |---|---|
79
+ | all nine covered exits (`forge-0-epic` … `forge-6-docs`, direct `forge-verify`, direct `forge-fix`) | the canonical scripted stage-exit stamp |
80
+
81
+ The scripted stamp fills one build-time slot, `{stage-exit-args}` — the per-stage argument
82
+ list from the table above (e.g. `--feature "{feature}" --stage forge-2-tech`; the epic
83
+ stage passes `--feature "{epic}" --stage forge-0-epic --next-feature
84
+ "{first-actionable-feature}"`; the loop passes `--feature "{feature}" --stage forge-5-loop
85
+ --outcome "{LoopOutcome}"`). `{feature}` / `{epic}` / `{specsDir}` /
86
+ `{first-actionable-feature}` / `{verify-capability}` remain runtime placeholders the skill
87
+ resolves before running the command, exactly as elsewhere.
88
+
89
+ <!-- BEGIN: scripted-stage-exit-stamp -->
90
+ **Close this stage with the Scripted Stage Exit** (contract: `references/stage-exit-protocol.md`; do not improvise a "Next steps" list). Run:
91
+
92
+ ```bash
93
+ R="$(bash -c 'for d in "${FEATURE_FORGE_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/feature-forge/* "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done')"
94
+ [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
95
+ python3 "$R/scripts/forge-session.py" stage-exit {stage-exit-args} --specs-dir "{specsDir}" --host pi --verify-capability "{verify-capability}"
96
+ ```
97
+
98
+ Obey the DIRECTIVES it prints, in the consumption order this protocol fixes: surface `invalidAutoVerifyKeys` and every `warnings` entry first; `runInStageVerify: true` → run the in-stage clean-room verify chain now (honoring `autoFixEligible`, and asking through the Standard Verify Gate first when you may not dispatch unsolicited); `verifyGate: "standard"` → present the Standard Verify Gate; `verifyGate: "manual-print"` → print the `verifyCommand` for the user and do **not** dispatch inline. Then, and only when `terminalOwnedBy` is `"self"`, **print the NEXT-STEPS block verbatim as your absolute last output — nothing after its sentinel line.** A `terminalOwnedBy: "outer"` payload carries `nextSteps: null`: return your structured result to the caller and print no terminal block at all.
99
+ <!-- END: scripted-stage-exit-stamp -->
100
+
101
+ The stamp is shown with `--host pi`; the adapter build substitutes `pi`/`generic` per
102
+ target, and §"Host and capability determination" below governs the value. The literal is
103
+ deliberate — `scripts/build-adapters.py` keys its host translation on the exact canon
104
+ value of that flag, and the stamp sites are compared byte-for-byte, so it is the one token
105
+ in that line that is not a placeholder.
106
+
107
+ ## Host and capability determination
108
+
109
+ Before the call, compute the two inputs independently. They are unrelated: **a host never
110
+ implies a capability**, and the script takes `--verify-capability` at face value.
111
+
112
+ **`--host`** describes only the active adapter command surface — `claude`, `pi`, or
113
+ `generic`. It selects command syntax (Claude's stage-command prefix vs Pi's `/skill:` vs
114
+ host-neutral) and fresh-session wording (Claude's clear command vs Pi's `/new` vs neutral
115
+ prose). Nothing else.
116
+
117
+ **`--verify-capability interactive`** is passed only when **both** of these hold:
118
+
119
+ - **(a)** a question mechanism equivalent to `AskUserQuestion` is available, **and**
120
+ - **(b)** a clean-room `forge-verifier` subagent can be dispatched.
121
+
122
+ If either is absent, or capability cannot be established, pass `manual`.
123
+
124
+ **(b) tests PERMISSION, not tool presence.** The question is not "is a subagent-dispatch
125
+ tool listed in my tool surface" but "**may I dispatch `forge-verifier` right now**". A
126
+ session can carry a standing host instruction against dispatching subagents unless the
127
+ user asked. Such instructions are injected by the harness, sit outside both the user's
128
+ config and this project's control, can be enabled or disabled per session, and **outrank
129
+ this prose**. A model that reads (b) as mere tool presence self-reports `interactive`,
130
+ attempts the dispatch, declines its own attempt, and lands in the recovery path below
131
+ instead of the correct path. Read (b) as permission and classify up front.
132
+
133
+ **A consent requirement is `interactive`, not `manual`.** When dispatch is barred only
134
+ *unless the user asked*, and a question mechanism **is** available, pass `interactive`. The
135
+ Standard Verify Gate's own prompt supplies the missing user request: the user selecting
136
+ "Verify {stageNoun} now" **is** the request, so the dispatch that follows that choice is
137
+ solicited and permitted. Degrading this case to `manual` prints a copy-paste command and
138
+ throws away the in-context digest for no reason. Pass `manual` only when there is **no**
139
+ question mechanism **and** **no** permitted dispatch — genuine incapability, never a
140
+ consent step.
141
+
142
+ **A dispatch bar routes an auto-verify directive through the gate; it never resolves it.**
143
+ When `runInStageVerify: true` arrives and you may not dispatch unsolicited, that directive
144
+ is **presented through the Standard Verify Gate** in its consent form — see "Consent
145
+ variant on a `none` gate" below — and the clean-room `forge-verifier` is **dispatched on
146
+ the affirmative choice**, never merely printed for the user to run later. Such a bar is
147
+ **never grounds to skip verification**, and it is never resolved by **advancing to the
148
+ production successor** while verification is unresolved.
149
+
150
+ **Do not use `host == claude` as a capability proxy.** It is not one in either direction:
151
+
152
+ - a capable Pi session is `--host pi --verify-capability interactive`, and receives the
153
+ same logical gate a capable Claude session does;
154
+ - Pi without a dispatchable verifier is `--host pi --verify-capability manual`;
155
+ - a Claude session that cannot dispatch keeps the Claude host value with
156
+ `--verify-capability manual`.
157
+
158
+ Interactive gate options keep their explicit labels, their recommended default, and their
159
+ one-line trade-off descriptions (below). The manual path prints the verify command as the
160
+ sole fenced primary action and mentions production advancement only as unfenced post-pass
161
+ guidance.
162
+
163
+ ### Clean-room unavailable, or a non-answer
164
+
165
+ If a dispatch advertised as available later returns
166
+ `CLEAN_ROOM_UNAVAILABLE: forge-verifier subagent not dispatchable — verify not run.`, or
167
+ returns a non-answer (a placeholder, a "still running" note, or a delegation message
168
+ instead of a findings block), then **verification failed / did not run**:
169
+
170
+ - do **not** run the verification inline, and do **not** silently accept the non-answer as
171
+ a pass;
172
+ - leave the verification debt **unresolved**, so the navigator catch-up fires later;
173
+ - obtain a **fresh** `stage-exit` payload with `--verify-capability manual` and use that
174
+ verify-first output.
175
+
176
+ **Never reuse an earlier payload that promotes production advancement.** The earlier
177
+ payload was computed under a capability claim that has just been disproved; re-printing it
178
+ advances the pipeline past verification that never happened.
179
+
180
+ ## Branch ownership: the `owner:` token
181
+
182
+ `forge-verify` and `forge-fix` are dispatched through a Skill/Agent invocation, not a CLI,
183
+ so no `--owner` flag arrives on its own — and ownership is **never** inferred from how the
184
+ invocation happened to be phrased.
185
+
186
+ The dispatching caller states ownership in its invocation prompt using a literal token:
187
+
188
+ - **`owner: nested`** — used by in-stage auto-verify chains, the navigator's catch-up
189
+ chain, and a nested re-verify. The branch skill returns its structured result to the
190
+ outer caller and prints no terminal block.
191
+ - **`owner: direct`** — used when the dispatcher intends the branch skill to own the
192
+ terminal block.
193
+
194
+ **Absent the token, the skill treats itself as `direct`.** A user-typed
195
+ `/skill:forge-verify` or `/skill:forge-fix` is the only path that carries
196
+ no dispatcher, so "no token" and "no dispatcher" are the same condition. The skill passes
197
+ the resolved value straight through as `--owner direct|nested`.
198
+
199
+ Getting this wrong is not cosmetic. A nested verify that self-reports `direct` emits a
200
+ second sentinel-terminated block **inside** an outer stage's exit, breaking the
201
+ exactly-one-terminal-block rule — and the canon guard cannot catch it, because both
202
+ wordings legitimately appear in the same file. Judge the token, not the phrasing.
203
+
204
+ ## Caller-side resumption: the declared resume point
205
+
206
+ The `owner:` token and `terminalOwnedBy` arbitrate who prints — but they specify only
207
+ the **callee** side: a nested skill stays quiet and returns its structured result. This
208
+ section is the reciprocal, caller-side half of that contract.
209
+
210
+ **On a sub-skill's return, the caller re-owns the terminal.** Every closing instruction
211
+ in the callee's own body — its report-and-stop posture, its "confirm the result" close,
212
+ its own next-steps habits — is void for this turn. The caller resumes at its **declared
213
+ resume point**, in the same turn, and its remaining steps run to its own terminal.
214
+
215
+ **Every Skill-tool delegation site declares, at the invocation, what happens on
216
+ return.** Suppression without resumption is the failure mode this section closes: the
217
+ callee's closing posture is the freshest instruction in context while the caller's next
218
+ step is the oldest, so an undeclared return silently ends the run one layer too early —
219
+ the caller's remaining steps (validation, state writes, commit, stage exit) dropped,
220
+ with no error surfaced. An implicit "let it run to its natural stopping point" is that
221
+ bug spelled politely, and it is banned on delegation sites. A site takes one of two
222
+ declared postures:
223
+
224
+ - **Delegate-and-resume** — the callee is a sub-step of the caller: the site names the
225
+ caller's own step that control returns to, and the caller continues there in the same
226
+ turn. The callee never owns the caller's terminal. The worked instance is
227
+ `forge-4-backlog` Step 4's **Return contract** for the `author-backlog` delegation
228
+ (control returns at Step 5; the sub-skill's direct-invocation posture — its approval
229
+ gate and its validate-and-confirm close — is explicitly disapplied on the delegated
230
+ path). New delegation sites follow that pattern rather than re-deriving it.
231
+ - **Terminal handoff** — the caller's job ends at the invocation and the invoked skill
232
+ owns the terminal from there on (e.g. the navigator's `autoInvokeNextStage`
233
+ "continue in this session" advance into the next production stage). Declaring the
234
+ handoff is what keeps it distinct from an accidental drop.
235
+
236
+ Scope: this contract governs **Skill-tool delegation within one session**. The
237
+ truncated-verifier-return guard (forge-verify's `findings-template.md`, "Truncated
238
+ Verifier Returns") is a different mechanism — it polices what an **Agent-dispatched
239
+ subagent's** return payload must contain, not where a caller resumes. A dispatch site
240
+ can be subject to both; satisfy each on its own terms.
241
+
242
+ ## Directive consumption order
243
+
244
+ `stage-exit` emits a DIRECTIVES object and (for a direct owner) a NEXT-STEPS block. The
245
+ skill executes the directives **in this order**; the script has already computed every
246
+ conditional, so a directive is an instruction, not a question to re-derive.
247
+
248
+ 1. **Surface `invalidAutoVerifyKeys` and `warnings` first**, before any terminal output.
249
+ `warnings` is a **list**, not a single string, rendered in the fixed order the script
250
+ emits (epic-member state fallback, then debt-metadata, then revision mismatch); more
251
+ than one entry can appear on a single call, so print every entry rather than the first.
252
+ An empty list means checked-and-clean, which is not the same as the key being absent.
253
+ 2. **`runInStageVerify: true`** → execute the nested verify → fix → re-verify chain
254
+ synchronously (see below). This is the **one** directive that asks for an *unsolicited*
255
+ dispatch — auto-verify is authorized by config, not by a live user request — so it is
256
+ exactly where a standing no-unsolicited-dispatch instruction bites. When dispatch
257
+ requires consent and a question mechanism is available, do **not** dispatch silently,
258
+ do **not** treat the bar as a reason to skip verification, and do **not** advance:
259
+ present the Standard Verify Gate first (in its consent form) and dispatch on the
260
+ affirmative choice, then continue the chain unchanged.
261
+ 3. **`verifyGate == "standard"`** → present the Standard Verify Gate. A pass, a findings
262
+ result, or an explicit skip must be **persisted** and the routing recomputed before any
263
+ block is printed. A "stop here" choice emits no advancing block.
264
+ 4. **`verifyGate == "manual-print"`** → do **not** dispatch inline; print `verifyCommand`
265
+ for the user and use the script's verify-first block as-is.
266
+ 5. **Print `nextSteps` byte-for-byte, and only when `terminalOwnedBy == "self"`.**
267
+
268
+ ## Directive contract
269
+
270
+ ### `invalidAutoVerifyKeys` (non-empty)
271
+
272
+ Each key names a `forge.config.json` `autoVerifyStages` entry that matches no
273
+ verify-capable stage — a config typo. The script already prints one warning line per key,
274
+ in sorted order; surface them and continue. They never fail the exit.
275
+
276
+ ### `warnings` (a list)
277
+
278
+ Non-fatal advisories, each naming both the affected feature/stage/key **and** the recovery
279
+ action. Print every entry, in the emitted order, above the terminal block. Do not
280
+ reformat, merge, or summarize them, and never dump the state file they were derived from.
281
+
282
+ ### `runInStageVerify: true` — in-stage auto-verify {stageNoun}
283
+
284
+ Auto-verify is effective for this stage and verification is outstanding — verify **now,
285
+ in this session** (principle #2 applied to auto-verify: the digest and any fix decision
286
+ land here, where the authoring context still exists — not deferred to a post-`/new`
287
+ navigator). The `auto-verify-pending` debt is already durable on disk at this point, so a
288
+ declined or deferred gate leaves recorded debt rather than a silent pass.
289
+
290
+ 1. **Clean-room verify (require-clean).** Dispatch the clean-room `forge-verifier`
291
+ subagent from this session in require-clean mode with the `owner: nested` token — the
292
+ same path the navigator uses (`skills/forge-verify/SKILL.md`). Dispatch it
293
+ **synchronously and await its digest inline** — do **not** run it in the background or
294
+ announce it as "still running"; the digest and any fix decision must land in this
295
+ session. It inherits none of this session's context, so no `/new` is needed and only
296
+ a compact digest returns.
297
+ **If you may not dispatch unsolicited**, present the consent form of the Standard
298
+ Verify Gate first and dispatch on the affirmative choice — see "Consent variant on a
299
+ `none` gate" below. **Clean-room unavailable or a non-answer returned**: follow
300
+ "Clean-room unavailable, or a non-answer" above — leave verify pending, print the
301
+ `verifyCommand`, and continue to the NEXT-STEPS block.
302
+ 2. **Verify passed / no findings** → the fresh verify state is recorded by the
303
+ clean-room run; continue to the NEXT-STEPS block.
304
+ 3. **Verify found findings** →
305
+ - **`autoFixEligible: true` AND the findings document has zero unresolved decision
306
+ points** → chain `feature-forge:forge-fix` in-session with the `owner: nested` token
307
+ (it owns its own commit + step tracking), then run a **mandatory re-verify** in
308
+ require-clean mode. Continue to the NEXT-STEPS block only if the re-verify passes. On
309
+ any precondition miss, a forge-fix early stop, or a red re-verify, fall through to the
310
+ digest gate below — never a silent partial mutation. (`autoFixEligible` already folds
311
+ in the config `autoFix` flag and the clean-tree precondition; a dirty tree or
312
+ `gitCommitAfterStage: false` arrives here as `false`.)
313
+ - **`autoFixEligible: false`, or unresolved decision points** → surface a **compact
314
+ findings digest** as text, then present the gate: **Run `forge-fix` now**
315
+ *(recommended — you are in-context and the digest is right here)* / **Clear + advance
316
+ anyway** (leave the findings for later) / **Stop here**. Do **not** hard-stop and do
317
+ **not** silently walk past. Act on the choice, then continue to the NEXT-STEPS block.
318
+
319
+ Every nested call in this chain prints no terminal block of its own. This stage is the
320
+ sole terminal owner, and it prints exactly one block after the chain settles.
321
+
322
+ ### `verifyGate: "standard"` — the Standard Verify Gate
323
+
324
+ Auto-verify is off for this stage and verification is outstanding (`verifyState` is
325
+ `never`, `stale`, `failing`, or `auto-pending`), and the caller declared
326
+ `--verify-capability interactive`. Verify **now, before clearing**, using the host's
327
+ question mechanism with exactly these **three** labeled choices — the recommended default
328
+ first:
329
+
330
+ - **Verify {stageNoun} now** *(recommended)* — dispatch the clean-room `forge-verifier`
331
+ subagent from this session in require-clean mode with the `owner: nested` token; the
332
+ digest returns here so any fix decision keeps its context. One-time — it does **not**
333
+ change config.
334
+ - **Verify now + enable auto-verify going forward** — verify now **and** patch
335
+ `"autoVerify": true` into `forge.config.json` in place (preserve formatting and every
336
+ other key) so future stages verify automatically, no prompt. This complements the
337
+ `forge-init` opt-in. **Do not auto-commit this config change** — treat it like
338
+ `notes`: a user-facing edit the user commits on their own cadence, never folded into
339
+ a stage's artifact commit.
340
+ - **Skip for now** — go straight to the NEXT-STEPS block without verifying. Record this
341
+ stage's verify status as `skipped` in pipeline state (via `state-verify`, never by hand)
342
+ **only** on an explicit skip — a skip does not go stale. Exception: if the existing
343
+ entry records `passed` or `findings-applied` (a resolved result whose freshness has
344
+ merely lapsed), write **nothing** — `state-verify` refuses to demote a resolved status
345
+ to `skipped` (#203), and the recorded result stands on its own; the user's decline is
346
+ honored by simply not re-verifying.
347
+
348
+ **Advancement is allowed only after a pass, or after an explicit skip has been
349
+ persisted.** Choosing to stop, or losing the interaction, produces no advancing terminal
350
+ block. If verify runs and finds findings, handle them exactly as in the in-stage flow
351
+ above (digest + gate; `autoFixEligible` applies unchanged).
352
+
353
+ #### Consent variant on a `none` gate
354
+
355
+ When `runInStageVerify: true` and you may not dispatch unsolicited, the emitted
356
+ `verifyGate` **stays `none`** — changing it to `standard` would alter directive values for
357
+ the existing stages 0–4. Reuse this same gate block for consent, with **choice 2 omitted**:
358
+ auto-verify is already effective on this path, so "enable auto-verify going forward" is a
359
+ no-op, and offering a label with no trade-off behind it is not an accessible choice. The
360
+ consent form is therefore exactly **two** choices:
361
+
362
+ 1. **Verify {stageNoun} now** *(recommended)* — dispatch the clean-room verifier now; this
363
+ choice **is** the user request that authorizes the dispatch.
364
+ 2. **Skip for now** — persisted as an explicit `skipped` before any advancing block.
365
+
366
+ This is the **only** case in which the rendered gate and the emitted `verifyGate` value
367
+ differ, and it exists because the gate here supplies *consent* rather than selecting
368
+ *policy*.
369
+
370
+ ### `verifyGate: "manual-print"`
371
+
372
+ Verification is outstanding and the caller declared `--verify-capability manual`. Do
373
+ **not** run verify inline — print the `verifyCommand` for the user to run (mirroring
374
+ `autoInvokeNextStage`), offer the auto-verify enable as plain text only if a config write
375
+ is possible, and continue to the NEXT-STEPS block. Verify state stays outstanding, so the
376
+ navigator catch-up can fire later. The script has already made the verify command the sole
377
+ fenced primary action and demoted production advancement to unfenced prose.
378
+
379
+ ### `verifyGate: "none"`
380
+
381
+ Verification is already resolved (fresh or explicitly skipped), the stage carries no
382
+ verification token at all, or the in-stage run above covers it. Say so in one line and
383
+ continue to the NEXT-STEPS block.
384
+
385
+ ### `epicReconcile` (epic backflow — present only when there are open requests)
386
+
387
+ Emitted only when the exiting member carries `open` `epicChangeRequests` (recorded by
388
+ `forge-1-prd`/`forge-2-tech` when the epic *decomposition* itself must change — see
389
+ `references/pipeline-state-schema.json`). Absent on the common path and for standalone
390
+ features. The script has already folded the routing into the NEXT-STEPS block, so this
391
+ directive is informational — you do **not** re-derive the wording:
392
+
393
+ - `required: true` (at least one `blocksCurrent: true` request) — the reconcile command
394
+ (`/skill:forge-0-epic {epic}`) is promoted ahead of the ordinary production
395
+ successor, and that successor is demoted to a follow-up line ("After reconciling,
396
+ continue the pipeline with …"). This is *reconcile-before-specs*: proceeding would author
397
+ artifacts against a decomposition that is about to change. It is strongest when exiting
398
+ `forge-2-tech` (next is `forge-3-specs`, the point of no cheap return). When
399
+ verification is also outstanding, verification stays primary and the reconcile becomes
400
+ the **first** deferred action, ahead of the ordinary successor.
401
+ - `reminder: true` (only `blocksCurrent: false` requests) — normal next-stage routing is
402
+ unchanged; the block appends a non-blocking reminder line ("You also flagged N epic
403
+ change(s) to reconcile when convenient …"). This is *finish-then-edit*.
404
+
405
+ Either way the added lines are host-neutral (they name no fresh-session command) and sit
406
+ **above** the sentinel; just print the NEXT-STEPS block verbatim as always.
407
+
408
+ ### Deferred decisions — do not solicit next-stage decisions at this exit
409
+
410
+ Each stage owns its own decisions. At a stage exit, do **not** pull a *later* stage's
411
+ decision forward — do not ask the user (or decide unilaterally) something that properly
412
+ belongs to the next stage's interview (e.g. at `forge-1-prd` exit, don't settle the
413
+ concrete cache backend that `forge-2-tech` will design). Soliciting it here guesses ahead
414
+ of the stage that owns the context, and the answer has nowhere durable to live.
415
+
416
+ Instead, when you notice a decision that belongs downstream, **record it structurally** as
417
+ a `deferredDecisions[]` entry on this feature's `.pipeline-state.json` by running
418
+ `state-decision` (`--rationale` and `--target-stage` are optional; the verb stamps
419
+ `raisedAt` and `status: "open"` for you). Add `--epic "{epic}"` when this feature is an
420
+ epic member — required, per the Pipeline State Protocol in `references/shared-conventions.md`:
421
+
422
+ ```bash
423
+ R="$(bash -c 'for d in "${FEATURE_FORGE_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/feature-forge/* "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done')"
424
+ [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
425
+ python3 "$R/scripts/forge-session.py" state-decision \
426
+ --feature "{feature}" --question "<phrased for the target stage>" \
427
+ --rationale "<why it belongs downstream>" --target-stage "<owning stage>" \
428
+ --raised-by "{stage}" --specs-dir "{specsDir}"
429
+ ```
430
+
431
+ This keeps the exit focused on *this* stage's next-step routing while carrying the open
432
+ question forward for the owning stage to resolve (it flips `status` to `addressed` when it
433
+ does). Prefer a `deferredDecisions[]` entry over stuffing the same thing into the free-text
434
+ `notes` string. This is a recording affordance, not a gate: never block the exit on it.
435
+
436
+ ### The NEXT-STEPS block, and the sentinel-last rule
437
+
438
+ **A direct payload** (`terminalOwnedBy: "self"`) carries exactly **one** occurrence of the
439
+ sentinel `─ forge: end of stage ─`, as the **final line** of `nextSteps`. Print that block
440
+ **verbatim as your absolute last output**. Nothing follows the sentinel — no summary, no
441
+ sign-off, no warning, no command result, no acceptance text, no caveat. The block already
442
+ carries the fresh-session recommendation (host-aware wording via `--host`) and the exact
443
+ next command, so trailing prose can only push the user's next action out of view.
444
+
445
+ **A nested payload** (`terminalOwnedBy: "outer"`) carries `nextSteps: null` and
446
+ `sentinel: null`. It prints **no terminal block at all** — not even an empty one. Return
447
+ your structured result to the outer caller; that caller re-runs `stage-exit` after the
448
+ nested state transitions so its single final block reflects the terminal result.
449
+
450
+ ---
451
+
452
+ ## Re-verify scope and convergence
453
+
454
+ A **re-verify** is any verification run whose served stage's verify entry is
455
+ `findings-applied` — a fix pass preceded it, and its job is to CONFIRM that pass, not to
456
+ re-open the artifact. These rules bind the dispatched `forge-verifier`, the skill that
457
+ synthesizes its digest (`skills/forge-verify/SKILL.md`), and the fix pass that requests
458
+ the re-verify (`skills/forge-fix/SKILL.md` Step 6):
459
+
460
+ - **Scope.** Confirm each finding of the prior report against that finding's own
461
+ acceptance evidence, and examine the fix's delta (the changed lines and what they
462
+ directly touch) for new blocking defects. A re-verify is NOT a fresh full-checklist
463
+ sweep: the full sweep already ran when the report was minted, and re-sweeping mints
464
+ arbitrary new findings against text the fix just wrote — the divergence loop this
465
+ section exists to prevent.
466
+ - **Convergence.** Only an unresolved finding from the prior report, or a new
467
+ **blocking** finding (`error` with behavioral, CLI-output, or decision-bearing
468
+ consequence, or `gap`) introduced by the fix delta itself, may make a re-verify close
469
+ as `reverify-findings`. Every other new observation — advisory-severity anywhere, or
470
+ anything outside the fix delta — is recorded in the report at most and never flips
471
+ the outcome.
472
+ - **Decision immunity.** A finding whose subject carries a recorded decision — a
473
+ `state-decision` entry, a recorded-decision comment in the artifact, or a declared
474
+ non-goal — is never filed, in a re-verify or a fresh sweep. Cite the decision
475
+ instead. Re-filing a decided question costs a round and reverses nothing.
476
+ In particular, a **meta-guard** (a test protecting other tests or prose) is judged
477
+ against its DECLARED protection set: guard-incompleteness against a declared
478
+ non-goal is never a finding — the space of what a guard does not cover is
479
+ unbounded, and enumerating it one round at a time is an arms race, not
480
+ verification (authoring norm: the testing-strategy archetype in
481
+ `skills/forge-3-specs/references/spec-archetypes.md`).
482
+ - **Escalation (the round ledger).** Rounds are counted from the served stage's
483
+ findings documents (`VERIFY-{mode}-{date}.md`, then `-round{N}` — the filename rule
484
+ in `skills/forge-verify/SKILL.md` Step 4), so the ledger is reconstructable from the
485
+ `.verification/` directory alone. On the SECOND consecutive `reverify-findings`
486
+ close for the same served stage, the loop has stopped converging: do NOT recommend
487
+ another fix pass. Present the compact findings digest and ask for explicit
488
+ disposition with exactly these options —
489
+ **Accept the residual findings and advance** *(recommended)*: record the acceptance
490
+ as a `state-decision` naming each accepted finding, then write the stage's verify
491
+ result as `passed` with the report attached (`--findings-file`/`--findings-count`);
492
+ the accepted findings become recorded decisions that decision immunity keeps from
493
+ ever being re-filed. **Run another fix pass**: available, never recommended at this
494
+ point. **Stop here**. The user may still choose to fix — the protocol just stops
495
+ steering into the loop it cannot show is converging. Under `manual` capability
496
+ (no question mechanism), print the digest and the three dispositions as text
497
+ BEFORE the terminal block — the user answers on their own cadence; the terminal
498
+ block still closes the stage mechanically.
499
+
500
+ ---
501
+
502
+ ## Retired blocks
503
+
504
+ The two bespoke terminal blocks this protocol used to carry — the **standard block** and
505
+ the **warm-acceptable variant**, the latter stamped only at the
506
+ `forge-5-loop → forge-6-docs` boundary — are **gone**. They were the last hand-written
507
+ advancing contract, and their final two stamp sites (`skills/forge-5-loop/SKILL.md`'s
508
+ step-6 epic handoff and `skills/forge-5-loop/references/result-reporting.md`'s all-done
509
+ report) now stamp the canonical scripted stamp instead.
510
+
511
+ Nothing may reintroduce them. A hand-written "walk the user through the Stage Exit
512
+ Protocol" block, a warm "clearing is optional" block, or any other bespoke next-command
513
+ list on a covered surface is a routing fork: the script already decides freshness, gate
514
+ form, host wording, and the next command from live state, and a second block can only
515
+ disagree with it. The canonical scripted stamp above is the **only** advancing contract
516
+ for all nine covered exits.
@@ -33,6 +33,35 @@ Detailed checklist for the **backlog** verification mode, loaded by the `forge-v
33
33
  - [ ] **CHECK-B18**: Items that depend on types/interfaces reference the item that creates them
34
34
  - [ ] **CHECK-B19**: Priority ordering is consistent with dependency ordering (dependencies should have equal or higher priority)
35
35
 
36
+ ### Dependency Topology
37
+ - [ ] **CHECK-B28**: **Fragile dependency topology — a single root gates a large fraction of the
38
+ backlog, or the chain is deep** (#194). *Advisory heuristic — severity `improvement`, **never**
39
+ `error`/`gap`, and it **never blocks**. **not-applicable** when no trigger fires or the graph is
40
+ trivial (0–1 items, or no dependsOn edges at all).* A backlog where one root item gates most of
41
+ the tree, or whose critical chain is deep relative to its size, has a single point of near-total
42
+ failure: one defect in that root (or anywhere on the long chain) strands the dependent subtree —
43
+ the loop-recovery incident was 3 roots gating 81% of 16 items down a 13-deep chain, and it passed
44
+ both authoring and verification without comment. Verify by computing, never by eyeballing:
45
+ 1. **Compute the topology.** Feed the runner's item array to the scripted metric:
46
+
47
+ ```
48
+ rauf backlog list . --backlog {resolvedBacklogDir} --json | python3 "$R/scripts/forge-session.py" backlog-topology --items-stdin --json
49
+ ```
50
+
51
+ Read `itemCount`, `rootCount`, `roots[].gatedCount`, `maxChainDepth`, and `warnings`. If
52
+ `itemCount <= 1` or there are no `dependsOn` edges, this check is **not-applicable**.
53
+ 2. **Read the warnings, do not re-derive them.** The metric applies the fixed thresholds
54
+ (`single-root-fanout` when any root gates ≥50% of items; `chain-depth` when `maxChainDepth`
55
+ ≥50% of item count). If `warnings` is empty, record **pass** (topology computed, no fragile
56
+ shape). Do not invent a different threshold — the constants are canonical
57
+ (`forge-session.py`).
58
+ 3. **Report each fired warning as one `improvement` finding.** For `single-root-fanout`, name the
59
+ root and its `gatedCount`/`itemCount` ("root 1 gates 13/16 items") and suggest splitting that
60
+ root's subtree or introducing an intermediate. For `chain-depth`, name
61
+ `maxChainDepth`/`itemCount` and suggest flattening. **Report, do not repair** — this is a
62
+ heads-up to the author, never a blocking gate. Cite the metric output the claim was derived
63
+ from.
64
+
36
65
  ### Completeness
37
66
  - [ ] **CHECK-B20**: There is an item for the initial package scaffold
38
67
  - [ ] **CHECK-B21**: There is an item for shared types and error hierarchy
@@ -95,3 +124,47 @@ Detailed checklist for the **backlog** verification mode, loaded by the `forge-v
95
124
  > provenance. Any item asserting a human-gated lifecycle state must trace — via `dependsOn` — to the
96
125
  > item that legitimately produces it, or assert the state through a dev-build / fixture path instead.
97
126
 
127
+ ### Work-Order Cardinality
128
+
129
+ > **When this fires:** only when the backlog, or an artifact the backlog derives from,
130
+ > **declares an enumerated per-item work list that claims to cover a set**. A backlog
131
+ > with no such list yields **not-applicable** — absence of a declared list is never a
132
+ > hard fail. The defect this catches is not a wrong item; it is a **missing** one, and
133
+ > a missing entry is invisible to every reader who checks the entries that are present.
134
+
135
+ - [ ] **CHECK-B29**: **A declared per-item work list covers the whole set it claims — name what is missing** (#170).
136
+ *Heuristic with a mechanical method — **not-applicable** when no enumerated per-item work
137
+ list is declared anywhere in the backlog or the artifacts it derives from; absence is
138
+ **never a hard fail**. A true omission is a `gap` (blocking): an unreviewed member is
139
+ missing coverage.* When the backlog — or an artifact it derives from, such as a
140
+ hand-authored work order, a per-item review sheet, a "one entry per item" table in a
141
+ plan the backlog cites, or a stated total in a summary line — declares an enumerated
142
+ list **claiming coverage of a set**, the list's cardinality must be **re-derived from
143
+ the actual member set** and never trusted from the list's own header, its numbering, or
144
+ a stated total. In the incident behind this check a hand-authored work order enumerated
145
+ **15 of 16** artifacts; it passed authoring and a full review, and the dropped
146
+ sixteenth would have been published unreviewed. Verify by re-deriving, never by
147
+ eyeballing:
148
+ 1. **Find the declared lists.** Scan the backlog and the artifacts it cites for an
149
+ enumerated list that claims coverage of a nameable set — one entry per backlog item,
150
+ per spec document, per requirement id, per generated artifact, per file to touch. The
151
+ coverage claim reads as "one per …", "all …", "every …", "each …", or as a stated
152
+ total ("16 artifacts", "covers the full set"). If **no** such list exists, this check
153
+ is **not-applicable** — record it and move on.
154
+ 2. **Re-derive the member set from its own source of record.** Build the actual set
155
+ independently of the list: backlog items from `backlog.json`, spec documents from the
156
+ spec directory listing, requirement ids from the PRD, artifacts from the paths the
157
+ items name. Count what you built; do not adopt any count the list asserts about
158
+ itself.
159
+ 3. **Difference both directions and name every discrepancy.** Report each member of the
160
+ re-derived set that has **no** entry in the declared list **by name** — the item id,
161
+ file path, or requirement id — never as a count delta ("one short", "off by one"),
162
+ which hands the reader back exactly the derivation this check just performed. Report
163
+ the reverse direction too: a list entry naming something absent from the re-derived
164
+ set is a stale entry.
165
+ 4. **Severity, and what to report.** A named omission is a `gap`. A stale entry, or a
166
+ stated total that disagrees with a list whose membership is nevertheless complete, is
167
+ an `inconsistency`. Every finding names the list, the source of record the set was
168
+ re-derived from, and each missing or stale member by name. **Report, do not repair** —
169
+ authoring the missing entry belongs to the fix pass.
170
+
@@ -12,7 +12,7 @@ reading the manifest, EPIC.md, completed members' specs, and (for E10) sibling m
12
12
  committed tests.
13
13
 
14
14
  ```bash
15
- R="$(bash -c 'for d in "${CLAUDE_PLUGIN_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/feature-forge/* "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done')"
15
+ R="$(bash -c 'for d in "${FEATURE_FORGE_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/feature-forge/* "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done')"
16
16
  [ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
17
17
  python3 "$R/scripts/epic-manifest.py" validate "{epic}" --specs-dir "{specsDir}" --json
18
18
  ```
@@ -46,9 +46,10 @@ python3 "$R/scripts/epic-manifest.py" validate "{epic}" --specs-dir "{specsDir}"
46
46
  - [ ] **CHECK-E09**: **open epic change requests** — any member whose `.pipeline-state.json`
47
47
  carries `epicChangeRequests[]` entries with `status: "open"` is surfaced as a **non-fatal**
48
48
  finding (one per open request). Severity keys off `blocksCurrent`: a **blocking** request →
49
- `inconsistency` (the epic decomposition and an in-flight member disagree; specs written now
50
- would build on a soon-invalid premise), a **non-blocking** request → `improvement` (a
51
- peer/downstream change to reconcile when convenient). Name the request's `kind`, `target`,
49
+ `error` (decision-bearing: the epic decomposition and an in-flight member disagree, stage
50
+ exits interpose reconcile-first on it, and specs written now would build on a soon-invalid
51
+ premise), a **non-blocking** request → `improvement` (a peer/downstream change to reconcile
52
+ when convenient). Name the request's `kind`, `target`,
52
53
  and `rationale`, and point at `/skill:forge-0-epic {epic}` to reconcile. **Report, do
53
54
  not repair** (same posture as CHECK-E07). Which members have open requests comes from the
54
55
  same `render-status --json` counts the navigator uses (`features[].openEpicChangeRequests` /