@kungfu-tech/buildchain 4.1.3-alpha.1 → 4.1.3-alpha.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 (202) hide show
  1. package/architecture/action-taxonomy.json +16 -0
  2. package/architecture/agent-change-map.md +239 -2
  3. package/architecture/ci-lane-change-budget.json +289 -0
  4. package/architecture/decisions/0005-minimal-consumer-contract.md +122 -0
  5. package/architecture/decisions/0006-business-attempt-journal.md +89 -0
  6. package/architecture/decisions/0007-hosted-pipeline-controller.md +106 -0
  7. package/architecture/decisions/0008-pipeline-product-publication.md +99 -0
  8. package/architecture/internal-capabilities.json +331 -2
  9. package/architecture/maintainability-debt.json +3 -1
  10. package/architecture/maintainability-policy.json +8 -8
  11. package/architecture/minimal-consumer-migration.json +7558 -0
  12. package/architecture/release-topology.json +245 -11
  13. package/architecture/universal-workflow-bootstrap.json +10 -0
  14. package/architecture/universal-workflow-capability-policy.json +1 -1
  15. package/architecture/workflow-taxonomy.json +55 -0
  16. package/dist/readers/business-attempt.cjs +805 -0
  17. package/dist/site/buildchain-contract.json +7 -5
  18. package/dist/site/buildchain-site.json +18 -13
  19. package/dist/site/capability-registry.json +3 -3
  20. package/dist/site/kfd-claims.json +311 -10
  21. package/dist/site/kfd-upstream-aggregate.json +1 -1
  22. package/dist/site/manual-registry.json +1 -1
  23. package/dist/site/node-api-registry.json +7 -7
  24. package/dist/site/page-registry.json +13 -8
  25. package/dist/site/public-surface-audit.json +201 -7
  26. package/dist/site/publication-authority-registry.json +121 -1
  27. package/dist/site/publication-registry.json +4 -4
  28. package/dist/site/site-manifest.json +5 -5
  29. package/dist/site/workflow-registry.json +416 -7
  30. package/docs/node-api-reference.md +11 -11
  31. package/docs/runtime-entry.md +45 -5
  32. package/docs/workflow-catalog.md +5 -0
  33. package/package.json +4 -3
  34. package/packages/core/consumer/contract/entries.js +85 -0
  35. package/packages/core/consumer/contract/examples.js +96 -0
  36. package/packages/core/consumer/contract/identity.js +65 -0
  37. package/packages/core/consumer/contract/inspection.js +45 -0
  38. package/packages/core/consumer/contract/plan.js +99 -0
  39. package/packages/core/consumer/contract/products.js +101 -0
  40. package/packages/core/consumer/contract/shape.js +46 -0
  41. package/packages/core/dev-delivery/candidate/admission.js +9 -5
  42. package/packages/core/dev-delivery/candidate/reservation.js +11 -0
  43. package/packages/core/dev-delivery/candidate/source-paths.js +12 -4
  44. package/packages/core/dev-delivery/native/actions.js +7 -1
  45. package/packages/core/dev-delivery/native/heartbeat-action.js +16 -0
  46. package/packages/core/dev-delivery/native/heartbeat.js +6 -4
  47. package/packages/core/dev-delivery/queue/landing-action.js +5 -0
  48. package/packages/core/governance/buildchain-publication-authority.js +5 -0
  49. package/packages/core/paper/operations/bootstrap.js +2 -0
  50. package/packages/core/paper/paper-npm-bootstrap.js +2 -2
  51. package/packages/core/providers/github/attempt-index.js +60 -0
  52. package/packages/core/providers/github/attempt-journal.js +154 -0
  53. package/packages/core/providers/github/discussions/materials.js +7 -2
  54. package/packages/core/providers/github/pipeline-checkout.js +49 -0
  55. package/packages/core/providers/github/pipeline-events.js +52 -0
  56. package/packages/core/providers/github/pipeline-integration.js +95 -0
  57. package/packages/core/providers/github/pipeline-policy.js +213 -0
  58. package/packages/core/providers/github/pipeline-product-payload.js +50 -0
  59. package/packages/core/providers/github/pipeline-product-release.js +191 -0
  60. package/packages/core/providers/github/pipeline-publication-artifacts.js +153 -0
  61. package/packages/core/providers/github/pipeline-run-entry.js +86 -0
  62. package/packages/core/providers/github/pipeline-runs.js +132 -0
  63. package/packages/core/providers/github/pipeline-source.js +178 -0
  64. package/packages/core/providers/github/pipeline-version.js +201 -0
  65. package/packages/core/providers/github/pipeline-worker.js +108 -0
  66. package/packages/core/publication/candidate/registry-hydration.js +2 -2
  67. package/packages/core/publication/npm/pack-preview.js +2 -2
  68. package/packages/core/publication/npm/pack-result.js +31 -0
  69. package/packages/core/publication/npm/package.js +3 -6
  70. package/packages/core/publication/npm/pipeline-channel.js +87 -0
  71. package/packages/core/publication/npm/pipeline-provider.js +109 -0
  72. package/packages/core/publication/npm/registry.js +12 -9
  73. package/packages/core/publication/pipeline/actions.js +100 -0
  74. package/packages/core/publication/pipeline/apply.js +182 -0
  75. package/packages/core/publication/pipeline/build-segments.js +107 -0
  76. package/packages/core/publication/pipeline/capsules.js +89 -0
  77. package/packages/core/publication/pipeline/context.js +39 -0
  78. package/packages/core/publication/pipeline/development-anchor.js +91 -0
  79. package/packages/core/publication/pipeline/development-current.js +63 -0
  80. package/packages/core/publication/pipeline/development-pr.js +85 -0
  81. package/packages/core/publication/pipeline/development-proof.js +76 -0
  82. package/packages/core/publication/pipeline/development-transition.js +112 -0
  83. package/packages/core/publication/pipeline/distribution.js +124 -0
  84. package/packages/core/publication/pipeline/documents.js +156 -0
  85. package/packages/core/publication/pipeline/effects.js +162 -0
  86. package/packages/core/publication/pipeline/files.js +66 -0
  87. package/packages/core/publication/pipeline/imported-materials.js +32 -0
  88. package/packages/core/publication/pipeline/journal.js +110 -0
  89. package/packages/core/publication/pipeline/next-development.js +116 -0
  90. package/packages/core/publication/pipeline/pack.js +151 -0
  91. package/packages/core/publication/pipeline/package-policy.js +22 -0
  92. package/packages/core/publication/pipeline/plan.js +114 -0
  93. package/packages/core/publication/pipeline/prepare.js +151 -0
  94. package/packages/core/publication/pipeline/qualification.js +170 -0
  95. package/packages/core/publication/pipeline/qualify.js +104 -0
  96. package/packages/core/publication/pipeline/recovery-admission.js +122 -0
  97. package/packages/core/publication/pipeline/recovery-build-download.js +80 -0
  98. package/packages/core/publication/pipeline/recovery-build-plan.js +122 -0
  99. package/packages/core/publication/pipeline/recovery-build-readback.js +68 -0
  100. package/packages/core/publication/pipeline/recovery-capsules.js +54 -0
  101. package/packages/core/publication/pipeline/recovery-import.js +80 -0
  102. package/packages/core/publication/pipeline/recovery-inspection.js +218 -0
  103. package/packages/core/publication/pipeline/recovery-materials.js +104 -0
  104. package/packages/core/publication/pipeline/recovery-plan.js +46 -0
  105. package/packages/core/publication/pipeline/recovery-prepare.js +73 -0
  106. package/packages/core/publication/pipeline/recovery-qualification.js +128 -0
  107. package/packages/core/publication/pipeline/recovery-readback.js +56 -0
  108. package/packages/core/publication/pipeline/recovery-signing.js +58 -0
  109. package/packages/core/publication/pipeline/sealed-products.js +79 -0
  110. package/packages/core/publication/pipeline/settle.js +43 -0
  111. package/packages/core/publication/pipeline/signing.js +140 -0
  112. package/packages/core/publication/pipeline/source-plan.js +83 -0
  113. package/packages/core/publication/pipeline/version.js +81 -0
  114. package/packages/core/publication/publication-reproducibility.js +2 -2
  115. package/packages/core/release/promote-candidate/product-provider-adapters.js +4 -3
  116. package/packages/core/release/promote-ref/internal/npm-existing-evidence.js +2 -1
  117. package/packages/core/release/promote-ref/internal/publish-command.js +16 -5
  118. package/packages/core/runtime/buildchain-domain.wasm +0 -0
  119. package/packages/core/runtime/domain-wasm-artifact.js +2 -2
  120. package/packages/core/runtime/entry/actions.js +27 -25
  121. package/packages/core/runtime/entry/attempt.js +25 -0
  122. package/packages/core/runtime/entry/selection.js +14 -0
  123. package/packages/core/runtime/entry/source.js +62 -0
  124. package/packages/core/workflow/attempt/identity.js +165 -0
  125. package/packages/core/workflow/attempt/journal.js +87 -0
  126. package/packages/core/workflow/attempt/materials.js +72 -0
  127. package/packages/core/workflow/attempt/reader-entry.js +12 -0
  128. package/packages/core/workflow/attempt/reader.js +149 -0
  129. package/packages/core/workflow/attempt/records.js +153 -0
  130. package/packages/core/workflow/attempt/store.js +75 -0
  131. package/packages/core/workflow/commands/pipeline-build.mjs +23 -0
  132. package/packages/core/workflow/pipeline/action-output.js +11 -0
  133. package/packages/core/workflow/pipeline/actions.js +62 -0
  134. package/packages/core/workflow/pipeline/build-control.js +140 -0
  135. package/packages/core/workflow/pipeline/build-evidence.js +92 -0
  136. package/packages/core/workflow/pipeline/build-qualification.js +145 -0
  137. package/packages/core/workflow/pipeline/build-result.js +69 -0
  138. package/packages/core/workflow/pipeline/build.js +95 -0
  139. package/packages/core/workflow/pipeline/cancellation.js +169 -0
  140. package/packages/core/workflow/pipeline/channel-control.js +127 -0
  141. package/packages/core/workflow/pipeline/controller.js +133 -0
  142. package/packages/core/workflow/pipeline/delivery-control.js +204 -0
  143. package/packages/core/workflow/pipeline/delivery-observation.js +118 -0
  144. package/packages/core/workflow/pipeline/delivery-request.js +198 -0
  145. package/packages/core/workflow/pipeline/events.js +84 -0
  146. package/packages/core/workflow/pipeline/fence.js +42 -0
  147. package/packages/core/workflow/pipeline/group-control.js +56 -0
  148. package/packages/core/workflow/pipeline/guard-build.js +37 -0
  149. package/packages/core/workflow/pipeline/guard.js +156 -0
  150. package/packages/core/workflow/pipeline/host.js +114 -0
  151. package/packages/core/workflow/pipeline/materials.js +58 -0
  152. package/packages/core/workflow/pipeline/notifications.js +36 -0
  153. package/packages/core/workflow/pipeline/parent-notification.js +27 -0
  154. package/packages/core/workflow/pipeline/platforms.js +21 -0
  155. package/packages/core/workflow/pipeline/progress.js +108 -0
  156. package/packages/core/workflow/pipeline/projection.js +20 -0
  157. package/packages/core/workflow/pipeline/reconcile.js +194 -0
  158. package/packages/core/workflow/pipeline/recovery-action.js +30 -0
  159. package/packages/core/workflow/pipeline/recovery-admission.js +122 -0
  160. package/packages/core/workflow/pipeline/recovery-build-control.js +95 -0
  161. package/packages/core/workflow/pipeline/recovery-build-evidence.js +71 -0
  162. package/packages/core/workflow/pipeline/recovery-build.js +121 -0
  163. package/packages/core/workflow/pipeline/recovery-controller.js +91 -0
  164. package/packages/core/workflow/pipeline/recovery-integration.js +66 -0
  165. package/packages/core/workflow/pipeline/recovery-merge-proof.js +90 -0
  166. package/packages/core/workflow/pipeline/recovery-ownership-settlement.js +150 -0
  167. package/packages/core/workflow/pipeline/recovery-ownership.js +91 -0
  168. package/packages/core/workflow/pipeline/recovery-plan.js +126 -0
  169. package/packages/core/workflow/pipeline/recovery-runtime.js +68 -0
  170. package/packages/core/workflow/pipeline/recovery-session.js +129 -0
  171. package/packages/core/workflow/pipeline/recovery-transition.js +135 -0
  172. package/packages/core/workflow/pipeline/recovery-unrecorded-build.js +74 -0
  173. package/packages/core/workflow/pipeline/runtime-source.js +111 -0
  174. package/packages/core/workflow/pipeline/selection.js +106 -0
  175. package/packages/core/workflow/pipeline/session.js +72 -0
  176. package/packages/core/workflow/pipeline/settlement.js +137 -0
  177. package/packages/core/workflow/pipeline/wake.js +38 -0
  178. package/packages/core/workflow/pipeline/web-status.js +108 -0
  179. package/scripts/build-release-discussion-reader.mjs +11 -7
  180. package/scripts/check-pipeline-publication-topology.mjs +36 -0
  181. package/scripts/check-release-topology.mjs +6 -1
  182. package/scripts/generate-minimal-consumer-contract.mjs +155 -0
  183. package/scripts/verify-golden-path.mjs +5 -1
  184. package/templates/minimal-consumer/binary/.buildchain/buildchain.toml +45 -0
  185. package/templates/minimal-consumer/binary/.github/workflows/buildchain-recover.yml +30 -0
  186. package/templates/minimal-consumer/binary/.github/workflows/buildchain.yml +28 -0
  187. package/templates/minimal-consumer/binary/package.json +6 -0
  188. package/templates/minimal-consumer/binary/src/build.mjs +5 -0
  189. package/templates/minimal-consumer/binary/src/hello.c +2 -0
  190. package/templates/minimal-consumer/binary/src/verify.mjs +3 -0
  191. package/templates/minimal-consumer/npm/.buildchain/buildchain.toml +46 -0
  192. package/templates/minimal-consumer/npm/.github/workflows/buildchain-recover.yml +30 -0
  193. package/templates/minimal-consumer/npm/.github/workflows/buildchain.yml +28 -0
  194. package/templates/minimal-consumer/npm/package.json +6 -0
  195. package/templates/minimal-consumer/npm/src/build.mjs +5 -0
  196. package/templates/minimal-consumer/npm/src/verify.mjs +3 -0
  197. package/templates/minimal-consumer/paper/.buildchain/buildchain.toml +45 -0
  198. package/templates/minimal-consumer/paper/.github/workflows/buildchain-recover.yml +30 -0
  199. package/templates/minimal-consumer/paper/.github/workflows/buildchain.yml +28 -0
  200. package/templates/minimal-consumer/paper/package.json +6 -0
  201. package/templates/minimal-consumer/paper/src/build.mjs +12 -0
  202. package/templates/minimal-consumer/paper/src/verify.mjs +3 -0
