@entelligentsia/forgecli 1.0.10 → 1.0.20

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 (183) hide show
  1. package/CHANGELOG.md +191 -0
  2. package/dist/CHANGELOG-forge-plugin.md +211 -0
  3. package/dist/bin/forge.js +0 -0
  4. package/dist/extensions/forgecli/config-layer.js.map +1 -1
  5. package/dist/extensions/forgecli/context-governor-compaction.d.ts +83 -0
  6. package/dist/extensions/forgecli/context-governor-compaction.js +302 -0
  7. package/dist/extensions/forgecli/context-governor-compaction.js.map +1 -0
  8. package/dist/extensions/forgecli/context-governor.d.ts +173 -0
  9. package/dist/extensions/forgecli/context-governor.js +618 -0
  10. package/dist/extensions/forgecli/context-governor.js.map +1 -0
  11. package/dist/extensions/forgecli/dashboard/component.d.ts +105 -0
  12. package/dist/extensions/forgecli/dashboard/component.js +861 -0
  13. package/dist/extensions/forgecli/dashboard/component.js.map +1 -0
  14. package/dist/extensions/forgecli/dashboard/register.d.ts +2 -0
  15. package/dist/extensions/forgecli/dashboard/register.js +31 -0
  16. package/dist/extensions/forgecli/dashboard/register.js.map +1 -0
  17. package/dist/extensions/forgecli/dashboard/theme.d.ts +27 -0
  18. package/dist/extensions/forgecli/dashboard/theme.js +91 -0
  19. package/dist/extensions/forgecli/dashboard/theme.js.map +1 -0
  20. package/dist/extensions/forgecli/dashboard/view-model.d.ts +35 -0
  21. package/dist/extensions/forgecli/dashboard/view-model.js +54 -0
  22. package/dist/extensions/forgecli/dashboard/view-model.js.map +1 -0
  23. package/dist/extensions/forgecli/fix-bug.js +126 -7
  24. package/dist/extensions/forgecli/fix-bug.js.map +1 -1
  25. package/dist/extensions/forgecli/forge-artifact-tool.js +2 -1
  26. package/dist/extensions/forgecli/forge-artifact-tool.js.map +1 -1
  27. package/dist/extensions/forgecli/forge-commands.js +1 -0
  28. package/dist/extensions/forgecli/forge-commands.js.map +1 -1
  29. package/dist/extensions/forgecli/forge-init/phase4-register.js +53 -0
  30. package/dist/extensions/forgecli/forge-init/phase4-register.js.map +1 -1
  31. package/dist/extensions/forgecli/forge-subagent.d.ts +20 -1
  32. package/dist/extensions/forgecli/forge-subagent.js +23 -7
  33. package/dist/extensions/forgecli/forge-subagent.js.map +1 -1
  34. package/dist/extensions/forgecli/forge-tools.js +3 -1
  35. package/dist/extensions/forgecli/forge-tools.js.map +1 -1
  36. package/dist/extensions/forgecli/hook-dispatcher.d.ts +3 -1
  37. package/dist/extensions/forgecli/hook-dispatcher.js +37 -3
  38. package/dist/extensions/forgecli/hook-dispatcher.js.map +1 -1
  39. package/dist/extensions/forgecli/index.js +38 -1
  40. package/dist/extensions/forgecli/index.js.map +1 -1
  41. package/dist/extensions/forgecli/lib/halt-advisor.d.ts +59 -0
  42. package/dist/extensions/forgecli/lib/halt-advisor.js +113 -0
  43. package/dist/extensions/forgecli/lib/halt-advisor.js.map +1 -0
  44. package/dist/extensions/forgecli/migration-engine.js +25 -12
  45. package/dist/extensions/forgecli/migration-engine.js.map +1 -1
  46. package/dist/extensions/forgecli/orchestrator-status-bar.d.ts +26 -0
  47. package/dist/extensions/forgecli/orchestrator-status-bar.js +213 -0
  48. package/dist/extensions/forgecli/orchestrator-status-bar.js.map +1 -0
  49. package/dist/extensions/forgecli/orchestrator-tree.d.ts +96 -0
  50. package/dist/extensions/forgecli/orchestrator-tree.js +390 -0
  51. package/dist/extensions/forgecli/orchestrator-tree.js.map +1 -0
  52. package/dist/extensions/forgecli/project-orientation.js +12 -8
  53. package/dist/extensions/forgecli/project-orientation.js.map +1 -1
  54. package/dist/extensions/forgecli/regenerate.d.ts +16 -0
  55. package/dist/extensions/forgecli/regenerate.js +110 -0
  56. package/dist/extensions/forgecli/regenerate.js.map +1 -1
  57. package/dist/extensions/forgecli/run-sprint.d.ts +3 -1
  58. package/dist/extensions/forgecli/run-sprint.js +34 -3
  59. package/dist/extensions/forgecli/run-sprint.js.map +1 -1
  60. package/dist/extensions/forgecli/run-task.d.ts +66 -1
  61. package/dist/extensions/forgecli/run-task.js +323 -12
  62. package/dist/extensions/forgecli/run-task.js.map +1 -1
  63. package/dist/extensions/forgecli/thread-switcher.d.ts +4 -1
  64. package/dist/extensions/forgecli/thread-switcher.js +118 -762
  65. package/dist/extensions/forgecli/thread-switcher.js.map +1 -1
  66. package/dist/extensions/forgecli/viewport-events.js +32 -0
  67. package/dist/extensions/forgecli/viewport-events.js.map +1 -1
  68. package/dist/forge-payload/.base-pack/commands/fix-bug.md +1 -1
  69. package/dist/forge-payload/.base-pack/commands/run-sprint.md +1 -1
  70. package/dist/forge-payload/.base-pack/commands/run-task.md +1 -1
  71. package/dist/forge-payload/.base-pack/personas/architect.md +1 -1
  72. package/dist/forge-payload/.base-pack/personas/bug-fixer.md +1 -1
  73. package/dist/forge-payload/.base-pack/personas/collator.md +3 -3
  74. package/dist/forge-payload/.base-pack/personas/engineer.md +1 -1
  75. package/dist/forge-payload/.base-pack/personas/librarian.md +1 -1
  76. package/dist/forge-payload/.base-pack/personas/orchestrator.md +1 -1
  77. package/dist/forge-payload/.base-pack/personas/product-manager.md +1 -1
  78. package/dist/forge-payload/.base-pack/personas/qa-engineer.md +1 -1
  79. package/dist/forge-payload/.base-pack/personas/supervisor.md +1 -1
  80. package/dist/forge-payload/.base-pack/workflows/_fragments/event-emission-schema.md +1 -1
  81. package/dist/forge-payload/.base-pack/workflows/_fragments/friction-emit.md +1 -1
  82. package/dist/forge-payload/.base-pack/workflows/_fragments/iron-laws.md +1 -1
  83. package/dist/forge-payload/.base-pack/workflows/_fragments/progress-reporting.md +2 -2
  84. package/dist/forge-payload/.base-pack/workflows/_fragments/store-cli-verbs.md +11 -2
  85. package/dist/forge-payload/.base-pack/workflows/architect_approve.md +6 -7
  86. package/dist/forge-payload/.base-pack/workflows/architect_review_sprint_completion.md +2 -2
  87. package/dist/forge-payload/.base-pack/workflows/architect_sprint_intake.md +2 -2
  88. package/dist/forge-payload/.base-pack/workflows/architect_sprint_plan.md +5 -5
  89. package/dist/forge-payload/.base-pack/workflows/collator_agent.md +4 -6
  90. package/dist/forge-payload/.base-pack/workflows/commit_task.md +5 -6
  91. package/dist/forge-payload/.base-pack/workflows/enhance.md +5 -5
  92. package/dist/forge-payload/.base-pack/workflows/implement_plan.md +15 -7
  93. package/dist/forge-payload/.base-pack/workflows/migrate_structural.md +12 -13
  94. package/dist/forge-payload/.base-pack/workflows/plan_task.md +12 -6
  95. package/dist/forge-payload/.base-pack/workflows/review_code.md +12 -11
  96. package/dist/forge-payload/.base-pack/workflows/review_plan.md +12 -11
  97. package/dist/forge-payload/.base-pack/workflows/sprint_retrospective.md +3 -3
  98. package/dist/forge-payload/.base-pack/workflows/triage.md +12 -9
  99. package/dist/forge-payload/.base-pack/workflows/update_implementation.md +2 -2
  100. package/dist/forge-payload/.base-pack/workflows/update_plan.md +2 -2
  101. package/dist/forge-payload/.base-pack/workflows/validate_task.md +9 -9
  102. package/dist/forge-payload/.base-pack/workflows-js/wfl-fix-bug.js +490 -0
  103. package/dist/forge-payload/.base-pack/workflows-js/wfl-run-sprint.js +416 -0
  104. package/dist/forge-payload/.base-pack/workflows-js/wfl-run-task.js +608 -0
  105. package/dist/forge-payload/.claude-plugin/plugin.json +1 -1
  106. package/dist/forge-payload/.schemas/config.schema.json +2 -3
  107. package/dist/forge-payload/.schemas/enum-catalog.json +2 -2
  108. package/dist/forge-payload/.schemas/event.schema.json +16 -0
  109. package/dist/forge-payload/.schemas/migrations.json +359 -18
  110. package/dist/forge-payload/commands/health.md +29 -0
  111. package/dist/forge-payload/commands/rebuild.md +143 -15
  112. package/dist/forge-payload/commands/update.md +28 -27
  113. package/dist/forge-payload/hooks/preflight-session.cjs +99 -0
  114. package/dist/forge-payload/init/phases/phase-3-materialize.md +18 -5
  115. package/dist/forge-payload/integrity.json +7 -6
  116. package/dist/forge-payload/meta/fragments/tool-discipline.md +1 -1
  117. package/dist/forge-payload/meta/personas/meta-architect.md +1 -1
  118. package/dist/forge-payload/meta/personas/meta-bug-fixer.md +1 -1
  119. package/dist/forge-payload/meta/personas/meta-collator.md +7 -7
  120. package/dist/forge-payload/meta/personas/meta-engineer.md +1 -1
  121. package/dist/forge-payload/meta/personas/meta-orchestrator.md +1 -1
  122. package/dist/forge-payload/meta/personas/meta-supervisor.md +1 -1
  123. package/dist/forge-payload/meta/tool-specs/store-cli.spec.md +1 -1
  124. package/dist/forge-payload/meta/workflows/_fragments/event-emission-schema.md +1 -1
  125. package/dist/forge-payload/meta/workflows/_fragments/friction-emit.md +1 -1
  126. package/dist/forge-payload/meta/workflows/_fragments/iron-laws.md +1 -1
  127. package/dist/forge-payload/meta/workflows/_fragments/progress-reporting.md +2 -2
  128. package/dist/forge-payload/meta/workflows/_fragments/store-cli-verbs.md +11 -2
  129. package/dist/forge-payload/meta/workflows/meta-approve.md +6 -7
  130. package/dist/forge-payload/meta/workflows/meta-bug-triage.md +12 -9
  131. package/dist/forge-payload/meta/workflows/meta-collate.md +5 -7
  132. package/dist/forge-payload/meta/workflows/meta-commit.md +5 -6
  133. package/dist/forge-payload/meta/workflows/meta-enhance.md +5 -5
  134. package/dist/forge-payload/meta/workflows/meta-fix-bug.md +35 -11
  135. package/dist/forge-payload/meta/workflows/meta-implement.md +15 -7
  136. package/dist/forge-payload/meta/workflows/meta-migrate.md +13 -14
  137. package/dist/forge-payload/meta/workflows/meta-new-sprint.md +3 -3
  138. package/dist/forge-payload/meta/workflows/meta-orchestrate.md +138 -39
  139. package/dist/forge-payload/meta/workflows/meta-plan-sprint.md +6 -6
  140. package/dist/forge-payload/meta/workflows/meta-plan-task.md +12 -6
  141. package/dist/forge-payload/meta/workflows/meta-retro.md +4 -4
  142. package/dist/forge-payload/meta/workflows/meta-retrospective.md +4 -4
  143. package/dist/forge-payload/meta/workflows/meta-review-implementation.md +12 -11
  144. package/dist/forge-payload/meta/workflows/meta-review-plan.md +12 -11
  145. package/dist/forge-payload/meta/workflows/meta-review-sprint-completion.md +3 -3
  146. package/dist/forge-payload/meta/workflows/meta-sprint-intake.md +3 -3
  147. package/dist/forge-payload/meta/workflows/meta-sprint-plan.md +6 -6
  148. package/dist/forge-payload/meta/workflows/meta-update-implementation.md +2 -2
  149. package/dist/forge-payload/meta/workflows/meta-update-plan.md +2 -2
  150. package/dist/forge-payload/meta/workflows/meta-validate.md +9 -9
  151. package/dist/forge-payload/schemas/config.schema.json +2 -3
  152. package/dist/forge-payload/schemas/enum-catalog.json +2 -2
  153. package/dist/forge-payload/schemas/event.schema.json +16 -0
  154. package/dist/forge-payload/schemas/structure-manifest.json +75 -73
  155. package/dist/forge-payload/skills/refresh-kb-links/SKILL.md +14 -7
  156. package/dist/forge-payload/tools/banners.cjs +29 -10
  157. package/dist/forge-payload/tools/check-structure.cjs +88 -7
  158. package/dist/forge-payload/tools/collate.cjs +48 -2
  159. package/dist/forge-payload/tools/manage-config.cjs +5 -7
  160. package/dist/forge-payload/tools/parse-gates.cjs +73 -1
  161. package/dist/forge-payload/tools/postflight-gate.cjs +298 -0
  162. package/dist/forge-payload/tools/preflight-gate.cjs +47 -0
  163. package/dist/forge-payload/tools/substitute-placeholders.cjs +5 -4
  164. package/dist/forge-payload/tools/verify-phase.cjs +17 -0
  165. package/package.json +2 -2
  166. package/dist/bin/forgecli.d.ts +0 -2
  167. package/dist/bin/forgecli.js +0 -6
  168. package/dist/bin/forgecli.js.map +0 -1
  169. package/dist/extensions/forgecli/config-tui/index.d.ts +0 -5
  170. package/dist/extensions/forgecli/config-tui/index.js +0 -5
  171. package/dist/extensions/forgecli/config-tui/index.js.map +0 -1
  172. package/dist/extensions/forgecli/loaders/persona-skill-loader.d.ts +0 -45
  173. package/dist/extensions/forgecli/loaders/persona-skill-loader.js +0 -227
  174. package/dist/extensions/forgecli/loaders/persona-skill-loader.js.map +0 -1
  175. package/dist/extensions/forgecli/loaders/template-render.d.ts +0 -20
  176. package/dist/extensions/forgecli/loaders/template-render.js +0 -85
  177. package/dist/extensions/forgecli/loaders/template-render.js.map +0 -1
  178. package/dist/extensions/forgecli/loaders/workflow-loader.d.ts +0 -41
  179. package/dist/extensions/forgecli/loaders/workflow-loader.js +0 -164
  180. package/dist/extensions/forgecli/loaders/workflow-loader.js.map +0 -1
  181. package/dist/forge-payload/.base-pack/workflows/fix_bug.md +0 -446
  182. package/dist/forge-payload/.base-pack/workflows/orchestrate_task.md +0 -928
  183. package/dist/forge-payload/.base-pack/workflows/run_sprint.md +0 -225
