artifact-graph 0.7.0 → 0.8.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.
@@ -0,0 +1,26 @@
1
+ name: Bug report
2
+ description: Report a reproducible problem
3
+ title: "[Bug]: "
4
+ labels: ["bug"]
5
+ body:
6
+ - type: textarea
7
+ id: summary
8
+ attributes:
9
+ label: Summary
10
+ description: What happened?
11
+ validations:
12
+ required: true
13
+ - type: textarea
14
+ id: reproduce
15
+ attributes:
16
+ label: Reproduction
17
+ description: Steps to reproduce the issue.
18
+ validations:
19
+ required: true
20
+ - type: textarea
21
+ id: environment
22
+ attributes:
23
+ label: Environment
24
+ description: Node.js version, package version, OS, and package manager.
25
+ validations:
26
+ required: false
@@ -0,0 +1,19 @@
1
+ name: Feature request
2
+ description: Suggest an improvement
3
+ title: "[Feature]: "
4
+ labels: ["enhancement"]
5
+ body:
6
+ - type: textarea
7
+ id: problem
8
+ attributes:
9
+ label: Problem
10
+ description: What problem should this solve?
11
+ validations:
12
+ required: true
13
+ - type: textarea
14
+ id: proposal
15
+ attributes:
16
+ label: Proposal
17
+ description: What would a good solution look like?
18
+ validations:
19
+ required: true
@@ -0,0 +1,14 @@
1
+ ## Summary
2
+
3
+ -
4
+
5
+ ## Validation
6
+
7
+ - [ ] `pnpm build`
8
+ - [ ] `pnpm test`
9
+ - [ ] `pnpm typecheck --if-present`
10
+
11
+ ## Checklist
12
+
13
+ - [ ] README / CHANGELOG updated when user-facing behavior changed
14
+ - [ ] No private parent-repository files or local machine paths included
@@ -0,0 +1,23 @@
1
+ name: CI
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches: [main]
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: pnpm/action-setup@v4
14
+ with:
15
+ version: 10.17.1
16
+ - uses: actions/setup-node@v4
17
+ with:
18
+ node-version: 22
19
+ - run: pnpm install
20
+ - run: pnpm test:ci
21
+ - run: pnpm typecheck
22
+ - run: pnpm build
23
+ - run: git diff --exit-code
package/CHANGELOG.md CHANGED
@@ -1,6 +1,31 @@
1
1
  # Changelog
2
2
 
3
- ## Unreleased
3
+ ## 0.8.0
4
+
5
+ ### Added
6
+
7
+ - **Artifact relation version locks**: `version-lock refresh` and `bootstrap` now generate
8
+ `artifactRelations` entries for artifact-to-artifact edges (for example, skill→skill_family and
9
+ feature→scenario). The `audit` command checks for missing relation locks, content hash mismatches,
10
+ and path drift.
11
+
12
+ ### Changed
13
+
14
+ - **Strict local artifact-relation refresh**: `version-lock refresh --changed-only` updates or adds
15
+ only relation locks whose endpoints are reached by the current worktree or staged change set. It
16
+ no longer fills unrelated missing relation locks while processing a local change; use
17
+ `version-lock refresh --all` only when intentionally establishing a complete relation baseline.
18
+ - **Deterministic, reproducible relation locks**: relation lock output uses deterministic sorting and
19
+ carries no timestamps, so identical artifact content produces byte-identical lock files across
20
+ environments and runs.
21
+ - **Old 1.0 lock read boundary**: lock files written before artifact relations existed (no
22
+ `artifactRelations` key) are read as an empty relation list instead of failing; run
23
+ `version-lock refresh --all` once to establish the complete relation baseline.
24
+ - **Non-software domain isolation via `baselinePolicy: false`**: when a project explicitly disables
25
+ the universal baseline (`baselinePolicy: false` in the context/packet manifest), packet assembly
26
+ and validation no longer inject the software-development defaults — baseline constraints, the risk
27
+ checklist, and blueprint non-goals are required to be empty (PKT-005 / PKT-010), so non-software
28
+ skill-family domains are not forced through software-specific packet rules.
4
29
 
5
30
  ## 0.7.0
6
31
 
