@entelligentsia/forgecli 1.0.3 → 1.0.14

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 (497) hide show
  1. package/CHANGELOG.md +93 -0
  2. package/README.md +2 -1
  3. package/dist/CHANGELOG-forge-plugin.md +250 -0
  4. package/dist/CHANGELOG-pi.md +94 -0
  5. package/dist/bin/forge.js +0 -0
  6. package/dist/extensions/forgecli/config-layer.d.ts +16 -0
  7. package/dist/extensions/forgecli/config-layer.js +5 -0
  8. package/dist/extensions/forgecli/config-layer.js.map +1 -1
  9. package/dist/extensions/forgecli/dashboard/component.d.ts +102 -0
  10. package/dist/extensions/forgecli/dashboard/component.js +882 -0
  11. package/dist/extensions/forgecli/dashboard/component.js.map +1 -0
  12. package/dist/extensions/forgecli/dashboard/register.d.ts +2 -0
  13. package/dist/extensions/forgecli/dashboard/register.js +45 -0
  14. package/dist/extensions/forgecli/dashboard/register.js.map +1 -0
  15. package/dist/extensions/forgecli/dashboard/view-model.d.ts +35 -0
  16. package/dist/extensions/forgecli/dashboard/view-model.js +54 -0
  17. package/dist/extensions/forgecli/dashboard/view-model.js.map +1 -0
  18. package/dist/extensions/forgecli/fix-bug.js +72 -7
  19. package/dist/extensions/forgecli/fix-bug.js.map +1 -1
  20. package/dist/extensions/forgecli/forge-artifact-tool.js +27 -4
  21. package/dist/extensions/forgecli/forge-artifact-tool.js.map +1 -1
  22. package/dist/extensions/forgecli/forge-cli-schema.json +4 -0
  23. package/dist/extensions/forgecli/forge-commands.js +1 -0
  24. package/dist/extensions/forgecli/forge-commands.js.map +1 -1
  25. package/dist/extensions/forgecli/forge-init/phase4-register.js +53 -0
  26. package/dist/extensions/forgecli/forge-init/phase4-register.js.map +1 -1
  27. package/dist/extensions/forgecli/forge-subagent.js +6 -4
  28. package/dist/extensions/forgecli/forge-subagent.js.map +1 -1
  29. package/dist/extensions/forgecli/forge-tools.js +2 -2
  30. package/dist/extensions/forgecli/forge-tools.js.map +1 -1
  31. package/dist/extensions/forgecli/index.js +5 -0
  32. package/dist/extensions/forgecli/index.js.map +1 -1
  33. package/dist/extensions/forgecli/lib/halt-advisor.d.ts +54 -0
  34. package/dist/extensions/forgecli/lib/halt-advisor.js +90 -0
  35. package/dist/extensions/forgecli/lib/halt-advisor.js.map +1 -0
  36. package/dist/extensions/forgecli/migration-engine.js +25 -12
  37. package/dist/extensions/forgecli/migration-engine.js.map +1 -1
  38. package/dist/extensions/forgecli/orchestrator-status-bar.d.ts +25 -0
  39. package/dist/extensions/forgecli/orchestrator-status-bar.js +183 -0
  40. package/dist/extensions/forgecli/orchestrator-status-bar.js.map +1 -0
  41. package/dist/extensions/forgecli/orchestrator-tree.d.ts +96 -0
  42. package/dist/extensions/forgecli/orchestrator-tree.js +390 -0
  43. package/dist/extensions/forgecli/orchestrator-tree.js.map +1 -0
  44. package/dist/extensions/forgecli/project-orientation.js +12 -8
  45. package/dist/extensions/forgecli/project-orientation.js.map +1 -1
  46. package/dist/extensions/forgecli/regenerate.d.ts +16 -0
  47. package/dist/extensions/forgecli/regenerate.js +110 -0
  48. package/dist/extensions/forgecli/regenerate.js.map +1 -1
  49. package/dist/extensions/forgecli/run-sprint.js +33 -3
  50. package/dist/extensions/forgecli/run-sprint.js.map +1 -1
  51. package/dist/extensions/forgecli/run-task.d.ts +32 -0
  52. package/dist/extensions/forgecli/run-task.js +185 -12
  53. package/dist/extensions/forgecli/run-task.js.map +1 -1
  54. package/dist/extensions/forgecli/subagent/phase-guard.js +15 -5
  55. package/dist/extensions/forgecli/subagent/phase-guard.js.map +1 -1
  56. package/dist/extensions/forgecli/subagent/phase-summary-map.d.ts +1 -0
  57. package/dist/extensions/forgecli/subagent/phase-summary-map.js +17 -0
  58. package/dist/extensions/forgecli/subagent/phase-summary-map.js.map +1 -1
  59. package/dist/extensions/forgecli/thread-switcher.js +105 -764
  60. package/dist/extensions/forgecli/thread-switcher.js.map +1 -1
  61. package/dist/extensions/forgecli/viewport-events.js +32 -0
  62. package/dist/extensions/forgecli/viewport-events.js.map +1 -1
  63. package/dist/forge-payload/.base-pack/commands/fix-bug.md +1 -1
  64. package/dist/forge-payload/.base-pack/commands/run-sprint.md +1 -1
  65. package/dist/forge-payload/.base-pack/commands/run-task.md +1 -1
  66. package/dist/forge-payload/.base-pack/personas/architect.md +1 -1
  67. package/dist/forge-payload/.base-pack/personas/bug-fixer.md +1 -1
  68. package/dist/forge-payload/.base-pack/personas/collator.md +3 -3
  69. package/dist/forge-payload/.base-pack/personas/engineer.md +1 -1
  70. package/dist/forge-payload/.base-pack/personas/librarian.md +1 -1
  71. package/dist/forge-payload/.base-pack/personas/orchestrator.md +1 -1
  72. package/dist/forge-payload/.base-pack/personas/product-manager.md +1 -1
  73. package/dist/forge-payload/.base-pack/personas/qa-engineer.md +1 -1
  74. package/dist/forge-payload/.base-pack/personas/supervisor.md +1 -1
  75. package/dist/forge-payload/.base-pack/workflows/_fragments/event-emission-schema.md +1 -1
  76. package/dist/forge-payload/.base-pack/workflows/_fragments/friction-emit.md +1 -1
  77. package/dist/forge-payload/.base-pack/workflows/_fragments/iron-laws.md +1 -1
  78. package/dist/forge-payload/.base-pack/workflows/_fragments/progress-reporting.md +2 -2
  79. package/dist/forge-payload/.base-pack/workflows/_fragments/store-cli-verbs.md +29 -5
  80. package/dist/forge-payload/.base-pack/workflows/architect_approve.md +8 -10
  81. package/dist/forge-payload/.base-pack/workflows/architect_review_sprint_completion.md +2 -2
  82. package/dist/forge-payload/.base-pack/workflows/architect_sprint_intake.md +2 -2
  83. package/dist/forge-payload/.base-pack/workflows/architect_sprint_plan.md +5 -5
  84. package/dist/forge-payload/.base-pack/workflows/collator_agent.md +5 -7
  85. package/dist/forge-payload/.base-pack/workflows/commit_task.md +7 -9
  86. package/dist/forge-payload/.base-pack/workflows/enhance.md +5 -5
  87. package/dist/forge-payload/.base-pack/workflows/implement_plan.md +9 -9
  88. package/dist/forge-payload/.base-pack/workflows/migrate_structural.md +12 -13
  89. package/dist/forge-payload/.base-pack/workflows/plan_task.md +5 -6
  90. package/dist/forge-payload/.base-pack/workflows/review_code.md +8 -8
  91. package/dist/forge-payload/.base-pack/workflows/review_plan.md +8 -8
  92. package/dist/forge-payload/.base-pack/workflows/sprint_retrospective.md +3 -3
  93. package/dist/forge-payload/.base-pack/workflows/triage.md +13 -10
  94. package/dist/forge-payload/.base-pack/workflows/update_implementation.md +2 -2
  95. package/dist/forge-payload/.base-pack/workflows/update_plan.md +2 -2
  96. package/dist/forge-payload/.base-pack/workflows/validate_task.md +6 -8
  97. package/dist/forge-payload/.base-pack/workflows-js/wfl-fix-bug.js +490 -0
  98. package/dist/forge-payload/.base-pack/workflows-js/wfl-run-sprint.js +416 -0
  99. package/dist/forge-payload/.base-pack/workflows-js/wfl-run-task.js +608 -0
  100. package/dist/forge-payload/.claude-plugin/plugin.json +1 -1
  101. package/dist/forge-payload/.schemas/_defs/locator.schema.json +13 -0
  102. package/dist/forge-payload/.schemas/bug.schema.json +1 -0
  103. package/dist/forge-payload/.schemas/config.schema.json +2 -3
  104. package/dist/forge-payload/.schemas/enum-catalog.json +2 -2
  105. package/dist/forge-payload/.schemas/event.schema.json +16 -0
  106. package/dist/forge-payload/.schemas/migrations.json +299 -0
  107. package/dist/forge-payload/.schemas/sprint.schema.json +1 -0
  108. package/dist/forge-payload/.schemas/task.schema.json +1 -0
  109. package/dist/forge-payload/commands/health.md +29 -0
  110. package/dist/forge-payload/commands/rebuild.md +143 -15
  111. package/dist/forge-payload/commands/update.md +28 -27
  112. package/dist/forge-payload/hooks/preflight-session.cjs +99 -0
  113. package/dist/forge-payload/init/phases/phase-3-materialize.md +18 -5
  114. package/dist/forge-payload/integrity.json +7 -6
  115. package/dist/forge-payload/meta/fragments/tool-discipline.md +1 -1
  116. package/dist/forge-payload/meta/personas/meta-architect.md +1 -1
  117. package/dist/forge-payload/meta/personas/meta-bug-fixer.md +1 -1
  118. package/dist/forge-payload/meta/personas/meta-collator.md +7 -7
  119. package/dist/forge-payload/meta/personas/meta-engineer.md +1 -1
  120. package/dist/forge-payload/meta/personas/meta-orchestrator.md +1 -1
  121. package/dist/forge-payload/meta/personas/meta-supervisor.md +1 -1
  122. package/dist/forge-payload/meta/tool-specs/store-cli.spec.md +1 -1
  123. package/dist/forge-payload/meta/workflows/_fragments/event-emission-schema.md +1 -1
  124. package/dist/forge-payload/meta/workflows/_fragments/friction-emit.md +1 -1
  125. package/dist/forge-payload/meta/workflows/_fragments/iron-laws.md +1 -1
  126. package/dist/forge-payload/meta/workflows/_fragments/progress-reporting.md +2 -2
  127. package/dist/forge-payload/meta/workflows/_fragments/store-cli-verbs.md +29 -5
  128. package/dist/forge-payload/meta/workflows/meta-approve.md +8 -10
  129. package/dist/forge-payload/meta/workflows/meta-bug-triage.md +13 -10
  130. package/dist/forge-payload/meta/workflows/meta-collate.md +6 -8
  131. package/dist/forge-payload/meta/workflows/meta-commit.md +7 -9
  132. package/dist/forge-payload/meta/workflows/meta-enhance.md +5 -5
  133. package/dist/forge-payload/meta/workflows/meta-fix-bug.md +35 -11
  134. package/dist/forge-payload/meta/workflows/meta-implement.md +18 -9
  135. package/dist/forge-payload/meta/workflows/meta-migrate.md +13 -14
  136. package/dist/forge-payload/meta/workflows/meta-new-sprint.md +3 -3
  137. package/dist/forge-payload/meta/workflows/meta-orchestrate.md +175 -82
  138. package/dist/forge-payload/meta/workflows/meta-plan-sprint.md +6 -6
  139. package/dist/forge-payload/meta/workflows/meta-plan-task.md +12 -6
  140. package/dist/forge-payload/meta/workflows/meta-retro.md +4 -4
  141. package/dist/forge-payload/meta/workflows/meta-retrospective.md +4 -4
  142. package/dist/forge-payload/meta/workflows/meta-review-implementation.md +8 -8
  143. package/dist/forge-payload/meta/workflows/meta-review-plan.md +8 -8
  144. package/dist/forge-payload/meta/workflows/meta-review-sprint-completion.md +3 -3
  145. package/dist/forge-payload/meta/workflows/meta-sprint-intake.md +3 -3
  146. package/dist/forge-payload/meta/workflows/meta-sprint-plan.md +6 -6
  147. package/dist/forge-payload/meta/workflows/meta-update-implementation.md +2 -2
  148. package/dist/forge-payload/meta/workflows/meta-update-plan.md +2 -2
  149. package/dist/forge-payload/meta/workflows/meta-validate.md +6 -8
  150. package/dist/forge-payload/schemas/_defs/locator.schema.json +13 -0
  151. package/dist/forge-payload/schemas/bug.schema.json +1 -0
  152. package/dist/forge-payload/schemas/config.schema.json +2 -3
  153. package/dist/forge-payload/schemas/enum-catalog.json +2 -2
  154. package/dist/forge-payload/schemas/event.schema.json +16 -0
  155. package/dist/forge-payload/schemas/sprint.schema.json +1 -0
  156. package/dist/forge-payload/schemas/structure-manifest.json +76 -73
  157. package/dist/forge-payload/schemas/task.schema.json +1 -0
  158. package/dist/forge-payload/skills/refresh-kb-links/SKILL.md +14 -7
  159. package/dist/forge-payload/tools/artifact-store.cjs +242 -0
  160. package/dist/forge-payload/tools/artifact.cjs +60 -120
  161. package/dist/forge-payload/tools/banners.cjs +29 -10
  162. package/dist/forge-payload/tools/check-structure.cjs +88 -7
  163. package/dist/forge-payload/tools/collate.cjs +16 -2
  164. package/dist/forge-payload/tools/lib/artifact-kinds.cjs +95 -0
  165. package/dist/forge-payload/tools/lib/store-nlp.cjs +6 -0
  166. package/dist/forge-payload/tools/lib/store-query-exec.cjs +39 -5
  167. package/dist/forge-payload/tools/lib/suggest.cjs +2 -1
  168. package/dist/forge-payload/tools/manage-config.cjs +5 -7
  169. package/dist/forge-payload/tools/parse-gates.cjs +73 -1
  170. package/dist/forge-payload/tools/postflight-gate.cjs +252 -0
  171. package/dist/forge-payload/tools/preflight-gate.cjs +102 -5
  172. package/dist/forge-payload/tools/store-cli.cjs +50 -15
  173. package/dist/forge-payload/tools/substitute-placeholders.cjs +5 -4
  174. package/dist/forge-payload/tools/verify-phase.cjs +17 -0
  175. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts +5 -2
  176. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts.map +1 -1
  177. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js +81 -18
  178. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js.map +1 -1
  179. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.d.ts.map +1 -1
  180. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.js +1 -0
  181. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.js.map +1 -1
  182. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.d.ts.map +1 -1
  183. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js +19 -24
  184. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js.map +1 -1
  185. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts +1 -0
  186. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts.map +1 -1
  187. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js +14 -1
  188. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js.map +1 -1
  189. package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts +22 -8
  190. package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts.map +1 -1
  191. package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.js.map +1 -1
  192. package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
  193. package/node_modules/@earendil-works/pi-ai/README.md +1 -1
  194. package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +374 -122
  195. package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts.map +1 -1
  196. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +424 -232
  197. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js.map +1 -1
  198. package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.d.ts +1 -1
  199. package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.d.ts.map +1 -1
  200. package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js +38 -2
  201. package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js.map +1 -1
  202. package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
  203. package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js +21 -12
  204. package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js.map +1 -1
  205. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.d.ts.map +1 -1
  206. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js +6 -10
  207. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js.map +1 -1
  208. package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.d.ts.map +1 -1
  209. package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.js +1 -1
  210. package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.js.map +1 -1
  211. package/node_modules/@earendil-works/pi-ai/dist/providers/google.d.ts.map +1 -1
  212. package/node_modules/@earendil-works/pi-ai/dist/providers/google.js +5 -3
  213. package/node_modules/@earendil-works/pi-ai/dist/providers/google.js.map +1 -1
  214. package/node_modules/@earendil-works/pi-ai/dist/providers/images/openrouter.d.ts.map +1 -1
  215. package/node_modules/@earendil-works/pi-ai/dist/providers/images/openrouter.js +3 -4
  216. package/node_modules/@earendil-works/pi-ai/dist/providers/images/openrouter.js.map +1 -1
  217. package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.d.ts.map +1 -1
  218. package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.js +2 -3
  219. package/node_modules/@earendil-works/pi-ai/dist/providers/mistral.js.map +1 -1
  220. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.d.ts.map +1 -1
  221. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.js +159 -78
  222. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.js.map +1 -1
  223. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.d.ts.map +1 -1
  224. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js +16 -11
  225. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js.map +1 -1
  226. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses-shared.d.ts.map +1 -1
  227. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses-shared.js +4 -1
  228. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses-shared.js.map +1 -1
  229. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.d.ts.map +1 -1
  230. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js +6 -10
  231. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js.map +1 -1
  232. package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.d.ts.map +1 -1
  233. package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.js +1 -0
  234. package/node_modules/@earendil-works/pi-ai/dist/providers/simple-options.js.map +1 -1
  235. package/node_modules/@earendil-works/pi-ai/dist/stream.d.ts.map +1 -1
  236. package/node_modules/@earendil-works/pi-ai/dist/stream.js +14 -2
  237. package/node_modules/@earendil-works/pi-ai/dist/stream.js.map +1 -1
  238. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +14 -4
  239. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
  240. package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
  241. package/node_modules/@earendil-works/pi-ai/dist/utils/abort-signals.d.ts +6 -0
  242. package/node_modules/@earendil-works/pi-ai/dist/utils/abort-signals.d.ts.map +1 -0
  243. package/node_modules/@earendil-works/pi-ai/dist/utils/abort-signals.js +34 -0
  244. package/node_modules/@earendil-works/pi-ai/dist/utils/abort-signals.js.map +1 -0
  245. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/device-code.d.ts +9 -7
  246. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/device-code.d.ts.map +1 -1
  247. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/device-code.js +8 -7
  248. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/device-code.js.map +1 -1
  249. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.d.ts.map +1 -1
  250. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.js +1 -1
  251. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.js.map +1 -1
  252. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/index.d.ts +1 -1
  253. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/index.d.ts.map +1 -1
  254. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/index.js +1 -1
  255. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/index.js.map +1 -1
  256. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.d.ts +10 -1
  257. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.d.ts.map +1 -1
  258. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.js +179 -79
  259. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.js.map +1 -1
  260. package/node_modules/@earendil-works/pi-ai/package.json +2 -2
  261. package/node_modules/@earendil-works/pi-coding-agent/CHANGELOG.md +94 -0
  262. package/node_modules/@earendil-works/pi-coding-agent/README.md +9 -0
  263. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.d.ts +3 -0
  264. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.d.ts.map +1 -1
  265. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.js +27 -0
  266. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/args.js.map +1 -1
  267. package/node_modules/@earendil-works/pi-coding-agent/dist/config.d.ts.map +1 -1
  268. package/node_modules/@earendil-works/pi-coding-agent/dist/config.js +15 -2
  269. package/node_modules/@earendil-works/pi-coding-agent/dist/config.js.map +1 -1
  270. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-services.d.ts +1 -0
  271. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-services.d.ts.map +1 -1
  272. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-services.js +1 -0
  273. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-services.js.map +1 -1
  274. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.d.ts +5 -1
  275. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
  276. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +28 -4
  277. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js.map +1 -1
  278. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.d.ts.map +1 -1
  279. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.js +18 -24
  280. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.js.map +1 -1
  281. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.d.ts +1 -1
  282. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.d.ts.map +1 -1
  283. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.js +8 -2
  284. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/runner.js.map +1 -1
  285. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.d.ts +7 -5
  286. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.d.ts.map +1 -1
  287. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/types.js.map +1 -1
  288. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-registry.d.ts.map +1 -1
  289. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-registry.js +65 -13
  290. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-registry.js.map +1 -1
  291. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.d.ts.map +1 -1
  292. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.js +1 -1
  293. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-resolver.js.map +1 -1
  294. package/node_modules/@earendil-works/pi-coding-agent/dist/core/resolve-config-value.d.ts +9 -1
  295. package/node_modules/@earendil-works/pi-coding-agent/dist/core/resolve-config-value.d.ts.map +1 -1
  296. package/node_modules/@earendil-works/pi-coding-agent/dist/core/resolve-config-value.js +134 -11
  297. package/node_modules/@earendil-works/pi-coding-agent/dist/core/resolve-config-value.js.map +1 -1
  298. package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.d.ts +2 -0
  299. package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.d.ts.map +1 -1
  300. package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.js +10 -6
  301. package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.js.map +1 -1
  302. package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.d.ts +6 -7
  303. package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.d.ts.map +1 -1
  304. package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.js +75 -28
  305. package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.js.map +1 -1
  306. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.d.ts +2 -0
  307. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.d.ts.map +1 -1
  308. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js +14 -9
  309. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js.map +1 -1
  310. package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.d.ts.map +1 -1
  311. package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.js +0 -3
  312. package/node_modules/@earendil-works/pi-coding-agent/dist/core/system-prompt.js.map +1 -1
  313. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.d.ts.map +1 -1
  314. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.js +7 -10
  315. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.js.map +1 -1
  316. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/find.d.ts.map +1 -1
  317. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/find.js.map +1 -1
  318. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.d.ts.map +1 -1
  319. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.js.map +1 -1
  320. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/ls.d.ts.map +1 -1
  321. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/ls.js +5 -7
  322. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/ls.js.map +1 -1
  323. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.d.ts.map +1 -1
  324. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js +6 -7
  325. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js.map +1 -1
  326. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/render-utils.d.ts +5 -2
  327. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/render-utils.d.ts.map +1 -1
  328. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/render-utils.js +17 -1
  329. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/render-utils.js.map +1 -1
  330. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/write.d.ts.map +1 -1
  331. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/write.js +5 -6
  332. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/write.js.map +1 -1
  333. package/node_modules/@earendil-works/pi-coding-agent/dist/index.d.ts +2 -0
  334. package/node_modules/@earendil-works/pi-coding-agent/dist/index.d.ts.map +1 -1
  335. package/node_modules/@earendil-works/pi-coding-agent/dist/index.js +2 -0
  336. package/node_modules/@earendil-works/pi-coding-agent/dist/index.js.map +1 -1
  337. package/node_modules/@earendil-works/pi-coding-agent/dist/main.d.ts.map +1 -1
  338. package/node_modules/@earendil-works/pi-coding-agent/dist/main.js +69 -16
  339. package/node_modules/@earendil-works/pi-coding-agent/dist/main.js.map +1 -1
  340. package/node_modules/@earendil-works/pi-coding-agent/dist/migrations.d.ts.map +1 -1
  341. package/node_modules/@earendil-works/pi-coding-agent/dist/migrations.js +118 -1
  342. package/node_modules/@earendil-works/pi-coding-agent/dist/migrations.js.map +1 -1
  343. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts +1 -3
  344. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  345. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +2 -4
  346. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/login-dialog.js.map +1 -1
  347. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  348. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/user-message.js +1 -1
  349. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/user-message.js.map +1 -1
  350. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts +3 -0
  351. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  352. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +59 -6
  353. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -1
  354. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  355. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.js +10 -0
  356. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.js.map +1 -1
  357. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  358. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.js +3 -1
  359. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.js.map +1 -1
  360. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-types.d.ts +1 -0
  361. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  362. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-types.js.map +1 -1
  363. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/deprecation.d.ts +4 -0
  364. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/deprecation.d.ts.map +1 -0
  365. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/deprecation.js +13 -0
  366. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/deprecation.js.map +1 -0
  367. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/json.d.ts +3 -0
  368. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/json.d.ts.map +1 -0
  369. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/json.js +7 -0
  370. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/json.js.map +1 -0
  371. package/node_modules/@earendil-works/pi-coding-agent/docs/custom-provider.md +13 -10
  372. package/node_modules/@earendil-works/pi-coding-agent/docs/development.md +1 -1
  373. package/node_modules/@earendil-works/pi-coding-agent/docs/extensions.md +12 -6
  374. package/node_modules/@earendil-works/pi-coding-agent/docs/models.md +25 -12
  375. package/node_modules/@earendil-works/pi-coding-agent/docs/providers.md +13 -5
  376. package/node_modules/@earendil-works/pi-coding-agent/docs/quickstart.md +1 -0
  377. package/node_modules/@earendil-works/pi-coding-agent/docs/rpc.md +2 -1
  378. package/node_modules/@earendil-works/pi-coding-agent/docs/sdk.md +6 -0
  379. package/node_modules/@earendil-works/pi-coding-agent/docs/session-format.md +1 -1
  380. package/node_modules/@earendil-works/pi-coding-agent/docs/sessions.md +8 -0
  381. package/node_modules/@earendil-works/pi-coding-agent/docs/settings.md +7 -3
  382. package/node_modules/@earendil-works/pi-coding-agent/docs/terminal-setup.md +2 -0
  383. package/node_modules/@earendil-works/pi-coding-agent/docs/tui.md +2 -2
  384. package/node_modules/@earendil-works/pi-coding-agent/docs/usage.md +9 -0
  385. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/README.md +1 -0
  386. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/index.ts +1 -1
  387. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package.json +1 -1
  388. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-gitlab-duo/index.ts +54 -3
  389. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  390. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/git-merge-and-resolve.ts +115 -0
  391. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/input-transform-streaming.ts +39 -0
  392. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/sandbox/package.json +1 -1
  393. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package.json +1 -1
  394. package/node_modules/@earendil-works/pi-coding-agent/npm-shrinkwrap.json +443 -61
  395. package/node_modules/@earendil-works/pi-coding-agent/package.json +6 -6
  396. package/node_modules/@earendil-works/pi-tui/README.md +2 -2
  397. package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts.map +1 -1
  398. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +24 -83
  399. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +1 -1
  400. package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts.map +1 -1
  401. package/node_modules/@earendil-works/pi-tui/dist/components/input.js +7 -55
  402. package/node_modules/@earendil-works/pi-tui/dist/components/input.js.map +1 -1
  403. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts +7 -1
  404. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts.map +1 -1
  405. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +12 -2
  406. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js.map +1 -1
  407. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts +1 -1
  408. package/node_modules/@earendil-works/pi-tui/dist/index.d.ts.map +1 -1
  409. package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -1
  410. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts +1 -1
  411. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts.map +1 -1
  412. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +34 -7
  413. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +1 -1
  414. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts +33 -10
  415. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -1
  416. package/node_modules/@earendil-works/pi-tui/dist/terminal.js +172 -37
  417. package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +1 -1
  418. package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts +6 -1
  419. package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +1 -1
  420. package/node_modules/@earendil-works/pi-tui/dist/utils.js +27 -15
  421. package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +1 -1
  422. package/node_modules/@earendil-works/pi-tui/dist/word-navigation.d.ts +25 -0
  423. package/node_modules/@earendil-works/pi-tui/dist/word-navigation.d.ts.map +1 -0
  424. package/node_modules/@earendil-works/pi-tui/dist/word-navigation.js +96 -0
  425. package/node_modules/@earendil-works/pi-tui/dist/word-navigation.js.map +1 -0
  426. package/node_modules/@earendil-works/pi-tui/package.json +2 -2
  427. package/node_modules/@entelligentsia/forge-compress/LICENSE +21 -0
  428. package/node_modules/@entelligentsia/forge-compress/README.md +85 -0
  429. package/node_modules/@mariozechner/clipboard/Cargo.toml +3 -3
  430. package/node_modules/@mariozechner/clipboard/index.d.ts +34 -20
  431. package/node_modules/@mariozechner/clipboard/index.js +546 -257
  432. package/node_modules/@mariozechner/clipboard/package.json +5 -6
  433. package/node_modules/@mariozechner/clipboard/package.json.prepack-backup +14 -14
  434. package/node_modules/@mariozechner/clipboard/src/lib.rs +4 -9
  435. package/node_modules/@mariozechner/clipboard-linux-x64-gnu/clipboard.linux-x64-gnu.node +0 -0
  436. package/node_modules/@mariozechner/clipboard-linux-x64-gnu/package.json +2 -2
  437. package/package.json +7 -7
  438. package/dist/bin/forgecli.d.ts +0 -2
  439. package/dist/bin/forgecli.js +0 -6
  440. package/dist/bin/forgecli.js.map +0 -1
  441. package/dist/extensions/forgecli/config-tui/index.d.ts +0 -5
  442. package/dist/extensions/forgecli/config-tui/index.js +0 -5
  443. package/dist/extensions/forgecli/config-tui/index.js.map +0 -1
  444. package/dist/extensions/forgecli/loaders/persona-skill-loader.d.ts +0 -45
  445. package/dist/extensions/forgecli/loaders/persona-skill-loader.js +0 -227
  446. package/dist/extensions/forgecli/loaders/persona-skill-loader.js.map +0 -1
  447. package/dist/extensions/forgecli/loaders/template-render.d.ts +0 -20
  448. package/dist/extensions/forgecli/loaders/template-render.js +0 -85
  449. package/dist/extensions/forgecli/loaders/template-render.js.map +0 -1
  450. package/dist/extensions/forgecli/loaders/workflow-loader.d.ts +0 -41
  451. package/dist/extensions/forgecli/loaders/workflow-loader.js +0 -164
  452. package/dist/extensions/forgecli/loaders/workflow-loader.js.map +0 -1
  453. package/dist/forge-payload/.base-pack/commands/quiz-agent.md +0 -6
  454. package/dist/forge-payload/.base-pack/commands/retrospective.md +0 -6
  455. package/dist/forge-payload/.base-pack/commands/sprint-intake.md +0 -6
  456. package/dist/forge-payload/.base-pack/commands/sprint-plan.md +0 -6
  457. package/dist/forge-payload/.base-pack/workflows/fix_bug.md +0 -446
  458. package/dist/forge-payload/.base-pack/workflows/orchestrate_task.md +0 -934
  459. package/dist/forge-payload/.base-pack/workflows/run_sprint.md +0 -225
  460. package/dist/forge-payload/commands/calibrate.md +0 -10
  461. package/dist/forge-payload/commands/materialize.md +0 -119
  462. package/dist/forge-payload/commands/migrate.md +0 -12
  463. package/dist/forge-payload/commands/quiz-agent.md +0 -6
  464. package/dist/forge-payload/commands/regenerate.md +0 -6
  465. package/dist/forge-payload/commands/store-query.md +0 -6
  466. package/dist/forge-payload/commands/store-repair.md +0 -6
  467. package/dist/forge-payload/commands/update-tools.md +0 -10
  468. package/dist/forge-payload/meta/templates/meta-retrospective.md +0 -28
  469. package/dist/forge-payload/tools/prompts/sprint-plan-prompt.md +0 -70
  470. package/dist/forge-payload/tools/schemas/task-list.schema.json +0 -53
  471. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution-env.d.ts +0 -4
  472. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution-env.d.ts.map +0 -1
  473. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution-env.js +0 -3
  474. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution-env.js.map +0 -1
  475. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/jsonl.d.ts +0 -20
  476. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/jsonl.d.ts.map +0 -1
  477. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/jsonl.js +0 -92
  478. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/jsonl.js.map +0 -1
  479. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/memory.d.ts +0 -18
  480. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/memory.d.ts.map +0 -1
  481. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/memory.js +0 -42
  482. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/memory.js.map +0 -1
  483. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/shared.d.ts +0 -10
  484. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/shared.d.ts.map +0 -1
  485. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/shared.js +0 -31
  486. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/shared.js.map +0 -1
  487. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/jsonl.d.ts +0 -30
  488. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/jsonl.d.ts.map +0 -1
  489. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/jsonl.js +0 -170
  490. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/jsonl.js.map +0 -1
  491. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/memory.d.ts +0 -26
  492. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/memory.d.ts.map +0 -1
  493. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/memory.js +0 -90
  494. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/memory.js.map +0 -1
  495. package/node_modules/@mariozechner/clipboard-linux-x64-musl/README.md +0 -3
  496. package/node_modules/@mariozechner/clipboard-linux-x64-musl/clipboard.linux-x64-musl.node +0 -0
  497. package/node_modules/@mariozechner/clipboard-linux-x64-musl/package.json +0 -25
