@izkac/forgekit 0.3.11 → 0.3.13

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 (116) hide show
  1. package/bin/forge.mjs +107 -107
  2. package/bin/forgekit.mjs +83 -83
  3. package/bin/review.mjs +81 -81
  4. package/package.json +1 -1
  5. package/scripts/prepack.mjs +78 -78
  6. package/scripts/run-tests.mjs +50 -50
  7. package/src/adr.mjs +236 -236
  8. package/src/adr.test.mjs +170 -170
  9. package/src/change.mjs +327 -234
  10. package/src/change.test.mjs +145 -83
  11. package/src/cleanup-sessions.mjs +84 -84
  12. package/src/config.mjs +103 -103
  13. package/src/defer.mjs +75 -75
  14. package/src/doctor.mjs +350 -341
  15. package/src/doctor.test.mjs +114 -114
  16. package/src/init.mjs +680 -621
  17. package/src/install.mjs +815 -815
  18. package/src/install.test.mjs +180 -180
  19. package/src/integrity-check.mjs +60 -60
  20. package/src/integrity.mjs +682 -682
  21. package/src/integrity.test.mjs +566 -566
  22. package/src/lib.mjs +143 -143
  23. package/src/models.defaults.json +41 -41
  24. package/src/new-session.mjs +99 -99
  25. package/src/openspec-overlays/README.md +19 -19
  26. package/src/openspec-overlays/openspec-apply-change-footer.md +14 -14
  27. package/src/openspec-overlays/opsx-apply-completion-step.md +1 -1
  28. package/src/openspec-overlays/opsx-apply-implement-step.md +11 -11
  29. package/src/paths.mjs +92 -92
  30. package/src/plan-engine.mjs +321 -278
  31. package/src/plan-engine.test.mjs +447 -283
  32. package/src/preferences.defaults.json +78 -78
  33. package/src/preferences.mjs +438 -438
  34. package/src/preferences.test.mjs +174 -174
  35. package/src/record-evidence.mjs +204 -204
  36. package/src/resolve-model.mjs +312 -312
  37. package/src/resolve-model.test.mjs +194 -194
  38. package/src/review/cli.test.mjs +117 -117
  39. package/src/review/export.mjs +172 -172
  40. package/src/review/export.test.mjs +197 -197
  41. package/src/review/fixtures/valid-review.json +42 -42
  42. package/src/review/lib.mjs +894 -894
  43. package/src/review/lib.test.mjs +266 -266
  44. package/src/review/schema.json +196 -196
  45. package/src/review/signals.test.mjs +62 -62
  46. package/src/score-cli.mjs +68 -68
  47. package/src/score.mjs +568 -566
  48. package/src/score.test.mjs +366 -340
  49. package/src/session-reminder.mjs +207 -207
  50. package/src/session-status.mjs +70 -70
  51. package/src/set-models.mjs +186 -186
  52. package/src/set-phase.mjs +205 -205
  53. package/src/set-prefs.mjs +294 -294
  54. package/src/specs-sync.mjs +234 -0
  55. package/src/specs-sync.test.mjs +114 -0
  56. package/src/spine.mjs +93 -93
  57. package/src/triage-prompt.mjs +175 -175
  58. package/src/triage-prompt.test.mjs +50 -50
  59. package/src/vendor-openspec-overlays.mjs +176 -176
  60. package/src/vendor-openspec-overlays.test.mjs +62 -62
  61. package/vendor/skills/archive-to-adr/SKILL.md +149 -149
  62. package/vendor/skills/forge/SKILL.md +136 -136
  63. package/vendor/skills/forge/docs/forge.md +650 -647
  64. package/vendor/skills/forge/phases/brainstorm.md +23 -23
  65. package/vendor/skills/forge/phases/finish.md +90 -87
  66. package/vendor/skills/forge/phases/implement.md +77 -77
  67. package/vendor/skills/forge/phases/plan-openspec.md +60 -60
  68. package/vendor/skills/forge/phases/plan-specs.md +163 -117
  69. package/vendor/skills/forge/phases/review.md +25 -25
  70. package/vendor/skills/forge/phases/verify.md +124 -124
  71. package/vendor/skills/forge/references/forge-layout.md +85 -85
  72. package/vendor/skills/forge/references/pace.md +115 -115
  73. package/vendor/skills/forge/references/plan-routing.md +52 -51
  74. package/vendor/skills/forge/references/runtime-integrity.md +232 -225
  75. package/vendor/skills/forge/references/substantial-work.md +37 -37
  76. package/vendor/skills/forge/references/test-evidence.md +30 -30
  77. package/vendor/skills/forge/references/test-strategy.md +68 -68
  78. package/vendor/skills/forge/skills/subagent-driven-development/SKILL.md +87 -87
  79. package/vendor/skills/forge/subagents/final-reviewer-prompt.md +56 -56
  80. package/vendor/skills/forge/subagents/implementer-prompt.md +38 -38
  81. package/vendor/skills/git-resolve-adr-conflict/SKILL.md +132 -132
  82. package/vendor/skills/thorough-code-review/SKILL.md +290 -290
  83. package/vendor/skills/thorough-code-review/examples.md +133 -133
  84. package/vendor/skills/thorough-code-review/reference/accepted-risks.md +26 -26
  85. package/vendor/skills/thorough-code-review/reference/lenses.md +96 -96
  86. package/vendor/skills/thorough-code-review/reference/phase1-scout.md +62 -62
  87. package/vendor/skills/thorough-code-review/reference/phase2-skeptic.md +105 -105
  88. package/vendor/skills/thorough-code-review/reference/report-schema.json +222 -222
  89. package/vendor/skills/thorough-code-review/reference/report-template.md +115 -115
  90. package/vendor/skills/thorough-code-review/reference/severity-rubric.md +49 -49
  91. package/vendor/skills/thorough-code-review/reference/signals-preflight.md +55 -55
  92. package/vendor/templates/adr/README.md +7 -7
  93. package/vendor/templates/adr/decisions.md +141 -141
  94. package/vendor/templates/adr/hooks/check-pending-adrs.mjs +74 -74
  95. package/vendor/templates/adr/hooks/check-pending-adrs.sh +3 -3
  96. package/vendor/templates/adr/hooks/openspec-archive-agent-message.mjs +52 -52
  97. package/vendor/templates/adr/hooks/openspec-archive-agent-message.sh +3 -3
  98. package/vendor/templates/project/claude/commands/forge-apply.md +75 -75
  99. package/vendor/templates/project/claude/commands/forge-brainstorm.md +7 -7
  100. package/vendor/templates/project/claude/commands/forge-build.md +17 -17
  101. package/vendor/templates/project/claude/commands/forge-plan.md +12 -12
  102. package/vendor/templates/project/claude/commands/forge-skip.md +14 -14
  103. package/vendor/templates/project/claude/commands/forge-status.md +16 -16
  104. package/vendor/templates/project/claude/commands/forge.md +16 -16
  105. package/vendor/templates/project/claude/hooks/forge-prompt-hook.mjs +73 -73
  106. package/vendor/templates/project/claude/hooks/forge-session-start.mjs +19 -19
  107. package/vendor/templates/project/claude/hooks/forge-triage-hook.mjs +77 -77
  108. package/vendor/templates/project/cursor/commands/forge-apply.md +75 -75
  109. package/vendor/templates/project/cursor/commands/forge-brainstorm.md +10 -10
  110. package/vendor/templates/project/cursor/commands/forge-build.md +17 -17
  111. package/vendor/templates/project/cursor/commands/forge-plan.md +15 -15
  112. package/vendor/templates/project/cursor/commands/forge-skip.md +14 -14
  113. package/vendor/templates/project/cursor/commands/forge-status.md +16 -16
  114. package/vendor/templates/project/cursor/commands/forge.md +16 -16
  115. package/vendor/templates/project/cursor/hooks/forge-session-start.mjs +30 -30
  116. package/vendor/templates/project/cursor/hooks/forge-session-start.sh +3 -3
