skill-family-harness-node 0.8.4 → 0.10.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 +43 -0
- package/CHANGELOG.zh-CN.md +43 -0
- package/README.md +21 -14
- package/README.zh-CN.md +19 -13
- package/candidate/mechanisms-cli.mjs +2 -0
- package/candidate/quickstart-profile.mjs +48 -3
- package/package.json +6 -3
- package/release-notes/0.10.0.yaml +25 -0
- package/release-notes/0.9.0.yaml +23 -0
- package/src/bound-read.mjs +241 -0
- package/src/errors.mjs +1 -0
- package/src/fixed-set-publication-loader.mjs +5 -0
- package/src/fixed-set-publication.mjs +289 -0
- package/src/index.mjs +3 -0
- package/src/native/NOTICE +3 -0
- package/src/native/bound_read.c +360 -0
- package/src/native/loader.mjs +93 -0
- package/src/native/prebuild-manifest.json +51 -0
- package/src/native/prebuild-release-receipt.json +12 -0
- package/src/native/prebuild-sbom.json +15 -0
- package/src/native/prebuilds/darwin-arm64/bound_read.darwin-arm64.node +0 -0
- package/src/native/prebuilds/darwin-x64/bound_read.darwin-x64.node +0 -0
- package/src/native/prebuilds/linux-arm64-gnu/bound_read.linux-arm64-gnu.node +0 -0
- package/src/native/prebuilds/linux-x64-gnu/bound_read.linux-x64-gnu.node +0 -0
- package/src/peer-adapter.mjs +186 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,48 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
<!-- release-skill:changelog:start version=0.10.0 locale=en baseline=sha256:64a325d3e51604a8436b33df5a7f617f9aab1f1e02adb32ccb58316aa5c5eab1 -->
|
|
4
|
+
## [0.10.0] - 2026-08-24
|
|
5
|
+
|
|
6
|
+
Harness 0.10.0 adds canonical entrypoints, reuses existing host mechanisms, and adds read-only peer adapter verification from real directories.
|
|
7
|
+
|
|
8
|
+
### Added
|
|
9
|
+
|
|
10
|
+
- Adds skill-family-harness-node/quickstart-profile and skill-family-harness-node/rename-directory-no-replace canonical exports.
|
|
11
|
+
- Reuses filesystem-root binding, strict no-replace publication, atomic replacement, and existing build digests for the Kit's local host install/update path.
|
|
12
|
+
- Adds `verifyPeerAdapterDirectories`, which re-enumerates peer roots and verifies common closure, byte digests, standard manifests, and complete logical mappings without writing them.
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- Keeps each historical candidate export as a same-source migration alias and leaves the mechanism registry unchanged.
|
|
17
|
+
- Keeps validate-many-by-schema-id and its error semantics unchanged while managed Bundles accept historical and canonical Schema IDs through the same validator.
|
|
18
|
+
|
|
19
|
+
### Upgrade Notes
|
|
20
|
+
|
|
21
|
+
Update all three exact pins to 0.10.0 and migrate historical candidate imports and Schema IDs once to canonical identities. The low-level no-replace primitive remains distinct from the stable fixed-set-publication API; choose the contract that matches the use case.
|
|
22
|
+
<!-- release-skill:changelog:end version=0.10.0 locale=en -->
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
<!-- release-skill:changelog:start version=0.9.0 locale=en baseline=sha256:e5f4e3bb6ab343e4ccfb7dcdbba8b9ab4576b4cf285c30bb3597d577be5eb391 -->
|
|
26
|
+
## [0.9.0] - 2026-08-24
|
|
27
|
+
|
|
28
|
+
Harness 0.9.0 adds stable identity-bound reads and fixed-set no-replace publication with a fixed four-platform native closure.
|
|
29
|
+
|
|
30
|
+
### Added
|
|
31
|
+
|
|
32
|
+
- Adds createFilesystemRootBinding and readFileBound with handle-relative no-follow acquisition and optional byte digest guarding.
|
|
33
|
+
- Adds the stable fixed-set-publication subpath with native no-replace publication and terminal indeterminate receipts.
|
|
34
|
+
- Adds the candidate validate-many-by-schema-id mechanism to the existing Quickstart dispatcher.
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
|
|
38
|
+
- Keeps protected deletion excluded and preserves the existing 21-item capability registry.
|
|
39
|
+
|
|
40
|
+
### Upgrade Notes
|
|
41
|
+
|
|
42
|
+
Pin Contracts, Harness, and Engineering Kit to exactly 0.9.0. Batch validation and the Quickstart Bundle remain candidate; filesystem binding and fixed-set publication are stable.
|
|
43
|
+
<!-- release-skill:changelog:end version=0.9.0 locale=en -->
|
|
44
|
+
|
|
45
|
+
|
|
3
46
|
<!-- release-skill:changelog:start version=0.8.4 locale=en baseline=sha256:dfb053d7719d3c7cb5b7d8dbe7a2349597696614651ef4ae04451c34cd7bbc02 -->
|
|
4
47
|
## [0.8.4] - 2026-08-24
|
|
5
48
|
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -1,5 +1,48 @@
|
|
|
1
1
|
# 变更日志
|
|
2
2
|
|
|
3
|
+
<!-- release-skill:changelog:start version=0.10.0 locale=zh-CN baseline=sha256:d8e27cce0c3e97b7d10b6f88fad4df66c8d527d3d6a2fb165f8c909612ff9f19 -->
|
|
4
|
+
## [0.10.0] - 2026-08-24
|
|
5
|
+
|
|
6
|
+
Harness 0.10.0 增加规范入口,复用既有宿主机制,并从真实目录提供同级适配器只读验证。
|
|
7
|
+
|
|
8
|
+
### 新增
|
|
9
|
+
|
|
10
|
+
- 新增 skill-family-harness-node/quickstart-profile 与 skill-family-harness-node/rename-directory-no-replace 规范导出。
|
|
11
|
+
- 复用 filesystem-root binding、严格不替换发布、原子替换和既有构建摘要,支持 Kit 的本地宿主 install/update。
|
|
12
|
+
- 新增 `verifyPeerAdapterDirectories`,重新枚举 peer 根目录,验证共同闭包、逐字节摘要、标准 manifest 和完整 logicalMappings,不写入目录。
|
|
13
|
+
|
|
14
|
+
### 变更
|
|
15
|
+
|
|
16
|
+
- 历史 candidate 导出继续作为同源迁移别名,机制登记表不变。
|
|
17
|
+
- validate-many-by-schema-id 及错误语义不变;受管 Bundle 让历史与规范 Schema ID 共用同一 validator。
|
|
18
|
+
|
|
19
|
+
### 升级说明
|
|
20
|
+
|
|
21
|
+
消费者应把三个包的精确 pin 更新到 0.10.0,并把历史 candidate 导入和 Schema ID 一次迁移到规范身份。低层不替换原语仍不同于稳定 fixed-set-publication API,消费者按所需合同选择。
|
|
22
|
+
<!-- release-skill:changelog:end version=0.10.0 locale=zh-CN -->
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
<!-- release-skill:changelog:start version=0.9.0 locale=zh-CN baseline=sha256:7f3ff503831b8fb52f20293a4af4003ff116b7f9d820a0c2da1bd34a0b261248 -->
|
|
26
|
+
## [0.9.0] - 2026-08-24
|
|
27
|
+
|
|
28
|
+
Harness 0.9.0 新增稳定身份绑定读取与固定集合不替换发布,并携带固定四平台原生闭包。
|
|
29
|
+
|
|
30
|
+
### 新增
|
|
31
|
+
|
|
32
|
+
- 新增 createFilesystemRootBinding 与 readFileBound,使用句柄相对不跟随符号链接获取,并支持可选字节摘要保护。
|
|
33
|
+
- 新增稳定 fixed-set-publication 子路径,使用原生不替换发布并保留终态 indeterminate 回执。
|
|
34
|
+
- 在既有 Quickstart dispatcher 中增加 validate-many-by-schema-id candidate 机制。
|
|
35
|
+
|
|
36
|
+
### 变更
|
|
37
|
+
|
|
38
|
+
- 身份保护删除继续排除,既有 21 项能力登记保持不变。
|
|
39
|
+
|
|
40
|
+
### 升级说明
|
|
41
|
+
|
|
42
|
+
三个 Foundation 包必须精确锁定 0.9.0。批量校验与 Quickstart Bundle 仍为 candidate;文件系统绑定与固定集合发布为 stable。
|
|
43
|
+
<!-- release-skill:changelog:end version=0.9.0 locale=zh-CN -->
|
|
44
|
+
|
|
45
|
+
|
|
3
46
|
<!-- release-skill:changelog:start version=0.8.4 locale=zh-CN baseline=sha256:e8d7be87a26ef296ee4ae27e2325ac8ff1dc33fc69e5f4a65520656f9860bb91 -->
|
|
4
47
|
## [0.8.4] - 2026-08-24
|
|
5
48
|
|
package/README.md
CHANGED
|
@@ -4,23 +4,29 @@
|
|
|
4
4
|
|
|
5
5
|
# skill-family-harness-node
|
|
6
6
|
|
|
7
|
-
<!-- release-skill:release-version: 0.
|
|
7
|
+
<!-- release-skill:release-version: 0.10.0 -->
|
|
8
8
|
|
|
9
9
|
The **single default Node implementation** of the Contracts mechanism protocol. This is a thin runtime: it only implements the mechanism protocol, introduces no business semantics, and does not provide a second-language implementation.
|
|
10
10
|
|
|
11
11
|
<!-- release-skill:managed:start id=latest-release -->
|
|
12
|
-
**0.
|
|
12
|
+
**0.10.0** (2026-08-24)
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Harness 0.10.0 adds canonical entrypoints, reuses existing host mechanisms, and adds read-only peer adapter verification from real directories.
|
|
15
|
+
|
|
16
|
+
**Added**
|
|
17
|
+
|
|
18
|
+
- Adds skill-family-harness-node/quickstart-profile and skill-family-harness-node/rename-directory-no-replace canonical exports.
|
|
19
|
+
- Reuses filesystem-root binding, strict no-replace publication, atomic replacement, and existing build digests for the Kit's local host install/update path.
|
|
20
|
+
- Adds `verifyPeerAdapterDirectories`, which re-enumerates peer roots and verifies common closure, byte digests, standard manifests, and complete logical mappings without writing them.
|
|
15
21
|
|
|
16
22
|
**Changed**
|
|
17
23
|
|
|
18
|
-
-
|
|
19
|
-
- Keeps
|
|
24
|
+
- Keeps each historical candidate export as a same-source migration alias and leaves the mechanism registry unchanged.
|
|
25
|
+
- Keeps validate-many-by-schema-id and its error semantics unchanged while managed Bundles accept historical and canonical Schema IDs through the same validator.
|
|
20
26
|
|
|
21
27
|
**Upgrade Notes**
|
|
22
28
|
|
|
23
|
-
|
|
29
|
+
Update all three exact pins to 0.10.0 and migrate historical candidate imports and Schema IDs once to canonical identities. The low-level no-replace primitive remains distinct from the stable fixed-set-publication API; choose the contract that matches the use case.
|
|
24
30
|
<!-- release-skill:managed:end id=latest-release -->
|
|
25
31
|
|
|
26
32
|
## Problem It Solves
|
|
@@ -34,14 +40,14 @@ The Harness consumes `skill-family-contracts` (a workspace dependency), reusing
|
|
|
34
40
|
## Installation and Minimal Example
|
|
35
41
|
|
|
36
42
|
```sh
|
|
37
|
-
npm install skill-family-harness-node@0.
|
|
43
|
+
npm install skill-family-harness-node@0.10.0
|
|
38
44
|
npm info skill-family-harness-node --help
|
|
39
45
|
```
|
|
40
46
|
|
|
41
47
|
The minimal example shows validating a contract document inside Node:
|
|
42
48
|
|
|
43
49
|
```js
|
|
44
|
-
// Run from an empty directory: npm install skill-family-harness-node@0.
|
|
50
|
+
// Run from an empty directory: npm install skill-family-harness-node@0.10.0
|
|
45
51
|
import { validateContractDocument } from "skill-family-harness-node";
|
|
46
52
|
|
|
47
53
|
const document = {
|
|
@@ -70,12 +76,12 @@ import {
|
|
|
70
76
|
createQuickstartTask,
|
|
71
77
|
wrapQuickstartResult,
|
|
72
78
|
verifyQuickstartExchange,
|
|
73
|
-
} from "skill-family-harness-node/
|
|
79
|
+
} from "skill-family-harness-node/quickstart-profile";
|
|
74
80
|
```
|
|
75
81
|
|
|
76
82
|
The v2 mechanism recomputes the bytes of every path-backed output and evidence Resource. It also rejects duplicate Resource ids, correlation drift, a changed Task digest, and incomplete or mismatched evidence bindings. It does not perform a domain audit, choose a method, retry work, or own lifecycle state.
|
|
77
83
|
|
|
78
|
-
The
|
|
84
|
+
The capability remains **candidate**. Pin all three Foundation packages exactly while evaluating it. Version 0.10.0 adds the canonical path above; the historical `/candidate/quickstart-profile` path remains a same-source migration alias. Migrate once to the canonical path. A later stable promotion will not require another import or same-byte Bundle rebuild. Integrations that still produce candidate v1 exchanges must stay pinned to exactly `0.2.1`.
|
|
79
85
|
|
|
80
86
|
## Typical Use Cases
|
|
81
87
|
|
|
@@ -162,7 +168,7 @@ Mechanism failures uniformly throw `SFC2004` (EXECUTION_FAILED), with `details.k
|
|
|
162
168
|
### Do not use when
|
|
163
169
|
|
|
164
170
|
- You need to put file-selection business rules into the Foundation (business rules are owned by the caller).
|
|
165
|
-
- You need host
|
|
171
|
+
- You need host identity policy, host drivers, remote publication, uninstall deletion, a full Qoder driver, or binary adapter source (explicitly unsupported).
|
|
166
172
|
- You need domain audit semantics, retry orchestration, or a compatibility-frozen Quickstart API.
|
|
167
173
|
|
|
168
174
|
### Capability selection
|
|
@@ -174,7 +180,7 @@ Mechanism failures uniformly throw `SFC2004` (EXECUTION_FAILED), with `details.k
|
|
|
174
180
|
- `foundation.harness.resource-closure`: deterministic resource closure and sha256 digest.
|
|
175
181
|
- `foundation.harness.request-processing`: operation-request → terminal operation-result.
|
|
176
182
|
- `foundation.harness.report`: report-model validation/render/binding/check.
|
|
177
|
-
- `foundation.harness.host-adapter`: adapter source closure/build/materialize and
|
|
183
|
+
- `foundation.harness.host-adapter`: adapter source closure/build/materialize, version probe, and read-only peer adapter verification.
|
|
178
184
|
- `foundation.harness.state-store`: append-only events, hash chain, snapshots, and lock recovery.
|
|
179
185
|
- `foundation.harness.errors`: mechanism error types and stable error classes.
|
|
180
186
|
- `foundation.harness.quickstart-profile-candidate`: exact-version observation/task/result construction and binding verification.
|
|
@@ -203,16 +209,17 @@ Mechanism failures uniformly throw `SFC2004` (EXECUTION_FAILED), with `details.k
|
|
|
203
209
|
|
|
204
210
|
- Event meaning and reducer transitions remain consumer-owned; state-store only provides the base.
|
|
205
211
|
- Only text adapter source (utf8) is supported; binary projection is not supported.
|
|
212
|
+
- `verifyPeerAdapterDirectories` enumerates and reads two or more real peer roots, reuses bound-read/path containment/closure/manifest primitives, and fails closed on symlinks, escapes, byte drift, member drift, or incomplete mappings.
|
|
206
213
|
|
|
207
214
|
### Route elsewhere when
|
|
208
215
|
|
|
209
216
|
- Business state machine / terminal states: route to loop-agent.
|
|
210
|
-
- Host
|
|
217
|
+
- Host identity policy, host drivers, and lifecycle authorization belong to Engineering Kit; Harness supplies only the reusable bound-read, strict-publication, atomic-write, closure, and probe mechanisms.
|
|
211
218
|
- Domain audit semantics: route to a standalone audit consumer.
|
|
212
219
|
|
|
213
220
|
### Machine-readable sources
|
|
214
221
|
|
|
215
222
|
- Public capability catalog: [`capability-catalog.json`](https://ifoohoo.github.io/skill-family-engineering-kit/agents/capability-catalog.json) (`foundation.harness.*` entries).
|
|
216
223
|
- Package-local source: `src/*.mjs`.
|
|
217
|
-
- Package-local candidate source: `candidate/quickstart-profile.mjs`; public import: `skill-family-harness-node/candidate/quickstart-profile`.
|
|
224
|
+
- Package-local candidate source: `candidate/quickstart-profile.mjs`; canonical public import: `skill-family-harness-node/quickstart-profile`; historical migration alias: `skill-family-harness-node/candidate/quickstart-profile`.
|
|
218
225
|
<!-- agent-quick-reference:end -->
|
package/README.zh-CN.md
CHANGED
|
@@ -5,23 +5,29 @@
|
|
|
5
5
|
|
|
6
6
|
# skill-family-harness-node
|
|
7
7
|
|
|
8
|
-
<!-- release-skill:release-version: 0.
|
|
8
|
+
<!-- release-skill:release-version: 0.10.0 -->
|
|
9
9
|
|
|
10
10
|
Contracts 机制协议的**唯一默认 Node 实现**。这是一个薄运行时(thin runtime):只实现机制协议,不引入业务语义,不做第二语言实现。
|
|
11
11
|
|
|
12
12
|
<!-- release-skill:managed:start id=latest-release -->
|
|
13
|
-
**0.
|
|
13
|
+
**0.10.0** (2026-08-24)
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Harness 0.10.0 增加规范入口,复用既有宿主机制,并从真实目录提供同级适配器只读验证。
|
|
16
|
+
|
|
17
|
+
**新增**
|
|
18
|
+
|
|
19
|
+
- 新增 skill-family-harness-node/quickstart-profile 与 skill-family-harness-node/rename-directory-no-replace 规范导出。
|
|
20
|
+
- 复用 filesystem-root binding、严格不替换发布、原子替换和既有构建摘要,支持 Kit 的本地宿主 install/update。
|
|
21
|
+
- 新增 `verifyPeerAdapterDirectories`,重新枚举 peer 根目录,验证共同闭包、逐字节摘要、标准 manifest 和完整 logicalMappings,不写入目录。
|
|
16
22
|
|
|
17
23
|
**变更**
|
|
18
24
|
|
|
19
|
-
-
|
|
20
|
-
-
|
|
25
|
+
- 历史 candidate 导出继续作为同源迁移别名,机制登记表不变。
|
|
26
|
+
- validate-many-by-schema-id 及错误语义不变;受管 Bundle 让历史与规范 Schema ID 共用同一 validator。
|
|
21
27
|
|
|
22
28
|
**升级说明**
|
|
23
29
|
|
|
24
|
-
|
|
30
|
+
消费者应把三个包的精确 pin 更新到 0.10.0,并把历史 candidate 导入和 Schema ID 一次迁移到规范身份。低层不替换原语仍不同于稳定 fixed-set-publication API,消费者按所需合同选择。
|
|
25
31
|
<!-- release-skill:managed:end id=latest-release -->
|
|
26
32
|
|
|
27
33
|
## 解决的问题
|
|
@@ -35,14 +41,14 @@ Harness 消费 `skill-family-contracts`(工作区依赖),复用其方言
|
|
|
35
41
|
## 安装和最小示例
|
|
36
42
|
|
|
37
43
|
```sh
|
|
38
|
-
npm install skill-family-harness-node@0.
|
|
44
|
+
npm install skill-family-harness-node@0.10.0
|
|
39
45
|
npm info skill-family-harness-node --help
|
|
40
46
|
```
|
|
41
47
|
|
|
42
48
|
最小示例演示在 Node 内校验一份契约文档:
|
|
43
49
|
|
|
44
50
|
```js
|
|
45
|
-
// 从空目录运行:npm install skill-family-harness-node@0.
|
|
51
|
+
// 从空目录运行:npm install skill-family-harness-node@0.10.0
|
|
46
52
|
import { validateContractDocument } from "skill-family-harness-node";
|
|
47
53
|
|
|
48
54
|
const document = {
|
|
@@ -71,12 +77,12 @@ import {
|
|
|
71
77
|
createQuickstartTask,
|
|
72
78
|
wrapQuickstartResult,
|
|
73
79
|
verifyQuickstartExchange,
|
|
74
|
-
} from "skill-family-harness-node/
|
|
80
|
+
} from "skill-family-harness-node/quickstart-profile";
|
|
75
81
|
```
|
|
76
82
|
|
|
77
83
|
v2 机制会重算每个 path-backed output 和 evidence Resource 的真实字节摘要,并拒绝重复 Resource id、correlation 漂移、Task digest 变化,以及缺失或错配的 evidence binding。它不执行领域审计,不选择 method,不编排重试,也不拥有生命周期状态。
|
|
78
84
|
|
|
79
|
-
|
|
85
|
+
该能力仍是 **candidate**,评估时必须精确锁定三个 Foundation 包。0.10.0 新增上面的规范入口;历史 `/candidate/quickstart-profile` 入口作为同源迁移别名继续可用。消费者迁移一次后,未来晋升 stable 不再切入口或重建相同 Bundle。仍生产 candidate v1 交换的接入必须继续精确锁定 `0.2.1`。
|
|
80
86
|
|
|
81
87
|
## 典型使用场景
|
|
82
88
|
|
|
@@ -163,7 +169,7 @@ v2 机制会重算每个 path-backed output 和 evidence Resource 的真实字
|
|
|
163
169
|
### Do not use when
|
|
164
170
|
|
|
165
171
|
- 需要把文件选择的业务规则放入 Foundation(业务规则由调用方拥有)。
|
|
166
|
-
-
|
|
172
|
+
- 需要宿主身份策略、宿主 driver、远端发布、删除式 uninstall、Qoder 完整 driver 或二进制 adapter source(明确 unsupported)。
|
|
167
173
|
- 需要领域审计语义、重试编排或兼容性已冻结的 Quickstart API。
|
|
168
174
|
|
|
169
175
|
### Capability selection
|
|
@@ -208,12 +214,12 @@ v2 机制会重算每个 path-backed output 和 evidence Resource 的真实字
|
|
|
208
214
|
### Route elsewhere when
|
|
209
215
|
|
|
210
216
|
- 业务状态机/终态:转 loop-agent。
|
|
211
|
-
-
|
|
217
|
+
- 宿主身份策略、宿主 driver 和生命周期授权归 Engineering Kit;Harness 只提供可复用的绑定读取、严格发布、原子写、闭包和探测机制。
|
|
212
218
|
- 领域审计语义:转独立审计消费者。
|
|
213
219
|
|
|
214
220
|
### Machine-readable sources
|
|
215
221
|
|
|
216
222
|
- 公开能力目录:[`capability-catalog.json`](https://ifoohoo.github.io/skill-family-engineering-kit/agents/capability-catalog.json)(`foundation.harness.*` 条目)。
|
|
217
223
|
- 包内源:`src/*.mjs`。
|
|
218
|
-
- 包内 Candidate 源:`candidate/quickstart-profile.mjs
|
|
224
|
+
- 包内 Candidate 源:`candidate/quickstart-profile.mjs`;规范公共导入:`skill-family-harness-node/quickstart-profile`;历史迁移别名:`skill-family-harness-node/candidate/quickstart-profile`。
|
|
219
225
|
<!-- agent-quick-reference:end -->
|
|
@@ -22,6 +22,8 @@ function errorResponse(cause) {
|
|
|
22
22
|
error: {
|
|
23
23
|
name: typeof cause?.name === "string" ? cause.name : "Error",
|
|
24
24
|
message: cause?.message ?? String(cause),
|
|
25
|
+
...(typeof cause?.code === "string" ? { code: cause.code } : {}),
|
|
26
|
+
...(cause?.details !== undefined ? { details: cause.details } : {}),
|
|
25
27
|
},
|
|
26
28
|
};
|
|
27
29
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { canonicalJson, digestDocument, isRegisteredErrorCode } from "skill-family-contracts";
|
|
1
|
+
import { canonicalJson, ContractsError, digestDocument, isRegisteredErrorCode } from "skill-family-contracts";
|
|
2
2
|
import {
|
|
3
3
|
QUICKSTART_PROTOCOL,
|
|
4
4
|
findNonJsonValue,
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
validateHarnessSurfaceDetectorDocument,
|
|
7
7
|
validateHarnessSurfaceInventoryDocument,
|
|
8
8
|
validateQuickstartProfileDocument,
|
|
9
|
-
} from "skill-family-contracts/
|
|
9
|
+
} from "skill-family-contracts/quickstart-profile";
|
|
10
10
|
import { lstat, readdir, readFile, realpath } from "node:fs/promises";
|
|
11
11
|
import path from "node:path";
|
|
12
12
|
import { fileURLToPath } from "node:url";
|
|
@@ -452,6 +452,7 @@ export async function verifyHarnessSurfaceInventory({ root, inventory, detectors
|
|
|
452
452
|
|
|
453
453
|
const FOUNDATION_MECHANISM_OPERATIONS = Object.freeze([
|
|
454
454
|
"validate-by-schema-id",
|
|
455
|
+
"validate-many-by-schema-id",
|
|
455
456
|
"canonical-json",
|
|
456
457
|
"digest-document",
|
|
457
458
|
"resource-closure",
|
|
@@ -518,7 +519,48 @@ async function invokeReadFileStrict(params) {
|
|
|
518
519
|
* several Foundation modules directly. validateBySchemaId is injected only
|
|
519
520
|
* by the trusted offline Bundle; callers cannot name arbitrary functions.
|
|
520
521
|
*/
|
|
521
|
-
|
|
522
|
+
function assertBatchRequest(request) {
|
|
523
|
+
if (Object.keys(request).sort().join(",") !== "operation,params" ||
|
|
524
|
+
request.operation !== "validate-many-by-schema-id" ||
|
|
525
|
+
request.params === null || typeof request.params !== "object" || Array.isArray(request.params) ||
|
|
526
|
+
Object.keys(request.params).sort().join(",") !== "requests" ||
|
|
527
|
+
!Array.isArray(request.params.requests) || request.params.requests.length === 0) {
|
|
528
|
+
throw new TypeError("invokeFoundationMechanism: validate-many-by-schema-id request is malformed");
|
|
529
|
+
}
|
|
530
|
+
for (const item of request.params.requests) {
|
|
531
|
+
if (item === null || typeof item !== "object" || Array.isArray(item) ||
|
|
532
|
+
Object.keys(item).sort().join(",") !== "document,schemaId" ||
|
|
533
|
+
typeof item.schemaId !== "string" || item.schemaId.length === 0) {
|
|
534
|
+
throw new TypeError("invokeFoundationMechanism: validate-many-by-schema-id item is malformed");
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
function invokeValidationBatch(request, { validateBySchemaId, listValidatableSchemaIds } = {}) {
|
|
540
|
+
assertBatchRequest(request);
|
|
541
|
+
if (typeof validateBySchemaId !== "function" || typeof listValidatableSchemaIds !== "function") {
|
|
542
|
+
throw new TypeError("invokeFoundationMechanism: validate-many-by-schema-id requires the trusted Bundle validator index");
|
|
543
|
+
}
|
|
544
|
+
const schemaIds = listValidatableSchemaIds();
|
|
545
|
+
if (!Array.isArray(schemaIds) || schemaIds.some((schemaId) => typeof schemaId !== "string")) {
|
|
546
|
+
throw new TypeError("invokeFoundationMechanism: trusted Bundle validator index is unavailable");
|
|
547
|
+
}
|
|
548
|
+
const known = new Set(schemaIds);
|
|
549
|
+
for (const item of request.params.requests) {
|
|
550
|
+
if (!known.has(item.schemaId)) {
|
|
551
|
+
throw new ContractsError("SFC1002", `unknown schema $id: ${item.schemaId}`, { schemaId: item.schemaId });
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
return {
|
|
555
|
+
results: request.params.requests.map((item, inputIndex) => ({
|
|
556
|
+
inputIndex,
|
|
557
|
+
schemaId: item.schemaId,
|
|
558
|
+
result: validateBySchemaId(item.schemaId, item.document),
|
|
559
|
+
})),
|
|
560
|
+
};
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
export async function invokeFoundationMechanism(request, { validateBySchemaId, listValidatableSchemaIds } = {}) {
|
|
522
564
|
if (request === null || typeof request !== "object" || Array.isArray(request)) {
|
|
523
565
|
throw new TypeError("invokeFoundationMechanism: request must be an object");
|
|
524
566
|
}
|
|
@@ -530,6 +572,9 @@ export async function invokeFoundationMechanism(request, { validateBySchemaId }
|
|
|
530
572
|
if (params === null || typeof params !== "object" || Array.isArray(params)) {
|
|
531
573
|
throw new TypeError("invokeFoundationMechanism: params must be an object");
|
|
532
574
|
}
|
|
575
|
+
if (operation === "validate-many-by-schema-id") {
|
|
576
|
+
return invokeValidationBatch(request, { validateBySchemaId, listValidatableSchemaIds });
|
|
577
|
+
}
|
|
533
578
|
if (operation === "validate-by-schema-id") {
|
|
534
579
|
if (typeof validateBySchemaId !== "function") {
|
|
535
580
|
throw new TypeError("invokeFoundationMechanism: validate-by-schema-id requires the trusted Bundle validator");
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@pnpm/lockfile.fs": "1001.1.35",
|
|
12
12
|
"ipaddr.js": "2.5.0",
|
|
13
|
-
"skill-family-contracts": "0.
|
|
13
|
+
"skill-family-contracts": "0.10.0",
|
|
14
14
|
"yaml": "2.9.0"
|
|
15
15
|
},
|
|
16
16
|
"description": "Thin Node.js mechanism runtime for Skill Family engineering contracts.",
|
|
@@ -21,7 +21,10 @@
|
|
|
21
21
|
"exports": {
|
|
22
22
|
".": "./src/index.mjs",
|
|
23
23
|
"./candidate/quickstart-profile": "./candidate/quickstart-profile.mjs",
|
|
24
|
-
"./candidate/rename-directory-no-replace": "./candidate/rename-directory-no-replace/rename-directory-no-replace.mjs"
|
|
24
|
+
"./candidate/rename-directory-no-replace": "./candidate/rename-directory-no-replace/rename-directory-no-replace.mjs",
|
|
25
|
+
"./fixed-set-publication": "./src/fixed-set-publication.mjs",
|
|
26
|
+
"./quickstart-profile": "./candidate/quickstart-profile.mjs",
|
|
27
|
+
"./rename-directory-no-replace": "./candidate/rename-directory-no-replace/rename-directory-no-replace.mjs"
|
|
25
28
|
},
|
|
26
29
|
"files": [
|
|
27
30
|
"src",
|
|
@@ -45,7 +48,7 @@
|
|
|
45
48
|
"url": "https://github.com/ifoohoo/skill-family-harness-node.git"
|
|
46
49
|
},
|
|
47
50
|
"type": "module",
|
|
48
|
-
"version": "0.
|
|
51
|
+
"version": "0.10.0",
|
|
49
52
|
"scripts": {
|
|
50
53
|
"check": "node --test",
|
|
51
54
|
"test": "node --test"
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
version: 0.10.0
|
|
2
|
+
date: 2026-08-24
|
|
3
|
+
locales:
|
|
4
|
+
en:
|
|
5
|
+
summary: Harness 0.10.0 adds canonical entrypoints, reuses existing host mechanisms, and adds read-only peer adapter verification from real directories.
|
|
6
|
+
changes:
|
|
7
|
+
added:
|
|
8
|
+
- Adds skill-family-harness-node/quickstart-profile and skill-family-harness-node/rename-directory-no-replace canonical exports.
|
|
9
|
+
- Reuses filesystem-root binding, strict no-replace publication, atomic replacement, and existing build digests for the Kit's local host install/update path.
|
|
10
|
+
- Adds `verifyPeerAdapterDirectories`, which re-enumerates peer roots and verifies common closure, byte digests, standard manifests, and complete logical mappings without writing them.
|
|
11
|
+
changed:
|
|
12
|
+
- Keeps each historical candidate export as a same-source migration alias and leaves the mechanism registry unchanged.
|
|
13
|
+
- Keeps validate-many-by-schema-id and its error semantics unchanged while managed Bundles accept historical and canonical Schema IDs through the same validator.
|
|
14
|
+
upgradeNotes: Update all three exact pins to 0.10.0 and migrate historical candidate imports and Schema IDs once to canonical identities. The low-level no-replace primitive remains distinct from the stable fixed-set-publication API; choose the contract that matches the use case.
|
|
15
|
+
zh-CN:
|
|
16
|
+
summary: Harness 0.10.0 增加规范入口,复用既有宿主机制,并从真实目录提供同级适配器只读验证。
|
|
17
|
+
changes:
|
|
18
|
+
added:
|
|
19
|
+
- 新增 skill-family-harness-node/quickstart-profile 与 skill-family-harness-node/rename-directory-no-replace 规范导出。
|
|
20
|
+
- 复用 filesystem-root binding、严格不替换发布、原子替换和既有构建摘要,支持 Kit 的本地宿主 install/update。
|
|
21
|
+
- 新增 `verifyPeerAdapterDirectories`,重新枚举 peer 根目录,验证共同闭包、逐字节摘要、标准 manifest 和完整 logicalMappings,不写入目录。
|
|
22
|
+
changed:
|
|
23
|
+
- 历史 candidate 导出继续作为同源迁移别名,机制登记表不变。
|
|
24
|
+
- validate-many-by-schema-id 及错误语义不变;受管 Bundle 让历史与规范 Schema ID 共用同一 validator。
|
|
25
|
+
upgradeNotes: 消费者应把三个包的精确 pin 更新到 0.10.0,并把历史 candidate 导入和 Schema ID 一次迁移到规范身份。低层不替换原语仍不同于稳定 fixed-set-publication API,消费者按所需合同选择。
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
version: 0.9.0
|
|
2
|
+
date: 2026-08-24
|
|
3
|
+
locales:
|
|
4
|
+
en:
|
|
5
|
+
summary: Harness 0.9.0 adds stable identity-bound reads and fixed-set no-replace publication with a fixed four-platform native closure.
|
|
6
|
+
changes:
|
|
7
|
+
added:
|
|
8
|
+
- Adds createFilesystemRootBinding and readFileBound with handle-relative no-follow acquisition and optional byte digest guarding.
|
|
9
|
+
- Adds the stable fixed-set-publication subpath with native no-replace publication and terminal indeterminate receipts.
|
|
10
|
+
- Adds the candidate validate-many-by-schema-id mechanism to the existing Quickstart dispatcher.
|
|
11
|
+
changed:
|
|
12
|
+
- Keeps protected deletion excluded and preserves the existing 21-item capability registry.
|
|
13
|
+
upgradeNotes: Pin Contracts, Harness, and Engineering Kit to exactly 0.9.0. Batch validation and the Quickstart Bundle remain candidate; filesystem binding and fixed-set publication are stable.
|
|
14
|
+
zh-CN:
|
|
15
|
+
summary: Harness 0.9.0 新增稳定身份绑定读取与固定集合不替换发布,并携带固定四平台原生闭包。
|
|
16
|
+
changes:
|
|
17
|
+
added:
|
|
18
|
+
- 新增 createFilesystemRootBinding 与 readFileBound,使用句柄相对不跟随符号链接获取,并支持可选字节摘要保护。
|
|
19
|
+
- 新增稳定 fixed-set-publication 子路径,使用原生不替换发布并保留终态 indeterminate 回执。
|
|
20
|
+
- 在既有 Quickstart dispatcher 中增加 validate-many-by-schema-id candidate 机制。
|
|
21
|
+
changed:
|
|
22
|
+
- 身份保护删除继续排除,既有 21 项能力登记保持不变。
|
|
23
|
+
upgradeNotes: 三个 Foundation 包必须精确锁定 0.9.0。批量校验与 Quickstart Bundle 仍为 candidate;文件系统绑定与固定集合发布为 stable。
|