@entelligentsia/forgecli 1.1.0 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +4 -0
  3. package/dist/CHANGELOG-forge-plugin.md +114 -0
  4. package/dist/extensions/forgecli/forge-subagent.js +58 -0
  5. package/dist/extensions/forgecli/forge-subagent.js.map +1 -1
  6. package/dist/extensions/forgecli/orchestrators/init/init-phase-dispatch.d.ts +49 -40
  7. package/dist/extensions/forgecli/orchestrators/init/init-phase-dispatch.js +59 -188
  8. package/dist/extensions/forgecli/orchestrators/init/init-phase-dispatch.js.map +1 -1
  9. package/dist/extensions/forgecli/orchestrators/init/init-phases.d.ts +0 -43
  10. package/dist/extensions/forgecli/orchestrators/init/init-phases.js +11 -59
  11. package/dist/extensions/forgecli/orchestrators/init/init-phases.js.map +1 -1
  12. package/dist/extensions/forgecli/orchestrators/init/init-steps.d.ts +115 -0
  13. package/dist/extensions/forgecli/orchestrators/init/init-steps.js +125 -0
  14. package/dist/extensions/forgecli/orchestrators/init/init-steps.js.map +1 -0
  15. package/dist/extensions/forgecli/orchestrators/init/run-init-pipeline.js +400 -211
  16. package/dist/extensions/forgecli/orchestrators/init/run-init-pipeline.js.map +1 -1
  17. package/dist/extensions/forgecli/orchestrators/init/run-init-types.d.ts +8 -2
  18. package/dist/extensions/forgecli/orchestrators/init/run-init-types.js +15 -5
  19. package/dist/extensions/forgecli/orchestrators/init/run-init-types.js.map +1 -1
  20. package/dist/forge-payload/.base-pack/workflows-js/wfl-init.js +99 -38
  21. package/dist/forge-payload/.claude-plugin/plugin.json +1 -1
  22. package/dist/forge-payload/.init/generation/generate-kb-doc.md +24 -0
  23. package/dist/forge-payload/.schemas/migrations.json +77 -0
  24. package/dist/forge-payload/init/generation/generate-kb-doc.md +24 -0
  25. package/dist/forge-payload/init/phases/phase-2/context.md +23 -0
  26. package/dist/forge-payload/init/phases/phase-2/database.md +26 -0
  27. package/dist/forge-payload/init/phases/phase-2/deployment.md +26 -0
  28. package/dist/forge-payload/init/phases/phase-2/domain-concepts.md +26 -0
  29. package/dist/forge-payload/init/phases/phase-2/domain-model.md +26 -0
  30. package/dist/forge-payload/init/phases/phase-2/entity-model.md +26 -0
  31. package/dist/forge-payload/init/phases/phase-2/index.md +25 -0
  32. package/dist/forge-payload/init/phases/phase-2/processes.md +26 -0
  33. package/dist/forge-payload/init/phases/phase-2/routing.md +25 -0
  34. package/dist/forge-payload/init/phases/phase-2/stack-checklist.md +25 -0
  35. package/dist/forge-payload/init/phases/phase-2/stack.md +27 -0
  36. package/dist/forge-payload/init/phases/phase-2/testing.md +26 -0
  37. package/dist/forge-payload/init/phases/phase-2-discover.md +15 -9
  38. package/dist/forge-payload/payload-manifest.json +2 -2
  39. package/dist/forge-payload/tools/seed-store.cjs +14 -0
  40. package/dist/forge-payload/tools/verify-phase.cjs +61 -4
  41. package/node_modules/@earendil-works/pi-coding-agent/npm-shrinkwrap.json +6 -6
  42. package/package.json +2 -2