@@ -21,6 +21,38 @@ deps:
21
21
  Wire the atomic workflows into a pipeline that drives a single task through
22
22
  the complete lifecycle. This is the task state machine.
23
23
 
24
+ ## Session Preflight (run once, before the phase loop)
25
+
26
+ The deterministic pre-dispatch glue — FORGE_ROOT resolution, config
27
+ reconciliation, generation-manifest state, calibration-baseline freshness,
28
+ MASTER_INDEX hashing, and the structure check — is bundled into a single
29
+ deterministic tool, `forge/tools/forge-preflight.cjs`. **Do NOT hand-run these
30
+ checks turn-by-turn.** Read the one compact blob it produces, once, at the top
31
+ of the orchestration:
32
+
33
+ 1. The SessionStart hook (`hooks/preflight-session.cjs`) primes the blob at
34
+ `.forge/cache/preflight-status.json` for any project that has a `.forge/`
35
+ directory. Read that file. If it is absent or stale, run the tool once:
36
+ `node .forge/tools/forge-preflight.cjs` and read its stdout.
37
+ 2. Branch on `blob.ok`:
38
+ - **`ok: true`** → proceed to the phase loop using `blob.forgeRoot` and the
39
+ recorded state. Do not re-derive any field the blob already carries
40
+ (`masterIndexHash`, `calibrationFresh`, `manifestState`, `structureOk`);
41
+ surface `calibrationFresh.suggest` to the operator if `fresh` is false, but
42
+ this is advisory and does not block the run.
43
+ - **`ok: false`** → **halt before phase 1** (fast-fail-safe). This is a
44
+ pre-dispatch halt: print `blob.warnings`, route through the existing
45
+ escalation idiom (see `§ Escalation Procedure`) — emit the standard
46
+ escalation event and message — and instruct the operator to fix the
47
+ surfaced preflight warning and re-run. A half-initialized run must never
48
+ proceed.
49
+
50
+ The blob is the single source of truth for these concerns for the remainder of
51
+ the run. The SessionStart hook is command-name-independent (SessionStart fires
52
+ before any command and carries no per-command signal); the scoping to
53
+ run-task / fix-bug / run-sprint contexts lives here, in the orchestration
54
+ preamble, which only those commands reach.
55
+
24
56
  ## Pipeline Phases
