@enterpriseai/cli 3.19.0 → 3.19.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (364) hide show
  1. package/package.json +3 -3
  2. package/resources/deploy/eai-app-template/producer-pin.json +5 -5
  3. package/resources/deploy/eai-app-template/tests/source-unknown-deployment-evidence.test.mjs +2141 -1
  4. package/resources/gofer/.gofer-version +4 -357
  5. package/resources/gofer/agents-skills/eai/SKILL.md +365 -0
  6. package/resources/gofer/agents-skills/eai-update/SKILL.md +56 -0
  7. package/resources/gofer/agents-skills/gofer-documentation/SKILL.md +93 -0
  8. package/resources/gofer/bash-scripts/create-new-feature.sh +3 -1
  9. package/resources/gofer/bash-scripts/sync-implementation-status.sh +4 -3
  10. package/resources/gofer/bash-scripts/update-agent-context.sh +7 -8
  11. package/resources/gofer/bash-scripts/validate-artifact.sh +10 -6
  12. package/resources/gofer/bash-scripts/verify-object-type-routing-workspace.sh +184 -0
  13. package/resources/gofer/claude-commands/eai-update.md +46 -0
  14. package/resources/gofer/claude-commands/eai.md +355 -0
  15. package/resources/gofer/claude-skills/eai/SKILL.md +365 -0
  16. package/resources/gofer/claude-skills/eai-update/SKILL.md +56 -0
  17. package/resources/gofer/claude-skills/gofer-documentation/SKILL.md +93 -0
  18. package/resources/gofer/commands/0_gofer_start.md +440 -99
  19. package/resources/gofer/commands/0a_problem_validation.md +187 -27
  20. package/resources/gofer/commands/10_gofer_cloud.md +183 -23
  21. package/resources/gofer/commands/1_gofer_research.md +239 -30
  22. package/resources/gofer/commands/2_gofer_specify.md +239 -35
  23. package/resources/gofer/commands/3_gofer_plan.md +259 -43
  24. package/resources/gofer/commands/4_gofer_tasks.md +401 -81
  25. package/resources/gofer/commands/5_gofer_implement.md +375 -84
  26. package/resources/gofer/commands/6_gofer_validate.md +284 -53
  27. package/resources/gofer/commands/7_gofer_save.md +187 -26
  28. package/resources/gofer/commands/7a_stakeholder_comms.md +183 -23
  29. package/resources/gofer/commands/8_gofer_branding.md +183 -23
  30. package/resources/gofer/commands/9_gofer_tests.md +212 -23
  31. package/resources/gofer/commands/gofer_bootstrap_workspace.md +121 -8
  32. package/resources/gofer/commands/gofer_check_workspace.md +123 -8
  33. package/resources/gofer/commands/gofer_constitution.md +183 -23
  34. package/resources/gofer/commands/gofer_diagnose.md +183 -23
  35. package/resources/gofer/commands/gofer_eai_first_run.md +254 -25
  36. package/resources/gofer/commands/gofer_hydrate.md +183 -23
  37. package/resources/gofer/commands/gofer_personality.md +117 -6
  38. package/resources/gofer/commands/gofer_plan.md +117 -6
  39. package/resources/gofer/commands/gofer_side.md +117 -6
  40. package/resources/gofer/commands/gofer_spec_summary.md +183 -23
  41. package/resources/gofer/commands/gofer_tdd.md +183 -23
  42. package/resources/gofer/commands/gofer_vocabulary.md +185 -25
  43. package/resources/gofer/commands/gofer_zoom_out.md +183 -23
  44. package/resources/gofer/config/typesafe-learning-review.json +16 -0
  45. package/resources/gofer/config/typesafe-semantic-review.json +9 -0
  46. package/resources/gofer/copilot-instructions/gofer-cost.instructions.md +15 -6
  47. package/resources/gofer/copilot-instructions/typescript.instructions.md +1 -1
  48. package/resources/gofer/copilot-prompts/eai-update.prompt.md +58 -0
  49. package/resources/gofer/copilot-prompts/eai.prompt.md +367 -0
  50. package/resources/gofer/gemini/commands/gofer/eai-update.md +22 -0
  51. package/resources/gofer/gemini/commands/gofer/eai-update.toml +2 -0
  52. package/resources/gofer/gemini/commands/gofer/eai.md +357 -0
  53. package/resources/gofer/gemini/commands/gofer/eai.toml +2 -0
  54. package/resources/gofer/gemini/commands/gofer/manifest.json +3 -27
  55. package/resources/gofer/gemini/extension.json +4 -4
  56. package/resources/gofer/github-agents/eai.agent.md +83 -0
  57. package/resources/gofer/github-agents/gofer-business.agent.md +73 -4
  58. package/resources/gofer/github-agents/gofer-implement.agent.md +71 -2
  59. package/resources/gofer/github-agents/gofer-plan.agent.md +72 -2
  60. package/resources/gofer/github-agents/gofer-research.agent.md +72 -2
  61. package/resources/gofer/github-agents/gofer-validate.agent.md +72 -2
  62. package/resources/gofer/github-skills/eai/SKILL.md +365 -0
  63. package/resources/gofer/github-skills/eai-update/SKILL.md +56 -0
  64. package/resources/gofer/github-skills/gofer-documentation/SKILL.md +93 -0
  65. package/resources/gofer/grok-skills/eai/SKILL.md +267 -14
  66. package/resources/gofer/grok-skills/eai-update/SKILL.md +56 -0
  67. package/resources/gofer/hook-scripts/user-prompt-submit.mjs +58 -13
  68. package/resources/gofer/instruction-templates/base/agents-base.md +8 -4
  69. package/resources/gofer/instruction-templates/gofer/gofer-claude.md +7 -5
  70. package/resources/gofer/instruction-templates/gofer/gofer-copilot.md +10 -8
  71. package/resources/gofer/memory/constitution.md +9 -7
  72. package/resources/gofer/memory/gofer-model-policy.yaml +23 -1
  73. package/resources/gofer/memory/lessons.md +0 -31
  74. package/resources/gofer/node-scripts/canonical-descriptions.mjs +1 -1
  75. package/resources/gofer/node-scripts/check-version-alignment.mjs +4 -7
  76. package/resources/gofer/node-scripts/delivery-lineage-corpus.mjs +156 -0
  77. package/resources/gofer/node-scripts/generate-commands.mjs +1073 -265
  78. package/resources/gofer/node-scripts/gofer-acceptance-check.mjs +143 -0
  79. package/resources/gofer/node-scripts/gofer-agent-catalog.mjs +271 -0
  80. package/resources/gofer/node-scripts/gofer-benchmark-executor.mjs +123 -0
  81. package/resources/gofer/node-scripts/gofer-benchmark-sign.mjs +62 -0
  82. package/resources/gofer/node-scripts/gofer-benchmark-signer.mjs +89 -0
  83. package/resources/gofer/node-scripts/gofer-benchmark.mjs +76 -0
  84. package/resources/gofer/node-scripts/gofer-blocker-control.mjs +274 -0
  85. package/resources/gofer/node-scripts/gofer-claude-adapter.mjs +154 -0
  86. package/resources/gofer/node-scripts/gofer-closed-loop-audit.mjs +19 -2
  87. package/resources/gofer/node-scripts/gofer-delivery-check.mjs +121 -0
  88. package/resources/gofer/node-scripts/gofer-encrypted-key.mjs +58 -0
  89. package/resources/gofer/node-scripts/gofer-execution-metrics.mjs +477 -0
  90. package/resources/gofer/node-scripts/gofer-execution-recovery.mjs +334 -0
  91. package/resources/gofer/node-scripts/gofer-grok-adapter.mjs +184 -0
  92. package/resources/gofer/node-scripts/gofer-heldout-corpus.mjs +73 -0
  93. package/resources/gofer/node-scripts/gofer-heldout-snapshot.mjs +286 -0
  94. package/resources/gofer/node-scripts/gofer-heldout-verifier.mjs +211 -0
  95. package/resources/gofer/node-scripts/gofer-host-capability.mjs +335 -0
  96. package/resources/gofer/node-scripts/gofer-independent-reviewer.mjs +130 -0
  97. package/resources/gofer/node-scripts/gofer-live-routing.mjs +109 -0
  98. package/resources/gofer/node-scripts/gofer-local-capability-issuer.mjs +71 -0
  99. package/resources/gofer/node-scripts/gofer-local-isolation.mjs +175 -0
  100. package/resources/gofer/node-scripts/gofer-local-settings-cleanup.mjs +388 -0
  101. package/resources/gofer/node-scripts/gofer-loop-audit.mjs +54 -3
  102. package/resources/gofer/node-scripts/gofer-native-adapter.mjs +567 -0
  103. package/resources/gofer/node-scripts/gofer-native-benchmark-dispatch.mjs +145 -0
  104. package/resources/gofer/node-scripts/gofer-native-runtime.mjs +169 -0
  105. package/resources/gofer/node-scripts/gofer-pre-edit-check.mjs +204 -0
  106. package/resources/gofer/node-scripts/gofer-priority-check.mjs +214 -0
  107. package/resources/gofer/node-scripts/gofer-response-check.mjs +56 -0
  108. package/resources/gofer/node-scripts/gofer-reviewed-learning.mjs +1232 -0
  109. package/resources/gofer/node-scripts/gofer-run-verified-task.mjs +330 -0
  110. package/resources/gofer/node-scripts/gofer-runtime-ledger.mjs +289 -0
  111. package/resources/gofer/node-scripts/gofer-semantic-drift.mjs +584 -0
  112. package/resources/gofer/node-scripts/gofer-surface-update.mjs +1178 -0
  113. package/resources/gofer/node-scripts/gofer-trust-bootstrap.mjs +77 -0
  114. package/resources/gofer/node-scripts/gofer-trusted-benchmark.mjs +102 -0
  115. package/resources/gofer/node-scripts/gofer-trusted-evaluator.mjs +274 -0
  116. package/resources/gofer/node-scripts/gofer-tty-prompt.mjs +34 -0
  117. package/resources/gofer/node-scripts/gofer-typesafe-credentials.mjs +435 -0
  118. package/resources/gofer/node-scripts/gofer-ui-preview.mjs +1212 -0
  119. package/resources/gofer/node-scripts/gofer-verified-execution.mjs +484 -0
  120. package/resources/gofer/node-scripts/gofer-verifier-key-ceremony.mjs +101 -0
  121. package/resources/gofer/node-scripts/gofer-worktree-layout.mjs +32 -0
  122. package/resources/gofer/node-scripts/object-type-routing-phase-bundle.mjs +360 -0
  123. package/resources/gofer/node-scripts/package-agent-plugin.mjs +574 -82
  124. package/resources/gofer/node-scripts/parse-stage-command.mjs +1 -1
  125. package/resources/gofer/node-scripts/render-delivery-lineage.mjs +178 -0
  126. package/resources/gofer/node-scripts/sync-extension-resources.mjs +78 -2
  127. package/resources/gofer/node-scripts/validate-object-type-identifiers.mjs +767 -0
  128. package/resources/gofer/node-scripts/validate-object-type-routing-workspace.mjs +1325 -0
  129. package/resources/gofer/node-scripts/validate-v4-resource-contract.d.mts +44 -0
  130. package/resources/gofer/node-scripts/validate-v4-resource-contract.mjs +957 -0
  131. package/resources/gofer/node-scripts/workspace-bootstrap-lib.mjs +685 -116
  132. package/resources/gofer/references/agent-catalog.json +126 -0
  133. package/resources/gofer/references/blocker-mediation.md +156 -0
  134. package/resources/gofer/references/business-updates-and-goal-checks.md +109 -0
  135. package/resources/gofer/references/delivery-lineage.md +48 -0
  136. package/resources/gofer/references/mvp-capability-validation.md +102 -0
  137. package/resources/gofer/references/platform/README.md +1 -1
  138. package/resources/gofer/references/platform/eai-app-template.md +15 -13
  139. package/resources/gofer/references/platform/eai-auth-access.md +104 -0
  140. package/resources/gofer/references/platform/eai-config-driven-ui.md +5 -5
  141. package/resources/gofer/references/platform/eai-error-catalog.yaml +77 -19
  142. package/resources/gofer/references/platform/eai-repo-contract.md +61 -23
  143. package/resources/gofer/references/platform/eai-service-patterns.md +102 -105
  144. package/resources/gofer/references/platform/eai.md +44 -8
  145. package/resources/gofer/references/platform/vertical-template.md +10 -9
  146. package/resources/gofer/references/priority-outcome-protection.md +152 -0
  147. package/resources/gofer/references/verified-agent-execution.md +179 -0
  148. package/resources/gofer/schemas/gofer-learning-trace-v1.json +70 -0
  149. package/resources/gofer/specify-commands/0_gofer_start.md +440 -99
  150. package/resources/gofer/specify-commands/0a_problem_validation.md +187 -27
  151. package/resources/gofer/specify-commands/10_gofer_cloud.md +183 -23
  152. package/resources/gofer/specify-commands/1_gofer_research.md +239 -30
  153. package/resources/gofer/specify-commands/2_gofer_specify.md +239 -35
  154. package/resources/gofer/specify-commands/3_gofer_plan.md +259 -43
  155. package/resources/gofer/specify-commands/4_gofer_tasks.md +401 -81
  156. package/resources/gofer/specify-commands/5_gofer_implement.md +375 -84
  157. package/resources/gofer/specify-commands/6_gofer_validate.md +284 -53
  158. package/resources/gofer/specify-commands/7_gofer_save.md +187 -26
  159. package/resources/gofer/specify-commands/7a_stakeholder_comms.md +183 -23
  160. package/resources/gofer/specify-commands/8_gofer_branding.md +183 -23
  161. package/resources/gofer/specify-commands/9_gofer_tests.md +212 -23
  162. package/resources/gofer/specify-commands/gofer_bootstrap_workspace.md +121 -8
  163. package/resources/gofer/specify-commands/gofer_check_workspace.md +123 -8
  164. package/resources/gofer/specify-commands/gofer_constitution.md +183 -23
  165. package/resources/gofer/specify-commands/gofer_diagnose.md +183 -23
  166. package/resources/gofer/specify-commands/gofer_eai_first_run.md +254 -25
  167. package/resources/gofer/specify-commands/gofer_hydrate.md +183 -23
  168. package/resources/gofer/specify-commands/gofer_personality.md +117 -6
  169. package/resources/gofer/specify-commands/gofer_plan.md +117 -6
  170. package/resources/gofer/specify-commands/gofer_side.md +117 -6
  171. package/resources/gofer/specify-commands/gofer_spec_summary.md +183 -23
  172. package/resources/gofer/specify-commands/gofer_tdd.md +183 -23
  173. package/resources/gofer/specify-commands/gofer_vocabulary.md +185 -25
  174. package/resources/gofer/specify-commands/gofer_zoom_out.md +183 -23
  175. package/resources/gofer/specify-config/object-type-routing.json +24 -0
  176. package/resources/gofer/specify-config/typesafe-learning-review.json +16 -0
  177. package/resources/gofer/specify-config/typesafe-semantic-review.json +9 -0
  178. package/resources/gofer/system-skills/eai/SKILL.md +365 -0
  179. package/resources/gofer/system-skills/eai-update/SKILL.md +56 -0
  180. package/resources/gofer/system-skills/gofer-documentation/SKILL.md +93 -0
  181. package/resources/gofer/templates/build-map-template.md +64 -0
  182. package/resources/gofer/templates/business-scenarios-template.json +14 -0
  183. package/resources/gofer/templates/ciso-security-summary-template.md +3 -3
  184. package/resources/gofer/templates/context-bundle-template.md +4 -3
  185. package/resources/gofer/templates/contract-pack-template.md +8 -8
  186. package/resources/gofer/templates/cto-architecture-summary-template.md +3 -3
  187. package/resources/gofer/templates/delivery-lineage-template.json +8 -0
  188. package/resources/gofer/templates/eai-preflight-template.md +109 -68
  189. package/resources/gofer/templates/goal-ledger-template.json +1 -1
  190. package/resources/gofer/templates/gofer-model-policy.yaml +28 -6
  191. package/resources/gofer/templates/loop-contract-template.json +3 -1
  192. package/resources/gofer/templates/plan-template.md +8 -7
  193. package/resources/gofer/templates/priority-plan-template.json +29 -0
  194. package/resources/gofer/templates/proposal-review-template.md +6 -3
  195. package/resources/gofer/templates/release-capability-ledger-template.md +24 -0
  196. package/resources/gofer/templates/research-template.md +7 -6
  197. package/resources/gofer/templates/spec-summary-template.md +1 -1
  198. package/resources/gofer/templates/spec-template.md +45 -6
  199. package/resources/gofer/templates/tasks-template.md +12 -3
  200. package/resources/gofer/templates/ui-preview-brief-template.md +55 -5
  201. package/resources/gofer/templates/ui-review-log-template.md +21 -3
  202. package/resources/gofer/templates/ui-show-and-tell-template.md +46 -0
  203. package/resources/gofer/templates/visuals/capability-heatmap-template.md +2 -2
  204. package/resources/gofer/templates/working-backwards-prfaq-template.md +9 -8
  205. package/resources/linked-sources.json +4 -4
  206. package/resources/gofer/agents-skills/0_gofer_start/SKILL.md +0 -1287
  207. package/resources/gofer/agents-skills/0a_problem_validation/SKILL.md +0 -429
  208. package/resources/gofer/agents-skills/10_gofer_cloud/SKILL.md +0 -635
  209. package/resources/gofer/agents-skills/1_gofer_research/SKILL.md +0 -1159
  210. package/resources/gofer/agents-skills/2_gofer_specify/SKILL.md +0 -860
  211. package/resources/gofer/agents-skills/3_gofer_plan/SKILL.md +0 -899
  212. package/resources/gofer/agents-skills/4_gofer_tasks/SKILL.md +0 -760
  213. package/resources/gofer/agents-skills/5_gofer_implement/SKILL.md +0 -944
  214. package/resources/gofer/agents-skills/6_gofer_validate/SKILL.md +0 -2302
  215. package/resources/gofer/agents-skills/7_gofer_save/SKILL.md +0 -423
  216. package/resources/gofer/agents-skills/7a_stakeholder_comms/SKILL.md +0 -508
  217. package/resources/gofer/agents-skills/8_gofer_branding/SKILL.md +0 -315
  218. package/resources/gofer/agents-skills/9_gofer_tests/SKILL.md +0 -558
  219. package/resources/gofer/agents-skills/gofer_bootstrap_workspace/SKILL.md +0 -148
  220. package/resources/gofer/agents-skills/gofer_check_workspace/SKILL.md +0 -119
  221. package/resources/gofer/agents-skills/gofer_constitution/SKILL.md +0 -612
  222. package/resources/gofer/agents-skills/gofer_diagnose/SKILL.md +0 -114
  223. package/resources/gofer/agents-skills/gofer_eai_first_run/SKILL.md +0 -397
  224. package/resources/gofer/agents-skills/gofer_hydrate/SKILL.md +0 -561
  225. package/resources/gofer/agents-skills/gofer_personality/SKILL.md +0 -44
  226. package/resources/gofer/agents-skills/gofer_plan/SKILL.md +0 -40
  227. package/resources/gofer/agents-skills/gofer_side/SKILL.md +0 -45
  228. package/resources/gofer/agents-skills/gofer_spec_summary/SKILL.md +0 -112
  229. package/resources/gofer/agents-skills/gofer_tdd/SKILL.md +0 -112
  230. package/resources/gofer/agents-skills/gofer_vocabulary/SKILL.md +0 -112
  231. package/resources/gofer/agents-skills/gofer_zoom_out/SKILL.md +0 -112
  232. package/resources/gofer/claude-commands/0_gofer_start.md +0 -1282
  233. package/resources/gofer/claude-commands/0a_problem_validation.md +0 -424
  234. package/resources/gofer/claude-commands/10_gofer_cloud.md +0 -630
  235. package/resources/gofer/claude-commands/1_gofer_research.md +0 -1154
  236. package/resources/gofer/claude-commands/2_gofer_specify.md +0 -855
  237. package/resources/gofer/claude-commands/3_gofer_plan.md +0 -894
  238. package/resources/gofer/claude-commands/4_gofer_tasks.md +0 -755
  239. package/resources/gofer/claude-commands/5_gofer_implement.md +0 -939
  240. package/resources/gofer/claude-commands/6_gofer_validate.md +0 -2297
  241. package/resources/gofer/claude-commands/7_gofer_save.md +0 -418
  242. package/resources/gofer/claude-commands/7a_stakeholder_comms.md +0 -503
  243. package/resources/gofer/claude-commands/8_gofer_branding.md +0 -310
  244. package/resources/gofer/claude-commands/9_gofer_tests.md +0 -553
  245. package/resources/gofer/claude-commands/gofer_bootstrap_workspace.md +0 -143
  246. package/resources/gofer/claude-commands/gofer_check_workspace.md +0 -114
  247. package/resources/gofer/claude-commands/gofer_constitution.md +0 -607
  248. package/resources/gofer/claude-commands/gofer_diagnose.md +0 -109
  249. package/resources/gofer/claude-commands/gofer_eai_first_run.md +0 -392
  250. package/resources/gofer/claude-commands/gofer_hydrate.md +0 -556
  251. package/resources/gofer/claude-commands/gofer_personality.md +0 -39
  252. package/resources/gofer/claude-commands/gofer_plan.md +0 -35
  253. package/resources/gofer/claude-commands/gofer_side.md +0 -40
  254. package/resources/gofer/claude-commands/gofer_spec_summary.md +0 -107
  255. package/resources/gofer/claude-commands/gofer_tdd.md +0 -107
  256. package/resources/gofer/claude-commands/gofer_vocabulary.md +0 -107
  257. package/resources/gofer/claude-commands/gofer_zoom_out.md +0 -107
  258. package/resources/gofer/claude-skills/eai-gofer/SKILL.md +0 -56
  259. package/resources/gofer/copilot-prompts/0_gofer_start.prompt.md +0 -1308
  260. package/resources/gofer/copilot-prompts/0a_problem_validation.prompt.md +0 -429
  261. package/resources/gofer/copilot-prompts/10_gofer_cloud.prompt.md +0 -644
  262. package/resources/gofer/copilot-prompts/1_gofer_research.prompt.md +0 -1177
  263. package/resources/gofer/copilot-prompts/2_gofer_specify.prompt.md +0 -878
  264. package/resources/gofer/copilot-prompts/3_gofer_plan.prompt.md +0 -917
  265. package/resources/gofer/copilot-prompts/4_gofer_tasks.prompt.md +0 -778
  266. package/resources/gofer/copilot-prompts/5_gofer_implement.prompt.md +0 -962
  267. package/resources/gofer/copilot-prompts/6_gofer_validate.prompt.md +0 -2310
  268. package/resources/gofer/copilot-prompts/7_gofer_save.prompt.md +0 -433
  269. package/resources/gofer/copilot-prompts/7a_stakeholder_comms.prompt.md +0 -516
  270. package/resources/gofer/copilot-prompts/8_gofer_branding.prompt.md +0 -323
  271. package/resources/gofer/copilot-prompts/9_gofer_tests.prompt.md +0 -566
  272. package/resources/gofer/copilot-prompts/gofer_bootstrap_workspace.prompt.md +0 -161
  273. package/resources/gofer/copilot-prompts/gofer_check_workspace.prompt.md +0 -132
  274. package/resources/gofer/copilot-prompts/gofer_constitution.prompt.md +0 -621
  275. package/resources/gofer/copilot-prompts/gofer_diagnose.prompt.md +0 -127
  276. package/resources/gofer/copilot-prompts/gofer_eai_first_run.prompt.md +0 -410
  277. package/resources/gofer/copilot-prompts/gofer_hydrate.prompt.md +0 -571
  278. package/resources/gofer/copilot-prompts/gofer_personality.prompt.md +0 -57
  279. package/resources/gofer/copilot-prompts/gofer_plan.prompt.md +0 -53
  280. package/resources/gofer/copilot-prompts/gofer_side.prompt.md +0 -58
  281. package/resources/gofer/copilot-prompts/gofer_spec_summary.prompt.md +0 -125
  282. package/resources/gofer/copilot-prompts/gofer_tdd.prompt.md +0 -125
  283. package/resources/gofer/copilot-prompts/gofer_vocabulary.prompt.md +0 -125
  284. package/resources/gofer/copilot-prompts/gofer_zoom_out.prompt.md +0 -125
  285. package/resources/gofer/gemini/commands/gofer/0_gofer_start.md +0 -1282
  286. package/resources/gofer/gemini/commands/gofer/0_gofer_start.toml +0 -2
  287. package/resources/gofer/gemini/commands/gofer/0a_problem_validation.md +0 -424
  288. package/resources/gofer/gemini/commands/gofer/0a_problem_validation.toml +0 -2
  289. package/resources/gofer/gemini/commands/gofer/10_gofer_cloud.md +0 -630
  290. package/resources/gofer/gemini/commands/gofer/10_gofer_cloud.toml +0 -2
  291. package/resources/gofer/gemini/commands/gofer/1_gofer_research.md +0 -1154
  292. package/resources/gofer/gemini/commands/gofer/1_gofer_research.toml +0 -2
  293. package/resources/gofer/gemini/commands/gofer/2_gofer_specify.md +0 -855
  294. package/resources/gofer/gemini/commands/gofer/2_gofer_specify.toml +0 -2
  295. package/resources/gofer/gemini/commands/gofer/3_gofer_plan.md +0 -894
  296. package/resources/gofer/gemini/commands/gofer/3_gofer_plan.toml +0 -2
  297. package/resources/gofer/gemini/commands/gofer/4_gofer_tasks.md +0 -755
  298. package/resources/gofer/gemini/commands/gofer/4_gofer_tasks.toml +0 -2
  299. package/resources/gofer/gemini/commands/gofer/5_gofer_implement.md +0 -939
  300. package/resources/gofer/gemini/commands/gofer/5_gofer_implement.toml +0 -2
  301. package/resources/gofer/gemini/commands/gofer/6_gofer_validate.md +0 -2297
  302. package/resources/gofer/gemini/commands/gofer/6_gofer_validate.toml +0 -2
  303. package/resources/gofer/gemini/commands/gofer/7_gofer_save.md +0 -418
  304. package/resources/gofer/gemini/commands/gofer/7_gofer_save.toml +0 -2
  305. package/resources/gofer/gemini/commands/gofer/7a_stakeholder_comms.md +0 -503
  306. package/resources/gofer/gemini/commands/gofer/7a_stakeholder_comms.toml +0 -2
  307. package/resources/gofer/gemini/commands/gofer/8_gofer_branding.md +0 -310
  308. package/resources/gofer/gemini/commands/gofer/8_gofer_branding.toml +0 -2
  309. package/resources/gofer/gemini/commands/gofer/9_gofer_tests.md +0 -553
  310. package/resources/gofer/gemini/commands/gofer/9_gofer_tests.toml +0 -2
  311. package/resources/gofer/gemini/commands/gofer/gofer_bootstrap_workspace.md +0 -143
  312. package/resources/gofer/gemini/commands/gofer/gofer_bootstrap_workspace.toml +0 -2
  313. package/resources/gofer/gemini/commands/gofer/gofer_check_workspace.md +0 -114
  314. package/resources/gofer/gemini/commands/gofer/gofer_check_workspace.toml +0 -2
  315. package/resources/gofer/gemini/commands/gofer/gofer_constitution.md +0 -607
  316. package/resources/gofer/gemini/commands/gofer/gofer_constitution.toml +0 -2
  317. package/resources/gofer/gemini/commands/gofer/gofer_diagnose.md +0 -109
  318. package/resources/gofer/gemini/commands/gofer/gofer_diagnose.toml +0 -2
  319. package/resources/gofer/gemini/commands/gofer/gofer_eai_first_run.md +0 -392
  320. package/resources/gofer/gemini/commands/gofer/gofer_eai_first_run.toml +0 -2
  321. package/resources/gofer/gemini/commands/gofer/gofer_hydrate.md +0 -556
  322. package/resources/gofer/gemini/commands/gofer/gofer_hydrate.toml +0 -2
  323. package/resources/gofer/gemini/commands/gofer/gofer_personality.md +0 -39
  324. package/resources/gofer/gemini/commands/gofer/gofer_personality.toml +0 -2
  325. package/resources/gofer/gemini/commands/gofer/gofer_plan.md +0 -35
  326. package/resources/gofer/gemini/commands/gofer/gofer_plan.toml +0 -2
  327. package/resources/gofer/gemini/commands/gofer/gofer_side.md +0 -40
  328. package/resources/gofer/gemini/commands/gofer/gofer_side.toml +0 -2
  329. package/resources/gofer/gemini/commands/gofer/gofer_spec_summary.md +0 -107
  330. package/resources/gofer/gemini/commands/gofer/gofer_spec_summary.toml +0 -2
  331. package/resources/gofer/gemini/commands/gofer/gofer_tdd.md +0 -107
  332. package/resources/gofer/gemini/commands/gofer/gofer_tdd.toml +0 -2
  333. package/resources/gofer/gemini/commands/gofer/gofer_vocabulary.md +0 -107
  334. package/resources/gofer/gemini/commands/gofer/gofer_vocabulary.toml +0 -2
  335. package/resources/gofer/gemini/commands/gofer/gofer_zoom_out.md +0 -107
  336. package/resources/gofer/gemini/commands/gofer/gofer_zoom_out.toml +0 -2
  337. package/resources/gofer/github-skills/eai-gofer/SKILL.md +0 -56
  338. package/resources/gofer/system-skills/0_gofer_start/SKILL.md +0 -1287
  339. package/resources/gofer/system-skills/0a_problem_validation/SKILL.md +0 -429
  340. package/resources/gofer/system-skills/10_gofer_cloud/SKILL.md +0 -635
  341. package/resources/gofer/system-skills/1_gofer_research/SKILL.md +0 -1159
  342. package/resources/gofer/system-skills/2_gofer_specify/SKILL.md +0 -860
  343. package/resources/gofer/system-skills/3_gofer_plan/SKILL.md +0 -899
  344. package/resources/gofer/system-skills/4_gofer_tasks/SKILL.md +0 -760
  345. package/resources/gofer/system-skills/5_gofer_implement/SKILL.md +0 -944
  346. package/resources/gofer/system-skills/6_gofer_validate/SKILL.md +0 -2302
  347. package/resources/gofer/system-skills/7_gofer_save/SKILL.md +0 -423
  348. package/resources/gofer/system-skills/7a_stakeholder_comms/SKILL.md +0 -508
  349. package/resources/gofer/system-skills/8_gofer_branding/SKILL.md +0 -315
  350. package/resources/gofer/system-skills/9_gofer_tests/SKILL.md +0 -558
  351. package/resources/gofer/system-skills/gofer_bootstrap_workspace/SKILL.md +0 -148
  352. package/resources/gofer/system-skills/gofer_check_workspace/SKILL.md +0 -119
  353. package/resources/gofer/system-skills/gofer_constitution/SKILL.md +0 -612
  354. package/resources/gofer/system-skills/gofer_diagnose/SKILL.md +0 -114
  355. package/resources/gofer/system-skills/gofer_eai_first_run/SKILL.md +0 -397
  356. package/resources/gofer/system-skills/gofer_hydrate/SKILL.md +0 -561
  357. package/resources/gofer/system-skills/gofer_personality/SKILL.md +0 -44
  358. package/resources/gofer/system-skills/gofer_plan/SKILL.md +0 -40
  359. package/resources/gofer/system-skills/gofer_side/SKILL.md +0 -45
  360. package/resources/gofer/system-skills/gofer_spec_summary/SKILL.md +0 -112
  361. package/resources/gofer/system-skills/gofer_tdd/SKILL.md +0 -112
  362. package/resources/gofer/system-skills/gofer_vocabulary/SKILL.md +0 -112
  363. package/resources/gofer/system-skills/gofer_zoom_out/SKILL.md +0 -112
  364. package/resources/gofer/templates/ui-approval-template.md +0 -32