@@ -0,0 +1,26 @@
1
+ <!-- kb-doc-fragment: domain-concepts -->
2
+ # Substance — `business-domain/domain-concepts`
3
+
4
+ **Output path:** `{kbFolder}/business-domain/domain-concepts.md`
5
+
6
+ **Topic focus:** the ubiquitous language — the core domain concepts, terms, and
7
+ vocabulary the project uses, with precise definitions. Describe *the words the
8
+ team uses and what they mean*, so a newcomer can read the codebase's language.
9
+
10
+ **Discovery input to read:** all Phase-1 discovery findings, mined for recurring
11
+ domain vocabulary (names of entities, states, actions, roles). Lean on the
12
+ `database` and `routing` findings for the richest terminology.
13
+
14
+ **Required output:**
15
+ - Confidence header on line 1.
16
+ - A glossary: each core concept/term with a one-to-two-sentence definition.
17
+ - Note synonyms and any terms with a project-specific (non-obvious) meaning.
18
+ - Concepts only — no field types or route tables (those are other docs).
19
+
20
+ **Not applicable:** if no distinct domain vocabulary emerges, the topic is *absent*
21
+ — a certainty, not a low-confidence guess. Write a **confident** not-applicable
22
+ stub: line 1 is
23
+ `<!-- AUTO-GENERATED by /forge:init — confidence: 100% — status: not-applicable -->`,
24
+ then the `# Domain Concepts` heading and the one-sentence absence statement `No
25
+ specialized domain vocabulary — this project uses only general programming terms.`
26
+ Do NOT lower confidence — an absent topic is known with certainty.
@@ -0,0 +1,26 @@
1
+ <!-- kb-doc-fragment: domain-model -->
2
+ # Substance — `business-domain/domain-model`
3
+
4
+ **Output path:** `{kbFolder}/business-domain/domain-model.md`
5
+
6
+ **Topic focus:** the *conceptual* business model — the real-world entities the
7
+ system represents, their relationships, and the business invariants/rules that
8
+ govern them. This is business meaning, distinct from `entity-model`'s technical
9
+ field inventory.
10
+
11
+ **Discovery input to read:** the `database` domain findings from Phase 1, read
12
+ through a business lens (what does each stored thing *mean* to the domain).
13
+
14
+ **Required output:**
15
+ - Confidence header on line 1.
16
+ - Business entities with their conceptual purpose (not field types).
17
+ - Relationships expressed in domain terms (e.g. "a Sprint owns many Tasks").
18
+ - Business invariants and rules (e.g. "a Task cannot be committed before approval").
19
+ - Entity names exactly as in the brief's `## Domain Entities`.
20
+
21
+ **Not applicable:** if the project has no discernible business domain (e.g. a
22
+ pure tool/utility), the topic is *absent* — a certainty, not a low-confidence
23
+ guess. Write a **confident** not-applicable stub: line 1 is
24
+ `<!-- AUTO-GENERATED by /forge:init — confidence: 100% — status: not-applicable -->`,
25
+ then the `# Domain Model` heading and the one-sentence absence statement `No
26
+ business domain — this is a technical utility with no domain entities.` Do NOT lower confidence — an absent topic is known with certainty.
@@ -0,0 +1,26 @@
1
+ <!-- kb-doc-fragment: entity-model -->
2
+ # Substance — `architecture/entity-model`
3
+
4
+ **Output path:** `{kbFolder}/architecture/entity-model.md`
5
+
6
+ **Topic focus:** the *technical* inventory of what is stored — every entity with
7
+ its full field list, types, and structural relationships as they exist in code.
8
+ This is the exhaustive structural catalogue; `domain-model` is its conceptual,
9
+ business-facing counterpart.
10
+
11
+ **Discovery input to read:** the `database` domain findings from Phase 1 (models,
12
+ schema definitions, type declarations).
13
+
14
+ **Required output:**
15
+ - Confidence header on line 1.
16
+ - One section per entity with the complete field inventory (name, type, nullability).
17
+ - Structural relationships (FK, embedding, references).
18
+ - Entity names used exactly as they appear in the brief's `## Domain Entities`.
19
+ - Technical inventory only — no business invariants (those live in `domain-model`).
20
+
21
+ **Not applicable:** if nothing is stored, the topic is *absent* — a certainty,
22
+ not a low-confidence guess. Write a **confident** not-applicable stub: line 1 is
23
+ `<!-- AUTO-GENERATED by /forge:init — confidence: 100% — status: not-applicable -->`,
24
+ then the `# Entity Model` heading and the one-sentence absence statement `No
25
+ entities — this project persists no structured data.` Do NOT lower confidence
26
+ — an absent topic is known with certainty.
@@ -0,0 +1,25 @@
1
+ <!-- kb-doc-fragment: index -->
2
+ # Substance — `index` step
3
+
4
+ **Output paths:** `{kbFolder}/architecture/INDEX.md`,
5
+ `{kbFolder}/business-domain/INDEX.md`, and `{kbFolder}/MASTER_INDEX.md`.
6
+
7
+ **Topic focus:** build the navigation indexes that link the KB docs already
8
+ written to disk. You run *after* all 10 leaf docs exist. Describe *how to
9
+ navigate the knowledge base*, linking only what is present.
10
+
11
+ **Discovery input to read:** the filesystem — list the docs actually written
12
+ under `architecture/` and `business-domain/`. Do NOT anticipate files that were
13
+ not produced.
14
+
15
+ **Required output:**
16
+ 1. `architecture/INDEX.md` — list and link every architecture doc on disk.
17
+ 2. `business-domain/INDEX.md` — list and link `domain-model.md` and
18
+ `domain-concepts.md` if present.
19
+ 3. `MASTER_INDEX.md` — link both INDEX files and include a `## Domain Entities`
20
+ section listing discovered entities, one per line.
21
+ - Link **only** docs that exist on disk at write time (AC3).
22
+ - Confidence header on the first line of each written index.
23
+
24
+ **Not applicable:** never fully skipped — if a section has no docs, write the
25
+ index with an explicit `(none generated)` note rather than a broken link.
@@ -0,0 +1,26 @@
1
+ <!-- kb-doc-fragment: processes -->
2
+ # Substance — `architecture/processes`
3
+
4
+ **Output path:** `{kbFolder}/architecture/processes.md`
5
+
6
+ **Topic focus:** the runnable processes and build/deploy topology — services,
7
+ daemons, workers, entry points, and the commands that build, start, and run
8
+ them. Describe *what runs* and *how it is built*, not the deployment targets.
9
+
10
+ **Discovery input to read:** the `processes` domain findings from Phase 1
11
+ (entry points, scripts, service definitions, build commands). Cross-reference
12
+ `stack` for the build tool.
13
+
14
+ **Required output:**
15
+ - Confidence header on line 1.
16
+ - Each service/process with its entry point and start command.
17
+ - Build pipeline steps in order.
18
+ - Inter-process relationships (who calls/spawns whom), if any.
19
+ - No CI/CD or environment content — that is `deployment`.
20
+
21
+ **Not applicable:** if the project defines no runnable processes (e.g. a library
22
+ with no service), the topic is *absent* — a certainty, not a low-confidence guess.
23
+ Write a **confident** not-applicable stub: line 1 is
24
+ `<!-- AUTO-GENERATED by /forge:init — confidence: 100% — status: not-applicable -->`,
25
+ then the `# Processes` heading and the one-sentence absence statement `No standalone
26
+ processes — this is a library/package consumed by other code.` Do NOT lower confidence — an absent topic is known with certainty.
@@ -0,0 +1,25 @@
1
+ <!-- kb-doc-fragment: routing -->
2
+ # Substance — `architecture/routing`
3
+
4
+ **Output path:** `{kbFolder}/architecture/routing.md`
5
+
6
+ **Topic focus:** the API/route surface — endpoints or command surface, route
7
+ groups, HTTP methods (or CLI verbs), and the auth/authorization strategy that
8
+ gates them. Describe *how the system is entered*, not what it stores.
9
+
10
+ **Discovery input to read:** the `routing` domain findings from Phase 1 (route
11
+ definitions, controllers, handlers, middleware, auth guards).
12
+
13
+ **Required output:**
14
+ - Confidence header on line 1.
15
+ - Route/endpoint groups with methods and paths (or CLI command surface).
16
+ - Auth strategy and where it is enforced.
17
+ - Middleware / interceptors in the request path.
18
+ - No persistence or deployment content.
19
+
20
+ **Not applicable:** if the project exposes no routes or command surface (e.g. a
21
+ pure library), the topic is *absent* — a certainty, not a low-confidence guess.
22
+ Write a **confident** not-applicable stub: line 1 is
23
+ `<!-- AUTO-GENERATED by /forge:init — confidence: 100% — status: not-applicable -->`,
24
+ then the `# Routing` heading and the one-sentence absence statement `No routing
25
+ surface — this project exposes no HTTP routes or command entry points.` Do NOT lower confidence — an absent topic is known with certainty.
@@ -0,0 +1,25 @@
1
+ <!-- kb-doc-fragment: stack-checklist -->
2
+ # Substance — `architecture/stack-checklist`
3
+
4
+ **Output path:** `{kbFolder}/architecture/stack-checklist.md`
5
+
6
+ **Topic focus:** an actionable review checklist derived from the stack and
7
+ testing facts — the concrete gates a change in this codebase must pass (syntax
8
+ check, lint, test, build, type-check commands). Describe *what to verify before
9
+ a change is considered done*.
10
+
11
+ **Discovery input to read:** the `stack` and `testing` domain findings from
12
+ Phase 1 (build tool, linter, type checker, test runner, their commands).
13
+
14
+ **Required output:**
15
+ - Confidence header on line 1.
16
+ - A checklist of verification steps, each with its exact command.
17
+ - Ordered from cheapest (syntax) to most expensive (full suite/build).
18
+ - Derived strictly from stack + testing facts — no invented tooling.
19
+
20
+ **Not applicable:** if no verification tooling exists, the topic is *absent* — a
21
+ certainty, not a low-confidence guess. Write a **confident** not-applicable stub:
22
+ line 1 is
23
+ `<!-- AUTO-GENERATED by /forge:init — confidence: 100% — status: not-applicable -->`,
24
+ then the `# Stack Checklist` heading and the one-sentence absence statement `No
25
+ verification tooling detected — no automated checklist can be derived.` Do NOT lower confidence — an absent topic is known with certainty.
@@ -0,0 +1,27 @@
1
+ <!-- kb-doc-fragment: stack -->
2
+ # Substance — `architecture/stack`
3
+
4
+ **Output path:** `{kbFolder}/architecture/stack.md`
5
+
6
+ **Topic focus:** the technology stack — languages and their versions, frameworks
7
+ and major libraries, the runtime/interpreter, package manager, and the build
8
+ toolchain. Describe *what the project is built with*, not how it is deployed.
9
+
10
+ **Discovery input to read:** the `stack` domain findings from Phase 1
11
+ (languages, dependency manifests, lockfiles, runtime versions). Cross-reference
12
+ the `testing` findings only for the test-runner dependency.
13
+
14
+ **Required output:**
15
+ - Confidence header on line 1.
16
+ - A languages/versions table or list (each fact `[?]`-marked if not directly observed).
17
+ - Frameworks & major libraries with their roles.
18
+ - Runtime + package manager + build tool.
19
+ - No deployment, routing, or schema content — those are other docs.
20
+
21
+ **Not applicable:** if the project has no identifiable stack (e.g. an empty or
22
+ docs-only repo), the topic is *absent* — a certainty, not a low-confidence guess.
23
+ Write a **confident** not-applicable stub: line 1 is
24
+ `<!-- AUTO-GENERATED by /forge:init — confidence: 100% — status: not-applicable -->`,
25
+ then the `# Stack` heading and the one-sentence absence statement `No application
26
+ stack detected — this repository contains no build- or runtime-bearing sources.`
27
+ Do NOT lower confidence — an absent topic is known with certainty.
@@ -0,0 +1,26 @@
1
+ <!-- kb-doc-fragment: testing -->
2
+ # Substance — `architecture/testing`
3
+
4
+ **Output path:** `{kbFolder}/architecture/testing.md`
5
+
6
+ **Topic focus:** the test strategy — frameworks and runners, the exact command
7
+ to run the suite, test layout (unit/integration/e2e), and coverage tooling.
8
+ Describe *how the project is verified*.
9
+
10
+ **Discovery input to read:** the `testing` domain findings from Phase 1 (test
11
+ directories, test frameworks, runner config, coverage config). Cross-reference
12
+ `stack` for the runner dependency version.
13
+
14
+ **Required output:**
15
+ - Confidence header on line 1.
16
+ - Test framework(s) and the resolved run command (from `commands.test`).
17
+ - Test layout and naming conventions.
18
+ - Coverage tool and threshold, if any.
19
+ - No CI wiring — that is `deployment`.
20
+
21
+ **Not applicable:** if the project has no tests, the topic is *absent* — a
22
+ certainty, not a low-confidence guess. Write a **confident** not-applicable stub:
23
+ line 1 is
24
+ `<!-- AUTO-GENERATED by /forge:init — confidence: 100% — status: not-applicable -->`,
25
+ then the `# Testing` heading and the one-sentence absence statement `No test suite
26
+ detected — this project currently has no automated tests.` Do NOT lower confidence — an absent topic is known with certainty.
@@ -1,6 +1,6 @@
1
1
  # Phase 2 — Discover
