skill-family-engineering-kit 0.5.0 → 0.6.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.
Files changed (119) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/CHANGELOG.zh-CN.md +22 -0
  3. package/README.md +12 -10
  4. package/README.zh-CN.md +12 -10
  5. package/package.json +3 -3
  6. package/release-notes/0.6.0.yaml +25 -0
  7. package/src/adopt-plan.mjs +81 -159
  8. package/src/check.mjs +443 -19
  9. package/src/cli.mjs +80 -1
  10. package/src/core-check.mjs +8 -4
  11. package/src/entry-check.mjs +384 -0
  12. package/src/errors.mjs +21 -0
  13. package/src/index.mjs +35 -6
  14. package/src/projection.mjs +221 -12
  15. package/src/relock.mjs +397 -0
  16. package/src/skeleton.mjs +162 -4
  17. package/CODE_OF_CONDUCT.md +0 -131
  18. package/CONTRIBUTING.md +0 -25
  19. package/SECURITY.md +0 -33
  20. package/docs/.nojekyll +0 -0
  21. package/docs/404.html +0 -1666
  22. package/docs/agents/architecture-routing/index.html +0 -1944
  23. package/docs/agents/capability-catalog.en.json +0 -1821
  24. package/docs/agents/capability-catalog.json +0 -1073
  25. package/docs/agents/capability-catalog.schema.json +0 -179
  26. package/docs/agents/capability-catalog.zh-CN.json +0 -1821
  27. package/docs/agents/index.html +0 -1914
  28. package/docs/architecture/index.html +0 -2194
  29. package/docs/assets/images/favicon.png +0 -0
  30. package/docs/assets/javascripts/bundle.d7400e89.min.js +0 -16
  31. package/docs/assets/javascripts/lunr/min/lunr.ar.min.js +0 -1
  32. package/docs/assets/javascripts/lunr/min/lunr.da.min.js +0 -18
  33. package/docs/assets/javascripts/lunr/min/lunr.de.min.js +0 -18
  34. package/docs/assets/javascripts/lunr/min/lunr.du.min.js +0 -18
  35. package/docs/assets/javascripts/lunr/min/lunr.el.min.js +0 -1
  36. package/docs/assets/javascripts/lunr/min/lunr.es.min.js +0 -18
  37. package/docs/assets/javascripts/lunr/min/lunr.fi.min.js +0 -18
  38. package/docs/assets/javascripts/lunr/min/lunr.fr.min.js +0 -18
  39. package/docs/assets/javascripts/lunr/min/lunr.he.min.js +0 -1
  40. package/docs/assets/javascripts/lunr/min/lunr.hi.min.js +0 -1
  41. package/docs/assets/javascripts/lunr/min/lunr.hu.min.js +0 -18
  42. package/docs/assets/javascripts/lunr/min/lunr.hy.min.js +0 -1
  43. package/docs/assets/javascripts/lunr/min/lunr.it.min.js +0 -18
  44. package/docs/assets/javascripts/lunr/min/lunr.ja.min.js +0 -1
  45. package/docs/assets/javascripts/lunr/min/lunr.jp.min.js +0 -1
  46. package/docs/assets/javascripts/lunr/min/lunr.kn.min.js +0 -1
  47. package/docs/assets/javascripts/lunr/min/lunr.ko.min.js +0 -1
  48. package/docs/assets/javascripts/lunr/min/lunr.multi.min.js +0 -1
  49. package/docs/assets/javascripts/lunr/min/lunr.nl.min.js +0 -18
  50. package/docs/assets/javascripts/lunr/min/lunr.no.min.js +0 -18
  51. package/docs/assets/javascripts/lunr/min/lunr.pt.min.js +0 -18
  52. package/docs/assets/javascripts/lunr/min/lunr.ro.min.js +0 -18
  53. package/docs/assets/javascripts/lunr/min/lunr.ru.min.js +0 -18
  54. package/docs/assets/javascripts/lunr/min/lunr.sa.min.js +0 -1
  55. package/docs/assets/javascripts/lunr/min/lunr.stemmer.support.min.js +0 -1
  56. package/docs/assets/javascripts/lunr/min/lunr.sv.min.js +0 -18
  57. package/docs/assets/javascripts/lunr/min/lunr.ta.min.js +0 -1
  58. package/docs/assets/javascripts/lunr/min/lunr.te.min.js +0 -1
  59. package/docs/assets/javascripts/lunr/min/lunr.th.min.js +0 -1
  60. package/docs/assets/javascripts/lunr/min/lunr.tr.min.js +0 -18
  61. package/docs/assets/javascripts/lunr/min/lunr.vi.min.js +0 -1
  62. package/docs/assets/javascripts/lunr/min/lunr.zh.min.js +0 -1
  63. package/docs/assets/javascripts/lunr/tinyseg.js +0 -206
  64. package/docs/assets/javascripts/lunr/wordcut.js +0 -6708
  65. package/docs/assets/javascripts/workers/search.2c215733.min.js +0 -42
  66. package/docs/assets/stylesheets/main.ec1eaa64.min.css +0 -1
  67. package/docs/assets/stylesheets/palette.ab4e12ef.min.css +0 -1
  68. package/docs/en/agents/architecture-routing/index.html +0 -1944
  69. package/docs/en/agents/index.html +0 -1925
  70. package/docs/en/architecture/index.html +0 -2196
  71. package/docs/en/examples-and-fixtures/index.html +0 -1888
  72. package/docs/en/help/index.html +0 -2035
  73. package/docs/en/index.html +0 -1895
  74. package/docs/en/licensing/index.html +0 -1917
  75. package/docs/en/migration/index.html +0 -2335
  76. package/docs/en/quickstart/index.html +0 -1919
  77. package/docs/en/recipes/adapter-text-closure/index.html +0 -2000
  78. package/docs/en/recipes/adopt-existing-repository/index.html +0 -1987
  79. package/docs/en/recipes/deterministic-human-report/index.html +0 -1998
  80. package/docs/en/recipes/domain-schema-validation/index.html +0 -2009
  81. package/docs/en/recipes/durable-local-state/index.html +0 -2009
  82. package/docs/en/recipes/host-profile-integration/index.html +0 -2001
  83. package/docs/en/recipes/index.html +0 -1877
  84. package/docs/en/recipes/safe-filesystem-and-atomic-write/index.html +0 -1994
  85. package/docs/en/reference/api/index.html +0 -1941
  86. package/docs/en/reference/compatibility/index.html +0 -2036
  87. package/docs/en/reference/failure-and-side-effect-matrix/index.html +0 -2216
  88. package/docs/examples-and-fixtures/index.html +0 -1871
  89. package/docs/git-lifecycle/index.html +0 -2029
  90. package/docs/help/index.html +0 -2035
  91. package/docs/index.html +0 -1893
  92. package/docs/integration/audit/baseline/audit-codes.json +0 -62
  93. package/docs/integration/audit/failure-evidence/index.html +0 -1925
  94. package/docs/integration/audit/independence/index.html +0 -1894
  95. package/docs/integration/audit/index.html +0 -1880
  96. package/docs/integration/audit/mutation-taxonomy/index.html +0 -2075
  97. package/docs/integration/audit/schemas/audit-evidence.schema.json +0 -182
  98. package/docs/integration/audit/version-compatibility/index.html +0 -1902
  99. package/docs/licensing/index.html +0 -1917
  100. package/docs/migration/index.html +0 -2335
  101. package/docs/public/status/index.html +0 -1884
  102. package/docs/quickstart/index.html +0 -1919
  103. package/docs/recipes/adapter-text-closure/index.html +0 -2000
  104. package/docs/recipes/adopt-existing-repository/index.html +0 -1987
  105. package/docs/recipes/deterministic-human-report/index.html +0 -1998
  106. package/docs/recipes/domain-schema-validation/index.html +0 -2009
  107. package/docs/recipes/durable-local-state/index.html +0 -2009
  108. package/docs/recipes/host-profile-integration/index.html +0 -2001
  109. package/docs/recipes/index.html +0 -1877
  110. package/docs/recipes/safe-filesystem-and-atomic-write/index.html +0 -1994
  111. package/docs/reference/api/contracts/index.html +0 -2558
  112. package/docs/reference/api/engineering-kit/index.html +0 -2577
  113. package/docs/reference/api/harness/index.html +0 -3029
  114. package/docs/reference/api/index.html +0 -1881
  115. package/docs/reference/compatibility/index.html +0 -2036
  116. package/docs/reference/failure-and-side-effect-matrix/index.html +0 -2216
  117. package/docs/search/search_index.json +0 -1
  118. package/docs/setup/index.html +0 -1995
  119. package/docs/sitemap.xml +0 -207
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # Changelog
2
2
 
