artifact-graph 0.11.0 → 0.13.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 CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.13.0
6
+
7
+ ### Added
8
+
9
+ - Added `artifact-graph restructure inspect`, `plan`, `apply`, `recover`, and
10
+ `prune-recovery` for reviewable artifact splitting, moving, renumbering, fail-closed file-set
11
+ application, and retained recovery-material handling.
12
+ - Added repeatable `version-lock refresh --remove-orphan-edge <edgeId>` cleanup for explicitly
13
+ selected orphan implementation and artifact-relation locks.
14
+
15
+ ### Changed
16
+
17
+ - Adopted `skill-family-contracts`, `skill-family-harness-node`, and
18
+ `skill-family-engineering-kit` 0.22.0 for the restructuring contracts, file-set mechanism, and
19
+ engineering validation.
20
+ - Raised the supported Node.js range to `>=22.22.2 <23`.
21
+ - Version lockstep with `artifact-chain-assistant` 0.13.0.
22
+
23
+ ## 0.12.0
24
+
25
+ ### Changed
26
+
27
+ - Declared pnpm `10.30.0` for source development.
28
+ - Version lockstep with `artifact-chain-assistant` 0.12.0. Runtime behavior is unchanged.
29
+
5
30
  ## 0.11.0
6
31
 
7
32
  ### Added
package/CONTRIBUTING.md CHANGED
@@ -9,7 +9,7 @@ Thanks for your interest in contributing.
9
9
 
10
10
  ## Development
11
11
 
12
- Use Node.js `>=22.0.0`.
12
+ Use Node.js `>=22.22.2 <23` and pnpm `10.30.0`.
13
13
 
14
14
  ```bash
15
15
  pnpm install
package/INSTALL.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Prerequisites
4
4
 
5
- - Node.js `>=22.0.0`.
5
+ - Node.js `>=22.22.2 <23`.
6
6
 
7
7
  ## Install
8
8
 
package/README.md CHANGED
@@ -23,7 +23,7 @@ pnpm exec artifact-graph --help
23
23
  pnpm exec artifact-graph doctor --root .
24
24
  ```
25
25
 
26
- If either read-only command fails, confirm that Node.js `>=22.0.0` is active and reinstall the
26
+ If either read-only command fails, confirm that Node.js `>=22.22.2 <23` is active and reinstall the
27
27
  package using the precise instructions in [INSTALL.md](INSTALL.md). Do not run a write command
28
28
  until the CLI resolves successfully and doctor reports an actionable diagnosis.
29
29
 
@@ -39,7 +39,7 @@ Or install from GitHub:
39
39
  npm install --save-dev github:ifoohoo/artifact-graph