2
2
 
3
- **Deliverable:** 7 KB architecture docs + 3 index files + `project-context.json` + calibration baseline.
3
+ **Deliverable:** 10 KB docs (8 architecture + 2 business-domain) + 3 index files + `project-context.json` + calibration baseline.
4
4
 
5
5
  Set `$FORGE_ROOT` and resolve `$KB_PATH` from `.forge/config.json`:
6
6
 
@@ -49,31 +49,37 @@ touch "{KB_PATH}/sprints/.gitkeep" "{KB_PATH}/bugs/.gitkeep" \
49
49
 
50
50
  Read `$FORGE_ROOT/init/generation/generate-kb-doc.md` once (the per-subagent rulebook).
51
51
 
52
- Generate all 7 knowledge-base documents. For each document, analyse the
52
+ Generate all 10 knowledge-base documents. For each document, analyse the
53
53
  project codebase for that topic and write to its output path. After writing
54
54
  each document, read it back and verify the confidence header is present
55
55
  (`<!-- AUTO-GENERATED — confidence: NN% -->`).
56
56
 
57
+ Output paths below are the canonical `{KB_PATH}/{docId}.md` targets for the
58
+ shared 10-doc contract (verify-phase.cjs `--phase 2` checks exactly these).
59
+
57
60
  | Document | Output path | Focus |