3
+ <!-- release-skill:changelog:start version=0.6.0 locale=en baseline=sha256:e84a44b51d513c123ce3c5e91c9e50374c6e899aa021adabe8e44c3ad86eb2b2 -->
4
+ ## [0.6.0] - 2026-08-21
5
+
6
+ This release extends the check command with the entry contract gate and the controlled relock transaction sub-actions, adds external frozen authority projection bindings (FG-3), and carries the nine-class check diagnostics (audit remediation C2).
7
+
8
+ ### Added
9
+
10
+ - Adds the check entries sub-action - runEntryContractCheck and checkEntriesAction run the shared entry contract gate (SFA-ENTRY-003/004/005/007 and SFA-CONTEXT-001/002) over skill-family.entry-contract.json and SKILL.md bytes; diagnosis only, zero writes.
11
+ - Adds the check relock sub-action - runRelock and relockAction are the one controlled exception to the no-write rule - a fail-closed transaction writing exactly the two contained state documents (.foundation/file-registry.json and skill-family.managed-file-lock.json), with drift validation before the first write and zero writes on any refusal.
12
+ - Adds external frozen authority projection bindings (FG-3) - PROJECTION_AUTHORITY_BINDING_KINDS freezes external-root and caller-bytes; external-root re-reads each authority source from a separate frozen directory through the strict no-follow reader, and caller-bytes binds caller-provided base64 authority bytes to declared sha256 digests with no authority filesystem access at all, keeping the target root free of forged local authority facts.
13
+
14
+ ### Changed
15
+
16
+ - Extends check diagnostics to nine classes (adds version single-source consistency, public boundary validation, and platform subset declaration validation); COMMAND_SIDE_EFFECTS now documents the entries and relock sub-action semantics.
17
+ - Keeps the four top-level commands (scaffold, adopt-plan, projection, check) unchanged; entries and relock are check sub-actions, not new commands.
18
+
19
+ ### Upgrade Notes
20
+
21
+ Version 0.6.0 is the Kit gate completion line. Projections whose authority does not live in the target root must declare an authorityBinding of kind external-root or caller-bytes and pin exactly 0.6.0.
22
+ <!-- release-skill:changelog:end version=0.6.0 locale=en -->
23
+
24
+
3
25
  <!-- release-skill:changelog:start version=0.5.0 locale=en baseline=sha256:f83b9c3442e5391149531b198be25131cf45728ff945d4ffc531342996e4e6f3 -->