@@ -0,0 +1,11 @@
1
+ # Code of Conduct
2
+
3
+ This project follows a simple contributor covenant:
4
+
5
+ - Be respectful and constructive.
6
+ - Assume good intent, but accept responsibility for impact.
7
+ - Keep technical discussion focused on the work.
8
+ - Do not harass, insult, or discriminate.
9
+
10
+ Maintainers may remove comments, issues, pull requests, or other contributions that violate these
11
+ expectations.
@@ -0,0 +1,24 @@
1
+ # Contributing
2
+
3
+ Thanks for your interest in contributing.
4
+
5
+ ## Development
6
+
7
+ Use Node.js `>=22.0.0`.
8
+
9
+ ```bash
10
+ pnpm install
11
+ pnpm build
12
+ pnpm test
13
+ ```
14
+
15
+ ## Pull Requests
16
+
17
+ - Keep changes focused.
18
+ - Update README, CHANGELOG, and tests when behavior changes.
19
+ - Run the package validation commands before opening a pull request.
20
+ - Do not include private parent-repository artifacts or local machine paths.
21
+
22
+ ## License
23
+
24
+ By contributing, you agree that your contribution is licensed under Apache-2.0.
package/README.md CHANGED
@@ -8,6 +8,25 @@ Git-native Markdown artifact graph scanner and validator for agentic coding work
8
8
  and version-lock metadata connected. It is designed for deterministic local use before an AI coding
9
9
  agent claims implementation work is complete.
10
10
 
11
+ <!-- release-skill:capability:external-write-boundary -->
12
+ > **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`, and `audit`
14
+ > do not change project files. Commands including `init`, `version-lock refresh`, and
15
+ > `hooks install-git` write locally only when explicitly invoked.
16
+
17
+ <!-- release-skill:capability:safe-first-command -->
18
+ > **Safe first command:** Inspect the installed CLI and project health before authorizing any
19
+ > initialization, version-lock refresh, or hook installation.
20
+
21
+ ```bash
22
+ pnpm exec artifact-graph --help
23
+ pnpm exec artifact-graph doctor --root .
24
+ ```
25
+
26
+ If either read-only command fails, confirm that Node.js `>=22.0.0` is active and reinstall the
27
+ package using the precise instructions in [INSTALL.md](INSTALL.md). Do not run a write command
28
+ until the CLI resolves successfully and doctor reports an actionable diagnosis.
29
+
11
30
  ## Install
12
31
 
13
32
  ```bash
@@ -49,6 +68,9 @@ npx artifact-graph version-lock audit --root . --strict-missing-lock
49
68
  - Validate Review Result Protocol v1.0 documents with `artifact-graph validate-review-result --file <path>`.
50
69
  - Build implementation context with `artifact-graph context` or `artifact-graph packet`.
51
70
  - Keep traceability freshness with `artifact-graph version-lock refresh` and `audit`.
71
+ - Version lock covers both implementation/verification edges (`locks`) and artifact-to-artifact
72
+ relations (`artifactRelations`). Old 1.0 lock files without `artifactRelations` are treated as
73
+ having an empty relation list; run `refresh --all` once to establish the complete relation baseline.
52
74
  - Install opt-in Git hooks with `artifact-graph hooks install-git --hook all`.
53
75
 
54
76
  ## Review Result Protocol
package/README.zh-CN.md CHANGED
@@ -7,6 +7,24 @@
7
7
  它把项目里的需求、场景、设计、源码、测试和 version-lock 元数据连成一张图,
8
8
  供 AI agent 在宣称实现完成之前,用确定性的本地命令检查上下文和追溯关系。
9
9
 
10
+ <!-- release-skill:capability:external-write-boundary -->
11
+ > **外部写入边界:** 安装 `artifact-graph` 不会修改项目或写入远端。`--help`、`doctor`、
12
+ > `validate`、`query` 和 `audit` 等只读命令不会更改项目文件。只有显式执行 `init`、
13
+ > `version-lock refresh` 或 `hooks install-git` 等命令时才会发生本地写入。
14
+
15
+ <!-- release-skill:capability:safe-first-command -->
16
+ > **安全的第一步:** 在授权初始化、刷新版本锁或安装 hook 前,先检查已安装的命令行工具
17
+ > 和项目健康状态。
18
+
19
+ ```bash
20
+ pnpm exec artifact-graph --help
21
+ pnpm exec artifact-graph doctor --root .
22
+ ```
23
+
24
+ 如果任一只读命令失败,先确认当前 Node.js 版本不低于 `22.0.0`,再按照
25
+ [INSTALL.md](INSTALL.md) 中的精确说明重新安装;命令行工具能够正常解析且 doctor
26
+ 给出可处理的诊断前,不要运行写入命令。
27
+
10
28
  ## 安装
11
29
 