58
61
  |----------|-------------|-------|
59
62
  | stack.md | `{KB_PATH}/architecture/stack.md` | Languages, frameworks, runtime, versions |
60
63
  | processes.md | `{KB_PATH}/architecture/processes.md` | Services, build/deploy topology |
61
- | database.md | `{KB_PATH}/architecture/database.md` | Entities, relationships, field types |
62
64
  | routing.md | `{KB_PATH}/architecture/routing.md` | API surface, route groups, auth strategy |
65
+ | database.md | `{KB_PATH}/architecture/database.md` | Entities, relationships, field types |
66
+ | testing.md | `{KB_PATH}/architecture/testing.md` | Test frameworks, run commands, coverage |
63
67
  | deployment.md | `{KB_PATH}/architecture/deployment.md` | Environments, CI/CD, infra targets |
64
- | entity-model.md | `{KB_PATH}/business-domain/entity-model.md` | Full entity inventory with fields |
65
- | stack-checklist.md | `{KB_PATH}/stack-checklist.md` | Review checklist items from stack + testing |
68
+ | entity-model.md | `{KB_PATH}/architecture/entity-model.md` | Full entity inventory with fields |
69
+ | stack-checklist.md | `{KB_PATH}/architecture/stack-checklist.md` | Review checklist items from stack + testing |
70
+ | domain-model.md | `{KB_PATH}/business-domain/domain-model.md` | Business entities, relationships, invariants |
71
+ | domain-concepts.md | `{KB_PATH}/business-domain/domain-concepts.md` | Ubiquitous language, core domain concepts |
66
72
 