4
26
  ## [0.5.0] - 2026-08-16
5
27
 
@@ -1,5 +1,27 @@
1
1
  # 变更日志
2
2
 
3
+ <!-- release-skill:changelog:start version=0.6.0 locale=zh-CN baseline=sha256:e48a11bcbdffb317068cb751f914809360aa8f2e2b852b1e436696601f6a2a47 -->
4
+ ## [0.6.0] - 2026-08-21
5
+
6
+ 本版为 check 命令新增入口契约门禁与受控 relock 事务子动作,新增外部冻结权威投影绑定(FG-3),并承载九类 check 诊断(审计整改 C2)。
7
+
8
+ ### 新增
9
+
10
+ - 新增 check entries 子动作:runEntryContractCheck 与 checkEntriesAction 运行共享入口契约门禁(SFA-ENTRY-003/004/005/007 与 SFA-CONTEXT-001/002),作用于 skill-family.entry-contract.json 与 SKILL.md 字节;只诊断、零写入。
11
+ - 新增 check relock 子动作:runRelock 与 relockAction 是零写入规则的唯一受控例外——一次失败关闭事务,精确写入两个受收容状态文档(.foundation/file-registry.json 与 skill-family.managed-file-lock.json),首次写入前做漂移校验,任何拒绝下零写入。
12
+ - 新增外部冻结权威投影绑定(FG-3):PROJECTION_AUTHORITY_BINDING_KINDS 冻结 external-root 与 caller-bytes;external-root 经严格不跟随读取器从独立的冻结目录重读每个权威源,caller-bytes 将调用方提供的 base64 权威字节绑定到声明的 sha256 摘要、完全不访问权威文件系统,使目标根内不存在伪造的本地权威事实。
13
+
14
+ ### 变更
15
+
16
+ - check 诊断扩展为九类(新增版本单源一致性、公开边界校验、平台子集限制声明校验);COMMAND_SIDE_EFFECTS 现记录 entries 与 relock 子动作语义。
17
+ - 四个顶层命令(scaffold、adopt-plan、projection、check)保持不变;entries 与 relock 是 check 子动作,不是新命令。
18
+
19
+ ### 升级说明
20
+
21
+ 0.6.0 是 Kit 门禁补齐线。权威不在目标根内的投影必须声明 kind 为 external-root 或 caller-bytes 的 authorityBinding,并精确锁定 0.6.0。
22
+ <!-- release-skill:changelog:end version=0.6.0 locale=zh-CN -->
23
+
24
+
3
25
  <!-- release-skill:changelog:start version=0.5.0 locale=zh-CN baseline=sha256:bdeefb2e456f6e9d1348152b464c701e96a739e514c5a08ca3576e9982e9b7e0 -->
4
26
  ## [0.5.0] - 2026-08-16
5
27
 
package/README.md CHANGED
@@ -4,27 +4,29 @@
4
4
 
5
5
  # skill-family-engineering-kit
6
6
 
7
- <!-- release-skill:release-version: 0.5.0 -->
7
+ <!-- release-skill:release-version: 0.6.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.5.0** (2026-08-16)
12
+ **0.6.0** (2026-08-21)
13
13
 
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.
14
+ This release extends the check command with the entry contract gate and the controlled relock transaction sub-actions, adds external frozen authority projection bindings (FG-3), and carries the nine-class check diagnostics (audit remediation C2).
15
15
 
16
16
  **Added**
17
17
 
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.
18
+ - Adds the check entries sub-action - runEntryContractCheck and checkEntriesAction run the shared entry contract gate (SFA-ENTRY-003/004/005/007 and SFA-CONTEXT-001/002) over skill-family.entry-contract.json and SKILL.md bytes; diagnosis only, zero writes.
19
+ - Adds the check relock sub-action - runRelock and relockAction are the one controlled exception to the no-write rule - a fail-closed transaction writing exactly the two contained state documents (.foundation/file-registry.json and skill-family.managed-file-lock.json), with drift validation before the first write and zero writes on any refusal.
20
+ - Adds external frozen authority projection bindings (FG-3) - PROJECTION_AUTHORITY_BINDING_KINDS freezes external-root and caller-bytes; external-root re-reads each authority source from a separate frozen directory through the strict no-follow reader, and caller-bytes binds caller-provided base64 authority bytes to declared sha256 digests with no authority filesystem access at all, keeping the target root free of forged local authority facts.
19
21
 
20
22
  **Changed**
21
23
 
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.
24
+ - Extends check diagnostics to nine classes (adds version single-source consistency, public boundary validation, and platform subset declaration validation); COMMAND_SIDE_EFFECTS now documents the entries and relock sub-action semantics.
25
+ - Keeps the four top-level commands (scaffold, adopt-plan, projection, check) unchanged; entries and relock are check sub-actions, not new commands.
24
26
 
25
27
  **Upgrade Notes**
