@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
|
@@ -11,11 +11,11 @@ const DEFAULT_ROOT = path.resolve(
|
|
|
11
11
|
);
|
|
12
12
|
const CALLER_PATH = ".github/workflows/self-build-public-consumer-dogfood.yml";
|
|
13
13
|
const REUSABLE_PATH = ".github/workflows/public-build-stage-capsule-canary.yml";
|
|
14
|
-
export const
|
|
14
|
+
export const PUBLIC_DOGFOOD_ALPHA_REF = "v4-alpha";
|
|
15
15
|
const PRIVATE_CONSUMER = ["buildchain", "self", "dogfood"].join("-");
|
|
16
16
|
const PRIVATE_SHADOW = ["kungfu", "shadow"].join("-");
|
|
17
17
|
|
|
18
|
-
export function
|
|
18
|
+
export function expectedPublicDogfoodWorkflow(validationRef) {
|
|
19
19
|
return `name: V4 Public Consumer Dogfood
|
|
20
20
|
|
|
21
21
|
on:
|
|
@@ -109,7 +109,7 @@ function assertWorkflowInventory(root) {
|
|
|
109
109
|
}
|
|
110
110
|
if (
|
|
111
111
|
relative !== REUSABLE_PATH &&
|
|
112
|
-
text.includes("scripts/
|
|
112
|
+
text.includes("scripts/stage-capsule-qualification.mjs")
|
|
113
113
|
)
|
|
114
114
|
fail(`${relative} invokes the private qualification script directly`);
|
|
115
115
|
if (
|
|
@@ -136,7 +136,7 @@ function assertProtectedVerify(root) {
|
|
|
136
136
|
for (const forbidden of [
|
|
137
137
|
"stage-capsule-qualification:",
|
|
138
138
|
"stage-capsule-qualification-reconciliation:",
|
|
139
|
-
"scripts/
|
|
139
|
+
"scripts/stage-capsule-qualification.mjs",
|
|
140
140
|
])
|
|
141
141
|
if (verify.includes(forbidden))
|
|
142
142
|
fail(`Verify retains private dogfood path ${forbidden}`);
|
|
@@ -145,14 +145,14 @@ function assertProtectedVerify(root) {
|
|
|
145
145
|
function assertArchitecture(root) {
|
|
146
146
|
const architecture = exactJson(
|
|
147
147
|
root,
|
|
148
|
-
"architecture/
|
|
148
|
+
"architecture/stage-capsule-qualification.json",
|
|
149
149
|
);
|
|
150
150
|
const dogfood = architecture.publicConsumerDogfood;
|
|
151
151
|
const validationRef = dogfood?.validationRef;
|
|
152
|
-
if (validationRef !==
|
|
152
|
+
if (validationRef !== PUBLIC_DOGFOOD_ALPHA_REF)
|
|
153
153
|
fail("architecture validationRef must use the floating v4-alpha channel");
|
|
154
154
|
const caller = read(root, CALLER_PATH);
|
|
155
|
-
if (caller !==
|
|
155
|
+
if (caller !== expectedPublicDogfoodWorkflow(validationRef))
|
|
156
156
|
fail(`${CALLER_PATH} must remain the exact thin public consumer caller`);
|
|
157
157
|
if (JSON.stringify(architecture.campaign?.consumers) !== '["buildchain"]')
|
|
158
158
|
fail(
|
|
@@ -218,10 +218,10 @@ function assertConsumerLifecycle(root) {
|
|
|
218
218
|
|
|
219
219
|
function assertPolicySources(root) {
|
|
220
220
|
for (const relative of [
|
|
221
|
-
"packages/core/
|
|
222
|
-
"packages/core/
|
|
223
|
-
"scripts/
|
|
224
|
-
"architecture/
|
|
221
|
+
"packages/core/stage-capsule-qualification.js",
|
|
222
|
+
"packages/core/stage-capsule-qualification-campaign.js",
|
|
223
|
+
"scripts/stage-capsule-qualification.mjs",
|
|
224
|
+
"architecture/stage-capsule-qualification.json",
|
|
225
225
|
"docs/v4-stage-capsule.md",
|
|
226
226
|
])
|
|
227
227
|
assertNoPrivateMarkers(relative, read(root, relative));
|
|
@@ -231,7 +231,7 @@ function assertPolicySources(root) {
|
|
|
231
231
|
"same public reusable-workflow contract as every other consumer",
|
|
232
232
|
"No agent may add or restore a relative/self reusable-workflow call",
|
|
233
233
|
"never solve recursion with an internal exception",
|
|
234
|
-
"scripts/check-
|
|
234
|
+
"scripts/check-public-dogfood-contract.mjs",
|
|
235
235
|
"source-persisted exact commit SHA",
|
|
236
236
|
"v4-alpha",
|
|
237
237
|
])
|
|
@@ -241,13 +241,13 @@ function assertPolicySources(root) {
|
|
|
241
241
|
const packageJson = exactJson(root, "package.json");
|
|
242
242
|
if (
|
|
243
243
|
!String(packageJson.scripts?.check || "").includes(
|
|
244
|
-
"node scripts/check-
|
|
244
|
+
"node scripts/check-public-dogfood-contract.mjs",
|
|
245
245
|
)
|
|
246
246
|
)
|
|
247
247
|
fail("pnpm run check does not include the public dogfood gate");
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
-
export function
|
|
250
|
+
export function checkPublicDogfoodContract(root = DEFAULT_ROOT) {
|
|
251
251
|
assertReusableWorkflow(root);
|
|
252
252
|
assertWorkflowInventory(root);
|
|
253
253
|
assertProtectedVerify(root);
|
|
@@ -270,7 +270,7 @@ if (
|
|
|
270
270
|
path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)
|
|
271
271
|
) {
|
|
272
272
|
try {
|
|
273
|
-
process.stdout.write(`${JSON.stringify(
|
|
273
|
+
process.stdout.write(`${JSON.stringify(checkPublicDogfoodContract())}\n`);
|
|
274
274
|
} catch (error) {
|
|
275
275
|
process.stderr.write(`${error.message}\n`);
|
|
276
276
|
process.exitCode = 1;
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "../packages/core/workflow-yaml-contract.js";
|
|
15
15
|
|
|
16
16
|
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
17
|
-
const ledgerPath = path.join(root, "architecture/
|
|
17
|
+
const ledgerPath = path.join(root, "architecture/release-topology.json");
|
|
18
18
|
|
|
19
19
|
function read(relative) {
|
|
20
20
|
return fs.readFileSync(path.join(root, relative), "utf8");
|
|
@@ -22,10 +22,11 @@ function read(relative) {
|
|
|
22
22
|
|
|
23
23
|
const LOCAL_MODULE_EXTENSIONS = ["", ".js", ".mjs", ".cjs"];
|
|
24
24
|
const PRIVILEGED_ENTRYPOINTS = [
|
|
25
|
-
"actions/
|
|
25
|
+
"actions/release-candidate-promote/index.js",
|
|
26
26
|
"scripts/binary-publication-evidence.mjs",
|
|
27
27
|
"scripts/next-development-review.mjs",
|
|
28
|
-
"scripts/
|
|
28
|
+
"scripts/oci-compose-preview.mjs",
|
|
29
|
+
"scripts/publication-settlement.mjs",
|
|
29
30
|
];
|
|
30
31
|
|
|
31
32
|
export function localModuleSpecifiers(source) {
|
|
@@ -137,12 +138,12 @@ function productionFiles(relative, extensions) {
|
|
|
137
138
|
function matchingProductionFiles(roots, extensions, pattern) {
|
|
138
139
|
return roots
|
|
139
140
|
.flatMap((relative) => productionFiles(relative, extensions))
|
|
140
|
-
.filter((relative) => relative !== "scripts/check-
|
|
141
|
+
.filter((relative) => relative !== "scripts/check-release-topology.mjs")
|
|
141
142
|
.filter((relative) => pattern.test(read(relative)))
|
|
142
143
|
.sort();
|
|
143
144
|
}
|
|
144
145
|
|
|
145
|
-
export function
|
|
146
|
+
export function discoverReleaseAuthorityClosure() {
|
|
146
147
|
const providerPlane = matchingProductionFiles(
|
|
147
148
|
["actions", "packages/core"],
|
|
148
149
|
[".js", ".mjs", ".cjs"],
|
|
@@ -151,19 +152,19 @@ export function discoverV4ReleaseAuthorityClosure() {
|
|
|
151
152
|
const runtimeSelectors = matchingProductionFiles(
|
|
152
153
|
[".github/workflows", "scripts", "packages/core"],
|
|
153
154
|
[".yml", ".yaml", ".js", ".mjs", ".cjs"],
|
|
154
|
-
/(?:promotion-runtime-sha|resume-buildchain-runtime-sha|BUILDCHAIN_(?:CURRENT_RUNTIME_SHA|RUNTIME_REF|RESUME_CANDIDATE_RUN_ID)|
|
|
155
|
+
/(?:promotion-runtime-sha|resume-buildchain-runtime-sha|BUILDCHAIN_(?:CURRENT_RUNTIME_SHA|RUNTIME_REF|RESUME_CANDIDATE_RUN_ID)|authorizeRuntimeSelection|scanRuntimeSelectorPersistence|release-candidate-adapter)/u,
|
|
155
156
|
);
|
|
156
157
|
const terminalProjections = matchingProductionFiles(
|
|
157
158
|
[".github/workflows", "actions", "packages/core", "scripts"],
|
|
158
159
|
[".yml", ".yaml", ".js", ".mjs", ".cjs"],
|
|
159
|
-
/(?:
|
|
160
|
+
/(?:createReleaseReceipt|release-receipt\.json|RELEASE_RECEIPT_CONTRACT)/u,
|
|
160
161
|
);
|
|
161
162
|
const privilegedModules = discoverStaticModuleClosure(PRIVILEGED_ENTRYPOINTS);
|
|
162
|
-
const rustWasmArtifact = "packages/core/buildchain-
|
|
163
|
+
const rustWasmArtifact = "packages/core/buildchain-domain.wasm";
|
|
163
164
|
const rustWasmDistributions = [
|
|
164
|
-
"actions/promote-buildchain-ref/dist/buildchain-
|
|
165
|
-
"actions/release-tail/dist/buildchain-
|
|
166
|
-
"actions/
|
|
165
|
+
"actions/promote-buildchain-ref/dist/buildchain-domain.wasm",
|
|
166
|
+
"actions/release-tail/dist/buildchain-domain.wasm",
|
|
167
|
+
"actions/release-candidate-promote/dist/buildchain-domain.wasm",
|
|
167
168
|
];
|
|
168
169
|
const legacyEngineModules = productionFiles(
|
|
169
170
|
"actions/promote-buildchain-ref",
|
|
@@ -183,7 +184,7 @@ export function discoverV4ReleaseAuthorityClosure() {
|
|
|
183
184
|
]),
|
|
184
185
|
].sort(),
|
|
185
186
|
runtimeSelectors,
|
|
186
|
-
runtimeEngines: ["actions/
|
|
187
|
+
runtimeEngines: ["actions/release-candidate-promote/index.js"],
|
|
187
188
|
terminalProjections,
|
|
188
189
|
privilegedExecutableClosure: {
|
|
189
190
|
entrypoints: PRIVILEGED_ENTRYPOINTS,
|
|
@@ -191,8 +192,8 @@ export function discoverV4ReleaseAuthorityClosure() {
|
|
|
191
192
|
root: rootedPathSet(privilegedModules),
|
|
192
193
|
},
|
|
193
194
|
rustWasmAuthority: {
|
|
194
|
-
loader: "packages/core/
|
|
195
|
-
metadata: "packages/core/
|
|
195
|
+
loader: "packages/core/domain-wasm.js",
|
|
196
|
+
metadata: "packages/core/domain-wasm-artifact.js",
|
|
196
197
|
artifact: rustWasmArtifact,
|
|
197
198
|
artifactRoot: fileSha256(rustWasmArtifact),
|
|
198
199
|
distributedArtifacts: rustWasmDistributions,
|
|
@@ -233,13 +234,21 @@ function workflowSnapshot(relative) {
|
|
|
233
234
|
.map((job) => {
|
|
234
235
|
const block = jobBlock(source, job.id);
|
|
235
236
|
const uses = job.uses || null;
|
|
237
|
+
// A built-in publisher still requires mutation authority when the caller supplies its envelope.
|
|
238
|
+
const inheritedPublisher =
|
|
239
|
+
!/^ permissions:/mu.test(block) &&
|
|
240
|
+
/uses:.*actions\/release-candidate-promote/u.test(block);
|
|
236
241
|
return {
|
|
237
242
|
id: job.id,
|
|
238
243
|
kind: uses ? "reusable-call" : "runner",
|
|
239
244
|
uses,
|
|
240
245
|
permissions: {
|
|
241
|
-
contents:
|
|
242
|
-
|
|
246
|
+
contents:
|
|
247
|
+
permission(block, "contents") ||
|
|
248
|
+
(inheritedPublisher ? "inherited" : null),
|
|
249
|
+
idToken:
|
|
250
|
+
permission(block, "id-token") ||
|
|
251
|
+
(inheritedPublisher ? "inherited" : null),
|
|
243
252
|
},
|
|
244
253
|
carriers: {
|
|
245
254
|
artifactDownload: /uses:\s+actions\/download-artifact@/u.test(block),
|
|
@@ -247,9 +256,11 @@ function workflowSnapshot(relative) {
|
|
|
247
256
|
jobOutput: /GITHUB_OUTPUT/u.test(block),
|
|
248
257
|
},
|
|
249
258
|
mutationSignals: [
|
|
250
|
-
/contents:\s*write/u.test(block) &&
|
|
251
|
-
|
|
252
|
-
/
|
|
259
|
+
(/contents:\s*write/u.test(block) || inheritedPublisher) &&
|
|
260
|
+
"contents-write",
|
|
261
|
+
(/id-token:\s*write/u.test(block) || inheritedPublisher) &&
|
|
262
|
+
"oidc-write",
|
|
263
|
+
/(?:promote-buildchain-ref|actions\/release-candidate-promote)/u.test(
|
|
253
264
|
block,
|
|
254
265
|
) && "promotion-runtime",
|
|
255
266
|
/(?:git push|npm publish|gh release (?:create|upload))/u.test(
|
|
@@ -270,7 +281,7 @@ function workflowSnapshot(relative) {
|
|
|
270
281
|
};
|
|
271
282
|
}
|
|
272
283
|
|
|
273
|
-
export function
|
|
284
|
+
export function discoverReleaseTopology(
|
|
274
285
|
workflowPaths,
|
|
275
286
|
semanticWorkflowPaths = workflowPaths,
|
|
276
287
|
) {
|
|
@@ -355,7 +366,7 @@ export function discoverV4ReleaseTopology(
|
|
|
355
366
|
};
|
|
356
367
|
}
|
|
357
368
|
|
|
358
|
-
export function
|
|
369
|
+
export function findUnknownReleaseTopology(
|
|
359
370
|
workflowPaths,
|
|
360
371
|
allWorkflowPaths = fs
|
|
361
372
|
.readdirSync(path.join(root, ".github/workflows"))
|
|
@@ -374,7 +385,7 @@ export function findUnknownV4ReleaseTopology(
|
|
|
374
385
|
.filter((relative) => {
|
|
375
386
|
const source = readWorkflow(relative);
|
|
376
387
|
const usesReleaseAuthority = parseYamlUses(source).some(({ value }) =>
|
|
377
|
-
/(?:release-candidate-promote|promote-buildchain-ref|
|
|
388
|
+
/(?:release-candidate-promote|promote-buildchain-ref|release-tail)/u.test(
|
|
378
389
|
value,
|
|
379
390
|
),
|
|
380
391
|
);
|
|
@@ -395,7 +406,7 @@ export function findUnknownV4ReleaseTopology(
|
|
|
395
406
|
}
|
|
396
407
|
|
|
397
408
|
function assertClosedWorld(workflowPaths) {
|
|
398
|
-
const unknown =
|
|
409
|
+
const unknown = findUnknownReleaseTopology(workflowPaths);
|
|
399
410
|
assert.deepEqual(
|
|
400
411
|
unknown,
|
|
401
412
|
[],
|
|
@@ -426,7 +437,7 @@ function assertAuthorityClosure(ledger) {
|
|
|
426
437
|
`authority closure path is not a file: ${relative}`,
|
|
427
438
|
);
|
|
428
439
|
}
|
|
429
|
-
const discovered =
|
|
440
|
+
const discovered = discoverReleaseAuthorityClosure();
|
|
430
441
|
for (const className of Object.keys(discovered))
|
|
431
442
|
assert.deepEqual(
|
|
432
443
|
closure[className],
|
|
@@ -452,7 +463,7 @@ function assertAuthorityClosure(ledger) {
|
|
|
452
463
|
`legacy release engines remain reachable from APPLY: ${reachableLegacyEngines.join(", ")}`,
|
|
453
464
|
);
|
|
454
465
|
assert.deepEqual(closure.runtimeEngines, [
|
|
455
|
-
"actions/
|
|
466
|
+
"actions/release-candidate-promote/index.js",
|
|
456
467
|
]);
|
|
457
468
|
assert.equal(
|
|
458
469
|
closure.freshEntry,
|
|
@@ -479,7 +490,7 @@ function assertAuthorityClosure(ledger) {
|
|
|
479
490
|
);
|
|
480
491
|
assert.match(
|
|
481
492
|
canonicalWorkflow,
|
|
482
|
-
/scripts\/
|
|
493
|
+
/scripts\/release-candidate-adapter\.mjs/u,
|
|
483
494
|
);
|
|
484
495
|
assert.match(
|
|
485
496
|
canonicalWorkflow,
|
|
@@ -487,12 +498,23 @@ function assertAuthorityClosure(ledger) {
|
|
|
487
498
|
);
|
|
488
499
|
}
|
|
489
500
|
|
|
490
|
-
export function
|
|
501
|
+
export function checkReleaseTopology() {
|
|
491
502
|
const ledger = JSON.parse(fs.readFileSync(ledgerPath, "utf8"));
|
|
492
503
|
assert.equal(ledger.contract, "kungfu-buildchain-v4-release-topology/v1");
|
|
493
504
|
assertClosedWorld(ledger.closedWorld.workflowPaths);
|
|
494
505
|
assertAuthorityClosure(ledger);
|
|
495
|
-
const
|
|
506
|
+
const preview = ledger.postPublicationScope;
|
|
507
|
+
assert.deepEqual(preview.workflowPaths, [
|
|
508
|
+
".github/workflows/public-release-oci-compose-preview.yml",
|
|
509
|
+
]);
|
|
510
|
+
const previewTopology = discoverReleaseTopology(
|
|
511
|
+
preview.workflowPaths,
|
|
512
|
+
preview.workflowPaths,
|
|
513
|
+
);
|
|
514
|
+
assert.equal(previewTopology.semanticMetrics.contentsWriteJobCount, 1);
|
|
515
|
+
assert.equal(previewTopology.semanticMetrics.oidcWriteJobCount, 0);
|
|
516
|
+
assert.deepEqual(preview.observedTopology, previewTopology);
|
|
517
|
+
const actual = discoverReleaseTopology(
|
|
496
518
|
ledger.closedWorld.workflowPaths,
|
|
497
519
|
ledger.semanticScope.workflowPaths,
|
|
498
520
|
);
|
|
@@ -526,13 +548,13 @@ if (
|
|
|
526
548
|
) {
|
|
527
549
|
if (process.argv.includes("--print-closure")) {
|
|
528
550
|
process.stdout.write(
|
|
529
|
-
`${JSON.stringify(
|
|
551
|
+
`${JSON.stringify(discoverReleaseAuthorityClosure(), null, 2)}\n`,
|
|
530
552
|
);
|
|
531
553
|
} else if (process.argv.includes("--print")) {
|
|
532
554
|
const ledger = JSON.parse(fs.readFileSync(ledgerPath, "utf8"));
|
|
533
555
|
process.stdout.write(
|
|
534
556
|
`${JSON.stringify(
|
|
535
|
-
|
|
557
|
+
discoverReleaseTopology(
|
|
536
558
|
ledger.closedWorld.workflowPaths,
|
|
537
559
|
ledger.semanticScope.workflowPaths,
|
|
538
560
|
),
|
|
@@ -541,7 +563,7 @@ if (
|
|
|
541
563
|
)}\n`,
|
|
542
564
|
);
|
|
543
565
|
} else {
|
|
544
|
-
|
|
566
|
+
checkReleaseTopology();
|
|
545
567
|
process.stdout.write("v4 release topology: ok\n");
|
|
546
568
|
}
|
|
547
569
|
}
|
package/scripts/{check-v4-runtime-semantic-closure.mjs → check-runtime-semantic-closure.mjs}
RENAMED
|
@@ -4,10 +4,10 @@ import fs from "node:fs";
|
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { pathToFileURL } from "node:url";
|
|
6
6
|
|
|
7
|
-
export const
|
|
7
|
+
export const RUNTIME_SEMANTIC_CLOSURE_CONTRACT =
|
|
8
8
|
"kungfu-buildchain-v4-runtime-semantic-closure";
|
|
9
|
-
export const
|
|
10
|
-
"architecture/
|
|
9
|
+
export const RUNTIME_SEMANTIC_CLOSURE_PATH =
|
|
10
|
+
"architecture/runtime-semantic-closure.json";
|
|
11
11
|
export const REQUIRED_RUNTIME_EVIDENCE = Object.freeze([
|
|
12
12
|
"positive",
|
|
13
13
|
"negative",
|
|
@@ -159,17 +159,20 @@ function validateAuthority(capability, stateMachine, issues) {
|
|
|
159
159
|
|
|
160
160
|
export function validateRuntimeSemanticClosure({
|
|
161
161
|
root = process.cwd(),
|
|
162
|
-
manifest = loadJson(root,
|
|
163
|
-
v3Inventory = loadJson(
|
|
164
|
-
v4Manifest = loadJson(
|
|
162
|
+
manifest = loadJson(root, RUNTIME_SEMANTIC_CLOSURE_PATH),
|
|
163
|
+
v3Inventory: baselineInventory = loadJson(
|
|
165
164
|
root,
|
|
166
|
-
"architecture/
|
|
165
|
+
"architecture/baseline-core-mechanism-inventory.json",
|
|
166
|
+
),
|
|
167
|
+
v4Manifest: domainManifest = loadJson(
|
|
168
|
+
root,
|
|
169
|
+
"architecture/capability-state-machine-manifest.json",
|
|
167
170
|
),
|
|
168
171
|
} = {}) {
|
|
169
172
|
const issues = [];
|
|
170
173
|
if (
|
|
171
174
|
manifest?.schemaVersion !== 1 ||
|
|
172
|
-
manifest?.contract !==
|
|
175
|
+
manifest?.contract !== RUNTIME_SEMANTIC_CLOSURE_CONTRACT
|
|
173
176
|
)
|
|
174
177
|
issues.push(
|
|
175
178
|
"runtime semantic closure contract or schemaVersion is invalid",
|
|
@@ -178,13 +181,13 @@ export function validateRuntimeSemanticClosure({
|
|
|
178
181
|
issues.push("runtime semantic closure evidence dimensions drifted");
|
|
179
182
|
|
|
180
183
|
const mechanisms = new Map(
|
|
181
|
-
(
|
|
184
|
+
(baselineInventory.mechanisms || []).map((entry) => [entry.id, entry]),
|
|
182
185
|
);
|
|
183
|
-
const
|
|
184
|
-
(
|
|
186
|
+
const domainCapabilities = new Map(
|
|
187
|
+
(domainManifest.capabilities || []).map((entry) => [entry.id, entry]),
|
|
185
188
|
);
|
|
186
189
|
const stateMachines = new Map(
|
|
187
|
-
(
|
|
190
|
+
(domainManifest.stateMachines || []).map((entry) => [entry.id, entry]),
|
|
188
191
|
);
|
|
189
192
|
const capabilities = Array.isArray(manifest?.capabilities)
|
|
190
193
|
? manifest.capabilities
|
|
@@ -201,7 +204,7 @@ export function validateRuntimeSemanticClosure({
|
|
|
201
204
|
if (
|
|
202
205
|
!sameMembers(
|
|
203
206
|
capabilities.map((entry) => entry.id),
|
|
204
|
-
|
|
207
|
+
domainCapabilities.keys(),
|
|
205
208
|
)
|
|
206
209
|
)
|
|
207
210
|
issues.push(
|
|
@@ -219,15 +222,15 @@ export function validateRuntimeSemanticClosure({
|
|
|
219
222
|
}
|
|
220
223
|
ids.add(capability.id);
|
|
221
224
|
const mechanism = mechanisms.get(capability.id);
|
|
222
|
-
const
|
|
223
|
-
if (!mechanism || !
|
|
225
|
+
const domainCapability = domainCapabilities.get(capability.id);
|
|
226
|
+
if (!mechanism || !domainCapability) continue;
|
|
224
227
|
if (capability.sourceMechanismId !== capability.id)
|
|
225
228
|
issues.push(`${capability.id}: source mechanism identity drifted`);
|
|
226
229
|
validateImplementation(root, mechanism, capability, issues);
|
|
227
230
|
validateResidualClosure(mechanism, capability, issues);
|
|
228
231
|
validateEvidence(root, mechanism, capability, issues);
|
|
229
232
|
validateAuthority(capability, stateMachines.get(capability.id), issues);
|
|
230
|
-
for (const surface of
|
|
233
|
+
for (const surface of domainCapability.surfaces || []) {
|
|
231
234
|
if (!surfaces.has(surface))
|
|
232
235
|
issues.push(
|
|
233
236
|
`${capability.id}: executable v4 surface is absent: ${surface}`,
|
package/scripts/{check-v4-universal-workflow-bootstrap.mjs → check-universal-workflow-bootstrap.mjs}
RENAMED
|
@@ -8,16 +8,16 @@ import { fileURLToPath } from "node:url";
|
|
|
8
8
|
|
|
9
9
|
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
10
10
|
const contract = JSON.parse(
|
|
11
|
-
fs.readFileSync(
|
|
12
|
-
path.join(root, "architecture/v4-universal-workflow-bootstrap.json"),
|
|
13
|
-
"utf8",
|
|
14
|
-
),
|
|
11
|
+
fs.readFileSync(path.join(root, "architecture/universal-workflow-bootstrap.json"), "utf8"),
|
|
15
12
|
);
|
|
16
13
|
const admissionPolicy = JSON.parse(
|
|
17
|
-
fs.readFileSync(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
fs.readFileSync(path.join(root, "architecture/universal-workflow-train-admission.json"), "utf8"),
|
|
15
|
+
);
|
|
16
|
+
const admissionObservedAt = Date.now();
|
|
17
|
+
assert.ok(
|
|
18
|
+
admissionObservedAt >= Date.parse(admissionPolicy.validFrom) &&
|
|
19
|
+
admissionObservedAt < Date.parse(admissionPolicy.expiresAt),
|
|
20
|
+
`release admission policy is outside its validity window (${admissionPolicy.validFrom} to ${admissionPolicy.expiresAt}); renew it through protected review before publishing`,
|
|
21
21
|
);
|
|
22
22
|
const fileRoot = (relative) =>
|
|
23
23
|
`sha256:${crypto
|
|
@@ -131,12 +131,12 @@ assert.ok(!admissionPolicy.allowedCapabilities.includes("workflow-contract"));
|
|
|
131
131
|
assert.deepEqual(
|
|
132
132
|
admissionPolicy.contractRoots,
|
|
133
133
|
[
|
|
134
|
-
fileRoot("architecture/
|
|
134
|
+
fileRoot("architecture/universal-workflow-bootstrap.json"),
|
|
135
135
|
fileRoot(contract.bootstrap.faultCampaign),
|
|
136
|
-
fileRoot("packages/core/
|
|
137
|
-
fileRoot("scripts/
|
|
138
|
-
fileRoot("scripts/
|
|
139
|
-
fileRoot("scripts/
|
|
136
|
+
fileRoot("packages/core/universal-workflow-bootstrap.js"),
|
|
137
|
+
fileRoot("scripts/universal-workflow-backflow.mjs"),
|
|
138
|
+
fileRoot("scripts/universal-workflow-engine.mjs"),
|
|
139
|
+
fileRoot("scripts/universal-workflow-self-dogfood.mjs"),
|
|
140
140
|
fileRoot(contract.bootstrap.publicWorkflow),
|
|
141
141
|
].sort(),
|
|
142
142
|
);
|
|
@@ -171,7 +171,7 @@ assert.match(
|
|
|
171
171
|
assert.match(bootstrapSource, /settle:[\s\S]*needs: \[admit, execute\]/u);
|
|
172
172
|
assert.match(
|
|
173
173
|
bootstrapSource,
|
|
174
|
-
/ascii_downcase\) == "kungfu-origin"[\s\S]*\.name == "check"[\s\S]*map\(select\(\.status == "completed" and \(\.conclusion \/\/ ""\) != ""\)\)[\s\S]*candidate\/architecture\/
|
|
174
|
+
/ascii_downcase\) == "kungfu-origin"[\s\S]*\.name == "check"[\s\S]*map\(select\(\.status == "completed" and \(\.conclusion \/\/ ""\) != ""\)\)[\s\S]*candidate\/architecture\/universal-workflow-train-admission\.json/u,
|
|
175
175
|
);
|
|
176
176
|
assert.match(
|
|
177
177
|
bootstrapSource,
|
|
@@ -3,11 +3,11 @@ import fs from "node:fs";
|
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} from "../packages/core/
|
|
6
|
+
certifyFloatingConsumerPolicyReceipt,
|
|
7
|
+
resolveFloatingConsumerPolicyAuthority,
|
|
8
|
+
scanFloatingConsumerPolicy,
|
|
9
|
+
consumerPolicyScannerRoot,
|
|
10
|
+
} from "../packages/core/floating-consumer-policy.js";
|
|
11
11
|
import { writeGitHubOutputs } from "./build-contract-core.mjs";
|
|
12
12
|
const RUNTIME_ROOT = path.resolve(import.meta.dirname, "..");
|
|
13
13
|
function parseArgs(argv) {
|
|
@@ -36,7 +36,7 @@ function writeJson(file, value) {
|
|
|
36
36
|
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
37
37
|
fs.writeFileSync(file, `${JSON.stringify(value, null, 2)}\n`);
|
|
38
38
|
}
|
|
39
|
-
export {
|
|
39
|
+
export { consumerPolicyScannerRoot };
|
|
40
40
|
export function scanCommand(options = {}) {
|
|
41
41
|
const root = path.resolve(
|
|
42
42
|
options.root || env("BUILDCHAIN_CONSUMER_ROOT", process.cwd()),
|
|
@@ -49,13 +49,13 @@ export function scanCommand(options = {}) {
|
|
|
49
49
|
options.output ||
|
|
50
50
|
env(
|
|
51
51
|
"BUILDCHAIN_V4_POLICY_RECEIPT_PATH",
|
|
52
|
-
".buildchain/evidence/
|
|
52
|
+
".buildchain/evidence/consumer-policy-receipt.json",
|
|
53
53
|
),
|
|
54
54
|
);
|
|
55
55
|
const policy = readJson(
|
|
56
|
-
path.join(RUNTIME_ROOT, "architecture/
|
|
56
|
+
path.join(RUNTIME_ROOT, "architecture/floating-consumer-policy.json"),
|
|
57
57
|
);
|
|
58
|
-
const result =
|
|
58
|
+
const result = scanFloatingConsumerPolicy({
|
|
59
59
|
root,
|
|
60
60
|
invocationRoot,
|
|
61
61
|
repository: options.repository || env("GITHUB_REPOSITORY"),
|
|
@@ -86,7 +86,7 @@ export function scanCommand(options = {}) {
|
|
|
86
86
|
".buildchain/alpha-contract-lock.json",
|
|
87
87
|
),
|
|
88
88
|
policy,
|
|
89
|
-
scannerRoot:
|
|
89
|
+
scannerRoot: consumerPolicyScannerRoot(),
|
|
90
90
|
});
|
|
91
91
|
writeJson(output, result);
|
|
92
92
|
writeGitHubOutputs({
|
|
@@ -137,13 +137,13 @@ export function certifyCommand(options = {}) {
|
|
|
137
137
|
receipt?.invocation?.workflow;
|
|
138
138
|
const resolvedRuntimeSha =
|
|
139
139
|
options.resolvedRuntimeSha || env("BUILDCHAIN_EXPECTED_RUNTIME_SHA");
|
|
140
|
-
const authority =
|
|
140
|
+
const authority = resolveFloatingConsumerPolicyAuthority({
|
|
141
141
|
runtimeRoot: RUNTIME_ROOT,
|
|
142
142
|
callerRoot,
|
|
143
143
|
stableLockPath,
|
|
144
144
|
alphaLockPath,
|
|
145
145
|
});
|
|
146
|
-
const authorityScan =
|
|
146
|
+
const authorityScan = scanFloatingConsumerPolicy({
|
|
147
147
|
root: callerRoot,
|
|
148
148
|
repository,
|
|
149
149
|
sourceSha,
|
|
@@ -163,7 +163,7 @@ export function certifyCommand(options = {}) {
|
|
|
163
163
|
scannerRoot: authority.scannerRoot,
|
|
164
164
|
contractLocks: authority.contractLocks,
|
|
165
165
|
};
|
|
166
|
-
const result =
|
|
166
|
+
const result = certifyFloatingConsumerPolicyReceipt({
|
|
167
167
|
receipt,
|
|
168
168
|
receiptRoot,
|
|
169
169
|
expectedReceiptRoot: authorityScan.receiptRoot,
|
|
@@ -183,7 +183,7 @@ export function certifyCommand(options = {}) {
|
|
|
183
183
|
options.output ||
|
|
184
184
|
env(
|
|
185
185
|
"BUILDCHAIN_V4_POLICY_CERTIFICATION_PATH",
|
|
186
|
-
".buildchain/evidence/
|
|
186
|
+
".buildchain/evidence/consumer-policy-certification.json",
|
|
187
187
|
),
|
|
188
188
|
);
|
|
189
189
|
const documentWithAuthority = {
|
|
@@ -211,7 +211,7 @@ function main(argv = process.argv.slice(2)) {
|
|
|
211
211
|
? certifyCommand(options)
|
|
212
212
|
: (() => {
|
|
213
213
|
throw new Error(
|
|
214
|
-
"usage:
|
|
214
|
+
"usage: consumer-policy.mjs <scan|certify> [--option value]",
|
|
215
215
|
);
|
|
216
216
|
})();
|
|
217
217
|
process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
|
|
@@ -5,10 +5,10 @@ import { fileURLToPath } from "node:url";
|
|
|
5
5
|
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
6
6
|
const destination = path.resolve(process.argv[2] || "");
|
|
7
7
|
if (!process.argv[2] || path.basename(destination) !== "dist") {
|
|
8
|
-
throw new Error("usage: copy-
|
|
8
|
+
throw new Error("usage: copy-domain-wasm.mjs ACTION_DIST_DIRECTORY");
|
|
9
9
|
}
|
|
10
10
|
fs.mkdirSync(destination, { recursive: true });
|
|
11
11
|
fs.copyFileSync(
|
|
12
|
-
path.join(root, "packages", "core", "buildchain-
|
|
13
|
-
path.join(destination, "buildchain-
|
|
12
|
+
path.join(root, "packages", "core", "buildchain-domain.wasm"),
|
|
13
|
+
path.join(destination, "buildchain-domain.wasm"),
|
|
14
14
|
);
|
|
@@ -5,10 +5,10 @@ import fs from "node:fs";
|
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} from "../packages/core/
|
|
8
|
+
createCrossPlatformAdopterReport,
|
|
9
|
+
qualifyCrossPlatformAdopters,
|
|
10
|
+
summarizeBaselineCapabilityInventory,
|
|
11
|
+
} from "../packages/core/cross-platform-adopter-qualification.js";
|
|
12
12
|
|
|
13
13
|
function flag(name, fallback = "") {
|
|
14
14
|
const index = process.argv.indexOf(`--${name}`);
|
|
@@ -74,9 +74,9 @@ function runPlatform() {
|
|
|
74
74
|
});
|
|
75
75
|
|
|
76
76
|
const inventory = readJson(
|
|
77
|
-
path.join(runtimeRoot, "architecture/
|
|
77
|
+
path.join(runtimeRoot, "architecture/capability-parity-live-capability-inventory.json"),
|
|
78
78
|
);
|
|
79
|
-
const inventoryEvidence =
|
|
79
|
+
const inventoryEvidence = summarizeBaselineCapabilityInventory(inventory);
|
|
80
80
|
fs.mkdirSync(workRoot, { recursive: true });
|
|
81
81
|
const initialPath = path.join(workRoot, "initial-readback.json");
|
|
82
82
|
const retryPath = path.join(workRoot, "retry-readback.json");
|
|
@@ -135,7 +135,7 @@ function runPlatform() {
|
|
|
135
135
|
);
|
|
136
136
|
expectPass(neutralDriver, "independent protocol-neutral driver");
|
|
137
137
|
|
|
138
|
-
const report =
|
|
138
|
+
const report = createCrossPlatformAdopterReport({
|
|
139
139
|
platform: required("platform"),
|
|
140
140
|
consumer: required("consumer"),
|
|
141
141
|
sourceBinding: {
|
|
@@ -210,7 +210,7 @@ function collectReports(root) {
|
|
|
210
210
|
|
|
211
211
|
function aggregate() {
|
|
212
212
|
const reportsRoot = path.resolve(required("reports-root"));
|
|
213
|
-
const qualification =
|
|
213
|
+
const qualification = qualifyCrossPlatformAdopters({
|
|
214
214
|
reports: collectReports(reportsRoot),
|
|
215
215
|
consumers: repeated("consumer"),
|
|
216
216
|
});
|
|
@@ -224,5 +224,5 @@ if (mode === "run") runPlatform();
|
|
|
224
224
|
else if (mode === "aggregate") aggregate();
|
|
225
225
|
else
|
|
226
226
|
throw new Error(
|
|
227
|
-
"usage:
|
|
227
|
+
"usage: cross-platform-adopter-qualification.mjs <run|aggregate> ...",
|
|
228
228
|
);
|
package/scripts/{v4-declarative-promotion-admission.mjs → declarative-promotion-admission.mjs}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { pathToFileURL } from "node:url";
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { assertDeclarativePromotionInputs } from "../packages/core/publication-qualification.js";
|
|
5
5
|
|
|
6
|
-
export function
|
|
6
|
+
export function admitDeclarativePromotion({
|
|
7
7
|
inputs,
|
|
8
8
|
runtimeRef,
|
|
9
9
|
declarative,
|
|
@@ -21,7 +21,7 @@ export function admitV4DeclarativePromotion({
|
|
|
21
21
|
error.code = "v4-declarative-release-tail-required";
|
|
22
22
|
throw error;
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
assertDeclarativePromotionInputs(inputs);
|
|
25
25
|
return Object.freeze({ mode: "v4-declarative", admitted: true });
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -30,7 +30,7 @@ if (
|
|
|
30
30
|
import.meta.url === pathToFileURL(process.argv[1]).href
|
|
31
31
|
) {
|
|
32
32
|
try {
|
|
33
|
-
const result =
|
|
33
|
+
const result = admitDeclarativePromotion({
|
|
34
34
|
inputs: JSON.parse(process.env.BUILDCHAIN_PROMOTION_INPUTS_JSON || "{}"),
|
|
35
35
|
runtimeRef: process.env.BUILDCHAIN_RUNTIME_REF,
|
|
36
36
|
declarative: process.env.BUILDCHAIN_DECLARATIVE_RELEASE_TAIL === "true",
|