25
57
 
26
58
  Each phase has:
@@ -116,7 +148,7 @@ Each phase subagent is responsible for reporting its own token usage via a sidec
116
148
  Do NOT shell out to a `cost-cli.cjs` — there is no such tool.
117
149
  2. Parse the output for the five fields:
118
150
  `inputTokens`, `outputTokens`, `cacheReadTokens`, `cacheWriteTokens`, `estimatedCostUSD`.
119
- 3. Write the usage sidecar via `node "$FORGE_ROOT/tools/store-cli.cjs" emit {sprintId} '{sidecar-json}' --sidecar` with the exact format:
151
+ 3. Write the usage sidecar via `node .forge/tools/store-cli.cjs emit {sprintId} '{sidecar-json}' --sidecar` with the exact format:
120
152
  ```json
121
153
  {
122
154
  "inputTokens": <integer>,
@@ -234,11 +266,26 @@ def compose_role_block(persona_noun):
234
266
  **Rollback:** set `FORGE_PROMPT_MODE=inline`. No persisted state to revert.
235
267
  The `inline` branch will be removed one version after `reference` ships.
236
268
 
269
+ > **Scope note (added FORGE-S27-T02, 2026-05-31):** `FORGE_PROMPT_MODE=inline` restores
270
+ > the **role block only** — full verbatim persona + skill file contents. It does NOT restore
271
+ > the full `MASTER_INDEX`: the overlay (`build-overlay.cjs`, line 462) is unconditional and
272
+ > delivers the same task-scoped slice in both modes. It also does NOT affect the workflow file,
273
+ > which is read verbatim from disk in both modes. There is currently no per-call escape hatch
274
+ > to the full `MASTER_INDEX` — a separate overlay-bypass flag would be required.
275
+
237
276
  ## Execution Algorithm
238
277
 
239
278
  The orchestrator MUST follow this procedure exactly. Do not deviate.
240
279
 
241
280
  ```