26
28
 
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.
29
+ Version 0.6.0 is the Kit gate completion line. Projections whose authority does not live in the target root must declare an authorityBinding of kind external-root or caller-bytes and pin exactly 0.6.0.
28
30
  <!-- release-skill:managed:end id=latest-release -->
29
31
 
30
32
  | Command | Purpose | Side effects |
@@ -45,7 +47,7 @@ Kit is the "engineering stage" layer, depending on the Harness and Contracts. It
45
47
  ## Installation and Minimal Example
46
48
 
47
49
  ```sh
48
- npm install --save-dev skill-family-engineering-kit@0.5.0
50
+ npm install --save-dev skill-family-engineering-kit@0.6.0
49
51
  npm exec -- skill-family-kit --help
50
52
  npm exec -- skill-family-kit scaffold --root <empty-dir> --project-id my-project
51
53
  npm exec -- skill-family-kit adopt-plan --root <repo>
@@ -53,7 +55,7 @@ npm exec -- skill-family-kit projection --root <repo>
53
55
  npm exec -- skill-family-kit check --root <repo>
54
56
  ```
55
57
 
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`.
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.6.0 -- skill-family-kit --help`.
57
59
 
58
60
  ### Report sub-action
59
61
 
@@ -158,7 +160,7 @@ This package must not perform git init, commit, push, tag, stash, branch switch,
158
160
  - `foundation.kit.scaffold`: generate a precise skeleton in an empty directory, atomic + contained.
159
161
  - `foundation.kit.adopt-plan`: strictly read-only inventory and completion determination of an existing repo.
160
162
  - `foundation.kit.projection`: managed projection, write only after full validation, zero writes on failure.
161
- - `foundation.kit.check`: seven check classes, diagnosis only, no fix.
163
+ - `foundation.kit.check`: nine check classes, diagnosis only, no fix.
162
164
  - `foundation.kit.report`: projection/check report sub-action orchestration.
163
165
  - `foundation.kit.git-probe`: read-only whitelisted Git status probe.
164
166
  - `foundation.kit.host`: describe/build/probe/plan, apply stably rejected.
package/README.zh-CN.md CHANGED
@@ -5,27 +5,29 @@
5
5
 
6
6
  # skill-family-engineering-kit
7
7
 
8
- <!-- release-skill:release-version: 0.5.0 -->
8
+ <!-- release-skill:release-version: 0.6.0 -->
9
9
 
10
10
  开发与 CI 阶段使用的工程工具包。**恰好四个**顶层命令,没有第五个:
11
11
 
12
12
  <!-- release-skill:managed:start id=latest-release -->
13
- **0.5.0** (2026-08-16)
13
+ **0.6.0** (2026-08-21)
14
14
 
15
- 本版保持 Kit 稳定四命令边界不变,并把离线消费者验证门加固为覆盖三个 Foundation 包的完整第三方生产闭包。
15
+ 本版为 check 命令新增入口契约门禁与受控 relock 事务子动作,新增外部冻结权威投影绑定(FG-3),并承载九类 check 诊断(审计整改 C2)。
16
16
 
17
17
  **新增**
18
18
 
19
- - 加固离线消费者验证门:candidate-profile-bundle tarball-source-binding 测试中的第三方闭包推导从单包闭包扩展为三个 Foundation 包的完整生产闭包(真实身份去重、npm: 别名感知、range-scoped override selector、对 pnpm 真实本地存储目录的字节身份),使 harness 运行时依赖评审决策(FND-ADR-011)持续对着真实安装字节被验证。
19
+ - 新增 check entries 子动作:runEntryContractCheck checkEntriesAction 运行共享入口契约门禁(SFA-ENTRY-003/004/005/007 SFA-CONTEXT-001/002),作用于 skill-family.entry-contract.json SKILL.md 字节;只诊断、零写入。
20
+ - 新增 check relock 子动作:runRelock 与 relockAction 是零写入规则的唯一受控例外——一次失败关闭事务,精确写入两个受收容状态文档(.foundation/file-registry.json 与 skill-family.managed-file-lock.json),首次写入前做漂移校验,任何拒绝下零写入。
21
+ - 新增外部冻结权威投影绑定(FG-3):PROJECTION_AUTHORITY_BINDING_KINDS 冻结 external-root 与 caller-bytes;external-root 经严格不跟随读取器从独立的冻结目录重读每个权威源,caller-bytes 将调用方提供的 base64 权威字节绑定到声明的 sha256 摘要、完全不访问权威文件系统,使目标根内不存在伪造的本地权威事实。
20
22
 
21
23
  **变更**
22
24
 
23
- - 稳定四命令(scaffold、adopt-plan、projection、check)保持不变。
24
- - 延续 0.4.0 adoption CLI 候选与 Quickstart Profile v2 离线 Bundle;0.5.0 未新增或移除任何 Kit 边界或候选入口。
25
+ - check 诊断扩展为九类(新增版本单源一致性、公开边界校验、平台子集限制声明校验);COMMAND_SIDE_EFFECTS 现记录 entries 与 relock 子动作语义。
26
+ - 四个顶层命令(scaffold、adopt-plan、projection、check)保持不变;entries relock check 子动作,不是新命令。
25
27
 
26
28
  **升级说明**
27
29
 
