artifact-contracts 0.33.4 → 0.33.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +40 -0
  2. package/cli-contract.yaml +126 -0
  3. package/dist/agents/orchestrator.js +1 -1
  4. package/dist/agents/orchestrator.js.map +1 -1
  5. package/dist/agents/types.d.ts +1 -1
  6. package/dist/agents/types.d.ts.map +1 -1
  7. package/dist/artifact-contracts.bundle.mjs +529 -187
  8. package/dist/artifact-contracts.bundle.mjs.map +4 -4
  9. package/dist/cli/discover.d.ts +12 -0
  10. package/dist/cli/discover.d.ts.map +1 -0
  11. package/dist/cli/discover.js +208 -0
  12. package/dist/cli/discover.js.map +1 -0
  13. package/dist/cli/index.js +4 -0
  14. package/dist/cli/index.js.map +1 -1
  15. package/dist/generated/contract.d.ts.map +1 -1
  16. package/dist/generated/contract.js +2 -2
  17. package/dist/generated/contract.js.map +1 -1
  18. package/dist/generated/dsl/agents.d.ts +1 -0
  19. package/dist/generated/dsl/agents.d.ts.map +1 -1
  20. package/dist/generated/dsl/agents.js +35 -0
  21. package/dist/generated/dsl/agents.js.map +1 -1
  22. package/dist/generated/dsl/dsl-data.d.ts.map +1 -1
  23. package/dist/generated/dsl/dsl-data.js +190 -1
  24. package/dist/generated/dsl/dsl-data.js.map +1 -1
  25. package/dist/generated/dsl/handoffs.d.ts +146 -12
  26. package/dist/generated/dsl/handoffs.d.ts.map +1 -1
  27. package/dist/generated/dsl/handoffs.js +41 -0
  28. package/dist/generated/dsl/handoffs.js.map +1 -1
  29. package/dist/generated/dsl/tasks.d.ts +1 -0
  30. package/dist/generated/dsl/tasks.d.ts.map +1 -1
  31. package/dist/generated/dsl/tasks.js +18 -0
  32. package/dist/generated/dsl/tasks.js.map +1 -1
  33. package/dist/generated/dsl/workflows.d.ts +1 -0
  34. package/dist/generated/dsl/workflows.d.ts.map +1 -1
  35. package/dist/generated/dsl/workflows.js +19 -0
  36. package/dist/generated/dsl/workflows.js.map +1 -1
  37. package/dist/generated/policy.d.ts +49 -0
  38. package/dist/generated/policy.d.ts.map +1 -1
  39. package/dist/generated/policy.js +71 -0
  40. package/dist/generated/policy.js.map +1 -1
  41. package/dist/generated/program.d.ts +10 -0
  42. package/dist/generated/program.d.ts.map +1 -1
  43. package/dist/generated/program.js +28 -2
  44. package/dist/generated/program.js.map +1 -1
  45. package/dist/generated/schemas.d.ts +58 -0
  46. package/dist/generated/schemas.d.ts.map +1 -1
  47. package/dist/generated/schemas.js +70 -0
  48. package/dist/generated/schemas.js.map +1 -1
  49. package/dist/generated/types.d.ts +36 -0
  50. package/dist/generated/types.d.ts.map +1 -1
  51. package/docs/cli-reference.md +60 -0
  52. package/package.json +1 -1
  53. package/schemas/2026B.config.json +47 -0
  54. package/schemas/2026B.json +165 -0
@@ -0,0 +1,12 @@
1
+ export interface DiscoverOptions {
2
+ adapter?: string;
3
+ model?: string;
4
+ showPrompt?: boolean;
5
+ dryRun?: boolean;
6
+ write?: boolean;
7
+ output?: string;
8
+ reportFormat?: string;
9
+ logFile?: string;
10
+ }
11
+ export declare function handleDiscover(options: DiscoverOptions): Promise<void>;
12
+ //# sourceMappingURL=discover.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discover.d.ts","sourceRoot":"","sources":["../../src/cli/discover.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAUD,wBAAsB,cAAc,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAkE5E"}
@@ -0,0 +1,208 @@
1
+ import { existsSync, readFileSync, writeFileSync } from "node:fs";
2
+ import { execSync } from "node:child_process";
3
+ import { resolve } from "node:path";
4
+ import { stringify as yamlStringify } from "yaml";
5
+ const EXIT_RUNTIME_MISSING = 11;
6
+ const EXIT_ADAPTER_ERROR = 12;
7
+ export async function handleDiscover(options) {
8
+ const yamlPath = resolve("artifact-contracts.yaml");
9
+ const mode = existsSync(yamlPath) ? "update" : "init";
10
+ let fileTree;
11
+ try {
12
+ fileTree = await getFileTree();
13
+ }
14
+ catch (err) {
15
+ process.stderr.write(`Error: ${err.message}\n`);
16
+ process.exit(3);
17
+ }
18
+ let existingContent;
19
+ if (mode === "update") {
20
+ try {
21
+ existingContent = readFileSync(yamlPath, "utf-8");
22
+ }
23
+ catch (err) {
24
+ process.stderr.write(`Error: ${err.message}\n`);
25
+ process.exit(3);
26
+ }
27
+ }
28
+ const metadata = getProjectMetadata();
29
+ const context = buildDiscoverContext({ mode, fileTree, existingContent, metadata });
30
+ if (options.showPrompt || options.dryRun) {
31
+ console.log(context);
32
+ return;
33
+ }
34
+ const { runAgentTask } = await import("../agents/orchestrator.js");
35
+ let result;
36
+ try {
37
+ result = await runAgentTask(context, "discover-artifact-definitions", {
38
+ adapter: options.adapter ?? "mock",
39
+ model: options.model,
40
+ }, {
41
+ dryRun: false,
42
+ failOn: "error",
43
+ logFile: options.logFile,
44
+ });
45
+ }
46
+ catch (err) {
47
+ const exitCode = err.exitCode;
48
+ if (exitCode === EXIT_RUNTIME_MISSING) {
49
+ process.stderr.write(err.message + "\n");
50
+ process.exit(EXIT_RUNTIME_MISSING);
51
+ }
52
+ if (exitCode === EXIT_ADAPTER_ERROR) {
53
+ process.stderr.write(`Adapter error: ${err.message}\n`);
54
+ process.exit(EXIT_ADAPTER_ERROR);
55
+ }
56
+ throw err;
57
+ }
58
+ const output = extractOutput(result, mode, options.reportFormat ?? "yaml");
59
+ if (options.write) {
60
+ writeFileSync(yamlPath, output, "utf-8");
61
+ process.stderr.write(`Written to ${yamlPath}\n`);
62
+ }
63
+ else if (options.output) {
64
+ writeFileSync(resolve(options.output), output, "utf-8");
65
+ process.stderr.write(`Written to ${options.output}\n`);
66
+ }
67
+ else {
68
+ console.log(output);
69
+ }
70
+ }
71
+ async function getFileTree() {
72
+ const cwd = process.cwd();
73
+ let filePaths;
74
+ try {
75
+ const output = execSync("git ls-files", {
76
+ encoding: "utf-8",
77
+ cwd,
78
+ });
79
+ filePaths = output.trim().split("\n").filter(Boolean);
80
+ }
81
+ catch {
82
+ try {
83
+ const { globSync } = await import("glob");
84
+ filePaths = globSync("**/*", {
85
+ cwd,
86
+ dot: true,
87
+ nodir: true,
88
+ ignore: ["node_modules/**", ".git/**"],
89
+ });
90
+ }
91
+ catch (err) {
92
+ throw new Error(`Failed to enumerate repository files: ${err.message}`);
93
+ }
94
+ }
95
+ return organizeFileTree(filePaths);
96
+ }
97
+ function organizeFileTree(filePaths) {
98
+ const tree = {};
99
+ for (const filePath of filePaths.sort()) {
100
+ const parts = filePath.split("/");
101
+ const dir = parts.length > 1 ? parts.slice(0, -1).join("/") : ".";
102
+ if (!tree[dir])
103
+ tree[dir] = [];
104
+ tree[dir].push(filePath);
105
+ }
106
+ const lines = [];
107
+ for (const dir of Object.keys(tree).sort()) {
108
+ lines.push(`${dir}/`);
109
+ for (const file of tree[dir]) {
110
+ lines.push(` ${file}`);
111
+ }
112
+ lines.push("");
113
+ }
114
+ return lines.join("\n");
115
+ }
116
+ function getProjectMetadata() {
117
+ const pkgPath = resolve("package.json");
118
+ if (!existsSync(pkgPath)) {
119
+ return "No package.json found.";
120
+ }
121
+ try {
122
+ const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
123
+ const lines = [
124
+ `name: ${pkg.name ?? "unknown"}`,
125
+ pkg.description ? `description: ${pkg.description}` : "",
126
+ pkg.version ? `version: ${pkg.version}` : "",
127
+ pkg.keywords?.length ? `keywords: ${pkg.keywords.join(", ")}` : "",
128
+ pkg.repository?.url ? `repository: ${pkg.repository.url}` : "",
129
+ ];
130
+ return lines.filter(Boolean).join("\n");
131
+ }
132
+ catch {
133
+ return "package.json exists but could not be parsed.";
134
+ }
135
+ }
136
+ function buildDiscoverContext(input) {
137
+ const { mode, fileTree, existingContent, metadata } = input;
138
+ const lines = [
139
+ "# Artifact Discovery",
140
+ "",
141
+ `## Mode: ${mode}`,
142
+ mode === "init"
143
+ ? "Create a new artifact-contracts.yaml from scratch based on the project file structure."
144
+ : "Update the existing artifact-contracts.yaml by adding definitions for uncovered files. Preserve all existing artifact definitions.",
145
+ "",
146
+ "## Project Metadata",
147
+ "",
148
+ metadata,
149
+ "",
150
+ "## Repository File Tree",
151
+ "",
152
+ fileTree,
153
+ ];
154
+ if (mode === "update" && existingContent) {
155
+ lines.push("## Existing artifact-contracts.yaml", "", "```yaml", existingContent, "```", "");
156
+ }
157
+ lines.push("## artifact-contracts.yaml Schema Reference", "", "The generated YAML must conform to this schema:", "", "```yaml", "artifact_contracts: \"2026A\" # or latest schema version", "", "system:", " id: <kebab-case-system-id>", " name: <human-readable name>", "", "artifacts:", " <artifact-id>: # kebab-case IDs", " type: <artifact-type> # e.g. source, config, generated-code, generated-doc", " description: <optional description>", " authority: canonical | derived | generated | control", " manual_edit: allowed | discouraged | forbidden # optional, defaults by authority", " change_control: none | approval-required | regeneration-required # optional", " visibility: public | internal | private # optional", " path_patterns: # required, at least one pattern", " - \"glob/pattern/**\"", " exclude_patterns: # optional", " - \"glob/pattern/to/exclude/**\"", "", "trace:", " links:", " - id: <kebab-case-link-id>", " from: <source-artifact-id>", " to: <target-artifact-id>", " resolver: operationId | ast | naming | codegen", " description: <optional description>", "```", "", "### Authority Guidelines", "", "- canonical: hand-written source of truth (source code, configs)", "- derived: generated from canonical sources but may need review (docs)", "- generated: auto-generated, should not be manually edited", "- control: governance/control files (CI, hooks)", "", "### Type Guidelines", "", "- source: application/library source code", "- config: configuration files (YAML, JSON configs)", "- generated-code: auto-generated code", "- generated-doc: auto-generated documentation", "", "### Path Pattern Rules", "", "- Use specific glob patterns, not overly broad ones like \"**/*\"", "- Group logically related files into single artifacts", "- Use exclude_patterns to omit test files, generated subdirs, etc.", "- Artifact IDs must be kebab-case", "", "### Trace Link Guidelines", "", "- Detect relationships between config/DSL artifacts and their generated outputs", "- Use resolver: codegen for build-time generation relationships", "- Use resolver: naming for convention-based relationships", "- Use resolver: ast for code-level references", "- Use resolver: operationId for API operation references", "", "## Instructions", "", "1. Analyze the file tree and group files into logical artifacts", "2. Assign appropriate type, authority, and path_patterns to each artifact", "3. Detect trace link relationships (especially config/DSL → generated code)", "4. In update mode, preserve ALL existing artifact definitions unchanged", "5. Add new artifacts only for files not covered by existing patterns", "6. Generate complete, valid artifact-contracts.yaml content", "", "## Output Format", "", "Respond with a JSON object matching the artifact-discovery-result handoff schema:", "", "```json", "{", " \"artifact_contracts_yaml\": \"<complete YAML string for artifact-contracts.yaml>\",", " \"decisions\": [", " { \"artifact_id\": \"<id>\", \"reasoning\": \"<why this grouping>\" }", " ],", " \"trace_decisions\": [", " { \"link_id\": \"<id>\", \"reasoning\": \"<why this trace link>\" }", " ],", " \"uncategorized_files\": [\"<files that could not be categorized>\"],", " \"suggestions\": [\"<improvement suggestions>\"]", "}", "```", "", "The artifact_contracts_yaml field must contain the complete, valid YAML document.", "");
158
+ return lines.join("\n");
159
+ }
160
+ function extractOutput(result, mode, reportFormat) {
161
+ if (result.status === "error") {
162
+ const msg = result.errorMessage ?? "Unknown error";
163
+ if (reportFormat === "json")
164
+ return JSON.stringify({ error: msg }, null, 2);
165
+ if (reportFormat === "yaml")
166
+ return yamlStringify({ error: msg });
167
+ return `Error: ${msg}`;
168
+ }
169
+ const data = result.data;
170
+ if (reportFormat === "json") {
171
+ const jsonResult = {
172
+ mode,
173
+ artifact_contracts_yaml: data?.artifact_contracts_yaml ?? extractYamlFromRaw(result.raw),
174
+ decisions: data?.decisions ?? [],
175
+ trace_decisions: data?.trace_decisions ?? [],
176
+ uncategorized_files: data?.uncategorized_files ?? [],
177
+ suggestions: data?.suggestions ?? [],
178
+ };
179
+ return JSON.stringify(jsonResult, null, 2);
180
+ }
181
+ const yamlContent = data?.artifact_contracts_yaml ?? extractYamlFromRaw(result.raw);
182
+ if (reportFormat === "yaml") {
183
+ return yamlContent;
184
+ }
185
+ return yamlContent;
186
+ }
187
+ function extractYamlFromRaw(raw) {
188
+ if (!raw)
189
+ return "";
190
+ try {
191
+ const parsed = JSON.parse(raw);
192
+ if (parsed.artifact_contracts_yaml) {
193
+ return parsed.artifact_contracts_yaml;
194
+ }
195
+ }
196
+ catch {
197
+ // not JSON, try to extract YAML block
198
+ }
199
+ const yamlBlockMatch = raw.match(/```ya?ml\n([\s\S]*?)```/);
200
+ if (yamlBlockMatch) {
201
+ return yamlBlockMatch[1].trim();
202
+ }
203
+ if (raw.includes("artifact_contracts:")) {
204
+ return raw.trim();
205
+ }
206
+ return raw;
207
+ }
208
+ //# sourceMappingURL=discover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discover.js","sourceRoot":"","sources":["../../src/cli/discover.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,MAAM,CAAC;AAElD,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAChC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAqB9B,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,OAAwB;IAC3D,MAAM,QAAQ,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;IACpD,MAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC;IAEtD,IAA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,yBAAyB,CAAC,CAAC;IAC5D,IAAI,cAAc,EAAE,CAAC;QACnB,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAClC,CAAC;IAED,IAAI,GAAG,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,CAAC;QACxC,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC;IACpB,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC"}
package/dist/cli/index.js CHANGED
@@ -8,6 +8,7 @@ import { handleResolve } from "./resolve.js";
8
8
  import { handleList } from "./list.js";
