@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.
- package/bin/forge.mjs +107 -107
- package/bin/forgekit.mjs +83 -83
- package/bin/review.mjs +81 -81
- package/package.json +1 -1
- package/scripts/prepack.mjs +78 -78
- package/scripts/run-tests.mjs +50 -50
- package/src/adr.mjs +236 -236
- package/src/adr.test.mjs +170 -170
- package/src/change.mjs +327 -234
- package/src/change.test.mjs +145 -83
- package/src/cleanup-sessions.mjs +84 -84
- package/src/config.mjs +103 -103
- package/src/defer.mjs +75 -75
- package/src/doctor.mjs +350 -341
- package/src/doctor.test.mjs +114 -114
- package/src/init.mjs +680 -621
- package/src/install.mjs +815 -815
- package/src/install.test.mjs +180 -180
- package/src/integrity-check.mjs +60 -60
- package/src/integrity.mjs +682 -682
- package/src/integrity.test.mjs +566 -566
- package/src/lib.mjs +143 -143
- package/src/models.defaults.json +41 -41
- package/src/new-session.mjs +99 -99
- package/src/openspec-overlays/README.md +19 -19
- package/src/openspec-overlays/openspec-apply-change-footer.md +14 -14
- package/src/openspec-overlays/opsx-apply-completion-step.md +1 -1
- package/src/openspec-overlays/opsx-apply-implement-step.md +11 -11
- package/src/paths.mjs +92 -92
- package/src/plan-engine.mjs +321 -278
- package/src/plan-engine.test.mjs +447 -283
- package/src/preferences.defaults.json +78 -78
- package/src/preferences.mjs +438 -438
- package/src/preferences.test.mjs +174 -174
- package/src/record-evidence.mjs +204 -204
- package/src/resolve-model.mjs +312 -312
- package/src/resolve-model.test.mjs +194 -194
- package/src/review/cli.test.mjs +117 -117
- package/src/review/export.mjs +172 -172
- package/src/review/export.test.mjs +197 -197
- package/src/review/fixtures/valid-review.json +42 -42
- package/src/review/lib.mjs +894 -894
- package/src/review/lib.test.mjs +266 -266
- package/src/review/schema.json +196 -196
- package/src/review/signals.test.mjs +62 -62
- package/src/score-cli.mjs +68 -68
- package/src/score.mjs +568 -566
- package/src/score.test.mjs +366 -340
- package/src/session-reminder.mjs +207 -207
- package/src/session-status.mjs +70 -70
- package/src/set-models.mjs +186 -186
- package/src/set-phase.mjs +205 -205
- package/src/set-prefs.mjs +294 -294
- package/src/specs-sync.mjs +234 -0
- package/src/specs-sync.test.mjs +114 -0
- package/src/spine.mjs +93 -93
- package/src/triage-prompt.mjs +175 -175
- package/src/triage-prompt.test.mjs +50 -50
- package/src/vendor-openspec-overlays.mjs +176 -176
- package/src/vendor-openspec-overlays.test.mjs +62 -62
- package/vendor/skills/archive-to-adr/SKILL.md +149 -149
- package/vendor/skills/forge/SKILL.md +136 -136
- package/vendor/skills/forge/docs/forge.md +650 -647
- package/vendor/skills/forge/phases/brainstorm.md +23 -23
- package/vendor/skills/forge/phases/finish.md +90 -87
- package/vendor/skills/forge/phases/implement.md +77 -77
- package/vendor/skills/forge/phases/plan-openspec.md +60 -60
- package/vendor/skills/forge/phases/plan-specs.md +163 -117
- package/vendor/skills/forge/phases/review.md +25 -25
- package/vendor/skills/forge/phases/verify.md +124 -124
- package/vendor/skills/forge/references/forge-layout.md +85 -85
- package/vendor/skills/forge/references/pace.md +115 -115
- package/vendor/skills/forge/references/plan-routing.md +52 -51
- package/vendor/skills/forge/references/runtime-integrity.md +232 -225
- package/vendor/skills/forge/references/substantial-work.md +37 -37
- package/vendor/skills/forge/references/test-evidence.md +30 -30
- package/vendor/skills/forge/references/test-strategy.md +68 -68
- package/vendor/skills/forge/skills/subagent-driven-development/SKILL.md +87 -87
- package/vendor/skills/forge/subagents/final-reviewer-prompt.md +56 -56
- package/vendor/skills/forge/subagents/implementer-prompt.md +38 -38
- package/vendor/skills/git-resolve-adr-conflict/SKILL.md +132 -132
- package/vendor/skills/thorough-code-review/SKILL.md +290 -290
- package/vendor/skills/thorough-code-review/examples.md +133 -133
- package/vendor/skills/thorough-code-review/reference/accepted-risks.md +26 -26
- package/vendor/skills/thorough-code-review/reference/lenses.md +96 -96
- package/vendor/skills/thorough-code-review/reference/phase1-scout.md +62 -62
- package/vendor/skills/thorough-code-review/reference/phase2-skeptic.md +105 -105
- package/vendor/skills/thorough-code-review/reference/report-schema.json +222 -222
- package/vendor/skills/thorough-code-review/reference/report-template.md +115 -115
- package/vendor/skills/thorough-code-review/reference/severity-rubric.md +49 -49
- package/vendor/skills/thorough-code-review/reference/signals-preflight.md +55 -55
- package/vendor/templates/adr/README.md +7 -7
- package/vendor/templates/adr/decisions.md +141 -141
- package/vendor/templates/adr/hooks/check-pending-adrs.mjs +74 -74
- package/vendor/templates/adr/hooks/check-pending-adrs.sh +3 -3
- package/vendor/templates/adr/hooks/openspec-archive-agent-message.mjs +52 -52
- package/vendor/templates/adr/hooks/openspec-archive-agent-message.sh +3 -3
- package/vendor/templates/project/claude/commands/forge-apply.md +75 -75
- package/vendor/templates/project/claude/commands/forge-brainstorm.md +7 -7
- package/vendor/templates/project/claude/commands/forge-build.md +17 -17
- package/vendor/templates/project/claude/commands/forge-plan.md +12 -12
- package/vendor/templates/project/claude/commands/forge-skip.md +14 -14
- package/vendor/templates/project/claude/commands/forge-status.md +16 -16
- package/vendor/templates/project/claude/commands/forge.md +16 -16
- package/vendor/templates/project/claude/hooks/forge-prompt-hook.mjs +73 -73
- package/vendor/templates/project/claude/hooks/forge-session-start.mjs +19 -19
- package/vendor/templates/project/claude/hooks/forge-triage-hook.mjs +77 -77
- package/vendor/templates/project/cursor/commands/forge-apply.md +75 -75
- package/vendor/templates/project/cursor/commands/forge-brainstorm.md +10 -10
- package/vendor/templates/project/cursor/commands/forge-build.md +17 -17
- package/vendor/templates/project/cursor/commands/forge-plan.md +15 -15
- package/vendor/templates/project/cursor/commands/forge-skip.md +14 -14
- package/vendor/templates/project/cursor/commands/forge-status.md +16 -16
- package/vendor/templates/project/cursor/commands/forge.md +16 -16
- package/vendor/templates/project/cursor/hooks/forge-session-start.mjs +30 -30
- 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.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
##
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
##
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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.
|