@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
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { nextDevelopmentRoot } from "./next-development-transition.js";
|
|
2
|
+
|
|
3
|
+
const VERSION =
|
|
4
|
+
/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-alpha\.(0|[1-9]\d*))?$/u;
|
|
5
|
+
|
|
6
|
+
export function developmentVersionParts(version) {
|
|
7
|
+
const parts = VERSION.exec(version || "");
|
|
8
|
+
if (!parts) throw new Error("expected a stable or alpha semantic version");
|
|
9
|
+
return parts
|
|
10
|
+
.slice(1)
|
|
11
|
+
.map((part) => (part === undefined ? null : BigInt(part)));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function compareDevelopmentVersions(left, right) {
|
|
15
|
+
const a = developmentVersionParts(left),
|
|
16
|
+
b = developmentVersionParts(right);
|
|
17
|
+
for (let i = 0; i < 4; i += 1) {
|
|
18
|
+
if (a[i] === b[i]) continue;
|
|
19
|
+
if (a[i] === null) return 1;
|
|
20
|
+
if (b[i] === null) return -1;
|
|
21
|
+
return a[i] < b[i] ? -1 : 1;
|
|
22
|
+
}
|
|
23
|
+
return 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function nextPatchDevelopmentVersion(stableVersion) {
|
|
27
|
+
const [major, minor, patch, alpha] = developmentVersionParts(stableVersion);
|
|
28
|
+
if (alpha !== null)
|
|
29
|
+
throw new Error("completed stable version must not be a prerelease");
|
|
30
|
+
return `${major}.${minor}.${patch + 1n}-alpha.0`;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function createStableDevelopmentTransition({
|
|
34
|
+
repository,
|
|
35
|
+
completedStable,
|
|
36
|
+
model,
|
|
37
|
+
sourcePaths,
|
|
38
|
+
derivedPaths,
|
|
39
|
+
}) {
|
|
40
|
+
const value = completedStable || {};
|
|
41
|
+
const version = nextPatchDevelopmentVersion(value.version);
|
|
42
|
+
if (
|
|
43
|
+
!/^[^/\s]+\/[^/\s]+$/u.test(repository || "") ||
|
|
44
|
+
value.outcome !== "succeeded" ||
|
|
45
|
+
value.exactTag !== `v${value.version}` ||
|
|
46
|
+
![value.releaseSha, value.treeSha].every((sha) =>
|
|
47
|
+
/^[a-f0-9]{40}$/u.test(sha || ""),
|
|
48
|
+
) ||
|
|
49
|
+
!/^sha256:[a-f0-9]{64}$/u.test(value.publicationRoot || "") ||
|
|
50
|
+
!Number.isFinite(Date.parse(value.completedAt))
|
|
51
|
+
)
|
|
52
|
+
throw new Error(
|
|
53
|
+
"stable development requires an exact completed publication",
|
|
54
|
+
);
|
|
55
|
+
if (model.strategy !== "semver" || model.next !== "auto")
|
|
56
|
+
throw new Error("automatic next-patch development requires semver/auto");
|
|
57
|
+
const identity = {
|
|
58
|
+
contract: "buildchain.stable-development-transition/v1",
|
|
59
|
+
repository,
|
|
60
|
+
completedStable: value,
|
|
61
|
+
model,
|
|
62
|
+
sourcePaths,
|
|
63
|
+
derivedPaths,
|
|
64
|
+
};
|
|
65
|
+
return {
|
|
66
|
+
...identity,
|
|
67
|
+
idempotencyKey: nextDevelopmentRoot(identity),
|
|
68
|
+
target: { version },
|
|
69
|
+
state: { status: "planned" },
|
|
70
|
+
publicationOutcome: "preserved-success",
|
|
71
|
+
};
|
|
72
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import crypto from "node:crypto";
|
|
2
2
|
|
|
3
|
-
export const
|
|
3
|
+
export const PUBLICATION_QUALIFICATION_SCHEMA =
|
|
4
4
|
"kungfu.buildchain.v4-publication-qualification/v1";
|
|
5
5
|
|
|
6
6
|
const ROOT = /^sha256:[0-9a-f]{64}$/u;
|
|
@@ -16,16 +16,16 @@ const FORBIDDEN_EXECUTION_KEYS = new Set([
|
|
|
16
16
|
"shell",
|
|
17
17
|
]);
|
|
18
18
|
|
|
19
|
-
export class
|
|
19
|
+
export class PublicationQualificationError extends Error {
|
|
20
20
|
constructor(code, message) {
|
|
21
21
|
super(message);
|
|
22
|
-
this.name = "
|
|
22
|
+
this.name = "PublicationQualificationError";
|
|
23
23
|
this.code = code;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
function fail(code, message) {
|
|
28
|
-
throw new
|
|
28
|
+
throw new PublicationQualificationError(code, message);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
function canonical(value) {
|
|
@@ -39,14 +39,14 @@ function canonical(value) {
|
|
|
39
39
|
return JSON.stringify(value);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
export function
|
|
42
|
+
export function domainPublicationQualificationRoot(value) {
|
|
43
43
|
return `sha256:${crypto.createHash("sha256").update(canonical(value)).digest("hex")}`;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
export function
|
|
46
|
+
export function assertNoExecutionFields(value, location = "$") {
|
|
47
47
|
if (Array.isArray(value)) {
|
|
48
48
|
value.forEach((entry, index) =>
|
|
49
|
-
|
|
49
|
+
assertNoExecutionFields(entry, `${location}[${index}]`),
|
|
50
50
|
);
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
@@ -58,7 +58,7 @@ export function assertNoV4ExecutionFields(value, location = "$") {
|
|
|
58
58
|
`v4 declarative publication forbids ${location}.${key}`,
|
|
59
59
|
);
|
|
60
60
|
}
|
|
61
|
-
|
|
61
|
+
assertNoExecutionFields(entry, `${location}.${key}`);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
|
|
@@ -109,7 +109,7 @@ function normalizedArtifacts(artifacts) {
|
|
|
109
109
|
return normalized;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
export function
|
|
112
|
+
export function createDomainPublicationQualificationReceipt({
|
|
113
113
|
repository,
|
|
114
114
|
candidateRoot,
|
|
115
115
|
sourceSha,
|
|
@@ -120,7 +120,7 @@ export function createV4PublicationQualificationReceipt({
|
|
|
120
120
|
expiresAt,
|
|
121
121
|
}) {
|
|
122
122
|
const body = {
|
|
123
|
-
schema:
|
|
123
|
+
schema: PUBLICATION_QUALIFICATION_SCHEMA,
|
|
124
124
|
repository: String(repository || ""),
|
|
125
125
|
candidateRoot: exactRoot(candidateRoot, "candidateRoot"),
|
|
126
126
|
sourceSha: exactSha(sourceSha, "sourceSha"),
|
|
@@ -140,16 +140,16 @@ export function createV4PublicationQualificationReceipt({
|
|
|
140
140
|
expires <= issued
|
|
141
141
|
)
|
|
142
142
|
fail("schema-invalid", "qualification freshness interval is invalid");
|
|
143
|
-
|
|
144
|
-
const artifactRoot =
|
|
143
|
+
assertNoExecutionFields(body);
|
|
144
|
+
const artifactRoot = domainPublicationQualificationRoot(body.artifacts);
|
|
145
145
|
const receipt = { ...body, artifactRoot };
|
|
146
146
|
return {
|
|
147
147
|
...receipt,
|
|
148
|
-
receiptRoot:
|
|
148
|
+
receiptRoot: domainPublicationQualificationRoot(receipt),
|
|
149
149
|
};
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
export function
|
|
152
|
+
export function validatePublicationQualificationReceipt(
|
|
153
153
|
receipt,
|
|
154
154
|
{
|
|
155
155
|
repository,
|
|
@@ -163,8 +163,8 @@ export function validateV4PublicationQualificationReceipt(
|
|
|
163
163
|
) {
|
|
164
164
|
if (!receipt)
|
|
165
165
|
fail("qualification-missing", "qualification receipt is required");
|
|
166
|
-
|
|
167
|
-
const recreated =
|
|
166
|
+
assertNoExecutionFields(receipt);
|
|
167
|
+
const recreated = createDomainPublicationQualificationReceipt(receipt);
|
|
168
168
|
if (
|
|
169
169
|
receipt.artifactRoot !== recreated.artifactRoot ||
|
|
170
170
|
receipt.receiptRoot !== recreated.receiptRoot
|
|
@@ -204,7 +204,7 @@ export function validateV4PublicationQualificationReceipt(
|
|
|
204
204
|
});
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
-
export function
|
|
207
|
+
export function assertDeclarativePromotionInputs(inputs) {
|
|
208
208
|
const forbidden = Object.entries(inputs || {}).filter(
|
|
209
209
|
([name, value]) =>
|
|
210
210
|
name !== "dry-run" &&
|
package/packages/core/{v4-publication-rehearsal-capsule.js → publication-rehearsal-capsule.js}
RENAMED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
validateReleaseTailTransaction,
|
|
8
8
|
} from "./release-tail-provider-plane.js";
|
|
9
9
|
import {
|
|
10
|
-
|
|
10
|
+
PublicationRehearsalFault,
|
|
11
11
|
publicationRehearsalByteSorted as byteSorted,
|
|
12
12
|
publicationRehearsalExactKeys as exactKeys,
|
|
13
13
|
publicationRehearsalFault as fault,
|
|
@@ -15,26 +15,26 @@ import {
|
|
|
15
15
|
publicationRehearsalRoot as root,
|
|
16
16
|
publicationRehearsalText as text,
|
|
17
17
|
publicationRehearsalToken as token,
|
|
18
|
-
|
|
19
|
-
} from "./
|
|
18
|
+
validatePublicationRehearsalProviderBindings,
|
|
19
|
+
} from "./publication-rehearsal-provider-bindings.js";
|
|
20
20
|
|
|
21
21
|
export {
|
|
22
|
-
|
|
22
|
+
PublicationRehearsalFault,
|
|
23
23
|
exactKeys as assertPublicationRehearsalExactKeys,
|
|
24
24
|
fault as publicationRehearsalFault,
|
|
25
25
|
root as publicationRehearsalRoot,
|
|
26
|
-
|
|
26
|
+
validatePublicationRehearsalProviderBindings,
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
export const
|
|
29
|
+
export const DOMAIN_PUBLICATION_REHEARSAL_CAPSULE_CONTRACT =
|
|
30
30
|
"buildchain-v4-publication-rehearsal-capsule/v1";
|
|
31
|
-
export const
|
|
31
|
+
export const DOMAIN_PUBLICATION_REHEARSAL_EVIDENCE_CONTRACT =
|
|
32
32
|
"buildchain-v4-publication-rehearsal-evidence/v1";
|
|
33
|
-
export const
|
|
33
|
+
export const PUBLICATION_REHEARSAL_AUTHORITY_CONTRACT =
|
|
34
34
|
"buildchain-v4-publication-rehearsal-authority/v1";
|
|
35
|
-
export const
|
|
35
|
+
export const PUBLICATION_REHEARSAL_PROVIDER_POLICY_CONTRACT =
|
|
36
36
|
"buildchain-v4-publication-rehearsal-provider-policy/v1";
|
|
37
|
-
export const
|
|
37
|
+
export const PUBLICATION_REHEARSAL_CORE_VERSION =
|
|
38
38
|
RELEASE_TAIL_TRANSACTION_POLICY;
|
|
39
39
|
|
|
40
40
|
const ROOT = /^sha256:[0-9a-f]{64}$/u;
|
|
@@ -138,7 +138,7 @@ function normalizeCandidateInputs(value) {
|
|
|
138
138
|
`$/${name}`,
|
|
139
139
|
`${name} is not bound by the candidate inventory`,
|
|
140
140
|
);
|
|
141
|
-
const providerBindings =
|
|
141
|
+
const providerBindings = validatePublicationRehearsalProviderBindings(
|
|
142
142
|
value.providerBindings,
|
|
143
143
|
);
|
|
144
144
|
root(value.providerBindingsRoot, "$/providerBindingsRoot");
|
|
@@ -177,7 +177,7 @@ function normalizeProviderPolicy(value, declaration) {
|
|
|
177
177
|
"$/providerPolicy",
|
|
178
178
|
);
|
|
179
179
|
if (
|
|
180
|
-
value.schema !==
|
|
180
|
+
value.schema !== PUBLICATION_REHEARSAL_PROVIDER_POLICY_CONTRACT ||
|
|
181
181
|
value.effectDefault !== "disabled"
|
|
182
182
|
)
|
|
183
183
|
fault(
|
|
@@ -295,10 +295,10 @@ function normalizeObservation(value, index, operationIds) {
|
|
|
295
295
|
return structuredClone(value);
|
|
296
296
|
}
|
|
297
297
|
|
|
298
|
-
export function
|
|
298
|
+
export function createPublicationRehearsalProviderPolicy(declarationInput) {
|
|
299
299
|
const declaration = parseReleaseTailDeclaration(declarationInput);
|
|
300
300
|
const body = {
|
|
301
|
-
schema:
|
|
301
|
+
schema: PUBLICATION_REHEARSAL_PROVIDER_POLICY_CONTRACT,
|
|
302
302
|
effectDefault: "disabled",
|
|
303
303
|
allowedCapabilityIds: declaration.capabilities
|
|
304
304
|
.map(({ id }) => id)
|
|
@@ -310,7 +310,7 @@ export function createV4PublicationRehearsalProviderPolicy(declarationInput) {
|
|
|
310
310
|
return { ...body, root: releaseTailRoot(body) };
|
|
311
311
|
}
|
|
312
312
|
|
|
313
|
-
export function
|
|
313
|
+
export function createDomainPublicationRehearsalCapsule(input) {
|
|
314
314
|
const declaration = parseReleaseTailDeclaration(input.declaration);
|
|
315
315
|
const transaction =
|
|
316
316
|
input.transaction || createReleaseTailTransaction(declaration);
|
|
@@ -323,14 +323,14 @@ export function createV4PublicationRehearsalCapsule(input) {
|
|
|
323
323
|
};
|
|
324
324
|
const policy =
|
|
325
325
|
input.providerPolicy ||
|
|
326
|
-
|
|
326
|
+
createPublicationRehearsalProviderPolicy(declaration);
|
|
327
327
|
const observations = structuredClone(input.expectedObservations || []);
|
|
328
|
-
const providerBindings =
|
|
328
|
+
const providerBindings = validatePublicationRehearsalProviderBindings(
|
|
329
329
|
input.providerBindings,
|
|
330
330
|
);
|
|
331
331
|
const body = {
|
|
332
|
-
schema:
|
|
333
|
-
coreVersion:
|
|
332
|
+
schema: DOMAIN_PUBLICATION_REHEARSAL_CAPSULE_CONTRACT,
|
|
333
|
+
coreVersion: PUBLICATION_REHEARSAL_CORE_VERSION,
|
|
334
334
|
source: { ...source, root: sourceRoot(source) },
|
|
335
335
|
candidate: { root: candidateRoot(files) },
|
|
336
336
|
manifest: structuredClone(input.manifest),
|
|
@@ -346,13 +346,13 @@ export function createV4PublicationRehearsalCapsule(input) {
|
|
|
346
346
|
transaction: structuredClone(transaction),
|
|
347
347
|
files,
|
|
348
348
|
};
|
|
349
|
-
return
|
|
349
|
+
return validatePublicationRehearsalCapsule({
|
|
350
350
|
...body,
|
|
351
351
|
capsuleRoot: releaseTailRoot(body),
|
|
352
352
|
});
|
|
353
353
|
}
|
|
354
354
|
|
|
355
|
-
export function
|
|
355
|
+
export function validatePublicationRehearsalCapsule(value) {
|
|
356
356
|
exactKeys(
|
|
357
357
|
value,
|
|
358
358
|
[
|
|
@@ -374,8 +374,8 @@ export function validateV4PublicationRehearsalCapsule(value) {
|
|
|
374
374
|
"$",
|
|
375
375
|
);
|
|
376
376
|
if (
|
|
377
|
-
value.schema !==
|
|
378
|
-
value.coreVersion !==
|
|
377
|
+
value.schema !== DOMAIN_PUBLICATION_REHEARSAL_CAPSULE_CONTRACT ||
|
|
378
|
+
value.coreVersion !== PUBLICATION_REHEARSAL_CORE_VERSION
|
|
379
379
|
)
|
|
380
380
|
fault(
|
|
381
381
|
"unsupported-publication-rehearsal-core-version",
|
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
} from "./publication-rehearsal-runtime.js";
|
|
7
7
|
|
|
8
8
|
export const PUBLICATION_REHEARSAL_AGENT_SECTION_START =
|
|
9
|
-
"<!-- buildchain:publication-rehearsal:
|
|
9
|
+
"<!-- buildchain:publication-rehearsal:start -->";
|
|
10
10
|
export const PUBLICATION_REHEARSAL_AGENT_SECTION_END =
|
|
11
|
-
"<!-- buildchain:publication-rehearsal:
|
|
11
|
+
"<!-- buildchain:publication-rehearsal:end -->";
|
|
12
12
|
export const PUBLICATION_REHEARSAL_WORKFLOW_PATH =
|
|
13
13
|
".github/workflows/publication-rehearsal.yml";
|
|
14
14
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export class
|
|
1
|
+
export class PublicationRehearsalFault extends Error {
|
|
2
2
|
constructor(code, location, message) {
|
|
3
3
|
super(`${location}: ${message}`);
|
|
4
|
-
this.name = "
|
|
4
|
+
this.name = "PublicationRehearsalFault";
|
|
5
5
|
this.code = code;
|
|
6
6
|
this.location = location;
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export function publicationRehearsalFault(code, location, message) {
|
|
11
|
-
throw new
|
|
11
|
+
throw new PublicationRehearsalFault(code, location, message);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export function publicationRehearsalExactKeys(value, expected, location) {
|
|
@@ -130,7 +130,7 @@ function canonicalObject(value, location, normalize) {
|
|
|
130
130
|
);
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
export function
|
|
133
|
+
export function validatePublicationRehearsalProviderBindings(value) {
|
|
134
134
|
publicationRehearsalExactKeys(
|
|
135
135
|
value,
|
|
136
136
|
["schema", "artifacts", "documents", "evidence"],
|
|
@@ -3,18 +3,18 @@ import path from "node:path";
|
|
|
3
3
|
|
|
4
4
|
import { releaseTailRoot } from "./release-tail-provider-plane.js";
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
} from "./
|
|
6
|
+
DOMAIN_PUBLICATION_REHEARSAL_CAPSULE_CONTRACT,
|
|
7
|
+
DOMAIN_PUBLICATION_REHEARSAL_EVIDENCE_CONTRACT,
|
|
8
|
+
createDomainPublicationRehearsalCapsule,
|
|
9
|
+
executeDomainPublicationRehearsal,
|
|
10
|
+
validatePublicationRehearsalCapsule,
|
|
11
|
+
verifyDomainPublicationRehearsalCapsule,
|
|
12
|
+
} from "./publication-rehearsal.js";
|
|
13
13
|
|
|
14
14
|
export const PUBLICATION_REHEARSAL_CAPSULE_CONTRACT =
|
|
15
|
-
|
|
15
|
+
DOMAIN_PUBLICATION_REHEARSAL_CAPSULE_CONTRACT;
|
|
16
16
|
export const PUBLICATION_REHEARSAL_EVIDENCE_CONTRACT =
|
|
17
|
-
|
|
17
|
+
DOMAIN_PUBLICATION_REHEARSAL_EVIDENCE_CONTRACT;
|
|
18
18
|
export const PUBLICATION_REHEARSAL_DIAGNOSTIC_CONTRACT =
|
|
19
19
|
"buildchain-v4-publication-rehearsal-compatibility-diagnostic/v1";
|
|
20
20
|
export const RELEASE_LOCAL_CONSTRUCTIBILITY_ADR =
|
|
@@ -24,7 +24,7 @@ export const RELEASE_LOCAL_CONSTRUCTIBILITY_INVARIANT =
|
|
|
24
24
|
export const PUBLICATION_REHEARSAL_COMMAND =
|
|
25
25
|
'buildchain release-tail rehearse --capsule "$PWD/.buildchain/publication-rehearsal/capsule.json" --candidate-root "$PWD/.buildchain/publication-rehearsal/candidate" --mode simulate --state "$PWD/.buildchain/publication-rehearsal/state.json" --evidence "$PWD/.buildchain/publication-rehearsal/evidence.json"';
|
|
26
26
|
|
|
27
|
-
const
|
|
27
|
+
const REQUIRED_INPUTS = Object.freeze([
|
|
28
28
|
"source.repository",
|
|
29
29
|
"source.revision",
|
|
30
30
|
"manifest.path",
|
|
@@ -41,8 +41,8 @@ function migrationReceipt(surface, reasonCode) {
|
|
|
41
41
|
reasonCode,
|
|
42
42
|
replacement: {
|
|
43
43
|
module: "@kungfu-tech/buildchain/v4-publication-rehearsal",
|
|
44
|
-
capsuleContract:
|
|
45
|
-
requiredInputs:
|
|
44
|
+
capsuleContract: DOMAIN_PUBLICATION_REHEARSAL_CAPSULE_CONTRACT,
|
|
45
|
+
requiredInputs: REQUIRED_INPUTS,
|
|
46
46
|
},
|
|
47
47
|
productionAuthority: false,
|
|
48
48
|
};
|
|
@@ -68,7 +68,7 @@ export class PublicationRehearsalError extends Error {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
function
|
|
71
|
+
function hasCreationBindings(input) {
|
|
72
72
|
return Boolean(
|
|
73
73
|
input?.source?.repository &&
|
|
74
74
|
input?.source?.revision &&
|
|
@@ -79,8 +79,8 @@ function hasV4CreationBindings(input) {
|
|
|
79
79
|
);
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
function
|
|
83
|
-
if (
|
|
82
|
+
function requireCreationBindings(input, surface) {
|
|
83
|
+
if (hasCreationBindings(input)) return;
|
|
84
84
|
const migration = migrationReceipt(surface, "v4-source-binding-required");
|
|
85
85
|
throw new PublicationRehearsalError(
|
|
86
86
|
"v3 rehearsal capsules cannot be upgraded implicitly; provide the v4 source, manifest, and config bindings",
|
|
@@ -89,15 +89,15 @@ function requireV4CreationBindings(input, surface) {
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
export function createPublicationRehearsalCapsule(input = {}) {
|
|
92
|
-
|
|
92
|
+
requireCreationBindings(
|
|
93
93
|
input,
|
|
94
94
|
"@kungfu-tech/buildchain/publication-rehearsal-runtime#createPublicationRehearsalCapsule",
|
|
95
95
|
);
|
|
96
|
-
return
|
|
96
|
+
return createDomainPublicationRehearsalCapsule(input);
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
export function normalizePublicationRehearsalCapsule(input) {
|
|
100
|
-
return
|
|
100
|
+
return validatePublicationRehearsalCapsule(input);
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
export function verifyPublicationRehearsalCapsule({
|
|
@@ -105,11 +105,11 @@ export function verifyPublicationRehearsalCapsule({
|
|
|
105
105
|
capsuleRoot,
|
|
106
106
|
candidateRoot = capsuleRoot,
|
|
107
107
|
} = {}) {
|
|
108
|
-
return
|
|
108
|
+
return verifyDomainPublicationRehearsalCapsule({ capsule, candidateRoot });
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
export function publicationRehearsalBindingRoot(capsule) {
|
|
112
|
-
return
|
|
112
|
+
return validatePublicationRehearsalCapsule(capsule).capsuleRoot;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
export function publicationRehearsalDiagnostic(error, { capsule } = {}) {
|
|
@@ -156,7 +156,7 @@ export async function executePublicationRehearsal({
|
|
|
156
156
|
{ code: "undeclared-environment", classification: "input", migration },
|
|
157
157
|
);
|
|
158
158
|
}
|
|
159
|
-
return
|
|
159
|
+
return executeDomainPublicationRehearsal({
|
|
160
160
|
capsule,
|
|
161
161
|
candidateRoot,
|
|
162
162
|
mode,
|
|
@@ -8,32 +8,32 @@ import {
|
|
|
8
8
|
validateReleaseTailTransaction,
|
|
9
9
|
} from "./release-tail-provider-plane.js";
|
|
10
10
|
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
PUBLICATION_REHEARSAL_AUTHORITY_CONTRACT,
|
|
12
|
+
DOMAIN_PUBLICATION_REHEARSAL_CAPSULE_CONTRACT,
|
|
13
|
+
PUBLICATION_REHEARSAL_CORE_VERSION,
|
|
14
|
+
DOMAIN_PUBLICATION_REHEARSAL_EVIDENCE_CONTRACT,
|
|
15
|
+
PUBLICATION_REHEARSAL_PROVIDER_POLICY_CONTRACT,
|
|
16
|
+
PublicationRehearsalFault,
|
|
17
17
|
assertPublicationRehearsalExactKeys as exactKeys,
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
createDomainPublicationRehearsalCapsule,
|
|
19
|
+
createPublicationRehearsalProviderPolicy,
|
|
20
20
|
publicationRehearsalFault as fault,
|
|
21
21
|
publicationRehearsalRoot,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
} from "./
|
|
22
|
+
validatePublicationRehearsalCapsule,
|
|
23
|
+
validatePublicationRehearsalProviderBindings,
|
|
24
|
+
} from "./publication-rehearsal-capsule.js";
|
|
25
25
|
|
|
26
26
|
export {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
PUBLICATION_REHEARSAL_AUTHORITY_CONTRACT,
|
|
28
|
+
DOMAIN_PUBLICATION_REHEARSAL_CAPSULE_CONTRACT,
|
|
29
|
+
PUBLICATION_REHEARSAL_CORE_VERSION,
|
|
30
|
+
DOMAIN_PUBLICATION_REHEARSAL_EVIDENCE_CONTRACT,
|
|
31
|
+
PUBLICATION_REHEARSAL_PROVIDER_POLICY_CONTRACT,
|
|
32
|
+
PublicationRehearsalFault,
|
|
33
|
+
createDomainPublicationRehearsalCapsule,
|
|
34
|
+
createPublicationRehearsalProviderPolicy,
|
|
35
|
+
validatePublicationRehearsalCapsule,
|
|
36
|
+
validatePublicationRehearsalProviderBindings,
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
const ROOT = /^sha256:[0-9a-f]{64}$/u;
|
|
@@ -118,11 +118,11 @@ function resolveCandidateOutput(candidateRootPath, relative, location) {
|
|
|
118
118
|
return resolved;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
export function
|
|
121
|
+
export function verifyDomainPublicationRehearsalCapsule({
|
|
122
122
|
capsule,
|
|
123
123
|
candidateRoot: candidateRootPath,
|
|
124
124
|
}) {
|
|
125
|
-
const normalized =
|
|
125
|
+
const normalized = validatePublicationRehearsalCapsule(capsule);
|
|
126
126
|
if (!path.isAbsolute(candidateRootPath || ""))
|
|
127
127
|
fault(
|
|
128
128
|
"publication-rehearsal-implicit-root-forbidden",
|
|
@@ -157,17 +157,17 @@ export function verifyV4PublicationRehearsalCapsule({
|
|
|
157
157
|
return normalized;
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
export function
|
|
160
|
+
export function resolvePublicationRehearsalProviderBindings({
|
|
161
161
|
capsule,
|
|
162
162
|
candidateRoot: candidateRootPath,
|
|
163
163
|
providerBindings = capsule?.providerBindings,
|
|
164
164
|
}) {
|
|
165
|
-
const normalized =
|
|
165
|
+
const normalized = verifyDomainPublicationRehearsalCapsule({
|
|
166
166
|
capsule,
|
|
167
167
|
candidateRoot: candidateRootPath,
|
|
168
168
|
});
|
|
169
169
|
const supplied =
|
|
170
|
-
|
|
170
|
+
validatePublicationRehearsalProviderBindings(providerBindings);
|
|
171
171
|
if (
|
|
172
172
|
releaseTailRoot(supplied) !== normalized.providerBindingsRoot ||
|
|
173
173
|
JSON.stringify(supplied) !== JSON.stringify(normalized.providerBindings)
|
|
@@ -347,13 +347,13 @@ function observationAdapters(capsule, transcript, adapters, mode) {
|
|
|
347
347
|
);
|
|
348
348
|
}
|
|
349
349
|
|
|
350
|
-
export function
|
|
350
|
+
export function createPublicationRehearsalAuthority(
|
|
351
351
|
capsule,
|
|
352
352
|
{ authorizationRoot } = {},
|
|
353
353
|
) {
|
|
354
|
-
const normalized =
|
|
354
|
+
const normalized = validatePublicationRehearsalCapsule(capsule);
|
|
355
355
|
const body = {
|
|
356
|
-
schema:
|
|
356
|
+
schema: PUBLICATION_REHEARSAL_AUTHORITY_CONTRACT,
|
|
357
357
|
mode: "provider-rehearsal",
|
|
358
358
|
capsuleRoot: normalized.capsuleRoot,
|
|
359
359
|
providerPolicyRoot: normalized.providerPolicy.root,
|
|
@@ -385,7 +385,7 @@ function validateAuthority(value, capsule) {
|
|
|
385
385
|
const body = { ...value };
|
|
386
386
|
delete body.authorityRoot;
|
|
387
387
|
if (
|
|
388
|
-
value.schema !==
|
|
388
|
+
value.schema !== PUBLICATION_REHEARSAL_AUTHORITY_CONTRACT ||
|
|
389
389
|
value.mode !== "provider-rehearsal" ||
|
|
390
390
|
value.productionAuthority !== false ||
|
|
391
391
|
value.capsuleRoot !== capsule.capsuleRoot ||
|
|
@@ -402,7 +402,7 @@ function validateAuthority(value, capsule) {
|
|
|
402
402
|
return structuredClone(value);
|
|
403
403
|
}
|
|
404
404
|
|
|
405
|
-
export async function
|
|
405
|
+
export async function executeDomainPublicationRehearsal({
|
|
406
406
|
capsule,
|
|
407
407
|
candidateRoot: candidateRootPath,
|
|
408
408
|
mode = "simulate",
|
|
@@ -417,7 +417,7 @@ export async function executeV4PublicationRehearsal({
|
|
|
417
417
|
"$/mode",
|
|
418
418
|
"simulate, replay, or provider required",
|
|
419
419
|
);
|
|
420
|
-
const normalized =
|
|
420
|
+
const normalized = verifyDomainPublicationRehearsalCapsule({
|
|
421
421
|
capsule,
|
|
422
422
|
candidateRoot: candidateRootPath,
|
|
423
423
|
});
|
|
@@ -448,7 +448,7 @@ export async function executeV4PublicationRehearsal({
|
|
|
448
448
|
checkpoint,
|
|
449
449
|
});
|
|
450
450
|
const body = {
|
|
451
|
-
schema:
|
|
451
|
+
schema: DOMAIN_PUBLICATION_REHEARSAL_EVIDENCE_CONTRACT,
|
|
452
452
|
mode,
|
|
453
453
|
truth:
|
|
454
454
|
mode === "provider"
|