@kungfu-tech/buildchain 4.0.2 → 4.0.3-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +4 -4
- package/CONTRIBUTING.md +34 -0
- package/README.md +1 -1
- package/architecture/agent-change-map.md +154 -147
- package/architecture/{v4-architecture-constitution.md → architecture-constitution.md} +11 -11
- package/architecture/{v3-core-mechanism-inventory.md → baseline-core-mechanism-inventory.md} +1 -1
- package/architecture/{v4-bootstrap-authority.json → bootstrap-authority.json} +3 -3
- package/architecture/{v3-v4-capability-closure.md → capability-parity-closure.md} +3 -3
- package/architecture/{v3-v4-live-capability-inventory.json → capability-parity-live-capability-inventory.json} +4 -4
- package/architecture/{v4-capability-state-machine-manifest.json → capability-state-machine-manifest.json} +2 -2
- package/architecture/{v4-capability-state-machine-manifest.schema.json → capability-state-machine-manifest.schema.json} +2 -2
- package/architecture/ci-lane-change-budget.json +18 -0
- package/architecture/{v4-cross-platform-adopter-qualification.json → cross-platform-adopter-qualification.json} +3 -3
- package/architecture/{v4-delivery-authority-parity.json → delivery-authority-parity.json} +16 -16
- package/architecture/{v4-delivery-warrant-shadow-bootstrap-plan.json → delivery-warrant-shadow-bootstrap-plan.json} +3 -3
- package/architecture/{v4-delivery-warrant-shadow-bootstrap-plan.md → delivery-warrant-shadow-bootstrap-plan.md} +7 -7
- package/architecture/{v4-floating-consumer-policy.md → floating-consumer-policy.md} +1 -1
- package/architecture/implementation-naming.json +1273 -0
- package/architecture/internal-capabilities.json +171 -169
- package/architecture/maintainability-debt.json +87 -82
- package/architecture/maintainability-policy.json +15 -15
- package/architecture/{v4-next-development-parity.json → next-development-parity.json} +8 -8
- package/architecture/{v4-partial-mutation-recovery-qualification.json → partial-mutation-recovery-qualification.json} +8 -8
- package/architecture/{v4-platform-stage-checkpoints.json → platform-stage-checkpoints.json} +2 -2
- package/architecture/{v4-provider-operation-journal-contract.json → provider-operation-journal-contract.json} +9 -9
- package/architecture/{v4-publication-rehearsal-parity.json → publication-rehearsal-parity.json} +4 -4
- package/architecture/{v4-release-activation-shadow-domain.json → release-activation-shadow-domain.json} +8 -8
- package/architecture/{v4-release-topology.json → release-topology.json} +112 -56
- package/architecture/{v4-release-train-parity.json → release-train-parity.json} +2 -2
- package/architecture/{v4-runtime-ref-resume-authority.json → runtime-ref-resume-authority.json} +1 -1
- package/architecture/{v4-runtime-semantic-closure.json → runtime-semantic-closure.json} +2 -2
- package/architecture/{v4-rust-libnode-bridge-evaluation.json → rust-libnode-bridge-evaluation.json} +3 -3
- package/architecture/{v4-rust-libnode-bridge-spike.md → rust-libnode-bridge-spike.md} +6 -6
- package/architecture/{v4-rust-wasm-production-authority.json → rust-wasm-production-authority.json} +11 -11
- package/architecture/{v4-stable-publication-fence.json → stable-publication-fence.json} +6 -6
- package/architecture/{v4-stage-capsule-contract.json → stage-capsule-contract.json} +1 -1
- package/architecture/{v4-stage-capsule-qualification.json → stage-capsule-qualification.json} +6 -6
- package/architecture/{v4-stage-capsule-resume-planner.json → stage-capsule-resume-planner.json} +2 -2
- package/architecture/{v4-stage-capsule-store-contract.json → stage-capsule-store-contract.json} +4 -4
- package/architecture/{v4-tail-reseal-parity.json → tail-reseal-parity.json} +28 -28
- package/architecture/{v4-universal-workflow-bootstrap.json → universal-workflow-bootstrap.json} +9 -4
- package/architecture/{v4-universal-workflow-fault-campaign.json → universal-workflow-fault-campaign.json} +8 -8
- package/architecture/{v4-universal-workflow-train-admission.json → universal-workflow-train-admission.json} +8 -8
- package/architecture/workflow-taxonomy.json +11 -0
- package/bin/buildchain.mjs +3 -3
- package/bin/internal/adopter-delivery-cli.mjs +9 -9
- package/contracts/fixtures/v4-tail-reseal-v1/valid.json +1 -1
- package/crates/{buildchain-v4-bridge → buildchain-host-bridge}/Cargo.lock +1 -1
- package/crates/{buildchain-v4-bridge → buildchain-host-bridge}/Cargo.toml +1 -1
- package/crates/{buildchain-v4-bridge → buildchain-host-bridge}/src/main.rs +3 -3
- package/dist/site/buildchain-contract.json +18 -18
- package/dist/site/buildchain-site.json +167 -71
- package/dist/site/capability-registry.json +5 -5
- package/dist/site/kfd-claims.json +226 -90
- package/dist/site/kfd-upstream-aggregate.json +1 -1
- package/dist/site/manual-registry.json +7 -7
- package/dist/site/node-api-registry.json +12929 -10491
- package/dist/site/page-registry.json +155 -59
- package/dist/site/public-surface-audit.json +65 -46
- package/dist/site/publication-authority-registry.json +27 -17
- package/dist/site/publication-registry.json +4 -4
- package/dist/site/release-provenance.json +18 -9
- package/dist/site/site-manifest.json +11 -11
- package/dist/site/workflow-registry.json +86 -52
- package/docs/MAP.md +4 -3
- package/docs/next-development-transition.md +24 -1
- package/docs/node-api-reference.md +435 -175
- package/docs/oci-publication.md +173 -0
- package/docs/publish-transaction.md +36 -3
- package/docs/release-flow.md +1 -1
- package/docs/reusable-build-surface.md +1 -1
- package/docs/v4-adopter-delivery.md +2 -2
- package/docs/v4-canonical-contracts.md +7 -7
- package/docs/v4-delivery-warrant-read-candidate.md +3 -3
- package/docs/v4-delivery-warrant-semantic-diff.md +3 -3
- package/docs/v4-production-release.md +8 -2
- package/docs/v4-publication-rehearsal.md +3 -3
- package/docs/v4-runtime-ref-resume-authority.md +2 -2
- package/docs/v4-rust-wasm-production-authority.md +6 -6
- package/docs/v4-stage-capsule.md +7 -7
- package/docs/v4-tail-reseal.md +1 -1
- package/docs/workflow-catalog.md +1 -0
- package/package.json +37 -26
- package/packages/compatibility/adopter-delivery.js +16 -0
- package/packages/compatibility/cross-platform-adopter-qualification.js +12 -0
- package/packages/compatibility/floating-consumer-policy.js +14 -0
- package/packages/compatibility/publication-qualification.js +11 -0
- package/packages/compatibility/publication-rehearsal.js +18 -0
- package/packages/compatibility/runtime-ref-resume-authority.js +13 -0
- package/packages/compatibility/tail-reseal-receipt.js +7 -0
- package/packages/compatibility/tail-reseal.js +11 -0
- package/packages/core/{v4-adopter-delivery-parity.js → adopter-delivery-parity.js} +12 -12
- package/packages/core/{v4-adopter-delivery.js → adopter-delivery.js} +24 -24
- package/packages/core/buildchain-contract.js +5 -5
- package/packages/core/buildchain-domain.wasm +0 -0
- package/packages/core/buildchain-publication-authority.js +1 -0
- package/packages/core/{v4-canonical-contracts.js → canonical-contracts.js} +32 -31
- package/packages/core/{v4-cross-platform-adopter-qualification.js → cross-platform-adopter-qualification.js} +19 -19
- package/packages/core/{v4-delivery-warrant-fixture-runner.js → delivery-warrant-fixture-runner.js} +36 -32
- package/packages/core/{v4-delivery-warrant-read-candidate.js → delivery-warrant-read-candidate.js} +40 -40
- package/packages/core/{v4-delivery-warrant-semantic-diff-gate.js → delivery-warrant-semantic-diff-gate.js} +58 -59
- package/packages/core/{v4-delivery-warrant-shadow-adapter.js → delivery-warrant-shadow-adapter.js} +15 -15
- package/packages/core/dev-delivery-execution-transfer.js +6 -6
- package/packages/core/dev-delivery-native-proof.js +12 -8
- package/packages/core/dev-delivery-warrant-legacy-recovery.js +1 -1
- package/packages/core/dev-delivery-warrant-native-compatibility.js +4 -4
- package/packages/core/dev-delivery-warrant-state.js +11 -11
- package/packages/core/dev-delivery-warrant.js +3 -3
- package/packages/core/domain-wasm-artifact.js +7 -0
- package/packages/core/{v4-domain-wasm.js → domain-wasm.js} +31 -31
- package/packages/core/{v4-floating-consumer-evidence.js → floating-consumer-evidence.js} +13 -13
- package/packages/core/{v4-floating-consumer-policy.js → floating-consumer-policy.js} +27 -29
- package/packages/core/{v4-floating-consumer-release-passport.js → floating-consumer-release-passport.js} +25 -25
- package/packages/core/index.js +4 -8
- package/packages/core/next-development-projection.js +24 -1
- package/packages/core/next-development-transition.js +5 -6
- package/packages/core/oci-compose-qualification.js +143 -0
- package/packages/core/oci-publication-bundle.js +281 -0
- package/packages/core/oci-publication-graph.js +206 -0
- package/packages/core/paper-runtime-channels.js +2 -2
- package/packages/core/paper.js +3 -3
- package/packages/core/partial-mutation-recovery-qualification.js +18 -0
- package/packages/core/{v4-platform-stage-checkpoints.js → platform-stage-checkpoints.js} +37 -37
- package/packages/core/{v4-product-publication.js → product-publication.js} +11 -9
- package/packages/core/{v4-protected-publication-source.js → protected-publication-source.js} +3 -3
- package/packages/core/provider-operation-journal.js +62 -0
- package/packages/core/{v4-provider-readback-idempotency.js → provider-readback-idempotency.js} +33 -33
- package/packages/core/public-export-compatibility.js +33 -0
- package/packages/core/publication-development.js +72 -0
- package/packages/core/{v4-publication-qualification.js → publication-qualification.js} +17 -17
- package/packages/core/{v4-publication-rehearsal-capsule.js → publication-rehearsal-capsule.js} +23 -23
- package/packages/core/publication-rehearsal-projection.js +2 -2
- package/packages/core/{v4-publication-rehearsal-provider-bindings.js → publication-rehearsal-provider-bindings.js} +4 -4
- package/packages/core/publication-rehearsal-runtime.js +21 -21
- package/packages/core/{v4-publication-rehearsal.js → publication-rehearsal.js} +33 -33
- package/packages/core/publication-sealed-bundle.js +78 -13
- package/packages/core/release-activation-shadow.js +32 -0
- package/packages/core/release-candidate.js +6 -6
- package/packages/core/{v4-release-invocation.js → release-invocation.js} +15 -15
- package/packages/core/release-passport.js +36 -36
- package/packages/core/release-tail-product-capabilities.js +9 -0
- package/packages/core/release-tail-provider-plane.js +10 -10
- package/packages/core/{v4-runtime-ref-resume-authority.js → runtime-ref-resume-authority.js} +36 -40
- package/packages/core/{v4-runtime-selector-persistence.js → runtime-selector-persistence.js} +7 -7
- package/packages/core/stable-publication-fence.js +28 -0
- package/packages/core/{v4-stage-capsule-local-store.js → stage-capsule-local-store.js} +56 -54
- package/packages/core/{v4-stage-capsule-qualification-campaign.js → stage-capsule-qualification-campaign.js} +37 -38
- package/packages/core/{v4-stage-capsule-qualification.js → stage-capsule-qualification.js} +28 -29
- package/packages/core/{v4-stage-capsule-resume-planner.js → stage-capsule-resume-planner.js} +29 -29
- package/packages/core/{v4-stage-capsule-store.js → stage-capsule-store.js} +59 -56
- package/packages/core/{v4-stage-capsule.js → stage-capsule.js} +45 -45
- package/packages/core/{v4-tail-reseal-contract.js → tail-reseal-contract.js} +6 -6
- package/packages/core/{v4-tail-reseal-github.js → tail-reseal-github.js} +12 -12
- package/packages/core/{v4-tail-reseal-receipt.js → tail-reseal-receipt.js} +22 -22
- package/packages/core/{v4-tail-reseal.js → tail-reseal.js} +29 -29
- package/packages/core/{v4-universal-workflow-bootstrap.js → universal-workflow-bootstrap.js} +23 -23
- package/scripts/{v4-architecture.mjs → architecture.mjs} +6 -6
- package/scripts/binary-publication-evidence.mjs +1 -1
- package/scripts/{v4-bridge-bootstrap.mjs → bridge-bootstrap.mjs} +14 -18
- package/scripts/{v4-bridge-evidence.mjs → bridge-evidence.mjs} +8 -8
- package/scripts/{build-v4-domain-wasm.mjs → build-domain-wasm.mjs} +6 -18
- package/scripts/{v3-v4-capability-catalog.mjs → capability-parity-catalog.mjs} +19 -19
- package/scripts/check-action-bundles.mjs +2 -2
- package/scripts/{check-v3-v4-capability-inventory.mjs → check-capability-parity-inventory.mjs} +42 -42
- package/scripts/check-core-mechanism-inventory.mjs +4 -1
- package/scripts/{check-v4-floating-consumer-policy-contract.mjs → check-floating-consumer-policy-contract.mjs} +8 -8
- package/scripts/check-implementation-naming.mjs +135 -0
- package/scripts/check-inventory.mjs +6 -5
- package/scripts/check-maintainability.mjs +9 -2
- package/scripts/{check-v4-public-dogfood-contract.mjs → check-public-dogfood-contract.mjs} +15 -15
- package/scripts/{check-v4-release-topology.mjs → check-release-topology.mjs} +53 -31
- package/scripts/{check-v4-runtime-semantic-closure.mjs → check-runtime-semantic-closure.mjs} +19 -16
- package/scripts/{check-v4-universal-workflow-bootstrap.mjs → check-universal-workflow-bootstrap.mjs} +14 -14
- package/scripts/{v4-consumer-policy.mjs → consumer-policy.mjs} +15 -15
- package/scripts/{copy-v4-domain-wasm.mjs → copy-domain-wasm.mjs} +3 -3
- package/scripts/{v4-cross-platform-adopter-qualification.mjs → cross-platform-adopter-qualification.mjs} +9 -9
- package/scripts/{v4-declarative-promotion-admission.mjs → declarative-promotion-admission.mjs} +4 -4
- package/scripts/dev-delivery-warrant-options.mjs +1 -1
- package/scripts/dev-delivery-warrant-store.mjs +29 -10
- package/scripts/dev-delivery-warrant.mjs +4 -4
- package/scripts/dev-pr-delivery-warrant.mjs +1 -1
- package/scripts/generate-channel-build-workflow.mjs +2 -2
- package/scripts/generate-channel-promotion-workflow.mjs +14 -31
- package/scripts/generate-release-candidate-passport.mjs +23 -23
- package/scripts/generate-site-bundle.mjs +17 -17
- package/scripts/{generate-v4-universal-workflow-facades.mjs → generate-universal-workflow-facades.mjs} +61 -21
- package/scripts/{v4-host-adapter.mjs → host-adapter.mjs} +1 -1
- package/scripts/implementation-references.mjs +25 -0
- package/scripts/init-repo.mjs +1 -1
- package/scripts/next-development-review.mjs +17 -11
- package/scripts/oci-compose-preview.mjs +261 -0
- package/scripts/{v4-platform-stage-checkpoint-rehearsal.mjs → platform-stage-checkpoint-rehearsal.mjs} +17 -17
- package/scripts/{v4-product-publication-intent.mjs → product-publication-intent.mjs} +16 -8
- package/scripts/publication-candidate-kind.mjs +93 -0
- package/scripts/publication-candidate-sealer.mjs +16 -1
- package/scripts/{v4-publication-rehearsal-fixture.mjs → publication-rehearsal-fixture.mjs} +5 -5
- package/scripts/{v4-publication-settlement.mjs → publication-settlement.mjs} +8 -8
- package/scripts/{v4-release-candidate-adapter.mjs → release-candidate-adapter.mjs} +4 -4
- package/scripts/release-candidate-resolver.mjs +15 -26
- package/scripts/release-tail.mjs +5 -5
- package/scripts/resume-from-candidate-run.mjs +35 -42
- package/scripts/site-capability-metadata.mjs +9 -0
- package/scripts/source-verification-evidence.mjs +7 -7
- package/scripts/{v4-stage-capsule-qualification.mjs → stage-capsule-qualification.mjs} +62 -62
- package/scripts/{v4-stage-capsule-resume-rehearsal.mjs → stage-capsule-resume-rehearsal.mjs} +6 -6
- package/scripts/{v4-tail-reseal-macos-rehearsal.mjs → tail-reseal-macos-rehearsal.mjs} +9 -9
- package/scripts/{v4-tail-reseal.mjs → tail-reseal.mjs} +19 -19
- package/scripts/universal-facade-maintainability.mjs +12 -3
- package/scripts/{v4-universal-workflow-backflow.mjs → universal-workflow-backflow.mjs} +10 -10
- package/scripts/{v4-universal-workflow-engine.mjs → universal-workflow-engine.mjs} +40 -38
- package/scripts/{v4-universal-workflow-self-dogfood.mjs → universal-workflow-self-dogfood.mjs} +12 -12
- package/scripts/verify-version-state-delta.mjs +4 -2
- package/scripts/{v4-warrant-shadow-plan.mjs → warrant-shadow-plan.mjs} +6 -6
- package/templates/universal-buildchain-bootstrap-recovery.yml +4 -4
- package/packages/core/buildchain-v4-domain.wasm +0 -0
- package/packages/core/v4-domain-wasm-artifact.js +0 -7
- package/packages/core/v4-partial-mutation-recovery-qualification.js +0 -18
- package/packages/core/v4-provider-operation-journal.js +0 -62
- package/packages/core/v4-release-activation-shadow.js +0 -32
- package/packages/core/v4-stable-publication-fence.js +0 -28
- /package/actions/{v4-release-candidate-promote → release-candidate-promote}/README.md +0 -0
- /package/architecture/{v4-adopter-delivery-parity.json → adopter-delivery-parity.json} +0 -0
- /package/architecture/{v3-core-mechanism-inventory.json → baseline-core-mechanism-inventory.json} +0 -0
- /package/architecture/{v4-canonical-contract-fixtures.json → canonical-contract-fixtures.json} +0 -0
- /package/architecture/{v4-compatibility-facts-parity.json → compatibility-facts-parity.json} +0 -0
- /package/architecture/{v4-delivery-warrant-shadow-bootstrap-plan.schema.json → delivery-warrant-shadow-bootstrap-plan.schema.json} +0 -0
- /package/architecture/{v4-delivery-warrant-shadow-fixtures.json → delivery-warrant-shadow-fixtures.json} +0 -0
- /package/architecture/{v4-delivery-warrant-shadow-fixtures.schema.json → delivery-warrant-shadow-fixtures.schema.json} +0 -0
- /package/architecture/{v4-exception-ledger.json → exception-ledger.json} +0 -0
- /package/architecture/{v4-exception-ledger.schema.json → exception-ledger.schema.json} +0 -0
- /package/architecture/{v4-floating-consumer-policy.json → floating-consumer-policy.json} +0 -0
- /package/architecture/{v4-publication-facade-patches.json → publication-facade-patches.json} +0 -0
- /package/architecture/{v4-release-invocation-fixtures.json → release-invocation-fixtures.json} +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import crypto from "node:crypto";
|
|
2
|
+
import { execFileSync } from "node:child_process";
|
|
2
3
|
import fs from "node:fs";
|
|
3
4
|
import path from "node:path";
|
|
4
5
|
|
|
@@ -19,7 +20,10 @@ function requiredString(value, label) {
|
|
|
19
20
|
|
|
20
21
|
function safeRelativePath(value, label) {
|
|
21
22
|
const normalized = requiredString(value, label).replaceAll("\\", "/");
|
|
22
|
-
if (
|
|
23
|
+
if (
|
|
24
|
+
normalized.startsWith("/") ||
|
|
25
|
+
normalized.split("/").some((part) => part === ".." || part === "")
|
|
26
|
+
) {
|
|
23
27
|
throw new Error(`${label} must be a safe relative path`);
|
|
24
28
|
}
|
|
25
29
|
return normalized;
|
|
@@ -41,7 +45,8 @@ function sha256File(filePath) {
|
|
|
41
45
|
const chunk = Buffer.allocUnsafe(8 * 1024 * 1024);
|
|
42
46
|
try {
|
|
43
47
|
let bytesRead = 0;
|
|
44
|
-
while ((bytesRead = fs.readSync(descriptor, chunk, 0, chunk.length, null)) > 0)
|
|
48
|
+
while ((bytesRead = fs.readSync(descriptor, chunk, 0, chunk.length, null)) > 0)
|
|
49
|
+
hash.update(chunk.subarray(0, bytesRead));
|
|
45
50
|
} finally {
|
|
46
51
|
fs.closeSync(descriptor);
|
|
47
52
|
}
|
|
@@ -60,8 +65,16 @@ function normalizeFile(entry, label) {
|
|
|
60
65
|
};
|
|
61
66
|
}
|
|
62
67
|
|
|
68
|
+
function fileInventory(files, label) {
|
|
69
|
+
return (files || []).map((entry, index) => normalizeFile(entry, `${label}[${index}]`))
|
|
70
|
+
.sort((left, right) => left.path.localeCompare(right.path));
|
|
71
|
+
}
|
|
72
|
+
|
|
63
73
|
function candidatePayload(candidate) {
|
|
64
|
-
if (
|
|
74
|
+
if (
|
|
75
|
+
candidate?.contract !== PUBLICATION_ARTIFACT_CANDIDATE_CONTRACT ||
|
|
76
|
+
Number(candidate?.schemaVersion) !== 1
|
|
77
|
+
) {
|
|
65
78
|
throw new Error("publication artifact candidate contract mismatch");
|
|
66
79
|
}
|
|
67
80
|
const { candidateDigest: _candidateDigest, ...payload } = candidate;
|
|
@@ -91,9 +104,7 @@ export function createPublicationSealedBundle({
|
|
|
91
104
|
githubReleaseRequired = true,
|
|
92
105
|
} = {}) {
|
|
93
106
|
const { digest } = candidatePayload(candidate);
|
|
94
|
-
const files = (candidate.files
|
|
95
|
-
.map((entry, index) => normalizeFile(entry, `candidate.files[${index}]`))
|
|
96
|
-
.sort((left, right) => left.path.localeCompare(right.path));
|
|
107
|
+
const files = fileInventory(candidate.files, "candidate.files");
|
|
97
108
|
if (new Set(files.map((entry) => entry.path)).size !== files.length) {
|
|
98
109
|
throw new Error("publication sealed bundle candidate paths must be unique");
|
|
99
110
|
}
|
|
@@ -119,6 +130,7 @@ export function createPublicationSealedBundle({
|
|
|
119
130
|
sha256: npmTarball.sha256,
|
|
120
131
|
integrity: requiredString(npmIntegrity, "npmIntegrity"),
|
|
121
132
|
},
|
|
133
|
+
...(candidate.npmPackages ? { npmPackages: candidate.npmPackages } : {}),
|
|
122
134
|
releaseAssets,
|
|
123
135
|
completion: {
|
|
124
136
|
githubReleaseRequired: Boolean(githubReleaseRequired),
|
|
@@ -130,8 +142,56 @@ export function createPublicationSealedBundle({
|
|
|
130
142
|
};
|
|
131
143
|
}
|
|
132
144
|
|
|
145
|
+
function verifyNpmPackageSet(manifest, files, resolvedRoot) {
|
|
146
|
+
const npmPackages = manifest.npmPackages;
|
|
147
|
+
if (JSON.stringify(npmPackages) !== JSON.stringify(manifest.candidate.npmPackages)) {
|
|
148
|
+
throw new Error("publication sealed bundle npm package inventory differs from candidate");
|
|
149
|
+
}
|
|
150
|
+
if (npmPackages) {
|
|
151
|
+
if (
|
|
152
|
+
!Array.isArray(npmPackages) ||
|
|
153
|
+
npmPackages.length < 2 ||
|
|
154
|
+
new Set(npmPackages.map((entry) => entry.name)).size !== npmPackages.length ||
|
|
155
|
+
new Set(npmPackages.map((entry) => entry.path)).size !== npmPackages.length
|
|
156
|
+
) {
|
|
157
|
+
throw new Error("publication sealed bundle npm package inventory must be unique");
|
|
158
|
+
}
|
|
159
|
+
for (const entry of npmPackages) {
|
|
160
|
+
const file = selectFile(files, entry.path, "npmPackages.path");
|
|
161
|
+
const absolutePath = path.resolve(resolvedRoot, file.path);
|
|
162
|
+
const metadata = JSON.parse(
|
|
163
|
+
execFileSync("tar", ["-xOf", path.basename(absolutePath), "package/package.json"], {
|
|
164
|
+
cwd: path.dirname(absolutePath),
|
|
165
|
+
encoding: "utf8",
|
|
166
|
+
}),
|
|
167
|
+
);
|
|
168
|
+
const integrity = `sha512-${crypto.createHash("sha512").update(fs.readFileSync(absolutePath)).digest("base64")}`;
|
|
169
|
+
if (
|
|
170
|
+
entry.name !== metadata.name ||
|
|
171
|
+
entry.version !== metadata.version ||
|
|
172
|
+
entry.size !== file.size ||
|
|
173
|
+
entry.sha256 !== file.sha256 ||
|
|
174
|
+
entry.integrity !== integrity
|
|
175
|
+
) {
|
|
176
|
+
throw new Error("publication sealed bundle npm package identity or integrity mismatch");
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
const main = npmPackages.filter((entry) => entry.role === "main");
|
|
180
|
+
if (
|
|
181
|
+
main.length !== 1 ||
|
|
182
|
+
Object.keys(manifest.npm).some((key) => main[0][key] !== manifest.npm[key])
|
|
183
|
+
) {
|
|
184
|
+
throw new Error("publication sealed bundle npm main package mismatch");
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return npmPackages;
|
|
188
|
+
}
|
|
189
|
+
|
|
133
190
|
export function verifyPublicationSealedBundle({ bundleRoot, manifest } = {}) {
|
|
134
|
-
if (
|
|
191
|
+
if (
|
|
192
|
+
manifest?.contract !== PUBLICATION_SEALED_BUNDLE_CONTRACT ||
|
|
193
|
+
Number(manifest?.schemaVersion) !== 1
|
|
194
|
+
) {
|
|
135
195
|
throw new Error("publication sealed bundle contract mismatch");
|
|
136
196
|
}
|
|
137
197
|
const resolvedRoot = path.resolve(requiredString(bundleRoot, "bundleRoot"));
|
|
@@ -139,12 +199,8 @@ export function verifyPublicationSealedBundle({ bundleRoot, manifest } = {}) {
|
|
|
139
199
|
if (normalizeSha256(manifest.root, "manifest.root") !== digest) {
|
|
140
200
|
throw new Error("publication sealed bundle root mismatch");
|
|
141
201
|
}
|
|
142
|
-
const files = (manifest.files
|
|
143
|
-
|
|
144
|
-
.sort((left, right) => left.path.localeCompare(right.path));
|
|
145
|
-
const candidateFiles = (manifest.candidate.files || [])
|
|
146
|
-
.map((entry, index) => normalizeFile(entry, `candidate.files[${index}]`))
|
|
147
|
-
.sort((left, right) => left.path.localeCompare(right.path));
|
|
202
|
+
const files = fileInventory(manifest.files, "manifest.files");
|
|
203
|
+
const candidateFiles = fileInventory(manifest.candidate.files, "candidate.files");
|
|
148
204
|
if (JSON.stringify(files) !== JSON.stringify(candidateFiles)) {
|
|
149
205
|
throw new Error("publication sealed bundle file inventory differs from candidate");
|
|
150
206
|
}
|
|
@@ -169,6 +225,7 @@ export function verifyPublicationSealedBundle({ bundleRoot, manifest } = {}) {
|
|
|
169
225
|
) {
|
|
170
226
|
throw new Error("publication sealed bundle npm tarball inventory mismatch");
|
|
171
227
|
}
|
|
228
|
+
const npmPackages = verifyNpmPackageSet(manifest, files, resolvedRoot);
|
|
172
229
|
const releaseAssets = (manifest.releaseAssets || []).map((entry, index) => {
|
|
173
230
|
const selected = selectFile(files, entry.path, `manifest.releaseAssets[${index}].path`);
|
|
174
231
|
const normalized = normalizeFile(entry, `manifest.releaseAssets[${index}]`);
|
|
@@ -194,6 +251,14 @@ export function verifyPublicationSealedBundle({ bundleRoot, manifest } = {}) {
|
|
|
194
251
|
...entry,
|
|
195
252
|
absolutePath: path.resolve(resolvedRoot, entry.path),
|
|
196
253
|
})),
|
|
254
|
+
...(npmPackages
|
|
255
|
+
? {
|
|
256
|
+
npmPackages: npmPackages.map((entry) => ({
|
|
257
|
+
...entry,
|
|
258
|
+
absolutePath: path.resolve(resolvedRoot, entry.path),
|
|
259
|
+
})),
|
|
260
|
+
}
|
|
261
|
+
: {}),
|
|
197
262
|
manifest,
|
|
198
263
|
};
|
|
199
264
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ContractFault } from "./canonical-contracts.js";
|
|
2
|
+
import { DomainWasmFault, invokeDomainWasm } from "./domain-wasm.js";
|
|
3
|
+
|
|
4
|
+
export const RELEASE_ACTIVATION_REQUEST_CONTRACT =
|
|
5
|
+
"buildchain-v4-release-activation-request/v1";
|
|
6
|
+
export const RELEASE_ACTIVATION_PLAN_CONTRACT =
|
|
7
|
+
"buildchain-v4-release-activation-plan/v1";
|
|
8
|
+
export const RELEASE_ACTIVATION_STATE_CONTRACT =
|
|
9
|
+
"buildchain-v4-release-activation-state/v1";
|
|
10
|
+
|
|
11
|
+
function project(request) {
|
|
12
|
+
try {
|
|
13
|
+
return invokeDomainWasm("release-activation", request);
|
|
14
|
+
} catch (error) {
|
|
15
|
+
if (error instanceof DomainWasmFault) {
|
|
16
|
+
throw new ContractFault(error.code, error.path, error.message);
|
|
17
|
+
}
|
|
18
|
+
throw error;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function planReleaseActivation(request) {
|
|
23
|
+
return project(request).plan;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function foldReleaseActivation(request) {
|
|
27
|
+
return project(request).state;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function projectReleaseActivation(request) {
|
|
31
|
+
return project(request);
|
|
32
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import crypto from "node:crypto";
|
|
2
|
-
import {
|
|
2
|
+
import { verifyFloatingConsumerPolicyReceipt } from "./floating-consumer-policy.js";
|
|
3
3
|
import { normalizeControllerReceiptReferences, validateControllerReceiptReference } from "./controller-evidence.js";
|
|
4
4
|
|
|
5
5
|
export const RELEASE_CANDIDATE_PASSPORT_CONTRACT = "kungfu-buildchain-release-candidate-passport";
|
|
@@ -172,7 +172,7 @@ function normalizeGateProfileEvidence(gateAggregate = undefined) {
|
|
|
172
172
|
};
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
function
|
|
175
|
+
function isBuildchainRuntime(buildchain = {}) {
|
|
176
176
|
return [buildchain.ref, buildchain.workflowShellRef]
|
|
177
177
|
.some((value) => /^v4(?:-alpha)?$/u.test(String(value || "")))
|
|
178
178
|
|| /^4\./u.test(String(buildchain.version || ""));
|
|
@@ -184,7 +184,7 @@ function normalizeConsumerPolicyEvidence(value, expected = {}) {
|
|
|
184
184
|
throw new Error("consumerPolicyReceipt must be an object");
|
|
185
185
|
}
|
|
186
186
|
const receipt = value.receipt || value;
|
|
187
|
-
const verification =
|
|
187
|
+
const verification = verifyFloatingConsumerPolicyReceipt({
|
|
188
188
|
receipt,
|
|
189
189
|
receiptRoot: value.receiptRoot || "",
|
|
190
190
|
repository: expected.repository,
|
|
@@ -198,11 +198,11 @@ function normalizeConsumerPolicyEvidence(value, expected = {}) {
|
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
function validateConsumerPolicyEvidence(passport, check) {
|
|
201
|
-
if (
|
|
201
|
+
if (isBuildchainRuntime(passport.buildchain)) {
|
|
202
202
|
check(Boolean(passport.consumerPolicy), "Buildchain v4 release candidate requires consumer policy evidence");
|
|
203
203
|
}
|
|
204
204
|
if (!passport.consumerPolicy) return;
|
|
205
|
-
const verification =
|
|
205
|
+
const verification = verifyFloatingConsumerPolicyReceipt({
|
|
206
206
|
receipt: passport.consumerPolicy.receipt,
|
|
207
207
|
receiptRoot: passport.consumerPolicy.receiptRoot,
|
|
208
208
|
repository: passport.repository,
|
|
@@ -406,7 +406,7 @@ export function createReleaseCandidatePassport({
|
|
|
406
406
|
sourceSha: normalizedSummary.publishSource?.ref === "publish-gate/anchor" ? (consumerPolicyReceipt?.receipt || consumerPolicyReceipt)?.caller?.sourceSha : sourceSha,
|
|
407
407
|
runtimeSha: resolvedBuildchain.sha,
|
|
408
408
|
});
|
|
409
|
-
if (
|
|
409
|
+
if (isBuildchainRuntime(resolvedBuildchain) && !normalizedConsumerPolicy) {
|
|
410
410
|
throw new Error("Buildchain v4 release candidate passport requires a valid floating consumer policy receipt");
|
|
411
411
|
}
|
|
412
412
|
const controllerReceiptEvidence = normalizeControllerReceiptReferences({
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ContractFault } from "./canonical-contracts.js";
|
|
2
|
+
import { DomainWasmFault, invokeDomainWasm } from "./domain-wasm.js";
|
|
3
3
|
|
|
4
|
-
export const
|
|
4
|
+
export const RELEASE_INVOCATION_CONTRACT =
|
|
5
5
|
"kungfu-buildchain-v4-release-invocation/v1";
|
|
6
|
-
export const
|
|
6
|
+
export const RELEASE_INVOCATION_ADAPTER_CONTRACT =
|
|
7
7
|
"kungfu-buildchain-v4-release-invocation-adapter/v1";
|
|
8
|
-
export const
|
|
8
|
+
export const RELEASE_TRANSACTION_CONTRACT =
|
|
9
9
|
"kungfu-buildchain-v4-release-transaction/v1";
|
|
10
|
-
export const
|
|
10
|
+
export const RELEASE_RECEIPT_CONTRACT =
|
|
11
11
|
"kungfu-buildchain-v4-release-receipt/v1";
|
|
12
|
-
export const
|
|
12
|
+
export const RELEASE_PROVIDER_CONTRACT =
|
|
13
13
|
"kungfu-buildchain-release-tail-provider/v1";
|
|
14
14
|
|
|
15
15
|
function invoke(operation, payload) {
|
|
16
16
|
try {
|
|
17
|
-
return
|
|
17
|
+
return invokeDomainWasm(operation, payload);
|
|
18
18
|
} catch (error) {
|
|
19
|
-
if (error instanceof
|
|
20
|
-
throw new
|
|
19
|
+
if (error instanceof DomainWasmFault) {
|
|
20
|
+
throw new ContractFault(error.code, error.path, error.message);
|
|
21
21
|
}
|
|
22
22
|
throw error;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
export function
|
|
26
|
+
export function createReleaseInvocation(value) {
|
|
27
27
|
const projected = invoke("release-invocation", value);
|
|
28
28
|
return { ...projected, invocation: value };
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
export function
|
|
31
|
+
export function adaptReleaseInvocation(value) {
|
|
32
32
|
const projected = invoke("release-invocation-adapter", value);
|
|
33
33
|
return { ...projected, invocation: value.invocation };
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
export function
|
|
36
|
+
export function planReleaseRoute({
|
|
37
37
|
requestedSha,
|
|
38
38
|
observedSha,
|
|
39
39
|
comparisonStatus,
|
|
@@ -55,10 +55,10 @@ export function planV4ReleaseRoute({
|
|
|
55
55
|
);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
export function
|
|
58
|
+
export function createDomainReleaseTransaction(value) {
|
|
59
59
|
return invoke("release-transaction", value);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
export function
|
|
62
|
+
export function createReleaseReceipt(value) {
|
|
63
63
|
return invoke("release-receipt", value);
|
|
64
64
|
}
|
|
@@ -33,20 +33,20 @@ import { normalizeControllerReceiptReferences } from "./controller-evidence.js";
|
|
|
33
33
|
import {
|
|
34
34
|
normalizeGitHubArtifactAttestationPolicy,
|
|
35
35
|
} from "./github-artifact-attestation.js";
|
|
36
|
-
import {
|
|
36
|
+
import { verifyFloatingConsumerPolicyCertification } from "./floating-consumer-evidence.js";
|
|
37
37
|
import {
|
|
38
38
|
normalizePromotionEvidence,
|
|
39
39
|
normalizePromotionRouting,
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
normalizeRuntimeResumeEvidence,
|
|
41
|
+
isPromotionRouting,
|
|
42
42
|
releasePassportCertificationVerificationOptions,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
} from "./
|
|
43
|
+
requireConsumerPolicyCertification,
|
|
44
|
+
resolveConsumerPolicyCertificationIdentity,
|
|
45
|
+
} from "./floating-consumer-release-passport.js";
|
|
46
46
|
import {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
} from "./
|
|
47
|
+
verifyRuntimeAuthorizationReceipt,
|
|
48
|
+
verifyRuntimeResumeLineage,
|
|
49
|
+
} from "./runtime-ref-resume-authority.js";
|
|
50
50
|
|
|
51
51
|
export { RELEASE_CHECK_REPORT_CONTRACT, RELEASE_PASSPORT_CONTRACT };
|
|
52
52
|
export const ARTIFACT_EVIDENCE_CONTRACT = "kungfu-buildchain-artifact-evidence";
|
|
@@ -1204,9 +1204,9 @@ export function createReleasePassport(options = {}) {
|
|
|
1204
1204
|
kfdSupportEvidencePath = "",
|
|
1205
1205
|
invariantPassports = undefined,
|
|
1206
1206
|
releaseEvidence = [],
|
|
1207
|
-
v4ConsumerPolicyCertification = undefined,
|
|
1208
|
-
v4ConsumerPolicyCertificationRoot = "",
|
|
1209
|
-
|
|
1207
|
+
v4ConsumerPolicyCertification: domainConsumerPolicyCertification = undefined,
|
|
1208
|
+
v4ConsumerPolicyCertificationRoot: domainConsumerPolicyCertificationRoot = "",
|
|
1209
|
+
domainRuntimeResumeEvidence = undefined,
|
|
1210
1210
|
kfdAgentHubEvidence = undefined,
|
|
1211
1211
|
kfdAgentHubEvidencePath = "",
|
|
1212
1212
|
controllerReceipts = [],
|
|
@@ -1223,9 +1223,9 @@ export function createReleasePassport(options = {}) {
|
|
|
1223
1223
|
const normalizedTrustedPublishing = normalizeTrustedPublishing(trustedPublishing, { workflow, publish });
|
|
1224
1224
|
const normalizedTransaction = normalizeTransaction(transaction);
|
|
1225
1225
|
const { promotion, buildEvidence } = preparePromotionBuild(options);
|
|
1226
|
-
const
|
|
1226
|
+
const normalizedRuntimeResume = normalizeRuntimeResumeEvidence(domainRuntimeResumeEvidence, {
|
|
1227
1227
|
repository,
|
|
1228
|
-
sourceSha:
|
|
1228
|
+
sourceSha: runtimeResumeSourceSha(release, sourceSha),
|
|
1229
1229
|
resumeRuntimeSha: promotion.routing?.runtime?.resolvedSha || "",
|
|
1230
1230
|
consumerPolicyReceiptRoot: promotion.consumerPolicy?.certification?.receiptRoot || "",
|
|
1231
1231
|
});
|
|
@@ -1374,7 +1374,7 @@ export function createReleasePassport(options = {}) {
|
|
|
1374
1374
|
["invariantPassports", invariantPassports],
|
|
1375
1375
|
["releaseEvidence", releaseEvidence],
|
|
1376
1376
|
["v4ConsumerPolicy", promotion.consumerPolicy],
|
|
1377
|
-
["v4RuntimeResume",
|
|
1377
|
+
["v4RuntimeResume", normalizedRuntimeResume],
|
|
1378
1378
|
["controllerReceipts", normalizedControllerReceipts],
|
|
1379
1379
|
["githubArtifactAttestations", normalizedGitHubArtifactAttestations],
|
|
1380
1380
|
]),
|
|
@@ -1497,9 +1497,9 @@ export function collectGitHubReleasePassport({
|
|
|
1497
1497
|
invariantPassportJsons = [],
|
|
1498
1498
|
invariantPassportCommand = "",
|
|
1499
1499
|
releaseEvidenceJsons = [],
|
|
1500
|
-
v4ConsumerPolicyCertificationJson = "",
|
|
1501
|
-
v4ConsumerPolicyCertificationRoot = "",
|
|
1502
|
-
v4RuntimeResumeEvidenceJson = "",
|
|
1500
|
+
v4ConsumerPolicyCertificationJson: domainConsumerPolicyCertificationJson = "",
|
|
1501
|
+
v4ConsumerPolicyCertificationRoot: domainConsumerPolicyCertificationRoot = "",
|
|
1502
|
+
v4RuntimeResumeEvidenceJson: domainRuntimeResumeEvidenceJson = "",
|
|
1503
1503
|
kfdAgentHubEvidenceJson = "",
|
|
1504
1504
|
controllerReceiptReferences = [],
|
|
1505
1505
|
githubArtifactAttestationPolicyJsons = [],
|
|
@@ -1575,9 +1575,9 @@ export function collectGitHubReleasePassport({
|
|
|
1575
1575
|
}),
|
|
1576
1576
|
)
|
|
1577
1577
|
.filter((meta) => meta.value);
|
|
1578
|
-
const
|
|
1579
|
-
|
|
1580
|
-
const
|
|
1578
|
+
const consumerPolicyCertificationMeta =
|
|
1579
|
+
parseConsumerPolicyCertification(domainConsumerPolicyCertificationJson, cwd);
|
|
1580
|
+
const domainRuntimeResumeEvidence = parseJsonInput(domainRuntimeResumeEvidenceJson, undefined, {
|
|
1581
1581
|
cwd,
|
|
1582
1582
|
label: "v4RuntimeResumeEvidenceJson",
|
|
1583
1583
|
});
|
|
@@ -1706,9 +1706,9 @@ export function collectGitHubReleasePassport({
|
|
|
1706
1706
|
kfdSupportEvidencePath: kfdSupport ? "kfd-support.json" : "",
|
|
1707
1707
|
invariantPassports,
|
|
1708
1708
|
releaseEvidence: releaseEvidenceAttachments.map(({ reference }) => reference),
|
|
1709
|
-
v4ConsumerPolicyCertification:
|
|
1710
|
-
v4ConsumerPolicyCertificationRoot,
|
|
1711
|
-
|
|
1709
|
+
v4ConsumerPolicyCertification: consumerPolicyCertificationMeta.value,
|
|
1710
|
+
v4ConsumerPolicyCertificationRoot: domainConsumerPolicyCertificationRoot,
|
|
1711
|
+
domainRuntimeResumeEvidence,
|
|
1712
1712
|
kfdAgentHubEvidence: kfdAgentHubEvidenceMeta.value
|
|
1713
1713
|
? { ...kfdAgentHubEvidenceMeta, path: "kfd-agent-hub-evidence.json" }
|
|
1714
1714
|
: undefined,
|
|
@@ -2650,8 +2650,8 @@ export function createReleaseCheckReport({
|
|
|
2650
2650
|
releaseEvidenceDocuments,
|
|
2651
2651
|
issues,
|
|
2652
2652
|
});
|
|
2653
|
-
|
|
2654
|
-
|
|
2653
|
+
validateConsumerPolicyPassportSection({ passport, issues });
|
|
2654
|
+
validateRuntimeResumePassportSection({ passport, issues });
|
|
2655
2655
|
validatePublishEvidenceSection({ passport, publishEvidence, normalizedPublishEvidence, issues });
|
|
2656
2656
|
const evidenceIndex = indexEvidenceArtifacts(evidenceArtifacts);
|
|
2657
2657
|
validateReleaseArtifacts({ artifacts, evidenceIndex, issues });
|
|
@@ -2805,14 +2805,14 @@ export function makeReleasePassportFixtureAssets(dir) {
|
|
|
2805
2805
|
export function validateKnownReleasePassportContracts() {
|
|
2806
2806
|
return [...CONTRACTS];
|
|
2807
2807
|
}
|
|
2808
|
-
function
|
|
2808
|
+
function parseConsumerPolicyCertification(input, cwd) {
|
|
2809
2809
|
return parseJsonInputWithMeta(input, undefined, {
|
|
2810
2810
|
cwd,
|
|
2811
2811
|
label: "v4ConsumerPolicyCertificationJson",
|
|
2812
2812
|
});
|
|
2813
2813
|
}
|
|
2814
2814
|
|
|
2815
|
-
function
|
|
2815
|
+
function runtimeResumeSourceSha(release, fallback = "") {
|
|
2816
2816
|
const builtSourceSha = releaseField(
|
|
2817
2817
|
release || {},
|
|
2818
2818
|
"builtSourceSha",
|
|
@@ -2824,10 +2824,10 @@ function v4RuntimeResumeSourceSha(release, fallback = "") {
|
|
|
2824
2824
|
}
|
|
2825
2825
|
|
|
2826
2826
|
|
|
2827
|
-
function
|
|
2827
|
+
function validateConsumerPolicyPassportSection({ passport, issues }) {
|
|
2828
2828
|
const routing = passport?.promotionRouting;
|
|
2829
2829
|
const evidence = passport?.v4ConsumerPolicy;
|
|
2830
|
-
if (
|
|
2830
|
+
if (isPromotionRouting(routing) && !evidence) {
|
|
2831
2831
|
issues.push(issue(
|
|
2832
2832
|
"error",
|
|
2833
2833
|
"v4ConsumerPolicy.missing",
|
|
@@ -2836,7 +2836,7 @@ function validateV4ConsumerPolicyPassportSection({ passport, issues }) {
|
|
|
2836
2836
|
return;
|
|
2837
2837
|
}
|
|
2838
2838
|
if (!evidence) return;
|
|
2839
|
-
const verification =
|
|
2839
|
+
const verification = verifyFloatingConsumerPolicyCertification(
|
|
2840
2840
|
releasePassportCertificationVerificationOptions({
|
|
2841
2841
|
evidence,
|
|
2842
2842
|
passport,
|
|
@@ -2848,26 +2848,26 @@ function validateV4ConsumerPolicyPassportSection({ passport, issues }) {
|
|
|
2848
2848
|
}
|
|
2849
2849
|
}
|
|
2850
2850
|
|
|
2851
|
-
function
|
|
2851
|
+
function validateRuntimeResumePassportSection({ passport, issues }) {
|
|
2852
2852
|
const evidence = passport?.v4RuntimeResume;
|
|
2853
2853
|
if (!evidence) return;
|
|
2854
2854
|
const consumerPolicyReceiptRoot = passport?.v4ConsumerPolicy?.certification?.receiptRoot || "";
|
|
2855
|
-
const authorization =
|
|
2855
|
+
const authorization = verifyRuntimeAuthorizationReceipt({
|
|
2856
2856
|
receipt: evidence.authorization,
|
|
2857
2857
|
receiptRoot: evidence.authorizationRoot,
|
|
2858
2858
|
repository: passport?.product?.repository || "",
|
|
2859
|
-
sourceSha:
|
|
2859
|
+
sourceSha: runtimeResumeSourceSha(passport?.release, passport?.release?.sourceSha || ""),
|
|
2860
2860
|
runtimeSha: passport?.promotionRouting?.runtime?.resolvedSha || "",
|
|
2861
2861
|
consumerPolicyReceiptRoot,
|
|
2862
2862
|
});
|
|
2863
2863
|
for (const failure of authorization.failures) {
|
|
2864
2864
|
issues.push(issue("error", `v4RuntimeResume.authorization.${failure}`, failure));
|
|
2865
2865
|
}
|
|
2866
|
-
const lineage =
|
|
2866
|
+
const lineage = verifyRuntimeResumeLineage({
|
|
2867
2867
|
lineage: evidence.lineage,
|
|
2868
2868
|
lineageRoot: evidence.lineageRoot,
|
|
2869
2869
|
repository: passport?.product?.repository || "",
|
|
2870
|
-
sourceSha:
|
|
2870
|
+
sourceSha: runtimeResumeSourceSha(passport?.release, passport?.release?.sourceSha || ""),
|
|
2871
2871
|
resumeRuntimeSha: passport?.promotionRouting?.runtime?.resolvedSha || "",
|
|
2872
2872
|
consumerPolicyReceiptRoot,
|
|
2873
2873
|
});
|
|
@@ -17,6 +17,15 @@ export const RELEASE_TAIL_PRODUCT_CAPABILITIES = Object.freeze([
|
|
|
17
17
|
receiptKind: "product-package-publication",
|
|
18
18
|
transactionState: "publishing",
|
|
19
19
|
}),
|
|
20
|
+
Object.freeze({
|
|
21
|
+
id: "product.oci.publish",
|
|
22
|
+
executor: "provider-adapter",
|
|
23
|
+
adapter: "oci-image-family",
|
|
24
|
+
effectKind: "oci-family-publication",
|
|
25
|
+
observationKind: "oci-family-readback",
|
|
26
|
+
receiptKind: "oci-family-publication",
|
|
27
|
+
transactionState: "publishing",
|
|
28
|
+
}),
|
|
20
29
|
Object.freeze({
|
|
21
30
|
id: "product.release-refs.converge",
|
|
22
31
|
executor: "provider-adapter",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { invokeDomainWasm } from "./domain-wasm.js";
|
|
5
5
|
import { RELEASE_TAIL_PRODUCT_CAPABILITIES } from "./release-tail-product-capabilities.js";
|
|
6
6
|
|
|
7
7
|
export const RELEASE_TAIL_DECLARATION_CONTRACT =
|
|
@@ -71,12 +71,12 @@ export const RELEASE_TAIL_CAPABILITY_REGISTRY = Object.freeze([
|
|
|
71
71
|
]);
|
|
72
72
|
|
|
73
73
|
export function releaseTailStableJson(value) {
|
|
74
|
-
const canonical =
|
|
74
|
+
const canonical = invokeDomainWasm("canonical-json", value).canonicalUtf8;
|
|
75
75
|
return canonical.endsWith("\n") ? canonical.slice(0, -1) : canonical;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
export function releaseTailRoot(value) {
|
|
79
|
-
return
|
|
79
|
+
return invokeDomainWasm("release-tail-root", value).root;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
export function parseReleaseTailDeclaration(input) {
|
|
@@ -90,26 +90,26 @@ export function parseReleaseTailDeclaration(input) {
|
|
|
90
90
|
);
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
return
|
|
93
|
+
return invokeDomainWasm("release-tail-parse", value);
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
export function compileReleaseTailDeclaration(input) {
|
|
97
|
-
return
|
|
97
|
+
return invokeDomainWasm(
|
|
98
98
|
"release-tail-compile",
|
|
99
99
|
typeof input === "string" ? JSON.parse(input) : input,
|
|
100
100
|
);
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
export function validateReleaseTailEffectPlan(plan) {
|
|
104
|
-
return
|
|
104
|
+
return invokeDomainWasm("release-tail-validate-plan", plan);
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
export function createReleaseTailTransaction(input) {
|
|
108
|
-
return
|
|
108
|
+
return invokeDomainWasm("release-tail-create", input);
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
export function validateReleaseTailTransaction(transaction) {
|
|
112
|
-
return
|
|
112
|
+
return invokeDomainWasm("release-tail-validate-transaction", transaction);
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
export function readReleaseTailTransaction(filePath) {
|
|
@@ -173,7 +173,7 @@ export async function executeReleaseTailTransaction(
|
|
|
173
173
|
transaction,
|
|
174
174
|
{ adapters, checkpoint } = {},
|
|
175
175
|
) {
|
|
176
|
-
let exchange =
|
|
176
|
+
let exchange = invokeDomainWasm(
|
|
177
177
|
"release-tail-execution-start",
|
|
178
178
|
transaction,
|
|
179
179
|
);
|
|
@@ -214,7 +214,7 @@ export async function executeReleaseTailTransaction(
|
|
|
214
214
|
`unsupported Rust/WASM release-tail instruction '${instruction.action}'`,
|
|
215
215
|
);
|
|
216
216
|
}
|
|
217
|
-
exchange =
|
|
217
|
+
exchange = invokeDomainWasm("release-tail-execution-advance", {
|
|
218
218
|
transaction: exchange.transaction,
|
|
219
219
|
cursor: exchange.cursor,
|
|
220
220
|
signal,
|