@tiangong-lca/foundry 0.1.2

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 (323) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +532 -0
  3. package/docs/architecture.md +450 -0
  4. package/docs/foundry-task-contracts.md +147 -0
  5. package/docs/import-profiles/bafu/constraints.md +343 -0
  6. package/docs/import-profiles/bafu/leaf-process-classification-authoring.md +153 -0
  7. package/docs/import-profiles/bafu/profile.md +183 -0
  8. package/docs/import-profiles/uslci/constraints.md +29 -0
  9. package/docs/import-profiles/uslci/profile.md +43 -0
  10. package/docs/import-profiles/worldsteel/constraints.md +77 -0
  11. package/docs/import-profiles/worldsteel/import-coverage.md +93 -0
  12. package/docs/import-profiles/worldsteel/import-plan.md +375 -0
  13. package/docs/import-profiles/worldsteel/profile.md +78 -0
  14. package/docs/package-distribution-contract.md +287 -0
  15. package/docs/public-runtime-contract.md +218 -0
  16. package/docs/runtime-context-contract.md +138 -0
  17. package/docs/safety-policy.md +164 -0
  18. package/docs/task-authorization-contract.md +131 -0
  19. package/docs/uslci-import-runbook.md +336 -0
  20. package/docs/workspace-migration-contract.md +127 -0
  21. package/package-dist/assets/foundry-package-descriptor.json +1661 -0
  22. package/package-dist/scripts/foundry-facade.d.ts +78 -0
  23. package/package-dist/scripts/foundry-facade.js +1317 -0
  24. package/package-dist/scripts/foundry-runtime.d.ts +180 -0
  25. package/package-dist/scripts/foundry-runtime.js +190 -0
  26. package/package-dist/scripts/lib/batch-orchestration/scope-attempt-ledger.d.ts +27 -0
  27. package/package-dist/scripts/lib/batch-orchestration/scope-attempt-ledger.js +85 -0
  28. package/package-dist/scripts/lib/batch-orchestration/scope-resume-contract.d.ts +38 -0
  29. package/package-dist/scripts/lib/batch-orchestration/scope-resume-contract.js +90 -0
  30. package/package-dist/scripts/lib/bundle-row-types.d.ts +44 -0
  31. package/package-dist/scripts/lib/bundle-row-types.js +46 -0
  32. package/package-dist/scripts/lib/bundle-sample-utils.d.ts +183 -0
  33. package/package-dist/scripts/lib/bundle-sample-utils.js +526 -0
  34. package/package-dist/scripts/lib/bundle-source-context.d.ts +31 -0
  35. package/package-dist/scripts/lib/bundle-source-context.js +142 -0
  36. package/package-dist/scripts/lib/canonical-description.d.ts +12 -0
  37. package/package-dist/scripts/lib/canonical-description.js +72 -0
  38. package/package-dist/scripts/lib/canonical-support-rewrites.d.ts +127 -0
  39. package/package-dist/scripts/lib/canonical-support-rewrites.js +527 -0
  40. package/package-dist/scripts/lib/decision-owners/classification.d.ts +245 -0
  41. package/package-dist/scripts/lib/decision-owners/classification.js +754 -0
  42. package/package-dist/scripts/lib/decision-owners/identity-preflight.d.ts +333 -0
  43. package/package-dist/scripts/lib/decision-owners/identity-preflight.js +1353 -0
  44. package/package-dist/scripts/lib/decision-owners/identity-task.d.ts +130 -0
  45. package/package-dist/scripts/lib/decision-owners/identity-task.js +494 -0
  46. package/package-dist/scripts/lib/decision-owners/identity.d.ts +74 -0
  47. package/package-dist/scripts/lib/decision-owners/identity.js +443 -0
  48. package/package-dist/scripts/lib/decision-owners/location.d.ts +239 -0
  49. package/package-dist/scripts/lib/decision-owners/location.js +704 -0
  50. package/package-dist/scripts/lib/decision-task-utils.d.ts +484 -0
  51. package/package-dist/scripts/lib/decision-task-utils.js +735 -0
  52. package/package-dist/scripts/lib/finalize-owners/cli-wrappers.d.ts +52 -0
  53. package/package-dist/scripts/lib/finalize-owners/cli-wrappers.js +146 -0
  54. package/package-dist/scripts/lib/finalize-owners/commit-handoff.d.ts +79 -0
  55. package/package-dist/scripts/lib/finalize-owners/commit-handoff.js +515 -0
  56. package/package-dist/scripts/lib/finalize-owners/post-authoring.d.ts +234 -0
  57. package/package-dist/scripts/lib/finalize-owners/post-authoring.js +1720 -0
  58. package/package-dist/scripts/lib/finalize-owners/post-write-closeout.d.ts +140 -0
  59. package/package-dist/scripts/lib/finalize-owners/post-write-closeout.js +656 -0
  60. package/package-dist/scripts/lib/foundry-args.d.ts +7 -0
  61. package/package-dist/scripts/lib/foundry-args.js +38 -0
  62. package/package-dist/scripts/lib/foundry-authentication-environment.d.ts +17 -0
  63. package/package-dist/scripts/lib/foundry-authentication-environment.js +55 -0
  64. package/package-dist/scripts/lib/foundry-authorization-input.d.ts +31 -0
  65. package/package-dist/scripts/lib/foundry-authorization-input.js +151 -0
  66. package/package-dist/scripts/lib/foundry-command-metadata.d.ts +32 -0
  67. package/package-dist/scripts/lib/foundry-command-metadata.js +1012 -0
  68. package/package-dist/scripts/lib/foundry-command-registry.d.ts +34 -0
  69. package/package-dist/scripts/lib/foundry-command-registry.js +241 -0
  70. package/package-dist/scripts/lib/foundry-command-spec.d.ts +1 -0
  71. package/package-dist/scripts/lib/foundry-command-spec.js +1 -0
  72. package/package-dist/scripts/lib/foundry-decision-owners.d.ts +17 -0
  73. package/package-dist/scripts/lib/foundry-decision-owners.js +68 -0
  74. package/package-dist/scripts/lib/foundry-decision-routing.d.ts +3 -0
  75. package/package-dist/scripts/lib/foundry-decision-routing.js +38 -0
  76. package/package-dist/scripts/lib/foundry-execution-admission.d.ts +33 -0
  77. package/package-dist/scripts/lib/foundry-execution-admission.js +225 -0
  78. package/package-dist/scripts/lib/foundry-execution-attempt.d.ts +11 -0
  79. package/package-dist/scripts/lib/foundry-execution-attempt.js +33 -0
  80. package/package-dist/scripts/lib/foundry-execution-context-format.d.ts +18 -0
  81. package/package-dist/scripts/lib/foundry-execution-context-format.js +83 -0
  82. package/package-dist/scripts/lib/foundry-facade-store.d.ts +25 -0
  83. package/package-dist/scripts/lib/foundry-facade-store.js +449 -0
  84. package/package-dist/scripts/lib/foundry-finalize-owners.d.ts +21 -0
  85. package/package-dist/scripts/lib/foundry-finalize-owners.js +203 -0
  86. package/package-dist/scripts/lib/foundry-identity-owners.d.ts +13 -0
  87. package/package-dist/scripts/lib/foundry-identity-owners.js +58 -0
  88. package/package-dist/scripts/lib/foundry-managed-host.d.ts +7 -0
  89. package/package-dist/scripts/lib/foundry-managed-host.js +173 -0
  90. package/package-dist/scripts/lib/foundry-migration-adoption-plan.d.ts +39 -0
  91. package/package-dist/scripts/lib/foundry-migration-adoption-plan.js +467 -0
  92. package/package-dist/scripts/lib/foundry-migration-adoption.d.ts +31 -0
  93. package/package-dist/scripts/lib/foundry-migration-adoption.js +187 -0
  94. package/package-dist/scripts/lib/foundry-migration-authority.d.ts +42 -0
  95. package/package-dist/scripts/lib/foundry-migration-authority.js +280 -0
  96. package/package-dist/scripts/lib/foundry-migration-inventory.d.ts +31 -0
  97. package/package-dist/scripts/lib/foundry-migration-inventory.js +148 -0
  98. package/package-dist/scripts/lib/foundry-migration-plan.d.ts +48 -0
  99. package/package-dist/scripts/lib/foundry-migration-plan.js +234 -0
  100. package/package-dist/scripts/lib/foundry-migration-replay.d.ts +3 -0
  101. package/package-dist/scripts/lib/foundry-migration-replay.js +134 -0
  102. package/package-dist/scripts/lib/foundry-migration-stage.d.ts +15 -0
  103. package/package-dist/scripts/lib/foundry-migration-stage.js +152 -0
  104. package/package-dist/scripts/lib/foundry-migration-transfer-io.d.ts +13 -0
  105. package/package-dist/scripts/lib/foundry-migration-transfer-io.js +226 -0
  106. package/package-dist/scripts/lib/foundry-migration-transfer.d.ts +36 -0
  107. package/package-dist/scripts/lib/foundry-migration-transfer.js +350 -0
  108. package/package-dist/scripts/lib/foundry-operation-result.d.ts +71 -0
  109. package/package-dist/scripts/lib/foundry-operation-result.js +264 -0
  110. package/package-dist/scripts/lib/foundry-owner-execution-store.d.ts +319 -0
  111. package/package-dist/scripts/lib/foundry-owner-execution-store.js +293 -0
  112. package/package-dist/scripts/lib/foundry-owner-readback.d.ts +22 -0
  113. package/package-dist/scripts/lib/foundry-owner-readback.js +189 -0
  114. package/package-dist/scripts/lib/foundry-owner-trace-acceptance.d.ts +15 -0
  115. package/package-dist/scripts/lib/foundry-owner-trace-acceptance.js +68 -0
  116. package/package-dist/scripts/lib/foundry-package-contract.d.ts +56 -0
  117. package/package-dist/scripts/lib/foundry-package-contract.js +392 -0
  118. package/package-dist/scripts/lib/foundry-private-path.d.ts +2 -0
  119. package/package-dist/scripts/lib/foundry-private-path.js +20 -0
  120. package/package-dist/scripts/lib/foundry-runtime-cache.d.ts +3 -0
  121. package/package-dist/scripts/lib/foundry-runtime-cache.js +25 -0
  122. package/package-dist/scripts/lib/foundry-runtime-command-policy.d.ts +20 -0
  123. package/package-dist/scripts/lib/foundry-runtime-command-policy.js +173 -0
  124. package/package-dist/scripts/lib/foundry-runtime-context-types.d.ts +59 -0
  125. package/package-dist/scripts/lib/foundry-runtime-context-types.js +1 -0
  126. package/package-dist/scripts/lib/foundry-runtime-context.d.ts +27 -0
  127. package/package-dist/scripts/lib/foundry-runtime-context.js +668 -0
  128. package/package-dist/scripts/lib/foundry-runtime-environment.d.ts +9 -0
  129. package/package-dist/scripts/lib/foundry-runtime-environment.js +90 -0
  130. package/package-dist/scripts/lib/foundry-runtime-error.d.ts +4 -0
  131. package/package-dist/scripts/lib/foundry-runtime-error.js +8 -0
  132. package/package-dist/scripts/lib/foundry-runtime-identity.d.ts +18 -0
  133. package/package-dist/scripts/lib/foundry-runtime-identity.js +127 -0
  134. package/package-dist/scripts/lib/foundry-runtime-paths.d.ts +16 -0
  135. package/package-dist/scripts/lib/foundry-runtime-paths.js +159 -0
  136. package/package-dist/scripts/lib/foundry-runtime-qualification.d.ts +66 -0
  137. package/package-dist/scripts/lib/foundry-runtime-qualification.js +223 -0
  138. package/package-dist/scripts/lib/foundry-runtime-selection-record.d.ts +16 -0
  139. package/package-dist/scripts/lib/foundry-runtime-selection-record.js +32 -0
  140. package/package-dist/scripts/lib/foundry-runtime-selection.d.ts +14 -0
  141. package/package-dist/scripts/lib/foundry-runtime-selection.js +123 -0
  142. package/package-dist/scripts/lib/foundry-runtime-utils.d.ts +178 -0
  143. package/package-dist/scripts/lib/foundry-runtime-utils.js +603 -0
  144. package/package-dist/scripts/lib/foundry-semantic-input.d.ts +30 -0
  145. package/package-dist/scripts/lib/foundry-semantic-input.js +132 -0
  146. package/package-dist/scripts/lib/foundry-task-authorization.d.ts +68 -0
  147. package/package-dist/scripts/lib/foundry-task-authorization.js +350 -0
  148. package/package-dist/scripts/lib/foundry-task-io.d.ts +18 -0
  149. package/package-dist/scripts/lib/foundry-task-io.js +92 -0
  150. package/package-dist/scripts/lib/foundry-task-registration.d.ts +6 -0
  151. package/package-dist/scripts/lib/foundry-task-registration.js +384 -0
  152. package/package-dist/scripts/lib/foundry-task-start-spec.d.ts +34 -0
  153. package/package-dist/scripts/lib/foundry-task-start-spec.js +161 -0
  154. package/package-dist/scripts/lib/foundry-task-store.d.ts +18 -0
  155. package/package-dist/scripts/lib/foundry-task-store.js +466 -0
  156. package/package-dist/scripts/lib/foundry-task-types.d.ts +99 -0
  157. package/package-dist/scripts/lib/foundry-task-types.js +1 -0
  158. package/package-dist/scripts/lib/foundry-workflow-approval-continuation.d.ts +6 -0
  159. package/package-dist/scripts/lib/foundry-workflow-approval-continuation.js +136 -0
  160. package/package-dist/scripts/lib/foundry-workflow-assessment.d.ts +3 -0
  161. package/package-dist/scripts/lib/foundry-workflow-assessment.js +231 -0
  162. package/package-dist/scripts/lib/foundry-workflow-authorization.d.ts +22 -0
  163. package/package-dist/scripts/lib/foundry-workflow-authorization.js +174 -0
  164. package/package-dist/scripts/lib/foundry-workflow-context.d.ts +3 -0
  165. package/package-dist/scripts/lib/foundry-workflow-context.js +99 -0
  166. package/package-dist/scripts/lib/foundry-workflow-decisions.d.ts +18 -0
  167. package/package-dist/scripts/lib/foundry-workflow-decisions.js +123 -0
  168. package/package-dist/scripts/lib/foundry-workflow-execution.d.ts +8 -0
  169. package/package-dist/scripts/lib/foundry-workflow-execution.js +248 -0
  170. package/package-dist/scripts/lib/foundry-workflow-finalize.d.ts +13 -0
  171. package/package-dist/scripts/lib/foundry-workflow-finalize.js +264 -0
  172. package/package-dist/scripts/lib/foundry-workflow-identity-apply.d.ts +14 -0
  173. package/package-dist/scripts/lib/foundry-workflow-identity-apply.js +159 -0
  174. package/package-dist/scripts/lib/foundry-workflow-identity.d.ts +6 -0
  175. package/package-dist/scripts/lib/foundry-workflow-identity.js +153 -0
  176. package/package-dist/scripts/lib/foundry-workflow-import.d.ts +4 -0
  177. package/package-dist/scripts/lib/foundry-workflow-import.js +70 -0
  178. package/package-dist/scripts/lib/foundry-workflow-io.d.ts +11 -0
  179. package/package-dist/scripts/lib/foundry-workflow-io.js +77 -0
  180. package/package-dist/scripts/lib/foundry-workflow-reference-verify.d.ts +41 -0
  181. package/package-dist/scripts/lib/foundry-workflow-reference-verify.js +266 -0
  182. package/package-dist/scripts/lib/foundry-workflow-rows.d.ts +2 -0
  183. package/package-dist/scripts/lib/foundry-workflow-rows.js +47 -0
  184. package/package-dist/scripts/lib/foundry-workflow-semantic.d.ts +5 -0
  185. package/package-dist/scripts/lib/foundry-workflow-semantic.js +367 -0
  186. package/package-dist/scripts/lib/foundry-workflow-state.d.ts +37 -0
  187. package/package-dist/scripts/lib/foundry-workflow-state.js +158 -0
  188. package/package-dist/scripts/lib/full-context-proof.d.ts +51 -0
  189. package/package-dist/scripts/lib/full-context-proof.js +932 -0
  190. package/package-dist/scripts/lib/identity-preflight-artifacts.d.ts +184 -0
  191. package/package-dist/scripts/lib/identity-preflight-artifacts.js +573 -0
  192. package/package-dist/scripts/lib/identity-preflight-proof.d.ts +117 -0
  193. package/package-dist/scripts/lib/identity-preflight-proof.js +341 -0
  194. package/package-dist/scripts/lib/identity-reference-rewrite-utils.d.ts +147 -0
  195. package/package-dist/scripts/lib/identity-reference-rewrite-utils.js +817 -0
  196. package/package-dist/scripts/lib/import-curation/authoring-packages.d.ts +28 -0
  197. package/package-dist/scripts/lib/import-curation/authoring-packages.js +92 -0
  198. package/package-dist/scripts/lib/import-curation/curation-cleanup.d.ts +32 -0
  199. package/package-dist/scripts/lib/import-curation/curation-cleanup.js +203 -0
  200. package/package-dist/scripts/lib/import-curation/curation-gate.d.ts +47 -0
  201. package/package-dist/scripts/lib/import-curation/curation-gate.js +528 -0
  202. package/package-dist/scripts/lib/import-curation/internal/artifact-inputs.d.ts +24 -0
  203. package/package-dist/scripts/lib/import-curation/internal/artifact-inputs.js +152 -0
  204. package/package-dist/scripts/lib/import-curation/internal/authoring-patch-workflow.d.ts +3 -0
  205. package/package-dist/scripts/lib/import-curation/internal/authoring-patch-workflow.js +3 -0
  206. package/package-dist/scripts/lib/import-curation/internal/authoring-task-workflow.d.ts +1 -0
  207. package/package-dist/scripts/lib/import-curation/internal/authoring-task-workflow.js +1 -0
  208. package/package-dist/scripts/lib/import-curation/internal/context-inputs.d.ts +56 -0
  209. package/package-dist/scripts/lib/import-curation/internal/context-inputs.js +206 -0
  210. package/package-dist/scripts/lib/import-curation/internal/curation-gate-workflow.d.ts +14 -0
  211. package/package-dist/scripts/lib/import-curation/internal/curation-gate-workflow.js +14 -0
  212. package/package-dist/scripts/lib/import-curation/internal/dataset-payload.d.ts +70 -0
  213. package/package-dist/scripts/lib/import-curation/internal/dataset-payload.js +141 -0
  214. package/package-dist/scripts/lib/import-curation/internal/dataset-types.d.ts +25 -0
  215. package/package-dist/scripts/lib/import-curation/internal/dataset-types.js +45 -0
  216. package/package-dist/scripts/lib/import-curation/internal/full-context-proof.d.ts +129 -0
  217. package/package-dist/scripts/lib/import-curation/internal/full-context-proof.js +552 -0
  218. package/package-dist/scripts/lib/import-curation/internal/hash-utils.d.ts +2 -0
  219. package/package-dist/scripts/lib/import-curation/internal/hash-utils.js +10 -0
  220. package/package-dist/scripts/lib/import-curation/internal/mutation-manifest-workflow.d.ts +15 -0
  221. package/package-dist/scripts/lib/import-curation/internal/mutation-manifest-workflow.js +15 -0
  222. package/package-dist/scripts/lib/import-curation/internal/prewrite-cleanup.d.ts +31 -0
  223. package/package-dist/scripts/lib/import-curation/internal/prewrite-cleanup.js +467 -0
  224. package/package-dist/scripts/lib/import-curation/internal/profiles-config.d.ts +47 -0
  225. package/package-dist/scripts/lib/import-curation/internal/profiles-config.js +88 -0
  226. package/package-dist/scripts/lib/import-curation/internal/runtime-io.d.ts +23 -0
  227. package/package-dist/scripts/lib/import-curation/internal/runtime-io.js +132 -0
  228. package/package-dist/scripts/lib/import-curation/internal/trace-summary.d.ts +53 -0
  229. package/package-dist/scripts/lib/import-curation/internal/trace-summary.js +114 -0
  230. package/package-dist/scripts/lib/import-curation/internal/workflow-authoring-tasks.d.ts +141 -0
  231. package/package-dist/scripts/lib/import-curation/internal/workflow-authoring-tasks.js +854 -0
  232. package/package-dist/scripts/lib/import-curation/internal/workflow-decision-apply-context.d.ts +20 -0
  233. package/package-dist/scripts/lib/import-curation/internal/workflow-decision-apply-context.js +46 -0
  234. package/package-dist/scripts/lib/import-curation/internal/workflow-decision-full-context.d.ts +110 -0
  235. package/package-dist/scripts/lib/import-curation/internal/workflow-decision-full-context.js +782 -0
  236. package/package-dist/scripts/lib/import-curation/internal/workflow-dry-run-context.d.ts +24 -0
  237. package/package-dist/scripts/lib/import-curation/internal/workflow-dry-run-context.js +191 -0
  238. package/package-dist/scripts/lib/import-curation/internal/workflow-evidence-scope.d.ts +80 -0
  239. package/package-dist/scripts/lib/import-curation/internal/workflow-evidence-scope.js +359 -0
  240. package/package-dist/scripts/lib/import-curation/internal/workflow-identity-decision-context.d.ts +146 -0
  241. package/package-dist/scripts/lib/import-curation/internal/workflow-identity-decision-context.js +381 -0
  242. package/package-dist/scripts/lib/import-curation/internal/workflow-identity-preflight.d.ts +223 -0
  243. package/package-dist/scripts/lib/import-curation/internal/workflow-identity-preflight.js +1079 -0
  244. package/package-dist/scripts/lib/import-curation/internal/workflow-patch-collect.d.ts +41 -0
  245. package/package-dist/scripts/lib/import-curation/internal/workflow-patch-collect.js +412 -0
  246. package/package-dist/scripts/lib/import-curation/internal/workflow-patch-evidence-context.d.ts +117 -0
  247. package/package-dist/scripts/lib/import-curation/internal/workflow-patch-evidence-context.js +278 -0
  248. package/package-dist/scripts/lib/import-curation/internal/workflow-patch-evidence.d.ts +59 -0
  249. package/package-dist/scripts/lib/import-curation/internal/workflow-patch-evidence.js +593 -0
  250. package/package-dist/scripts/lib/import-curation/internal/workflow-queue-context.d.ts +58 -0
  251. package/package-dist/scripts/lib/import-curation/internal/workflow-queue-context.js +263 -0
  252. package/package-dist/scripts/lib/import-curation/internal/workflow-reference-closure.d.ts +177 -0
  253. package/package-dist/scripts/lib/import-curation/internal/workflow-reference-closure.js +812 -0
  254. package/package-dist/scripts/lib/import-curation/internal/workflow-row-transform-context.d.ts +159 -0
  255. package/package-dist/scripts/lib/import-curation/internal/workflow-row-transform-context.js +466 -0
  256. package/package-dist/scripts/lib/import-curation/internal/workflow-semantic-actions.d.ts +152 -0
  257. package/package-dist/scripts/lib/import-curation/internal/workflow-semantic-actions.js +1377 -0
  258. package/package-dist/scripts/lib/import-curation/internal/workflow-source-reference-context.d.ts +38 -0
  259. package/package-dist/scripts/lib/import-curation/internal/workflow-source-reference-context.js +116 -0
  260. package/package-dist/scripts/lib/import-curation/mutation-manifest.d.ts +51 -0
  261. package/package-dist/scripts/lib/import-curation/mutation-manifest.js +542 -0
  262. package/package-dist/scripts/lib/import-curation/patch-collect.d.ts +18 -0
  263. package/package-dist/scripts/lib/import-curation/patch-collect.js +172 -0
  264. package/package-dist/scripts/lib/import-curation/profiles.d.ts +1 -0
  265. package/package-dist/scripts/lib/import-curation/profiles.js +1 -0
  266. package/package-dist/scripts/lib/import-curation/trace-summary.d.ts +1 -0
  267. package/package-dist/scripts/lib/import-curation/trace-summary.js +1 -0
  268. package/package-dist/scripts/lib/oauth-session-reference.d.ts +1 -0
  269. package/package-dist/scripts/lib/oauth-session-reference.js +20 -0
  270. package/package-dist/scripts/lib/post-authoring-finalize-utils.d.ts +95 -0
  271. package/package-dist/scripts/lib/post-authoring-finalize-utils.js +548 -0
  272. package/package-dist/scripts/lib/post-write-root-proof.d.ts +44 -0
  273. package/package-dist/scripts/lib/post-write-root-proof.js +169 -0
  274. package/package-dist/scripts/lib/reference-description-text.d.ts +2 -0
  275. package/package-dist/scripts/lib/reference-description-text.js +12 -0
  276. package/package-dist/scripts/lib/remote-verification-accepted-diff.d.ts +42 -0
  277. package/package-dist/scripts/lib/remote-verification-accepted-diff.js +424 -0
  278. package/package-dist/scripts/lib/same-identity-commit-recovery.d.ts +8 -0
  279. package/package-dist/scripts/lib/same-identity-commit-recovery.js +52 -0
  280. package/package-dist/scripts/lib/source-semantics.d.ts +255 -0
  281. package/package-dist/scripts/lib/source-semantics.js +888 -0
  282. package/package-dist/scripts/lib/stage-contract.d.ts +36 -0
  283. package/package-dist/scripts/lib/stage-contract.js +25 -0
  284. package/package-dist/scripts/lib/task-authorization.d.ts +84 -0
  285. package/package-dist/scripts/lib/task-authorization.js +210 -0
  286. package/package-dist/scripts/lib/tidas-adapter.d.ts +113 -0
  287. package/package-dist/scripts/lib/tidas-adapter.js +525 -0
  288. package/package-dist/scripts/lib/tidas-language-utils.d.ts +8 -0
  289. package/package-dist/scripts/lib/tidas-language-utils.js +206 -0
  290. package/package-dist/scripts/lib/tidas-row-utils.d.ts +70 -0
  291. package/package-dist/scripts/lib/tidas-row-utils.js +225 -0
  292. package/package-dist/scripts/lib/trace-coverage.d.ts +53 -0
  293. package/package-dist/scripts/lib/trace-coverage.js +178 -0
  294. package/package-dist/scripts/package-entry.d.ts +2 -0
  295. package/package-dist/scripts/package-entry.js +4 -0
  296. package/package-dist/scripts/public-api.d.ts +80 -0
  297. package/package-dist/scripts/public-api.js +28 -0
  298. package/package-dist/scripts/runtime-entry.d.ts +23 -0
  299. package/package-dist/scripts/runtime-entry.js +424 -0
  300. package/package.json +93 -0
  301. package/specs/canonical-support/flow-properties-unit-groups.json +2692 -0
  302. package/specs/import-profiles.json +118 -0
  303. package/specs/prewrite-content-policy.json +105 -0
  304. package/specs/schemas/authorization-derivation.schema.json +34 -0
  305. package/specs/schemas/execution-context.schema.json +68 -0
  306. package/specs/schemas/foundry-authorization-input.schema.json +120 -0
  307. package/specs/schemas/foundry-facade-request-index.schema.json +78 -0
  308. package/specs/schemas/foundry-managed-runtime.schema.json +122 -0
  309. package/specs/schemas/foundry-migration-activation.schema.json +213 -0
  310. package/specs/schemas/foundry-migration-adoption-plan.schema.json +548 -0
  311. package/specs/schemas/foundry-migration-transfer-receipt.schema.json +93 -0
  312. package/specs/schemas/foundry-operation-result.schema.json +147 -0
  313. package/specs/schemas/foundry-package-descriptor.schema.json +134 -0
  314. package/specs/schemas/foundry-runtime-selection.schema.json +59 -0
  315. package/specs/schemas/foundry-semantic-input.schema.json +36 -0
  316. package/specs/schemas/foundry-task-start.schema.json +123 -0
  317. package/specs/schemas/foundry-workspace-migration-pending.schema.json +17 -0
  318. package/specs/schemas/foundry-workspace-migration-plan.schema.json +59 -0
  319. package/specs/schemas/foundry-workspace-migration-transfer-plan.schema.json +357 -0
  320. package/specs/schemas/foundry-workspace-v2.schema.json +70 -0
  321. package/specs/schemas/runtime-qualification.schema.json +63 -0
  322. package/specs/schemas/task-authorization.schema.json +154 -0
  323. package/specs/schemas/tidas-runtime-expectation.schema.json +54 -0