28
- 0.5.0 已发布到 npm public 镜像仓。Kit 公开面与 0.4.0 相同;面向新的契约规格 1.5.0 线请把包精确锁定为 0.5.0。
30
+ 0.6.0 Kit 门禁补齐线。权威不在目标根内的投影必须声明 kind external-root caller-bytes authorityBinding,并精确锁定 0.6.0。
29
31
  <!-- release-skill:managed:end id=latest-release -->
30
32
 
31
33
  | 命令 | 用途 | 副作用 |
@@ -46,7 +48,7 @@ Kit 是「工程阶段」层,依赖 Harness 与 Contracts。它只做四件事
46
48
  ## 安装和最小示例
47
49
 
48
50
  ```sh
49
- npm install --save-dev skill-family-engineering-kit@0.5.0
51
+ npm install --save-dev skill-family-engineering-kit@0.6.0
50
52
  npm exec -- skill-family-kit --help
51
53
  npm exec -- skill-family-kit scaffold --root <empty-dir> --project-id my-project
52
54
  npm exec -- skill-family-kit adopt-plan --root <repo>
@@ -54,7 +56,7 @@ npm exec -- skill-family-kit projection --root <repo>
54
56
  npm exec -- skill-family-kit check --root <repo>
55
57
  ```
56
58
 
57
- 以上四条命令分别覆盖生成骨架、只读盘点、受管投影与诊断;零安装形式可用 `npm exec --package=skill-family-engineering-kit@0.5.0 -- skill-family-kit --help`。
59
+ 以上四条命令分别覆盖生成骨架、只读盘点、受管投影与诊断;零安装形式可用 `npm exec --package=skill-family-engineering-kit@0.6.0 -- skill-family-kit --help`。
58
60
 
59
61
  ### 报告子动作
60
62
 
@@ -159,7 +161,7 @@ projection 只写同时满足两个条件的路径:manifest 列出,且目标
159
161
  - `foundation.kit.scaffold`:空目录生成精确骨架,原子 + 收容。
160
162
  - `foundation.kit.adopt-plan`:存量仓严格只读盘点与完成判定。
161
163
  - `foundation.kit.projection`:受管投影,全校验后才写,失败零写。
162
- - `foundation.kit.check`:七类检查只诊断不修复。
164
+ - `foundation.kit.check`:九类检查只诊断不修复。
163
165
  - `foundation.kit.report`:projection/check report 子动作编排。
164
166
  - `foundation.kit.git-probe`:只读白名单 Git 状态探测。
165
167
  - `foundation.kit.host`:describe/build/probe/plan,apply 稳定拒绝。
package/package.json CHANGED
@@ -8,8 +8,8 @@
8
8
  "url": "https://github.com/ifoohoo/skill-family-engineering-kit/issues"
9
9
  },
10
10
  "dependencies": {
11
- "skill-family-contracts": "0.5.0",
12
- "skill-family-harness-node": "0.5.0"
11
+ "skill-family-contracts": "0.6.0",
12
+ "skill-family-harness-node": "0.6.0"
13
13
  },
14
14
  "description": "Build-time scaffold, adoption planning, projection, and checks.",
15
15
  "engines": {
@@ -46,7 +46,7 @@
46
46
  "url": "https://github.com/ifoohoo/skill-family-engineering-kit.git"
47
47
  },
48
48
  "type": "module",
