@warpgogol/forge 2.9.11 → 2.9.23
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/dist/bin/cli.js +1 -1
- package/dist/os/adr/adr.module.d.ts.map +1 -1
- package/dist/os/adr/adr.module.js +1 -0
- package/dist/os/adr/adr.module.js.map +1 -1
- package/dist/os/audit/audit.module.d.ts.map +1 -1
- package/dist/os/audit/audit.module.js +1 -0
- package/dist/os/audit/audit.module.js.map +1 -1
- package/dist/os/compass/compass.module.d.ts.map +1 -1
- package/dist/os/compass/compass.module.js +1 -0
- package/dist/os/compass/compass.module.js.map +1 -1
- package/dist/os/compass/handlers/compass-inventory-handler.d.ts.map +1 -1
- package/dist/os/compass/handlers/compass-inventory-handler.js +82 -1
- package/dist/os/compass/handlers/compass-inventory-handler.js.map +1 -1
- package/dist/os/core/core.module.d.ts.map +1 -1
- package/dist/os/core/core.module.js +16 -0
- package/dist/os/core/core.module.js.map +1 -1
- package/dist/os/core/handlers/assets-helpers.js +1 -1
- package/dist/os/core/handlers/assets-helpers.js.map +1 -1
- package/dist/os/core/handlers/determinism-check.js +1 -1
- package/dist/os/core/handlers/determinism-check.js.map +1 -1
- package/dist/os/core/handlers/forge-autonomy-validate.d.ts +18 -0
- package/dist/os/core/handlers/forge-autonomy-validate.d.ts.map +1 -0
- package/dist/os/core/handlers/forge-autonomy-validate.js +78 -0
- package/dist/os/core/handlers/forge-autonomy-validate.js.map +1 -0
- package/dist/os/core/handlers/knowledge-compact.d.ts.map +1 -1
- package/dist/os/core/handlers/knowledge-compact.js +7 -1
- package/dist/os/core/handlers/knowledge-compact.js.map +1 -1
- package/dist/os/core/handlers/release-prepare.js +1 -1
- package/dist/os/core/handlers/release-prepare.js.map +1 -1
- package/dist/os/exploration/exploration.module.d.ts.map +1 -1
- package/dist/os/exploration/exploration.module.js +1 -0
- package/dist/os/exploration/exploration.module.js.map +1 -1
- package/dist/os/mission/mission.module.d.ts.map +1 -1
- package/dist/os/mission/mission.module.js +1 -0
- package/dist/os/mission/mission.module.js.map +1 -1
- package/dist/os/naming/naming.module.d.ts.map +1 -1
- package/dist/os/naming/naming.module.js +1 -0
- package/dist/os/naming/naming.module.js.map +1 -1
- package/dist/os/notes/notes.module.d.ts.map +1 -1
- package/dist/os/notes/notes.module.js +1 -0
- package/dist/os/notes/notes.module.js.map +1 -1
- package/dist/os/plan/plan.module.d.ts.map +1 -1
- package/dist/os/plan/plan.module.js +1 -0
- package/dist/os/plan/plan.module.js.map +1 -1
- package/dist/os/plugin/plugin.module.d.ts +25 -0
- package/dist/os/plugin/plugin.module.d.ts.map +1 -0
- package/dist/os/plugin/plugin.module.js +208 -0
- package/dist/os/plugin/plugin.module.js.map +1 -0
- package/dist/os/program/program.module.d.ts.map +1 -1
- package/dist/os/program/program.module.js +1 -0
- package/dist/os/program/program.module.js.map +1 -1
- package/dist/os/rfc/rfc.module.d.ts.map +1 -1
- package/dist/os/rfc/rfc.module.js +1 -0
- package/dist/os/rfc/rfc.module.js.map +1 -1
- package/dist/os/session/session.module.d.ts.map +1 -1
- package/dist/os/session/session.module.js +1 -0
- package/dist/os/session/session.module.js.map +1 -1
- package/dist/os/spec/spec.module.d.ts.map +1 -1
- package/dist/os/spec/spec.module.js +1 -0
- package/dist/os/spec/spec.module.js.map +1 -1
- package/dist/os/werkstatt/handlers/workspace-deps.d.ts.map +1 -0
- package/dist/os/{core → werkstatt}/handlers/workspace-deps.js +4 -3
- package/dist/os/werkstatt/handlers/workspace-deps.js.map +1 -0
- package/dist/os/werkstatt/werkstatt.module.d.ts.map +1 -1
- package/dist/os/werkstatt/werkstatt.module.js +1 -0
- package/dist/os/werkstatt/werkstatt.module.js.map +1 -1
- package/dist/os/workflow/workflow.module.d.ts.map +1 -1
- package/dist/os/workflow/workflow.module.js +1 -0
- package/dist/os/workflow/workflow.module.js.map +1 -1
- package/dist/src/compass/contract-registry.d.ts +7 -0
- package/dist/src/compass/contract-registry.d.ts.map +1 -0
- package/dist/src/compass/contract-registry.js +93 -0
- package/dist/src/compass/contract-registry.js.map +1 -0
- package/dist/src/compass/types.d.ts +28 -0
- package/dist/src/compass/types.d.ts.map +1 -0
- package/dist/src/compass/types.js +14 -0
- package/dist/src/compass/types.js.map +1 -0
- package/dist/src/forge-module.d.ts +1 -0
- package/dist/src/forge-module.d.ts.map +1 -1
- package/dist/src/forge-module.js +2 -1
- package/dist/src/forge-module.js.map +1 -1
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +3 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/onboarding/doctor.d.ts.map +1 -1
- package/dist/src/onboarding/doctor.js +89 -7
- package/dist/src/onboarding/doctor.js.map +1 -1
- package/dist/src/onboarding/init.d.ts.map +1 -1
- package/dist/src/onboarding/init.js +22 -1
- package/dist/src/onboarding/init.js.map +1 -1
- package/dist/src/onboarding/scaffold.d.ts.map +1 -1
- package/dist/src/onboarding/scaffold.js +1 -0
- package/dist/src/onboarding/scaffold.js.map +1 -1
- package/dist/src/onboarding/upgrade.d.ts.map +1 -1
- package/dist/src/onboarding/upgrade.js +7 -1
- package/dist/src/onboarding/upgrade.js.map +1 -1
- package/dist/src/plugin/ForgePluginManifest.d.ts +38 -0
- package/dist/src/plugin/ForgePluginManifest.d.ts.map +1 -0
- package/dist/src/plugin/ForgePluginManifest.js +52 -0
- package/dist/src/plugin/ForgePluginManifest.js.map +1 -0
- package/dist/src/registry.d.ts.map +1 -1
- package/dist/src/registry.js +28 -0
- package/dist/src/registry.js.map +1 -1
- package/dist/src/validators/port-validate.js +3 -3
- package/dist/src/validators/port-validate.js.map +1 -1
- package/os/adr/adr.module.ts +1 -0
- package/os/audit/audit.module.ts +1 -0
- package/os/compass/compass.module.ts +1 -0
- package/os/compass/handlers/compass-inventory-handler.ts +107 -1
- package/os/core/core.module.ts +18 -0
- package/os/core/handlers/assets-helpers.ts +1 -1
- package/os/core/handlers/determinism-check.ts +1 -1
- package/os/core/handlers/forge-autonomy-validate.ts +115 -0
- package/os/core/handlers/knowledge-compact.ts +6 -1
- package/os/core/handlers/release-prepare.ts +1 -1
- package/os/exploration/exploration.module.ts +1 -0
- package/os/mission/mission.module.ts +1 -0
- package/os/naming/naming.module.ts +1 -0
- package/os/notes/notes.module.ts +1 -0
- package/os/plan/plan.module.ts +1 -0
- package/os/plugin/plugin.module.ts +261 -0
- package/os/program/program.module.ts +1 -0
- package/os/rfc/rfc.module.ts +1 -0
- package/os/session/session.module.ts +1 -0
- package/os/spec/spec.module.ts +1 -0
- package/os/{core → werkstatt}/handlers/workspace-deps.ts +4 -3
- package/os/werkstatt/werkstatt.module.ts +1 -0
- package/os/workflow/workflow.module.ts +1 -0
- package/package.json +13 -3
- package/profiles/forge-shell.yaml +1 -1
- package/profiles/godot-csharp.yaml +13 -13
- package/profiles/knowledge-typescript-turborepo.yaml +1 -1
- package/profiles/phaser-turborepo.yaml +13 -13
- package/skills/fo/fo-add-tests/SKILL.md +54 -0
- package/skills/fo/fo-compass-annotate/SKILL.md +1 -0
- package/skills/fo/fo-idea-implement/SKILL.md +80 -0
- package/src/compass/contract-registry.ts +114 -0
- package/src/compass/types.ts +45 -0
- package/src/forge-module.ts +3 -1
- package/src/index.ts +17 -0
- package/src/onboarding/doctor.ts +89 -7
- package/src/onboarding/init.ts +20 -1
- package/src/onboarding/scaffold.ts +1 -0
- package/src/onboarding/templates/behavioral-layer-core.md +9 -0
- package/src/onboarding/upgrade.ts +6 -1
- package/src/plugin/ForgePluginManifest.ts +76 -0
- package/src/registry.ts +36 -0
- package/src/tests/contract-registry.test.ts +248 -0
- package/src/tests/discover-pack-skills.test.ts +112 -0
- package/src/tests/doctor-autonomy.test.ts +3 -3
- package/src/tests/fixtures/agents-generate-business-before.txt +9 -0
- package/src/tests/forge-autonomy-validate.test.ts +157 -0
- package/src/tests/plugin-manifest.test.ts +226 -0
- package/src/tests/upgrade.test.ts +5 -0
- package/src/validators/port-validate.ts +3 -3
- package/dist/os/core/handlers/workspace-deps.d.ts.map +0 -1
- package/dist/os/core/handlers/workspace-deps.js.map +0 -1
- /package/dist/os/{core → werkstatt}/handlers/workspace-deps.d.ts +0 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const forgePluginManifestSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
version: z.ZodString;
|
|
5
|
+
extensionPoints: z.ZodOptional<z.ZodObject<{
|
|
6
|
+
compass: z.ZodOptional<z.ZodObject<{
|
|
7
|
+
contract: z.ZodOptional<z.ZodObject<{
|
|
8
|
+
blocks: z.ZodArray<z.ZodObject<{
|
|
9
|
+
blockId: z.ZodString;
|
|
10
|
+
requiredFor: z.ZodArray<z.ZodString>;
|
|
11
|
+
requiredTags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
12
|
+
name: z.ZodString;
|
|
13
|
+
minWords: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
}, z.core.$strip>>>;
|
|
15
|
+
}, z.core.$strip>>;
|
|
16
|
+
}, z.core.$strip>>;
|
|
17
|
+
}, z.core.$strict>>;
|
|
18
|
+
}, z.core.$strict>>;
|
|
19
|
+
}, z.core.$strict>;
|
|
20
|
+
export interface ForgePluginManifest {
|
|
21
|
+
id: string;
|
|
22
|
+
version: string;
|
|
23
|
+
extensionPoints?: {
|
|
24
|
+
compass?: {
|
|
25
|
+
contract?: {
|
|
26
|
+
blocks: Array<{
|
|
27
|
+
blockId: string;
|
|
28
|
+
requiredFor: string[];
|
|
29
|
+
requiredTags?: Array<{
|
|
30
|
+
name: string;
|
|
31
|
+
minWords?: number;
|
|
32
|
+
}>;
|
|
33
|
+
}>;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=ForgePluginManifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ForgePluginManifest.d.ts","sourceRoot":"","sources":["../../../src/plugin/ForgePluginManifest.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoCxB,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;kBAQ3B,CAAC;AAEZ,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE;QAChB,OAAO,CAAC,EAAE;YACR,QAAQ,CAAC,EAAE;gBACT,MAAM,EAAE,KAAK,CAAC;oBACZ,OAAO,EAAE,MAAM,CAAC;oBAChB,WAAW,EAAE,MAAM,EAAE,CAAC;oBACtB,YAAY,CAAC,EAAE,KAAK,CAAC;wBAAE,IAAI,EAAE,MAAM,CAAC;wBAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;qBAAE,CAAC,CAAC;iBAC3D,CAAC,CAAC;aACJ,CAAC;SACH,CAAC;KACH,CAAC;CACH"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>ForgePluginManifest — pack identity contract for project-declared skill packs (RFC-0941). Strict Zod schema with optional extensionPoints (RFC-0943).</purpose>
|
|
4
|
+
<non-goals>
|
|
5
|
+
<item>Do not add forgeRange, commands, or skills fields — deferred until real use cases emerge.</item>
|
|
6
|
+
<item>Do not replace forge.yaml bindings — the manifest declares pack identity and extension points only.</item>
|
|
7
|
+
<item>Do not allow pack-provided validate() functions — extension points are declarative data, not executable code.</item>
|
|
8
|
+
</non-goals>
|
|
9
|
+
</MODULE_CONTRACT>
|
|
10
|
+
<CHANGE_SUMMARY>
|
|
11
|
+
<item>RFC-0941: initial ForgePluginManifest interface and Zod schema.</item>
|
|
12
|
+
<item>RFC-0943: added optional extensionPoints.compass.contract field for declarative Compass contract block specs.</item>
|
|
13
|
+
</CHANGE_SUMMARY>
|
|
14
|
+
*/
|
|
15
|
+
import { z } from "zod";
|
|
16
|
+
const KEBAB_CASE_REGEX = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;
|
|
17
|
+
const SEMVER_REGEX = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
|
|
18
|
+
const compassContractBlockSpecSchema = z.object({
|
|
19
|
+
blockId: z
|
|
20
|
+
.string()
|
|
21
|
+
.regex(KEBAB_CASE_REGEX, "blockId must be kebab-case (lowercase letters, digits, hyphens)"),
|
|
22
|
+
requiredFor: z.array(z.string().min(1)).min(1),
|
|
23
|
+
requiredTags: z
|
|
24
|
+
.array(z.object({
|
|
25
|
+
name: z.string().min(1),
|
|
26
|
+
minWords: z.number().int().positive().optional(),
|
|
27
|
+
}))
|
|
28
|
+
.optional(),
|
|
29
|
+
});
|
|
30
|
+
const compassContractExtensionPointSchema = z.object({
|
|
31
|
+
blocks: z.array(compassContractBlockSpecSchema),
|
|
32
|
+
});
|
|
33
|
+
const extensionPointsSchema = z
|
|
34
|
+
.object({
|
|
35
|
+
compass: z
|
|
36
|
+
.object({
|
|
37
|
+
contract: compassContractExtensionPointSchema.optional(),
|
|
38
|
+
})
|
|
39
|
+
.strict()
|
|
40
|
+
.optional(),
|
|
41
|
+
})
|
|
42
|
+
.strict();
|
|
43
|
+
export const forgePluginManifestSchema = z
|
|
44
|
+
.object({
|
|
45
|
+
id: z
|
|
46
|
+
.string()
|
|
47
|
+
.regex(KEBAB_CASE_REGEX, "id must be kebab-case (lowercase letters, digits, hyphens)"),
|
|
48
|
+
version: z.string().regex(SEMVER_REGEX, "version must be a valid semver string (e.g. 1.0.0)"),
|
|
49
|
+
extensionPoints: extensionPointsSchema.optional(),
|
|
50
|
+
})
|
|
51
|
+
.strict();
|
|
52
|
+
//# sourceMappingURL=ForgePluginManifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ForgePluginManifest.js","sourceRoot":"","sources":["../../../src/plugin/ForgePluginManifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;EAaE;AAEF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,gBAAgB,GAAG,iCAAiC,CAAC;AAC3D,MAAM,YAAY,GAChB,qLAAqL,CAAC;AAExL,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,KAAK,CAAC,gBAAgB,EAAE,iEAAiE,CAAC;IAC7F,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9C,YAAY,EAAE,CAAC;SACZ,KAAK,CACJ,CAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QACvB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;KACjD,CAAC,CACH;SACA,QAAQ,EAAE;CACd,CAAC,CAAC;AAEH,MAAM,mCAAmC,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,8BAA8B,CAAC;CAChD,CAAC,CAAC;AAEH,MAAM,qBAAqB,GAAG,CAAC;KAC5B,MAAM,CAAC;IACN,OAAO,EAAE,CAAC;SACP,MAAM,CAAC;QACN,QAAQ,EAAE,mCAAmC,CAAC,QAAQ,EAAE;KACzD,CAAC;SACD,MAAM,EAAE;SACR,QAAQ,EAAE;CACd,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC;KACvC,MAAM,CAAC;IACN,EAAE,EAAE,CAAC;SACF,MAAM,EAAE;SACR,KAAK,CAAC,gBAAgB,EAAE,4DAA4D,CAAC;IACxF,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,YAAY,EAAE,oDAAoD,CAAC;IAC7F,eAAe,EAAE,qBAAqB,CAAC,QAAQ,EAAE;CAClD,CAAC;KACD,MAAM,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/registry.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAG5D;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,IAAI,GAAG,QAAQ,GAAG,MAAM,CAAC;IACnC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;IAC7B,QAAQ,EAAE,WAAW,GAAG,eAAe,GAAG,kBAAkB,GAAG,eAAe,CAAC;IAC/E,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,cAAc,EAAE,CA+E/F;AA4ED,eAAO,MAAM,YAAY,EAAE,eAAe,EAAqC,CAAC"}
|
package/dist/src/registry.js
CHANGED
|
@@ -17,11 +17,13 @@
|
|
|
17
17
|
<item>RFC-0524: added optional knowledge?: string[] field for cumulative knowledge system. Added knowledge arrays to fo-site-scan and grilling.</item>
|
|
18
18
|
<item>RFC-0538: added fo-compass-annotate skill (22nd fo skill) — full-lifecycle Compass header management replacing removed compass.annotate, compass.clear, compass.markup.migrate, compass.invariant.add kernel commands.</item>
|
|
19
19
|
<item>RFC-0539: added discoverPackSkills helper and PackSkillEntry interface for project-declared skill packs. Removed mission-complete and fo-site-scan entries (relocated to warpgogol-skills as wg- pack skills).</item>
|
|
20
|
+
<item>RFC-0941: discoverPackSkills now requires forge.plugin.yaml manifest at each pack root — throws on missing or invalid manifest (fail-fast).</item>
|
|
20
21
|
</CHANGE_SUMMARY>
|
|
21
22
|
*/
|
|
22
23
|
import fs from "node:fs";
|
|
23
24
|
import path from "node:path";
|
|
24
25
|
import { parse as parseYaml } from "yaml";
|
|
26
|
+
import { forgePluginManifestSchema } from "./plugin/ForgePluginManifest.js";
|
|
25
27
|
/**
|
|
26
28
|
* Discover skills in project-declared skill packs by scanning each pack's
|
|
27
29
|
* directory for `<prefix>-<name>/SKILL.md` entries (RFC-0539).
|
|
@@ -37,6 +39,32 @@ export function discoverPackSkills(workspaceRoot, config) {
|
|
|
37
39
|
const packDir = path.resolve(workspaceRoot, pack.dir);
|
|
38
40
|
if (!fs.existsSync(packDir))
|
|
39
41
|
continue;
|
|
42
|
+
const manifestPath = path.join(packDir, "forge.plugin.yaml");
|
|
43
|
+
if (!fs.existsSync(manifestPath)) {
|
|
44
|
+
throw new Error(`forge.plugin.yaml not found at ${packDir} for pack prefix "${pack.prefix}". ` +
|
|
45
|
+
"Run `forge init` to create manifests for declared skill packs (RFC-0941).");
|
|
46
|
+
}
|
|
47
|
+
let manifestRaw;
|
|
48
|
+
try {
|
|
49
|
+
manifestRaw = fs.readFileSync(manifestPath, "utf-8");
|
|
50
|
+
}
|
|
51
|
+
catch (err) {
|
|
52
|
+
throw new Error(`Failed to read forge.plugin.yaml at ${manifestPath}: ${err.message}`);
|
|
53
|
+
}
|
|
54
|
+
let manifestParsed;
|
|
55
|
+
try {
|
|
56
|
+
manifestParsed = parseYaml(manifestRaw);
|
|
57
|
+
}
|
|
58
|
+
catch (err) {
|
|
59
|
+
throw new Error(`forge.plugin.yaml at ${manifestPath} is not valid YAML: ${err.message}`);
|
|
60
|
+
}
|
|
61
|
+
const manifestResult = forgePluginManifestSchema.safeParse(manifestParsed);
|
|
62
|
+
if (!manifestResult.success) {
|
|
63
|
+
const issues = manifestResult.error.issues
|
|
64
|
+
.map((i) => `${i.path.join(".")}: ${i.message}`)
|
|
65
|
+
.join("; ");
|
|
66
|
+
throw new Error(`forge.plugin.yaml at ${manifestPath} failed schema validation: ${issues}`);
|
|
67
|
+
}
|
|
40
68
|
const entries = fs.readdirSync(packDir, { withFileTypes: true });
|
|
41
69
|
for (const entry of entries) {
|
|
42
70
|
if (!entry.isDirectory())
|
package/dist/src/registry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/registry.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;EAqBE;AAEF,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAE1C,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AA+B5E;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,aAAqB,EAAE,MAAmB;IAC3E,MAAM,MAAM,GAAqB,EAAE,CAAC;IACpC,IAAI,CAA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;gBACP,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC;oBAC/B,CAAC,CAAC;wBACE,QAAQ,EAAG,EAAE,CAAC,UAAU,CAAe,CAAC,MAAM,CAC5C,CAAC,CAAC,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAC1C;qBACF;oBACH,CAAC,CAAC,EAAE,CAAC;aACR,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAC7D,CAAC;AAED,SAAS,iBAAiB;IACxB,MAAM,UAAU,GAAG;QACjB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC;QACjD,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC;KACxD,CAAC;IACF,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,IAAI,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC;YAAE,OAAO,SAAS,CAAC;IACjD,CAAC;IACD,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC;AACvB,CAAC;AACD,MAAM,WAAW,GAAG,iBAAiB,EAAE,CAAC;AACxC,MAAM,CAAC,MAAM,YAAY,GAAsB,mBAAmB,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -14,10 +14,10 @@ import path from "node:path";
|
|
|
14
14
|
import { FORGE_SKILLS } from "../registry.js";
|
|
15
15
|
// RFC-0556: removed @warpgogol/site-kernel-checks and @warpgogol/site-kernel-handoff
|
|
16
16
|
// from this list — os/compass and os/werkstatt no longer import them (handlers inlined).
|
|
17
|
-
// RFC-0776: @warpgogol/site-kernel replaced by @warpgogol/werkstatt/kernel.
|
|
18
|
-
// @warpgogol/werkstatt/kernel remains forbidden for src/ portability.
|
|
17
|
+
// RFC-0776: @warpgogol/site-kernel replaced by @warpgogol/werkstatt-engine/kernel.
|
|
18
|
+
// @warpgogol/werkstatt-engine/kernel remains forbidden for src/ portability.
|
|
19
19
|
const FORBIDDEN_IMPORTS = [
|
|
20
|
-
"@warpgogol/werkstatt/kernel",
|
|
20
|
+
"@warpgogol/werkstatt-engine/kernel",
|
|
21
21
|
"@warpgogol/werkstatt-site/ui",
|
|
22
22
|
"@warpgogol/werkstatt-shared/share/page",
|
|
23
23
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"port-validate.js","sourceRoot":"","sources":["../../../src/validators/port-validate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQ9C,qFAAqF;AACrF,yFAAyF;AACzF,
|
|
1
|
+
{"version":3,"file":"port-validate.js","sourceRoot":"","sources":["../../../src/validators/port-validate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAEF,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQ9C,qFAAqF;AACrF,yFAAyF;AACzF,mFAAmF;AACnF,6EAA6E;AAC7E,MAAM,iBAAiB,GAAG;IACxB,oCAAoC;IACpC,8BAA8B;IAC9B,wCAAwC;CACzC,CAAC;AAEF,MAAM,UAAU,eAAe,CAC7B,KAAmC,EACnC,OAAgB;IAEhB,MAAM,GAAG,GAAG,OAAqC,CAAC;IAClD,MAAM,aAAa,GAAG,GAAG,EAAE,aAAa,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IAC1D,MAA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,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;QACjD,UAAU;KACX,CAAC;AACJ,CAAC;AAED,SAAS,uBAAuB,CAAC,GAAW,EAAE,SAAmB,EAAE,UAAoB;IACrF,MAAM,OAAO,GAAG,EAAE,CAAC,WAAW,CAAC,GAAG,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7D,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QAC5C,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,uBAAuB,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;QAC3D,CAAC;aAAM,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YACrE,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;YAClD,KAAK,MAAM,GAAG,IAAI,SAAS,EAAE,CAAC;gBAC5B,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;oBAC1B,UAAU,CAAC,IAAI,CACb,qBAAqB,GAAG,cAAc,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,QAAQ,CAAC,EAAE,CAC/E,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/os/adr/adr.module.ts
CHANGED
|
@@ -17,6 +17,7 @@ import type { ForgeModule } from "../../src/forge-module.ts";
|
|
|
17
17
|
export const forgeAdrModule: ForgeModule = {
|
|
18
18
|
name: "forge-adr",
|
|
19
19
|
version: "0.1.0",
|
|
20
|
+
runtime: "autonomous",
|
|
20
21
|
|
|
21
22
|
async register(registry) {
|
|
22
23
|
const { runAdrList, runAdrCreate } = await import("./handlers/list-create.ts");
|
package/os/audit/audit.module.ts
CHANGED
|
@@ -15,6 +15,7 @@ import type { ForgeModule } from "../../src/forge-module.ts";
|
|
|
15
15
|
export const forgeAuditModule: ForgeModule = {
|
|
16
16
|
name: "forge-audit",
|
|
17
17
|
version: "0.1.0",
|
|
18
|
+
runtime: "autonomous",
|
|
18
19
|
async register(registry) {
|
|
19
20
|
const { runAuditArchive } = await import("./handlers/archive.ts");
|
|
20
21
|
|
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
<purpose>Compass inventory and validation command handlers. Moved from
|
|
4
4
|
@warpgogol/site-kernel-checks to @warpgogol/forge for full autonomous mode (RFC-0556).
|
|
5
5
|
Provides runCompassInventory (XML report generation) and runCompassValidation
|
|
6
|
-
(compliance diagnostics with COMPASS-* rules)
|
|
6
|
+
(compliance diagnostics with COMPASS-* rules). RFC-0943: validates pack-declared
|
|
7
|
+
contract block specs alongside built-in MODULE_CONTRACT and CHANGE_SUMMARY checks.</purpose>
|
|
7
8
|
<non-goals>
|
|
8
9
|
<item>Do not handle raw file parsing or content analysis.</item>
|
|
9
10
|
<item>Do not manage configuration or orchestration of external services.</item>
|
|
11
|
+
<item>Do not execute pack-provided validate() functions — pack block specs are declarative data interpreted here.</item>
|
|
10
12
|
</non-goals>
|
|
11
13
|
</MODULE_CONTRACT>
|
|
12
14
|
<CHANGE_SUMMARY>
|
|
@@ -14,6 +16,7 @@ Provides runCompassInventory (XML report generation) and runCompassValidation
|
|
|
14
16
|
<item>RFC-0350: added COMPASS-TODO-01 diagnostic for unfilled Compass TODO sentinels.</item>
|
|
15
17
|
<item>RFC-0556: moved from @warpgogol/site-kernel-checks to @warpgogol/forge for autonomous mode.</item>
|
|
16
18
|
<item>Game extensions: added COMPASS-SYNTAX-01 diagnostic validating comment syntax per file type (.gd needs # prefix, .tscn/.tres need ; prefix, .ts/.cs need block comment).</item>
|
|
19
|
+
<item>RFC-0943: added COMPASS-PLUGIN-01/02/03 diagnostics for pack-declared contract block specs from forge.plugin.yaml extensionPoints.</item>
|
|
17
20
|
</CHANGE_SUMMARY>
|
|
18
21
|
*/
|
|
19
22
|
|
|
@@ -22,12 +25,27 @@ import { readFile } from "node:fs/promises";
|
|
|
22
25
|
import { createCompassInventoryEntries, type CompassInventoryEntry } from "./compass-inventory.ts";
|
|
23
26
|
import { resolveCompassScanRoot } from "./resolve-scan-root.ts";
|
|
24
27
|
import { writeFileIfChanged } from "../../../src/utils/fs-idempotent.ts";
|
|
28
|
+
import { loadForgeConfig } from "../../../src/config/forge-config.ts";
|
|
29
|
+
import {
|
|
30
|
+
loadContractRegistry,
|
|
31
|
+
findApplicablePackSpecs,
|
|
32
|
+
} from "../../../src/compass/contract-registry.ts";
|
|
33
|
+
import type {
|
|
34
|
+
CompassContractBlockSpec,
|
|
35
|
+
CompassContractRegistryEntry,
|
|
36
|
+
} from "../../../src/compass/types.ts";
|
|
25
37
|
import type {
|
|
26
38
|
ForgeCommandInput,
|
|
27
39
|
ForgeCommandResult,
|
|
28
40
|
ForgeRuntimeContext,
|
|
29
41
|
} from "../../../src/types.ts";
|
|
30
42
|
|
|
43
|
+
function extractBlockContentForPlugin(source: string, tagName: string): string | null {
|
|
44
|
+
const escapedTag = tagName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
45
|
+
const match = source.match(new RegExp(`<${escapedTag}>[\\s\\S]*?<\/${escapedTag}>`));
|
|
46
|
+
return match?.[0] ?? null;
|
|
47
|
+
}
|
|
48
|
+
|
|
31
49
|
const INVENTORY_OUTPUT_PATH = "docs/compass-inventory.xml";
|
|
32
50
|
|
|
33
51
|
function getExpectedCommentSyntax(filePath: string): "block" | "hash" | "semicolon" | null {
|
|
@@ -287,6 +305,7 @@ export async function runCompassValidation(
|
|
|
287
305
|
file: string;
|
|
288
306
|
message: string;
|
|
289
307
|
fix: string;
|
|
308
|
+
pack?: string;
|
|
290
309
|
}> = [];
|
|
291
310
|
|
|
292
311
|
for (const failure of failures) {
|
|
@@ -361,6 +380,93 @@ export async function runCompassValidation(
|
|
|
361
380
|
}
|
|
362
381
|
}
|
|
363
382
|
|
|
383
|
+
let registry: {
|
|
384
|
+
builtIn: CompassContractBlockSpec[];
|
|
385
|
+
pack: CompassContractRegistryEntry[];
|
|
386
|
+
} = { builtIn: [], pack: [] };
|
|
387
|
+
try {
|
|
388
|
+
const config = loadForgeConfig(context.workspaceRoot, context.forgeRoot);
|
|
389
|
+
registry = loadContractRegistry(context.workspaceRoot, config);
|
|
390
|
+
} catch {
|
|
391
|
+
// No forge.yaml or invalid config — skip pack-declared blocks
|
|
392
|
+
}
|
|
393
|
+
if (registry.pack.length > 0) {
|
|
394
|
+
for (const entry of entries) {
|
|
395
|
+
if (entry.authoringStatus !== "authored" || entry.requiredScaffolding === "none") {
|
|
396
|
+
continue;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
const applicableSpecs = findApplicablePackSpecs(registry, entry.path);
|
|
400
|
+
if (applicableSpecs.length === 0) continue;
|
|
401
|
+
|
|
402
|
+
const absPath = resolve(context.workspaceRoot, entry.path);
|
|
403
|
+
const source = await readFile(absPath, "utf8");
|
|
404
|
+
|
|
405
|
+
for (const spec of applicableSpecs) {
|
|
406
|
+
const blockMarker = `<${spec.blockId.toUpperCase().replace(/-/g, "_")}>`;
|
|
407
|
+
if (!source.includes(blockMarker)) {
|
|
408
|
+
context.logger.error(
|
|
409
|
+
`[compass.validate] COMPASS-PLUGIN-01: ${entry.path}: missing ${spec.blockId} block (declared by pack ${spec.packId})`,
|
|
410
|
+
);
|
|
411
|
+
diagnostics.push({
|
|
412
|
+
ruleId: "COMPASS-PLUGIN-01",
|
|
413
|
+
severity: "error",
|
|
414
|
+
file: entry.path,
|
|
415
|
+
message: `missing ${spec.blockId} block (declared by pack ${spec.packId})`,
|
|
416
|
+
fix: `fix: add a ${blockMarker} block to this file`,
|
|
417
|
+
pack: spec.packId,
|
|
418
|
+
});
|
|
419
|
+
continue;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
if (spec.requiredTags && spec.requiredTags.length > 0) {
|
|
423
|
+
const blockContent = extractBlockContentForPlugin(
|
|
424
|
+
source,
|
|
425
|
+
spec.blockId.toUpperCase().replace(/-/g, "_"),
|
|
426
|
+
);
|
|
427
|
+
for (const tag of spec.requiredTags) {
|
|
428
|
+
const tagMarker = `<${tag.name}>`;
|
|
429
|
+
if (!blockContent || !blockContent.includes(tagMarker)) {
|
|
430
|
+
context.logger.error(
|
|
431
|
+
`[compass.validate] COMPASS-PLUGIN-02: ${entry.path}: missing <${tag.name}> tag in ${spec.blockId} block (declared by pack ${spec.packId})`,
|
|
432
|
+
);
|
|
433
|
+
diagnostics.push({
|
|
434
|
+
ruleId: "COMPASS-PLUGIN-02",
|
|
435
|
+
severity: "error",
|
|
436
|
+
file: entry.path,
|
|
437
|
+
message: `missing <${tag.name}> tag in ${spec.blockId} block (declared by pack ${spec.packId})`,
|
|
438
|
+
fix: `fix: add a <${tag.name}> tag inside the ${blockMarker} block`,
|
|
439
|
+
pack: spec.packId,
|
|
440
|
+
});
|
|
441
|
+
continue;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
if (tag.minWords) {
|
|
445
|
+
const tagContent = extractBlockContentForPlugin(blockContent, tag.name);
|
|
446
|
+
if (tagContent) {
|
|
447
|
+
const text = tagContent.replace(/<[^>]+>/g, " ");
|
|
448
|
+
const wordCount = text.trim().split(/\s+/).filter(Boolean).length;
|
|
449
|
+
if (wordCount < tag.minWords) {
|
|
450
|
+
context.logger.error(
|
|
451
|
+
`[compass.validate] COMPASS-PLUGIN-03: ${entry.path}: <${tag.name}> in ${spec.blockId} has ${wordCount} words (minimum ${tag.minWords}, declared by pack ${spec.packId})`,
|
|
452
|
+
);
|
|
453
|
+
diagnostics.push({
|
|
454
|
+
ruleId: "COMPASS-PLUGIN-03",
|
|
455
|
+
severity: "error",
|
|
456
|
+
file: entry.path,
|
|
457
|
+
message: `<${tag.name}> in ${spec.blockId} has ${wordCount} words (minimum ${tag.minWords}, declared by pack ${spec.packId})`,
|
|
458
|
+
fix: `fix: write at least ${tag.minWords} words in the <${tag.name}> tag`,
|
|
459
|
+
pack: spec.packId,
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
|
|
364
470
|
const hasFailures = diagnostics.length > 0;
|
|
365
471
|
|
|
366
472
|
return {
|
package/os/core/core.module.ts
CHANGED
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
<item>RFC-0733: register forge pinned.validate and forge pinned.init commands for pinned-files protection system.</item>
|
|
26
26
|
<item>Lockfile safety net: docs.archive post-loop refreshes pnpm-lock.yaml after mission workpiece moves.</item>
|
|
27
27
|
<item>RFC-0877: forge.create --in-place required, --profile required, --name optional (derived from folder), strict empty-directory check (only .git/ tolerated).</item>
|
|
28
|
+
<item>RFC-0940: register forge.autonomy.validate command enforcing FORGE-AUTONOMY-01 (no @warpgogol/werkstatt-engine imports outside os/werkstatt/).</item>
|
|
28
29
|
</CHANGE_SUMMARY>
|
|
29
30
|
*/
|
|
30
31
|
|
|
@@ -47,6 +48,7 @@ import { loadForgeConfig } from "../../src/config/forge-config.ts";
|
|
|
47
48
|
export const forgeCoreModule: ForgeModule = {
|
|
48
49
|
name: "forge-core",
|
|
49
50
|
version: "0.1.0",
|
|
51
|
+
runtime: "autonomous",
|
|
50
52
|
async register(registry) {
|
|
51
53
|
const { runScaffold } = await import("../../src/onboarding/scaffold.ts");
|
|
52
54
|
const { runSkillValidate } = await import("../../src/validators/skill-validate.ts");
|
|
@@ -720,6 +722,22 @@ export const forgeCoreModule: ForgeModule = {
|
|
|
720
722
|
execute: runPackageHealth,
|
|
721
723
|
});
|
|
722
724
|
|
|
725
|
+
// ── forge.autonomy.validate (RFC-0940) ─────────────────────────────────────
|
|
726
|
+
const { runForgeAutonomyValidate } = await import("./handlers/forge-autonomy-validate.ts");
|
|
727
|
+
registry.registerCommand({
|
|
728
|
+
name: "forge.autonomy.validate",
|
|
729
|
+
description:
|
|
730
|
+
"Scan packages/forge/os/** for forbidden @warpgogol/werkstatt-engine imports outside os/werkstatt/. " +
|
|
731
|
+
"Enforces FORGE-AUTONOMY-01 (RFC-0940, DNA-64). @warpgogol/werkstatt-shared is exempt. " +
|
|
732
|
+
"Type-only imports (import type) are exempt.",
|
|
733
|
+
scope: "workspace",
|
|
734
|
+
supportsAllSites: false,
|
|
735
|
+
reads: ["packages/forge/os/**/*.ts"],
|
|
736
|
+
cacheable: false,
|
|
737
|
+
flags: {},
|
|
738
|
+
execute: runForgeAutonomyValidate,
|
|
739
|
+
});
|
|
740
|
+
|
|
723
741
|
// ── docs.archive ─────────────────────────────────────────────────────────
|
|
724
742
|
registry.registerCommand({
|
|
725
743
|
name: "docs.archive",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
import { readFile, stat } from "node:fs/promises";
|
|
15
15
|
import { join, relative, extname } from "node:path";
|
|
16
|
-
import { loadWorkspaceDeps } from "
|
|
16
|
+
import { loadWorkspaceDeps } from "../../werkstatt/handlers/workspace-deps.ts";
|
|
17
17
|
import type { ProfileAsset, ProfileAssetType } from "../../../src/profiles/profile-schema.ts";
|
|
18
18
|
|
|
19
19
|
export interface AssetEntry {
|
|
@@ -17,7 +17,7 @@ import { readFile, writeFile, mkdir } from "node:fs/promises";
|
|
|
17
17
|
import { existsSync } from "node:fs";
|
|
18
18
|
import { join, relative, dirname } from "node:path";
|
|
19
19
|
import { createHash } from "node:crypto";
|
|
20
|
-
import { loadWorkspaceDeps } from "
|
|
20
|
+
import { loadWorkspaceDeps } from "../../werkstatt/handlers/workspace-deps.ts";
|
|
21
21
|
import type {
|
|
22
22
|
ForgeCommandInput,
|
|
23
23
|
ForgeCommandResult,
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>forge.autonomy.validate — scans packages/forge/os/** for forbidden
|
|
4
|
+
@warpgogol/werkstatt-engine imports outside os/werkstatt/. Enforces FORGE-AUTONOMY-01
|
|
5
|
+
(RFC-0940, DNA-64). @warpgogol/werkstatt-shared is exempt (shared infrastructure).
|
|
6
|
+
Type-only imports (import type) are exempt.</purpose>
|
|
7
|
+
<keywords>autonomy, guard, RFC-0940, DNA-64, forge, import boundary</keywords>
|
|
8
|
+
<non-goals>
|
|
9
|
+
<item>Does not scan test files — .test.ts and .spec.ts are always excluded.</item>
|
|
10
|
+
<item>Does not scan os/werkstatt/ — the adapter directory may import @warpgogol/werkstatt-engine.</item>
|
|
11
|
+
<item>Does not flag @warpgogol/werkstatt-shared — shared infrastructure, not the engine.</item>
|
|
12
|
+
<item>Does not flag import type statements — type-only imports are erased at compile time.</item>
|
|
13
|
+
</non-goals>
|
|
14
|
+
</MODULE_CONTRACT>
|
|
15
|
+
<CHANGE_SUMMARY>
|
|
16
|
+
<item>RFC-0940: initial forge.autonomy.validate handler implementing FORGE-AUTONOMY-01.</item>
|
|
17
|
+
</CHANGE_SUMMARY>
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { readFile } from "node:fs/promises";
|
|
21
|
+
import { join } from "node:path";
|
|
22
|
+
import { scanDirectoryForImports } from "@warpgogol/werkstatt-shared/share/import-scan";
|
|
23
|
+
import type {
|
|
24
|
+
ForgeCommandInput,
|
|
25
|
+
ForgeCommandResult,
|
|
26
|
+
ForgeRuntimeContext,
|
|
27
|
+
} from "../../../src/types.ts";
|
|
28
|
+
|
|
29
|
+
const FORBIDDEN_PACKAGE = "@warpgogol/werkstatt-engine";
|
|
30
|
+
const ADAPTER_DIR_PREFIX = "packages/forge/os/werkstatt/";
|
|
31
|
+
|
|
32
|
+
export interface ForgeAutonomyViolation {
|
|
33
|
+
ruleId: "FORGE-AUTONOMY-01";
|
|
34
|
+
file: string;
|
|
35
|
+
specifier: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface ForgeAutonomyValidateResult {
|
|
39
|
+
command: "forge.autonomy.validate";
|
|
40
|
+
status: "pass" | "fail";
|
|
41
|
+
violations: ForgeAutonomyViolation[];
|
|
42
|
+
scannedFiles: number;
|
|
43
|
+
modules: Record<string, { runtime: "autonomous" | "werkstatt-adapter"; violations: number }>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function isTypeOnlyImport(content: string, specifier: string): boolean {
|
|
47
|
+
const specifierIdx = content.indexOf(specifier);
|
|
48
|
+
if (specifierIdx === -1) return false;
|
|
49
|
+
|
|
50
|
+
const importStart = content.lastIndexOf("import", specifierIdx);
|
|
51
|
+
if (importStart === -1) return false;
|
|
52
|
+
|
|
53
|
+
const importLine = content.slice(importStart, specifierIdx);
|
|
54
|
+
return /\bimport\s+type\b/.test(importLine);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export async function runForgeAutonomyValidate(
|
|
58
|
+
_input: ForgeCommandInput,
|
|
59
|
+
context: ForgeRuntimeContext,
|
|
60
|
+
): Promise<ForgeCommandResult<ForgeAutonomyValidateResult>> {
|
|
61
|
+
const workspaceRoot = context.workspaceRoot;
|
|
62
|
+
const forgeOsDir = join(workspaceRoot, "packages", "forge", "os");
|
|
63
|
+
|
|
64
|
+
const { violations: rawViolations, scannedFiles } = await scanDirectoryForImports(
|
|
65
|
+
forgeOsDir,
|
|
66
|
+
workspaceRoot,
|
|
67
|
+
(specifier) => specifier === FORBIDDEN_PACKAGE || specifier.startsWith(FORBIDDEN_PACKAGE + "/"),
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
const violations: ForgeAutonomyViolation[] = [];
|
|
71
|
+
for (const v of rawViolations) {
|
|
72
|
+
if (v.file.startsWith(ADAPTER_DIR_PREFIX)) continue;
|
|
73
|
+
|
|
74
|
+
const fullPath = join(workspaceRoot, v.file);
|
|
75
|
+
const content = await readFile(fullPath, "utf8").catch(() => "");
|
|
76
|
+
if (!isTypeOnlyImport(content, v.specifier)) {
|
|
77
|
+
violations.push({
|
|
78
|
+
ruleId: "FORGE-AUTONOMY-01",
|
|
79
|
+
file: v.file,
|
|
80
|
+
specifier: v.specifier,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const modules: Record<
|
|
86
|
+
string,
|
|
87
|
+
{ runtime: "autonomous" | "werkstatt-adapter"; violations: number }
|
|
88
|
+
> = {};
|
|
89
|
+
for (const v of violations) {
|
|
90
|
+
const parts = v.file.split("/");
|
|
91
|
+
const modKey = parts.slice(0, 4).join("/");
|
|
92
|
+
if (!modules[modKey]) {
|
|
93
|
+
const isAdapter = v.file.startsWith(ADAPTER_DIR_PREFIX);
|
|
94
|
+
modules[modKey] = {
|
|
95
|
+
runtime: isAdapter ? "werkstatt-adapter" : "autonomous",
|
|
96
|
+
violations: 0,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
modules[modKey]!.violations++;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const status = violations.length === 0 ? "pass" : "fail";
|
|
103
|
+
|
|
104
|
+
return {
|
|
105
|
+
data: {
|
|
106
|
+
command: "forge.autonomy.validate",
|
|
107
|
+
status,
|
|
108
|
+
violations,
|
|
109
|
+
scannedFiles,
|
|
110
|
+
modules,
|
|
111
|
+
},
|
|
112
|
+
exitCode: status === "pass" ? 0 : 1,
|
|
113
|
+
summary: `[forge.autonomy.validate] ${status.toUpperCase()} — ${violations.length} violation(s) across ${scannedFiles} files`,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
@@ -76,7 +76,12 @@ function discoverSkillKnowledgeFiles(
|
|
|
76
76
|
|
|
77
77
|
// Collect pack skills if --all or if --skill matches a pack skill
|
|
78
78
|
if (all || (skillName && !result.some((r) => r.skill === skillName))) {
|
|
79
|
-
|
|
79
|
+
let packSkills: ReturnType<typeof discoverPackSkills> = [];
|
|
80
|
+
try {
|
|
81
|
+
packSkills = discoverPackSkills(workspaceRoot, config);
|
|
82
|
+
} catch {
|
|
83
|
+
// Manifest missing or invalid — skip pack skills
|
|
84
|
+
}
|
|
80
85
|
for (const skill of packSkills) {
|
|
81
86
|
if (skillName && skill.name !== skillName) continue;
|
|
82
87
|
if (!skill.knowledge || skill.knowledge.length === 0) continue;
|
|
@@ -23,7 +23,7 @@ import type {
|
|
|
23
23
|
ForgeRuntimeContext,
|
|
24
24
|
} from "../../../src/types.ts";
|
|
25
25
|
import { resolveActiveProfile, resolveLifecycleFlags } from "./profile-resolve.ts";
|
|
26
|
-
import { loadWorkspaceDeps } from "
|
|
26
|
+
import { loadWorkspaceDeps } from "../../werkstatt/handlers/workspace-deps.ts";
|
|
27
27
|
import { writeFileIfChanged } from "../../../src/utils/fs-idempotent.ts";
|
|
28
28
|
import type { ProfileRelease } from "../../../src/profiles/profile-schema.ts";
|
|
29
29
|
|
|
@@ -15,6 +15,7 @@ import type { ForgeModule } from "../../src/forge-module.ts";
|
|
|
15
15
|
export const forgeExplorationModule: ForgeModule = {
|
|
16
16
|
name: "forge-exploration",
|
|
17
17
|
version: "0.1.0",
|
|
18
|
+
runtime: "autonomous",
|
|
18
19
|
async register(registry) {
|
|
19
20
|
const { runExplorationList } = await import("./handlers/list.ts");
|
|
20
21
|
const { runExplorationShow } = await import("./handlers/show.ts");
|
|
@@ -15,6 +15,7 @@ import type { ForgeModule } from "../../src/forge-module.ts";
|
|
|
15
15
|
export const forgeMissionModule: ForgeModule = {
|
|
16
16
|
name: "forge-mission",
|
|
17
17
|
version: "0.1.0",
|
|
18
|
+
runtime: "autonomous",
|
|
18
19
|
async register(registry) {
|
|
19
20
|
const { runMissionArchive } = await import("./handlers/archive.ts");
|
|
20
21
|
|
|
@@ -15,6 +15,7 @@ import type { ForgeModule } from "../../src/forge-module.ts";
|
|
|
15
15
|
export const forgeNamingModule: ForgeModule = {
|
|
16
16
|
name: "forge-naming",
|
|
17
17
|
version: "0.1.0",
|
|
18
|
+
runtime: "autonomous",
|
|
18
19
|
async register(registry) {
|
|
19
20
|
const { runNamingConventionLint } = await import("./naming-convention.ts");
|
|
20
21
|
registry.registerCommand({
|
package/os/notes/notes.module.ts
CHANGED
|
@@ -20,6 +20,7 @@ import type {
|
|
|
20
20
|
export const forgeNotesModule: ForgeModule = {
|
|
21
21
|
name: "forge-notes",
|
|
22
22
|
version: "0.1.0",
|
|
23
|
+
runtime: "autonomous",
|
|
23
24
|
async register(registry) {
|
|
24
25
|
const { runNoteLinkValidate } = await import("../../src/validators/note-link-validate.ts");
|
|
25
26
|
const { runNoteFrontmatterValidate } =
|
package/os/plan/plan.module.ts
CHANGED
|
@@ -15,6 +15,7 @@ import type { ForgeModule } from "../../src/forge-module.ts";
|
|
|
15
15
|
export const forgePlanModule: ForgeModule = {
|
|
16
16
|
name: "forge-plan",
|
|
17
17
|
version: "0.1.0",
|
|
18
|
+
runtime: "autonomous",
|
|
18
19
|
async register(registry) {
|
|
19
20
|
const { runPlanArchive } = await import("./handlers/archive.ts");
|
|
20
21
|
|