281
+ # --- Utility helpers ---
282
+ def safe_parse_json(text):
283
+ """Attempt to parse a JSON string; return dict or None on failure."""
284
+ try:
285
+ return json.loads(text.strip()) if text and text.strip() else None
286
+ except Exception:
287
+ return None
288
+
242
289
  # --- Persona symbol lookup (emoji, name, tagline) ---
243
290
  PERSONA_MAP = {
244
291
  "plan": ("🌱", "Engineer", "I plan what will be built before any code is written."),
@@ -314,7 +361,7 @@ for each task in dependency_sorted(tasks):
314
361
 
315
362
  # --- Clear progress log for this sprint ---
316
363
  progress_log_path = f".forge/store/events/{sprint_id}/progress.log"
317
- run_bash(f'FORGE_ROOT=$(node -e "console.log(require(\'./.forge/config.json\').paths.forgeRoot)") && node "$FORGE_ROOT/tools/store-cli.cjs" progress-clear {sprint_id}')
364
+ run_bash(f'node .forge/tools/store-cli.cjs progress-clear {sprint_id}')
318
365
 
319
366
  while i < len(phases):
320
367
  phase = phases[i]
@@ -359,9 +406,27 @@ for each task in dependency_sorted(tasks):
359
406
  agent_name = f"{task_id}:{persona_noun}:{phase.role}:{iteration}"
360
407
 
361
408
  # --- Announce phase with identity banner (badge) + task context ---
409
+ # --quiet makes banners.cjs emit zero stdout (unconditional; no isTTY branch).
410
+ # The badge is fully suppressed during the automated run_bash call — it does
411
+ # not enter the LLM context window and is not shown on the human terminal.
412
+ # The human-visible per-phase marker is the print() line below.
413
+ #
414
+ # Digest-compliance note (FORGE-S27-T03): every deterministic tool call this
415
+ # loop body makes is already digest-compliant on its success path:
416
+ # store-cli write verbs (update-status, emit, merge-sidecar, set-summary,
417
+ # progress-clear) → silent on success.
418
+ # preflight-gate.cjs → silent on success (stderr only on failure).
419
+ # read-verdict.cjs → one load-bearing token (e.g. "approved"); orchestrator
420
+ # branches on it — must not be suppressed.
421
+ # banners.cjs --badge → 1-line ANSI badge; made zero-cost via --quiet below.
422
+ # build-overlay.cjs → ~1185 chars captured into overlay_md and injected into
423
+ # the subagent prompt as Project Context. This is payload
424
+ # data, not a log — reducing it would break prompt assembly.
425
+ # Reference-mode redesign is deferred to the T02/forge-compress
426
+ # work; leave unchanged here.
362
427
  emoji, persona_name, tagline = PERSONA_MAP.get(phase.role, ("🌊", "Orchestrator", "I move tasks through their lifecycle."))
363
428
  banner_name = BANNER_MAP.get(phase.role, "forge")
364
- run_bash(f'FORGE_ROOT=$(node -e "console.log(require(\'./.forge/config.json\').paths.forgeRoot)") && node "$FORGE_ROOT/tools/banners.cjs" --badge {banner_name}')
429
+ run_bash(f'node .forge/tools/banners.cjs --badge {banner_name} --quiet')
365
430
  print(f" → {task_id} [{display_model}]\n")
366
431
 
367
432
  # --- Start progress Monitor before spawning subagent ---
@@ -374,23 +439,35 @@ for each task in dependency_sorted(tasks):
374
439
  )
