@garygentry/feature-forge 0.2.13 → 0.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/adapters/claude/.feature-forge-bundle.json +1 -1
- package/adapters/claude/references/epic-manifest-schema.json +5 -0
- package/adapters/claude/references/shared-conventions.md +12 -0
- package/adapters/claude/references/stacks/_generic.md +21 -0
- package/adapters/claude/references/stacks/go.md +19 -0
- package/adapters/claude/references/stacks/python.md +21 -0
- package/adapters/claude/references/stacks/rust.md +19 -0
- package/adapters/claude/references/stacks/typescript.md +23 -0
- package/adapters/claude/scripts/epic-manifest.py +75 -5
- package/adapters/claude/scripts/forge-root.sh +55 -11
- package/adapters/claude/scripts/forge-session.py +38 -1
- package/adapters/claude/skills/forge/references/shared-conventions.md +12 -0
- package/adapters/claude/skills/forge-0-epic/references/shared-conventions.md +12 -0
- package/adapters/claude/skills/forge-1-prd/SKILL.md +2 -0
- package/adapters/claude/skills/forge-1-prd/references/shared-conventions.md +12 -0
- package/adapters/claude/skills/forge-2-tech/SKILL.md +2 -0
- package/adapters/claude/skills/forge-2-tech/references/shared-conventions.md +12 -0
- package/adapters/claude/skills/forge-2-tech/references/stacks/_generic.md +21 -0
- package/adapters/claude/skills/forge-2-tech/references/stacks/go.md +19 -0
- package/adapters/claude/skills/forge-2-tech/references/stacks/python.md +21 -0
- package/adapters/claude/skills/forge-2-tech/references/stacks/rust.md +19 -0
- package/adapters/claude/skills/forge-2-tech/references/stacks/typescript.md +23 -0
- package/adapters/claude/skills/forge-3-specs/SKILL.md +2 -0
- package/adapters/claude/skills/forge-3-specs/references/shared-conventions.md +12 -0
- package/adapters/claude/skills/forge-3-specs/references/stacks/_generic.md +21 -0
- package/adapters/claude/skills/forge-3-specs/references/stacks/go.md +19 -0
- package/adapters/claude/skills/forge-3-specs/references/stacks/python.md +21 -0
- package/adapters/claude/skills/forge-3-specs/references/stacks/rust.md +19 -0
- package/adapters/claude/skills/forge-3-specs/references/stacks/typescript.md +23 -0
- package/adapters/claude/skills/forge-4-backlog/SKILL.md +5 -0
- package/adapters/claude/skills/forge-4-backlog/references/shared-conventions.md +12 -0
- package/adapters/claude/skills/forge-5-loop/SKILL.md +7 -9
- package/adapters/claude/skills/forge-5-loop/references/runner-contract.md +41 -0
- package/adapters/claude/skills/forge-5-loop/references/shared-conventions.md +12 -0
- package/adapters/claude/skills/forge-6-docs/references/shared-conventions.md +12 -0
- package/adapters/claude/skills/forge-fix/references/shared-conventions.md +12 -0
- package/adapters/claude/skills/forge-guide/references/shared-conventions.md +12 -0
- package/adapters/claude/skills/forge-guide/references/stacks/_generic.md +21 -0
- package/adapters/claude/skills/forge-guide/references/stacks/go.md +19 -0
- package/adapters/claude/skills/forge-guide/references/stacks/python.md +21 -0
- package/adapters/claude/skills/forge-guide/references/stacks/rust.md +19 -0
- package/adapters/claude/skills/forge-guide/references/stacks/typescript.md +23 -0
- package/adapters/claude/skills/forge-verify/SKILL.md +3 -3
- package/adapters/claude/skills/forge-verify/references/shared-conventions.md +12 -0
- package/adapters/claude/skills/forge-verify/references/verification-checklists.md +82 -3
- package/adapters/codex/.feature-forge-bundle.json +1 -1
- package/adapters/codex/references/epic-manifest-schema.json +5 -0
- package/adapters/codex/references/shared-conventions.md +12 -0
- package/adapters/codex/references/stacks/_generic.md +21 -0
- package/adapters/codex/references/stacks/go.md +19 -0
- package/adapters/codex/references/stacks/python.md +21 -0
- package/adapters/codex/references/stacks/rust.md +19 -0
- package/adapters/codex/references/stacks/typescript.md +23 -0
- package/adapters/codex/scripts/epic-manifest.py +75 -5
- package/adapters/codex/scripts/forge-root.sh +55 -11
- package/adapters/codex/scripts/forge-session.py +38 -1
- package/adapters/codex/skills/forge/references/shared-conventions.md +12 -0
- package/adapters/codex/skills/forge-0-epic/references/shared-conventions.md +12 -0
- package/adapters/codex/skills/forge-1-prd/SKILL.md +2 -0
- package/adapters/codex/skills/forge-1-prd/references/shared-conventions.md +12 -0
- package/adapters/codex/skills/forge-2-tech/SKILL.md +2 -0
- package/adapters/codex/skills/forge-2-tech/references/shared-conventions.md +12 -0
- package/adapters/codex/skills/forge-2-tech/references/stacks/_generic.md +21 -0
- package/adapters/codex/skills/forge-2-tech/references/stacks/go.md +19 -0
- package/adapters/codex/skills/forge-2-tech/references/stacks/python.md +21 -0
- package/adapters/codex/skills/forge-2-tech/references/stacks/rust.md +19 -0
- package/adapters/codex/skills/forge-2-tech/references/stacks/typescript.md +23 -0
- package/adapters/codex/skills/forge-3-specs/SKILL.md +2 -0
- package/adapters/codex/skills/forge-3-specs/references/shared-conventions.md +12 -0
- package/adapters/codex/skills/forge-3-specs/references/stacks/_generic.md +21 -0
- package/adapters/codex/skills/forge-3-specs/references/stacks/go.md +19 -0
- package/adapters/codex/skills/forge-3-specs/references/stacks/python.md +21 -0
- package/adapters/codex/skills/forge-3-specs/references/stacks/rust.md +19 -0
- package/adapters/codex/skills/forge-3-specs/references/stacks/typescript.md +23 -0
- package/adapters/codex/skills/forge-4-backlog/SKILL.md +5 -0
- package/adapters/codex/skills/forge-4-backlog/references/shared-conventions.md +12 -0
- package/adapters/codex/skills/forge-5-loop/SKILL.md +7 -9
- package/adapters/codex/skills/forge-5-loop/references/runner-contract.md +41 -0
- package/adapters/codex/skills/forge-5-loop/references/shared-conventions.md +12 -0
- package/adapters/codex/skills/forge-6-docs/references/shared-conventions.md +12 -0
- package/adapters/codex/skills/forge-fix/references/shared-conventions.md +12 -0
- package/adapters/codex/skills/forge-guide/references/shared-conventions.md +12 -0
- package/adapters/codex/skills/forge-guide/references/stacks/_generic.md +21 -0
- package/adapters/codex/skills/forge-guide/references/stacks/go.md +19 -0
- package/adapters/codex/skills/forge-guide/references/stacks/python.md +21 -0
- package/adapters/codex/skills/forge-guide/references/stacks/rust.md +19 -0
- package/adapters/codex/skills/forge-guide/references/stacks/typescript.md +23 -0
- package/adapters/codex/skills/forge-verify/SKILL.md +3 -3
- package/adapters/codex/skills/forge-verify/references/shared-conventions.md +12 -0
- package/adapters/codex/skills/forge-verify/references/verification-checklists.md +82 -3
- package/adapters/copilot/.feature-forge-bundle.json +1 -1
- package/adapters/copilot/references/epic-manifest-schema.json +5 -0
- package/adapters/copilot/references/shared-conventions.md +12 -0
- package/adapters/copilot/references/stacks/_generic.md +21 -0
- package/adapters/copilot/references/stacks/go.md +19 -0
- package/adapters/copilot/references/stacks/python.md +21 -0
- package/adapters/copilot/references/stacks/rust.md +19 -0
- package/adapters/copilot/references/stacks/typescript.md +23 -0
- package/adapters/copilot/scripts/epic-manifest.py +75 -5
- package/adapters/copilot/scripts/forge-root.sh +55 -11
- package/adapters/copilot/scripts/forge-session.py +38 -1
- package/adapters/copilot/skills/forge/references/shared-conventions.md +12 -0
- package/adapters/copilot/skills/forge-0-epic/references/shared-conventions.md +12 -0
- package/adapters/copilot/skills/forge-1-prd/forge-1-prd.md +2 -0
- package/adapters/copilot/skills/forge-1-prd/references/shared-conventions.md +12 -0
- package/adapters/copilot/skills/forge-2-tech/forge-2-tech.md +2 -0
- package/adapters/copilot/skills/forge-2-tech/references/shared-conventions.md +12 -0
- package/adapters/copilot/skills/forge-2-tech/references/stacks/_generic.md +21 -0
- package/adapters/copilot/skills/forge-2-tech/references/stacks/go.md +19 -0
- package/adapters/copilot/skills/forge-2-tech/references/stacks/python.md +21 -0
- package/adapters/copilot/skills/forge-2-tech/references/stacks/rust.md +19 -0
- package/adapters/copilot/skills/forge-2-tech/references/stacks/typescript.md +23 -0
- package/adapters/copilot/skills/forge-3-specs/forge-3-specs.md +2 -0
- package/adapters/copilot/skills/forge-3-specs/references/shared-conventions.md +12 -0
- package/adapters/copilot/skills/forge-3-specs/references/stacks/_generic.md +21 -0
- package/adapters/copilot/skills/forge-3-specs/references/stacks/go.md +19 -0
- package/adapters/copilot/skills/forge-3-specs/references/stacks/python.md +21 -0
- package/adapters/copilot/skills/forge-3-specs/references/stacks/rust.md +19 -0
- package/adapters/copilot/skills/forge-3-specs/references/stacks/typescript.md +23 -0
- package/adapters/copilot/skills/forge-4-backlog/forge-4-backlog.md +5 -0
- package/adapters/copilot/skills/forge-4-backlog/references/shared-conventions.md +12 -0
- package/adapters/copilot/skills/forge-5-loop/forge-5-loop.md +7 -9
- package/adapters/copilot/skills/forge-5-loop/references/runner-contract.md +41 -0
- package/adapters/copilot/skills/forge-5-loop/references/shared-conventions.md +12 -0
- package/adapters/copilot/skills/forge-6-docs/references/shared-conventions.md +12 -0
- package/adapters/copilot/skills/forge-fix/references/shared-conventions.md +12 -0
- package/adapters/copilot/skills/forge-guide/references/shared-conventions.md +12 -0
- package/adapters/copilot/skills/forge-guide/references/stacks/_generic.md +21 -0
- package/adapters/copilot/skills/forge-guide/references/stacks/go.md +19 -0
- package/adapters/copilot/skills/forge-guide/references/stacks/python.md +21 -0
- package/adapters/copilot/skills/forge-guide/references/stacks/rust.md +19 -0
- package/adapters/copilot/skills/forge-guide/references/stacks/typescript.md +23 -0
- package/adapters/copilot/skills/forge-verify/forge-verify.md +3 -3
- package/adapters/copilot/skills/forge-verify/references/shared-conventions.md +12 -0
- package/adapters/copilot/skills/forge-verify/references/verification-checklists.md +82 -3
- package/adapters/cursor/.feature-forge-bundle.json +1 -1
- package/adapters/cursor/references/epic-manifest-schema.json +5 -0
- package/adapters/cursor/references/shared-conventions.md +12 -0
- package/adapters/cursor/references/stacks/_generic.md +21 -0
- package/adapters/cursor/references/stacks/go.md +19 -0
- package/adapters/cursor/references/stacks/python.md +21 -0
- package/adapters/cursor/references/stacks/rust.md +19 -0
- package/adapters/cursor/references/stacks/typescript.md +23 -0
- package/adapters/cursor/scripts/epic-manifest.py +75 -5
- package/adapters/cursor/scripts/forge-root.sh +55 -11
- package/adapters/cursor/scripts/forge-session.py +38 -1
- package/adapters/cursor/skills/forge/references/shared-conventions.md +12 -0
- package/adapters/cursor/skills/forge-0-epic/references/shared-conventions.md +12 -0
- package/adapters/cursor/skills/forge-1-prd/forge-1-prd.mdc +2 -0
- package/adapters/cursor/skills/forge-1-prd/references/shared-conventions.md +12 -0
- package/adapters/cursor/skills/forge-2-tech/forge-2-tech.mdc +2 -0
- package/adapters/cursor/skills/forge-2-tech/references/shared-conventions.md +12 -0
- package/adapters/cursor/skills/forge-2-tech/references/stacks/_generic.md +21 -0
- package/adapters/cursor/skills/forge-2-tech/references/stacks/go.md +19 -0
- package/adapters/cursor/skills/forge-2-tech/references/stacks/python.md +21 -0
- package/adapters/cursor/skills/forge-2-tech/references/stacks/rust.md +19 -0
- package/adapters/cursor/skills/forge-2-tech/references/stacks/typescript.md +23 -0
- package/adapters/cursor/skills/forge-3-specs/forge-3-specs.mdc +2 -0
- package/adapters/cursor/skills/forge-3-specs/references/shared-conventions.md +12 -0
- package/adapters/cursor/skills/forge-3-specs/references/stacks/_generic.md +21 -0
- package/adapters/cursor/skills/forge-3-specs/references/stacks/go.md +19 -0
- package/adapters/cursor/skills/forge-3-specs/references/stacks/python.md +21 -0
- package/adapters/cursor/skills/forge-3-specs/references/stacks/rust.md +19 -0
- package/adapters/cursor/skills/forge-3-specs/references/stacks/typescript.md +23 -0
- package/adapters/cursor/skills/forge-4-backlog/forge-4-backlog.mdc +5 -0
- package/adapters/cursor/skills/forge-4-backlog/references/shared-conventions.md +12 -0
- package/adapters/cursor/skills/forge-5-loop/forge-5-loop.mdc +7 -9
- package/adapters/cursor/skills/forge-5-loop/references/runner-contract.md +41 -0
- package/adapters/cursor/skills/forge-5-loop/references/shared-conventions.md +12 -0
- package/adapters/cursor/skills/forge-6-docs/references/shared-conventions.md +12 -0
- package/adapters/cursor/skills/forge-fix/references/shared-conventions.md +12 -0
- package/adapters/cursor/skills/forge-guide/references/shared-conventions.md +12 -0
- package/adapters/cursor/skills/forge-guide/references/stacks/_generic.md +21 -0
- package/adapters/cursor/skills/forge-guide/references/stacks/go.md +19 -0
- package/adapters/cursor/skills/forge-guide/references/stacks/python.md +21 -0
- package/adapters/cursor/skills/forge-guide/references/stacks/rust.md +19 -0
- package/adapters/cursor/skills/forge-guide/references/stacks/typescript.md +23 -0
- package/adapters/cursor/skills/forge-verify/forge-verify.mdc +3 -3
- package/adapters/cursor/skills/forge-verify/references/shared-conventions.md +12 -0
- package/adapters/cursor/skills/forge-verify/references/verification-checklists.md +82 -3
- package/adapters/gemini/.feature-forge-bundle.json +1 -1
- package/adapters/gemini/gemini-extension.json +1 -1
- package/adapters/gemini/references/epic-manifest-schema.json +5 -0
- package/adapters/gemini/references/shared-conventions.md +12 -0
- package/adapters/gemini/references/stacks/_generic.md +21 -0
- package/adapters/gemini/references/stacks/go.md +19 -0
- package/adapters/gemini/references/stacks/python.md +21 -0
- package/adapters/gemini/references/stacks/rust.md +19 -0
- package/adapters/gemini/references/stacks/typescript.md +23 -0
- package/adapters/gemini/scripts/epic-manifest.py +75 -5
- package/adapters/gemini/scripts/forge-root.sh +55 -11
- package/adapters/gemini/scripts/forge-session.py +38 -1
- package/adapters/gemini/skills/forge/references/shared-conventions.md +12 -0
- package/adapters/gemini/skills/forge-0-epic/references/shared-conventions.md +12 -0
- package/adapters/gemini/skills/forge-1-prd/forge-1-prd.md +2 -0
- package/adapters/gemini/skills/forge-1-prd/references/shared-conventions.md +12 -0
- package/adapters/gemini/skills/forge-2-tech/forge-2-tech.md +2 -0
- package/adapters/gemini/skills/forge-2-tech/references/shared-conventions.md +12 -0
- package/adapters/gemini/skills/forge-2-tech/references/stacks/_generic.md +21 -0
- package/adapters/gemini/skills/forge-2-tech/references/stacks/go.md +19 -0
- package/adapters/gemini/skills/forge-2-tech/references/stacks/python.md +21 -0
- package/adapters/gemini/skills/forge-2-tech/references/stacks/rust.md +19 -0
- package/adapters/gemini/skills/forge-2-tech/references/stacks/typescript.md +23 -0
- package/adapters/gemini/skills/forge-3-specs/forge-3-specs.md +2 -0
- package/adapters/gemini/skills/forge-3-specs/references/shared-conventions.md +12 -0
- package/adapters/gemini/skills/forge-3-specs/references/stacks/_generic.md +21 -0
- package/adapters/gemini/skills/forge-3-specs/references/stacks/go.md +19 -0
- package/adapters/gemini/skills/forge-3-specs/references/stacks/python.md +21 -0
- package/adapters/gemini/skills/forge-3-specs/references/stacks/rust.md +19 -0
- package/adapters/gemini/skills/forge-3-specs/references/stacks/typescript.md +23 -0
- package/adapters/gemini/skills/forge-4-backlog/forge-4-backlog.md +5 -0
- package/adapters/gemini/skills/forge-4-backlog/references/shared-conventions.md +12 -0
- package/adapters/gemini/skills/forge-5-loop/forge-5-loop.md +7 -9
- package/adapters/gemini/skills/forge-5-loop/references/runner-contract.md +41 -0
- package/adapters/gemini/skills/forge-5-loop/references/shared-conventions.md +12 -0
- package/adapters/gemini/skills/forge-6-docs/references/shared-conventions.md +12 -0
- package/adapters/gemini/skills/forge-fix/references/shared-conventions.md +12 -0
- package/adapters/gemini/skills/forge-guide/references/shared-conventions.md +12 -0
- package/adapters/gemini/skills/forge-guide/references/stacks/_generic.md +21 -0
- package/adapters/gemini/skills/forge-guide/references/stacks/go.md +19 -0
- package/adapters/gemini/skills/forge-guide/references/stacks/python.md +21 -0
- package/adapters/gemini/skills/forge-guide/references/stacks/rust.md +19 -0
- package/adapters/gemini/skills/forge-guide/references/stacks/typescript.md +23 -0
- package/adapters/gemini/skills/forge-verify/forge-verify.md +3 -3
- package/adapters/gemini/skills/forge-verify/references/shared-conventions.md +12 -0
- package/adapters/gemini/skills/forge-verify/references/verification-checklists.md +82 -3
- package/package.json +1 -1
|
@@ -274,6 +274,18 @@ This write is **left uncommitted**: it is staged and committed as part of this s
|
|
|
274
274
|
|
|
275
275
|
**Incremental artifact tracking:** When a stage writes multiple files (e.g. forge-3-specs writing a suite of spec documents), update the `stages.{stage}.artifacts` array in `.pipeline-state.json` after writing each file — not just at stage completion. This is what makes the Interrupted inventory above precise about which files were successfully written.
|
|
276
276
|
|
|
277
|
+
## Stage-Completion Re-check
|
|
278
|
+
|
|
279
|
+
Invoke this block **at the head of any post-entry step that writes a stage artifact or runs the Scripted Stage Exit** — the Stage-Entry Guard runs only once, at the top of the skill. A **resumed or pasted mid-stage instruction** (e.g. "continue {stage}: write TRACEABILITY.md, run the stage exit") enters *below* the entry guard, so nothing re-checks completion before it overwrites a committed artifact and re-fires a finished exit — data-destructive if followed literally. This re-check is the idempotency backstop for that path. `{stage}` is the invoking skill's id.
|
|
280
|
+
|
|
281
|
+
**Re-read** `stages.{stage}` in `{resolvedFeatureDir}/.pipeline-state.json`, then classify by **provenance** — a legitimate completion runs in the same session that applied this stage's Entry Stamp; a replayed continuation finds a finished stage it did not produce:
|
|
282
|
+
|
|
283
|
+
1. **Proceed** when `stages.{stage}.status` is `"in-progress"` (this session's Entry Stamp — you are finishing the run you started) or absent/`pending`. Run the write / exit normally.
|
|
284
|
+
|
|
285
|
+
2. **Detect-and-refuse** when ALL of these hold: `stages.{stage}.status ∈ {"complete", "stale"}` **AND** the stage's artifacts (incl. `TRACEABILITY.md` for forge-3-specs) exist on disk **AND** a `commitHash` is recorded for the stage **AND** you did **not** author this stage earlier in the current session. This is a stale/replayed continuation of an already-finished, committed stage. Do **not** overwrite the artifact or re-run the exit. Route instead to the **Stage-Entry Guard**'s *Re-authoring* path: surface the same `AskUserQuestion` warning ("A completed {stage} artifact already exists for '{feature}' (v{n}{, marked stale}). Continuing will create a new version. Proceed?"). Only on explicit confirmation re-enter from the Entry Stamp (the version bumps at exit); otherwise **stop** and report that the stage is already complete — cite the recorded `commitHash` and offer `/feature-forge:forge {feature}` to see true state.
|
|
286
|
+
|
|
287
|
+
When you cannot confirm you authored the current run, treat it as a replay and refuse: a false refuse costs one confirmation click; a false proceed overwrites a committed artifact and re-churns a stage version. `--force` follows Force Mode (skip the gate, treat as a deliberate re-author).
|
|
288
|
+
|
|
277
289
|
## Force Mode
|
|
278
290
|
|
|
279
291
|
If the user passes `--force` as an argument, skip prerequisite validation with a warning:
|
|
@@ -151,7 +151,7 @@ Use the host's question mechanism to present the rendered run command and option
|
|
|
151
151
|
```
|
|
152
152
|
Ready to run the loop for {feature}:
|
|
153
153
|
|
|
154
|
-
{rendered runCommand}
|
|
154
|
+
{rendered runCommand} # + " --review" when the recommended Run-mode option (below) is picked
|
|
155
155
|
|
|
156
156
|
Backlog summary:
|
|
157
157
|
- Pending: {pending}
|
|
@@ -160,15 +160,13 @@ Backlog summary:
|
|
|
160
160
|
- Blocked: {blocked}
|
|
161
161
|
- Iterations: {iterationCount} ({activeItems} items x {loopIterationMultiplier} multiplier)
|
|
162
162
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
precedence (item.model > --model/options > project default > provider default),
|
|
166
|
-
read references/runner-contract.md.
|
|
167
|
-
|
|
168
|
-
Proceed with this command, or would you like to adjust?
|
|
163
|
+
For the model-selection precedence (item.model > --model/options > project default >
|
|
164
|
+
provider default) and the full optional-flags catalog, read references/runner-contract.md.
|
|
169
165
|
```
|
|
170
166
|
|
|
171
|
-
|
|
167
|
+
**Run mode (gated on `loopRunner.name == "rauf"`).** When the runner is rauf, add a **"Run mode"** question to this same the host's question mechanism surface with these options **in this exact order** (do NOT improvise — deterministic ordering is the point): **(1) "Run with review pass (recommended)"** — append `--review`, and this is the default; **(2) "Run without review"** — the bare rendered command; **(3, only when 2a counted blocked items) "Review + retry blocked"** — append `--review --retry-blocked`. the host's question mechanism's built-in "Other" covers ad-hoc flags (`--model`/`--timeout`); add no separate open-ended option. The command line shown above renders `--review` (the recommended default). **When the runner is not rauf**, add NO Run-mode question — present the bare rendered command and let the user adjust via "Other" (byte-identical to today). Verbatim option labels: `## Run mode (Step 2d, rauf)` in `references/runner-contract.md`.
|
|
168
|
+
|
|
169
|
+
For the full loop-runner contract — event-stream vs. log-fallback launch, the live-supervision/monitor rules, and the model-selection precedence — read `references/runner-contract.md`. Whichever Run-mode option (or "Other") the user picks, append its flags to the rendered run command before Step 3.
|
|
172
170
|
|
|
173
171
|
#### Agent selection (gated on `loopRunner.agentArgument`)
|
|
174
172
|
|
|
@@ -179,7 +177,7 @@ For the full loop-runner contract — event-stream vs. log-fallback launch, the
|
|
|
179
177
|
- **(c) Availability listing.** From the **same** parsed `agents[]` (no second probe), list `id` / `displayName` / available (`yes`/`no`, `detail` on unavailable rows).
|
|
180
178
|
- **(d) Verdict** — only for a **non-default** resolved agent (default path `None`/`claude-cli` → no probe, byte-identical to today). Classify by **membership** then `available` (never by exit code): **UNKNOWN** (`∉` set) → **hard-reject BEFORE any loop side-effect**, error lists the **sorted** valid ids, **NO proceed-anyway**; **UNAVAILABLE** (member, `available False`) → warn with `detail`, the host's question mechanism offering **proceed-anyway OR choose-another** (re-presents the same `agents[]`), never silent; **AVAILABLE** → proceed, the validated id fills `{agent}`; **probe failure** (non-zero exit / unparseable / missing or empty `agents[]` / row lacking `id`) → surface it, offer **choose-another OR abort**, **never launch the non-default agent unvalidated** and never silently fall back to the default.
|
|
181
179
|
- **(d-model) Claude-only model-alias guard.** Runs **only** when the resolved agent is **non-default** (not the default / `claude-cli` path). Read the backlog.json (Step 1e path); collect items whose `model` is a **Claude-specific alias** (tier `opus`/`sonnet`/`haiku` or a `claude-*` id). **If none, skip silently.** Otherwise warn before launch via the host's question mechanism (NOT prose): `item.model` outranks `--agent`, so the alias is forwarded verbatim to `{agent}`, which will likely reject it (e.g. codex 400 *"The 'sonnet' model is not supported…"*) — every spawn exits 1 and rauf circuit-breaks (*"3 consecutive infra failures — halting"*) with no hint of the cause. Offer: **(1) Strip `model` for this run (recommended)** — rewrite backlog.json removing the `model` key from each affected item (persistent edit; re-run forge-4-backlog to restore), then proceed; **(2) Proceed as-is** — only safe if `{agent}` understands the pinned ids. forge touches only `model`, never `provider`. Full rationale: `references/runner-contract.md`.
|
|
182
|
-
- **(e) Optional-flags line.**
|
|
180
|
+
- **(e) Optional-flags line.** Augment the confirmation block's closing flags/precedence pointer to list `--agent <id>` first plus the agent precedence pointer (`item.provider > --agent > project defaultAgent > runner default`) alongside the model precedence.
|
|
183
181
|
- **(f) Resolved-agent line.** Add to the confirmation block: `Agent: {resolved.agent or claude-cli} (source: {sourceLabel})` — `sourceLabel`: `RUN` → `"per-run selection"`, `PROJECT` → `"project default (loopRunner.defaultAgent)"`, `DEFAULT` → `"runner default — claude-cli"`.
|
|
184
182
|
|
|
185
183
|
## Step 3: Execute the Loop
|
|
@@ -109,6 +109,47 @@ default / `claude-cli` path skips this guard (the aliases are valid there).
|
|
|
109
109
|
> feature-forge's launch-time export is the mitigation; the upstream fix lives in the
|
|
110
110
|
> rauf plugin/repo. Track as a follow-up.
|
|
111
111
|
|
|
112
|
+
## Run mode (Step 2d, rauf)
|
|
113
|
+
|
|
114
|
+
**Applies only when `loopRunner.name == "rauf"`.** rauf's `--review` runs a review
|
|
115
|
+
pass after all iterations complete (an extra agent session that re-examines the
|
|
116
|
+
finished work and can file follow-up backlog items). feature-forge treats **running
|
|
117
|
+
with review as the recommended default** — a review pass is cheap relative to the
|
|
118
|
+
loop it audits, and catches gaps before the pipeline moves on to docs. So Step 2d
|
|
119
|
+
adds a **"Run mode"** question to the confirmation's `AskUserQuestion` surface with a
|
|
120
|
+
**fixed, non-improvised option order** (determinism is the point — the option set
|
|
121
|
+
must not vary run-to-run):
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
Run mode:
|
|
125
|
+
1. Run with review pass (recommended) → append `--review` [DEFAULT]
|
|
126
|
+
After all iterations, a review agent re-examines the finished work and may
|
|
127
|
+
file follow-up items. Recommended for every forge run.
|
|
128
|
+
2. Run without review → bare rendered command
|
|
129
|
+
Skip the review pass — iterations only, no post-run audit.
|
|
130
|
+
3. Review + retry blocked → append `--review --retry-blocked`
|
|
131
|
+
ONLY offered when Step 2a counted one or more `blocked` items. Runs the
|
|
132
|
+
review pass and also unblocks/retries the previously blocked items.
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Notes:
|
|
136
|
+
|
|
137
|
+
- **Option 1 is the default** and the confirmation's rendered command line shows
|
|
138
|
+
`--review` appended. On any pick, append the option's flags to the rendered run
|
|
139
|
+
command before Step 3 (launch).
|
|
140
|
+
- **`AskUserQuestion`'s built-in "Other"** already lets the user type ad-hoc flags
|
|
141
|
+
(`--model <model>`, `--timeout <min>`, or any combination) — do **not** add a
|
|
142
|
+
separate open-ended option for that.
|
|
143
|
+
- **Option 3 is conditional.** Include it only when the Step 2a tally has `blocked
|
|
144
|
+
> 0`; otherwise present options 1 and 2 only.
|
|
145
|
+
- **Version floor.** rauf's explicit `review` signal ships in 0.5.0, below the
|
|
146
|
+
`minRunnerVersion` floor (0.6.0) enforced at gate 1c — so `--review` is always
|
|
147
|
+
available once the loop is cleared to launch. No extra version check is needed.
|
|
148
|
+
- **Non-rauf runners.** When `loopRunner.name != "rauf"`, add **no** Run-mode
|
|
149
|
+
question — present the bare rendered command and let the user adjust via "Other",
|
|
150
|
+
byte-identical to the pre-review-default behavior. `--review` is a rauf-specific
|
|
151
|
+
flag; a swapped-in runner conforming to the contract need not support it.
|
|
152
|
+
|
|
112
153
|
## Optional flags catalog (Step 2d, rauf)
|
|
113
154
|
|
|
114
155
|
These are the optional flags the user may add to the rendered run command. If the
|
|
@@ -274,6 +274,18 @@ This write is **left uncommitted**: it is staged and committed as part of this s
|
|
|
274
274
|
|
|
275
275
|
**Incremental artifact tracking:** When a stage writes multiple files (e.g. forge-3-specs writing a suite of spec documents), update the `stages.{stage}.artifacts` array in `.pipeline-state.json` after writing each file — not just at stage completion. This is what makes the Interrupted inventory above precise about which files were successfully written.
|
|
276
276
|
|
|
277
|
+
## Stage-Completion Re-check
|
|
278
|
+
|
|
279
|
+
Invoke this block **at the head of any post-entry step that writes a stage artifact or runs the Scripted Stage Exit** — the Stage-Entry Guard runs only once, at the top of the skill. A **resumed or pasted mid-stage instruction** (e.g. "continue {stage}: write TRACEABILITY.md, run the stage exit") enters *below* the entry guard, so nothing re-checks completion before it overwrites a committed artifact and re-fires a finished exit — data-destructive if followed literally. This re-check is the idempotency backstop for that path. `{stage}` is the invoking skill's id.
|
|
280
|
+
|
|
281
|
+
**Re-read** `stages.{stage}` in `{resolvedFeatureDir}/.pipeline-state.json`, then classify by **provenance** — a legitimate completion runs in the same session that applied this stage's Entry Stamp; a replayed continuation finds a finished stage it did not produce:
|
|
282
|
+
|
|
283
|
+
1. **Proceed** when `stages.{stage}.status` is `"in-progress"` (this session's Entry Stamp — you are finishing the run you started) or absent/`pending`. Run the write / exit normally.
|
|
284
|
+
|
|
285
|
+
2. **Detect-and-refuse** when ALL of these hold: `stages.{stage}.status ∈ {"complete", "stale"}` **AND** the stage's artifacts (incl. `TRACEABILITY.md` for forge-3-specs) exist on disk **AND** a `commitHash` is recorded for the stage **AND** you did **not** author this stage earlier in the current session. This is a stale/replayed continuation of an already-finished, committed stage. Do **not** overwrite the artifact or re-run the exit. Route instead to the **Stage-Entry Guard**'s *Re-authoring* path: surface the same `AskUserQuestion` warning ("A completed {stage} artifact already exists for '{feature}' (v{n}{, marked stale}). Continuing will create a new version. Proceed?"). Only on explicit confirmation re-enter from the Entry Stamp (the version bumps at exit); otherwise **stop** and report that the stage is already complete — cite the recorded `commitHash` and offer `/feature-forge:forge {feature}` to see true state.
|
|
286
|
+
|
|
287
|
+
When you cannot confirm you authored the current run, treat it as a replay and refuse: a false refuse costs one confirmation click; a false proceed overwrites a committed artifact and re-churns a stage version. `--force` follows Force Mode (skip the gate, treat as a deliberate re-author).
|
|
288
|
+
|
|
277
289
|
## Force Mode
|
|
278
290
|
|
|
279
291
|
If the user passes `--force` as an argument, skip prerequisite validation with a warning:
|
|
@@ -274,6 +274,18 @@ This write is **left uncommitted**: it is staged and committed as part of this s
|
|
|
274
274
|
|
|
275
275
|
**Incremental artifact tracking:** When a stage writes multiple files (e.g. forge-3-specs writing a suite of spec documents), update the `stages.{stage}.artifacts` array in `.pipeline-state.json` after writing each file — not just at stage completion. This is what makes the Interrupted inventory above precise about which files were successfully written.
|
|
276
276
|
|
|
277
|
+
## Stage-Completion Re-check
|
|
278
|
+
|
|
279
|
+
Invoke this block **at the head of any post-entry step that writes a stage artifact or runs the Scripted Stage Exit** — the Stage-Entry Guard runs only once, at the top of the skill. A **resumed or pasted mid-stage instruction** (e.g. "continue {stage}: write TRACEABILITY.md, run the stage exit") enters *below* the entry guard, so nothing re-checks completion before it overwrites a committed artifact and re-fires a finished exit — data-destructive if followed literally. This re-check is the idempotency backstop for that path. `{stage}` is the invoking skill's id.
|
|
280
|
+
|
|
281
|
+
**Re-read** `stages.{stage}` in `{resolvedFeatureDir}/.pipeline-state.json`, then classify by **provenance** — a legitimate completion runs in the same session that applied this stage's Entry Stamp; a replayed continuation finds a finished stage it did not produce:
|
|
282
|
+
|
|
283
|
+
1. **Proceed** when `stages.{stage}.status` is `"in-progress"` (this session's Entry Stamp — you are finishing the run you started) or absent/`pending`. Run the write / exit normally.
|
|
284
|
+
|
|
285
|
+
2. **Detect-and-refuse** when ALL of these hold: `stages.{stage}.status ∈ {"complete", "stale"}` **AND** the stage's artifacts (incl. `TRACEABILITY.md` for forge-3-specs) exist on disk **AND** a `commitHash` is recorded for the stage **AND** you did **not** author this stage earlier in the current session. This is a stale/replayed continuation of an already-finished, committed stage. Do **not** overwrite the artifact or re-run the exit. Route instead to the **Stage-Entry Guard**'s *Re-authoring* path: surface the same `AskUserQuestion` warning ("A completed {stage} artifact already exists for '{feature}' (v{n}{, marked stale}). Continuing will create a new version. Proceed?"). Only on explicit confirmation re-enter from the Entry Stamp (the version bumps at exit); otherwise **stop** and report that the stage is already complete — cite the recorded `commitHash` and offer `/feature-forge:forge {feature}` to see true state.
|
|
286
|
+
|
|
287
|
+
When you cannot confirm you authored the current run, treat it as a replay and refuse: a false refuse costs one confirmation click; a false proceed overwrites a committed artifact and re-churns a stage version. `--force` follows Force Mode (skip the gate, treat as a deliberate re-author).
|
|
288
|
+
|
|
277
289
|
## Force Mode
|
|
278
290
|
|
|
279
291
|
If the user passes `--force` as an argument, skip prerequisite validation with a warning:
|
|
@@ -274,6 +274,18 @@ This write is **left uncommitted**: it is staged and committed as part of this s
|
|
|
274
274
|
|
|
275
275
|
**Incremental artifact tracking:** When a stage writes multiple files (e.g. forge-3-specs writing a suite of spec documents), update the `stages.{stage}.artifacts` array in `.pipeline-state.json` after writing each file — not just at stage completion. This is what makes the Interrupted inventory above precise about which files were successfully written.
|
|
276
276
|
|
|
277
|
+
## Stage-Completion Re-check
|
|
278
|
+
|
|
279
|
+
Invoke this block **at the head of any post-entry step that writes a stage artifact or runs the Scripted Stage Exit** — the Stage-Entry Guard runs only once, at the top of the skill. A **resumed or pasted mid-stage instruction** (e.g. "continue {stage}: write TRACEABILITY.md, run the stage exit") enters *below* the entry guard, so nothing re-checks completion before it overwrites a committed artifact and re-fires a finished exit — data-destructive if followed literally. This re-check is the idempotency backstop for that path. `{stage}` is the invoking skill's id.
|
|
280
|
+
|
|
281
|
+
**Re-read** `stages.{stage}` in `{resolvedFeatureDir}/.pipeline-state.json`, then classify by **provenance** — a legitimate completion runs in the same session that applied this stage's Entry Stamp; a replayed continuation finds a finished stage it did not produce:
|
|
282
|
+
|
|
283
|
+
1. **Proceed** when `stages.{stage}.status` is `"in-progress"` (this session's Entry Stamp — you are finishing the run you started) or absent/`pending`. Run the write / exit normally.
|
|
284
|
+
|
|
285
|
+
2. **Detect-and-refuse** when ALL of these hold: `stages.{stage}.status ∈ {"complete", "stale"}` **AND** the stage's artifacts (incl. `TRACEABILITY.md` for forge-3-specs) exist on disk **AND** a `commitHash` is recorded for the stage **AND** you did **not** author this stage earlier in the current session. This is a stale/replayed continuation of an already-finished, committed stage. Do **not** overwrite the artifact or re-run the exit. Route instead to the **Stage-Entry Guard**'s *Re-authoring* path: surface the same `AskUserQuestion` warning ("A completed {stage} artifact already exists for '{feature}' (v{n}{, marked stale}). Continuing will create a new version. Proceed?"). Only on explicit confirmation re-enter from the Entry Stamp (the version bumps at exit); otherwise **stop** and report that the stage is already complete — cite the recorded `commitHash` and offer `/feature-forge:forge {feature}` to see true state.
|
|
286
|
+
|
|
287
|
+
When you cannot confirm you authored the current run, treat it as a replay and refuse: a false refuse costs one confirmation click; a false proceed overwrites a committed artifact and re-churns a stage version. `--force` follows Force Mode (skip the gate, treat as a deliberate re-author).
|
|
288
|
+
|
|
277
289
|
## Force Mode
|
|
278
290
|
|
|
279
291
|
If the user passes `--force` as an argument, skip prerequisite validation with a warning:
|
|
@@ -274,6 +274,18 @@ This write is **left uncommitted**: it is staged and committed as part of this s
|
|
|
274
274
|
|
|
275
275
|
**Incremental artifact tracking:** When a stage writes multiple files (e.g. forge-3-specs writing a suite of spec documents), update the `stages.{stage}.artifacts` array in `.pipeline-state.json` after writing each file — not just at stage completion. This is what makes the Interrupted inventory above precise about which files were successfully written.
|
|
276
276
|
|
|
277
|
+
## Stage-Completion Re-check
|
|
278
|
+
|
|
279
|
+
Invoke this block **at the head of any post-entry step that writes a stage artifact or runs the Scripted Stage Exit** — the Stage-Entry Guard runs only once, at the top of the skill. A **resumed or pasted mid-stage instruction** (e.g. "continue {stage}: write TRACEABILITY.md, run the stage exit") enters *below* the entry guard, so nothing re-checks completion before it overwrites a committed artifact and re-fires a finished exit — data-destructive if followed literally. This re-check is the idempotency backstop for that path. `{stage}` is the invoking skill's id.
|
|
280
|
+
|
|
281
|
+
**Re-read** `stages.{stage}` in `{resolvedFeatureDir}/.pipeline-state.json`, then classify by **provenance** — a legitimate completion runs in the same session that applied this stage's Entry Stamp; a replayed continuation finds a finished stage it did not produce:
|
|
282
|
+
|
|
283
|
+
1. **Proceed** when `stages.{stage}.status` is `"in-progress"` (this session's Entry Stamp — you are finishing the run you started) or absent/`pending`. Run the write / exit normally.
|
|
284
|
+
|
|
285
|
+
2. **Detect-and-refuse** when ALL of these hold: `stages.{stage}.status ∈ {"complete", "stale"}` **AND** the stage's artifacts (incl. `TRACEABILITY.md` for forge-3-specs) exist on disk **AND** a `commitHash` is recorded for the stage **AND** you did **not** author this stage earlier in the current session. This is a stale/replayed continuation of an already-finished, committed stage. Do **not** overwrite the artifact or re-run the exit. Route instead to the **Stage-Entry Guard**'s *Re-authoring* path: surface the same `AskUserQuestion` warning ("A completed {stage} artifact already exists for '{feature}' (v{n}{, marked stale}). Continuing will create a new version. Proceed?"). Only on explicit confirmation re-enter from the Entry Stamp (the version bumps at exit); otherwise **stop** and report that the stage is already complete — cite the recorded `commitHash` and offer `/feature-forge:forge {feature}` to see true state.
|
|
286
|
+
|
|
287
|
+
When you cannot confirm you authored the current run, treat it as a replay and refuse: a false refuse costs one confirmation click; a false proceed overwrites a committed artifact and re-churns a stage version. `--force` follows Force Mode (skip the gate, treat as a deliberate re-author).
|
|
288
|
+
|
|
277
289
|
## Force Mode
|
|
278
290
|
|
|
279
291
|
If the user passes `--force` as an argument, skip prerequisite validation with a warning:
|
|
@@ -79,6 +79,27 @@ Replace stack-specific checks with these generic equivalents:
|
|
|
79
79
|
| "JSDoc on every field" | "Documentation comments on every field" |
|
|
80
80
|
| "tsconfig.json extends root" | "Build configuration follows project conventions" |
|
|
81
81
|
|
|
82
|
+
### Runtime Entrypoints & Bootstrap-Wiring Sites
|
|
83
|
+
|
|
84
|
+
Used by `CHECK-I22` (a runtime-required bootstrap needs a **non-test** caller on one of these) and
|
|
85
|
+
`CHECK-I23` (a heavy init wired into a **universal** bootstrap entry should move to a lazier site).
|
|
86
|
+
Since no dedicated profile applies, identify these by role rather than exact filename:
|
|
87
|
+
|
|
88
|
+
- **Runtime entrypoints (a legitimate non-test call site):** the process/main entry the build's
|
|
89
|
+
run command actually launches (from the CI/`Makefile`/manifest "start" target), an HTTP/RPC handler
|
|
90
|
+
or route, a scheduled/worker task, or a CLI subcommand — **not** a file in the project's test
|
|
91
|
+
directory or matching its test-file convention.
|
|
92
|
+
- **Universal bootstrap entries (run on every startup — the `CHECK-I23` risk site):** any
|
|
93
|
+
module/hook the framework runs **once per process before serving** — a startup/lifecycle hook, an
|
|
94
|
+
import-time initializer, a global preload, or a shared test-setup module that bootstraps production
|
|
95
|
+
graphs. Side effects here run on every process start (and, under a dev/watch runtime, on every
|
|
96
|
+
reload).
|
|
97
|
+
- **Heavy server-only import markers (what makes an init "heavy" for `CHECK-I23`):** database/ORM
|
|
98
|
+
clients and connection pools, message/queue clients, telemetry/observability SDKs, or a broad
|
|
99
|
+
whole-service-layer import. An init pulling any of these into a universal bootstrap entry is the
|
|
100
|
+
CHECK-I23 pattern — recommend lazy initialization at the first handler/worker that needs the graph,
|
|
101
|
+
not eagerly at process start.
|
|
102
|
+
|
|
82
103
|
## Acceptance Criteria Patterns
|
|
83
104
|
|
|
84
105
|
Use these placeholder patterns in backlog items. Replace `{typeCheckCommand}`, `{testCommand}`, and `{module}` with values from `forge.config.json` and the project structure:
|
|
@@ -84,6 +84,25 @@ When examining a Go project, check for:
|
|
|
84
84
|
- **Formatting**: `gofmt -l .` or `goimports -l .` (should produce no output)
|
|
85
85
|
- **Module tidiness**: `go mod tidy` (ensures `go.mod` and `go.sum` are consistent)
|
|
86
86
|
|
|
87
|
+
### Runtime Entrypoints & Bootstrap-Wiring Sites
|
|
88
|
+
|
|
89
|
+
Used by `CHECK-I22` (a runtime-required bootstrap needs a **non-test** caller on one of these) and
|
|
90
|
+
`CHECK-I23` (a heavy init wired into a **universal** bootstrap entry should move to a lazier site).
|
|
91
|
+
|
|
92
|
+
- **Runtime entrypoints (a legitimate non-test call site):** `func main()` in a `package main` under
|
|
93
|
+
`cmd/…` or the module root, an HTTP handler registered on a `*http.ServeMux` / router, a gRPC service
|
|
94
|
+
registration, or a worker/consumer goroutine started from `main` — not a `*_test.go` file.
|
|
95
|
+
- **Universal bootstrap entries (run on every startup — the `CHECK-I23` risk site):** a package-level
|
|
96
|
+
`func init()` that constructs heavy clients, package-level `var` initializers that dial/connect at
|
|
97
|
+
import time, or a single `bootstrap`/`wire` module `main` calls before serving. `init()` and
|
|
98
|
+
package-var side effects run on **every** binary start, before `main` gets control.
|
|
99
|
+
- **Heavy server-only import markers (what makes an init "heavy" for `CHECK-I23`):** DB drivers/pools
|
|
100
|
+
(`database/sql` + a driver, `pgx`, `gorm`, `mongo-driver`), message/queue clients (`sarama`/Kafka,
|
|
101
|
+
`amqp`, `go-redis`), telemetry SDKs (`go.opentelemetry.io/*`, `sentry-go`), or a broad internal
|
|
102
|
+
service package. An `init()` or package-var that dials any of these is the CHECK-I23 pattern —
|
|
103
|
+
recommend a `sync.Once` lazy constructor invoked from the first handler that needs it, not an
|
|
104
|
+
eager package-level connect.
|
|
105
|
+
|
|
87
106
|
## Testing
|
|
88
107
|
|
|
89
108
|
- **Framework**: `testing` stdlib package
|
|
@@ -111,6 +111,27 @@ async def refresh_session_token(
|
|
|
111
111
|
- **Import validation**: `mypy` with `--strict` or `--disallow-untyped-defs` catches missing type annotations
|
|
112
112
|
- **Module export validation**: `__all__` lists in `__init__.py` match spec's public API
|
|
113
113
|
|
|
114
|
+
### Runtime Entrypoints & Bootstrap-Wiring Sites
|
|
115
|
+
|
|
116
|
+
Used by `CHECK-I22` (a runtime-required bootstrap needs a **non-test** caller on one of these) and
|
|
117
|
+
`CHECK-I23` (a heavy init wired into a **universal** bootstrap entry should move to a lazier site).
|
|
118
|
+
|
|
119
|
+
- **Runtime entrypoints (a legitimate non-test call site):** a `if __name__ == "__main__":` block, a
|
|
120
|
+
`[project.scripts]` console-script target in `pyproject.toml`, an ASGI/WSGI app object
|
|
121
|
+
(`app = FastAPI()` / Django `wsgi.py` / `asgi.py`), a route/view/handler, a Celery/RQ task module, or
|
|
122
|
+
a management command — not a `test_*.py` / `conftest.py`.
|
|
123
|
+
- **Universal bootstrap entries (run on every startup — the `CHECK-I23` risk site):** a package
|
|
124
|
+
`__init__.py` that eagerly instantiates heavy clients at import time, a framework startup hook
|
|
125
|
+
(FastAPI `lifespan` / `@app.on_event("startup")`, Django `AppConfig.ready()`, a Gunicorn/uvicorn
|
|
126
|
+
`--preload` module), or a `conftest.py` that bootstraps production graphs. Import-time side effects
|
|
127
|
+
here run on every process start.
|
|
128
|
+
- **Heavy server-only import markers (what makes an init "heavy" for `CHECK-I23`):** DB/ORM engines
|
|
129
|
+
(`sqlalchemy.create_engine`, `psycopg`, Django ORM, `pymongo`, `redis`), task queues (`celery`,
|
|
130
|
+
`rq`, `kafka`), telemetry SDKs (`opentelemetry`, `sentry_sdk`), or a whole-service-layer package
|
|
131
|
+
import. An init pulling any of these at a universal entry is the CHECK-I23 pattern — recommend lazy
|
|
132
|
+
init (module-level `@lru_cache` factory, `Depends()` provider, or first-use lazy import) at the
|
|
133
|
+
handler that needs it.
|
|
134
|
+
|
|
114
135
|
## Testing
|
|
115
136
|
|
|
116
137
|
- **Framework**: pytest (with `conftest.py` for fixtures)
|
|
@@ -90,6 +90,25 @@ When examining a Rust project, check for:
|
|
|
90
90
|
- **Formatting**: `cargo fmt --check` (ensures code matches `rustfmt` style)
|
|
91
91
|
- **Unsafe audit**: `cargo geiger` (if security-sensitive — counts unsafe blocks)
|
|
92
92
|
|
|
93
|
+
### Runtime Entrypoints & Bootstrap-Wiring Sites
|
|
94
|
+
|
|
95
|
+
Used by `CHECK-I22` (a runtime-required bootstrap needs a **non-test** caller on one of these) and
|
|
96
|
+
`CHECK-I23` (a heavy init wired into a **universal** bootstrap entry should move to a lazier site).
|
|
97
|
+
|
|
98
|
+
- **Runtime entrypoints (a legitimate non-test call site):** `fn main()` in `main.rs` or a `[[bin]]`
|
|
99
|
+
target, an async runtime entry (`#[tokio::main]`), an HTTP handler registered on an axum/actix/warp
|
|
100
|
+
router, or a worker task spawned from `main` — not a `#[cfg(test)]` module or a `tests/` integration
|
|
101
|
+
file.
|
|
102
|
+
- **Universal bootstrap entries (run on every startup — the `CHECK-I23` risk site):** a `lazy_static!`
|
|
103
|
+
/ `once_cell::sync::Lazy` static that eagerly constructs heavy clients, a single `bootstrap`/`setup`
|
|
104
|
+
fn `main` calls before serving, or a `#[ctor]`-style pre-`main` initializer. A `Lazy` static is only
|
|
105
|
+
a risk when it is *forced* at startup rather than on first use.
|
|
106
|
+
- **Heavy server-only import markers (what makes an init "heavy" for `CHECK-I23`):** DB pools
|
|
107
|
+
(`sqlx::Pool`, `diesel`, `deadpool`, `mongodb`), message/queue clients (`rdkafka`, `lapin`,
|
|
108
|
+
`redis`), telemetry SDKs (`opentelemetry`, `sentry`), or a broad internal service crate. Constructing
|
|
109
|
+
any of these eagerly at a universal entry is the CHECK-I23 pattern — recommend a `OnceCell`/`Lazy`
|
|
110
|
+
forced on **first use** by the handler that needs it, not at process start.
|
|
111
|
+
|
|
93
112
|
## Testing
|
|
94
113
|
|
|
95
114
|
- **Framework**: Built-in test harness (`#[test]`, `#[cfg(test)]`)
|
|
@@ -64,6 +64,29 @@ When examining a TypeScript project, check for:
|
|
|
64
64
|
- **Cross-package type checks**: `bun run typecheck` (or equivalent) passes for both the feature package AND packages that depend on it
|
|
65
65
|
- **Import path validation**: All import paths resolve correctly per the `exports` map in `package.json`
|
|
66
66
|
|
|
67
|
+
### Runtime Entrypoints & Bootstrap-Wiring Sites
|
|
68
|
+
|
|
69
|
+
Used by `CHECK-I22` (a runtime-required bootstrap needs a **non-test** caller on one of these) and
|
|
70
|
+
`CHECK-I23` (a heavy init wired into a **universal** bootstrap entry should move to a lazier site).
|
|
71
|
+
|
|
72
|
+
- **Runtime entrypoints (a legitimate non-test call site):** a `package.json` `bin` / CLI `main`; a
|
|
73
|
+
server entry that actually starts listening (`src/server.ts`, `src/index.ts` invoking `listen`); a
|
|
74
|
+
worker/consumer file; and for Next.js — `middleware.ts`, `app/**/route.ts` route handlers,
|
|
75
|
+
`app/**/{page,layout,template}.tsx`, server actions, and `instrumentation.ts`. Express/Hono/Fastify:
|
|
76
|
+
the file that constructs the app and calls `.listen()`.
|
|
77
|
+
- **Universal bootstrap entries (run on every startup — the `CHECK-I23` risk site):** Next.js
|
|
78
|
+
`instrumentation.ts` / `instrumentation.js` (its `register()` runs once per server process before
|
|
79
|
+
any request), an app-server preload/`register`/`--import` hook, a root `app/layout.tsx` that
|
|
80
|
+
eagerly imports server singletons, and global test setup (`vitest.setup.ts`, `jest.setup.ts`) if it
|
|
81
|
+
bootstraps production graphs. Wiring a heavy init here loads it on **every** cold start (and, under
|
|
82
|
+
the dev server, on every module re-evaluation).
|
|
83
|
+
- **Heavy server-only import markers (what makes an init "heavy" for `CHECK-I23`):** DB/ORM clients
|
|
84
|
+
(`drizzle-orm`, `@prisma/client`, `pg`, `mongoose`, `kysely`), queue/worker libs (`bullmq`, `bull`,
|
|
85
|
+
`kafkajs`, `ioredis`), telemetry/observability SDKs (`@opentelemetry/*`, `@sentry/node`), and a
|
|
86
|
+
whole-service-layer barrel (`import * as services from "@repo/services"`). An init that pulls any of
|
|
87
|
+
these into a universal bootstrap entry is the CHECK-I23 pattern — recommend lazy init at the first
|
|
88
|
+
route/handler/worker that needs it.
|
|
89
|
+
|
|
67
90
|
## Testing
|
|
68
91
|
|
|
69
92
|
- **Framework**: Vitest (most common in modern TS), Jest, or testing-library
|
|
@@ -29,7 +29,7 @@ Pick based on how many checks the mode carries (see the per-mode totals in Step
|
|
|
29
29
|
- **Small modes (prd ~15, tech ~15): single verifier.** Use the host's subagent mechanism once with
|
|
30
30
|
`the forge-verifier custom agent`, passing the feature name and mode. It runs all
|
|
31
31
|
checks and returns findings.
|
|
32
|
-
- **Large modes (specs ~38, backlog ~
|
|
32
|
+
- **Large modes (specs ~38, backlog ~27, impl ~23): parallel dimensioned fan-out.**
|
|
33
33
|
Split the mode's checklist into **dimension groups** and dispatch **one
|
|
34
34
|
`forge-verifier` per group, in parallel — a single message with multiple subagent
|
|
35
35
|
calls** (the `superpowers:dispatching-parallel-agents` pattern). Each instance owns a
|
|
@@ -162,9 +162,9 @@ Load into context ALL artifacts for this feature based on mode:
|
|
|
162
162
|
|
|
163
163
|
Read `references/verification-checklists.md` for the detailed checklists per mode. Execute every check. Do not skip checks because things "look fine." That same reference also holds the relocated **Findings Document Template (Step 4)**, the worked **Example Findings (Step 4)**, and the **Epic Mode State Write Detail (Step 6)** sections used later in this skill.
|
|
164
164
|
|
|
165
|
-
Each check in `verification-checklists.md` has a unique ID (CHECK-P01, CHECK-T01, CHECK-S01, CHECK-B01, etc.). As you execute each check, record its ID and result (pass/fail/not-applicable). After completing all checks, report the total: "Executed N of M checks. Results: X pass, Y fail, Z not-applicable." If your count is significantly below the expected total for the mode (prd: ~15 checks, tech: ~15 checks, specs: ~38 checks, backlog: ~
|
|
165
|
+
Each check in `verification-checklists.md` has a unique ID (CHECK-P01, CHECK-T01, CHECK-S01, CHECK-B01, etc.). As you execute each check, record its ID and result (pass/fail/not-applicable). After completing all checks, report the total: "Executed N of M checks. Results: X pass, Y fail, Z not-applicable." If your count is significantly below the expected total for the mode (prd: ~15 checks, tech: ~15 checks, specs: ~38 checks, backlog: ~27 checks, impl: ~23 checks, epic: ~10 checks), you likely skipped checks — go back and complete them.
|
|
166
166
|
|
|
167
|
-
**Epic mode dispatch.** Epic mode is a small (~
|
|
167
|
+
**Epic mode dispatch.** Epic mode is a small (~10-check) checklist, so per the single-vs-parallel rule above, dispatch a **single `forge-verifier`** via the host's subagent mechanism, passing the epic name and `mode=epic`. The verifier runs CHECK-E01..E10 from the `## Epic Mode Checklist` in `references/verification-checklists.md` (E01/E02/E03/E08 are delegated to `epic-manifest.py validate`/`check-name`; E04–E07, E09, and E10 are verifier judgment) and returns its findings.
|
|
168
168
|
|
|
169
169
|
### Important: Be Specific, Not General
|
|
170
170
|
|
|
@@ -274,6 +274,18 @@ This write is **left uncommitted**: it is staged and committed as part of this s
|
|
|
274
274
|
|
|
275
275
|
**Incremental artifact tracking:** When a stage writes multiple files (e.g. forge-3-specs writing a suite of spec documents), update the `stages.{stage}.artifacts` array in `.pipeline-state.json` after writing each file — not just at stage completion. This is what makes the Interrupted inventory above precise about which files were successfully written.
|
|
276
276
|
|
|
277
|
+
## Stage-Completion Re-check
|
|
278
|
+
|
|
279
|
+
Invoke this block **at the head of any post-entry step that writes a stage artifact or runs the Scripted Stage Exit** — the Stage-Entry Guard runs only once, at the top of the skill. A **resumed or pasted mid-stage instruction** (e.g. "continue {stage}: write TRACEABILITY.md, run the stage exit") enters *below* the entry guard, so nothing re-checks completion before it overwrites a committed artifact and re-fires a finished exit — data-destructive if followed literally. This re-check is the idempotency backstop for that path. `{stage}` is the invoking skill's id.
|
|
280
|
+
|
|
281
|
+
**Re-read** `stages.{stage}` in `{resolvedFeatureDir}/.pipeline-state.json`, then classify by **provenance** — a legitimate completion runs in the same session that applied this stage's Entry Stamp; a replayed continuation finds a finished stage it did not produce:
|
|
282
|
+
|
|
283
|
+
1. **Proceed** when `stages.{stage}.status` is `"in-progress"` (this session's Entry Stamp — you are finishing the run you started) or absent/`pending`. Run the write / exit normally.
|
|
284
|
+
|
|
285
|
+
2. **Detect-and-refuse** when ALL of these hold: `stages.{stage}.status ∈ {"complete", "stale"}` **AND** the stage's artifacts (incl. `TRACEABILITY.md` for forge-3-specs) exist on disk **AND** a `commitHash` is recorded for the stage **AND** you did **not** author this stage earlier in the current session. This is a stale/replayed continuation of an already-finished, committed stage. Do **not** overwrite the artifact or re-run the exit. Route instead to the **Stage-Entry Guard**'s *Re-authoring* path: surface the same `AskUserQuestion` warning ("A completed {stage} artifact already exists for '{feature}' (v{n}{, marked stale}). Continuing will create a new version. Proceed?"). Only on explicit confirmation re-enter from the Entry Stamp (the version bumps at exit); otherwise **stop** and report that the stage is already complete — cite the recorded `commitHash` and offer `/feature-forge:forge {feature}` to see true state.
|
|
286
|
+
|
|
287
|
+
When you cannot confirm you authored the current run, treat it as a replay and refuse: a false refuse costs one confirmation click; a false proceed overwrites a committed artifact and re-churns a stage version. `--force` follows Force Mode (skip the gate, treat as a deliberate re-author).
|
|
288
|
+
|
|
277
289
|
## Force Mode
|
|
278
290
|
|
|
279
291
|
If the user passes `--force` as an argument, skip prerequisite validation with a warning:
|
|
@@ -153,6 +153,60 @@ Detailed checklists for each verification mode. Execute EVERY check — do not s
|
|
|
153
153
|
- [ ] **CHECK-B24**: There are items for tests (or testing is included in each feature item's acceptance criteria)
|
|
154
154
|
- [ ] **CHECK-B25**: No large items that try to do too many things (should be broken down)
|
|
155
155
|
|
|
156
|
+
### Generated-Artifact Freshness
|
|
157
|
+
- [ ] **CHECK-B26**: **Generated-artifact freshness vs. `testCommand` `--check` gates** (#145). When a
|
|
158
|
+
project's configured `testCommand` (forge.config.json) gates on **staleness of generated artifacts**
|
|
159
|
+
— sub-commands of the shape `<generator> --check` / `--verify` / `:check` that fail if a checked-in
|
|
160
|
+
generated file is out of date with its source — every backlog item that regenerates *one* gated
|
|
161
|
+
artifact must regenerate (and commit) **all** the sibling artifacts those same `--check` gates
|
|
162
|
+
depend on, or the item will pass locally yet red-gate on the stale-generated check. Verify
|
|
163
|
+
heuristically:
|
|
164
|
+
1. **Enumerate the gates.** String-scan `testCommand` for `--check`-style freshness sub-commands and
|
|
165
|
+
collect the generator/artifact each one guards (e.g. `build-benchmarks --check` guards
|
|
166
|
+
`partner-program-benchmarks`). If the command shape is unrecognized (no parseable `--check`
|
|
167
|
+
tokens), this check is **advisory / not-applicable** — never a hard fail.
|
|
168
|
+
2. **A gate with no regenerator.** If a `--check` gate guards an artifact that **no** backlog item
|
|
169
|
+
regenerates, and some item edits that artifact's *source*, flag a `gap`: the source change will
|
|
170
|
+
trip the freshness gate with nothing scheduled to refresh the output.
|
|
171
|
+
3. **Partial regeneration.** If an item regenerates a proper subset of the artifacts gated by the
|
|
172
|
+
`--check` set it touches (e.g. runs `build-partner-programs` + `build-analysis` but the gate also
|
|
173
|
+
covers `build-benchmarks`), flag an `inconsistency` naming the missing generator(s) and
|
|
174
|
+
recommending they be added to that item's execute + commit sequence. Same posture as the authoring
|
|
175
|
+
guidance in `forge-4-backlog` / rauf `author-backlog`: enumerate the whole `--check`-gated set, not
|
|
176
|
+
just the artifact the item is "about".
|
|
177
|
+
|
|
178
|
+
### Artifact Lifecycle Consistency
|
|
179
|
+
- [ ] **CHECK-B27**: **No test item forcing a lifecycle transition another item forbids** (#150).
|
|
180
|
+
*Advisory heuristic — keyword/artifact-name based; **not-applicable** when no lifecycle vocabulary is
|
|
181
|
+
present, **never** a hard fail.* A **lifecycle state** (draft / published / released / approved /
|
|
182
|
+
reviewed / signed-off / gated) is a downstream-project concept forge does not itself track — but a
|
|
183
|
+
backlog can still encode a **contradiction** about one named artifact: item A pins artifact `X` as
|
|
184
|
+
*draft* / *unpublished* / *unreviewed* while item B asserts (in its acceptance criteria or a test it
|
|
185
|
+
adds) that `X` is *published* / *released* / *approved*, with **no** publishing/review item for `X`
|
|
186
|
+
anywhere in B's dependency closure. That leaves a **test/e2e item as the only thing forcing the
|
|
187
|
+
transition** — and since the autonomous loop can neither publish a package nor stand in for a human
|
|
188
|
+
reviewer, asked to make such a test green it **fabricates** the publication or sign-off (a provenance
|
|
189
|
+
defect a `--review` pass has caught in the wild). Verify heuristically:
|
|
190
|
+
1. **Find lifecycle assertions.** Scan item titles/descriptions/`acceptanceCriteria` for a named
|
|
191
|
+
artifact paired with a lifecycle-state keyword — earlier states (`draft` / `unpublished` /
|
|
192
|
+
`pending review` / `unreleased`) vs later states (`published` / `released` / `approved` / `live` /
|
|
193
|
+
`signed-off` / `gated`). If **no** item carries such vocabulary, this check is **not-applicable**.
|
|
194
|
+
2. **Pair by artifact name.** Group assertions that reference the **same named artifact**. A pair
|
|
195
|
+
where one item requires the *earlier* state and another asserts the *later* state is a candidate.
|
|
196
|
+
3. **Check the dependency closure.** If the later-state item has **no** publish / review / human-gated
|
|
197
|
+
item for that artifact in its transitive `dependsOn`, flag an `inconsistency`: name the artifact,
|
|
198
|
+
both items, and recommend either (a) adding a `dependsOn` on an explicit human-gated publish/review
|
|
199
|
+
item that legitimately produces the state, or (b) re-asserting the state via a dev-build / fixture
|
|
200
|
+
path — never letting a test item be the sole driver of the transition (mirrors the authoring
|
|
201
|
+
guidance in `forge-4-backlog` / rauf `author-backlog`). **Report, do not repair.**
|
|
202
|
+
|
|
203
|
+
> **Anti-pattern (visible even where the heuristic can't fire):** a test/e2e item whose pass condition
|
|
204
|
+
> is "artifact `X` is published / approved / reviewed" while the backlog contains no human-gated
|
|
205
|
+
> publish or review item producing that state. The autonomous loop cannot publish or sign off on
|
|
206
|
+
> behalf of a human; asked to make such a test green it will **fabricate** the published/reviewed
|
|
207
|
+
> provenance. Any item asserting a human-gated lifecycle state must trace — via `dependsOn` — to the
|
|
208
|
+
> item that legitimately produces it, or assert the state through a dev-build / fixture path instead.
|
|
209
|
+
|
|
156
210
|
## Implementation Mode Checklist
|
|
157
211
|
|
|
158
212
|
### Spec Compliance
|
|
@@ -190,13 +244,17 @@ Detailed checklists for each verification mode. Execute EVERY check — do not s
|
|
|
190
244
|
> **When these fire:** only at impl-verify **completion** (impl mode runs post-loop), never mid-loop — an early skeleton that only compiles is not punished. **Both degrade gracefully:** a feature with no runnable surface (a pure library with no bootstrap contract) or no configured `smokeCommand` yields an **advisory not-applicable** finding, never a hard fail — the same way a null `{typeCheckCommand}` is handled. These exist because `CHECK-I01..I20` are all static reads + typecheck/lint + "tests exist"; nothing here asserts the assembled application actually **runs**. A bootstrap that is exported and unit-tested (each test calls it manually) but never wired into a runtime entrypoint passes every other check yet serves no real request (#121).
|
|
191
245
|
|
|
192
246
|
- [ ] **CHECK-I21**: **End-to-end smoke passes.** If `smokeCommand` from forge.config.json is set, execute it — it boots the wired entrypoint and drives one happy-path request end-to-end; **pass iff exit 0**. A non-zero exit is an `error` finding (the assembled app does not run — quote the command's failing output). If `smokeCommand` is `null`, this is **advisory**: emit a `not-applicable` finding recommending the user configure a `smokeCommand` so "clean" means "it runs" (never fabricate or guess a command — run only the user-configured one, exactly as `CHECK-I11` runs only a configured `{typeCheckCommand}`).
|
|
193
|
-
-
|
|
247
|
+
- **Prefer the dev runtime the developer actually uses (#149).** Recommend the configured `smokeCommand` boot the app in its **development** mode — the dev server / watch loop / HMR runtime — not only a clean production build. The failure modes that a static typecheck and a prod smoke both miss live in the dev runtime: **module-graph-identity** bugs (a "singleton" duplicated across a re-evaluated module graph, so the initialized instance and the one the request path reads are different objects) and **watch-loop** bugs (an init that fires once but never re-fires on hot reload, or fires on every reload and leaks). A prod build evaluates the graph once and hides both. When the project is served in dev during development, the `smokeCommand` should exercise that same runtime.
|
|
248
|
+
- **For a fix, re-verify in the mode the bug manifested.** When impl-verify runs after a **fix** (not a greenfield build), re-run the smoke in the **same runtime mode where the original bug appeared** — a bug reproduced in dev/watch mode is not proven fixed by a green prod-mode smoke, and vice versa. Note the mode in the finding so "smoke passed" is unambiguous about *which* runtime was exercised.
|
|
249
|
+
- [ ] **CHECK-I22**: **Runtime-required bootstrap has a non-test caller.** Every exported bootstrap / `init*` / singleton-populator the specs mark as **required for runtime** must have ≥1 **non-test** call site on a runtime path — an entrypoint such as `main` / `instrumentation` / a route / a layout / a worker, NOT only test files. Statically grep for each such symbol's references (use the stack profile `references/stacks/{stack}.md` **Runtime Entrypoints & Bootstrap-Wiring Sites** list for what counts as a runtime entrypoint in this language). A symbol that is exported and covered by tests but referenced **only** from test files is a `gap` — the #121 walking-skeleton (bootstrap wired to nothing). Degrades naturally: a feature whose specs mark no bootstrap symbol as runtime-required is `not-applicable`. Weaker than `CHECK-I21` (it proves a call site exists, not that the boot succeeds), so it complements rather than replaces the smoke.
|
|
250
|
+
- [ ] **CHECK-I23**: **Heavy bootstrap wired into a universal startup entry — recommend lazy init** (#149). *Advisory heuristic — a `gap`/`improvement` at most, **never** a hard fail.* When a runtime-required `init`/bootstrap/singleton-populator is wired into a **framework bootstrap entry that runs on every startup** (a Next.js `instrumentation.ts`, an app-server preload/`register` hook, a global setup module) **and** that init pulls in a **large server-only import graph** (DB clients, ORMs, queue/background workers, telemetry exporters, the whole service layer), recommend moving to **lazy initialization at the entry that already loads that graph** — the first route / handler / worker that needs it — rather than eager wiring at the universal entry. Eager wiring drags the heavy graph into every cold start, and in dev into every module re-evaluation (the watch-loop cost `CHECK-I21` also targets). **Detect statically:** from the stack profile's **Runtime Entrypoints & Bootstrap-Wiring Sites** list, identify this stack's universal bootstrap entries; grep those files for imports of the feature's runtime-required bootstrap symbols (`CHECK-I22`) and for the server-only heavy-import markers the profile names. A match → an `improvement`/`gap` finding naming the entry, the heavy graph it pulls, and the lazier call site to move initialization to. Degrades to `not-applicable` when the stack has no universal bootstrap entry, when no heavy init is wired there, or when the profile lists no bootstrap-wiring sites — **report, do not repair.**
|
|
194
251
|
|
|
195
252
|
## Epic Mode Checklist
|
|
196
253
|
|
|
197
254
|
Run `epic-manifest.py validate "{epic}" --specs-dir "{specsDir}" --json` once; map its
|
|
198
|
-
findings to E01/E02/E03/E08. Then perform the judgment checks E04–E07
|
|
199
|
-
manifest, EPIC.md,
|
|
255
|
+
findings to E01/E02/E03/E08. Then perform the judgment checks E04–E07, E09, and E10 by
|
|
256
|
+
reading the manifest, EPIC.md, completed members' specs, and (for E10) sibling members'
|
|
257
|
+
committed tests.
|
|
200
258
|
|
|
201
259
|
```bash
|
|
202
260
|
R="$(bash -c 'for d in "${CLAUDE_PLUGIN_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/feature-forge/* "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done')"
|
|
@@ -242,6 +300,27 @@ python3 "$R/scripts/epic-manifest.py" validate "{epic}" --specs-dir "{specsDir}"
|
|
|
242
300
|
`.blockingEpicChangeRequests`); the per-request `kind`/`target`/`rationale` detail is read
|
|
243
301
|
from the member `.pipeline-state.json` already loaded in Step 2. This is the pre-emptive
|
|
244
302
|
surface for the divergence class CHECK-E06/E07 otherwise catch only after the fact.
|
|
303
|
+
- [ ] **CHECK-E10**: **cross-member shared-state test coupling** (#144). A member that writes or
|
|
304
|
+
migrates a file a *sibling's* committed tests already pin will break the sibling's suite the
|
|
305
|
+
moment it runs — blocking every one of its own commits from a green test gate — yet nothing in
|
|
306
|
+
E04–E09 catches it (contracts cover code symbols, not shared data files). Detect it heuristically,
|
|
307
|
+
per member `M`:
|
|
308
|
+
1. **Collect `M`'s mutated paths.** Take `M`'s `mutatesShared[]` from the manifest if present
|
|
309
|
+
(the authored precision hint). If absent or empty, fall back to grepping `M`'s specs
|
|
310
|
+
(change-maps / "files this writes") and backlog item `execute` steps for project-root-relative
|
|
311
|
+
paths it creates, writes, or migrates (data corpora, generated fixtures, migration outputs —
|
|
312
|
+
not `M`'s own source modules or its own tests).
|
|
313
|
+
2. **Grep sibling tests for reads of those paths.** For every *other* member `S` that is already
|
|
314
|
+
**`complete`** (derived status — its regression suite is live and gating), grep `S`'s committed
|
|
315
|
+
**test** files/globs for a read/import/load of any path in step 1. Use the stack profile
|
|
316
|
+
(`references/stacks/{stack}.md`) for what a test glob looks like in this language.
|
|
317
|
+
3. **Emit the finding.** A hit → a non-fatal `inconsistency` finding: name `M`, the shared path,
|
|
318
|
+
the sibling `S` and the specific test, and **recommend a reconciliation backlog item** on `M`
|
|
319
|
+
(regenerate/re-pin `S`'s fixture, or update `S`'s test to the new shape) scheduled *before*
|
|
320
|
+
`M`'s first mutating item — so the coupling is planned, not discovered mid-loop on a red gate.
|
|
321
|
+
**Report, do not repair** (same posture as CHECK-E07/E09). Degrades to a clean no-op when no
|
|
322
|
+
member declares or greps a shared write, or when no completed sibling reads it — never a
|
|
323
|
+
spurious hard-fail.
|
|
245
324
|
|
|
246
325
|
## Findings Document Template (Step 4)
|
|
247
326
|
|
|
@@ -74,6 +74,11 @@
|
|
|
74
74
|
"type": "array",
|
|
75
75
|
"items": { "$ref": "#/definitions/consumedContract" },
|
|
76
76
|
"description": "What this feature relies on from its dependencies (REQ-EPIC-03). May be empty."
|
|
77
|
+
},
|
|
78
|
+
"mutatesShared": {
|
|
79
|
+
"type": "array",
|
|
80
|
+
"items": { "type": "string" },
|
|
81
|
+
"description": "OPTIONAL precision hint for cross-member coupling detection (#144): project-root-relative file/glob paths this feature writes or migrates that are shared across the epic (e.g. a corpus a sibling's tests pin). When present, forge-verify CHECK-E10 uses it directly; when absent, CHECK-E10 falls back to grepping specs/backlog for mutated paths. Not a dependency edge — declarative only. May be omitted entirely."
|
|
77
82
|
}
|
|
78
83
|
}
|
|
79
84
|
},
|
|
@@ -274,6 +274,18 @@ This write is **left uncommitted**: it is staged and committed as part of this s
|
|
|
274
274
|
|
|
275
275
|
**Incremental artifact tracking:** When a stage writes multiple files (e.g. forge-3-specs writing a suite of spec documents), update the `stages.{stage}.artifacts` array in `.pipeline-state.json` after writing each file — not just at stage completion. This is what makes the Interrupted inventory above precise about which files were successfully written.
|
|
276
276
|
|
|
277
|
+
## Stage-Completion Re-check
|
|
278
|
+
|
|
279
|
+
Invoke this block **at the head of any post-entry step that writes a stage artifact or runs the Scripted Stage Exit** — the Stage-Entry Guard runs only once, at the top of the skill. A **resumed or pasted mid-stage instruction** (e.g. "continue {stage}: write TRACEABILITY.md, run the stage exit") enters *below* the entry guard, so nothing re-checks completion before it overwrites a committed artifact and re-fires a finished exit — data-destructive if followed literally. This re-check is the idempotency backstop for that path. `{stage}` is the invoking skill's id.
|
|
280
|
+
|
|
281
|
+
**Re-read** `stages.{stage}` in `{resolvedFeatureDir}/.pipeline-state.json`, then classify by **provenance** — a legitimate completion runs in the same session that applied this stage's Entry Stamp; a replayed continuation finds a finished stage it did not produce:
|
|
282
|
+
|
|
283
|
+
1. **Proceed** when `stages.{stage}.status` is `"in-progress"` (this session's Entry Stamp — you are finishing the run you started) or absent/`pending`. Run the write / exit normally.
|
|
284
|
+
|
|
285
|
+
2. **Detect-and-refuse** when ALL of these hold: `stages.{stage}.status ∈ {"complete", "stale"}` **AND** the stage's artifacts (incl. `TRACEABILITY.md` for forge-3-specs) exist on disk **AND** a `commitHash` is recorded for the stage **AND** you did **not** author this stage earlier in the current session. This is a stale/replayed continuation of an already-finished, committed stage. Do **not** overwrite the artifact or re-run the exit. Route instead to the **Stage-Entry Guard**'s *Re-authoring* path: surface the same `AskUserQuestion` warning ("A completed {stage} artifact already exists for '{feature}' (v{n}{, marked stale}). Continuing will create a new version. Proceed?"). Only on explicit confirmation re-enter from the Entry Stamp (the version bumps at exit); otherwise **stop** and report that the stage is already complete — cite the recorded `commitHash` and offer `/feature-forge:forge {feature}` to see true state.
|
|
286
|
+
|
|
287
|
+
When you cannot confirm you authored the current run, treat it as a replay and refuse: a false refuse costs one confirmation click; a false proceed overwrites a committed artifact and re-churns a stage version. `--force` follows Force Mode (skip the gate, treat as a deliberate re-author).
|
|
288
|
+
|
|
277
289
|
## Force Mode
|
|
278
290
|
|
|
279
291
|
If the user passes `--force` as an argument, skip prerequisite validation with a warning:
|
|
@@ -79,6 +79,27 @@ Replace stack-specific checks with these generic equivalents:
|
|
|
79
79
|
| "JSDoc on every field" | "Documentation comments on every field" |
|
|
80
80
|
| "tsconfig.json extends root" | "Build configuration follows project conventions" |
|
|
81
81
|
|
|
82
|
+
### Runtime Entrypoints & Bootstrap-Wiring Sites
|
|
83
|
+
|
|
84
|
+
Used by `CHECK-I22` (a runtime-required bootstrap needs a **non-test** caller on one of these) and
|
|
85
|
+
`CHECK-I23` (a heavy init wired into a **universal** bootstrap entry should move to a lazier site).
|
|
86
|
+
Since no dedicated profile applies, identify these by role rather than exact filename:
|
|
87
|
+
|
|
88
|
+
- **Runtime entrypoints (a legitimate non-test call site):** the process/main entry the build's
|
|
89
|
+
run command actually launches (from the CI/`Makefile`/manifest "start" target), an HTTP/RPC handler
|
|
90
|
+
or route, a scheduled/worker task, or a CLI subcommand — **not** a file in the project's test
|
|
91
|
+
directory or matching its test-file convention.
|
|
92
|
+
- **Universal bootstrap entries (run on every startup — the `CHECK-I23` risk site):** any
|
|
93
|
+
module/hook the framework runs **once per process before serving** — a startup/lifecycle hook, an
|
|
94
|
+
import-time initializer, a global preload, or a shared test-setup module that bootstraps production
|
|
95
|
+
graphs. Side effects here run on every process start (and, under a dev/watch runtime, on every
|
|
96
|
+
reload).
|
|
97
|
+
- **Heavy server-only import markers (what makes an init "heavy" for `CHECK-I23`):** database/ORM
|
|
98
|
+
clients and connection pools, message/queue clients, telemetry/observability SDKs, or a broad
|
|
99
|
+
whole-service-layer import. An init pulling any of these into a universal bootstrap entry is the
|
|
100
|
+
CHECK-I23 pattern — recommend lazy initialization at the first handler/worker that needs the graph,
|
|
101
|
+
not eagerly at process start.
|
|
102
|
+
|
|
82
103
|
## Acceptance Criteria Patterns
|
|
83
104
|
|
|
84
105
|
Use these placeholder patterns in backlog items. Replace `{typeCheckCommand}`, `{testCommand}`, and `{module}` with values from `forge.config.json` and the project structure:
|