@@ -0,0 +1,287 @@
1
+ ---
2
+ title: Foundry Package Distribution Contract
3
+ docType: contract
4
+ scope: repo
5
+ status: active
6
+ authoritative: true
7
+ owner: tiangong-lca-data-foundry
8
+ language: en
9
+ whenToUse:
10
+ - when changing the Foundry npm package, public bin, exports, package compiler or shipped assets
11
+ - when qualifying a packed or installed Foundry candidate
12
+ - when preparing a release-only version change or verifying published npm provenance
13
+ whenToUpdate:
14
+ - when package identity, file closure, descriptor, runtime layout, supported platform or install behavior changes
15
+ checkPaths:
16
+ - package.json
17
+ - pnpm-lock.yaml
18
+ - tsconfig.package.json
19
+ - scripts/package-entry.ts
20
+ - scripts/public-api.ts
21
+ - scripts/build-foundry-package.ts
22
+ - scripts/pack-foundry-package.ts
23
+ - scripts/verify-foundry-package.ts
24
+ - scripts/release-*.ts
25
+ - scripts/lib/foundry-release-*.ts
26
+ - .github/workflows/publish-foundry.yml
27
+ - .github/workflows/quality-gate.yml
28
+ - scripts/lib/foundry-package-contract.ts
29
+ - scripts/lib/foundry-runtime-paths.ts
30
+ - specs/schemas/foundry-package-descriptor.schema.json
31
+ - specs/release/**
32
+ - test/unit/foundry-package-contract.test.mts
33
+ - test/unit/foundry-release-*.test.mts
34
+ - test/commands/foundry-release-*.test.mts
35
+ - test/unit/runtime-layout.test.mts
36
+ - test/scenarios/foundry-package-consumer.test.mts
37
+ lastReviewedAt: 2026-09-09
38
+ lastReviewedCommit: 21f10ac1643798aade3bd930c99785a0e6eaf0d9
39
+ lastReviewedNote: "Reviewed for Foundry #128: exact version-only 0.1.2 follows qualified main21f10ac via a fresh release event after the prior GitHub run could not restart. Only package identity and review metadata change; CLI0.1.12, TIDAS0.3.0, full source/public qualification, signing, first-identity handoff and final F1 acceptance remain unchanged and required."
40
+ related:
41
+ - docs/public-runtime-contract.md
42
+ - docs/runtime-context-contract.md
43
+ - docs/task-authorization-contract.md
44
+ - docs/safety-policy.md
45
+ ---
46
+
47
+ # Foundry package distribution
48
+
49
+ The npm identity is `@tiangong-lca/foundry`; the public bin is `tiangong-foundry`. W06 establishes the installable `0.1.0` candidate and its production dependency closure. It does not publish a registry version or call this candidate F1. W08 owns the release-only workflow, Trusted Publishing/provenance, immutable tag, platform components, SBOM/license bundle and product compatibility manifest.
50
+
51
+ The package depends exactly on public `@tiangong-lca/cli@0.1.12`. Ajv remains a development dependency for internal commands and release-side SPDX validation. Sigstore 5.0.0, YAML 2.9.0, tar 7.5.22 and fflate 0.8.3 are also development-only release tools for signing/verification, lock parsing and bounded upstream archive selection. None enters the public compiler/dependency closure. TIDAS is an independently verified native component selected later by the CLI manager, not an npm dependency or bundled binary.
52
+
53
+ ## Public surface
54
+
55
+ `scripts/package-entry.ts` is the only bin source. It calls `runFoundryPublicCommand`, which routes the six operations in `public-runtime-contract.md` and converts every other name into the stable unknown-operation envelope. It never falls back to `scripts/foundry.ts`, the repository doctor, 63-command dispatcher, production case runner or maintenance owners.
56
+
57
+ `scripts/public-api.ts` binds the facade's module identity internally. A consumer supplies workspace, optional runtime selection/account intent and host controls; it cannot redirect package discovery through its own `moduleUrl`. The root and `./runtime` exports expose only the facade, public command host, result/task/migration protocol types and validators, next-action binding verifier, and package descriptor verifier. Internal command factories, mutation dispatch and raw runtime/task stores are not package exports.
58
+
59
+ The installed `runtimeUse` facade can retain a CLI-managed cache containing its own package after the package descriptor and independently trusted current component set both verify that ownership. The source-free consumer test exercises that behavior from real installed application bytes, including rollback, restoration, retained leases and rejected cache drift. Its surrounding component metadata is explicitly a fixture; it does not establish F1 provenance, native launch qualification or publication.
60
+
61
+ ## Managed process admission
62
+
63
+ The package bin initializes its host before running any public operation. An inherited IPC channel is consumed through the public CLI `receiveRuntimeHostContext` API. The receiver supplies the independently trusted full manifest, canonical cache/CWD, launch id and actual host after its handshake. Without IPC, the ordinary installed bin retains the unqualified local facade. A failed IPC handshake never falls back to that unmanaged path.
64
+
65
+ The selected launch must use the current managed Node and exactly one declared application argument: the verified installed Foundry bin. The executing package version must equal the product version, and its component must declare `tiangong-foundry.managed-runtime.v1`. The host reads `metadata/foundry-runtime.json` only from that application component and rechecks its inventory-bound bytes. A familiar filename or self-computed digest alone is not authority.
66
+
67
+ `specs/schemas/foundry-managed-runtime.schema.json` describes the strict structural shape: schema and platform, the exact CLI expectation, a TIDAS component/file reference plus expectation, and at most sixteen unique launch-id policies. Each policy chooses `read` or `write` workspace access and a target of either `null` (the current manifest) or a declared component file containing another runtime manifest. The selected target's original bytes are verified against the digest already bound by the current trusted manifest. Ordinary argv, task files and environment variables cannot select alternate metadata or target trust anchors.
68
+
69
+ The host additionally validates relationships that the structural schema cannot prove: every policy uses the declared Node and installed package entry, the installed CLI/Node match their independent expectation, and the selected TIDAS file matches its declared size/hash/executable mode. Existing runtime qualification owns the TIDAS version/protocol/assets handshake when an operation requests qualification. A read policy never grants writes; explicit runtime selection still requires a qualified current writer and actor/request intent. The CLI-owned component cache and its descendants/ancestors cannot become a workspace, including migration destinations.
70
+
71
+ The public command adapter accepts an optional trusted asynchronous host initializer so signal handling and the single-result envelope cover admission as well as the operation. Pre-observed cancellation skips initialization. Cancellation while waiting for IPC closes that channel and preserves the interrupted result. Unsupported managed metadata versions return `blocked`; invalid bindings return `failed` before workspace effects. The initializer cannot replace the adapter's output handlers or cancellation signal.
72
+
73
+ Installed-process tests use real Node, the packed Foundry candidate, public CLI APIs and genuine IPC, with separate application/native fixture components. TIDAS and predecessor-release metadata remain explicit fixtures. These tests qualify the admission mechanism; final production component assembly, real native inputs, immutable publication and complete F1 startup qualification remain separate W08 work.
74
+
75
+ ## Complete runtime component preparation
76
+
77
+ `pnpm release:prepare-runtime --output <new-absolute-directory>` builds a source candidate from its own clean physical checkout. `--published` selects the independently verified public Foundry package at that same version/source and compares its exact tarball bytes with the source package. It is a read-only publication-input selection, not an upload command. Neither mode accepts alternate source roots, versions, platforms, URLs or serialized preparation receipts.
78
+
79
+ Production and native preparation now expose frozen process-local inputs for the assembler. Their existing standalone commands retain their output and source boundaries. Production payloads also retain the original verified CLI registry metadata and attestation bytes. Component copying checks the complete declared source inventory before copying, rejects changed/unlisted/linked files, rechecks copied bytes and modes, and never replaces an existing destination. Native subsets are selected only after their complete preparation input has been checked.
80
+
81
+ The assembler produces three regular-file-only components: `foundry`, `node` and `tidas`. The application component contains the exact Foundry package, all sixteen locked CLI dependency packages, source/public provenance, retained licenses, a complete runtime lock, the managed-host binding, an application SPDX document and a nineteen-package product SPDX graph. The product graph includes the native Node/TIDAS dependencies; native license comments use `component-id:relative-path` references into those separately declared components. The Node component is also the C1 bootstrap base: it retains the verified CLI production closure and licenses, Node executable, both upstream sources, a combined SPDX graph and a full checksum index. The TIDAS component retains its own executable/notices/input facts, lock, SPDX and upstream source evidence.
82
+
83
+ Native component identities and metadata use the selected upstream versions, source commits/dates and a fixed component-format creator. The Node/CLI base binds the frozen production graph and exact public CLI evidence but excludes Foundry-specific preparation timestamps and source-lock metadata; the owning Foundry lock evidence remains in the application component. They do not change merely because the Foundry source revision changes. Source candidates use SPDX `NOASSERTION` for the unpublished Foundry package download location. Published-package mode uses the verified registry artifact and retains its original metadata/attestation. Native input documents describe the upstream distributions; they are not a claim that an embedded-dependency notice inventory was present when it was absent.
84
+
85
+ Minimum-host data is frozen in `specs/release/runtime-inputs.json`. [The pinned Node source platform table](https://github.com/nodejs/node/blob/cdc1b38d40cb567b7ad0b39c86addf830a0af0ae/BUILDING.md) supplies Linux kernel4.18, macOS13.5 and Windows10/Server2016 ABI floors. The manifest represents those as Linux4.18.0, Darwin22.6.0 and Windows10.0.0; the independently observed TIDAS GNU requirement raises the combined GLIBC floor to2.38. Only the four approved platform tuples are included.
86
+
87
+ The source-side qualifier receives the in-process prepared authority. It executes the actual packaged Node/Foundry/TIDAS combination with an empty tool PATH, no supplied credentials, an empty component cache seeded from the verified local archives, and then a warm cache with no manager downloads. It checks public init/doctor/task lifecycle, read selection/restoration and rejection of developer commands. Diagnostic timings and results live outside hashed component payloads. This proves native execution from the prepared archives; published URL download/copy-bootstrap and final four-platform publication remain distinct gates.
88
+
89
+ The qualified TIDAS0.3.0 archive includes distribution manifest v2 and a complete executable/source-bound native notice inventory. Preparation verifies the nested manifest digest, every retained file and Cargo/native/Rust evidence before reporting `owner-inventory-verified`. The assembler still refuses published mode when this verified coverage is absent. All original notice texts and source evidence remain in the TIDAS component, and its SPDX license references include every retained notice text. The component manifest points to the existing project LICENSE, upstream notice README and notice-manifest.json. These three entrypoints stay within the published CLI limit of64, while the nested inventory identifies every original text and its package/source role. No additional concatenated copy is generated. Candidate component URLs are intended release locations and are not advertised as already downloadable. The source CI performs candidate assembly/qualification but does not publish its binaries.
90
+
91
+ ## Build and staging roots
92
+
93
+ Three roots have distinct ownership:
94
+
95
+ | Root | Contract |
96
+ | --- | --- |
97
+ | `package-dist/` | Ignored deterministic compiler output. `tsconfig.package.json` follows only the public bin/API import graph and emits JS plus declarations. |
98
+ | `package-stage/` | Ignored exact publish tree with a generated public manifest and copied reviewed payload. |
99
+ | `package-artifacts/` | Ignored local tarball destination; no task, credential or source data belongs here. |
100
+
101
+ The package compiler sets LF output and disables source maps, declaration maps and inline sources. The admitted closure contains no `scripts/commands/**`, `scripts/cases/**`, source `.ts`, tests, CI/agent/Git state or developer tools. Generated `.d.ts` declarations are public types, not source implementation.
102
+
103
+ The public compiler closure includes the native-import and contract-context adapters reached through the facade. They reuse qualified TIDAS and the exact CLI, persist only user-workspace stage artifacts, and add no public flat command or source-checkout requirement. Package installation and these local stages do not establish complete task or release acceptance.
104
+
105
+ Indexed row preparation and local assessment include the existing curation and authoring library owners in that closure. `specs/prewrite-content-policy.json` is an explicit required asset; the packaged path must not fall back to an absent content policy. Native validation data issues remain available to curation. Public authoring output disables legacy source-runner commands while the developer producer retains its default command rendering.
106
+
107
+ Finalization includes the reused library owner closure and the existing public canonical support reference catalog at `specs/canonical-support/flow-properties-unit-groups.json`. The catalog is an explicit allowlisted, descriptor-bound asset; it supplies reference choices and does not grant write permission or replace current remote verification. Queue, dry-run and verification calls use the qualified CLI with explicit environments. Developer command modules remain outside the compiled package.
108
+
109
+ The package includes `foundry-semantic-input.schema.json` and exports its schema identifier and input types. Public semantic submission reuses the existing collector and exact CLI local patch owner. Selected bytes are captured without exposing a caller-selected runtime or an arbitrary executable, and only a successful local apply advances the indexed row version.
110
+
111
+ `foundry-authorization-input.schema.json` and its public identifier/types describe explicit approval selection. The compiled closure reuses current identity, authorization registration and execution-capsule owners. No approval content, credentials or task artifacts enter the distributed package. Public command hosts may provide the same process-only authentication configuration as SDK hosts; it is not an ordinary CLI/task-file option.
112
+
113
+ The repository manifest retains developer scripts. `build-foundry-package.ts` projects a separate exact public manifest into `package-stage/` containing identity, repository links, public access intent, bin/exports/files, Node engine, license, one production dependency and runtime layout. It omits `scripts`, `devDependencies`, `packageManager`, lint configuration and `private`. There are no install/prepare lifecycle hooks; installation cannot initialize a workspace, install Git hooks, authenticate or download a component. Repository hook setup is the explicit `pnpm dev:hooks` command.
114
+
115
+ ## File and descriptor integrity
116
+
117
+ `package.json.files` is an explicit allowlist for the compiled closure, public schemas/profile documents and reviewed contracts. Profile documentation referenced by `specs/import-profiles.json` is included so a distributed profile has no dangling governed document. README and LICENSE are included. Private live evidence, `.env*`, session data, tasks, inputs, outputs, reports and `.foundry` are excluded.
118
+
119
+ `package-dist/assets/foundry-package-descriptor.json` uses `tiangong-foundry.package-descriptor.v1`. It binds package/bin/API identity, exact CLI dependency, runtime layout v2, the four supported tuples, workspace read/write schema and public protocol set. Its sorted file inventory binds every other shipped payload by portable path, bytes and SHA-256. The descriptor excludes itself. `package.json` is also excluded from the byte inventory because package managers normalize its property order; the installed verifier instead compares its complete semantic object to the exact sanitized public shape and rejects every extra field, including lifecycle scripts.
120
+
121
+ The public protocol set advertises each shipped external task input: task-start, semantic-input and authorization-input v1. The descriptor and its structural schema agree; including an input schema file in the archive alone does not declare support for that public protocol.
122
+
123
+ Verification uses regular-file, `O_NOFOLLOW`, fd size/inode/mtime and SHA checks. Missing, extra, linked, renamed, traversing, oversized or changed payloads fail before a package-backed facade context is created. Every package-entry resolution performs this check even if an extra source-like file appears; such a file is itself an unexpected payload and cannot switch the resolver into developer mode. A nested `node_modules` may be dependency storage only when it is a real directory, never a symlink. Source and ordinary developer-emitted layouts remain readable as legacy layout v1 or repository layout v2 without treating a copied name-only manifest as a package.
124
+
125
+ ## Version preparation
126
+
127
+ `pnpm release:version --version <major.minor.patch>` is a read-only maintainer plan. It validates the repository package identity and coherent manifest, compiled-verifier and descriptor-schema versions, then reports the three bounded content changes. Stable versions cannot decrease. The CLI has no alternate-root or serialized-plan input.
128
+
129
+ `--apply` additionally requires a clean Git working tree at the script’s own repository root; inherited Git repository bindings are removed before that check. The private in-process plan binds the original file bytes and modes. Metadata must be regular files reached through real repository directories, and all inputs are rechecked before prepared files are renamed. Replacement is atomic per file, not a cross-file filesystem transaction; an I/O failure after a replacement reports the affected Git paths for review. This command creates no commit or tag and performs no registry operation. Release-only orchestration and publication remain separate W08 gates.
130
+
131
+ Release tools compare native filesystem directory identity when binding the script root to Git's reported root. Different drive/path casing for the same directory is accepted; a parent, child or other directory is rejected. This applies to version preparation, exact Git inspection and workflow admission without weakening clean-tree or inherited-Git-environment guards.
132
+
133
+ ## Bootstrap base and adjacent lock
134
+
135
+ The released C1 bootstrap installs one complete base component containing both Node and the public CLI entry before running the manager. Foundry supplies that format in its existing Node component, including the CLI's verified production dependencies and original licenses. The application keeps its exact CLI dependency closure for ordinary package resolution. The bootstrap component key equals the manager key, allowing the manager to verify and adopt the complete installed base before creating its receipt. Native qualification removes only the Node receipt in its isolated test cache, invokes the actual base Node/CLI pair, verifies receipt adoption, and repeats a warm call. The thirteen-call report includes these two base invocations; copied-script and public-download proof remain separate.
136
+
137
+ `metadata/bootstrap-sha256.txt` lists every other base file in stable path order with its actual SHA256. The checksum file is itself included in the component inventory and independently bound by the adjacent lock. Missing, extra, aliased, unsafe or changed files fail. Bootstrap file_count excludes the checksum file, so archive entries equal file_count+1.
138
+
139
+ Four-platform aggregation generates bootstrap-lock.json using the public manager's component keys, the exact complete manifest, reviewed C1 script digests and existing Node/CLI entry paths. The lock has the flat field layout expected by C1 and accepts only the source-bound candidate or final Foundry manifest URL. It adds no source-version, task, credential or arbitrary trust-anchor override. Component publication retains the candidate lock separately; final Skills data must select the qualified final manifest.
140
+
141
+ The source script pins refer to C1's immutable Git source at the same verified public release commit. They are copied unchanged for bootstrap qualification; they are not imports of CLI private runtime modules. Public-download and copied-script native qualification remain separate required gates.
142
+
143
+ ## Portable npm archive bytes
144
+
145
+ The pinned pnpm packer emits identical package payloads but different gzip OS header bytes on Linux, Windows and macOS. The Foundry packer sets only that header byte to255 before returning, signing or uploading the archive. It preserves the compressed blocks, tar metadata, CRC and uncompressed size. [RFC1952](https://www.rfc-editor.org/info/rfc1952/) permits255 as the default OS value; headers with optional fields or a header CRC are rejected rather than modified. Published-package equality remains an exact byte comparison across platforms.
146
+
147
+ ## Four-platform runtime aggregation
148
+
149
+ `pnpm release:aggregate-runtime --input <absolute-platform-results> --output <new-absolute-directory>` consumes the four fixed platform directories from successful jobs at the executing clean source. The default requires `published-release` package inputs; explicit `--candidate` keeps source-only qualification separate. There is no source, version, platform, registry or publication override.
150
+
151
+ Each platform manifest must match its preparation and native-qualification facts, exact source/tree/date, package archive/inventory, owner versions and validation fingerprint. Every platform supplies the same product and workspace read/write contract, its reviewed minimum host, exactly three components and both managed Foundry launch modes. Missing, duplicate, mixed-source, failed, blocked or mismatched results fail. Input order cannot change the combined manifest.
152
+
153
+ The command checks each actual archive's digest and byte length, then uses the public CLI manager to verify its complete regular-file archive inventory from local seeds. Foreign host selectors here perform structural verification only; they never execute another platform's binary or replace the prior native job. The output contains twelve verified archives, one combined runtime-manifest.json, its adjacent bootstrap-lock.json data and diagnostic runtime-aggregate.json. These files are a handoff, not independent publication authority; final release jobs must bind their inputs to the qualified workflow/source and complete public-download verification.
154
+
155
+ Source CI preserves each successful native result under a run-attempt-specific artifact name. The aggregation job needs all four native jobs, downloads those exact current-attempt artifacts outside the source checkout, and retains the combined candidate contract after verification. It has read-only GitHub permissions and cannot publish packages, tags or release assets.
156
+
157
+ ## CI qualification and verified build reuse
158
+
159
+ The local `pnpm prepush:gate` remains the complete developer gate. Full source CI partitions the complete test-file inventory into four duration-balanced groups on each supported platform. Test files execute in isolated Node processes; shared environment and process mocks never require concurrent tests within one process. New unprofiled files remain included. Every shard binds the exact clean source and plan digest, records Node-owned counters and per-file execution evidence, and hashes its event report. Aggregation requires every platform/group exactly once with matching source, inventory and successful outcomes. Missing, duplicate, failed or stale results block qualification.
160
+
161
+ Only a pull request whose exact ancestor-related diff passes `inspectFoundryRelease` may use the version-only lane. It allows the same three version fields and permitted single-line review metadata, then runs type/lint/toolchain, build/surface/audit, release/package contracts and the real packed consumer. Mixed source, dependencies, lock changes, document bodies or invalid Git evidence cannot select this lane. Every final release `workflow_call` supplies its exact source SHA and always executes full four-platform tests, native qualification, aggregation and copied bootstrap. Required platform checks run their dependency guard even after a failed or skipped prerequisite. Full aggregation and bootstrap use explicit cancellation/result guards so an intentionally skipped version-only job cannot suppress them transitively. An always-running terminal gate requires every stage selected by the mode to succeed; missing or skipped full-qualification stages fail the workflow. Publication continuations likewise require successful prerequisites and respect cancellation.
162
+
163
+ A dedicated source build produces the canonical npm archive once and verifies its descriptor, complete packed file set and CLI pin. The build manifest binds exact Git commit/tree, package, Node/pnpm/TypeScript versions, lock digest and GitHub run/attempt/workflow. Archive and manifest SHA-256 values travel as independent producing-job outputs; downloaded metadata cannot select its own authority. Consumers verify those digests and the current context, safely extract and validate the package inventory, then receive a branded in-memory snapshot. Serialized objects, partial selections, stale source, different attempts and changed bytes fail without falling back to a fresh build.
164
+
165
+ Native source qualification, published-input assembly and npm signing may consume that same verified snapshot. Published mode still independently verifies actual registry provenance and requires registry bytes to equal the qualified source artifact. Dedicated fresh-build, cold-install, tamper and native bootstrap cases remain. Ordinary local packing without a selected CI artifact continues to build fresh. These source-only mechanisms add no installed-runtime input, credential store or business permission. Artifact selection is scoped to one run attempt; recovery that needs new qualification uses the owning workflow rather than mixing prior-attempt artifacts.
166
+
167
+ ## Release diff and published-source verification
168
+
169
+ `pnpm release:inspect --base <40-hex-sha> --head <40-hex-sha>` reads exact ancestor-related commits from its own Git root, with inherited repository bindings and replacement objects disabled. It reports the source tree and whether the package version changed. Ordinary commits return `release: false` before unrelated blobs are read. A version change must equal the same three-file projection used by the version preparer. Every changed file must retain regular Git mode `100644` and valid UTF-8 bytes. Other source, lock, additions, deletions or mode changes fail; existing Markdown frontmatter and `.docpact/config.yaml` may change only the single-line `lastReviewedAt`, `lastReviewedCommit` and `lastReviewedNote` values. Document bodies and all remaining bytes stay fixed. `--github-output` writes validated scalar outputs only within GitHub Actions. This inspection does not prove PR approval, main eligibility or a completed release.
170
+
171
+ `pnpm release:verify-npm --package <cli|foundry> --version <x.y.z> --expected-git-head <40-hex-sha>` independently downloads the exact public npm metadata, tarball and attestation. Downloads reject redirects, credentials, alternate registry origins/paths and unbounded responses. Verification binds canonical SHA-512 to the downloaded tarball, then verifies the Sigstore certificate, issuer and transparency logs before interpreting the signed in-toto/SLSA payload. The verified certificate identity must match the signed workflow/ref, package subject, source commit and exact GitHub-hosted run attempt. Optional registry `gitHead` must match when present; its absence never substitutes for signed provenance.
172
+
173
+ CLI provenance is restricted to `tiangong-lca/tiangong-cli` and `.github/workflows/publish.yml` at the exact `cli-v<version>` tag. The Foundry policy binds `tiangong-lca/data-foundry` and `.github/workflows/publish-foundry.yml`; a normal publication must originate from a main push, and recovery must originate from `workflow_dispatch` on the exact `foundry-v<version>` tag. Both paths require the expected source digest.
174
+
175
+ `--output <new-absolute-directory>` preserves the verified tarball, raw registry metadata/attestations and the digest-bound verification report only after verification succeeds. It never replaces an existing directory. Reports are verification evidence, not independent trust anchors: component consumers still require the separately trusted product manifest/Skills lock. The tool cannot publish, tag, configure a publisher, read `.env` or supply a registry token. Sigstore uses an owned temporary trust cache that is removed after verification.
176
+
177
+ ## Workflow source qualification
178
+
179
+ `pnpm release:context [--github-output]` admits only the canonical GitHub Actions event and workflow definition at the event's exact commit. A normal push must update main without creating, deleting or force-updating it. Manual recovery has no alternate-source inputs: it must dispatch the existing stable `foundry-v<version>` tag, with matching event/ref/workflow/source identity. The checked-out source must be clean, match the event commit and remain an ancestor of fetched `origin/main`; recovery additionally proves the exact local tag and its release-only first-parent diff.
180
+
181
+ An ordinary unchanged-version main push exits without a GitHub PR lookup. A release requires one PR merged into the canonical repository's main branch whose merge commit exactly matches the source; wrong-target, open, unmerged, ambiguous, incomplete or mismatched evidence fails. A merged fork PR remains valid even after its source fork is deleted: the canonical main commit and merged PR record own the source proof. The bounded read-only GitHub API lookup uses only the workflow-provided token and emits the PR identity, never credentials. This proves the source relationship; it does not replace required review or platform qualification.
182
+
183
+ `.github/workflows/publish-foundry.yml` connects that context gate to the existing four-native-host canonical gate through `workflow_call`. The reusable quality workflow checks out the admitted SHA, retains its ordinary PR/manual triggers, and does not persist checkout credentials. These source qualification jobs have read-only permissions.
184
+
185
+ After every host passes, the separate `release-tag` job revalidates the event, clean source/main relationship, release-only diff and merged PR. `pnpm release:tag` accepts no source/tag arguments or serialized context and requires that exact job identity. This tag job receives contents-write permission only for its create-or-verify operation; it installs no project dependencies and does not persist checkout credentials. The later component publisher has separate contents-write permission gated on all published-input native jobs; final-manifest publication has its own contents-write job after all public bootstrap checks.
186
+
187
+ The tag helper derives `foundry-v<version>`, queries only the canonical repository and creates a missing tag reference at the exact qualified source commit. An existing tag must resolve to that same commit; an annotated tag is followed through at most four tag objects, with cycles and invalid object types rejected. There is no update, force or delete operation. If a create response is lost or fails, one readback may confirm the intended tag; an absent or different result stays failed without replaying the mutation. A fresh workflow rerun repeats source validation and the same create-or-verify policy.
188
+
189
+ GitHub tag creation and source qualification alone are not F1 publication. npm publication, component production and final manifest publication remain further W08 stages.
190
+
191
+ ## Prepared package and first publication
192
+
193
+ The `npm-package` job runs after four-host qualification and exact tag creation. It checks out that source without persisted credentials, installs frozen development dependencies without lifecycle scripts, and runs `pnpm release:prepare-package`. The command accepts no arguments, revalidates the merged release-only source and exact remote tag, consumes the independently selected package from that source qualification and rechecks the source before signing. An ordinary source invocation without CI artifact selection retains fresh packing. Verified reuse returns the descriptor and immutable archive snapshot directly; the command never reconstructs archive bytes from process output.
194
+
195
+ Signing is restricted to that GitHub-hosted job and the exact event/source/workflow identity. It requests a short-lived GitHub Actions OIDC identity with audience `sigstore`, signs standard in-toto/SLSA provenance binding the package SHA-512, canonical repository, source commit and workflow run attempt, then cryptographically verifies the returned bundle. A static `SIGSTORE_ID_TOKEN` is rejected. The signing token is neither persisted nor printed. This step publishes a transparency-log attestation but makes no npm registry write.
196
+
197
+ The fresh `package-artifacts/npm-release/` directory contains the exact tarball, `foundry-<version>.sigstore`, `prepared-release.json` and a generated README with source/PR/run links and exact commands. The workflow exports these files as a run/attempt-specific artifact. The receipt records source, file digests and inventory as preparation evidence; it does not establish npm publication or supply an independent runtime trust anchor.
198
+
199
+ `pnpm release:verify-prepared --directory <absolute-download-directory> --version <x.y.z> --expected-git-head <40-hex-sha>` is a read-only maintainer verifier. Select the expected version and source commit independently from the reviewed release PR. The verifier reads bounded regular files at the canonical versioned names and verifies the actual package bytes against the Sigstore certificate/log and signed source/workflow. It does not derive the expected identity from the downloaded receipt or README. Use this source command from the reviewed checkout with its frozen development dependencies installed.
200
+
201
+ For a package identity's first publication, after the reviewed pipeline has produced and verified the exact artifact:
202
+
203
+ 1. Download the artifact from the qualified release's exact GitHub run attempt. Verify it with the command above and retain its result alongside the release record.
204
+ 2. An authorized maintainer signs in to npm using their own account and completes the required 2FA. Keep the artifact files unchanged and change into their downloaded directory outside a Git checkout.
205
+ 3. With pinned pnpm 11.24.0, execute the generated command: `pnpm publish ./tiangong-lca-foundry-<version>.tgz --access public --no-git-checks --config.provenance-file=./foundry-<version>.sigstore`. The generic `--config.provenance-file` spelling is required by this pinned client. The provided CI signature accompanies the unchanged package; the account authorizes its upload.
206
+ 4. Independently run `release:verify-npm` for that exact version/source, compare its tarball digests with the prepared verification, and preserve the result. After a failed or uncertain upload, inspect the exact public version before deciding the next action; do not blindly replay a publish or overwrite an existing version.
207
+ 5. Review the new package's npm Trusted Publisher settings for organization `tiangong-lca`, repository `data-foundry`, workflow `publish-foundry.yml`, permission to publish and the actual job environment binding. The current job declares no GitHub environment. Routine publication must use that reviewed workflow's OIDC path and receive separate public readback verification.
208
+
209
+ The npm package identity and publisher configuration are account-controlled prerequisites, separate from CI signing. A prepared artifact, a successful mock-registry transport test or source-only native qualification is not a published F1 release. The actual versioned workflow execution, complete native components and immutable product-manifest publication remain W08 release gates.
210
+
211
+ ## Registry publication
212
+
213
+ After exporting the prepared artifact, the owning job runs `pnpm release:publish-package`. This command accepts no arguments and requires the exact `npm-package` job, merged release-only source, verified prepared bytes and unchanged immutable tag. An absent package identity produces a `needs-maintainer` result and stops with no upload; the already exported artifact contains the first-upload instructions. An existing exact version must pass independent public provenance/source/byte verification and is never uploaded again. A new version must advance an existing stable public `latest` tag. Registry availability and source/tag identity are refreshed before a new upload.
214
+
215
+ The new-version path explicitly requests GitHub OIDC audience `npm:registry.npmjs.org` and exchanges that identity at npm's fixed, package-specific endpoint. Only HTTP 201 with `token_type: oidc`, a fresh creation time, a future expiry and at most two hours of credential lifetime is accepted. Exchange failures do not reach the publisher. This uses the [official npm OIDC exchange](https://api-docs.npmjs.com/) and prevents pnpm's automatic OIDC failure handling from selecting an unrelated credential.
216
+
217
+ The pinned pnpm 11.24.0 executable uploads copied, rechecked tarball/signature bytes from a fresh private directory proven to be outside Git. Its environment contains essential process settings and only the newly exchanged short-lived credential; inherited npm/GitHub credentials, OIDC endpoints, Node options and user configuration overrides are omitted. Private npm configuration files contain fixed registry/TLS settings and an environment-variable placeholder, never the credential itself. Those files and temporary package copies are removed after the process closes. Publishing uses the prepacked artifact, provided provenance, no Git checks and zero HTTP retries; no shell, package lifecycle, ordinary-account token or alternate package manager is involved.
218
+
219
+ There is one publisher invocation. Regardless of its reported success or an uncertain/failed response, independent public readback owns the outcome. Up to three bounded readback attempts accommodate registry propagation; they never repeat publication. The public tarball's byte count and SHA-512 must match the prepared artifact, in addition to all signed-source/workflow checks. A different existing version payload, missing provenance or failed readback stops the release. Existing-version verification does not establish that the account has configured future Trusted Publisher permissions.
220
+
221
+ `package-artifacts/npm-publication/` contains the publication result and readable report; a successful result also preserves public metadata, attestations and verification. The workflow exports this evidence even when publication fails. `npm_published=true` is emitted only after public verification succeeds; later component/manifest stages must require it. It proves package publication only, not complete F1 runtime qualification.
222
+
223
+ ## Runtime component publication
224
+
225
+ After `npm_published=true`, four native `prepare-runtime` jobs run `release:prepare-runtime --published` at the same release source. They independently verify public npm inputs, build the three complete components and execute native qualification. The jobs attest their exact archives with pinned GitHub build provenance and retain run-attempt-specific artifacts; they have no GitHub contents-write permission.
226
+
227
+ The `publish-components` job downloads those four results from its own run attempt and verifies each archive attestation against the canonical workflow, exact source digest/ref and GitHub-hosted runner identity. `release:publish-components` accepts no arguments and requires that exact owning job. It revalidates the merged release-only source, existing package tag and actual public Foundry npm artifact, then performs fresh in-process four-platform aggregation and checks package digests again. Copied aggregate receipts cannot supply release bytes. Before upload it rechecks its source, manifest, report and every archived byte.
228
+
229
+ Component assets use the existing `foundry-v<version>` tag. The publisher creates a draft, uploads only missing expected files, checks exact source and server-reported asset digests, then publishes the complete draft. An existing published release is accepted only with the complete identical asset set. Conflicting bytes, extra files, an incomplete published release or a different tag source fail; there is no asset replacement, deletion or tag movement. The final-manifest stage uses the distinct `foundry-runtime-v<version>` namespace after public bootstrap qualification.
230
+
231
+ After a lost mutation response, one fresh read owns the result; the operation is not automatically repeated. Draft recovery uses a bounded complete release listing only when no published tag result is available, then retains the exact release ID for subsequent reads. Source identity is read from the actual peeled Git tag, never from the release's display-oriented target_commitish field. Ambiguous or incomplete draft discovery fails before another release is created.
232
+
233
+ The published component release includes twelve archives, runtime-candidate.json, runtime-aggregate.json and bootstrap-lock.candidate.json. The candidate manifest is deliberately separate from the final compatibility publication: native public-download and copied-bootstrap checks must complete before the final immutable manifest is released and selected by Skills. The current component stage records that those further checks are required; component availability alone is not F1 completion. Separate release stages support GitHub's rule that immutable published releases cannot receive additional assets.
234
+
235
+ ## Copied bootstrap and final manifest qualification
236
+
237
+ `release:qualify-bootstrap` requires an independently selected manifest SHA256, exact same-source aggregate input, a new absolute output and either qualified local archives or explicit public mode. The CLI refuses source-tree output. Public mode additionally requires the owning release job, published-package scope and exact merged release-only context. The tool cannot choose another package version or publish anything.
238
+
239
+ The verifier downloads both original C1 source scripts through their pinned URLs and checks their full bytes and SHA256 before copying them unchanged beside freshly derived lock data. Its child environment contains isolated home/cache/config/temp paths and system tools; account credentials, session paths, Node hooks, npm configuration, proxy credentials and PowerShell execution-policy overrides are excluded. It invokes the installed PowerShell executable directly on Windows and the system POSIX shell elsewhere, without changing host execution policy.
240
+
241
+ Cached qualification verifies and seeds the real archives, then re-extracts the base with the system tar after checking the exact regular-file entry list. It removes only the base receipt in that private test cache so the original script and CLI must adopt the verified tree. Public qualification starts with no cache or archive seeds and lets the original script download the actual released manifest/base and the manager download the remaining components. Both modes exercise initialization, warm doctor, developer-command rejection and rejection of altered script/checksum-index bytes; modified private test copies are restored and the final cache is rechecked.
242
+
243
+ Source CI runs cached copied-script checks on all four hosts after complete aggregation. Release CI runs public checks after component publication. Their reports carry distinct modes and initial-cache evidence. Cached or single-platform success cannot authorize final publication.
244
+
245
+ `release:publish-runtime-manifest` runs only in its owning job after all four public-bootstrap jobs succeed. It revalidates the exact source, the complete twelve-component/eight-launch manifest, all five checks per public report, original script digests and observed package/Node/TIDAS identities. It rereads the public candidate manifest and exact source tag before creating or verifying `foundry-runtime-v<version>`.
246
+
247
+ The final release contains the identical qualified runtime-manifest.json, bootstrap-lock.json pointing to that final URL, both unchanged C1 scripts and a public qualification summary binding all four report hashes and the workflow run. It uses the existing create-only draft/asset/readback machinery. Every final public asset is downloaded and compared again before runtime_published=true is emitted. The first-package account handoff and actual versioned workflow execution remain required; implementation or transport fixtures alone do not establish F1 publication.
248
+
249
+ ## Frozen production payload and metadata
250
+
251
+ `pnpm release:prepare-production --output <new-absolute-directory>` is the source-only entrypoint for this input. It requires its own clean checkout, the pinned Node/pnpm source toolchain declaration and a supported host. Output must be outside the source checkout or under ignored `package-artifacts/`; existing destinations are preserved. `specs/release/runtime-inputs.json` binds the exact public CLI version, source commit, repository and tag, and must agree with the public Foundry dependency. The command independently verifies that public CLI release before assembling locked package bytes, runs C1's public runtime inspection from the isolated tree, and uses C1's public writer to produce the archive. It rechecks source before returning the receipt and readable report. No source/version/registry/publish override is available. Its `npm-production-input` result is a prepared assembly input, not a complete runtime or released F1.
252
+
253
+ `projectFoundryProductionLock` reads the sole owning pnpm lock and the exact direct dependency declaration from the public package. It requires the pnpm 9.0 lock format, one root importer and coherent exact root versions. Strict YAML parsing rejects duplicate keys, aliases, multiple documents and invalid UTF-8. The projection follows every required snapshot edge, binds canonical SHA-512 package integrities and default public-registry tarball locations, and excludes development-only nodes. Its source byte count/hash refer to the original lock, including its development graph; the derived JSON is release evidence, not a second authoritative package-manager lock.
254
+
255
+ The current qualified closure contains 16 packages with one version per package name. `materializeFoundryProductionPackages` consumes a fresh in-process projection, downloads those exact public tarballs without credentials/redirects, verifies their locked SHA-512 and extracts them into a new physical `node_modules` tree. It performs no version/range resolution, package-manager install, lifecycle execution or floating dependency lookup. Each tarball's manifest name/version and dependency/peer declaration must match the locked graph. The optional `@opentelemetry/api` peer declared by Supabase is explicitly recorded as absent; it is not silently installed or counted as shipped software. A missing required peer or an absent peer that would accidentally resolve in the flattened tree fails. Other optional package graphs, peer-context locators, aliases, non-registry resolutions or multiple versions of one name require an explicit layout/qualification change before use; they cannot silently select another layout.
256
+
257
+ The source tar extractor accepts bounded gzip npm archives with complete regular files under `package/`. Before creating a payload root it checks portable paths, case-folded duplicates, file/directory collisions, complete bodies and unpacked/count bounds. It rejects links, special entries, outside-prefix paths and malformed archives. Extraction uses the maintained tar library with strict parsing, ownership/path protections and bounded metadata; every extracted file is then compared with the preflight byte inventory. Modes normalize to 0644/0755, including on Windows; empty payload files remain valid. Existing destinations are never replaced and failures remove only the newly owned tree. This upstream npm reader does not relax C1's separate canonical component archive contract.
258
+
259
+ Production-tree results are fresh in-process evidence. `collectFoundryNpmMetadata` rechecks retained license bytes against the package inventory, preserves complete texts, and deduplicates identical texts by digest. Its license index binds each package, original archive/path or exact upstream source, declared license and copied file hash. The npm saxes 6.0.0 archive omits LICENSE: the reviewed supplement in `specs/release/` binds its exact package integrity and upstream commit `211fa0ebec9b628affc09219199639887174bfc3`, which matches both npm `gitHead` and the dereferenced `v6.0.0` tag. Full historical notices are retained. A new missing license needs its own reviewed source; the tool never invents license text or applies the saxes exception to another artifact.
260
+
261
+ `createFoundrySpdxDocument` emits deterministic SPDX 2.3 package/dependency data with exact archive checksums, source locations and retained license references. It rejects an incomplete graph or unsupported source/version/platform context. Its timestamp is normalized to the owning source commit; its namespace also binds the sorted software facts. Package-level metadata sets `filesAnalyzed: false` and does not claim per-file license conclusions; C1's component manifest separately binds every shipped file. The document is validated against the unmodified upstream SPDX 2.3 schema pinned in `specs/release/upstream-assets.json`. That catalog preserves its source commit, digest, attribution and CC-BY-3.0 license URI. The exact schema is excluded from formatting so its source digest remains valid; these source release assets are absent from the npm allowlist.
262
+
263
+ The production dependency payload is an input to complete runtime-component assembly. Its npm-only SBOM and candidate archive do not qualify a complete Node/C1/Foundry/TIDAS component, native host compatibility, public downloads or the final product manifest. Final assembly must include the selected native/software artifacts and their metadata, use the public C1 component writer, and pass every declared platform's actual consumer/manager/bootstrap gate.
264
+
265
+ ## Native release inputs
266
+
267
+ `pnpm release:prepare-native --output <new-absolute-directory>` binds its clean source and current supported host to the reviewed Node/TIDAS entries in `specs/release/runtime-inputs.json`. It offers no platform, version, source or registry override. Native downloads use a bounded HTTPS transfer through official artifact hosts, verify the pinned SHA-256 before parsing, and select the declared Node files or the complete TIDAS v2 inventory. The TIDAS reader checks the exact release version/target/source, binary and nested notice hashes, complete file inventory, Cargo-lock/package evidence, native XML notice coverage and Rust compiler/source notice bindings. Missing, extra, changed, linked, duplicated, unsafe or oversized files fail before output creation. The tar reader only streams regular selected entries; complete ZIP inputs additionally check ordinary single-disk central records for file types before development-only fflate decompression. Output paths come from the verified bounded inventory, and all files are written as regular files.
268
+
269
+ The current Node input is24.19.0 at source `cdc1b38d40cb567b7ad0b39c86addf830a0af0ae`; its official SHASUMS256 entries pin the four targets. The source LICENSE is byte-identical to the selected macOS release LICENSE. Windows uses the official `win-x64/node.exe` plus that checksum-bound source license. TIDAS 0.3.0 is pinned to actual release target `bbccee6a7e3c10ce1184e06fd7b621862ad6ce07`, as recorded by the immutable release request and source-bound SLSA/SPDX attestations for all four public archives. Eligible main `e237a6cf1d4c55ba490719a8fcee0f659d1f840c` includes the request; the tag target owns the binary source identity. The command checks the TIDAS distribution manifest, executes the downloaded Node to verify version/architecture, and uses the existing TIDAS version/validation handshake in an isolated home. It records native observations, selected file hashes, upstream sources, licenses and SPDX data as assembly inputs.
270
+
271
+ Native handshake success is not minimum-host or clean-machine qualification. Current binary inspection finds Node macOS minimum13.5 and TIDAS minimum11.0; both TIDAS GNU Linux targets require GLIBC2.38. The public Windows TIDAS 0.3.0 executable uses static CRT linkage: independent LLVM PE inspection finds only Windows OS imports, and the exact-tag native workflow passed packaged smoke. The reviewed input profile records an empty external-runtime DLL list and the actual public executable hash. [TIDAS #181](https://github.com/tiangong-lca/tidas-tools/issues/181) and [release #187](https://github.com/tiangong-lca/tidas-tools/issues/187) retain the correction and publication evidence. Complete Node/CLI/Foundry/TIDAS cold-start qualification remains a further F1 gate.
272
+
273
+ ## Qualification
274
+
275
+ `pnpm package:build` rebuilds both output roots from scratch and verifies the staged package. `pnpm package:check` compares the stage with the descriptor, runs a pack dry-run, and verifies the installed C1 descriptor. `pnpm package:pack` packs only `package-stage/` into an owned temporary directory, derives the versioned archive name from the verified staged descriptor, then installs it with an exclusive hardlink. The repository manifest, compiled verifier version and descriptor JSON Schema version remain coherent release projections; the verifier never takes its expected identity from the installed manifest it is checking. An identical existing archive is reused; a link, invalid file or different existing bytes are preserved and rejected rather than overwritten.
276
+
277
+ The package scenario rebuilds twice, packs twice byte-identically, and installs the same tarball into two clean consumers; the second install is offline from the first consumer's isolated public cache. The scenario first verifies the source-pinned pnpm version. Corepack, when used, stores that tool in a fresh scenario-local cache shared across the isolated tool homes; later packing runs with Corepack networking disabled and latest-version lookup disabled. Tool bootstrap and the first public-registry install have bounded five-minute deadlines for cold network downloads; the offline install and local commands retain their two-minute deadlines. It verifies the exact import surface and declarations, public CLI 0.1.12 runtime identity, shebang/bin, source/installed operation equivalence, arbitrary Unicode CWD, read-only package bytes, isolated workspace writes and all six facade operations. It also proves that internal commands, modified/extra/linked files, a lifecycle-bearing manifest, a `darwin-x64` descriptor and a package copied without C1 fail closed.
278
+
279
+ These checks qualify a local candidate tarball. They do not prove registry provenance, public component download, native TIDAS availability on every host or a complete Node+CLI+Foundry+TIDAS component. Those are W08 release gates.
280
+
281
+ Version rehearsal also runs the complete gate after the coherent version projection in an isolated source checkout. Synthetic current-host manifests used by migration and runtime-selection tests follow the executing repository package version; explicitly older and untrusted selections still test rejection. Passing only the unchanged `0.1.0` source tests does not prove that a versioned release can pass the gate.
282
+
283
+ The W10 planning extension adds the shared pure attempt leaf and bounded migration plan/stage readers to the public graph, plus the transfer-plan schema and migration contract. It still excludes the internal capsule command and all developer commands. Future package qualification must use the rebuilt descriptor/tarball; the earlier W06 tarball remains an immutable baseline artifact.
284
+
285
+ The W10 transfer extension ships bounded transfer I/O and staging/audit owners plus pending-marker and receipt schemas. It still has no install lifecycle effects, no business mutation dispatcher and no automatic activation; source-free consumers can explicitly stage and audit the same v2 plans.
286
+
287
+ The adoption extension ships migration planning/application/authority/scope guards, explicit read/write access, runtime selection and their strict schemas. The package descriptor lists both supported read and write schemas while retaining v1 as the default initialization schema; v2 writes additionally require the trusted host feature selection. Public CLI apply/runtime-use remain separate explicit actions, never install hooks. Source and installed packages must qualify the same behaviors; managed component publication/bootstrap remains W08.