@@ -115,7 +115,7 @@ Target: `./packages/core/index.js`. Public symbols: 625.
115
115
  | `BUILDCHAIN_VERSION_PIN_PATH` | constant: const BUILDCHAIN_VERSION_PIN_PATH | none | value | Import does not declare a throw contract. | none-on-import | `import { BUILDCHAIN_VERSION_PIN_PATH } from "@kungfu-tech/buildchain";` | `packages/core/contracts/buildchain-layout.js:5` |
116
116
  | `BUILDCHAIN_WORKFLOW_FRICTION_ISSUE_CONTRACT` | constant: const BUILDCHAIN_WORKFLOW_FRICTION_ISSUE_CONTRACT | none | value | Import does not declare a throw contract. | none-on-import | `import { BUILDCHAIN_WORKFLOW_FRICTION_ISSUE_CONTRACT } from "@kungfu-tech/buildchain";` | `packages/core/governance/issue-reporting.js:5` |
117
117
  | `buildchainKfdClaims` | constant: const buildchainKfdClaims | none | value | Import does not declare a throw contract. | none-on-import | `import { buildchainKfdClaims } from "@kungfu-tech/buildchain";` | `packages/core/adoption/kfd.js:896` |
118
- | `buildchainPublicationAuthorityDescriptors` | function: function buildchainPublicationAuthorityDescriptors({ root = process.cwd() } = {}) | { root = process.cwd() } = {} | unknown | May throw an Error on rejected input or failed operations; follow the linked source contract. | none-detected-by-static-source-scan | `import { buildchainPublicationAuthorityDescriptors } from "@kungfu-tech/buildchain";` | `packages/core/governance/buildchain-publication-authority.js:65` |
118
+ | `buildchainPublicationAuthorityDescriptors` | function: function buildchainPublicationAuthorityDescriptors({ root = process.cwd() } = {}) | { root = process.cwd() } = {} | unknown | May throw an Error on rejected input or failed operations; follow the linked source contract. | none-detected-by-static-source-scan | `import { buildchainPublicationAuthorityDescriptors } from "@kungfu-tech/buildchain";` | `packages/core/governance/buildchain-publication-authority.js:70` |
119
119
  | `buildConsumerIssueReport` | function: function buildConsumerIssueReport(options = {}) | options = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { buildConsumerIssueReport } from "@kungfu-tech/buildchain";` | `packages/core/governance/issue-reporting.js:104` |
120
120
  | `buildFactsDigest` | function: function buildFactsDigest(value) | value | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | local-filesystem-write, subprocess | `import { buildFactsDigest } from "@kungfu-tech/buildchain";` | `packages/core/build/build-facts.js:44` |
121
121
  | `buildWorkflowFrictionIssueReport` | function: function buildWorkflowFrictionIssueReport(options = {}) | options = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { buildWorkflowFrictionIssueReport } from "@kungfu-tech/buildchain";` | `packages/core/governance/issue-reporting.js:199` |
@@ -187,7 +187,7 @@ Target: `./packages/core/index.js`. Public symbols: 625.
187
187
  | `createBuildchainKfdSurfaceRegistry` | function: function createBuildchainKfdSurfaceRegistry({ root = process.cwd() } = {}) | { root = process.cwd() } = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { createBuildchainKfdSurfaceRegistry } from "@kungfu-tech/buildchain";` | `packages/core/adoption/buildchain-kfd-claims.js:411` |
188
188
  | `createBuildchainLayoutDiscovery` | function: function createBuildchainLayoutDiscovery({ cwd = process.cwd(), buildchainVersion = "", } = {}) | { cwd = process.cwd(), buildchainVersion = "", } = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { createBuildchainLayoutDiscovery } from "@kungfu-tech/buildchain";` | `packages/core/contracts/buildchain-layout.js:99` |
189
189
  | `createBuildchainLogger` | function: function createBuildchainLogger(options = {}) | options = {} | unknown | May throw an Error on rejected input or failed operations; follow the linked source contract. | subprocess | `import { createBuildchainLogger } from "@kungfu-tech/buildchain";` | `packages/core/observability/logging.js:300` |
190
- | `createBuildchainPublicationAuthorityRegistry` | function: function createBuildchainPublicationAuthorityRegistry({ root = process.cwd() } = {}) | { root = process.cwd() } = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { createBuildchainPublicationAuthorityRegistry } from "@kungfu-tech/buildchain";` | `packages/core/governance/buildchain-publication-authority.js:104` |
190
+ | `createBuildchainPublicationAuthorityRegistry` | function: function createBuildchainPublicationAuthorityRegistry({ root = process.cwd() } = {}) | { root = process.cwd() } = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { createBuildchainPublicationAuthorityRegistry } from "@kungfu-tech/buildchain";` | `packages/core/governance/buildchain-publication-authority.js:109` |
191
191
  | `createBuildchainPublicClaimDefinitions` | function: function createBuildchainPublicClaimDefinitions() | none | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { createBuildchainPublicClaimDefinitions } from "@kungfu-tech/buildchain";` | `packages/core/adoption/buildchain-kfd-claims.js:226` |
192
192
  | `createCacheEvidenceSet` | function: function createCacheEvidenceSet({ repository, sourceCommit, sourceTree = "", runtimeCommit = "", platform, operations = [], } = {}) | { repository, sourceCommit, sourceTree = "", runtimeCommit = "", platform, operations = [], } = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { createCacheEvidenceSet } from "@kungfu-tech/buildchain";` | `packages/core/observability/cache-evidence.js:244` |
