@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
package/AGENTS.md
CHANGED
|
@@ -7,7 +7,7 @@ Portable governance skills and command modules extracted from the engine (RFC-03
|
|
|
7
7
|
- `src/` — portable, no kernel imports. Contains skill schema, registry, validators, onboarding handlers, config module, canonical types, and utilities.
|
|
8
8
|
- `os/` — ForgeModule registrations. RFC-0556: `os/compass/` and `os/werkstatt/` are fully autonomous — all command handlers are inlined in `os/*/handlers/` and no longer dynamically import `@warpgogol/*` packages. Other `os/` modules may still use dynamic imports where kernel integration is needed.
|
|
9
9
|
- `bin/` — CLI entrypoint (`forge` command) for autonomous usage without `@warpgogol/werkstatt`.
|
|
10
|
-
- `skills/` — forge-managed skill definitions (
|
|
10
|
+
- `skills/` — forge-managed skill definitions (29 fo skills + 5 shared + 3 meta = 37 skills). Project-declared skill packs (RFC-0539) live outside forge and are discovered via `discoverPackSkills` from `forge.yaml` `skillPacks` config.
|
|
11
11
|
|
|
12
12
|
## RFC-0855 program control-plane boundary
|
|
13
13
|
|
package/README.md
CHANGED
|
@@ -6,13 +6,14 @@ Portable governance engine for AI-assisted project development. Provides skills,
|
|
|
6
6
|
|
|
7
7
|
## What you can build with Forge
|
|
8
8
|
|
|
9
|
-
Forge supports
|
|
9
|
+
Forge supports four kinds of projects. You pick one when you start — everything else is automatic.
|
|
10
10
|
|
|
11
11
|
| Project type | What it is | Example ideas |
|
|
12
12
|
| --- | --- | --- |
|
|
13
13
|
| **Browser game** | An interactive game that runs in a web browser — 2D, arcade, puzzle, adventure | Catch falling stars, tile-matching puzzle, platformer |
|
|
14
14
|
| **Governance / library** | A code library or governance-only project — no website, no game, no video, just structure and documentation | npm package, internal toolkit, documentation hub |
|
|
15
15
|
| **Godot game** | A desktop or mobile game built with Godot 4.x and C# — 2D, 3D, platformer, RPG | Top-down adventure, 3D platformer, puzzle game |
|
|
16
|
+
| **Knowledge system** | An evidence-backed knowledge base — structured datasets where claims are backed by registered source provenance | Game knowledge base, domain ontology, curated reference dataset |
|
|
16
17
|
|
|
17
18
|
Each project type gets its own scaffold: the right folder structure, the right dependencies, the right tools. You don't need to know what any of those are — Forge sets them up for you.
|
|
18
19
|
|
|
@@ -28,22 +29,26 @@ For full project lifecycle management — missions, releases, deployment, certif
|
|
|
28
29
|
| --- | --- | --- |
|
|
29
30
|
| `@warpgogol/werkstatt` | Runtime engine — missions, releases, Leitstand deployment, certification, Bordbuch, artifact store | All project types with lifecycle management |
|
|
30
31
|
| `@warpgogol/werkstatt-shared` | Shared infrastructure — checks, integration, ontology, passport | Installed automatically with the engine |
|
|
31
|
-
| `@warpgogol/werkstatt-game` | Phaser game plugin —
|
|
32
|
-
| `@warpgogol/werkstatt-godot` | Godot plugin — scene validators, dotnet build, itch.io deploy, Godot skills | Godot game projects (`godot-csharp`) |
|
|
32
|
+
| `@warpgogol/werkstatt-phaser-game` | Phaser game plugin — phaser validators, Vite build, deploy adapters | Browser game projects (`phaser-turborepo`) |
|
|
33
|
+
| `@warpgogol/werkstatt-godot-game` | Godot plugin — scene validators, dotnet build, itch.io deploy, Godot skills | Godot game projects (`godot-csharp`) |
|
|
34
|
+
| `@warpgogol/werkstatt-knowledge` | Knowledge plugin — source binding, canonical verification, extraction, materialization, release checks | Knowledge system projects (`knowledge-typescript-turborepo`) |
|
|
33
35
|
|
|
34
36
|
### When you need these packages
|
|
35
37
|
|
|
36
38
|
- **Governance-only projects** (RFCs, ADRs, skills, documentation hubs) — Forge alone is sufficient.
|
|
37
|
-
- **Games, Godot projects** — install `@warpgogol/werkstatt` (the engine) plus the matching stack plugin. The `forge-bootstrap` skill configures bindings automatically; the packages themselves must be installed as devDependencies.
|
|
39
|
+
- **Games, Godot projects, Knowledge systems** — install `@warpgogol/werkstatt` (the engine) plus the matching stack plugin. The `forge-bootstrap` skill configures bindings automatically; the packages themselves must be installed as devDependencies.
|
|
38
40
|
|
|
39
41
|
### Installing engine packages
|
|
40
42
|
|
|
41
43
|
```sh
|
|
42
44
|
# Browser game project
|
|
43
|
-
pnpm add -D @warpgogol/werkstatt @warpgogol/werkstatt-game
|
|
45
|
+
pnpm add -D @warpgogol/werkstatt @warpgogol/werkstatt-phaser-game
|
|
44
46
|
|
|
45
47
|
# Godot game project
|
|
46
|
-
pnpm add -D @warpgogol/werkstatt @warpgogol/werkstatt-godot
|
|
48
|
+
pnpm add -D @warpgogol/werkstatt @warpgogol/werkstatt-godot-game
|
|
49
|
+
|
|
50
|
+
# Knowledge system project
|
|
51
|
+
pnpm add -D @warpgogol/werkstatt @warpgogol/werkstatt-knowledge
|
|
47
52
|
```
|
|
48
53
|
|
|
49
54
|
> **Note for agents:** When scaffolding a new project with `forge create`, always install the engine and matching stack plugin after the scaffold completes. The `forge.yaml` bindings reference commands from these packages (e.g. `pnpm exec werkstatt run rfc.validate`), and they will fail if the packages are not installed.
|
|
@@ -201,11 +206,12 @@ You need to run one command in the terminal to create your project. After that,
|
|
|
201
206
|
|
|
202
207
|
The project name is derived from the folder name (`my-game` in this example). You can override it with `--name`. This populates the current folder with everything Forge needs — skills, configuration, and project structure. For other project types, use a different `--profile`:
|
|
203
208
|
|
|
204
|
-
| What you want to build | Profile flag
|
|
205
|
-
| ----------------------------------- |
|
|
206
|
-
| Browser game (2D, arcade, puzzle) | `--profile phaser-turborepo`
|
|
207
|
-
| Godot game (desktop, mobile, 2D/3D) | `--profile godot-csharp`
|
|
208
|
-
|
|
|
209
|
+
| What you want to build | Profile flag |
|
|
210
|
+
| ----------------------------------- | ------------------------------------------ |
|
|
211
|
+
| Browser game (2D, arcade, puzzle) | `--profile phaser-turborepo` |
|
|
212
|
+
| Godot game (desktop, mobile, 2D/3D) | `--profile godot-csharp` |
|
|
213
|
+
| Knowledge system (evidence-backed) | `--profile knowledge-typescript-turborepo` |
|
|
214
|
+
| Library or governance-only project | `--profile forge-shell` |
|
|
209
215
|
|
|
210
216
|
2. **Open the project folder in your AI IDE.** Open the folder from step 1 in Windsurf or your preferred IDE.
|
|
211
217
|
|
|
@@ -282,6 +288,9 @@ pnpm dlx @warpgogol/forge@latest create --in-place --profile phaser-turborepo
|
|
|
282
288
|
mkdir my-godot-game && cd my-godot-game
|
|
283
289
|
pnpm dlx @warpgogol/forge@latest create --in-place --profile godot-csharp
|
|
284
290
|
|
|
291
|
+
mkdir my-knowledge-base && cd my-knowledge-base
|
|
292
|
+
pnpm dlx @warpgogol/forge@latest create --in-place --profile knowledge-typescript-turborepo
|
|
293
|
+
|
|
285
294
|
# Override the project name (derived from folder name by default)
|
|
286
295
|
pnpm dlx @warpgogol/forge@latest create --in-place --profile forge-shell --name my-custom-name
|
|
287
296
|
```
|
|
@@ -330,6 +339,7 @@ A stack profile defines the project scaffold: directory structure, dependencies,
|
|
|
330
339
|
| `forge-shell` | Governance / library | Minimal Forge shell (default) | — | Governance-only projects, libraries, non-web projects |
|
|
331
340
|
| `phaser-turborepo` | Browser game | Phaser + TypeScript + pnpm + Turborepo | `games/my-game` | Browser games, interactive experiences |
|
|
332
341
|
| `godot-csharp` | Godot game | Godot 4.x + C# + pnpm + Turborepo | `games/my-game` | Desktop/mobile games, Godot-based interactive projects |
|
|
342
|
+
| `knowledge-typescript-turborepo` | Knowledge system | TypeScript + pnpm + Turborepo | `knowledge/my-kb` | Evidence-backed knowledge bases, structured datasets with source provenance |
|
|
333
343
|
|
|
334
344
|
```sh
|
|
335
345
|
# List available profiles (after install)
|
|
@@ -357,7 +367,7 @@ pnpm exec forge doctor
|
|
|
357
367
|
|
|
358
368
|
## What forge gives you
|
|
359
369
|
|
|
360
|
-
- **
|
|
370
|
+
- **37 skills** (fo-pipeline, grilling, preferences, skill authoring) — deployed to `.agents/skills/` by `forge create`
|
|
361
371
|
- **RFC workflow** — create, validate, list, graph, archive, acceptance probes, decision logs, DNA trace
|
|
362
372
|
- **ADR workflow** — lightweight architectural decision records
|
|
363
373
|
- **Spec vendoring** — vendor external spec packages as immutable snapshots with integrity manifests
|
|
@@ -433,7 +443,7 @@ await forgeRfcModule.register(registry);
|
|
|
433
443
|
| `src/` | Portable core — types, config, skills registry, validators, onboarding. Zero `@warpgogol/*` imports. |
|
|
434
444
|
| `os/` | ForgeModule registrations. `compass` and `werkstatt` are fully autonomous (RFC-0556) — all handlers inlined, no `@warpgogol/*` imports. |
|
|
435
445
|
| `bin/` | CLI entrypoint (`forge` command). |
|
|
436
|
-
| `skills/` |
|
|
446
|
+
| `skills/` | 37 skill definitions (29 fo + 5 shared + 3 meta) with SKILL.md frontmatter. |
|
|
437
447
|
| `profiles/` | Stack profiles for `scaffold`. |
|
|
438
448
|
|
|
439
449
|
## Publishing to npm
|
package/README.uk.md
CHANGED
|
@@ -6,13 +6,14 @@
|
|
|
6
6
|
|
|
7
7
|
## Що можна створити за допомогою Forge
|
|
8
8
|
|
|
9
|
-
Forge підтримує
|
|
9
|
+
Forge підтримує чотири типи проєктів. Ви обираєте один на старті — все інше відбувається автоматично.
|
|
10
10
|
|
|
11
11
|
| Тип проєкту | Що це | Приклади |
|
|
12
12
|
| --- | --- | --- |
|
|
13
13
|
| **Браузерна гра** | Інтерактивна гра, що працює в браузері — 2D, аркада, головоломка, пригода | Лови зірки, головоломка з плитками, платформер |
|
|
14
14
|
| **Управління / бібліотека** | Бібліотека коду або проєкт лише з управлінською структурою — без сайту, без гри, без відео, лише структура та документація | npm-пакет, внутрішній інструмент, центр документації |
|
|
15
15
|
| **Гра Godot** | Десктопна або мобільна гра на Godot 4.x з C# — 2D, 3D, платформер, RPG | Пригода з виглядом зверху, 3D-платформер, головоломка |
|
|
16
|
+
| **Система знань** | База знань з підтримкою доказів — структуровані набори даних, де твердження підтверджені зареєстрованими джерелами | База знань гри, доменна онтологія, куратований довідковий набір даних |
|
|
16
17
|
|
|
17
18
|
Кожен тип проєкту отримує власний каркас: правильну структуру папок, правильні залежності, правильні інструменти. Вам не потрібно знати, що це таке — Forge налаштує все за вас.
|
|
18
19
|
|
|
@@ -28,22 +29,26 @@ Forge — це **шар управління**: навички, RFC/ADR робо
|
|
|
28
29
|
| --- | --- | --- |
|
|
29
30
|
| `@warpgogol/werkstatt` | Рушій runtime — місії, релізи, розгортання Leitstand, сертифікація, Bordbuch, сховище артефактів | Усі типи проєктів з управлінням життєвим циклом |
|
|
30
31
|
| `@warpgogol/werkstatt-shared` | Спільна інфраструктура — перевірки, інтеграція, онтологія, паспорт | Встановлюється автоматично з рушієм |
|
|
31
|
-
| `@warpgogol/werkstatt-game` | Плагін Phaser-гри — валідатори
|
|
32
|
-
| `@warpgogol/werkstatt-godot` | Плагін Godot — валідатори сцен, збірка dotnet, розгортання itch.io, навички Godot | Проєкти ігор Godot (`godot-csharp`) |
|
|
32
|
+
| `@warpgogol/werkstatt-phaser-game` | Плагін Phaser-гри — валідатори phaser, збірка Vite, адаптери розгортання | Проєкти браузерних ігор (`phaser-turborepo`) |
|
|
33
|
+
| `@warpgogol/werkstatt-godot-game` | Плагін Godot — валідатори сцен, збірка dotnet, розгортання itch.io, навички Godot | Проєкти ігор Godot (`godot-csharp`) |
|
|
34
|
+
| `@warpgogol/werkstatt-knowledge` | Плагін системи знань — прив'язка джерел, канонічна верифікація, екстракція, матеріалізація, перевірки релізу | Проєкти систем знань (`knowledge-typescript-turborepo`) |
|
|
33
35
|
|
|
34
36
|
### Коли потрібні ці пакети
|
|
35
37
|
|
|
36
38
|
- **Проєкти лише з управлінням** (RFC, ADR, навички, центри документації) — Forge сам по собі достатній.
|
|
37
|
-
- **Ігри, проєкти Godot
|
|
39
|
+
- **Ігри, проєкти Godot, системи знань** — встановіть `@warpgogol/werkstatt` (рушій) плюс відповідний плагін стеку. Навичка `forge-bootstrap` налаштовує прив'язки автоматично; самі пакети потрібно встановити як devDependencies.
|
|
38
40
|
|
|
39
41
|
### Встановлення пакунків рушія
|
|
40
42
|
|
|
41
43
|
```sh
|
|
42
44
|
# Проєкт браузерної гри
|
|
43
|
-
pnpm add -D @warpgogol/werkstatt @warpgogol/werkstatt-game
|
|
45
|
+
pnpm add -D @warpgogol/werkstatt @warpgogol/werkstatt-phaser-game
|
|
44
46
|
|
|
45
47
|
# Проєкт гри Godot
|
|
46
|
-
pnpm add -D @warpgogol/werkstatt @warpgogol/werkstatt-godot
|
|
48
|
+
pnpm add -D @warpgogol/werkstatt @warpgogol/werkstatt-godot-game
|
|
49
|
+
|
|
50
|
+
# Проєкт системи знань
|
|
51
|
+
pnpm add -D @warpgogol/werkstatt @warpgogol/werkstatt-knowledge
|
|
47
52
|
```
|
|
48
53
|
|
|
49
54
|
> **Примітка для агентів:** Після створення проєкту командою `forge create` завжди встановлюйте рушій та відповідний плагін стеку. Прив'язки в `forge.yaml` посилаються на команди з цих пакунків (напр. `pnpm exec werkstatt run rfc.validate`), і вони не працюватимуть, якщо пакунки не встановлені.
|
|
@@ -193,11 +198,12 @@ dotnet --version
|
|
|
193
198
|
|
|
194
199
|
Назва проєкту визначається з назви папки (`my-game` у цьому прикладі). Ви можете перевизначити її прапорцем `--name`. Це наповнює поточну папку усьом, що потрібно Forge — навичками, конфігурацією та структурою проєкту. Для інших типів проєктів використовуйте інший `--profile`:
|
|
195
200
|
|
|
196
|
-
| Що ви хочете створити | Прапорець профілю
|
|
197
|
-
| ---------------------------------------- |
|
|
198
|
-
| Браузерна гра (2D, аркада, головоломка) | `--profile phaser-turborepo`
|
|
199
|
-
| Гра Godot (десктоп, мобільний, 2D/3D) | `--profile godot-csharp`
|
|
200
|
-
|
|
|
201
|
+
| Що ви хочете створити | Прапорець профілю |
|
|
202
|
+
| ---------------------------------------- | ------------------------------------------ |
|
|
203
|
+
| Браузерна гра (2D, аркада, головоломка) | `--profile phaser-turborepo` |
|
|
204
|
+
| Гра Godot (десктоп, мобільний, 2D/3D) | `--profile godot-csharp` |
|
|
205
|
+
| Система знань (з підтримкою доказів) | `--profile knowledge-typescript-turborepo` |
|
|
206
|
+
| Бібліотека або проєкт лише з управлінням | `--profile forge-shell` |
|
|
201
207
|
|
|
202
208
|
2. **Відкрийте папку проєкту в вашому IDE.** Відкрийте папку з кроку 1 у Windsurf або вашому IDE.
|
|
203
209
|
|
|
@@ -322,6 +328,7 @@ pnpm exec forge skill.list
|
|
|
322
328
|
| `forge-shell` | Управління / бібліотека | Мінімальний каркас Forge (за замовчуванням) | — | Проєкти лише з управлінням, бібліотеки, невеб-проєкти |
|
|
323
329
|
| `phaser-turborepo` | Браузерна гра | Phaser + TypeScript + pnpm + Turborepo | `games/my-game` | Браузерні ігри, інтерактивні досвіди |
|
|
324
330
|
| `godot-csharp` | Гра Godot | Godot 4.x + C# + pnpm + Turborepo | `games/my-game` | Десктопні/мобільні ігри, інтерактивні проєкти на Godot |
|
|
331
|
+
| `knowledge-typescript-turborepo` | Система знань | TypeScript + pnpm + Turborepo | `knowledge/my-kb` | Бази знань з підтримкою доказів, структуровані набори даних з джерельною простежуваністю |
|
|
325
332
|
|
|
326
333
|
```sh
|
|
327
334
|
# Список доступних профілів (після встановлення)
|
|
@@ -349,7 +356,7 @@ pnpm exec forge doctor
|
|
|
349
356
|
|
|
350
357
|
## Що дає Forge
|
|
351
358
|
|
|
352
|
-
- **
|
|
359
|
+
- **37 навичок** (fo-pipeline, grilling, preferences, написання навичок) — розгортаються у `.agents/skills/` командою `forge create`
|
|
353
360
|
- **RFC робочий процес** — створення, валідація, список, граф, архівування, acceptance-зондування, журнали рішень, DNA-трасування
|
|
354
361
|
- **ADR робочий процес** — легковісні архітектурні записи рішень
|
|
355
362
|
- **Вендоринг специфікацій** — вендоринг зовнішніх пакетів специфікацій як незмінних знімків з маніфестами цілісності
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../../os/session/handlers/validate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../../os/session/handlers/validate.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAML,KAAK,uBAAuB,EAE7B,MAAM,aAAa,CAAC;AAgBrB,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,iBAAiB,EACxB,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,kBAAkB,CAAC,uBAAuB,CAAC,CAAC,CA8LtD"}
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
<purpose>
|
|
4
4
|
session.validate handler — checks session frontmatter schema (SES-01),
|
|
5
5
|
id-filename match (SES-02), RFC-id existence (SES-03), raw file hygiene
|
|
6
|
-
(SES-04),
|
|
6
|
+
(SES-04), non-markdown file detection (SES-05), and missing checkpoint
|
|
7
|
+
fields in implementation/mission sessions (SES-06, RFC-0884).
|
|
7
8
|
</purpose>
|
|
8
9
|
<non-goals>
|
|
9
10
|
<item>Does not move or modify files — that is session.archive.</item>
|
|
@@ -12,6 +13,7 @@ id-filename match (SES-02), RFC-id existence (SES-03), raw file hygiene
|
|
|
12
13
|
</MODULE_CONTRACT>
|
|
13
14
|
<CHANGE_SUMMARY>
|
|
14
15
|
<item>RFC-0537: implement session.validate command handler.</item>
|
|
16
|
+
<item>RFC-0884: add SES-06 warning for missing checkpoint fields in implementation/mission sessions.</item>
|
|
15
17
|
</CHANGE_SUMMARY>
|
|
16
18
|
*/
|
|
17
19
|
import path from "node:path";
|
|
@@ -76,7 +78,9 @@ export async function runSessionValidate(input, context) {
|
|
|
76
78
|
}
|
|
77
79
|
}
|
|
78
80
|
// SES-01: Check types is a valid array
|
|
81
|
+
// typesArray is also used by SES-06 below — hoisted here to make the coupling explicit.
|
|
79
82
|
const typesValue = fm["types"];
|
|
83
|
+
const typesArray = Array.isArray(typesValue) ? typesValue : [];
|
|
80
84
|
if (Array.isArray(typesValue)) {
|
|
81
85
|
for (const t of typesValue) {
|
|
82
86
|
if (!SESSION_TYPES.includes(t)) {
|
|
@@ -129,6 +133,24 @@ export async function runSessionValidate(input, context) {
|
|
|
129
133
|
});
|
|
130
134
|
}
|
|
131
135
|
}
|
|
136
|
+
// SES-06: Missing checkpoint fields in implementation/mission sessions
|
|
137
|
+
// typesArray is extracted by SES-01 above.
|
|
138
|
+
const isImplOrMission = typesArray.includes("implementation") || typesArray.includes("mission");
|
|
139
|
+
if (isImplOrMission) {
|
|
140
|
+
const hasCheckpointFields = "systemDelta" in fm ||
|
|
141
|
+
"diagrams" in fm ||
|
|
142
|
+
"evidence" in fm ||
|
|
143
|
+
"remainingIssues" in fm ||
|
|
144
|
+
"checkpoint" in fm;
|
|
145
|
+
if (!hasCheckpointFields) {
|
|
146
|
+
violations.push({
|
|
147
|
+
rule: SES_RULES.SES_06,
|
|
148
|
+
file: relFile,
|
|
149
|
+
message: "Implementation/mission session missing checkpoint frontmatter fields (systemDelta, diagrams, evidence, remainingIssues, checkpoint). Agent should populate these during fo-session-save.",
|
|
150
|
+
severity: "warning",
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
}
|
|
132
154
|
}
|
|
133
155
|
// SES-04: Raw files in .raw/ that haven't been processed (warning)
|
|
134
156
|
const rawFiles = await listRawFiles(sessionDirPath);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../../os/session/handlers/validate.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../../os/session/handlers/validate.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AAC;gBACnB,MAAM,CAAC,KAAK,CAAC,GAAG,UAAU,cAAc,SAAS,aAAa,CAAC,CAAC;YAClE,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,IAAI,CAAC,GAAG,SAAS,gCAAgC,CAAC,CAAC;YAC5D,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO;QACL,IAAI,EAAE;YACJ,OAAO,EAAE,kBAAkB;YAC3B,MAAM,EAAE,YAAY;YACpB,UAAU;YACV,OAAO,EAAE,eAAe,CAAC,MAAM;SAChC;QACD,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3B,OAAO,EAAE,SAAS;YAChB,CAAC,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,MAAM,iBAAiB;YAC7E,CAAC,CAAC,OAAO,eAAe,CAAC,MAAM,oCAAoC;KACtE,CAAC;AACJ,CAAC"}
|
|
@@ -5,7 +5,7 @@ export declare const SESSION_ID_PATTERN: RegExp;
|
|
|
5
5
|
export declare const SESSION_FILE_PATTERN: RegExp;
|
|
6
6
|
export declare const SESSION_TYPES: readonly ["mission", "grilling", "implementation", "review", "fix", "freeform"];
|
|
7
7
|
export type SessionType = (typeof SESSION_TYPES)[number];
|
|
8
|
-
export declare const SESSION_KNOWN_KEYS: readonly ["id", "date", "duration", "types", "summary", "relatedRfcs", "relatedArtifacts", "decisions", "commits", "files", "commands"];
|
|
8
|
+
export declare const SESSION_KNOWN_KEYS: readonly ["id", "date", "duration", "types", "summary", "relatedRfcs", "relatedArtifacts", "decisions", "commits", "files", "commands", "systemDelta", "diagrams", "evidence", "remainingIssues", "checkpoint"];
|
|
9
9
|
export declare const SESSION_REQUIRED_KEYS: readonly ["id", "date", "types"];
|
|
10
10
|
export declare const SESSION_REQUIRED_SECTIONS: readonly ["## Transcript"];
|
|
11
11
|
export declare const SES_RULES: {
|
|
@@ -14,8 +14,33 @@ export declare const SES_RULES: {
|
|
|
14
14
|
readonly SES_03: "SES-03";
|
|
15
15
|
readonly SES_04: "SES-04";
|
|
16
16
|
readonly SES_05: "SES-05";
|
|
17
|
+
readonly SES_06: "SES-06";
|
|
17
18
|
};
|
|
18
19
|
export type SesRule = (typeof SES_RULES)[keyof typeof SES_RULES];
|
|
20
|
+
export interface SessionCheckpoint {
|
|
21
|
+
before: string;
|
|
22
|
+
change: string;
|
|
23
|
+
after: string;
|
|
24
|
+
}
|
|
25
|
+
export interface SessionDiagram {
|
|
26
|
+
type: "flowchart" | "sequenceDiagram" | "stateDiagram-v2" | "erDiagram" | "none";
|
|
27
|
+
scope: "current-system" | "session-delta";
|
|
28
|
+
caption: string;
|
|
29
|
+
mermaid: string;
|
|
30
|
+
}
|
|
31
|
+
export interface SessionEvidenceEntry {
|
|
32
|
+
claim: string;
|
|
33
|
+
source?: string;
|
|
34
|
+
test?: string;
|
|
35
|
+
command?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface SessionSystemDelta {
|
|
38
|
+
changedContracts: string[];
|
|
39
|
+
changedSchemas: string[];
|
|
40
|
+
changedStateMachines: string[];
|
|
41
|
+
changedInvariants: string[];
|
|
42
|
+
changedPersistence: string[];
|
|
43
|
+
}
|
|
19
44
|
export interface SessionFrontmatter {
|
|
20
45
|
id: string;
|
|
21
46
|
date: string;
|
|
@@ -28,6 +53,11 @@ export interface SessionFrontmatter {
|
|
|
28
53
|
commits: string[];
|
|
29
54
|
files: string[];
|
|
30
55
|
commands: string[];
|
|
56
|
+
systemDelta?: SessionSystemDelta;
|
|
57
|
+
diagrams?: SessionDiagram[];
|
|
58
|
+
evidence?: SessionEvidenceEntry[];
|
|
59
|
+
remainingIssues?: string[];
|
|
60
|
+
checkpoint?: SessionCheckpoint;
|
|
31
61
|
}
|
|
32
62
|
export interface SessionSaveResult {
|
|
33
63
|
command: "session.save";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../os/session/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../os/session/types.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,WAAW,kBAAkB,CAAC;AAC3C,eAAO,MAAM,kBAAkB,SAAS,CAAC;AACzC,eAAO,MAAM,sBAAsB,YAAY,CAAC;AAChD,eAAO,MAAM,kBAAkB,QAAsD,CAAC;AACtF,eAAO,MAAM,oBAAoB,QAA0D,CAAC;AAE5F,eAAO,MAAM,aAAa,iFAOhB,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,eAAO,MAAM,kBAAkB,iNAiBrB,CAAC;AAEX,eAAO,MAAM,qBAAqB,kCAAmC,CAAC;AAEtE,eAAO,MAAM,yBAAyB,4BAA6B,CAAC;AAGpE,eAAO,MAAM,SAAS;;;;;;;CAOZ,CAAC;AAEX,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AAIjE,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,WAAW,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,WAAW,GAAG,MAAM,CAAC;IACjF,KAAK,EAAE,gBAAgB,GAAG,eAAe,CAAC;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,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AC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,cAAc,CAAC;IACxB,MAAM,EAAE,IAAI,CAAC;IACb,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;CACf"}
|
package/dist/os/session/types.js
CHANGED
|
@@ -11,6 +11,7 @@ validation rule identifiers.
|
|
|
11
11
|
</MODULE_CONTRACT>
|
|
12
12
|
<CHANGE_SUMMARY>
|
|
13
13
|
<item>RFC-0537: initial session domain types, constants, and SES rule identifiers.</item>
|
|
14
|
+
<item>RFC-0884: add checkpoint interfaces, extend SessionFrontmatter with optional checkpoint fields, add SES-06 rule.</item>
|
|
14
15
|
</CHANGE_SUMMARY>
|
|
15
16
|
*/
|
|
16
17
|
export const SESSION_DIR = "docs/sessions";
|
|
@@ -38,6 +39,11 @@ export const SESSION_KNOWN_KEYS = [
|
|
|
38
39
|
"commits",
|
|
39
40
|
"files",
|
|
40
41
|
"commands",
|
|
42
|
+
"systemDelta",
|
|
43
|
+
"diagrams",
|
|
44
|
+
"evidence",
|
|
45
|
+
"remainingIssues",
|
|
46
|
+
"checkpoint",
|
|
41
47
|
];
|
|
42
48
|
export const SESSION_REQUIRED_KEYS = ["id", "date", "types"];
|
|
43
49
|
export const SESSION_REQUIRED_SECTIONS = ["## Transcript"];
|
|
@@ -48,5 +54,6 @@ export const SES_RULES = {
|
|
|
48
54
|
SES_03: "SES-03",
|
|
49
55
|
SES_04: "SES-04",
|
|
50
56
|
SES_05: "SES-05",
|
|
57
|
+
SES_06: "SES-06",
|
|
51
58
|
};
|
|
52
59
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../os/session/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../os/session/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;EAeE;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC;AAC3C,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AACzC,MAAM,CAAC,MAAM,sBAAsB,GAAG,SAAS,CAAC;AAChD,MAAM,CAAC,MAAM,kBAAkB,GAAG,mDAAmD,CAAC;AACtF,MAAM,CAAC,MAAM,oBAAoB,GAAG,uDAAuD,CAAC;AAE5F,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,SAAS;IACT,UAAU;IACV,gBAAgB;IAChB,QAAQ;IACR,KAAK;IACL,UAAU;CACF,CAAC;AAIX,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,IAAI;IACJ,MAAM;IACN,UAAU;IACV,OAAO;IACP,SAAS;IACT,aAAa;IACb,kBAAkB;IAClB,WAAW;IACX,SAAS;IACT,OAAO;IACP,UAAU;IACV,aAAa;IACb,UAAU;IACV,UAAU;IACV,iBAAiB;IACjB,YAAY;CACJ,CAAC;AAEX,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAU,CAAC;AAEtE,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,eAAe,CAAU,CAAC;AAEpE,uBAAuB;AACvB,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;CACR,CAAC"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>Register the Architectural Decision Record (ADR) command domain with the forge kernel registry.</purpose>
|
|
4
|
+
<non-goals>
|
|
5
|
+
<item>Do not implement command logic here; implementations live in handlers/*.ts.</item>
|
|
6
|
+
</non-goals>
|
|
7
|
+
</MODULE_CONTRACT>
|
|
8
|
+
<CHANGE_SUMMARY>
|
|
9
|
+
<item>RFC-0366: register adr.create, adr.validate, and adr.list commands.</item>
|
|
10
|
+
<item>RFC-0521: migrated from packages/os/site-kernel/src/adr/ to packages/forge/os/adr/ as forgeAdrModule.</item>
|
|
11
|
+
<item>RFC-0727: register adr.implement.stamp command for atomic ADR status transition.</item>
|
|
12
|
+
</CHANGE_SUMMARY>
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import type { ForgeModule } from "../../src/forge-module.ts";
|
|
16
|
+
|
|
17
|
+
export const forgeAdrModule: ForgeModule = {
|
|
18
|
+
name: "forge-adr",
|
|
19
|
+
version: "0.1.0",
|
|
20
|
+
|
|
21
|
+
async register(registry) {
|
|
22
|
+
const { runAdrList, runAdrCreate } = await import("./handlers/list-create.ts");
|
|
23
|
+
const { runAdrValidate } = await import("./handlers/validate.ts");
|
|
24
|
+
const { runAdrArchive } = await import("./handlers/archive.ts");
|
|
25
|
+
const { runAdrImplementStamp } = await import("./handlers/implement-stamp.ts");
|
|
26
|
+
|
|
27
|
+
registry.registerCommand({
|
|
28
|
+
name: "adr.list",
|
|
29
|
+
description:
|
|
30
|
+
"List all ADRs. Filter with --status, --scope, --decider flags. " +
|
|
31
|
+
"Use --json for machine-readable output. " +
|
|
32
|
+
"Parses frontmatter on the fly — no index file needed.",
|
|
33
|
+
scope: "workspace",
|
|
34
|
+
flags: {
|
|
35
|
+
status: {
|
|
36
|
+
kind: "string",
|
|
37
|
+
description: "Filter by ADR status (e.g. proposed, accepted, superseded).",
|
|
38
|
+
},
|
|
39
|
+
scope: {
|
|
40
|
+
kind: "string",
|
|
41
|
+
description: "Filter by ADR scope (package, app, workspace).",
|
|
42
|
+
},
|
|
43
|
+
decider: { kind: "string", description: "Filter by decider string." },
|
|
44
|
+
},
|
|
45
|
+
reads: ["docs/adrs/**/*.md"],
|
|
46
|
+
execute: runAdrList,
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
registry.registerCommand({
|
|
50
|
+
name: "adr.create",
|
|
51
|
+
description:
|
|
52
|
+
"Create a new ADR draft from the template. " +
|
|
53
|
+
'Pass --title "Short title" (required). ' +
|
|
54
|
+
"Optional: --scope, --decider, --status, --related. " +
|
|
55
|
+
"Always creates status: proposed unless overridden. " +
|
|
56
|
+
"AI agents are allowed to use this command.",
|
|
57
|
+
scope: "workspace",
|
|
58
|
+
mutatesState: true,
|
|
59
|
+
writes: ["docs/adrs/adr-*.md"],
|
|
60
|
+
reads: ["docs/adrs/**/*.md"],
|
|
61
|
+
cacheable: false,
|
|
62
|
+
flags: {
|
|
63
|
+
title: { kind: "string", required: true, description: "Short imperative ADR title." },
|
|
64
|
+
scope: {
|
|
65
|
+
kind: "string",
|
|
66
|
+
default: "package",
|
|
67
|
+
description: "ADR scope: package | app | workspace.",
|
|
68
|
+
},
|
|
69
|
+
decider: {
|
|
70
|
+
kind: "string",
|
|
71
|
+
default: "architecture",
|
|
72
|
+
description: "ADR decider, e.g. architecture or human:<handle>.",
|
|
73
|
+
},
|
|
74
|
+
status: {
|
|
75
|
+
kind: "string",
|
|
76
|
+
default: "proposed",
|
|
77
|
+
description: "ADR status: proposed | accepted | superseded | rejected.",
|
|
78
|
+
},
|
|
79
|
+
related: {
|
|
80
|
+
kind: "string",
|
|
81
|
+
description: "Comma-separated list of related RFC/ADR ids (e.g. RFC-0365,RFC-0001).",
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
execute: runAdrCreate,
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
registry.registerCommand({
|
|
88
|
+
name: "adr.validate",
|
|
89
|
+
description:
|
|
90
|
+
"Validate ADR frontmatter schema, required markdown sections, " +
|
|
91
|
+
"referential integrity (supersedes/supersededBy), and id/filename consistency. " +
|
|
92
|
+
"Pass --id to validate a single file, or run without arguments for all.",
|
|
93
|
+
scope: "workspace",
|
|
94
|
+
flags: {
|
|
95
|
+
id: { kind: "string", description: "Target a single ADR by id (e.g. ADR-0003)." },
|
|
96
|
+
},
|
|
97
|
+
reads: ["docs/adrs/**/*.md"],
|
|
98
|
+
execute: runAdrValidate,
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
registry.registerCommand({
|
|
102
|
+
name: "adr.archive",
|
|
103
|
+
description:
|
|
104
|
+
"Move terminal-status ADR files (implemented, rejected, superseded) into " +
|
|
105
|
+
"docs/adrs/archive/<status>/ subdirectories. Bidirectional: moves non-terminal " +
|
|
106
|
+
"files found in subdirectories back to root. Use --dry-run to preview. " +
|
|
107
|
+
"Use --status to filter to a single terminal status. " +
|
|
108
|
+
"Prefer the docs.archive umbrella command unless you need to archive only ADRs.",
|
|
109
|
+
scope: "workspace",
|
|
110
|
+
mutatesState: true,
|
|
111
|
+
writes: ["docs/adrs/*.md", "docs/adrs/archive/**"],
|
|
112
|
+
reads: ["docs/adrs/**/*.md"],
|
|
113
|
+
cacheable: false,
|
|
114
|
+
flags: {
|
|
115
|
+
"dry-run": {
|
|
116
|
+
kind: "boolean",
|
|
117
|
+
description: "Preview what would be moved without touching the filesystem.",
|
|
118
|
+
},
|
|
119
|
+
status: {
|
|
120
|
+
kind: "string",
|
|
121
|
+
description: "Filter to a single terminal status (implemented, rejected, superseded).",
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
execute: runAdrArchive,
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
registry.registerCommand({
|
|
128
|
+
name: "adr.implement.stamp",
|
|
129
|
+
description:
|
|
130
|
+
"Atomically transition an ADR from accepted/proposed to implemented. " +
|
|
131
|
+
"Validates preconditions (status, implementation commit, file cleanliness, " +
|
|
132
|
+
"concurrent safety) and mutates frontmatter in one atomic write. " +
|
|
133
|
+
"Use --dry-run to preview without mutating.",
|
|
134
|
+
scope: "workspace",
|
|
135
|
+
mutatesState: true,
|
|
136
|
+
writes: ["docs/adrs/*.md"],
|
|
137
|
+
reads: ["docs/adrs/**/*.md"],
|
|
138
|
+
cacheable: false,
|
|
139
|
+
flags: {
|
|
140
|
+
id: {
|
|
141
|
+
kind: "string",
|
|
142
|
+
required: true,
|
|
143
|
+
description: "Target ADR id (e.g. ADR-0003).",
|
|
144
|
+
},
|
|
145
|
+
"implementation-commit": {
|
|
146
|
+
kind: "string",
|
|
147
|
+
required: true,
|
|
148
|
+
description: "SHA of the implementation commit.",
|
|
149
|
+
},
|
|
150
|
+
"dry-run": {
|
|
151
|
+
kind: "boolean",
|
|
152
|
+
description: "Preview without mutating the ADR file.",
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
execute: runAdrImplementStamp,
|
|
156
|
+
});
|
|
157
|
+
},
|
|
158
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>
|
|
4
|
+
Shared ADR frontmatter file I/O — list ADR files and parse their YAML frontmatter
|
|
5
|
+
without validating the shape.
|
|
6
|
+
</purpose>
|
|
7
|
+
<non-goals>
|
|
8
|
+
<item>Do not validate frontmatter shape — that is the validate handler.</item>
|
|
9
|
+
</non-goals>
|
|
10
|
+
</MODULE_CONTRACT>
|
|
11
|
+
<CHANGE_SUMMARY>
|
|
12
|
+
<item>RFC-0366: mirror the RFC frontmatter-io contract for ADRs.</item>
|
|
13
|
+
<item>RFC-0521: migrated from packages/os/site-kernel/src/adr/ to packages/forge/os/adr/.</item>
|
|
14
|
+
</CHANGE_SUMMARY>
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import fs from "node:fs/promises";
|
|
18
|
+
import path from "node:path";
|
|
19
|
+
import YAML from "yaml";
|
|
20
|
+
|
|
21
|
+
export interface ParsedAdr {
|
|
22
|
+
frontmatter: Record<string, unknown>;
|
|
23
|
+
body: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function parseAdrFile(source: string): ParsedAdr {
|
|
27
|
+
const match = source.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/);
|
|
28
|
+
if (!match) {
|
|
29
|
+
return { frontmatter: {}, body: source };
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
frontmatter: (YAML.parse(match[1]!) ?? {}) as Record<string, unknown>,
|
|
33
|
+
body: match[2] ?? "",
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export async function listAdrFiles(adrDirPath: string): Promise<string[]> {
|
|
38
|
+
const results: string[] = [];
|
|
39
|
+
|
|
40
|
+
async function scanDir(dirPath: string, relativePrefix: string): Promise<void> {
|
|
41
|
+
try {
|
|
42
|
+
const entries = await fs.readdir(dirPath, { withFileTypes: true });
|
|
43
|
+
for (const entry of entries) {
|
|
44
|
+
const relativePath = relativePrefix ? `${relativePrefix}/${entry.name}` : entry.name;
|
|
45
|
+
if (entry.isDirectory()) {
|
|
46
|
+
await scanDir(path.join(dirPath, entry.name), relativePath);
|
|
47
|
+
} else if (
|
|
48
|
+
entry.isFile() &&
|
|
49
|
+
entry.name.endsWith(".md") &&
|
|
50
|
+
!entry.name.startsWith("adr-0000") &&
|
|
51
|
+
entry.name !== "README.md"
|
|
52
|
+
) {
|
|
53
|
+
results.push(relativePath);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
} catch {
|
|
57
|
+
// Directory doesn't exist or is unreadable — return empty
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
await scanDir(adrDirPath, "");
|
|
62
|
+
return results.sort();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function adrFileMatchesId(fileName: string, targetId: string): boolean {
|
|
66
|
+
return path.basename(fileName).toLowerCase().startsWith(targetId.toLowerCase());
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export async function readAndParseAdr(
|
|
70
|
+
adrDirPath: string,
|
|
71
|
+
fileName: string,
|
|
72
|
+
): Promise<{ fileName: string; parsed: ParsedAdr } | undefined> {
|
|
73
|
+
try {
|
|
74
|
+
const filePath = path.join(adrDirPath, fileName);
|
|
75
|
+
const content = await fs.readFile(filePath, "utf-8");
|
|
76
|
+
return { fileName, parsed: parseAdrFile(content) };
|
|
77
|
+
} catch {
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
}
|