@agentxm/extension-model 0.28.12 → 0.28.13

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/README.md CHANGED
@@ -9,6 +9,9 @@ client and the AgentXM platform. Every export lives under an explicit
9
9
  `./unstable/*` subpath: the surface is unsupported and may change in any
10
10
  release. Ordinary users should use the [`axm` CLI](https://axm.sh) instead.
11
11
 
12
+ The executable-specification metadata contract that used to ship as
13
+ `./unstable/specifications` now lives in `@agentxm/specification-metadata`.
14
+
12
15
  ## VERS Parser Reference
13
16
 
14
17
  `VersRangeSchema` currently targets `package-url/vers-spec` commit
@@ -0,0 +1,157 @@
1
+ /**
2
+ * Agent-agnostic extension type capability catalog.
3
+ *
4
+ * @experimental This API is unstable and may change without notice.
5
+ */
6
+ /** @experimental This API is unstable and may change without notice. */
7
+ export declare const EXTENSION_TYPES_BY_ID: {
8
+ skill: {
9
+ id: "skill";
10
+ summary: string;
11
+ description: string;
12
+ standard: {
13
+ readonly id: "agent-skills";
14
+ readonly name: "Agent Skills";
15
+ readonly url: "https://agentskills.io";
16
+ };
17
+ docs: {
18
+ label: string;
19
+ url: string;
20
+ }[];
21
+ };
22
+ "mcp-server": {
23
+ id: "mcp-server";
24
+ summary: string;
25
+ description: string;
26
+ standard: {
27
+ readonly id: "mcp";
28
+ readonly name: "Model Context Protocol";
29
+ readonly url: "https://modelcontextprotocol.io";
30
+ };
31
+ docs: {
32
+ label: string;
33
+ url: string;
34
+ }[];
35
+ };
36
+ subagent: {
37
+ id: "subagent";
38
+ summary: string;
39
+ description: string;
40
+ standard: null;
41
+ docs: {
42
+ label: string;
43
+ url: string;
44
+ }[];
45
+ };
46
+ rule: {
47
+ id: "rule";
48
+ summary: string;
49
+ description: string;
50
+ standard: {
51
+ readonly id: "agents-md";
52
+ readonly name: "AGENTS.md";
53
+ readonly url: "https://agents.md";
54
+ };
55
+ docs: {
56
+ label: string;
57
+ url: string;
58
+ }[];
59
+ };
60
+ hook: {
61
+ id: "hook";
62
+ summary: string;
63
+ description: string;
64
+ standard: null;
65
+ docs: {
66
+ label: string;
67
+ url: string;
68
+ }[];
69
+ };
70
+ knowledge: {
71
+ id: "knowledge";
72
+ summary: string;
73
+ description: string;
74
+ standard: {
75
+ readonly id: "okf-0.2";
76
+ readonly name: "Open Knowledge Format 0.2";
77
+ readonly url: "https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md";
78
+ };
79
+ docs: {
80
+ label: string;
81
+ url: string;
82
+ }[];
83
+ };
84
+ };
85
+ /** @experimental This API is unstable and may change without notice. */
86
+ export declare const EXTENSION_TYPES: ({
87
+ id: "skill";
88
+ summary: string;
89
+ description: string;
90
+ standard: {
91
+ readonly id: "agent-skills";
92
+ readonly name: "Agent Skills";
93
+ readonly url: "https://agentskills.io";
94
+ };
95
+ docs: {
96
+ label: string;
97
+ url: string;
98
+ }[];
99
+ } | {
100
+ id: "mcp-server";
101
+ summary: string;
102
+ description: string;
103
+ standard: {
104
+ readonly id: "mcp";
105
+ readonly name: "Model Context Protocol";
106
+ readonly url: "https://modelcontextprotocol.io";
107
+ };
108
+ docs: {
109
+ label: string;
110
+ url: string;
111
+ }[];
112
+ } | {
113
+ id: "subagent";
114
+ summary: string;
115
+ description: string;
116
+ standard: null;
117
+ docs: {
118
+ label: string;
119
+ url: string;
120
+ }[];
121
+ } | {
122
+ id: "rule";
123
+ summary: string;
124
+ description: string;
125
+ standard: {
126
+ readonly id: "agents-md";
127
+ readonly name: "AGENTS.md";
128
+ readonly url: "https://agents.md";
129
+ };
130
+ docs: {
131
+ label: string;
132
+ url: string;
133
+ }[];
134
+ } | {
135
+ id: "hook";
136
+ summary: string;
137
+ description: string;
138
+ standard: null;
139
+ docs: {
140
+ label: string;
141
+ url: string;
142
+ }[];
143
+ } | {
144
+ id: "knowledge";
145
+ summary: string;
146
+ description: string;
147
+ standard: {
148
+ readonly id: "okf-0.2";
149
+ readonly name: "Open Knowledge Format 0.2";
150
+ readonly url: "https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md";
151
+ };
152
+ docs: {
153
+ label: string;
154
+ url: string;
155
+ }[];
156
+ })[];
157
+ //# sourceMappingURL=catalog.d.ts.map
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Agent-agnostic extension type capability catalog.
3
+ *
4
+ * @experimental This API is unstable and may change without notice.
5
+ */
6
+ import { STANDARDS } from "./standards.js";
7
+ const skill = {
8
+ id: "skill",
9
+ summary: "Package reusable agent skills with SKILL.md metadata and instructions.",
10
+ description: "Reusable capability packages authored in the Agent Skills format. Read by the agent as task-specific behavior and grounded by the Agent Skills open standard.",
11
+ standard: STANDARDS.skills,
12
+ docs: [{ label: "Skill manifest schema", url: "https://axm.sh/schemas/skill.schema.json" }],
13
+ };
14
+ const mcpServer = {
15
+ id: "mcp-server",
16
+ summary: "Configure Model Context Protocol servers for agents.",
17
+ description: "MCP server connections installed into each agent's native MCP configuration. The Model Context Protocol is the authoritative standard for this capability.",
18
+ standard: STANDARDS.mcp,
19
+ docs: [{ label: "MCP server manifest schema", url: "https://axm.sh/schemas/mcp.schema.json" }],
20
+ };
21
+ const subagent = {
22
+ id: "subagent",
23
+ summary: "Install specialized agent profiles into an agent's native subagent system.",
24
+ description: "Delegated agent profiles installed into vendor-specific subagent layouts. Subagents have no governing open standard.",
25
+ standard: null,
26
+ docs: [{ label: "Subagent manifest schema", url: "https://axm.sh/schemas/subagent.schema.json" }],
27
+ };
28
+ const rule = {
29
+ id: "rule",
30
+ summary: "Sync instruction files and distribute rule extensions that inject into them.",
31
+ description: "Umbrella capability for behavior-governing instructions: syncing AGENTS.md, CLAUDE.md, and rules directories, and distributing rule extensions that inject content into those instruction files. Read by the agent to shape behavior.",
32
+ standard: STANDARDS.rules,
33
+ docs: [{ label: "Rule manifest schema", url: "https://axm.sh/schemas/rule.schema.json" }],
34
+ };
35
+ const hook = {
36
+ id: "hook",
37
+ summary: "Install lifecycle hook extensions into an agent's native hook system.",
38
+ description: "Lifecycle automation hooks installed into vendor-specific agent hook systems. Hooks have no governing open standard.",
39
+ standard: null,
40
+ docs: [{ label: "Hook manifest schema", url: "https://axm.sh/schemas/hook.schema.json" }],
41
+ };
42
+ const knowledge = {
43
+ id: "knowledge",
44
+ summary: "Package portable Open Knowledge Format concept bundles.",
45
+ description: "Reference knowledge installed as isolated Markdown concept bundles using Open Knowledge Format 0.2. Knowledge is discoverable and readable without being injected into agent instructions.",
46
+ standard: STANDARDS.okf,
47
+ docs: [
48
+ { label: "Knowledge manifest schema", url: "https://axm.sh/schemas/knowledge.schema.json" },
49
+ ],
50
+ };
51
+ /** @experimental This API is unstable and may change without notice. */
52
+ export const EXTENSION_TYPES_BY_ID = {
53
+ skill,
54
+ "mcp-server": mcpServer,
55
+ subagent,
56
+ rule,
57
+ hook,
58
+ knowledge,
59
+ };
60
+ /** @experimental This API is unstable and may change without notice. */
61
+ export const EXTENSION_TYPES = Object.values(EXTENSION_TYPES_BY_ID);
62
+ //# sourceMappingURL=catalog.js.map
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Derivation helpers for the extension type catalog.
3
+ *
4
+ * @experimental This API is unstable and may change without notice.
5
+ */
6
+ import type { CatalogExtensionType, ExtensionTypeDefinition, Standard } from "./schema.js";
7
+ /** @experimental This API is unstable and may change without notice. */
8
+ export declare const getExtensionTypeDefinition: (id: CatalogExtensionType) => ExtensionTypeDefinition;
9
+ /** @experimental This API is unstable and may change without notice. */
10
+ export declare const getStandardForExtensionType: (id: CatalogExtensionType) => Standard | null;
11
+ /** @experimental This API is unstable and may change without notice. */
12
+ export declare const isSpecTracked: (id: CatalogExtensionType) => boolean;
13
+ //# sourceMappingURL=derive.d.ts.map
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Derivation helpers for the extension type catalog.
3
+ *
4
+ * @experimental This API is unstable and may change without notice.
5
+ */
6
+ import { EXTENSION_TYPES_BY_ID } from "./catalog.js";
7
+ /** @experimental This API is unstable and may change without notice. */
8
+ export const getExtensionTypeDefinition = (id) => EXTENSION_TYPES_BY_ID[id];
9
+ /** @experimental This API is unstable and may change without notice. */
10
+ export const getStandardForExtensionType = (id) => getExtensionTypeDefinition(id).standard;
11
+ /** @experimental This API is unstable and may change without notice. */
12
+ export const isSpecTracked = (id) => getStandardForExtensionType(id) !== null;
13
+ //# sourceMappingURL=derive.js.map
@@ -4,5 +4,7 @@
4
4
  * @experimental This API is unstable and may change without notice.
5
5
  */
6
6
  export { CATALOG_EXTENSION_TYPES, type CatalogExtensionType, CatalogExtensionTypeSchema, type DocLink, DocLinkSchema, type ExtensionTypeCatalog, ExtensionTypeCatalogSchema, type ExtensionTypeDefinition, ExtensionTypeDefinitionSchema, LEAF_EXTENSION_TYPES, type LeafExtensionType, LeafExtensionTypeSchema, type Standard, StandardSchema, type Url, UrlSchema, isCatalogExtensionType, } from "./schema.js";
7
+ export { EXTENSION_TYPES, EXTENSION_TYPES_BY_ID } from "./catalog.js";
8
+ export { getExtensionTypeDefinition, getStandardForExtensionType, isSpecTracked, } from "./derive.js";
7
9
  export { STANDARDS } from "./standards.js";
8
10
  //# sourceMappingURL=index.d.ts.map
@@ -4,5 +4,7 @@
4
4
  * @experimental This API is unstable and may change without notice.
5
5
  */
6
6
  export { CATALOG_EXTENSION_TYPES, CatalogExtensionTypeSchema, DocLinkSchema, ExtensionTypeCatalogSchema, ExtensionTypeDefinitionSchema, LEAF_EXTENSION_TYPES, LeafExtensionTypeSchema, StandardSchema, UrlSchema, isCatalogExtensionType, } from "./schema.js";
7
+ export { EXTENSION_TYPES, EXTENSION_TYPES_BY_ID } from "./catalog.js";
8
+ export { getExtensionTypeDefinition, getStandardForExtensionType, isSpecTracked, } from "./derive.js";
7
9
  export { STANDARDS } from "./standards.js";
8
10
  //# sourceMappingURL=index.js.map
@@ -5,6 +5,7 @@
5
5
  */
6
6
  import * as Schema from "effect/Schema";
7
7
  import * as Option from "effect/Option";
8
+ import { AgentIdSchema } from "../agent-capabilities/catalog.js";
8
9
  /**
9
10
  * Author information for a manifest.
10
11
  *
@@ -510,14 +511,12 @@ export declare const NonPackManifestFields: {
510
511
  standalone: Schema.optional<Schema.Boolean>;
511
512
  };
512
513
  /**
513
- * Agent identifier enumeration for supported coding agents.
514
- *
515
- * Derived from `AGENT_IDS` in agents/types.ts — compile-time enforced,
516
- * no manual sync required.
514
+ * Agent identifier enumeration for supported coding agents: the single
515
+ * definition lives in the capability catalog.
517
516
  *
518
517
  * @experimental This API is unstable and may change without notice.
519
518
  */
520
- export declare const AgentIdSchema: Schema.Literals<readonly ["adal", "aider-desk", "amp", "antigravity", "antigravity-cli", "augment", "claude-code", "cline", "codearts-agent", "codebuddy", "codemaker", "codestudio", "codex", "command-code", "continue", "cortex", "crush", "cursor", "deepagents", "devin", "dexto", "droid", "firebender", "forgecode", "gemini-cli", "github-copilot-cli", "goose", "grok-cli", "hermes", "ibm-bob", "iflow-cli", "junie", "lingma", "kilo", "kimi-cli", "kiro-cli", "kode", "mcpjam", "minimax-code", "mistral-vibe", "mux", "neovate", "openclaw", "opencode", "openhands", "ona", "pi", "pochi", "qoder", "qoder-cn", "qwen-code", "replit", "roo", "rovodev", "tabnine-cli", "trae-cn", "trae", "warp", "windsurf", "zencoder", "zed", "zenflow", "universal"]>;
519
+ export { AgentIdSchema };
521
520
  /**
522
521
  * Agent identifiers users may persist in `axm.json`.
523
522
  *
@@ -535,5 +534,4 @@ export declare const ConfigurableAgentIdSchema: Schema.Literals<readonly ["adal"
535
534
  export type AgentId = Schema.Schema.Type<typeof AgentIdSchema>;
536
535
  /** @experimental This API is unstable and may change without notice. */
537
536
  export type ConfigurableAgentId = Schema.Schema.Type<typeof ConfigurableAgentIdSchema>;
538
- export {};
539
537
  //# sourceMappingURL=common.d.ts.map
@@ -7,7 +7,8 @@ import * as EffectRecord from "effect/Record";
7
7
  import * as Schema from "effect/Schema";
8
8
  import * as Option from "effect/Option";
9
9
  import * as Result from "effect/Result";
10
- import { AGENT_IDS, CONFIGURABLE_AGENT_IDS } from "../agents/types.js";
10
+ import { AgentIdSchema } from "../agent-capabilities/catalog.js";
11
+ import { CONFIGURABLE_AGENT_IDS } from "../agents/types.js";
11
12
  import { HANDLE_PATTERN_SOURCE, HandleSchema } from "./handle.js";
12
13
  import { parseLicenseExpression } from "./license.js";
13
14
  import { CompanionPackageSchema } from "../package-urls/index.js";
@@ -570,24 +571,17 @@ export const NonPackManifestFields = {
570
571
  description: "Pack recommendations and same-pack composition metadata. Entries do not install or guarantee the pack or its members.",
571
572
  }))),