@@ -1,117 +1,163 @@
1
- # Plan phase — built-in specs engine
2
-
3
- For projects with `.forge/config.json` → `plan.engine: specs`. Mirrors the
4
- OpenSpec propose flow without the vendor CLI. Change lives under
5
- `<specsDir>/changes/<change-name>/` (default `specs/changes/…`).
6
-
7
- ## Steps
8
-
9
- 1. Derive a kebab-case change name from the brainstorm outcome (e.g.
10
- `add-stripe-refunds`). No date prefix while active.
11
- 2. Create the change directory (preferred: CLI scaffold):
12
-
13
- ```bash
14
- forge change new <change-name>
15
- ```
16
-
17
- Or create manually under `<specsDir>/changes/<change-name>/` with:
18
-
19
- **`proposal.md`** (required)
20
-
21
- ```markdown
22
- # <Change title>
23
-
24
- ## Why
25
- One or two paragraphs: problem / pressure.
26
-
27
- ## What Changes
28
- Bulleted scope behavior, contracts, data.
29
-
30
- ## Impact
31
- Affected code/areas, risks, migration notes.
32
- ```
33
-
34
- **`design.md`** (only when there are real design decisions)
35
-
36
- Context, decisions with alternatives, risks. Skip for mechanical changes.
37
-
38
- **`tasks.md`** (required)
39
-
40
- ```markdown
41
- # Tasks
42
-
43
- ## 1. <Group name>
44
- - [ ] 1.1 <Bite-sized task — exact files, expected tests>
45
- - [ ] 1.2 …
46
-
47
- ## 2. <Group name>
48
- - [ ] 2.1 …
49
- ```
50
-
51
- Task-writing rules (from writing-plans practice):
52
- - Bite-sized: one task = one reviewable step (a test + the code to pass it).
53
- - Name exact file paths where known.
54
- - Each task states its verification (test command or observable behavior).
55
- - Group with `##` sections — Forge reviews per group under `standard` pace.
56
-
57
- 3. Confirm `tasks.md` exists and the change is apply-ready.
58
- 4. **Spine (always) + orchestration seam** — see [../references/runtime-integrity.md](../references/runtime-integrity.md):
59
-
60
- ```bash
61
- forge spine init # mandatory every change — fill rows or set notApplicable
62
- ```
63
-
64
- Sync-only / docs-only: `"notApplicable": "<reason>"`. Capability work: one row
65
- per REQ cluster (library → runtime owner → writes → evidence).
66
-
67
- When the spine has real rows, also `forge e2e init` — the executable
68
- product-loop steps (`e2e.json`) are a **plan deliverable**: author them (or
69
- task out their authoring) so verify can `forge e2e run` them.
70
-
71
- If the change also involves workers, job queues, handlers, or cross-runtime
72
- calls, `tasks.md` MUST include:
73
-
74
- - Explicit **wiring** tasks per job kind / entry point → domain pipeline
75
- - One **product-loop acceptance** task (last implement task, before
76
- verify) — its output is a green `forge e2e run`
77
-
78
- Missing spine = plan **not** ready. (`forge phase done` refuses without a
79
- valid spine and, when the spine has rows, a green current e2e run —
80
- keyword sniffing does not decide.)
81
-
82
- 5. **Operator brief (mandatory)** see [../references/operator-brief.md](../references/operator-brief.md):
83
- write `<specsDir>/changes/<change-name>/brief.html` a plain-language,
84
- self-contained HTML explanation of what will be built (mermaid diagrams
85
- where helpful), then:
86
-
87
- ```bash
88
- forge brief stamp # records specs hash (does NOT auto-open)
89
- ```
90
-
91
- `forge phase implement` hard-refuses while the brief is missing or stale
92
- (specs edited after stamping → rewrite affected sections and re-stamp).
93
-
94
- 6. Update session:
95
-
96
- ```bash
97
- forge phase plan --plan-type specs --openspec <change-name>
98
- forge phase implement --tasks-total <N>
99
- ```
100
-
101
- Count tasks from `tasks.md` checkboxes. (`--openspec` carries the change
102
- name for both engines.)
103
-
104
- 7. Get user approval on the artefacts before implementing (unless they already said "go").
105
- The brief is what the operator reviews — tell them its path and that
106
- `forge brief open` launches it; never open it for them.
107
-
108
- ## Compatibility
109
-
110
- Layout and conventions are deliberately identical to OpenSpec
111
- (`proposal.md` / `design.md` / `tasks.md`, archive on finish). Migration:
112
- `openspec init`, then move `specs/changes/*` into `openspec/changes/`.
113
-
114
- ## Session tracking
115
-
116
- Forge session holds orchestration artefacts; the canonical plan lives under
117
- `<specsDir>/changes/<change-name>/`.
1
+ # Plan phase — built-in specs engine
2
+
3
+ For projects with `.forge/config.json` → `plan.engine: specs`. Mirrors the
4
+ OpenSpec propose flow without the vendor CLI. Engine root is `plan.dir`
5
+ (default `specs/`; set to `openspec` to reuse an OpenSpec tree).
6
+
7
+ Change lives under `<plan.dir>/changes/<change-name>/`.
8
+
9
+ ## Steps
10
+
11
+ 1. Derive a kebab-case change name from the brainstorm outcome (e.g.
12
+ `add-stripe-refunds`). No date prefix while active.
13
+ 2. Create the change directory (preferred: CLI scaffold):
14
+
15
+ ```bash
16
+ forge change new <change-name> --capability <domain> [--capability <other>]
17
+ ```
18
+
19
+ Or create manually under `<plan.dir>/changes/<change-name>/` with the
20
+ **same layout as OpenSpec**:
21
+
22
+ **`proposal.md`** (required)
23
+
24
+ ```markdown
25
+ # <Change title>
26
+
27
+ ## Why
28
+ One or two paragraphs: problem / pressure.
29
+
30
+ ## What Changes
31
+ Bulleted scope — behavior, contracts, data.
32
+
33
+ ## Capabilities
34
+ - `<domain>`: brief delta at `specs/<domain>/spec.md`
35
+
36
+ ## Impact
37
+ Affected code/areas, risks, migration notes.
38
+ ```
39
+
40
+ **`design.md`** (scaffold always; trim or delete when purely mechanical)
41
+
42
+ Context, decisions with alternatives, risks.
43
+
44
+ **`tasks.md`** (required)
45
+
46
+ ```markdown
47
+ # Tasks
48
+
49
+ ## 1. <Group name>
50
+ - [ ] 1.1 <Bite-sized task — exact files, expected tests>
51
+ - [ ] 1.2
52
+
53
+ ## 2. <Group name>
54
+ - [ ] 2.1
55
+ ```
56
+
57
+ **`specs/<capability>/spec.md`** (delta specs required for capability work)
58
+
59
+ Same format as OpenSpec. There is **no** `deltas/` directory — deltas live
60
+ under `changes/<name>/specs/`:
61
+
62
+ ```markdown
63
+ # Delta for <Capability>
64
+
65
+ ## ADDED Requirements
66
+
67
+ ### Requirement:
68
+ The system SHALL
69
+
70
+ #### Scenario: …
71
+ - GIVEN
72
+ - WHEN
73
+ - THEN …
74
+
75
+ ## MODIFIED Requirements
76
+
77
+
78
+ ## REMOVED Requirements
79
+
80
+ ```
81
+
82
+ Task-writing rules (from writing-plans practice):
83
+ - Bite-sized: one task = one reviewable step (a test + the code to pass it).
84
+ - Name exact file paths where known.
85
+ - Each task states its verification (test command or observable behavior).
86
+ - Group with `##` sections — Forge reviews per group under `standard` pace.
87
+
88
+ 3. Confirm `tasks.md` exists and at least one delta under `specs/` when the
89
+ change adds/changes behavior. Apply-ready = proposal + tasks + deltas
90
+ (design when non-mechanical).
91
+ 4. **Spine (always) + orchestration seam** see [../references/runtime-integrity.md](../references/runtime-integrity.md):
92
+
93
+ ```bash
94
+ forge spine init # mandatory every change — fill rows or set notApplicable
95
+ ```
96
+
97
+ Sync-only / docs-only: `"notApplicable": "<reason>"`. Capability work: one row
98
+ per REQ cluster (library → runtime owner → writes → evidence).
99
+
100
+ When the spine has real rows, also `forge e2e init` — the executable
101
+ product-loop steps (`e2e.json`) are a **plan deliverable**: author them (or
102
+ task out their authoring) so verify can `forge e2e run` them.
103
+
104
+ If the change also involves workers, job queues, handlers, or cross-runtime
105
+ calls, `tasks.md` MUST include:
106
+
107
+ - Explicit **wiring** tasks per job kind / entry point → domain pipeline
108
+ - One **product-loop acceptance** task (last implement task, before
109
+ verify) — its output is a green `forge e2e run`
110
+
111
+ Missing spine = plan **not** ready. (`forge phase done` refuses without a
112
+ valid spine and, when the spine has rows, a green current e2e run —
113
+ keyword sniffing does not decide.)
114
+
115
+ 5. **Operator brief (mandatory)** — see [../references/operator-brief.md](../references/operator-brief.md):
116
+ write `<plan.dir>/changes/<change-name>/brief.html` a plain-language,
117
+ self-contained HTML explanation of what will be built (mermaid diagrams
118
+ where helpful), then:
119
+
120
+ ```bash
121
+ forge brief stamp # records specs hash (does NOT auto-open)
122
+ ```
123
+
124
+ `forge phase implement` hard-refuses while the brief is missing or stale
125
+ (specs edited after stamping → rewrite affected sections and re-stamp).
126
+
127
+ 6. Update session:
128
+
129
+ ```bash
130
+ forge phase plan --plan-type specs --openspec <change-name>
131
+ forge phase implement --tasks-total <N>
132
+ ```
133
+
134
+ Count tasks from `tasks.md` checkboxes. (`--openspec` carries the change
135
+ name for both engines.)
136
+
137
+ 7. Get user approval on the artefacts before implementing (unless they already said "go").
138
+ The brief is what the operator reviews — tell them its path and that
139
+ `forge brief open` launches it; never open it for them.
140
+
141
+ ## Compatibility
142
+
143
+ Layout and conventions are identical to OpenSpec:
144
+
145
+ | Path | Role |
146
+ | ---- | ---- |
147
+ | `<plan.dir>/specs/<cap>/spec.md` | Source of truth |
148
+ | `<plan.dir>/changes/<name>/proposal.md` | Why / what / capabilities / impact |
149
+ | `<plan.dir>/changes/<name>/design.md` | Technical approach |
150
+ | `<plan.dir>/changes/<name>/tasks.md` | Checklist |
151
+ | `<plan.dir>/changes/<name>/specs/<cap>/spec.md` | Delta specs |
152
+
153
+ Switch engines without moving files:
154
+
155
+ ```bash
156
+ forge init --no-openspec --plan-dir openspec
157
+ # → .forge/config.json { "plan": { "engine": "specs", "dir": "openspec" } }
158
+ ```
159
+
160
+ ## Session tracking
161
+
162
+ Forge session holds orchestration artefacts; the canonical plan lives under
163
+ `<plan.dir>/changes/<change-name>/`.
@@ -1,25 +1,25 @@
1
- # Review phase
2
-
3
- Per-task reviews happen inside [implement.md](./implement.md). This phase covers **final** review before finish.
4
-
5
- Read and follow [../skills/requesting-code-review/SKILL.md](../skills/requesting-code-review/SKILL.md).
6
-
7
- **Pace:** Check `review.final` via [../references/pace.md](../references/pace.md) / `forge status`. If pace skips final review and the session is not high-risk, write `.forge/sessions/<id>/reviews/final-review.md` with `SKIPPED (pace=…)` and proceed. High-risk sessions (money/auth/contracts/migrations) always get a final review (hard floor).
8
-
9
- Otherwise dispatch the final reviewer using [../subagents/final-reviewer-prompt.md](../subagents/final-reviewer-prompt.md) (whole-session verdict; the reviewer applies the checklist from [code-reviewer.md](../skills/requesting-code-review/code-reviewer.md)).
10
-
11
- **Model:** `forge resolve-model --tier capable` (or `standard`/`fast` when `models.bias` is `prefer-fast` and not high-risk; billing **`included`** by default). If `omitModel` is true, omit the Task `model` parameter; otherwise pass `model` exactly. Do not use metered/API models unless the user explicitly requests them.
12
-
13
- <HARD-GATE>
14
- Do NOT hand-pick a model slug for the final reviewer — not even "the most capable" from the host's model list. Resolver output only. On dispatch failure, re-resolve; do not substitute a slug yourself.
15
- </HARD-GATE>
16
-
17
- Save output to `.forge/sessions/<id>/reviews/final-review.md`.
18
-
19
- ```bash
20
- forge phase review
21
- ```
22
-
23
- Address Critical and Important findings before finish.
24
-
25
- Then proceed to [finish.md](./finish.md).
1
+ # Review phase
2
+
3
+ Per-task reviews happen inside [implement.md](./implement.md). This phase covers **final** review before finish.
4
+
5
+ Read and follow [../skills/requesting-code-review/SKILL.md](../skills/requesting-code-review/SKILL.md).
6
+
7
+ **Pace:** Check `review.final` via [../references/pace.md](../references/pace.md) / `forge status`. If pace skips final review and the session is not high-risk, write `.forge/sessions/<id>/reviews/final-review.md` with `SKIPPED (pace=…)` and proceed. High-risk sessions (money/auth/contracts/migrations) always get a final review (hard floor).
8
+
9
+ Otherwise dispatch the final reviewer using [../subagents/final-reviewer-prompt.md](../subagents/final-reviewer-prompt.md) (whole-session verdict; the reviewer applies the checklist from [code-reviewer.md](../skills/requesting-code-review/code-reviewer.md)).
10
+
11
+ **Model:** `forge resolve-model --tier capable` (or `standard`/`fast` when `models.bias` is `prefer-fast` and not high-risk; billing **`included`** by default). If `omitModel` is true, omit the Task `model` parameter; otherwise pass `model` exactly. Do not use metered/API models unless the user explicitly requests them.
12
+
13
+ <HARD-GATE>
14
+ Do NOT hand-pick a model slug for the final reviewer — not even "the most capable" from the host's model list. Resolver output only. On dispatch failure, re-resolve; do not substitute a slug yourself.
15
+ </HARD-GATE>
16
+
17
+ Save output to `.forge/sessions/<id>/reviews/final-review.md`.
18
+
19
+ ```bash
20
+ forge phase review
21
+ ```
22
+
23
+ Address Critical and Important findings before finish.
24
+
25
+ Then proceed to [finish.md](./finish.md).
@@ -1,124 +1,124 @@
1
- # Verify phase
2
-
3
- Read and follow [../skills/verification-before-completion/SKILL.md](../skills/verification-before-completion/SKILL.md) and [../references/test-strategy.md](../references/test-strategy.md).
4
-
5
- ## Required checks
6
-
7
- ### 1. Audit tier 2 evidence (per task)
8
-
9
- For each completed task under `.forge/sessions/<id>/tasks/<nn>-<slug>/`:
10
-
11
- - `test-evidence.md` exists with command, exit code `0`, and pass summary (or key output lines).
12
- - `task-review.md` shows **APPROVED** (legacy sessions: `spec-review.md` + `quality-review.md`).
13
- - Evidence uses tier 2 scope (narrow) unless the task documented a tier-2 full-workspace exception.
14
-
15
- If any task lacks evidence, shows non-zero exit, or reviewers rejected test coverage → **stop** and fix or re-dispatch that task's implementer.
16
-
17
- **Do not** re-run tier 2 commands here — audit the artifacts.
18
-
19
- ### 2. Tier 3 (scope from pace)
20
-
21
- After tier 2 audit passes, honor `verify.tier3` from [../references/pace.md](../references/pace.md) / `forge status`:
22
-
23
- | `verify.tier3` | Action |
24
- | -------------- | ------ |
25
- | `full-workspace` | One fresh full test per affected workspace (default thorough/standard) |
26
- | `affected-only` | Full test only for workspaces touched by this change |
27
- | `audit-tier2-only` | Do **not** run the suite; record deferral to push/CI in `verify-evidence.md` |
28
-
29
- ```bash
30
- npm test (affected package/workspace)
31
- ```
32
-
33
- When contracts changed and tier3 is not `audit-tier2-only`, also run tests in downstream consumer workspaces (project ecosystem-impact policy).
34
-
35
- Save to `.forge/sessions/<id>/verify-evidence.md`:
36
-
37
- ```markdown
38
- # Verify evidence — tier 3
39
-
40
- - **Workspaces:** your-workspace, …
41
- - **Command:** `npm test -- path/to/scoped.test.ts`
42
- - **Exit code:** 0
43
- - **Summary:** 142/142 pass (or paste last ~30 lines)
44
- - **Run at:** 2026-06-07T12:00:00Z
45
- ```
46
-
47
- Cite this file when claiming the implementation passes. Exit code must be `0` before leaving verify.
48
-
49
- ### 2b. Strict typecheck — enforced at the gate, not here
50
-
51
- Tier 3 runs **tests**, and Vitest transpiles without type-checking — so green tests do
52
- **not** prove the code compiles under strict `tsc`. You do **not** need to run the full
53
- build gate to leave verify — strict typecheck is enforced automatically by the `pre-push`
54
- hook (diff-scoped, on every push / launcher **Publish**) and the full typecheck + tests on
55
- `development` by CI. If you want local certainty on the types you touched, optionally run:
56
-
57
- ```bash
58
- npm run build:packages # fresh dist/ so dependents resolve current .d.ts
59
- node scripts/agent-check.mjs # strict typecheck + tests for the diff-affected workspaces
60
- ```
61
-
62
- — but a clean tier-3 test audit is the bar to leave verify; the Publish/push + CI gate
63
- (`shared-build-gate` capability) catches any strict-mode breakage before it's shared.
64
-
65
- ### 3. Runtime wiring audit
66
-
67
- Honor [../references/runtime-integrity.md](../references/runtime-integrity.md).
68
-
69
- For each requirement in the change's **capability specs** (not only `tasks.md`):
70
-
71
- - Name the **production caller** (job kind, endpoint, CLI, …) that invokes the implementing code.
72
- - Library-only / stub handler / false success / enqueueable-but-unhandled kind → **stop**. Add wiring or mark explicit gaps; do not advance.
73
-
74
- Record the trace in `verify-evidence.md` (a short REQ → caller table is enough).
75
-
76
- ### 4. Product-loop E2E — executed, or BLOCKED
77
-
78
- Before leaving verify / claiming the change complete:
79
-
80
- 1. Confirm `e2e.json` (scaffolded at plan time via `forge e2e init`) drives the **closed product loop** — not a single job slice. When the design has a producer/consumer split (analyze vs execute, proposals vs ratify), the loop is: produce artifact → consumer reads it → decision/state change → **next run's output differs from baseline**. Steps must assert domain side effects; a step list that would pass against a stubbed handler is invalid.
81
- 2. `forge e2e run` — executes the steps sequentially and writes `e2e-results.json` (per-step exit codes, output tails, steps hash) into the session dir. A **green run** is required; results go stale if `e2e.json` changes afterwards (re-run). Prose in `verify-evidence.md` no longer satisfies the done gate. **Or**
82
- 3. Leave an explicit **`BLOCKED`** list in `verify-evidence.md` explaining why E2E cannot run here — the done gate then refuses `done` until unblocked or the user signs `--allow-incomplete`. (`e2e.json` `notApplicable` is only for loops no command can drive — reviewers police the reason.)
83
-
84
- Keep a short loop narrative under `## Product loop` in `verify-evidence.md` as reviewer context — the gate checks the executed results, not the heading.
85
-
86
- Also enforce **job-kind closure**: every product-surface job kind is wired end-to-end or deleted from enums/API/UI before complete. And the **consumer–producer rule**: anything the UI/API reads must be proven written by the production path.
87
-
88
- Do **not** mark the change complete or advance to `done` while a critical path is stubbed, unwired, or unverified without `BLOCKED`. Green unit/tier-3 suites alone are not enough when jobs/workers/orchestration are in scope (`integrity.requireE2E`).
89
-
90
- ### 5. Mechanical gate
91
-
92
- ```bash
93
- forge spine check # every capability row wired (library → runtime owner → writes → evidence)
94
- forge e2e check # green, current e2e-results.json (steps hash matches e2e.json)
95
- forge defer list # no unresolved deferrals
96
- forge integrity-check # combined; forge phase done runs the same checks
97
- ```
98
-
99
- Fix any failure before proceeding — `forge phase done|finish` refuses on the same problems.
100
-
101
- ### 6. Plan completeness
102
-
103
- - Confirm every plan task is marked complete.
104
- - Confirm no tier 2 evidence contradicts another.
105
- - For OpenSpec: `openspec instructions apply --change "<name>" --json` shows expected progress.
106
- - Requirements met = line-by-line vs **capability specs**, not vs a narrowed task reading.
107
-
108
- ```bash
109
- forge phase verify
110
- ```
111
-
112
- ## When to re-run tier 3
113
-
114
- - Tier 3 failed (fix, then re-run tier 3)
115
- - Coordinator edited code after `verify-evidence.md` was recorded
116
- - Quality or final reviewer flagged test gaps
117
- - User explicitly asks for a fresh run
118
-
119
- ## When NOT to re-run
120
-
121
- - Tier 2 narrow commands — already audited; duplicating them is slow and redundant
122
- - Tier 3 passed and nothing changed since — do not run full suite again "for freshness"
123
-
124
- Then proceed to [review.md](./review.md) if not already done per task.
1
+ # Verify phase
2
+
3
+ Read and follow [../skills/verification-before-completion/SKILL.md](../skills/verification-before-completion/SKILL.md) and [../references/test-strategy.md](../references/test-strategy.md).
4
+
5
+ ## Required checks
6
+
7
+ ### 1. Audit tier 2 evidence (per task)
8
+
9
+ For each completed task under `.forge/sessions/<id>/tasks/<nn>-<slug>/`:
10
+
11
+ - `test-evidence.md` exists with command, exit code `0`, and pass summary (or key output lines).
12
+ - `task-review.md` shows **APPROVED** (legacy sessions: `spec-review.md` + `quality-review.md`).
13
+ - Evidence uses tier 2 scope (narrow) unless the task documented a tier-2 full-workspace exception.
14
+
15
+ If any task lacks evidence, shows non-zero exit, or reviewers rejected test coverage → **stop** and fix or re-dispatch that task's implementer.
16
+
17
+ **Do not** re-run tier 2 commands here — audit the artifacts.
18
+
19
+ ### 2. Tier 3 (scope from pace)
20
+
21
+ After tier 2 audit passes, honor `verify.tier3` from [../references/pace.md](../references/pace.md) / `forge status`:
22
+
23
+ | `verify.tier3` | Action |
24
+ | -------------- | ------ |
25
+ | `full-workspace` | One fresh full test per affected workspace (default thorough/standard) |
26
+ | `affected-only` | Full test only for workspaces touched by this change |
27
+ | `audit-tier2-only` | Do **not** run the suite; record deferral to push/CI in `verify-evidence.md` |
28
+
29
+ ```bash
30
+ npm test (affected package/workspace)
31
+ ```
32
+
33
+ When contracts changed and tier3 is not `audit-tier2-only`, also run tests in downstream consumer workspaces (project ecosystem-impact policy).
34
+
35
+ Save to `.forge/sessions/<id>/verify-evidence.md`:
36
+
37
+ ```markdown
38
+ # Verify evidence — tier 3
39
+
40
+ - **Workspaces:** your-workspace, …
41
+ - **Command:** `npm test -- path/to/scoped.test.ts`
42
+ - **Exit code:** 0
43
+ - **Summary:** 142/142 pass (or paste last ~30 lines)
44
+ - **Run at:** 2026-06-07T12:00:00Z
45
+ ```
46
+
47
+ Cite this file when claiming the implementation passes. Exit code must be `0` before leaving verify.
48
+
49
+ ### 2b. Strict typecheck — enforced at the gate, not here
50
+
51
+ Tier 3 runs **tests**, and Vitest transpiles without type-checking — so green tests do
52
+ **not** prove the code compiles under strict `tsc`. You do **not** need to run the full
53
+ build gate to leave verify — strict typecheck is enforced automatically by the `pre-push`
54
+ hook (diff-scoped, on every push / launcher **Publish**) and the full typecheck + tests on
55
+ `development` by CI. If you want local certainty on the types you touched, optionally run:
56
+
57
+ ```bash
58
+ npm run build:packages # fresh dist/ so dependents resolve current .d.ts
59
+ node scripts/agent-check.mjs # strict typecheck + tests for the diff-affected workspaces
60
+ ```
61
+
62
+ — but a clean tier-3 test audit is the bar to leave verify; the Publish/push + CI gate
63
+ (`shared-build-gate` capability) catches any strict-mode breakage before it's shared.
64
+
65
+ ### 3. Runtime wiring audit
66
+
67
+ Honor [../references/runtime-integrity.md](../references/runtime-integrity.md).
68
+
69
+ For each requirement in the change's **capability specs** (not only `tasks.md`):
70
+
71
+ - Name the **production caller** (job kind, endpoint, CLI, …) that invokes the implementing code.
72
+ - Library-only / stub handler / false success / enqueueable-but-unhandled kind → **stop**. Add wiring or mark explicit gaps; do not advance.
73
+
74
+ Record the trace in `verify-evidence.md` (a short REQ → caller table is enough).
75
+
76
+ ### 4. Product-loop E2E — executed, or BLOCKED
77
+
78
+ Before leaving verify / claiming the change complete:
79
+
80
+ 1. Confirm `e2e.json` (scaffolded at plan time via `forge e2e init`) drives the **closed product loop** — not a single job slice. When the design has a producer/consumer split (analyze vs execute, proposals vs ratify), the loop is: produce artifact → consumer reads it → decision/state change → **next run's output differs from baseline**. Steps must assert domain side effects; a step list that would pass against a stubbed handler is invalid.
81
+ 2. `forge e2e run` — executes the steps sequentially and writes `e2e-results.json` (per-step exit codes, output tails, steps hash) into the session dir. A **green run** is required; results go stale if `e2e.json` changes afterwards (re-run). Prose in `verify-evidence.md` no longer satisfies the done gate. **Or**
82
+ 3. Leave an explicit **`BLOCKED`** list in `verify-evidence.md` explaining why E2E cannot run here — the done gate then refuses `done` until unblocked or the user signs `--allow-incomplete`. (`e2e.json` `notApplicable` is only for loops no command can drive — reviewers police the reason.)
83
+
84
+ Keep a short loop narrative under `## Product loop` in `verify-evidence.md` as reviewer context — the gate checks the executed results, not the heading.
85
+
86
+ Also enforce **job-kind closure**: every product-surface job kind is wired end-to-end or deleted from enums/API/UI before complete. And the **consumer–producer rule**: anything the UI/API reads must be proven written by the production path.
87
+
88
+ Do **not** mark the change complete or advance to `done` while a critical path is stubbed, unwired, or unverified without `BLOCKED`. Green unit/tier-3 suites alone are not enough when jobs/workers/orchestration are in scope (`integrity.requireE2E`).
89
+
90
+ ### 5. Mechanical gate
91
+
92
+ ```bash
93
+ forge spine check # every capability row wired (library → runtime owner → writes → evidence)
94
+ forge e2e check # green, current e2e-results.json (steps hash matches e2e.json)
95
+ forge defer list # no unresolved deferrals
96
+ forge integrity-check # combined; forge phase done runs the same checks
97
+ ```
98
+
99
+ Fix any failure before proceeding — `forge phase done|finish` refuses on the same problems.
100
+
101
+ ### 6. Plan completeness
102
+
103
+ - Confirm every plan task is marked complete.
104
+ - Confirm no tier 2 evidence contradicts another.
105
+ - For OpenSpec: `openspec instructions apply --change "<name>" --json` shows expected progress.
106
+ - Requirements met = line-by-line vs **capability specs**, not vs a narrowed task reading.
107
+
108
+ ```bash
109
+ forge phase verify
110
+ ```
111
+
112
+ ## When to re-run tier 3
113
+
114
+ - Tier 3 failed (fix, then re-run tier 3)
115
+ - Coordinator edited code after `verify-evidence.md` was recorded
116
+ - Quality or final reviewer flagged test gaps
117
+ - User explicitly asks for a fresh run
118
+
119
+ ## When NOT to re-run
120
+
121
+ - Tier 2 narrow commands — already audited; duplicating them is slow and redundant
122
+ - Tier 3 passed and nothing changed since — do not run full suite again "for freshness"
123
+
124
+ Then proceed to [review.md](./review.md) if not already done per task.