@@ -1,2310 +0,0 @@
1
- ---
2
- name: 6_gofer_validate
3
- description: Validate implemented work with evidence-backed scoring, blast-radius analysis, and engineering review.
4
- agent: copilot-workspace
5
- tools:
6
- - Read
7
- - Grep
8
- - Glob
9
- - Bash
10
- - WebSearch
11
- argument-hint: feature-name-or-description
12
- gofer:
13
- workflowProfile: standard
14
- canonicalSource: .specify/commands/6_gofer_validate.md
15
- canonicalChecksum: c375a15f7dcaaf7b6908f43521bb54b226d6890935ffb7624b34efd956ef9a69
16
- metadataSource: scripts/generate-commands.ts
17
- ---
18
-
19
- ## Workspace Preflight
20
-
21
- Before doing stage/helper work:
22
-
23
- 1. Resolve the repository root.
24
- 2. Check the core Gofer sentinels:
25
- - `.specify/.gofer-version`
26
- - `.specify/commands/0_gofer_start.md`
27
- - `.specify/templates/spec-template.md`
28
- - `.specify/templates/loop-contract-template.json`
29
- - `.specify/templates/working-backwards-prfaq-template.md`
30
- - `.specify/templates/business-owner-summary-template.md`
31
- - `.specify/templates/cto-architecture-summary-template.md`
32
- - `.specify/templates/ciso-security-summary-template.md`
33
- - `.specify/templates/stakeholder-review-index-template.md`
34
- - `.specify/scripts/bash/create-new-feature.sh`
35
- - `.specify/scripts/node/parse-stage-command.mjs`
36
- - `.specify/scripts/node/gofer-loop-audit.mjs`
37
- - `.specify/scripts/hooks/post-tool-use.mjs`
38
- - `.specify/scripts/powershell/install-optional-tools.ps1`
39
- - `.specify/templates/gofer-model-policy.yaml`
40
- - `.specify/memory/gofer-model-policy.yaml`
41
- - `.specify/specs/`
42
- - `.specify/memory/`
43
- 3. Check host-specific repo-owned files when relevant:
44
- - Claude: `AGENTS.md`, `CLAUDE.md`, `.claude/settings.json`
45
- - Codex: `AGENTS.md`
46
- - Copilot: `.github/copilot-instructions.md`
47
- - VS Code extension mirrors Claude/Copilot/Gemini resources itself and should still keep the core scaffold healthy
48
- 4. If the repo already has the workspace checker script, prefer running:
49
- - `node .specify/scripts/node/gofer-workspace-check.mjs --host copilot --json`
50
- 5. If the workspace is missing or stale, ask exactly:
51
- - **"This repo is missing or stale for Gofer. Initialize/update it now?"**
52
- 6. If the user says yes, run the Gofer workspace bootstrap helper and then resume this command from the top.
53
- 7. If the user says no, stop and explain that Gofer stage/helper work depends on the repo-owned scaffold.
54
-
55
-
56
- # Gofer Validate
57
-
58
- ## EAI Platform Session Preflight
59
-
60
- Before any Gofer stage/helper command does pipeline work:
61
-
62
- 1. Treat durable delivery as EAI Platform delivery by default, with Azure second
63
- and every other stack only by explicit exception.
64
- 2. Run `eai whoami` and confirm the EAI CLI is installed, the user is logged in,
65
- and an active workspace is visible.
66
- 3. If `eai` is missing, `eai whoami` fails, the token is expired, or no active
67
- workspace is available, stop and run `/gofer:eai-first-run` or ask the user to
68
- approve login/setup before continuing.
69
- 4. For EAI app delivery, do not continue into research, specification, planning,
70
- tasks, implementation, or validation until
71
- `.specify/specs/{feature}/eai-preflight.md` records login, workspace, template,
72
- app-readiness, and next-action evidence.
73
- 5. Do not write tokens, secrets, private workspace IDs, Entra/CIAM authority tenant IDs, or local `.env` values into
74
- Gofer artifacts; record only product-safe readiness status and evidence.
75
-
76
- ## Token And Cost Policy
77
- <!-- gofer:token-cost-policy:start -->
78
-
79
- Before spawning agents, calling tools, or loading large files:
80
-
81
- 1. Treat `.specify/memory/gofer-model-policy.yaml` as the repo-owned source of truth for simple, medium, hard, and arbiter model routing. If it is missing, run `/gofer:bootstrap-workspace` before continuing.
82
- 2. Use the cheapest capable model first.
83
- - Claude: Haiku for scouting/extraction; Sonnet for normal implementation, synthesis, validation, and security; Opus for high-risk arbitration or release-critical failures.
84
- - Codex/OpenAI: GPT mini for simple coding; GPT nano only for locate/classify/summarize/mechanical work; GPT-5.3-Codex or flagship GPT for tool-heavy coding, architecture, and release-critical validation.
85
- - Gemini: Flash-Lite for cheap large-context scan/summarize; Flash for default research synthesis; Pro for large-context architecture or high-risk arbitration.
86
- - Copilot: prefer Auto for simple and default work; ask the user before choosing a paid/high-tier picker model for hard security, architecture, or release gates.
87
- 3. Keep raw tool output out of the main conversation context. Save stable findings to `.specify/specs/{feature}/context-bundle.md`, then work from summaries.
88
- 4. Use provider prompt/context caching only for stable, non-secret prefixes: Gofer scaffold, AGENTS/CLAUDE/Copilot instructions, constitution, repo map, stage contracts, and validation rubric.
89
- 5. Before continuing after large research, planning, implementation, or validation bursts, checkpoint the durable artifacts and compact/clear/resume context when the host supports it.
90
- 6. Escalate model tier only when a cheaper pass is low-confidence, contradictory, security-sensitive, or blocking release quality.
91
- <!-- gofer:token-cost-policy:end -->
92
-
93
- ## User Input
94
-
95
- ```text
96
- $ARGUMENTS
97
- ```
98
-
99
- You **MUST** consider the user input before proceeding (if not empty).
100
-
101
- ## Execution Profile And Validation Cost
102
-
103
- Validation must respect the final risk label:
104
-
105
- - **fast**: for `docs-only` or very small low-risk changes, run focused checks
106
- and verify no unnecessary artifact churn or unrelated files were changed.
107
- - **standard**: run the normal rubric, focused build/test/lint/typecheck
108
- evidence, and traceability checks.
109
- - **full**: preserve the existing blast-radius, evidence gates, review loop,
110
- scoring, and release-readiness checks; require evidence for contract,
111
- security, data, infra/config, rollback, and cross-repository claims.
112
- - **dynamic**: preserve the full validation behavior, then also verify
113
- `execution-profile.md`, `workflow-dag.md`, shard outputs, reducer synthesis,
114
- verifier/refuter evidence, budget/stop-condition evidence, and any explicit
115
- user confirmation required before broad fanout work.
116
-
117
- Archived specs under `.specify/specs/_*/` are historical context and must not
118
- inflate active context-health estimates or current blast-radius manifests.
119
-
120
- ## Prerequisites
121
-
122
- This command expects in `.specify/specs/{feature}/`:
123
-
124
- - `research.md` - Codebase analysis (from #1_gofer_research)
125
- - `spec.md` - Feature specification (from #2_gofer_specify)
126
- - `plan.md` - Implementation plan (from #3_gofer_plan)
127
- - `tasks.md` - Task breakdown (from #4_gofer_tasks)
128
- - `goal-ledger.json` - Goal, metric, delivery-state, and re-loop contract
129
- - `loop-contract.json` - Bounded eval commands and stop rules
130
- - `loop-ledger.jsonl` - Implementation and validation loop evidence
131
- - `traceability.md` - Requirement -> task -> code -> test matrix
132
- - Implemented code (from #5_gofer_implement)
133
-
134
- ---
135
-
136
- ## Spec Artifact Guard
137
-
138
- Before validation, `.specify/scripts/bash/check-prerequisites.sh --json
139
- --require-tasks` must confirm that `{FEATURE_DIR}/spec.md` exists, is
140
- non-empty, and is not the unfilled spec template. If the helper reports
141
- `spec.md` as missing, empty, or `template`, stop and run `#2_gofer_specify`.
142
- Validation cannot score functional correctness, traceability, or objective
143
- outcomes without a real specification.
144
-
145
- ## Outline
146
-
147
- 1. Context health check
148
- 2. Load implementation context
149
- 3. Closed-loop objective audit
150
- 4. **Phase A** — Spawn 6 specialist rubric validation agents in parallel
151
- 4. Evidence gate pre-check and pending-gate tracking
152
- 5. **Phase B** — Spawn 5 blast-radius analysis agents in parallel
153
- 7. Blast-radius synthesis (change graph, interface diff, observability,
154
- dependency/submodule impact, rollback readiness, release checklist)
155
- 8. Run automated checks (build, test, lint, typecheck)
156
- 9. Mutation testing gate
157
- 10. Mock ratio analysis
158
- 11. Semantic slop detection
159
- 12. Score the 11-category rubric (110 points)
160
- 13. Generate enhanced validation report + blast-radius report
161
- 14. Determine rubric PASS/FAIL outcome
162
- 15. Brownfield restart on failure
163
- 16. **Phase C** — Engineering review loop (3 agents × up to 5 cycles with
164
- auto-fix)
165
- 17. Generate engineering review report
166
- 18. Attribution logging to JSONL
167
- 19. Memory update check
168
-
169
- ---
170
-
171
- ## Execution Strategy by Platform
172
-
173
- | Platform | Validation Execution Strategy |
174
- | -------------------------------------- | --------------------------------------------------------------------------------------------- |
175
- | Claude Code CLI | Run all validation agents in parallel using the Task tool |
176
- | GitHub Copilot Chat (2026+) | Use multi-agent delegation to run validation in parallel |
177
- | GitHub Copilot Chat (2025 and earlier) | Run validation checks sequentially using the **Legacy Workflow** in `docs/legacy-workflow.md` |
178
-
179
- For pre-2026 Copilot environments, execute the validation phases
180
- **sequentially** instead of parallel spawning.
181
-
182
- ---
183
-
184
- ## The Engineering Quality Rubric
185
-
186
- ### 11-Category Scoring (110 Points)
187
-
188
- | # | Category | Points | Pass Criteria | Agent |
189
- | --- | ---------------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
190
- | 1 | Functional Correctness | 15 | Every acceptance criterion in spec.md has a passing test exercising real code | validation-correctness |
191
- | 2 | Test Authenticity | 15 | Zero skips, zero placeholders, zero mock-only assertions. Mutation score >= 60% if Stryker available | validation-test-quality |
192
- | 3 | UI/E2E Verification | 10 | If feature has UI: real rendering tests pass. If no UI: points redistribute | N/A (automated check) |
193
- | 4 | Security Posture | 10 | Zero hardcoded secrets, no disabled security features, no client-side keys | validation-security |
194
- | 5 | Integration Reality | 10 | Integration tests use real dependencies where possible. Contract tests validate boundaries | validation-integration |
195
- | 6 | Error Path Coverage | 10 | Public functions tested for failure modes. No empty catch blocks | validation-correctness + validation-standards |
196
- | 7 | Architecture Compliance | 10 | File structure, patterns, visual explanations, and human-facing document summaries match plan.md and research.md. Required visuals are simple, rendered or fallback-safe, and traceable to requirements, code, and EAI Platform decisions | validation-standards |
197
- | 8 | Performance Baseline | 5 | No synchronous I/O in async paths, no unbounded loops, no N+1 patterns | validation-performance |
198
- | 9 | Code Hygiene | 10 | Zero AI slop: no TODO placeholders, no redundant comments, no magic numbers | validation-standards |
199
- | 10 | Specification Traceability | 5 | Every user story maps to tests, every test maps to code | validation-correctness |
200
- | 11 | **Blast Radius Containment** | 10 | No unmitigated breaking API changes, full-surface consumer/import audit, new error paths log, no new High/Critical CVEs, rollback/feature-flag path exists, release checklist complete | codebase-analyzer + validation-integration + validation-standards + research-dependency-evaluator + tasks-rollback-planner |
201
-
202
- ### Point Redistribution (No-UI Features)
203
-
204
- When a feature has **no UI component** (no web pages, no frontend, no visual
205
- interface), the 10 points from UI/E2E Verification are redistributed:
206
-
207
- - **+5 to Functional Correctness** (total: 20 points)
208
- - **+5 to Test Authenticity** (total: 20 points)
209
-
210
- Total remains **110/110** across all 11 categories.
211
-
212
- **Detection**: Check plan.md tech stack. If no UI framework (React, Vue,
213
- Angular, Svelte) and no Playwright/Cypress tests exist, this is a no-UI feature.
214
-
215
- ### Scoring Rules
216
-
217
- - Each category scores **full points** or **0**. There is no partial credit.
218
- - A category scores 0 if its agent reports any **Red (blocking)** finding.
219
- - A category scores 0 if its automated check fails.
220
- - **Total score** = sum of all category scores (max **110**, was 100).
221
- - **PASS** = 110/110 and a passing objective outcome gate. Anything less = FAIL.
222
- - Legacy consumers reading `status: PASS` / `score: 100` from historical reports
223
- should migrate to the 110-point scale. The report keeps the `score` field as
224
- the numerator and `score_max` to disambiguate.
225
-
226
- **Honest-scoring rule (FR-012)**: If an agent reports `EVIDENCE ABSENT:`, the
227
- orchestrating stage MUST score that category 0 regardless of other findings.
228
- Phrases like `likely correct`, `appears wired`, or `should be passing` are NOT
229
- evidence and MUST NOT contribute to any score. Any rubric category where
230
- evidence is absent, unverifiable, fabricated, or implied scores exactly 0 — no
231
- partial credit.
232
-
233
- ---
234
-
235
- ## Step 0: Context Health Check
236
-
237
- Before starting validation, assess context window health:
238
-
239
- ```bash
240
- .specify/scripts/bash/check-context-health.sh
241
- ```
242
-
243
- - If **< 50%**: Proceed normally
244
- - If **50-70%**: Use sub-agents heavily, minimize main context
245
- - If **> 70%**: Run `#7_gofer_save`, start a fresh session, read the
246
- checkpoint, and continue validation
247
-
248
- Validation loads all artifacts and spawns 6 agents — context pressure is high.
249
-
250
- ---
251
-
252
- ## Step 1: Load Context
253
-
254
- 1. **Run setup script**:
255
-
256
- ```bash
257
- .specify/scripts/bash/check-prerequisites.sh --json --require-tasks
258
- ```
259
-
260
- Parse JSON for FEATURE_DIR
261
-
262
- 2. **Load all artifacts**:
263
- - spec.md (user stories, acceptance criteria)
264
- - plan.md (architecture, file structure, tech stack)
265
- - tasks.md (task completion status)
266
- - goal-ledger.json (goal IDs, metrics, delivery states, re-loop triggers)
267
- - loop-contract.json (loop objective, eval commands, max iterations, stop conditions)
268
- - loop-ledger.jsonl (implementation and validation loop evidence)
269
- - traceability.md (requirement-to-code/test evidence matrix)
270
- - research.md (codebase patterns to follow)
271
-
272
- 3. **Detect iteration count**:
273
- - Check if `{FEATURE_DIR}/remediation-report.md` exists
274
- - If yes, read the iteration count from it
275
- - Track: `ITERATION = [1|2|3]` (first run = 1)
276
-
277
- 4. **Determine UI presence**:
278
- - Read plan.md tech stack
279
- - If UI framework present AND Playwright/Cypress tests exist: `HAS_UI = true`
280
- - Otherwise: `HAS_UI = false` → apply point redistribution
281
-
282
- **Deployment/Render Scope Detection** (FR-011):
283
-
284
- Scan `spec.md`, `plan.md`, `contract-pack.md`, and `quickstart.md` (when
285
- present) for the following signals:
286
-
287
- - `DEPLOY_SIGNAL_1`: any acceptance criterion contains: `rendered`,
288
- `live route`, `live API`, `deployed`, `production`, `staging`,
289
- `SharePoint`, `Azure`, `smoke`, `E2E`, `browser`
290
- - `DEPLOY_SIGNAL_2`: `plan.md`, `contract-pack.md`, or `quickstart.md`
291
- names a deployment target: SharePoint, Azure, staging, production, Vercel,
292
- Netlify, Docker, Kubernetes, or any server/environment referenced in the
293
- acceptance chain
294
- - `DEPLOY_SIGNAL_3`: `plan.md` declares a UI/rendered experience AND at least
295
- one acceptance criterion uses: `sees`, `displays`, `shows`, `renders`,
296
- `navigates to`
297
-
298
- Set `DEPLOY_IN_SCOPE = true` if ANY signal is present.
299
- Set `DEPLOY_IN_SCOPE = false` if NO signal is present.
300
- Record the determination in the validation report preamble.
301
-
302
- ## Managed-Source Readiness Gate
303
-
304
- Before rubric scoring or declaring selected EAI-maintained source ready, verify
305
- `eai deploy source validate --help` and check the current app:
306
-
307
- ```bash
308
- node .specify/scripts/node/eai-app-template-readiness.mjs --root . --source eai-managed --json
309
- ```
310
-
311
- Add `--cli <executable>` for the app's explicitly selected CLI. Require
312
- `ready: true` and `sourceValidation.status: passed`; missing, malformed, or failed
313
- validation blocks managed-source readiness. Include all customer-authored app
314
- files, including runners, tests, backend code, scripts, documentation, and
315
- supported dot configuration. Preserve protected EAI authentication,
316
- platform-service, deployment, and workflow controls. Unsupported custom runtimes
317
- must fail explicitly. Do not omit business changes or customer app files,
318
- restore files automatically, or weaken protected controls. Recheck after source
319
- changes. This gate is read-only and cannot prove deployment success. Do not
320
- apply it to local-only or customer-owned source.
321
-
322
- ## Step 1.5: Closed-Loop Objective And Loop Evidence Audit
323
-
324
- Before rubric scoring, run the closed-loop audit and write a fresh rebaseline
325
- report:
326
-
327
- ```bash
328
- node .specify/scripts/node/gofer-closed-loop-audit.mjs --feature-dir {FEATURE_DIR} --json --strict
329
- ```
330
-
331
- Also write/update `{FEATURE_DIR}/goal-rebaseline-report.md`.
332
-
333
- Then run the bounded loop audit:
334
-
335
- ```bash
336
- node .specify/scripts/node/gofer-loop-audit.mjs --feature-dir {FEATURE_DIR} --stage 6_validate --json --strict
337
- ```
338
-
339
- This writes/updates `{FEATURE_DIR}/loop-audit-report.md`.
340
-
341
- Validation MUST treat the closed-loop and loop audits as objective gates:
342
-
343
- - If the audit reports missing goal coverage, missing code/test evidence,
344
- expired assumptions, or invalid goal-ledger structure, validation FAILS.
345
- - If the loop audit reports a missing/invalid loop contract, missing
346
- `loop-ledger.jsonl` evidence, maxIterations breach, or required human
347
- escalation, validation FAILS.
348
- - If the audit recommends reopening `#2_gofer_specify`, `#3_gofer_plan`,
349
- `#4_gofer_tasks`, or `#6_gofer_validate`, record that as a blocking drift
350
- finding and FAIL the run. The feature is no longer in a closed state even if
351
- the code still compiles.
352
- - If the audit only reports low-severity warnings with no recommended reopen
353
- stage, continue but record them in the validation report.
354
-
355
- ## Object Type Identifier Contract
356
-
357
- - Preserve PascalCase source/model `name` and exact lowercase kebab-case
358
- transport/storage `slug` as distinct identifiers.
359
- - Generated `linkTypes[].targetObjectType`, runtime `target_type`, paths, and
360
- governed v4 fields contain exact stored slugs.
361
- - Resolve same-manifest model-name shorthand through the declared slug before
362
- publication; reject unresolved names instead of guessing.
363
- - Use the shared platform SDK for app routes. Never hand-write v4 resource
364
- paths or add a local slugifier.
365
- - Historical stored slugs are authoritative. Never normalize, alias, or rename
366
- them to match current derivation.
367
-
368
- ---
369
-
370
- # Phase A — Rubric Validation
371
-
372
- Phase A runs the 10-category engineering rubric (Categories 1-10, up to 100
373
- points before Category 11 is added).
374
-
375
- ## Step 2: Spawn 6 Specialist Validation Agents
376
-
377
- **CRITICAL**: You **MUST** launch all 6 agents **in parallel** using the Task
378
- tool. Do NOT perform validation work inline in the main context. The main
379
- context should only orchestrate, score the rubric, and review agent outputs.
380
- Each agent receives the feature context and returns structured findings.
381
-
382
- ### Agent 1: Correctness Validator
383
-
384
- ```
385
- Task: subagent_type="validation-correctness", model="sonnet"
386
- Prompt: "Validate functional correctness for feature [FEATURE_NAME].
387
-
388
- Feature directory: {FEATURE_DIR}
389
- Spec: {FEATURE_DIR}/spec.md
390
- Plan: {FEATURE_DIR}/plan.md
391
-
392
- Check every acceptance criterion in spec.md.
393
- For each criterion, find the test that exercises it and verify it tests real code.
394
- Return findings in your standard report format (<2000 tokens)."
395
- ```
396
-
397
- ### Agent 2: Security Validator
398
-
399
- ```
400
- Task: subagent_type="validation-security", model="sonnet"
401
- Prompt: "Validate security posture for feature [FEATURE_NAME].
402
-
403
- Scan all new/modified files (from tasks.md file paths).
404
- Check for: hardcoded secrets, disabled security, auth bypass, client-side keys.
405
- Return findings with Red/Yellow/Gray severity (<2000 tokens)."
406
- ```
407
-
408
- ### Agent 3: Performance Validator
409
-
410
- ```
411
- Task: subagent_type="validation-performance", model="haiku"
412
- Prompt: "Validate performance characteristics for feature [FEATURE_NAME].
413
-
414
- Scan all new/modified source files (from tasks.md file paths).
415
- Check for: sync I/O in async paths, cyclomatic complexity > 12, unbounded loops.
416
- Build scripts and test files are exempt.
417
- Return findings with complexity scores (<2000 tokens)."
418
- ```
419
-
420
- ### Agent 4: Test Quality Validator
421
-
422
- ```
423
- Task: subagent_type="validation-test-quality", model="haiku"
424
- Prompt: "Validate test quality for feature [FEATURE_NAME].
425
-
426
- Scan test files related to the feature.
427
- Check for: placeholder assertions, skipped tests, mock ratio, mock-only tests.
428
- VSCode API mocks marked '// mock-justified: VSCode API' are exempt from ratio.
429
- Return findings with mock ratio calculation (<2000 tokens)."
430
- ```
431
-
432
- ### Agent 5: Integration Validator
433
-
434
- ```
435
- Task: subagent_type="validation-integration", model="sonnet"
436
- Prompt: "Validate integration contracts for feature [FEATURE_NAME].
437
-
438
- Feature directory: {FEATURE_DIR}
439
- Check contracts/ directory if it exists.
440
- Verify cross-component boundaries, type compatibility, integration test coverage.
441
- Return findings with contract compliance status (<2000 tokens)."
442
- ```
443
-
444
- ### Agent 6: Standards Validator
445
-
446
- ```
447
- Task: subagent_type="validation-standards", model="sonnet"
448
- Prompt: "Validate standards compliance for feature [FEATURE_NAME].
449
-
450
- Feature directory: {FEATURE_DIR}
451
- Check against constitution.md (if exists) and research.md patterns.
452
- Detect AI slop: redundant comments, over-engineered abstractions, silent failures.
453
- Check code hygiene: TODO/FIXME, magic numbers, unused imports.
454
- Return findings with severity tiers (<2000 tokens)."
455
- ```
456
-
457
- ### Agent 7: Security Red Team (Optional — Multi-Perspective)
458
-
459
- When the feature involves security-sensitive code (authentication,
460
- authorization, user input handling, external APIs), run the security red team
461
- strategy (#13):
462
-
463
- ```
464
- # Diverge: 3 attack perspectives
465
- Task: subagent_type="validate-security-red-team", model="opus"
466
- Prompt: "Perspective 1: OWASP Top 10 attack analysis for feature [FEATURE_NAME].
467
- Scan all new/modified files from tasks.md. Attack from OWASP perspective.
468
- Return findings with exploit steps (<2000 tokens)."
469
-
470
- Task: subagent_type="validate-security-red-team", model="opus"
471
- Prompt: "Perspective 2: Business logic abuse analysis for feature [FEATURE_NAME].
472
- Scan all new/modified files from tasks.md. Attack business logic.
473
- Return findings with exploit steps (<2000 tokens)."
474
-
475
- Task: subagent_type="validate-security-red-team", model="opus"
476
- Prompt: "Perspective 3: CVE search for feature [FEATURE_NAME].
477
- Check package.json dependencies for known CVEs.
478
- Return findings with advisory references (<2000 tokens)."
479
-
480
- # Converge: Judge synthesizes attack findings
481
- Task: subagent_type="multi-perspective-judge", model="opus"
482
- Prompt: "Synthesize 3 security red team perspectives for [FEATURE_NAME].
483
- Perspective 1 (OWASP): [result]. Perspective 2 (Business Logic): [result].
484
- Perspective 3 (CVE): [result].
485
- Identify confirmed vulnerabilities vs false positives. Prioritize by exploitability."
486
- ```
487
-
488
- **Run all 6 core agents in parallel.** Run Agent 7 (if applicable) in parallel
489
- with the core agents.
490
-
491
- ## Step 2.2: Evidence Gate Pre-Check
492
-
493
- Evaluate the truthfulness gates before final scoring. If a gate is still
494
- pending here, re-check it after Step 3 automated checks complete and before the
495
- PASS/FAIL synthesis.
496
-
497
- ```
498
- GATE-1 (Integration Proof — Category 5):
499
- Require: runtime wiring artifact OR integration-test execution output
500
- present in the current session context by final scoring time.
501
- If absent during Step 2.2, record GATE-1 as pending and re-check it after
502
- Step 3 automated checks complete.
503
- Still absent after Step 3 → Category 5 score = 0; mark GATE_FAIL = true
504
-
505
- GATE-2 (Test Execution — Categories 1 and 2):
506
- Require: real, executed npm test output with pass/fail count already present
507
- or produced by Step 3 automated checks before final scoring.
508
- If absent during Step 2.2, record GATE-2 as pending and re-check it after
509
- Step 3 automated checks complete.
510
- Still absent after Step 3 → Categories 1 and 2 score = 0; mark GATE_FAIL = true
511
-
512
- GATE-3 (Render/Deployment Proof — Category 3):
513
- IF HAS_UI = false:
514
- Record "N/A — HAS_UI=false" in evidence table.
515
- Record a matching not-in-scope reason in `Absent / Reason for 0`.
516
- Apply existing no-UI point redistribution.
517
- IF HAS_UI = true AND DEPLOY_IN_SCOPE = false:
518
- Require: local render proof (screenshot, component render assertion,
519
- headless browser assertion, or local smoke-check output) present by final
520
- scoring time.
521
- If absent during Step 2.2, record GATE-3 as pending and re-check before
522
- final PASS/FAIL synthesis.
523
- Still absent → Category 3 score = 0; mark GATE_FAIL = true
524
- If present, record "Render proof only — deployment target not in scope" in
525
- the evidence table and do not redistribute Category 3 points.
526
- IF HAS_UI = true AND DEPLOY_IN_SCOPE = true:
527
- Require: screenshot, curl/HTTP transcript, deployment log, headless browser
528
- assertion, or smoke-check output present by final scoring time, with at
529
- least one artifact proving rendered/live behavior on the declared route or
530
- deployment target.
531
- If absent during Step 2.2, record GATE-3 as pending and re-check before
532
- final PASS/FAIL synthesis.
533
- Still absent → Category 3 score = 0; mark GATE_FAIL = true
534
-
535
- If any GATE_FAIL = true:
536
- - Any agent that would have scored the gated category is still run
537
- - The category score remains 0 unless the missing evidence appears before
538
- final scoring
539
- ```
540
-
541
- Collect all results before proceeding.
542
-
543
- ---
544
-
545
- # Phase B — Blast Radius Analysis
546
-
547
- Phase B quantifies the **ripple effect** of the implementation. It assesses risk
548
- to code outside the feature boundary, interface-contract stability,
549
- observability preservation, dependency / submodule impact, rollback readiness,
550
- and release-checklist compliance. Phase B results score **Category 11 (10
551
- points)** and produce a separate `blast-radius-report.md` artifact.
552
-
553
- Phase B runs **after** Phase A agents have returned (Step 2 complete) and
554
- **before** automated checks in Step 3, because breaking-change detection informs
555
- how to interpret failing tests/types.
556
-
557
- ## Step 2.5: Pre-Flight Change Surface Discovery
558
-
559
- Before spawning Phase B agents, build a **change manifest** the agents can
560
- reference. This is a cheap main-context pass, not an agent task.
561
-
562
- 1. **Modified file list** — from `tasks.md` completed tasks and git:
563
-
564
- ```bash
565
- git diff --name-only $(git merge-base HEAD main 2>/dev/null || echo HEAD~1) HEAD
566
- ```
567
-
568
- 2. **Submodule inventory** — detect repo submodules and workspace packages:
569
-
570
- ```bash
571
- git submodule status 2>/dev/null
572
- cat package.json 2>/dev/null | grep -E '"workspaces"' -A 20
573
- ls -d */package.json 2>/dev/null | xargs -I {} dirname {}
574
- ```
575
-
576
- Record which submodules/workspaces contain modified files. For this repo the
577
- canonical submodules are `extension/`, `language-server/`, `docs/`.
578
-
579
- 3. **Public-surface detection** — identify exported symbols at risk:
580
- - `index.ts` / `index.js` files in modified directories
581
- - `*.d.ts` files in modified directories
582
- - Entries in the `exports` / `main` / `types` fields of modified
583
- `package.json` files
584
- - Files under `contracts/` or `.specify/specs/{feature}/contracts/`
585
-
586
- 4. **Dependency manifest diff** — capture dependency churn:
587
-
588
- ```bash
589
- git diff $(git merge-base HEAD main 2>/dev/null || echo HEAD~1) HEAD -- package.json package-lock.json extension/package.json language-server/package.json 2>/dev/null
590
- ```
591
-
592
- 5. **Rollback-relevant assets** — flag anything that needs a reverse path:
593
- - Files under `migrations/`, `db/migrations/`, `prisma/migrations/`
594
- - Files named `*.sql`, `schema.*`
595
- - Feature-flag definitions (search for `featureFlag`, `growthbook`,
596
- `launchdarkly`, `flags.`)
597
- - `CHANGELOG.md`, `RELEASES.md`, version fields in `package.json`
598
-
599
- Record these into `CHANGE_MANIFEST` for the Phase B prompts.
600
-
601
- ---
602
-
603
- ## Step 2.6: Spawn 5 Blast-Radius Analysis Agents
604
-
605
- Launch all 5 agents **in parallel** using the Task tool. Pass the
606
- `CHANGE_MANIFEST` from Step 2.5 into each prompt so agents see the same ground
607
- truth.
608
-
609
- ### Agent 8: Change Graph / Ripple Analyzer
610
-
611
- ```
612
- Task: subagent_type="codebase-analyzer", model="sonnet"
613
- Prompt: "Blast-radius change-graph analysis for feature [FEATURE_NAME].
614
-
615
- Feature directory: {FEATURE_DIR}
616
- Change manifest (modified files): {CHANGE_MANIFEST.modifiedFiles}
617
- Submodules: {CHANGE_MANIFEST.submodules}
618
-
619
- Build a change-graph table for EVERY modified symbol (function, class, type,
620
- const) in the modified files:
621
- 1. List every direct importer/caller (file:line references).
622
- 2. Classify each as Direct (imports the symbol) or Transitive (imports a
623
- re-export of it) or Runtime (dynamic require / reflection).
624
- 3. Flag any cross-submodule ripple (symbol defined in submodule A, consumed
625
- in submodule B) — this is Red if unplanned.
626
- 4. Flag any consumer whose tests do NOT exercise the changed code path —
627
- Yellow.
628
- 5. Count orphan changes (modified code with zero importers) — Gray.
629
-
630
- Return findings with Red/Yellow/Gray severity and a concise ripple summary
631
- (<2500 tokens). Output sections: 'Ripple Summary', 'Cross-submodule Crossings',
632
- 'Consumer Coverage Gaps', 'Orphans'."
633
- ```
634
-
635
- ### Agent 9: Interface Contract Diff
636
-
637
- ```
638
- Task: subagent_type="validation-integration", model="sonnet"
639
- Prompt: "Interface contract blast-radius analysis for feature [FEATURE_NAME].
640
-
641
- Feature directory: {FEATURE_DIR}
642
- Public-surface manifest: {CHANGE_MANIFEST.publicSurface}
643
- Contracts directory: {FEATURE_DIR}/contracts (if present)
644
-
645
- For every public export, package.json exports field entry, contract file,
646
- and .d.ts symbol that was modified, deleted, or added:
647
- 1. Diff old signature vs new signature (parameters, return types, generics,
648
- optional vs required, default values).
649
- 2. Classify each change:
650
- - BREAKING: removed export, renamed export, narrowed return type, widened
651
- required-param set, removed optional param callers rely on.
652
- - ADDITIVE: new export, new optional param, widened return type.
653
- - NEUTRAL: implementation change with identical signature.
654
- 3. Red = any BREAKING change without a corresponding entry in CHANGELOG.md
655
- or a migration note in the spec.
656
- 4. Yellow = BREAKING change with CHANGELOG entry but no migration guide.
657
- 5. Gray = ADDITIVE changes for informational tracking.
658
-
659
- Verify contract tests still cover all pre-existing contract clauses (no
660
- silent coverage regression). Return findings (<2000 tokens) with sections:
661
- 'Breaking Changes', 'Additive Changes', 'Contract Coverage Regression'."
662
- ```
663
-
664
- ### Agent 10: Error Logging & Observability Integrity
665
-
666
- ```
667
- Task: subagent_type="validation-standards", model="sonnet"
668
- Prompt: "Observability blast-radius analysis for feature [FEATURE_NAME].
669
-
670
- Feature directory: {FEATURE_DIR}
671
- Modified files: {CHANGE_MANIFEST.modifiedFiles}
672
-
673
- Assess whether observability was preserved, degraded, or improved:
674
- 1. For every new/modified catch block: does it log? Use the same structured
675
- logger used elsewhere in the repo (detect the logger by scanning for
676
- common imports: winston, pino, bunyan, console, vscode.window.showError,
677
- telemetry module). Red if any catch swallows silently in production code.
678
- 2. For every removed log statement: is removal justified by a comment or
679
- spec? Red if production-relevant logs disappeared without justification.
680
- 3. Log-level hygiene: no `console.log` in production code (test files
681
- exempt); no debug-level logs left at info/warn level.
682
- 4. PII / secrets leakage in new log messages — Red if detected.
683
- 5. Telemetry/metrics coverage: if the feature touched hot paths that
684
- previously emitted metrics, verify emission is preserved.
685
- 6. Correlation IDs / trace context propagation: if the repo uses them,
686
- verify new code paths propagate them.
687
-
688
- Return findings (<2000 tokens) with sections: 'Silent Failures', 'Removed
689
- Logs', 'PII Risk', 'Metric Coverage Delta', 'Trace Propagation'."
690
- ```
691
-
692
- ### Agent 11: Dependency & Submodule Impact (with npm audit delta)
693
-
694
- ```
695
- Task: subagent_type="research-dependency-evaluator", model="haiku"
696
- Prompt: "Dependency and submodule blast-radius analysis for feature
697
- [FEATURE_NAME].
698
-
699
- Dependency manifest diff: {CHANGE_MANIFEST.dependencyDiff}
700
- Submodules affected: {CHANGE_MANIFEST.submodules}
701
-
702
- 1. New dependencies: list each with source (npm / git / local), license, and
703
- bundle-size impact (approx). Red if license is incompatible (GPL/AGPL in
704
- a permissive-licensed repo), or if the package is unmaintained (>2 years
705
- since last release, <1000 weekly downloads).
706
- 2. Version bumps: classify as major / minor / patch. Red for major bumps
707
- without migration notes.
708
- 3. Lockfile churn: if package.json is unchanged but package-lock.json
709
- changed materially (>20 lines), flag as Yellow (indirect dep drift).
710
- 4. npm audit delta: run `npm audit --json 2>/dev/null` on the current branch
711
- and compare vulnerability counts vs baseline (main). Red if the branch
712
- adds any new High or Critical CVE. Yellow for new Moderate. Gray for new
713
- Low.
714
- 5. Submodule boundary crossings: if the feature modifies code in multiple
715
- submodules (extension/, language-server/, docs/), verify each submodule
716
- independently builds and tests. Red if a cross-submodule change breaks
717
- any submodule's standalone build.
718
-
719
- Return findings (<2500 tokens) with sections: 'New Dependencies', 'Version
720
- Bumps', 'Lockfile Drift', 'CVE Delta', 'Submodule Boundary Crossings'."
721
- ```
722
-
723
- ### Agent 12: Rollback Readiness & Release Checklist
724
-
725
- ```
726
- Task: subagent_type="tasks-rollback-planner", model="haiku"
727
- Prompt: "Rollback readiness + release-checklist review for feature
728
- [FEATURE_NAME].
729
-
730
- Feature directory: {FEATURE_DIR}
731
- Rollback assets: {CHANGE_MANIFEST.rollbackAssets}
732
-
733
- Assess reversibility and release readiness:
734
- 1. DB migrations: is every forward migration paired with a down/reverse
735
- migration? Red if any irreversible migration lacks explicit justification
736
- in the spec or plan.
737
- 2. Feature flags: if the feature is risky, is it gated behind a flag? Is the
738
- flag default-off? Is the pre-flag code path preserved so disabling the
739
- flag restores prior behavior? Red if a risky change is unflagged and
740
- irreversible.
741
- 3. Data-shape changes: detect schema changes that cannot be rolled back
742
- without data loss (column drops, type narrowings). Red if no backfill or
743
- dual-write strategy.
744
- 4. Release checklist for user-visible changes:
745
- - CHANGELOG.md updated for this feature — Red if missing and feature is
746
- user-visible.
747
- - Version bump planned (semver correct for breaking/additive/patch) — Red
748
- if breaking change present without major bump plan.
749
- - Migration guide present for breaking changes — Red if missing.
750
- - Documentation updated (docs/ or README.md) for new user-facing
751
- capabilities — Yellow if missing.
752
- 5. Rollback runbook: is there a documented 'how to revert' path? Yellow if
753
- absent for non-trivial changes.
754
-
755
- Return findings (<2000 tokens) with sections: 'Migration Reversibility',
756
- 'Feature Flag Coverage', 'Data-Shape Rollback Risk', 'Release Checklist',
757
- 'Rollback Runbook'."
758
- ```
759
-
760
- **Run all 5 Phase B agents in parallel.** Collect results before synthesis.
761
-
762
- ---
763
-
764
- ## Step 2.7: Blast Radius Synthesis
765
-
766
- Aggregate Phase B agent findings into a single blast-radius verdict.
767
-
768
- ### Consolidated Finding Table
769
-
770
- ```
771
- | # | Dimension | Finding | Severity | Agent | File | Line |
772
- |---|-----------|---------|----------|-------|------|------|
773
- | 1 | Change graph | [desc] | Red | codebase-analyzer | [file] | [line] |
774
- | 2 | Interface contract | [desc] | Red | validation-integration | [file] | [line] |
775
- | 3 | Observability | [desc] | Yellow | validation-standards | [file] | [line] |
776
- | 4 | Dependency | [desc] | Yellow | research-dependency-evaluator | [file] | [line] |
777
- | 5 | Rollback | [desc] | Red | tasks-rollback-planner | [file] | [line] |
778
- ```
779
-
780
- ### Severity Rollup
781
-
782
- ```
783
- BLAST_RADIUS_RED = count of Red findings across all 5 agents
784
- BLAST_RADIUS_YELLOW = count of Yellow findings
785
- BLAST_RADIUS_GRAY = count of Gray findings
786
- ```
787
-
788
- ### Write `blast-radius-report.md`
789
-
790
- Write to `{FEATURE_DIR}/blast-radius-report.md`:
791
-
792
- ```markdown
793
- ---
794
- feature: [Feature Name]
795
- generated: [ISO timestamp]
796
- reviewer: Claude
797
- GeneratedAt: [ISO timestamp]
798
- SourceCommandId: /6_gofer_validate
799
- SourceInputs: [spec.md, plan.md, tasks.md, research.md, blast-radius inputs]
800
- OverwriteNoticeWhenApplicable: [new file or overwrite note]
801
- dimensions_checked:
802
- [
803
- change_graph,
804
- interface_contract,
805
- observability,
806
- dependency_submodule,
807
- rollback_release,
808
- ]
809
- red_count: [N]
810
- yellow_count: [N]
811
- gray_count: [N]
812
- verdict: [CONTAINED | BREACHED]
813
- ---
814
-
815
- # Blast Radius Report: [Feature Name]
816
-
817
- ## Changed Surfaces
818
-
819
- - Modified files: [N]
820
- - Submodules touched: [list]
821
- - Public-surface symbols affected: [N]
822
- - New dependencies: [N]
823
- - Version bumps: [list]
824
- - Migration files: [list]
825
- - Feature flags introduced/modified: [list]
826
-
827
- ## Risk Vectors
828
-
829
- ### 1. Change Graph / Ripple (Agent: codebase-analyzer)
830
-
831
- - Cross-submodule crossings: [list or "none"]
832
- - Consumer coverage gaps: [N]
833
- - Orphan changes: [N]
834
- - Red findings: [table]
835
-
836
- ### 2. Interface Contracts (Agent: validation-integration)
837
-
838
- - Breaking changes: [N] ([list])
839
- - Additive changes: [N]
840
- - Contract coverage regressions: [list]
841
- - Red findings: [table]
842
-
843
- ### 3. Error Logging & Observability (Agent: validation-standards)
844
-
845
- - Silent failures introduced: [N]
846
- - Logs removed without justification: [N]
847
- - PII/secret leakage risk: [list]
848
- - Metric/trace coverage delta: [summary]
849
- - Red findings: [table]
850
-
851
- ### 4. Dependencies & Submodules (Agent: research-dependency-evaluator)
852
-
853
- - New dependencies: [table with license/size/maintenance]
854
- - Version bumps: [list]
855
- - Lockfile drift: [summary]
856
- - CVE delta: Critical +[N], High +[N], Moderate +[N], Low +[N]
857
- - Submodule boundary crossings: [list]
858
- - Red findings: [table]
859
-
860
- ### 5. Rollback Readiness & Release Checklist (Agent: tasks-rollback-planner)
861
-
862
- - Migration reversibility: [OK / BREACHED]
863
- - Feature flag coverage: [OK / BREACHED / N/A]
864
- - Data-shape rollback risk: [OK / BREACHED]
865
- - Release checklist:
866
- - CHANGELOG updated: [Yes / No / N/A]
867
- - Version bump planned: [patch / minor / major / N/A]
868
- - Migration guide: [Yes / No / N/A]
869
- - Docs updated: [Yes / No / N/A]
870
- - Rollback runbook: [Present / Absent / N/A]
871
- - Red findings: [table]
872
-
873
- ## Containment Summary
874
-
875
- - **CONTAINED** if `BLAST_RADIUS_RED == 0` — Category 11 scores full 10 pts.
876
- - **BREACHED** if `BLAST_RADIUS_RED > 0` — Category 11 scores 0.
877
-
878
- Yellow findings do NOT fail Category 11 but are reported to the engineering
879
- review loop (Phase C) for mandatory attention.
880
- ```
881
-
882
- Proceed to Step 3 (automated checks) with blast-radius results attached to the
883
- context.
884
-
885
- ---
886
-
887
- # End of Phase B
888
-
889
- ---
890
-
891
- ## Step 3: Run Automated Checks
892
-
893
- Execute verification commands and capture results:
894
-
895
- ### Build Check
896
-
897
- ```bash
898
- npm run build # or appropriate build command
899
- ```
900
-
901
- ### Test Check
902
-
903
- ```bash
904
- npm test # or appropriate test command
905
- ```
906
-
907
- ### Lint Check
908
-
909
- ```bash
910
- npm run lint # or appropriate lint command
911
- ```
912
-
913
- ### Type Check (if TypeScript)
914
-
915
- ```bash
916
- npm run typecheck # or tsc --noEmit
917
- ```
918
-
919
- Record results:
920
-
921
- ```
922
- | Check | Command | Result |
923
- |-----------|------------------|---------------|
924
- | Build | npm run build | PASS / FAIL |
925
- | Tests | npm test | PASS / FAIL |
926
- | Lint | npm run lint | PASS / FAIL |
927
- | TypeCheck | tsc --noEmit | PASS / FAIL |
928
- ```
929
-
930
- **If Build or Tests FAIL**: Mark Functional Correctness as 0 immediately.
931
-
932
- ---
933
-
934
- ## Step 4: Mutation Testing Gate
935
-
936
- Check if mutation testing tools are available:
937
-
938
- ```bash
939
- npx stryker --version 2>/dev/null
940
- ```
941
-
942
- ### If Stryker is available:
943
-
944
- 1. Run mutation testing:
945
- ```bash
946
- npx stryker run --reporters clear-text 2>&1 | tail -50
947
- ```
948
- 2. Parse mutation score from output
949
- 3. Record: `MUTATION_SCORE = [N]%`
950
- 4. If score < 60%: contributes to Test Authenticity scoring 0
951
-
952
- ### If Stryker is NOT available:
953
-
954
- 1. Record: `MUTATION_SCORE = "unavailable"`
955
- 2. Log recommendation: "Install @stryker-mutator/core for mutation testing"
956
- 3. Test Authenticity is scored based on other criteria only (placeholders,
957
- skips, mock ratio)
958
- 4. Do NOT block on mutation score when Stryker is absent
959
-
960
- ---
961
-
962
- ## Step 5: Mock Ratio Analysis
963
-
964
- Count mocking patterns vs real assertions across feature test files:
965
-
966
- ### Count Mock Calls
967
-
968
- Use Grep to count in test files related to the feature:
969
-
970
- - `vi.mock(` — module-level mocks
971
- - `vi.fn(` — individual function mocks
972
- - `jest.mock(` — Jest module mocks
973
- - `jest.fn(` — Jest function mocks
974
- - `.mockReturnValue(` — mock configurations
975
- - `.mockResolvedValue(` — async mock configurations
976
-
977
- ### Count Real Assertions
978
-
979
- Use Grep to count:
980
-
981
- - `expect(` followed by `.toBe(`, `.toEqual(`, `.toContain(`, `.toThrow(`,
982
- `.toMatch(`, `.toBeGreaterThan(`, `.toBeLessThan(`, `.toBeDefined(`,
983
- `.toBeNull(`, `.toHaveLength(`, `.toHaveProperty(`
984
-
985
- ### Exclude Justified Mocks
986
-
987
- Lines containing `// mock-justified:` are excluded from the mock count. This
988
- allows VSCode API mocks and other unavoidable mocks to be documented and exempt.
989
-
990
- ### Calculate Ratio
991
-
992
- ```
993
- MOCK_RATIO = mock_calls / (mock_calls + real_assertions)
994
- ```
995
-
996
- ### Evaluate
997
-
998
- - If `MOCK_RATIO > 0.30` (30%): contributes to Test Authenticity scoring 0
999
- - Report per-file ratios for the worst offenders
1000
-
1001
- ---
1002
-
1003
- ## Step 6: Semantic Slop Detection
1004
-
1005
- ### Automated Pattern Detection (Grep-based)
1006
-
1007
- Run these checks on new/modified source files (not test files):
1008
-
1009
- #### Red Severity (Blocks)
1010
-
1011
- ```
1012
- Pattern: expect(true).toBe(true)
1013
- Also: expect(1).toBe(1), expect('a').toBe('a')
1014
- Method: Grep for tautological assertions in test files
1015
- ```
1016
-
1017
- ```
1018
- Pattern: test.skip / it.skip / describe.skip / xit / xdescribe
1019
- Method: Grep for skip patterns in feature-related test files
1020
- ```
1021
-
1022
- #### Yellow Severity (Must Address)
1023
-
1024
- ```
1025
- Pattern: TODO / FIXME / XXX / HACK in source code (not test helpers)
1026
- Method: Grep in new/modified .ts/.js/.py files
1027
- ```
1028
-
1029
- ```
1030
- Pattern: Empty catch blocks — catch (e) {} or catch { }
1031
- Method: Grep for catch blocks with empty or whitespace-only bodies
1032
- ```
1033
-
1034
- #### Gray Severity (Informational)
1035
-
1036
- Gray-level findings are reported by the specialist agents (Standards and Test
1037
- Quality). They include:
1038
-
1039
- - Redundant comments restating code (agent: validation-standards)
1040
- - Over-engineered abstractions for one-time use (agent: validation-standards)
1041
- - Magic numbers without named constants (agent: validation-standards)
1042
- - Mock-only tests that verify wiring not behavior (agent:
1043
- validation-test-quality)
1044
-
1045
- ### Consolidate Slop Findings
1046
-
1047
- Combine automated Grep results with agent findings:
1048
-
1049
- ```
1050
- | # | Pattern | Severity | Source | Description | File | Line |
1051
- |---|---------|----------|--------|-------------|------|------|
1052
- | 1 | Placeholder test | Red | Grep | expect(true).toBe(true) | test.ts | 45 |
1053
- | 2 | Skipped test | Red | Grep | it.skip('should...') | spec.ts | 12 |
1054
- | 3 | TODO placeholder | Yellow | Grep | // TODO: implement | service.ts | 89 |
1055
- | 4 | Redundant comment | Yellow | Agent | "// create user" above createUser() | user.ts | 23 |
1056
- ```
1057
-
1058
- ---
1059
-
1060
- ## Step 7: Score the 10-Category Rubric
1061
-
1062
- Using agent reports, automated checks, and analysis from Steps 3-6, score each
1063
- category:
1064
-
1065
- ### Scoring Logic
1066
-
1067
- **Category 1: Functional Correctness** ({15 or 20 if no UI} pts)
1068
-
1069
- - Input: validation-correctness agent report + `GATE-2` + automated test results
1070
- - Score 0 if: `GATE-2` fails, OR any Red finding from correctness agent, OR
1071
- build/tests fail, OR tests fail to import
1072
- - Score full if: All acceptance criteria verified with real tests
1073
-
1074
- **Category 2: Test Authenticity** ({15 or 20 if no UI} pts)
1075
-
1076
- - Input: validation-test-quality agent report + `GATE-2` + mutation score +
1077
- mock ratio
1078
- - Score 0 if: Any placeholder assertion found, OR any test.skip found, OR mock
1079
- ratio > 30%, OR mutation score < 60% (when Stryker available), OR
1080
- `GATE-2` fails
1081
- - Score full if: Zero placeholders, zero skips, mock ratio <= 30%
1082
-
1083
- **Category 3: UI/E2E Verification** (10 pts, or 0 if redistributed)
1084
-
1085
- - If `HAS_UI = false`: Record `N/A — HAS_UI=false` plus an explicit not-in-scope
1086
- reason in the evidence table and apply the existing no-UI redistribution.
1087
- - If `HAS_UI = true` and `DEPLOY_IN_SCOPE = false`: Check `GATE-3` for local
1088
- render proof and record `Render proof only — deployment target not in scope`
1089
- when that proof exists. Score 0 if `GATE-3` fails or no local render proof
1090
- exists. Do not redistribute Category 3 points.
1091
- - If `HAS_UI = true` and `DEPLOY_IN_SCOPE = true`: Check `GATE-3` for
1092
- screenshot, curl/HTTP transcript, deployment log, headless browser
1093
- assertion, or smoke-check output with proof of rendered/live behavior on the
1094
- declared route or target. Score 0 if `GATE-3` fails or no real render/deploy
1095
- proof exists.
1096
-
1097
- **Category 4: Security Posture** (10 pts)
1098
-
1099
- - Input: validation-security agent report
1100
- - Score 0 if: Any Red finding from security agent
1101
- - Score full if: No Red or Yellow findings
1102
-
1103
- **Category 5: Integration Reality** (10 pts)
1104
-
1105
- - Input: validation-integration agent report + `GATE-1`
1106
- - Score 0 if: `GATE-1` fails, OR any contract violation, OR critical boundary
1107
- with zero tests
1108
- - Score full if: All contracts satisfied, integration tests use real deps
1109
-
1110
- **Category 6: Error Path Coverage** (10 pts)
1111
-
1112
- - Input: validation-correctness agent (error paths) + validation-standards agent
1113
- (empty catch blocks)
1114
- - Score 0 if: Empty catch blocks found, OR public functions lack error path
1115
- tests
1116
- - Score full if: Error paths tested, catch blocks handle errors properly
1117
-
1118
- **Category 7: Architecture Compliance** (10 pts)
1119
-
1120
- - Input: validation-standards agent report (architecture section)
1121
- - Score 0 if: File structure deviates from plan.md without justification, OR
1122
- required diagrams/pictures are stale, unreadable, unrendered without fallback,
1123
- disconnected from the requirements/code/EAI Platform evidence they explain, OR
1124
- human-facing artifacts lack a plain-language executive summary
1125
- - Score full if: All files in expected locations, patterns followed
1126
-
1127
- **Visual And Document Comprehension Gate** (part of Category 7, no extra points):
1128
-
1129
- Use this gate whenever the feature has architecture, process, security,
1130
- workflow, data, UI, or EAI Platform behavior that a human reviewer or future AI
1131
- loop must understand. This is benchmarked against C4-style abstraction levels,
1132
- diagram-as-code/source-controlled visuals, 8090-style requirement/blueprint
1133
- alignment, Marp-style narrative decks, and UI proof practices such as screenshot
1134
- or visual-test evidence.
1135
-
1136
- - Executive summaries: every human-facing document starts with three to five
1137
- plain-language bullets that cover the decision, value, risk, evidence, and next
1138
- ask. Technical detail comes after the summary.
1139
- - Purpose clarity: every visual states the question it answers, audience,
1140
- source inputs, and how to read it in plain language.
1141
- - Simplicity: each diagram focuses on one decision or flow, keeps primary
1142
- nodes/steps to about seven or fewer where practical, and splits crowded
1143
- diagrams instead of making a spaghetti map.
1144
- - Correct visual type: use context/container C4 views for system boundaries,
1145
- sequence/state diagrams for flows, ERD for data, value stream for process,
1146
- heatmaps for capability/risk priority, and screenshot/storyboard evidence for
1147
- UI behavior.
1148
- - Renderability: Mermaid/D2/Structurizr-style source must render locally or
1149
- provide a markdown-table/text fallback; Marp decks must be valid Markdown with
1150
- slide frontmatter; UI visuals need screenshot, Storybook/component,
1151
- Playwright, or equivalent render proof.
1152
- - Traceability: each visual links to the requirement, plan, contract, code/test,
1153
- EAI service/template asset, or validation evidence it summarizes.
1154
- - Freshness: validation must check whether visuals changed or were reapproved
1155
- after spec, plan, code, workspace/auth, or validation changes; stale visuals fail
1156
- Category 7 even when the code passes.
1157
- - Public safety: visuals must not expose workspace-private data, secrets, customer
1158
- identifiers, internal-only architecture names, or screenshots containing
1159
- private content.
1160
-
1161
- **Category 8: Performance Baseline** (5 pts)
1162
-
1163
- - Input: validation-performance agent report
1164
- - Score 0 if: Sync I/O in async paths, OR complexity > 12, OR unbounded loops
1165
- - Score full if: No blocking performance findings
1166
-
1167
- **Category 9: Code Hygiene** (10 pts)
1168
-
1169
- - Input: validation-standards agent report (hygiene section) + slop detection
1170
- - Score 0 if: TODO placeholders in production code, OR > 5 redundant comments,
1171
- OR silent error swallowing found
1172
- - Score full if: Clean code, no slop findings above Gray
1173
-
1174
- **Category 10: Specification Traceability** (5 pts)
1175
-
1176
- - Input: validation-correctness agent (criteria mapping)
1177
- - Score 0 if: User stories cannot be traced to tests and code
1178
- - Score full if: Every US has tests, every test maps to implementing code
1179
-
1180
- **Category 11: Blast Radius Containment** (10 pts) — NEW
1181
-
1182
- - Input: Phase B blast-radius-report.md (Agents 8-12)
1183
- - Score 0 if **any** of:
1184
- - `BLAST_RADIUS_RED > 0` (verdict BREACHED in blast-radius-report.md), OR
1185
- - Interface Contract Diff found a BREAKING change without CHANGELOG entry, OR
1186
- - Observability agent found a silent failure in production code, OR
1187
- - Dependency agent reports a new High or Critical CVE, OR
1188
- - Rollback agent reports an irreversible migration without justification, OR
1189
- - Cross-submodule ripple detected that was not planned in plan.md
1190
- - Score full (10) if: `BLAST_RADIUS_RED == 0` — verdict CONTAINED in
1191
- blast-radius-report.md. Yellow/Gray findings do not block the category but are
1192
- forwarded to Phase C for attention.
1193
-
1194
- ### Calculate Total Score
1195
-
1196
- ```
1197
- TOTAL = Cat1 + Cat2 + Cat3 + ... + Cat10 + Cat11
1198
- ```
1199
-
1200
- Must equal **110** to PASS (no-UI features: Cat3 redistributes +5 to Cat1 and +5
1201
- to Cat2; total is still 110).
1202
-
1203
- ---
1204
-
1205
- ## Step 7.4: Two-Pass Canvas Refresh (Impact Canvas)
1206
-
1207
- After the validation council completes, refresh the Impact Canvas with
1208
- validation findings. This is a SURGICAL update: only the `topThreeRisks` slot of
1209
- `impact-canvas.md` is replaced; all other canvas content (header, problem
1210
- statement, personas, AI-leverage pie, outcomes) is preserved byte-for-byte. The
1211
- frontmatter `pass:` marker is bumped from 1 to 2 so downstream consumers can
1212
- tell which pass produced the artefact.
1213
-
1214
- ```
1215
- Task: subagent_type="visual-canvas-writer", model="haiku"
1216
- Prompt: "Pass-2 refresh for {FEATURE_DIR}/visuals/impact-canvas.md.
1217
- Read validation council output from {FEATURE_DIR}/validation.md.
1218
- Replace ONLY the topThreeRisks section with the council's top three risks.
1219
- Preserve all other content byte-for-byte.
1220
-
1221
- Use the runPass2() helper at .specify/scripts/node/lib/visual-pass-pipeline.mjs
1222
- which implements the surgical replacement (regex-bounded swap of the
1223
- '## Top Three Risks' section + frontmatter pass: 1 -> 2 bump).
1224
-
1225
- Return: absolute path of file written and the three risk strings used."
1226
- ```
1227
-
1228
- The `runPass2()` function in
1229
- `.specify/scripts/node/lib/visual-pass-pipeline.mjs` already implements the
1230
- surgical replacement; the writer agent only needs to provide the three
1231
- council-validated risk strings. This satisfies FR-016 (two-pass canvas refresh)
1232
- and the locked decision recorded in `plan.md:912-919`.
1233
-
1234
- ---
1235
-
1236
- ## Step 7.5: Refresh Risk Heatmap (Persona Pack — US4)
1237
-
1238
- After the rubric is scored and validation council findings are available,
1239
- dispatch `visual-risk-writer` in **pass-2 mode** to refresh the risk heatmap
1240
- with critical risks identified by the council. This replaces the heuristic
1241
- top-quadrant entries that pass-1 (run from this same stage before validation)
1242
- populated from the spec NFR / Out-of-Scope sections.
1243
-
1244
- ```
1245
- Task: subagent_type="visual-risk-writer", model="haiku"
1246
- Prompt: "Pass 2: refresh risk heatmap for feature [FEATURE_NAME].
1247
-
1248
- Feature directory: {FEATURE_DIR}
1249
- Spec: {FEATURE_DIR}/spec.md
1250
- Validation council findings: {FEATURE_DIR}/validation-report.md (in-progress)
1251
- Existing heatmap (pass-1): {FEATURE_DIR}/visuals/risk-heatmap.md
1252
- Template: .specify/templates/visuals/risk-heatmap-template.md
1253
-
1254
- Replace top-quadrant risks with the validation council's critical findings.
1255
- Preserve pass-1 risks that did not surface in validation.
1256
- Honour ≥30 ≤200 word plain-language preamble (NFR-010).
1257
-
1258
- Return: absolute path of file written and risk counts per quadrant."
1259
- ```
1260
-
1261
- The validation report (Step 8) MUST link to the refreshed risk heatmap under its
1262
- `## Risk Posture` section. If the Mermaid renderer fails for a downstream
1263
- consumer, the `mermaid-tabular-fallback.mjs` helper provides a markdown-table
1264
- fallback for the `quadrantChart` block.
1265
-
1266
- ---
1267
-
1268
- ## Step 8: Generate Validation Report
1269
-
1270
- Write to `{FEATURE_DIR}/validation-report.md`:
1271
-
1272
- ```markdown
1273
- ---
1274
- feature: [Feature Name]
1275
- validated: [ISO timestamp]
1276
- validator: Claude
1277
- status: [PASS/FAIL]
1278
- score: [N]
1279
- score_max: 110
1280
- iteration: [N]
1281
- has_ui: [true/false]
1282
- deploy_in_scope: [true/false]
1283
- objective_gate_status: [PASS/FAIL]
1284
- goal_rebaseline_report: goal-rebaseline-report.md
1285
- loop_audit_report: loop-audit-report.md
1286
- blast_radius_verdict: [CONTAINED | BREACHED]
1287
- blast_radius_report: blast-radius-report.md
1288
- GeneratedAt: [ISO timestamp]
1289
- SourceCommandId: /6_gofer_validate
1290
- SourceInputs: [spec.md, plan.md, tasks.md, research.md, automated checks, agent findings]
1291
- OverwriteNoticeWhenApplicable: [new file or overwrite note]
1292
- ---
1293
-
1294
- # Validation Report: [Feature Name]
1295
-
1296
- ## Objective Outcome Gate
1297
-
1298
- - Goal ledger: `goal-ledger.json`
1299
- - Rebaseline report: `goal-rebaseline-report.md`
1300
- - Loop contract: `loop-contract.json`
1301
- - Loop ledger: `loop-ledger.jsonl`
1302
- - Loop audit report: `loop-audit-report.md`
1303
- - Outcome gate status: [PASS/FAIL]
1304
- - Recommended reopen stage: [none | 2_specify | 3_plan | 4_tasks | 6_validate]
1305
- - Summary: [why objectives remain aligned or why the loop must reopen]
1306
-
1307
- ## Rubric Score
1308
-
1309
- | # | Category | Points | Score | Status | Evidence |
1310
- | --- | -------------------------- | ------- | ---------- | --------------- | --------- |
1311
- | 1 | Functional Correctness | [15/20] | [0/15/20] | PASS/FAIL | [summary] |
1312
- | 2 | Test Authenticity | [15/20] | [0/15/20] | PASS/FAIL | [summary] |
1313
- | 3 | UI/E2E Verification | [10/0] | [0/10/N/A] | PASS/FAIL/SKIP | [summary] |
1314
- | 4 | Security Posture | 10 | [0/10] | PASS/FAIL | [summary] |
1315
- | 5 | Integration Reality | 10 | [0/10] | PASS/FAIL | [summary] |
1316
- | 6 | Error Path Coverage | 10 | [0/10] | PASS/FAIL | [summary] |
1317
- | 7 | Architecture Compliance | 10 | [0/10] | PASS/FAIL | [summary] |
1318
- | 8 | Performance Baseline | 5 | [0/5] | PASS/FAIL | [summary] |
1319
- | 9 | Code Hygiene | 10 | [0/10] | PASS/FAIL | [summary] |
1320
- | 10 | Specification Traceability | 5 | [0/5] | PASS/FAIL | [summary] |
1321
- | 11 | Blast Radius Containment | 10 | [0/10] | PASS/FAIL | [summary] |
1322
- | | **TOTAL** | **110** | **[N]** | **[PASS/FAIL]** | |
1323
-
1324
- ## Automated Check Results
1325
-
1326
- | Check | Command | Result |
1327
- | --------- | ------------- | ------------------- |
1328
- | Build | npm run build | [PASS/FAIL] |
1329
- | Tests | npm test | [PASS/FAIL] |
1330
- | Lint | npm run lint | [PASS/FAIL + count] |
1331
- | TypeCheck | tsc --noEmit | [PASS/FAIL] |
1332
-
1333
- ## Closed-Loop Traceability
1334
-
1335
- | Requirement ID | Goal ID | Code Evidence | Test Evidence | Status |
1336
- | -------------- | ------- | ------------- | ------------- | ------ |
1337
- | [FR-001] | [G1] | [path] | [path] | [PASS/FAIL] |
1338
-
1339
- ## Mutation Testing
1340
-
1341
- - **Stryker available**: [Yes/No]
1342
- - **Mutation score**: [N]% (target: >= 60%)
1343
-
1344
- ## Mock Ratio Analysis
1345
-
1346
- - **Total mock calls**: [N]
1347
- - **Total real assertions**: [N]
1348
- - **Mock ratio**: [N]% (target: <= 30%)
1349
- - **Justified mocks excluded**: [N]
1350
-
1351
- ### Worst Offenders by File
1352
-
1353
- | File | Mocks | Assertions | Ratio | Status |
1354
- | ------ | ----- | ---------- | ----- | ------- |
1355
- | [file] | [N] | [N] | [N]% | OK/FAIL |
1356
-
1357
- ## Specialist Agent Findings
1358
-
1359
- ### Red (Blocking)
1360
-
1361
- | # | Category | Finding | File | Line |
1362
- | --- | ---------- | ------------- | ------ | ------ |
1363
- | [N] | [category] | [description] | [file] | [line] |
1364
-
1365
- ### Yellow (Must Address)
1366
-
1367
- | # | Category | Finding | File | Line |
1368
- | --- | ---------- | ------------- | ------ | ------ |
1369
- | [N] | [category] | [description] | [file] | [line] |
1370
-
1371
- ### Gray (Informational)
1372
-
1373
- | # | Category | Finding | File | Line |
1374
- | --- | ---------- | ------------- | ------ | ------ |
1375
- | [N] | [category] | [description] | [file] | [line] |
1376
-
1377
- ## AI Slop Detection Summary
1378
-
1379
- | Pattern | Count | Severity |
1380
- | ---------------------------- | ----- | -------- |
1381
- | Placeholder assertions | [N] | Red |
1382
- | Skipped tests | [N] | Red |
1383
- | TODO/FIXME placeholders | [N] | Yellow |
1384
- | Empty catch blocks | [N] | Yellow |
1385
- | Redundant comments | [N] | Yellow |
1386
- | Over-engineered abstractions | [N] | Gray |
1387
- | Magic numbers | [N] | Gray |
1388
-
1389
- ## Blast Radius Summary (Phase B)
1390
-
1391
- See `{FEATURE_DIR}/blast-radius-report.md` for the full dimension report.
1392
-
1393
- | Dimension | Agent | Red | Yellow | Gray | Verdict |
1394
- | ----------------------------------- | ----------------------------- | --- | ------ | ---- | ------------------------ |
1395
- | Change graph / ripple | codebase-analyzer | [N] | [N] | [N] | [OK/BREACHED] |
1396
- | Interface contracts | validation-integration | [N] | [N] | [N] | [OK/BREACHED] |
1397
- | Error logging & observability | validation-standards | [N] | [N] | [N] | [OK/BREACHED] |
1398
- | Dependency & submodule impact | research-dependency-evaluator | [N] | [N] | [N] | [OK/BREACHED] |
1399
- | Rollback readiness & release chklst | tasks-rollback-planner | [N] | [N] | [N] | [OK/BREACHED] |
1400
- | | **TOTAL** | [N] | [N] | [N] | **[CONTAINED/BREACHED]** |
1401
-
1402
- **Change Surface Summary**
1403
-
1404
- - Modified files: [N]
1405
- - Submodules touched: [list]
1406
- - Public-surface symbols modified: [N]
1407
- - Breaking API changes: [N]
1408
- - New dependencies: [N]
1409
- - New High/Critical CVEs: [N]
1410
- - Irreversible migrations: [N]
1411
- - CHANGELOG updated: [Yes/No/N/A]
1412
-
1413
- **Phase B Gate**: Cat 11 scores 10 only if verdict is **CONTAINED**.
1414
-
1415
- ## Spec Compliance
1416
-
1417
- ### [US1 Name]
1418
-
1419
- - [x/] Acceptance criterion 1
1420
- - [x/] Acceptance criterion 2
1421
-
1422
- ### [US2 Name]
1423
-
1424
- - [x/] Acceptance criterion 1
1425
-
1426
- ## Recommendations
1427
-
1428
- ### Before Merge (Must Fix)
1429
-
1430
- - [Red and Yellow findings requiring action]
1431
-
1432
- ### Future Improvements (Informational)
1433
-
1434
- - [Gray findings and suggestions]
1435
-
1436
- ## Evidence Table
1437
-
1438
- | Category | Score | Evidence Artifact / Command Output | Absent / Reason for 0 |
1439
- | --- | --- | --- | --- |
1440
- | 1 — Functional Correctness | [0/15/20] | [file path, executed `npm test` output with timestamp, or agent citation] | [reason if 0] |
1441
- | 2 — Test Authenticity | [0/15/20] | [file path, mutation output, or agent citation] | [reason if 0] |
1442
- | 3 — UI/E2E Verification | [0/10/N/A] | [`N/A — HAS_UI=false`, `Render proof only — deployment target not in scope`, or render/deploy artifact] | [reason if 0 or not in scope] |
1443
- | 4 — Security Posture | [0/10] | [agent finding citation] | [reason if 0] |
1444
- | 5 — Integration Reality | [0/10] | [runtime wiring proof, integration-test output, or agent citation] | [reason if 0] |
1445
- | 6 — Error Path Coverage | [0/10] | [agent finding citation] | [reason if 0] |
1446
- | 7 — Architecture Compliance | [0/10] | [agent finding citation] | [reason if 0] |
1447
- | 8 — Performance Baseline | [0/5] | [agent finding citation] | [reason if 0] |
1448
- | 9 — Code Hygiene | [0/10] | [agent finding citation] | [reason if 0] |
1449
- | 10 — Specification Traceability | [0/5] | [agent finding citation] | [reason if 0] |
1450
- | 11 — Blast Radius Containment | [0/10] | [blast-radius-report.md reference] | [reason if 0] |
1451
- | **Total** | **[N]/110** | | |
1452
- ```
1453
-
1454
- This evidence table is required on **EVERY run (PASS and FAIL)**.
1455
-
1456
- Each `Evidence Artifact / Command Output` cell MUST contain at least one of:
1457
-
1458
- - A file path visible in the current session
1459
- - An executed command and its real output (with timestamp)
1460
- - A sub-agent finding citation (agent name + finding ID)
1461
-
1462
- An empty evidence cell or a cell containing only inferences/assumptions MUST
1463
- cause that category to score 0.
1464
-
1465
- Category 11's evidence cell MUST cite `blast-radius-report.md`.
1466
-
1467
- When Category 3 is not in scope, the report preamble or row text MUST make the
1468
- redistribution explicit enough that normalization/effective contribution remains
1469
- derivable from the persisted report, and `Absent / Reason for 0` must record
1470
- the matching not-in-scope reason.
1471
-
1472
- ---
1473
-
1474
- ## Step 9: Determine Outcome
1475
-
1476
- ### If TOTAL = 110 and objective_gate_status = PASS: PASS (Phase A + B)
1477
-
1478
- ```
1479
- ════════════════════════════════════════════════════════════════
1480
- RUBRIC PASSED: [Feature Name]
1481
- ════════════════════════════════════════════════════════════════
1482
-
1483
- Score: 110/110
1484
-
1485
- Rubric:
1486
- ✓ Functional Correctness [15/20]/[15/20]
1487
- ✓ Test Authenticity [15/20]/[15/20]
1488
- ✓ UI/E2E Verification [10/10 or N/A]
1489
- ✓ Security Posture 10/10
1490
- ✓ Integration Reality 10/10
1491
- ✓ Error Path Coverage 10/10
1492
- ✓ Architecture Compliance 10/10
1493
- ✓ Performance Baseline 5/5
1494
- ✓ Code Hygiene 10/10
1495
- ✓ Specification Traceability 5/5
1496
- ✓ Blast Radius Containment 10/10
1497
-
1498
- Reports:
1499
- {FEATURE_DIR}/validation-report.md
1500
- {FEATURE_DIR}/blast-radius-report.md
1501
-
1502
- ════════════════════════════════════════════════════════════════
1503
- ```
1504
-
1505
- Proceed to **Phase C: Engineering Review Loop** (inline, Step 10a below), then
1506
- **Step 11: Attribution Logging** and **Step 12: Memory Update Check**.
1507
-
1508
- **No external auto-chain is needed** — Phase C runs inline in this command.
1509
- After Phase C completes, the feature pipeline is complete.
1510
-
1511
- ### If TOTAL < 110 or objective_gate_status = FAIL: FAIL
1512
-
1513
- Proceed to **Step 10: Brownfield Restart** (Phase C does not run when the rubric
1514
- fails — fix the rubric first).
1515
-
1516
- ---
1517
-
1518
- ## Step 10: Brownfield Restart Loop
1519
-
1520
- When validation fails (score < score_max), generate a remediation report and signal
1521
- the orchestrator to restart the pipeline focused on failed areas.
1522
-
1523
- ### 10.1 Check Iteration Count
1524
-
1525
- - If `ITERATION >= 3`: Generate **escalation report** instead (see 10.4)
1526
- - If `ITERATION < 3`: Generate **remediation report** and signal restart
1527
-
1528
- ### 10.2 Generate Remediation Report
1529
-
1530
- Write to `{FEATURE_DIR}/remediation-report.md`:
1531
-
1532
- ```markdown
1533
- ---
1534
- feature: [Feature Name]
1535
- iteration: [N]
1536
- score: [N]
1537
- score_max: 110
1538
- generated: [ISO timestamp]
1539
- failed_categories: [list]
1540
- ---
1541
-
1542
- # Remediation Report: [Feature Name]
1543
-
1544
- ## Iteration [N] of 3
1545
-
1546
- **Score**: [N]/110 **Status**: FAIL — Remediation Required
1547
-
1548
- ## Failed Categories
1549
-
1550
- ### [Category Name] (0/[points])
1551
-
1552
- **Evidence**: [Specific findings from agent reports]
1553
-
1554
- **Required Actions**:
1555
-
1556
- 1. [Specific action to fix this category]
1557
- 2. [Another specific action]
1558
-
1559
- **Files to modify**:
1560
-
1561
- - `path/to/file.ts:line` — [what to change]
1562
-
1563
- ### [Next Failed Category]
1564
-
1565
- ...
1566
-
1567
- ## Remediation Scope
1568
-
1569
- The following pipeline stages should re-run focused on these areas:
1570
-
1571
- - **Research**: [Any new research needed, or "Not needed"]
1572
- - **Plan**: [Any plan updates, or "Not needed"]
1573
- - **Implement**: [Specific tasks to re-implement]
1574
- - **Validate**: Re-run after fixes
1575
-
1576
- ## Previous Iterations
1577
-
1578
- | Iteration | Score | Failed Categories | Date |
1579
- | --------- | ------- | ----------------- | ------ |
1580
- | 1 | [N]/110 | [list] | [date] |
1581
- | 2 | [N]/110 | [list] | [date] |
1582
- ```
1583
-
1584
- ### 10.3 Signal Orchestrator
1585
-
1586
- Output the routing instruction:
1587
-
1588
- ```
1589
- ════════════════════════════════════════════════════════════════
1590
- VALIDATION FAILED: [Feature Name]
1591
- ════════════════════════════════════════════════════════════════
1592
-
1593
- Score: [N]/110
1594
- Iteration: [N] of 3
1595
-
1596
- Failed categories:
1597
- ✗ [Category] — 0/[points]: [brief reason]
1598
- ✗ [Category] — 0/[points]: [brief reason]
1599
-
1600
- Remediation report: {FEATURE_DIR}/remediation-report.md
1601
-
1602
- REMEDIATION REQUIRED: [feature-name]
1603
- Failed categories: [list]
1604
- Iteration: [N] of 3
1605
- Route: #5_gofer_implement → focused on [failed areas]
1606
-
1607
- ════════════════════════════════════════════════════════════════
1608
- ```
1609
-
1610
- Then proceed to **Step 11: Attribution Logging**.
1611
-
1612
- ### 10.4 Escalation (Iteration 3 Failure)
1613
-
1614
- If this is the 3rd iteration and validation still fails, generate
1615
- `{FEATURE_DIR}/escalation-report.md`:
1616
-
1617
- ```markdown
1618
- ---
1619
- feature: [Feature Name]
1620
- iteration: 3
1621
- final_score: [N]/110
1622
- escalated: [ISO timestamp]
1623
- ---
1624
-
1625
- # Escalation Report: [Feature Name]
1626
-
1627
- ## Human Review Required
1628
-
1629
- After 3 remediation attempts, the following categories still fail:
1630
-
1631
- ### [Category] — All 3 attempts failed
1632
-
1633
- **Iteration history**:
1634
-
1635
- 1. Score [N] — [what was tried]
1636
- 2. Score [N] — [what was tried]
1637
- 3. Score [N] — [what was tried]
1638
-
1639
- **Root cause assessment**: [Why automated remediation isn't working]
1640
-
1641
- **Recommended human action**: [What a developer should do]
1642
-
1643
- ## Full Score History
1644
-
1645
- | Iteration | Total | Cat1 | Cat2 | Cat3 | Cat4 | Cat5 | Cat6 | Cat7 | Cat8 | Cat9 | Cat10 | Cat11 |
1646
- | --------- | ----- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ----- | ----- |
1647
- | 1 | [N] | [N] | [N] | [N] | [N] | [N] | [N] | [N] | [N] | [N] | [N] | [N] |
1648
- | 2 | [N] | [N] | [N] | [N] | [N] | [N] | [N] | [N] | [N] | [N] | [N] | [N] |
1649
- | 3 | [N] | [N] | [N] | [N] | [N] | [N] | [N] | [N] | [N] | [N] | [N] | [N] |
1650
- ```
1651
-
1652
- Output:
1653
-
1654
- ```
1655
- ════════════════════════════════════════════════════════════════
1656
- ESCALATION: [Feature Name]
1657
- ════════════════════════════════════════════════════════════════
1658
-
1659
- After 3 remediation attempts, validation still fails.
1660
- Score: [N]/110
1661
-
1662
- Escalation report: {FEATURE_DIR}/escalation-report.md
1663
-
1664
- This feature requires human review before proceeding.
1665
- The automated pipeline cannot resolve the remaining issues.
1666
-
1667
- ════════════════════════════════════════════════════════════════
1668
- ```
1669
-
1670
- ---
1671
-
1672
- # Phase C — Engineering Review Loop
1673
-
1674
- Phase C runs **only when the rubric passes** (110/110). It performs 1-5
1675
- iterative review→fix→re-review cycles using 3 additional review agents per
1676
- cycle, catching issues that the rubric-based validation might miss (edge cases,
1677
- race conditions, API-contract drift against the as-implemented code, spec spirit
1678
- violations).
1679
-
1680
- Phase C is the terminal stage of `#6_gofer_validate`. After Phase C completes,
1681
- the feature pipeline is complete.
1682
-
1683
- ## Step 10a: Initialize Phase C
1684
-
1685
- 1. **Guard**: only proceed if rubric `status == PASS` and the objective outcome
1686
- gate passes (Step 9 TOTAL = 110 and Step 1.5 PASS). If
1687
- FAIL, skip Phase C entirely — brownfield restart (Step 10) already triggered.
1688
-
1689
- 2. **Initialize cycle counter**: `CYCLE = 1`
1690
-
1691
- 3. **Initialize findings history**: Empty array to accumulate across cycles.
1692
-
1693
- 4. **Seed findings from Phase B Yellow/Gray**: All Yellow findings from the
1694
- blast-radius report are added to the Phase C finding list for mandatory
1695
- attention. Gray findings are logged but not auto-fixed.
1696
-
1697
- ## Step 10b: Spawn 3 Parallel Review Agents (Cycle N of 5)
1698
-
1699
- Launch all 3 agents **in parallel** using the Task tool. Each agent receives the
1700
- feature context and returns structured findings.
1701
-
1702
- ### Agent 13: Engineer Review (Spec↔Plan↔Tasks↔Research Alignment)
1703
-
1704
- ```
1705
- Task: subagent_type="engineer-review", model="sonnet"
1706
- Prompt: "Post-implementation engineering review for feature [FEATURE_NAME].
1707
-
1708
- Feature directory: {FEATURE_DIR}
1709
- Spec: {FEATURE_DIR}/spec.md
1710
- Plan: {FEATURE_DIR}/plan.md
1711
- Tasks: {FEATURE_DIR}/tasks.md
1712
- Research: {FEATURE_DIR}/research.md
1713
-
1714
- This is a POST-IMPLEMENTATION review (code is already written).
1715
- In addition to your standard spec↔plan↔tasks alignment checks:
1716
- 1. Verify spec completeness against research.md — are all research findings addressed?
1717
- 2. Check all acceptance criteria are addressed in the actual code (not just tasks)
1718
- 3. Verify research.md patterns were followed in implementation
1719
-
1720
- Return findings in your standard report format (<2000 tokens)."
1721
- ```
1722
-
1723
- ### Agent 14: Codebase Analyzer (Code↔Tasks Verification)
1724
-
1725
- ```
1726
- Task: subagent_type="codebase-analyzer", model="sonnet"
1727
- Prompt: "Post-implementation code verification for feature [FEATURE_NAME].
1728
-
1729
- Feature directory: {FEATURE_DIR}
1730
- Tasks: {FEATURE_DIR}/tasks.md
1731
-
1732
- Verify the following:
1733
- 1. Every task marked [x] in tasks.md has corresponding code changes — check file paths
1734
- 2. Search for TODO/FIXME/HACK comments in files listed in tasks.md
1735
- 3. Check for dead code or unused imports in changed files
1736
- 4. Verify any API contracts/interfaces match their actual implementations
1737
- 5. Check for inconsistencies between task descriptions and what was implemented
1738
-
1739
- Return findings with Red/Yellow/Gray severity (<2000 tokens).
1740
- Red = task marked complete but no code found, or API contract mismatch
1741
- Yellow = TODO/FIXME comments, unused imports, minor inconsistencies
1742
- Gray = style suggestions, optional improvements"
1743
- ```
1744
-
1745
- ### Agent 15: Correctness Re-verification
1746
-
1747
- ```
1748
- Task: subagent_type="validation-correctness", model="sonnet"
1749
- Prompt: "Post-implementation correctness re-verification for feature [FEATURE_NAME].
1750
-
1751
- Feature directory: {FEATURE_DIR}
1752
- Spec: {FEATURE_DIR}/spec.md
1753
- Plan: {FEATURE_DIR}/plan.md
1754
-
1755
- This is a focused re-check after validation passed. Look for issues that
1756
- rubric-based validation might miss:
1757
- 1. Edge cases from spec that may not have explicit tests
1758
- 2. Error handling completeness — are all failure modes covered?
1759
- 3. Race conditions or concurrency issues in async code
1760
- 4. Input validation at system boundaries
1761
- 5. Any acceptance criteria that are technically 'covered' by tests but
1762
- the implementation doesn't fully satisfy the spirit of the requirement
1763
-
1764
- Return findings with Red/Yellow/Gray severity (<2000 tokens).
1765
- Red = acceptance criterion not genuinely satisfied, critical error path missing
1766
- Yellow = edge case not covered, partial error handling
1767
- Gray = potential improvement, defensive coding suggestion"
1768
- ```
1769
-
1770
- **Run all 3 agents in parallel.** Collect all results before proceeding.
1771
-
1772
- ## Step 10c: Run Build/Test/Lint Verification
1773
-
1774
- Execute verification commands and capture results:
1775
-
1776
- ### Build Check
1777
-
1778
- ```bash
1779
- cd extension && npm run compile
1780
- ```
1781
-
1782
- ### Test Check
1783
-
1784
- ```bash
1785
- cd extension && npm test
1786
- ```
1787
-
1788
- ### Lint Check
1789
-
1790
- ```bash
1791
- cd extension && npm run lint
1792
- ```
1793
-
1794
- Record results:
1795
-
1796
- ```
1797
- | Check | Command | Result |
1798
- |--------|----------------------|-------------|
1799
- | Build | npm run compile | PASS / FAIL |
1800
- | Tests | npm test | PASS / FAIL |
1801
- | Lint | npm run lint | PASS / FAIL |
1802
- ```
1803
-
1804
- **If any check FAILS**: Record as a Red finding.
1805
-
1806
- ## Step 10d: Synthesize Findings
1807
-
1808
- Collect all agent reports and build/test/lint results. Merge with Phase B
1809
- Yellow/Gray carryovers. Classify each finding:
1810
-
1811
- - **Red** (blocking): Task marked complete but no code, API contract mismatch,
1812
- acceptance criterion not genuinely satisfied, build/test/lint failure,
1813
- critical error path missing
1814
- - **Yellow** (should fix): TODO/FIXME comments, unused imports, edge cases not
1815
- covered, partial error handling, minor inconsistencies, Phase B Yellows
1816
- - **Gray** (informational): Style suggestions, optional improvements, defensive
1817
- coding suggestions, Phase B Grays
1818
-
1819
- ### Compile Finding Table
1820
-
1821
- ```
1822
- | # | Finding | Severity | Source | File | Line | Status |
1823
- |---|---------|----------|---------------------------|--------|--------|--------|
1824
- | 1 | [desc] | Red | engineer-review | [file] | [line] | OPEN |
1825
- | 2 | [desc] | Yellow | codebase-analyzer | [file] | [line] | OPEN |
1826
- | 3 | [desc] | Yellow | phase-b:observability | [file] | [line] | OPEN |
1827
- ```
1828
-
1829
- ### Decision Logic
1830
-
1831
- - If **NO Red or Yellow findings** → PASS → proceed to Step 10g (Report)
1832
- - If **Red or Yellow findings exist** → proceed to Step 10e (Fix)
1833
-
1834
- ## Step 10e: Fix Findings
1835
-
1836
- For each Red and Yellow finding from the current cycle:
1837
-
1838
- 1. **Read the affected file** at the specified line
1839
- 2. **Apply the fix** directly using Edit tool
1840
- 3. **Mark the finding as FIXED** in the finding table
1841
-
1842
- ### Fix Priority
1843
-
1844
- 1. Red findings first (blocking issues)
1845
- 2. Yellow findings second (should fix)
1846
- 3. Gray findings are logged but NOT auto-fixed
1847
-
1848
- ### After Fixing
1849
-
1850
- Re-run build/test/lint to verify fixes don't introduce regressions:
1851
-
1852
- ```bash
1853
- cd extension && npm run compile && npm test && npm run lint
1854
- ```
1855
-
1856
- If the verification fails after fixes, record new failures as Red findings for
1857
- the next cycle.
1858
-
1859
- ## Step 10f: Loop or Complete
1860
-
1861
- ### Increment Cycle
1862
-
1863
- ```
1864
- CYCLE = CYCLE + 1
1865
- ```
1866
-
1867
- ### Decision
1868
-
1869
- - If `CYCLE <= 5` AND findings were fixed in the previous cycle → **Go to Step
1870
- 10b** (re-review with fresh agent runs to verify fixes and catch any new
1871
- issues)
1872
- - If `CYCLE > 5` AND Red/Yellow findings still remain → **Generate escalation
1873
- section** in the report, declare pipeline complete with warnings
1874
- - If **all findings resolved** (no Red or Yellow) → **Declare pipeline
1875
- complete** (proceed to Step 10g)
1876
-
1877
- ## Step 10g: Generate Engineering Review Report
1878
-
1879
- Write to `{FEATURE_DIR}/engineering-review-report.md`:
1880
-
1881
- ```markdown
1882
- ---
1883
- feature: [Feature Name]
1884
- reviewed: [ISO timestamp]
1885
- reviewer: Claude
1886
- status: [PASS/PASS_WITH_WARNINGS/ESCALATED]
1887
- cycles: [N]
1888
- total_findings: [N]
1889
- resolved_findings: [N]
1890
- blast_radius_carryovers: [N]
1891
- ---
1892
-
1893
- # Engineering Review Report: [Feature Name]
1894
-
1895
- ## Summary
1896
-
1897
- - **Status**: [PASS / PASS_WITH_WARNINGS / ESCALATED]
1898
- - **Review cycles**: [N] of 5 max
1899
- - **Total findings**: [N] (Red: [N], Yellow: [N], Gray: [N])
1900
- - **Resolved**: [N] findings fixed across [N] cycles
1901
- - **Remaining**: [N] findings (if any)
1902
- - **Phase B carryovers addressed**: [N] of [N]
1903
-
1904
- ## Cycle History
1905
-
1906
- ### Cycle 1
1907
-
1908
- **Agents**: engineer-review, codebase-analyzer, validation-correctness
1909
- **Build/Test/Lint**: [PASS/FAIL details]
1910
-
1911
- | # | Finding | Severity | Source | File | Line | Resolution |
1912
- | --- | ------- | -------- | ------ | ------ | ------ | ------------ |
1913
- | 1 | [desc] | [sev] | [src] | [file] | [line] | [FIXED/OPEN] |
1914
-
1915
- ### Cycle 2 (if applicable)
1916
-
1917
- ...
1918
-
1919
- ## Remaining Findings (if any)
1920
-
1921
- | # | Finding | Severity | Source | File | Line | Reason Not Fixed |
1922
- | --- | ------- | -------- | ------ | ------ | ------ | ---------------- |
1923
- | 1 | [desc] | [sev] | [src] | [file] | [line] | [why] |
1924
-
1925
- ## Recommendations
1926
-
1927
- ### Must Address Before Merge
1928
-
1929
- - [Any remaining Red/Yellow findings]
1930
-
1931
- ### Future Improvements
1932
-
1933
- - [Gray findings and suggestions]
1934
- ```
1935
-
1936
- ## Step 10g.5: Final Working Backwards PR/FAQ And CISO Summary
1937
-
1938
- After the validation report, blast-radius report, loop audit, and engineering
1939
- review report are written:
1940
-
1941
- 1. Update `{FEATURE_DIR}/working-backwards-prfaq.md`.
1942
- - Mark each Press Release claim as validated, changed, or unvalidated based
1943
- on `validation-report.md`, `blast-radius-report.md`,
1944
- `goal-rebaseline-report.md`, and `loop-audit-report.md`.
1945
- - Fill Internal FAQ CISO / Risk with data handled, identity controls,
1946
- workspace boundaries, secrets handling, residual risks, validation evidence,
1947
- and launch gates.
1948
- - Update "What happens if something goes wrong?" with rollback/support
1949
- evidence from validation and blast-radius analysis.
1950
- 2. Write `{FEATURE_DIR}/prfaq-history/06-validate.md` as an immutable final
1951
- validation snapshot.
1952
- 3. Create or update `{FEATURE_DIR}/ciso-security-summary.md` from
1953
- `.specify/templates/ciso-security-summary-template.md` using
1954
- `validation-report.md`, `blast-radius-report.md`, `audit-history.md`,
1955
- `visuals/risk-heatmap.md`, auth/workspace evidence, secrets/data handling
1956
- evidence, and loop audit evidence.
1957
- 4. Refresh `{FEATURE_DIR}/business-owner-summary.md` with final validation
1958
- status, business value confidence, and any validated/disproven assumptions.
1959
- 5. Refresh `{FEATURE_DIR}/cto-architecture-summary.md` with validation status,
1960
- blast-radius verdict, and any architecture/security exceptions.
1961
- 6. Update `{FEATURE_DIR}/stakeholder-review-index.md` and make the final
1962
- approve/revise/defer asks explicit:
1963
- - Business Owner: release value, user/process impact, assumptions.
1964
- - CTO / Architecture: platform/architecture evidence and exceptions.
1965
- - CISO / Risk: controls, residual risks, security posture, launch gate.
1966
- - Delivery: rollout, rollback, support, and evidence completeness.
1967
-
1968
- If any validation gate failed, write these documents honestly with `FAIL`,
1969
- `Pending`, or `Blocked` status; do not polish a failed feature as ready.
1970
-
1971
- ## Step 10h: Output Completion Banner
1972
-
1973
- ### If PASS (all findings resolved or no findings):
1974
-
1975
- ```
1976
- ════════════════════════════════════════════════════════════════
1977
- ENGINEERING REVIEW PASSED: [Feature Name]
1978
- ════════════════════════════════════════════════════════════════
1979
-
1980
- Cycles: [N] of 5 max
1981
- Findings: [N] found, [N] resolved
1982
- Report: {FEATURE_DIR}/engineering-review-report.md
1983
- Working Backwards PR/FAQ: {FEATURE_DIR}/working-backwards-prfaq.md
1984
- CISO summary: {FEATURE_DIR}/ciso-security-summary.md
1985
- Stakeholder review index: {FEATURE_DIR}/stakeholder-review-index.md
1986
-
1987
- ════════════════════════════════════════════════════════════════
1988
- FEATURE PIPELINE COMPLETE!
1989
-
1990
- All Gofer stages finished:
1991
- 1. #1_gofer_research ✓
1992
- 2. #2_gofer_specify ✓
1993
- 3. #3_gofer_plan ✓
1994
- 4. #4_gofer_tasks ✓
1995
- 5. #5_gofer_implement ✓
1996
- 6. #6_gofer_validate ✓ (Phase A ✓, Phase B ✓, Phase C ✓)
1997
-
1998
- The feature is ready for review and merge.
1999
- Stakeholder PR/FAQ and persona summaries are ready for Business Owner,
2000
- CTO/Architecture, CISO/Risk, and Delivery review.
2001
- ════════════════════════════════════════════════════════════════
2002
- ```
2003
-
2004
- ### If PASS_WITH_WARNINGS (5 cycles exhausted, only Gray remaining):
2005
-
2006
- ```
2007
- ════════════════════════════════════════════════════════════════
2008
- ENGINEERING REVIEW PASSED (WITH WARNINGS): [Feature Name]
2009
- ════════════════════════════════════════════════════════════════
2010
-
2011
- Cycles: 5 of 5 max
2012
- Findings: [N] found, [N] resolved, [N] Gray remaining
2013
- Report: {FEATURE_DIR}/engineering-review-report.md
2014
- Working Backwards PR/FAQ: {FEATURE_DIR}/working-backwards-prfaq.md
2015
- CISO summary: {FEATURE_DIR}/ciso-security-summary.md
2016
- Stakeholder review index: {FEATURE_DIR}/stakeholder-review-index.md
2017
-
2018
- ⚠ Gray findings remain — see report for details.
2019
-
2020
- ════════════════════════════════════════════════════════════════
2021
- FEATURE PIPELINE COMPLETE!
2022
-
2023
- All Gofer stages finished:
2024
- 1. #1_gofer_research ✓
2025
- 2. #2_gofer_specify ✓
2026
- 3. #3_gofer_plan ✓
2027
- 4. #4_gofer_tasks ✓
2028
- 5. #5_gofer_implement ✓
2029
- 6. #6_gofer_validate ✓ (Phase A ✓, Phase B ✓, Phase C ⚠)
2030
-
2031
- The feature is ready for review and merge (review Gray findings).
2032
- ════════════════════════════════════════════════════════════════
2033
- ```
2034
-
2035
- ### If ESCALATED (5 cycles exhausted, Red/Yellow remain):
2036
-
2037
- ```
2038
- ════════════════════════════════════════════════════════════════
2039
- ENGINEERING REVIEW ESCALATED: [Feature Name]
2040
- ════════════════════════════════════════════════════════════════
2041
-
2042
- Cycles: 5 of 5 max (exhausted)
2043
- Findings: [N] found, [N] resolved, [N] Red/Yellow remaining
2044
-
2045
- Remaining issues:
2046
- ✗ [Finding] — [severity]: [brief reason]
2047
-
2048
- Report: {FEATURE_DIR}/engineering-review-report.md
2049
- Working Backwards PR/FAQ: {FEATURE_DIR}/working-backwards-prfaq.md
2050
- CISO summary: {FEATURE_DIR}/ciso-security-summary.md
2051
- Stakeholder review index: {FEATURE_DIR}/stakeholder-review-index.md
2052
-
2053
- This feature requires human review of remaining findings
2054
- before merging.
2055
-
2056
- ════════════════════════════════════════════════════════════════
2057
- ```
2058
-
2059
- ---
2060
-
2061
- # End of Phase C
2062
-
2063
- ---
2064
-
2065
- ## Step 11: Attribution Logging
2066
-
2067
- Log every finding to `.specify/logs/validation-findings.jsonl`.
2068
- For EnterpriseAI runs, also mirror the same finding lifecycle to
2069
- `{FEATURE_DIR}/audit-history.md` so executive, architecture, CISO, data, CIO,
2070
- delivery, finance, operations, and risk/compliance stakeholders can see stable
2071
- finding IDs, recurrence, disposition, owner, expiry, and review cadence.
2072
-
2073
- ### Finding Format
2074
-
2075
- For each finding from all agents and automated checks, append a JSON line:
2076
-
2077
- ```json
2078
- {
2079
- "finding_id": "F[NNN]",
2080
- "timestamp": "[ISO timestamp]",
2081
- "feature": "[feature-name]",
2082
- "category": "[rubric_category_snake_case]",
2083
- "severity": "[red|yellow|gray]",
2084
- "description": "[finding description]",
2085
- "file": "[file path]",
2086
- "line": [line number or null],
2087
- "agent": "[agent name or 'automated']",
2088
- "resolution": null,
2089
- "iteration": [N]
2090
- }
2091
- ```
2092
-
2093
- ### Categories for `category` field
2094
-
2095
- - `functional_correctness`
2096
- - `test_authenticity`
2097
- - `ui_e2e_verification`
2098
- - `security_posture`
2099
- - `integration_reality`
2100
- - `error_path_coverage`
2101
- - `architecture_compliance`
2102
- - `performance_baseline`
2103
- - `code_hygiene`
2104
- - `specification_traceability`
2105
- - `blast_radius_containment` — **NEW** (Cat 11, Phase B)
2106
- - Sub-dimensions for the `dimension` sub-field: `change_graph`,
2107
- `interface_contract`, `observability`, `dependency_submodule`,
2108
- `rollback_release`
2109
- - `engineering_review` — Phase C findings (agent-specific sub-dimensions:
2110
- `spec_alignment`, `code_verification`, `correctness_reverify`)
2111
-
2112
- ### EnterpriseAI Persistent Audit Requirements
2113
-
2114
- `audit-history.md` MUST include:
2115
-
2116
- | Field | Requirement |
2117
- | ----- | ----------- |
2118
- | Finding ID | Stable across validation cycles; never renumber existing findings |
2119
- | Source | Rubric category, agent, automated check, or stakeholder gate |
2120
- | Status | Open, fixed, accepted, or escalated |
2121
- | Recurrence | Count and prior cycle references for repeated findings |
2122
- | Owner | Named accountable role or team |
2123
- | Expiry | Required for accepted exceptions |
2124
- | Evidence | Links to validation report, tests, contract pack, or code references |
2125
-
2126
- Recurring red findings must escalate to the relevant decision owner and block
2127
- launch unless explicitly accepted with owner, expiry, and review cadence.
2128
-
2129
- For application delivery, validation MUST also check
2130
- `{FEATURE_DIR}/journeys/base-journey.md` against the delivered implementation:
2131
-
2132
- - The app process has four user-facing steps or fewer, or an approved exception
2133
- explains why extra steps could not be combined, automated, or handled by
2134
- generative AI assistance.
2135
- - Each journey step preserves its business goal, AI assistance mode, data/context
2136
- used, completion signal, human controls, evidence/confidence display, audit
2137
- trail, and fallback/escalation path.
2138
- - `{FEATURE_DIR}/ui-review-log.md` contains at least one pre-presentation
2139
- self-review entry for each preview round that was shown to the stakeholder,
2140
- with screenshot, local render proof, Playwright-style evidence, or an
2141
- explicit reasoned exception.
2142
- - `{FEATURE_DIR}/ui-approval.md` records the approved preview, approved
2143
- branding/logo decisions, any approved EAI App Template exceptions, the
2144
- approver, and approval timestamp.
2145
- - `{FEATURE_DIR}/service-fit-matrix.md` records each desired platform
2146
- capability, the evidence source used to evaluate it, and whether it is
2147
- accessible now, purchasable but unavailable now, or unavailable without new
2148
- platform work.
2149
- - The delivered app uses EAI Platform, including the EAI app template, as the
2150
- primary app substrate and Azure as the preferred cloud/supporting substrate.
2151
- Any Firebase, Supabase, Vercel primary runtime, AWS, GCP, bespoke backend,
2152
- unmanaged database, or unrelated SaaS dependency is rejected unless it is
2153
- recorded as an approved integration/migration/exception with rationale, owner,
2154
- expiry, and validation evidence.
2155
- - The approved external/internal/hybrid profile choice, package lane, coupling
2156
- status, Storybook story IDs, theme override points, public-readiness target,
2157
- and custom-block exceptions are present in the preview/approval/service-fit
2158
- artifacts and match the delivered implementation.
2159
- - Validation confirms that app-delivery runs used EAI App Template blocks by
2160
- default and that any create-new UI concept was explicitly approved rather
2161
- than silently introduced.
2162
- - Validation confirms that block-porting tasks produced the expected package
2163
- surface and that public or hybrid lanes do not directly depend on source platform
2164
- internals unless an approved restricted-source exception is recorded.
2165
- - Chatbot, voice, accessibility, translation, contextual prefill, validation,
2166
- and step-goal assistance claims are covered by acceptance tests where they are
2167
- in scope.
2168
-
2169
- For explicit non-app work, validation MUST treat `ui-preview-brief.md`,
2170
- `ui-review-log.md`, `ui-approval.md`, and `service-fit-matrix.md` as
2171
- **not applicable** rather than as missing blocking artifacts.
2172
-
2173
- ### Log Summary Entry
2174
-
2175
- After all findings, append a summary entry:
2176
-
2177
- ```json
2178
- {
2179
- "finding_id": "SUMMARY",
2180
- "timestamp": "[ISO timestamp]",
2181
- "feature": "[feature-name]",
2182
- "category": "summary",
2183
- "severity": "info",
2184
- "description": "Validation score: [N]/110. Categories failed: [list or 'none']",
2185
- "file": null,
2186
- "line": null,
2187
- "agent": "rubric",
2188
- "resolution": "[PASS|FAIL|ESCALATED]",
2189
- "iteration": [N]
2190
- }
2191
- ```
2192
-
2193
- ### Historical Reference
2194
-
2195
- Before logging, read existing entries in `validation-findings.jsonl` for the
2196
- same feature. If the same finding (same file, same line, same category) appears
2197
- in a previous iteration, note it as a **repeat finding** in the description:
2198
-
2199
- ```
2200
- "description": "[REPEAT from iteration 1] expect(true).toBe(true) still present"
2201
- ```
2202
-
2203
- This enables tracking of findings that persist across remediation attempts.
2204
-
2205
- ---
2206
-
2207
- ## Step 12: Memory Update Check
2208
-
2209
- After validation, assess whether learnings should be persisted.
2210
-
2211
- ### 12.1 Memory Update Decision Matrix
2212
-
2213
- | Learning Type | Update Location | When to Update |
2214
- | ---------------------------- | ---------------------------- | ----------------------------------------- |
2215
- | **Project-wide patterns** | `CLAUDE.md` | New conventions affecting all future work |
2216
- | **Architectural decisions** | `.specify/memory/decisions/` | Significant design choices with rationale |
2217
- | **Feature-specific context** | `{FEATURE_DIR}/research.md` | Discoveries relevant only to this feature |
2218
- | **Reusable code patterns** | `CLAUDE.md` or constitution | Patterns other features should follow |
2219
- | **Bug workarounds** | `.specify/memory/decisions/` | Issues that may recur |
2220
-
2221
- ### 12.2 CLAUDE.md Update Criteria
2222
-
2223
- **DO update CLAUDE.md when**:
2224
-
2225
- - Discovered a new coding convention used across the codebase
2226
- - Identified a critical dependency or integration pattern
2227
- - Found a gotcha that affects multiple features
2228
- - Established a new testing or build pattern
2229
-
2230
- **DO NOT update CLAUDE.md when**:
2231
-
2232
- - Learning is specific to one feature
2233
- - Information will become stale quickly
2234
- - Pattern is already documented elsewhere
2235
- - Change is experimental/temporary
2236
-
2237
- ### 12.3 Memory Update Checklist
2238
-
2239
- Before completing validation, verify:
2240
-
2241
- - [ ] Any project-wide patterns discovered -> added to CLAUDE.md?
2242
- - [ ] Any significant decisions made -> recorded in decisions/?
2243
- - [ ] Any gotchas or workarounds -> documented for future reference?
2244
- - [ ] Feature-specific learnings -> captured in research.md?
2245
-
2246
- ---
2247
-
2248
- ## Observability Logging
2249
-
2250
- At stage completion, log metrics:
2251
-
2252
- ```bash
2253
- .specify/scripts/bash/log-stage.sh 6_validate --complete --tokens [N] --compactions [N]
2254
- ```
2255
-
2256
- This also logs quality metrics (rubric scores, finding counts) to:
2257
- `.specify/logs/quality-metrics.jsonl`
2258
-
2259
- ---
2260
-
2261
- ## Key Rules
2262
-
2263
- ### Phase A (Rubric)
2264
-
2265
- - **110/110 is the only passing score** — there is no "close enough"
2266
- - **Agents run in parallel** — spawn all 6 (or 7 with red team) at once, do not
2267
- serialize
2268
- - **Red findings block** — any Red finding in any agent zeroes that category
2269
- - **Mutation testing is optional** — gracefully degrade when Stryker absent
2270
- - **Mock ratio excludes justified mocks** — mark with `// mock-justified:`
2271
- comment
2272
- - **Maximum 3 remediation iterations** — then escalate to human
2273
-
2274
- ### Phase B (Blast Radius)
2275
-
2276
- - **5 blast-radius agents run in parallel** — do not serialize across dimensions
2277
- - **The change manifest is ground truth** — build it once in Step 2.5, pass the
2278
- same manifest to every Phase B agent
2279
- - **Breaking change + no CHANGELOG entry = Red** — always. Release-checklist
2280
- compliance is mandatory for user-visible changes.
2281
- - **New High/Critical CVE = Red** — block before merge; Moderate is Yellow; Low
2282
- is Gray
2283
- - **Cross-submodule ripple requires explicit plan.md approval** — otherwise Red
2284
- - **Blast-radius verdict CONTAINED gives Cat 11 = 10**; BREACHED gives Cat 11 =
2285
- 0 — this is the only way Cat 11 scores
2286
- - **Phase B writes `blast-radius-report.md`** alongside `validation-report.md`
2287
- - **Phase B Yellows seed Phase C** — Phase C must address them
2288
-
2289
- ### Phase C (Engineering Review Loop)
2290
-
2291
- - **3 review agents per cycle** — spawn all in parallel, do not serialize
2292
- - **5 cycles maximum** — hard cap to prevent infinite loops
2293
- - **Fix Red before Yellow** — priority ordering matters
2294
- - **Re-verify after fixes** — always re-run build/test/lint after changes
2295
- - **Gray findings are logged, not auto-fixed** — they go in the report
2296
- - **Phase C only runs if the rubric passes** — a failing rubric triggers
2297
- brownfield restart instead
2298
- - **This stage is the pipeline terminal** — "PIPELINE COMPLETE" only appears at
2299
- the end of Phase C
2300
- - **Engineering review is inline** — there is no separate follow-up stage after
2301
- validation
2302
-
2303
- ### Across All Phases
2304
-
2305
- - **Attribution logging is mandatory** — every finding (A, B, C) gets logged to
2306
- JSONL with its phase and sub-dimension
2307
- - **Be specific** — cite file paths and line numbers for all findings
2308
- - **Score the rubric honestly** — the goal is to catch real problems, not to
2309
- pass
2310
- - Log stage completion for observability tracking