@@ -42,7 +42,7 @@ fields (`model`, `provider`, `eventId`, timestamps, token counts) are
42
42
  at drain time.
43
43
 
44
44
  ```sh
45
- node "$FORGE_ROOT/tools/friction-emit.cjs" \
45
+ node .forge/tools/friction-emit.cjs \
46
46
  --workflow {workflow-key} \
47
47
  --persona {persona-noun} \
48
48
  --issue skill_unused \
@@ -21,7 +21,7 @@ An Iron Laws section MUST contain exactly these three bullets in this order:
21
21
 
22
22
  - {WORKFLOW_SPECIFIC_LAW}
23
23
  - Read `.forge/personas/{persona}.md` first; print the persona identity line (emoji, name, tagline) to stdout before any other tool use.
24
- - All store I/O via `forge_store` (or `node "$FORGE_ROOT/tools/store-cli.cjs"`). Never edit `.forge/store/*.json` directly.
24
+ - All store I/O via `forge_store` (or `node .forge/tools/store-cli.cjs`). Never edit `.forge/store/*.json` directly.
25
25
  ```
26
26
 
27
27
  ### Slot definitions
@@ -25,7 +25,7 @@ orchestrator monitors in real time.
25
25
  **Writing entries:** Use `store-cli progress`:
26
26
 
27
27
  ```
28
- node "$FORGE_ROOT/tools/store-cli.cjs" progress {sprintId} {agentName} {bannerKey} {status} "detail text"
28
+ node .forge/tools/store-cli.cjs progress {sprintId} {agentName} {bannerKey} {status} "detail text"
29
29
  ```
30
30
 
31
31
  **Monitoring:** The orchestrator starts a Monitor on the progress log before
@@ -34,5 +34,5 @@ spawning each subagent and stops it after the subagent returns.
34
34
  **Clearing:** The orchestrator clears the progress log at task start:
35
35
 
36
36
  ```
37
- node "$FORGE_ROOT/tools/store-cli.cjs" progress-clear {sprintId}
37
+ node .forge/tools/store-cli.cjs progress-clear {sprintId}
38
38
  ```
@@ -28,7 +28,7 @@ Notes for subagents:
28
28
  Do not `write` a task back with a new `status` field; the FSM is enforced
29
29
  by `update-status`. Syntax requires the field keyword `status` as the third
30
30
  argument — four args total:
31
- `node "$FORGE_ROOT/tools/store-cli.cjs" update-status task {taskId} status {value}`
31
+ `node .forge/tools/store-cli.cjs update-status task {taskId} status {value}`
32
32
  The three-arg form `update-status task {taskId} {value}` is WRONG and will
33
33
  error. Always include `status` between the id and the value.
34
34
  - **`emit`** appends an event. There is no `append-event` / `add-event`.
@@ -38,6 +38,15 @@ Notes for subagents:
38
38
  canonical phase→filename map (so `set-summary {taskId} validation` just works).
39
39
  Never pass a hand-built `engineering/sprints/.../…-SUMMARY.json` path. Do not
40
40
  inline summaries into the entity via `write`.
41
+ - **`forge_store` tool shape (not CLI flags).** The tool has exactly two
42
+ fields: `command` (string) and `args` (positional string array). There is
43
+ NO `entity` / `id` / `phase` named field — passing them silently drops them.
44
+ The summary call is `forge_store({ command:"set-summary", args:["<id>", "<phase>"] })`
45
+ where `args[0]` is the record id and `args[1]` is the LITERAL phase key
46
+ (`plan`, `review_plan`, `implementation`, `code_review`, `validation`,
47
+ `triage`, `approve`). `args[1]` is NEVER the record id and NEVER a path —
48
+ putting the id in both slots is the canonical failure and the phase-ownership
49
+ guard rejects it with `expected summary key '<phase>'`.
41
50
  - **Artifact I/O:** Use `forge_artifact` for ALL phase artifact reads and writes
42
51
  (PLAN.md, PROGRESS.md, *-SUMMARY.json, CODE_REVIEW.md, etc.). Never construct
43
52
  artifact file paths manually — the tool resolves paths from entity IDs and
@@ -56,7 +65,7 @@ Notes for subagents:
56
65
  These spellings are parsed literally by tools (`preflight-gate.cjs`,
57
66
  `collate.cjs`) — do not invent new spellings or rename them in prose.
58
67
  - If you need a verb not on this list, run
59
- `node "$FORGE_ROOT/tools/store-cli.cjs" --help` before improvising.
68
+ `node .forge/tools/store-cli.cjs --help` before improvising.
60
69
  - If you supply an unknown verb, entity type, enum value, or field name,
61
70
  store-cli appends a **Did you mean?** suggestion to the error message.
62
71
  Suggestions use Levenshtein distance (≤ 2) and a curated drift map for
@@ -31,7 +31,7 @@ The Architect gives final sign-off on a completed task after Supervisor approval
31
31
 
32
32
  - Approve only when the implementation is consistent with the project's architecture and the deployment posture is understood. Architectural sign-off is not a rubber stamp — it is the last point at which cross-cutting concerns can be caught cheaply.
33
33
  - Read `.forge/personas/architect.md` first; print the persona identity line (emoji, name, tagline) to stdout before any other tool use.
34
- - All store I/O via `forge_store` (or `node "$FORGE_ROOT/tools/store-cli.cjs"`). Never edit `.forge/store/*.json` directly.
34
+ - All store I/O via `forge_store` (or `node .forge/tools/store-cli.cjs`). Never edit `.forge/store/*.json` directly.
35
35
 
36
36
  ## Store-Write Verification
37
37
 
@@ -42,9 +42,8 @@ The Architect gives final sign-off on a completed task after Supervisor approval
42
42
  ```
43
43
 
44
44
  0a. Pre-flight Gate Check:
45
- - Resolve FORGE_ROOT (`node -e "console.log(require('./.forge/config.json').paths.forgeRoot)"`).
46
45
  - **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 approve --{entity_kind} {record_id}`
46
+ - Run: `node .forge/tools/preflight-gate.cjs --phase approve --{entity_kind} {record_id}`
48
47
  - Exit 1 (gate failed) → print stderr and HALT. Do not proceed; do not attempt to produce the artifact.
49
48
  - Exit 2 (misconfiguration) → print stderr and HALT.
50
49
  - Exit 0 → continue.
@@ -53,7 +52,7 @@ The Architect gives final sign-off on a completed task after Supervisor approval
53
52
  - If `--force` is present in the invocation arguments, skip this step entirely.
54
53
  - If `entity_kind == "bug"`, skip this step entirely (bug state is managed by meta-fix-bug.md).
55
54
  - Read current task state:
56
- `node "$FORGE_ROOT/tools/store-cli.cjs" read task {record_id} --json`
55
+ `node .forge/tools/store-cli.cjs read task {record_id} --json`
57
56
  - Extract the `status` field from the JSON output.
58
57
  - Allowed states for this phase: `review-approved`.
59
58
  - If the current status is NOT in the allowed set:
@@ -86,7 +85,7 @@ The Architect gives final sign-off on a completed task after Supervisor approval
86
85
 
87
86
  4. Finalize:
88
87
  - Transitions:
89
- - **Task mode** — Update status: `node "$FORGE_ROOT/tools/store-cli.cjs" update-status task {taskId} status approved`. The status IS the verdict signal for task-mode commit gate (`STATUS_SOURCE` in `read-verdict.cjs`).
88
+ - **Task mode** — Update status: `node .forge/tools/store-cli.cjs update-status task {taskId} status approved`. The status IS the verdict signal for task-mode commit gate (`STATUS_SOURCE` in `read-verdict.cjs`).
90
89
  - **Bug mode** — NO status write. The bug remains `in-progress`. The verdict signal travels through `summaries.approve.verdict` written in step 5 below (read by `read-verdict.cjs § BUG_PHASE_VERDICT_SOURCE`). Writing `bug.status` here — especially writing `approved` or `verified` — violates `meta-fix-bug.md § Iron Laws #2` and is the trap that produced the FORGE-BUG-002 regression.
91
90
  - **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.
92
91
 
@@ -106,11 +105,11 @@ The Architect gives final sign-off on a completed task after Supervisor approval
106
105
  - Call (task mode) — optional for tasks, since `task.status` is the canonical signal.
107
106
  The sidecar path is auto-resolved from the record's `path` — never pass it:
108
107
  ```
109
- node "$FORGE_ROOT/tools/store-cli.cjs" set-summary {taskId} approve
108
+ node .forge/tools/store-cli.cjs set-summary {taskId} approve
110
109
  ```
111
110
  Or (bug mode) — REQUIRED for bugs, this is the canonical verdict signal:
112
111
  ```
113
- node "$FORGE_ROOT/tools/store-cli.cjs" set-bug-summary {bugId} approve
112
+ node .forge/tools/store-cli.cjs set-bug-summary {bugId} approve
114
113
  ```
115
114
  - In bug mode, if the set-bug-summary call exits non-zero, fix the sidecar JSON and retry. Do not return without a valid summary — the downstream commit gate has no other way to read the approval verdict.
116
115
  ```
@@ -37,7 +37,7 @@ and the only phase that records the route decision read by the orchestrator
37
37
  reproduction has no business going to plan-fix or implement.
38
38
  - Read `.forge/personas/bug-fixer.md` first; print the persona identity
39
39
  line (emoji, name, tagline) to stdout before any other tool use.
40
- - All store I/O via `forge_store` (or `node "$FORGE_ROOT/tools/store-cli.cjs"`).
40
+ - All store I/O via `forge_store` (or `node .forge/tools/store-cli.cjs`).
41
41
  Never edit `.forge/store/*.json` directly.
42
42
  - **Triage NEVER writes `bug.status`.** The orchestrator (`meta-fix-bug.md`)
43
43
  owns the `reported → triaged` and `triaged → in-progress` transitions.
@@ -60,8 +60,7 @@ and the only phase that records the route decision read by the orchestrator
60
60
  ```
61
61
 
62
62
  0. Pre-flight Gate Check:
63
- - Resolve FORGE_ROOT (`node -e "console.log(require('./.forge/config.json').paths.forgeRoot)"`).
64
- - Run: `node "$FORGE_ROOT/tools/preflight-gate.cjs" --phase triage --bug {bugId}`
63
+ - Run: `node .forge/tools/preflight-gate.cjs --phase triage --bug {bugId}`
65
64
  - Exit 1 (gate failed) → print stderr and HALT. Do not proceed.
66
65
  - Exit 2 (misconfiguration) → print stderr and HALT.
67
66
  - Exit 0 → continue.
@@ -70,7 +69,7 @@ and the only phase that records the route decision read by the orchestrator
70
69
  - Read `.forge/personas/bug-fixer.md` first; print the persona identity
71
70
  line to stdout before any other tool use.
72
71
  - Read the bug record:
73
- `forge_store({ command:"read", entity:"bug", id:"{bugId}" })`
72
+ `forge_store({ command:"read", args:["bug", "{bugId}"] })`
74
73
  - Read business domain docs relevant to the reported symptom.
75
74
  - store-cli verbs: `read` | `list` | `write` | `emit` |
76
75
  `update-status` | `set-summary` | `set-bug-summary` | `describe` |
@@ -138,13 +137,17 @@ and the only phase that records the route decision read by the orchestrator
138
137
 
139
138
  - Call:
140
139
  ```
141
- forge_store({ command:"set-bug-summary", entity:"bug",
142
- id:"{bugId}", phase:"triage" })
140
+ forge_store({ command:"set-bug-summary", args:["{bugId}", "triage"] })
143
141
  // sidecar path auto-resolved from the bug record's `path` — never pass it
144
142
  ```
145
- - If the set-bug-summary call exits non-zero, fix the sidecar JSON
146
- and retry (up to 3 attempts per the Store-Write Verification rule).
147
- Do not proceed without a valid summary.
143
+ `forge_store` has only `command` + `args` (positional) no
144
+ `entity`/`id`/`phase` field. `args[0]` is the bug id, `args[1]` is the
145
+ LITERAL phase key `triage` (never the bug id, never a path). See
146
+ `_fragments/store-cli-verbs.md`.
147
+ - If the set-bug-summary call exits non-zero (phase-ownership guard:
148
+ `expected summary key 'triage'`), `args[1]` was wrong — set it to `triage`
149
+ and retry (up to 3 attempts per the Store-Write Verification rule). Do not
150
+ proceed without a valid summary.
148
151
 
149
152
  > **Field-naming caution — runtime-tested.** The route field is named
150
153
  > `route`, never `path`. The bug schema's top-level `path` field is the
@@ -23,7 +23,7 @@ Regenerate markdown views from the JSON store. This is a deterministic operation
23
23
 
24
24
  - Collation is a read-and-rewrite of generated markdown. Do not mutate any JSON record under `.forge/store/`; the store is the source of truth and collation flows downstream from it.
25
25
  - Read `.forge/personas/collator.md` first; print the persona identity line (emoji, name, tagline) to stdout before any other tool use.
26
- - All store reads via `forge_store` (or `node "$FORGE_ROOT/tools/store-cli.cjs"`). Never edit `.forge/store/*.json` directly.
26
+ - All store reads via `forge_store` (or `node .forge/tools/store-cli.cjs`). Never edit `.forge/store/*.json` directly.
27
27
  - Do NOT call `set-summary` or `set-bug-summary` from within collation. The collator writes markdown views and a `WRITEBACK-SUMMARY.json` disk file only. Calling `set-summary` mutates the JSON store and violates Iron Law 1 (the store is the source of truth; collation flows downstream from it, not into it). The orchestrator reads `WRITEBACK-SUMMARY.json` directly — no store write is needed.
28
28
 
29
29
  <!-- See _fragments/store-write-verification.md — NOTE: this file uses an intentionally modified
@@ -46,8 +46,7 @@ Never set `FORGE_SKIP_WRITE_VALIDATION=1` — operator-only emergency switch.
46
46
 
47
47
  ```
48
48
  1. Preferred: Run Plugin Tool
49
- - Read `paths.forgeRoot` from `.forge/config.json` as `FORGE_ROOT`
50
- - Run: `node "$FORGE_ROOT/tools/collate.cjs" [SPRINT_ID]`
49
+ - Run: `node .forge/tools/collate.cjs [SPRINT_ID]`
51
50
  - If tool succeeds, proceed to Finalize
52
51
 
53
52
  2. Fallback: Manual Collation
@@ -61,9 +60,8 @@ Never set `FORGE_SKIP_WRITE_VALIDATION=1` — operator-only emergency switch.
61
60
  - Rebuild the architecture context pack so orchestrators have a fresh summary
62
61
  after any KB updates (architecture docs may have changed during the sprint):
63
62
  ```
64
- FORGE_ROOT=$(node -e "console.log(require('./.forge/config.json').paths.forgeRoot)")
65
- ENGINEERING=$(node "$FORGE_ROOT/tools/manage-config.cjs" get paths.engineering 2>/dev/null || echo engineering)
66
- node "$FORGE_ROOT/tools/build-context-pack.cjs" \
63
+ ENGINEERING=$(node .forge/tools/manage-config.cjs get paths.engineering 2>/dev/null || echo engineering)
64
+ node .forge/tools/build-context-pack.cjs \
67
65
  --arch-dir "$ENGINEERING/architecture" \
68
66
  --out-md .forge/cache/context-pack.md \
69
67
  --out-json .forge/cache/context-pack.json
@@ -101,5 +99,5 @@ Never set `FORGE_SKIP_WRITE_VALIDATION=1` — operator-only emergency switch.
101
99
  (Claude Code only); on any other runtime treat as unavailable and proceed.
102
100
  Do NOT shell out to a `cost-cli.cjs` — there is no such tool.
103
101
  2. Parse: `inputTokens`, `outputTokens`, `cacheReadTokens`, `cacheWriteTokens`, `estimatedCostUSD`.
104
- 3. Write the usage sidecar via `node "$FORGE_ROOT/tools/store-cli.cjs" emit {sprintId} '{sidecar-json}' --sidecar`.
102
+ 3. Write the usage sidecar via `node .forge/tools/store-cli.cjs emit {sprintId} '{sidecar-json}' --sidecar`.
105
103
  - **Event Emission:** Ensure the "complete" event includes the `eventId` passed by the orchestrator.
@@ -31,7 +31,7 @@ Seal a completed and approved task by committing its artifacts to the VCS and up
31
31
 
32
32
  - Commit only the artifacts produced for this task; do not sweep unrelated working-tree changes into the commit. The commit boundary mirrors the task boundary.
33
33
  - Read `.forge/personas/engineer.md` first; print the persona identity line (emoji, name, tagline) to stdout before any other tool use.
34
- - All store I/O via `forge_store` (or `node "$FORGE_ROOT/tools/store-cli.cjs"`). Never edit `.forge/store/*.json` directly.
34
+ - All store I/O via `forge_store` (or `node .forge/tools/store-cli.cjs`). Never edit `.forge/store/*.json` directly.
35
35
 
36
36
  ## Store-Write Verification
37
37
 
@@ -42,9 +42,8 @@ Seal a completed and approved task by committing its artifacts to the VCS and up
42
42
  ```
43
43
 
44
44
  0a. Pre-flight Gate Check:
45
- - Resolve FORGE_ROOT (`node -e "console.log(require('./.forge/config.json').paths.forgeRoot)"`).
46
45
  - **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 commit --{entity_kind} {record_id}`
46
+ - Run: `node .forge/tools/preflight-gate.cjs --phase commit --{entity_kind} {record_id}`
48
47
  - Exit 1 (gate failed) → print stderr and HALT. Do not proceed; do not attempt to produce the artifact.
49
48
  - Exit 2 (misconfiguration) → print stderr and HALT.
50
49
  - Exit 0 → continue.
@@ -53,7 +52,7 @@ Seal a completed and approved task by committing its artifacts to the VCS and up
53
52
  - If `--force` is present in the invocation arguments, skip this step entirely.
54
53
  - If `entity_kind == "bug"`, skip this step entirely (bug state is managed by meta-fix-bug.md).
55
54
  - Read current task state:
56
- `node "$FORGE_ROOT/tools/store-cli.cjs" read task {record_id} --json`
55
+ `node .forge/tools/store-cli.cjs read task {record_id} --json`
57
56
  - Extract the `status` field from the JSON output.
58
57
  - Allowed states for this phase: `approved`.
59
58
  - If the current status is NOT in the allowed set:
@@ -79,8 +78,8 @@ Seal a completed and approved task by committing its artifacts to the VCS and up
79
78
 
80
79
  4. Store Finalization:
81
80
  - Transitions:
82
- - **Task mode** — `approved → committed` (terminal): `node "$FORGE_ROOT/tools/store-cli.cjs" update-status task {taskId} status committed`
83
- - **Bug mode** — `in-progress → fixed` (terminal): `node "$FORGE_ROOT/tools/store-cli.cjs" update-status bug {bugId} status fixed`. This is the ONLY phase in the bug pipeline that writes `bug.status` post-triage (see `meta-fix-bug.md § Iron Laws #2`). Do NOT write `approved` or `verified` — those values are vestigial enum members slated for removal.
81
+ - **Task mode** — `approved → committed` (terminal): `node .forge/tools/store-cli.cjs update-status task {taskId} status committed`
82
+ - **Bug mode** — `in-progress → fixed` (terminal): `node .forge/tools/store-cli.cjs update-status bug {bugId} status fixed`. This is the ONLY phase in the bug pipeline that writes `bug.status` post-triage (see `meta-fix-bug.md § Iron Laws #2`). Do NOT write `approved` or `verified` — those values are vestigial enum members slated for removal.
84
83
 
85
84
  5. Finalize:
86
85
  - **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.
@@ -10,7 +10,7 @@ deps:
10
10
  templates: []
11
11
  sub_workflows: []
12
12
  kb_docs: []
13
- config_fields: [paths.engineering, paths.forgeRoot]
13
+ config_fields: [paths.engineering]
14
14
  ---
15
15
 
16
16
  # Meta-Workflow: Enhancement Agent
@@ -20,7 +20,7 @@ deps:
20
20
 
21
21
  - Orchestrator-only: this workflow runs with full tool access in the orchestrator session. NEVER delegate it to a subagent.
22
22
  - Read `.forge/personas/engineer.md` first; print the persona identity line (emoji, name, tagline) to stdout before any other tool use.
23
- - All store I/O via `forge_store` (or `node "$FORGE_ROOT/tools/store-cli.cjs"`). Never edit `.forge/store/*.json` directly.
23
+ - All store I/O via `forge_store` (or `node .forge/tools/store-cli.cjs`). Never edit `.forge/store/*.json` directly.
24
24
  - Phase 1 only touches `{{KEY}}` token text; never rewrite persona prose, algorithm steps, or role definitions.
25
25
 
26
26
  <!-- See _fragments/store-write-verification.md — NOTE: this file uses an intentionally abbreviated
@@ -140,7 +140,7 @@ Invoked by T09 post-init hook (`--auto`) or manually via `/forge:rebuild --enric
140
140
 
141
141
  2. **Skip runtime passthrough keys** — keys used at runtime (e.g., `{{TASK_ID}}`, `{{SPRINT_ID}}`,
142
142
  `{{ARGUMENTS}}`) are intentional and must not be substituted. Read
143
- `$FORGE_ROOT/tools/substitute-placeholders.cjs` to identify the RUNTIME_PASSTHROUGH_KEYS list.
143
+ `.forge/tools/substitute-placeholders.cjs` to identify the RUNTIME_PASSTHROUGH_KEYS list.
144
144
  Exclude them from the fill candidates.
145
145
 
146
146
  3. **Derive values from codebase signals** — for each remaining `{{KEY}}`, attempt to derive a
@@ -172,7 +172,7 @@ Invoked by T09 post-init hook (`--auto`) or manually via `/forge:rebuild --enric
172
172
 
173
173
  6. **Snapshot gate** — if at least one fill was applied:
174
174
  ```sh
175
- node "$FORGE_ROOT/tools/manage-versions.cjs" add-snapshot \
175
+ node .forge/tools/manage-versions.cjs add-snapshot \
176
176
  --source post-init \
177
177
  --enhanced-elements "<comma-separated list of relative .forge/ paths that were modified>"
178
178
  ```
@@ -180,7 +180,7 @@ Invoked by T09 post-init hook (`--auto`) or manually via `/forge:rebuild --enric
180
180
 
181
181
  7. **Emit enhancement event** to the store:
182
182
  ```sh
183
- node "$FORGE_ROOT/tools/store-cli.cjs" emit enhancement '{
183
+ node .forge/tools/store-cli.cjs emit enhancement '{
184
184
  "eventId": "<ISO timestamp slug>_enhance_phase1",
185
185
  "taskId": "enhancement",
186
186
  "sprintId": "enhancement",
@@ -138,7 +138,13 @@ Differences are confined to the **triage** step and the **path branch**.
138
138
 
139
139
  ```
140
140
  1. Pre-loop setup (mirrors meta-orchestrate.md):
141
- - Resolve FORGE_ROOT.
141
+ - Session Preflight (see `meta-orchestrate.md § Session Preflight`):
142
+ Read `.forge/cache/preflight-status.json` if present and fresh; otherwise
143
+ run `node .forge/tools/forge-preflight.cjs --bug {bugId}` and read
144
+ its stdout. Use `blob.forgeRoot` as FORGE_ROOT for the remainder of the
145
+ run — do not re-derive it. Branch on `blob.ok`: ok:true → proceed;
146
+ ok:false → halt (fast-fail-safe), emit escalation event, instruct operator
147
+ to fix the surfaced preflight warning before re-running.
142
148
  - Detect execution cluster from ANTHROPIC_DEFAULT_*_MODEL env vars.
143
149
  - Clear progress log: store-cli progress-clear bugs
144
150
  - Read bug record. If status ∈ {blocked, escalated, fixed, abandoned}:
@@ -159,6 +165,12 @@ Differences are confined to the **triage** step and the **path branch**.
159
165
  - On return, orchestrator transitions status:
160
166
  store-cli update-status bug {bugId} status triaged
161
167
  store-cli update-status bug {bugId} status in-progress
168
+ # Digest-compliance note (FORGE-S27-T05): update-status is already silent on
169
+ # success (no stdout on the success path). The two-step triaged→in-progress
170
+ # transition is a required state-machine contract per Iron Law 2 — only triage
171
+ # and commit own bug.status writes. Collapsing these two writes into one would
172
+ # be a behavioral violation. This is not LLM-hand-run glue; it executes as a
173
+ # direct tool call after the triage subagent returns.
162
174
  - Read summaries.triage.route. If neither "A" nor "B": escalate
163
175
  (verdict_malformed). Do not guess.
164
176
 
@@ -171,12 +183,22 @@ Differences are confined to the **triage** step and the **path branch**.
171
183
  - Resolve model (cluster + ROLE_TIER).
172
184
  - Compute eventId, agent_name, banner_name (from PERSONA_MAP /
173
185
  BANNER_MAP below).
174
- - Announce phase: banner + "→ {bugId} [{display_model}]".
186
+ - Announce phase:
187
+ run_bash(f'node .forge/tools/banners.cjs --badge {banner_name} --quiet')
188
+ # Digest-compliance note (FORGE-S27-T05): --quiet makes banners.cjs emit
189
+ # zero stdout (unconditional; no isTTY branch). The badge is fully
190
+ # suppressed during the automated run_bash call — it does not enter the
191
+ # LLM context window. Mirrors meta-orchestrate.md:399–411 treatment.
192
+ print(f" → {bugId} [{display_model}]\n")
175
193
  - Start progress Monitor on .forge/store/events/bugs/progress.log.
176
194
  - Preflight gate: preflight-gate.cjs --phase {role} --bug {bugId}
177
- Exit 1 or 2 escalate (see meta-orchestrate.md § Escalation Procedure)
178
- with bug_id substituted for task_id. Update bug.status to "escalated"
179
- only if it is currently "in-progress" (do not downgrade other states).
195
+ Exit 1 structured JSON on stdout ({ phase, reasonCode, detail, remediation });
196
+ parse and render it exactly as meta-orchestrate.md § Execution Algorithm
197
+ does for tasks (safe_parse_json(stdout) format reason + remediation).
198
+ Exit 2 → escalate (misconfiguration). In both cases:
199
+ see meta-orchestrate.md § Escalation Procedure with bug_id substituted
200
+ for task_id. Update bug.status to "escalated" only if it is currently
201
+ "in-progress" (do not downgrade other states).
180
202
  - Compose role-block, architecture-block, summary-block, overlay (via
181
203
  build-overlay.cjs --bug {bugId}).
182
204
  - Spawn subagent via Agent tool. Subagent prompt passes:
@@ -209,10 +231,12 @@ Differences are confined to the **triage** step and the **path branch**.
209
231
  phase that writes bug.status post-triage.
210
232
 
211
233
  6. Finalize (collator, housekeeping):
212
- - Aggregate cost data from .forge/store/events/bugs/*.json filtered by
213
- this bugId, and append a "## Cost Summary" section to the bug's
214
- INDEX.md artifact.
215
- - Run `node "$FORGE_ROOT/tools/collate.cjs" {bugId} --purge-events`.
234
+ - Run `node .forge/tools/collate.cjs {bugId} --purge-events`.
235
+ # Note (FORGE-S27-T05): collate.cjs --purge-events already handles cost
236
+ # aggregation and embeds the "## Cost" section into the bug's INDEX.md
237
+ # automatically (see collate.cjs buildBugIndex). Do NOT attempt a separate
238
+ # cost-aggregation round-trip before calling collate — it is redundant and
239
+ # may produce a duplicate section. The collate call is the single step.
216
240
  Collate purges only this bug's events from the shared bugs/ dir
217
241
  (filtered by bugId reference) — it does NOT purge other bugs' events.
218
242
  - Run preflight finalize gate: preflight-gate.cjs --phase finalize --bug {bugId}.
@@ -282,7 +306,7 @@ differences are:
282
306
  ```
283
307
  # --- Materialize project overlay (replaces MASTER_INDEX.md read in subagent) ---
284
308
  overlay_result = run_bash(
285
- f'node "$FORGE_ROOT/tools/build-overlay.cjs" --bug {bug_id} --format md'
309
+ f'node .forge/tools/build-overlay.cjs --bug {bug_id} --format md'
286
310
  )
287
311
  bug_overlay_md = overlay_result.stdout if overlay_result.exit_code == 0 else ""
288
312
 
@@ -461,7 +485,7 @@ or is redundant with another skill — emit a `friction` event so
461
485
  | `skill_stale` | A skill's guidance contradicts current architecture / supersedes its own advice. |
462
486
  | `skill_redundant` | Two skills provided overlapping or conflicting guidance for the same decision. |
463
487
 
464
- **Recording friction (subagent side):** call `node "$FORGE_ROOT/tools/friction-emit.cjs` `--workflow {workflow} --persona {persona-noun} --issue {token} [--subkind {token}] [--evidence '{...}']`. The tool appends one judgement-only record to `.forge/cache/FRICTION-{workflow}.jsonl`. The orchestrator drains the file at phase-end, stamps runtime attribution (model, provider, usage, wall times, eventId) onto each record, and emits the events via `store-cli emit` as event type `"friction"`. The schema enforces `{workflow, persona, issue}` as required when `type === "friction"`; `subkind` is the frozen enum `skill_unused|skill_failed|skill_missing|skill_stale|skill_redundant` or experimental `^x_[a-z_]+$`. Emit one record per distinct friction signal — do not coalesce.
488
+ **Recording friction (subagent side):** call `node .forge/tools/friction-emit.cjs` `--workflow {workflow} --persona {persona-noun} --issue {token} [--subkind {token}] [--evidence '{...}']`. The tool appends one judgement-only record to `.forge/cache/FRICTION-{workflow}.jsonl`. The orchestrator drains the file at phase-end, stamps runtime attribution (model, provider, usage, wall times, eventId) onto each record, and emits the events via `store-cli emit` as event type `"friction"`. The schema enforces `{workflow, persona, issue}` as required when `type === "friction"`; `subkind` is the frozen enum `skill_unused|skill_failed|skill_missing|skill_stale|skill_redundant` or experimental `^x_[a-z_]+$`. Emit one record per distinct friction signal — do not coalesce.
465
489
 
466
490
  ## Progress Reporting
467
491
 
@@ -31,9 +31,8 @@ The Engineer implements the approved plan: write code, run tests, verify, and do
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 implement --{entity_kind} {record_id}`
35
+ - Run: `node .forge/tools/preflight-gate.cjs --phase implement --{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 implements the approved plan: write code, run tests, verify, and do
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: `plan-approved`.
48
47
  - If the current status is NOT in the allowed set:
@@ -83,10 +82,10 @@ The Engineer implements the approved plan: write code, run tests, verify, and do
83
82
  - Out-of-band escapes (any state): `plan-revision-required`, `code-revision-required`, `blocked`, `escalated`, `abandoned`
84
83
  Update status — check current state first:
85
84
  - If predecessor is `planned` or `implementing`:
86
- `node "$FORGE_ROOT/tools/store-cli.cjs" update-status task {taskId} status implemented`
85
+ `node .forge/tools/store-cli.cjs update-status task {taskId} status implemented`
87
86
  - If predecessor is `plan-approved` (two-step mandatory — FSM forbids skipping `implementing`):
88
- `node "$FORGE_ROOT/tools/store-cli.cjs" update-status task {taskId} status implementing`
89
- `node "$FORGE_ROOT/tools/store-cli.cjs" update-status task {taskId} status implemented`
87
+ `node .forge/tools/store-cli.cjs update-status task {taskId} status implementing`
88
+ `node .forge/tools/store-cli.cjs update-status task {taskId} status implemented`
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
 
@@ -100,6 +99,15 @@ The Engineer implements the approved plan: write code, run tests, verify, and do
100
99
  Or (bug mode):
101
100
  `forge_store({ command:"set-bug-summary", args:["{bugId}", "implementation"] })`
102
101
  The sidecar path is auto-resolved from the record's `path` — never pass it.
102
+
103
+ 8. Post-Phase Output Guard: the `outputs` block below is the authoritative enforcer.
104
+ You MUST satisfy it before returning. If PROGRESS.md is missing or too small,
105
+ re-run the relevant step before emitting the complete event.
106
+ ```
107
+
108
+ ```outputs phase=implement
109
+ artifact {engineering}/{sprint}/{task}/PROGRESS.md min=200
110
+ require summaries.implementation.verdict == n/a
103
111
  ```
104
112
 
105
113
  <!-- See _fragments/iron-laws.md for Iron Laws section structure guidance -->
@@ -107,7 +115,7 @@ The Engineer implements the approved plan: write code, run tests, verify, and do
107
115
 
108
116
  - Follow the Algorithm step by step. Execute the approved PLAN.md exactly; do not invent scope or skip steps without updating the plan first.
109
117
  - Read `.forge/personas/engineer.md` first; print the persona identity line (emoji, name, tagline) to stdout before any other tool use.
110
- - All store I/O via `forge_store` (or `node "$FORGE_ROOT/tools/store-cli.cjs"`). Never edit `.forge/store/*.json` directly.
118
+ - All store I/O via `forge_store` (or `node .forge/tools/store-cli.cjs`). Never edit `.forge/store/*.json` directly.
111
119
  - Run the full test suite before declaring the task implemented. Silent continuation past test failures is never acceptable.
112
120
 
113
121
  ## Store-Write Verification
@@ -35,15 +35,18 @@ or when `.forge/structure-versions.json` is absent (pre-T05 install detected).
35
35
 
36
36
  - Migration operations are reversible and user-confirmed before any destructive writes. Do not skip the Phase 2 confirmation gate — proceed only after the user explicitly accepts the migration plan.
37
37
  - Read `.forge/personas/engineer.md` first; print the persona identity line (emoji, name, tagline) to stdout before any other tool use.
38
- - All store I/O via `forge_store` (or `node "$FORGE_ROOT/tools/store-cli.cjs"`). Never edit `.forge/store/*.json` directly.
38
+ - All store I/O via `forge_store` (or `node .forge/tools/store-cli.cjs`). Never edit `.forge/store/*.json` directly.
39
39
 
40
40
  ## Pre-conditions
41
41
 
42
42
  - `/forge:init` has run: `.forge/config.json` exists and is readable.
43
43
  - `.forge/structure-versions.json` is absent OR `--structural` was passed.
44
- - The Forge plugin root is resolvable:
44
+ - The Forge plugin root is resolvable. Migration reads plugin source
45
+ (`$FORGE_ROOT/init/base-pack`, `$FORGE_ROOT/.claude-plugin/plugin.json`)
46
+ that is not vendored into `.forge/`, so resolve the active plugin install
47
+ root from `CLAUDE_PLUGIN_ROOT` (this workflow runs plugin-side):
45
48
  ```sh
46
- export FORGE_ROOT=$(node -e "console.log(require('./.forge/config.json').paths.forgeRoot)")
49
+ export FORGE_ROOT="${CLAUDE_PLUGIN_ROOT}"
47
50
  ```
48
51
 
49
52
  ---
@@ -58,7 +61,7 @@ Check that `.forge/config.json` exists. If it does not, stop:
58
61
 
59
62
  > "Forge has not been initialised in this project. Run `/forge:init` first."
60
63
 
61
- Read `FORGE_ROOT` from `.forge/config.json`.
64
+ Resolve `FORGE_ROOT` from `${CLAUDE_PLUGIN_ROOT}` (the active plugin install root).
62
65
 
63
66
  **0b. Detect install generation.**
64
67
 
@@ -273,8 +276,7 @@ Write `.forge/project-context.json` with the synthesised content.
273
276
 
274
277
  Validate via the store tool:
275
278
  ```sh
276
- export FORGE_ROOT
277
- node "$FORGE_ROOT/tools/validate-store.cjs" --dry-run
279
+ node .forge/tools/validate-store.cjs --dry-run
278
280
  ```
279
281
 
280
282
  If this exits non-zero, report the validation errors to the user and HALT. Do
@@ -284,7 +286,7 @@ NOT remove the sentinel — the user can fix the issue and re-run.
284
286
 
285
287
  ```sh
286
288
  export FORGE_ROOT
287
- node "$FORGE_ROOT/tools/substitute-placeholders.cjs" \
289
+ node .forge/tools/substitute-placeholders.cjs \
288
290
  --forge-root "$FORGE_ROOT" \
289
291
  --base-pack "$FORGE_ROOT/init/base-pack" \
290
292
  --config ".forge/config.json" \
@@ -302,8 +304,7 @@ user. Do NOT remove the sentinel (preserves ability to re-run after fixing).
302
304
  #### Step 3d — Register snapshot (T05)
303
305
 
304
306
  ```sh
305
- export FORGE_ROOT
306
- node "$FORGE_ROOT/tools/manage-versions.cjs" init
307
+ node .forge/tools/manage-versions.cjs init
307
308
  ```
308
309
 
309
310
  `manage-versions init` is idempotent. Since `.forge/structure-versions.json`
@@ -347,9 +348,8 @@ rm .forge/archive/pre-migration/.migration-in-progress
347
348
  **Verification (CLI-accessible only — do NOT invoke `/forge:health` here):**
348
349
 
349
350
  ```sh
350
- export FORGE_ROOT
351
351
  # 1. Validate the store
352
- node "$FORGE_ROOT/tools/validate-store.cjs" --dry-run
352
+ node .forge/tools/validate-store.cjs --dry-run
353
353
 
354
354
  # 2. Verify substitution outputs are non-empty
355
355
  ls .forge/personas/*.md .forge/skills/*.md .forge/workflows/*.md .forge/templates/*.md
@@ -375,9 +375,8 @@ Read that file and extract the `sprintId` field. If no sprint files exist, use
375
375
  `"migration"` as the `sprintId` placeholder.
376
376
 
377
377
  ```sh
378
- export FORGE_ROOT
379
378
  MIGRATION_END=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
380
- node "$FORGE_ROOT/tools/store-cli.cjs" emit "{projectSprintId}" '{
379
+ node .forge/tools/store-cli.cjs emit "{projectSprintId}" '{
381
380
  "eventId": "migration-'"$(date -u +%Y%m%dT%H%M%SZ)"'",
382
381
  "taskId": "migration",
383
382
  "sprintId": "{projectSprintId}",
@@ -467,7 +466,7 @@ cd .forge && md5sum -c archive/pre-migration/MANIFEST.md5 2>/dev/null | grep -v
467
466
  - **Workflow Structure:** The generated `migrate_structural.md` must follow the strict multi-phase Algorithm block format (Phase 0 pre-flight → Phase 1 read/extract → Phase 2 confirmation gate → Phase 3 write → Phase 4 verify/emit → Rollback Procedure → Error Handling).
468
467
  - **Context Isolation:** Forbid inline execution of archival or substitution operations; use `forge_store` reads and structured `node` invocations for all store interactions.
469
468
  - **Project Specifics:**
470
- - Reference the project's `paths.engineering` and `paths.forgeRoot` from `.forge/config.json` for all path resolutions.
469
+ - Reference the project's `paths.engineering` from `.forge/config.json` for path resolutions; resolve the plugin root from `${CLAUDE_PLUGIN_ROOT}` (not `config.paths.forgeRoot`, which is retired).
471
470
  - Include the project's migration path docs in the Error Handling table (e.g., expected schema files, archive paths).
472
471
  - **Token Reporting:** See `_fragments/finalize.md` — wire via `file_ref:`. Token reporting is diagnostic only (migration is not an orchestrated phase — it emits its own record via `store-cli emit` in Phase 4).
473
472
  - **Event Emission:** Migration emits its own completion event directly via `store-cli emit` in Phase 4 (orchestrator-exception; this is not a task phase). The "do NOT emit yourself" rule does not apply here.
@@ -23,7 +23,7 @@ Capture sprint requirements via a structured interview and document them for pla
23
23
 
24
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
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.
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
 
@@ -56,7 +56,7 @@ Capture sprint requirements via a structured interview and document them for pla
56
56
  - Ensure all deliverables are measurable and testable
57
57
 
58
58
  5. Finalize:
59
- - Update sprint status via `node "$FORGE_ROOT/tools/store-cli.cjs" update-status sprint {sprintId} status planning`
59
+ - Update sprint status via `node .forge/tools/store-cli.cjs update-status sprint {sprintId} status planning`
60
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
61
  ```
62
62
 
@@ -79,6 +79,6 @@ Capture sprint requirements via a structured interview and document them for pla
79
79
  - Set token fields to `null`: `"inputTokens": null, "outputTokens": null, "estimatedCostUSD": null`.
80
80
  - Add `"source": "missing"` to sidecar JSON.
81
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`.
82
+ 4. Write the usage sidecar via `node .forge/tools/store-cli.cjs emit {sprintId} '{sidecar-json}' --sidecar`.
83
83
  5. **NEVER skip sidecar write.** Always emit (reported or placeholder with nulls).
84
84
  - **Event Emission:** Ensure the "complete" event includes the `eventId` passed by the orchestrator.