572
573
  standalone: Schema.optional(Schema.Boolean.pipe(Schema.annotate({
573
- description: "False means the extension requires sibling extensions that are direct members of a pack named in recommendedPacks; it does not create dependencies.",
574
+ description: "False means the extension requires sibling extensions that are direct members of a pack named in recommendedPacks, resolved by extension identity rather than by path; it does not create dependencies.",
574
575
  default: true,
575
576
  }))),
576
577
  };
577
578
  /**
578
- * Agent identifier enumeration for supported coding agents.
579
- *
580
- * Derived from `AGENT_IDS` in agents/types.ts — compile-time enforced,
581
- * no manual sync required.
579
+ * Agent identifier enumeration for supported coding agents: the single
580
+ * definition lives in the capability catalog.
582
581
  *
583
582
  * @experimental This API is unstable and may change without notice.
584
583
  */
585
- export const AgentIdSchema = Schema.Literals([...AGENT_IDS]).annotate({
586
- identifier: "AgentId",
587
- title: "Agent ID",
588
- description: "Supported coding agent identifier.",
589
- examples: ["claude-code", "codex", "cursor"],
590
- });
584
+ export { AgentIdSchema };
591
585
  /**
592
586
  * Agent identifiers users may persist in `axm.json`.
593
587
  *
@@ -19,4 +19,11 @@ export declare const makeAbsolutePath: (path: Path.Path, value: string) => Absol
19
19
  export declare const makeRelativePath: (path: Path.Path, value: string) => Option.Option<RelativePath>;
20
20
  export declare const makeWorkspaceRelativePath: (path: Path.Path, workspaceRoot: AbsolutePath | string, target: string) => Option.Option<RelativePath>;
21
21
  export declare const makeWorkspaceRelativeSourcePath: (path: Path.Path, workspaceRoot: AbsolutePath | string, target: string) => Option.Option<string>;
22
+ /**
23
+ * Whether a resolved target path stays within a base directory.
24
+ *
25
+ * Uses a path-separator boundary check so a sibling directory sharing a name
26
+ * prefix is not mistaken for a child.
27
+ */
28
+ export declare const isPathSafe: (path: Path.Path, base: string, target: string) => boolean;
22
29
  //# sourceMappingURL=path-types.d.ts.map