67
- You may spawn all 7 as parallel subagents in a single Agent tool message for speed.
68
- Wait for all 7 to return. Retry any that returned FAILED: once.
73
+ You may spawn all 10 as parallel subagents in a single Agent tool message for speed.
74
+ Wait for all 10 to return. Retry any that returned FAILED: once.
69
75
  Any still failing after one retry: halt and surface the id list.
70
76
 
71
77
  ### Step 4 — Create index files (sequential)
72
78
 
73
79
  After all leaf docs are written:
74
80
 
75
- 1. **`{KB_PATH}/architecture/INDEX.md`** — list and link to the 5 architecture docs
76
- 2. **`{KB_PATH}/business-domain/INDEX.md`** — list and link to entity-model.md
81
+ 1. **`{KB_PATH}/architecture/INDEX.md`** — list and link to the 8 architecture docs
82
+ 2. **`{KB_PATH}/business-domain/INDEX.md`** — list and link to domain-model.md and domain-concepts.md
77
83
  3. **`{KB_PATH}/MASTER_INDEX.md`** — scaffold linking both INDEX files; include
78
84
  `## Domain Entities` section listing discovered entities (one per line)
79
85
 
@@ -210,10 +210,10 @@
210
210
  "install": ".forge/init/phases/",
211
211
  "owner": "forge-scaffold",
212
212
  "select": {
213
- "recursive": false,
213
+ "recursive": true,
214
214
  "ext": [".md"]
215
215
  },