193
193
  | `createCacheOperationReceipt` | function: function createCacheOperationReceipt({ operationId, operation, provider, producer, platform, cacheKey, cacheRoot, outcome, bindings = {}, metrics, evidence, } = {}) | { operationId, operation, provider, producer, platform, cacheKey, cacheRoot, outcome, bindings = {}, metrics, evidence, } = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { createCacheOperationReceipt } from "@kungfu-tech/buildchain";` | `packages/core/observability/cache-evidence.js:169` |
@@ -291,7 +291,7 @@ Target: `./packages/core/index.js`. Public symbols: 625.
291
291
  | `evaluateGithubGovernanceSnapshot` | function: function evaluateGithubGovernanceSnapshot({ descriptor = createBuildchainGithubGovernanceAuthority(), repository, targetRef, organizationPlan, codeowners, effectivePolicy, memberships, apiEvidence = {}, observedAt, expiresAt, verifier = {}, } = {}) | { descriptor = createBuildchainGithubGovernanceAuthority(), repository, targetRef, organizationPlan, codeowners, effectivePolicy, memberships, apiEvidence = {}, observedAt, expiresAt, verifier = {}, } = {} | unknown | May throw an Error on rejected input or failed operations; follow the linked source contract. | none-detected-by-static-source-scan | `import { evaluateGithubGovernanceSnapshot } from "@kungfu-tech/buildchain";` | `packages/core/governance/github-governance-authority.js:695` |
292
292
  | `evaluateKfdProductGate` | function: async function evaluateKfdProductGate({ cwd = process.cwd(), input, expectedSourceSha = "", checkedAt = new Date().toISOString(), } = {}) | { cwd = process.cwd(), input, expectedSourceSha = "", checkedAt = new Date().toISOString(), } = {} | Promise<unknown> | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { evaluateKfdProductGate } from "@kungfu-tech/buildchain";` | `packages/core/adoption/kfd-product-gates.js:419` |
293
293
  | `evaluatePublicationControlPlaneSnapshot` | function: function evaluatePublicationControlPlaneSnapshot({ repository, workflowPath, publisherWorkflowPath = workflowPath, environment, branch, packageName, publisherMode = "npm-trusted-publisher", requiredStatusCheck = "check", snapshot, observedAt, expiresAt, } = {}) | { repository, workflowPath, publisherWorkflowPath = workflowPath, environment, branch, packageName, publisherMode = "npm-trusted-publisher", requiredStatusCheck = "check", snapshot, observedAt, expiresAt, } = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { evaluatePublicationControlPlaneSnapshot } from "@kungfu-tech/buildchain";` | `packages/core/publication/publication-control-plane-audit.js:245` |
294
- | `executePaperNpmBootstrap` | function: function executePaperNpmBootstrap(options = {}) | options = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | may-write-or-invoke-external-actions | `import { executePaperNpmBootstrap } from "@kungfu-tech/buildchain";` | `packages/core/paper/operations/bootstrap.js:47` |
294
+ | `executePaperNpmBootstrap` | function: function executePaperNpmBootstrap(options = {}) | options = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | may-write-or-invoke-external-actions | `import { executePaperNpmBootstrap } from "@kungfu-tech/buildchain";` | `packages/core/paper/operations/bootstrap.js:48` |
295
295
  | `executePaperWorkStart` | function: function executePaperWorkStart(plan) | plan | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | may-write-or-invoke-external-actions | `import { executePaperWorkStart } from "@kungfu-tech/buildchain";` | `packages/core/paper/paper-work.js:169` |
296
296
  | `executePaperWorkSubmitPush` | function: function executePaperWorkSubmitPush(plan) | plan | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | may-write-or-invoke-external-actions | `import { executePaperWorkSubmitPush } from "@kungfu-tech/buildchain";` | `packages/core/paper/paper-work.js:357` |
297
297
  | `executeReleasePropagationPush` | function: function executeReleasePropagationPush({ work, expectedWorkRoot, cwd = process.cwd(), remote = "origin", } = {}) | { work, expectedWorkRoot, cwd = process.cwd(), remote = "origin", } = {} | unknown | May throw an Error on rejected input or failed operations; follow the linked source contract. | may-write-or-invoke-external-actions | `import { executeReleasePropagationPush } from "@kungfu-tech/buildchain";` | `packages/core/release/release-propagation-push.js:231` |
@@ -458,7 +458,7 @@ Target: `./packages/core/index.js`. Public symbols: 625.
458
458
  | `PUBLICATION_NPM_PACKAGE_CONTRACT` | constant: const PUBLICATION_NPM_PACKAGE_CONTRACT | none | value | Import does not declare a throw contract. | none-on-import | `import { PUBLICATION_NPM_PACKAGE_CONTRACT } from "@kungfu-tech/buildchain";` | `packages/core/publication/publication-package.js:6` |
459
459
  | `PUBLICATION_QUALIFICATION_RECEIPT_CONTRACT` | constant: const PUBLICATION_QUALIFICATION_RECEIPT_CONTRACT | none | value | Import does not declare a throw contract. | none-on-import | `import { PUBLICATION_QUALIFICATION_RECEIPT_CONTRACT } from "@kungfu-tech/buildchain";` | `packages/core/publication/publication-authority.js:22` |
460
460
  | `PUBLICATION_QUALIFICATION_SCHEMA` | constant: const PUBLICATION_QUALIFICATION_SCHEMA | none | value | Import does not declare a throw contract. | none-on-import | `import { PUBLICATION_QUALIFICATION_SCHEMA } from "@kungfu-tech/buildchain";` | `packages/core/publication/publication-qualification.js:3` |
461
- | `PUBLICATION_REPRODUCIBILITY_RECEIPT_CONTRACT` | constant: const PUBLICATION_REPRODUCIBILITY_RECEIPT_CONTRACT | none | value | Import does not declare a throw contract. | none-on-import | `import { PUBLICATION_REPRODUCIBILITY_RECEIPT_CONTRACT } from "@kungfu-tech/buildchain";` | `packages/core/publication/publication-reproducibility.js:11` |
461
+ | `PUBLICATION_REPRODUCIBILITY_RECEIPT_CONTRACT` | constant: const PUBLICATION_REPRODUCIBILITY_RECEIPT_CONTRACT | none | value | Import does not declare a throw contract. | none-on-import | `import { PUBLICATION_REPRODUCIBILITY_RECEIPT_CONTRACT } from "@kungfu-tech/buildchain";` | `packages/core/publication/publication-reproducibility.js:12` |
462
462
  | `PUBLICATION_SEALED_BUNDLE_CONTRACT` | constant: const PUBLICATION_SEALED_BUNDLE_CONTRACT | none | value | Import does not declare a throw contract. | none-on-import | `import { PUBLICATION_SEALED_BUNDLE_CONTRACT } from "@kungfu-tech/buildchain";` | `packages/core/publication/publication-sealed-bundle.js:11` |
463
463
  | `publicationArtifactCandidateDigest` | function: function publicationArtifactCandidateDigest(value) | value | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { publicationArtifactCandidateDigest } from "@kungfu-tech/buildchain";` | `packages/core/publication/publication-artifact-candidate.js:19` |
464
464
  | `publicationAuthorityDigest` | function: function publicationAuthorityDigest(value) | value | unknown | May throw an Error on rejected input or failed operations; follow the linked source contract. | none-detected-by-static-source-scan | `import { publicationAuthorityDigest } from "@kungfu-tech/buildchain";` | `packages/core/publication/publication-authority.js:72` |
@@ -790,7 +790,7 @@ Target: `./packages/core/index.js`. Public symbols: 625.
790
790
  | `BUILDCHAIN_VERSION_PIN_PATH` | constant: const BUILDCHAIN_VERSION_PIN_PATH | none | value | Import does not declare a throw contract. | none-on-import | `import { BUILDCHAIN_VERSION_PIN_PATH } from "@kungfu-tech/buildchain/core";` | `packages/core/contracts/buildchain-layout.js:5` |
791
791
  | `BUILDCHAIN_WORKFLOW_FRICTION_ISSUE_CONTRACT` | constant: const BUILDCHAIN_WORKFLOW_FRICTION_ISSUE_CONTRACT | none | value | Import does not declare a throw contract. | none-on-import | `import { BUILDCHAIN_WORKFLOW_FRICTION_ISSUE_CONTRACT } from "@kungfu-tech/buildchain/core";` | `packages/core/governance/issue-reporting.js:5` |
792
792
  | `buildchainKfdClaims` | constant: const buildchainKfdClaims | none | value | Import does not declare a throw contract. | none-on-import | `import { buildchainKfdClaims } from "@kungfu-tech/buildchain/core";` | `packages/core/adoption/kfd.js:896` |
793
- | `buildchainPublicationAuthorityDescriptors` | function: function buildchainPublicationAuthorityDescriptors({ root = process.cwd() } = {}) | { root = process.cwd() } = {} | unknown | May throw an Error on rejected input or failed operations; follow the linked source contract. | none-detected-by-static-source-scan | `import { buildchainPublicationAuthorityDescriptors } from "@kungfu-tech/buildchain/core";` | `packages/core/governance/buildchain-publication-authority.js:65` |
793
+ | `buildchainPublicationAuthorityDescriptors` | function: function buildchainPublicationAuthorityDescriptors({ root = process.cwd() } = {}) | { root = process.cwd() } = {} | unknown | May throw an Error on rejected input or failed operations; follow the linked source contract. | none-detected-by-static-source-scan | `import { buildchainPublicationAuthorityDescriptors } from "@kungfu-tech/buildchain/core";` | `packages/core/governance/buildchain-publication-authority.js:70` |
794
794
  | `buildConsumerIssueReport` | function: function buildConsumerIssueReport(options = {}) | options = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { buildConsumerIssueReport } from "@kungfu-tech/buildchain/core";` | `packages/core/governance/issue-reporting.js:104` |
795
795
  | `buildFactsDigest` | function: function buildFactsDigest(value) | value | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | local-filesystem-write, subprocess | `import { buildFactsDigest } from "@kungfu-tech/buildchain/core";` | `packages/core/build/build-facts.js:44` |
796
796
  | `buildWorkflowFrictionIssueReport` | function: function buildWorkflowFrictionIssueReport(options = {}) | options = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { buildWorkflowFrictionIssueReport } from "@kungfu-tech/buildchain/core";` | `packages/core/governance/issue-reporting.js:199` |
