artifact-graph 0.14.1 → 0.16.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 +29 -0
- package/INSTALL.md +9 -0
- package/README.md +24 -1
- package/README.zh-CN.md +20 -1
- package/contracts/spec/schema.json +44 -0
- package/dist/cli.js +905 -271
- package/dist/index.cjs +787 -323
- package/dist/index.d.cts +29 -1
- package/dist/index.d.ts +29 -1
- package/dist/index.js +837 -227
- package/package.json +4 -1
- package/profiles/project-artifact-profiles.json +109 -0
- package/schemas/project-artifact-profiles.schema.json +120 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,35 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.16.0
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- `loadConfig` and `artifact-graph doctor` diagnose declared graph-config field structure and types. A `statuses` value that should be a string array is rejected with a field path. Unknown top-level keys stay compatible and produce a locatable warning; they are not rejected as a class. `allowedEdges` is required on an existing config. `[]`, `null`, or a YAML empty value adopts the filled built-in `DEFAULT_SCHEMA.allowedEdges`. A non-empty list replaces the default table and is a strict from/to/kind whitelist; relations outside it are `DISALLOWED_EDGE`. `forbiddenEdges` still reports `FORBIDDEN_EDGE` first. A missing config file stays unconnected. `extraFields` remains optional index metadata.
|
|
10
|
+
- The package ships the official `artifact.spec@1` Markdown semantic-marker contract at `contracts/spec/schema.json`. `artifact-graph contract explain --contract artifact.spec@1` reports `identity`, `revisionDigest`, and `semanticMarkers`. `artifact-graph contract validate-markers` checks a complete SPEC Markdown file for the required markers `changes`, `scope`, and `acceptance`, and accepts the optional markers `acceptance-record` and `archive-record`. `contract validate` remains JSON-instance validation and does not substitute for Markdown marker checks. Unknown, undefined, empty, or optional-only marker sets are not a mechanical pass.
|
|
11
|
+
|
|
12
|
+
### Breaking Changes
|
|
13
|
+
|
|
14
|
+
- Existing configs that omit `allowedEdges` now fail. `loadConfig` and `doctor` report a field-path diagnostic; the config does not load until the field is declared.
|
|
15
|
+
- A non-empty `allowedEdges` list is now a strict from/to/kind whitelist. Relations outside that list are `DISALLOWED_EDGE` and fail validation. Previous releases accepted those relations unless `forbiddenEdges` matched.
|
|
16
|
+
- `[]`, `null`, or a YAML empty `allowedEdges` value adopts the filled built-in `DEFAULT_SCHEMA.allowedEdges`. Custom project relations are not in that table unless the project writes them after analysing its own artifacts.
|
|
17
|
+
- Migration: declare `allowedEdges` explicitly. Use an empty value only when the built-in default table is the intended contract. After project analysis, write a precise non-empty from/to/kind list for custom relations. Do not copy every scanned edge into the list as a pass-through. `forbiddenEdges` still reports `FORBIDDEN_EDGE` first.
|
|
18
|
+
- Standing parent release policy maps breaking API changes to a major version (for example `0.9.0` → `1.0.0`). This release keeps `0.16.0` as a one-release maintainer exception and records the incompatible behavior. The standing major-version policy is unchanged.
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
- Version lockstep with `artifact-chain-assistant` 0.16.0.
|
|
23
|
+
|
|
24
|
+
## 0.15.0
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
|
|
28
|
+
- The package exports a static recommendation list at `artifact-graph/project-artifact-profiles`, with companion schema `artifact-graph/schemas/project-artifact-profiles.schema.json` and `schema_version` `1.0`. Common minimum types are `feature`, `scenario`, and `design`. The `skill-plugin` standard adds `agent_skill` and `e2e_test`. Lifecycle and capability entries are conditions, not auto-enable rules. Project configuration owns adoption and keeps extra types. Consumers can `require('artifact-graph/project-artifact-profiles')`.
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
|
|
32
|
+
- `version-lock bootstrap` and `refresh` write one `artifactRelations` lock per relation identity when the scan graph keeps multiple source occurrences of the same artifact-to-artifact relation. Scan-graph source evidence is unchanged. A lock file that already contains duplicate `artifactRelations` is still rejected. This release does not auto-repair historically damaged duplicate locks.
|
|
33
|
+
|
|
5
34
|
## 0.14.1
|
|
6
35
|
|
|
7
36
|
### Fixed
|
package/INSTALL.md
CHANGED
|
@@ -379,6 +379,15 @@ With `false`, `resolveArtifactContext` skips baseline injection entirely. No `ba
|
|
|
379
379
|
appears in the context manifest, and the manifest writes `baselinePolicy: false` so that
|
|
380
380
|
packet validation (`validatePacket`) correctly allows `requiredBaseline.total=0`.
|
|
381
381
|
|
|
382
|
+
### Allowed edges
|
|
383
|
+
|
|
384
|
+
Existing `artifact-graph.config.yaml` files must declare `allowedEdges`. Use `[]`, `null`, or a YAML empty value to adopt the built-in `DEFAULT_SCHEMA.allowedEdges`. A non-empty list replaces that table and is a strict from/to/kind whitelist. Relations outside the effective list fail `validate` with `DISALLOWED_EDGE`. `forbiddenEdges` still wins. A missing file stays unconnected; `init` writes the filled default table.
|
|
385
|
+
|
|
386
|
+
```yaml
|
|
387
|
+
# artifact-graph.config.yaml
|
|
388
|
+
allowedEdges: []
|
|
389
|
+
```
|
|
390
|
+
|
|
382
391
|
### Config validation
|
|
383
392
|
|
|
384
393
|
`loadConfig` rejects non-boolean values for `context.universal_baseline`:
|
package/README.md
CHANGED
|
@@ -81,6 +81,26 @@ See [Code Traceability And Coverage Boundaries](INSTALL.md#code-traceability-and
|
|
|
81
81
|
for syntax, scan configuration, classification, exemptions and project isolation. Inspect the
|
|
82
82
|
index before `refresh --all`; there is no `version-lock update --all` operation.
|
|
83
83
|
|
|
84
|
+
### Published type profiles and schema
|
|
85
|
+
|
|
86
|
+
The package exports a static JSON list at the subpath `artifact-graph/project-artifact-profiles`. The companion JSON Schema is `artifact-graph/schemas/project-artifact-profiles.schema.json`. The `schema_version` field is `1.0`.
|
|
87
|
+
|
|
88
|
+
This export is available from version 0.15.0.
|
|
89
|
+
|
|
90
|
+
```js
|
|
91
|
+
const profiles = require('artifact-graph/project-artifact-profiles');
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
`common_minimum` contains exactly three types: `feature`, `scenario`, and `design`.
|
|
95
|
+
|
|
96
|
+
The only approved `project_standards` key is `skill-plugin`. It `extends` `common_minimum` and adds exactly two types: `agent_skill` and `e2e_test`.
|
|
97
|
+
|
|
98
|
+
`lifecycle` and `conditional` entries describe adoption-stage and capability conditions. Stage items and capability items remain candidates. Reading the JSON does not enable project types.
|
|
99
|
+
|
|
100
|
+
The target project's `artifact-graph.config.yaml` owns adoption. Types already declared in that config or in existing method bindings stay, including extra types that are not on the published lists.
|
|
101
|
+
|
|
102
|
+
`loadConfig` and `artifact-graph doctor` diagnose declared field structure and types. A `statuses` value that should be a string array is rejected with a field path. Unknown top-level keys stay compatible and produce a locatable warning; they are not rejected as a class. `allowedEdges` is required on an existing config file. `[]`, `null`, or a YAML empty value adopts the built-in `DEFAULT_SCHEMA.allowedEdges`. A non-empty list replaces that table and is a strict from/to/kind whitelist; relations outside it are `DISALLOWED_EDGE`. `forbiddenEdges` still reports `FORBIDDEN_EDGE` first. A missing config file stays unconnected and is not turned into a valid project. `extraFields` remains optional index metadata. Markdown body contracts are not validated by `contract validate` in this round.
|
|
103
|
+
|
|
84
104
|
### JSON originals for custom types
|
|
85
105
|
|
|
86
106
|
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`.
|
|
@@ -93,7 +113,7 @@ Relations stay in `relationSemantics`, using the existing `kind`, `fields`, `tar
|
|
|
93
113
|
|
|
94
114
|
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
115
|
|
|
96
|
-
A project can point a method at a capability and a release record at a method. The configuration below shows those two directions.
|
|
116
|
+
A project can point a method at a capability and a release record at a method. The configuration below shows those two directions. A non-empty `allowedEdges` list replaces the built-in default table, so the two project relations must be listed; `[]` does not authorize these custom-type relations.
|
|
97
117
|
|
|
98
118
|
```yaml
|
|
99
119
|
types:
|
|
@@ -122,6 +142,9 @@ relationSemantics:
|
|
|
122
142
|
label: Release record points to method
|
|
123
143
|
targetTypes: [method]
|
|
124
144
|
fields: [methods]
|
|
145
|
+
allowedEdges:
|
|
146
|
+
- { from: method, to: capability, kind: applies }
|
|
147
|
+
- { from: skill_release, to: method, kind: releases }
|
|
125
148
|
```
|
|
126
149
|
|
|
127
150
|
A method file stores one capability id under nested properties. `capability.*` looks up a property named `*` and does not collect the neighboring properties.
|
package/README.zh-CN.md
CHANGED
|
@@ -78,6 +78,22 @@ Python 的 `#` 注释目前不受支持。
|
|
|
78
78
|
见 [代码追溯接入说明](INSTALL.md#code-traceability-and-coverage-boundaries)。先确认索引中确有预期节点和关系,
|
|
79
79
|
再运行 `refresh --all` 建立锁;不存在 `version-lock update --all` 操作。
|
|
80
80
|
|
|
81
|
+
### 公开清单与采用边界
|
|
82
|
+
|
|
83
|
+
包提供静态 JSON 清单,公开子路径是 `artifact-graph/project-artifact-profiles`,配套 Schema 是 `artifact-graph/schemas/project-artifact-profiles.schema.json`。字段 `schema_version` 的值是 `1.0`。该入口从 0.15.0 版本开始提供。
|
|
84
|
+
|
|
85
|
+
```js
|
|
86
|
+
const profiles = require('artifact-graph/project-artifact-profiles');
|
|
87
|
+
```
|
|
88
|
+
|
|
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
|
+
|
|
81
97
|
### 自定义类型的 JSON 原文件
|
|
82
98
|
|
|
83
99
|
内置类型继续使用各自的专用解析。`format: json` 只写在项目自己注册的自定义类型上,同一项还要给出 `idField`。省略 `format` 时,文件仍按 Markdown 解析,扫描路径写成 `*.json` 也不改变这一规则。类型声明 `format: json` 之后,才按 JSON 读取。
|
|
@@ -100,7 +116,7 @@ JSON 文件把 `fields` 中的点分字符串当成逐层属性名。
|
|
|
100
116
|
|
|
101
117
|
点号只切开固定的属性名。`*`、筛选条件和 JSONPath 都不是路径语法;名为 `*` 的属性只按这个名字查找。数组里的记录留在原对象中。这一批读取编号,以及 `relationSemantics` 里已经声明的关系。标题、状态、编号拼接、前缀和改写都不在读取范围内。Markdown 字段仍按整个字符串查找,嵌套对象不会被点号拆开。诊断带原文件路径和字段名,行号记为 1。
|
|
102
118
|
|
|
103
|
-
|
|
119
|
+
项目可以把方法指向能力,把发行记录指向方法。下面的配置只示范这两个方向。非空 `allowedEdges` 会完全替换内置默认表,所以这两条项目关系必须写进清单;只写 `[]` 不能授权这些自定义类型。
|
|
104
120
|
|
|
105
121
|
```yaml
|
|
106
122
|
types:
|
|
@@ -129,6 +145,9 @@ relationSemantics:
|
|
|
129
145
|
label: 发行记录对应的方法
|
|
130
146
|
targetTypes: [method]
|
|
131
147
|
fields: [methods]
|
|
148
|
+
allowedEdges:
|
|
149
|
+
- { from: method, to: capability, kind: applies }
|
|
150
|
+
- { from: skill_release, to: method, kind: releases }
|
|
132
151
|
```
|
|
133
152
|
|
|
134
153
|
方法文件把一个能力编号放在嵌套属性里。
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "artifact.spec@1",
|
|
4
|
+
"title": "Artifact Contract: SPEC Increment",
|
|
5
|
+
"description": "Declarative semantic-marker contract for SPEC Markdown. Mechanical check uses comment markers only; JSON body fields are not required and are not validated as hard slots.",
|
|
6
|
+
"version": "1.0.0",
|
|
7
|
+
"contractIdentity": {
|
|
8
|
+
"major": "artifact.spec@1",
|
|
9
|
+
"authority": "artifact",
|
|
10
|
+
"namespace": "artifact",
|
|
11
|
+
"revisionDigest": "sha256:adbb6fd0d923d49463ee461038076858be0f01e54396ea65b82d084d32439060",
|
|
12
|
+
"semanticMarkers": {
|
|
13
|
+
"changes": {
|
|
14
|
+
"jsonPointer": "/changes",
|
|
15
|
+
"markdownMarker": "changes",
|
|
16
|
+
"required": true
|
|
17
|
+
},
|
|
18
|
+
"scope": {
|
|
19
|
+
"jsonPointer": "/scope",
|
|
20
|
+
"markdownMarker": "scope",
|
|
21
|
+
"required": true
|
|
22
|
+
},
|
|
23
|
+
"acceptance": {
|
|
24
|
+
"jsonPointer": "/acceptance",
|
|
25
|
+
"markdownMarker": "acceptance",
|
|
26
|
+
"required": true
|
|
27
|
+
},
|
|
28
|
+
"acceptance_record": {
|
|
29
|
+
"jsonPointer": "/acceptance_record",
|
|
30
|
+
"markdownMarker": "acceptance-record",
|
|
31
|
+
"required": false
|
|
32
|
+
},
|
|
33
|
+
"archive_record": {
|
|
34
|
+
"jsonPointer": "/archive_record",
|
|
35
|
+
"markdownMarker": "archive-record",
|
|
36
|
+
"required": false
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"type": "object",
|
|
41
|
+
"required": [],
|
|
42
|
+
"properties": {},
|
|
43
|
+
"additionalProperties": true
|
|
44
|
+
}
|