216
- "note": "Init rulebook phase prompts read by run-phases.ts / wfl-init.js (build-payload Pass-2 2e-pre)."
216
+ "note": "Init rulebook phase prompts read by run-phases.ts / wfl-init.js (build-payload Pass-2 2e-pre). Recursive so the phase-2/ per-step substance fragments (index.md, context.md, and the 10 KB-doc fragments) vendor into .forge/init/phases/phase-2/ — wfl-init.js references them literally (FORGE-S35-T06 / Slice 5)."
217
217
  },
218
218
  {
219
219
  "source": "init/discovery",
@@ -215,6 +215,20 @@ try {
215
215
  }
216
216
  }
217
217
 
218
+ // Always lay down the store skeleton — a COLLATION_STATE.json baseline is
219
+ // written even when zero entities are seeded, so a fresh `/forge:init`
220
+ // leaves a consistent `.forge/store/` (dir + watermark) instead of nothing.
221
+ // The next real `/forge:collate` overwrites this with live counts.
222
+ if (!DRY_RUN) {
223
+ Store.writeCollationState({
224
+ collatedAt: new Date().toISOString(),
225
+ featureCount: 0,
226
+ sprintCount,
227
+ taskCount,
228
+ bugCount,
229
+ });
230
+ }
231
+
218
232
  const prefix_ = DRY_RUN ? '[dry-run] ' : '';
219
233
  console.log(`${prefix_}Seeded: ${sprintCount} sprint(s), ${taskCount} task(s), ${bugCount} bug(s)`);
220
234
  } catch (e) {
@@ -166,19 +166,76 @@ function verifyPhase1Foundation(cwd) {
166
166
  };
167
167
  }
168
168
 
169
- // ── Phase 2: KB architecture docs verification ────────────────────────────────
169
+ // ── Phase 2: KB documents verification ────────────────────────────────────────
170
170
 
171
- const ARCH_DOCS = ['stack', 'processes', 'database', 'routing', 'deployment', 'entity-model', 'stack-checklist'];
171
+ // The canonical 10-doc KB contract (FORGE-S35-T01). docIds carry their KB folder
172
+ // prefix (architecture/ or business-domain/); the gate resolves each as
173
+ // {kbPath}/{docId}.md — no hardcoded architecture/ prefix.
174
+ //
175
+ // DRIFT-GUARD: this list MUST stay byte-identical (same items, same order) to
176
+ // KB_DOC_IDS in init/base-pack/workflows-js/wfl-init.js and in forge-cli's
177
+ // run-init-types.ts. Asserted by tools/__tests__/kb-doc-contract.test.cjs.
178
+ const ARCH_DOCS = [
179
+ 'architecture/stack',
180
+ 'architecture/processes',
181
+ 'architecture/routing',
182
+ 'architecture/database',
183
+ 'architecture/testing',
184
+ 'architecture/deployment',
185
+ 'architecture/entity-model',
186
+ 'architecture/stack-checklist',
187
+ 'business-domain/domain-model',
188
+ 'business-domain/domain-concepts',
189
+ ];
190
+
191
+ // A doc satisfies the gate when it exists AND carries a confidence-header token.
192
+ // Keyed on the `confidence: N%` token only (real digit required, case-
193
+ // insensitive) so BOTH in-tree header forms pass:
194
+ // <!-- AUTO-GENERATED by /forge:init — confidence: 85% --> (generate-kb-doc.md Rule 2)
195
+ // <!-- AUTO-GENERATED — confidence: 85% --> (phase-2-discover.md Step 3)
196
+ const CONFIDENCE_HEADER = /confidence:\s*\d+%/i;
197
+
198
+ // A not-applicable topic is a certainty, not a guess: an absent-topic stub is a
199
+ // confident (100%) doc carrying this marker (FORGE-S35-T04 / Slice 3). The marker
200
+ // may live inside the AUTO-GENERATED header comment or in the body. A doc bearing
201
+ // it satisfies the substantive-OR-not-applicable gate even with no other body.
202
+ const STATUS_NOT_APPLICABLE = /status:\s*not-applicable/i;
203
+
204
+ // Strip HTML comments (the AUTO-GENERATED confidence/status header lives in one)
205
+ // so a doc that is nothing but its header is recognised as empty.
206
+ const HTML_COMMENT = /<!--[\s\S]*?-->/g;
172
207
 
