artifact-graph 1.1.0 → 1.2.1

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,18 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 1.2.1
6
+
7
+ ### Changed
8
+
9
+ - Released in lockstep with artifact-chain-assistant 1.2.1 to connect the standalone GitHub Pages documentation site (`https://ifoohoo.github.io/artifact-chain-assistant-site/`) and explicit package documentation entry links. Graph runtime, CLI, API, and contract semantics are unchanged from 1.1.0.
10
+
11
+ ## 1.2.0
12
+
13
+ ### Changed
14
+
15
+ - Released in lockstep with artifact-chain-assistant 1.2.0 for its default testing handoff, selectable artifact methods, and requirement-pool workflow. Graph runtime, CLI, API, and contract semantics are unchanged from 1.1.0.
16
+
5
17
  ## 1.1.0
6
18
 
7
19
  ### Changed
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # artifact-graph
2
2
 
3
- [中文](README.zh-CN.md)
3
+ [中文](README.zh-CN.md) · **Online Documentation (GitHub Pages):** [https://ifoohoo.github.io/artifact-chain-assistant-site/](https://ifoohoo.github.io/artifact-chain-assistant-site/)
4
4
 
5
5
  Git-native artifact graph scanner and validator for agentic coding workflows.
6
6
  Markdown stays the default parser. A custom type may set `format: json` and bring that original file into the same graph.
@@ -11,11 +11,12 @@ agent claims implementation work is complete.
11
11
 
12
12
  <!-- release-skill:capability:external-write-boundary -->
13
13
  > **External-write boundary:** Installing `artifact-graph` does not modify a project or write to
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
18
- > `hooks install-git` write locally only when explicitly invoked.
14
+ > remote systems. Read-only commands such as `--help`, `doctor`, `validate`, `query`, `inbox list`,
15
+ > `inbox match`, `audit`, `check-professional` (without `--conclusion-output`), and `read-proof` do
16
+ > not change project files. `--conclusion-output` creates one new proof file at an explicit absolute
17
+ > path and never overwrites an existing proof. Commands including `init`, `scan`, `inbox add`,
18
+ > `version-lock refresh`, `hooks install-git`, and `hooks uninstall` write locally only when
19
+ > explicitly invoked.
19
20
 
20
21
  <!-- release-skill:capability:safe-first-command -->
21
22
  > **Safe first command:** Inspect the installed CLI and project health before authorizing any
@@ -64,6 +65,16 @@ npx artifact-graph version-lock audit --root . --strict-missing-lock
64
65
  > Use `version-lock refresh --all` for the initial lock. The `--changed-only --staged` variant is for
65
66
  > pre-commit hooks on existing projects — not for first-time initialization.
66
67
 
68
+ When capturing an unattached cross-project idea before choosing a repository or initializing configuration, use the zero-config workspace inbox:
69
+
70
+ ```bash
71
+ npx artifact-graph inbox add "Bind review results to target file digests" --context "async review"
72
+ npx artifact-graph inbox list
73
+ npx artifact-graph inbox match "review target digests"
74
+ ```
75
+
76
+ Ideas are recorded in `.artifact-inbox/ideas.jsonl` with `status: "captured"`, surface lexically related stories/requirements across the workspace, and never trigger project scaffolding automatically.
77
+
67
78
  ## Common Workflows
68
79
 
69
80
  ### Code traceability starts with scan scope
@@ -178,18 +189,19 @@ A release file stores several method ids in a string array. `method:METH-1` is r
178
189
  `GRAPH_CLEAR` with complete scope is `pass`; findings, incomplete checks, and recorded unavailability
179
190
  are `not_pass`. A missing, damaged, foreign, or unknown-code file is `unavailable`. This is not the
180
191
  Review Result Protocol.
181
- - Validate Review Result Protocol v1.0 documents with `artifact-graph validate-review-result --file <path>`.
192
+ - Validate Review Result Protocol v1.0 documents with `artifact-graph validate-review-result --file <path>` (add `--verify-target-digests` and optional `--targets <p1,p2>` to verify target SHA-256 digests and prevent stale or cross-wired reviews).
182
193
  - Build implementation context with `artifact-graph context` or `artifact-graph packet`.
183
194
  - Add `--view current|planned|history|all` to `query`, `context`, or `packet` when a project maps
184
195
  statuses through `statusViews`. The default stays compatible with the unfiltered graph.
185
196
  - Inspect change impact without refreshing locks with `artifact-graph impact --worktree`.
186
197
  - Report graph health, scan mapping, and the limits of behavior/release evidence with
187
198
  `artifact-graph coverage`. The command does not infer successful verification or publication.
188
- - Keep traceability freshness with `artifact-graph version-lock refresh` and `audit`.
199
+ - Keep traceability freshness with `artifact-graph version-lock refresh` and `audit`. Tagged `.ts`/`.tsx`/`.js`/`.jsx`/`.mjs`/`.cjs`/`.py` test files must contain real test cases or assertions; comment-only empty shells are rejected.
200
+ - Audit intra-repo `implementationSurface` entry claims (`entryGlobs`, `excludeGlobs`, `requireCodeLocks`) and cross-repo bidirectional allocations (`artifacts/portfolio-allocations.json` / `artifacts/upstream-bindings.json`) with `artifact-graph alignment-audit [--root .] [--strict] [--format json|markdown]`. Portfolio `computedSatisfaction` strictly separates static double-lock readiness (`traceability_locked`, fresh `implements` + `verifies` locks scoped to each allocation's `targetUid` downstream lineage) from execution-backed completion (`verified_satisfied`, requiring real passing execution receipts or a valid `readonlyTarget` audit receipt), and supports retired targets marked `allocationStatus: "absorbed"` with an `absorbedBy` carrier. Synchronize mutual digests explicitly with `artifact-graph alignment-lock`.
189
201
  - Version lock covers both implementation/verification edges (`locks`) and artifact-to-artifact
190
202
  relations (`artifactRelations`). Old 1.0 lock files without `artifactRelations` are treated as
191
203
  having an empty relation list; run `refresh --all` once to establish the complete relation baseline.
192
- - Install opt-in Git hooks with `artifact-graph hooks install-git --hook all`.
204
+ - Install opt-in Git hooks with `artifact-graph hooks install-git --hook all`, and remove managed hook blocks idempotently with `artifact-graph hooks uninstall --hook all` while preserving custom user hook lines.
193
205
  - Inspect and plan artifact restructuring with `artifact-graph restructure inspect` and
194
206
  `artifact-graph restructure plan`. These two are read-only compilations of a mapping you supply.
195
207
 
@@ -279,6 +291,7 @@ independence.
279
291
 
280
292
  ## Documentation
281
293
 
294
+ - [Online Knowledge Site (GitHub Pages)](https://ifoohoo.github.io/artifact-chain-assistant-site/) — overview, 10-minute quickstart, alignment model, workflows, CLI reference, and troubleshooting
282
295
  - [INSTALL.md](INSTALL.md) — detailed installation and pnpm 10+ setup guide
283
296
  - [CHANGELOG.md](CHANGELOG.md) — release history
284
297
  - [CONTRIBUTING.md](CONTRIBUTING.md) — contribution guidelines
package/README.zh-CN.md CHANGED
@@ -1,32 +1,23 @@
1
1
  # artifact-graph
2
2
 
3
- [English](README.md)
3
+ [English](README.md) · **在线文档站(GitHub Pages):** [https://ifoohoo.github.io/artifact-chain-assistant-site/](https://ifoohoo.github.io/artifact-chain-assistant-site/)
4
4
 
5
- `artifact-graph` 是一个 Git 原生的制品图扫描与校验工具,面向 AI 编程工作流。
6
- 默认解析 Markdown。自定义类型可以声明 `format: json`,把 JSON 原文件读进同一张图。
5
+ `artifact-graph` 是面向 AI 编程与协作研发流程的 Git 原生制品图扫描、关系校验与版本锁工具。它把项目中的需求、场景、设计说明、源码、测试和追溯版本锁连接成一张可验证的图,让智能体或开发者在宣布“功能已完成”之前,先用确定性的本地命令核清上下文、影响面与证据边界。
7
6
 
8
- 它把项目里的需求、场景、设计、源码、测试和 version-lock 元数据连成一张图,
9
- 供 AI agent 在宣称实现完成之前,用确定性的本地命令检查上下文和追溯关系。
7
+ 默认解析 Markdown 制品;项目注册自定义类型时也可声明 `format: json` 与 `idField`,将原始 JSON 文件直接纳入同一张图。对于尚未确定归属仓库的早期点子,还提供零配置的跨项目轻量收件箱(`artifact-graph inbox`)。
10
8
 
11
9
  <!-- release-skill:capability:external-write-boundary -->
12
- > **外部写入边界:** 安装 `artifact-graph` 不会修改项目或写入远端。`--help`、`doctor`、
13
- > `validate`、`query`、`audit`、不带 `--conclusion-output` 的 `check-professional` 以及
14
- > `read-proof` 等只读命令不会更改项目文件。`--conclusion-output` 只在明确的绝对路径
15
- > 排他创建一份证明,不会覆盖已有证明。只有显式执行 `init`、`scan`、
16
- > `version-lock refresh` 或 `hooks install-git` 等命令时才会发生本地写入。
10
+ > **外部写入边界:** 安装 `artifact-graph` 不会修改目标项目,也不会向任何远端系统写入数据。`--help`、`doctor`、`validate`、`query`、`impact`、`coverage`、`inbox list`、`inbox match`、`version-lock audit`、不带 `--conclusion-output` 的 `check-professional` 以及 `read-proof` 均为纯只读命令。`--conclusion-output` 仅在显式指定的绝对路径排他创建一份新证明文件,绝不覆盖已有文件。只有显式执行 `init`、`scan`、`inbox add`、`version-lock refresh`、`hooks install-git` 或 `hooks uninstall` 等命令时,才会在本地受控路径写入文件。
17
11
 
18
12
  <!-- release-skill:capability:safe-first-command -->
19
- > **安全的第一步:** 在授权初始化、刷新版本锁或安装 hook 前,先检查已安装的命令行工具
20
- > 和项目健康状态。
13
+ > **安全的第一步:** 在授权初始化配置、刷新版本锁或安装 Git Hook 之前,先运行以下只读命令确认 CLI 与运行环境正常。
21
14
 
22
15
  ```bash
23
16
  pnpm exec artifact-graph --help
24
17
  pnpm exec artifact-graph doctor --root .
25
18
  ```
26
19
 
27
- 如果任一只读命令失败,先确认当前 Node.js 满足 `>=22.22.2 <23`,再按照
28
- [INSTALL.md](INSTALL.md) 中的精确说明重新安装;命令行工具能够正常解析且 doctor
29
- 给出可处理的诊断前,不要运行写入命令。
20
+ 若任一只读命令失败,请先确认当前 Node.js 版本满足 `>=22.22.2 <23`,再按 [INSTALL.md](INSTALL.md) 的说明重新安装。在 CLI 能够正常解析且 `doctor` 给出明确诊断前,不要执行任何写入命令。
30
21
 
31
22
  ## 安装
32
23
 
@@ -34,16 +25,30 @@ pnpm exec artifact-graph doctor --root .
34
25
  pnpm add -D artifact-graph
35
26
  ```
36
27
 
37
- 或从 GitHub 安装:
28
+ 或直接从 GitHub 安装:
38
29
 
39
30
  ```bash
40
31
  npm install --save-dev github:ifoohoo/artifact-graph
41
32
  ```
42
33
 
43
- 需要 Node.js `>=22.22.2 <23`。pnpm 10+ 需要配置原生构建白名单,详见 [INSTALL.md](INSTALL.md)。
34
+ 运行环境要求 Node.js `>=22.22.2 <23`。使用 pnpm 10+ 时需放行原生模块构建白名单(`better-sqlite3`),配置方式见 [INSTALL.md](INSTALL.md)。
44
35
 
45
36
  ## 快速开始
46
37
 
38
+ ### 场景 A:想法尚未选定具体仓库(跨项目轻量收件箱)
39
+
40
+ 当只有一个原始想法、还不打算初始化完整项目配置时,可直接写入工作区收件箱并自动检索近似历史想法、用户故事或需求条目:
41
+
42
+ ```bash
43
+ npx artifact-graph inbox add "支持审阅结果绑定目标文件哈希,防止串单" --context "跨会话异步复审"
44
+ npx artifact-graph inbox list
45
+ npx artifact-graph inbox match "审阅结果防串单"
46
+ ```
47
+
48
+ 该流程默认写入 `.artifact-inbox/ideas.jsonl`(状态固定为 `captured`),不会生成 `artifact-graph.config.yaml`,也不会触发任何脚手架或开发动作。
49
+
50
+ ### 场景 B:在目标仓库建立制品链与版本锁
51
+
47
52
  ```bash
48
53
  # pnpm
49
54
  pnpm exec artifact-graph init --root .
@@ -58,65 +63,38 @@ npx artifact-graph version-lock refresh --all --format markdown
58
63
  npx artifact-graph version-lock audit --root . --strict-missing-lock
59
64
  ```
60
65
 
61
- > 首次初始化版本锁使用 `version-lock refresh --all`。`--changed-only --staged` 适用于
62
- > 已有项目的 pre-commit hook,不适用于首次初始化。
63
-
64
- ## 常见工作流
66
+ > 首次建立版本锁基线请使用 `version-lock refresh --all`。`--changed-only --staged` 仅用于已有基线项目的 `pre-commit` 增量刷新,不用于首次建锁。
65
67
 
66
- ### 代码与制品追溯:先确认扫描范围
68
+ ## 核心工作流与边界
67
69
 
68
- 源码可用独占一行的 `// @feature A1` 声明实现关系;技能 Markdown 可用
69
- `<!-- @feature A1 -->`。`A1` 是制品 ID,命令行的 `feature:A1` 写法不能直接放在注释值中。
70
- 文件必须纳入 `types.test.paths`;该字段也用于实现文件,默认不会扫描所有 `src/` 或 `skills/`。
71
- Python 的 `#` 注释目前不受支持。
70
+ ### 1. 代码追溯与扫描范围
72
71
 
73
- > `version-lock audit --strict-missing-lock` 只检查已发现关系的锁与新鲜度。
74
- > 没有注释的文件、没有关系的制品可能不产生缺锁问题;零锁也可能审计通过。
75
- > 它不能证明“每个发布文件都有制品来源、每个制品都有实现或豁免”。
72
+ 源码通过独占一行的 `// @feature A1` 注释声明实现或验证关系,技能 Markdown 使用 `<!-- @feature A1 -->`(填写制品 ID `A1`,不要写成命令行选择器 `feature:A1`;暂不支持 Python `#` 注释)。承载追溯注释的源码、测试与技能文件必须纳入 `types.test.paths`,默认配置不会全盘扫描所有 `src/` 或 `skills/` 目录。
76
73
 
77
- 详细语法、扫描配置、`implements`(实现)与 `verifies`(验证)的分类、豁免边界及多项目隔离,
78
- 见 [代码追溯接入说明](INSTALL.md#code-traceability-and-coverage-boundaries)。先确认索引中确有预期节点和关系,
79
- 再运行 `refresh --all` 建立锁;不存在 `version-lock update --all` 操作。
74
+ > `version-lock audit --strict-missing-lock` 检查的是**已被扫描发现的关系**是否建锁且哈希新鲜。未加注释的源文件或未声明关系的制品不会触发缺锁报错,因此即使锁条目为零也可能通过审计——它不能单独证明“所有发布文件均已覆盖”。完整语法、边分类与多项目隔离规则见 [代码追溯接入说明](INSTALL.md#code-traceability-and-coverage-boundaries)。
80
75
 
81
- ### 公开清单与采用边界
76
+ ### 2. 公开项目类型清单与采用权归属
82
77
 
83
- 包提供静态 JSON 清单,公开子路径是 `artifact-graph/project-artifact-profiles`,配套 Schema 是 `artifact-graph/schemas/project-artifact-profiles.schema.json`。字段 `schema_version` 的值是 `1.0`。该入口从 0.15.0 版本开始提供。
78
+ 自 `0.15.0` 起,包内通过子路径 `artifact-graph/project-artifact-profiles` 导出静态推荐清单(配套 Schema 为 `artifact-graph/schemas/project-artifact-profiles.schema.json`,`schema_version` 为 `"1.0"`):
84
79
 
85
80
  ```js
86
81
  const profiles = require('artifact-graph/project-artifact-profiles');
87
82
  ```
88
83
 
89
- `common_minimum` 恰好三项:`feature`、`scenario`、`design`。`project_standards` 目前只有 `skill-plugin`:它 `extends` `common_minimum`,再加 `agent_skill`、`e2e_test`。
90
-
91
- `lifecycle` 与 `conditional` 是采用阶段和能力条件。阶段项和能力项只是候选。读到这份 JSON 不会启用项目类型。
92
-
93
- 目标项目的 `artifact-graph.config.yaml` 拥有采用权。配置或既有方法绑定里已经声明的类型都要保留,包括清单里没有的追加类型。
94
-
95
- `loadConfig`(配置加载入口)与 `artifact-graph doctor` 会检查已声明字段的结构与类型。`statuses` 应为字符串数组;写成字符串时按字段路径报错。未知顶层键会保留兼容,并给出可定位提示,不一律拒绝。已有配置文件必须写出 `allowedEdges`。写成 `[]`、`null` 或 YAML 空值时,采用内置 `DEFAULT_SCHEMA.allowedEdges`。非空清单完全替换默认表,按 from/to/kind 严格匹配;清单外关系报 `DISALLOWED_EDGE`。`forbiddenEdges` 仍优先报告 `FORBIDDEN_EDGE`。没有配置文件时保持未接入,不会伪装成有效项目。`extraFields` 仍是可选索引字段。本轮也尚未用 `contract validate` 校验 Markdown 正文合同。
96
-
97
- ### 自定义类型的 JSON 原文件
98
-
99
- 内置类型继续使用各自的专用解析。`format: json` 只写在项目自己注册的自定义类型上,同一项还要给出 `idField`。省略 `format` 时,文件仍按 Markdown 解析,扫描路径写成 `*.json` 也不改变这一规则。类型声明 `format: json` 之后,才按 JSON 读取。
100
-
101
- `idField` 是根对象上的一个属性名。查找时使用这个完整名字,名字里的点号仍是名字的一部分。每个文件只接受一个 JSON 对象,并生成一个节点。编号取该属性中的字符串,空格和大小写按原文保留,再用该类型已有的 `idPatterns` 检查。
102
-
103
- 下面的输入会给出诊断,并且不生成节点:
84
+ - `common_minimum` 包含三项跨项目最小类型:`feature`、`scenario`、`design`。
85
+ - `project_standards` 当前批准的独立标准为 `skill-plugin`,在 `common_minimum` 基础上增加 `agent_skill` 与 `e2e_test`。
86
+ - `lifecycle` 与 `conditional` 仅描述不同采用阶段和能力条件下的候选类型;读取这份 JSON 不会自动启用任何类型。
104
87
 
105
- - JSON 文本无法解析;
106
- - 根值是数组、字符串、数字、布尔值或 `null`;
107
- - 编号属性不存在,或者值不是非空字符串。
88
+ **采用权始终归目标项目的 `artifact-graph.config.yaml` 所有**:项目已声明的类型与方法绑定(含未出现在公开清单中的自定义类型)均原样保留。`loadConfig` 与 `artifact-graph doctor` 会校验配置结构:未知顶层键产生可定位的兼容性警告而不粗暴拒绝;`allowedEdges` 为空数组 `[]`、`null` 或空值时沿用内置 `DEFAULT_SCHEMA.allowedEdges`,一旦写成非空数组即作为严格的 `from/to/kind` 白名单替换默认表(表外关系报 `DISALLOWED_EDGE`,`forbiddenEdges` 仍优先报 `FORBIDDEN_EDGE`)。缺失配置文件的目录保持“未接入”状态。
108
89
 
109
- 编号字符串存在,但不符合 `idPatterns` 时,节点仍然保留,同时报出诊断。
90
+ ### 3. 自定义类型的 JSON 原文件接入
110
91
 
111
- 关系继续写在 `relationSemantics` 里,沿用原来的 `kind`、`fields`、`targetTypes` 和 `label`。
112
- JSON 文件把 `fields` 中的点分字符串当成逐层属性名。
113
- 以 `capability.capabilityRef` 为例,解析先读根对象自己的 `capability`,再读下一层对象自己的 `capabilityRef`。
92
+ 内置类型使用专用解析器;项目自定义的制品类型若需直接纳管 JSON 原文件,须同时声明 `format: json` 与根对象主键属性名 `idField`(未声明 `format: json` 时,即使路径匹配 `*.json` 仍按 Markdown 解析):
114
93
 
115
- 某一层没有这个属性时,这条可选关系不进入图。中间值不是对象,或者末端不是非空字符串,也不是非空字符串数组时,诊断写明原文件路径和字段名。数组中的每个合法字符串交给现有目标解析。对不上现有节点的引用,仍由原来的图校验报告。空数组不生成边。
94
+ - 每个 JSON 文件须包含单个根对象并映射为一个图节点,`idField` 按完整属性名读取(不按点号拆分),读取后再按 `idPatterns` 校验。JSON 语法错误、根值为数组/标量或编号字段缺失/为空字符串时输出诊断且不生成节点;编号不符合 `idPatterns` 时保留节点并附带诊断。
95
+ - 关系字段仍在 `relationSemantics` 中配置。在 JSON 原文件里,`fields` 中的点号表示逐层属性访问(如 `capability.capabilityRef` 依次读取根对象的 `capability` 与子对象的 `capabilityRef`;不支持 `*` 通配或 JSONPath 表达式)。属性缺失时不创建可选边;中间层级非对象或末端值既非非空字符串也非非空字符串数组时,诊断会指出具体文件与字段路径。
116
96
 
117
- 点号只切开固定的属性名。`*`、筛选条件和 JSONPath 都不是路径语法;名为 `*` 的属性只按这个名字查找。数组里的记录留在原对象中。这一批读取编号,以及 `relationSemantics` 里已经声明的关系。标题、状态、编号拼接、前缀和改写都不在读取范围内。Markdown 字段仍按整个字符串查找,嵌套对象不会被点号拆开。诊断带原文件路径和字段名,行号记为 1。
118
-
119
- 项目可以把方法指向能力,把发行记录指向方法。下面的配置只示范这两个方向。非空 `allowedEdges` 会完全替换内置默认表,所以这两条项目关系必须写进清单;只写 `[]` 不能授权这些自定义类型。
97
+ 示例配置(注意非空 `allowedEdges` 会替换默认表,须显式列出自定义边):
120
98
 
121
99
  ```yaml
122
100
  types:
@@ -150,7 +128,7 @@ allowedEdges:
150
128
  - { from: skill_release, to: method, kind: releases }
151
129
  ```
152
130
 
153
- 方法文件把一个能力编号放在嵌套属性里。
131
+ 对应的方法文件与发行记录文件示例:
154
132
 
155
133
  ```json
156
134
  {
@@ -159,8 +137,6 @@ allowedEdges:
159
137
  }
160
138
  ```
161
139
 
162
- 发行文件用字符串数组保存多个方法编号。`method:METH-1` 交给现有的 `type:id` 解析。
163
-
164
140
  ```json
165
141
  {
166
142
  "releaseId": "REL-1",
@@ -168,115 +144,68 @@ allowedEdges:
168
144
  }
169
145
  ```
170
146
 
171
- `scanArtifacts`、`validate` 和 `version-lock` 消费同一张图,锁按原文件字节计算。读到节点和已配置关系,只说明这些原文件进入了图。领域审核和发布事实需要各自的证据。
172
-
173
- ### 日常命令
174
-
175
- - 用 `artifact-graph init` 生成或检查项目制品图配置。
176
- - 用 `artifact-graph validate` 校验制品之间的链接。
177
- - 用 `artifact-graph check-professional --root . --format json` 生成可复用的图专业证明。
178
- 只有需要证明文件时才加 `--conclusion-output <绝对路径>`;该命令组合已有的
179
- `validate`、`version-lock audit` 和 `coverage`,不写图缓存。
180
- - 用 `artifact-graph read-proof --proof-root <root> --proof <相对路径> --format json`
181
- 阅读本族证明。`GRAPH_CLEAR` 且范围 complete 为 `pass`;发现问题、检查未完成或证明记载
182
- 未能检查为 `not_pass`。缺文件、损坏、非本族或未知领域码为 `unavailable`。这与
183
- Review Result Protocol 不是同一合同。
184
- - 用 `artifact-graph validate-review-result --file <path>` 校验 Review Result Protocol v1.0 文档。
185
- - 用 `artifact-graph context` 或 `artifact-graph packet` 构建实现上下文。
186
- - 项目通过 `statusViews` 映射状态后,可在 `query`、`context` 或 `packet` 上增加
187
- `--view current|planned|history|all`;不传参数时仍返回兼容旧版的未过滤图。
188
- - 用 `artifact-graph impact --worktree` 只读查看变更影响,不刷新版本锁。
189
- - 用 `artifact-graph coverage` 报告图健康、扫描映射以及行为与发布证据的评估边界;
190
- 该命令不推断验证成功或已经发布。
191
- - 用 `artifact-graph version-lock refresh` 和 `audit` 保持追溯关系及时更新。
192
- - 版本锁覆盖实现/验证边(`locks`)和制品间关系(`artifactRelations`)。旧版 1.0 锁文件缺少
193
- `artifactRelations` 时视为空数组;首次启用时执行一次 `refresh --all` 建立完整关系基线。
194
- - 用 `artifact-graph hooks install-git --hook all` 安装可选 Git hooks。
195
- - 用 `artifact-graph restructure inspect` 和 `artifact-graph restructure plan` 检查与规划制品重组:
196
- 这两步只读取入并确定性地编译已经给出的映射,不写项目。
197
-
198
- ### 制品重组(拆分、跨文件移动与重编号)
199
-
200
- `artifact-graph restructure` 把一份显式重组映射编译成可复核的候选计划,再以一次文件集合操作
201
- 应用。支持三类变换:`record-split`(记录物理拆分)、`identity-split`(编号身份拆分)与
202
- `move-renumber`(跨文件移动与重编号)。能力边界、共同约束与每项验收标准的去向不由 CLI 决定;
203
- 编译器只把一份完整映射编译成计划并应用。
147
+ `scanArtifacts`、`validate` 与 `version-lock` 消费同一张图并按原文件字节计算哈希。文件进入图只代表声明关系成立,领域评审与真实发布仍须提供各自的执行证据。
148
+
149
+ ### 4. 日常高频命令速查
150
+
151
+ - **配置与链接校验**:`artifact-graph init` 生成配置骨架;`artifact-graph validate` 检查断链与非法边。
152
+ - **可复用的图专业证明**:`artifact-graph check-professional --root . --format json` 只读组合 `validate`、`version-lock audit` 与 `coverage`,不写图缓存;传入 `--conclusion-output <绝对路径>` 时排他生成证明文件。用 `artifact-graph read-proof --proof-root <root> --proof <相对路径> --format json` 核验本族证明(`GRAPH_CLEAR` 且范围完整时为 `pass`,其余问题或未完成为 `not_pass`,文件缺失/损坏或非本族证明为 `unavailable`;该证明与 Review Result Protocol 分属两套独立契约)。
153
+ - **审阅结果校验与防串单**:`artifact-graph validate-review-result --file <path>` 校验协议结构与身份独立性;加上 `--verify-target-digests`(可配合 `--targets <p1,p2>` 或内联摘要映射)可强制比对目标文件当前字节的 SHA-256 摘要,拦截“审阅 JSON 语法合法,但目标文件已改动或串到了其他条目”的风险。
154
+ - **上下文组装与影响面**:`artifact-graph context`、`artifact-graph packet` 生成受控实现上下文;配置 `statusViews` 后可加 `--view current|planned|history|all` 按时间视图筛选。`artifact-graph impact --worktree` 只读评估工作树改动的波及范围;`artifact-graph coverage` 报告图扫描与覆盖边界(不推断测试通过或发布完成)。
155
+ - **版本锁维护**:`artifact-graph version-lock refresh` 与 `audit` 同时守护实现/验证边(`locks`)和制品间关系(`artifactRelations`),并对带追溯注释的代码测试文件校验其包含真实测试用例或断言,拦截纯注释空壳。旧版 1.0 锁文件缺少 `artifactRelations` 时视为空列表,跑一次 `refresh --all` 即可补齐完整基线。
156
+ - **实现表面与双向一致性对齐**:项目配置 `implementationSurface`(`entryGlobs`、`excludeGlobs`、`requireCodeLocks`)后,可用 `artifact-graph alignment-audit [--root .] [--strict] [--format json|markdown]` 审计单仓入口认领,以及跨仓 `artifacts/portfolio-allocations.json` 与 `artifacts/upstream-bindings.json` 的对称绑定、血缘子集新鲜锁与只读收据(严格区分静态双锁齐备 `traceability_locked` 与具备真实测试执行通过收据的 `verified_satisfied`,并支持已吸纳条目声明 `allocationStatus: "absorbed"` 与 `absorbedBy` 承接仓);显式运行 `artifact-graph alignment-lock` 同步互锁摘要。
157
+ - **Git Hook 安装与幂等卸载**:`artifact-graph hooks install-git --hook all` 安装可选钩子;停用时执行 `artifact-graph hooks uninstall --hook all`,仅幂等移除受管片段并完整保留用户自定义的 Hook 命令与文件权限。
158
+
159
+ ### 5. 制品重组(拆分、跨文件移动与重编号)
160
+
161
+ `artifact-graph restructure` 将显式映射编译为可复核的候选计划并按文件集合应用,支持三类确定性变换:`record-split`(物理记录拆分)、`identity-split`(编号身份一拆多)与 `move-renumber`(跨文件迁移与重编号)。能力边界划分与验收条件归属由上层技能或作者决定,CLI 只编译完整映射并执行文件切换:
204
162
 
205
163
  ```bash
206
- # pnpm
207
164
  pnpm exec artifact-graph restructure inspect --root . --input request.json --format json
208
165
  pnpm exec artifact-graph restructure plan --root . --input mapping.json --format json
209
166
  pnpm exec artifact-graph restructure apply --root . --plan plan.json --confirm-cooperative-writers
210
-
211
- # npm
212
- npx artifact-graph restructure inspect --root . --input request.json --format json
213
- npx artifact-graph restructure plan --root . --input mapping.json --format json
214
- npx artifact-graph restructure apply --root . --plan plan.json --confirm-cooperative-writers
215
167
  ```
216
168
 
217
- `plan` 输出阻断项、未解决项、候选内部问题与写集外的引用出现位置;只要存在阻断项或未解决项,
218
- `applicable` 就不为真,不可应用的计划不得进入 `apply`。计划文档要保存到写集之外的普通目录:
219
- 恢复只依赖该文档,不依赖进程状态。
169
+ 只要 `plan` 中仍存在阻断项或未决项,`applicable` 即为 `false`,禁止进入 `apply`。请将计划文件保存在候选写集之外的普通目录——中断恢复只依赖该计划文件,不依赖内存进程状态。
220
170
 
221
- > **采用边界。** 文件集合写入能力的成熟度为 `candidate`。资格环境仅为 Darwin / arm64 / APFS;
222
- > 其他平台返回不可用,不会降级成无事务写入。该能力以合作式写者为前提,且不自证该前提:
223
- > `apply` 与 `prune-recovery` 必须给出 `--confirm-cooperative-writers`,缺失即拒绝写入;
224
- > 恢复必须用 `recover` 并同时给出 `--confirm-all-participants-stopped` 与
225
- > `--confirm-exclusive-maintenance`。恢复材料默认保留,只有显式 `prune-recovery` 才清理。
226
- > 不承诺全平台事务保证。`inspect` 与 `plan` 不写项目。
171
+ > **采用边界:** 文件集合写入能力当前成熟度为 `candidate`,仅在 `Darwin / arm64 / APFS` 环境下开放真实写入;其他平台仍可使用只读的 `inspect` 与 `plan`,调用 `apply` 会以 `APPLY_ENVIRONMENT_UNSUPPORTED` 明确拒绝,绝不静默降级为无事务裸写。`apply` 与 `prune-recovery` 要求操作者显式传入 `--confirm-cooperative-writers`;中断恢复须执行 `recover` 并同时传入 `--confirm-all-participants-stopped` 与 `--confirm-exclusive-maintenance`。恢复材料默认保留,仅在显式执行 `prune-recovery` 时清理。
227
172
 
228
- ### 制品删除或拆分后的孤立锁清理
173
+ ### 6. 删除或拆分制品后的孤立锁清理
229
174
 
230
- 当制品、源码文件或追溯边不再存在时(常见于制品删除或拆分之后),对应的版本锁会成为
231
- 孤立锁。`version-lock refresh` 默认保留孤立锁,让清理始终是一次显式、可审查的操作:
175
+ 删除、合并或重编号制品后,旧边对应的版本锁会变成孤立锁(orphan lock)。`version-lock refresh` 默认保留孤立锁,确保清理动作始终可见、可审阅:
232
176
 
233
177
  ```bash
234
- # pnpm
178
+ # 批量清理全部孤立锁
235
179
  pnpm exec artifact-graph version-lock refresh --all --remove-orphans --format markdown
236
- git diff artifacts/traceability-version-lock.json # 审查被移除的锁条目
237
- git add artifacts/traceability-version-lock.json # 暂存后重新提交
238
-
239
- # npm
240
- npx artifact-graph version-lock refresh --all --remove-orphans --format markdown
241
180
  git diff artifacts/traceability-version-lock.json
242
181
  git add artifacts/traceability-version-lock.json
243
- ```
244
-
245
- 只清理一次改号产生的那条边时,点名它,不要整体清扫:
246
182
 
247
- ```bash
183
+ # 仅精准移除本次改号产生的单条孤立边(与 --remove-orphans 互斥,可重复传参)
248
184
  pnpm exec artifact-graph version-lock refresh --changed-only --worktree --remove-orphan-edge <edgeId>
249
185
  ```
250
186
 
251
- `--remove-orphan-edge` 可重复指定,只对当前仍是孤儿的边生效,并与 `--remove-orphans` 互斥
252
- (同时给出即被拒绝)。点名仍是活边的边会被拒绝且不删除;同一锁文件里既有的孤立锁保持不变。
187
+ 若点名的 `edgeId` 当前仍是有效活边,命令会拒绝删除并保留原状。`version-lock audit` 会将结构性孤立锁与过期哈希列为阻断项;测试文件脱离已配置运行器激活范围(runner liveness)则仅报警告。
253
188
 
254
- `version-lock audit` 会把结构性孤立锁和陈旧哈希标记为阻断问题,并输出上述解决步骤;
255
- runner liveness 发现(测试文件不再处于任何已配置 runner 的激活范围)只是警告,不会阻断。
189
+ ## Review Result Protocol(审阅结果协议 v1.0)
256
190
 
257
- ## Review Result Protocol
191
+ 本包导出 `schemas/review-result.schema.json`、TypeScript 类型定义及 `validateReviewResult(input, options?)` 语义校验函数,统一约束审阅(`review`)、修复(`repair`)、批次度量、问题分级与阻断裁决:
258
192
 
259
- 包内发布了 `schemas/review-result.schema.json`,以及配套的 TypeScript 类型和 `validateReviewResult`
260
- 校验 API。该协议与具体项目无关,覆盖 review、repair、批次证据、findings、metrics 和
261
- fail-closed decision;非法字段和语义违规都会以稳定的 JSON path 报告。协议拒绝未知顶层字段;
262
- `attempt` 取值仅限 1–3;成功接受必须带 `producer`;`PASS`/`PASS_WITH_RESIDUAL_MINOR` 不允许
263
- 存在未关闭的 `block` finding。独立的 repair 复审可以记录 `acceptance.reviewer` 和
264
- `acceptance.source_result`,validator 会拒绝 repair producer 自我接受。
265
- JSON Schema 无法比较跨对象的字段值,因此调用方还必须运行语义 validator;稳定身份由
266
- `executor + name` 构成,`skill` 只是附加元数据,不能用来证明独立性。
193
+ - 拒绝未知顶层字段;`attempt` 限制在 `1..3`;验收通过(`SUCCEEDED` + `PASS` / `PASS_WITH_RESIDUAL_MINOR`)必须记录 `producer` 身份,且不允许残留未关闭的 `block` 级问题。
194
+ - 独立复审可通过 `acceptance.reviewer` 与 `acceptance.source_result` 关联修复来源;语义校验器按 `executor + name` 比对稳定身份(`skill` 仅作附加元数据),拒绝修复执行者自我验收。
195
+ - 当向 `validateReviewResult` 传入 `{ expectedTargetDigests }`(或 CLI 传入 `--verify-target-digests`)时,校验器会进一步核对 `review.target_digests` / `evidence` 中的目标文件 SHA-256 摘要及 `review.files` 范围,防止旧快照混入或跨条目串单。
267
196
 
268
197
  ## 文档导航
269
198
 
270
- - [INSTALL.md](INSTALL.md) — 详细安装指南与 pnpm 10+ 配置
271
- - [CHANGELOG.md](CHANGELOG.md) — 版本发布历史
272
- - [CONTRIBUTING.md](CONTRIBUTING.md) — 贡献指南
273
- - [SECURITY.md](SECURITY.md) — 安全策略
199
+ - [在线文档站(GitHub Pages)](https://ifoohoo.github.io/artifact-chain-assistant-site/) — 产品概览、十分钟上手、图谱与四态对齐、工作流协同、命令行参考与排障指南
200
+ - [INSTALL.md](INSTALL.md) — 安装要求、pnpm 10+ 原生模块白名单与代码追溯边界说明
201
+ - [CHANGELOG.md](CHANGELOG.md) — 版本变更记录
202
+ - [CONTRIBUTING.md](CONTRIBUTING.md) — 参与贡献指南
203
+ - [SECURITY.md](SECURITY.md) — 安全漏洞报告策略
274
204
 
275
- ## 相关项目
205
+ ## 配套项目
276
206
 
277
- 如果需要 Codex / Claude Code 技能来引导制品链的接入、初始化和日常维护,请使用
278
- [`artifact-chain-assistant`](https://github.com/ifoohoo/artifact-chain-assistant)。
207
+ 如需在 Codex、Claude Code、Kimi Code 或 Qoder 中使用引导式技能完成制品链初始化、需求池双维管理、现状分诊与规格编写,请配合安装 [`artifact-chain-assistant`](https://github.com/ifoohoo/artifact-chain-assistant)。
279
208
 
280
- ## 开源协议
209
+ ## 开源许可
281
210
 
282
211
  Apache-2.0。详见 [LICENSE](LICENSE)。