375
440
 
376
441
  # --- Pre-flight gate check (see Phase Gates below) ---
377
- # Resolve FORGE_ROOT once so the CLI shim can locate the gate parser.
442
+ # Resolve FORGE_ROOT once (needed for meta/workflows fragment reads below).
378
443
  FORGE_ROOT = resolve_forge_root()
379
444
  preflight_result = run_bash(
380
- f'node "$FORGE_ROOT/tools/preflight-gate.cjs" --phase {phase.role} --task {task_id}'
445
+ f'node .forge/tools/preflight-gate.cjs --phase {phase.role} --task {task_id}'
381
446
  )
382
447
  if preflight_result.exit_code == 1:
383
448
  # Gate failed: halt the orchestrator loop for THIS task. Do not retry,
384
- # do not spawn. Missing prerequisites are listed on stderr.
385
- print(f" ✗ {task_id} {phase.role} — gate failed\n{preflight_result.stderr}")
386
- append_progress(progress_log_path, f"❌ Gate failed for {phase.role}: {preflight_result.stderr}")
387
- emit_event(task, phase, action="gate_failed", notes=preflight_result.stderr)
449
+ # do not spawn. Structured failure JSON is on stdout; human-readable detail on stderr.
450
+ # Parse the structured JSON for a user-friendly advisory.
451
+ gate_failure = safe_parse_json(preflight_result.stdout)
452
+ if gate_failure:
453
+ reason_code = gate_failure.get("reasonCode", "unknown")
454
+ gate_detail = gate_failure.get("detail", preflight_result.stderr.strip())
455
+ gate_remedy = gate_failure.get("remediation", "")
456
+ print(f" ✗ {task_id} {phase.role} — gate failed [{reason_code}]")
457
+ print(f" Detail: {gate_detail}")
458
+ print(f" Remediation: {gate_remedy}")
459
+ gate_notes = f"gate_failed [{reason_code}]: {gate_detail}"
460
+ else:
461
+ print(f" ✗ {task_id} {phase.role} — gate failed\n{preflight_result.stderr}")
462
+ gate_notes = f"gate_failed: {preflight_result.stderr}"
463
+ append_progress(progress_log_path, f"❌ Gate failed for {phase.role}: {gate_notes}")
464
+ emit_event(task, phase, action="gate_failed", notes=gate_notes)
388
465
  # ---- ESCALATION (mandatory hard stop — do NOT continue) ----
389
- run_bash(f'node "$FORGE_ROOT/tools/store-cli.cjs" update-status task {task_id} status escalated')
466
+ run_bash(f'node .forge/tools/store-cli.cjs update-status task {task_id} status escalated')
390
467
  emit_event(task, phase, eventId=event_id, iteration=iteration,
391
468
  action="escalated", verdict="escalated",
392
- notes=f"gate_failed: {preflight_result.stderr}")
393
- print(f" ⚠ Task {task_id} escalated: gate_failed: {preflight_result.stderr}\n")
469
+ notes=gate_notes)
470
+ print(f" ⚠ Task {task_id} escalated: {gate_notes}\n")
394
471
  print(f" Review artifact: {artifact_path}\n")
395
472
  print(f" Resume with: /{phase.command} {task_id} after addressing the issues.\n")
396
473
  break # stop processing this task
@@ -398,7 +475,7 @@ for each task in dependency_sorted(tasks):
398
475
  # Misconfiguration (unknown phase, malformed gates block). Fail loud.
399
476
  print(f" ⚠ {task_id} {phase.role} — gate misconfigured\n{preflight_result.stderr}")
400
477
  # ---- ESCALATION (mandatory hard stop — do NOT continue) ----
401
- run_bash(f'node "$FORGE_ROOT/tools/store-cli.cjs" update-status task {task_id} status escalated')
478
+ run_bash(f'node .forge/tools/store-cli.cjs update-status task {task_id} status escalated')
402
479
  emit_event(task, phase, eventId=event_id, iteration=iteration,
403
480
  action="escalated", verdict="escalated",
404
481
  notes=f"gate_misconfigured: {preflight_result.stderr}")
@@ -428,7 +505,7 @@ for each task in dependency_sorted(tasks):
428
505
 
429
506
  # --- Materialize project overlay (replaces MASTER_INDEX.md read in subagent) ---
430
507
  overlay_result = run_bash(
431
- f'node "$FORGE_ROOT/tools/build-overlay.cjs" --task {task_id} --format md'
508
+ f'node .forge/tools/build-overlay.cjs --task {task_id} --format md'
432
509
  )
433
510
  overlay_md = overlay_result.stdout if overlay_result.exit_code == 0 else ""
434
511
 
@@ -526,7 +603,7 @@ for each task in dependency_sorted(tasks):
526
603
  emit_event(task, phase, action="subagent_escalated",
527
604
  notes=f"second failure: {subagent_failure_reason(result)}")
528
605
  # ---- ESCALATION (mandatory hard stop — do NOT continue) ----
529
- run_bash(f'node "$FORGE_ROOT/tools/store-cli.cjs" update-status task {task_id} status escalated')
606
+ run_bash(f'node .forge/tools/store-cli.cjs update-status task {task_id} status escalated')
530
607
  emit_event(task, phase, eventId=event_id, iteration=iteration,
531
608
  action="escalated", verdict="escalated",
532
609
  notes=f"subagent failed after retry: {subagent_failure_reason(result)}")
@@ -539,7 +616,7 @@ for each task in dependency_sorted(tasks):
539
616
  emit_event(task, phase, action="subagent_escalated",
540
617
  notes=f"second failure: {subagent_failure_reason(result)}")
541
618
  # ---- ESCALATION (mandatory hard stop — do NOT continue) ----
542
- run_bash(f'node "$FORGE_ROOT/tools/store-cli.cjs" update-status task {task_id} status escalated')
619
+ run_bash(f'node .forge/tools/store-cli.cjs update-status task {task_id} status escalated')
543
620
  emit_event(task, phase, eventId=event_id, iteration=iteration,
544
621
  action="escalated", verdict="escalated",
545
622
  notes=f"subagent failed after retry: {subagent_failure_reason(result)}")
@@ -548,10 +625,9 @@ for each task in dependency_sorted(tasks):
548
625
  break
549
626
 
550
627
  # --- Sidecar merge: merge token usage written by subagent via custodian ---
551
- # The subagent wrote the sidecar via node "$FORGE_ROOT/tools/store-cli.cjs" emit {sprintId} '{sidecar-json}' --sidecar
628
+ # The subagent wrote the sidecar via node .forge/tools/store-cli.cjs emit {sprintId} '{sidecar-json}' --sidecar
552
629
  # Merge the sidecar into the canonical event and delete the sidecar file
553
- FORGE_ROOT = resolve_forge_root()
554
- run: node "$FORGE_ROOT/tools/store-cli.cjs" merge-sidecar {sprint_id} {event_id}
630
+ run: node .forge/tools/store-cli.cjs merge-sidecar {sprint_id} {event_id}
555
631
  # merge-sidecar reads the sidecar, merges token fields into the canonical event, and deletes the sidecar