40
40
  ```
41
41
 
42
- Node.js `>=22.0.0` is required. For pnpm 10+, see [INSTALL.md](INSTALL.md) for the native build
42
+ Node.js `>=22.22.2 <23` is required. For pnpm 10+, see [INSTALL.md](INSTALL.md) for the native build
43
43
  allowlist setup.
44
44
 
45
45
  ## Quick Start
@@ -94,6 +94,43 @@ index before `refresh --all`; there is no `version-lock update --all` operation.
94
94
  relations (`artifactRelations`). Old 1.0 lock files without `artifactRelations` are treated as
95
95
  having an empty relation list; run `refresh --all` once to establish the complete relation baseline.
96
96
  - Install opt-in Git hooks with `artifact-graph hooks install-git --hook all`.
97
+ - Inspect and plan artifact restructuring with `artifact-graph restructure inspect` and
98
+ `artifact-graph restructure plan`. These two are read-only compilations of a mapping you supply.
99
+
100
+ ### Restructuring Artifacts (Split, Move, Renumber)
101
+
102
+ `artifact-graph restructure` compiles an explicit restructuring mapping into a reviewable candidate
103
+ plan and then applies the file set as one operation. Three transformations are supported:
104
+ `record-split` (physically split records), `identity-split` (split one numbered identity into
105
+ several), and `move-renumber` (move records between files and renumber them). Deciding capability
106
+ boundaries and where each acceptance criterion goes stays outside the CLI; the compiler only turns
107
+ a complete mapping into a plan and applies it.
108
+
109
+ ```bash
110
+ # pnpm
111
+ pnpm exec artifact-graph restructure inspect --root . --input request.json --format json
112
+ pnpm exec artifact-graph restructure plan --root . --input mapping.json --format json
113
+ pnpm exec artifact-graph restructure apply --root . --plan plan.json --confirm-cooperative-writers
114
+
115
+ # npm
116
+ npx artifact-graph restructure inspect --root . --input request.json --format json
117
+ npx artifact-graph restructure plan --root . --input mapping.json --format json
118
+ npx artifact-graph restructure apply --root . --plan plan.json --confirm-cooperative-writers
119
+ ```
120
+
121
+ `plan` reports blockers, unresolved items, candidate issues and out-of-scope reference sites;
122
+ `applicable` is false while any blocker or unresolved item remains, and an inapplicable plan must not
123
+ be applied. Keep the plan document in an ordinary directory outside the write set — recovery depends
124
+ on that document, not on process state.
125
+
126
+ > **Adoption limits.** The file-set write capability has `candidate` maturity. The qualified
127
+ > environment is Darwin / arm64 / APFS only; other platforms are reported as unavailable rather than
128
+ > degraded to a non-transactional write. It assumes cooperative writers and does not prove that
129
+ > premise: `apply` and `prune-recovery` require `--confirm-cooperative-writers`, and refuse to write
130
+ > without it. Recovery requires `recover` with both `--confirm-all-participants-stopped` and
131
+ > `--confirm-exclusive-maintenance`. Recovery materials are retained by default; only an explicit
132
+ > `prune-recovery` removes them. No cross-platform transactional guarantee is offered. `inspect` and
133
+ > `plan` do not write to the project.
97
134
 
98
135
  ### Cleaning Up Orphan Locks After Deleting or Splitting Artifacts
99
136
 
@@ -113,6 +150,17 @@ git diff artifacts/traceability-version-lock.json
113
150
  git add artifacts/traceability-version-lock.json
114
151
  ```
115
152
 
153
+ When only the edge produced by one renumbering should go, name it explicitly instead of sweeping
154
+ every orphan:
155
+
156
+ ```bash
157
+ pnpm exec artifact-graph version-lock refresh --changed-only --worktree --remove-orphan-edge <edgeId>
158
+ ```
159
+
160
+ `--remove-orphan-edge` is repeatable, applies only to edges that are still orphaned, and is mutually
161
+ exclusive with `--remove-orphans` — passing both is rejected. Naming an edge that is still live is
162
+ rejected without deleting anything, and pre-existing orphans in the same lock file are left intact.
163
+
116
164
  `version-lock audit` marks structural orphan locks and stale hashes as blocking issues and prints
117
165
  these same remediation steps. Runner liveness findings (a test file no longer active in any
118
166
  configured runner) are warnings only and do not block.
package/README.zh-CN.md CHANGED
@@ -21,7 +21,7 @@ pnpm exec artifact-graph --help
21
21
  pnpm exec artifact-graph doctor --root .
22
22
  ```
23
23
 
24
- 如果任一只读命令失败,先确认当前 Node.js 版本不低于 `22.0.0`,再按照
24
+ 如果任一只读命令失败,先确认当前 Node.js 满足 `>=22.22.2 <23`,再按照
25
25
  [INSTALL.md](INSTALL.md) 中的精确说明重新安装;命令行工具能够正常解析且 doctor
26
26
  给出可处理的诊断前,不要运行写入命令。
27
27
 
@@ -37,7 +37,7 @@ pnpm add -D artifact-graph
37
37
  npm install --save-dev github:ifoohoo/artifact-graph
38
38
  ```
39
39
 
40
- 需要 Node.js `>=22.0.0`。pnpm 10+ 需要配置原生构建白名单,详见 [INSTALL.md](INSTALL.md)。
40
+ 需要 Node.js `>=22.22.2 <23`。pnpm 10+ 需要配置原生构建白名单,详见 [INSTALL.md](INSTALL.md)。
41
41
 
42
42
  ## 快速开始
43
43
 
@@ -90,6 +90,38 @@ Python 的 `#` 注释目前不受支持。
90
90
  - 版本锁覆盖实现/验证边(`locks`)和制品间关系(`artifactRelations`)。旧版 1.0 锁文件缺少
