skill-family-engineering-kit 0.3.0 → 0.5.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 +41 -0
- package/CHANGELOG.zh-CN.md +41 -0
- package/README.md +10 -12
- package/README.zh-CN.md +10 -12
- package/candidate/adoption-cli.mjs +67 -0
- package/candidate/adoption-mechanisms.mjs +69 -0
- package/candidate/index.mjs +3 -0
- package/candidate/profile-bundle.mjs +464 -15
- package/candidate/projection-bundle-cli.mjs +18 -0
- package/docs/agents/capability-catalog.en.json +1819 -1562
- package/docs/agents/capability-catalog.json +1068 -930
- package/docs/agents/capability-catalog.zh-CN.json +1819 -1562
- package/docs/architecture/index.html +11 -4
- package/docs/en/architecture/index.html +12 -3
- package/docs/integration/audit/index.html +1 -1
- package/docs/integration/audit/version-compatibility/index.html +4 -3
- package/docs/public/status/index.html +3 -3
- package/docs/reference/api/harness/index.html +396 -1
- package/docs/search/search_index.json +1 -1
- package/package.json +3 -3
- package/release-notes/0.4.0.yaml +23 -0
- package/release-notes/0.5.0.yaml +21 -0
- package/src/adopt-plan.mjs +26 -1
- package/src/index.mjs +5 -2
- package/src/migration.mjs +121 -1
- package/src/projection.mjs +1152 -266
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,46 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
<!-- release-skill:changelog:start version=0.5.0 locale=en baseline=sha256:f83b9c3442e5391149531b198be25131cf45728ff945d4ffc531342996e4e6f3 -->
|
|
4
|
+
## [0.5.0] - 2026-08-16
|
|
5
|
+
|
|
6
|
+
This release keeps the stable four-command Kit surface unchanged and strengthens the offline-consumer verification gates to cover the complete third-party production closure of the three Foundation packages.
|
|
7
|
+
|
|
8
|
+
### Added
|
|
9
|
+
|
|
10
|
+
- Strengthens the offline-consumer verification gates: the third-party closure derivation in candidate-profile-bundle and tarball-source-binding tests is extended from a single-package closure to the complete production closure of the three Foundation packages (identity-deduplicated, npm: alias-aware, range-scoped override selectors, byte identity against the real store directory of pnpm), so the harness runtime-dependency review decision (FND-ADR-011) is continuously verified against the real installed bytes.
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Keeps the stable scaffold, adopt-plan, projection, and check commands unchanged.
|
|
15
|
+
- Carries forward the 0.4.0 adoption CLI candidate and the Quickstart Profile v2 offline bundle; no Kit surface or candidate entry point is added or removed in 0.5.0.
|
|
16
|
+
|
|
17
|
+
### Upgrade Notes
|
|
18
|
+
|
|
19
|
+
Version 0.5.0 is released on npm and the public mirror. The Kit public surface is unchanged from 0.4.0; pin the package to exactly 0.5.0 for the new contract-spec 1.5.0 line.
|
|
20
|
+
<!-- release-skill:changelog:end version=0.5.0 locale=en -->
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
<!-- release-skill:changelog:start version=0.4.0 locale=en baseline=sha256:b75bcca6a62cddc63d0a8d88faf268415aec803bcf00e04aacd797907d1ea6e8 -->
|
|
24
|
+
## [0.4.0] - 2026-08-16
|
|
25
|
+
|
|
26
|
+
This release adds the candidate adoption CLI and adoption mechanisms to the Engineering Kit while preserving the stable four-command surface and the 0.3.0 offline bundle.
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
|
|
30
|
+
- Adds the adoption-cli candidate, a stdin/stdout CLI that assesses adoption bindings, legacy exit lists, and legacy references through the migration manifest, and verifies managed-bundle identity and harness surface inventory.
|
|
31
|
+
- Adds the adoption-mechanisms candidate module as the shared implementation behind the adoption CLI.
|
|
32
|
+
|
|
33
|
+
### Changed
|
|
34
|
+
|
|
35
|
+
- Keeps the stable scaffold, adopt-plan, projection, and check commands unchanged.
|
|
36
|
+
- Carries forward the 0.3.0 Quickstart Profile v2 offline bundle (standalone validators selected by schema $id, full provenance recording) and the candidate plugin skill naming checker.
|
|
37
|
+
|
|
38
|
+
### Upgrade Notes
|
|
39
|
+
|
|
40
|
+
Version 0.4.0 is released on npm and the public mirror. The adoption CLI is a candidate entry point; invoke it through its explicit candidate subpath and pin the package to exactly 0.4.0.
|
|
41
|
+
<!-- release-skill:changelog:end version=0.4.0 locale=en -->
|
|
42
|
+
|
|
43
|
+
|
|
3
44
|
<!-- release-skill:changelog:start version=0.3.0 locale=en baseline=sha256:4c017d6121ff888f90ad9a4ef958b4fee3e25c8d1b69be61cc1ba1f79d527163 -->
|
|
4
45
|
## [0.3.0] - 2026-08-12
|
|
5
46
|
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -1,5 +1,46 @@
|
|
|
1
1
|
# 变更日志
|
|
2
2
|
|
|
3
|
+
<!-- release-skill:changelog:start version=0.5.0 locale=zh-CN baseline=sha256:bdeefb2e456f6e9d1348152b464c701e96a739e514c5a08ca3576e9982e9b7e0 -->
|
|
4
|
+
## [0.5.0] - 2026-08-16
|
|
5
|
+
|
|
6
|
+
本版保持 Kit 稳定四命令边界不变,并把离线消费者验证门加固为覆盖三个 Foundation 包的完整第三方生产闭包。
|
|
7
|
+
|
|
8
|
+
### 新增
|
|
9
|
+
|
|
10
|
+
- 加固离线消费者验证门:candidate-profile-bundle 与 tarball-source-binding 测试中的第三方闭包推导从单包闭包扩展为三个 Foundation 包的完整生产闭包(真实身份去重、npm: 别名感知、range-scoped override selector、对 pnpm 真实本地存储目录的字节身份),使 harness 运行时依赖评审决策(FND-ADR-011)持续对着真实安装字节被验证。
|
|
11
|
+
|
|
12
|
+
### 变更
|
|
13
|
+
|
|
14
|
+
- 稳定四命令(scaffold、adopt-plan、projection、check)保持不变。
|
|
15
|
+
- 延续 0.4.0 的 adoption CLI 候选与 Quickstart Profile v2 离线 Bundle;0.5.0 未新增或移除任何 Kit 边界或候选入口。
|
|
16
|
+
|
|
17
|
+
### 升级说明
|
|
18
|
+
|
|
19
|
+
0.5.0 已发布到 npm 与 public 镜像仓。Kit 公开面与 0.4.0 相同;面向新的契约规格 1.5.0 线请把包精确锁定为 0.5.0。
|
|
20
|
+
<!-- release-skill:changelog:end version=0.5.0 locale=zh-CN -->
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
<!-- release-skill:changelog:start version=0.4.0 locale=zh-CN baseline=sha256:0305934fb2f833eff10b17014f551533bfca9e9e51d3820a5a1e62613a3edb6a -->
|
|
24
|
+
## [0.4.0] - 2026-08-16
|
|
25
|
+
|
|
26
|
+
本版为 Engineering Kit 新增候选 adoption CLI 与 adoption mechanisms,同时保持稳定四命令边界与 0.3.0 的离线 Bundle 不变。
|
|
27
|
+
|
|
28
|
+
### 新增
|
|
29
|
+
|
|
30
|
+
- 新增 adoption-cli 候选:基于 stdin/stdout 的 CLI,通过 migration manifest 评估 adoption 绑定、遗留 exit list 与遗留引用,并校验 managed-bundle 身份与 harness 表面清单。
|
|
31
|
+
- 新增 adoption-mechanisms 候选模块,作为 adoption CLI 的共享实现。
|
|
32
|
+
|
|
33
|
+
### 变更
|
|
34
|
+
|
|
35
|
+
- 稳定四命令(scaffold、adopt-plan、projection、check)保持不变。
|
|
36
|
+
- 延续 0.3.0 的 Quickstart Profile v2 离线 Bundle(按 schema $id 选择的 standalone validator、完整 provenance 记录)与候选插件技能命名检查器。
|
|
37
|
+
|
|
38
|
+
### 升级说明
|
|
39
|
+
|
|
40
|
+
0.4.0 已发布到 npm 与 public 镜像仓。adoption CLI 是候选入口,须经显式 candidate 子路径调用,并把包精确锁定为 0.4.0。
|
|
41
|
+
<!-- release-skill:changelog:end version=0.4.0 locale=zh-CN -->
|
|
42
|
+
|
|
43
|
+
|
|
3
44
|
<!-- release-skill:changelog:start version=0.3.0 locale=zh-CN baseline=sha256:ddb48e61ef87de545348880216ee283b5d0165305dd5dfd8e044929b93ec4673 -->
|
|
4
45
|
## [0.3.0] - 2026-08-12
|
|
5
46
|
|
package/README.md
CHANGED
|
@@ -4,29 +4,27 @@
|
|
|
4
4
|
|
|
5
5
|
# skill-family-engineering-kit
|
|
6
6
|
|
|
7
|
-
<!-- release-skill:release-version: 0.
|
|
7
|
+
<!-- release-skill:release-version: 0.5.0 -->
|
|
8
8
|
|
|
9
9
|
An engineering toolkit used in development and CI. There are **exactly four** top-level commands, and no fifth:
|
|
10
10
|
|
|
11
11
|
<!-- release-skill:managed:start id=latest-release -->
|
|
12
|
-
**0.
|
|
12
|
+
**0.5.0** (2026-08-16)
|
|
13
13
|
|
|
14
|
-
This
|
|
14
|
+
This release keeps the stable four-command Kit surface unchanged and strengthens the offline-consumer verification gates to cover the complete third-party production closure of the three Foundation packages.
|
|
15
15
|
|
|
16
16
|
**Added**
|
|
17
17
|
|
|
18
|
-
-
|
|
19
|
-
- Records complete source and payload provenance, package-manager identity, and the licenses for third-party code that enters the bundle.
|
|
20
|
-
- Adds a candidate plugin skill naming checker (policy JSON plus build-time CLI) that scans a plugin skills root and reports per-rule PASS/FAIL for the prefixed-name, description-signal, and routing-scope rules.
|
|
18
|
+
- Strengthens the offline-consumer verification gates: the third-party closure derivation in candidate-profile-bundle and tarball-source-binding tests is extended from a single-package closure to the complete production closure of the three Foundation packages (identity-deduplicated, npm: alias-aware, range-scoped override selectors, byte identity against the real store directory of pnpm), so the harness runtime-dependency review decision (FND-ADR-011) is continuously verified against the real installed bytes.
|
|
21
19
|
|
|
22
20
|
**Changed**
|
|
23
21
|
|
|
24
|
-
-
|
|
25
|
-
-
|
|
22
|
+
- Keeps the stable scaffold, adopt-plan, projection, and check commands unchanged.
|
|
23
|
+
- Carries forward the 0.4.0 adoption CLI candidate and the Quickstart Profile v2 offline bundle; no Kit surface or candidate entry point is added or removed in 0.5.0.
|
|
26
24
|
|
|
27
25
|
**Upgrade Notes**
|
|
28
26
|
|
|
29
|
-
Version 0.
|
|
27
|
+
Version 0.5.0 is released on npm and the public mirror. The Kit public surface is unchanged from 0.4.0; pin the package to exactly 0.5.0 for the new contract-spec 1.5.0 line.
|
|
30
28
|
<!-- release-skill:managed:end id=latest-release -->
|
|
31
29
|
|
|
32
30
|
| Command | Purpose | Side effects |
|
|
@@ -47,7 +45,7 @@ Kit is the "engineering stage" layer, depending on the Harness and Contracts. It
|
|
|
47
45
|
## Installation and Minimal Example
|
|
48
46
|
|
|
49
47
|
```sh
|
|
50
|
-
npm install --save-dev skill-family-engineering-kit@0.
|
|
48
|
+
npm install --save-dev skill-family-engineering-kit@0.5.0
|
|
51
49
|
npm exec -- skill-family-kit --help
|
|
52
50
|
npm exec -- skill-family-kit scaffold --root <empty-dir> --project-id my-project
|
|
53
51
|
npm exec -- skill-family-kit adopt-plan --root <repo>
|
|
@@ -55,7 +53,7 @@ npm exec -- skill-family-kit projection --root <repo>
|
|
|
55
53
|
npm exec -- skill-family-kit check --root <repo>
|
|
56
54
|
```
|
|
57
55
|
|
|
58
|
-
The four commands above cover skeleton generation, read-only inventory, managed projection, and diagnostics respectively; a zero-install form is available via `npm exec --package=skill-family-engineering-kit@0.
|
|
56
|
+
The four commands above cover skeleton generation, read-only inventory, managed projection, and diagnostics respectively; a zero-install form is available via `npm exec --package=skill-family-engineering-kit@0.5.0 -- skill-family-kit --help`.
|
|
59
57
|
|
|
60
58
|
### Report sub-action
|
|
61
59
|
|
|
@@ -79,7 +77,7 @@ import {
|
|
|
79
77
|
|
|
80
78
|
The generated Bundle selects standalone validators by schema `$id` and runs offline without Foundation packages, `node_modules`, or runtime Ajv. Its provenance binds Foundation sources, consumer schemas, payload bytes, tool versions, and the licenses of code that actually enters the Bundle.
|
|
81
79
|
|
|
82
|
-
Pass the returned `manifest` to the stable `runProjection` API; the helper does not write files or add a fifth top-level command. This subpath is public but **not stable**. Pin exactly `0.
|
|
80
|
+
Pass the returned `manifest` to the stable `runProjection` API; the helper does not write files or add a fifth top-level command. This subpath is public but **not stable**. Pin exactly `0.4.0` for v2; integrations that still require the v1 dependency-closure Bundle must stay pinned to exactly `0.2.1`.
|
|
83
81
|
|
|
84
82
|
### Host sub-action
|
|
85
83
|
|
package/README.zh-CN.md
CHANGED
|
@@ -5,29 +5,27 @@
|
|
|
5
5
|
|
|
6
6
|
# skill-family-engineering-kit
|
|
7
7
|
|
|
8
|
-
<!-- release-skill:release-version: 0.
|
|
8
|
+
<!-- release-skill:release-version: 0.5.0 -->
|
|
9
9
|
|
|
10
10
|
开发与 CI 阶段使用的工程工具包。**恰好四个**顶层命令,没有第五个:
|
|
11
11
|
|
|
12
12
|
<!-- release-skill:managed:start id=latest-release -->
|
|
13
|
-
**0.
|
|
13
|
+
**0.5.0** (2026-08-16)
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
本版保持 Kit 稳定四命令边界不变,并把离线消费者验证门加固为覆盖三个 Foundation 包的完整第三方生产闭包。
|
|
16
16
|
|
|
17
17
|
**新增**
|
|
18
18
|
|
|
19
|
-
-
|
|
20
|
-
- 完整记录来源与 payload provenance、包管理器身份,以及实际进入 Bundle 的第三方代码许可证。
|
|
21
|
-
- 新增候选插件技能命名检查器(policy JSON 加构建期 CLI):扫描插件 skills 根目录,对前缀命名、description 领域信号与路由入口范围三条规则逐项输出 PASS/FAIL。
|
|
19
|
+
- 加固离线消费者验证门:candidate-profile-bundle 与 tarball-source-binding 测试中的第三方闭包推导从单包闭包扩展为三个 Foundation 包的完整生产闭包(真实身份去重、npm: 别名感知、range-scoped override selector、对 pnpm 真实本地存储目录的字节身份),使 harness 运行时依赖评审决策(FND-ADR-011)持续对着真实安装字节被验证。
|
|
22
20
|
|
|
23
21
|
**变更**
|
|
24
22
|
|
|
25
|
-
-
|
|
26
|
-
-
|
|
23
|
+
- 稳定四命令(scaffold、adopt-plan、projection、check)保持不变。
|
|
24
|
+
- 延续 0.4.0 的 adoption CLI 候选与 Quickstart Profile v2 离线 Bundle;0.5.0 未新增或移除任何 Kit 边界或候选入口。
|
|
27
25
|
|
|
28
26
|
**升级说明**
|
|
29
27
|
|
|
30
|
-
0.
|
|
28
|
+
0.5.0 已发布到 npm 与 public 镜像仓。Kit 公开面与 0.4.0 相同;面向新的契约规格 1.5.0 线请把包精确锁定为 0.5.0。
|
|
31
29
|
<!-- release-skill:managed:end id=latest-release -->
|
|
32
30
|
|
|
33
31
|
| 命令 | 用途 | 副作用 |
|
|
@@ -48,7 +46,7 @@ Kit 是「工程阶段」层,依赖 Harness 与 Contracts。它只做四件事
|
|
|
48
46
|
## 安装和最小示例
|
|
49
47
|
|
|
50
48
|
```sh
|
|
51
|
-
npm install --save-dev skill-family-engineering-kit@0.
|
|
49
|
+
npm install --save-dev skill-family-engineering-kit@0.5.0
|
|
52
50
|
npm exec -- skill-family-kit --help
|
|
53
51
|
npm exec -- skill-family-kit scaffold --root <empty-dir> --project-id my-project
|
|
54
52
|
npm exec -- skill-family-kit adopt-plan --root <repo>
|
|
@@ -56,7 +54,7 @@ npm exec -- skill-family-kit projection --root <repo>
|
|
|
56
54
|
npm exec -- skill-family-kit check --root <repo>
|
|
57
55
|
```
|
|
58
56
|
|
|
59
|
-
以上四条命令分别覆盖生成骨架、只读盘点、受管投影与诊断;零安装形式可用 `npm exec --package=skill-family-engineering-kit@0.
|
|
57
|
+
以上四条命令分别覆盖生成骨架、只读盘点、受管投影与诊断;零安装形式可用 `npm exec --package=skill-family-engineering-kit@0.5.0 -- skill-family-kit --help`。
|
|
60
58
|
|
|
61
59
|
### 报告子动作
|
|
62
60
|
|
|
@@ -80,7 +78,7 @@ import {
|
|
|
80
78
|
|
|
81
79
|
生成的 Bundle 按 Schema `$id` 选择 standalone validator,离线运行时不依赖 Foundation 包、`node_modules` 或 Ajv。provenance 绑定 Foundation 来源、消费者 Schema、payload 字节、工具版本,以及实际进入 Bundle 的代码许可证。
|
|
82
80
|
|
|
83
|
-
以上辅助函数不写文件,也不增加第五个顶层命令。调用方需要把返回的 `manifest` 交给稳定的 `runProjection` API。该子路径公开但**不稳定**;使用 v2 时应精确锁定 `0.
|
|
81
|
+
以上辅助函数不写文件,也不增加第五个顶层命令。调用方需要把返回的 `manifest` 交给稳定的 `runProjection` API。该子路径公开但**不稳定**;使用 v2 时应精确锁定 `0.4.0`,仍依赖 v1 依赖闭包 Bundle 的接入必须继续精确锁定 `0.2.1`。
|
|
84
82
|
|
|
85
83
|
### 宿主子动作
|
|
86
84
|
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { realpathSync } from "node:fs";
|
|
3
|
+
import { stdin, stdout, stderr } from "node:process";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import {
|
|
6
|
+
invokeFoundationAdoption,
|
|
7
|
+
verifyManagedBundleIdentity,
|
|
8
|
+
} from "./adoption-mechanisms.mjs";
|
|
9
|
+
|
|
10
|
+
const CLI_NAME = "adoption-cli.mjs";
|
|
11
|
+
|
|
12
|
+
async function readRequest(input) {
|
|
13
|
+
const chunks = [];
|
|
14
|
+
for await (const chunk of input) chunks.push(Buffer.from(chunk));
|
|
15
|
+
const text = new TextDecoder("utf-8", { fatal: true }).decode(Buffer.concat(chunks));
|
|
16
|
+
return JSON.parse(text);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function errorResponse(cause) {
|
|
20
|
+
return {
|
|
21
|
+
ok: false,
|
|
22
|
+
error: {
|
|
23
|
+
name: typeof cause?.name === "string" ? cause.name : "Error",
|
|
24
|
+
message: cause?.message ?? String(cause),
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** One-request/one-response transport for the fixed adoption operation set. */
|
|
30
|
+
export async function runAdoptionCli({
|
|
31
|
+
input = stdin,
|
|
32
|
+
output = stdout,
|
|
33
|
+
error = stderr,
|
|
34
|
+
invoke = invokeFoundationAdoption,
|
|
35
|
+
} = {}) {
|
|
36
|
+
try {
|
|
37
|
+
const request = await readRequest(input);
|
|
38
|
+
const result = request?.operation === "self-check"
|
|
39
|
+
? await runSelfCheck(request)
|
|
40
|
+
: await invoke(request);
|
|
41
|
+
output.write(`${JSON.stringify(result)}\n`);
|
|
42
|
+
return 0;
|
|
43
|
+
} catch (cause) {
|
|
44
|
+
error.write(`${JSON.stringify(errorResponse(cause))}\n`);
|
|
45
|
+
return 2;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
async function runSelfCheck(request) {
|
|
50
|
+
if (
|
|
51
|
+
request === null ||
|
|
52
|
+
typeof request !== "object" ||
|
|
53
|
+
Array.isArray(request) ||
|
|
54
|
+
Object.keys(request).sort().join(",") !== "operation,params" ||
|
|
55
|
+
request.params === null ||
|
|
56
|
+
typeof request.params !== "object" ||
|
|
57
|
+
Array.isArray(request.params) ||
|
|
58
|
+
Object.keys(request.params).length !== 0
|
|
59
|
+
) {
|
|
60
|
+
throw new TypeError("adoption CLI self-check requires exactly operation and empty params");
|
|
61
|
+
}
|
|
62
|
+
return verifyManagedBundleIdentity({ cliUrl: import.meta.url, cliName: CLI_NAME });
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (process.argv[1] && realpathSync(fileURLToPath(import.meta.url)) === realpathSync(process.argv[1])) {
|
|
66
|
+
process.exitCode = await runAdoptionCli();
|
|
67
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import {
|
|
2
|
+
assessAdoptionBinding,
|
|
3
|
+
assessLegacyExitList,
|
|
4
|
+
assessLegacyReferences,
|
|
5
|
+
loadMigrationManifestState,
|
|
6
|
+
} from "../src/migration.mjs";
|
|
7
|
+
import {
|
|
8
|
+
verifyHarnessSurfaceInventory,
|
|
9
|
+
verifyManagedBundleIdentity,
|
|
10
|
+
} from "skill-family-harness-node/candidate/quickstart-profile";
|
|
11
|
+
|
|
12
|
+
export { verifyManagedBundleIdentity };
|
|
13
|
+
|
|
14
|
+
const ADOPTION_OPERATIONS = Object.freeze([
|
|
15
|
+
"load-migration-manifest-state",
|
|
16
|
+
"assess-adoption-binding",
|
|
17
|
+
"assess-legacy-exit-list",
|
|
18
|
+
"assess-legacy-references",
|
|
19
|
+
"verify-harness-surface-inventory",
|
|
20
|
+
]);
|
|
21
|
+
|
|
22
|
+
const FORBIDDEN_ROUTING_KEYS = new Set(["entry", "module", "export", "pathToFileURL"]);
|
|
23
|
+
|
|
24
|
+
function assertNoRoutingKeys(value, path = "params") {
|
|
25
|
+
if (value === null || typeof value !== "object") return;
|
|
26
|
+
if (Array.isArray(value)) {
|
|
27
|
+
value.forEach((item, index) => assertNoRoutingKeys(item, `${path}/${index}`));
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
for (const [key, child] of Object.entries(value)) {
|
|
31
|
+
if (FORBIDDEN_ROUTING_KEYS.has(key)) {
|
|
32
|
+
throw new TypeError(`invokeFoundationAdoption: caller routing key is forbidden at ${path}/${key}`);
|
|
33
|
+
}
|
|
34
|
+
assertNoRoutingKeys(child, `${path}/${key}`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** Fixed, read-only adoption bridge; callers cannot select code or exports. */
|
|
39
|
+
export async function invokeFoundationAdoption(request) {
|
|
40
|
+
if (request === null || typeof request !== "object" || Array.isArray(request)) {
|
|
41
|
+
throw new TypeError("invokeFoundationAdoption: request must be an object");
|
|
42
|
+
}
|
|
43
|
+
const requestKeys = Object.keys(request).sort();
|
|
44
|
+
if (requestKeys.length !== 2 || requestKeys[0] !== "operation" || requestKeys[1] !== "params") {
|
|
45
|
+
throw new TypeError("invokeFoundationAdoption: request must contain exactly operation and params");
|
|
46
|
+
}
|
|
47
|
+
const { operation, params } = request;
|
|
48
|
+
if (!ADOPTION_OPERATIONS.includes(operation)) {
|
|
49
|
+
throw new TypeError(`invokeFoundationAdoption: unknown operation: ${String(operation)}`);
|
|
50
|
+
}
|
|
51
|
+
if (params === null || typeof params !== "object" || Array.isArray(params)) {
|
|
52
|
+
throw new TypeError("invokeFoundationAdoption: params must be an object");
|
|
53
|
+
}
|
|
54
|
+
assertNoRoutingKeys(params);
|
|
55
|
+
switch (operation) {
|
|
56
|
+
case "load-migration-manifest-state":
|
|
57
|
+
return loadMigrationManifestState(params.root);
|
|
58
|
+
case "assess-adoption-binding":
|
|
59
|
+
return assessAdoptionBinding(params.manifest, params.profileId);
|
|
60
|
+
case "assess-legacy-exit-list":
|
|
61
|
+
return assessLegacyExitList(params.root, params.legacyItems);
|
|
62
|
+
case "assess-legacy-references":
|
|
63
|
+
return assessLegacyReferences(params.root, params.legacyReferences);
|
|
64
|
+
case "verify-harness-surface-inventory":
|
|
65
|
+
return verifyHarnessSurfaceInventory(params);
|
|
66
|
+
default:
|
|
67
|
+
throw new TypeError("invokeFoundationAdoption: unreachable operation");
|
|
68
|
+
}
|
|
69
|
+
}
|
package/candidate/index.mjs
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export {
|
|
2
2
|
buildQuickstartProfileProjection,
|
|
3
|
+
buildQuickstartProfileProjectionFromInventory,
|
|
3
4
|
QUICKSTART_PROFILE_TARGET_PREFIX,
|
|
4
5
|
} from "./profile-bundle.mjs";
|
|
6
|
+
export { invokeFoundationAdoption } from "./adoption-mechanisms.mjs";
|
|
7
|
+
export { runAdoptionCli } from "./adoption-cli.mjs";
|