173
208
  function verifyPhase2(cwd, kbPath) {
174
209
  const missing = [];
175
210
  const checked = [];
176
211
 
177
212
  for (const doc of ARCH_DOCS) {
178
- const rel = path.join(kbPath, 'architecture', `${doc}.md`);
213
+ const rel = path.join(kbPath, `${doc}.md`);
179
214
  checked.push(rel);
180
- if (!fs.existsSync(path.join(cwd, rel))) {
215
+ const abs = path.join(cwd, rel);
216
+ if (!fs.existsSync(abs)) {
181
217
  missing.push(rel);
218
+ continue;
219
+ }
220
+ let content = '';
221
+ try {
222
+ content = fs.readFileSync(abs, 'utf8');
223
+ } catch {
224
+ content = '';
225
+ }
226
+ if (!CONFIDENCE_HEADER.test(content)) {
227
+ missing.push(`${rel} (no confidence header)`);
228
+ continue;
229
+ }
230
+ // Substantive-OR-not-applicable gate (FORGE-S35-T04): a doc passes iff it
231
+ // carries a `status: not-applicable` marker OR has non-empty body content
232
+ // after the header. Header-only/empty docs are rejected. Completeness stays
233
+ // ADVISORY — no confidence-percentage threshold, no entity-count bar — so an
234
+ // entity-less/library project passes with confident not-applicable stubs.
235
+ const hasNotApplicable = STATUS_NOT_APPLICABLE.test(content);
236
+ const body = content.replace(HTML_COMMENT, '').trim();
237
+ if (!hasNotApplicable && body.length === 0) {
238
+ missing.push(`${rel} (empty — no substance and no status: not-applicable marker)`);
182
239
  }
183
240
  }
184
241
 
@@ -474,8 +474,8 @@
474
474
  }
475
475
  },
476
476
  "node_modules/@earendil-works/pi-agent-core": {
477
- "version": "0.80.2-forge.1",
478
- "resolved": "https://registry.npmjs.org/@earendil-works/pi-agent-core/-/pi-agent-core-0.80.2-forge.1.tgz",
477
+ "version": "0.80.2",
478
+ "resolved": "https://registry.npmjs.org/@earendil-works/pi-agent-core/-/pi-agent-core-0.80.2.tgz",
479
479
  "license": "MIT",
480
480
  "dependencies": {
481
481
  "@earendil-works/pi-ai": "^0.80.2",
@@ -488,8 +488,8 @@
488
488
  }
489
489
  },
490
490
  "node_modules/@earendil-works/pi-ai": {
491
- "version": "0.80.2-forge.1",
492
- "resolved": "https://registry.npmjs.org/@earendil-works/pi-ai/-/pi-ai-0.80.2-forge.1.tgz",
491
+ "version": "0.80.2",
492
+ "resolved": "https://registry.npmjs.org/@earendil-works/pi-ai/-/pi-ai-0.80.2.tgz",
493
493
  "license": "MIT",
494
494
  "dependencies": {
495
495
  "@anthropic-ai/sdk": "0.91.1",
@@ -512,8 +512,8 @@
512
512
  }
513
513
  },
514
514
  "node_modules/@earendil-works/pi-tui": {
515
- "version": "0.80.2-forge.1",
516
- "resolved": "https://registry.npmjs.org/@earendil-works/pi-tui/-/pi-tui-0.80.2-forge.1.tgz",
515
+ "version": "0.80.2",
516
+ "resolved": "https://registry.npmjs.org/@earendil-works/pi-tui/-/pi-tui-0.80.2.tgz",
517
517
  "license": "MIT",
518
518
  "dependencies": {
519
519
  "get-east-asian-width": "1.6.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@entelligentsia/forgecli",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Forge SDLC ported onto @earendil-works/pi-coding-agent — production launcher with three bin aliases (forge/forgecli/4ge). Bundles a curated fork of pi-coding-agent vendored under earendil-works names.",
5
5
  "license": "MIT",
6
6
  "author": "Entelligentsia",
@@ -49,7 +49,7 @@
49
49
  ]
50
50
  },
51
51
  "forge": {
52
- "bundledVersion": "1.4.4",
52
+ "bundledVersion": "1.6.10",
53
53
  "forgeRoot": "../forge/forge"
54
54
  },
55
55
  "scripts": {