12
30
  ```bash
@@ -47,6 +65,8 @@ npx artifact-graph version-lock audit --root . --strict-missing-lock
47
65
  - 用 `artifact-graph validate-review-result --file <path>` 校验 Review Result Protocol v1.0 文档。
48
66
  - 用 `artifact-graph context` 或 `artifact-graph packet` 构建实现上下文。
49
67
  - 用 `artifact-graph version-lock refresh` 和 `audit` 保持追溯关系及时更新。
68
+ - 版本锁覆盖实现/验证边(`locks`)和制品间关系(`artifactRelations`)。旧版 1.0 锁文件缺少
69
+ `artifactRelations` 时视为空数组;首次启用时执行一次 `refresh --all` 建立完整关系基线。
50
70
  - 用 `artifact-graph hooks install-git --hook all` 安装可选 Git hooks。
51
71
 
52
72
  ## Review Result Protocol
package/SECURITY.md ADDED
@@ -0,0 +1,19 @@
1
+ # Security Policy
2
+
3
+ ## Reporting A Vulnerability
4
+
5
+ Please do not open a public issue for sensitive security reports.
6
+
7
+ Send a private report to the repository owner through GitHub's private vulnerability reporting when
8
+ available, or contact the maintainer directly.
9
+
10
+ Include:
11
+
12
+ - affected package and version;
13
+ - reproduction steps;
14
+ - impact;
15
+ - suggested fix, if known.
16
+
17
+ ## Supported Versions
18
+
19
+ Security fixes target the latest released version.
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "artifact-graph",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Git-native Markdown artifact graph scanner and validator",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
+ "packageManager": "pnpm@10.17.1",
7
8
  "keywords": [
8
9
  "artifact-graph",
9
10
  "traceability",
@@ -34,6 +35,17 @@
34
35
  "engines": {
35
36
  "node": ">=22.0.0"
36
37
  },
38
+ "scripts": {
39
+ "build": "tsup src/index.ts --format esm,cjs --dts --splitting false && tsup src/cli.ts --format esm --dts --splitting false",
40
+ "test": "vitest run --config vitest.config.ts",
41
+ "test:ci": "ARTIFACT_GRAPH_PUBLIC_REPO=1 vitest run --config vitest.config.ts && pnpm test:npm-consumer",
42
+ "test:npm-consumer": "node test/npm-bin-install.test.mjs",
43
+ "test:watch": "vitest",
44
+ "typecheck": "tsc --noEmit",
45
+ "clean": "rm -rf dist coverage",
46
+ "packet:audit": "node scripts/run-packet-audit.mjs",
47
+ "packet:prompt-audit": "node scripts/run-packet-prompt-audit.mjs"
48
+ },
37
49
  "dependencies": {
38
50
  "ajv": "^8.20.0",
39
51
  "better-sqlite3": "^11.9.0",
@@ -56,6 +68,10 @@
56
68
  "LICENSE",
57
69
  "NOTICE",
58
70
  "INSTALL.md",
71
+ "CONTRIBUTING.md",
72
+ "CODE_OF_CONDUCT.md",
73
+ "SECURITY.md",
74
+ ".github",
59
75
  "dist",
60
76
  "schemas",
61
77
  "contracts",
@@ -74,15 +90,10 @@
74
90
  "contributors": [
75
91
  "mzdbxqh"
76
92
  ],
77
- "scripts": {
78
- "build": "tsup src/index.ts --format esm,cjs --dts --splitting false && tsup src/cli.ts --format esm --dts --splitting false",
79
- "test": "vitest run --config vitest.config.ts",
80
- "test:ci": "ARTIFACT_GRAPH_PUBLIC_REPO=1 vitest run --config vitest.config.ts && pnpm test:npm-consumer",
81
- "test:npm-consumer": "node test/npm-bin-install.test.mjs",
82
- "test:watch": "vitest",
83
- "typecheck": "tsc --noEmit",
84
- "clean": "rm -rf dist coverage",
85
- "packet:audit": "node scripts/run-packet-audit.mjs",
86
- "packet:prompt-audit": "node scripts/run-packet-prompt-audit.mjs"
93
+ "pnpm": {
94
+ "onlyBuiltDependencies": [
95
+ "better-sqlite3",
96
+ "esbuild"
97
+ ]
87
98
  }
88
- }
99
+ }
File without changes
File without changes
File without changes
@@ -1,315 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$id": "artifact.e2e-test@1",
4
- "title": "Artifact Contract: E2E Test Specification",
5
- "description": "Minimal schema for E2E test specification artifacts",
6
- "version": "1.0.0",
7
- "contractIdentity": {
8
- "major": "artifact.e2e-test@1",
9
- "authority": "artifact",
10
- "namespace": "artifact",
11
- "revisionDigest": "sha256:374b99424519e42b40b621774fb602d62dfa23f48f792095f717bbabbe9e3f2a",
12
- "relationRules": {
13
- "derives_from": {
14
- "allowedTargetTypes": ["scenario", "design", "decision"],
15
- "min": 1,
16
- "max": 10,
17
- "anchorPolicy": "optional"
18
- },
19
- "verifies": {
20
- "allowedTargetTypes": ["feature", "scenario"],
21
- "min": 1,
22
- "max": 5,
23
- "anchorPolicy": "required"
24
- },
25
- "implemented_by": {
26
- "allowedTargetTypes": ["code"],
27
- "min": 0,
28
- "max": 5,
29
- "anchorPolicy": "optional"
30
- },
31
- "references": {
32
- "allowedTargetTypes": ["feature", "scenario", "decision", "design", "e2e_test", "test"],
33
- "min": 0,
34
- "max": 20,
35
- "anchorPolicy": "optional"
36
- },
37
- "covers": {
38
- "allowedTargetTypes": ["feature", "scenario"],
39
- "min": 0,
40
- "max": 10,
41
- "anchorPolicy": "optional"
42
- }
43
- },
44
- "semanticMarkers": {
45
- "scope": {
46
- "jsonPointer": "/scope",
47
- "markdownMarker": "scope",
48
- "required": true
49
- },
50
- "system_boundary": {
51
- "jsonPointer": "/system_boundary",
52
- "markdownMarker": "system-boundary",
53
- "required": true
54
- },
55
- "coverage": {
56
- "jsonPointer": "/coverage",
57
- "markdownMarker": "coverage",
58
- "required": true
59
- },
60
- "environment_data": {
61
- "jsonPointer": "/environment_data",
62
- "markdownMarker": "environment-data",
63
- "required": true
64
- },
65
- "test_cases": {
66
- "jsonPointer": "/test_cases",
67
- "markdownMarker": "test-cases",
68
- "required": true
69
- },
70
- "evidence_contract": {
71
- "jsonPointer": "/evidence_contract",
72
- "markdownMarker": "evidence-contract",
73
- "required": true
74
- }
75
- }
76
- },
77
- "type": "object",
78
- "required": ["metadata", "scope", "system_boundary", "coverage", "environment_data", "relations", "test_cases", "evidence_contract"],
79
- "properties": {
80
- "metadata": {
81
- "type": "object",
82
- "required": ["id", "title", "status"],
83
- "properties": {
84
- "id": {
85
- "type": "string",
86
- "pattern": "^[A-Za-z0-9._-]+:(TC-\\d+[a-z]?|FILE)$"
87
- },
88
- "title": {
89
- "type": "string",
90
- "minLength": 1
91
- },
92
- "status": {
93
- "type": "string",
94
- "enum": ["planned", "active", "done", "deprecated"]
95
- },
96
- "test_batch": {
97
- "type": "string"
98
- }
99
- },
100
- "additionalProperties": false
101
- },
102
- "scope": {
103
- "type": "object",
104
- "required": ["business_goal", "actors"],
105
- "properties": {
106
- "business_goal": {
107
- "type": "string",
108
- "minLength": 1
109
- },
110
- "actors": {
111
- "type": "array",
112
- "items": { "type": "string" },
113
- "minItems": 1
114
- },
115
- "system_boundaries": {
116
- "type": "array",
117
- "items": { "type": "string" }
118
- },
119
- "non_goals": {
120
- "type": "array",
121
- "items": { "type": "string" }
122
- }
123
- },
124
- "additionalProperties": false
125
- },
126
- "system_boundary": {
127
- "type": "object",
128
- "required": ["components"],
129
- "properties": {
130
- "components": {
131
- "type": "array",
132
- "items": { "type": "string" },
133
- "minItems": 1
134
- },
135
- "external_dependencies": {
136
- "type": "array",
137
- "items": { "type": "string" }
138
- },
139
- "trust_boundaries": {
140
- "type": "array",
141
- "items": { "type": "string" }
142
- }
143
- },
144
- "additionalProperties": false
145
- },
146
- "coverage": {
147
- "type": "object",
148
- "required": [],
149
- "properties": {
150
- "ac_coverage": {
151
- "type": "object",
152
- "additionalProperties": {
153
- "type": "array",
154
- "items": { "type": "string" }
155
- }
156
- },
157
- "related_scenarios": {
158
- "type": "array",
159
- "items": { "type": "string" }
160
- },
161
- "related_features": {
162
- "type": "array",
163
- "items": { "type": "string" }
164
- },
165
- "related_decisions": {
166
- "type": "array",
167
- "items": { "type": "string" }
168
- }
169
- },
170
- "additionalProperties": false
171
- },
172
- "environment_data": {
173
- "type": "object",
174
- "properties": {
175
- "topology": {
176
- "type": "string"
177
- },
178
- "fixtures": {
179
- "type": "array",
180
- "items": { "type": "string" }
181
- },
182
- "identities": {
183
- "type": "array",
184
- "items": { "type": "string" }
185
- },
186
- "isolation_strategy": {
187
- "type": "string"
188
- }
189
- },
190
- "additionalProperties": false
191
- },
192
- "relations": {
193
- "type": "array",
194
- "description": "Machine-readable relation declarations: kind, target type/id, optional anchor, and contract-level cardinality rules",
195
- "minItems": 2,
196
- "items": {
197
- "type": "object",
198
- "required": ["kind", "target_type", "target_id"],
199
- "properties": {
200
- "kind": {
201
- "type": "string",
202
- "enum": ["derives_from", "verifies", "implemented_by", "references", "covers"]
203
- },
204
- "target_type": {
205
- "type": "string",
206
- "enum": ["feature", "scenario", "decision", "design", "e2e_test", "test", "code"]
207
- },
208
- "target_id": {
209
- "type": "string",
210
- "minLength": 1
211
- },
212
- "anchor": {
213
- "type": "string",
214
- "description": "Optional anchor point (e.g., section marker, line reference)"
215
- }
216
- },
217
- "additionalProperties": false
218
- }
219
- },
220
- "test_cases": {
221
- "type": "array",
222
- "items": {
223
- "$ref": "#/definitions/testCase"
224
- },
225
- "minItems": 1
226
- },
227
- "evidence_contract": {
228
- "type": "object",
229
- "required": ["required_artifacts"],
230
- "properties": {
231
- "required_artifacts": {
232
- "type": "array",
233
- "items": { "type": "string" },
234
- "minItems": 1
235
- },
236
- "runner_binding": {
237
- "type": "string"
238
- },
239
- "proof_requirements": {
240
- "type": "array",
241
- "items": { "type": "string" }
242
- }
243
- },
244
- "additionalProperties": false
245
- }
246
- },
247
- "additionalProperties": false,
248
- "definitions": {
249
- "testCase": {
250
- "type": "object",
251
- "required": ["case_id", "goal", "preconditions", "actions", "oracles", "cleanup", "priority", "trace_targets"],
252
- "properties": {
253
- "case_id": {
254
- "type": "string",
255
- "pattern": "^TC-\\d+[a-z]?$"
256
- },
257
- "goal": {
258
- "type": "string",
259
- "minLength": 1
260
- },
261
- "preconditions": {
262
- "type": "array",
263
- "items": { "type": "string" },
264
- "minItems": 1
265
- },
266
- "actions": {
267
- "type": "array",
268
- "items": {
269
- "type": "object",
270
- "required": ["step", "action"],
271
- "properties": {
272
- "step": { "type": "integer", "minimum": 1 },
273
- "action": { "type": "string", "minLength": 1 },
274
- "expected_result": { "type": "string" }
275
- },
276
- "additionalProperties": false
277
- },
278
- "minItems": 1
279
- },
280
- "oracles": {
281
- "type": "array",
282
- "items": {
283
- "type": "object",
284
- "required": ["observable", "criterion"],
285
- "properties": {
286
- "observable": { "type": "string", "minLength": 1 },
287
- "criterion": { "type": "string", "minLength": 1 },
288
- "timeout_ms": { "type": "integer", "minimum": 0 }
289
- },
290
- "additionalProperties": false
291
- },
292
- "minItems": 1
293
- },
294
- "cleanup": {
295
- "type": "array",
296
- "items": { "type": "string" }
297
- },
298
- "priority": {
299
- "type": "string",
300
- "enum": ["critical", "high", "medium", "low"]
301
- },
302
- "trace_targets": {
303
- "type": "array",
304
- "items": { "type": "string" },
305
- "minItems": 1
306
- },
307
- "path_class": {
308
- "type": "string",
309
- "enum": ["happy", "error", "recovery", "edge", "security", "performance"]
310
- }
311
- },
312
- "additionalProperties": false
313
- }
314
- }
315
- }
package/dist/cli.d.ts DELETED
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env node
2
- interface CliIo {
3
- cwd?: string;
4
- stdout?: (chunk: string) => void;
5
- stderr?: (chunk: string) => void;
6
- }
7
- declare function runCli(argv: string[], io?: CliIo): Promise<number>;
8
-
9
- export { type CliIo, runCli };