artifact-graph 0.3.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 ADDED
@@ -0,0 +1,32 @@
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ ## 0.3.0
6
+
7
+ ### Added
8
+
9
+ - **Config-driven custom artifact types**: register any Markdown artifact type via `artifact-graph.config.yaml` with `paths`, `idPatterns`, `extraFields`, `target`, `role`, and `aliases`. Generic frontmatter parser handles all registered types without dedicated code.
10
+ - **Dynamic `--target` selector**: unified `--target <type>:<id>` for `context`, `packet`, `packet-prompt`, and audit commands; legacy `--feature`, `--scenario`, `--decision`, `--design`, `--e2e-test` flags remain compatible.
11
+ - **Extra fields indexing**: declare `extraFields` (string, number, boolean, enum) in config to index specific frontmatter fields for custom types.
12
+ - **`packet-prompt-audit --discover` mode**: automatically discovers all targets from artifact config and audits packet prompts without a targets file.
13
+ - **`CUSTOM_ARTIFACT_ISOLATED` validation**: warns when config-registered custom types have no traceability edges.
14
+ - **Java code traceability**: `isTestFile` classifier supports `*Test.java`/`*Tests.java` convention for Java projects.
15
+
16
+ ### Changed
17
+
18
+ - Scenario-PRD validation (`--include scenario-prd-links`) is now opt-in via `validateScenarioPrdLinkIndex` instead of unconditionally executed.
19
+ - Expand `release-verifier` sub-agent to check CHANGELOG completeness and GitHub Release readiness.
20
+ - Document CHANGELOG format standard (Keep a Changelog style with category headings).
21
+ - Document version decision rules (semver based on CHANGELOG content).
22
+ - Add GitHub Releases creation step to publish workflow.
23
+ - Reference release-policy.md for version/CHANGELOG/GitHub Releases procedures in SKILL.md.
24
+
25
+ ## 0.1.4
26
+
27
+ ### Changed
28
+
29
+ - Publish `artifact-graph` as a standalone public package.
30
+ - Add version-lock refresh and audit workflows.
31
+ - Add Git hook installation support.
32
+ - Add package README, Chinese README, NOTICE, and Apache-2.0 license files.
package/INSTALL.md ADDED
@@ -0,0 +1,81 @@
1
+ # artifact-graph Installation
2
+
3
+ ## Prerequisites
4
+
5
+ - Node.js `>=22.0.0`.
6
+
7
+ ## Install
8
+
9
+ ### From npm
10
+
11
+ ```bash
12
+ pnpm add -D artifact-graph
13
+ ```
14
+
15
+ Or with npm:
16
+
17
+ ```bash
18
+ npm install --save-dev artifact-graph
19
+ ```
20
+
21
+ ### From GitHub
22
+
23
+ ```bash
24
+ npm install github:mzdbxqh/artifact-graph
25
+ ```
26
+
27
+ Or with pnpm:
28
+
29
+ ```bash
30
+ pnpm add -D github:mzdbxqh/artifact-graph
31
+ ```
32
+
33
+ After installation, verify the CLI is available:
34
+
35
+ ```bash
36
+ artifact-graph --help
37
+ ```
38
+
39
+ ### pnpm Native Build Allowlist
40
+
41
+ With pnpm 10+, the native `better-sqlite3` dependency must be allowed to build.
42
+ Add or update `pnpm-workspace.yaml` in your project root:
43
+
44
+ ```yaml
45
+ allowBuilds:
46
+ better-sqlite3: true
47
+ ```
48
+
49
+ Without this entry, `pnpm install` may skip the native build and `artifact-graph` will fail at
50
+ runtime.
51
+
52
+ ## Quick Start
53
+
54
+ From your project root:
55
+
56
+ ```bash
57
+ artifact-graph init --root .
58
+ artifact-graph validate --root . --warning-only
59
+ artifact-graph version-lock refresh --changed-only --staged --format markdown
60
+ artifact-graph version-lock audit --root . --strict-missing-lock
61
+ ```
62
+
63
+ ## Smoke Test
64
+
65
+ Run these commands to confirm the installation is working:
66
+
67
+ ```bash
68
+ artifact-graph --help
69
+ artifact-graph doctor --format markdown
70
+ artifact-graph validate --root . --warning-only
71
+ ```
72
+
73
+ If `artifact-graph doctor` cannot find the CLI or config, check that:
74
+
75
+ 1. `artifact-graph` is in `PATH` or `./node_modules/.bin/`.
76
+ 2. Your project has an `artifact-graph.config.yaml` (run `artifact-graph init --root .` to create one).
77
+
78
+ ## Related Project
79
+
80
+ Use [`artifact-chain-assistant`](https://github.com/mzdbxqh/artifact-chain-assistant) for Codex and
81
+ Claude Code skills that guide artifact-chain intake, setup, and maintenance.
package/LICENSE ADDED
@@ -0,0 +1,186 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction, and
10
+ distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by the
13
+ copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all other
16
+ entities that control, are controlled by, or are under common control with
17
+ that entity. For the purposes of this definition, "control" means (i) the
18
+ power, direct or indirect, to cause the direction or management of such
19
+ entity, whether by contract or otherwise, or (ii) ownership of fifty percent
20
+ (50%) or more of the outstanding shares, or (iii) beneficial ownership of such
21
+ entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity exercising
24
+ permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation source, and
28
+ configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical transformation or
31
+ translation of a Source form, including but not limited to compiled object
32
+ code, generated documentation, and conversions to other media types.
33
+
34
+ "Work" shall mean the work of authorship, whether in Source or Object form,
35
+ made available under the License, as indicated by a copyright notice that is
36
+ included in or attached to the work (an example is provided in the Appendix
37
+ below).
38
+
39
+ "Derivative Works" shall mean any work, whether in Source or Object form,
40
+ that is based on (or derived from) the Work and for which the editorial
41
+ revisions, annotations, elaborations, or other modifications represent, as a
42
+ whole, an original work of authorship. For the purposes of this License,
43
+ Derivative Works shall not include works that remain separable from, or merely
44
+ link (or bind by name) to the interfaces of, the Work and Derivative Works
45
+ thereof.
46
+
47
+ "Contribution" shall mean any work of authorship, including the original
48
+ version of the Work and any modifications or additions to that Work or
49
+ Derivative Works thereof, that is intentionally submitted to Licensor for
50
+ inclusion in the Work by the copyright owner or by an individual or Legal
51
+ Entity authorized to submit on behalf of the copyright owner. For the purposes
52
+ of this definition, "submitted" means any form of electronic, verbal, or
53
+ written communication sent to the Licensor or its representatives, including
54
+ but not limited to communication on electronic mailing lists, source code
55
+ control systems, and issue tracking systems that are managed by, or on behalf
56
+ of, the Licensor for the purpose of discussing and improving the Work, but
57
+ excluding communication that is conspicuously marked or otherwise designated in
58
+ writing by the copyright owner as "Not a Contribution."
59
+
60
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf
61
+ of whom a Contribution has been received by Licensor and subsequently
62
+ incorporated within the Work.
63
+
64
+ 2. Grant of Copyright License. Subject to the terms and conditions of this
65
+ License, each Contributor hereby grants to You a perpetual, worldwide,
66
+ non-exclusive, no-charge, royalty-free, irrevocable copyright license to
67
+ reproduce, prepare Derivative Works of, publicly display, publicly perform,
68
+ sublicense, and distribute the Work and such Derivative Works in Source or
69
+ Object form.
70
+
71
+ 3. Grant of Patent License. Subject to the terms and conditions of this
72
+ License, each Contributor hereby grants to You a perpetual, worldwide,
73
+ non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this
74
+ section) patent license to make, have made, use, offer to sell, sell, import,
75
+ and otherwise transfer the Work, where such license applies only to those
76
+ patent claims licensable by such Contributor that are necessarily infringed by
77
+ their Contribution(s) alone or by combination of their Contribution(s) with the
78
+ Work to which such Contribution(s) was submitted. If You institute patent
79
+ litigation against any entity (including a cross-claim or counterclaim in a
80
+ lawsuit) alleging that the Work or a Contribution incorporated within the Work
81
+ constitutes direct or contributory patent infringement, then any patent
82
+ licenses granted to You under this License for that Work shall terminate as of
83
+ the date such litigation is filed.
84
+
85
+ 4. Redistribution. You may reproduce and distribute copies of the Work or
86
+ Derivative Works thereof in any medium, with or without modifications, and in
87
+ Source or Object form, provided that You meet the following conditions:
88
+
89
+ (a) You must give any other recipients of the Work or Derivative Works a copy
90
+ of this License; and
91
+
92
+ (b) You must cause any modified files to carry prominent notices stating that
93
+ You changed the files; and
94
+
95
+ (c) You must retain, in the Source form of any Derivative Works that You
96
+ distribute, all copyright, patent, trademark, and attribution notices from the
97
+ Source form of the Work, excluding those notices that do not pertain to any
98
+ part of the Derivative Works; and
99
+
100
+ (d) If the Work includes a "NOTICE" text file as part of its distribution,
101
+ then any Derivative Works that You distribute must include a readable copy of
102
+ the attribution notices contained within such NOTICE file, excluding those
103
+ notices that do not pertain to any part of the Derivative Works, in at least
104
+ one of the following places: within a NOTICE text file distributed as part of
105
+ the Derivative Works; within the Source form or documentation, if provided
106
+ along with the Derivative Works; or, within a display generated by the
107
+ Derivative Works, if and wherever such third-party notices normally appear.
108
+ The contents of the NOTICE file are for informational purposes only and do not
109
+ modify the License. You may add Your own attribution notices within Derivative
110
+ Works that You distribute, alongside or as an addendum to the NOTICE text from
111
+ the Work, provided that such additional attribution notices cannot be construed
112
+ as modifying the License.
113
+
114
+ You may add Your own copyright statement to Your modifications and may provide
115
+ additional or different license terms and conditions for use, reproduction, or
116
+ distribution of Your modifications, or for any such Derivative Works as a
117
+ whole, provided Your use, reproduction, and distribution of the Work otherwise
118
+ complies with the conditions stated in this License.
119
+
120
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any
121
+ Contribution intentionally submitted for inclusion in the Work by You to the
122
+ Licensor shall be under the terms and conditions of this License, without any
123
+ additional terms or conditions. Notwithstanding the above, nothing herein shall
124
+ supersede or modify the terms of any separate license agreement you may have
125
+ executed with Licensor regarding such Contributions.
126
+
127
+ 6. Trademarks. This License does not grant permission to use the trade names,
128
+ trademarks, service marks, or product names of the Licensor, except as required
129
+ for reasonable and customary use in describing the origin of the Work and
130
+ reproducing the content of the NOTICE file.
131
+
132
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
133
+ writing, Licensor provides the Work (and each Contributor provides its
134
+ Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
135
+ KIND, either express or implied, including, without limitation, any warranties
136
+ or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
137
+ PARTICULAR PURPOSE. You are solely responsible for determining the
138
+ appropriateness of using or redistributing the Work and assume any risks
139
+ associated with Your exercise of permissions under this License.
140
+
141
+ 8. Limitation of Liability. In no event and under no legal theory, whether in
142
+ tort (including negligence), contract, or otherwise, unless required by
143
+ applicable law (such as deliberate and grossly negligent acts) or agreed to in
144
+ writing, shall any Contributor be liable to You for damages, including any
145
+ direct, indirect, special, incidental, or consequential damages of any character
146
+ arising as a result of this License or out of the use or inability to use the
147
+ Work (including but not limited to damages for loss of goodwill, work stoppage,
148
+ computer failure or malfunction, or any and all other commercial damages or
149
+ losses), even if such Contributor has been advised of the possibility of such
150
+ damages.
151
+
152
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or
153
+ Derivative Works thereof, You may choose to offer, and charge a fee for,
154
+ acceptance of support, warranty, indemnity, or other liability obligations
155
+ and/or rights consistent with this License. However, in accepting such
156
+ obligations, You may act only on Your own behalf and on Your sole
157
+ responsibility, not on behalf of any other Contributor, and only if You agree
158
+ to indemnify, defend, and hold each Contributor harmless for any liability
159
+ incurred by, or claims asserted against, such Contributor by reason of your
160
+ accepting any such warranty or additional liability.
161
+
162
+ END OF TERMS AND CONDITIONS
163
+
164
+ APPENDIX: How to apply the Apache License to your work.
165
+
166
+ To apply the Apache License to your work, attach the following boilerplate
167
+ notice, with the fields enclosed by brackets "[]" replaced with your own
168
+ identifying information. (Don't include the brackets!) The text should be
169
+ enclosed in the appropriate comment syntax for the file format. We also
170
+ recommend that a file or class name and description of purpose be included on
171
+ the same "printed page" as the copyright notice for easier identification
172
+ within third-party archives.
173
+
174
+ Copyright 2026 xqh
175
+
176
+ Licensed under the Apache License, Version 2.0 (the "License");
177
+ you may not use this file except in compliance with the License.
178
+ You may obtain a copy of the License at
179
+
180
+ http://www.apache.org/licenses/LICENSE-2.0
181
+
182
+ Unless required by applicable law or agreed to in writing, software
183
+ distributed under the License is distributed on an "AS IS" BASIS,
184
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
185
+ See the License for the specific language governing permissions and
186
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,4 @@
1
+ artifact-graph
2
+ Copyright 2026 xqh
3
+
4
+ This product includes software developed for the artifact-chain project.
package/README.md ADDED
@@ -0,0 +1,50 @@
1
+ # artifact-graph
2
+
3
+ [中文](README.zh-CN.md)
4
+
5
+ Git-native Markdown artifact graph scanner and validator for agentic coding workflows.
6
+
7
+ `artifact-graph` helps projects keep requirements, scenarios, design notes, source files, tests,
8
+ and version-lock metadata connected. It is designed for deterministic local use before an AI coding
9
+ agent claims implementation work is complete.
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ pnpm add -D artifact-graph
15
+ ```
16
+
17
+ Or install from GitHub:
18
+
19
+ ```bash
20
+ npm install github:mzdbxqh/artifact-graph
21
+ ```
22
+
23
+ Node.js `>=22.0.0` is required. For pnpm 10+, see [INSTALL.md](INSTALL.md) for the native build
24
+ allowlist setup.
25
+
26
+ ## Quick Start
27
+
28
+ ```bash
29
+ artifact-graph init --root .
30
+ artifact-graph validate --root . --warning-only
31
+ artifact-graph version-lock refresh --changed-only --staged --format markdown
32
+ artifact-graph version-lock audit --root . --strict-missing-lock
33
+ ```
34
+
35
+ ## Common Workflows
36
+
37
+ - Generate or inspect project artifact graph configuration with `artifact-graph init`.
38
+ - Validate artifact links with `artifact-graph validate`.
39
+ - Build implementation context with `artifact-graph context` or `artifact-graph packet`.
40
+ - Keep traceability freshness with `artifact-graph version-lock refresh` and `audit`.
41
+ - Install opt-in Git hooks with `artifact-graph hooks install-git --hook all`.
42
+
43
+ ## Related Project
44
+
45
+ Use [`artifact-chain-assistant`](https://github.com/mzdbxqh/artifact-chain-assistant) for Codex and
46
+ Claude Code skills that guide artifact-chain intake, setup, and maintenance.
47
+
48
+ ## License
49
+
50
+ Apache-2.0. See [LICENSE](LICENSE).
@@ -0,0 +1,48 @@
1
+ # artifact-graph
2
+
3
+ [English](README.md)
4
+
5
+ `artifact-graph` 是面向 AI 编程工作流的 Git-native Markdown 制品图扫描和校验工具。
6
+
7
+ 它帮助项目把需求、场景、设计、源码、测试和 version-lock 元数据连接起来,在 AI agent
8
+ 声称实现完成之前,用确定性本地命令检查上下文和追溯关系。
9
+
10
+ ## 安装
11
+
12
+ ```bash
13
+ pnpm add -D artifact-graph
14
+ ```
15
+
16
+ 或从 GitHub 安装:
17
+
18
+ ```bash
19
+ npm install github:mzdbxqh/artifact-graph
20
+ ```
21
+
22
+ 需要 Node.js `>=22.0.0`。pnpm 10+ 需要配置原生构建白名单,详见 [INSTALL.md](INSTALL.md)。
23
+
24
+ ## 快速开始
25
+
26
+ ```bash
27
+ artifact-graph init --root .
28
+ artifact-graph validate --root . --warning-only
29
+ artifact-graph version-lock refresh --changed-only --staged --format markdown
30
+ artifact-graph version-lock audit --root . --strict-missing-lock
31
+ ```
32
+
33
+ ## 常见工作流
34
+
35
+ - 用 `artifact-graph init` 生成或检查项目制品图配置。
36
+ - 用 `artifact-graph validate` 校验制品之间的链接。
37
+ - 用 `artifact-graph context` 或 `artifact-graph packet` 构建实现上下文。
38
+ - 用 `artifact-graph version-lock refresh` 和 `audit` 维护追溯新鲜度。
39
+ - 用 `artifact-graph hooks install-git --hook all` 安装可选 Git hooks。
40
+
41
+ ## 相关项目
42
+
43
+ 如果需要 Codex / Claude Code 的技能、初始化引导和维护流程,请使用
44
+ [`artifact-chain-assistant`](https://github.com/mzdbxqh/artifact-chain-assistant)。
45
+
46
+ ## 开源协议
47
+
48
+ Apache-2.0。详见 [LICENSE](LICENSE)。
package/dist/cli.d.ts ADDED
@@ -0,0 +1,9 @@
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 };