@entelligentsia/forgecli 0.21.0 → 1.0.3

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/CHANGELOG.md +44 -0
  2. package/README.md +31 -33
  3. package/dist/CHANGELOG-forge-plugin.md +142 -0
  4. package/dist/CHANGELOG-pi.md +24 -1
  5. package/dist/bin/forgecli.d.ts +2 -0
  6. package/dist/bin/forgecli.js +6 -0
  7. package/dist/bin/forgecli.js.map +1 -0
  8. package/dist/extensions/forgecli/add-pipeline.js +1 -1
  9. package/dist/extensions/forgecli/add-pipeline.js.map +1 -1
  10. package/dist/extensions/forgecli/add-task.js +1 -1
  11. package/dist/extensions/forgecli/add-task.js.map +1 -1
  12. package/dist/extensions/forgecli/approve.js +17 -2
  13. package/dist/extensions/forgecli/approve.js.map +1 -1
  14. package/dist/extensions/forgecli/audience-gate.js +1 -1
  15. package/dist/extensions/forgecli/audience-gate.js.map +1 -1
  16. package/dist/extensions/forgecli/calibrate.js +11 -8
  17. package/dist/extensions/forgecli/calibrate.js.map +1 -1
  18. package/dist/extensions/forgecli/collate.js +1 -1
  19. package/dist/extensions/forgecli/collate.js.map +1 -1
  20. package/dist/extensions/forgecli/commit.js +17 -2
  21. package/dist/extensions/forgecli/commit.js.map +1 -1
  22. package/dist/extensions/forgecli/enhance.js +1 -1
  23. package/dist/extensions/forgecli/enhance.js.map +1 -1
  24. package/dist/extensions/forgecli/fix-bug.d.ts +1 -2
  25. package/dist/extensions/forgecli/fix-bug.js +678 -609
  26. package/dist/extensions/forgecli/fix-bug.js.map +1 -1
  27. package/dist/extensions/forgecli/forge-artifact-tool.d.ts +6 -8
  28. package/dist/extensions/forgecli/forge-artifact-tool.js +94 -197
  29. package/dist/extensions/forgecli/forge-artifact-tool.js.map +1 -1
  30. package/dist/extensions/forgecli/forge-commands.js +57 -18
  31. package/dist/extensions/forgecli/forge-commands.js.map +1 -1
  32. package/dist/extensions/forgecli/forge-init/phase4-register.js +6 -7
  33. package/dist/extensions/forgecli/forge-init/phase4-register.js.map +1 -1
  34. package/dist/extensions/forgecli/forge-init/run-phases.d.ts +4 -0
  35. package/dist/extensions/forgecli/forge-init/run-phases.js +304 -0
  36. package/dist/extensions/forgecli/forge-init/run-phases.js.map +1 -0
  37. package/dist/extensions/forgecli/forge-init/verifiers.d.ts +14 -5
  38. package/dist/extensions/forgecli/forge-init/verifiers.js +79 -62
  39. package/dist/extensions/forgecli/forge-init/verifiers.js.map +1 -1
  40. package/dist/extensions/forgecli/forge-init.js +131 -76
  41. package/dist/extensions/forgecli/forge-init.js.map +1 -1
  42. package/dist/extensions/forgecli/forge-subagent.d.ts +26 -0
  43. package/dist/extensions/forgecli/forge-subagent.js +42 -18
  44. package/dist/extensions/forgecli/forge-subagent.js.map +1 -1
  45. package/dist/extensions/forgecli/forge-tools.d.ts +34 -4
  46. package/dist/extensions/forgecli/forge-tools.js +191 -79
  47. package/dist/extensions/forgecli/forge-tools.js.map +1 -1
  48. package/dist/extensions/forgecli/health-check.js +3 -3
  49. package/dist/extensions/forgecli/health-check.js.map +1 -1
  50. package/dist/extensions/forgecli/hook-dispatcher.d.ts +1 -1
  51. package/dist/extensions/forgecli/hooks/check-update.d.ts +8 -0
  52. package/dist/extensions/forgecli/hooks/check-update.js +29 -1
  53. package/dist/extensions/forgecli/hooks/check-update.js.map +1 -1
  54. package/dist/extensions/forgecli/hooks/post-init-hook.js +6 -6
  55. package/dist/extensions/forgecli/hooks/post-init-hook.js.map +1 -1
  56. package/dist/extensions/forgecli/hooks/post-sprint-hook.js +6 -6
  57. package/dist/extensions/forgecli/hooks/post-sprint-hook.js.map +1 -1
  58. package/dist/extensions/forgecli/hooks/triage-error.js +1 -0
  59. package/dist/extensions/forgecli/hooks/triage-error.js.map +1 -1
  60. package/dist/extensions/forgecli/implement.js +20 -2
  61. package/dist/extensions/forgecli/implement.js.map +1 -1
  62. package/dist/extensions/forgecli/index.js +39 -32
  63. package/dist/extensions/forgecli/index.js.map +1 -1
  64. package/dist/extensions/forgecli/lib/pipeline-guard.d.ts +41 -0
  65. package/dist/extensions/forgecli/lib/pipeline-guard.js +100 -0
  66. package/dist/extensions/forgecli/lib/pipeline-guard.js.map +1 -0
  67. package/dist/extensions/forgecli/loaders/persona-skill-loader.js +2 -2
  68. package/dist/extensions/forgecli/loaders/persona-skill-loader.js.map +1 -1
  69. package/dist/extensions/forgecli/migrate.d.ts +3 -0
  70. package/dist/extensions/forgecli/migrate.js +4 -2
  71. package/dist/extensions/forgecli/migrate.js.map +1 -1
  72. package/dist/extensions/forgecli/plan.js +21 -2
  73. package/dist/extensions/forgecli/plan.js.map +1 -1
  74. package/dist/extensions/forgecli/quiz-agent.js +7 -7
  75. package/dist/extensions/forgecli/quiz-agent.js.map +1 -1
  76. package/dist/extensions/forgecli/regenerate.js +49 -18
  77. package/dist/extensions/forgecli/regenerate.js.map +1 -1
  78. package/dist/extensions/forgecli/remove-command.js +1 -1
  79. package/dist/extensions/forgecli/remove-command.js.map +1 -1
  80. package/dist/extensions/forgecli/report-bug.js +1 -1
  81. package/dist/extensions/forgecli/report-bug.js.map +1 -1
  82. package/dist/extensions/forgecli/retrospective.js +9 -9
  83. package/dist/extensions/forgecli/retrospective.js.map +1 -1
  84. package/dist/extensions/forgecli/review-code.d.ts +13 -0
  85. package/dist/extensions/forgecli/review-code.js +62 -3
  86. package/dist/extensions/forgecli/review-code.js.map +1 -1
  87. package/dist/extensions/forgecli/review-plan.d.ts +13 -0
  88. package/dist/extensions/forgecli/review-plan.js +65 -3
  89. package/dist/extensions/forgecli/review-plan.js.map +1 -1
  90. package/dist/extensions/forgecli/run-task.js +461 -391
  91. package/dist/extensions/forgecli/run-task.js.map +1 -1
  92. package/dist/extensions/forgecli/session-registry.d.ts +12 -0
  93. package/dist/extensions/forgecli/session-registry.js +23 -0
  94. package/dist/extensions/forgecli/session-registry.js.map +1 -1
  95. package/dist/extensions/forgecli/skill-curator-subagent.d.ts +2 -1
  96. package/dist/extensions/forgecli/skill-curator-subagent.js +2 -1
  97. package/dist/extensions/forgecli/skill-curator-subagent.js.map +1 -1
  98. package/dist/extensions/forgecli/sprint-intake.js +6 -6
  99. package/dist/extensions/forgecli/sprint-intake.js.map +1 -1
  100. package/dist/extensions/forgecli/sprint-plan.js +9 -9
  101. package/dist/extensions/forgecli/sprint-plan.js.map +1 -1
  102. package/dist/extensions/forgecli/status-command.js +1 -1
  103. package/dist/extensions/forgecli/status-command.js.map +1 -1
  104. package/dist/extensions/forgecli/store-query.js +11 -11
  105. package/dist/extensions/forgecli/store-query.js.map +1 -1
  106. package/dist/extensions/forgecli/store-repair.js +7 -7
  107. package/dist/extensions/forgecli/store-repair.js.map +1 -1
  108. package/dist/extensions/forgecli/subagent/caller-context.d.ts +35 -11
  109. package/dist/extensions/forgecli/subagent/caller-context.js +49 -21
  110. package/dist/extensions/forgecli/subagent/caller-context.js.map +1 -1
  111. package/dist/extensions/forgecli/subagent/orchestrator-transcript.d.ts +66 -0
  112. package/dist/extensions/forgecli/subagent/orchestrator-transcript.js +66 -0
  113. package/dist/extensions/forgecli/subagent/orchestrator-transcript.js.map +1 -0
  114. package/dist/extensions/forgecli/subagent/phase-guard.d.ts +34 -0
  115. package/dist/extensions/forgecli/subagent/phase-guard.js +139 -0
  116. package/dist/extensions/forgecli/subagent/phase-guard.js.map +1 -0
  117. package/dist/extensions/forgecli/subagent/phase-summary-map.d.ts +1 -0
  118. package/dist/extensions/forgecli/subagent/phase-summary-map.js +22 -0
  119. package/dist/extensions/forgecli/subagent/phase-summary-map.js.map +1 -0
  120. package/dist/extensions/forgecli/thread-switcher.js +2 -2
  121. package/dist/extensions/forgecli/thread-switcher.js.map +1 -1
  122. package/dist/extensions/forgecli/validate.js +17 -2
  123. package/dist/extensions/forgecli/validate.js.map +1 -1
  124. package/dist/extensions/forgecli/viewport-events.d.ts +4 -0
  125. package/dist/extensions/forgecli/viewport-events.js +18 -1
  126. package/dist/extensions/forgecli/viewport-events.js.map +1 -1
  127. package/dist/extensions/forgecli/viewport-renderer.d.ts +12 -2
  128. package/dist/extensions/forgecli/viewport-renderer.js +8 -6
  129. package/dist/extensions/forgecli/viewport-renderer.js.map +1 -1
  130. package/dist/forge-payload/.base-pack/commands/check-agent.md +22 -0
  131. package/dist/forge-payload/.base-pack/commands/new-sprint.md +22 -0
  132. package/dist/forge-payload/.base-pack/commands/plan-sprint.md +22 -0
  133. package/dist/forge-payload/.base-pack/commands/quiz-agent.md +2 -18
  134. package/dist/forge-payload/.base-pack/commands/retro.md +22 -0
  135. package/dist/forge-payload/.base-pack/commands/retrospective.md +2 -18
  136. package/dist/forge-payload/.base-pack/commands/sprint-intake.md +2 -18
  137. package/dist/forge-payload/.base-pack/commands/sprint-plan.md +2 -18
  138. package/dist/forge-payload/.base-pack/workflows/_fragments/friction-emit.md +2 -2
  139. package/dist/forge-payload/.base-pack/workflows/_fragments/generation-instructions.md +4 -4
  140. package/dist/forge-payload/.base-pack/workflows/_fragments/iron-laws.md +1 -1
  141. package/dist/forge-payload/.base-pack/workflows/architect_approve.md +13 -1
  142. package/dist/forge-payload/.base-pack/workflows/commit_task.md +12 -1
  143. package/dist/forge-payload/.base-pack/workflows/enhance.md +6 -6
  144. package/dist/forge-payload/.base-pack/workflows/fix_bug.md +11 -29
  145. package/dist/forge-payload/.base-pack/workflows/implement_plan.md +14 -2
  146. package/dist/forge-payload/.base-pack/workflows/migrate_structural.md +2 -2
  147. package/dist/forge-payload/.base-pack/workflows/orchestrate_task.md +20 -4
  148. package/dist/forge-payload/.base-pack/workflows/plan_task.md +14 -2
  149. package/dist/forge-payload/.base-pack/workflows/review_code.md +37 -7
  150. package/dist/forge-payload/.base-pack/workflows/review_plan.md +36 -6
  151. package/dist/forge-payload/.base-pack/workflows/run_sprint.md +2 -2
  152. package/dist/forge-payload/.base-pack/workflows/triage.md +190 -0
  153. package/dist/forge-payload/.base-pack/workflows/validate_task.md +37 -7
  154. package/dist/forge-payload/.claude-plugin/plugin.json +1 -1
  155. package/dist/forge-payload/.schemas/config.schema.json +0 -5
  156. package/dist/forge-payload/.schemas/enum-catalog.json +9 -13
  157. package/dist/forge-payload/.schemas/migrations.json +63 -0
  158. package/dist/forge-payload/agents/tomoshibi.md +150 -6
  159. package/dist/forge-payload/commands/add-pipeline.md +1 -1
  160. package/dist/forge-payload/commands/add-task.md +1 -1
  161. package/dist/forge-payload/commands/calibrate.md +4 -350
  162. package/dist/forge-payload/commands/check-agent.md +38 -0
  163. package/dist/forge-payload/commands/config.md +3 -113
  164. package/dist/forge-payload/commands/enhance.md +5 -32
  165. package/dist/forge-payload/commands/health.md +155 -13
  166. package/dist/forge-payload/commands/init.md +25 -31
  167. package/dist/forge-payload/commands/migrate.md +6 -154
  168. package/dist/forge-payload/commands/quiz-agent.md +2 -34
  169. package/dist/forge-payload/commands/rebuild.md +664 -0
  170. package/dist/forge-payload/commands/regenerate.md +2 -774
  171. package/dist/forge-payload/commands/remove.md +10 -13
  172. package/dist/forge-payload/commands/repair.md +187 -0
  173. package/dist/forge-payload/commands/search.md +73 -0
  174. package/dist/forge-payload/commands/status.md +105 -0
  175. package/dist/forge-payload/commands/store-query.md +2 -69
  176. package/dist/forge-payload/commands/store-repair.md +2 -183
  177. package/dist/forge-payload/commands/update-tools.md +4 -50
  178. package/dist/forge-payload/commands/update.md +64 -58
  179. package/dist/forge-payload/hooks/check-update.cjs +1 -1
  180. package/dist/forge-payload/hooks/post-init.cjs +2 -2
  181. package/dist/forge-payload/hooks/post-sprint.cjs +2 -2
  182. package/dist/forge-payload/hooks/triage-error.cjs +11 -10
  183. package/dist/forge-payload/init/phases/phase-1-collect.md +138 -0
  184. package/dist/forge-payload/init/phases/phase-2-discover.md +127 -0
  185. package/dist/forge-payload/init/phases/phase-3-materialize.md +113 -0
  186. package/dist/forge-payload/init/phases/phase-4-register.md +159 -0
  187. package/dist/forge-payload/integrity.json +21 -24
  188. package/dist/forge-payload/meta/fragments/tool-discipline.md +41 -0
  189. package/dist/forge-payload/meta/templates/meta-retro.md +28 -0
  190. package/dist/forge-payload/meta/workflows/_fragments/friction-emit.md +2 -2
  191. package/dist/forge-payload/meta/workflows/_fragments/generation-instructions.md +4 -4
  192. package/dist/forge-payload/meta/workflows/_fragments/iron-laws.md +1 -1
  193. package/dist/forge-payload/meta/workflows/meta-approve.md +13 -1
  194. package/dist/forge-payload/meta/workflows/meta-bug-triage.md +210 -0
  195. package/dist/forge-payload/meta/workflows/meta-check-agent.md +138 -0
  196. package/dist/forge-payload/meta/workflows/meta-commit.md +12 -1
  197. package/dist/forge-payload/meta/workflows/meta-enhance.md +5 -5
  198. package/dist/forge-payload/meta/workflows/meta-fix-bug.md +11 -29
  199. package/dist/forge-payload/meta/workflows/meta-implement.md +13 -1
  200. package/dist/forge-payload/meta/workflows/meta-migrate.md +3 -3
  201. package/dist/forge-payload/meta/workflows/meta-new-sprint.md +84 -0
  202. package/dist/forge-payload/meta/workflows/meta-orchestrate.md +20 -4
  203. package/dist/forge-payload/meta/workflows/meta-plan-sprint.md +152 -0
  204. package/dist/forge-payload/meta/workflows/meta-plan-task.md +13 -1
  205. package/dist/forge-payload/meta/workflows/meta-retro.md +73 -0
  206. package/dist/forge-payload/meta/workflows/meta-review-implementation.md +37 -7
  207. package/dist/forge-payload/meta/workflows/meta-review-plan.md +36 -6
  208. package/dist/forge-payload/meta/workflows/meta-validate.md +37 -7
  209. package/dist/forge-payload/schemas/config.schema.json +0 -5
  210. package/dist/forge-payload/schemas/enum-catalog.json +9 -13
  211. package/dist/forge-payload/schemas/structure-manifest.json +25 -8
  212. package/dist/forge-payload/tools/artifact.cjs +324 -0
  213. package/dist/forge-payload/tools/banners.cjs +3 -4
  214. package/dist/forge-payload/tools/build-context-pack.cjs +1 -1
  215. package/dist/forge-payload/tools/check-structure.cjs +8 -3
  216. package/dist/forge-payload/tools/store-cli.cjs +67 -7
  217. package/dist/forge-payload/tools/substitute-placeholders.cjs +1 -1
  218. package/dist/forge-payload/tools/verify-apply.cjs +75 -0
  219. package/dist/forge-payload/tools/verify-phase.cjs +259 -0
  220. package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
  221. package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +0 -17
  222. package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts.map +1 -1
  223. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +21 -38
  224. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js.map +1 -1
  225. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.d.ts.map +1 -1
  226. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.js +5 -4
  227. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.js.map +1 -1
  228. package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.d.ts +2 -1
  229. package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.d.ts.map +1 -1
  230. package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js +5 -2
  231. package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js.map +1 -1
  232. package/node_modules/@earendil-works/pi-ai/package.json +1 -1
  233. package/node_modules/@earendil-works/pi-coding-agent/CHANGELOG.md +24 -1
  234. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/file-processor.d.ts.map +1 -1
  235. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/file-processor.js +2 -3
  236. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/file-processor.js.map +1 -1
  237. package/node_modules/@earendil-works/pi-coding-agent/dist/core/output-guard.d.ts +1 -0
  238. package/node_modules/@earendil-works/pi-coding-agent/dist/core/output-guard.d.ts.map +1 -1
  239. package/node_modules/@earendil-works/pi-coding-agent/dist/core/output-guard.js +52 -22
  240. package/node_modules/@earendil-works/pi-coding-agent/dist/core/output-guard.js.map +1 -1
  241. package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.d.ts.map +1 -1
  242. package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js +16 -4
  243. package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js.map +1 -1
  244. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.d.ts.map +1 -1
  245. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js +45 -50
  246. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js.map +1 -1
  247. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.d.ts.map +1 -1
  248. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.js +43 -81
  249. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.js.map +1 -1
  250. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/file-mutation-queue.d.ts.map +1 -1
  251. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/file-mutation-queue.js +27 -12
  252. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/file-mutation-queue.js.map +1 -1
  253. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/find.d.ts.map +1 -1
  254. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/find.js +2 -3
  255. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/find.js.map +1 -1
  256. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.d.ts.map +1 -1
  257. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.js +3 -3
  258. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.js.map +1 -1
  259. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/ls.d.ts.map +1 -1
  260. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/ls.js +5 -5
  261. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/ls.js.map +1 -1
  262. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/path-utils.d.ts +2 -0
  263. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/path-utils.d.ts.map +1 -1
  264. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/path-utils.js +37 -0
  265. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/path-utils.js.map +1 -1
  266. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.d.ts.map +1 -1
  267. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js +9 -8
  268. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js.map +1 -1
  269. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/write.d.ts.map +1 -1
  270. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/write.js +20 -35
  271. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/write.js.map +1 -1
  272. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-client.d.ts +3 -0
  273. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  274. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-client.js +64 -7
  275. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-client.js.map +1 -1
  276. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  277. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.js +15 -3
  278. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.js.map +1 -1
  279. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/clipboard-native.d.ts +3 -1
  280. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/clipboard-native.d.ts.map +1 -1
  281. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/clipboard-native.js +14 -8
  282. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/clipboard-native.js.map +1 -1
  283. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.d.ts +30 -0
  284. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.d.ts.map +1 -0
  285. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.js +124 -0
  286. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.js.map +1 -0
  287. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-worker.d.ts +2 -0
  288. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-worker.d.ts.map +1 -0
  289. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-worker.js +31 -0
  290. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-worker.js.map +1 -0
  291. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize.d.ts +7 -27
  292. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize.d.ts.map +1 -1
  293. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize.js +75 -115
  294. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize.js.map +1 -1
  295. package/node_modules/@earendil-works/pi-coding-agent/docs/terminal-setup.md +6 -0
  296. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package.json +1 -1
  297. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  298. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/sandbox/package.json +1 -1
  299. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package.json +1 -1
  300. package/node_modules/@earendil-works/pi-coding-agent/npm-shrinkwrap.json +12 -14
  301. package/node_modules/@earendil-works/pi-coding-agent/package.json +5 -5
  302. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.d.ts +3 -0
  303. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.d.ts.map +1 -0
  304. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js +53 -0
  305. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js.map +1 -0
  306. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts.map +1 -1
  307. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +4 -1
  308. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +1 -1
  309. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts +2 -0
  310. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -1
  311. package/node_modules/@earendil-works/pi-tui/dist/terminal.js +13 -1
  312. package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +1 -1
  313. package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-arm64/darwin-modifiers.node +0 -0
  314. package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-x64/darwin-modifiers.node +0 -0
  315. package/node_modules/@earendil-works/pi-tui/package.json +2 -2
  316. package/node_modules/@entelligentsia/forge-compress/dist/compressor.d.ts +6 -0
  317. package/node_modules/@entelligentsia/forge-compress/dist/compressor.js +137 -0
  318. package/node_modules/@entelligentsia/forge-compress/dist/entropy.d.ts +3 -0
  319. package/node_modules/@entelligentsia/forge-compress/dist/entropy.js +99 -0
  320. package/node_modules/@entelligentsia/forge-compress/dist/forge/entity.d.ts +8 -0
  321. package/node_modules/@entelligentsia/forge-compress/dist/forge/entity.js +149 -0
  322. package/node_modules/@entelligentsia/forge-compress/dist/forge/index.d.ts +7 -0
  323. package/node_modules/@entelligentsia/forge-compress/dist/forge/index.js +4 -0
  324. package/node_modules/@entelligentsia/forge-compress/dist/forge/markdown.d.ts +5 -0
  325. package/node_modules/@entelligentsia/forge-compress/dist/forge/markdown.js +92 -0
  326. package/node_modules/@entelligentsia/forge-compress/dist/forge/query.d.ts +7 -0
  327. package/node_modules/@entelligentsia/forge-compress/dist/forge/query.js +60 -0
  328. package/node_modules/@entelligentsia/forge-compress/dist/forge/validate.d.ts +1 -0
  329. package/node_modules/@entelligentsia/forge-compress/dist/forge/validate.js +82 -0
  330. package/node_modules/@entelligentsia/forge-compress/dist/index.d.ts +6 -0
  331. package/node_modules/@entelligentsia/forge-compress/dist/index.js +5 -0
  332. package/node_modules/@entelligentsia/forge-compress/dist/progressive.d.ts +1 -0
  333. package/node_modules/@entelligentsia/forge-compress/dist/progressive.js +108 -0
  334. package/node_modules/@entelligentsia/forge-compress/dist/strip.d.ts +4 -0
  335. package/node_modules/@entelligentsia/forge-compress/dist/strip.js +55 -0
  336. package/node_modules/@entelligentsia/forge-compress/dist/tokens.d.ts +2 -0
  337. package/node_modules/@entelligentsia/forge-compress/dist/tokens.js +17 -0
  338. package/node_modules/@entelligentsia/forge-compress/package.json +45 -0
  339. package/node_modules/@entelligentsia/forge-compress/src/__tests__/compress.test.ts +409 -0
  340. package/node_modules/@entelligentsia/forge-compress/src/compressor.ts +147 -0
  341. package/node_modules/@entelligentsia/forge-compress/src/entropy.ts +105 -0
  342. package/node_modules/@entelligentsia/forge-compress/src/forge/entity.ts +184 -0
  343. package/node_modules/@entelligentsia/forge-compress/src/forge/index.ts +10 -0
  344. package/node_modules/@entelligentsia/forge-compress/src/forge/markdown.ts +122 -0
  345. package/node_modules/@entelligentsia/forge-compress/src/forge/query.ts +105 -0
  346. package/node_modules/@entelligentsia/forge-compress/src/forge/validate.ts +86 -0
  347. package/node_modules/@entelligentsia/forge-compress/src/index.ts +22 -0
  348. package/node_modules/@entelligentsia/forge-compress/src/progressive.ts +123 -0
  349. package/node_modules/@entelligentsia/forge-compress/src/strip.ts +58 -0
  350. package/node_modules/@entelligentsia/forge-compress/src/tokens.ts +19 -0
  351. package/package.json +10 -15
  352. package/dist/extensions/forgecli/forge-init/phase-descriptors.d.ts +0 -72
  353. package/dist/extensions/forgecli/forge-init/phase-descriptors.js +0 -359
  354. package/dist/extensions/forgecli/forge-init/phase-descriptors.js.map +0 -1
  355. package/dist/extensions/forgecli/forge-init/prompts.d.ts +0 -10
  356. package/dist/extensions/forgecli/forge-init/prompts.js +0 -91
  357. package/dist/extensions/forgecli/forge-init/prompts.js.map +0 -1
  358. package/dist/extensions/forgecli/lib/store-error-remediation.d.ts +0 -65
  359. package/dist/extensions/forgecli/lib/store-error-remediation.js +0 -298
  360. package/dist/extensions/forgecli/lib/store-error-remediation.js.map +0 -1
  361. package/dist/forge-payload/hooks/check-update.js +0 -378
  362. package/dist/forge-payload/hooks/forge-permissions.js +0 -164
  363. package/dist/forge-payload/hooks/triage-error.js +0 -77
  364. package/dist/forge-payload/hooks/validate-write.js +0 -250