556
632
  # If the sidecar does not exist, merge-sidecar exits 1 — treat as non-fatal (subagent may have skipped it)
557
633
  emit_event(task, phase, action="complete")
@@ -561,40 +637,50 @@ for each task in dependency_sorted(tasks):
561
637
  if phase.role not in ("review-plan", "review-code", "validate"):
562
638
  print(f" ✓ {task_id} {phase.role} — completed\n")
563
639
  i += 1
564
- # Compact context: all state is on disk; preserve loop bookkeeping in the summary
640
+ # State-ledger compaction: the [checkpoint] line IS the state ledger it carries
641
+ # the loop bookkeeping (task_id, sprint_id, phase_index, iteration_counts) that
642
+ # /compact must preserve verbatim. Raw tool output and subagent return text is
643
+ # shed here; do not retain it between phases. The durable state is on disk.
565
644
  print(f"[checkpoint] task={task_id} sprint={sprint_id} phase_index={i} iterations={iteration_counts}")
566
645
  /compact
567
646
  continue
568
647
 
569
- # --- Review phase: detect verdict via parse-verdict.cjs (see Verdict Detection below) ---
570
- # The CLI returns exit 0/1/2 for approved/revision/unknown. Never pattern-match
571
- # the **Verdict:** line manually — the closed vocabulary lives in the tool.
648
+ # --- Review phase: detect verdict via read-verdict.cjs (see Verdict Detection below) ---
649
+ # Verdicts come from the STORE record (phase summaries / task.status), NOT from a
650
+ # markdown review artifact — the orchestrator never constructs an artifact path.
651
+ # stdout is one of: approved | revision | n/a | unknown. Never pattern-match a
652
+ # **Verdict:** line — the closed vocabulary lives in the tool.
572
653
  verdict_result = run_bash(
573
- f'node "$FORGE_ROOT/tools/parse-verdict.cjs" {review_artifact_path(phase, task)}'
654
+ f'node .forge/tools/read-verdict.cjs --phase {phase.role} --task {task_id}'
574
655
  )
575
- if verdict_result.exit_code == 0:
656
+ verdict_token = verdict_result.stdout.strip()
657
+ if verdict_token == "approved":
576
658
  verdict = "Approved"
577
- elif verdict_result.exit_code == 1:
659
+ elif verdict_token == "revision":
578
660
  verdict = "Revision Required"
579
661
  else:
580
- # exit 2: malformed, missing verdict line, or missing artifact. Never guess.
662
+ # "n/a" / "unknown" (no verdict recorded) or exit 2 (record not found / bad args).
663
+ # Never guess.
581
664
  print(f" ⚠ {task_id} {phase.role} — verdict_malformed, escalating\n")
582
665
  emit_event(task, phase, action="verdict_malformed",
583
- notes=f"parse-verdict exit={verdict_result.exit_code}")
666
+ notes=f"read-verdict stdout='{verdict_token}' exit={verdict_result.exit_code}")
584
667
  # ---- ESCALATION (mandatory hard stop — do NOT continue) ----
585
- run_bash(f'node "$FORGE_ROOT/tools/store-cli.cjs" update-status task {task_id} status escalated')
668
+ run_bash(f'node .forge/tools/store-cli.cjs update-status task {task_id} status escalated')
586
669
  emit_event(task, phase, eventId=event_id, iteration=iteration,
587
670
  action="escalated", verdict="escalated",
588
- notes="verdict_malformed: review artifact missing or verdict line unparseable")
589
- print(f" ⚠ Task {task_id} escalated: verdict_malformed — review artifact missing or verdict line unparseable\n")
590
- print(f" Review artifact: {review_artifact_path(phase, task)}\n")
671
+ notes="verdict_malformed: no verdict recorded in the phase summary / record")
672
+ print(f" ⚠ Task {task_id} escalated: verdict_malformed — no verdict recorded for {phase.role}\n")
673
+ print(f" Inspect with: node \.forge/tools/read-verdict.cjs\" --phase {phase.role} --task {task_id}\n")
591
674
  print(f" Resume with: /{phase.command} {task_id} after addressing the issues.\n")
592
675
  break
593
676
 
594
677
  if verdict == "Approved":
595
678
  print(f" ✓ {task_id} {phase.role} — Approved\n")
596
679
  i += 1 # advance to next phase
597
- # Compact context: all state is on disk; preserve loop bookkeeping in the summary
680
+ # State-ledger compaction: the [checkpoint] line IS the state ledger it carries
681
+ # the loop bookkeeping (task_id, sprint_id, phase_index, iteration_counts) that
682
+ # /compact must preserve verbatim. Raw tool output and subagent return text is
683
+ # shed here; do not retain it between phases. The durable state is on disk.
598
684
  print(f"[checkpoint] task={task_id} sprint={sprint_id} phase_index={i} iterations={iteration_counts}")
599
685
  /compact
600
686
 
@@ -604,12 +690,12 @@ for each task in dependency_sorted(tasks):
604
690
 
605
691
  if iteration_counts[phase.command] >= phase.maxIterations: # default 3
606
692
  # ---- ESCALATION (mandatory hard stop — do NOT continue) ----
607
- run_bash(f'node "$FORGE_ROOT/tools/store-cli.cjs" update-status task {task_id} status escalated')
693
+ run_bash(f'node .forge/tools/store-cli.cjs update-status task {task_id} status escalated')
608
694
  emit_event(task, phase, eventId=event_id, iteration=iteration,
609
695
  action="escalated", verdict="escalated",
610
696
  notes="max iterations reached")
611
697
  print(f" ⚠ Task {task_id} escalated: max iterations reached\n")
612
- print(f" Review artifact: {review_artifact_path(phase, task)}\n")
698
+ print(f" Inspect with: node \.forge/tools/read-verdict.cjs\" --phase {phase.role} --task {task_id}\n")
613
699
  print(f" Resume with: /{phase.command} {task_id} after addressing the issues.\n")
614
700
  break
615
701
  break # stop processing this task
@@ -617,11 +703,14 @@ for each task in dependency_sorted(tasks):
617
703
  # Route back to the revision target
618
704
  target = phase.on_revision or nearest_preceding_non_review(phases, i)
619
705
  i = index_of(phases, target) # loop back
620
- # Compact context: all state is on disk; preserve loop bookkeeping in the summary
706
+ # State-ledger compaction: the [checkpoint] line IS the state ledger it carries
707
+ # the loop bookkeeping (task_id, sprint_id, phase_index, iteration_counts) that
708
+ # /compact must preserve verbatim. Raw tool output and subagent return text is
709
+ # shed here; do not retain it between phases. The durable state is on disk.
621
710
  print(f"[checkpoint] task={task_id} sprint={sprint_id} phase_index={i} iterations={iteration_counts}")
622
711
  /compact
623
712
 
624
- # No `else:` branch needed — parse-verdict.cjs already exhausts the
713
+ # No `else:` branch needed — read-verdict.cjs already exhausts the
625
714
  # possibilities (approved | revision | verdict_malformed), and the
626
715
  # malformed case is handled above before this if/elif chain.
627
716
  ```
@@ -681,45 +770,34 @@ Examples:
681
770
  ## Verdict Detection
682
771
 
683
772
  After each review phase completes, the orchestrator MUST read the verdict
684
- before branching. Do not infer the verdict from conversation context alone
685
- always read the artifact.
686
-
687
- | Phase role | Artifact to read | Verdict field |
688
- |---------------|---------------------------------------------------------------------------|------------------------------|
689
- | `review-plan` | `{engineering}/sprints/{sprintDir}/{taskDir}/PLAN_REVIEW.md` | Line matching `**Verdict:**` |
690
- | `review-code` | `{engineering}/sprints/{sprintDir}/{taskDir}/CODE_REVIEW.md` | Line matching `**Verdict:**` |
691
- | `validate` | `{engineering}/sprints/{sprintDir}/{taskDir}/VALIDATION_REPORT.md` | Line matching `**Verdict:**` |
773
+ before branching. Do not infer the verdict from conversation context alone, and
774
+ **never construct or read a markdown artifact path** to find it — the verdict
775
+ lives in the **store record** (the phase summary written by `set-summary`, or
776
+ `task.status` for the approve phase).
692
777
 
693
- The verdict line format is:
778
+ **Read the verdict via `read-verdict.cjs`** — addressed by entity ID and phase
779
+ role, never by file path. The tool sources the verdict from the record and
780
+ enforces a closed vocabulary so typos, case drift, and reviewer prose cannot
781
+ cause silent misclassification:
694
782
 
695
783
  ```
