artifact-graph 0.4.0 → 0.5.0
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/CHANGELOG.md +50 -0
- package/INSTALL.md +110 -16
- package/README.md +22 -6
- package/README.zh-CN.md +21 -6
- package/dist/cli.js +356 -77
- package/dist/index.cjs +315 -63
- package/dist/index.d.cts +41 -3
- package/dist/index.d.ts +41 -3
- package/dist/index.js +316 -64
- package/package.json +2 -1
- package/schemas/review-result.schema.json +74 -1
- package/templates/git-hooks/pre-commit.sh +18 -1
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
3
|
"$id": "https://artifact-graph.dev/schemas/review-result/v1.0.schema.json",
|
|
4
4
|
"title": "Review Result Protocol",
|
|
5
|
-
"description": "Versioned, machine-verifiable result schema for artifact review, repair, and batch processing workflows. Covers run-level, stage/batch-level, and finding-level results with severity, status, evidence, and repair relationships.",
|
|
5
|
+
"description": "Versioned, machine-verifiable result schema for artifact review, repair, and batch processing workflows. Covers run-level, stage/batch-level, and finding-level results with severity, status, evidence, and repair relationships. Cross-object producer/reviewer identity comparison requires the semantic TypeScript validator because JSON Schema cannot compare field values.",
|
|
6
6
|
"version": "1.0",
|
|
7
7
|
"type": "object",
|
|
8
|
+
"additionalProperties": false,
|
|
8
9
|
"required": ["schema_version", "run_id", "status", "decision", "summary"],
|
|
9
10
|
"properties": {
|
|
10
11
|
"schema_version": {
|
|
@@ -24,6 +25,7 @@
|
|
|
24
25
|
"attempt": {
|
|
25
26
|
"type": "integer",
|
|
26
27
|
"minimum": 1,
|
|
28
|
+
"maximum": 3,
|
|
27
29
|
"description": "Attempt number for this stage. Defaults to 1."
|
|
28
30
|
},
|
|
29
31
|
"status": {
|
|
@@ -78,6 +80,25 @@
|
|
|
78
80
|
}
|
|
79
81
|
}
|
|
80
82
|
},
|
|
83
|
+
"acceptance": {
|
|
84
|
+
"type": "object",
|
|
85
|
+
"additionalProperties": false,
|
|
86
|
+
"description": "Independent re-review identity and the repair result being accepted. The semantic validator compares stable executor+name identity (skill is metadata) and rejects self-acceptance.",
|
|
87
|
+
"required": ["reviewer", "source_result"],
|
|
88
|
+
"properties": {
|
|
89
|
+
"reviewer": { "$ref": "#/$defs/producer" },
|
|
90
|
+
"source_result": {
|
|
91
|
+
"type": "object",
|
|
92
|
+
"additionalProperties": false,
|
|
93
|
+
"required": ["run_id", "producer"],
|
|
94
|
+
"properties": {
|
|
95
|
+
"run_id": { "type": "string", "minLength": 1 },
|
|
96
|
+
"stage_id": { "type": "string" },
|
|
97
|
+
"producer": { "$ref": "#/$defs/producer" }
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
81
102
|
"evidence": {
|
|
82
103
|
"type": "array",
|
|
83
104
|
"items": {
|
|
@@ -189,7 +210,59 @@
|
|
|
189
210
|
}
|
|
190
211
|
}
|
|
191
212
|
},
|
|
213
|
+
"allOf": [
|
|
214
|
+
{
|
|
215
|
+
"if": {
|
|
216
|
+
"required": ["status", "decision"],
|
|
217
|
+
"properties": {
|
|
218
|
+
"status": { "const": "SUCCEEDED" },
|
|
219
|
+
"decision": { "enum": ["PASS", "PASS_WITH_RESIDUAL_MINOR"] }
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
"then": { "required": ["producer"] }
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
"if": {
|
|
226
|
+
"required": ["decision"],
|
|
227
|
+
"properties": {
|
|
228
|
+
"decision": { "enum": ["PASS", "PASS_WITH_RESIDUAL_MINOR"] }
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
"then": {
|
|
232
|
+
"not": {
|
|
233
|
+
"required": ["review"],
|
|
234
|
+
"properties": {
|
|
235
|
+
"review": {
|
|
236
|
+
"required": ["findings"],
|
|
237
|
+
"properties": {
|
|
238
|
+
"findings": {
|
|
239
|
+
"contains": {
|
|
240
|
+
"type": "object",
|
|
241
|
+
"required": ["severity"],
|
|
242
|
+
"properties": { "severity": { "const": "block" } },
|
|
243
|
+
"anyOf": [
|
|
244
|
+
{ "not": { "required": ["status"] } },
|
|
245
|
+
{ "required": ["status"], "properties": { "status": { "const": "open" } } }
|
|
246
|
+
]
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
],
|
|
192
256
|
"$defs": {
|
|
257
|
+
"producer": {
|
|
258
|
+
"type": "object",
|
|
259
|
+
"required": ["executor", "name"],
|
|
260
|
+
"properties": {
|
|
261
|
+
"executor": { "type": "string", "enum": ["script", "worker", "agent", "manual", "cli"] },
|
|
262
|
+
"name": { "type": "string", "minLength": 1 },
|
|
263
|
+
"skill": { "type": "string" }
|
|
264
|
+
}
|
|
265
|
+
},
|
|
193
266
|
"finding": {
|
|
194
267
|
"type": "object",
|
|
195
268
|
"required": ["id", "severity", "message"],
|
|
@@ -18,7 +18,24 @@ artifact_graph() {
|
|
|
18
18
|
return 127
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
# Detect if config or spec boundary files are staged
|
|
22
|
+
staged_files=$(git diff --cached --name-only --diff-filter=ACMR 2>/dev/null || true)
|
|
23
|
+
config_staged=0
|
|
24
|
+
for f in $staged_files; do
|
|
25
|
+
case "$f" in
|
|
26
|
+
artifact-graph.config.yaml|*/artifact-graph.config.yaml)
|
|
27
|
+
config_staged=1
|
|
28
|
+
break
|
|
29
|
+
;;
|
|
30
|
+
esac
|
|
31
|
+
done
|
|
32
|
+
|
|
33
|
+
if [ "$config_staged" -eq 1 ]; then
|
|
34
|
+
artifact_graph version-lock refresh --all --format markdown || exit $?
|
|
35
|
+
else
|
|
36
|
+
artifact_graph version-lock refresh --changed-only --staged --format markdown || exit $?
|
|
37
|
+
fi
|
|
38
|
+
|
|
22
39
|
if ! git diff --quiet -- artifacts/traceability-version-lock.json; then
|
|
23
40
|
echo "artifact-chain-assistant: version lock changed during pre-commit." >&2
|
|
24
41
|
echo "Please review and stage artifacts/traceability-version-lock.json, then commit again." >&2
|