@@ -0,0 +1,84 @@
1
+ ---
2
+ requirements:
3
+ reasoning: High
4
+ context: Medium
5
+ speed: Low
6
+ deps:
7
+ personas: [product-manager]
8
+ skills: [architect, generic]
9
+ templates: [SPRINT_REQUIREMENTS_TEMPLATE, SPRINT_MANIFEST_TEMPLATE]
10
+ sub_workflows: []
11
+ kb_docs: [MASTER_INDEX.md, architecture/stack.md]
12
+ config_fields: [project.prefix, paths.engineering]
13
+ ---
14
+
15
+ # 🌸 Meta-Workflow: Sprint Intake
16
+
17
+ ## Purpose
18
+
19
+ Capture sprint requirements via a structured interview and document them for planning.
20
+
21
+ <!-- See _fragments/iron-laws.md for Iron Laws section structure guidance -->
22
+ ## Iron Laws
23
+
24
+ - Capture requirements accurately; do not editorialize or pre-select options on the user's behalf. The product manager documents what the user says, not what the agent thinks is best.
25
+ - Read `.forge/personas/product-manager.md` first; print the persona identity line (emoji, name, tagline) to stdout before any other tool use.
26
+ - All store I/O via `forge_store` (or `node "$FORGE_ROOT/tools/store-cli.cjs"`). Never edit `.forge/store/*.json` directly.
27
+
28
+ ## Algorithm
29
+
30
+ ```
31
+ 0. Project Orientation:
32
+ - Your current working directory is the project root.
33
+ - Forge config lives at `.forge/config.json` (relative to cwd); the `forge_config` MCP tool returns canonical values.
34
+ - Engineering knowledge lives under `engineering/` (relative to cwd) — `MASTER_INDEX.md`, `architecture/`, `business-domain/`, `sprints/`, `features/`.
35
+ - Paths in subsequent steps resolve against this cwd.
36
+
37
+ 1. Pre-flight Gate Check:
38
+ - Probe token reporting: if the host runtime exposes a `/cost` slash command
39
+ (Claude Code), invoke it; on any other runtime treat as unavailable and
40
+ proceed. Do NOT search for or invent a `cost-cli.cjs` — there is no such tool.
41
+ - If the probe succeeds → note for later (will use reported data)
42
+ - If the probe fails or is unavailable → note for later (will use estimates)
43
+
44
+ 2. Load Context:
45
+ - Read `engineering/MASTER_INDEX.md` (relative to cwd)
46
+ - Read any pending feature requests or bug reports under `engineering/`
47
+
48
+ 3. Requirements Interview:
49
+ - Conduct a structured interview with the user
50
+ - Capture: Objectives, Constraints, Deliverables, and Success Criteria
51
+ - Clarify ambiguous requirements through iterative questioning
52
+
53
+ 4. Document Requirements:
54
+ - Generate `engineering/sprints/<SPRINT_ID>/SPRINT_REQUIREMENTS.md`
55
+ - Map requirements to existing Features if applicable
56
+ - Ensure all deliverables are measurable and testable
57
+
58
+ 5. Finalize:
59
+ - Update sprint status via `node "$FORGE_ROOT/tools/store-cli.cjs" update-status sprint {sprintId} status planning`
60
+ - **Do NOT emit a phase event yourself.** The orchestrator (or kickoff handler) owns event emission — it composes the canonical event from runtime telemetry (model, provider, tokens, wall times) plus the SUMMARY you write in the next step. Subagents that call `store-cli emit` for phase events hallucinate runtime facts (see Plan 11 / Slice 2). Write the SUMMARY and return.
61
+ ```
62
+
63
+ <!-- See _fragments/generation-instructions.md for Generation Instructions template -->
64
+ ## Generation Instructions
65
+
66
+ - **Persona Self-Load:** The generated workflow MUST begin by reading `.forge/personas/product-manager.md` as its first step (before any other tool use). This replaces the former inline `## Persona` section. The persona identity line (emoji, name, tagline) should be printed to stdout after reading the file.
67
+ - **Workflow Structure:** The generated `sprint_intake.md` must follow the strict "Algorithm" block format.
68
+ - **Context Isolation:** Forbid inline execution of requirement analysis; use the `Agent` tool for sub-tasks.
69
+ - **Project Specifics:**
70
+ - Reference project-specific requirement templates.
71
+ - **Token Reporting:** The generated workflow MUST mandate the following before returning:
72
+ 1. Probe session token usage: invoke `/cost` if the host runtime supports it
73
+ (Claude Code only); on any other runtime treat as unavailable. Do NOT
74
+ shell out to a `cost-cli.cjs` — there is no such tool.
75
+ 2. If the probe succeeds:
76
+ - Parse: `inputTokens`, `outputTokens`, `cacheReadTokens`, `cacheWriteTokens`, `estimatedCostUSD`.
77
+ - Add `"source": "reported"` to sidecar JSON.
78
+ 3. If the probe fails or is unavailable:
79
+ - Set token fields to `null`: `"inputTokens": null, "outputTokens": null, "estimatedCostUSD": null`.
80
+ - Add `"source": "missing"` to sidecar JSON.
81
+ - Log: "Token data unavailable (cost probe failed). Backfill later via estimate-usage.cjs."
82
+ 4. Write the usage sidecar via `node "$FORGE_ROOT/tools/store-cli.cjs" emit {sprintId} '{sidecar-json}' --sidecar`.
83
+ 5. **NEVER skip sidecar write.** Always emit (reported or placeholder with nulls).
84
+ - **Event Emission:** Ensure the "complete" event includes the `eventId` passed by the orchestrator.
@@ -172,7 +172,7 @@ and what capabilities it has. Two modes are supported, selected by the
172
172
  | `reference` | Compact summary from `.forge/cache/persona-pack.json`, plus a file_ref pointer to the full persona/skill definitions. | ✅ |
