artifact-graph 0.12.0 → 0.14.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 +33 -0
- package/CONTRIBUTING.md +1 -1
- package/INSTALL.md +1 -1
- package/README.md +126 -5
- package/README.zh-CN.md +128 -4
- package/contracts/restructure-mapping/schema.json +263 -0
- package/contracts/restructure-plan/schema.json +112 -0
- package/contracts/restructure-request/schema.json +48 -0
- package/dist/cli.js +2873 -412
- package/dist/index.cjs +2596 -253
- package/dist/index.d.cts +549 -3
- package/dist/index.d.ts +549 -3
- package/dist/index.js +2542 -247
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,39 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.14.0
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Custom artifact types can read one JSON object per original file with `format: json` and a root
|
|
10
|
+
`idField`. Configured relation fields follow fixed dotted property paths; graph diagnostics and
|
|
11
|
+
version locks continue to refer to the original file. Markdown remains the default format.
|
|
12
|
+
- Added `check-professional` to combine graph validation, version-lock audit, and coverage into a
|
|
13
|
+
graph-scoped conclusion without writing the scan cache. It can create a proof at an explicit
|
|
14
|
+
absolute path without overwriting an existing file. `read-proof` reads that proof without a scan.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- Version lockstep with `artifact-chain-assistant` 0.14.0.
|
|
19
|
+
|
|
20
|
+
## 0.13.0
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
|
|
24
|
+
- Added `artifact-graph restructure inspect`, `plan`, `apply`, `recover`, and
|
|
25
|
+
`prune-recovery` for reviewable artifact splitting, moving, renumbering, fail-closed file-set
|
|
26
|
+
application, and retained recovery-material handling.
|
|
27
|
+
- Added repeatable `version-lock refresh --remove-orphan-edge <edgeId>` cleanup for explicitly
|
|
28
|
+
selected orphan implementation and artifact-relation locks.
|
|
29
|
+
|
|
30
|
+
### Changed
|
|
31
|
+
|
|
32
|
+
- Adopted `skill-family-contracts`, `skill-family-harness-node`, and
|
|
33
|
+
`skill-family-engineering-kit` 0.22.0 for the restructuring contracts, file-set mechanism, and
|
|
34
|
+
engineering validation.
|
|
35
|
+
- Raised the supported Node.js range to `>=22.22.2 <23`.
|
|
36
|
+
- Version lockstep with `artifact-chain-assistant` 0.13.0.
|
|
37
|
+
|
|
5
38
|
## 0.12.0
|
|
6
39
|
|
|
7
40
|
### Changed
|
package/CONTRIBUTING.md
CHANGED
package/INSTALL.md
CHANGED
package/README.md
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
[中文](README.zh-CN.md)
|
|
4
4
|
|
|
5
|
-
Git-native
|
|
5
|
+
Git-native artifact graph scanner and validator for agentic coding workflows.
|
|
6
|
+
Markdown stays the default parser. A custom type may set `format: json` and bring that original file into the same graph.
|
|
6
7
|
|
|
7
8
|
`artifact-graph` helps projects keep requirements, scenarios, design notes, source files, tests,
|
|
8
9
|
and version-lock metadata connected. It is designed for deterministic local use before an AI coding
|
|
@@ -10,8 +11,10 @@ agent claims implementation work is complete.
|
|
|
10
11
|
|
|
11
12
|
<!-- release-skill:capability:external-write-boundary -->
|
|
12
13
|
> **External-write boundary:** Installing `artifact-graph` does not modify a project or write to
|
|
13
|
-
> remote systems. Read-only commands such as `--help`, `doctor`, `validate`, `query`,
|
|
14
|
-
> do not change project files.
|
|
14
|
+
> remote systems. Read-only commands such as `--help`, `doctor`, `validate`, `query`, `audit`,
|
|
15
|
+
> `check-professional` (without `--conclusion-output`), and `read-proof` do not change project files.
|
|
16
|
+
> `--conclusion-output` creates one new proof file at an explicit absolute path and never overwrites
|
|
17
|
+
> an existing proof. Commands including `init`, `scan`, `version-lock refresh`, and
|
|
15
18
|
> `hooks install-git` write locally only when explicitly invoked.
|
|
16
19
|
|
|
17
20
|
<!-- release-skill:capability:safe-first-command -->
|
|
@@ -23,7 +26,7 @@ pnpm exec artifact-graph --help
|
|
|
23
26
|
pnpm exec artifact-graph doctor --root .
|
|
24
27
|
```
|
|
25
28
|
|
|
26
|
-
If either read-only command fails, confirm that Node.js `>=22.
|
|
29
|
+
If either read-only command fails, confirm that Node.js `>=22.22.2 <23` is active and reinstall the
|
|
27
30
|
package using the precise instructions in [INSTALL.md](INSTALL.md). Do not run a write command
|
|
28
31
|
until the CLI resolves successfully and doctor reports an actionable diagnosis.
|
|
29
32
|
|
|
@@ -39,7 +42,7 @@ Or install from GitHub:
|
|
|
39
42
|
npm install --save-dev github:ifoohoo/artifact-graph
|
|
40
43
|
```
|
|
41
44
|
|
|
42
|
-
Node.js `>=22.
|
|
45
|
+
Node.js `>=22.22.2 <23` is required. For pnpm 10+, see [INSTALL.md](INSTALL.md) for the native build
|
|
43
46
|
allowlist setup.
|
|
44
47
|
|
|
45
48
|
## Quick Start
|
|
@@ -78,10 +81,80 @@ See [Code Traceability And Coverage Boundaries](INSTALL.md#code-traceability-and
|
|
|
78
81
|
for syntax, scan configuration, classification, exemptions and project isolation. Inspect the
|
|
79
82
|
index before `refresh --all`; there is no `version-lock update --all` operation.
|
|
80
83
|
|
|
84
|
+
### JSON originals for custom types
|
|
85
|
+
|
|
86
|
+
Built-in types keep their dedicated parsers. `format: json` belongs only on a custom type registered by the project, and that type must also set `idField`. Omitting `format` keeps Markdown parsing. A `*.json` scan path does not switch parsers until the type declares `format: json`.
|
|
87
|
+
|
|
88
|
+
`idField` is the name of one property on the root object. The name is used whole, so a dot inside it stays part of the name. Each file must contain one JSON object and produces one node. The id is that property's string, including spaces and case, and is then checked with the type's existing `idPatterns`.
|
|
89
|
+
|
|
90
|
+
Invalid JSON, a root array or scalar, a missing id, a non-string id, or a blank string produces a diagnostic and no node. A string that fails `idPatterns` still produces the node, together with a diagnostic.
|
|
91
|
+
|
|
92
|
+
Relations stay in `relationSemantics`, using the existing `kind`, `fields`, `targetTypes`, and `label`. For JSON files, a dotted `fields` entry is a chain of own properties. `capability.capabilityRef` reads the root object's `capability`, then that object's `capabilityRef`. A missing property does not create an optional relation. If an intermediate value is not an object, or the final value is not a non-empty string or an array of non-empty strings, the diagnostic names the original file and the field. Valid array entries use the existing target resolver; a broken target remains a graph validation finding. An empty array creates no edge.
|
|
93
|
+
|
|
94
|
+
A dot only separates exact property names. `*`, filters, JSONPath, and expressions are not path syntax in this batch. Records inside an array stay in the original object. This batch reads the id and configured relations; it does not select a title or status, and it does not join, prefix, or rewrite ids. Markdown fields are still looked up as one literal string. Diagnostics use line 1 because this batch does not map JSON tokens to source lines.
|
|
95
|
+
|
|
96
|
+
A project can point a method at a capability and a release record at a method. The configuration below shows those two directions.
|
|
97
|
+
|
|
98
|
+
```yaml
|
|
99
|
+
types:
|
|
100
|
+
capability:
|
|
101
|
+
paths: ["capabilities/*.json"]
|
|
102
|
+
format: json
|
|
103
|
+
idField: capabilityId
|
|
104
|
+
method:
|
|
105
|
+
paths: ["methods/*.json"]
|
|
106
|
+
format: json
|
|
107
|
+
idField: methodId
|
|
108
|
+
skill_release:
|
|
109
|
+
paths: ["releases/*.json"]
|
|
110
|
+
format: json
|
|
111
|
+
idField: releaseId
|
|
112
|
+
idPatterns:
|
|
113
|
+
capability: "^CAP-[A-Z0-9-]+$"
|
|
114
|
+
method: "^METH-[A-Z0-9-]+$"
|
|
115
|
+
skill_release: "^REL-[A-Z0-9-]+$"
|
|
116
|
+
relationSemantics:
|
|
117
|
+
applies:
|
|
118
|
+
label: Method applies to capability
|
|
119
|
+
targetTypes: [capability]
|
|
120
|
+
fields: [capability.capabilityRef]
|
|
121
|
+
releases:
|
|
122
|
+
label: Release record points to method
|
|
123
|
+
targetTypes: [method]
|
|
124
|
+
fields: [methods]
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
A method file stores one capability id under nested properties. `capability.*` looks up a property named `*` and does not collect the neighboring properties.
|
|
128
|
+
|
|
129
|
+
```json
|
|
130
|
+
{
|
|
131
|
+
"methodId": "METH-1",
|
|
132
|
+
"capability": { "capabilityRef": "CAP-1" }
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
A release file stores several method ids in a string array. `method:METH-1` is resolved by the existing `type:id` parser.
|
|
137
|
+
|
|
138
|
+
```json
|
|
139
|
+
{
|
|
140
|
+
"releaseId": "REL-1",
|
|
141
|
+
"methods": ["METH-1", "method:METH-2"]
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
`scanArtifacts`, `validate`, and `version-lock` consume the same graph. The lock still hashes the original file bytes. Finding the configured nodes and relations shows that those files entered the graph. Domain review and publication facts need their own evidence.
|
|
146
|
+
|
|
81
147
|
### Daily commands
|
|
82
148
|
|
|
83
149
|
- Generate or inspect project artifact graph configuration with `artifact-graph init`.
|
|
84
150
|
- Validate artifact links with `artifact-graph validate`.
|
|
151
|
+
- Emit a reusable graph professional proof with `artifact-graph check-professional --root . --format json`.
|
|
152
|
+
Add `--conclusion-output <absolute-path>` only when a proof file is required; the command composes
|
|
153
|
+
existing `validate`, `version-lock audit`, and `coverage` checks and does not write graph cache.
|
|
154
|
+
- Read one graph proof with `artifact-graph read-proof --proof-root <root> --proof <relative> --format json`.
|
|
155
|
+
`GRAPH_CLEAR` with complete scope is `pass`; findings, incomplete checks, and recorded unavailability
|
|
156
|
+
are `not_pass`. A missing, damaged, foreign, or unknown-code file is `unavailable`. This is not the
|
|
157
|
+
Review Result Protocol.
|
|
85
158
|
- Validate Review Result Protocol v1.0 documents with `artifact-graph validate-review-result --file <path>`.
|
|
86
159
|
- Build implementation context with `artifact-graph context` or `artifact-graph packet`.
|
|
87
160
|
- Add `--view current|planned|history|all` to `query`, `context`, or `packet` when a project maps
|
|
@@ -94,6 +167,43 @@ index before `refresh --all`; there is no `version-lock update --all` operation.
|
|
|
94
167
|
relations (`artifactRelations`). Old 1.0 lock files without `artifactRelations` are treated as
|
|
95
168
|
having an empty relation list; run `refresh --all` once to establish the complete relation baseline.
|
|
96
169
|
- Install opt-in Git hooks with `artifact-graph hooks install-git --hook all`.
|
|
170
|
+
- Inspect and plan artifact restructuring with `artifact-graph restructure inspect` and
|
|
171
|
+
`artifact-graph restructure plan`. These two are read-only compilations of a mapping you supply.
|
|
172
|
+
|
|
173
|
+
### Restructuring Artifacts (Split, Move, Renumber)
|
|
174
|
+
|
|
175
|
+
`artifact-graph restructure` compiles an explicit restructuring mapping into a reviewable candidate
|
|
176
|
+
plan and then applies the file set as one operation. Three transformations are supported:
|
|
177
|
+
`record-split` (physically split records), `identity-split` (split one numbered identity into
|
|
178
|
+
several), and `move-renumber` (move records between files and renumber them). Deciding capability
|
|
179
|
+
boundaries and where each acceptance criterion goes stays outside the CLI; the compiler only turns
|
|
180
|
+
a complete mapping into a plan and applies it.
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
# pnpm
|
|
184
|
+
pnpm exec artifact-graph restructure inspect --root . --input request.json --format json
|
|
185
|
+
pnpm exec artifact-graph restructure plan --root . --input mapping.json --format json
|
|
186
|
+
pnpm exec artifact-graph restructure apply --root . --plan plan.json --confirm-cooperative-writers
|
|
187
|
+
|
|
188
|
+
# npm
|
|
189
|
+
npx artifact-graph restructure inspect --root . --input request.json --format json
|
|
190
|
+
npx artifact-graph restructure plan --root . --input mapping.json --format json
|
|
191
|
+
npx artifact-graph restructure apply --root . --plan plan.json --confirm-cooperative-writers
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
`plan` reports blockers, unresolved items, candidate issues and out-of-scope reference sites;
|
|
195
|
+
`applicable` is false while any blocker or unresolved item remains, and an inapplicable plan must not
|
|
196
|
+
be applied. Keep the plan document in an ordinary directory outside the write set — recovery depends
|
|
197
|
+
on that document, not on process state.
|
|
198
|
+
|
|
199
|
+
> **Adoption limits.** The file-set write capability has `candidate` maturity. The qualified
|
|
200
|
+
> environment is Darwin / arm64 / APFS only; other platforms are reported as unavailable rather than
|
|
201
|
+
> degraded to a non-transactional write. It assumes cooperative writers and does not prove that
|
|
202
|
+
> premise: `apply` and `prune-recovery` require `--confirm-cooperative-writers`, and refuse to write
|
|
203
|
+
> without it. Recovery requires `recover` with both `--confirm-all-participants-stopped` and
|
|
204
|
+
> `--confirm-exclusive-maintenance`. Recovery materials are retained by default; only an explicit
|
|
205
|
+
> `prune-recovery` removes them. No cross-platform transactional guarantee is offered. `inspect` and
|
|
206
|
+
> `plan` do not write to the project.
|
|
97
207
|
|
|
98
208
|
### Cleaning Up Orphan Locks After Deleting or Splitting Artifacts
|
|
99
209
|
|
|
@@ -113,6 +223,17 @@ git diff artifacts/traceability-version-lock.json
|
|
|
113
223
|
git add artifacts/traceability-version-lock.json
|
|
114
224
|
```
|
|
115
225
|
|
|
226
|
+
When only the edge produced by one renumbering should go, name it explicitly instead of sweeping
|
|
227
|
+
every orphan:
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
pnpm exec artifact-graph version-lock refresh --changed-only --worktree --remove-orphan-edge <edgeId>
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
`--remove-orphan-edge` is repeatable, applies only to edges that are still orphaned, and is mutually
|
|
234
|
+
exclusive with `--remove-orphans` — passing both is rejected. Naming an edge that is still live is
|
|
235
|
+
rejected without deleting anything, and pre-existing orphans in the same lock file are left intact.
|
|
236
|
+
|
|
116
237
|
`version-lock audit` marks structural orphan locks and stale hashes as blocking issues and prints
|
|
117
238
|
these same remediation steps. Runner liveness findings (a test file no longer active in any
|
|
118
239
|
configured runner) are warnings only and do not block.
|
package/README.zh-CN.md
CHANGED
|
@@ -2,14 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
[English](README.md)
|
|
4
4
|
|
|
5
|
-
`artifact-graph` 是一个 Git
|
|
5
|
+
`artifact-graph` 是一个 Git 原生的制品图扫描与校验工具,面向 AI 编程工作流。
|
|
6
|
+
默认解析 Markdown。自定义类型可以声明 `format: json`,把 JSON 原文件读进同一张图。
|
|
6
7
|
|
|
7
8
|
它把项目里的需求、场景、设计、源码、测试和 version-lock 元数据连成一张图,
|
|
8
9
|
供 AI agent 在宣称实现完成之前,用确定性的本地命令检查上下文和追溯关系。
|
|
9
10
|
|
|
10
11
|
<!-- release-skill:capability:external-write-boundary -->
|
|
11
12
|
> **外部写入边界:** 安装 `artifact-graph` 不会修改项目或写入远端。`--help`、`doctor`、
|
|
12
|
-
> `validate`、`query`
|
|
13
|
+
> `validate`、`query`、`audit`、不带 `--conclusion-output` 的 `check-professional` 以及
|
|
14
|
+
> `read-proof` 等只读命令不会更改项目文件。`--conclusion-output` 只在明确的绝对路径
|
|
15
|
+
> 排他创建一份证明,不会覆盖已有证明。只有显式执行 `init`、`scan`、
|
|
13
16
|
> `version-lock refresh` 或 `hooks install-git` 等命令时才会发生本地写入。
|
|
14
17
|
|
|
15
18
|
<!-- release-skill:capability:safe-first-command -->
|
|
@@ -21,7 +24,7 @@ pnpm exec artifact-graph --help
|
|
|
21
24
|
pnpm exec artifact-graph doctor --root .
|
|
22
25
|
```
|
|
23
26
|
|
|
24
|
-
如果任一只读命令失败,先确认当前 Node.js
|
|
27
|
+
如果任一只读命令失败,先确认当前 Node.js 满足 `>=22.22.2 <23`,再按照
|
|
25
28
|
[INSTALL.md](INSTALL.md) 中的精确说明重新安装;命令行工具能够正常解析且 doctor
|
|
26
29
|
给出可处理的诊断前,不要运行写入命令。
|
|
27
30
|
|
|
@@ -37,7 +40,7 @@ pnpm add -D artifact-graph
|
|
|
37
40
|
npm install --save-dev github:ifoohoo/artifact-graph
|
|
38
41
|
```
|
|
39
42
|
|
|
40
|
-
需要 Node.js `>=22.
|
|
43
|
+
需要 Node.js `>=22.22.2 <23`。pnpm 10+ 需要配置原生构建白名单,详见 [INSTALL.md](INSTALL.md)。
|
|
41
44
|
|
|
42
45
|
## 快速开始
|
|
43
46
|
|
|
@@ -75,10 +78,90 @@ Python 的 `#` 注释目前不受支持。
|
|
|
75
78
|
见 [代码追溯接入说明](INSTALL.md#code-traceability-and-coverage-boundaries)。先确认索引中确有预期节点和关系,
|
|
76
79
|
再运行 `refresh --all` 建立锁;不存在 `version-lock update --all` 操作。
|
|
77
80
|
|
|
81
|
+
### 自定义类型的 JSON 原文件
|
|
82
|
+
|
|
83
|
+
内置类型继续使用各自的专用解析。`format: json` 只写在项目自己注册的自定义类型上,同一项还要给出 `idField`。省略 `format` 时,文件仍按 Markdown 解析,扫描路径写成 `*.json` 也不改变这一规则。类型声明 `format: json` 之后,才按 JSON 读取。
|
|
84
|
+
|
|
85
|
+
`idField` 是根对象上的一个属性名。查找时使用这个完整名字,名字里的点号仍是名字的一部分。每个文件只接受一个 JSON 对象,并生成一个节点。编号取该属性中的字符串,空格和大小写按原文保留,再用该类型已有的 `idPatterns` 检查。
|
|
86
|
+
|
|
87
|
+
下面的输入会给出诊断,并且不生成节点:
|
|
88
|
+
|
|
89
|
+
- JSON 文本无法解析;
|
|
90
|
+
- 根值是数组、字符串、数字、布尔值或 `null`;
|
|
91
|
+
- 编号属性不存在,或者值不是非空字符串。
|
|
92
|
+
|
|
93
|
+
编号字符串存在,但不符合 `idPatterns` 时,节点仍然保留,同时报出诊断。
|
|
94
|
+
|
|
95
|
+
关系继续写在 `relationSemantics` 里,沿用原来的 `kind`、`fields`、`targetTypes` 和 `label`。
|
|
96
|
+
JSON 文件把 `fields` 中的点分字符串当成逐层属性名。
|
|
97
|
+
以 `capability.capabilityRef` 为例,解析先读根对象自己的 `capability`,再读下一层对象自己的 `capabilityRef`。
|
|
98
|
+
|
|
99
|
+
某一层没有这个属性时,这条可选关系不进入图。中间值不是对象,或者末端不是非空字符串,也不是非空字符串数组时,诊断写明原文件路径和字段名。数组中的每个合法字符串交给现有目标解析。对不上现有节点的引用,仍由原来的图校验报告。空数组不生成边。
|
|
100
|
+
|
|
101
|
+
点号只切开固定的属性名。`*`、筛选条件和 JSONPath 都不是路径语法;名为 `*` 的属性只按这个名字查找。数组里的记录留在原对象中。这一批读取编号,以及 `relationSemantics` 里已经声明的关系。标题、状态、编号拼接、前缀和改写都不在读取范围内。Markdown 字段仍按整个字符串查找,嵌套对象不会被点号拆开。诊断带原文件路径和字段名,行号记为 1。
|
|
102
|
+
|
|
103
|
+
项目可以把方法指向能力,把发行记录指向方法。下面的配置只示范这两个方向。
|
|
104
|
+
|
|
105
|
+
```yaml
|
|
106
|
+
types:
|
|
107
|
+
capability:
|
|
108
|
+
paths: ["capabilities/*.json"]
|
|
109
|
+
format: json
|
|
110
|
+
idField: capabilityId
|
|
111
|
+
method:
|
|
112
|
+
paths: ["methods/*.json"]
|
|
113
|
+
format: json
|
|
114
|
+
idField: methodId
|
|
115
|
+
skill_release:
|
|
116
|
+
paths: ["releases/*.json"]
|
|
117
|
+
format: json
|
|
118
|
+
idField: releaseId
|
|
119
|
+
idPatterns:
|
|
120
|
+
capability: "^CAP-[A-Z0-9-]+$"
|
|
121
|
+
method: "^METH-[A-Z0-9-]+$"
|
|
122
|
+
skill_release: "^REL-[A-Z0-9-]+$"
|
|
123
|
+
relationSemantics:
|
|
124
|
+
applies:
|
|
125
|
+
label: 方法适用的能力
|
|
126
|
+
targetTypes: [capability]
|
|
127
|
+
fields: [capability.capabilityRef]
|
|
128
|
+
releases:
|
|
129
|
+
label: 发行记录对应的方法
|
|
130
|
+
targetTypes: [method]
|
|
131
|
+
fields: [methods]
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
方法文件把一个能力编号放在嵌套属性里。
|
|
135
|
+
|
|
136
|
+
```json
|
|
137
|
+
{
|
|
138
|
+
"methodId": "METH-1",
|
|
139
|
+
"capability": { "capabilityRef": "CAP-1" }
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
发行文件用字符串数组保存多个方法编号。`method:METH-1` 交给现有的 `type:id` 解析。
|
|
144
|
+
|
|
145
|
+
```json
|
|
146
|
+
{
|
|
147
|
+
"releaseId": "REL-1",
|
|
148
|
+
"methods": ["METH-1", "method:METH-2"]
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
`scanArtifacts`、`validate` 和 `version-lock` 消费同一张图,锁按原文件字节计算。读到节点和已配置关系,只说明这些原文件进入了图。领域审核和发布事实需要各自的证据。
|
|
153
|
+
|
|
78
154
|
### 日常命令
|
|
79
155
|
|
|
80
156
|
- 用 `artifact-graph init` 生成或检查项目制品图配置。
|
|
81
157
|
- 用 `artifact-graph validate` 校验制品之间的链接。
|
|
158
|
+
- 用 `artifact-graph check-professional --root . --format json` 生成可复用的图专业证明。
|
|
159
|
+
只有需要证明文件时才加 `--conclusion-output <绝对路径>`;该命令组合已有的
|
|
160
|
+
`validate`、`version-lock audit` 和 `coverage`,不写图缓存。
|
|
161
|
+
- 用 `artifact-graph read-proof --proof-root <root> --proof <相对路径> --format json`
|
|
162
|
+
阅读本族证明。`GRAPH_CLEAR` 且范围 complete 为 `pass`;发现问题、检查未完成或证明记载
|
|
163
|
+
未能检查为 `not_pass`。缺文件、损坏、非本族或未知领域码为 `unavailable`。这与
|
|
164
|
+
Review Result Protocol 不是同一合同。
|
|
82
165
|
- 用 `artifact-graph validate-review-result --file <path>` 校验 Review Result Protocol v1.0 文档。
|
|
83
166
|
- 用 `artifact-graph context` 或 `artifact-graph packet` 构建实现上下文。
|
|
84
167
|
- 项目通过 `statusViews` 映射状态后,可在 `query`、`context` 或 `packet` 上增加
|
|
@@ -90,6 +173,38 @@ Python 的 `#` 注释目前不受支持。
|
|
|
90
173
|
- 版本锁覆盖实现/验证边(`locks`)和制品间关系(`artifactRelations`)。旧版 1.0 锁文件缺少
|
|
91
174
|
`artifactRelations` 时视为空数组;首次启用时执行一次 `refresh --all` 建立完整关系基线。
|
|
92
175
|
- 用 `artifact-graph hooks install-git --hook all` 安装可选 Git hooks。
|
|
176
|
+
- 用 `artifact-graph restructure inspect` 和 `artifact-graph restructure plan` 检查与规划制品重组:
|
|
177
|
+
这两步只读取入并确定性地编译已经给出的映射,不写项目。
|
|
178
|
+
|
|
179
|
+
### 制品重组(拆分、跨文件移动与重编号)
|
|
180
|
+
|
|
181
|
+
`artifact-graph restructure` 把一份显式重组映射编译成可复核的候选计划,再以一次文件集合操作
|
|
182
|
+
应用。支持三类变换:`record-split`(记录物理拆分)、`identity-split`(编号身份拆分)与
|
|
183
|
+
`move-renumber`(跨文件移动与重编号)。能力边界、共同约束与每项验收标准的去向不由 CLI 决定;
|
|
184
|
+
编译器只把一份完整映射编译成计划并应用。
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
# pnpm
|
|
188
|
+
pnpm exec artifact-graph restructure inspect --root . --input request.json --format json
|
|
189
|
+
pnpm exec artifact-graph restructure plan --root . --input mapping.json --format json
|
|
190
|
+
pnpm exec artifact-graph restructure apply --root . --plan plan.json --confirm-cooperative-writers
|
|
191
|
+
|
|
192
|
+
# npm
|
|
193
|
+
npx artifact-graph restructure inspect --root . --input request.json --format json
|
|
194
|
+
npx artifact-graph restructure plan --root . --input mapping.json --format json
|
|
195
|
+
npx artifact-graph restructure apply --root . --plan plan.json --confirm-cooperative-writers
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
`plan` 输出阻断项、未解决项、候选内部问题与写集外的引用出现位置;只要存在阻断项或未解决项,
|
|
199
|
+
`applicable` 就不为真,不可应用的计划不得进入 `apply`。计划文档要保存到写集之外的普通目录:
|
|
200
|
+
恢复只依赖该文档,不依赖进程状态。
|
|
201
|
+
|
|
202
|
+
> **采用边界。** 文件集合写入能力的成熟度为 `candidate`。资格环境仅为 Darwin / arm64 / APFS;
|
|
203
|
+
> 其他平台返回不可用,不会降级成无事务写入。该能力以合作式写者为前提,且不自证该前提:
|
|
204
|
+
> `apply` 与 `prune-recovery` 必须给出 `--confirm-cooperative-writers`,缺失即拒绝写入;
|
|
205
|
+
> 恢复必须用 `recover` 并同时给出 `--confirm-all-participants-stopped` 与
|
|
206
|
+
> `--confirm-exclusive-maintenance`。恢复材料默认保留,只有显式 `prune-recovery` 才清理。
|
|
207
|
+
> 不承诺全平台事务保证。`inspect` 与 `plan` 不写项目。
|
|
93
208
|
|
|
94
209
|
### 制品删除或拆分后的孤立锁清理
|
|
95
210
|
|
|
@@ -108,6 +223,15 @@ git diff artifacts/traceability-version-lock.json
|
|
|
108
223
|
git add artifacts/traceability-version-lock.json
|
|
109
224
|
```
|
|
110
225
|
|
|
226
|
+
只清理一次改号产生的那条边时,点名它,不要整体清扫:
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
pnpm exec artifact-graph version-lock refresh --changed-only --worktree --remove-orphan-edge <edgeId>
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
`--remove-orphan-edge` 可重复指定,只对当前仍是孤儿的边生效,并与 `--remove-orphans` 互斥
|
|
233
|
+
(同时给出即被拒绝)。点名仍是活边的边会被拒绝且不删除;同一锁文件里既有的孤立锁保持不变。
|
|
234
|
+
|
|
111
235
|
`version-lock audit` 会把结构性孤立锁和陈旧哈希标记为阻断问题,并输出上述解决步骤;
|
|
112
236
|
runner liveness 发现(测试文件不再处于任何已配置 runner 的激活范围)只是警告,不会阻断。
|
|
113
237
|
|