91
91
  `artifactRelations` 时视为空数组;首次启用时执行一次 `refresh --all` 建立完整关系基线。
92
92
  - 用 `artifact-graph hooks install-git --hook all` 安装可选 Git hooks。
93
+ - 用 `artifact-graph restructure inspect` 和 `artifact-graph restructure plan` 检查与规划制品重组:
94
+ 这两步只读取入并确定性地编译你给出的映射,不写项目。
95
+
96
+ ### 制品重组(拆分、跨文件移动与重编号)
97
+
98
+ `artifact-graph restructure` 把一份显式重组映射编译成可复核的候选计划,再以一次文件集合操作
99
+ 应用。支持三类变换:`record-split`(记录物理拆分)、`identity-split`(编号身份拆分)与
100
+ `move-renumber`(跨文件移动与重编号)。能力边界、共同约束与每项验收标准的去向不由 CLI 决定;
101
+ 编译器只把一份完整映射编译成计划并应用。
102
+
103
+ ```bash
104
+ # pnpm
105
+ pnpm exec artifact-graph restructure inspect --root . --input request.json --format json
106
+ pnpm exec artifact-graph restructure plan --root . --input mapping.json --format json
107
+ pnpm exec artifact-graph restructure apply --root . --plan plan.json --confirm-cooperative-writers
108
+
109
+ # npm
110
+ npx artifact-graph restructure inspect --root . --input request.json --format json
111
+ npx artifact-graph restructure plan --root . --input mapping.json --format json
112
+ npx artifact-graph restructure apply --root . --plan plan.json --confirm-cooperative-writers
113
+ ```
114
+
115
+ `plan` 输出阻断项、未解决项、候选内部问题与写集外的引用出现位置;只要存在阻断项或未解决项,
116
+ `applicable` 就不为真,不可应用的计划不得进入 `apply`。计划文档要保存到写集之外的普通目录:
117
+ 恢复只依赖该文档,不依赖进程状态。
118
+
119
+ > **采用边界。** 文件集合写入能力的成熟度为 `candidate`。资格环境仅为 Darwin / arm64 / APFS;
120
+ > 其他平台返回不可用,不会降级成无事务写入。该能力以合作式写者为前提,且不自证该前提:
121
+ > `apply` 与 `prune-recovery` 必须给出 `--confirm-cooperative-writers`,缺失即拒绝写入;
122
+ > 恢复必须用 `recover` 并同时给出 `--confirm-all-participants-stopped` 与
123
+ > `--confirm-exclusive-maintenance`。恢复材料默认保留,只有显式 `prune-recovery` 才清理。
124
+ > 不承诺全平台事务保证。`inspect` 与 `plan` 不写项目。
93
125
 
94
126
  ### 制品删除或拆分后的孤立锁清理
95
127
 
@@ -108,6 +140,15 @@ git diff artifacts/traceability-version-lock.json
108
140
  git add artifacts/traceability-version-lock.json