@@ -862,7 +862,7 @@ Target: `./packages/core/index.js`. Public symbols: 625.
862
862
  | `createBuildchainKfdSurfaceRegistry` | function: function createBuildchainKfdSurfaceRegistry({ root = process.cwd() } = {}) | { root = process.cwd() } = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { createBuildchainKfdSurfaceRegistry } from "@kungfu-tech/buildchain/core";` | `packages/core/adoption/buildchain-kfd-claims.js:411` |
863
863
  | `createBuildchainLayoutDiscovery` | function: function createBuildchainLayoutDiscovery({ cwd = process.cwd(), buildchainVersion = "", } = {}) | { cwd = process.cwd(), buildchainVersion = "", } = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { createBuildchainLayoutDiscovery } from "@kungfu-tech/buildchain/core";` | `packages/core/contracts/buildchain-layout.js:99` |
864
864
  | `createBuildchainLogger` | function: function createBuildchainLogger(options = {}) | options = {} | unknown | May throw an Error on rejected input or failed operations; follow the linked source contract. | subprocess | `import { createBuildchainLogger } from "@kungfu-tech/buildchain/core";` | `packages/core/observability/logging.js:300` |
865
- | `createBuildchainPublicationAuthorityRegistry` | function: function createBuildchainPublicationAuthorityRegistry({ root = process.cwd() } = {}) | { root = process.cwd() } = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { createBuildchainPublicationAuthorityRegistry } from "@kungfu-tech/buildchain/core";` | `packages/core/governance/buildchain-publication-authority.js:104` |
865
+ | `createBuildchainPublicationAuthorityRegistry` | function: function createBuildchainPublicationAuthorityRegistry({ root = process.cwd() } = {}) | { root = process.cwd() } = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { createBuildchainPublicationAuthorityRegistry } from "@kungfu-tech/buildchain/core";` | `packages/core/governance/buildchain-publication-authority.js:109` |
866
866
  | `createBuildchainPublicClaimDefinitions` | function: function createBuildchainPublicClaimDefinitions() | none | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { createBuildchainPublicClaimDefinitions } from "@kungfu-tech/buildchain/core";` | `packages/core/adoption/buildchain-kfd-claims.js:226` |
867
867
  | `createCacheEvidenceSet` | function: function createCacheEvidenceSet({ repository, sourceCommit, sourceTree = "", runtimeCommit = "", platform, operations = [], } = {}) | { repository, sourceCommit, sourceTree = "", runtimeCommit = "", platform, operations = [], } = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { createCacheEvidenceSet } from "@kungfu-tech/buildchain/core";` | `packages/core/observability/cache-evidence.js:244` |
868
868
  | `createCacheOperationReceipt` | function: function createCacheOperationReceipt({ operationId, operation, provider, producer, platform, cacheKey, cacheRoot, outcome, bindings = {}, metrics, evidence, } = {}) | { operationId, operation, provider, producer, platform, cacheKey, cacheRoot, outcome, bindings = {}, metrics, evidence, } = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { createCacheOperationReceipt } from "@kungfu-tech/buildchain/core";` | `packages/core/observability/cache-evidence.js:169` |
@@ -966,7 +966,7 @@ Target: `./packages/core/index.js`. Public symbols: 625.
966
966
  | `evaluateGithubGovernanceSnapshot` | function: function evaluateGithubGovernanceSnapshot({ descriptor = createBuildchainGithubGovernanceAuthority(), repository, targetRef, organizationPlan, codeowners, effectivePolicy, memberships, apiEvidence = {}, observedAt, expiresAt, verifier = {}, } = {}) | { descriptor = createBuildchainGithubGovernanceAuthority(), repository, targetRef, organizationPlan, codeowners, effectivePolicy, memberships, apiEvidence = {}, observedAt, expiresAt, verifier = {}, } = {} | unknown | May throw an Error on rejected input or failed operations; follow the linked source contract. | none-detected-by-static-source-scan | `import { evaluateGithubGovernanceSnapshot } from "@kungfu-tech/buildchain/core";` | `packages/core/governance/github-governance-authority.js:695` |
967
967
  | `evaluateKfdProductGate` | function: async function evaluateKfdProductGate({ cwd = process.cwd(), input, expectedSourceSha = "", checkedAt = new Date().toISOString(), } = {}) | { cwd = process.cwd(), input, expectedSourceSha = "", checkedAt = new Date().toISOString(), } = {} | Promise<unknown> | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { evaluateKfdProductGate } from "@kungfu-tech/buildchain/core";` | `packages/core/adoption/kfd-product-gates.js:419` |
968
968
  | `evaluatePublicationControlPlaneSnapshot` | function: function evaluatePublicationControlPlaneSnapshot({ repository, workflowPath, publisherWorkflowPath = workflowPath, environment, branch, packageName, publisherMode = "npm-trusted-publisher", requiredStatusCheck = "check", snapshot, observedAt, expiresAt, } = {}) | { repository, workflowPath, publisherWorkflowPath = workflowPath, environment, branch, packageName, publisherMode = "npm-trusted-publisher", requiredStatusCheck = "check", snapshot, observedAt, expiresAt, } = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { evaluatePublicationControlPlaneSnapshot } from "@kungfu-tech/buildchain/core";` | `packages/core/publication/publication-control-plane-audit.js:245` |
969
- | `executePaperNpmBootstrap` | function: function executePaperNpmBootstrap(options = {}) | options = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | may-write-or-invoke-external-actions | `import { executePaperNpmBootstrap } from "@kungfu-tech/buildchain/core";` | `packages/core/paper/operations/bootstrap.js:47` |
969
+ | `executePaperNpmBootstrap` | function: function executePaperNpmBootstrap(options = {}) | options = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | may-write-or-invoke-external-actions | `import { executePaperNpmBootstrap } from "@kungfu-tech/buildchain/core";` | `packages/core/paper/operations/bootstrap.js:48` |
970
970
  | `executePaperWorkStart` | function: function executePaperWorkStart(plan) | plan | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | may-write-or-invoke-external-actions | `import { executePaperWorkStart } from "@kungfu-tech/buildchain/core";` | `packages/core/paper/paper-work.js:169` |
971
971
  | `executePaperWorkSubmitPush` | function: function executePaperWorkSubmitPush(plan) | plan | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | may-write-or-invoke-external-actions | `import { executePaperWorkSubmitPush } from "@kungfu-tech/buildchain/core";` | `packages/core/paper/paper-work.js:357` |
972
972
  | `executeReleasePropagationPush` | function: function executeReleasePropagationPush({ work, expectedWorkRoot, cwd = process.cwd(), remote = "origin", } = {}) | { work, expectedWorkRoot, cwd = process.cwd(), remote = "origin", } = {} | unknown | May throw an Error on rejected input or failed operations; follow the linked source contract. | may-write-or-invoke-external-actions | `import { executeReleasePropagationPush } from "@kungfu-tech/buildchain/core";` | `packages/core/release/release-propagation-push.js:231` |
@@ -1133,7 +1133,7 @@ Target: `./packages/core/index.js`. Public symbols: 625.
1133
1133
  | `PUBLICATION_NPM_PACKAGE_CONTRACT` | constant: const PUBLICATION_NPM_PACKAGE_CONTRACT | none | value | Import does not declare a throw contract. | none-on-import | `import { PUBLICATION_NPM_PACKAGE_CONTRACT } from "@kungfu-tech/buildchain/core";` | `packages/core/publication/publication-package.js:6` |
1134
1134
  | `PUBLICATION_QUALIFICATION_RECEIPT_CONTRACT` | constant: const PUBLICATION_QUALIFICATION_RECEIPT_CONTRACT | none | value | Import does not declare a throw contract. | none-on-import | `import { PUBLICATION_QUALIFICATION_RECEIPT_CONTRACT } from "@kungfu-tech/buildchain/core";` | `packages/core/publication/publication-authority.js:22` |
1135
1135
  | `PUBLICATION_QUALIFICATION_SCHEMA` | constant: const PUBLICATION_QUALIFICATION_SCHEMA | none | value | Import does not declare a throw contract. | none-on-import | `import { PUBLICATION_QUALIFICATION_SCHEMA } from "@kungfu-tech/buildchain/core";` | `packages/core/publication/publication-qualification.js:3` |
1136
- | `PUBLICATION_REPRODUCIBILITY_RECEIPT_CONTRACT` | constant: const PUBLICATION_REPRODUCIBILITY_RECEIPT_CONTRACT | none | value | Import does not declare a throw contract. | none-on-import | `import { PUBLICATION_REPRODUCIBILITY_RECEIPT_CONTRACT } from "@kungfu-tech/buildchain/core";` | `packages/core/publication/publication-reproducibility.js:11` |
1136
+ | `PUBLICATION_REPRODUCIBILITY_RECEIPT_CONTRACT` | constant: const PUBLICATION_REPRODUCIBILITY_RECEIPT_CONTRACT | none | value | Import does not declare a throw contract. | none-on-import | `import { PUBLICATION_REPRODUCIBILITY_RECEIPT_CONTRACT } from "@kungfu-tech/buildchain/core";` | `packages/core/publication/publication-reproducibility.js:12` |
1137
1137
  | `PUBLICATION_SEALED_BUNDLE_CONTRACT` | constant: const PUBLICATION_SEALED_BUNDLE_CONTRACT | none | value | Import does not declare a throw contract. | none-on-import | `import { PUBLICATION_SEALED_BUNDLE_CONTRACT } from "@kungfu-tech/buildchain/core";` | `packages/core/publication/publication-sealed-bundle.js:11` |
1138
1138
  | `publicationArtifactCandidateDigest` | function: function publicationArtifactCandidateDigest(value) | value | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { publicationArtifactCandidateDigest } from "@kungfu-tech/buildchain/core";` | `packages/core/publication/publication-artifact-candidate.js:19` |