696
- **Verdict:** Approved
697
- ```
698
- or
699
- ```
700
- **Verdict:** Revision Required
784
+ result = run_bash(f'node .forge/tools/read-verdict.cjs --phase {phase.role} --task {task_id}')
785
+ # stdout "approved" → approved
786
+ # stdout "revision" → revision
787
+ # stdout "n/a" | "unknown" → no verdict recorded (treat as malformed; do NOT guess)
788
+ # exit 2 → record not found / invalid args (treat as malformed)
701
789
  ```
702
790
 
703
- **Parse the verdict via `parse-verdict.cjs`** do NOT pattern-match the
704
- line manually. The tool enforces a closed verdict vocabulary so typos, case
705
- drift, and reviewer prose cannot cause silent misclassification:
791
+ Branch on the **stdout token** (exit 1 bundles both `revision` and the
792
+ no-verdict cases, so the token is authoritative). Recognised verdict values:
706
793
 
707
- ```
708
- FORGE_ROOT = resolve_forge_root()
709
- result = run_bash(f'node "$FORGE_ROOT/tools/parse-verdict.cjs" {artifact_path}')
710
- # exit 0 → approved (stdout "approved")
711
- # exit 1 → revision (stdout "revision")
712
- # exit 2 → unknown/malformed/missing (stdout "unknown")
713
- ```
714
-
715
- Recognised values (case-insensitive):
716
-
717
- - **approved** — `Approved`, `Approve`, `[Approved]`
718
- - **revision** — `Revision Required`, `Revision`, `Needs Revision`, `Changes Requested`
794
+ - **approved** — written as `verdict: "approved"` in the phase summary (or `task.status == approved` for the approve phase).
795
+ - **revision** — `verdict: "revision"`.
719
796
 
720
- Anything else — including free-form prose, missing bold markers, a missing
721
- verdict line, or a missing artifact yields exit 2. Do NOT treat unknown
722
- as approved or revision; halt the loop and escalate via `verdict_malformed`.
797
+ Anything else — `n/a`, `unknown`, a missing summary, or a missing record —
798
+ must NOT be treated as approved or revision; halt the loop and escalate via
799
+ `verdict_malformed`. (In bug mode pass `--bug {bug_id}`; `read-verdict.cjs`
800
+ applies the bug-specific phase→summary map.)
723
801
 
724
802
  ## Escalation Procedure
725
803
 
@@ -730,7 +808,7 @@ as approved or revision; halt the loop and escalate via `verdict_malformed`.
730
808
 
731
809
  When escalating to the human:
732
810
 
733
- 1. Update task status via `node "$FORGE_ROOT/tools/store-cli.cjs" update-status task {taskId} status escalated`
811
+ 1. Update task status via `node .forge/tools/store-cli.cjs update-status task {taskId} status escalated`
734
812
  2. Emit a final event with `verdict: "escalated"` and `notes` explaining the reason
735
813
  3. Output a clear message:
736
814
  ```
@@ -755,8 +833,8 @@ Grammar (one directive per line):
755
833
  `in [v1, v2, ...]`. Fields are dotted paths against the store record, e.g.
756
834
  `task.status`.
757
835
  - `forbid <field> <op> <value>` — predicate must NOT hold.
758
- - `after <phase> = <approved|revision>` — predecessor phase's review artifact
759
- must carry the stated verdict (parsed by `parse-verdict.cjs`).
836
+ - `after <phase> = <approved|revision>` — predecessor phase's stored verdict
837
+ must match (read from the record by `read-verdict.cjs`, not from markdown).
760
838
 
761
839
  ```gates phase=plan
762
840
  forbid task.status == committed
@@ -854,7 +932,7 @@ is a violation of the Iron Laws.
854
932
  - Subagent empty/crash/timeout response: retry once with simplified prompt
855
933
  (strip summary and architecture blocks). Escalate on second failure.
856
934
  See Subagent Response Validation in the Execution Algorithm.
857
- - Subagent non-zero exit code (not parse-verdict): same as above — retry
935
+ - Subagent non-zero exit code (not read-verdict): same as above — retry
858
936
  once, escalate on second failure. The crash reason is captured in the
859
937
  escalation event notes.
860
938
  - Verdict malformed or missing: escalate to human immediately. Never guess.
@@ -886,7 +964,7 @@ subagent returns, the orchestrator:
886
964
  4. Composes the canonical event with `eventId`, `taskId`, `sprintId`, `role`,
887
965
  `action`, `phase`, `iteration` from its own task state and `tokenSource:
888
966
  "reported"` when the runtime surfaced usage.
889
- 5. Calls `node "$FORGE_ROOT/tools/store-cli.cjs" emit {sprintId} '{event-json}'`
967
+ 5. Calls `node .forge/tools/store-cli.cjs emit {sprintId} '{event-json}'`
890
968
  with the complete record.
891
969
 
892
970
  Do not include hardcoded example `model` or `provider` strings in the
@@ -910,7 +988,7 @@ Refer subagents to `.forge/schemas/event.schema.json` instead.
910
988
  Do NOT generate a "Model Assignments" table — the Model Resolution section
911
989
  above is the single source of truth.
912
990
  - **Include the sidecar merge pattern.** After each subagent returns, run
913
- `node "$FORGE_ROOT/tools/store-cli.cjs" merge-sidecar {sprintId} {eventId}` to merge token fields from the
991
+ `node .forge/tools/store-cli.cjs merge-sidecar {sprintId} {eventId}` to merge token fields from the
914
992
  sidecar into the canonical event and delete the sidecar. If the sidecar does not
915
993
  exist (merge-sidecar exits 1), treat as non-fatal and emit the event without token
916
994
  fields (graceful fallback — no error).
@@ -938,7 +1016,7 @@ Refer subagents to `.forge/schemas/event.schema.json` instead.
938
1016
  subagents do not display banners. Instead, include progress reporting instructions
939
1017
  in the subagent prompt with the agent name, progress log path, and banner key.
940
1018
  - **Include the progress IPC pattern.** Each generated orchestrator MUST:
941
- 1. Clear the progress log at task start: `node "$FORGE_ROOT/tools/store-cli.cjs" progress-clear {sprintId}`
1019
+ 1. Clear the progress log at task start: `node .forge/tools/store-cli.cjs progress-clear {sprintId}`
942
1020
  2. Compute the agent name before each spawn: `{taskId}:{persona_noun}:{phase.role}:{iteration}`
943
1021
  3. Start a Monitor on the progress log before each subagent spawn
944
1022
  4. Include progress reporting instructions in the subagent prompt (agent name,
@@ -958,13 +1036,28 @@ Refer subagents to `.forge/schemas/event.schema.json` instead.
958
1036
  `Read engineering/architecture/stack.md` calls with a single cached summary.
959
1037
  Subagents instructed by this block should read full docs **only** when the
960
1038
  summary is insufficient.
961
- - **Include post-phase /compact calls.** After each phase-exit signal (for every
962
- non-escalation outcome), the generated orchestrator MUST:
1039
+ - **Include post-phase /compact calls with state-ledger discipline.** After each
1040
+ phase-exit signal (for every non-escalation outcome), the generated orchestrator
1041
+ MUST:
963
1042
  1. Print a checkpoint line: `[checkpoint] task={task_id} sprint={sprint_id} phase_index={i} iterations={iteration_counts}`
964
1043
  2. Run `/compact` to free orchestrator context before the next phase.
965
- All durable state is on disk; the checkpoint line ensures the compact summary
966
- preserves the loop bookkeeping (task ID, sprint ID, current phase index,
967
- iteration counts). Do NOT compact on escalation the human needs full context.
1044
+
1045
+ The `[checkpoint]` line IS the state ledger. It carries the loop bookkeeping
1046
+ (task ID, sprint ID, current phase index, iteration counts) that `/compact` must
1047
+ preserve verbatim in its summary. It is not an optional debug breadcrumb — it is
1048
+ the one line the orchestrator must carry forward through each compaction boundary.
1049
+
1050
+ Raw tool output (bash stdout, subagent return blobs, multi-KB phase responses)
1051
+ is shed at every `/compact` call. The generated orchestrator MUST NOT retain
1052
+ verbatim tool output or subagent return text between phases — only the
1053
+ checkpoint ledger line and on-disk artifact pointers survive compaction.
1054
+
1055
+ The compact summary MUST contain: the checkpoint line verbatim, the task/sprint
1056
+ IDs, and the current phase index. The compact summary MUST NOT contain: raw
1057
+ subagent return text, bash stdout blobs, or multi-line phase responses.
1058
+
1059
+ Do NOT compact on escalation (verdict_malformed or max-iterations break paths) —
1060
+ the human needs the full uncompacted context to diagnose and resume.
968
1061
 
969
1062
  ## Friction Emit
970
1063
 
@@ -984,7 +1077,7 @@ When the Orchestrator detects skill friction during orchestrate-task — a refer
984
1077
 
985
1078
  1. **Subagent-experienced friction** (the persona running plan / implement /
986
1079
  validate / etc. detects skill friction). The subagent records the signal
987
- via `node "$FORGE_ROOT/tools/friction-emit.cjs" --workflow {wf} --persona {p}
1080
+ via `node .forge/tools/friction-emit.cjs --workflow {wf} --persona {p}
988
1081
  --issue {token} [--subkind {token}] [--evidence '{...}']`, which appends a
989
1082
  judgement-only record to `.forge/cache/FRICTION-{wf}.jsonl`. After the
990
1083
  subagent returns, the orchestrator drains this file, stamps the
@@ -31,8 +31,8 @@ Break sprint requirements into a set of estimated tasks with a dependency graph.
31
31
  1. Load Context:
32
32
  - Query the store to orient on current project state before reading docs:
33
33
  ```sh
34
- node "$FORGE_ROOT/tools/store-cli.cjs" nlp "latest sprint"
35
- node "$FORGE_ROOT/tools/store-cli.cjs" nlp "open bugs"
34
+ node .forge/tools/store-cli.cjs nlp "latest sprint"
35
+ node .forge/tools/store-cli.cjs nlp "open bugs"
36
36
  ```
37
37
  Use results (titles, statuses, excerpts, file refs) to skip manual MASTER_INDEX.md navigation where sufficient.
38
38
  - Read SPRINT_REQUIREMENTS.md