109
141
  ```
110
142
 
143
+ 只清理一次改号产生的那条边时,点名它,不要整体清扫:
144
+
145
+ ```bash
146
+ pnpm exec artifact-graph version-lock refresh --changed-only --worktree --remove-orphan-edge <edgeId>
147
+ ```
148
+
149
+ `--remove-orphan-edge` 可重复指定,只对当前仍是孤儿的边生效,并与 `--remove-orphans` 互斥
150
+ (同时给出即被拒绝)。点名仍是活边的边会被拒绝且不删除;同一锁文件里既有的孤立锁保持不变。
151
+
111
152
  `version-lock audit` 会把结构性孤立锁和陈旧哈希标记为阻断问题,并输出上述解决步骤;
112
153
  runner liveness 发现(测试文件不再处于任何已配置 runner 的激活范围)只是警告,不会阻断。
113
154
 
@@ -0,0 +1,263 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "artifact.restructure-mapping@1",
4
+ "title": "Artifact Contract: Restructure Mapping",
5
+ "version": "1.1.0",
6
+ "contractIdentity": {
7
+ "major": "artifact.restructure-mapping@1",
8
+ "authority": "artifact",
9
+ "namespace": "artifact",
10
+ "revisionDigest": "sha256:b3a7a52b4ab2479c97a53e754f57e3ec6bf71e7c81385e11666c015f54d7c414"
11
+ },
12
+ "type": "object",
13
+ "required": ["schema_version", "request", "request_digest", "config_snapshot", "sources", "targets", "content_moves", "identity_map", "criterion_map", "relation_map", "prose_edits", "file_headers", "unresolved"],
14
+ "properties": {
15
+ "schema_version": { "const": "1.0" },
16
+ "request": { "$ref": "#/definitions/request" },
17
+ "request_digest": { "$ref": "#/definitions/digest" },
18
+ "config_snapshot": { "$ref": "#/definitions/snapshot" },
19
+ "sources": {
20
+ "type": "array",
21
+ "minItems": 1,
22
+ "items": {
23
+ "type": "object",
24
+ "required": ["type", "id", "path", "snapshot", "disposition"],
25
+ "properties": {
26
+ "type": { "type": "string", "minLength": 1 },
27
+ "id": { "type": "string", "minLength": 1 },
28
+ "path": { "type": "string", "minLength": 1 },
29
+ "snapshot": { "$ref": "#/definitions/snapshot" },
30
+ "disposition": { "enum": ["preserved", "retired"] }
31
+ },
32
+ "additionalProperties": false
33
+ }
34
+ },
35
+ "targets": {
36
+ "type": "array",
37
+ "items": {
38
+ "type": "object",
39
+ "required": ["key", "type", "id", "path", "snapshot"],
40
+ "properties": {
41
+ "key": { "type": "string", "minLength": 1 },
42
+ "type": { "type": "string", "minLength": 1 },
43
+ "id": { "type": "string", "minLength": 1 },
44
+ "path": { "type": "string", "minLength": 1 },
45
+ "snapshot": { "$ref": "#/definitions/snapshot" }
46
+ },
47
+ "additionalProperties": false
48
+ }
49
+ },
50
+ "content_moves": {
51
+ "type": "array",
52
+ "items": {
53
+ "type": "object",
54
+ "required": ["id", "source", "target"],
55
+ "properties": {
56
+ "id": { "type": "string", "minLength": 1 },
57
+ "source": { "$ref": "#/definitions/span" },
58
+ "target": {
59
+ "type": "object",
60
+ "required": ["path", "order", "mode"],
61
+ "properties": {
62
+ "path": { "type": "string", "minLength": 1 },
63
+ "order": { "type": "integer", "minimum": 0 },
64
+ "mode": { "enum": ["move", "copy"] },
65
+ "separator": { "type": "string" }
66
+ },
67
+ "additionalProperties": false
68
+ }
69
+ },
70
+ "additionalProperties": false
71
+ }
72
+ },
73
+ "identity_map": {
74
+ "type": "array",
75
+ "items": {
76
+ "type": "object",
77
+ "required": ["source_type", "source_id", "target_keys", "source_disposition"],
78
+ "properties": {
79
+ "source_type": { "type": "string", "minLength": 1 },
80
+ "source_id": { "type": "string", "minLength": 1 },
81
+ "target_keys": { "type": "array", "minItems": 1, "items": { "type": "string", "minLength": 1 }, "uniqueItems": true },
82
+ "source_disposition": { "enum": ["preserved", "retired"] }
83
+ },
84
+ "additionalProperties": false
85
+ }
86
+ },
87
+ "criterion_map": {
88
+ "type": "array",
89
+ "items": {
90
+ "type": "object",
91
+ "required": ["source_feature", "source_criterion", "targets"],
92
+ "properties": {
93
+ "source_feature": { "type": "string", "minLength": 1 },
94
+ "source_criterion": { "type": "string", "pattern": "^AC[0-9]+$" },
95
+ "targets": {
96
+ "type": "array",
97
+ "minItems": 1,
98
+ "items": {
99
+ "type": "object",
100
+ "required": ["feature", "criterion"],
101
+ "properties": {
102
+ "feature": { "type": "string", "minLength": 1 },
103
+ "criterion": { "type": "string", "pattern": "^AC[0-9]+$" }
104
+ },
105
+ "additionalProperties": false
106
+ }
107
+ }
108
+ },
109
+ "additionalProperties": false
110
+ }
111
+ },
112
+ "relation_map": {
113
+ "type": "array",
114
+ "items": {
115
+ "type": "object",
116
+ "required": ["occurrence", "targets", "basis"],
117
+ "properties": {
118
+ "occurrence": { "$ref": "#/definitions/relation" },
119
+ "targets": { "type": "array", "items": { "$ref": "#/definitions/relationTarget" } },
120
+ "basis": { "type": "string", "minLength": 1 }
121
+ },
122
+ "additionalProperties": false
123
+ }
124
+ },
125
+ "prose_edits": {
126
+ "type": "array",
127
+ "items": {
128
+ "type": "object",
129
+ "required": ["source", "target_path", "old_text", "new_text", "reason"],
130
+ "properties": {
131
+ "source": { "$ref": "#/definitions/span" },
132
+ "target_path": { "type": "string", "minLength": 1 },
133
+ "old_text": { "type": "string" },
134
+ "new_text": { "type": "string" },
135
+ "reason": { "type": "string", "minLength": 1 }
136
+ },
137
+ "additionalProperties": false
138
+ }
139
+ },
140
+ "file_headers": {
141
+ "type": "array",
142
+ "items": {
143
+ "type": "object",
144
+ "required": ["path", "content", "affected_records"],
145
+ "properties": {
146
+ "path": { "type": "string", "minLength": 1 },
147
+ "content": { "type": "string" },
148
+ "affected_records": { "type": "array", "items": { "type": "string", "minLength": 1 }, "uniqueItems": true }
149
+ },
150
+ "additionalProperties": false
151
+ }
152
+ },
153
+ "unresolved": {
154
+ "type": "array",
155
+ "items": {
156
+ "type": "object",
157
+ "required": ["code", "message"],
158
+ "properties": {
159
+ "code": { "type": "string", "minLength": 1 },
160
+ "message": { "type": "string", "minLength": 1 },
161
+ "path": { "type": "string" },
162
+ "line": { "type": "integer", "minimum": 1 }
163
+ },
164
+ "additionalProperties": false
165
+ }
166
+ }
167
+ },
168
+ "additionalProperties": false,
169
+ "definitions": {
170
+ "request": {
171
+ "type": "object",
172
+ "required": ["schema_version", "operation", "sources", "allowed_output_paths"],
173
+ "properties": {
174
+ "schema_version": { "const": "1.0" },
175
+ "operation": { "enum": ["record-split", "identity-split", "move-renumber"] },
176
+ "sources": {
177
+ "type": "array",
178
+ "minItems": 1,
179
+ "items": {
180
+ "type": "object",
181
+ "required": ["type", "id"],
182
+ "properties": {
183
+ "type": { "type": "string", "minLength": 1 },
184
+ "id": { "type": "string", "minLength": 1 },
185
+ "path": { "type": "string", "minLength": 1 }
186
+ },
187
+ "additionalProperties": false
188
+ }
189
+ },
190
+ "allowed_output_paths": {
191
+ "type": "array",
192
+ "minItems": 1,
193
+ "items": { "type": "string", "minLength": 1 },
194
+ "uniqueItems": true
195
+ },
196
+ "numbering_policy": {
197
+ "type": "object",
198
+ "required": ["mode"],
199
+ "properties": {
200
+ "mode": { "enum": ["explicit", "configured-next-available"] },
201
+ "range": { "type": "string", "minLength": 1 }
202
+ },
203
+ "additionalProperties": false
204
+ }
205
+ },
206
+ "additionalProperties": false
207
+ },
208
+ "digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
209
+ "mode": {
210
+ "anyOf": [
211
+ { "type": "integer", "minimum": 0, "maximum": 511 },
212
+ { "type": "null" }
213
+ ]
214
+ },
215
+ "snapshot": {
216
+ "type": "object",
217
+ "required": ["path", "exists", "sha256", "size", "mode"],
218
+ "properties": {
219
+ "path": { "type": "string" },
220
+ "exists": { "type": "boolean" },
221
+ "sha256": { "anyOf": [{ "$ref": "#/definitions/digest" }, { "type": "null" }] },
222
+ "size": { "type": "integer", "minimum": 0 },
223
+ "mode": { "$ref": "#/definitions/mode" }
224
+ },
225
+ "additionalProperties": false
226
+ },
227
+ "span": {
228
+ "type": "object",
229
+ "required": ["path", "start_byte", "end_byte", "sha256"],
230
+ "properties": {
231
+ "path": { "type": "string", "minLength": 1 },
232
+ "start_byte": { "type": "integer", "minimum": 0 },
233
+ "end_byte": { "type": "integer", "minimum": 0 },
234
+ "sha256": { "$ref": "#/definitions/digest" }
235
+ },
236
+ "additionalProperties": false
237
+ },
238
+ "relation": {
239
+ "type": "object",
240
+ "required": ["from", "to", "kind", "source", "source_path", "source_line", "occurrence"],
241
+ "properties": {
242
+ "from": { "type": "string", "minLength": 1 },
243
+ "to": { "type": "string", "minLength": 1 },
244
+ "kind": { "type": "string", "minLength": 1 },
245
+ "source": { "type": "string", "minLength": 1 },
246
+ "source_path": { "type": "string", "minLength": 1 },
247
+ "source_line": { "type": "integer", "minimum": 1 },
248
+ "occurrence": { "type": "integer", "minimum": 1 }
249
+ },
250
+ "additionalProperties": false
251
+ },
252
+ "relationTarget": {
253
+ "type": "object",
254
+ "required": ["from", "to", "kind"],
255
+ "properties": {
256
+ "from": { "type": "string", "minLength": 1 },
257
+ "to": { "type": "string", "minLength": 1 },
258
+ "kind": { "type": "string", "minLength": 1 }
259
+ },
260
+ "additionalProperties": false
261
+ }
262
+ }
263
+ }
@@ -0,0 +1,112 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "artifact.restructure-plan@1",
4
+ "title": "Artifact Contract: Restructure Plan",
5
+ "version": "1.1.0",
6
+ "contractIdentity": {
7
+ "major": "artifact.restructure-plan@1",
8
+ "authority": "artifact",
9
+ "namespace": "artifact",
10
+ "revisionDigest": "sha256:afaf8c75738b4c4caf613ad4cabdb9b8423b646b2db799cf345d6de9c5869283"
11
+ },
12
+ "type": "object",
13
+ "required": ["schema_version", "operation_id", "validation_timeout_ms", "request_digest", "mapping_digest", "config_snapshot", "input_snapshots", "candidates", "graph_diff", "validation", "applicable"],
14
+ "properties": {
15
+ "schema_version": { "const": "1.1" },
16
+ "operation_id": { "$ref": "#/definitions/operationId" },
17
+ "validation_timeout_ms": { "const": 30000 },
18
+ "request_digest": { "$ref": "#/definitions/digest" },
19
+ "mapping_digest": { "$ref": "#/definitions/digest" },
20
+ "config_snapshot": { "$ref": "#/definitions/snapshot" },
21
+ "input_snapshots": { "type": "array", "items": { "$ref": "#/definitions/snapshot" } },
22
+ "candidates": {
23
+ "type": "array",
24
+ "items": {
25
+ "type": "object",
26
+ "required": ["path", "action", "content", "sha256", "mode", "original", "diff"],
27
+ "properties": {
28
+ "path": { "type": "string", "minLength": 1 },
29
+ "action": { "enum": ["create", "replace", "delete"] },
30
+ "content": { "anyOf": [{ "type": "string" }, { "type": "null" }] },
31
+ "sha256": { "anyOf": [{ "$ref": "#/definitions/digest" }, { "type": "null" }] },
32
+ "mode": { "$ref": "#/definitions/mode" },
33
+ "original": { "$ref": "#/definitions/snapshot" },
34
+ "diff": { "type": "string" }
35
+ },
36
+ "additionalProperties": false
37
+ }
38
+ },
39
+ "graph_diff": {
40
+ "type": "object",
41
+ "required": ["added_nodes", "removed_nodes", "added_edges", "removed_edges"],
42
+ "properties": {
43
+ "added_nodes": { "type": "array", "items": { "type": "string" } },
44
+ "removed_nodes": { "type": "array", "items": { "type": "string" } },
45
+ "added_edges": { "type": "array", "items": { "type": "string" } },
46
+ "removed_edges": { "type": "array", "items": { "type": "string" } }
47
+ },
48
+ "additionalProperties": false
49
+ },
50
+ "validation": {
51
+ "type": "object",
52
+ "required": ["blockers", "unresolved", "candidate_issues", "consumer_candidates"],
53
+ "properties": {
54
+ "blockers": { "type": "array", "items": { "$ref": "#/definitions/finding" } },
55
+ "unresolved": { "type": "array", "items": { "$ref": "#/definitions/finding" } },
56
+ "candidate_issues": { "type": "array", "items": { "type": "object" } },
57
+ "consumer_candidates": {
58
+ "type": "array",
59
+ "items": {
60
+ "type": "object",
61
+ "required": ["path", "line", "reference"],
62
+ "properties": {
63
+ "path": { "type": "string", "minLength": 1 },
64
+ "line": { "type": "integer", "minimum": 1 },
65
+ "reference": { "type": "string", "minLength": 1 }
66
+ },
67
+ "additionalProperties": false
68
+ }
69
+ }
70
+ },
71
+ "additionalProperties": false
72
+ },
73
+ "applicable": { "type": "boolean" }
74
+ },
75
+ "additionalProperties": false,
76
+ "definitions": {
77
+ "digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
78
+ "operationId": {
79
+ "type": "string",
80
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
81
+ },
82
+ "mode": {
83
+ "anyOf": [
84
+ { "type": "integer", "minimum": 0, "maximum": 511 },
85
+ { "type": "null" }
86
+ ]
87
+ },
88
+ "snapshot": {
89
+ "type": "object",
90
+ "required": ["path", "exists", "sha256", "size", "mode"],
91
+ "properties": {
92
+ "path": { "type": "string" },
93
+ "exists": { "type": "boolean" },
94
+ "sha256": { "anyOf": [{ "$ref": "#/definitions/digest" }, { "type": "null" }] },
95
+ "size": { "type": "integer", "minimum": 0 },
96
+ "mode": { "$ref": "#/definitions/mode" }
97
+ },
98
+ "additionalProperties": false
99
+ },
100
+ "finding": {
101
+ "type": "object",
102
+ "required": ["code", "message"],
103
+ "properties": {
104
+ "code": { "type": "string", "minLength": 1 },
105
+ "message": { "type": "string", "minLength": 1 },
106
+ "path": { "type": "string" },
107
+ "line": { "type": "integer", "minimum": 1 }
108
+ },
109
+ "additionalProperties": true
110
+ }
111
+ }
112
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "artifact.restructure-request@1",
4
+ "title": "Artifact Contract: Restructure Request",
5
+ "version": "1.0.0",
6
+ "contractIdentity": {
7
+ "major": "artifact.restructure-request@1",
8
+ "authority": "artifact",
9
+ "namespace": "artifact",
10
+ "revisionDigest": "sha256:a8daeb76c2107a5516f8900b57f28425ecf89b4e76d95a64e7b705c773fed7bd"
11
+ },
12
+ "type": "object",
13
+ "required": ["schema_version", "operation", "sources", "allowed_output_paths"],
14
+ "properties": {
15
+ "schema_version": { "const": "1.0" },
16
+ "operation": { "enum": ["record-split", "identity-split", "move-renumber"] },
17
+ "sources": {
18
+ "type": "array",
19
+ "minItems": 1,
20
+ "items": {
21
+ "type": "object",
22
+ "required": ["type", "id"],
23
+ "properties": {
24
+ "type": { "type": "string", "minLength": 1 },
25
+ "id": { "type": "string", "minLength": 1 },
26
+ "path": { "type": "string", "minLength": 1 }
27
+ },
28
+ "additionalProperties": false
29
+ }
30
+ },
31
+ "allowed_output_paths": {
32
+ "type": "array",
33
+ "minItems": 1,
34
+ "items": { "type": "string", "minLength": 1 },
35
+ "uniqueItems": true
36
+ },
37
+ "numbering_policy": {
38
+ "type": "object",
39
+ "required": ["mode"],
40
+ "properties": {
41
+ "mode": { "enum": ["explicit", "configured-next-available"] },
42
+ "range": { "type": "string", "minLength": 1 }
43
+ },
44
+ "additionalProperties": false
45
+ }
46
+ },
47
+ "additionalProperties": false
48
+ }