artifact-contracts 0.30.2 → 0.30.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/cli-contract.yaml +2 -2
- package/docs/cli-reference.md +252 -0
- package/package.json +7 -6
- package/schemas/2026A.config.json +1 -1
- package/schemas/2026A.json +1 -1
package/LICENSE
CHANGED
package/cli-contract.yaml
CHANGED
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
# artifact-contracts CLI
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
**Version:** 0.1.1
|
|
6
|
+
|
|
7
|
+
## Table of Contents
|
|
8
|
+
|
|
9
|
+
- [artifact-contracts](#artifact-contracts)
|
|
10
|
+
- [validate](#artifact-contracts-validate)
|
|
11
|
+
- [resolve](#artifact-contracts-resolve)
|
|
12
|
+
- [list](#artifact-contracts-list)
|
|
13
|
+
- [explain](#artifact-contracts-explain)
|
|
14
|
+
- [audit](#artifact-contracts-audit)
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## artifact-contracts
|
|
19
|
+
|
|
20
|
+
Artifact registry CLI — validate definitions, resolve artifacts, list registered entries, and explain file properties.
|
|
21
|
+
|
|
22
|
+
### Global Options
|
|
23
|
+
|
|
24
|
+
| Option | Aliases | Required | Default | Description |
|
|
25
|
+
|---|---|---|---|---|
|
|
26
|
+
| `--version` | -V | No | | Output the version number |
|
|
27
|
+
| `--help` | -h | No | | Display help for command |
|
|
28
|
+
|
|
29
|
+
### Environment Variables
|
|
30
|
+
|
|
31
|
+
| Variable | Description |
|
|
32
|
+
|---|---|
|
|
33
|
+
| `OPENAI_API_KEY` | OpenAI API key. Required when --adapter openai is selected. |
|
|
34
|
+
| `ANTHROPIC_API_KEY` | Anthropic API key. Required when --adapter claude is selected. |
|
|
35
|
+
| `GEMINI_API_KEY` | Google Gemini API key. Required when --adapter gemini is selected. |
|
|
36
|
+
| `CURSOR_API_KEY` | Cursor API key. Required when --adapter cursor is selected. |
|
|
37
|
+
|
|
38
|
+
### validate
|
|
39
|
+
|
|
40
|
+
Validate artifact-contracts definitions
|
|
41
|
+
|
|
42
|
+
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.
|
|
43
|
+
|
|
44
|
+
**Usage:**
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
artifact-contracts validate [--config] [--check-files]
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
#### Options
|
|
51
|
+
|
|
52
|
+
| Option | Aliases | Required | Default | Description |
|
|
53
|
+
|---|---|---|---|---|
|
|
54
|
+
| `--config` | | No | | Path to artifact-contracts.config.yaml |
|
|
55
|
+
| `--check-files` | | No | | 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. |
|
|
56
|
+
|
|
57
|
+
#### Exit Codes
|
|
58
|
+
|
|
59
|
+
**Exit 0:** Validation passed with no errors
|
|
60
|
+
|
|
61
|
+
**Exit 1:** Schema or naming convention errors detected
|
|
62
|
+
|
|
63
|
+
**Exit 2:** Overlap detected — same path matches multiple artifacts
|
|
64
|
+
|
|
65
|
+
**Exit 3:** Config or input file not found / parse error
|
|
66
|
+
|
|
67
|
+
#### Extensions
|
|
68
|
+
|
|
69
|
+
```yaml
|
|
70
|
+
x-agent:
|
|
71
|
+
expected_duration_ms: 5000
|
|
72
|
+
retryable_exit_codes:
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
### resolve
|
|
79
|
+
|
|
80
|
+
Output fully-resolved artifact definitions
|
|
81
|
+
|
|
82
|
+
Expands config variables, applies authority-based defaults for manual_edit and change_control, and outputs the complete resolved DSL. Default format is yaml.
|
|
83
|
+
|
|
84
|
+
**Usage:**
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
artifact-contracts resolve [--config] [--format]
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
#### Options
|
|
91
|
+
|
|
92
|
+
| Option | Aliases | Required | Default | Description |
|
|
93
|
+
|---|---|---|---|---|
|
|
94
|
+
| `--config` | | No | | Path to artifact-contracts.config.yaml |
|
|
95
|
+
| `--format` | | No | | Output format (default: yaml) |
|
|
96
|
+
|
|
97
|
+
#### Exit Codes
|
|
98
|
+
|
|
99
|
+
**Exit 0:** Successfully output resolved definitions
|
|
100
|
+
|
|
101
|
+
**Exit 1:** Error resolving definitions
|
|
102
|
+
|
|
103
|
+
**Exit 3:** Config or input file not found / parse error
|
|
104
|
+
|
|
105
|
+
#### Extensions
|
|
106
|
+
|
|
107
|
+
```yaml
|
|
108
|
+
x-agent:
|
|
109
|
+
expected_duration_ms: 2000
|
|
110
|
+
retryable_exit_codes:
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
### list
|
|
117
|
+
|
|
118
|
+
List registered artifacts
|
|
119
|
+
|
|
120
|
+
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.
|
|
121
|
+
|
|
122
|
+
**Usage:**
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
artifact-contracts list [--config] [--authority] [--path] [--format]
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
#### Options
|
|
129
|
+
|
|
130
|
+
| Option | Aliases | Required | Default | Description |
|
|
131
|
+
|---|---|---|---|---|
|
|
132
|
+
| `--config` | | No | | Path to artifact-contracts.config.yaml |
|
|
133
|
+
| `--authority` | | No | | Filter by authority type |
|
|
134
|
+
| `--path` | | No | | Reverse-lookup — show artifact IDs matching this file path. For full governance details, use the explain command. |
|
|
135
|
+
| `--format` | | No | | Output format (default: text) |
|
|
136
|
+
|
|
137
|
+
#### Exit Codes
|
|
138
|
+
|
|
139
|
+
**Exit 0:** Successfully listed artifacts
|
|
140
|
+
|
|
141
|
+
**Exit 1:** Error reading definitions
|
|
142
|
+
|
|
143
|
+
**Exit 3:** Config or input file not found / parse error
|
|
144
|
+
|
|
145
|
+
#### Extensions
|
|
146
|
+
|
|
147
|
+
```yaml
|
|
148
|
+
x-agent:
|
|
149
|
+
expected_duration_ms: 2000
|
|
150
|
+
retryable_exit_codes:
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
### explain
|
|
157
|
+
|
|
158
|
+
Explain artifact properties for a file path
|
|
159
|
+
|
|
160
|
+
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.
|
|
161
|
+
|
|
162
|
+
**Usage:**
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
artifact-contracts explain <path> [--config] [--format]
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
#### Arguments
|
|
169
|
+
|
|
170
|
+
| Name | Required | Description |
|
|
171
|
+
|---|---|---|
|
|
172
|
+
| `path` | Yes | File path to explain |
|
|
173
|
+
|
|
174
|
+
#### Options
|
|
175
|
+
|
|
176
|
+
| Option | Aliases | Required | Default | Description |
|
|
177
|
+
|---|---|---|---|---|
|
|
178
|
+
| `--config` | | No | | Path to artifact-contracts.config.yaml |
|
|
179
|
+
| `--format` | | No | | Output format (default: text) |
|
|
180
|
+
|
|
181
|
+
#### Exit Codes
|
|
182
|
+
|
|
183
|
+
**Exit 0:** Path resolved to an artifact
|
|
184
|
+
|
|
185
|
+
**Exit 2:** Overlap — path matches multiple artifacts
|
|
186
|
+
|
|
187
|
+
**Exit 3:** Config or input file not found / parse error
|
|
188
|
+
|
|
189
|
+
**Exit 4:** Path does not match any registered artifact
|
|
190
|
+
|
|
191
|
+
#### Extensions
|
|
192
|
+
|
|
193
|
+
```yaml
|
|
194
|
+
x-agent:
|
|
195
|
+
expected_duration_ms: 2000
|
|
196
|
+
retryable_exit_codes:
|
|
197
|
+
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
### audit
|
|
203
|
+
|
|
204
|
+
LLM-based semantic audit of artifact definitions
|
|
205
|
+
|
|
206
|
+
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.
|
|
207
|
+
|
|
208
|
+
**Usage:**
|
|
209
|
+
|
|
210
|
+
```
|
|
211
|
+
artifact-contracts audit [--config] [--adapter] [--model] [--show-prompt] [--dry-run] [--fail-on] [--output] [--report-format]
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
#### Options
|
|
215
|
+
|
|
216
|
+
| Option | Aliases | Required | Default | Description |
|
|
217
|
+
|---|---|---|---|---|
|
|
218
|
+
| `--config` | | No | | Path to artifact-contracts.config.yaml |
|
|
219
|
+
| `--adapter` | | No | | LLM adapter to use |
|
|
220
|
+
| `--model` | | No | | Model name to pass to the adapter |
|
|
221
|
+
| `--show-prompt` | | No | | Output the constructed prompt without calling the LLM API |
|
|
222
|
+
| `--dry-run` | -n | No | | Alias for --show-prompt (output prompt without LLM call) |
|
|
223
|
+
| `--fail-on` | | No | | Minimum severity that causes exit 10. Ordering: critical > error > warning > info. For example, --fail-on warning exits 10 on warning, error, or critical. |
|
|
224
|
+
| `--output` | -o | No | | Write result to a file instead of stdout |
|
|
225
|
+
| `--report-format` | | No | | Output format for the report (default: text). LLM commands use --report-format; deterministic commands use --format. |
|
|
226
|
+
|
|
227
|
+
#### Exit Codes
|
|
228
|
+
|
|
229
|
+
**Exit 0:** Audit completed — no findings above threshold
|
|
230
|
+
|
|
231
|
+
**Exit 1:** General / transient error
|
|
232
|
+
|
|
233
|
+
**Exit 3:** Config or input file not found / parse error
|
|
234
|
+
|
|
235
|
+
**Exit 10:** Findings detected above --fail-on threshold
|
|
236
|
+
|
|
237
|
+
**Exit 11:** agent-contracts-runtime is not installed
|
|
238
|
+
|
|
239
|
+
**Exit 12:** Adapter initialization error (missing API key, etc.)
|
|
240
|
+
|
|
241
|
+
#### Extensions
|
|
242
|
+
|
|
243
|
+
```yaml
|
|
244
|
+
x-agent:
|
|
245
|
+
expected_duration_ms: 120000
|
|
246
|
+
retryable_exit_codes:
|
|
247
|
+
- 1
|
|
248
|
+
recommended_before_use:
|
|
249
|
+
- Run with --show-prompt first to preview the prompt
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
---
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "artifact-contracts",
|
|
3
|
-
"version": "0.30.
|
|
3
|
+
"version": "0.30.4",
|
|
4
4
|
"description": "Declarative artifact registry — define file properties, resolve paths to artifact IDs, and detect definition overlaps",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"files": [
|
|
22
22
|
"dist",
|
|
23
23
|
"schemas",
|
|
24
|
+
"docs",
|
|
24
25
|
"cli-contract.yaml",
|
|
25
26
|
"README.md",
|
|
26
27
|
"LICENSE"
|
|
@@ -44,15 +45,15 @@
|
|
|
44
45
|
"registry",
|
|
45
46
|
"validation"
|
|
46
47
|
],
|
|
47
|
-
"author": "foo-
|
|
48
|
+
"author": "foo-log-inc",
|
|
48
49
|
"license": "MIT",
|
|
49
50
|
"repository": {
|
|
50
51
|
"type": "git",
|
|
51
|
-
"url": "git+https://github.com/foo-
|
|
52
|
+
"url": "git+https://github.com/foo-log-inc/artifact-contracts.git"
|
|
52
53
|
},
|
|
53
|
-
"homepage": "https://github.com/foo-
|
|
54
|
+
"homepage": "https://github.com/foo-log-inc/artifact-contracts#readme",
|
|
54
55
|
"bugs": {
|
|
55
|
-
"url": "https://github.com/foo-
|
|
56
|
+
"url": "https://github.com/foo-log-inc/artifact-contracts/issues"
|
|
56
57
|
},
|
|
57
58
|
"dependencies": {
|
|
58
59
|
"commander": "^12.1.0",
|
|
@@ -86,4 +87,4 @@
|
|
|
86
87
|
"engines": {
|
|
87
88
|
"node": ">=20.0.0"
|
|
88
89
|
}
|
|
89
|
-
}
|
|
90
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://github.com/foo-
|
|
3
|
+
"$id": "https://github.com/foo-log-inc/artifact-contracts/schemas/2026A.config.json",
|
|
4
4
|
"title": "Artifact Contracts Config",
|
|
5
5
|
"description": "Schema for artifact-contracts.config.yaml — processing configuration and variables.",
|
|
6
6
|
"version": "2026A",
|
package/schemas/2026A.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://github.com/foo-
|
|
3
|
+
"$id": "https://github.com/foo-log-inc/artifact-contracts/schemas/2026A.json",
|
|
4
4
|
"title": "Artifact Contracts Document",
|
|
5
5
|
"description": "Schema for artifact-contracts.yaml — declarative artifact registry definitions.",
|
|
6
6
|
"version": "2026A",
|