@@ -52,11 +52,11 @@ Break sprint requirements into a set of estimated tasks with a dependency graph.
52
52
 
53
53
  4. Documentation:
54
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}'`.
55
+ - Create each task via `node .forge/tools/store-cli.cjs write task '{task-json}'`.
56
56
  If the command exits non-zero or the PreToolUse hook blocks the write:
57
57
  parse the error, correct the JSON, and retry (see Store-Write Verification).
58
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).
59
+ - Update the sprint record with all new task IDs via `node .forge/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
60
  If the command exits non-zero or the PreToolUse hook blocks the write:
61
61
  parse the error, correct the JSON, and retry (see Store-Write Verification).
62
62
  Do not proceed until this write succeeds.
@@ -64,7 +64,7 @@ Break sprint requirements into a set of estimated tasks with a dependency graph.
64
64
  * Folder: `engineering/sprints/{sprintId}/{taskId}/`
65
65
  * File: `TASK_PROMPT.md` — populate from `.forge/templates/TASK_PROMPT_TEMPLATE.md`
66
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`.
67
+ - Update sprint status via `node .forge/tools/store-cli.cjs update-status sprint {sprintId} status active`.
68
68
  If the command exits non-zero, parse the error and retry
69
69
  (see Store-Write Verification). Do not proceed until this write succeeds.
70
70
 
@@ -141,7 +141,7 @@ environment variable is reserved for emergency operator repair only.
141
141
  - Set token fields to `null`: `"inputTokens": null, "outputTokens": null, "estimatedCostUSD": null`.
142
142
  - Add `"source": "missing"` to sidecar JSON.
143
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`.
144
+ 4. Write the usage sidecar via `node .forge/tools/store-cli.cjs emit {sprintId} '{sidecar-json}' --sidecar`.
145
145
  5. **NEVER skip sidecar write.** Always emit (reported or placeholder with nulls).
146
146
  - **Event Emission:** Ensure the "complete" event includes the `eventId` passed by the orchestrator.
147
147
  - **Store-Write Verification:** The generated workflow MUST include the "Store-Write
@@ -31,9 +31,8 @@ The Engineer reads the task prompt, researches the codebase, and produces an imp
31
31
  ```
32
32
 
33
33
  0a. Pre-flight Gate Check:
34
- - Resolve FORGE_ROOT (`node -e "console.log(require('./.forge/config.json').paths.forgeRoot)"`).
35
34
  - **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
- - Run: `node "$FORGE_ROOT/tools/preflight-gate.cjs" --phase plan --{entity_kind} {record_id}`
35
+ - Run: `node .forge/tools/preflight-gate.cjs --phase plan --{entity_kind} {record_id}`
37
36
  - Exit 1 (gate failed) → print stderr and HALT. Do not proceed; do not attempt to produce the artifact.
38
37
  - Exit 2 (misconfiguration) → print stderr and HALT.
39
38
  - Exit 0 → continue.
@@ -42,7 +41,7 @@ The Engineer reads the task prompt, researches the codebase, and produces an imp
42
41
  - If `--force` is present in the invocation arguments, skip this step entirely.
43
42
  - If `entity_kind == "bug"`, skip this step entirely (bug state is managed by meta-fix-bug.md).
44
43
  - Read current task state:
45
- `node "$FORGE_ROOT/tools/store-cli.cjs" read task {record_id} --json`
44
+ `node .forge/tools/store-cli.cjs read task {record_id} --json`
46
45
  - Extract the `status` field from the JSON output.
47
46
  - Allowed states for this phase: `draft`, `planned`, `plan-revision-required`.
48
47
  - If the current status is NOT in the allowed set:
@@ -55,7 +54,7 @@ The Engineer reads the task prompt, researches the codebase, and produces an imp
55
54
  - Read task prompt (source of truth)
56
55
  - Query the store for this task and any related entities:
57
56
  ```sh
58
- node "$FORGE_ROOT/tools/store-cli.cjs" nlp "{taskId} with sprint with feature"
57
+ node .forge/tools/store-cli.cjs nlp "{taskId} with sprint with feature"
59
58
  ```
60
59
  Use store results directly if they include title, status, sprint, and excerpt.
61
60
  - Read the architecture summary from your injected context (if present).
@@ -86,7 +85,7 @@ The Engineer reads the task prompt, researches the codebase, and produces an imp
86
85
  5. Finalize:
87
86
  - Transitions:
88
87
  - **Task mode** — legal target from this step: `draft → planned`. Out-of-band escapes (any state): `plan-revision-required`, `code-revision-required`, `blocked`, `escalated`, `abandoned`.
89
- Update status: `node "$FORGE_ROOT/tools/store-cli.cjs" update-status task {taskId} status planned`
88
+ Update status: `node .forge/tools/store-cli.cjs update-status task {taskId} status planned`
90
89
  - **Bug mode** — NO status write. The bug remains `in-progress` until the commit phase transitions it to `fixed`. Writing `bug.status` here violates `meta-fix-bug.md § Iron Laws #2`.
91
90
  - **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.
92
91
 
@@ -110,6 +109,13 @@ The Engineer reads the task prompt, researches the codebase, and produces an imp
110
109
  Or (bug mode):
111
110
  `forge_store({ command:"set-bug-summary", args:["{record_id}", "plan"] })`
112
111
  - If the set-summary call exits non-zero, fix the sidecar JSON and retry. Do not proceed without a valid summary.
112
+
113
+ 7. Post-Phase Output Guard: satisfy the `outputs` block before returning.
114
+ ```
115
+
116
+ ```outputs phase=plan
117
+ artifact {engineering}/{sprint}/{task}/PLAN.md min=200
118
+ require summaries.plan.verdict == n/a
113
119
  ```
114
120
 
115
121
  <!-- See _fragments/iron-laws.md for Iron Laws section structure guidance -->
@@ -117,7 +123,7 @@ The Engineer reads the task prompt, researches the codebase, and produces an imp
117
123
 
118
124
  - Follow the Algorithm step by step. No code, pseudocode, or implementation sketches in the plan.
119
125
  - Read `.forge/personas/architect.md` first; print the persona identity line (emoji, name, tagline) to stdout before any other tool use.
120
- - All store I/O via `forge_store` (or `node "$FORGE_ROOT/tools/store-cli.cjs"`). Never edit `.forge/store/*.json` directly.
126
+ - All store I/O via `forge_store` (or `node .forge/tools/store-cli.cjs`). Never edit `.forge/store/*.json` directly.
121
127
 
122
128
  ## Store-Write Verification
123
129
 
@@ -23,7 +23,7 @@ Close a sprint by reviewing learnings, updating the knowledge base, and improvin
23
23
 
24
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
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.
26
+ - All store I/O via `forge_store` (or `node .forge/tools/store-cli.cjs`). Never edit `.forge/store/*.json` directly.
27
27
 
28
28
  ## Algorithm
29
29
 
@@ -45,8 +45,8 @@ Close a sprint by reviewing learnings, updating the knowledge base, and improvin
45
45
 
46
46
  4. Finalize:
47
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`
48
+ - Update sprint status via `node .forge/tools/store-cli.cjs update-status sprint {sprintId} status retrospective-done`
49
+ - Run `node .forge/tools/collate.cjs {sprintId} --purge-events`
50
50
  This single deterministic step: generates COST_REPORT.md from all
51
51
  accumulated events, then deletes `.forge/store/events/{sprintId}/`.
52
52
  COST_REPORT.md is the durable record; the raw event files are not
@@ -69,5 +69,5 @@ Close a sprint by reviewing learnings, updating the knowledge base, and improvin
69
69
  (Claude Code only); on any other runtime treat as unavailable and proceed.
70
70
  Do NOT shell out to a `cost-cli.cjs` — there is no such tool.
71
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`.
72
+ 3. Write the usage sidecar via `node .forge/tools/store-cli.cjs emit {sprintId} '{sidecar-json}' --sidecar`.
73
73
  - **Event Emission:** Ensure the "complete" event includes the `eventId` passed by the orchestrator.
@@ -23,7 +23,7 @@ Close a sprint by reviewing learnings, updating the knowledge base, and improvin
23
23
 
24
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
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.
26
+ - All store I/O via `forge_store` (or `node .forge/tools/store-cli.cjs`). Never edit `.forge/store/*.json` directly.
27
27
 
28
28
  ## Algorithm
29
29
 
@@ -45,8 +45,8 @@ Close a sprint by reviewing learnings, updating the knowledge base, and improvin
45
45
 
46
46
  4. Finalize:
47
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`
48
+ - Update sprint status via `node .forge/tools/store-cli.cjs update-status sprint {sprintId} status retrospective-done`
49
+ - Run `node .forge/tools/collate.cjs {sprintId} --purge-events`
50
50
  This single deterministic step: generates COST_REPORT.md from all
51
51
  accumulated events, then deletes `.forge/store/events/{sprintId}/`.
52
52
  COST_REPORT.md is the durable record; the raw event files are not
@@ -69,5 +69,5 @@ Close a sprint by reviewing learnings, updating the knowledge base, and improvin
69
69
  (Claude Code only); on any other runtime treat as unavailable and proceed.
70
70
  Do NOT shell out to a `cost-cli.cjs` — there is no such tool.
71
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`.
72
+ 3. Write the usage sidecar via `node .forge/tools/store-cli.cjs emit {sprintId} '{sidecar-json}' --sidecar`.
73
73
  - **Event Emission:** Ensure the "complete" event includes the `eventId` passed by the orchestrator.