skill-family-contracts 0.2.0 → 0.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 +21 -0
- package/CHANGELOG.zh-CN.md +21 -0
- package/NOTICE +10 -0
- package/README.md +205 -113
- package/README.zh-CN.md +265 -0
- package/candidate/quickstart-profile/fixtures/resource-negative-bad-digest.json +13 -0
- package/candidate/quickstart-profile/fixtures/resource-positive.json +13 -0
- package/candidate/quickstart-profile/index.mjs +59 -0
- package/candidate/quickstart-profile/resource.schema.json +66 -0
- package/candidate/quickstart-profile/result.schema.json +154 -0
- package/candidate/quickstart-profile/task.schema.json +90 -0
- package/package.json +12 -2
- package/release-notes/0.2.1.yaml +23 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
<!-- release-skill:changelog:start version=0.2.1 locale=en baseline=sha256:b759650e4d52969bd907bccea937c64622b00b0ff97851da9c6c4aee8adb4888 -->
|
|
4
|
+
## [0.2.1] - 2026-08-10
|
|
5
|
+
|
|
6
|
+
This release adds a candidate Quickstart Profile contract surface and makes the package release documentation available in English and Simplified Chinese.
|
|
7
|
+
|
|
8
|
+
### Added
|
|
9
|
+
|
|
10
|
+
- Adds candidate Resource, Task, and Result schemas with strict validation helpers. The candidate schemas remain outside the stable Contracts registry.
|
|
11
|
+
- Adds complete English and Simplified Chinese package documentation, including an agent quick-reference section.
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- Manages the current README and CHANGELOG release sections from one bilingual, versioned notes source.
|
|
16
|
+
- Distributes the project NOTICE separately from the Apache-2.0 LICENSE.
|
|
17
|
+
|
|
18
|
+
### Upgrade Notes
|
|
19
|
+
|
|
20
|
+
Stable registry consumers do not need to change. Import the Quickstart Profile only through its candidate subpath and do not treat it as a frozen Contracts object.
|
|
21
|
+
<!-- release-skill:changelog:end version=0.2.1 locale=en -->
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# 变更日志
|
|
2
|
+
|
|
3
|
+
<!-- release-skill:changelog:start version=0.2.1 locale=zh-CN baseline=sha256:1f9b53564843c024415fda87d41abf96bc22db2ec5b90d12d7a8cd7c897a24fc -->
|
|
4
|
+
## [0.2.1] - 2026-08-10
|
|
5
|
+
|
|
6
|
+
本版新增 Quickstart Profile 候选契约面,并为包发布文档提供完整英文版与简体中文版。
|
|
7
|
+
|
|
8
|
+
### 新增
|
|
9
|
+
|
|
10
|
+
- 新增候选 Resource、Task、Result Schema 及其严格校验辅助函数。这组候选 Schema 不进入稳定 Contracts 登记表。
|
|
11
|
+
- 新增完整的英文与简体中文包文档,并补充智能体快速参考章节。
|
|
12
|
+
|
|
13
|
+
### 变更
|
|
14
|
+
|
|
15
|
+
- 使用同一份双语版本化说明源管理当前 README 与 CHANGELOG 的发布区域。
|
|
16
|
+
- 项目 NOTICE 与 Apache-2.0 LICENSE 分开分发。
|
|
17
|
+
|
|
18
|
+
### 升级说明
|
|
19
|
+
|
|
20
|
+
稳定登记表的消费者无需修改。Quickstart Profile 只能通过 candidate 子路径导入,不得把它当作已冻结的 Contracts 对象。
|
|
21
|
+
<!-- release-skill:changelog:end version=0.2.1 locale=zh-CN -->
|
package/NOTICE
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Skill Family Foundation
|
|
2
|
+
=======================
|
|
3
|
+
|
|
4
|
+
Copyright 2026 广州市风荷科技有限公司
|
|
5
|
+
|
|
6
|
+
Licensed under the Apache License, Version 2.0.
|
|
7
|
+
|
|
8
|
+
This NOTICE contains project attribution for Skill Family Foundation. Third-party
|
|
9
|
+
attribution and license texts distributed with skill-family-engineering-kit are
|
|
10
|
+
recorded separately in THIRD_PARTY_NOTICES and the corresponding license files.
|
package/README.md
CHANGED
|
@@ -1,21 +1,98 @@
|
|
|
1
1
|
<!-- release-skill:safe-first-command -->
|
|
2
2
|
<!-- release-skill:external-write-boundary -->
|
|
3
|
+
> 简体中文版:[README.zh-CN.md](./README.zh-CN.md)
|
|
3
4
|
|
|
4
5
|
# skill-family-contracts
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
<!-- release-skill:release-version: 0.2.1 -->
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
协议名/`$id` 登记表,以及九种有限机械检查类型与受限强制规则集。
|
|
10
|
-
本包不执行骨架生成、文件写入、审计或发布;机制实现由 Harness 承担,
|
|
11
|
-
工程命令由 Kit 承担,二者单向消费本包。
|
|
9
|
+
The single authoritative package of machine-executable engineering structure and mechanism protocols (Contracts 1.4.0, frozen).
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
<!-- release-skill:managed:start id=latest-release -->
|
|
12
|
+
**0.2.1** (2026-08-10)
|
|
15
13
|
|
|
16
|
-
|
|
14
|
+
This release adds a candidate Quickstart Profile contract surface and makes the package release documentation available in English and Simplified Chinese.
|
|
17
15
|
|
|
18
|
-
|
|
16
|
+
**Added**
|
|
17
|
+
|
|
18
|
+
- Adds candidate Resource, Task, and Result schemas with strict validation helpers. The candidate schemas remain outside the stable Contracts registry.
|
|
19
|
+
- Adds complete English and Simplified Chinese package documentation, including an agent quick-reference section.
|
|
20
|
+
|
|
21
|
+
**Changed**
|
|
22
|
+
|
|
23
|
+
- Manages the current README and CHANGELOG release sections from one bilingual, versioned notes source.
|
|
24
|
+
- Distributes the project NOTICE separately from the Apache-2.0 LICENSE.
|
|
25
|
+
|
|
26
|
+
**Upgrade Notes**
|
|
27
|
+
|
|
28
|
+
Stable registry consumers do not need to change. Import the Quickstart Profile only through its candidate subpath and do not treat it as a frozen Contracts object.
|
|
29
|
+
<!-- release-skill:managed:end id=latest-release -->
|
|
30
|
+
|
|
31
|
+
## Problem It Solves
|
|
32
|
+
|
|
33
|
+
When every skill-family project writes its own set of structural contracts, you get schema drift, inconsistent error codes, and protocol-name collisions. Contracts consolidates the structure, protocols, error codes, and protocol-name registry into one frozen machine-readable authority, so that the Harness and Kit consume it unidirectionally instead of each interpreting it independently.
|
|
34
|
+
|
|
35
|
+
## Core Mental Model
|
|
36
|
+
|
|
37
|
+
Contracts is the "definition and registry" layer, not the "execution" layer. It owns the JSON Schemas for the eighteen top-level object classes, the Kernel Protocol, the stable error codes, the protocol-name and `$id` registry, and the nine finite mechanical check types together with a restricted set of mandatory rules. This package does not perform skeleton generation, file writing, auditing, or publishing; mechanism implementation is owned by the Harness, and engineering commands are owned by the Kit.
|
|
38
|
+
|
|
39
|
+
Schema validation is based entirely on [Ajv](https://ajv.js.org/) (exact version in `package.json`), routing by dialect to the corresponding Ajv class; no hand-written schema-subset interpreter is implemented.
|
|
40
|
+
|
|
41
|
+
## Installation and Minimal Example
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
npm install skill-family-contracts@0.2.1
|
|
45
|
+
npm info skill-family-contracts --help
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The minimal example starts from an empty directory and demonstrates how to validate a registered contract object:
|
|
49
|
+
|
|
50
|
+
```js
|
|
51
|
+
// Run from an empty directory: npm install skill-family-contracts@0.2.1
|
|
52
|
+
import { validateDocument } from "skill-family-contracts";
|
|
53
|
+
|
|
54
|
+
const document = {
|
|
55
|
+
schemaVersion: 1,
|
|
56
|
+
kind: "skill-family.project-manifest",
|
|
57
|
+
project: { id: "my-project", name: "My Project", description: "Example" },
|
|
58
|
+
contracts: { version: "1.0.0", profile: "generic" },
|
|
59
|
+
managedFiles: ["package.json"],
|
|
60
|
+
updatedAt: "2026-01-01T00:00:00Z",
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const result = validateDocument(document, {
|
|
64
|
+
schemaId: "https://contracts.skill-family.example/v1/project-manifest.json",
|
|
65
|
+
dialect: "2020-12",
|
|
66
|
+
});
|
|
67
|
+
if (!result.valid) console.error(result.errorCode);
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
The code above shows the basic `validateDocument` call: pass the document and the target Schema's `$id`, and it returns `{ valid, errorCode, errors, data }`, where `data` is a normalized copy and the original input is not modified.
|
|
71
|
+
|
|
72
|
+
## Candidate Quickstart Profile
|
|
73
|
+
|
|
74
|
+
Use the candidate Quickstart Profile to evaluate an early Resource → Task → Result exchange before proposing it for the frozen registry:
|
|
75
|
+
|
|
76
|
+
```js
|
|
77
|
+
import {
|
|
78
|
+
QUICKSTART_PROTOCOL,
|
|
79
|
+
quickstartProfileSchemas,
|
|
80
|
+
validateQuickstartProfileDocument,
|
|
81
|
+
} from "skill-family-contracts/candidate/quickstart-profile";
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
The subpath is public but **not stable**. Its schemas are deliberately absent from `src/registry.json`, do not expand the eighteen stable object classes, and may change or be removed in a later minor release. Consumers should pin the exact package version and keep candidate imports outside their stable public API. Use the root package export for production contracts that require frozen registry and compatibility guarantees.
|
|
85
|
+
|
|
86
|
+
## Typical Use Cases
|
|
87
|
+
|
|
88
|
+
- Need to validate whether a contract document conforms to a registered Schema: use `validateDocument`.
|
|
89
|
+
- Need to look up a Schema by object name or `$id`, or look up a Kernel Protocol by protocol name: use `loadRegistry` / `findSchemaByObject` / `findProtocol`.
|
|
90
|
+
- Need to run mandatory mechanical rules and collect unresolved references: use `runChecks` / `collectUnresolvedRefs`.
|
|
91
|
+
- Need to enumerate and validate the public fixtures: use `verifyAllFixtures`.
|
|
92
|
+
|
|
93
|
+
## Eighteen Top-Level Object Classes
|
|
94
|
+
|
|
95
|
+
| Object | `$id` | Schema File |
|
|
19
96
|
| --- | --- | --- |
|
|
20
97
|
| `project-manifest` | `https://contracts.skill-family.example/v1/project-manifest.json` | `src/schemas/project-manifest.schema.json` |
|
|
21
98
|
| `profile-descriptor` | `https://contracts.skill-family.example/v1/profile-descriptor.json` | `src/schemas/profile-descriptor.schema.json` |
|
|
@@ -34,84 +111,66 @@ Schema 验证完全基于 [Ajv](https://ajv.js.org/)(精确版本见 `package.
|
|
|
34
111
|
| `host-registry` | `https://contracts.skill-family.example/v1/host-registry.json` | `src/schemas/host-registry.schema.json` |
|
|
35
112
|
| `host-probe-result` | `https://contracts.skill-family.example/v1/host-probe-result.json` | `src/schemas/host-probe-result.schema.json` |
|
|
36
113
|
| `state-event-envelope` | `https://contracts.skill-family.example/v1/state-event-envelope.json` | `src/schemas/state-event-envelope.schema.json` |
|
|
37
|
-
| `state-snapshot-metadata` | `https://contracts.skill-family.example/v1/state-snapshot-metadata.json` | `src/schemas/state-snapshot-metadata.
|
|
114
|
+
| `state-snapshot-metadata` | `https://contracts.skill-family.example/v1/state-snapshot-metadata.json` | `src/schemas/state-snapshot-metadata.json` |
|
|
38
115
|
|
|
39
|
-
|
|
40
|
-
`schemaVersion: 1` + 唯一 `kind` 常量 + 各层 `additionalProperties: false`。
|
|
41
|
-
`$id` 命名空间 `contracts.skill-family.example` 使用保留示例域,永不解析到真实站点。
|
|
116
|
+
All v1 Schemas use the draft 2020-12 dialect; instance envelopes are uniformly `schemaVersion: 1` + a unique `kind` constant + `additionalProperties: false` at each layer. The `$id` namespace `contracts.skill-family.example` uses a reserved example domain and never resolves to a real site.
|
|
42
117
|
|
|
43
|
-
## Kernel Protocol
|
|
118
|
+
## Kernel Protocol
|
|
44
119
|
|
|
45
|
-
|
|
120
|
+
Registry: `src/registry.json`; frozen definition: `src/kernel-protocol.json`.
|
|
46
121
|
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
|
|
50
|
-
-
|
|
51
|
-
入口可直接 `rejected`。
|
|
52
|
-
- v1 操作词汇表只冻结 `validate`,其 params 合同在
|
|
53
|
-
`kernel-protocol.json` 内定义(`schemaId` + `document` 必填)。
|
|
54
|
-
新增操作名属于合同变更,需新版本登记。
|
|
122
|
+
- Protocol name: `skill-family.kernel.operation`, version `1`, status `stable`.
|
|
123
|
+
- State set: `accepted`, `running`, `succeeded`, `failed`, `rejected`; terminal states are `succeeded`, `failed`, `rejected`; `operation-result` carries only terminal states.
|
|
124
|
+
- Transitions: `accepted → running → succeeded|failed`, with `accepted → failed` also allowed; the entry may directly `rejected`.
|
|
125
|
+
- The v1 operation vocabulary freezes only `validate`, whose params contract is defined inside `kernel-protocol.json` (`schemaId` + `document` required). Adding a new operation name is a contract change and requires a new version registration.
|
|
55
126
|
|
|
56
|
-
|
|
57
|
-
`registerSchema` 抛出 `SFC1003`;检查类型 `protocol.unique-name` 与
|
|
58
|
-
`schema.unique-id` 对登记表做同样判定。
|
|
127
|
+
Duplicate-name protocols and duplicate `$id`s are machine-rejected: `registerProtocol` throws `SFC1004`, `registerSchema` throws `SFC1003`; the check types `protocol.unique-name` and `schema.unique-id` make the same determination against the registry.
|
|
59
128
|
|
|
60
|
-
##
|
|
129
|
+
## Stable Error Codes
|
|
61
130
|
|
|
62
|
-
|
|
63
|
-
`SFC2xxx` 为内核操作错误,`SFC3xxx` 为报告绑定错误。码只增不改、不复用。v1 冻结:
|
|
131
|
+
Frozen registry: `src/error-codes.json`. `SFC1xxx` are contract-authority-layer errors, `SFC2xxx` are kernel-operation errors, `SFC3xxx` are report-binding errors. Codes are only added, never modified or reused. Frozen in v1:
|
|
64
132
|
|
|
65
|
-
|
|
|
133
|
+
| Code | Name | Summary |
|
|
66
134
|
| --- | --- | --- |
|
|
67
|
-
| SFC1001 | SCHEMA_VALIDATION_FAILED |
|
|
68
|
-
| SFC1002 | UNKNOWN_SCHEMA_ID | `$id`
|
|
69
|
-
| SFC1003 | DUPLICATE_SCHEMA_ID |
|
|
70
|
-
| SFC1004 | DUPLICATE_PROTOCOL_NAME |
|
|
71
|
-
| SFC1005 | UNRESOLVED_REF | `$ref`
|
|
72
|
-
| SFC1006 | UNSUPPORTED_DIALECT |
|
|
73
|
-
| SFC1007 | UNKNOWN_CHECK_TYPE |
|
|
74
|
-
| SFC1008 | RULE_BUDGET_EXCEEDED |
|
|
75
|
-
| SFC1009 | UNKNOWN_ERROR_CODE |
|
|
76
|
-
| SFC1010 | FIXTURE_EXPECTATION_MISMATCH |
|
|
77
|
-
| SFC1011 | UNKNOWN_PROTOCOL |
|
|
78
|
-
| SFC1012 | SCHEMA_COMPILE_FAILED | Schema
|
|
79
|
-
| SFC2002 | UNKNOWN_OPERATION |
|
|
80
|
-
| SFC2003 | INVALID_PARAMS |
|
|
81
|
-
| SFC2004 | EXECUTION_FAILED |
|
|
82
|
-
| SFC3001 | REPORT_DIGEST_MISMATCH |
|
|
83
|
-
| SFC3002 | REPORT_ELEMENT_MISSING |
|
|
84
|
-
| SFC3003 | REPORT_FACT_DRIFT |
|
|
85
|
-
|
|
86
|
-
##
|
|
87
|
-
|
|
88
|
-
-
|
|
89
|
-
|
|
90
|
-
-
|
|
91
|
-
- `
|
|
92
|
-
|
|
93
|
-
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
## Fixture
|
|
108
|
-
|
|
109
|
-
`src/fixtures/<contract>/` 为每类合同提供正例(positive)、反例(negative)
|
|
110
|
-
与方言边界(dialect-boundary)样例,共 76 个。每个 fixture 声明目标 Schema、
|
|
111
|
-
方言、策略与期望;反例期望携带稳定失败码。`verifyAllFixtures()` 机械重放全部期望,
|
|
112
|
-
行为不符报 `SFC1010`。fixture 是完全虚构数据,不是审计 oracle。
|
|
113
|
-
|
|
114
|
-
## API 概览
|
|
135
|
+
| SFC1001 | SCHEMA_VALIDATION_FAILED | Document failed target Schema validation |
|
|
136
|
+
| SFC1002 | UNKNOWN_SCHEMA_ID | `$id` not registered in the registry |
|
|
137
|
+
| SFC1003 | DUPLICATE_SCHEMA_ID | Duplicate `$id` registration rejected |
|
|
138
|
+
| SFC1004 | DUPLICATE_PROTOCOL_NAME | Duplicate protocol name/version registration rejected |
|
|
139
|
+
| SFC1005 | UNRESOLVED_REF | `$ref` target cannot be resolved |
|
|
140
|
+
| SFC1006 | UNSUPPORTED_DIALECT | Dialect not in the frozen support set |
|
|
141
|
+
| SFC1007 | UNKNOWN_CHECK_TYPE | Rule uses a check type outside the nine categories |
|
|
142
|
+
| SFC1008 | RULE_BUDGET_EXCEEDED | Mandatory rule count exceeds budget/limit |
|
|
143
|
+
| SFC1009 | UNKNOWN_ERROR_CODE | References an unregistered error code |
|
|
144
|
+
| SFC1010 | FIXTURE_EXPECTATION_MISMATCH | Fixture behavior does not match declared expectation |
|
|
145
|
+
| SFC1011 | UNKNOWN_PROTOCOL | Request references an unregistered protocol name/version |
|
|
146
|
+
| SFC1012 | SCHEMA_COMPILE_FAILED | Schema itself cannot be compiled |
|
|
147
|
+
| SFC2002 | UNKNOWN_OPERATION | Operation name not in the frozen vocabulary |
|
|
148
|
+
| SFC2003 | INVALID_PARAMS | Parameters do not satisfy the operation's frozen params contract |
|
|
149
|
+
| SFC2004 | EXECUTION_FAILED | Mechanism runtime execution failed (only demonstrable at runtime) |
|
|
150
|
+
| SFC3001 | REPORT_DIGEST_MISMATCH | Report or result digest inconsistent with binding |
|
|
151
|
+
| SFC3002 | REPORT_ELEMENT_MISSING | Report missing a mandatory element |
|
|
152
|
+
| SFC3003 | REPORT_FACT_DRIFT | Report bytes deviate from deterministic re-render result |
|
|
153
|
+
|
|
154
|
+
## Dialects and Validation Strategy (Ajv)
|
|
155
|
+
|
|
156
|
+
- Supported dialects: `draft-07`, `2020-12`. Draft detection uses `$schema` URI mapping (`detectDialect`), and validation routes by dialect to the corresponding Ajv class.
|
|
157
|
+
- Validation strategy (`VALIDATION_POLICIES`):
|
|
158
|
+
- `strict` (default): no type coercion, no injected defaults; Ajv strict mode fully enabled;
|
|
159
|
+
- `tolerant`: enables Ajv `coerceTypes: "array"` and `useDefaults`, for adoption scenarios.
|
|
160
|
+
- Format: `date-time` (RFC 3339, including calendar-validity checks) registered via Ajv `addFormat`.
|
|
161
|
+
- `validateDocument` never modifies the caller's input; the normalized copy is returned in the result's `data` field.
|
|
162
|
+
|
|
163
|
+
## Nine Mechanical Check Types and the Rule Budget
|
|
164
|
+
|
|
165
|
+
Registry: `src/rules.json`. The check-type set is closed, with nine types total: `schema.compile`, `schema.unique-id`, `protocol.unique-name`, `schema.ref-resolves`, `schema.dialect-declared`, `fixture.positive-passes`, `fixture.negative-coded`, `error-code.registered`, `rules.budget`.
|
|
166
|
+
|
|
167
|
+
There are currently **9** mandatory rules (CR-001, CR-006…CR-013). Among them, CR-001 performs uniform compilation of all Schemas in the registry, instead of occupying one rule per object; the budget cap is 20 rules, absolute cap 30 rules; `rules.budget` is a mechanical gate, and exceeding it fails `runChecks` with `SFC1008`.
|
|
168
|
+
|
|
169
|
+
## Fixtures
|
|
170
|
+
|
|
171
|
+
`src/fixtures/<contract>/` provides positive, negative, and dialect-boundary samples for each contract class. Each fixture declares the target Schema, dialect, policy, and expectation; negative expectations carry a stable failure code. `verifyAllFixtures()` mechanically replays all expectations, and reports `SFC1010` on mismatch. Fixtures are entirely fictional data, not an audit oracle.
|
|
172
|
+
|
|
173
|
+
## API Overview
|
|
115
174
|
|
|
116
175
|
```js
|
|
117
176
|
import {
|
|
@@ -125,48 +184,81 @@ import {
|
|
|
125
184
|
} from "skill-family-contracts";
|
|
126
185
|
```
|
|
127
186
|
|
|
128
|
-
|
|
129
|
-
`{ valid, errorCode, errors, data }`;
|
|
130
|
-
- `runChecks({ rules?, registry?, fixtures?, loadSchema? })` →
|
|
131
|
-
`{ ok, mandatoryCount, budget, results }`;
|
|
132
|
-
- `registerSchema` / `registerProtocol` 返回新登记表副本,重复项分别以
|
|
133
|
-
`SFC1003` / `SFC1004` 抛出 `ContractsError`。
|
|
187
|
+
The imports above list the stable public surface of this package; `validateDocument` and `runChecks` are the most commonly used entry points. `validateDocument(document, { schemaId | schema, dialect, policy })` returns `{ valid, errorCode, errors, data }`; `runChecks({ rules?, registry?, fixtures?, loadSchema? })` returns `{ ok, mandatoryCount, budget, results }`; `registerSchema` / `registerProtocol` return a new registry copy, throwing `ContractsError` with `SFC1003` / `SFC1004` respectively on duplicates.
|
|
134
188
|
|
|
135
|
-
##
|
|
189
|
+
## Security Boundaries and Non-Goals
|
|
136
190
|
|
|
137
|
-
|
|
138
|
-
消费者冒烟结果、领域审计报告或自由文本规则语言;不建通用 DSL。
|
|
139
|
-
冻结内容的变更只能作为新的合同版本任务进行。
|
|
191
|
+
It does not own generation, semantic auditing, publishing state, or remote writing; it does not define cleanup plans, publish snapshots, consumer smoke results, domain audit reports, or a free-text rule language; it does not build a general DSL. Changes to frozen content can only be carried out as a new contract-version task.
|
|
140
192
|
|
|
141
|
-
##
|
|
193
|
+
## Troubleshooting
|
|
142
194
|
|
|
143
|
-
|
|
144
|
-
npm install skill-family-contracts@0.2.0
|
|
145
|
-
npm info skill-family-contracts --help
|
|
146
|
-
```
|
|
195
|
+
On validation failure `errorCode` is `SFC1001` (SCHEMA_VALIDATION_FAILED, document failed target Schema validation); when `$id` is unregistered it reports `SFC1002` (UNKNOWN_SCHEMA_ID). If it fails, check whether the document satisfies the target Schema's required fields and type constraints.
|
|
147
196
|
|
|
148
|
-
##
|
|
197
|
+
## Further Documentation
|
|
149
198
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
199
|
+
- Architecture boundaries and routing: [Architecture](https://ifoohoo.github.io/skill-family-engineering-kit/architecture/), [Agent architecture routing](https://ifoohoo.github.io/skill-family-engineering-kit/agents/architecture-routing/)
|
|
200
|
+
- Capability catalog: [capability-catalog.json](https://ifoohoo.github.io/skill-family-engineering-kit/agents/capability-catalog.json)
|
|
201
|
+
- Current product status: [Public status](https://ifoohoo.github.io/skill-family-engineering-kit/public/status/)
|
|
153
202
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
kind: "skill-family.project-manifest",
|
|
157
|
-
project: { id: "my-project", name: "My Project", description: "Example" },
|
|
158
|
-
contracts: { version: "1.0.0", profile: "generic" },
|
|
159
|
-
managedFiles: ["package.json"],
|
|
160
|
-
updatedAt: "2026-01-01T00:00:00Z",
|
|
161
|
-
};
|
|
203
|
+
<!-- agent-quick-reference:start -->
|
|
204
|
+
## Agent Quick Reference
|
|
162
205
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
206
|
+
### Use when
|
|
207
|
+
|
|
208
|
+
- You need to validate a registered contract object, look up a Schema/protocol, or run mandatory mechanical rules.
|
|
209
|
+
- You need to enumerate and validate public fixtures, or deterministically serialize the contract surface.
|
|
210
|
+
- You need to evaluate the non-stable Quickstart Resource/Task/Result profile with an exact package-version pin.
|
|
211
|
+
|
|
212
|
+
### Do not use when
|
|
213
|
+
|
|
214
|
+
- You need to validate a consumer's own business Schema (the consumer should own it; Foundation does not replace it).
|
|
215
|
+
- You need to mix domain semantic validation into the general contract.
|
|
216
|
+
- You need a compatibility-frozen Quickstart profile; the candidate subpath is not registered as stable.
|
|
217
|
+
|
|
218
|
+
### Capability selection
|
|
219
|
+
|
|
220
|
+
- `foundation.contracts.object-validation`: Ajv dual-dialect validation of the 18 object classes.
|
|
221
|
+
- `foundation.contracts.registry-protocol`: Schema `$id` and protocol-name registry query.
|
|
222
|
+
- `foundation.contracts.kernel-protocol`: operation-request/result protocol.
|
|
223
|
+
- `foundation.contracts.mandatory-checks`: nine mandatory rules and unresolved references.
|
|
224
|
+
- `foundation.contracts.fixture-verification`: full fixture replay.
|
|
225
|
+
- `foundation.contracts.error-codes`: stable error-code system.
|
|
226
|
+
- `foundation.contracts.audit-surface`: canonical JSON + sha256 digest.
|
|
227
|
+
- `foundation.contracts.quickstart-profile-candidate`: candidate-only Resource/Task/Result schemas and validation through the exact-version subpath.
|
|
228
|
+
|
|
229
|
+
### Required inputs
|
|
230
|
+
|
|
231
|
+
- The document to validate (carrying a registered `$id`), or the target contract object name.
|
|
232
|
+
- The validation policy `strict` (default) or `tolerant`.
|
|
233
|
+
|
|
234
|
+
### Outputs and evidence
|
|
235
|
+
|
|
236
|
+
- `validateDocument` returns `{ valid, errorCode, errors, data }`.
|
|
237
|
+
- Evidence: `packages/skill-family-contracts/test/validator.test.mjs`, `registry.test.mjs`, `checker.test.mjs`, `fixtures.test.mjs`.
|
|
238
|
+
|
|
239
|
+
### Side effects
|
|
240
|
+
|
|
241
|
+
- Pure functions; no filesystem, Git, network, or process side effects (the compile cache lives only in memory).
|
|
242
|
+
|
|
243
|
+
### Failure semantics
|
|
244
|
+
|
|
245
|
+
- Stable error codes such as `SFC1001/1002/1006`; the error object carries `stableError` and `details.kind`.
|
|
246
|
+
- Frozen error codes are only added, never modified; no drift.
|
|
247
|
+
|
|
248
|
+
### Architectural invariants
|
|
249
|
+
|
|
250
|
+
- The set of 18 top-level object classes is fixed; additions require an ADR; the error-code freeze does not drift.
|
|
251
|
+
- The validator is exclusively Ajv 8.20.0 (exact pin); no other implementation is accepted.
|
|
252
|
+
|
|
253
|
+
### Route elsewhere when
|
|
254
|
+
|
|
255
|
+
- Consumer business Schema validation: stays with the caller.
|
|
256
|
+
- Remote publish writing: route to release-skill.
|
|
257
|
+
- Domain audit semantics: route to a standalone audit consumer.
|
|
169
258
|
|
|
170
|
-
|
|
259
|
+
### Machine-readable sources
|
|
171
260
|
|
|
172
|
-
|
|
261
|
+
- Public capability catalog: [`capability-catalog.json`](https://ifoohoo.github.io/skill-family-engineering-kit/agents/capability-catalog.json) (`foundation.contracts.*` entries).
|
|
262
|
+
- Package-local structural contract: `src/registry.json`, `src/schemas/*`.
|
|
263
|
+
- Package-local candidate source: `candidate/quickstart-profile/*`; public import: `skill-family-contracts/candidate/quickstart-profile`.
|
|
264
|
+
<!-- agent-quick-reference:end -->
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
<!-- release-skill:safe-first-command -->
|
|
2
|
+
<!-- release-skill:external-write-boundary -->
|
|
3
|
+
|
|
4
|
+
> English version: [README.md](./README.md)
|
|
5
|
+
|
|
6
|
+
# skill-family-contracts
|
|
7
|
+
|
|
8
|
+
<!-- release-skill:release-version: 0.2.1 -->
|
|
9
|
+
|
|
10
|
+
机器可执行工程结构和机制协议的唯一权威包(Contracts 1.4.0,冻结)。
|
|
11
|
+
|
|
12
|
+
<!-- release-skill:managed:start id=latest-release -->
|
|
13
|
+
**0.2.1** (2026-08-10)
|
|
14
|
+
|
|
15
|
+
本版新增 Quickstart Profile 候选契约面,并为包发布文档提供完整英文版与简体中文版。
|
|
16
|
+
|
|
17
|
+
**新增**
|
|
18
|
+
|
|
19
|
+
- 新增候选 Resource、Task、Result Schema 及其严格校验辅助函数。这组候选 Schema 不进入稳定 Contracts 登记表。
|
|
20
|
+
- 新增完整的英文与简体中文包文档,并补充智能体快速参考章节。
|
|
21
|
+
|
|
22
|
+
**变更**
|
|
23
|
+
|
|
24
|
+
- 使用同一份双语版本化说明源管理当前 README 与 CHANGELOG 的发布区域。
|
|
25
|
+
- 项目 NOTICE 与 Apache-2.0 LICENSE 分开分发。
|
|
26
|
+
|
|
27
|
+
**升级说明**
|
|
28
|
+
|
|
29
|
+
稳定登记表的消费者无需修改。Quickstart Profile 只能通过 candidate 子路径导入,不得把它当作已冻结的 Contracts 对象。
|
|
30
|
+
<!-- release-skill:managed:end id=latest-release -->
|
|
31
|
+
|
|
32
|
+
## 解决的问题
|
|
33
|
+
|
|
34
|
+
技能族项目各自写一套结构契约,会出现 Schema 漂移、错误码不一致、协议名冲突。Contracts 把结构、协议、错误码与协议名登记收敛成一份冻结的机器可读权威,让 Harness 与 Kit 单向消费,不再各自解释。
|
|
35
|
+
|
|
36
|
+
## 核心心智模型
|
|
37
|
+
|
|
38
|
+
Contracts 是「定义与登记」层,不是「执行」层。它拥有十八类顶层对象的 JSON Schema、Kernel Protocol(内核协议)、稳定错误码、协议名与 `$id` 登记表,以及九种有限机械检查类型与受限强制规则集。本包不执行骨架生成、文件写入、审计或发布;机制实现由 Harness 承担,工程命令由 Kit 承担。
|
|
39
|
+
|
|
40
|
+
Schema 验证完全基于 [Ajv](https://ajv.js.org/)(精确版本见 `package.json`),按方言路由到对应 Ajv 类;不实现任何手写 Schema 子集解释器。
|
|
41
|
+
|
|
42
|
+
## 安装和最小示例
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
npm install skill-family-contracts@0.2.1
|
|
46
|
+
npm info skill-family-contracts --help
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
最小示例从空目录开始,演示如何校验一份已登记契约对象:
|
|
50
|
+
|
|
51
|
+
```js
|
|
52
|
+
// 从空目录运行:npm install skill-family-contracts@0.2.1
|
|
53
|
+
import { validateDocument } from "skill-family-contracts";
|
|
54
|
+
|
|
55
|
+
const document = {
|
|
56
|
+
schemaVersion: 1,
|
|
57
|
+
kind: "skill-family.project-manifest",
|
|
58
|
+
project: { id: "my-project", name: "My Project", description: "Example" },
|
|
59
|
+
contracts: { version: "1.0.0", profile: "generic" },
|
|
60
|
+
managedFiles: ["package.json"],
|
|
61
|
+
updatedAt: "2026-01-01T00:00:00Z",
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const result = validateDocument(document, {
|
|
65
|
+
schemaId: "https://contracts.skill-family.example/v1/project-manifest.json",
|
|
66
|
+
dialect: "2020-12",
|
|
67
|
+
});
|
|
68
|
+
if (!result.valid) console.error(result.errorCode);
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
以上代码展示了 `validateDocument` 的基本调用:传入文档与目标 Schema 的 `$id`,返回 `{ valid, errorCode, errors, data }`,其中 `data` 是规范化后的副本,原输入不被修改。
|
|
72
|
+
|
|
73
|
+
## Candidate Quickstart Profile
|
|
74
|
+
|
|
75
|
+
需要在进入冻结登记表前评估早期 Resource → Task → Result 交换时,使用 candidate Quickstart Profile:
|
|
76
|
+
|
|
77
|
+
```js
|
|
78
|
+
import {
|
|
79
|
+
QUICKSTART_PROTOCOL,
|
|
80
|
+
quickstartProfileSchemas,
|
|
81
|
+
validateQuickstartProfileDocument,
|
|
82
|
+
} from "skill-family-contracts/candidate/quickstart-profile";
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
以上子路径公开但**不稳定**。这些 Schema 刻意不进入 `src/registry.json`,不扩张十八类稳定对象,后续小版本可以修改或移除。调用方需要锁定精确包版本,并避免把 candidate 导入转成自身稳定公共 API。生产合同若需要冻结登记与兼容性保证,继续使用包根导出。
|
|
86
|
+
|
|
87
|
+
## 典型使用场景
|
|
88
|
+
|
|
89
|
+
- 需要校验某份契约文档是否符合已登记 Schema:用 `validateDocument`。
|
|
90
|
+
- 需要按对象名或 `$id` 查找 Schema、按协议名查找 Kernel 协议:用 `loadRegistry` / `findSchemaByObject` / `findProtocol`。
|
|
91
|
+
- 需要运行强制机械规则、收集未解析引用:用 `runChecks` / `collectUnresolvedRefs`。
|
|
92
|
+
- 需要枚举并校验公开 fixture:用 `verifyAllFixtures`。
|
|
93
|
+
|
|
94
|
+
## 十八类顶层对象
|
|
95
|
+
|
|
96
|
+
| 对象 | `$id` | Schema 文件 |
|
|
97
|
+
| --- | --- | --- |
|
|
98
|
+
| `project-manifest` | `https://contracts.skill-family.example/v1/project-manifest.json` | `src/schemas/project-manifest.schema.json` |
|
|
99
|
+
| `profile-descriptor` | `https://contracts.skill-family.example/v1/profile-descriptor.json` | `src/schemas/profile-descriptor.schema.json` |
|
|
100
|
+
| `managed-file-lock` | `https://contracts.skill-family.example/v1/managed-file-lock.json` | `src/schemas/managed-file-lock.schema.json` |
|
|
101
|
+
| `operation-request` | `https://contracts.skill-family.example/v1/operation-request.json` | `src/schemas/operation-request.schema.json` |
|
|
102
|
+
| `operation-result` | `https://contracts.skill-family.example/v1/operation-result.json` | `src/schemas/operation-result.schema.json` |
|
|
103
|
+
| `migration-manifest` | `https://contracts.skill-family.example/v1/migration-manifest.json` | `src/schemas/migration-manifest.schema.json` |
|
|
104
|
+
| `report-model` | `https://contracts.skill-family.example/v1/report-model.json` | `src/schemas/report-model.schema.json` |
|
|
105
|
+
| `report-binding` | `https://contracts.skill-family.example/v1/report-binding.json` | `src/schemas/report-binding.schema.json` |
|
|
106
|
+
| `host-descriptor` | `https://contracts.skill-family.example/v1/host-descriptor.json` | `src/schemas/host-descriptor.schema.json` |
|
|
107
|
+
| `host-capability-fact` | `https://contracts.skill-family.example/v1/host-capability-fact.json` | `src/schemas/host-capability-fact.schema.json` |
|
|
108
|
+
| `adapter-build-manifest` | `https://contracts.skill-family.example/v1/adapter-build-manifest.json` | `src/schemas/adapter-build-manifest.schema.json` |
|
|
109
|
+
| `host-operation-plan` | `https://contracts.skill-family.example/v1/host-operation-plan.json` | `src/schemas/host-operation-plan.schema.json` |
|
|
110
|
+
| `host-operation-receipt` | `https://contracts.skill-family.example/v1/host-operation-receipt.json` | `src/schemas/host-operation-receipt.schema.json` |
|
|
111
|
+
| `adapter-source` | `https://contracts.skill-family.example/v1/adapter-source.json` | `src/schemas/adapter-source.schema.json` |
|
|
112
|
+
| `host-registry` | `https://contracts.skill-family.example/v1/host-registry.json` | `src/schemas/host-registry.schema.json` |
|
|
113
|
+
| `host-probe-result` | `https://contracts.skill-family.example/v1/host-probe-result.json` | `src/schemas/host-probe-result.schema.json` |
|
|
114
|
+
| `state-event-envelope` | `https://contracts.skill-family.example/v1/state-event-envelope.json` | `src/schemas/state-event-envelope.schema.json` |
|
|
115
|
+
| `state-snapshot-metadata` | `https://contracts.skill-family.example/v1/state-snapshot-metadata.json` | `src/schemas/state-snapshot-metadata.json` |
|
|
116
|
+
|
|
117
|
+
所有 v1 Schema 使用 draft 2020-12 方言;实例信封统一为 `schemaVersion: 1` + 唯一 `kind` 常量 + 各层 `additionalProperties: false`。`$id` 命名空间 `contracts.skill-family.example` 使用保留示例域,永不解析到真实站点。
|
|
118
|
+
|
|
119
|
+
## Kernel Protocol(内核协议)
|
|
120
|
+
|
|
121
|
+
登记表:`src/registry.json`;冻结定义:`src/kernel-protocol.json`。
|
|
122
|
+
|
|
123
|
+
- 协议名:`skill-family.kernel.operation`,版本 `1`,状态 `stable`。
|
|
124
|
+
- 状态集:`accepted`、`running`、`succeeded`、`failed`、`rejected`;终态为 `succeeded`、`failed`、`rejected`;`operation-result` 只携带终态。
|
|
125
|
+
- 转移:`accepted → running → succeeded|failed`,另允许 `accepted → failed`;入口可直接 `rejected`。
|
|
126
|
+
- v1 操作词汇表只冻结 `validate`,其 params 合同在 `kernel-protocol.json` 内定义(`schemaId` + `document` 必填)。新增操作名属于合同变更,需新版本登记。
|
|
127
|
+
|
|
128
|
+
重名协议与重复 `$id` 被机械拒绝:`registerProtocol` 抛出 `SFC1004`,`registerSchema` 抛出 `SFC1003`;检查类型 `protocol.unique-name` 与 `schema.unique-id` 对登记表做同样判定。
|
|
129
|
+
|
|
130
|
+
## 稳定错误码
|
|
131
|
+
|
|
132
|
+
冻结登记表:`src/error-codes.json`。`SFC1xxx` 为合同权威层错误,`SFC2xxx` 为内核操作错误,`SFC3xxx` 为报告绑定错误。码只增不改、不复用。v1 冻结:
|
|
133
|
+
|
|
134
|
+
| 码 | 名称 | 含义摘要 |
|
|
135
|
+
| --- | --- | --- |
|
|
136
|
+
| SFC1001 | SCHEMA_VALIDATION_FAILED | 文档未通过目标 Schema 验证 |
|
|
137
|
+
| SFC1002 | UNKNOWN_SCHEMA_ID | `$id` 未在登记表注册 |
|
|
138
|
+
| SFC1003 | DUPLICATE_SCHEMA_ID | 重复 `$id` 注册被拒绝 |
|
|
139
|
+
| SFC1004 | DUPLICATE_PROTOCOL_NAME | 重复协议名/版本注册被拒绝 |
|
|
140
|
+
| SFC1005 | UNRESOLVED_REF | `$ref` 目标无法解析 |
|
|
141
|
+
| SFC1006 | UNSUPPORTED_DIALECT | 方言不在冻结支持集 |
|
|
142
|
+
| SFC1007 | UNKNOWN_CHECK_TYPE | 规则使用九类之外的检查类型 |
|
|
143
|
+
| SFC1008 | RULE_BUDGET_EXCEEDED | 强制规则数超出预算/上限 |
|
|
144
|
+
| SFC1009 | UNKNOWN_ERROR_CODE | 引用了未登记的错误码 |
|
|
145
|
+
| SFC1010 | FIXTURE_EXPECTATION_MISMATCH | fixture 行为与声明期望不符 |
|
|
146
|
+
| SFC1011 | UNKNOWN_PROTOCOL | 请求引用未登记的协议名/版本 |
|
|
147
|
+
| SFC1012 | SCHEMA_COMPILE_FAILED | Schema 本身无法编译 |
|
|
148
|
+
| SFC2002 | UNKNOWN_OPERATION | 操作名不在冻结词汇表 |
|
|
149
|
+
| SFC2003 | INVALID_PARAMS | 参数不满足操作的冻结 params 合同 |
|
|
150
|
+
| SFC2004 | EXECUTION_FAILED | 机制运行时执行失败(仅运行时可演示) |
|
|
151
|
+
| SFC3001 | REPORT_DIGEST_MISMATCH | 报告或结果摘要与绑定不一致 |
|
|
152
|
+
| SFC3002 | REPORT_ELEMENT_MISSING | 报告缺少强制元素 |
|
|
153
|
+
| SFC3003 | REPORT_FACT_DRIFT | 报告字节偏离确定性重渲染结果 |
|
|
154
|
+
|
|
155
|
+
## 方言与验证策略(Ajv)
|
|
156
|
+
|
|
157
|
+
- 支持方言:`draft-07`、`2020-12`。draft 识别通过 `$schema` URI 映射(`detectDialect`),验证按方言路由到对应 Ajv 类。
|
|
158
|
+
- 验证策略(`VALIDATION_POLICIES`):
|
|
159
|
+
- `strict`(默认):不做类型强制、不注入默认值,Ajv 严格模式全开;
|
|
160
|
+
- `tolerant`:开启 Ajv `coerceTypes: "array"` 与 `useDefaults`,用于采纳场景。
|
|
161
|
+
- 格式:`date-time`(RFC 3339,含日历合法性检查)经 Ajv `addFormat` 登记。
|
|
162
|
+
- `validateDocument` 永不修改调用者输入;规范化后的副本在结果的 `data` 字段返回。
|
|
163
|
+
|
|
164
|
+
## 九类机械检查与规则预算
|
|
165
|
+
|
|
166
|
+
登记表:`src/rules.json`。检查类型集合封闭,共九种:`schema.compile`、`schema.unique-id`、`protocol.unique-name`、`schema.ref-resolves`、`schema.dialect-declared`、`fixture.positive-passes`、`fixture.negative-coded`、`error-code.registered`、`rules.budget`。
|
|
167
|
+
|
|
168
|
+
当前强制规则 **9 条**(CR-001、CR-006…CR-013)。其中 CR-001 对登记表内全部 Schema 做统一编译,不再为每个对象重复占用一条规则;预算上限 20 条、绝对上限 30 条;`rules.budget` 是机械门禁,超限即 `runChecks` 失败并报 `SFC1008`。
|
|
169
|
+
|
|
170
|
+
## Fixture
|
|
171
|
+
|
|
172
|
+
`src/fixtures/<contract>/` 为每类合同提供正例(positive)、反例(negative)与方言边界(dialect-boundary)样例。每个 fixture 声明目标 Schema、方言、策略与期望;反例期望携带稳定失败码。`verifyAllFixtures()` 机械重放全部期望,行为不符报 `SFC1010`。fixture 是完全虚构数据,不是审计 oracle。
|
|
173
|
+
|
|
174
|
+
## API 概览
|
|
175
|
+
|
|
176
|
+
```js
|
|
177
|
+
import {
|
|
178
|
+
CONTRACT_OBJECTS, CONTRACTS_VERSION,
|
|
179
|
+
validateDocument, SUPPORTED_DIALECTS, VALIDATION_POLICIES, detectDialect,
|
|
180
|
+
loadRegistry, registerSchema, registerProtocol,
|
|
181
|
+
loadKernelProtocol, checkOperation,
|
|
182
|
+
runChecks, CHECK_TYPES, MANDATORY_RULES, RULE_BUDGET,
|
|
183
|
+
listFixtures, verifyAllFixtures,
|
|
184
|
+
ERROR_CODES, ContractsError, stableError,
|
|
185
|
+
} from "skill-family-contracts";
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
以上导入列出了本包稳定公共面;`validateDocument` 与 `runChecks` 是最常用入口。`validateDocument(document, { schemaId | schema, dialect, policy })` 返回 `{ valid, errorCode, errors, data }`;`runChecks({ rules?, registry?, fixtures?, loadSchema? })` 返回 `{ ok, mandatoryCount, budget, results }`;`registerSchema` / `registerProtocol` 返回新登记表副本,重复项分别以 `SFC1003` / `SFC1004` 抛出 `ContractsError`。
|
|
189
|
+
|
|
190
|
+
## 安全边界与非目标
|
|
191
|
+
|
|
192
|
+
不拥有生成、语义审计、发布状态与远端写入;不定义清理计划、发布快照、消费者冒烟结果、领域审计报告或自由文本规则语言;不建通用 DSL。冻结内容的变更只能作为新的合同版本任务进行。
|
|
193
|
+
|
|
194
|
+
## 故障诊断
|
|
195
|
+
|
|
196
|
+
验证失败时 `errorCode` 为 `SFC1001`(SCHEMA_VALIDATION_FAILED,文档未通过目标 Schema 验证);`$id` 未注册时报 `SFC1002`(UNKNOWN_SCHEMA_ID)。如失败,检查文档是否满足目标 Schema 的必填字段与类型约束。
|
|
197
|
+
|
|
198
|
+
## 深入文档入口
|
|
199
|
+
|
|
200
|
+
- 架构边界与路由:[架构说明](https://ifoohoo.github.io/skill-family-engineering-kit/architecture/)、[智能体架构路由](https://ifoohoo.github.io/skill-family-engineering-kit/agents/architecture-routing/)
|
|
201
|
+
- 能力目录:[capability-catalog.json](https://ifoohoo.github.io/skill-family-engineering-kit/agents/capability-catalog.json)
|
|
202
|
+
- 当前产品状态:[公开状态](https://ifoohoo.github.io/skill-family-engineering-kit/public/status/)
|
|
203
|
+
|
|
204
|
+
<!-- agent-quick-reference:start -->
|
|
205
|
+
## Agent Quick Reference
|
|
206
|
+
|
|
207
|
+
### Use when
|
|
208
|
+
|
|
209
|
+
- 需要校验已登记契约对象、查找 Schema/协议、运行强制机械规则。
|
|
210
|
+
- 需要枚举并校验公开 fixture,或确定性序列化契约表面。
|
|
211
|
+
- 需要在锁定精确包版本后评估非稳定的 Quickstart Resource/Task/Result Profile。
|
|
212
|
+
|
|
213
|
+
### Do not use when
|
|
214
|
+
|
|
215
|
+
- 需要校验消费者自有业务 Schema(消费者应自行持有,Foundation 不取代)。
|
|
216
|
+
- 需要把领域语义校验混入通用契约。
|
|
217
|
+
- 需要兼容性已冻结的 Quickstart Profile;candidate 子路径尚未登记为 stable。
|
|
218
|
+
|
|
219
|
+
### Capability selection
|
|
220
|
+
|
|
221
|
+
- `foundation.contracts.object-validation`:Ajv 双方言校验 18 类对象。
|
|
222
|
+
- `foundation.contracts.registry-protocol`:Schema `$id` 与协议名登记查询。
|
|
223
|
+
- `foundation.contracts.kernel-protocol`:operation-request/result 协议。
|
|
224
|
+
- `foundation.contracts.mandatory-checks`:九类强制规则与未解析引用。
|
|
225
|
+
- `foundation.contracts.fixture-verification`:fixture 全量回放。
|
|
226
|
+
- `foundation.contracts.error-codes`:稳定错误码体系。
|
|
227
|
+
- `foundation.contracts.audit-surface`:canonical JSON + sha256 摘要。
|
|
228
|
+
- `foundation.contracts.quickstart-profile-candidate`:通过精确版本子路径使用 candidate-only Resource/Task/Result Schema 与校验。
|
|
229
|
+
|
|
230
|
+
### Required inputs
|
|
231
|
+
|
|
232
|
+
- 待校验文档(带已登记 `$id`)或目标契约对象名。
|
|
233
|
+
- 校验策略 `strict`(默认)或 `tolerant`。
|
|
234
|
+
|
|
235
|
+
### Outputs and evidence
|
|
236
|
+
|
|
237
|
+
- `validateDocument` 返回 `{ valid, errorCode, errors, data }`。
|
|
238
|
+
- 证据:`packages/skill-family-contracts/test/validator.test.mjs`、`registry.test.mjs`、`checker.test.mjs`、`fixtures.test.mjs`。
|
|
239
|
+
|
|
240
|
+
### Side effects
|
|
241
|
+
|
|
242
|
+
- 纯函数,无文件系统、Git、网络或进程副作用(编译缓存仅驻留内存)。
|
|
243
|
+
|
|
244
|
+
### Failure semantics
|
|
245
|
+
|
|
246
|
+
- `SFC1001/1002/1006` 等稳定错误码,错误对象含 `stableError` 与 `details.kind`。
|
|
247
|
+
- 冻结错误码只增不改,不漂移。
|
|
248
|
+
|
|
249
|
+
### Architectural invariants
|
|
250
|
+
|
|
251
|
+
- 18 类顶层对象集合固定,新增需 ADR;错误码冻结不漂移。
|
|
252
|
+
- 校验器仅 Ajv 8.20.0(精确 pin),不接受其他实现。
|
|
253
|
+
|
|
254
|
+
### Route elsewhere when
|
|
255
|
+
|
|
256
|
+
- 消费者业务 Schema 校验:留在调用方。
|
|
257
|
+
- 发布远端写入:转 release-skill。
|
|
258
|
+
- 领域审计语义:转独立审计消费者。
|
|
259
|
+
|
|
260
|
+
### Machine-readable sources
|
|
261
|
+
|
|
262
|
+
- 公开能力目录:[`capability-catalog.json`](https://ifoohoo.github.io/skill-family-engineering-kit/agents/capability-catalog.json)(`foundation.contracts.*` 条目)。
|
|
263
|
+
- 包内结构合同:`src/registry.json`、`src/schemas/*`。
|
|
264
|
+
- 包内 Candidate 源:`candidate/quickstart-profile/*`;公共导入:`skill-family-contracts/candidate/quickstart-profile`。
|
|
265
|
+
<!-- agent-quick-reference:end -->
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"kind": "skill-family.resource",
|
|
4
|
+
"id": "observation-main",
|
|
5
|
+
"location": {
|
|
6
|
+
"path": "inputs/observation.json"
|
|
7
|
+
},
|
|
8
|
+
"role": "observation",
|
|
9
|
+
"digest": {
|
|
10
|
+
"algorithm": "sha256",
|
|
11
|
+
"value": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { detectDialect, validateDocument } from "../../src/validator.mjs";
|
|
3
|
+
|
|
4
|
+
const documents = Object.freeze({
|
|
5
|
+
resource: load("resource.schema.json"),
|
|
6
|
+
task: load("task.schema.json"),
|
|
7
|
+
result: load("result.schema.json"),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
function load(name) {
|
|
11
|
+
return Object.freeze(
|
|
12
|
+
JSON.parse(readFileSync(new URL(name, import.meta.url), "utf8")),
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const QUICKSTART_PROFILE_ID = "quickstart-profile";
|
|
17
|
+
export const QUICKSTART_PROFILE_VERSION = 1;
|
|
18
|
+
export const QUICKSTART_PROTOCOL = Object.freeze({
|
|
19
|
+
name: "skill-family.quickstart-profile",
|
|
20
|
+
version: 1,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
/** Candidate-only schemas. They are deliberately absent from registry.json. */
|
|
24
|
+
export function quickstartProfileSchemas() {
|
|
25
|
+
return structuredClone(documents);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function linkResourceSchema(schema) {
|
|
29
|
+
const linked = structuredClone(schema);
|
|
30
|
+
const resourceId = documents.resource.$id;
|
|
31
|
+
const visit = (value) => {
|
|
32
|
+
if (Array.isArray(value)) {
|
|
33
|
+
for (const item of value) visit(item);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (!value || typeof value !== "object") return;
|
|
37
|
+
if (value.$ref === resourceId) value.$ref = "#/$defs/quickstartResource";
|
|
38
|
+
for (const child of Object.values(value)) visit(child);
|
|
39
|
+
};
|
|
40
|
+
visit(linked);
|
|
41
|
+
linked.$defs = {
|
|
42
|
+
...(linked.$defs ?? {}),
|
|
43
|
+
quickstartResource: structuredClone(documents.resource),
|
|
44
|
+
};
|
|
45
|
+
return linked;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Validate one candidate profile document through the shared Ajv validator. */
|
|
49
|
+
export function validateQuickstartProfileDocument(kind, document) {
|
|
50
|
+
if (!Object.hasOwn(documents, kind)) {
|
|
51
|
+
throw new TypeError(`unknown quickstart profile document kind: ${String(kind)}`);
|
|
52
|
+
}
|
|
53
|
+
const schema = kind === "resource" ? documents.resource : linkResourceSchema(documents[kind]);
|
|
54
|
+
return validateDocument(document, {
|
|
55
|
+
schema,
|
|
56
|
+
dialect: detectDialect(schema),
|
|
57
|
+
policy: "strict",
|
|
58
|
+
});
|
|
59
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://contracts.skill-family.example/candidate/quickstart-profile/v1/resource.json",
|
|
4
|
+
"title": "QuickstartResource",
|
|
5
|
+
"description": "Candidate Resource profile for one content-addressed observation, output, or evidence item.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["schemaVersion", "kind", "id", "location", "role", "digest"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"schemaVersion": {
|
|
11
|
+
"const": 1
|
|
12
|
+
},
|
|
13
|
+
"kind": {
|
|
14
|
+
"const": "skill-family.resource"
|
|
15
|
+
},
|
|
16
|
+
"id": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"
|
|
19
|
+
},
|
|
20
|
+
"location": {
|
|
21
|
+
"type": "object",
|
|
22
|
+
"additionalProperties": false,
|
|
23
|
+
"properties": {
|
|
24
|
+
"path": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))[A-Za-z0-9._-]+(?:/[A-Za-z0-9._-]+)*$"
|
|
27
|
+
},
|
|
28
|
+
"uri": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"pattern": "^[A-Za-z][A-Za-z0-9+.-]*:.+$"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"oneOf": [
|
|
34
|
+
{
|
|
35
|
+
"required": ["path"],
|
|
36
|
+
"properties": {
|
|
37
|
+
"path": {}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"required": ["uri"],
|
|
42
|
+
"properties": {
|
|
43
|
+
"uri": {}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
"role": {
|
|
49
|
+
"enum": ["observation", "output", "evidence"]
|
|
50
|
+
},
|
|
51
|
+
"digest": {
|
|
52
|
+
"type": "object",
|
|
53
|
+
"additionalProperties": false,
|
|
54
|
+
"required": ["algorithm", "value"],
|
|
55
|
+
"properties": {
|
|
56
|
+
"algorithm": {
|
|
57
|
+
"const": "sha256"
|
|
58
|
+
},
|
|
59
|
+
"value": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"pattern": "^[0-9a-f]{64}$"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://contracts.skill-family.example/candidate/quickstart-profile/v1/result.json",
|
|
4
|
+
"title": "QuickstartResult",
|
|
5
|
+
"description": "Candidate narrow profile over the stable terminal operation-result envelope.",
|
|
6
|
+
"allOf": [
|
|
7
|
+
{
|
|
8
|
+
"$ref": "https://contracts.skill-family.example/v1/operation-result.json"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"type": "object",
|
|
12
|
+
"properties": {
|
|
13
|
+
"protocol": {
|
|
14
|
+
"const": {
|
|
15
|
+
"name": "skill-family.quickstart-profile",
|
|
16
|
+
"version": 1
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"operation": {
|
|
20
|
+
"const": "audit"
|
|
21
|
+
},
|
|
22
|
+
"outputs": {
|
|
23
|
+
"oneOf": [
|
|
24
|
+
{
|
|
25
|
+
"type": "null"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"$ref": "#/$defs/outputs"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"allOf": [
|
|
34
|
+
{
|
|
35
|
+
"if": {
|
|
36
|
+
"properties": {
|
|
37
|
+
"state": {
|
|
38
|
+
"const": "succeeded"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"required": ["state"]
|
|
42
|
+
},
|
|
43
|
+
"then": {
|
|
44
|
+
"type": "object",
|
|
45
|
+
"required": ["outputs"],
|
|
46
|
+
"properties": {
|
|
47
|
+
"outputs": {
|
|
48
|
+
"$ref": "#/$defs/outputs"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"$defs": {
|
|
57
|
+
"correlation": {
|
|
58
|
+
"type": "object",
|
|
59
|
+
"additionalProperties": false,
|
|
60
|
+
"required": ["run", "stage", "attempt"],
|
|
61
|
+
"properties": {
|
|
62
|
+
"run": {
|
|
63
|
+
"type": "string",
|
|
64
|
+
"pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"
|
|
65
|
+
},
|
|
66
|
+
"stage": {
|
|
67
|
+
"type": "string",
|
|
68
|
+
"pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"
|
|
69
|
+
},
|
|
70
|
+
"attempt": {
|
|
71
|
+
"type": "integer",
|
|
72
|
+
"minimum": 1
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"taskBinding": {
|
|
77
|
+
"type": "object",
|
|
78
|
+
"additionalProperties": false,
|
|
79
|
+
"required": ["operationId", "taskDigest", "observationId", "observationDigest", "correlation"],
|
|
80
|
+
"properties": {
|
|
81
|
+
"operationId": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"
|
|
84
|
+
},
|
|
85
|
+
"taskDigest": {
|
|
86
|
+
"type": "string",
|
|
87
|
+
"pattern": "^[0-9a-f]{64}$"
|
|
88
|
+
},
|
|
89
|
+
"observationId": {
|
|
90
|
+
"type": "string",
|
|
91
|
+
"pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"
|
|
92
|
+
},
|
|
93
|
+
"observationDigest": {
|
|
94
|
+
"type": "string",
|
|
95
|
+
"pattern": "^[0-9a-f]{64}$"
|
|
96
|
+
},
|
|
97
|
+
"correlation": {
|
|
98
|
+
"$ref": "#/$defs/correlation"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"outputs": {
|
|
103
|
+
"type": "object",
|
|
104
|
+
"additionalProperties": false,
|
|
105
|
+
"required": ["summary", "outputs", "evidence", "domainResult", "taskBinding"],
|
|
106
|
+
"properties": {
|
|
107
|
+
"summary": {
|
|
108
|
+
"type": "string",
|
|
109
|
+
"minLength": 1
|
|
110
|
+
},
|
|
111
|
+
"outputs": {
|
|
112
|
+
"type": "array",
|
|
113
|
+
"items": {
|
|
114
|
+
"allOf": [
|
|
115
|
+
{
|
|
116
|
+
"$ref": "https://contracts.skill-family.example/candidate/quickstart-profile/v1/resource.json"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"type": "object",
|
|
120
|
+
"properties": {
|
|
121
|
+
"role": {
|
|
122
|
+
"const": "output"
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"evidence": {
|
|
130
|
+
"type": "array",
|
|
131
|
+
"items": {
|
|
132
|
+
"allOf": [
|
|
133
|
+
{
|
|
134
|
+
"$ref": "https://contracts.skill-family.example/candidate/quickstart-profile/v1/resource.json"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"type": "object",
|
|
138
|
+
"properties": {
|
|
139
|
+
"role": {
|
|
140
|
+
"const": "evidence"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"domainResult": {},
|
|
148
|
+
"taskBinding": {
|
|
149
|
+
"$ref": "#/$defs/taskBinding"
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://contracts.skill-family.example/candidate/quickstart-profile/v1/task.json",
|
|
4
|
+
"title": "QuickstartTask",
|
|
5
|
+
"description": "Candidate narrow profile over the stable operation-request envelope.",
|
|
6
|
+
"allOf": [
|
|
7
|
+
{
|
|
8
|
+
"$ref": "https://contracts.skill-family.example/v1/operation-request.json"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"type": "object",
|
|
12
|
+
"properties": {
|
|
13
|
+
"protocol": {
|
|
14
|
+
"const": {
|
|
15
|
+
"name": "skill-family.quickstart-profile",
|
|
16
|
+
"version": 1
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"operation": {
|
|
20
|
+
"const": "audit"
|
|
21
|
+
},
|
|
22
|
+
"params": {
|
|
23
|
+
"type": "object",
|
|
24
|
+
"additionalProperties": false,
|
|
25
|
+
"required": ["method", "parameters", "inputs", "correlation"],
|
|
26
|
+
"properties": {
|
|
27
|
+
"method": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$"
|
|
30
|
+
},
|
|
31
|
+
"parameters": {
|
|
32
|
+
"type": "object"
|
|
33
|
+
},
|
|
34
|
+
"inputs": {
|
|
35
|
+
"type": "array",
|
|
36
|
+
"minItems": 1,
|
|
37
|
+
"maxItems": 1,
|
|
38
|
+
"items": {
|
|
39
|
+
"allOf": [
|
|
40
|
+
{
|
|
41
|
+
"$ref": "https://contracts.skill-family.example/candidate/quickstart-profile/v1/resource.json"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"type": "object",
|
|
45
|
+
"properties": {
|
|
46
|
+
"location": {
|
|
47
|
+
"type": "object",
|
|
48
|
+
"required": ["path"],
|
|
49
|
+
"properties": {
|
|
50
|
+
"path": {}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"role": {
|
|
54
|
+
"const": "observation"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"correlation": {
|
|
62
|
+
"$ref": "#/$defs/correlation"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
"$defs": {
|
|
70
|
+
"correlation": {
|
|
71
|
+
"type": "object",
|
|
72
|
+
"additionalProperties": false,
|
|
73
|
+
"required": ["run", "stage", "attempt"],
|
|
74
|
+
"properties": {
|
|
75
|
+
"run": {
|
|
76
|
+
"type": "string",
|
|
77
|
+
"pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"
|
|
78
|
+
},
|
|
79
|
+
"stage": {
|
|
80
|
+
"type": "string",
|
|
81
|
+
"pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"
|
|
82
|
+
},
|
|
83
|
+
"attempt": {
|
|
84
|
+
"type": "integer",
|
|
85
|
+
"minimum": 1
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
package/package.json
CHANGED
|
@@ -11,9 +11,19 @@
|
|
|
11
11
|
"engines": {
|
|
12
12
|
"node": ">=22.22.2 <23"
|
|
13
13
|
},
|
|
14
|
-
"exports":
|
|
14
|
+
"exports": {
|
|
15
|
+
".": "./src/index.mjs",
|
|
16
|
+
"./candidate/quickstart-profile": "./candidate/quickstart-profile/index.mjs"
|
|
17
|
+
},
|
|
15
18
|
"files": [
|
|
16
19
|
"src",
|
|
20
|
+
"candidate",
|
|
21
|
+
"release-notes",
|
|
22
|
+
"README.md",
|
|
23
|
+
"README.zh-CN.md",
|
|
24
|
+
"CHANGELOG.md",
|
|
25
|
+
"CHANGELOG.zh-CN.md",
|
|
26
|
+
"NOTICE",
|
|
17
27
|
"SECURITY.md",
|
|
18
28
|
"CONTRIBUTING.md",
|
|
19
29
|
"CODE_OF_CONDUCT.md"
|
|
@@ -27,7 +37,7 @@
|
|
|
27
37
|
"url": "https://github.com/ifoohoo/skill-family-contracts.git"
|
|
28
38
|
},
|
|
29
39
|
"type": "module",
|
|
30
|
-
"version": "0.2.
|
|
40
|
+
"version": "0.2.1",
|
|
31
41
|
"scripts": {
|
|
32
42
|
"check": "node --test",
|
|
33
43
|
"test": "node --test"
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
version: 0.2.1
|
|
2
|
+
date: 2026-08-10
|
|
3
|
+
locales:
|
|
4
|
+
en:
|
|
5
|
+
summary: This release adds a candidate Quickstart Profile contract surface and makes the package release documentation available in English and Simplified Chinese.
|
|
6
|
+
changes:
|
|
7
|
+
added:
|
|
8
|
+
- Adds candidate Resource, Task, and Result schemas with strict validation helpers. The candidate schemas remain outside the stable Contracts registry.
|
|
9
|
+
- Adds complete English and Simplified Chinese package documentation, including an agent quick-reference section.
|
|
10
|
+
changed:
|
|
11
|
+
- Manages the current README and CHANGELOG release sections from one bilingual, versioned notes source.
|
|
12
|
+
- Distributes the project NOTICE separately from the Apache-2.0 LICENSE.
|
|
13
|
+
upgradeNotes: Stable registry consumers do not need to change. Import the Quickstart Profile only through its candidate subpath and do not treat it as a frozen Contracts object.
|
|
14
|
+
zh-CN:
|
|
15
|
+
summary: 本版新增 Quickstart Profile 候选契约面,并为包发布文档提供完整英文版与简体中文版。
|
|
16
|
+
changes:
|
|
17
|
+
added:
|
|
18
|
+
- 新增候选 Resource、Task、Result Schema 及其严格校验辅助函数。这组候选 Schema 不进入稳定 Contracts 登记表。
|
|
19
|
+
- 新增完整的英文与简体中文包文档,并补充智能体快速参考章节。
|
|
20
|
+
changed:
|
|
21
|
+
- 使用同一份双语版本化说明源管理当前 README 与 CHANGELOG 的发布区域。
|
|
22
|
+
- 项目 NOTICE 与 Apache-2.0 LICENSE 分开分发。
|
|
23
|
+
upgradeNotes: 稳定登记表的消费者无需修改。Quickstart Profile 只能通过 candidate 子路径导入,不得把它当作已冻结的 Contracts 对象。
|