@@ -45,4 +45,15 @@ export const makeWorkspaceRelativeSourcePath = (path, workspaceRoot, target) =>
45
45
  return Option.none();
46
46
  return Option.some(path.normalize(relative.length === 0 ? "." : relative));
47
47
  };
48
+ /**
49
+ * Whether a resolved target path stays within a base directory.
50
+ *
51
+ * Uses a path-separator boundary check so a sibling directory sharing a name
52
+ * prefix is not mistaken for a child.
53
+ */
54
+ export const isPathSafe = (path, base, target) => {
55
+ const resolvedBase = path.resolve(base);
56
+ const resolvedTarget = path.resolve(target);
57
+ return resolvedTarget === resolvedBase || resolvedTarget.startsWith(resolvedBase + path.sep);
58
+ };
48
59
  //# sourceMappingURL=path-types.js.map
@@ -75,6 +75,59 @@ export type NamedRegistryResolution = {
75
75
  readonly requestedRange?: string;
76
76
  readonly candidate: ReleaseAgeEvidence;
77
77
  };
78
+ /**
79
+ * Index-level selection decision for one named Registry target, before the
80
+ * provider maps the chosen entry to an `ExtensionRef` or probes any archive.
81
+ * Versions are identified by their version string; the provider owns the
82
+ * index and looks the entry up.
83
+ *
84
+ * @experimental This API is unstable and may change without notice.
85
+ */
86
+ export type NamedRegistryVersionDecision = {
87
+ readonly kind: "selected";
88
+ readonly version: string;
89
+ readonly newerHeld?: ReleaseAgeEvidence;
90
+ } | {
91
+ readonly kind: "exempted";
92
+ readonly version: string;
93
+ readonly bypassed: ReleaseAgeEvidence;
94
+ readonly exemption: ReleaseAgeExemption;
95
+ } | {
96
+ readonly kind: "not_found";
97
+ } | {
98
+ readonly kind: "version_unsatisfied";
99
+ readonly requestedRange: string;
100
+ } | {
101
+ readonly kind: "policy_held";
102
+ readonly requestedRange?: string;
103
+ readonly candidate: ReleaseAgeEvidence;
104
+ };
105
+ /**
106
+ * What selecting one probe-verified candidate would mean under the policy.
107
+ *
108
+ * @experimental This API is unstable and may change without notice.
109
+ */
110
+ export type NamedRegistryCandidateOutcome = {
111
+ readonly kind: "selected";
112
+ } | {
113
+ readonly kind: "exempted";
114
+ readonly bypassed: ReleaseAgeEvidence;
115
+ readonly exemption: ReleaseAgeExemption;
116
+ } | {
117
+ readonly kind: "held";
118
+ readonly candidate: ReleaseAgeEvidence;
119
+ };
120
+ /**
121
+ * One candidate a provider may verify before selecting a named target, in
122
+ * policy order: selectable candidates newest first, then held candidates
123
+ * newest first.
124
+ *
125
+ * @experimental This API is unstable and may change without notice.
126
+ */
127
+ export interface NamedRegistryCandidate {
128
+ readonly version: string;
129
+ readonly outcome: NamedRegistryCandidateOutcome;
130
+ }
78
131
  /**
79
132
  * Materialized extension files ready for installation.
80
133
  *
package/package.json CHANGED
@@ -11,6 +11,7 @@
11
11
  },
12
12
  "description": "Shared AgentXM extension model: identities, manifests, version constraints, and agent capabilities. Unstable and unsupported — use the axm.sh CLI.",
13
13
  "devDependencies": {
14
+ "@agentxm/specification-metadata": "0.28.13",
14
15
  "@effect/vitest": "4.0.0-rc.112",
15
16
  "@types/semver": "^7.7.1",
16
17
  "@types/spdx-expression-parse": "4.0.0",
@@ -62,6 +63,16 @@
62
63
  "default": "./dist/src/unstable/extension-types/index.js",
63
64
  "types": "./dist/src/unstable/extension-types/index.d.ts"
64
65
  },
66
+ "./unstable/extension-types/catalog": {
67
+ "axm-source": "./src/unstable/extension-types/catalog.ts",
68
+ "default": "./dist/src/unstable/extension-types/catalog.js",
69
+ "types": "./dist/src/unstable/extension-types/catalog.d.ts"
70
+ },
71
+ "./unstable/extension-types/derive": {
72
+ "axm-source": "./src/unstable/extension-types/derive.ts",
73
+ "default": "./dist/src/unstable/extension-types/derive.js",
74
+ "types": "./dist/src/unstable/extension-types/derive.d.ts"
75
+ },
65
76
  "./unstable/extension-types/schema": {
66
77
  "axm-source": "./src/unstable/extension-types/schema.ts",
67
78
  "default": "./dist/src/unstable/extension-types/schema.js",
@@ -287,11 +298,6 @@
287
298
  "default": "./dist/src/unstable/sources/workspace.js",
288
299
  "types": "./dist/src/unstable/sources/workspace.d.ts"
289
300
  },
290
- "./unstable/specifications": {
291
- "axm-source": "./src/unstable/specifications/index.ts",
292
- "default": "./dist/src/unstable/specifications/index.js",
293
- "types": "./dist/src/unstable/specifications/index.d.ts"
294
- },
295
301
  "./unstable/subagents/manifest-schema": {
296
302
  "axm-source": "./src/unstable/subagents/manifest-schema.ts",
297
303
  "default": "./dist/src/unstable/subagents/manifest-schema.js",
@@ -327,11 +333,11 @@
327
333
  "access": "public"
328
334
  },
329
335
  "repository": {
330
- "directory": "packages/extension-model",
336
+ "directory": "packages/core/extension-model",
331
337
  "type": "git",
332
338
  "url": "https://github.com/agentxm/axm.git"
333
339
  },
334
340
  "sideEffects": false,
335
341
  "type": "module",
336
- "version": "0.28.12"
337
- }
342
+ "version": "0.28.13"
343
+ }
@@ -1,62 +0,0 @@
1
- /**
2
- * Corpus conformance for executable specifications.
3
- *
4
- * A pure check over already-decoded metadata: it establishes that a
5
- * specification corpus has the contract's form and linkage — vocabulary,
6
- * identity, goal references, boundary rationale, lineage, and product
7
- * language. A clean result never establishes that the accepted obligations
8
- * are the right ones; that judgment stays with set review and the acceptance
9
- * decision.
10
- *
11
- * Both repositories run this check over their own corpus. Shared goal
12
- * identities come from the installed contract, so a specification that names
13
- * a shared goal the installed release cohort does not register is a dangling
14
- * cross-repository reference and fails here.
15
- *
16
- * @experimental This API is unstable and may change without notice.
17
- */
18
- import { type ExecutionBinding, type ProductGoalRegistry, type SpecificationMetadata } from "./contract.js";
19
- export interface ConformanceIssue {
20
- readonly severity: "error" | "warning";
21
- /** Repository-relative source the issue is anchored to. */
22
- readonly source: string;
23
- readonly message: string;
24
- }
25
- export interface CorpusSpecification {
26
- /** Repository-relative source path of the specification file. */
27
- readonly source: string;
28
- readonly metadata: SpecificationMetadata;
29
- }
30
- export interface CorpusExecutionBinding {
31
- /** Repository-relative source path of the boundary execution. */
32
- readonly source: string;
33
- readonly binding: ExecutionBinding;
34
- }
35
- export interface CorpusInput {
36
- readonly specifications: readonly CorpusSpecification[];
37
- /** The repository's local product-goal registry. */
38
- readonly localGoals: ProductGoalRegistry;
39
- /** Source path reported for local-registry issues. */
40
- readonly localGoalsSource: string;
41
- /** Shared goals from the installed contract. Defaults to `sharedProductGoals`. */
42
- readonly sharedGoals?: ProductGoalRegistry;
43
- readonly executionBindings?: readonly CorpusExecutionBinding[];
44
- }
45
- /**
46
- * Whether at least one declared method produces runner evidence. A method
47
- * set made only of unverifiable methods is reported as unverified by the
48
- * harness, never as passing.
49
- */
50
- export declare const isExecutableMethodSet: (methods: readonly string[]) => boolean;
51
- /**
52
- * Lints a title or statement for implementation vocabulary. Specification
53
- * text describes conditions and observable results; it never names
54
- * handlers, services, Layers, private functions, or mock interactions.
55
- */
56
- export declare const lintProductLanguage: (text: string) => string | undefined;
57
- /**
58
- * Checks one corpus for contract form and linkage. Issues are ordered by
59
- * discovery; callers decide whether warnings block.
60
- */
61
- export declare const checkSpecificationCorpus: (input: CorpusInput) => readonly ConformanceIssue[];
62
- //# sourceMappingURL=conformance.d.ts.map
@@ -1,137 +0,0 @@
1
- /**
2
- * Corpus conformance for executable specifications.
3
- *
4
- * A pure check over already-decoded metadata: it establishes that a
5
- * specification corpus has the contract's form and linkage — vocabulary,
6
- * identity, goal references, boundary rationale, lineage, and product
7
- * language. A clean result never establishes that the accepted obligations
8
- * are the right ones; that judgment stays with set review and the acceptance
9
- * decision.
10
- *
11
- * Both repositories run this check over their own corpus. Shared goal
12
- * identities come from the installed contract, so a specification that names
13
- * a shared goal the installed release cohort does not register is a dangling
14
- * cross-repository reference and fails here.
15
- *
16
- * @experimental This API is unstable and may change without notice.
17
- */
18
- import { IDENTITY_SEGMENT_PATTERN, UNVERIFIABLE_SPECIFICATION_METHODS, } from "./contract.js";
19
- import { sharedProductGoals } from "./shared-goals.js";
20
- /** Words that identify implementation vocabulary leaking into product language. */
21
- const IMPLEMENTATION_WORDS = new Set([
22
- "layer",
23
- "handler",
24
- "mock",
25
- "stub",
26
- "middleware",
27
- "refactor",
28
- ]);
29
- const CAMEL_CASE_TOKEN = /\b[a-z]+[A-Z][A-Za-z]*\b/;
30
- /**
31
- * Whether at least one declared method produces runner evidence. A method
32
- * set made only of unverifiable methods is reported as unverified by the
33
- * harness, never as passing.
34
- */
35
- export const isExecutableMethodSet = (methods) => methods.some((method) => !UNVERIFIABLE_SPECIFICATION_METHODS.some((entry) => entry === method));
36
- /**
37
- * Lints a title or statement for implementation vocabulary. Specification
38
- * text describes conditions and observable results; it never names
39
- * handlers, services, Layers, private functions, or mock interactions.
40
- */
41
- export const lintProductLanguage = (text) => {
42
- if (CAMEL_CASE_TOKEN.test(text)) {
43
- return `contains an implementation-style camelCase token: "${text}"`;
44
- }
45
- for (const word of text.toLowerCase().split(/[^a-z]+/)) {
46
- if (IMPLEMENTATION_WORDS.has(word)) {
47
- return `contains implementation vocabulary ("${word}"): "${text}"`;
48
- }
49
- }
50
- return undefined;
51
- };
52
- const error = (source, message) => ({
53
- severity: "error",
54
- source,
55
- message,
56
- });
57
- const warning = (source, message) => ({
58
- severity: "warning",
59
- source,
60
- message,
61
- });
62
- /**
63
- * Checks one corpus for contract form and linkage. Issues are ordered by
64
- * discovery; callers decide whether warnings block.
65
- */
66
- export const checkSpecificationCorpus = (input) => {
67
- const issues = [];
68
- const sharedGoals = input.sharedGoals ?? sharedProductGoals;
69
- for (const id of Object.keys(input.localGoals)) {
70
- if (!IDENTITY_SEGMENT_PATTERN.test(id)) {
71
- issues.push(error(input.localGoalsSource, `product-goal id \`${id}\` must be a lowercase kebab identifier`));
72
- }
73
- if (Object.hasOwn(sharedGoals, id)) {
74
- issues.push(error(input.localGoalsSource, `product goal \`${id}\` is a shared goal; reference the shared identity instead of redefining it locally`));
75
- }
76
- }
77
- const registeredGoals = new Map();
78
- for (const registry of [sharedGoals, input.localGoals]) {
79
- for (const [id, definition] of Object.entries(registry)) {
80
- registeredGoals.set(id, { status: definition.status ?? "active" });
81
- }
82
- }
83
- const byRequirement = new Map();
84
- for (const specification of input.specifications) {
85
- const existing = byRequirement.get(specification.metadata.requirement);
86
- if (existing !== undefined) {
87
- issues.push(error(specification.source, `duplicate requirement identity \`${specification.metadata.requirement}\` (also declared in ${existing.source})`));
88
- continue;
89
- }
90
- byRequirement.set(specification.metadata.requirement, specification);
91
- }
92
- const referencedGoals = new Set();
93
- for (const { source, metadata } of input.specifications) {
94
- for (const goal of metadata.goals) {
95
- referencedGoals.add(goal);
96
- const registered = registeredGoals.get(goal);
97
- if (registered === undefined) {
98
- issues.push(error(source, `references unregistered product goal \`${goal}\``));
99
- }
100
- else if (registered.status === "retired") {
101
- issues.push(error(source, `references retired product goal \`${goal}\`; the specification is a retirement candidate`));
102
- }
103
- }
104
- for (const superseded of metadata.supersedes) {
105
- if (byRequirement.has(superseded)) {
106
- issues.push(error(source, `supersedes \`${superseded}\`, which is still present in the corpus; retire the predecessor in the same change`));
107
- }
108
- }
109
- const titleFinding = lintProductLanguage(metadata.title);
110
- if (titleFinding !== undefined) {
111
- issues.push(error(source, `title ${titleFinding}`));
112
- }
113
- const statementFinding = lintProductLanguage(metadata.statement);
114
- if (statementFinding !== undefined) {
115
- issues.push(error(source, `statement ${statementFinding}`));
116
- }
117
- if (!isExecutableMethodSet(metadata.methods)) {
118
- issues.push(warning(source, `declares only unverifiable methods (${metadata.methods.join(", ")}); the harness reports this specification as unverified`));
119
- }
120
- }
121
- for (const [id, definition] of registeredGoals) {
122
- if (definition.status === "active" &&
123
- !referencedGoals.has(id) &&
124
- input.specifications.length > 0) {
125
- issues.push(warning(input.localGoalsSource, `active product goal \`${id}\` has no referencing specification (missing coverage or a dead goal)`));
126
- }
127
- }
128
- for (const { source, binding } of input.executionBindings ?? []) {
129
- for (const requirement of binding.requirements) {
130
- if (!byRequirement.has(requirement)) {
131
- issues.push(error(source, `execution binding references unknown requirement \`${requirement}\``));
132
- }
133
- }
134
- }
135
- return issues;
136
- };
137
- //# sourceMappingURL=conformance.js.map
@@ -1,215 +0,0 @@
1
- /**
2
- * Shared executable-specification contract.
3
- *
4
- * One metadata contract, one classification lens, one set of controlled
5
- * vocabularies, and one shared product-goal registry for every AgentXM
6
- * specification corpus. Each repository keeps its own specification files,
7
- * local product goals, and local placement rules; only this contract and the
8
- * shared goal identities cross the repository boundary.
9
- *
10
- * Metadata is data. Every specification file exports one `specification`
11
- * constant built with `defineSpecification`: a literal object carrying only
12
- * the cross-method information that discovery, conformance, and reporting
13
- * need. It never wraps or replaces native test-framework constructs, and
14
- * catalog tooling reads it statically without executing the specification.
15
- *
16
- * @experimental This API is unstable and may change without notice.
17
- */
18
- /**
19
- * The review lens a specification is classified by. Classification selects
20
- * the review expertise and quality criteria the obligation most needs; it
21
- * does not determine priority, acceptance, subject, or verification method.
22
- *
23
- * - `functional`: responses, transformations, rules, and observable
24
- * capabilities;
25
- * - `quality`: a measurable degree such as performance, reliability,
26
- * security, or installability, named by `characteristic`;
27
- * - `constraint`: a genuine restriction on solution, environment,
28
- * technology, or operation;
29
- * - `external-conformance`: an obligation adopted from a named law,
30
- * standard, contract, or interface;
31
- * - `human-factors`: capabilities and qualities arising from people, tasks,
32
- * accessibility, ergonomics, or context of use; and
33
- * - `process`: an obligation on development, delivery, operation, support,
34
- * migration, or retirement.
35
- */
36
- export type SpecificationClass = "functional" | "quality" | "constraint" | "external-conformance" | "human-factors" | "process";
37
- export declare const SPECIFICATION_CLASSES: readonly SpecificationClass[];
38
- /**
39
- * How a specification participates in the product contract and its reading
40
- * paths. Experience specifications describe tasks in product language,
41
- * interface specifications state public machine-consumable contracts, and
42
- * supporting specifications state subordinate system or engineering
43
- * obligations.
44
- */
45
- export type SpecificationRole = "experience" | "interface" | "supporting";
46
- export declare const SPECIFICATION_ROLES: readonly SpecificationRole[];
47
- /**
48
- * Where the specification's default execution observes the system.
49
- * Additional boundary-specific executions bind their own evidence to the
50
- * same requirement identity.
51
- */
52
- export type ExecutionBoundary = "memory" | "process" | "binary" | "packed-artifact" | "installed" | "platform" | "published-artifact" | "deployed" | "repository";
53
- export declare const EXECUTION_BOUNDARIES: readonly ExecutionBoundary[];
54
- /** When this specification's evidence is selected by default. */
55
- export type ExecutionSelection = "per-change" | "platform-matrix" | "scheduled" | "release-candidate" | "post-deployment";
56
- export declare const EXECUTION_SELECTIONS: readonly ExecutionSelection[];
57
- /**
58
- * Known testing methods. The vocabulary is extensible: a method not listed
59
- * here is accepted when it is a lowercase kebab identifier, so a new or
60
- * combined method never needs a contract change before use.
61
- */
62
- export declare const KNOWN_SPECIFICATION_METHODS: readonly ["example", "decision-table", "property", "model", "contract", "conformance-matrix", "golden-output", "measurement", "static", "smoke", "manual", "review"];
63
- export type KnownSpecificationMethod = (typeof KNOWN_SPECIFICATION_METHODS)[number];
64
- /**
65
- * Methods whose evidence is produced by a person rather than a runner. A
66
- * specification whose methods are all unverifiable is reported as unverified
67
- * by the harness; it is never reported as passing.
68
- */
69
- export declare const UNVERIFIABLE_SPECIFICATION_METHODS: readonly KnownSpecificationMethod[];
70
- /**
71
- * Known quality characteristics. Required for `quality`-class specifications
72
- * and permitted elsewhere; extensible under the same identifier rule as
73
- * methods.
74
- */
75
- export declare const KNOWN_QUALITY_CHARACTERISTICS: readonly ["installability", "compatibility", "performance", "security", "privacy", "reliability", "availability", "maintainability", "observability", "accessibility", "usability"];
76
- export type KnownQualityCharacteristic = (typeof KNOWN_QUALITY_CHARACTERISTICS)[number];
77
- /** Segments of a requirement identity or product-goal identity. */
78
- export declare const IDENTITY_SEGMENT_PATTERN: RegExp;
79
- /** A declared blind spot of one specification and the condition that retires it. */
80
- export interface SpecificationLimitation {
81
- /** What the specification's evidence cannot establish, in product language. */
82
- readonly limitation: string;
83
- /** The observable condition under which this limitation is removed. */
84
- readonly retirementCondition: string;
85
- }
86
- export interface SpecificationMetadata {
87
- /**
88
- * Stable requirement identity: lowercase kebab path segments joined by `/`,
89
- * for example `cli/install/realizes-direct-intent`. Declared here, not
90
- * derived from the filesystem; repository policy keeps it equal to the
91
- * file's path under `specifications/`, so moving or renaming a file is an
92
- * identity change — a requirements decision.
93
- */
94
- readonly requirement: string;
95
- /** Product-language title, readable without the source. */
96
- readonly title: string;
97
- /**
98
- * The normative statement: obligated subject, condition or trigger, and
99
- * the required or prohibited outcome, in product language. This sentence
100
- * is the obligation; native tests are its reportable scenarios.
101
- */
102
- readonly statement: string;
103
- /** The review lens this specification is classified by. */
104
- readonly class: SpecificationClass;
105
- /**
106
- * The quality characteristic a `quality` specification measures, or the
107
- * human-factors quality a `human-factors` specification names. Required
108
- * for `quality`; optional otherwise.
109
- */
110
- readonly characteristic?: string;
111
- /** The specification's primary role in the product contract. */
112
- readonly role: SpecificationRole;
113
- /**
114
- * Registered product-goal identities this specification supports. Every
115
- * entry must exist, active, in the shared registry or the repository's
116
- * local registry.
117
- */
118
- readonly goals: readonly [string, ...string[]];
119
- /** Observation boundary of the default execution. Defaults to `memory`. */
120
- readonly boundary?: ExecutionBoundary;
121
- /**
122
- * Why this specification observes a boundary other than memory: the
123
- * evidence that boundary supplies which an in-memory run cannot. Required
124
- * whenever `boundary` is not `memory`.
125
- */
126
- readonly boundaryRationale?: string;
127
- /** Testing methods the specification actually uses. */
128
- readonly methods: readonly [string, ...string[]];
129
- /** Default evidence-selection policy. Defaults to `per-change`. */
130
- readonly selection?: ExecutionSelection;
131
- /**
132
- * Sources this obligation was derived from: predecessor requirement
133
- * identities, prior specification identities, tests that witnessed the
134
- * behavior, or surfaces that supplied its conditions. Empty when the
135
- * specification is an original source.
136
- */
137
- readonly derivedFrom: readonly string[];
138
- /**
139
- * Identities this specification replaces as authority. A superseded
140
- * identity is retired in the same change that lands its successor and
141
- * must not remain present in the corpus.
142
- */
143
- readonly supersedes: readonly string[];
144
- /**
145
- * Conditions the obligation presumes and its evidence does not establish.
146
- * An empty list records that none were found after review; `"unknown"`
147
- * records that assumptions have not been assessed.
148
- */
149
- readonly assumptions: readonly string[] | "unknown";
150
- /**
151
- * Unresolved questions about the obligation's meaning, scope, or subject.
152
- * An empty list records that none remain; `"unknown"` records that the
153
- * specification has not been reviewed for open questions.
154
- */
155
- readonly openQuestions: readonly string[] | "unknown";
156
- /** Declared blind spots of this specification's evidence. */
157
- readonly limitations?: readonly [SpecificationLimitation, ...SpecificationLimitation[]];
158
- }
159
- /**
160
- * Declares one specification's metadata. Identity function: it exists to type
161
- * the literal and to give discovery a stable syntactic anchor.
162
- */
163
- export declare const defineSpecification: <const M extends SpecificationMetadata>(metadata: M) => M;
164
- /** One registered product goal. */
165
- export interface ProductGoalDefinition {
166
- /** One-sentence statement of the desired outcome this goal names. */
167
- readonly outcome: string;
168
- /**
169
- * Retired goals stay registered so specifications referencing them are
170
- * flagged as retirement candidates instead of silently orphaned.
171
- */
172
- readonly status?: "active" | "retired";
173
- }
174
- export type ProductGoalRegistry = Readonly<Record<string, ProductGoalDefinition>>;
175
- /**
176
- * Declares a product-goal registry. Identity function with the same
177
- * literal-only discipline as `defineSpecification`.
178
- */
179
- export declare const defineProductGoals: <const R extends ProductGoalRegistry>(registry: R) => R;
180
- /**
181
- * Binds a boundary-specific execution (for example an end-to-end test file)
182
- * to the requirement identities it provides evidence for. The execution is
183
- * evidence, never a second authority: it must not state new requirements.
184
- */
185
- export interface ExecutionBinding {
186
- /** Requirement identities this execution binds evidence to. */
187
- readonly requirements: readonly [string, ...string[]];
188
- /** Observation boundary of this execution. */
189
- readonly boundary: ExecutionBoundary;
190
- /**
191
- * The boundary-specific reason this execution exists beyond the in-memory
192
- * evidence — required so boundary scenarios never silently duplicate
193
- * in-memory scenarios.
194
- */
195
- readonly rationale: string;
196
- }
197
- /** Declares a boundary-specific execution binding. Identity function. */
198
- export declare const defineExecutionBinding: <const B extends ExecutionBinding>(binding: B) => B;
199
- /**
200
- * One static verification gate whose result is bound to the owning
201
- * specification's requirement identity. Bound evidence supports the owning
202
- * specification; it never replaces it and never states a new requirement.
203
- */
204
- export interface BoundEvidenceGate {
205
- /** The static gate, named by the verification surface that runs it. */
206
- readonly gate: string;
207
- /** What the gate verifies for this requirement, in product language. */
208
- readonly verifies: string;
209
- }
210
- /**
211
- * Declares the static gates bound to a specification as evidence. Exported
212
- * as `boundEvidence` beside the `specification` constant. Identity function.
213
- */
214
- export declare const defineBoundEvidence: <const E extends readonly [BoundEvidenceGate, ...BoundEvidenceGate[]]>(evidence: E) => E;
215
- //# sourceMappingURL=contract.d.ts.map
@@ -1,114 +0,0 @@
1
- /**
2
- * Shared executable-specification contract.
3
- *
4
- * One metadata contract, one classification lens, one set of controlled
5
- * vocabularies, and one shared product-goal registry for every AgentXM
6
- * specification corpus. Each repository keeps its own specification files,
7
- * local product goals, and local placement rules; only this contract and the
8
- * shared goal identities cross the repository boundary.
9
- *
10
- * Metadata is data. Every specification file exports one `specification`
11
- * constant built with `defineSpecification`: a literal object carrying only
12
- * the cross-method information that discovery, conformance, and reporting
13
- * need. It never wraps or replaces native test-framework constructs, and
14
- * catalog tooling reads it statically without executing the specification.
15
- *
16
- * @experimental This API is unstable and may change without notice.
17
- */
18
- export const SPECIFICATION_CLASSES = [
19
- "functional",
20
- "quality",
21
- "constraint",
22
- "external-conformance",
23
- "human-factors",
24
- "process",
25
- ];
26
- export const SPECIFICATION_ROLES = [
27
- "experience",
28
- "interface",
29
- "supporting",
30
- ];
31
- export const EXECUTION_BOUNDARIES = [
32
- "memory",
33
- "process",
34
- "binary",
35
- "packed-artifact",
36
- "installed",
37
- "platform",
38
- "published-artifact",
39
- "deployed",
40
- "repository",
41
- ];
42
- export const EXECUTION_SELECTIONS = [
43
- "per-change",
44
- "platform-matrix",
45
- "scheduled",
46
- "release-candidate",
47
- "post-deployment",
48
- ];
49
- /**
50
- * Known testing methods. The vocabulary is extensible: a method not listed
51
- * here is accepted when it is a lowercase kebab identifier, so a new or
52
- * combined method never needs a contract change before use.
53
- */
54
- export const KNOWN_SPECIFICATION_METHODS = [
55
- "example",
56
- "decision-table",
57
- "property",
58
- "model",
59
- "contract",
60
- "conformance-matrix",
61
- "golden-output",
62
- "measurement",
63
- "static",
64
- "smoke",
65
- "manual",
66
- "review",
67
- ];
68
- /**
69
- * Methods whose evidence is produced by a person rather than a runner. A
70
- * specification whose methods are all unverifiable is reported as unverified
71
- * by the harness; it is never reported as passing.
72
- */
73
- export const UNVERIFIABLE_SPECIFICATION_METHODS = [
74
- "manual",
75
- "review",
76
- ];
77
- /**
78
- * Known quality characteristics. Required for `quality`-class specifications
79
- * and permitted elsewhere; extensible under the same identifier rule as
80
- * methods.
81
- */
82
- export const KNOWN_QUALITY_CHARACTERISTICS = [
83
- "installability",
84
- "compatibility",
85
- "performance",
86
- "security",
87
- "privacy",
88
- "reliability",
89
- "availability",
90
- "maintainability",
91
- "observability",
92
- "accessibility",
93
- "usability",
94
- ];
95
- /** Segments of a requirement identity or product-goal identity. */
96
- export const IDENTITY_SEGMENT_PATTERN = /^[a-z0-9]+(-[a-z0-9]+)*$/;
97
- /**
98
- * Declares one specification's metadata. Identity function: it exists to type
99
- * the literal and to give discovery a stable syntactic anchor.
100
- */
101
- export const defineSpecification = (metadata) => metadata;
102
- /**
103
- * Declares a product-goal registry. Identity function with the same
104
- * literal-only discipline as `defineSpecification`.
105
- */
106
- export const defineProductGoals = (registry) => registry;
107
- /** Declares a boundary-specific execution binding. Identity function. */
108
- export const defineExecutionBinding = (binding) => binding;
109
- /**
110
- * Declares the static gates bound to a specification as evidence. Exported
111
- * as `boundEvidence` beside the `specification` constant. Identity function.
112
- */
113
- export const defineBoundEvidence = (evidence) => evidence;
114
- //# sourceMappingURL=contract.js.map
@@ -1,57 +0,0 @@
1
- /**
2
- * Decoders for the shared specification contract.
3
- *
4
- * Catalog tooling extracts each literal statically; result adapters read the
5
- * exported constant at run time. Both decode the unknown value through these
6
- * schemas so every corpus applies one vocabulary with one set of messages.
7
- *
8
- * @experimental This API is unstable and may change without notice.
9
- */
10
- import * as Schema from "effect/Schema";
11
- import { type ExecutionBinding, type ProductGoalRegistry, type BoundEvidenceGate, type SpecificationMetadata } from "./contract.js";
12
- export declare const SpecificationMetadataSchema: Schema.Struct<{
13
- readonly requirement: Schema.String;
14
- readonly title: Schema.NonEmptyString;
15
- readonly statement: Schema.NonEmptyString;
16
- readonly class: Schema.Literals<import("./contract.js").SpecificationClass[]>;
17
- readonly characteristic: Schema.optionalKey<Schema.String>;
18
- readonly role: Schema.Literals<import("./contract.js").SpecificationRole[]>;
19
- readonly goals: Schema.NonEmptyArray<Schema.String>;
20
- readonly boundary: Schema.optionalKey<Schema.Literals<import("./contract.js").ExecutionBoundary[]>>;
21
- readonly boundaryRationale: Schema.optionalKey<Schema.NonEmptyString>;
22
- readonly methods: Schema.NonEmptyArray<Schema.String>;
23
- readonly selection: Schema.optionalKey<Schema.Literals<import("./contract.js").ExecutionSelection[]>>;
24
- readonly derivedFrom: Schema.$Array<Schema.NonEmptyString>;
25
- readonly supersedes: Schema.$Array<Schema.NonEmptyString>;
26
- readonly assumptions: Schema.Union<readonly [Schema.$Array<Schema.NonEmptyString>, Schema.Literal<"unknown">]>;
27
- readonly openQuestions: Schema.Union<readonly [Schema.$Array<Schema.NonEmptyString>, Schema.Literal<"unknown">]>;
28
- readonly limitations: Schema.optionalKey<Schema.NonEmptyArray<Schema.Struct<{
29
- readonly limitation: Schema.NonEmptyString;
30
- readonly retirementCondition: Schema.NonEmptyString;
31
- }>>>;
32
- }>;
33
- export declare const ProductGoalRegistrySchema: Schema.$Record<Schema.String, Schema.Struct<{
34
- readonly outcome: Schema.NonEmptyString;
35
- readonly status: Schema.optionalKey<Schema.Literals<readonly ["active", "retired"]>>;
36
- }>>;
37
- export declare const ExecutionBindingSchema: Schema.Struct<{
38
- readonly requirements: Schema.NonEmptyArray<Schema.String>;
39
- readonly boundary: Schema.Literals<import("./contract.js").ExecutionBoundary[]>;
40
- readonly rationale: Schema.NonEmptyString;
41
- }>;
42
- export declare const BoundEvidenceSchema: Schema.NonEmptyArray<Schema.Struct<{
43
- readonly gate: Schema.NonEmptyString;
44
- readonly verifies: Schema.NonEmptyString;
45
- }>>;
46
- export type DecodeResult<T> = {
47
- readonly ok: true;
48
- readonly value: T;
49
- } | {
50
- readonly ok: false;
51
- readonly issues: readonly string[];
52
- };
53
- export declare const decodeSpecificationMetadata: (value: unknown) => DecodeResult<SpecificationMetadata>;
54
- export declare const decodeProductGoalRegistry: (value: unknown) => DecodeResult<ProductGoalRegistry>;
55
- export declare const decodeExecutionBinding: (value: unknown) => DecodeResult<ExecutionBinding>;
56
- export declare const decodeBoundEvidence: (value: unknown) => DecodeResult<readonly [BoundEvidenceGate, ...BoundEvidenceGate[]]>;
57
- //# sourceMappingURL=decode.d.ts.map
@@ -1,91 +0,0 @@
1
- /**
2
- * Decoders for the shared specification contract.
3
- *
4
- * Catalog tooling extracts each literal statically; result adapters read the
5
- * exported constant at run time. Both decode the unknown value through these
6
- * schemas so every corpus applies one vocabulary with one set of messages.
7
- *
8
- * @experimental This API is unstable and may change without notice.
9
- */
10
- import * as Result from "effect/Result";
11
- import * as Schema from "effect/Schema";
12
- import { formatSchemaIssuesToLines } from "../schema-issues.js";
13
- import { EXECUTION_BOUNDARIES, EXECUTION_SELECTIONS, IDENTITY_SEGMENT_PATTERN, SPECIFICATION_CLASSES, SPECIFICATION_ROLES, } from "./contract.js";
14
- const REQUIREMENT_IDENTITY_PATTERN = /^[a-z0-9]+(-[a-z0-9]+)*(\/[a-z0-9]+(-[a-z0-9]+)*)+$/;
15
- const RequirementIdentitySchema = Schema.String.pipe(Schema.check(Schema.isPattern(REQUIREMENT_IDENTITY_PATTERN, {
16
- title: "Requirement identity",
17
- message: "Expected two or more lowercase kebab segments joined by '/'",
18
- })));
19
- const IdentifierSchema = Schema.String.pipe(Schema.check(Schema.isPattern(IDENTITY_SEGMENT_PATTERN, {
20
- title: "Identifier",
21
- message: "Expected a lowercase kebab identifier",
22
- })));
23
- const SpecificationLimitationSchema = Schema.Struct({
24
- limitation: Schema.NonEmptyString,
25
- retirementCondition: Schema.NonEmptyString,
26
- });
27
- const StatedOrUnknownSchema = Schema.Union([
28
- Schema.Array(Schema.NonEmptyString),
29
- Schema.Literal("unknown"),
30
- ]);
31
- const specificationClasses = SPECIFICATION_CLASSES.map((entry) => entry);
32
- const specificationRoles = SPECIFICATION_ROLES.map((entry) => entry);
33
- const executionBoundaries = EXECUTION_BOUNDARIES.map((entry) => entry);
34
- const executionSelections = EXECUTION_SELECTIONS.map((entry) => entry);
35
- export const SpecificationMetadataSchema = Schema.Struct({
36
- requirement: RequirementIdentitySchema,
37
- title: Schema.NonEmptyString,
38
- statement: Schema.NonEmptyString,
39
- class: Schema.Literals(specificationClasses),
40
- characteristic: Schema.optionalKey(IdentifierSchema),
41
- role: Schema.Literals(specificationRoles),
42
- goals: Schema.NonEmptyArray(IdentifierSchema),
43
- boundary: Schema.optionalKey(Schema.Literals(executionBoundaries)),
44
- boundaryRationale: Schema.optionalKey(Schema.NonEmptyString),
45
- methods: Schema.NonEmptyArray(IdentifierSchema),
46
- selection: Schema.optionalKey(Schema.Literals(executionSelections)),
47
- derivedFrom: Schema.Array(Schema.NonEmptyString),
48
- supersedes: Schema.Array(Schema.NonEmptyString),
49
- assumptions: StatedOrUnknownSchema,
50
- openQuestions: StatedOrUnknownSchema,
51
- limitations: Schema.optionalKey(Schema.NonEmptyArray(SpecificationLimitationSchema)),
52
- }).pipe(Schema.check(Schema.makeFilter((metadata) => metadata.class === "quality" && metadata.characteristic === undefined
53
- ? "A quality specification must name the characteristic it measures"
54
- : undefined), Schema.makeFilter((metadata) => (metadata.boundary ?? "memory") !== "memory" && metadata.boundaryRationale === undefined
55
- ? "A specification observed outside memory must state the evidence that boundary supplies"
56
- : undefined), Schema.makeFilter((metadata) => metadata.supersedes.some((entry) => metadata.supersedes.indexOf(entry) !== metadata.supersedes.lastIndexOf(entry))
57
- ? "supersedes must not repeat an identity"
58
- : undefined)));
59
- const ProductGoalDefinitionSchema = Schema.Struct({
60
- outcome: Schema.NonEmptyString,
61
- status: Schema.optionalKey(Schema.Literals(["active", "retired"])),
62
- });
63
- export const ProductGoalRegistrySchema = Schema.Record(IdentifierSchema, ProductGoalDefinitionSchema);
64
- export const ExecutionBindingSchema = Schema.Struct({
65
- requirements: Schema.NonEmptyArray(RequirementIdentitySchema),
66
- boundary: Schema.Literals(executionBoundaries),
67
- rationale: Schema.NonEmptyString,
68
- });
69
- const BoundEvidenceGateSchema = Schema.Struct({
70
- gate: Schema.NonEmptyString,
71
- verifies: Schema.NonEmptyString,
72
- });
73
- export const BoundEvidenceSchema = Schema.NonEmptyArray(BoundEvidenceGateSchema);
74
- const toDecodeResult = (result) => Result.isSuccess(result)
75
- ? { ok: true, value: result.success }
76
- : { ok: false, issues: formatSchemaIssuesToLines(result.failure.issue) };
77
- /**
78
- * Metadata is a closed literal: a field the contract does not define is a
79
- * decoding failure, never ignored.
80
- */
81
- const decodeMetadata = Schema.decodeUnknownResult(SpecificationMetadataSchema, {
82
- onExcessProperty: "error",
83
- });
84
- const decodeRegistry = Schema.decodeUnknownResult(ProductGoalRegistrySchema);
85
- const decodeBinding = Schema.decodeUnknownResult(ExecutionBindingSchema);
86
- const decodeEvidence = Schema.decodeUnknownResult(BoundEvidenceSchema);
87
- export const decodeSpecificationMetadata = (value) => toDecodeResult(decodeMetadata(value));
88
- export const decodeProductGoalRegistry = (value) => toDecodeResult(decodeRegistry(value));
89
- export const decodeExecutionBinding = (value) => toDecodeResult(decodeBinding(value));
90
- export const decodeBoundEvidence = (value) => toDecodeResult(decodeEvidence(value));
91
- //# sourceMappingURL=decode.js.map
@@ -1,10 +0,0 @@
1
- /**
2
- * Area barrel for the shared executable-specification contract.
3
- *
4
- * @experimental This API is unstable and may change without notice.
5
- */
6
- export { type BoundEvidenceGate, EXECUTION_BOUNDARIES, EXECUTION_SELECTIONS, type ExecutionBinding, type ExecutionBoundary, type ExecutionSelection, IDENTITY_SEGMENT_PATTERN, KNOWN_QUALITY_CHARACTERISTICS, KNOWN_SPECIFICATION_METHODS, type KnownQualityCharacteristic, type KnownSpecificationMethod, type ProductGoalDefinition, type ProductGoalRegistry, SPECIFICATION_CLASSES, SPECIFICATION_ROLES, type SpecificationClass, type SpecificationLimitation, type SpecificationMetadata, type SpecificationRole, UNVERIFIABLE_SPECIFICATION_METHODS, defineBoundEvidence, defineExecutionBinding, defineProductGoals, defineSpecification, } from "./contract.js";
7
- export { BoundEvidenceSchema, ExecutionBindingSchema, ProductGoalRegistrySchema, SpecificationMetadataSchema, decodeBoundEvidence, decodeExecutionBinding, decodeProductGoalRegistry, decodeSpecificationMetadata, type DecodeResult, } from "./decode.js";
8
- export { type ConformanceIssue, type CorpusExecutionBinding, type CorpusInput, type CorpusSpecification, checkSpecificationCorpus, isExecutableMethodSet, lintProductLanguage, } from "./conformance.js";
9
- export { type SharedProductGoalId, sharedProductGoals } from "./shared-goals.js";
10
- //# sourceMappingURL=index.d.ts.map
@@ -1,10 +0,0 @@
1
- /**
2
- * Area barrel for the shared executable-specification contract.
3
- *
4
- * @experimental This API is unstable and may change without notice.
5
- */
6
- export { EXECUTION_BOUNDARIES, EXECUTION_SELECTIONS, IDENTITY_SEGMENT_PATTERN, KNOWN_QUALITY_CHARACTERISTICS, KNOWN_SPECIFICATION_METHODS, SPECIFICATION_CLASSES, SPECIFICATION_ROLES, UNVERIFIABLE_SPECIFICATION_METHODS, defineBoundEvidence, defineExecutionBinding, defineProductGoals, defineSpecification, } from "./contract.js";
7
- export { BoundEvidenceSchema, ExecutionBindingSchema, ProductGoalRegistrySchema, SpecificationMetadataSchema, decodeBoundEvidence, decodeExecutionBinding, decodeProductGoalRegistry, decodeSpecificationMetadata, } from "./decode.js";
8
- export { checkSpecificationCorpus, isExecutableMethodSet, lintProductLanguage, } from "./conformance.js";
9
- export { sharedProductGoals } from "./shared-goals.js";
10
- //# sourceMappingURL=index.js.map
@@ -1,36 +0,0 @@
1
- /**
2
- * Shared product goals: outcomes that more than one AgentXM repository
3
- * serves. Each is registered once, here, with a stable identity; every
4
- * repository's specification corpus references these identities and keeps
5
- * repository-specific goals in its own local registry. A local registry must
6
- * not redefine a shared identity.
7
- *
8
- * The registry does not restate, own, or rank the specifications that
9
- * support a goal. Requirements review walks goals: a retired goal makes its
10
- * referencing specifications retirement candidates, and an active goal with
11
- * no referencing specification identifies missing coverage or a dead goal.
12
- *
13
- * @experimental This API is unstable and may change without notice.
14
- */
15
- export declare const sharedProductGoals: {
16
- readonly "extension-adoption": {
17
- readonly outcome: "People and agents can find, install, update, and remove reusable extensions across coding agents through dependable product surfaces.";
18
- };
19
- readonly "trustworthy-distribution": {
20
- readonly outcome: "Publishing and acquiring extensions preserves integrity, provenance, and immutable accepted resolutions.";
21
- };
22
- readonly "machine-automation": {
23
- readonly outcome: "Machine consumers can drive AgentXM surfaces non-interactively with complete, schema-backed results separated from diagnostics.";
24
- };
25
- readonly "knowledge-access": {
26
- readonly outcome: "People and agents can discover concepts, commands, and contracts from the surface they are already using.";
27
- };
28
- readonly "privacy-and-consent": {
29
- readonly outcome: "Observation of product use stays within the documented data boundary and under the control of the person being observed.";
30
- };
31
- readonly "dependable-change-process": {
32
- readonly outcome: "Changes and releases land through the governed repository process with required evidence and human approval.";
33
- };
34
- };
35
- export type SharedProductGoalId = keyof typeof sharedProductGoals;
36
- //# sourceMappingURL=shared-goals.d.ts.map
@@ -1,36 +0,0 @@
1
- /**
2
- * Shared product goals: outcomes that more than one AgentXM repository
3
- * serves. Each is registered once, here, with a stable identity; every
4
- * repository's specification corpus references these identities and keeps
5
- * repository-specific goals in its own local registry. A local registry must
6
- * not redefine a shared identity.
7
- *
8
- * The registry does not restate, own, or rank the specifications that
9
- * support a goal. Requirements review walks goals: a retired goal makes its
10
- * referencing specifications retirement candidates, and an active goal with
11
- * no referencing specification identifies missing coverage or a dead goal.
12
- *
13
- * @experimental This API is unstable and may change without notice.
14
- */
15
- import { defineProductGoals } from "./contract.js";
16
- export const sharedProductGoals = defineProductGoals({
17
- "extension-adoption": {
18
- outcome: "People and agents can find, install, update, and remove reusable extensions across coding agents through dependable product surfaces.",
19
- },
20
- "trustworthy-distribution": {
21
- outcome: "Publishing and acquiring extensions preserves integrity, provenance, and immutable accepted resolutions.",
22
- },
23
- "machine-automation": {
24
- outcome: "Machine consumers can drive AgentXM surfaces non-interactively with complete, schema-backed results separated from diagnostics.",
25
- },
26
- "knowledge-access": {
27
- outcome: "People and agents can discover concepts, commands, and contracts from the surface they are already using.",
28
- },
29
- "privacy-and-consent": {
30
- outcome: "Observation of product use stays within the documented data boundary and under the control of the person being observed.",
31
- },
32
- "dependable-change-process": {
33
- outcome: "Changes and releases land through the governed repository process with required evidence and human approval.",
34
- },
35
- });
36
- //# sourceMappingURL=shared-goals.js.map