49
- "version": "0.5.0",
49
+ "version": "0.6.0",
50
50
  "scripts": {
51
51
  "check": "node --test",
52
52
  "test": "node --test"
@@ -0,0 +1,25 @@
1
+ version: 0.6.0
2
+ date: 2026-08-21
3
+ locales:
4
+ en:
5
+ summary: This release extends the check command with the entry contract gate and the controlled relock transaction sub-actions, adds external frozen authority projection bindings (FG-3), and carries the nine-class check diagnostics (audit remediation C2).
6
+ changes:
7
+ added:
8
+ - Adds the check entries sub-action - runEntryContractCheck and checkEntriesAction run the shared entry contract gate (SFA-ENTRY-003/004/005/007 and SFA-CONTEXT-001/002) over skill-family.entry-contract.json and SKILL.md bytes; diagnosis only, zero writes.
9
+ - Adds the check relock sub-action - runRelock and relockAction are the one controlled exception to the no-write rule - a fail-closed transaction writing exactly the two contained state documents (.foundation/file-registry.json and skill-family.managed-file-lock.json), with drift validation before the first write and zero writes on any refusal.
10
+ - Adds external frozen authority projection bindings (FG-3) - PROJECTION_AUTHORITY_BINDING_KINDS freezes external-root and caller-bytes; external-root re-reads each authority source from a separate frozen directory through the strict no-follow reader, and caller-bytes binds caller-provided base64 authority bytes to declared sha256 digests with no authority filesystem access at all, keeping the target root free of forged local authority facts.
11
+ changed:
12
+ - Extends check diagnostics to nine classes (adds version single-source consistency, public boundary validation, and platform subset declaration validation); COMMAND_SIDE_EFFECTS now documents the entries and relock sub-action semantics.
13
+ - Keeps the four top-level commands (scaffold, adopt-plan, projection, check) unchanged; entries and relock are check sub-actions, not new commands.
14
+ upgradeNotes: Version 0.6.0 is the Kit gate completion line. Projections whose authority does not live in the target root must declare an authorityBinding of kind external-root or caller-bytes and pin exactly 0.6.0.
15
+ zh-CN:
16
+ summary: 本版为 check 命令新增入口契约门禁与受控 relock 事务子动作,新增外部冻结权威投影绑定(FG-3),并承载九类 check 诊断(审计整改 C2)。
17
+ changes:
18
+ added:
19
+ - 新增 check entries 子动作:runEntryContractCheck 与 checkEntriesAction 运行共享入口契约门禁(SFA-ENTRY-003/004/005/007 与 SFA-CONTEXT-001/002),作用于 skill-family.entry-contract.json 与 SKILL.md 字节;只诊断、零写入。
20
+ - 新增 check relock 子动作:runRelock 与 relockAction 是零写入规则的唯一受控例外——一次失败关闭事务,精确写入两个受收容状态文档(.foundation/file-registry.json 与 skill-family.managed-file-lock.json),首次写入前做漂移校验,任何拒绝下零写入。
21
+ - 新增外部冻结权威投影绑定(FG-3):PROJECTION_AUTHORITY_BINDING_KINDS 冻结 external-root 与 caller-bytes;external-root 经严格不跟随读取器从独立的冻结目录重读每个权威源,caller-bytes 将调用方提供的 base64 权威字节绑定到声明的 sha256 摘要、完全不访问权威文件系统,使目标根内不存在伪造的本地权威事实。
22
+ changed:
23
+ - check 诊断扩展为九类(新增版本单源一致性、公开边界校验、平台子集限制声明校验);COMMAND_SIDE_EFFECTS 现记录 entries 与 relock 子动作语义。
24
+ - 四个顶层命令(scaffold、adopt-plan、projection、check)保持不变;entries 与 relock 是 check 子动作,不是新命令。
25
+ upgradeNotes: 0.6.0 是 Kit 门禁补齐线。权威不在目标根内的投影必须声明 kind 为 external-root 或 caller-bytes 的 authorityBinding,并精确锁定 0.6.0。
@@ -12,8 +12,8 @@ import {
12
12
  findNestedRepositories,
13
13
  loadMigrationManifestState,
14
14
  MIGRATION_MANIFEST_PATH,
15
+ REQUIRED_FOUNDATION_PACKAGES,
15
16
  validateException,
16
- VERIFICATION_EVIDENCE_KINDS,
17
17
  } from "./migration.mjs";
18
18
  import {
19
19
  describeSkeletonFiles,
@@ -54,147 +54,67 @@ async function readExistingBytes(rootAbs, relPath) {
54
54
  }
55
55
 
56
56
  /**
57
- * The ten-field per-repository adoption hand-off draft.
57
+ * The per-adoption profile draft (SPI v2; remediation handoff C3/D-8).
58
58
  *
59
- * adopt-plan must carry enough structured data to draft the planner's
60
- * ten-field hand-off. Fields that cannot be derived mechanically from
61
- * read-only evidence are marked INCOMPLETE and block the draft the kit
62
- * never guesses. The draft binds the target file-set digest and the
63
- * Foundation plan digest; rendering is a separate read-only planner task
64
- * that only ever writes the planner-side draft, never the consumer repo.
59
+ * Replaces the deprecated ten-field hand-off draft of the adoption-lock
60
+ * era: the adoption-lock concept and its artifact form are abolished, and
61
+ * the lightweight adoption proof is the profile.json descriptor's own
62
+ * adoption declaration, machine-verified by verifyProfile (SPI v2):
63
+ * descriptor-schema completeness of the minimal adoption field set, GK-4
64
+ * real-file digest discipline (SPE1006), and the tightening-only overrides
65
+ * policy (SPE1007).
66
+ *
67
+ * The draft pre-fills everything derivable from read-only facts:
68
+ * - descriptor identity (profile id/name from the plan inputs) and the
69
+ * frozen contracts base;
70
+ * - the D-8 minimal adoption field set (foundation_profile, foundation_pin,
71
+ * adopted_at) with pin versions pre-filled manifest-declaration-first,
72
+ * then from the loaded package constants;
73
+ * - an empty overrides array — the empty example. Overrides are opt-in
74
+ * self-tightening declarations; the kit never enumerates rule examples
75
+ * (the core never imports the profile layer).
76
+ * Every non-derivable field stays null and is listed in incompleteFields —
77
+ * the kit never guesses. The draft binds the target file-set digest and the
78
+ * Foundation plan digest.
65
79
  */
66
- export const HANDOFF_FIELDS = Object.freeze([
67
- "project-identity",
68
- "repository-state",
69
- "foundation-binding",
70
- "write-set-policy",
71
- "legacy-exits",
72
- "business-logic-to-keep",
73
- "plan-summary",
74
- "verification-entries",
75
- "legacy-removal-recovery",
76
- "authorization-status",
77
- ]);
78
-
79
- export function buildHandoffDraft({
80
- projectId,
81
- rootAbs,
82
- agentsFiles,
83
- git,
84
- gitFacts,
85
- unregisteredPaths,
86
- nestedRepositories,
87
- inputs,
88
- migrationManifest,
89
- writeSet,
90
- conflicts,
91
- risks,
92
- legacyExitList,
93
- legacyReferenceExitList,
94
- verificationFacts,
95
- migrationState,
96
- entries,
97
- }) {
98
- const fields = [];
99
- const push = (id, name, status, value) => fields.push({ id, name, status, value });
100
-
101
- // 1. Project identity, absolute path, project-level AGENTS files.
102
- push(1, HANDOFF_FIELDS[0], "derived", {
103
- projectId,
104
- root: rootAbs,
105
- agentsFiles: agentsFiles ?? [],
106
- });
107
-
108
- // 2. dirty / untracked / nested-repository state — facts or not-proven,
109
- // never fabricated.
110
- push(2, HANDOFF_FIELDS[1], "derived", {
111
- repository: git.repository,
112
- headCommit: git.headCommit,
113
- cleanState: git.cleanState,
114
- dirty: git.cleanState === false,
115
- unregisteredContent: git.repository ? null : unregisteredPaths ?? [],
116
- nestedRepositories: nestedRepositories ?? [],
117
- trackedButIgnored: gitFacts?.status === "proven" ? gitFacts.trackedButIgnored : null,
118
- gitFactsStatus: gitFacts?.status ?? "not-proven",
119
- });
120
-
121
- // 3. Profile plus exact Foundation versions and digests: only the
122
- // manifest-declared binding counts; an undeclared binding is INCOMPLETE.
80
+ export function buildProfileDraft({ inputs, migrationManifest, writeSet, entries }) {
81
+ const incompleteFields = [];
82
+
83
+ // foundation_profile (D-8 minimal set): the adopted foundation profile id
84
+ // is derivable from the plan inputs; its version and stability are human
85
+ // decisions the kit never guesses.
86
+ const foundationProfile = { id: inputs.profileId, version: null, stability: null };
87
+ incompleteFields.push("adoption.foundation_profile.version", "adoption.foundation_profile.stability");
88
+
89
+ // foundation_pin (D-8 minimal set): versions are manifest-declared
90
+ // bindings first, then loaded package constants; path and sha256 exist
91
+ // only once the real pinned artifacts have been placed inside the profile
92
+ // write set — until then they stay null (GK-4 digest discipline: a digest
93
+ // is computed from real artifact bytes, never guessed).
123
94
  const declaredPackages = Array.isArray(migrationManifest?.foundationPackages)
124
95
  ? migrationManifest.foundationPackages
125
- : null;
126
- push(3, HANDOFF_FIELDS[2], declaredPackages && declaredPackages.length > 0 ? "derived" : "INCOMPLETE", {
127
- plannedProfile: inputs.profileId,
128
- contractsVersion: CONTRACTS_VERSION,
129
- foundationPackages: declaredPackages,
130
- });
131
-
132
- // 4. Allowed and forbidden write sets.
133
- const creates = writeSet.filter((item) => item.action !== "unchanged").map((item) => item.path).sort();
134
- push(4, HANDOFF_FIELDS[3], "derived", {
135
- allowed: creates,
136
- unchanged: writeSet.length - creates.length,
137
- forbidden:
138
- "nothing outside the listed write set is ever written; the kit never renames, deletes, rewrites handwritten files, or touches remotes; legacy removal is a human-performed exit step",
139
- });
140
-
141
- // 5. The validator/builder/docs-pipeline/git-preflight slated for exit.
142
- // Includes both whole-file exits (legacyInfra) and reference-level
143
- // exits (legacyReferences) for retained files.
144
- push(5, HANDOFF_FIELDS[4], "derived", {
145
- exits: legacyExitList.map((item) => ({ path: item.path, replacedBy: item.replacedBy, status: item.status })),
146
- referenceExits: (legacyReferenceExitList ?? []).map((ref) => ({
147
- path: ref.path,
148
- text: ref.text,
149
- replacedBy: ref.replacedBy,
150
- status: ref.status,
151
- occurrenceCount: ref.occurrenceCount,
152
- })),
153
- });
154
-
155
- // 6. Business logic that must be kept: never derivable from repo facts.
156
- push(6, HANDOFF_FIELDS[5], "INCOMPLETE", {
157
- reason: "business-logic boundaries cannot be derived mechanically; a human owner must enumerate them before any hand-off starts",
158
- });
159
-
160
- // 7. adopt-plan summary.
161
- push(7, HANDOFF_FIELDS[6], "derived", {
162
- writeSetCreates: creates.length,
163
- writeSetUnchanged: writeSet.length - creates.length,
164
- conflicts: conflicts.length,
165
- risks: risks.length,
166
- migrationState,
167
- });
168
-
169
- // 8. Unit / integration / consumer / independent-audit entries: derived
170
- // only when every evidence kind is proven. assessVerificationEvidence
171
- // always returns one status-bearing fact per kind (undeclared/missing/
172
- // invalid-path/unreadable/identity-mismatch/proven), so presence alone
173
- // proves nothing — fail-closed, never guessed (FC-12).
174
- const evidenceByKind = new Map((verificationFacts ?? []).map((fact) => [fact.kind, fact]));
175
- const missingEvidence = VERIFICATION_EVIDENCE_KINDS.filter((kind) => evidenceByKind.get(kind)?.status !== "proven");
176
- push(8, HANDOFF_FIELDS[7], missingEvidence.length === 0 ? "derived" : "INCOMPLETE", {
177
- entries: (verificationFacts ?? []).map((fact) => ({ kind: fact.kind, path: fact.path ?? null, status: fact.status })),
178
- missing: missingEvidence,
179
- });
180
-
181
- // 9. How removed legacy implementations can be recovered: never
182
- // derivable mechanically (depends on the target's own history/backups).
183
- push(9, HANDOFF_FIELDS[8], "INCOMPLETE", {
184
- reason: "recovery paths for removed legacy implementations depend on the target's own history and backups; the kit never guesses them",
185
- });
186
-
187
- // 10. commit/push/tag/publish authorization: a fixed policy fact —
188
- // adoption planning authorizes none of them.
189
- push(10, HANDOFF_FIELDS[9], "derived", {
190
- commit: false,
191
- push: false,
192
- tag: false,
193
- publish: false,
194
- note: "adoption authorizes no git write, tag, or release; each requires explicit per-task user authorization",
96
+ : [];
97
+ const declaredByName = new Map(
98
+ declaredPackages
99
+ .filter((pkg) => pkg && typeof pkg.name === "string")
100
+ .map((pkg) => [pkg.name, pkg]),
101
+ );
102
+ const loadedVersions = Object.freeze({
103
+ "skill-family-contracts": CONTRACTS_VERSION,
104
+ "skill-family-engineering-kit": KIT_VERSION,
195
105
  });
106
+ const packages = {};
107
+ for (const name of [...REQUIRED_FOUNDATION_PACKAGES].sort()) {
108
+ const version = declaredByName.get(name)?.version ?? loadedVersions[name] ?? null;
109
+ if (version === null) incompleteFields.push(`adoption.foundation_pin.packages.${name}.version`);
110
+ incompleteFields.push(
111
+ `adoption.foundation_pin.packages.${name}.path`,
112
+ `adoption.foundation_pin.packages.${name}.sha256`,
113
+ );
114
+ packages[name] = { version, path: null, sha256: null };
115
+ }
196
116
 
197
- const incompleteFields = fields.filter((field) => field.status === "INCOMPLETE").map((field) => field.name);
117
+ incompleteFields.push("descriptor.profile.version", "adoption.adopted_at");
198
118
 
199
119
  // Binding digests: the target file-set summary and the Foundation plan.
200
120
  const targetSetDigest = digestBytes(
@@ -205,12 +125,30 @@ export function buildHandoffDraft({
205
125
  );
206
126
 
207
127
  return {
208
- kind: "skill-family.handoff-draft",
128
+ kind: "skill-family.profile-draft",
209
129
  schemaVersion: 1,
210
- fields,
130
+ descriptorRelPath: "profile.json",
131
+ descriptor: {
132
+ schemaVersion: 1,
133
+ kind: "skill-family.profile-descriptor",
134
+ profile: { id: inputs.projectId, name: inputs.projectName, version: null },
135
+ base: { contractsVersion: CONTRACTS_VERSION },
136
+ differences: [],
137
+ spi: [],
138
+ adoption: {
139
+ foundation_profile: foundationProfile,
140
+ foundation_pin: { algorithm: "sha256", packages },
141
+ adopted_at: null,
142
+ },
143
+ overrides: [],
144
+ },
145
+ overridesGuidance:
146
+ "overrides stays empty by default. An override is admissible only when it reuses an existing rule id with a project-level numeric value that strictly tightens the frozen rule baseline catalog in the parameter's declared direction (not-increase: strictly less; not-decrease: strictly greater). Equality and relaxation are refused (SPI v2 SPE1007); risk identification for misuse of tightening belongs to skill-failure-auditor, not to this mechanical check.",
211
147
  incompleteFields,
212
148
  ready: incompleteFields.length === 0,
213
149
  binding: { targetSetDigest, foundationPlanDigest },
150
+ policyNote:
151
+ "adoption-lock is deprecated (remediation handoff D-8): the kit no longer produces adoption-lock-form artifacts. The adoption proof is this descriptor's adoption declaration, completed with real artifact paths and digests inside the profile write set and machine-verified by verifyProfile (SPI v2: SPE1006 digest discipline, SPE1007 tightening-only overrides).",
214
152
  };
215
153
  }
216
154
 
@@ -515,29 +453,13 @@ export async function planAdoption({
515
453
 
516
454
  const existingManagedDeclarations = [...facts.managedSet].sort();
517
455
 
518
- // The ten-field hand-off draft. Fields that cannot be derived
519
- // mechanically stay INCOMPLETE and block readiness never guessed.
520
- const agentsFiles = entries
521
- .filter((entry) => entry.kind === "file" && (entry.path === "AGENTS.md" || entry.path === "CLAUDE.md"))
522
- .map((entry) => entry.path)
523
- .sort();
524
- const handoffDraft = buildHandoffDraft({
525
- projectId: inputs.projectId,
526
- rootAbs,
527
- agentsFiles,
528
- git,
529
- gitFacts,
530
- unregisteredPaths,
531
- nestedRepositories,
456
+ // The profile draft: pre-filled adoption declaration (D-8 minimal set)
457
+ // plus the empty overrides example. Fields that cannot be derived
458
+ // mechanically stay null and block readiness — never guessed.
459
+ const profileDraft = buildProfileDraft({
532
460
  inputs,
533
461
  migrationManifest,
534
462
  writeSet,
535
- conflicts,
536
- risks,
537
- legacyExitList,
538
- legacyReferenceExitList,
539
- verificationFacts,
540
- migrationState: completion.state,
541
463
  entries,
542
464
  });
543
465
 
@@ -589,7 +511,7 @@ export async function planAdoption({
589
511
  state: completion.state,
590
512
  completion,
591
513
  },
592
- handoffDraft,
514
+ profileDraft,
593
515
  traceability: {
594
516
  contractsVersion: CONTRACTS_VERSION,
595
517
  skeletonSource: "describeSkeletonFiles",