1139
1139
  | `publicationAuthorityDigest` | function: function publicationAuthorityDigest(value) | value | unknown | May throw an Error on rejected input or failed operations; follow the linked source contract. | none-detected-by-static-source-scan | `import { publicationAuthorityDigest } from "@kungfu-tech/buildchain/core";` | `packages/core/publication/publication-authority.js:72` |
@@ -2133,7 +2133,7 @@ Target: `./packages/core/publication/publication-reproducibility.js`. Public sym
2133
2133
 
2134
2134
  | Symbol | Kind and signature | Parameters | Return | Errors | Side effects | Example | Source |
2135
2135
  | --- | --- | --- | --- | --- | --- | --- | --- |
2136
- | `PUBLICATION_REPRODUCIBILITY_RECEIPT_CONTRACT` | constant: const PUBLICATION_REPRODUCIBILITY_RECEIPT_CONTRACT | none | value | Import does not declare a throw contract. | none-on-import | `import { PUBLICATION_REPRODUCIBILITY_RECEIPT_CONTRACT } from "@kungfu-tech/buildchain/publication-reproducibility";` | `packages/core/publication/publication-reproducibility.js:11` |
2136
+ | `PUBLICATION_REPRODUCIBILITY_RECEIPT_CONTRACT` | constant: const PUBLICATION_REPRODUCIBILITY_RECEIPT_CONTRACT | none | value | Import does not declare a throw contract. | none-on-import | `import { PUBLICATION_REPRODUCIBILITY_RECEIPT_CONTRACT } from "@kungfu-tech/buildchain/publication-reproducibility";` | `packages/core/publication/publication-reproducibility.js:12` |
2137
2137
  | `verifyPublicationReproducibility` | function: function verifyPublicationReproducibility({ cwd = process.cwd(), sourceSha = "", output = DEFAULT_OUTPUT, promote = false, keepWorkspaces = false, pullToolchain = true, packageName = "", allowUnpinnedToolchain = false, toolchain: selectedToolchain, overlayPaths = [DEFAULT_REGISTRY_INPUT_DIR, DEFAULT_REGISTRY_HYDRATION], } = {}) | { cwd = process.cwd(), sourceSha = "", output = DEFAULT_OUTPUT, promote = false, keepWorkspaces = false, pullToolchain = true, packageName = "", allowUnpinnedToolchain = false, toolchain: selectedToolchain, overlayPaths = [DEFAULT_REGISTRY_INPUT_DIR, DEFAULT_REGISTRY_HYDRATION], } = {} | unknown | May throw an Error on rejected input or failed operations; follow the linked source contract. | local-filesystem-write | `import { verifyPublicationReproducibility } from "@kungfu-tech/buildchain/publication-reproducibility";` | `packages/core/publication/publication-reproducibility.js:868` |
2138
2138
 
2139
2139
  ## `@kungfu-tech/buildchain/publication-sealed-bundle`
@@ -2204,8 +2204,8 @@ Target: `./packages/core/governance/buildchain-publication-authority.js`. Public
2204
2204
 
2205
2205
  | Symbol | Kind and signature | Parameters | Return | Errors | Side effects | Example | Source |
2206
2206
  | --- | --- | --- | --- | --- | --- | --- | --- |
2207
- | `buildchainPublicationAuthorityDescriptors` | function: function buildchainPublicationAuthorityDescriptors({ root = process.cwd() } = {}) | { root = process.cwd() } = {} | unknown | May throw an Error on rejected input or failed operations; follow the linked source contract. | none-detected-by-static-source-scan | `import { buildchainPublicationAuthorityDescriptors } from "@kungfu-tech/buildchain/buildchain-publication-authority";` | `packages/core/governance/buildchain-publication-authority.js:65` |
2208
- | `createBuildchainPublicationAuthorityRegistry` | function: function createBuildchainPublicationAuthorityRegistry({ root = process.cwd() } = {}) | { root = process.cwd() } = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { createBuildchainPublicationAuthorityRegistry } from "@kungfu-tech/buildchain/buildchain-publication-authority";` | `packages/core/governance/buildchain-publication-authority.js:104` |
2207
+ | `buildchainPublicationAuthorityDescriptors` | function: function buildchainPublicationAuthorityDescriptors({ root = process.cwd() } = {}) | { root = process.cwd() } = {} | unknown | May throw an Error on rejected input or failed operations; follow the linked source contract. | none-detected-by-static-source-scan | `import { buildchainPublicationAuthorityDescriptors } from "@kungfu-tech/buildchain/buildchain-publication-authority";` | `packages/core/governance/buildchain-publication-authority.js:70` |
2208
+ | `createBuildchainPublicationAuthorityRegistry` | function: function createBuildchainPublicationAuthorityRegistry({ root = process.cwd() } = {}) | { root = process.cwd() } = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { createBuildchainPublicationAuthorityRegistry } from "@kungfu-tech/buildchain/buildchain-publication-authority";` | `packages/core/governance/buildchain-publication-authority.js:109` |
2209
2209
 
2210
2210
  ## `@kungfu-tech/buildchain/github-governance-authority`
2211
2211
 
@@ -8,12 +8,12 @@ confidence: high
8
8
  sensitivity: public
9
9
  evidence_grade: B
10
10
  review_state: unreviewed
11
- last_reviewed: 2026-09-11
11
+ last_reviewed: 2026-09-13
12
12
  ai_provenance:
13
13
  model_family: GPT-6
14
14
  product: Codex
15
- generated_at: 2026-09-11
16
- visible_context: Explicit user-approved runtime selection, recovery and alpha publication requirements.
15
+ generated_at: 2026-09-13
16
+ visible_context: Source-bound attempt recovery implementation, published entry contract and local failure-path tests.
17
17
  invisible_context_boundary: This contract does not claim implementation or hosted qualification is complete.
18
18
  ---
19
19
 
@@ -40,7 +40,9 @@ Switching runtimes does not automatically qualify all previous results for reuse
40
40
  Neither the persisted caller nor its contract lock needs a train rewrite.
41
41
 
42
42
  An entry failure is repaired by publishing and adopting a corrected entry and
43
- starting a complete run. Recovering an invalid entry is not a runtime feature.
43
+ starting a new provider run through the corrected floating entry. The caller files
44
+ remain unchanged. A usable recovery entry can still recover the exact existing
45
+ attempt; an entry failure before admission has no attempt to recover.
44
46
  Buildchain self-dogfood uses exactly the same consumer contract and has no
45
47
  repository-specific execution or recovery route.
46
48
 
@@ -54,7 +56,45 @@ single preparation ownership, different entry/runtime execution, train recovery,
54
56
  platform and multi-job qualification, and validation of the published consumer
55
57
  entry. A source test or a successful package import alone is insufficient.
56
58
 
57
- ## Consumer build and recovery
59
+ ## Minimal pipeline recovery
60
+
61
+ The minimal contract has one normal event caller and one manual recovery caller,
62
+ plus `.buildchain/buildchain.toml`. Both callers are maintained by Buildchain's
63
+ consumer setup; product differences do not require additional recovery workflows.
64
+ The repository implementation alone does not prove the entry has been published
65
+ or qualified in a clean consumer.
66
+
67
+ The workflow summary identifies the current attempt, its source PR, completed
68
+ steps and remaining work. Follow **Recover this attempt**, choose **Run workflow**,
69
+ and paste the exact attempt. Leave `runtime-ref` empty for an ordinary retry;
70
+ supply a repaired runtime only when needed. The public recovery entry accepts no
71
+ other recovery selectors. It derives configuration, producer runs, artifacts and
72
+ transaction coordinates from the canonical attempt history.
73
+
74
+ Recovery opens a new attempt with an explicit predecessor. Successful platform
75
+ jobs and their actual retained artifacts are independently requalified; only
76
+ missing platforms or explicitly incompatible stage implementations are rebuilt.
77
+ A signing failure can requalify the original sealed bytes under the repaired
78
+ publisher. Partial publication preserves its original signed transaction and
79
+ completed effects, reads providers again, and authorizes only remaining effects.
80
+ Missing, expired or conflicting evidence stops with a diagnosis; it does not
81
+ silently trigger a complete rebuild or replace published bytes.
82
+
83
+ A repeated request for the same predecessor and repair selects the same successor.
84
+ If that recovery was interrupted, select the successor shown in the summary for
85
+ the next recovery. An active predecessor must first finish or be cancelled using
86
+ its ordinary GitHub execution link. A changed or superseded source cannot reuse
87
+ an old attempt as authority for the current PR. Completed publication remains
88
+ recorded even when distribution or the next development version still needs work.
89
+ Cancellation stops remaining work and cannot undo published results.
90
+
91
+ Once admitted, ordinary wake events continue with the recovered attempt's exact
92
+ runtime, even when the consumer lock still names the original runtime. A further
93
+ runtime change requires another explicit recovery. An entry repair is distributed
94
+ through the existing `@v4` or `@v4-alpha` entry; consumers do not maintain backup
95
+ scripts, patch a job definition, or add a different recovery workflow family.
96
+
97
+ ## Advanced build component recovery
58
98
 