9
9
  import { handleExplain } from "./explain.js";
10
10
  import { handleAudit } from "./audit.js";
11
+ import { handleDiscover } from "./discover.js";
11
12
  import { resolvedDsl } from "../generated/dsl/index.js";
12
13
  const __dirname = dirname(fileURLToPath(import.meta.url));
13
14
  const pkg = JSON.parse(readFileSync(resolve(__dirname, "../../package.json"), "utf-8"));
@@ -31,6 +32,9 @@ const handlers = {
31
32
  audit: async (opts) => {
32
33
  await handleAudit(opts);
33
34
  },
35
+ discover: async (opts) => {
36
+ await handleDiscover(opts);
37
+ },
34
38
  agents: async (opts) => {
35
39
  const YAML = await import("yaml");
36
40
  const format = opts.format ?? "yaml";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAwB,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,c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B,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YACpD,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;YAC/D,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,yBAA0B,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;YACjE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;CACF,CAAC;AAEF,aAAa,CAAC,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src/generated/contract.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,EAAE,MAAmklB,CAAC;AAEhmlB,eAAO,MAAM,iBAAiB,EAAE,MAAmk3B,CAAC"}
1
+ {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src/generated/contract.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,EAAE,MAAk5tB,CAAC;AAE/6tB,eAAO,MAAM,iBAAiB,EAAE,MAAkukC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  // Auto-generated by cli-contracts. Do not edit.
2
2
  // Embedded contract for the extract subcommand.
3
- export const CONTRACT_YAML = "# yaml-language-server: $schema=./node_modules/cli-contracts/schemas/cli-contract.schema.json\ncli_contracts: 0.1.0\n\ninfo:\n title: artifact-contracts CLI\n version: 0.1.1\n description: >-\n Declarative artifact registry — define file properties, resolve\n paths to artifact IDs, and detect definition overlaps.\n stdout is reserved for primary output (JSON/YAML/text result);\n all diagnostics and progress messages go to stderr.\n license:\n name: MIT\n contact:\n name: foo-log-inc\n url: https://github.com/foo-log-inc/artifact-contracts\n\nartifact_slots:\n artifact-definitions:\n description: artifact-contracts.yaml definitions and config files\n direction: read\n repository-files:\n description: Repository files scanned for path pattern matching and overlap detection\n direction: read\n audit-report:\n description: LLM audit result output files\n direction: write\n\ncommand_sets:\n artifact-contracts:\n summary: >-\n Artifact registry CLI — validate definitions, resolve artifacts,\n list registered entries, and explain file properties.\n executable: artifact-contracts\n\n global_options:\n - name: version\n aliases: [V]\n description: Output the version number\n schema:\n type: boolean\n - name: help\n aliases: [h]\n description: Display help for command\n schema:\n type: boolean\n\n commands:\n validate:\n summary: Validate artifact-contracts definitions\n description: >-\n Validates artifact-contracts.yaml against the schema, checks\n artifact ID naming conventions, ensures path_patterns are\n non-empty, and optionally detects overlapping definitions\n against real repository files.\n options:\n - name: config\n description: Path to artifact-contracts.config.yaml\n value_name: path\n - name: check-files\n description: >-\n Scan repository files to detect path_patterns overlaps\n that static glob analysis cannot fully determine.\n When enabled, reads all files from git ls-files or glob.\n schema:\n type: boolean\n effects:\n risk_level: low\n reads:\n - artifact-definitions\n - repository-files\n execution_mode: normal\n x-agent:\n expected_duration_ms: 5000\n retryable_exit_codes: []\n stdout:\n schema:\n $ref: \"#/components/schemas/ValidationResult\"\n description: >-\n Validation diagnostics. On exit 0 stdout is empty (diagnostics\n go to stderr). On exit 1/2 with --format json, structured\n diagnostics are written to stdout.\n exits:\n \"0\":\n description: Validation passed with no errors\n \"1\":\n description: Schema or naming convention errors detected\n \"2\":\n description: Overlap detected — same path matches multiple artifacts\n \"3\":\n description: Config or input file not found / parse error\n\n resolve:\n summary: Output fully-resolved artifact definitions\n description: >-\n Expands config variables, applies authority-based defaults\n for manual_edit and change_control, and outputs the complete\n resolved DSL. Default format is yaml.\n options:\n - name: config\n description: Path to artifact-contracts.config.yaml\n value_name: path\n - name: format\n description: \"Output format (default: yaml)\"\n schema:\n type: string\n enum: [yaml, json]\n effects:\n risk_level: low\n reads:\n - artifact-definitions\n execution_mode: normal\n x-agent:\n expected_duration_ms: 2000\n retryable_exit_codes: []\n stdout:\n schema:\n $ref: \"#/components/schemas/ResolvedDefinitions\"\n description: >-\n Fully resolved artifact definitions with authority-based\n defaults applied. Format varies by --format (yaml default, json).\n exits:\n \"0\":\n description: Successfully output resolved definitions\n \"1\":\n description: Error resolving definitions\n \"3\":\n description: Config or input file not found / parse error\n\n list:\n summary: List registered artifacts\n description: >-\n Displays all registered artifacts with optional filtering\n by authority. Use --path for simple ID lookup; use explain\n for full governance metadata. Default format is text.\n options:\n - name: config\n description: Path to artifact-contracts.config.yaml\n value_name: path\n - name: authority\n description: Filter by authority type\n schema:\n type: string\n enum: [canonical, derived, generated, control]\n - name: path\n description: >-\n Reverse-lookup — show artifact IDs matching this file\n path. For full governance details, use the explain command.\n value_name: file\n - name: format\n description: \"Output format (default: text)\"\n schema:\n type: string\n enum: [text, json, yaml]\n effects:\n risk_level: low\n reads:\n - artifact-definitions\n execution_mode: normal\n x-agent:\n expected_duration_ms: 2000\n retryable_exit_codes: []\n stdout:\n schema:\n $ref: \"#/components/schemas/ArtifactList\"\n description: >-\n List of matching artifacts. Schema applies to --format json\n and --format yaml. Text format is human-readable only.\n exits:\n \"0\":\n description: Successfully listed artifacts\n \"1\":\n description: Error reading definitions\n \"3\":\n description: Config or input file not found / parse error\n\n explain:\n summary: Explain artifact properties for a file path\n description: >-\n Given a file path, resolves the matching artifact and displays\n its full governance properties — artifact ID, authority,\n manual_edit policy, change_control, and other metadata.\n Useful for humans and LLM agents to understand file\n governance. Default format is text.\n arguments:\n - name: path\n description: File path to explain\n required: true\n options:\n - name: config\n description: Path to artifact-contracts.config.yaml\n value_name: path\n - name: format\n description: \"Output format (default: text)\"\n schema:\n type: string\n enum: [text, json, yaml]\n effects:\n risk_level: low\n reads:\n - artifact-definitions\n execution_mode: normal\n x-agent:\n expected_duration_ms: 2000\n retryable_exit_codes: []\n stdout:\n schema:\n $ref: \"#/components/schemas/ArtifactExplanation\"\n description: >-\n Artifact governance metadata for the resolved path.\n Schema applies to --format json and --format yaml.\n Text format is human-readable only.\n exits:\n \"0\":\n description: Path resolved to an artifact\n \"2\":\n description: Overlap — path matches multiple artifacts\n \"3\":\n description: Config or input file not found / parse error\n \"4\":\n description: Path does not match any registered artifact\n\n audit:\n summary: LLM-based semantic audit of artifact definitions\n description: >-\n Performs semantic analysis of artifact definitions using LLM\n to identify quality issues that static validation cannot\n detect — naming inconsistencies, missing coverage for common\n file types, authority mismatches, and structural improvements.\n options:\n - name: config\n description: Path to artifact-contracts.config.yaml\n value_name: path\n - name: adapter\n description: LLM adapter to use\n schema:\n type: string\n enum: [mock, openai, claude, gemini]\n - name: model\n description: Model name to pass to the adapter\n - name: show-prompt\n description: Output the constructed prompt without calling the LLM API\n schema:\n type: boolean\n - name: dry-run\n aliases: [n]\n description: Alias for --show-prompt (output prompt without LLM call)\n schema:\n type: boolean\n - name: fail-on\n description: >-\n Minimum severity that causes exit 10. Ordering:\n critical > error > warning > info. For example,\n --fail-on warning exits 10 on warning, error, or critical.\n schema:\n type: string\n enum: [info, warning, error, critical]\n - name: output\n aliases: [o]\n description: Write result to a file instead of stdout\n value_name: file\n - name: report-format\n description: >-\n Output format for the report (default: text).\n LLM commands use --report-format; deterministic\n commands use --format.\n schema:\n type: string\n enum: [text, json, yaml]\n - name: log-file\n aliases: [l]\n description: Write agent progress log to this file path.\n schema:\n type: string\n effects:\n risk_level: medium\n reads:\n - artifact-definitions\n writes:\n - audit-report\n network:\n description: LLM API calls to configured provider\n idempotent: false\n execution_mode: normal\n stdout:\n schema:\n $ref: \"#/components/schemas/AgentAuditResult\"\n description: >-\n Structured audit result conforming to the AgentAuditResult\n schema. Format varies by --report-format (json, yaml, text).\n x-agent:\n dslTask: audit-artifact-definitions\n riskLevel: low\n requiresConfirmation: false\n idempotent: true\n sideEffects: [network]\n sideEffectNote: >-\n Makes network calls to the configured LLM provider when adapter is\n not mock. Filesystem write only when --output is specified.\n safeDryRunOption: show-prompt\n expectedDurationMs: 120000\n retryableExitCodes: [1, 12]\n recommendedBeforeUse:\n - \"Run with --show-prompt first to preview the prompt\"\n exits:\n \"0\":\n description: Audit completed — no findings above threshold\n \"1\":\n description: General / transient error\n \"3\":\n description: Config or input file not found / parse error\n \"10\":\n description: Findings detected above --fail-on threshold\n \"11\":\n description: agent-contracts-runtime is not installed\n \"12\":\n description: Adapter initialization error (missing API key, etc.)\n\n # ── agents ──────────────────────────────────────────\n agents:\n summary: Output the full resolved agent DSL as structured data.\n description: >-\n Outputs the complete resolved agent-contracts DSL (agents, tasks,\n workflows, handoff_types) embedded in this CLI binary.\n Useful for debugging, external tooling integration, and DSL\n inspection.\n options:\n - name: format\n aliases: [F]\n description: Output format.\n schema:\n type: string\n enum: [yaml, json]\n default: yaml\n\n exits:\n '0':\n description: DSL output successfully.\n stdout:\n format: text\n '1':\n description: Failed to load embedded DSL.\n stderr:\n format: text\n\n x-agent:\n riskLevel: low\n requiresConfirmation: false\n idempotent: true\n sideEffects: []\n\n env:\n OPENAI_API_KEY:\n description: >-\n OpenAI API key. Required when --adapter openai is selected.\n required: false\n ANTHROPIC_API_KEY:\n description: >-\n Anthropic API key. Required when --adapter claude is selected.\n required: false\n GEMINI_API_KEY:\n description: >-\n Google Gemini API key. Required when --adapter gemini is selected.\n required: false\n\ncomponents:\n schemas:\n AgentFinding:\n type: object\n properties:\n id:\n type: string\n severity:\n type: string\n enum: [critical, error, warning, info]\n category:\n type: string\n title:\n type: string\n description:\n type: string\n location:\n type: string\n target:\n type: string\n recommendation:\n type: string\n evidence:\n type: array\n items:\n $ref: \"#/components/schemas/AgentEvidence\"\n required: [id, severity, category, title, description]\n\n AgentAuditResult:\n type: object\n properties:\n summary:\n type: string\n risk_level:\n type: string\n enum: [none, low, medium, high, critical]\n findings:\n type: array\n items:\n $ref: \"#/components/schemas/AgentFinding\"\n recommended_actions:\n type: array\n items:\n $ref: \"#/components/schemas/AgentRecommendedAction\"\n metadata:\n type: object\n properties:\n total_artifacts:\n type: integer\n analyzed_artifacts:\n type: integer\n analysis_scope:\n type: string\n required: [summary, risk_level, findings, recommended_actions]\n\n AgentEvidence:\n type: object\n properties:\n kind:\n type: string\n enum: [schema, code, config, runtime, doc]\n target:\n type: string\n location:\n type: string\n excerpt:\n type: string\n reasoning:\n type: string\n required: [kind]\n\n AgentRecommendedAction:\n type: object\n properties:\n action:\n type: string\n priority:\n type: string\n enum: [high, medium, low]\n description:\n type: string\n required: [action, priority]\n\n ResolvedDefinitions:\n type: object\n description: Output of the resolve command\n properties:\n artifact_contracts:\n type: string\n system:\n type: object\n properties:\n id:\n type: string\n name:\n type: string\n required: [id]\n artifacts:\n type: object\n description: Map of artifact ID to resolved artifact definition\n additionalProperties:\n $ref: \"#/components/schemas/ArtifactDefinition\"\n required: [artifact_contracts, system, artifacts]\n\n ArtifactExplanation:\n type: object\n description: Output of the explain command (json/yaml format)\n properties:\n id:\n type: string\n type:\n type: string\n authority:\n type: string\n manual_edit:\n type: string\n change_control:\n type: string\n visibility:\n type: string\n description:\n type: string\n path_patterns:\n type: array\n items:\n type: string\n exclude_patterns:\n type: array\n items:\n type: string\n required: [id, type, authority, manual_edit, change_control]\n\n ArtifactDefinition:\n type: object\n description: A single resolved artifact definition\n properties:\n type:\n type: string\n authority:\n type: string\n enum: [canonical, derived, generated, control]\n manual_edit:\n type: string\n enum: [allowed, discouraged, forbidden]\n change_control:\n type: string\n enum: [none, approval-required, regeneration-required]\n visibility:\n type: string\n enum: [public, internal, private]\n description:\n type: string\n path_patterns:\n type: array\n items:\n type: string\n exclude_patterns:\n type: array\n items:\n type: string\n states:\n type: array\n items:\n type: string\n required: [type, authority, manual_edit, change_control, visibility, path_patterns]\n\n ArtifactList:\n type: object\n description: Output of the list command (json/yaml format)\n properties:\n artifacts:\n type: object\n description: Map of artifact ID to resolved artifact definition\n additionalProperties:\n $ref: \"#/components/schemas/ArtifactDefinition\"\n\n ValidationResult:\n type: object\n description: Output of the validate command (json format, on error)\n properties:\n valid:\n type: boolean\n diagnostics:\n type: array\n items:\n type: object\n properties:\n path:\n type: string\n message:\n type: string\n severity:\n type: string\n enum: [error, warning]\n required: [message, severity]\n overlaps:\n type: array\n items:\n type: object\n properties:\n path:\n type: string\n matching_artifacts:\n type: array\n items:\n type: string\n required: [path, matching_artifacts]\n required: [valid, diagnostics, overlaps]\n";
4
- export const CONTRACT_JSON_STR = "{\n \"cli_contracts\": \"0.1.0\",\n \"info\": {\n \"title\": \"artifact-contracts CLI\",\n \"version\": \"0.1.1\",\n \"description\": \"Declarative artifact registry — define file properties, resolve paths to artifact IDs, and detect definition overlaps. stdout is reserved for primary output (JSON/YAML/text result); all diagnostics and progress messages go to stderr.\",\n \"license\": {\n \"name\": \"MIT\"\n },\n \"contact\": {\n \"name\": \"foo-log-inc\",\n \"url\": \"https://github.com/foo-log-inc/artifact-contracts\"\n }\n },\n \"artifact_slots\": {\n \"artifact-definitions\": {\n \"description\": \"artifact-contracts.yaml definitions and config files\",\n \"direction\": \"read\"\n },\n \"repository-files\": {\n \"description\": \"Repository files scanned for path pattern matching and overlap detection\",\n \"direction\": \"read\"\n },\n \"audit-report\": {\n \"description\": \"LLM audit result output files\",\n \"direction\": \"write\"\n }\n },\n \"command_sets\": {\n \"artifact-contracts\": {\n \"summary\": \"Artifact registry CLI — validate definitions, resolve artifacts, list registered entries, and explain file properties.\",\n \"executable\": \"artifact-contracts\",\n \"global_options\": [\n {\n \"name\": \"version\",\n \"aliases\": [\n \"V\"\n ],\n \"description\": \"Output the version number\",\n \"schema\": {\n \"type\": \"boolean\"\n }\n },\n {\n \"name\": \"help\",\n \"aliases\": [\n \"h\"\n ],\n \"description\": \"Display help for command\",\n \"schema\": {\n \"type\": \"boolean\"\n }\n }\n ],\n \"commands\": {\n \"validate\": {\n \"summary\": \"Validate artifact-contracts definitions\",\n \"description\": \"Validates artifact-contracts.yaml against the schema, checks artifact ID naming conventions, ensures path_patterns are non-empty, and optionally detects overlapping definitions against real repository files.\",\n \"options\": [\n {\n \"name\": \"config\",\n \"description\": \"Path to artifact-contracts.config.yaml\",\n \"value_name\": \"path\"\n },\n {\n \"name\": \"check-files\",\n \"description\": \"Scan repository files to detect path_patterns overlaps that static glob analysis cannot fully determine. When enabled, reads all files from git ls-files or glob.\",\n \"schema\": {\n \"type\": \"boolean\"\n }\n }\n ],\n \"effects\": {\n \"risk_level\": \"low\",\n \"reads\": [\n \"artifact-definitions\",\n \"repository-files\"\n ],\n \"execution_mode\": \"normal\"\n },\n \"x-agent\": {\n \"expected_duration_ms\": 5000,\n \"retryable_exit_codes\": []\n },\n \"stdout\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/ValidationResult\"\n },\n \"description\": \"Validation diagnostics. On exit 0 stdout is empty (diagnostics go to stderr). On exit 1/2 with --format json, structured diagnostics are written to stdout.\"\n },\n \"exits\": {\n \"0\": {\n \"description\": \"Validation passed with no errors\"\n },\n \"1\": {\n \"description\": \"Schema or naming convention errors detected\"\n },\n \"2\": {\n \"description\": \"Overlap detected — same path matches multiple artifacts\"\n },\n \"3\": {\n \"description\": \"Config or input file not found / parse error\"\n }\n }\n },\n \"resolve\": {\n \"summary\": \"Output fully-resolved artifact definitions\",\n \"description\": \"Expands config variables, applies authority-based defaults for manual_edit and change_control, and outputs the complete resolved DSL. Default format is yaml.\",\n \"options\": [\n {\n \"name\": \"config\",\n \"description\": \"Path to artifact-contracts.config.yaml\",\n \"value_name\": \"path\"\n },\n {\n \"name\": \"format\",\n \"description\": \"Output format (default: yaml)\",\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"yaml\",\n \"json\"\n ]\n }\n }\n ],\n \"effects\": {\n \"risk_level\": \"low\",\n \"reads\": [\n \"artifact-definitions\"\n ],\n \"execution_mode\": \"normal\"\n },\n \"x-agent\": {\n \"expected_duration_ms\": 2000,\n \"retryable_exit_codes\": []\n },\n \"stdout\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/ResolvedDefinitions\"\n },\n \"description\": \"Fully resolved artifact definitions with authority-based defaults applied. Format varies by --format (yaml default, json).\"\n },\n \"exits\": {\n \"0\": {\n \"description\": \"Successfully output resolved definitions\"\n },\n \"1\": {\n \"description\": \"Error resolving definitions\"\n },\n \"3\": {\n \"description\": \"Config or input file not found / parse error\"\n }\n }\n },\n \"list\": {\n \"summary\": \"List registered artifacts\",\n \"description\": \"Displays all registered artifacts with optional filtering by authority. Use --path for simple ID lookup; use explain for full governance metadata. Default format is text.\",\n \"options\": [\n {\n \"name\": \"config\",\n \"description\": \"Path to artifact-contracts.config.yaml\",\n \"value_name\": \"path\"\n },\n {\n \"name\": \"authority\",\n \"description\": \"Filter by authority type\",\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"canonical\",\n \"derived\",\n \"generated\",\n \"control\"\n ]\n }\n },\n {\n \"name\": \"path\",\n \"description\": \"Reverse-lookup — show artifact IDs matching this file path. For full governance details, use the explain command.\",\n \"value_name\": \"file\"\n },\n {\n \"name\": \"format\",\n \"description\": \"Output format (default: text)\",\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"text\",\n \"json\",\n \"yaml\"\n ]\n }\n }\n ],\n \"effects\": {\n \"risk_level\": \"low\",\n \"reads\": [\n \"artifact-definitions\"\n ],\n \"execution_mode\": \"normal\"\n },\n \"x-agent\": {\n \"expected_duration_ms\": 2000,\n \"retryable_exit_codes\": []\n },\n \"stdout\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/ArtifactList\"\n },\n \"description\": \"List of matching artifacts. Schema applies to --format json and --format yaml. Text format is human-readable only.\"\n },\n \"exits\": {\n \"0\": {\n \"description\": \"Successfully listed artifacts\"\n },\n \"1\": {\n \"description\": \"Error reading definitions\"\n },\n \"3\": {\n \"description\": \"Config or input file not found / parse error\"\n }\n }\n },\n \"explain\": {\n \"summary\": \"Explain artifact properties for a file path\",\n \"description\": \"Given a file path, resolves the matching artifact and displays its full governance properties — artifact ID, authority, manual_edit policy, change_control, and other metadata. Useful for humans and LLM agents to understand file governance. Default format is text.\",\n \"arguments\": [\n {\n \"name\": \"path\",\n \"description\": \"File path to explain\",\n \"required\": true\n }\n ],\n \"options\": [\n {\n \"name\": \"config\",\n \"description\": \"Path to artifact-contracts.config.yaml\",\n \"value_name\": \"path\"\n },\n {\n \"name\": \"format\",\n \"description\": \"Output format (default: text)\",\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"text\",\n \"json\",\n \"yaml\"\n ]\n }\n }\n ],\n \"effects\": {\n \"risk_level\": \"low\",\n \"reads\": [\n \"artifact-definitions\"\n ],\n \"execution_mode\": \"normal\"\n },\n \"x-agent\": {\n \"expected_duration_ms\": 2000,\n \"retryable_exit_codes\": []\n },\n \"stdout\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/ArtifactExplanation\"\n },\n \"description\": \"Artifact governance metadata for the resolved path. Schema applies to --format json and --format yaml. Text format is human-readable only.\"\n },\n \"exits\": {\n \"0\": {\n \"description\": \"Path resolved to an artifact\"\n },\n \"2\": {\n \"description\": \"Overlap — path matches multiple artifacts\"\n },\n \"3\": {\n \"description\": \"Config or input file not found / parse error\"\n },\n \"4\": {\n \"description\": \"Path does not match any registered artifact\"\n }\n }\n },\n \"audit\": {\n \"summary\": \"LLM-based semantic audit of artifact definitions\",\n \"description\": \"Performs semantic analysis of artifact definitions using LLM to identify quality issues that static validation cannot detect — naming inconsistencies, missing coverage for common file types, authority mismatches, and structural improvements.\",\n \"options\": [\n {\n \"name\": \"config\",\n \"description\": \"Path to artifact-contracts.config.yaml\",\n \"value_name\": \"path\"\n },\n {\n \"name\": \"adapter\",\n \"description\": \"LLM adapter to use\",\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"mock\",\n \"openai\",\n \"claude\",\n \"gemini\"\n ]\n }\n },\n {\n \"name\": \"model\",\n \"description\": \"Model name to pass to the adapter\"\n },\n {\n \"name\": \"show-prompt\",\n \"description\": \"Output the constructed prompt without calling the LLM API\",\n \"schema\": {\n \"type\": \"boolean\"\n }\n },\n {\n \"name\": \"dry-run\",\n \"aliases\": [\n \"n\"\n ],\n \"description\": \"Alias for --show-prompt (output prompt without LLM call)\",\n \"schema\": {\n \"type\": \"boolean\"\n }\n },\n {\n \"name\": \"fail-on\",\n \"description\": \"Minimum severity that causes exit 10. Ordering: critical > error > warning > info. For example, --fail-on warning exits 10 on warning, error, or critical.\",\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"info\",\n \"warning\",\n \"error\",\n \"critical\"\n ]\n }\n },\n {\n \"name\": \"output\",\n \"aliases\": [\n \"o\"\n ],\n \"description\": \"Write result to a file instead of stdout\",\n \"value_name\": \"file\"\n },\n {\n \"name\": \"report-format\",\n \"description\": \"Output format for the report (default: text). LLM commands use --report-format; deterministic commands use --format.\",\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"text\",\n \"json\",\n \"yaml\"\n ]\n }\n },\n {\n \"name\": \"log-file\",\n \"aliases\": [\n \"l\"\n ],\n \"description\": \"Write agent progress log to this file path.\",\n \"schema\": {\n \"type\": \"string\"\n }\n }\n ],\n \"effects\": {\n \"risk_level\": \"medium\",\n \"reads\": [\n \"artifact-definitions\"\n ],\n \"writes\": [\n \"audit-report\"\n ],\n \"network\": {\n \"description\": \"LLM API calls to configured provider\",\n \"idempotent\": false\n },\n \"execution_mode\": \"normal\"\n },\n \"stdout\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/AgentAuditResult\"\n },\n \"description\": \"Structured audit result conforming to the AgentAuditResult schema. Format varies by --report-format (json, yaml, text).\"\n },\n \"x-agent\": {\n \"dslTask\": \"audit-artifact-definitions\",\n \"riskLevel\": \"low\",\n \"requiresConfirmation\": false,\n \"idempotent\": true,\n \"sideEffects\": [\n \"network\"\n ],\n \"sideEffectNote\": \"Makes network calls to the configured LLM provider when adapter is not mock. Filesystem write only when --output is specified.\",\n \"safeDryRunOption\": \"show-prompt\",\n \"expectedDurationMs\": 120000,\n \"retryableExitCodes\": [\n 1,\n 12\n ],\n \"recommendedBeforeUse\": [\n \"Run with --show-prompt first to preview the prompt\"\n ]\n },\n \"exits\": {\n \"0\": {\n \"description\": \"Audit completed — no findings above threshold\"\n },\n \"1\": {\n \"description\": \"General / transient error\"\n },\n \"3\": {\n \"description\": \"Config or input file not found / parse error\"\n },\n \"10\": {\n \"description\": \"Findings detected above --fail-on threshold\"\n },\n \"11\": {\n \"description\": \"agent-contracts-runtime is not installed\"\n },\n \"12\": {\n \"description\": \"Adapter initialization error (missing API key, etc.)\"\n }\n }\n },\n \"agents\": {\n \"summary\": \"Output the full resolved agent DSL as structured data.\",\n \"description\": \"Outputs the complete resolved agent-contracts DSL (agents, tasks, workflows, handoff_types) embedded in this CLI binary. Useful for debugging, external tooling integration, and DSL inspection.\",\n \"options\": [\n {\n \"name\": \"format\",\n \"aliases\": [\n \"F\"\n ],\n \"description\": \"Output format.\",\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"yaml\",\n \"json\"\n ],\n \"default\": \"yaml\"\n }\n }\n ],\n \"exits\": {\n \"0\": {\n \"description\": \"DSL output successfully.\",\n \"stdout\": {\n \"format\": \"text\"\n }\n },\n \"1\": {\n \"description\": \"Failed to load embedded DSL.\",\n \"stderr\": {\n \"format\": \"text\"\n }\n }\n },\n \"x-agent\": {\n \"riskLevel\": \"low\",\n \"requiresConfirmation\": false,\n \"idempotent\": true,\n \"sideEffects\": []\n }\n }\n },\n \"env\": {\n \"OPENAI_API_KEY\": {\n \"description\": \"OpenAI API key. Required when --adapter openai is selected.\",\n \"required\": false\n },\n \"ANTHROPIC_API_KEY\": {\n \"description\": \"Anthropic API key. Required when --adapter claude is selected.\",\n \"required\": false\n },\n \"GEMINI_API_KEY\": {\n \"description\": \"Google Gemini API key. Required when --adapter gemini is selected.\",\n \"required\": false\n }\n }\n }\n },\n \"components\": {\n \"schemas\": {\n \"AgentFinding\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"severity\": {\n \"type\": \"string\",\n \"enum\": [\n \"critical\",\n \"error\",\n \"warning\",\n \"info\"\n ]\n },\n \"category\": {\n \"type\": \"string\"\n },\n \"title\": {\n \"type\": \"string\"\n },\n \"description\": {\n \"type\": \"string\"\n },\n \"location\": {\n \"type\": \"string\"\n },\n \"target\": {\n \"type\": \"string\"\n },\n \"recommendation\": {\n \"type\": \"string\"\n },\n \"evidence\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/AgentEvidence\"\n }\n }\n },\n \"required\": [\n \"id\",\n \"severity\",\n \"category\",\n \"title\",\n \"description\"\n ]\n },\n \"AgentAuditResult\": {\n \"type\": \"object\",\n \"properties\": {\n \"summary\": {\n \"type\": \"string\"\n },\n \"risk_level\": {\n \"type\": \"string\",\n \"enum\": [\n \"none\",\n \"low\",\n \"medium\",\n \"high\",\n \"critical\"\n ]\n },\n \"findings\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/AgentFinding\"\n }\n },\n \"recommended_actions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/AgentRecommendedAction\"\n }\n },\n \"metadata\": {\n \"type\": \"object\",\n \"properties\": {\n \"total_artifacts\": {\n \"type\": \"integer\"\n },\n \"analyzed_artifacts\": {\n \"type\": \"integer\"\n },\n \"analysis_scope\": {\n \"type\": \"string\"\n }\n }\n }\n },\n \"required\": [\n \"summary\",\n \"risk_level\",\n \"findings\",\n \"recommended_actions\"\n ]\n },\n \"AgentEvidence\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": {\n \"type\": \"string\",\n \"enum\": [\n \"schema\",\n \"code\",\n \"config\",\n \"runtime\",\n \"doc\"\n ]\n },\n \"target\": {\n \"type\": \"string\"\n },\n \"location\": {\n \"type\": \"string\"\n },\n \"excerpt\": {\n \"type\": \"string\"\n },\n \"reasoning\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"kind\"\n ]\n },\n \"AgentRecommendedAction\": {\n \"type\": \"object\",\n \"properties\": {\n \"action\": {\n \"type\": \"string\"\n },\n \"priority\": {\n \"type\": \"string\",\n \"enum\": [\n \"high\",\n \"medium\",\n \"low\"\n ]\n },\n \"description\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"action\",\n \"priority\"\n ]\n },\n \"ResolvedDefinitions\": {\n \"type\": \"object\",\n \"description\": \"Output of the resolve command\",\n \"properties\": {\n \"artifact_contracts\": {\n \"type\": \"string\"\n },\n \"system\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"name\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"id\"\n ]\n },\n \"artifacts\": {\n \"type\": \"object\",\n \"description\": \"Map of artifact ID to resolved artifact definition\",\n \"additionalProperties\": {\n \"$ref\": \"#/components/schemas/ArtifactDefinition\"\n }\n }\n },\n \"required\": [\n \"artifact_contracts\",\n \"system\",\n \"artifacts\"\n ]\n },\n \"ArtifactExplanation\": {\n \"type\": \"object\",\n \"description\": \"Output of the explain command (json/yaml format)\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"type\": \"string\"\n },\n \"authority\": {\n \"type\": \"string\"\n },\n \"manual_edit\": {\n \"type\": \"string\"\n },\n \"change_control\": {\n \"type\": \"string\"\n },\n \"visibility\": {\n \"type\": \"string\"\n },\n \"description\": {\n \"type\": \"string\"\n },\n \"path_patterns\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"exclude_patterns\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n \"required\": [\n \"id\",\n \"type\",\n \"authority\",\n \"manual_edit\",\n \"change_control\"\n ]\n },\n \"ArtifactDefinition\": {\n \"type\": \"object\",\n \"description\": \"A single resolved artifact definition\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\"\n },\n \"authority\": {\n \"type\": \"string\",\n \"enum\": [\n \"canonical\",\n \"derived\",\n \"generated\",\n \"control\"\n ]\n },\n \"manual_edit\": {\n \"type\": \"string\",\n \"enum\": [\n \"allowed\",\n \"discouraged\",\n \"forbidden\"\n ]\n },\n \"change_control\": {\n \"type\": \"string\",\n \"enum\": [\n \"none\",\n \"approval-required\",\n \"regeneration-required\"\n ]\n },\n \"visibility\": {\n \"type\": \"string\",\n \"enum\": [\n \"public\",\n \"internal\",\n \"private\"\n ]\n },\n \"description\": {\n \"type\": \"string\"\n },\n \"path_patterns\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"exclude_patterns\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"states\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n \"required\": [\n \"type\",\n \"authority\",\n \"manual_edit\",\n \"change_control\",\n \"visibility\",\n \"path_patterns\"\n ]\n },\n \"ArtifactList\": {\n \"type\": \"object\",\n \"description\": \"Output of the list command (json/yaml format)\",\n \"properties\": {\n \"artifacts\": {\n \"type\": \"object\",\n \"description\": \"Map of artifact ID to resolved artifact definition\",\n \"additionalProperties\": {\n \"$ref\": \"#/components/schemas/ArtifactDefinition\"\n }\n }\n }\n },\n \"ValidationResult\": {\n \"type\": \"object\",\n \"description\": \"Output of the validate command (json format, on error)\",\n \"properties\": {\n \"valid\": {\n \"type\": \"boolean\"\n },\n \"diagnostics\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"path\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"severity\": {\n \"type\": \"string\",\n \"enum\": [\n \"error\",\n \"warning\"\n ]\n }\n },\n \"required\": [\n \"message\",\n \"severity\"\n ]\n }\n },\n \"overlaps\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"path\": {\n \"type\": \"string\"\n },\n \"matching_artifacts\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n \"required\": [\n \"path\",\n \"matching_artifacts\"\n ]\n }\n }\n },\n \"required\": [\n \"valid\",\n \"diagnostics\",\n \"overlaps\"\n ]\n }\n }\n }\n}";
3
+ export const CONTRACT_YAML = "# yaml-language-server: $schema=./node_modules/cli-contracts/schemas/cli-contract.schema.json\ncli_contracts: 0.1.0\n\ninfo:\n title: artifact-contracts CLI\n version: 0.1.1\n description: >-\n Declarative artifact registry — define file properties, resolve\n paths to artifact IDs, and detect definition overlaps.\n stdout is reserved for primary output (JSON/YAML/text result);\n all diagnostics and progress messages go to stderr.\n license:\n name: MIT\n contact:\n name: foo-log-inc\n url: https://github.com/foo-log-inc/artifact-contracts\n\nartifact_slots:\n artifact-definitions:\n description: artifact-contracts.yaml definitions and config files\n direction: read\n repository-files:\n description: Repository files scanned for path pattern matching and overlap detection\n direction: read\n audit-report:\n description: LLM audit result output files\n direction: write\n\ncommand_sets:\n artifact-contracts:\n summary: >-\n Artifact registry CLI — validate definitions, resolve artifacts,\n list registered entries, and explain file properties.\n executable: artifact-contracts\n\n global_options:\n - name: version\n aliases: [V]\n description: Output the version number\n schema:\n type: boolean\n - name: help\n aliases: [h]\n description: Display help for command\n schema:\n type: boolean\n\n commands:\n validate:\n summary: Validate artifact-contracts definitions\n description: >-\n Validates artifact-contracts.yaml against the schema, checks\n artifact ID naming conventions, ensures path_patterns are\n non-empty, and optionally detects overlapping definitions\n against real repository files.\n options:\n - name: config\n description: Path to artifact-contracts.config.yaml\n value_name: path\n - name: check-files\n description: >-\n Scan repository files to detect path_patterns overlaps\n that static glob analysis cannot fully determine.\n When enabled, reads all files from git ls-files or glob.\n schema:\n type: boolean\n effects:\n risk_level: low\n reads:\n - artifact-definitions\n - repository-files\n execution_mode: normal\n x-agent:\n expected_duration_ms: 5000\n retryable_exit_codes: []\n stdout:\n schema:\n $ref: \"#/components/schemas/ValidationResult\"\n description: >-\n Validation diagnostics. On exit 0 stdout is empty (diagnostics\n go to stderr). On exit 1/2 with --format json, structured\n diagnostics are written to stdout.\n exits:\n \"0\":\n description: Validation passed with no errors\n \"1\":\n description: Schema or naming convention errors detected\n \"2\":\n description: Overlap detected — same path matches multiple artifacts\n \"3\":\n description: Config or input file not found / parse error\n\n resolve:\n summary: Output fully-resolved artifact definitions\n description: >-\n Expands config variables, applies authority-based defaults\n for manual_edit and change_control, and outputs the complete\n resolved DSL. Default format is yaml.\n options:\n - name: config\n description: Path to artifact-contracts.config.yaml\n value_name: path\n - name: format\n description: \"Output format (default: yaml)\"\n schema:\n type: string\n enum: [yaml, json]\n effects:\n risk_level: low\n reads:\n - artifact-definitions\n execution_mode: normal\n x-agent:\n expected_duration_ms: 2000\n retryable_exit_codes: []\n stdout:\n schema:\n $ref: \"#/components/schemas/ResolvedDefinitions\"\n description: >-\n Fully resolved artifact definitions with authority-based\n defaults applied. Format varies by --format (yaml default, json).\n exits:\n \"0\":\n description: Successfully output resolved definitions\n \"1\":\n description: Error resolving definitions\n \"3\":\n description: Config or input file not found / parse error\n\n list:\n summary: List registered artifacts\n description: >-\n Displays all registered artifacts with optional filtering\n by authority. Use --path for simple ID lookup; use explain\n for full governance metadata. Default format is text.\n options:\n - name: config\n description: Path to artifact-contracts.config.yaml\n value_name: path\n - name: authority\n description: Filter by authority type\n schema:\n type: string\n enum: [canonical, derived, generated, control]\n - name: path\n description: >-\n Reverse-lookup — show artifact IDs matching this file\n path. For full governance details, use the explain command.\n value_name: file\n - name: format\n description: \"Output format (default: text)\"\n schema:\n type: string\n enum: [text, json, yaml]\n effects:\n risk_level: low\n reads:\n - artifact-definitions\n execution_mode: normal\n x-agent:\n expected_duration_ms: 2000\n retryable_exit_codes: []\n stdout:\n schema:\n $ref: \"#/components/schemas/ArtifactList\"\n description: >-\n List of matching artifacts. Schema applies to --format json\n and --format yaml. Text format is human-readable only.\n exits:\n \"0\":\n description: Successfully listed artifacts\n \"1\":\n description: Error reading definitions\n \"3\":\n description: Config or input file not found / parse error\n\n explain:\n summary: Explain artifact properties for a file path\n description: >-\n Given a file path, resolves the matching artifact and displays\n its full governance properties — artifact ID, authority,\n manual_edit policy, change_control, and other metadata.\n Useful for humans and LLM agents to understand file\n governance. Default format is text.\n arguments:\n - name: path\n description: File path to explain\n required: true\n options:\n - name: config\n description: Path to artifact-contracts.config.yaml\n value_name: path\n - name: format\n description: \"Output format (default: text)\"\n schema:\n type: string\n enum: [text, json, yaml]\n effects:\n risk_level: low\n reads:\n - artifact-definitions\n execution_mode: normal\n x-agent:\n expected_duration_ms: 2000\n retryable_exit_codes: []\n stdout:\n schema:\n $ref: \"#/components/schemas/ArtifactExplanation\"\n description: >-\n Artifact governance metadata for the resolved path.\n Schema applies to --format json and --format yaml.\n Text format is human-readable only.\n exits:\n \"0\":\n description: Path resolved to an artifact\n \"2\":\n description: Overlap — path matches multiple artifacts\n \"3\":\n description: Config or input file not found / parse error\n \"4\":\n description: Path does not match any registered artifact\n\n audit:\n summary: LLM-based semantic audit of artifact definitions\n description: >-\n Performs semantic analysis of artifact definitions using LLM\n to identify quality issues that static validation cannot\n detect — naming inconsistencies, missing coverage for common\n file types, authority mismatches, and structural improvements.\n options:\n - name: config\n description: Path to artifact-contracts.config.yaml\n value_name: path\n - name: adapter\n description: LLM adapter to use\n schema:\n type: string\n enum: [mock, openai, claude, gemini]\n - name: model\n description: Model name to pass to the adapter\n - name: show-prompt\n description: Output the constructed prompt without calling the LLM API\n schema:\n type: boolean\n - name: dry-run\n aliases: [n]\n description: Alias for --show-prompt (output prompt without LLM call)\n schema:\n type: boolean\n - name: fail-on\n description: >-\n Minimum severity that causes exit 10. Ordering:\n critical > error > warning > info. For example,\n --fail-on warning exits 10 on warning, error, or critical.\n schema:\n type: string\n enum: [info, warning, error, critical]\n - name: output\n aliases: [o]\n description: Write result to a file instead of stdout\n value_name: file\n - name: report-format\n description: >-\n Output format for the report (default: text).\n LLM commands use --report-format; deterministic\n commands use --format.\n schema:\n type: string\n enum: [text, json, yaml]\n - name: log-file\n aliases: [l]\n description: Write agent progress log to this file path.\n schema:\n type: string\n effects:\n risk_level: medium\n reads:\n - artifact-definitions\n writes:\n - audit-report\n network:\n description: LLM API calls to configured provider\n idempotent: false\n execution_mode: normal\n stdout:\n schema:\n $ref: \"#/components/schemas/AgentAuditResult\"\n description: >-\n Structured audit result conforming to the AgentAuditResult\n schema. Format varies by --report-format (json, yaml, text).\n x-agent:\n dslTask: audit-artifact-definitions\n riskLevel: low\n requiresConfirmation: false\n idempotent: true\n sideEffects: [network]\n sideEffectNote: >-\n Makes network calls to the configured LLM provider when adapter is\n not mock. Filesystem write only when --output is specified.\n safeDryRunOption: show-prompt\n expectedDurationMs: 120000\n retryableExitCodes: [1, 12]\n recommendedBeforeUse:\n - \"Run with --show-prompt first to preview the prompt\"\n exits:\n \"0\":\n description: Audit completed — no findings above threshold\n \"1\":\n description: General / transient error\n \"3\":\n description: Config or input file not found / parse error\n \"10\":\n description: Findings detected above --fail-on threshold\n \"11\":\n description: agent-contracts-runtime is not installed\n \"12\":\n description: Adapter initialization error (missing API key, etc.)\n\n discover:\n summary: LLM-based artifact discovery from project file structure\n description: >-\n Analyzes the project file structure using LLM to generate or update\n artifact-contracts.yaml definitions. In init mode (no existing file),\n creates a new registry from scratch. In update mode (existing file),\n proposes additional artifact definitions and trace link rules for\n uncovered files.\n options:\n - name: adapter\n description: LLM adapter to use\n schema:\n type: string\n enum: [mock, openai, claude, gemini]\n - name: model\n description: Model name to pass to the adapter\n - name: show-prompt\n description: Output the constructed prompt without calling the LLM API\n schema:\n type: boolean\n - name: dry-run\n aliases: [n]\n description: Alias for --show-prompt (output prompt without LLM call)\n schema:\n type: boolean\n - name: write\n aliases: [w]\n description: Write the generated YAML directly to artifact-contracts.yaml\n schema:\n type: boolean\n - name: output\n aliases: [o]\n description: Write result to a specific file path instead of stdout\n value_name: file\n - name: report-format\n description: \"Output format (default: yaml)\"\n schema:\n type: string\n enum: [yaml, json]\n - name: log-file\n aliases: [l]\n description: Write agent progress log to this file path.\n schema:\n type: string\n effects:\n risk_level: medium\n reads:\n - artifact-definitions\n - repository-files\n writes:\n - artifact-definitions\n network:\n description: LLM API calls to configured provider\n idempotent: false\n execution_mode: normal\n stdout:\n schema:\n $ref: \"#/components/schemas/DiscoverResult\"\n description: >-\n Generated artifact-contracts.yaml content or structured discovery result.\n x-agent:\n dslTask: discover-artifact-definitions\n riskLevel: low\n requiresConfirmation: false\n idempotent: true\n sideEffects: [network]\n sideEffectNote: >-\n Makes network calls to the configured LLM provider when adapter is\n not mock. Filesystem write only when --write or --output is specified.\n safeDryRunOption: show-prompt\n expectedDurationMs: 120000\n retryableExitCodes: [1, 12]\n recommendedBeforeUse:\n - \"Run with --show-prompt first to preview the prompt\"\n exits:\n \"0\":\n description: Discovery completed successfully\n \"1\":\n description: General / transient error\n \"3\":\n description: File system read error\n \"11\":\n description: agent-contracts-runtime is not installed\n \"12\":\n description: Adapter initialization error (missing API key, etc.)\n\n # ── agents ──────────────────────────────────────────\n agents:\n summary: Output the full resolved agent DSL as structured data.\n description: >-\n Outputs the complete resolved agent-contracts DSL (agents, tasks,\n workflows, handoff_types) embedded in this CLI binary.\n Useful for debugging, external tooling integration, and DSL\n inspection.\n options:\n - name: format\n aliases: [F]\n description: Output format.\n schema:\n type: string\n enum: [yaml, json]\n default: yaml\n\n exits:\n '0':\n description: DSL output successfully.\n stdout:\n format: text\n '1':\n description: Failed to load embedded DSL.\n stderr:\n format: text\n\n x-agent:\n riskLevel: low\n requiresConfirmation: false\n idempotent: true\n sideEffects: []\n\n env:\n OPENAI_API_KEY:\n description: >-\n OpenAI API key. Required when --adapter openai is selected.\n required: false\n ANTHROPIC_API_KEY:\n description: >-\n Anthropic API key. Required when --adapter claude is selected.\n required: false\n GEMINI_API_KEY:\n description: >-\n Google Gemini API key. Required when --adapter gemini is selected.\n required: false\n\ncomponents:\n schemas:\n AgentFinding:\n type: object\n properties:\n id:\n type: string\n severity:\n type: string\n enum: [critical, error, warning, info]\n category:\n type: string\n title:\n type: string\n description:\n type: string\n location:\n type: string\n target:\n type: string\n recommendation:\n type: string\n evidence:\n type: array\n items:\n $ref: \"#/components/schemas/AgentEvidence\"\n required: [id, severity, category, title, description]\n\n AgentAuditResult:\n type: object\n properties:\n summary:\n type: string\n risk_level:\n type: string\n enum: [none, low, medium, high, critical]\n findings:\n type: array\n items:\n $ref: \"#/components/schemas/AgentFinding\"\n recommended_actions:\n type: array\n items:\n $ref: \"#/components/schemas/AgentRecommendedAction\"\n metadata:\n type: object\n properties:\n total_artifacts:\n type: integer\n analyzed_artifacts:\n type: integer\n analysis_scope:\n type: string\n required: [summary, risk_level, findings, recommended_actions]\n\n AgentEvidence:\n type: object\n properties:\n kind:\n type: string\n enum: [schema, code, config, runtime, doc]\n target:\n type: string\n location:\n type: string\n excerpt:\n type: string\n reasoning:\n type: string\n required: [kind]\n\n AgentRecommendedAction:\n type: object\n properties:\n action:\n type: string\n priority:\n type: string\n enum: [high, medium, low]\n description:\n type: string\n required: [action, priority]\n\n ResolvedDefinitions:\n type: object\n description: Output of the resolve command\n properties:\n artifact_contracts:\n type: string\n system:\n type: object\n properties:\n id:\n type: string\n name:\n type: string\n required: [id]\n artifacts:\n type: object\n description: Map of artifact ID to resolved artifact definition\n additionalProperties:\n $ref: \"#/components/schemas/ArtifactDefinition\"\n required: [artifact_contracts, system, artifacts]\n\n ArtifactExplanation:\n type: object\n description: Output of the explain command (json/yaml format)\n properties:\n id:\n type: string\n type:\n type: string\n authority:\n type: string\n manual_edit:\n type: string\n change_control:\n type: string\n visibility:\n type: string\n description:\n type: string\n path_patterns:\n type: array\n items:\n type: string\n exclude_patterns:\n type: array\n items:\n type: string\n required: [id, type, authority, manual_edit, change_control]\n\n ArtifactDefinition:\n type: object\n description: A single resolved artifact definition\n properties:\n type:\n type: string\n authority:\n type: string\n enum: [canonical, derived, generated, control]\n manual_edit:\n type: string\n enum: [allowed, discouraged, forbidden]\n change_control:\n type: string\n enum: [none, approval-required, regeneration-required]\n visibility:\n type: string\n enum: [public, internal, private]\n description:\n type: string\n path_patterns:\n type: array\n items:\n type: string\n exclude_patterns:\n type: array\n items:\n type: string\n states:\n type: array\n items:\n type: string\n required: [type, authority, manual_edit, change_control, visibility, path_patterns]\n\n ArtifactList:\n type: object\n description: Output of the list command (json/yaml format)\n properties:\n artifacts:\n type: object\n description: Map of artifact ID to resolved artifact definition\n additionalProperties:\n $ref: \"#/components/schemas/ArtifactDefinition\"\n\n DiscoverResult:\n type: object\n description: Output of the discover command\n properties:\n mode:\n type: string\n enum: [init, update]\n artifact_contracts_yaml:\n type: string\n description: Generated YAML content\n decisions:\n type: array\n items:\n type: object\n properties:\n artifact_id:\n type: string\n reasoning:\n type: string\n required: [artifact_id, reasoning]\n trace_decisions:\n type: array\n items:\n type: object\n properties:\n link_id:\n type: string\n reasoning:\n type: string\n required: [link_id, reasoning]\n uncategorized_files:\n type: array\n items:\n type: string\n suggestions:\n type: array\n items:\n type: string\n required: [mode, artifact_contracts_yaml]\n\n ValidationResult:\n type: object\n description: Output of the validate command (json format, on error)\n properties:\n valid:\n type: boolean\n diagnostics:\n type: array\n items:\n type: object\n properties:\n path:\n type: string\n message:\n type: string\n severity:\n type: string\n enum: [error, warning]\n required: [message, severity]\n overlaps:\n type: array\n items:\n type: object\n properties:\n path:\n type: string\n matching_artifacts:\n type: array\n items:\n type: string\n required: [path, matching_artifacts]\n required: [valid, diagnostics, overlaps]\n";
4
+ export const CONTRACT_JSON_STR = "{\n \"cli_contracts\": \"0.1.0\",\n \"info\": {\n \"title\": \"artifact-contracts CLI\",\n \"version\": \"0.1.1\",\n \"description\": \"Declarative artifact registry — define file properties, resolve paths to artifact IDs, and detect definition overlaps. stdout is reserved for primary output (JSON/YAML/text result); all diagnostics and progress messages go to stderr.\",\n \"license\": {\n \"name\": \"MIT\"\n },\n \"contact\": {\n \"name\": \"foo-log-inc\",\n \"url\": \"https://github.com/foo-log-inc/artifact-contracts\"\n }\n },\n \"artifact_slots\": {\n \"artifact-definitions\": {\n \"description\": \"artifact-contracts.yaml definitions and config files\",\n \"direction\": \"read\"\n },\n \"repository-files\": {\n \"description\": \"Repository files scanned for path pattern matching and overlap detection\",\n \"direction\": \"read\"\n },\n \"audit-report\": {\n \"description\": \"LLM audit result output files\",\n \"direction\": \"write\"\n }\n },\n \"command_sets\": {\n \"artifact-contracts\": {\n \"summary\": \"Artifact registry CLI — validate definitions, resolve artifacts, list registered entries, and explain file properties.\",\n \"executable\": \"artifact-contracts\",\n \"global_options\": [\n {\n \"name\": \"version\",\n \"aliases\": [\n \"V\"\n ],\n \"description\": \"Output the version number\",\n \"schema\": {\n \"type\": \"boolean\"\n }\n },\n {\n \"name\": \"help\",\n \"aliases\": [\n \"h\"\n ],\n \"description\": \"Display help for command\",\n \"schema\": {\n \"type\": \"boolean\"\n }\n }\n ],\n \"commands\": {\n \"validate\": {\n \"summary\": \"Validate artifact-contracts definitions\",\n \"description\": \"Validates artifact-contracts.yaml against the schema, checks artifact ID naming conventions, ensures path_patterns are non-empty, and optionally detects overlapping definitions against real repository files.\",\n \"options\": [\n {\n \"name\": \"config\",\n \"description\": \"Path to artifact-contracts.config.yaml\",\n \"value_name\": \"path\"\n },\n {\n \"name\": \"check-files\",\n \"description\": \"Scan repository files to detect path_patterns overlaps that static glob analysis cannot fully determine. When enabled, reads all files from git ls-files or glob.\",\n \"schema\": {\n \"type\": \"boolean\"\n }\n }\n ],\n \"effects\": {\n \"risk_level\": \"low\",\n \"reads\": [\n \"artifact-definitions\",\n \"repository-files\"\n ],\n \"execution_mode\": \"normal\"\n },\n \"x-agent\": {\n \"expected_duration_ms\": 5000,\n \"retryable_exit_codes\": []\n },\n \"stdout\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/ValidationResult\"\n },\n \"description\": \"Validation diagnostics. On exit 0 stdout is empty (diagnostics go to stderr). On exit 1/2 with --format json, structured diagnostics are written to stdout.\"\n },\n \"exits\": {\n \"0\": {\n \"description\": \"Validation passed with no errors\"\n },\n \"1\": {\n \"description\": \"Schema or naming convention errors detected\"\n },\n \"2\": {\n \"description\": \"Overlap detected — same path matches multiple artifacts\"\n },\n \"3\": {\n \"description\": \"Config or input file not found / parse error\"\n }\n }\n },\n \"resolve\": {\n \"summary\": \"Output fully-resolved artifact definitions\",\n \"description\": \"Expands config variables, applies authority-based defaults for manual_edit and change_control, and outputs the complete resolved DSL. Default format is yaml.\",\n \"options\": [\n {\n \"name\": \"config\",\n \"description\": \"Path to artifact-contracts.config.yaml\",\n \"value_name\": \"path\"\n },\n {\n \"name\": \"format\",\n \"description\": \"Output format (default: yaml)\",\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"yaml\",\n \"json\"\n ]\n }\n }\n ],\n \"effects\": {\n \"risk_level\": \"low\",\n \"reads\": [\n \"artifact-definitions\"\n ],\n \"execution_mode\": \"normal\"\n },\n \"x-agent\": {\n \"expected_duration_ms\": 2000,\n \"retryable_exit_codes\": []\n },\n \"stdout\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/ResolvedDefinitions\"\n },\n \"description\": \"Fully resolved artifact definitions with authority-based defaults applied. Format varies by --format (yaml default, json).\"\n },\n \"exits\": {\n \"0\": {\n \"description\": \"Successfully output resolved definitions\"\n },\n \"1\": {\n \"description\": \"Error resolving definitions\"\n },\n \"3\": {\n \"description\": \"Config or input file not found / parse error\"\n }\n }\n },\n \"list\": {\n \"summary\": \"List registered artifacts\",\n \"description\": \"Displays all registered artifacts with optional filtering by authority. Use --path for simple ID lookup; use explain for full governance metadata. Default format is text.\",\n \"options\": [\n {\n \"name\": \"config\",\n \"description\": \"Path to artifact-contracts.config.yaml\",\n \"value_name\": \"path\"\n },\n {\n \"name\": \"authority\",\n \"description\": \"Filter by authority type\",\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"canonical\",\n \"derived\",\n \"generated\",\n \"control\"\n ]\n }\n },\n {\n \"name\": \"path\",\n \"description\": \"Reverse-lookup — show artifact IDs matching this file path. For full governance details, use the explain command.\",\n \"value_name\": \"file\"\n },\n {\n \"name\": \"format\",\n \"description\": \"Output format (default: text)\",\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"text\",\n \"json\",\n \"yaml\"\n ]\n }\n }\n ],\n \"effects\": {\n \"risk_level\": \"low\",\n \"reads\": [\n \"artifact-definitions\"\n ],\n \"execution_mode\": \"normal\"\n },\n \"x-agent\": {\n \"expected_duration_ms\": 2000,\n \"retryable_exit_codes\": []\n },\n \"stdout\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/ArtifactList\"\n },\n \"description\": \"List of matching artifacts. Schema applies to --format json and --format yaml. Text format is human-readable only.\"\n },\n \"exits\": {\n \"0\": {\n \"description\": \"Successfully listed artifacts\"\n },\n \"1\": {\n \"description\": \"Error reading definitions\"\n },\n \"3\": {\n \"description\": \"Config or input file not found / parse error\"\n }\n }\n },\n \"explain\": {\n \"summary\": \"Explain artifact properties for a file path\",\n \"description\": \"Given a file path, resolves the matching artifact and displays its full governance properties — artifact ID, authority, manual_edit policy, change_control, and other metadata. Useful for humans and LLM agents to understand file governance. Default format is text.\",\n \"arguments\": [\n {\n \"name\": \"path\",\n \"description\": \"File path to explain\",\n \"required\": true\n }\n ],\n \"options\": [\n {\n \"name\": \"config\",\n \"description\": \"Path to artifact-contracts.config.yaml\",\n \"value_name\": \"path\"\n },\n {\n \"name\": \"format\",\n \"description\": \"Output format (default: text)\",\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"text\",\n \"json\",\n \"yaml\"\n ]\n }\n }\n ],\n \"effects\": {\n \"risk_level\": \"low\",\n \"reads\": [\n \"artifact-definitions\"\n ],\n \"execution_mode\": \"normal\"\n },\n \"x-agent\": {\n \"expected_duration_ms\": 2000,\n \"retryable_exit_codes\": []\n },\n \"stdout\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/ArtifactExplanation\"\n },\n \"description\": \"Artifact governance metadata for the resolved path. Schema applies to --format json and --format yaml. Text format is human-readable only.\"\n },\n \"exits\": {\n \"0\": {\n \"description\": \"Path resolved to an artifact\"\n },\n \"2\": {\n \"description\": \"Overlap — path matches multiple artifacts\"\n },\n \"3\": {\n \"description\": \"Config or input file not found / parse error\"\n },\n \"4\": {\n \"description\": \"Path does not match any registered artifact\"\n }\n }\n },\n \"audit\": {\n \"summary\": \"LLM-based semantic audit of artifact definitions\",\n \"description\": \"Performs semantic analysis of artifact definitions using LLM to identify quality issues that static validation cannot detect — naming inconsistencies, missing coverage for common file types, authority mismatches, and structural improvements.\",\n \"options\": [\n {\n \"name\": \"config\",\n \"description\": \"Path to artifact-contracts.config.yaml\",\n \"value_name\": \"path\"\n },\n {\n \"name\": \"adapter\",\n \"description\": \"LLM adapter to use\",\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"mock\",\n \"openai\",\n \"claude\",\n \"gemini\"\n ]\n }\n },\n {\n \"name\": \"model\",\n \"description\": \"Model name to pass to the adapter\"\n },\n {\n \"name\": \"show-prompt\",\n \"description\": \"Output the constructed prompt without calling the LLM API\",\n \"schema\": {\n \"type\": \"boolean\"\n }\n },\n {\n \"name\": \"dry-run\",\n \"aliases\": [\n \"n\"\n ],\n \"description\": \"Alias for --show-prompt (output prompt without LLM call)\",\n \"schema\": {\n \"type\": \"boolean\"\n }\n },\n {\n \"name\": \"fail-on\",\n \"description\": \"Minimum severity that causes exit 10. Ordering: critical > error > warning > info. For example, --fail-on warning exits 10 on warning, error, or critical.\",\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"info\",\n \"warning\",\n \"error\",\n \"critical\"\n ]\n }\n },\n {\n \"name\": \"output\",\n \"aliases\": [\n \"o\"\n ],\n \"description\": \"Write result to a file instead of stdout\",\n \"value_name\": \"file\"\n },\n {\n \"name\": \"report-format\",\n \"description\": \"Output format for the report (default: text). LLM commands use --report-format; deterministic commands use --format.\",\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"text\",\n \"json\",\n \"yaml\"\n ]\n }\n },\n {\n \"name\": \"log-file\",\n \"aliases\": [\n \"l\"\n ],\n \"description\": \"Write agent progress log to this file path.\",\n \"schema\": {\n \"type\": \"string\"\n }\n }\n ],\n \"effects\": {\n \"risk_level\": \"medium\",\n \"reads\": [\n \"artifact-definitions\"\n ],\n \"writes\": [\n \"audit-report\"\n ],\n \"network\": {\n \"description\": \"LLM API calls to configured provider\",\n \"idempotent\": false\n },\n \"execution_mode\": \"normal\"\n },\n \"stdout\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/AgentAuditResult\"\n },\n \"description\": \"Structured audit result conforming to the AgentAuditResult schema. Format varies by --report-format (json, yaml, text).\"\n },\n \"x-agent\": {\n \"dslTask\": \"audit-artifact-definitions\",\n \"riskLevel\": \"low\",\n \"requiresConfirmation\": false,\n \"idempotent\": true,\n \"sideEffects\": [\n \"network\"\n ],\n \"sideEffectNote\": \"Makes network calls to the configured LLM provider when adapter is not mock. Filesystem write only when --output is specified.\",\n \"safeDryRunOption\": \"show-prompt\",\n \"expectedDurationMs\": 120000,\n \"retryableExitCodes\": [\n 1,\n 12\n ],\n \"recommendedBeforeUse\": [\n \"Run with --show-prompt first to preview the prompt\"\n ]\n },\n \"exits\": {\n \"0\": {\n \"description\": \"Audit completed — no findings above threshold\"\n },\n \"1\": {\n \"description\": \"General / transient error\"\n },\n \"3\": {\n \"description\": \"Config or input file not found / parse error\"\n },\n \"10\": {\n \"description\": \"Findings detected above --fail-on threshold\"\n },\n \"11\": {\n \"description\": \"agent-contracts-runtime is not installed\"\n },\n \"12\": {\n \"description\": \"Adapter initialization error (missing API key, etc.)\"\n }\n }\n },\n \"discover\": {\n \"summary\": \"LLM-based artifact discovery from project file structure\",\n \"description\": \"Analyzes the project file structure using LLM to generate or update artifact-contracts.yaml definitions. In init mode (no existing file), creates a new registry from scratch. In update mode (existing file), proposes additional artifact definitions and trace link rules for uncovered files.\",\n \"options\": [\n {\n \"name\": \"adapter\",\n \"description\": \"LLM adapter to use\",\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"mock\",\n \"openai\",\n \"claude\",\n \"gemini\"\n ]\n }\n },\n {\n \"name\": \"model\",\n \"description\": \"Model name to pass to the adapter\"\n },\n {\n \"name\": \"show-prompt\",\n \"description\": \"Output the constructed prompt without calling the LLM API\",\n \"schema\": {\n \"type\": \"boolean\"\n }\n },\n {\n \"name\": \"dry-run\",\n \"aliases\": [\n \"n\"\n ],\n \"description\": \"Alias for --show-prompt (output prompt without LLM call)\",\n \"schema\": {\n \"type\": \"boolean\"\n }\n },\n {\n \"name\": \"write\",\n \"aliases\": [\n \"w\"\n ],\n \"description\": \"Write the generated YAML directly to artifact-contracts.yaml\",\n \"schema\": {\n \"type\": \"boolean\"\n }\n },\n {\n \"name\": \"output\",\n \"aliases\": [\n \"o\"\n ],\n \"description\": \"Write result to a specific file path instead of stdout\",\n \"value_name\": \"file\"\n },\n {\n \"name\": \"report-format\",\n \"description\": \"Output format (default: yaml)\",\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"yaml\",\n \"json\"\n ]\n }\n },\n {\n \"name\": \"log-file\",\n \"aliases\": [\n \"l\"\n ],\n \"description\": \"Write agent progress log to this file path.\",\n \"schema\": {\n \"type\": \"string\"\n }\n }\n ],\n \"effects\": {\n \"risk_level\": \"medium\",\n \"reads\": [\n \"artifact-definitions\",\n \"repository-files\"\n ],\n \"writes\": [\n \"artifact-definitions\"\n ],\n \"network\": {\n \"description\": \"LLM API calls to configured provider\",\n \"idempotent\": false\n },\n \"execution_mode\": \"normal\"\n },\n \"stdout\": {\n \"schema\": {\n \"$ref\": \"#/components/schemas/DiscoverResult\"\n },\n \"description\": \"Generated artifact-contracts.yaml content or structured discovery result.\"\n },\n \"x-agent\": {\n \"dslTask\": \"discover-artifact-definitions\",\n \"riskLevel\": \"low\",\n \"requiresConfirmation\": false,\n \"idempotent\": true,\n \"sideEffects\": [\n \"network\"\n ],\n \"sideEffectNote\": \"Makes network calls to the configured LLM provider when adapter is not mock. Filesystem write only when --write or --output is specified.\",\n \"safeDryRunOption\": \"show-prompt\",\n \"expectedDurationMs\": 120000,\n \"retryableExitCodes\": [\n 1,\n 12\n ],\n \"recommendedBeforeUse\": [\n \"Run with --show-prompt first to preview the prompt\"\n ]\n },\n \"exits\": {\n \"0\": {\n \"description\": \"Discovery completed successfully\"\n },\n \"1\": {\n \"description\": \"General / transient error\"\n },\n \"3\": {\n \"description\": \"File system read error\"\n },\n \"11\": {\n \"description\": \"agent-contracts-runtime is not installed\"\n },\n \"12\": {\n \"description\": \"Adapter initialization error (missing API key, etc.)\"\n }\n }\n },\n \"agents\": {\n \"summary\": \"Output the full resolved agent DSL as structured data.\",\n \"description\": \"Outputs the complete resolved agent-contracts DSL (agents, tasks, workflows, handoff_types) embedded in this CLI binary. Useful for debugging, external tooling integration, and DSL inspection.\",\n \"options\": [\n {\n \"name\": \"format\",\n \"aliases\": [\n \"F\"\n ],\n \"description\": \"Output format.\",\n \"schema\": {\n \"type\": \"string\",\n \"enum\": [\n \"yaml\",\n \"json\"\n ],\n \"default\": \"yaml\"\n }\n }\n ],\n \"exits\": {\n \"0\": {\n \"description\": \"DSL output successfully.\",\n \"stdout\": {\n \"format\": \"text\"\n }\n },\n \"1\": {\n \"description\": \"Failed to load embedded DSL.\",\n \"stderr\": {\n \"format\": \"text\"\n }\n }\n },\n \"x-agent\": {\n \"riskLevel\": \"low\",\n \"requiresConfirmation\": false,\n \"idempotent\": true,\n \"sideEffects\": []\n }\n }\n },\n \"env\": {\n \"OPENAI_API_KEY\": {\n \"description\": \"OpenAI API key. Required when --adapter openai is selected.\",\n \"required\": false\n },\n \"ANTHROPIC_API_KEY\": {\n \"description\": \"Anthropic API key. Required when --adapter claude is selected.\",\n \"required\": false\n },\n \"GEMINI_API_KEY\": {\n \"description\": \"Google Gemini API key. Required when --adapter gemini is selected.\",\n \"required\": false\n }\n }\n }\n },\n \"components\": {\n \"schemas\": {\n \"AgentFinding\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"severity\": {\n \"type\": \"string\",\n \"enum\": [\n \"critical\",\n \"error\",\n \"warning\",\n \"info\"\n ]\n },\n \"category\": {\n \"type\": \"string\"\n },\n \"title\": {\n \"type\": \"string\"\n },\n \"description\": {\n \"type\": \"string\"\n },\n \"location\": {\n \"type\": \"string\"\n },\n \"target\": {\n \"type\": \"string\"\n },\n \"recommendation\": {\n \"type\": \"string\"\n },\n \"evidence\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/AgentEvidence\"\n }\n }\n },\n \"required\": [\n \"id\",\n \"severity\",\n \"category\",\n \"title\",\n \"description\"\n ]\n },\n \"AgentAuditResult\": {\n \"type\": \"object\",\n \"properties\": {\n \"summary\": {\n \"type\": \"string\"\n },\n \"risk_level\": {\n \"type\": \"string\",\n \"enum\": [\n \"none\",\n \"low\",\n \"medium\",\n \"high\",\n \"critical\"\n ]\n },\n \"findings\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/AgentFinding\"\n }\n },\n \"recommended_actions\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/AgentRecommendedAction\"\n }\n },\n \"metadata\": {\n \"type\": \"object\",\n \"properties\": {\n \"total_artifacts\": {\n \"type\": \"integer\"\n },\n \"analyzed_artifacts\": {\n \"type\": \"integer\"\n },\n \"analysis_scope\": {\n \"type\": \"string\"\n }\n }\n }\n },\n \"required\": [\n \"summary\",\n \"risk_level\",\n \"findings\",\n \"recommended_actions\"\n ]\n },\n \"AgentEvidence\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": {\n \"type\": \"string\",\n \"enum\": [\n \"schema\",\n \"code\",\n \"config\",\n \"runtime\",\n \"doc\"\n ]\n },\n \"target\": {\n \"type\": \"string\"\n },\n \"location\": {\n \"type\": \"string\"\n },\n \"excerpt\": {\n \"type\": \"string\"\n },\n \"reasoning\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"kind\"\n ]\n },\n \"AgentRecommendedAction\": {\n \"type\": \"object\",\n \"properties\": {\n \"action\": {\n \"type\": \"string\"\n },\n \"priority\": {\n \"type\": \"string\",\n \"enum\": [\n \"high\",\n \"medium\",\n \"low\"\n ]\n },\n \"description\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"action\",\n \"priority\"\n ]\n },\n \"ResolvedDefinitions\": {\n \"type\": \"object\",\n \"description\": \"Output of the resolve command\",\n \"properties\": {\n \"artifact_contracts\": {\n \"type\": \"string\"\n },\n \"system\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"name\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"id\"\n ]\n },\n \"artifacts\": {\n \"type\": \"object\",\n \"description\": \"Map of artifact ID to resolved artifact definition\",\n \"additionalProperties\": {\n \"$ref\": \"#/components/schemas/ArtifactDefinition\"\n }\n }\n },\n \"required\": [\n \"artifact_contracts\",\n \"system\",\n \"artifacts\"\n ]\n },\n \"ArtifactExplanation\": {\n \"type\": \"object\",\n \"description\": \"Output of the explain command (json/yaml format)\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\"\n },\n \"type\": {\n \"type\": \"string\"\n },\n \"authority\": {\n \"type\": \"string\"\n },\n \"manual_edit\": {\n \"type\": \"string\"\n },\n \"change_control\": {\n \"type\": \"string\"\n },\n \"visibility\": {\n \"type\": \"string\"\n },\n \"description\": {\n \"type\": \"string\"\n },\n \"path_patterns\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"exclude_patterns\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n \"required\": [\n \"id\",\n \"type\",\n \"authority\",\n \"manual_edit\",\n \"change_control\"\n ]\n },\n \"ArtifactDefinition\": {\n \"type\": \"object\",\n \"description\": \"A single resolved artifact definition\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\"\n },\n \"authority\": {\n \"type\": \"string\",\n \"enum\": [\n \"canonical\",\n \"derived\",\n \"generated\",\n \"control\"\n ]\n },\n \"manual_edit\": {\n \"type\": \"string\",\n \"enum\": [\n \"allowed\",\n \"discouraged\",\n \"forbidden\"\n ]\n },\n \"change_control\": {\n \"type\": \"string\",\n \"enum\": [\n \"none\",\n \"approval-required\",\n \"regeneration-required\"\n ]\n },\n \"visibility\": {\n \"type\": \"string\",\n \"enum\": [\n \"public\",\n \"internal\",\n \"private\"\n ]\n },\n \"description\": {\n \"type\": \"string\"\n },\n \"path_patterns\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"exclude_patterns\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"states\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n \"required\": [\n \"type\",\n \"authority\",\n \"manual_edit\",\n \"change_control\",\n \"visibility\",\n \"path_patterns\"\n ]\n },\n \"ArtifactList\": {\n \"type\": \"object\",\n \"description\": \"Output of the list command (json/yaml format)\",\n \"properties\": {\n \"artifacts\": {\n \"type\": \"object\",\n \"description\": \"Map of artifact ID to resolved artifact definition\",\n \"additionalProperties\": {\n \"$ref\": \"#/components/schemas/ArtifactDefinition\"\n }\n }\n }\n },\n \"DiscoverResult\": {\n \"type\": \"object\",\n \"description\": \"Output of the discover command\",\n \"properties\": {\n \"mode\": {\n \"type\": \"string\",\n \"enum\": [\n \"init\",\n \"update\"\n ]\n },\n \"artifact_contracts_yaml\": {\n \"type\": \"string\",\n \"description\": \"Generated YAML content\"\n },\n \"decisions\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"artifact_id\": {\n \"type\": \"string\"\n },\n \"reasoning\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"artifact_id\",\n \"reasoning\"\n ]\n }\n },\n \"trace_decisions\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"link_id\": {\n \"type\": \"string\"\n },\n \"reasoning\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"link_id\",\n \"reasoning\"\n ]\n }\n },\n \"uncategorized_files\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"suggestions\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n \"required\": [\n \"mode\",\n \"artifact_contracts_yaml\"\n ]\n },\n \"ValidationResult\": {\n \"type\": \"object\",\n \"description\": \"Output of the validate command (json format, on error)\",\n \"properties\": {\n \"valid\": {\n \"type\": \"boolean\"\n },\n \"diagnostics\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"path\": {\n \"type\": \"string\"\n },\n \"message\": {\n \"type\": \"string\"\n },\n \"severity\": {\n \"type\": \"string\",\n \"enum\": [\n \"error\",\n \"warning\"\n ]\n }\n },\n \"required\": [\n \"message\",\n \"severity\"\n ]\n }\n },\n \"overlaps\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"path\": {\n \"type\": \"string\"\n },\n \"matching_artifacts\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n \"required\": [\n \"path\",\n \"matching_artifacts\"\n ]\n }\n }\n },\n \"required\": [\n \"valid\",\n \"diagnostics\",\n \"overlaps\"\n ]\n }\n }\n }\n}";
5
5
  //# sourceMappingURL=contract.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"contract.js","sourceRoot":"","sources":["../../src/generated/contract.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,gDAAgD;AAEhD,MAAM,CAAC,MAAM,aAAa,GAAW,0jlBAA0jlB,CAAC;AAEhmlB,MAAM,CAAC,MAAM,iBAAiB,GAAW,0j3BAA0j3B,CAAC"}
1
+ {"version":3,"file":"contract.js","sourceRoot":"","sources":["../../src/generated/contract.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,gDAAgD;AAEhD,MAAM,CAAC,MAAM,aAAa,GAAW,y4tBAAy4tB,CAAC;AAE/6tB,MAAM,CAAC,MAAM,iBAAiB,GAAW,ytkCAAytkC,CAAC"}
@@ -28,6 +28,7 @@ export interface AgentContract {
28
28
  readonly rules: readonly AgentRule[];
29
29
  readonly escalation_criteria: readonly EscalationCriterion[];
30
30
  }
31
+ export declare const artifactDiscoveryAgent: AgentContract;
31
32
  export declare const artifactQualityReviewer: AgentContract;
32
33
  export declare const agentRegistry: Record<string, AgentContract>;
33
34
  export type AgentId = keyof typeof agentRegistry;
@@ -1 +1 @@
1
- {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../../src/generated/dsl/agents.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,WAAW,GAAG,aAAa,GAAG,UAAU,CAAC;CAC7D;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,iBAAiB,GAAG,qBAAqB,GAAG,mBAAmB,CAAC;CAClF;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,YAAY,GAAG,WAAW,CAAC;IAC1C,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,kBAAkB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/C,QAAQ,CAAC,mBAAmB,EAAE,SAAS,MAAM,EAAE,CAAC;IAChD,QAAQ,CAAC,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9C,QAAQ,CAAC,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9C,QAAQ,CAAC,mBAAmB,EAAE,SAAS,MAAM,EAAE,CAAC;IAChD,QAAQ,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7C,QAAQ,CA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