@warpgogol/forge 2.8.0 → 2.8.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.
- package/AGENTS.md +1 -1
- package/README.md +23 -13
- package/README.uk.md +19 -12
- package/dist/os/session/handlers/validate.d.ts.map +1 -1
- package/dist/os/session/handlers/validate.js +23 -1
- package/dist/os/session/handlers/validate.js.map +1 -1
- package/dist/os/session/types.d.ts +31 -1
- package/dist/os/session/types.d.ts.map +1 -1
- package/dist/os/session/types.js +7 -0
- package/dist/os/session/types.js.map +1 -1
- package/os/adr/adr.module.ts +158 -0
- package/os/adr/frontmatter-io.ts +80 -0
- package/os/adr/handlers/archive.ts +244 -0
- package/os/adr/handlers/implement-stamp.ts +331 -0
- package/os/adr/handlers/list-create.ts +207 -0
- package/os/adr/handlers/validate.test.ts +232 -0
- package/os/adr/handlers/validate.ts +429 -0
- package/os/adr/index.ts +33 -0
- package/os/adr/types.ts +141 -0
- package/os/audit/audit.module.ts +48 -0
- package/os/audit/frontmatter-io.ts +84 -0
- package/os/audit/handlers/archive.ts +239 -0
- package/os/audit/index.ts +23 -0
- package/os/audit/types.ts +29 -0
- package/os/compass/compass.module.ts +186 -0
- package/os/compass/handlers/compass-audit-handler.ts +382 -0
- package/os/compass/handlers/compass-change-summary-handler.ts +272 -0
- package/os/compass/handlers/compass-inventory-handler.ts +294 -0
- package/os/compass/handlers/compass-inventory.ts +521 -0
- package/os/compass/handlers/git-revision.ts +137 -0
- package/os/compass/handlers/resolve-scan-root-workpiece.test.ts +65 -0
- package/os/compass/handlers/resolve-scan-root.ts +79 -0
- package/os/compass/index.ts +33 -0
- package/os/core/core.module.ts +948 -0
- package/os/core/handlers/assets-check.ts +122 -0
- package/os/core/handlers/assets-helpers.ts +174 -0
- package/os/core/handlers/assets-list.ts +99 -0
- package/os/core/handlers/build.ts +155 -0
- package/os/core/handlers/determinism-check.ts +354 -0
- package/os/core/handlers/dev.ts +127 -0
- package/os/core/handlers/invariant-engine.test.ts +681 -0
- package/os/core/handlers/knowledge-compact.ts +248 -0
- package/os/core/handlers/lifecycle-handlers.test.ts +524 -0
- package/os/core/handlers/note-frontmatter-validate.test.ts +93 -0
- package/os/core/handlers/note-link-validate.test.ts +117 -0
- package/os/core/handlers/note-orphan-detect.test.ts +94 -0
- package/os/core/handlers/package-health.test.ts +226 -0
- package/os/core/handlers/package-health.ts +231 -0
- package/os/core/handlers/pinned-check.ts +200 -0
- package/os/core/handlers/pinned-init.ts +333 -0
- package/os/core/handlers/pinned-types.ts +50 -0
- package/os/core/handlers/pinned-validate.ts +301 -0
- package/os/core/handlers/profile-resolve.ts +92 -0
- package/os/core/handlers/release-prepare.ts +294 -0
- package/os/core/handlers/release-publish.ts +211 -0
- package/os/core/handlers/validate.ts +262 -0
- package/os/core/handlers/workspace-deps.ts +55 -0
- package/os/core/index.ts +13 -0
- package/os/exploration/exploration.module.ts +90 -0
- package/os/exploration/frontmatter-io.ts +77 -0
- package/os/exploration/handlers/archive.ts +159 -0
- package/os/exploration/handlers/list.ts +77 -0
- package/os/exploration/handlers/show.ts +107 -0
- package/os/exploration/index.ts +25 -0
- package/os/exploration/types.ts +65 -0
- package/os/mission/handlers/archive.test.ts +391 -0
- package/os/mission/handlers/archive.ts +453 -0
- package/os/mission/index.ts +1 -0
- package/os/mission/mission.module.ts +48 -0
- package/os/mission/types.ts +41 -0
- package/os/naming/index.ts +14 -0
- package/os/naming/naming-convention.test.ts +163 -0
- package/os/naming/naming-convention.ts +378 -0
- package/os/naming/naming.module.ts +36 -0
- package/os/notes/index.ts +10 -0
- package/os/notes/notes.module.ts +109 -0
- package/os/plan/frontmatter-io.ts +82 -0
- package/os/plan/handlers/archive.ts +238 -0
- package/os/plan/index.ts +23 -0
- package/os/plan/plan.module.ts +48 -0
- package/os/plan/types.ts +29 -0
- package/os/program/discovery.ts +294 -0
- package/os/program/handlers/complete.ts +419 -0
- package/os/program/handlers/lease.ts +433 -0
- package/os/program/handlers/seal.ts +332 -0
- package/os/program/handlers/validate.ts +213 -0
- package/os/program/lease.ts +156 -0
- package/os/program/program.module.ts +212 -0
- package/os/program/schemas.ts +218 -0
- package/os/program/state.ts +264 -0
- package/os/rfc/acceptance.ts +344 -0
- package/os/rfc/decision-log.ts +310 -0
- package/os/rfc/dna-trace.ts +280 -0
- package/os/rfc/frontmatter-io.test.ts +132 -0
- package/os/rfc/frontmatter-io.ts +130 -0
- package/os/rfc/handlers/archive.ts +300 -0
- package/os/rfc/handlers/check.ts +238 -0
- package/os/rfc/handlers/implement-stamp.ts +515 -0
- package/os/rfc/handlers/index-graph.ts +237 -0
- package/os/rfc/handlers/lifecycle.test.ts +127 -0
- package/os/rfc/handlers/lifecycle.ts +249 -0
- package/os/rfc/handlers/list-create.ts +296 -0
- package/os/rfc/handlers/pipeline-status.ts +173 -0
- package/os/rfc/handlers/shared.ts +121 -0
- package/os/rfc/handlers/supersede-propose.ts +241 -0
- package/os/rfc/handlers/validate-rules.test.ts +891 -0
- package/os/rfc/handlers/validate-rules.ts +984 -0
- package/os/rfc/handlers/validate.ts +166 -0
- package/os/rfc/handlers.ts +19 -0
- package/os/rfc/index.ts +97 -0
- package/os/rfc/rfc.module.ts +416 -0
- package/os/rfc/types.ts +596 -0
- package/os/rfc/verification-evidence.ts +244 -0
- package/os/session/atif-parser.ts +166 -0
- package/os/session/frontmatter-io.ts +163 -0
- package/os/session/handlers/archive.ts +288 -0
- package/os/session/handlers/list.ts +174 -0
- package/os/session/handlers/save.ts +348 -0
- package/os/session/handlers/validate.ts +250 -0
- package/os/session/index.ts +50 -0
- package/os/session/session.module.ts +126 -0
- package/os/session/types.ts +203 -0
- package/os/spec/live-spec-list-show-validate.test.ts +257 -0
- package/os/spec/live-spec-list.ts +78 -0
- package/os/spec/live-spec-merge.test.ts +261 -0
- package/os/spec/live-spec-merge.ts +413 -0
- package/os/spec/live-spec-show.ts +117 -0
- package/os/spec/live-spec-types.ts +93 -0
- package/os/spec/live-spec-validate.ts +170 -0
- package/os/spec/spec-materialize.ts +390 -0
- package/os/spec/spec-schema.ts +174 -0
- package/os/spec/spec-status.ts +284 -0
- package/os/spec/spec-validate.ts +513 -0
- package/os/spec/spec.module.ts +135 -0
- package/os/werkstatt/handlers/lock.ts +168 -0
- package/os/werkstatt/handlers/schema.ts +47 -0
- package/os/werkstatt/handlers/werkstatt-lock-recover.ts +175 -0
- package/os/werkstatt/handlers/werkstatt-lock-status.ts +73 -0
- package/os/werkstatt/handlers/werkstatt-operation-validate.ts +104 -0
- package/os/werkstatt/index.ts +39 -0
- package/os/werkstatt/werkstatt.module.ts +62 -0
- package/os/workflow/handlers.ts +304 -0
- package/os/workflow/index.ts +28 -0
- package/os/workflow/types.ts +99 -0
- package/os/workflow/workflow.module.ts +54 -0
- package/package.json +3 -3
- package/profiles/godot-csharp.yaml +4 -4
- package/profiles/knowledge-typescript-turborepo.yaml +110 -0
- package/profiles/phaser-turborepo.yaml +5 -5
- package/skills/_shared/fo-session-summary.md +132 -16
- package/skills/fo/fo-add-tests/pbt-guide.md +13 -13
- package/skills/fo/fo-doc-audit/SKILL.md +6 -6
- package/skills/fo/fo-handoff/SKILL.md +5 -0
- package/skills/fo/fo-idea/SKILL.md +1 -1
- package/skills/fo/fo-review/SKILL.md +1 -1
- package/skills/fo/fo-session-retro/SKILL.md +8 -0
- package/skills/fo/fo-session-save/SKILL.md +8 -0
- package/src/cli-output.ts +59 -0
- package/src/config/__tests__/resolve-terminology.test.ts +45 -0
- package/src/config/forge-config.ts +524 -0
- package/src/forge-module.ts +39 -0
- package/src/index.ts +172 -0
- package/src/knowledge/__tests__/promote.test.ts +219 -0
- package/src/knowledge/__tests__/serialize.test.ts +192 -0
- package/src/knowledge/budgets.ts +202 -0
- package/src/knowledge/compact.ts +405 -0
- package/src/knowledge/index.ts +53 -0
- package/src/knowledge/parse.ts +227 -0
- package/src/knowledge/promote.ts +156 -0
- package/src/knowledge/schema.ts +112 -0
- package/src/knowledge/serialize.ts +72 -0
- package/src/migration-adapters/__tests__/ignored-files.test.ts +51 -0
- package/src/migration-adapters/__tests__/registry.test.ts +131 -0
- package/src/migration-adapters/__tests__/types.test.ts +86 -0
- package/src/migration-adapters/git-utils.ts +71 -0
- package/src/migration-adapters/ignored-files.ts +221 -0
- package/src/migration-adapters/index.ts +21 -0
- package/src/migration-adapters/node-typescript-pnpm/index.ts +189 -0
- package/src/migration-adapters/phaser-pnpm/index.ts +189 -0
- package/src/migration-adapters/registry.ts +61 -0
- package/src/migration-adapters/types.ts +68 -0
- package/src/onboarding/__tests__/workspace-discovery.test.ts +134 -0
- package/src/onboarding/agents-generate.ts +443 -0
- package/src/onboarding/create.ts +427 -0
- package/src/onboarding/doctor.ts +1297 -0
- package/src/onboarding/init.ts +337 -0
- package/src/onboarding/invariant-engine.ts +448 -0
- package/src/onboarding/memory-scaffold.ts +189 -0
- package/src/onboarding/nested-agents-generate.ts +93 -0
- package/src/onboarding/nested-agents-templates.ts +233 -0
- package/src/onboarding/profile-validate.ts +139 -0
- package/src/onboarding/scaffold-project.ts +299 -0
- package/src/onboarding/scaffold.ts +143 -0
- package/src/onboarding/upgrade.ts +558 -0
- package/src/onboarding/workspace-discovery.ts +167 -0
- package/src/profiles/__tests__/profile-schema.test.ts +228 -0
- package/src/profiles/__tests__/stack-profile.test.ts +190 -0
- package/src/profiles/__tests__/terminology-utils.test.ts +71 -0
- package/src/profiles/profile-schema.ts +350 -0
- package/src/profiles/stack-profile.ts +188 -0
- package/src/profiles/terminology-utils.ts +36 -0
- package/src/registry.ts +185 -0
- package/src/skill-schema.ts +37 -0
- package/src/tests/acceptance-criteria.test.ts +99 -0
- package/src/tests/adr-implement-stamp.test.ts +368 -0
- package/src/tests/agents-generate-domain.test.ts +317 -0
- package/src/tests/agents-generate.test.ts +458 -0
- package/src/tests/bindings-schema.test.ts +314 -0
- package/src/tests/budgets.test.ts +213 -0
- package/src/tests/cli-output.test.ts +196 -0
- package/src/tests/compact.test.ts +796 -0
- package/src/tests/create.test.ts +289 -0
- package/src/tests/doctor-autonomy.test.ts +98 -0
- package/src/tests/doctor-bindings.test.ts +286 -0
- package/src/tests/doctor-domain.test.ts +113 -0
- package/src/tests/exploration-handlers.test.ts +256 -0
- package/src/tests/fixtures/agents-generate-business-before.txt +288 -0
- package/src/tests/forge-config.test.ts +420 -0
- package/src/tests/fs-atomic.test.ts +96 -0
- package/src/tests/fs.test.ts +103 -0
- package/src/tests/generated-marker.test.ts +161 -0
- package/src/tests/hash.test.ts +37 -0
- package/src/tests/implement-stamp.test.ts +505 -0
- package/src/tests/init-bindings.test.ts +183 -0
- package/src/tests/knowledge-parse.test.ts +307 -0
- package/src/tests/knowledge-pbt.test.ts +164 -0
- package/src/tests/memory-scaffold.test.ts +192 -0
- package/src/tests/migration-adapters.test.ts +480 -0
- package/src/tests/package-files.test.ts +54 -0
- package/src/tests/pinned-check.test.ts +194 -0
- package/src/tests/pinned-init.test.ts +126 -0
- package/src/tests/profile-schema.test.ts +194 -0
- package/src/tests/profile-validate.test.ts +120 -0
- package/src/tests/program-lease.test.ts +245 -0
- package/src/tests/program-paths-extended.test.ts +117 -0
- package/src/tests/program-paths.test.ts +98 -0
- package/src/tests/program-property.test.ts +139 -0
- package/src/tests/program-schemas.test.ts +445 -0
- package/src/tests/program-spec-node.test.ts +250 -0
- package/src/tests/promote.test.ts +481 -0
- package/src/tests/registry.test.ts +73 -0
- package/src/tests/scaffold-project.test.ts +150 -0
- package/src/tests/session-handlers.test.ts +503 -0
- package/src/tests/session-pbt.test.ts +190 -0
- package/src/tests/skill-schema.test.ts +146 -0
- package/src/tests/skill-validate-knowledge.test.ts +26 -0
- package/src/tests/skill-validate.test.ts +254 -0
- package/src/tests/stack-profile.test.ts +221 -0
- package/src/tests/string-utils.test.ts +42 -0
- package/src/tests/upgrade.test.ts +428 -0
- package/src/tests/werkstatt-lock.test.ts +343 -0
- package/src/tests/workspace-discovery-domain.test.ts +112 -0
- package/src/tests/workspace-discovery.test.ts +135 -0
- package/src/types.ts +221 -0
- package/src/utils/__tests__/fs-idempotent.test.ts +73 -0
- package/src/utils/__tests__/fs-trash.test.ts +45 -0
- package/src/utils/fs-atomic.ts +93 -0
- package/src/utils/fs-idempotent.ts +41 -0
- package/src/utils/fs-trash-sync.ts +37 -0
- package/src/utils/fs-trash.ts +24 -0
- package/src/utils/fs.ts +74 -0
- package/src/utils/generated-marker.ts +166 -0
- package/src/utils/hash.ts +19 -0
- package/src/utils/index.ts +29 -0
- package/src/utils/string-utils.ts +19 -0
- package/src/validators/__tests__/note-orphan-detect.test.ts +94 -0
- package/src/validators/note-frontmatter-validate.ts +142 -0
- package/src/validators/note-link-validate.ts +145 -0
- package/src/validators/note-orphan-detect.ts +146 -0
- package/src/validators/port-validate.ts +97 -0
- package/src/validators/skill-validate.ts +831 -0
|
@@ -22,34 +22,122 @@ The closing block MUST use `aiLanguage` (from `PREFERENCES.md`), same as all oth
|
|
|
22
22
|
|
|
23
23
|
**All labels and headings in the closing block must be translated to `aiLanguage`.** The structural format below uses placeholder labels — replace them with the equivalent in the operator's language. Only slash commands and document identifiers (RFC-XXXX, ADR-XXXX, file paths) stay in their original form.
|
|
24
24
|
|
|
25
|
-
##
|
|
25
|
+
## Engineering Checkpoint protocol (RFC-0884)
|
|
26
|
+
|
|
27
|
+
The closing block has two modes. The agent selects the mode based on what the session changed:
|
|
28
|
+
|
|
29
|
+
- **Lightweight mode** — for sessions that do not change system structure (typo fixes, small refactors, document edits, read-only exploration). Uses a 3-section format.
|
|
30
|
+
- **Full mode** — for sessions that change architecture, runtime flow, state machines, persistence models, or public contracts. Uses a 6-section format with an optional Mermaid diagram.
|
|
31
|
+
|
|
32
|
+
### Mode selection
|
|
33
|
+
|
|
34
|
+
The agent analyzes the session's changes to determine which mode to use. The decision is based on **what changed in the system**, not on the session's chronology:
|
|
35
|
+
|
|
36
|
+
- If the session changed any of: architecture, component relationships, runtime flow, state machines, persistence models, public contracts, schemas, invariants, pipeline topology → **full mode**.
|
|
37
|
+
- Otherwise → **lightweight mode**.
|
|
38
|
+
|
|
39
|
+
When in doubt, use lightweight mode. A full checkpoint for a session that made no structural changes adds noise without value.
|
|
40
|
+
|
|
41
|
+
### Diagram selection rules
|
|
42
|
+
|
|
43
|
+
When using **full mode**, the agent MUST analyze the session's changes to determine if a Mermaid diagram is warranted.
|
|
44
|
+
|
|
45
|
+
| Change type | Diagram type | When to use |
|
|
46
|
+
| --- | --- | --- |
|
|
47
|
+
| Architecture / component relationships | `flowchart` | Components, modules, packages, and their dependencies changed |
|
|
48
|
+
| Runtime interaction / request flow | `sequenceDiagram` | New or changed runtime interaction between components, services, or external systems |
|
|
49
|
+
| Lifecycle / state machine | `stateDiagram-v2` | State transitions, mission lifecycle, release states, or protocol states changed |
|
|
50
|
+
| Entities / persistence model | `erDiagram` | Data models, entity relationships, schema changes, storage contracts |
|
|
51
|
+
| Pipeline / dependency chain | `flowchart` | Build pipeline, validation pipeline, deployment pipeline changed |
|
|
52
|
+
| Quantitative results (performance, coverage, benchmarks) | markdown table | Measurable data exists that is clearer as a table than prose |
|
|
53
|
+
| No structural change | _(none)_ | Session did not change system structure, runtime flow, state, or persistence |
|
|
54
|
+
|
|
55
|
+
**Diagram rules:**
|
|
56
|
+
|
|
57
|
+
1. **Do not draw a diagram merely to satisfy the requirement.** If no meaningful visualization is warranted, explicitly state: "No diagram: this session did not change system structure, runtime flow, state transitions, persistence relationships, or other relationships that would be clearer visually."
|
|
58
|
+
2. **Diagram shows resulting state, not work chronology.** The diagram depicts the system AFTER changes, not the sequence of edits the agent made.
|
|
59
|
+
3. **At most one diagram per closing block.** If multiple structural changes occurred, pick the one that most reduces cognitive load. Additional diagrams may appear in the session file or handoff document.
|
|
60
|
+
4. **CURRENT vs SESSION DELTA.** For large systems where the full architecture is too complex, the agent may draw a session-delta diagram (only the changed subgraph) instead of the full current-system diagram. If a delta diagram is used, label it as "session delta" and reference the full system context.
|
|
61
|
+
5. **Mermaid syntax only.** Diagrams use Mermaid text syntax (`flowchart`, `sequenceDiagram`, `stateDiagram-v2`, `erDiagram`) so they are Git-versionable and diffable.
|
|
62
|
+
6. **Quantitative charts are markdown tables.** No image rendering infrastructure is added. If measurable data exists (test counts, coverage %, performance ms), present it as a markdown table with a caption.
|
|
63
|
+
|
|
64
|
+
### Quality test self-check
|
|
65
|
+
|
|
66
|
+
After composing the Engineering Checkpoint (either mode), the agent performs a self-check:
|
|
67
|
+
|
|
68
|
+
> "Can another engineer understand the resulting system state from this checkpoint alone, without reading the full session transcript?"
|
|
69
|
+
|
|
70
|
+
If the answer is no, the agent improves the checkpoint before presenting it. This is a semantic check performed by the agent, not an automated validation.
|
|
71
|
+
|
|
72
|
+
## Closing block format — Full mode
|
|
73
|
+
|
|
74
|
+
Use when the session changed architecture, runtime flow, state machines, persistence models, or public contracts.
|
|
26
75
|
|
|
27
76
|
```
|
|
28
77
|
---
|
|
29
78
|
|
|
30
|
-
**<
|
|
79
|
+
**<Completed label in aiLanguage>**
|
|
80
|
+
|
|
81
|
+
<1–3 sentences: what was implemented — concretely, with document ids, commit count, review verdict. No filler.>
|
|
82
|
+
|
|
83
|
+
**<System Delta label in aiLanguage>**
|
|
84
|
+
|
|
85
|
+
<Changed public contracts, schemas, APIs, state machines, invariants, persistence models, file surfaces. Grouped by category. Each item links to the source file or commit.>
|
|
86
|
+
|
|
87
|
+
**<Resulting Architecture label in aiLanguage>**
|
|
88
|
+
|
|
89
|
+
<Mermaid diagram of the system state AFTER changes — only when it reduces cognitive load vs text. See diagram selection rules. If no diagram is warranted, state: "No diagram: this session did not change system structure, runtime flow, state transitions, persistence relationships, or other relationships that would be clearer visually.">
|
|
90
|
+
|
|
91
|
+
**<Verification label in aiLanguage>**
|
|
92
|
+
|
|
93
|
+
<Tests executed, type checking, build status, relevant deterministic/recovery/integration checks, important observed results. Each claim links to evidence: test file:line, command output, or commit.>
|
|
94
|
+
|
|
95
|
+
**<Remaining Issues label in aiLanguage>**
|
|
31
96
|
|
|
32
|
-
<
|
|
97
|
+
<Known limitations, unverified assumptions, open questions, technical debt introduced. Be honest — this is the uncertainty map.>
|
|
33
98
|
|
|
34
|
-
**<Next
|
|
99
|
+
**<Next Step label in aiLanguage>**
|
|
35
100
|
|
|
36
101
|
- `/fo-idea-audit RFC-XXXX` — <one line in aiLanguage: why>
|
|
37
102
|
- `/fo-idea-enhance RFC-XXXX` — <one line in aiLanguage: why>
|
|
38
|
-
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Closing block format — Lightweight mode
|
|
106
|
+
|
|
107
|
+
Use for sessions that do not change system structure (typo fixes, small refactors, document edits, read-only exploration).
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
**<Completed label in aiLanguage>**
|
|
113
|
+
|
|
114
|
+
<1–3 sentences: what was done.>
|
|
115
|
+
|
|
116
|
+
**<Verification label in aiLanguage>**
|
|
117
|
+
|
|
118
|
+
<Tests/typecheck/build status — one line.>
|
|
119
|
+
|
|
120
|
+
**<Next Step label in aiLanguage>**
|
|
121
|
+
|
|
122
|
+
- `/fo-idea-status` — <one line in aiLanguage: why>
|
|
39
123
|
```
|
|
40
124
|
|
|
41
125
|
### Rules
|
|
42
126
|
|
|
43
|
-
1. **
|
|
44
|
-
2. **
|
|
45
|
-
3. **
|
|
46
|
-
4. **
|
|
47
|
-
5. **
|
|
48
|
-
6. **
|
|
127
|
+
1. **Completed** — 1–3 concise sentences in `aiLanguage`. State what was done: document ids, commit count, review verdict, key outcomes. No filler, no repetition of the batch summary — the summary is the _essence_.
|
|
128
|
+
2. **System Delta** (full mode only) — changed public contracts, schemas, APIs, state machines, invariants, persistence models, file surfaces. Grouped by category. Each item links to the source file or commit.
|
|
129
|
+
3. **Resulting Architecture** (full mode only) — optional Mermaid diagram of the system state AFTER changes. Follow the diagram selection rules. If no diagram is warranted, state explicitly.
|
|
130
|
+
4. **Verification** — tests executed, type checking, build status, relevant checks. Each claim links to evidence. In lightweight mode, this is one line.
|
|
131
|
+
5. **Remaining Issues** (full mode only) — known limitations, unverified assumptions, open questions, technical debt introduced.
|
|
132
|
+
6. **Next Step** — a bulleted list of 1–3 items. Each item is a copy-pasteable slash-command invocation followed by a short `aiLanguage` explanation of why the operator might want to run it.
|
|
133
|
+
7. **Only relevant commands** — list only skills that are genuinely applicable as the next step given the current state. Do not list commands that were already completed or that do not apply.
|
|
134
|
+
8. **Copy-pasteable** — the slash command must be the exact invocation string the operator can paste into chat. Include the document id if known.
|
|
135
|
+
9. **No more than 3 items** — the operator should not be overwhelmed. Pick the most relevant next steps.
|
|
136
|
+
10. **Translate labels** — the section headings must be in `aiLanguage`, not English. Only slash commands and identifiers stay untranslated.
|
|
49
137
|
|
|
50
138
|
### Examples
|
|
51
139
|
|
|
52
|
-
**After `fo-idea-create-rfc` completes (aiLanguage = ru):**
|
|
140
|
+
**After `fo-idea-create-rfc` completes (lightweight mode, aiLanguage = ru):**
|
|
53
141
|
|
|
54
142
|
```
|
|
55
143
|
---
|
|
@@ -58,34 +146,62 @@ The closing block MUST use `aiLanguage` (from `PREFERENCES.md`), same as all oth
|
|
|
58
146
|
|
|
59
147
|
Создан драфт RFC-0380 «Standardize kernel execution reports» (status: draft, 1 коммит). `rfc.validate` проходит без нарушений. Документ ожидает архитектурного ревью.
|
|
60
148
|
|
|
149
|
+
**Проверка**
|
|
150
|
+
|
|
151
|
+
`rfc.validate` — 0 нарушений.
|
|
152
|
+
|
|
61
153
|
**Дальнейшие шаги**
|
|
62
154
|
|
|
63
155
|
- `/fo-idea-audit RFC-0380` — семантический аудит RFC перед энхансментом
|
|
64
156
|
- `/fo-idea-i-just-want-to-see-the-result RFC-0380` — полный пайплайн до реализации
|
|
65
157
|
```
|
|
66
158
|
|
|
67
|
-
**After `fo-idea-implement` completes (aiLanguage = en):**
|
|
159
|
+
**After `fo-idea-implement` completes (full mode, aiLanguage = en):**
|
|
68
160
|
|
|
69
161
|
```
|
|
70
162
|
---
|
|
71
163
|
|
|
72
|
-
**
|
|
164
|
+
**Completed**
|
|
73
165
|
|
|
74
166
|
RFC-0377 implemented: 4 plan steps, 3 commits, scoped build — pass. Review: approved (0 findings). Status: implemented (2026-07-13).
|
|
75
167
|
|
|
168
|
+
**System Delta**
|
|
169
|
+
|
|
170
|
+
- **Schemas**: `SessionFrontmatter` extended with `systemDelta`, `diagrams`, `evidence`, `remainingIssues`, `checkpoint` optional fields (`packages/forge/os/session/types.ts:100-117`)
|
|
171
|
+
- **Validation**: SES-06 warning rule added to `session.validate` (`packages/forge/os/session/handlers/validate.ts:166-186`)
|
|
172
|
+
- **Skills**: `fo-session-summary.md` restructured with lightweight and full checkpoint modes
|
|
173
|
+
|
|
174
|
+
**Resulting Architecture**
|
|
175
|
+
|
|
176
|
+
No diagram: this session changed types and skill markdown only, not system structure, runtime flow, state transitions, or persistence relationships.
|
|
177
|
+
|
|
178
|
+
**Verification**
|
|
179
|
+
|
|
180
|
+
- `pnpm --filter @warpgogol/forge run build:check` — pass
|
|
181
|
+
- `rfc.validate --id RFC-0377` — 0 violations
|
|
182
|
+
- `forge.skill.validate` — 0 violations
|
|
183
|
+
|
|
184
|
+
**Remaining Issues**
|
|
185
|
+
|
|
186
|
+
None. All acceptance criteria met.
|
|
187
|
+
|
|
76
188
|
**Next steps**
|
|
77
189
|
|
|
78
190
|
- `/fo-idea-status` — overview of current RFC/ADR statuses
|
|
79
191
|
```
|
|
80
192
|
|
|
81
|
-
**After `fo-review` completes (aiLanguage = ru):**
|
|
193
|
+
**After `fo-review` completes (lightweight mode, aiLanguage = ru):**
|
|
82
194
|
|
|
83
195
|
```
|
|
84
196
|
---
|
|
85
197
|
|
|
86
198
|
**Сводка**
|
|
87
199
|
|
|
88
|
-
Ревью кода завершено: вердикт needs-revision, 3 замечания (Axis B: DNA-23 нарушение, Axis D: legacy путь, Axis E: нет Compass-разметки). Отчёт сохранён в docs/reviews/code/packages-
|
|
200
|
+
Ревью кода завершено: вердикт needs-revision, 3 замечания (Axis B: DNA-23 нарушение, Axis D: legacy путь, Axis E: нет Compass-разметки). Отчёт сохранён в docs/reviews/code/packages-werkstatt-site/.
|
|
201
|
+
|
|
202
|
+
**Проверка**
|
|
203
|
+
|
|
204
|
+
Ревью завершено, замечания задокументированы.
|
|
89
205
|
|
|
90
206
|
**Дальнейшие шаги**
|
|
91
207
|
|
|
@@ -178,16 +178,16 @@ test("compareSemver is antisymmetric: compare(a, b) == -compare(b, a)", () => {
|
|
|
178
178
|
|
|
179
179
|
| Function | Package | Property | Pattern |
|
|
180
180
|
| --- | --- | --- | --- |
|
|
181
|
-
| `normalizeText` | `@warpgogol/
|
|
182
|
-
| `normalizeHtml` | `@warpgogol/
|
|
183
|
-
| `normalizeMarkdown` | `@warpgogol/
|
|
184
|
-
| `normalizeJson` | `@warpgogol/
|
|
185
|
-
| `compareSemver` | `@warpgogol/
|
|
186
|
-
| `compareSemver` | `@warpgogol/
|
|
187
|
-
| `parseSemver` / `formatSemver` | `@warpgogol/
|
|
188
|
-
| `substituteRefsDeep` | `@warpgogol/
|
|
189
|
-
| `markdownTwinRelPath` | `@warpgogol/
|
|
190
|
-
| `deepMergeEntryData` | `@warpgogol/
|
|
191
|
-
| `citySlug` | `@warpgogol/
|
|
192
|
-
| `redactUrl` | `@warpgogol/
|
|
193
|
-
| `validateAgainstCapabilitySchema` | `@warpgogol/
|
|
181
|
+
| `normalizeText` | `@warpgogol/werkstatt-shared` | `normalize(normalize(x)) == normalize(x)` | Idempotency |
|
|
182
|
+
| `normalizeHtml` | `@warpgogol/werkstatt-shared` | `normalize(normalize(x)) == normalize(x)` | Idempotency |
|
|
183
|
+
| `normalizeMarkdown` | `@warpgogol/werkstatt-shared` | `normalize(normalize(x)) == normalize(x)` | Idempotency |
|
|
184
|
+
| `normalizeJson` | `@warpgogol/werkstatt-shared` | `normalize(normalize(x)) == normalize(x)` | Idempotency |
|
|
185
|
+
| `compareSemver` | `@warpgogol/werkstatt` | `a < b and b < c implies a < c` | Transitivity |
|
|
186
|
+
| `compareSemver` | `@warpgogol/werkstatt` | `compare(a, b) == -compare(b, a)` | Antisymmetry |
|
|
187
|
+
| `parseSemver` / `formatSemver` | `@warpgogol/werkstatt` | `parse(format(parsed)) == parsed` | Round-trip |
|
|
188
|
+
| `substituteRefsDeep` | `@warpgogol/werkstatt-shared` | Input is not mutated after call | Immutability |
|
|
189
|
+
| `markdownTwinRelPath` | `@warpgogol/werkstatt-shared` | `twinUrlPath(twinRelPath(x))` is consistent for valid paths | Round-trip |
|
|
190
|
+
| `deepMergeEntryData` | `@warpgogol/werkstatt-shared` | Merge is associative for nested objects (not arrays) | Associativity |
|
|
191
|
+
| `citySlug` | `@warpgogol/werkstatt-site` | Output only contains lowercase alphanumeric and hyphens | Invariance |
|
|
192
|
+
| `redactUrl` | `@warpgogol/werkstatt-shared` | Output never contains a query string | Invariance |
|
|
193
|
+
| `validateAgainstCapabilitySchema` | `@warpgogol/werkstatt` | Non-object input always fails validation | Invariance |
|
|
@@ -33,7 +33,7 @@ The ecosystem has seven documentation surfaces. Each has a different audience an
|
|
|
33
33
|
| **README** | root, `packages/*/README.md`, `services/*/README.md` | Humans (developers, operators) | Public API, CLI surface, usage pattern, or installation flow change |
|
|
34
34
|
| **Compass XML** | `docs/requirements.xml`, `docs/technology.xml`, `docs/development-plan.xml`, `docs/knowledge-graph.xml`, `docs/verification-plan.xml`, `docs/source-markup.xml` | AI agents (machine-readable semantic layer) | Repository-wide requirements, shared package contracts, app-package relationships, verification policy |
|
|
35
35
|
| **architecture-dna.md** | `ref(forge.yaml bindings.paths.invariantsFile)` | AI agents + humans | New DNA invariant, invariant amendment, or invariant retirement |
|
|
36
|
-
| **Templates** | `packages/
|
|
36
|
+
| **Templates** | `packages/werkstatt-site/src/onboarding/templates/`, `packages/werkstatt-site/src/codegen/templates/` | Future apps/packages (scaffold time) | Change to what a new app or package should look like at creation time |
|
|
37
37
|
| **Generated artifacts** | `docs/ecosystem.generated.json`, `docs/command-manifest.generated.yaml`, `fleet/*.generated.yaml`, `*.generated.css` | AI agents (read-only projection) | **Never edit directly** — update the generator or registry, then regenerate |
|
|
38
38
|
| **COMMANDS / PACKAGE_GRAPH** | `docs/COMMANDS.md`, `docs/PACKAGE_GRAPH.md` | Humans + AI agents | New command, removed command, package graph change |
|
|
39
39
|
|
|
@@ -52,7 +52,7 @@ Capture the full list of changed files and categorize them:
|
|
|
52
52
|
- **Code** — `.ts`, `.js`, `.mjs`, `.astro`, `.css`, `.json`, `.yaml`, etc.
|
|
53
53
|
- **Content** — `src/content/**/*.md`, `src/content/**/*.yaml`.
|
|
54
54
|
- **Docs** — `docs/**/*.md`, `docs/**/*.xml`, `AGENTS.md`, `README.md`.
|
|
55
|
-
- **Templates** — files under `packages/
|
|
55
|
+
- **Templates** — files under `packages/werkstatt-site/src/onboarding/templates/` and `packages/werkstatt-site/src/codegen/templates/`.
|
|
56
56
|
- **Generated** — `*.generated.*`, `fleet/*.generated.*`.
|
|
57
57
|
|
|
58
58
|
### 2. Run impact analysis
|
|
@@ -115,7 +115,7 @@ If yes, update `ref(forge.yaml bindings.paths.invariantsFile)`. If a new invaria
|
|
|
115
115
|
- Did a **boilerplate file, script, or config** pattern change that onboarding/codegen templates should reflect?
|
|
116
116
|
- Did a **new convention** get introduced that future apps/packages must follow from creation?
|
|
117
117
|
|
|
118
|
-
If yes, update the **template** files in `packages/
|
|
118
|
+
If yes, update the **template** files in `packages/werkstatt-site/src/onboarding/templates/` and `packages/werkstatt-site/src/codegen/templates/`. **Never edit generated output in existing apps** — fix the template, then regenerate if needed.
|
|
119
119
|
|
|
120
120
|
#### 2f. Generated artifacts
|
|
121
121
|
|
|
@@ -150,8 +150,8 @@ Present the impact analysis as a concise table before applying any changes. This
|
|
|
150
150
|
| Surface | Needs update? | Reason |
|
|
151
151
|
| --- | --- | --- |
|
|
152
152
|
| AGENTS.md (root) | Yes | New command lifecycle rule |
|
|
153
|
-
| AGENTS.md (packages/
|
|
154
|
-
| README (packages/
|
|
153
|
+
| AGENTS.md (packages/werkstatt-site) | Yes | New cache module registered |
|
|
154
|
+
| README (packages/werkstatt-site) | No | No public API change |
|
|
155
155
|
| Compass XML (docs/verification-plan.xml) | Yes | New check pipeline stage |
|
|
156
156
|
| architecture-dna.md | No | No DNA invariant change |
|
|
157
157
|
| Templates | No | No scaffold-time change |
|
|
@@ -215,7 +215,7 @@ docs: sync documentation for <feature/RFC>
|
|
|
215
215
|
- AGENTS.md (root): <what changed>
|
|
216
216
|
- docs/verification-plan.xml: <what changed>
|
|
217
217
|
- docs/COMMANDS.md: <what changed>
|
|
218
|
-
- packages/
|
|
218
|
+
- packages/werkstatt-site/README.md: <what changed>
|
|
219
219
|
```
|
|
220
220
|
|
|
221
221
|
Stage only the documentation files touched by this step. Do not stage unrelated changes — another agent may be working in a different session; `git add -A` or `git add .` is forbidden.
|
|
@@ -33,6 +33,11 @@ Include:
|
|
|
33
33
|
- **Suggested skills** — which skills the next agent should invoke and why.
|
|
34
34
|
- **References to existing artifacts** — specs, plans, ADRs, issues, commits, diffs. Reference them by path or URL instead of duplicating content.
|
|
35
35
|
- **Current state** — what the codebase looks like now, what's uncommitted, what's in progress.
|
|
36
|
+
- **System State Transition (RFC-0884)** — three prose subsections:
|
|
37
|
+
- **Before** — state N before the session (what the system looked like before changes)
|
|
38
|
+
- **Change** — what was done (the key changes made during the session)
|
|
39
|
+
- **After** — state N+1 after the session (what the system looks like now)
|
|
40
|
+
- **Resulting Architecture (RFC-0884)** — optional Mermaid diagram of the system state AFTER changes, following the diagram selection rules from `_shared/fo-session-summary.md`. If no diagram is warranted, state: "No diagram: this session did not change system structure."
|
|
36
41
|
- **Next steps** — concrete, actionable items the next agent should pick up.
|
|
37
42
|
- **Memory layer pointer** — tell the next agent to read `.agents/memory/MEMORY.md` and recent `.agents/memory/daily/` files for project context.
|
|
38
43
|
|
|
@@ -117,7 +117,7 @@ Use the following decision table:
|
|
|
117
117
|
These patterns **look like RFCs but are ADRs**:
|
|
118
118
|
|
|
119
119
|
- **"Applied to all apps" ≠ "cross-workspace contract"** — a convention like "use Fontsource for fonts" or "self-host all web fonts" applies everywhere but does not create a package boundary, inter-package type contract, or new command. It is an ADR with `scope: workspace`.
|
|
120
|
-
- **"Changes a shared package" ≠ "establishes a package boundary"** — extending `packages/
|
|
120
|
+
- **"Changes a shared package" ≠ "establishes a package boundary"** — extending `packages/werkstatt-site/src/domain/ui/fonts.ts` with a new font family modifies shared code, but the decision is about which fonts to use, not about the package's interface or contract. ADR.
|
|
121
121
|
- **"Might be mentioned in AGENTS.md" ≠ "modifies a DNA invariant"** — a decision might be documented in AGENTS.md for visibility, but unless it changes a DNA-NN invariant or a governance rule, it is an ADR.
|
|
122
122
|
- **"Has cross-app impact" ≠ "cross-workspace contract"** — adding a font to the shared registry affects all apps' builds, but the decision itself is a tooling/standard choice, not a contract between packages.
|
|
123
123
|
|
|
@@ -233,7 +233,7 @@ Present the findings in this structure in `aiLanguage`. **Translate all labels,
|
|
|
233
233
|
|
|
234
234
|
### 7. Persist the review
|
|
235
235
|
|
|
236
|
-
Derive the `<module-folder>` from the reviewed files: take the package path with the most changed files and convert it to lowercase kebab-case (for example, `packages/growth` → `packages-growth`, `packages/
|
|
236
|
+
Derive the `<module-folder>` from the reviewed files: take the package path with the most changed files and convert it to lowercase kebab-case (for example, `packages/growth` → `packages-growth`, `packages/werkstatt-site` → `packages-werkstatt-site`). For cross-workspace diffs, use the package with the largest number of changed files; list all reviewed files in the `filesReviewed` frontmatter field.
|
|
237
237
|
|
|
238
238
|
Write the report to:
|
|
239
239
|
|
|
@@ -435,6 +435,12 @@ If any operator insights were routed to `.agents/operator-profile.md`, offer the
|
|
|
435
435
|
|
|
436
436
|
Present a concise summary in `aiLanguage`. **ALL labels, headings, column names, and prose MUST be translated to `aiLanguage`** — the template below is structural only. Only identifiers (file paths, skill names, RFC/ADR ids, commit hashes) stay untranslated. This is non-negotiable: an English summary when `aiLanguage` is `ru` is a violation of this skill's language contract.
|
|
437
437
|
|
|
438
|
+
**Engineering Checkpoint (RFC-0884):** The closing block follows the Engineering Checkpoint protocol defined in `_shared/fo-session-summary.md`. The agent MUST:
|
|
439
|
+
|
|
440
|
+
1. **Select mode** — analyze the session's changes. If the session changed architecture, runtime flow, state machines, persistence models, or public contracts, use **full mode** (6 sections). Otherwise, use **lightweight mode** (3 sections).
|
|
441
|
+
2. **Diagram selection** (full mode only) — apply the diagram selection rules table from `_shared/fo-session-summary.md` to determine if a Mermaid diagram is warranted. If no structural change warrants a diagram, explicitly state "No diagram: this session did not change system structure..."
|
|
442
|
+
3. **Quality test self-check** — after composing the checkpoint, ask: "Can another engineer understand the resulting system state from this checkpoint alone, without reading the full session transcript?" If no, improve the checkpoint before presenting it.
|
|
443
|
+
|
|
438
444
|
```
|
|
439
445
|
## <Session Retro Summary in aiLanguage>
|
|
440
446
|
|
|
@@ -455,6 +461,8 @@ Present a concise summary in `aiLanguage`. **ALL labels, headings, column names,
|
|
|
455
461
|
### <Commit>: <hash | none — no direct edits>
|
|
456
462
|
```
|
|
457
463
|
|
|
464
|
+
After the summary table, emit the **Engineering Checkpoint closing block** following the format in `_shared/fo-session-summary.md` (full or lightweight mode). This closing block IS the session-end output — it replaces any ad-hoc summary.
|
|
465
|
+
|
|
458
466
|
## Relationship to other session-end skills
|
|
459
467
|
|
|
460
468
|
| Skill | Question | Overlap |
|
|
@@ -46,6 +46,14 @@ Enhance saved session transcripts with semantic annotations, summaries, and qual
|
|
|
46
46
|
|
|
47
47
|
6. **Update the session file:**
|
|
48
48
|
- Update frontmatter: `summary`, `decisions`, refined `types`, corrected metadata.
|
|
49
|
+
- **Checkpoint fields (RFC-0884):** When the session produced substantial engineering work, populate the optional checkpoint frontmatter fields:
|
|
50
|
+
- `checkpoint` — object with `before`, `change`, `after` (each 1-2 sentences describing state N, what was done, state N+1)
|
|
51
|
+
- `systemDelta` — object with arrays: `changedContracts`, `changedSchemas`, `changedStateMachines`, `changedInvariants`, `changedPersistence`
|
|
52
|
+
- `diagrams` — array of objects: `type` (flowchart/sequenceDiagram/stateDiagram-v2/erDiagram/none), `scope` (current-system/session-delta), `caption`, `mermaid` (Mermaid syntax or empty string)
|
|
53
|
+
- `evidence` — array of objects: `claim`, `source` (file:line), `test` (test file:line), `command` (command + result)
|
|
54
|
+
- `remainingIssues` — array of strings: known limitations, unverified assumptions, open questions
|
|
55
|
+
- These fields are **optional** — only populate when the session produced substantial engineering work. For lightweight sessions (typo fixes, small refactors), skip them.
|
|
56
|
+
- The `session.save` deterministic command does NOT populate these — they are agent-populated via this skill or manual editing.
|
|
49
57
|
- Append a `## Session notes` section with structured annotations.
|
|
50
58
|
|
|
51
59
|
7. **Update knowledge files** with any new insights:
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>CLI output rendering helpers (RFC-0542) — renderNextSteps,
|
|
4
|
+
renderIdeRecommendation, generateHelp. Pure functions, no I/O, no process.exit.
|
|
5
|
+
Importable by bin/cli.ts and unit tests.</purpose>
|
|
6
|
+
<non-goals>
|
|
7
|
+
<item>Do not call console.log or process.exit — callers handle output.</item>
|
|
8
|
+
<item>Do not import from bin/ — this is the portable layer.</item>
|
|
9
|
+
</non-goals>
|
|
10
|
+
</MODULE_CONTRACT>
|
|
11
|
+
<CHANGE_SUMMARY>
|
|
12
|
+
<item>RFC-0542: initial CLI output rendering helpers — renderNextSteps, renderIdeRecommendation, generateHelp.</item>
|
|
13
|
+
</CHANGE_SUMMARY>
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import type { ForgeNextStep, CommandRegistry } from "./types.ts";
|
|
17
|
+
|
|
18
|
+
export function renderNextSteps(steps?: ForgeNextStep[]): string {
|
|
19
|
+
if (!steps || steps.length === 0) return "";
|
|
20
|
+
const lines = ["\nNext steps:"];
|
|
21
|
+
for (const step of steps) {
|
|
22
|
+
const label = step.kind === "required" ? "[must do]" : "[can do]";
|
|
23
|
+
lines.push(` • ${step.action} ${label}`);
|
|
24
|
+
}
|
|
25
|
+
return lines.join("\n");
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function renderIdeRecommendation(): string {
|
|
29
|
+
return "\nRecommended IDE: Windsurf (tested with forge). Other IDEs (VS Code, Cursor)\nwork but are not tested.";
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function generateHelp(registry: CommandRegistry): string {
|
|
33
|
+
const commands = registry.listCommands().filter((cmd) => !cmd.hidden);
|
|
34
|
+
const header = `forge — autonomous project tooling
|
|
35
|
+
|
|
36
|
+
Usage:
|
|
37
|
+
forge <command> [args...] [--flags...]
|
|
38
|
+
forge --help <command> Show per-command flags and description
|
|
39
|
+
|
|
40
|
+
Flags:
|
|
41
|
+
--json Output results as JSON
|
|
42
|
+
--dry-run Show what would happen without making changes
|
|
43
|
+
--site <name> Target a specific site/app
|
|
44
|
+
--version Show forge version
|
|
45
|
+
--help Show this help (or per-command help with --help <command>)
|
|
46
|
+
|
|
47
|
+
Registered commands (${commands.length}):`;
|
|
48
|
+
|
|
49
|
+
const commandLines = commands
|
|
50
|
+
.map((cmd) => {
|
|
51
|
+
const desc =
|
|
52
|
+
cmd.description.length > 80 ? cmd.description.slice(0, 77) + "..." : cmd.description;
|
|
53
|
+
const displayName = cmd.name.replace(/^forge\./, "");
|
|
54
|
+
return ` ${displayName.padEnd(40)} ${desc}`;
|
|
55
|
+
})
|
|
56
|
+
.join("\n");
|
|
57
|
+
|
|
58
|
+
return `${header}\n${commandLines}\n`;
|
|
59
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { resolveTerminology, defaultForgeConfig, type ForgeConfig } from "../forge-config.ts";
|
|
3
|
+
import { TERMINOLOGY_DEFAULTS } from "../../profiles/profile-schema.ts";
|
|
4
|
+
|
|
5
|
+
describe("resolveTerminology", () => {
|
|
6
|
+
function makeConfig(terminology?: Record<string, string>): ForgeConfig {
|
|
7
|
+
const config = defaultForgeConfig("test");
|
|
8
|
+
if (terminology && config.bindings) {
|
|
9
|
+
config.bindings.terminology = terminology;
|
|
10
|
+
}
|
|
11
|
+
return config;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
it("returns universal default when no overrides exist", () => {
|
|
15
|
+
const config = makeConfig();
|
|
16
|
+
expect(resolveTerminology(config, undefined, "artifact")).toBe(TERMINOLOGY_DEFAULTS.artifact);
|
|
17
|
+
expect(resolveTerminology(config, undefined, "operator")).toBe(TERMINOLOGY_DEFAULTS.operator);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it("returns the key itself when not found in any tier", () => {
|
|
21
|
+
const config = makeConfig();
|
|
22
|
+
expect(resolveTerminology(config, undefined, "nonexistent")).toBe("nonexistent");
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("tier 1: per-project bindings.terminology overrides everything", () => {
|
|
26
|
+
const config = makeConfig({ artifact: "widget" });
|
|
27
|
+
expect(resolveTerminology(config, { artifact: "module" }, "artifact")).toBe("widget");
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it("tier 2: caller-provided terminology overrides universal default", () => {
|
|
31
|
+
const config = makeConfig();
|
|
32
|
+
expect(resolveTerminology(config, { artifact: "custom" }, "artifact")).toBe("custom");
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it("tier 3: universal default used when tiers 1 and 2 are absent", () => {
|
|
36
|
+
const config = makeConfig();
|
|
37
|
+
expect(resolveTerminology(config, undefined, "module")).toBe(TERMINOLOGY_DEFAULTS.module);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it("handles undefined bindings entirely", () => {
|
|
41
|
+
const config = defaultForgeConfig("test");
|
|
42
|
+
delete config.bindings;
|
|
43
|
+
expect(resolveTerminology(config, { artifact: "thing" }, "artifact")).toBe("thing");
|
|
44
|
+
});
|
|
45
|
+
});
|