59
99
  ```yaml
60
100
  on:
@@ -47,6 +47,8 @@ Register ownership before adding a workflow. `pnpm run check:workflows` validate
47
47
  | [public-ops-patrol-monthly.yml](../.github/workflows/public-ops-patrol-monthly.yml) | ops | reusable | active | Buildchain Patrol Monthly |
48
48
  | [public-ops-patrol-weekly.yml](../.github/workflows/public-ops-patrol-weekly.yml) | ops | reusable | active | Buildchain Patrol Weekly |
49
49
  | [public-ops-patrol.yml](../.github/workflows/public-ops-patrol.yml) | ops | reusable | active | Buildchain Patrol |
50
+ | [public-ops-pipeline.yml](../.github/workflows/public-ops-pipeline.yml) | ops | reusable | active | Buildchain pipeline |
51
+ | [public-ops-recover.yml](../.github/workflows/public-ops-recover.yml) | ops | reusable | active | Buildchain recovery |
50
52
  | [public-ops-release-governance.yml](../.github/workflows/public-ops-release-governance.yml) | ops | reusable | active | Release Governance Reconcile |
51
53
  | [public-ops-stable-candidate-patrol.yml](../.github/workflows/public-ops-stable-candidate-patrol.yml) | ops | reusable | active | Buildchain Stable Candidate Patrol |
52
54
  | [public-ops-tail-reseal.yml](../.github/workflows/public-ops-tail-reseal.yml) | ops | reusable | active | V4 Retained Candidate Tail Reseal |
@@ -69,8 +71,11 @@ Register ownership before adding a workflow. `pnpm run check:workflows` validate
69
71
  | [.build-gate-profile.yml](../.github/workflows/.build-gate-profile.yml) | build | reusable | active | Buildchain Shifu Gate Profile |
70
72
  | [.build.yml](../.github/workflows/.build.yml) | build | reusable | active | Buildchain Build |
71
73
  | [.ops-git-sync.yml](../.github/workflows/.ops-git-sync.yml) | ops | reusable | active | sync remote git |
74
+ | [.ops-pipeline-delivery.yml](../.github/workflows/.ops-pipeline-delivery.yml) | ops | reusable | active | Internal pipeline delivery |
75
+ | [.ops-pipeline-execute.yml](../.github/workflows/.ops-pipeline-execute.yml) | ops | reusable | active | Internal pipeline execution |
72
76
  | [.release-authority.yml](../.github/workflows/.release-authority.yml) | release | reusable | active | Buildchain Sealed Publication Authority |
73
77
  | [.release-binary-assets.yml](../.github/workflows/.release-binary-assets.yml) | release | reusable | active | Buildchain Binary Release Assets |
78
+ | [.release-pipeline-products.yml](../.github/workflows/.release-pipeline-products.yml) | release | reusable | active | Internal pipeline product publication |
74
79
  | [.release-promote.yml](../.github/workflows/.release-promote.yml) | release | reusable | active | Release Candidate Promote Advanced |
75
80
 
76
81
  ## self
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kungfu-tech/buildchain",
3
- "version": "4.1.3-alpha.1",
3
+ "version": "4.1.3-alpha.2",
4
4
  "private": false,
5
5
  "description": "Buildchain Release Passport, release governance, CLI toolkit, and site facts.",
6
6
  "repository": "https://github.com/kungfu-systems/buildchain",
@@ -157,7 +157,7 @@
157
157
  "scripts": {
158
158
  "precheck:static": "prettier --check architecture/decisions/0003-two-phase-delivery-warrant.md architecture/delivery-authority-parity.json contracts/dev-delivery-authority-v2.schema.json dist/site/schemas/dev-delivery-authority-v2.schema.json docs/dev-delivery-qualification-landing-adr.md packages/core/dev-delivery/dev-delivery-authority-candidate.js packages/core/dev-delivery/dev-delivery-authority-evidence.js packages/core/dev-delivery/dev-delivery-authority-landing.js packages/core/dev-delivery/dev-delivery-authority-observation.js packages/core/dev-delivery/dev-delivery-authority-qualification.js packages/core/dev-delivery/dev-delivery-authority-settlement.js packages/core/dev-delivery/dev-delivery-authority-state.js packages/core/dev-delivery/dev-delivery-execution-failure.js packages/core/dev-delivery/dev-delivery-execution-transfer.js packages/core/dev-delivery/dev-delivery-landing-readback.js packages/core/dev-delivery/dev-delivery-landing-terminal-evidence.js packages/core/dev-delivery/dev-delivery-landing-testing-port.js packages/core/dev-delivery/dev-delivery-native-execution.js packages/core/dev-delivery/dev-delivery-native-proof.js packages/core/dev-delivery/dev-delivery-process-boundary.js packages/core/dev-delivery/dev-delivery-warrant-qualification.js packages/core/dev-delivery/dev-delivery-warrant-state.js packages/core/dev-delivery/commands/dev-delivery-authority-command-adapters.mjs packages/core/dev-delivery/commands/dev-delivery-authority-provider.mjs packages/core/dev-delivery/commands/dev-delivery-authority.mjs packages/core/dev-delivery/native/execution.js packages/core/dev-delivery/commands/dev-delivery-process-boundary.mjs packages/core/dev-delivery/native/transactions.js packages/core/dev-delivery/commands/dev-delivery-two-phase.mjs packages/core/dev-delivery/commands/dev-delivery-warrant-options.mjs packages/core/dev-delivery/warrant/persistence.js templates/native-dev-delivery.yml",
159
159
  "operator:windows-jit": "bash packages/core/providers/commands/aws-windows-jit-operator.sh",
160
- "check": "pnpm run check:discussion-reader && pnpm run check:layout && node scripts/check-runtime-entry.mjs && pnpm run check:implementation-naming && pnpm run check:static && node scripts/check-ci-lane-change-budget.mjs && node scripts/check-public-dogfood-contract.mjs && node scripts/check-floating-consumer-policy-contract.mjs && node scripts/check-release-topology.mjs && node scripts/check-universal-workflow-bootstrap.mjs && pnpm run check:bridge && pnpm run check:contracts:rust && pnpm run check:wasm && node scripts/check-maintainability.mjs && node scripts/check-internal-architecture.mjs && node scripts/generate-agent-change-map.mjs && node scripts/check-inventory.mjs && node scripts/check-core-mechanism-inventory.mjs && node scripts/check-runtime-semantic-closure.mjs && node scripts/check-capability-parity-inventory.mjs && node scripts/check-release-tail-contract.mjs && node scripts/publication-rehearsal-fixture.mjs --check && node packages/core/governance/commands/architecture.mjs validate && node scripts/warrant-shadow-plan.mjs validate && pnpm run check:site && pnpm run check:workflows && pnpm run test:unit && pnpm run check:golden-path && node scripts/check-action-bundles.mjs",
160
+ "check": "pnpm run check:consumer-contract && pnpm run check:discussion-reader && pnpm run check:layout && node scripts/check-runtime-entry.mjs && pnpm run check:implementation-naming && pnpm run check:static && node scripts/check-ci-lane-change-budget.mjs && node scripts/check-public-dogfood-contract.mjs && node scripts/check-floating-consumer-policy-contract.mjs && node scripts/check-release-topology.mjs && node scripts/check-universal-workflow-bootstrap.mjs && pnpm run check:bridge && pnpm run check:contracts:rust && pnpm run check:wasm && node scripts/check-maintainability.mjs && node scripts/check-internal-architecture.mjs && node scripts/generate-agent-change-map.mjs && node scripts/check-inventory.mjs && node scripts/check-core-mechanism-inventory.mjs && node scripts/check-runtime-semantic-closure.mjs && node scripts/check-capability-parity-inventory.mjs && node scripts/check-release-tail-contract.mjs && node scripts/publication-rehearsal-fixture.mjs --check && node packages/core/governance/commands/architecture.mjs validate && node scripts/warrant-shadow-plan.mjs validate && pnpm run check:site && pnpm run check:workflows && pnpm run test:unit && pnpm run check:golden-path && node scripts/check-action-bundles.mjs",
161
161
  "check:static": "node scripts/check-javascript-syntax.mjs && node scripts/check-source-bindings.mjs && prettier --check architecture/*.json contracts/release-tail-provider-bindings-v1.schema.json contracts/v4-canonical-contracts-v1.schema.json contracts/v4-compatibility-facts-v1.schema.json contracts/v4-delivery-warrant-semantic-diff-report-v1.schema.json contracts/v4-delivery-warrant-trace-v1.schema.json contracts/v4-floating-consumer-policy-receipt-v1.schema.json contracts/runtime-resume-lineage-v2.schema.json contracts/v4-tail-reseal-v1.schema.json contracts/v4-host-contract-v1.schema.json contracts/v4-provider-operation-journal-v1.schema.json contracts/v4-release-activation-shadow-v1.schema.json contracts/v4-stable-publication-fence-v1.schema.json contracts/v4-partial-mutation-recovery-v1.schema.json contracts/v4-stage-capsule-v1.schema.json contracts/v4-stage-capsule-store-v1.schema.json contracts/v4-stage-capsule-resume-v1.schema.json contracts/release-tail-capabilities-v1.schema.json contracts/fixtures/release-tail-capabilities-v1/*.json contracts/fixtures/v4-delivery-warrant-trace-v1/*.json contracts/fixtures/v4-floating-consumer-policy-v1/*.json contracts/fixtures/runtime-resume-lineage-v2/*.json contracts/fixtures/v4-tail-reseal-v1/*.json contracts/fixtures/v4-compatibility-facts-v1/*.json contracts/fixtures/v4-provider-operation-journal-v1/*.json contracts/fixtures/v4-provider-readback-idempotency-v1/*.json contracts/fixtures/v4-release-activation-shadow-v1/*.json contracts/fixtures/v4-stable-publication-fence-v1/*.json contracts/fixtures/v4-partial-mutation-recovery-v1/*.json contracts/fixtures/v4-stage-capsule-v1/*.json contracts/fixtures/v4-stage-capsule-store-v1/*.json contracts/fixtures/v4-stage-capsule-resume-v1/*.json packages/core/contracts/command-registry.mjs packages/core/governance/cli/compatibility-facts.mjs packages/core/contracts/canonical-contracts.js packages/core/contracts/kungfu-temporal-fact.js packages/core/governance/buildchain-compatibility-fact.js packages/core/governance/buildchain-compatibility-authority.js packages/core/governance/buildchain-compatibility-proof.js packages/core/consumer/floating-consumer-evidence.js packages/core/consumer/floating-consumer-policy.js packages/core/consumer/floating-consumer-release-passport.js packages/core/release/recovery/lineage.js packages/core/release/tail-reseal-contract.js packages/core/release/tail-reseal-github.js packages/core/release/tail-reseal-receipt.js packages/core/release/tail-reseal.js packages/core/consumer/runtime-selector-persistence.js packages/core/release/provider-operation-journal.js packages/core/release/provider-readback-idempotency.js packages/core/release/release-activation-shadow.js packages/core/release/stable-publication-fence.js packages/core/release/partial-mutation-recovery-qualification.js packages/core/build/stage-capsule.js packages/core/build/stage-capsule-store.js packages/core/build/stage-capsule-local-store.js packages/core/build/platform-stage-checkpoints.js packages/core/build/stage-capsule-resume-planner.js packages/core/build/stage-capsule-qualification.js packages/core/build/stage-capsule-qualification-campaign.js packages/core/dev-delivery/delivery-warrant-fixture-runner.js packages/core/dev-delivery/delivery-warrant-read-candidate.js packages/core/dev-delivery/delivery-warrant-semantic-diff-gate.js packages/core/dev-delivery/delivery-warrant-shadow-adapter.js scripts/check-core-mechanism-inventory.mjs scripts/check-runtime-semantic-closure.mjs scripts/check-release-tail-contract.mjs scripts/check-javascript-syntax.mjs scripts/check-maintainability.mjs packages/core/dev-delivery/commands/dev-pr-prequeue-guard.mjs scripts/check-public-dogfood-contract.mjs scripts/maintainability-metrics.mjs scripts/maintainability-domain-metrics.mjs scripts/maintainability-governance.mjs scripts/generate-agent-change-map.mjs scripts/public-reference.mjs scripts/site-reference-registry.mjs scripts/generate-public-reference.mjs packages/core/governance/commands/architecture.mjs packages/core/runtime/commands/bridge-bootstrap.mjs scripts/bridge-evidence.mjs packages/core/consumer/commands/consumer-policy.mjs packages/core/runtime/commands/host-adapter.mjs scripts/platform-stage-checkpoint-rehearsal.mjs scripts/stage-capsule-resume-rehearsal.mjs packages/core/build/commands/stage-capsule-qualification.mjs scripts/tail-reseal-macos-rehearsal.mjs packages/core/release/commands/tail-reseal.mjs scripts/warrant-shadow-plan.mjs scripts/verify-golden-path.mjs tests/runtime-entry-provider.test.mjs tests/command-registry.test.mjs tests/core-mechanism-inventory.test.mjs tests/release-tail-contract.test.mjs tests/maintainability.test.mjs tests/maintainability-governance.test.mjs tests/promotion-responsibilities.test.mjs tests/public-reference.test.mjs tests/architecture.test.mjs tests/bridge.test.mjs tests/canonical-contracts.test.mjs tests/delivery-warrant-fixture-runner.test.mjs tests/delivery-warrant-read-candidate.test.mjs tests/floating-consumer-policy.test.mjs tests/runtime-resume-lineage.test.mjs tests/runtime-semantic-closure.test.mjs tests/tail-reseal.test.mjs tests/tail-reseal-parity.test.mjs tests/compatibility-facts.test.mjs tests/platform-stage-checkpoints.test.mjs tests/provider-operation-journal.test.mjs tests/provider-readback-idempotency.test.mjs tests/public-dogfood-contract.test.mjs tests/release-activation-shadow.test.mjs tests/stable-publication-fence.test.mjs tests/partial-mutation-recovery-qualification.test.mjs tests/stage-capsule.test.mjs tests/stage-capsule-store.test.mjs tests/stage-capsule-resume-planner.test.mjs tests/stage-capsule-qualification.test.mjs tests/warrant-shadow-plan.test.mjs",
162
162
  "check:bridge": "cargo fmt --manifest-path crates/buildchain-host-bridge/Cargo.toml -- --check && cargo clippy --locked --manifest-path crates/buildchain-host-bridge/Cargo.toml -- -D warnings && cargo test --locked --manifest-path crates/buildchain-host-bridge/Cargo.toml",
163
163
  "check:contracts": "pnpm run check:contracts:rust && node --test tests/canonical-contracts.test.mjs tests/delivery-warrant-fixture-runner.test.mjs tests/delivery-warrant-read-candidate.test.mjs tests/domain-wasm.test.mjs tests/floating-consumer-policy-contract.test.mjs tests/floating-consumer-policy.test.mjs tests/runtime-resume-lineage.test.mjs tests/tail-reseal.test.mjs tests/tail-reseal-parity.test.mjs tests/compatibility-facts.test.mjs tests/publication-rehearsal.test.mjs tests/platform-stage-checkpoints.test.mjs tests/provider-operation-journal.test.mjs tests/provider-readback-idempotency.test.mjs tests/public-dogfood-contract.test.mjs tests/release-activation-shadow.test.mjs tests/stable-publication-fence.test.mjs tests/partial-mutation-recovery-qualification.test.mjs tests/stage-capsule.test.mjs tests/stage-capsule-store.test.mjs tests/stage-capsule-resume-planner.test.mjs tests/stage-capsule-qualification.test.mjs",
@@ -184,7 +184,8 @@
184
184
  "check:implementation-naming": "node scripts/check-implementation-naming.mjs",
185
185
  "check:layout": "node scripts/check-code-layout.mjs",
186
186
  "build:discussion-reader": "node scripts/build-release-discussion-reader.mjs",
187
- "check:discussion-reader": "node scripts/build-release-discussion-reader.mjs --check"
187
+ "check:discussion-reader": "node scripts/build-release-discussion-reader.mjs --check",
188
+ "check:consumer-contract": "node scripts/generate-minimal-consumer-contract.mjs --check"
188
189
  },
189
190
  "devDependencies": {
190
191
  "@actions/expressions": "0.3.61",
@@ -0,0 +1,85 @@
1
+ import { choice, object, relativePath, text } from "./shape.js";
2
+ import { CONFIG_PATH } from "./plan.js";
3
+
4
+ export const PIPELINE_ENTRY = ".github/workflows/public-ops-pipeline.yml";
5
+ export const RECOVERY_ENTRY = ".github/workflows/public-ops-recover.yml";
6
+ export const PIPELINE_EVENTS = {
7
+ pull_request: [
8
+ "opened",
9
+ "reopened",
10
+ "synchronize",
11
+ "ready_for_review",
12
+ "converted_to_draft",
13
+ "closed",
14
+ "labeled",
15
+ "unlabeled",
16
+ "edited",
17
+ "enqueued",
18
+ "dequeued",
19
+ ],
20
+ pull_request_review: ["submitted", "dismissed"],
21
+ pull_request_target: ["closed"],
22
+ merge_group: ["checks_requested"],
23
+ push: [],
24
+ repository_dispatch: ["buildchain-attempt-wake"],
25
+ };
26
+
27
+ export function normalInputs(value = {}) {
28
+ object(value, [], ["config-path"], "inputs");
29
+ const configPath = relativePath(
30
+ value["config-path"] ?? CONFIG_PATH,
31
+ "inputs.config-path",
32
+ );
33
+ if (!configPath.endsWith(".toml") || configPath.includes("*"))
34
+ throw new Error("inputs.config-path: expected one TOML path");
35
+ return { configPath };
36
+ }
37
+
38
+ export function recoveryInputs(value) {
39
+ object(value, ["attempt"], ["runtime-ref"], "inputs");
40
+ text(value.attempt, "inputs.attempt", /^attempt-[0-9a-f]{64}$/u);
41
+ const runtimeRef = value["runtime-ref"] ?? "";
42
+ if (runtimeRef !== "")
43
+ text(
44
+ runtimeRef,
45
+ "inputs.runtime-ref",
46
+ /^(?:[0-9a-f]{40}|v4(?:-alpha)?|train\/v4\/v4\.[0-9]+\/[a-z0-9][a-z0-9-]*)$/u,
47
+ );
48
+ return { attempt: value.attempt, runtimeRef };
49
+ }
50
+
51
+ export function admitEvent(name, action = "") {
52
+ choice(name, Object.keys(PIPELINE_EVENTS), "event.name");
53
+ choice(
54
+ action,
55
+ PIPELINE_EVENTS[name].length ? PIPELINE_EVENTS[name] : [""],
56
+ "event.action",
57
+ );
58
+ return { name, action };
59
+ }
60
+
61
+ function call(entry, channel, extra = "") {
62
+ return `permissions:\n contents: read\njobs:\n buildchain:\n uses: kungfu-systems/buildchain/${entry}@${channel}\n${extra} secrets: inherit\n permissions:\n actions: write\n attestations: write\n checks: write\n contents: write\n discussions: write\n id-token: write\n pull-requests: write\n statuses: write\n`;
63
+ }
64
+
65
+ // Product-independent source of the two caller bytes. Public entry publication
66
+ // is qualified separately; rendering this contract is not an execution receipt.
67
+ export function consumerWorkflows(channel = "v4", configPath = CONFIG_PATH) {
68
+ choice(channel, ["v4", "v4-alpha"], "entry.channel");
69
+ normalInputs({ "config-path": configPath });
70
+ const configInput =
71
+ configPath === CONFIG_PATH
72
+ ? ""
73
+ : ` with:\n config-path: ${configPath}\n`;
74
+ const events = Object.entries(PIPELINE_EVENTS)
75
+ .map(([name, types]) => {
76
+ return types.length
77
+ ? ` ${name}:\n types: [${types.join(", ")}]\n`
78
+ : ` ${name}:\n`;
79
+ })
80
+ .join("");
81
+ return {
82
+ ".github/workflows/buildchain.yml": `name: Buildchain pipeline\non:\n${events}${call(PIPELINE_ENTRY, channel, configInput)}`,
83
+ ".github/workflows/buildchain-recover.yml": `name: Buildchain recovery\non:\n workflow_dispatch:\n inputs:\n attempt:\n description: Exact Buildchain attempt to recover\n required: true\n type: string\n runtime-ref:\n description: Optional repaired runtime\n required: false\n type: string\n${call(RECOVERY_ENTRY, channel, " with:\n attempt: ${{ inputs.attempt }}\n runtime-ref: ${{ inputs.runtime-ref }}\n")}`,
84
+ };
85
+ }
@@ -0,0 +1,96 @@
1
+ import { choice } from "./shape.js";
2
+ import { consumerWorkflows } from "./entries.js";
3
+ import { CONFIG_PATH } from "./plan.js";
4
+ import { PRODUCT_TYPES } from "./products.js";
5
+
6
+ const ARTIFACTS = {
7
+ npm: { path: "dist/package", kind: "npm-package", provider: "npm" },
8
+ binary: {
9
+ path: "dist/hello.tar.gz",
10
+ kind: "archive",
11
+ provider: "github-release",
12
+ },
13
+ paper: { path: "dist/paper.pdf", kind: "pdf", provider: "github-release" },
14
+ };
15
+
16
+ function productSource(type) {
17
+ const prefix =
18
+ 'import fs from "node:fs";\nfs.mkdirSync("dist", { recursive: true });\n';
19
+ if (type === "npm")
20
+ return `${prefix}fs.mkdirSync("dist/package", { recursive: true });\nfs.writeFileSync("dist/package/index.js", 'export const hello = "hello";\\n');\nfs.writeFileSync("dist/package/package.json", JSON.stringify({ name: "@example/minimal", version: JSON.parse(fs.readFileSync("package.json")).version, type: "module", exports: "./index.js" }));\n`;
21
+ if (type === "binary")
22
+ return `${prefix}import { execFileSync } from "node:child_process";\nexecFileSync("cc", ["src/hello.c", "-o", "dist/hello"], { stdio: "inherit" });\nexecFileSync("tar", ["-czf", "dist/hello.tar.gz", "-C", "dist", "hello"], { stdio: "inherit" });\n`;
23
+ return `${prefix}const stream = "BT /F1 24 Tf 50 700 Td (Minimal Paper) Tj ET";
24
+ const objects = ["<< /Type /Catalog /Pages 2 0 R >>", "<< /Type /Pages /Kids [3 0 R] /Count 1 >>", "<< /Type /Page /Parent 2 0 R /MediaBox [0 0 612 792] /Resources << /Font << /F1 4 0 R >> >> /Contents 5 0 R >>", "<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica >>", \`<< /Length \${stream.length} >>\\nstream\\n\${stream}\\nendstream\`];
25
+ let pdf = "%PDF-1.4\\n";
26
+ const offsets = [0];
27
+ for (const [index, object] of objects.entries()) { offsets.push(Buffer.byteLength(pdf)); pdf += \`\${index + 1} 0 obj\\n\${object}\\nendobj\\n\`; }
28
+ const xref = Buffer.byteLength(pdf);
29
+ pdf += \`xref\\n0 \${offsets.length}\\n0000000000 65535 f \\n\`;
30
+ for (const offset of offsets.slice(1)) pdf += \`\${String(offset).padStart(10, "0")} 00000 n \\n\`;
31
+ pdf += \`trailer\\n<< /Size \${offsets.length} /Root 1 0 R >>\\nstartxref\\n\${xref}\\n%%EOF\\n\`;
32
+ fs.writeFileSync("dist/paper.pdf", pdf);
33
+ `;
34
+ }
35
+
36
+ export function standardConsumerExample(type, channel = "v4") {
37
+ choice(type, PRODUCT_TYPES, "product.type");
38
+ const artifact = ARTIFACTS[type];
39
+ const npmAccess = type === "npm" ? 'access = "public"\n' : "";
40
+ const files = {
41
+ ...consumerWorkflows(channel),
42
+ "package.json": `${JSON.stringify({ name: `minimal-${type}`, private: true, version: "1.0.0-alpha.1", type: "module" }, null, 2)}\n`,
43
+ "src/build.mjs": productSource(type),
44
+ "src/verify.mjs": `import assert from "node:assert/strict";\nimport fs from "node:fs";\nassert.ok(fs.statSync(${JSON.stringify(artifact.path)}).${type === "npm" ? "isDirectory()" : "size > 0"});\n`,
45
+ [CONFIG_PATH]: `schema = 2
46
+
47
+ [[products]]
48
+ id = "main"
49
+ type = "${type}"
50
+ platforms = ["linux-x64"]
51
+ build = ["node src/build.mjs"]
52
+ verify = ["node src/verify.mjs"]
53
+
54
+ [[products.artifacts]]
55
+ id = "main"
56
+ path = "${artifact.path}"
57
+ kind = "${artifact.kind}"
58
+
59
+ [[products.targets]]
60
+ provider = "${artifact.provider}"
61
+ artifacts = ["main"]
62
+ ${npmAccess}
63
+ [version]
64
+ strategy = "semver"
65
+
66
+ [[version.files]]
67
+ path = "package.json"
68
+ format = "json"
69
+ key = "version"
70
+
71
+ [[channels]]
72
+ from = "feature/*"
73
+ to = "dev/v1/v1.0"
74
+ operation = "develop"
75
+
76
+ [[channels]]
77
+ from = "dev/v1/v1.0"
78
+ to = "alpha/v1/v1.0"
79
+ operation = "alpha"
80
+
81
+ [[channels]]
82
+ from = "alpha/v1/v1.0"
83
+ to = "release/v1/v1.0"
84
+ operation = "stable"
85
+
86
+ [review]
87
+ minimum_approvals = 1
88
+ code_owners = true
89
+ merge_queue = true
90
+ `,
91
+ };
92
+ if (type === "binary")
93
+ files["src/hello.c"] =
94
+ '#include <stdio.h>\nint main(void) { puts("hello"); return 0; }\n';
95
+ return files;
96
+ }
@@ -0,0 +1,65 @@
1
+ import { createHash } from "node:crypto";
2
+ import { object, relativePath, text } from "./shape.js";
3
+ import { compileConsumerPlan, CONSUMER_CONTRACT } from "./plan.js";
4
+
5
+ export function contentDigest(bytes) {
6
+ return `sha256:${createHash("sha256").update(bytes).digest("hex")}`;
7
+ }
8
+
9
+ // Source identities are prepared from trusted GitHub readback, never caller inputs.
10
+ export function bindConsumerSource(source, configBytes) {
11
+ object(
12
+ source,
13
+ ["repository", "commit", "tree", "configPath", "configBlob"],
14
+ [],
15
+ "source",
16
+ );
17
+ text(
18
+ source.repository,
19
+ "source.repository",
20
+ /^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/u,
21
+ );
22
+ for (const key of ["commit", "tree", "configBlob"])
23
+ text(source[key], `source.${key}`, /^[0-9a-f]{40}$/u);
24
+ relativePath(source.configPath, "source.configPath");
25
+ const bytes = Buffer.from(configBytes);
26
+ const blob = createHash("sha1")
27
+ .update(`blob ${bytes.length}\0`)
28
+ .update(bytes)
29
+ .digest("hex");
30
+ if (blob !== source.configBlob)
31
+ throw new Error("source.configBlob: config bytes do not match Git blob");
32
+ const plan = compileConsumerPlan(bytes.toString("utf8"));
33
+ const identity = {
34
+ schema: "buildchain.consumer-source/v1",
35
+ repository: source.repository,
36
+ commit: source.commit,
37
+ tree: source.tree,
38
+ configPath: source.configPath,
39
+ configBlob: blob,
40
+ configDigest: contentDigest(bytes),
41
+ contract: CONSUMER_CONTRACT,
42
+ };
43
+ return {
44
+ identity,
45
+ identityDigest: contentDigest(JSON.stringify(identity)),
46
+ plan,
47
+ };
48
+ }
49
+
50
+ export function consumerContractLock({ entry, runtime, configDigest }) {
51
+ for (const [name, value] of Object.entries({ entry, runtime })) {
52
+ object(value, ["repository", "sha"], [], name);
53
+ if (value.repository !== "kungfu-systems/buildchain")
54
+ throw new Error(`${name}: untrusted Buildchain repository`);
55
+ text(value.sha, `${name}.sha`, /^[0-9a-f]{40}$/u);
56
+ }
57
+ text(configDigest, "configDigest", /^sha256:[0-9a-f]{64}$/u);
58
+ return {
59
+ schema: "buildchain.consumer-contract-lock/v2",
60
+ contract: CONSUMER_CONTRACT,
61
+ entry: { ...entry },
62
+ runtime: { ...runtime },
63
+ configDigest,
64
+ };
65
+ }
@@ -0,0 +1,45 @@
1
+ import { consumerWorkflows } from "./entries.js";
2
+ import { compileConsumerPlan, CONFIG_PATH } from "./plan.js";
3
+
4
+ const INTERNAL_WIRING = [
5
+ /\b(?:request-json|native-roots-json|used-nonces-json|warrant-result|source-proof|integration-proof)\b/iu,
6
+ /\bbuildchain\s+(?:dev\s+(?:warrant|proof)|release|promote|recover|publish)\b/iu,
7
+ /\b(?:npm\s+publish|gh\s+release\s+(?:create|upload)|gh\s+run\s+download)\b/iu,
8
+ /actions\/download-artifact@/u,
9
+ /\.buildchain\/runtime\/|packages\/core\/(?:publication|release|dev-delivery)\//u,
10
+ /\b(?:fencingToken|candidateRoot|sourceProofRoot|usedNonces|generationRoot|compareAndSwap)\b/u,
11
+ /buildchain[-./][\w-]*(?:warrant|proof|fence|nonce|candidate|authority|transaction)/iu,
12
+ ];
13
+
14
+ // The supplied file map must be the complete tracked consumer tree, including
15
+ // package scripts and the source files they invoke. Runtime source is never run.
16
+ export function inspectConsumerContract(
17
+ files,
18
+ { channel = "v4", configPath = CONFIG_PATH } = {},
19
+ ) {
20
+ const issues = [];
21
+ let plan;
22
+ try {
23
+ plan = compileConsumerPlan(files[configPath]);
24
+ } catch (error) {
25
+ issues.push(`${configPath}: ${error.message}`);
26
+ }
27
+ const workflows = consumerWorkflows(channel, configPath);
28
+ for (const [file, expected] of Object.entries(workflows))
29
+ if (files[file] !== expected)
30
+ issues.push(`${file}: must match the generated thin caller`);
31
+ for (const [file, source] of Object.entries(files)) {
32
+ if (
33
+ /^\.github\/workflows\/.*\.ya?ml$/u.test(file) &&
34
+ !Object.hasOwn(workflows, file)
35
+ )
36
+ issues.push(`${file}: extra consumer workflow is forbidden`);
37
+ if (!/\.(?:toml|json|ya?ml|[cm]?js|ts|py|sh|ps1|rb)$/u.test(file)) continue;
38
+ for (const pattern of INTERNAL_WIRING)
39
+ if (pattern.test(String(source)))
40
+ issues.push(
41
+ `${file}: consumer owns internal orchestration (${pattern.source})`,
42
+ );
43
+ }
44
+ return { ok: issues.length === 0, issues, plan };
45
+ }