173
173
  | `inline` | Legacy: inject the full verbatim persona and skill file contents. Kept for one version as a rollback path. | |
174
174
 
175
- The pack is built by `/forge:regenerate` and `/forge:materialize` via
175
+ The pack is built by `/forge:rebuild` via
176
176
  `forge/tools/build-persona-pack.cjs`. It compiles YAML frontmatter from
177
177
  `$FORGE_ROOT/meta/personas/meta-*.md` and `$FORGE_ROOT/meta/skills/meta-*.md`
178
178
  into `.forge/cache/persona-pack.json`.
@@ -199,7 +199,7 @@ def compose_role_block(persona_noun):
199
199
  # regeneration bug and should be reported via /forge:report-bug.
200
200
  raise OrchestratorError(
201
201
  f"persona '{persona_noun}' not in persona-pack. "
202
- "Run /forge:regenerate to rebuild the pack."
202
+ "Run /forge:rebuild to rebuild the pack."
203
203
  )
204
204
 
205
205
  lines = [
@@ -435,6 +435,20 @@ for each task in dependency_sorted(tasks):
435
435
  # --- Load finalize fragment (token reporting contract) ---
436
436
  finalize_fragment = read_file(f"{FORGE_ROOT}/meta/workflows/_fragments/finalize.md") if file_exists(f"{FORGE_ROOT}/meta/workflows/_fragments/finalize.md") else ""
437
437
 
438
+ # --- Compose review loop context block (review-role phases only) ---
439
+ # Injected between summary_block and role_block so reviewers know their
440
+ # position in the revision loop at the moment they are spawned.
441
+ # `iteration` is the current attempt number (pre-spawn, not post-increment).
442
+ # `phase.maxIterations` is the configured limit (default 3).
443
+ if phase.role in ("review-plan", "review-code", "validate"):
444
+ review_loop_context = (
445
+ f"### Review Loop Context\n"
446
+ f"- Iteration: {iteration} of {phase.maxIterations}\n"
447
+ f"- Is final iteration: {iteration >= phase.maxIterations}\n\n"
448
+ )
449
+ else:
450
+ review_loop_context = ""
451
+
438
452
  spawn_kwargs = dict(
439
453
  prompt=(
440
454
  f"Append progress entries to {progress_log_path} via store-cli "
@@ -442,6 +456,7 @@ for each task in dependency_sorted(tasks):
442
456
  f"---\n\n"
443
457
  f"{architecture_block}"
444
458
  f"{summary_block}"
459
+ f"{review_loop_context}"
445
460
  f"{role_block}\n\n"
446
461
  f"### Project Context\n"
447
462
  f"{overlay_md}\n\n"
@@ -490,6 +505,7 @@ for each task in dependency_sorted(tasks):
490
505
  f"- Banner key: {banner_name}\n\n"
491
506
  f"Append progress entries as you work.\n\n"
492
507
  f"---\n\n"
508
+ f"{review_loop_context}"
493
509
  f"{role_block}\n\n"
494
510
  f"### Current Working Context\n"
495
511
  f"- Sprint Root: {sprint_root_path}\n"
@@ -952,7 +968,7 @@ Refer subagents to `.forge/schemas/event.schema.json` instead.
952
968
 
953
969
  ## Friction Emit
954
970
 
955
- When the Orchestrator detects skill friction during orchestrate-task — a referenced skill is unused, fails on invocation, is missing from the registry, has gone stale relative to current architecture, or is redundant with another skill — emit a `friction` event so `/forge:enhance --phase 2` can act on the signal. This is the writer side of the channel whose reader landed in S13-T08; the reader is empty without these emits.
971
+ When the Orchestrator detects skill friction during orchestrate-task — a referenced skill is unused, fails on invocation, is missing from the registry, has gone stale relative to current architecture, or is redundant with another skill — emit a `friction` event so `/forge:rebuild --enrich` (phase 2) can act on the signal. This is the writer side of the channel whose reader landed in S13-T08; the reader is empty without these emits.
956
972
 
957
973
  **Trigger conditions** (set `issue` to the matching token):
958
974
 
@@ -992,4 +1008,4 @@ experimental `^x_[a-z_]+$`. Emit one record per distinct friction signal
992
1008
  — do not coalesce.
993
1009
 
994
1010
  The generated `orchestrate_task.md` MUST carry this section verbatim —
995
- `/forge:enhance --phase 2` greps for it.
1011
+ `/forge:rebuild --enrich` (phase 2) greps for it.
@@ -0,0 +1,152 @@
1
+ ---
2
+ requirements:
3
+ reasoning: High
4
+ context: Medium
5
+ speed: Low
6
+ deps:
7
+ personas: [architect]
8
+ skills: [architect, generic]
9
+ templates: [SPRINT_MANIFEST_TEMPLATE, TASK_PROMPT_TEMPLATE]
10
+ sub_workflows: []
11
+ kb_docs: [MASTER_INDEX.md, architecture/stack.md]
12
+ config_fields: [project.prefix, paths.engineering]
13
+ ---
14
+
15
+ # 🗻 Meta-Workflow: Sprint Plan
16
+
17
+ ## Purpose
18
+
19
+ Break sprint requirements into a set of estimated tasks with a dependency graph.
20
+
21
+ ## Algorithm
22
+
23
+ ```
24
+ 0. Pre-flight Gate Check:
25
+ - Probe token reporting: if the host runtime exposes a `/cost` slash command
26
+ (Claude Code), invoke it; on any other runtime treat as unavailable. Do
27
+ NOT search for or invent a `cost-cli.cjs` — there is no such tool.
28
+ - If the probe succeeds → note for later (will use reported data)
29
+ - If the probe fails or is unavailable → note for later (will use estimates)
30
+
31
+ 1. Load Context:
32
+ - Query the store to orient on current project state before reading docs:
33
+ ```sh
34
+ node "$FORGE_ROOT/tools/store-cli.cjs" nlp "latest sprint"
35
+ node "$FORGE_ROOT/tools/store-cli.cjs" nlp "open bugs"
36
+ ```
37
+ Use results (titles, statuses, excerpts, file refs) to skip manual MASTER_INDEX.md navigation where sufficient.
38
+ - Read SPRINT_REQUIREMENTS.md
39
+ - Read architecture and domain docs
40
+ - Read the stack checklist
41
+
42
+ 2. Task Decomposition:
43
+ - Break requirements into atomic tasks
44
+ - Assign each task to a Feature (if applicable)
45
+ - Define clear acceptance criteria for each task
46
+ - Use the `ID-description` format (e.g., `FORGE-S05-agent-runtime-portability`) for sprint and task folders.
47
+
48
+ 3. Estimation and Sequencing:
49
+ - Estimate each task (S, M, L) based on complexity
50
+ - Define the dependency graph (which tasks must precede others)
51
+ - Identify the critical path
52
+
53
+ 4. Documentation:
54
+ - Write SPRINT_PLAN.md to `engineering/sprints/{sprintId}/SPRINT_PLAN.md`
55
+ - Create each task via `node "$FORGE_ROOT/tools/store-cli.cjs" write task '{task-json}'`.
56
+ If the command exits non-zero or the PreToolUse hook blocks the write:
57
+ parse the error, correct the JSON, and retry (see Store-Write Verification).
58
+ Do not proceed to the next task until this write succeeds.
59
+ - Update the sprint record with all new task IDs via `node "$FORGE_ROOT/tools/store-cli.cjs" write sprint '{updated-sprint-json}'` (the sprint JSON must include the complete `taskIds` array with all newly created task IDs).
60
+ If the command exits non-zero or the PreToolUse hook blocks the write:
61
+ parse the error, correct the JSON, and retry (see Store-Write Verification).
62
+ Do not proceed until this write succeeds.
63
+ - For each task, create its task folder and write TASK_PROMPT.md:
64
+ * Folder: `engineering/sprints/{sprintId}/{taskId}/`
65
+ * File: `TASK_PROMPT.md` — populate from `.forge/templates/TASK_PROMPT_TEMPLATE.md`
66
+ filling in title, objective, acceptance criteria, entities, DSL/CLI changes, and operational impact
67
+ - Update sprint status via `node "$FORGE_ROOT/tools/store-cli.cjs" update-status sprint {sprintId} status active`.
68
+ If the command exits non-zero, parse the error and retry
69
+ (see Store-Write Verification). Do not proceed until this write succeeds.
70
+
71
+ 5. Finalize:
72
+ - **Do NOT emit a phase event yourself.** The orchestrator (or kickoff handler) owns event emission — it composes the canonical event from runtime telemetry (model, provider, tokens, wall times) plus the SUMMARY you write in the next step. Subagents that call `store-cli emit` for phase events hallucinate runtime facts (see Plan 11 / Slice 2). Write the SUMMARY and return.
73
+ ```
74
+
75
+ <!-- See _fragments/iron-laws.md for Iron Laws section structure guidance (sprint-plan uses verbatim Anti-Pattern Guard pattern — orchestrator-special case) -->
76
+ ## Anti-Pattern Guard
77
+
78
+ The generated workflow MUST include the following section verbatim, placed immediately
79
+ after the Purpose heading and before the Algorithm block:
80
+
81
+ ```
82
+ ## Iron Laws
83
+
84
+ - YOU MUST NOT write any code, pseudocode, or implementation sketch.
85
+ - YOU MUST NOT produce a plan of your own before reading this workflow.
86
+ - YOU MUST follow the Algorithm below step by step. Reading it is not optional.
87
+ - If you have already read SPRINT_REQUIREMENTS.md and feel ready to decompose tasks:
88
+ stop. Return to step 1 of the Algorithm and proceed from there.
89
+ ```
90
+
91
+ <!-- See _fragments/store-write-verification.md — NOTE: this file uses an intentionally expanded
92
+ Store-Write Verification variant that explains what counts as a store write in the sprint-plan
93
+ context (includes direct Write/Edit tool calls). Canonical fragment is reference only. -->
94
+ ## Store-Write Verification
95
+
96
+ Every write to the Forge store MUST succeed before the agent proceeds to the next
97
+ step. Store writes include `store-cli` commands (`write`, `update-status`, `emit`)
98
+ and direct `Write`/`Edit` tool calls against Forge-owned paths under
99
+ `.forge/store/`.
100
+
101
+ If a write is rejected — either by `store-cli` exiting non-zero or by the
102
+ `PreToolUse` write-boundary hook blocking the call with exit code 2 — the agent
103
+ MUST:
104
+
105
+ 1. **Parse the error.** Both `store-cli` and the write-boundary hook emit
106
+ structured messages naming the offending field and referencing the relevant
107
+ schema file (e.g. `forge/schemas/task.schema.json`). Read the error carefully
108
+ to identify which field is wrong and what the schema expects.
109
+ 2. **Correct the data.** Fix the JSON payload to satisfy the schema: add missing
110
+ required fields, fix type mismatches, remove undeclared properties, correct
111
+ enum values, etc. If the hook message mentions a schema file, read that file
112
+ to understand the full shape.
113
+ 3. **Retry the write.** Re-attempt the same store write with the corrected payload.
114
+ 4. **Repeat until success.** Do NOT advance past the current step, emit events,
115
+ or produce further artifacts until the write is confirmed successful.
116
+
117
+ **Maximum retries: 3.** If the write still fails after 3 correction attempts,
118
+ halt and escalate to the human. Include the original payload, the corrected
119
+ payload, and all error messages in the escalation.
120
+
121
+ **Do NOT** set `FORGE_SKIP_WRITE_VALIDATION=1` to bypass a schema error. That
122
+ environment variable is reserved for emergency operator repair only.
123
+
124
+ <!-- See _fragments/generation-instructions.md for Generation Instructions template -->
125
+ ## Generation Instructions
126
+
127
+ - **Persona Self-Load:** The generated workflow MUST begin by reading `.forge/personas/architect.md` as its first step (before any other tool use). This replaces the former inline `## Persona` section. The persona identity line (emoji, name, tagline) should be printed to stdout after reading the file.
128
+ - **Workflow Structure:** The generated `sprint_plan.md` must follow the strict "Algorithm" block format.
129
+ - **Context Isolation:** Forbid inline execution of task decomposition or estimation; use the `Agent` tool for sub-tasks.
130
+ - **Project Specifics:**
131
+ - Use project-specific estimation guidelines.
132
+ - Reference project's task manifest schema.
133
+ - **Token Reporting:** The generated workflow MUST mandate the following before returning:
134
+ 1. Probe session token usage: invoke `/cost` if the host runtime supports it
135
+ (Claude Code only); on any other runtime treat as unavailable. Do NOT
136
+ shell out to a `cost-cli.cjs` — there is no such tool.
137
+ 2. If the probe succeeds:
138
+ - Parse: `inputTokens`, `outputTokens`, `cacheReadTokens`, `cacheWriteTokens`, `estimatedCostUSD`.
139
+ - Add `"source": "reported"` to sidecar JSON.
140
+ 3. If the probe fails or is unavailable:
141
+ - Set token fields to `null`: `"inputTokens": null, "outputTokens": null, "estimatedCostUSD": null`.
142
+ - Add `"source": "missing"` to sidecar JSON.
143
+ - Log: "Token data unavailable (cost probe failed). Backfill later via estimate-usage.cjs."
144
+ 4. Write the usage sidecar via `node "$FORGE_ROOT/tools/store-cli.cjs" emit {sprintId} '{sidecar-json}' --sidecar`.
145
+ 5. **NEVER skip sidecar write.** Always emit (reported or placeholder with nulls).
146
+ - **Event Emission:** Ensure the "complete" event includes the `eventId` passed by the orchestrator.
147
+ - **Store-Write Verification:** The generated workflow MUST include the "Store-Write
148
+ Verification" section verbatim. Every `store-cli write`, `store-cli update-status`,
149
+ and `store-cli emit` command in the Algorithm must be annotated with the
150
+ parse-correct-retry instruction: "If the command exits non-zero or the
151
+ PreToolUse hook blocks the write: parse the error, correct the JSON, and retry
152
+ (see Store-Write Verification). Do not proceed until this write succeeds."
@@ -30,13 +30,25 @@ The Engineer reads the task prompt, researches the codebase, and produces an imp
30
30
 
31
31
  ```
32
32
 
33
- 0. Pre-flight Gate Check:
33
+ 0a. Pre-flight Gate Check:
34
34
  - Resolve FORGE_ROOT (`node -e "console.log(require('./.forge/config.json').paths.forgeRoot)"`).
35
35
  - **Entity-mode resolution:** read the kickoff arguments. `--task {id}` → `entity_kind = "task"`, `record_id = {id}`. `--bug {id}` → `entity_kind = "bug"`, `record_id = {id}`. All store-cli calls below substitute `{entity_kind}` and `{record_id}` for the literal "task"/{taskId} placeholders.
36
36
  - Run: `node "$FORGE_ROOT/tools/preflight-gate.cjs" --phase plan --{entity_kind} {record_id}`
37
37
  - Exit 1 (gate failed) → print stderr and HALT. Do not proceed; do not attempt to produce the artifact.
38
38
  - Exit 2 (misconfiguration) → print stderr and HALT.
39
39
  - Exit 0 → continue.
40
+
41
+ 0b. Pipeline Step Guard (user-invoked state check):
42
+ - If `--force` is present in the invocation arguments, skip this step entirely.
43
+ - If `entity_kind == "bug"`, skip this step entirely (bug state is managed by meta-fix-bug.md).
44
+ - Read current task state:
45
+ `node "$FORGE_ROOT/tools/store-cli.cjs" read task {record_id} --json`
46
+ - Extract the `status` field from the JSON output.
47
+ - Allowed states for this phase: `draft`, `planned`, `plan-revision-required`.
48
+ - If the current status is NOT in the allowed set:
49
+ Print the following and HALT (do not proceed):
50
+ `× Task {record_id} is in state '{status}' — /forge:plan cannot run from this state; a reset or reassignment must complete first. To run the full pipeline: /forge:run-task {record_id}`
51
+
40
52
  1. Load Context:
41
53
  - Read `.forge/personas/architect.md` first; print the persona identity line (emoji, name, tagline) to stdout before any other tool use.
42
54
  - store-cli verbs: `read` | `list` | `write` | `emit` | `update-status` | `set-summary` | `describe` | `nlp` | `query` | `delete` — there is no `get`/`set`/`find`. See `_fragments/store-cli-verbs.md` for full notes; run `--help` before improvising.
@@ -0,0 +1,73 @@
1
+ ---
2
+ requirements:
3
+ reasoning: High
4
+ context: Medium
5
+ speed: Low
6
+ deps:
7
+ personas: [architect]
8
+ skills: [architect, generic]
9
+ templates: [RETROSPECTIVE_TEMPLATE]
10
+ sub_workflows: []
11
+ kb_docs: [architecture/stack.md]
12
+ config_fields: [paths.engineering]
13
+ ---
14
+
15
+ # 🗻 Meta-Workflow: Retrospective
16
+
17
+ ## Purpose
18
+
19
+ Close a sprint by reviewing learnings, updating the knowledge base, and improving workflows.
20
+
21
+ <!-- See _fragments/iron-laws.md for Iron Laws section structure guidance -->
22
+ ## Iron Laws
23
+
24
+ - Never mutate JSON records during retrospective; the store is the source of truth and retrospective flows downstream from it. Retrospective operations read store data and write markdown views only.
25
+ - Read `.forge/personas/architect.md` first; print the persona identity line (emoji, name, tagline) to stdout before any other tool use.
26
+ - All store I/O via `forge_store` (or `node "$FORGE_ROOT/tools/store-cli.cjs"`). Never edit `.forge/store/*.json` directly.
27
+
28
+ ## Algorithm
29
+
30
+ ```
31
+ 1. Load Context:
32
+ - Read all task manifests for the sprint
33
+ - Read all event logs (including token usage)
34
+ - Read all retrospective notes gathered during the sprint
35
+
36
+ 2. Analysis:
37
+ - Calculate total sprint cost (tokens/USD)
38
+ - Identify "bottleneck" tasks (high iteration counts or long duration)
39
+ - Analyze common failure modes in reviews
40
+
41
+ 3. Knowledge Update:
42
+ - Update architecture/domain docs with "lessons learned"
43
+ - Propose improvements to meta-workflows based on analysis
44
+ - Update stack-checklist with new verification steps
45
+
46
+ 4. Finalize:
47
+ - Write SPRINT_RETROSPECTIVE.md
48
+ - Update sprint status via `node "$FORGE_ROOT/tools/store-cli.cjs" update-status sprint {sprintId} status retrospective-done`
49
+ - Run `node "$FORGE_ROOT/tools/collate.cjs" {sprintId} --purge-events`
50
+ This single deterministic step: generates COST_REPORT.md from all
51
+ accumulated events, then deletes `.forge/store/events/{sprintId}/`.
52
+ COST_REPORT.md is the durable record; the raw event files are not
53
+ retained after retrospective close.
54
+ - **Do NOT emit a phase event yourself.** The orchestrator (or kickoff handler) owns event emission — it composes the canonical event from runtime telemetry (model, provider, tokens, wall times) plus the SUMMARY you write in the next step. Subagents that call `store-cli emit` for phase events hallucinate runtime facts (see Plan 11 / Slice 2). Write the SUMMARY and return.
55
+ (tombstone — written after the purge; the only event in the directory
56
+ going forward)
57
+ ```
58
+
59
+ <!-- See _fragments/generation-instructions.md for Generation Instructions template -->
60
+ ## Generation Instructions
61
+
62
+ - **Persona Self-Load:** The generated workflow MUST begin by reading `.forge/personas/architect.md` as its first step (before any other tool use). This replaces the former inline `## Persona` section. The persona identity line (emoji, name, tagline) should be printed to stdout after reading the file.
63
+ - **Workflow Structure:** The generated `retrospective.md` must follow the strict "Algorithm" block format.
64
+ - **Context Isolation:** Forbid inline execution of cost analysis or doc updates; use the `Agent` tool for sub-tasks.
65
+ - **Project Specifics:**
66
+ - Reference project's cost reporting templates.
67
+ - **Token Reporting:** The generated workflow MUST mandate the following before returning:
68
+ 1. Probe session token usage: invoke `/cost` if the host runtime supports it
69
+ (Claude Code only); on any other runtime treat as unavailable and proceed.
70
+ Do NOT shell out to a `cost-cli.cjs` — there is no such tool.
71
+ 2. Parse: `inputTokens`, `outputTokens`, `cacheReadTokens`, `cacheWriteTokens`, `estimatedCostUSD`.
72
+ 3. Write the usage sidecar via `node "$FORGE_ROOT/tools/store-cli.cjs" emit {sprintId} '{sidecar-json}' --sidecar`.
73
+ - **Event Emission:** Ensure the "complete" event includes the `eventId` passed by the orchestrator.
@@ -41,43 +41,73 @@ The Supervisor reviews the Engineer's implementation for correctness, quality, a
41
41
 
42
42
  ```
43
43
 
44
- 0. Pre-flight Gate Check:
44
+ 0a. Pre-flight Gate Check:
45
45
  - Resolve FORGE_ROOT (`node -e "console.log(require('./.forge/config.json').paths.forgeRoot)"`).
46
46
  - **Entity-mode resolution:** read the kickoff arguments. `--task {id}` → `entity_kind = "task"`, `record_id = {id}`. `--bug {id}` → `entity_kind = "bug"`, `record_id = {id}`. All store-cli calls below substitute `{entity_kind}` and `{record_id}` for the literal "task"/{taskId} placeholders.
47
47
  - Run: `node "$FORGE_ROOT/tools/preflight-gate.cjs" --phase review-code --{entity_kind} {record_id}`
48
48
  - Exit 1 (gate failed) → print stderr and HALT. Do not proceed; do not attempt to produce the artifact.
49
49
  - Exit 2 (misconfiguration) → print stderr and HALT.
50
50
  - Exit 0 → continue.
51
- 1. Load Context:
51
+
52
+ 0b. Pipeline Step Guard (user-invoked state check):
53
+ - If `--force` is present in the invocation arguments, skip this step entirely.
54
+ - If `entity_kind == "bug"`, skip this step entirely (bug state is managed by meta-fix-bug.md).
55
+ - Read current task state:
56
+ `node "$FORGE_ROOT/tools/store-cli.cjs" read task {record_id} --json`
57
+ - Extract the `status` field from the JSON output.
58
+ - Allowed states for this phase: `implemented`, `implementing`.
59
+ - If the current status is NOT in the allowed set:
60
+ Print the following and HALT (do not proceed):
61
+ `× Task {record_id} is in state '{status}' — /forge:implement must complete first. To run the full pipeline: /forge:run-task {record_id}`
62
+
63
+ 1. Read Review Loop Context:
64
+ - Check the spawning prompt for a `### Review Loop Context` block.
65
+ - If present, extract:
66
+ - `Iteration: N of M` — current attempt number and the configured limit
67
+ - `Is final iteration: true/false`
68
+ - If absent (user-invoked, not orchestrated): treat as iteration 1 of M, where M is
69
+ read from `.forge/config.json` → `maxReviewIterations` (default 3 if field absent).
70
+ - Include `(iteration N of M)` in the opening line of the `CODE_REVIEW.md` artifact.
71
+ - If this is the final iteration (`N == M`) and the verdict is `Revision Required`,
72
+ append a `### Next Steps` section to the artifact showing:
73
+ ```
74
+ ### Next Steps
75
+ - Force-approve (bypass remaining reviews): `/forge:approve --force {task_id}`
76
+ - Increase iteration limit: edit `config.pipelines.{pipeline}.phases[review-code].maxIterations`
77
+ - Restart from review: `/forge:review-code {task_id}`
78
+ ```
79
+
80
+ 2. Load Context:
52
81
  - Read task prompt
53
82
  - Read approved PLAN.md
54
83
  - Read PROGRESS.md
55
84
 
56
85
  **Read mode: diff-first.** Read `git diff $(git merge-base HEAD origin/main)..HEAD -- <files-listed-in-PLAN>` first. Read full source files only when the diff context is insufficient to judge a finding (e.g., the change is an inversion of an invariant defined elsewhere). Do not pre-load full source — tool calls earn their tokens.
57
86
 
58
- 2. Review:
87
+ 3. Review:
59
88
  - Verify all plan steps were executed
60
89
  - Review code for quality, security, and architecture alignment
61
90
  - Verify test evidence in PROGRESS.md is authentic and complete
62
91
 
63
- 3. Verdict:
92
+ 4. Verdict:
64
93
  - Write the code review via forge_artifact:
65
94
  `forge_artifact({ command:"write", entity:"{entity_kind}", entityId:"{record_id}", artifact:"code-review", content:"<markdown>" })`
66
95
  Use the format:
67
96
  **Verdict:** [Approved | Revision Required]
68
97
  - If Revision Required: provide numbered, actionable items
69
98
  - If Approved: provide any advisory notes
99
+ - See step 1 for iteration header and final-iteration Next Steps requirements.
70
100
 
71
- 4. Knowledge Writeback:
101
+ 5. Knowledge Writeback:
72
102
  - Update stack-checklist.md if new patterns or pitfalls were discovered
73
103
 
74
- 5. Finalize:
104
+ 6. Finalize:
75
105
  - Transitions:
76
106
  - **Task mode** — Update status: `node "$FORGE_ROOT/tools/store-cli.cjs" update-status task {taskId} status review-approved` (if Approved) or `... status code-revision-required` (if Revision Required).
77
107
  - **Bug mode** — NO status write. The bug remains `in-progress`. The verdict signal travels through `summaries.code_review.verdict` (read by `read-verdict.cjs § BUG_PHASE_VERDICT_SOURCE`), not `bug.status`. Writing `bug.status` here violates `meta-fix-bug.md § Iron Laws #2`.
78
108
  - **Do NOT emit a phase event yourself.** The orchestrator (or kickoff handler) owns event emission — it composes the canonical event from runtime telemetry (model, provider, tokens, wall times) plus the SUMMARY you write in the next step. Subagents that call `store-cli emit` for phase events hallucinate runtime facts (see Plan 11 / Slice 2). Write the SUMMARY and return.
79
109
 
80
- 6. Emit Summary Sidecar:
110
+ 7. Emit Summary Sidecar:
81
111
  - Write the review summary via forge_artifact:
82
112
  `forge_artifact({ command:"write", entity:"{entity_kind}", entityId:"{record_id}", artifact:"review-impl-summary", content:"<JSON>" })`
83
113
  The JSON shape:
@@ -37,30 +37,60 @@ deps:
37
37
 
38
38
  ```
39
39
 
40
- 0. Pre-flight Gate Check:
40
+ 0a. Pre-flight Gate Check:
41
41
  - Resolve FORGE_ROOT (`node -e "console.log(require('./.forge/config.json').paths.forgeRoot)"`).
42
42
  - **Entity-mode resolution:** read the kickoff arguments. `--task {id}` → `entity_kind = "task"`, `record_id = {id}`. `--bug {id}` → `entity_kind = "bug"`, `record_id = {id}`. All store-cli calls below substitute `{entity_kind}` and `{record_id}` for the literal "task"/{taskId} placeholders.
43
43
  - Run: `node "$FORGE_ROOT/tools/preflight-gate.cjs" --phase review-plan --{entity_kind} {record_id}`
44
44
  - Exit 1 (gate failed) → print stderr and HALT. Do not proceed; do not attempt to produce the artifact.
45
45
  - Exit 2 (misconfiguration) → print stderr and HALT.
46
46
  - Exit 0 → continue.
47
- 1. Load Context:
47
+
48
+ 0b. Pipeline Step Guard (user-invoked state check):
49
+ - If `--force` is present in the invocation arguments, skip this step entirely.
50
+ - If `entity_kind == "bug"`, skip this step entirely (bug state is managed by meta-fix-bug.md).
51
+ - Read current task state:
52
+ `node "$FORGE_ROOT/tools/store-cli.cjs" read task {record_id} --json`
53
+ - Extract the `status` field from the JSON output.
54
+ - Allowed states for this phase: `planned`.
55
+ - If the current status is NOT in the allowed set:
56
+ Print the following and HALT (do not proceed):
57
+ `× Task {record_id} is in state '{status}' — /forge:plan must complete first. To run the full pipeline: /forge:run-task {record_id}`
58
+
59
+ 1. Read Review Loop Context:
60
+ - Check the spawning prompt for a `### Review Loop Context` block.
61
+ - If present, extract:
62
+ - `Iteration: N of M` — current attempt number and the configured limit
63
+ - `Is final iteration: true/false`
64
+ - If absent (user-invoked, not orchestrated): treat as iteration 1 of M, where M is
65
+ read from `.forge/config.json` → `maxReviewIterations` (default 3 if field absent).
66
+ - Include `(iteration N of M)` in the opening line of the `PLAN_REVIEW.md` artifact.
67
+ - If this is the final iteration (`N == M`) and the verdict is `Revision Required`,
68
+ append a `### Next Steps` section to the artifact showing:
69
+ ```
70
+ ### Next Steps
71
+ - Force-approve (bypass remaining reviews): `/forge:approve --force {task_id}`
72
+ - Increase iteration limit: edit `config.pipelines.{pipeline}.phases[review-plan].maxIterations`
73
+ - Restart from review: `/forge:review-plan {task_id}`
74
+ ```
75
+
76
+ 2. Load Context:
48
77
  - Read task prompt (source of truth)
49
78
  - Read PLAN.md (subject of review)
50
79
  - Read stack checklist if available
51
80
 
52
- 2. Review:
81
+ 3. Review:
53
82
  - Evaluate feasibility, completeness, security, architecture alignment, and testing strategy
54
83
  - Identify missing edge cases or failure modes
55
84
 
56
- 3. Verdict:
85
+ 4. Verdict:
57
86
  - Write the plan review via forge_artifact: forge_artifact({ command:"write", entity:"{entity_kind}", entityId:"{record_id}", artifact:"plan-review", content:"<markdown>" })
58
87
  Use the format:
59
88
  **Verdict:** [Approved | Revision Required]
60
89
  - If Revision Required: provide numbered, actionable items
61
90
  - If Approved: provide any advisory notes
91
+ - See step 1 for iteration header and final-iteration Next Steps requirements.
62
92
 
63
- 4. Finalize:
93
+ 5. Finalize:
64
94
  - Transitions:
65
95
  - **Task mode** — predecessor must be `planned`.
66
96
  - Approved → `plan-approved`
@@ -70,7 +100,7 @@ deps:
70
100
  - **Bug mode** — NO status write. The bug remains `in-progress`. The verdict signal travels through `summaries.review_plan.verdict` (read by `read-verdict.cjs § BUG_PHASE_VERDICT_SOURCE`), not `bug.status`. Writing `bug.status` here violates `meta-fix-bug.md § Iron Laws #2`.
71
101
  - **Do NOT emit a phase event yourself.** The orchestrator owns event emission — it composes the canonical event from runtime telemetry (model, provider, tokens, wall times) plus the SUMMARY you write in the next step. Subagents that call `store-cli emit` for phase events hallucinate runtime facts (see Plan 11 / Slice 2). Write the SUMMARY and return.
72
102
 
73
- 5. Emit Summary Sidecar:
103
+ 6. Emit Summary Sidecar:
74
104
  - Write the review-plan summary via forge_artifact: forge_artifact({ command:"write", entity:"{entity_kind}", entityId:"{record_id}", artifact:"review-plan-summary", content:"<JSON>" })
75
105
  The JSON must have the following shape:
76
106
  ```json
@@ -41,38 +41,68 @@ The Supervisor performs a final validation of the implementation against the acc
41
41
 
42
42
  ```
43
43
 
44
- 0. Pre-flight Gate Check:
44
+ 0a. Pre-flight Gate Check:
45
45
  - Resolve FORGE_ROOT (`node -e "console.log(require('./.forge/config.json').paths.forgeRoot)"`).
46
- - Run: `node "$FORGE_ROOT/tools/preflight-gate.cjs" --phase validate --task {taskId}`
46
+ - **Entity-mode resolution:** read the kickoff arguments. `--task {id}` → `entity_kind = "task"`, `record_id = {id}`. `--bug {id}` → `entity_kind = "bug"`, `record_id = {id}`. All store-cli calls below substitute `{entity_kind}` and `{record_id}` for the literal "task"/{taskId} placeholders.
47
+ - Run: `node "$FORGE_ROOT/tools/preflight-gate.cjs" --phase validate --{entity_kind} {record_id}`
47
48
  - Exit 1 (gate failed) → print stderr and HALT. Do not proceed; do not attempt to produce the artifact.
48
49
  - Exit 2 (misconfiguration) → print stderr and HALT.
49
50
  - Exit 0 → continue.
50
51
 
51
- 1. Load Context:
52
+ 0b. Pipeline Step Guard (user-invoked state check):
53
+ - If `--force` is present in the invocation arguments, skip this step entirely.
54
+ - If `entity_kind == "bug"`, skip this step entirely (bug state is managed by meta-fix-bug.md).
55
+ - Read current task state:
56
+ `node "$FORGE_ROOT/tools/store-cli.cjs" read task {record_id} --json`
57
+ - Extract the `status` field from the JSON output.
58
+ - Allowed states for this phase: `implemented`, `review-approved`.
59
+ - If the current status is NOT in the allowed set:
60
+ Print the following and HALT (do not proceed):
61
+ `× Task {record_id} is in state '{status}' — /forge:implement must complete first. To run the full pipeline: /forge:run-task {record_id}`
62
+
63
+ 1. Read Review Loop Context:
64
+ - Check the spawning prompt for a `### Review Loop Context` block.
65
+ - If present, extract:
66
+ - `Iteration: N of M` — current attempt number and the configured limit
67
+ - `Is final iteration: true/false`
68
+ - If absent (user-invoked, not orchestrated): treat as iteration 1 of M, where M is
69
+ read from `.forge/config.json` → `maxReviewIterations` (default 3 if field absent).
70
+ - Include `(iteration N of M)` in the opening line of the `VALIDATION_REPORT.md` artifact.
71
+ - If this is the final iteration (`N == M`) and the verdict is `Revision Required`,
72
+ append a `### Next Steps` section to the artifact showing:
73
+ ```
74
+ ### Next Steps
75
+ - Force-approve (bypass remaining reviews): `/forge:approve --force {task_id}`
76
+ - Increase iteration limit: edit `config.pipelines.{pipeline}.phases[validate].maxIterations`
77
+ - Restart from validation: `/forge:validate {task_id}`
78
+ ```
79
+
80
+ 2. Load Context:
52
81
  - Read task prompt
53
82
  - Read approved PLAN.md
54
83
  - Read the implementation
55
84
  - Read PROGRESS.md
56
85
 
57
- 2. Validation:
86
+ 3. Validation:
58
87
  - Execute the "Acceptance Criteria" checklist from the plan
59
88
  - Verify that all technical constraints (e.g., performance, security) are met
60
89
  - Check for any regressions in related functionality
61
90
  - When re-running the test suite, use the **resolved test command** from `commands.test` in `.forge/config.json` (i.e. `` `${commands.test}` ``, e.g. `.venv/bin/python -m pytest`). Template placeholder: {{TEST_COMMAND}}. Do NOT invoke bare `python` / `python3` — the project interpreter is rarely on `$PATH`.
62
91
 
63
- 3. Verdict:
92
+ 4. Verdict:
64
93
  - Write the validation report via:
65
94
  `forge_artifact({ command:"write", entity:"{entity_kind}", entityId:"{record_id}", artifact:"validation-report", content:"<markdown>" })`
66
95
  The markdown content must use the format:
67
96
  **Verdict:** [Approved | Revision Required]
68
97
  - If Revision Required: list the failed criteria and required fixes
69
98
  - If Approved: confirm the task is validated
99
+ - See step 1 for iteration header and final-iteration Next Steps requirements.
70
100
 
71
- 4. Finalize:
101
+ 5. Finalize:
72
102
  - Update task status via `node "$FORGE_ROOT/tools/store-cli.cjs" update-status task {taskId} status review-approved` (if Approved) or `node "$FORGE_ROOT/tools/store-cli.cjs" update-status task {taskId} status code-revision-required` (if Revision Required)
73
103
  - **Do NOT emit a phase event yourself.** The orchestrator owns event emission — it composes the canonical event from runtime telemetry (model, provider, tokens, wall times) plus the SUMMARY you write in the next step. Subagents that call `store-cli emit` for phase events hallucinate runtime facts (see Plan 11 / Slice 2). Write the SUMMARY and return.
74
104
 
75
- 5. Emit Summary Sidecar:
105
+ 6. Emit Summary Sidecar:
76
106
  - Write the validation summary via:
77
107
  `forge_artifact({ command:"write", entity:"{entity_kind}", entityId:"{record_id}", artifact:"validation-summary", content:"<JSON>" })`
78
108
  The JSON content must have the following shape: