@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
|
@@ -23,8 +23,8 @@ const PLATFORM_MARKERS = Object.freeze({
|
|
|
23
23
|
"self-hosted": /\bself-hosted\b/iu,
|
|
24
24
|
windows: /\bwindows\b/iu,
|
|
25
25
|
});
|
|
26
|
-
const
|
|
27
|
-
const
|
|
26
|
+
const LIVE_PROTECTED_BRANCH = "refs/heads/dev/v4/v4.0";
|
|
27
|
+
const LIVE_PROTECTED_LINEAGE_REF = "refs/remotes/origin/dev/v4/v4.0";
|
|
28
28
|
const PROTECTED_LINEAGE_DEPTH = 256;
|
|
29
29
|
|
|
30
30
|
export function sha256(value) {
|
|
@@ -85,7 +85,7 @@ export function ensureCapabilityCutAncestor({
|
|
|
85
85
|
try {
|
|
86
86
|
execFileSync(
|
|
87
87
|
"git",
|
|
88
|
-
["fetch", "--no-tags", "--depth=
|
|
88
|
+
["fetch", "--no-tags", "--depth=256", "origin", descendantCommit],
|
|
89
89
|
{ cwd: root, stdio: "ignore" },
|
|
90
90
|
);
|
|
91
91
|
} catch {
|
|
@@ -96,7 +96,7 @@ export function ensureCapabilityCutAncestor({
|
|
|
96
96
|
assertCapabilityCutAncestor({ root, revision, descendant, label });
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
function
|
|
99
|
+
function protectedTreeWitness(root, descendant) {
|
|
100
100
|
try {
|
|
101
101
|
execFileSync(
|
|
102
102
|
"git",
|
|
@@ -105,13 +105,13 @@ function protectedV4TreeWitness(root, descendant) {
|
|
|
105
105
|
"--no-tags",
|
|
106
106
|
`--depth=${PROTECTED_LINEAGE_DEPTH}`,
|
|
107
107
|
"origin",
|
|
108
|
-
`${
|
|
108
|
+
`${LIVE_PROTECTED_BRANCH}:${LIVE_PROTECTED_LINEAGE_REF}`,
|
|
109
109
|
],
|
|
110
110
|
{ cwd: root, stdio: "ignore" },
|
|
111
111
|
);
|
|
112
112
|
} catch {
|
|
113
113
|
throw new Error(
|
|
114
|
-
`protected v4 lineage ${
|
|
114
|
+
`protected v4 lineage ${LIVE_PROTECTED_BRANCH} could not be hydrated through a bounded origin fetch`,
|
|
115
115
|
);
|
|
116
116
|
}
|
|
117
117
|
const tree = git(root, ["rev-parse", `${descendant}^{tree}`]);
|
|
@@ -120,7 +120,7 @@ function protectedV4TreeWitness(root, descendant) {
|
|
|
120
120
|
"log",
|
|
121
121
|
`--max-count=${PROTECTED_LINEAGE_DEPTH}`,
|
|
122
122
|
"--format=%H %T",
|
|
123
|
-
|
|
123
|
+
LIVE_PROTECTED_LINEAGE_REF,
|
|
124
124
|
])
|
|
125
125
|
.split("\n")
|
|
126
126
|
.map((row) => row.split(" "))
|
|
@@ -138,7 +138,7 @@ export function ensureCapabilityCutLineage({
|
|
|
138
138
|
ensureCapabilityCutAncestor({ root, revision, descendant, label });
|
|
139
139
|
return { mode: "direct-ancestry", witness: descendant };
|
|
140
140
|
} catch (directError) {
|
|
141
|
-
const witness =
|
|
141
|
+
const witness = protectedTreeWitness(root, descendant);
|
|
142
142
|
if (!witness)
|
|
143
143
|
throw new Error(
|
|
144
144
|
`${label} ${revision} is not an ancestor of ${descendant}, and ${descendant} has no tree-equivalent commit in the bounded protected v4 lineage`,
|
|
@@ -394,12 +394,12 @@ function addMechanismCatalog(
|
|
|
394
394
|
catalog,
|
|
395
395
|
mechanismInventory,
|
|
396
396
|
runtimeSemanticClosure,
|
|
397
|
-
|
|
397
|
+
isLiveBaseline,
|
|
398
398
|
) {
|
|
399
|
-
const mechanisms =
|
|
399
|
+
const mechanisms = isLiveBaseline
|
|
400
400
|
? mechanismInventory.mechanisms || []
|
|
401
401
|
: runtimeSemanticClosure.capabilities || [];
|
|
402
|
-
const relPath =
|
|
402
|
+
const relPath = isLiveBaseline
|
|
403
403
|
? "architecture/v3-core-mechanism-inventory.json"
|
|
404
404
|
: "architecture/v4-runtime-semantic-closure.json";
|
|
405
405
|
for (const mechanism of mechanisms) {
|
|
@@ -439,7 +439,7 @@ function addPlatformCatalog(catalog, root, revision, paths) {
|
|
|
439
439
|
}
|
|
440
440
|
}
|
|
441
441
|
|
|
442
|
-
export function collectRevisionCatalog({ root, revision, liveV3Revision }) {
|
|
442
|
+
export function collectRevisionCatalog({ root, revision, liveV3Revision: liveBaselineRevision }) {
|
|
443
443
|
const catalog = new Map();
|
|
444
444
|
const paths = gitPaths(root, revision);
|
|
445
445
|
const pathSet = new Set(paths);
|
|
@@ -461,7 +461,7 @@ export function collectRevisionCatalog({ root, revision, liveV3Revision }) {
|
|
|
461
461
|
"architecture/v3-core-mechanism-inventory.json",
|
|
462
462
|
);
|
|
463
463
|
const runtimeSemanticClosure =
|
|
464
|
-
revision ===
|
|
464
|
+
revision === liveBaselineRevision
|
|
465
465
|
? null
|
|
466
466
|
: gitJson(
|
|
467
467
|
root,
|
|
@@ -476,7 +476,7 @@ export function collectRevisionCatalog({ root, revision, liveV3Revision }) {
|
|
|
476
476
|
catalog,
|
|
477
477
|
mechanismInventory,
|
|
478
478
|
runtimeSemanticClosure,
|
|
479
|
-
revision ===
|
|
479
|
+
revision === liveBaselineRevision,
|
|
480
480
|
);
|
|
481
481
|
addPlatformCatalog(catalog, root, revision, paths);
|
|
482
482
|
return { catalog, paths: pathSet };
|
|
@@ -485,8 +485,8 @@ export function collectRevisionCatalog({ root, revision, liveV3Revision }) {
|
|
|
485
485
|
export function collectHistoryRows({
|
|
486
486
|
root,
|
|
487
487
|
priorRevision,
|
|
488
|
-
liveV3Revision,
|
|
489
|
-
v4Paths,
|
|
488
|
+
liveV3Revision: liveBaselineRevision,
|
|
489
|
+
v4Paths: domainPaths,
|
|
490
490
|
migrationPaths,
|
|
491
491
|
ownerAssignment,
|
|
492
492
|
}) {
|
|
@@ -494,7 +494,7 @@ export function collectHistoryRows({
|
|
|
494
494
|
"diff",
|
|
495
495
|
"--name-status",
|
|
496
496
|
priorRevision,
|
|
497
|
-
|
|
497
|
+
liveBaselineRevision,
|
|
498
498
|
]);
|
|
499
499
|
return output
|
|
500
500
|
.split("\n")
|
|
@@ -503,11 +503,11 @@ export function collectHistoryRows({
|
|
|
503
503
|
const fields = line.split("\t");
|
|
504
504
|
const sourcePath = fields.at(-1);
|
|
505
505
|
const migrationPath = migrationPaths.get(sourcePath);
|
|
506
|
-
if (!
|
|
506
|
+
if (!domainPaths.has(sourcePath) && !migrationPath)
|
|
507
507
|
throw new Error(
|
|
508
508
|
`unclassified post-family v3 history path: ${sourcePath}`,
|
|
509
509
|
);
|
|
510
|
-
if (migrationPath && !
|
|
510
|
+
if (migrationPath && !domainPaths.has(migrationPath))
|
|
511
511
|
throw new Error(
|
|
512
512
|
`history migration route is absent from the exact v4 cut: ${migrationPath}`,
|
|
513
513
|
);
|
|
@@ -20,9 +20,9 @@ const javascriptBundlePaths = readdirSync(actionsRoot, { withFileTypes: true })
|
|
|
20
20
|
const wasmBundlePaths = [
|
|
21
21
|
"promote-buildchain-ref",
|
|
22
22
|
"release-tail",
|
|
23
|
-
"
|
|
23
|
+
"release-candidate-promote",
|
|
24
24
|
].map((name) =>
|
|
25
|
-
path.join(actionsRoot, name, "dist", "buildchain-
|
|
25
|
+
path.join(actionsRoot, name, "dist", "buildchain-domain.wasm"),
|
|
26
26
|
);
|
|
27
27
|
const bundlePaths = [...javascriptBundlePaths, ...wasmBundlePaths];
|
|
28
28
|
|
package/scripts/{check-v3-v4-capability-inventory.mjs → check-capability-parity-inventory.mjs}
RENAMED
|
@@ -11,16 +11,16 @@ import {
|
|
|
11
11
|
ensureCapabilityCutLineage,
|
|
12
12
|
git,
|
|
13
13
|
sha256,
|
|
14
|
-
} from "./
|
|
14
|
+
} from "./capability-parity-catalog.mjs";
|
|
15
15
|
|
|
16
|
-
export const
|
|
16
|
+
export const BASELINE_CAPABILITY_INVENTORY_CONTRACT =
|
|
17
17
|
"kungfu-buildchain-v3-v4-live-capability-inventory";
|
|
18
|
-
export const
|
|
18
|
+
export const BASELINE_CAPABILITY_CUTS = Object.freeze({
|
|
19
19
|
priorFamilyV3: "6b96bdad8d9f8ccf9275f27d9370a226a9c78465",
|
|
20
20
|
liveV3: "8493bf140a7f567e76aff3119f3d39ff026afc84",
|
|
21
21
|
liveV4: "97edd5b93eb67e5bf36ad55726e08231b47b70c0",
|
|
22
22
|
});
|
|
23
|
-
const INVENTORY_PATH = "architecture/
|
|
23
|
+
const INVENTORY_PATH = "architecture/capability-parity-live-capability-inventory.json";
|
|
24
24
|
const ALLOWED_DISPOSITIONS = new Set([
|
|
25
25
|
"v4-native",
|
|
26
26
|
"compatibility-adapter",
|
|
@@ -30,7 +30,7 @@ const ALLOWED_DISPOSITIONS = new Set([
|
|
|
30
30
|
const ASSIGNMENTS = Object.freeze({
|
|
31
31
|
public: "2026-08-26-buildchain-v4-public-surface-compatibility-closure",
|
|
32
32
|
runtime: "2026-08-26-buildchain-v4-runtime-semantic-closure",
|
|
33
|
-
adopter: "2026-08-26-buildchain-
|
|
33
|
+
adopter: "2026-08-26-buildchain-cross-platform-adopter-qualification",
|
|
34
34
|
stable: "2026-08-26-buildchain-v4-stable-channel-capability-closure",
|
|
35
35
|
retirement: "2026-08-26-buildchain-v4-v3-retirement-reconciliation",
|
|
36
36
|
});
|
|
@@ -93,7 +93,7 @@ function capabilityCutAvailable(root, revision) {
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
function ensureCapabilityCutsAvailable(root) {
|
|
96
|
-
const revisions = Object.values(
|
|
96
|
+
const revisions = Object.values(BASELINE_CAPABILITY_CUTS);
|
|
97
97
|
const missing = revisions.filter(
|
|
98
98
|
(revision) => !capabilityCutAvailable(root, revision),
|
|
99
99
|
);
|
|
@@ -114,7 +114,7 @@ function ensureCapabilityCutsAvailable(root) {
|
|
|
114
114
|
}
|
|
115
115
|
ensureCapabilityCutLineage({
|
|
116
116
|
root,
|
|
117
|
-
revision:
|
|
117
|
+
revision: BASELINE_CAPABILITY_CUTS.liveV4,
|
|
118
118
|
label: "live v4 capability cut",
|
|
119
119
|
});
|
|
120
120
|
}
|
|
@@ -233,14 +233,14 @@ function rowFromCatalogEntry(source, targetCatalog) {
|
|
|
233
233
|
const migratedId = MIGRATION_ROUTES.get(source.id);
|
|
234
234
|
const migrated = migratedId ? targetCatalog.get(migratedId) : undefined;
|
|
235
235
|
let disposition;
|
|
236
|
-
let
|
|
236
|
+
let route = null;
|
|
237
237
|
let residual = null;
|
|
238
238
|
if (direct) {
|
|
239
239
|
disposition = "v4-native";
|
|
240
|
-
|
|
240
|
+
route = { capabilityId: direct.id, evidence: direct.evidence };
|
|
241
241
|
} else if (migrated) {
|
|
242
242
|
disposition = "executable-migration";
|
|
243
|
-
|
|
243
|
+
route = { capabilityId: migrated.id, evidence: migrated.evidence };
|
|
244
244
|
} else if (PUBLIC_SURFACE_CLOSURE_IDS.has(source.id)) {
|
|
245
245
|
disposition = "owned-missing";
|
|
246
246
|
residual = {
|
|
@@ -257,7 +257,7 @@ function rowFromCatalogEntry(source, targetCatalog) {
|
|
|
257
257
|
disposition,
|
|
258
258
|
ownerAssignment,
|
|
259
259
|
sourceEvidence: source.evidence,
|
|
260
|
-
v4Route,
|
|
260
|
+
v4Route: route,
|
|
261
261
|
residual,
|
|
262
262
|
positiveProbe:
|
|
263
263
|
disposition === "owned-missing"
|
|
@@ -279,33 +279,33 @@ function sourceCut(root, commit, role) {
|
|
|
279
279
|
};
|
|
280
280
|
}
|
|
281
281
|
|
|
282
|
-
export function
|
|
282
|
+
export function buildBaselineCapabilityInventory({ root = process.cwd() } = {}) {
|
|
283
283
|
ensureCapabilityCutsAvailable(root);
|
|
284
284
|
git(root, [
|
|
285
285
|
"merge-base",
|
|
286
286
|
"--is-ancestor",
|
|
287
|
-
|
|
288
|
-
|
|
287
|
+
BASELINE_CAPABILITY_CUTS.priorFamilyV3,
|
|
288
|
+
BASELINE_CAPABILITY_CUTS.liveV3,
|
|
289
289
|
]);
|
|
290
|
-
const
|
|
290
|
+
const baseline = collectRevisionCatalog({
|
|
291
291
|
root,
|
|
292
|
-
revision:
|
|
293
|
-
liveV3Revision:
|
|
292
|
+
revision: BASELINE_CAPABILITY_CUTS.liveV3,
|
|
293
|
+
liveV3Revision: BASELINE_CAPABILITY_CUTS.liveV3,
|
|
294
294
|
});
|
|
295
|
-
const
|
|
295
|
+
const domain = collectRevisionCatalog({
|
|
296
296
|
root,
|
|
297
|
-
revision:
|
|
298
|
-
liveV3Revision:
|
|
297
|
+
revision: BASELINE_CAPABILITY_CUTS.liveV4,
|
|
298
|
+
liveV3Revision: BASELINE_CAPABILITY_CUTS.liveV3,
|
|
299
299
|
});
|
|
300
300
|
const rows = [
|
|
301
|
-
...[...
|
|
302
|
-
rowFromCatalogEntry(entry,
|
|
301
|
+
...[...baseline.catalog.values()].map((entry) =>
|
|
302
|
+
rowFromCatalogEntry(entry, domain.catalog),
|
|
303
303
|
),
|
|
304
304
|
...collectHistoryRows({
|
|
305
305
|
root,
|
|
306
|
-
priorRevision:
|
|
307
|
-
liveV3Revision:
|
|
308
|
-
v4Paths:
|
|
306
|
+
priorRevision: BASELINE_CAPABILITY_CUTS.priorFamilyV3,
|
|
307
|
+
liveV3Revision: BASELINE_CAPABILITY_CUTS.liveV3,
|
|
308
|
+
v4Paths: domain.paths,
|
|
309
309
|
migrationPaths: HISTORY_MIGRATION_PATHS,
|
|
310
310
|
ownerAssignment: ASSIGNMENTS.retirement,
|
|
311
311
|
}),
|
|
@@ -313,24 +313,24 @@ export function buildV3V4CapabilityInventory({ root = process.cwd() } = {}) {
|
|
|
313
313
|
const changedPaths = rows.filter((row) => row.category === "history-change");
|
|
314
314
|
const prior = sourceCut(
|
|
315
315
|
root,
|
|
316
|
-
|
|
316
|
+
BASELINE_CAPABILITY_CUTS.priorFamilyV3,
|
|
317
317
|
"previous-absorption-family-capture",
|
|
318
318
|
);
|
|
319
|
-
const
|
|
319
|
+
const baselineCut = sourceCut(
|
|
320
320
|
root,
|
|
321
|
-
|
|
321
|
+
BASELINE_CAPABILITY_CUTS.liveV3,
|
|
322
322
|
"execution-time-protected-read-only-reference",
|
|
323
323
|
);
|
|
324
|
-
const
|
|
324
|
+
const currentCut = sourceCut(
|
|
325
325
|
root,
|
|
326
|
-
|
|
326
|
+
BASELINE_CAPABILITY_CUTS.liveV4,
|
|
327
327
|
"execution-time-protected-target",
|
|
328
328
|
);
|
|
329
|
-
|
|
329
|
+
currentCut.branch = "origin/dev/v4/v4.0";
|
|
330
330
|
const inventory = {
|
|
331
331
|
schemaVersion: 1,
|
|
332
|
-
contract:
|
|
333
|
-
sourceCuts: { priorFamilyV3: prior, liveV3, liveV4 },
|
|
332
|
+
contract: BASELINE_CAPABILITY_INVENTORY_CONTRACT,
|
|
333
|
+
sourceCuts: { priorFamilyV3: prior, liveV3: baselineCut, liveV4: currentCut },
|
|
334
334
|
extraction: {
|
|
335
335
|
mode: "exact-git-object-closed-world",
|
|
336
336
|
extractor: "scripts/check-v3-v4-capability-inventory.mjs",
|
|
@@ -352,13 +352,13 @@ export function buildV3V4CapabilityInventory({ root = process.cwd() } = {}) {
|
|
|
352
352
|
residualPolicy: "exact-identity-allowlist-with-required-owner",
|
|
353
353
|
},
|
|
354
354
|
reverseHistory: {
|
|
355
|
-
fromCommit:
|
|
356
|
-
toCommit:
|
|
355
|
+
fromCommit: BASELINE_CAPABILITY_CUTS.priorFamilyV3,
|
|
356
|
+
toCommit: BASELINE_CAPABILITY_CUTS.liveV3,
|
|
357
357
|
commitCount: Number(
|
|
358
358
|
git(root, [
|
|
359
359
|
"rev-list",
|
|
360
360
|
"--count",
|
|
361
|
-
`${
|
|
361
|
+
`${BASELINE_CAPABILITY_CUTS.priorFamilyV3}..${BASELINE_CAPABILITY_CUTS.liveV3}`,
|
|
362
362
|
]),
|
|
363
363
|
),
|
|
364
364
|
changedPathCount: changedPaths.length,
|
|
@@ -378,7 +378,7 @@ export function buildV3V4CapabilityInventory({ root = process.cwd() } = {}) {
|
|
|
378
378
|
},
|
|
379
379
|
capabilities: rows,
|
|
380
380
|
};
|
|
381
|
-
|
|
381
|
+
assertBaselineCapabilityInventory(inventory);
|
|
382
382
|
return inventory;
|
|
383
383
|
}
|
|
384
384
|
|
|
@@ -448,8 +448,8 @@ function validateCoverage(inventory, rows, issues) {
|
|
|
448
448
|
}
|
|
449
449
|
if (
|
|
450
450
|
inventory?.reverseHistory?.fromCommit !==
|
|
451
|
-
|
|
452
|
-
inventory?.reverseHistory?.toCommit !==
|
|
451
|
+
BASELINE_CAPABILITY_CUTS.priorFamilyV3 ||
|
|
452
|
+
inventory?.reverseHistory?.toCommit !== BASELINE_CAPABILITY_CUTS.liveV3 ||
|
|
453
453
|
inventory?.reverseHistory?.unclassifiedPathCount !== 0
|
|
454
454
|
) {
|
|
455
455
|
issues.push(
|
|
@@ -464,11 +464,11 @@ function validateCoverage(inventory, rows, issues) {
|
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
466
|
|
|
467
|
-
export function
|
|
467
|
+
export function assertBaselineCapabilityInventory(inventory) {
|
|
468
468
|
const issues = [];
|
|
469
469
|
if (
|
|
470
470
|
inventory?.schemaVersion !== 1 ||
|
|
471
|
-
inventory?.contract !==
|
|
471
|
+
inventory?.contract !== BASELINE_CAPABILITY_INVENTORY_CONTRACT
|
|
472
472
|
) {
|
|
473
473
|
issues.push("inventory contract or schemaVersion is invalid");
|
|
474
474
|
}
|
|
@@ -487,7 +487,7 @@ export function assertV3V4CapabilityInventory(inventory) {
|
|
|
487
487
|
|
|
488
488
|
function main() {
|
|
489
489
|
const root = process.cwd();
|
|
490
|
-
const inventory =
|
|
490
|
+
const inventory = buildBaselineCapabilityInventory({ root });
|
|
491
491
|
const expected = canonicalInventoryJson(inventory);
|
|
492
492
|
if (process.argv.includes("--write")) {
|
|
493
493
|
fs.writeFileSync(path.join(root, INVENTORY_PATH), expected);
|
|
@@ -275,7 +275,10 @@ function validateReverseScan(root, inventory, ids, ownedSources, issues) {
|
|
|
275
275
|
|
|
276
276
|
function checkCoreMechanismInventory({
|
|
277
277
|
root = process.cwd(),
|
|
278
|
-
inventory = loadJson(
|
|
278
|
+
inventory = loadJson(
|
|
279
|
+
root,
|
|
280
|
+
"architecture/baseline-core-mechanism-inventory.json",
|
|
281
|
+
),
|
|
279
282
|
} = {}) {
|
|
280
283
|
const issues = [];
|
|
281
284
|
if (
|
|
@@ -83,14 +83,14 @@ function assertPersistedSelectors() {
|
|
|
83
83
|
".github/workflows/self-ops-promotion-recovery.yml" &&
|
|
84
84
|
match[1] === ".github/workflows/.release-candidate-promote.yml" &&
|
|
85
85
|
selector === "alpha/v4/v4.0";
|
|
86
|
-
const
|
|
86
|
+
const isCurrentMajor =
|
|
87
87
|
selector === "v4" ||
|
|
88
88
|
selector === "v4-alpha" ||
|
|
89
89
|
/^v4(?:[./-]|$)/u.test(selector) ||
|
|
90
90
|
/^[0-9a-f]{40}$/iu.test(selector) ||
|
|
91
91
|
selector.includes("${{");
|
|
92
92
|
if (
|
|
93
|
-
(
|
|
93
|
+
(isCurrentMajor || protectedBootstrap) &&
|
|
94
94
|
!["v4", "v4-alpha"].includes(selector) &&
|
|
95
95
|
!protectedBootstrap
|
|
96
96
|
) {
|
|
@@ -104,9 +104,9 @@ function assertPersistedSelectors() {
|
|
|
104
104
|
);
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
export function
|
|
107
|
+
export function checkFloatingConsumerPolicyContract() {
|
|
108
108
|
const policy = JSON.parse(
|
|
109
|
-
read("architecture/
|
|
109
|
+
read("architecture/floating-consumer-policy.json"),
|
|
110
110
|
);
|
|
111
111
|
if (policy.contract !== "kungfu-buildchain-v4-floating-consumer-policy/v1") {
|
|
112
112
|
fail("architecture policy contract is missing");
|
|
@@ -173,12 +173,12 @@ export function checkV4FloatingConsumerPolicyContract() {
|
|
|
173
173
|
["packages/core/release-candidate.js", "consumerPolicy"],
|
|
174
174
|
["packages/core/release-passport.js", "v4ConsumerPolicy"],
|
|
175
175
|
[
|
|
176
|
-
"actions/
|
|
176
|
+
"actions/release-candidate-promote/index.js",
|
|
177
177
|
"candidate.consumerPolicy?.receiptRoot",
|
|
178
178
|
],
|
|
179
179
|
[
|
|
180
|
-
"actions/
|
|
181
|
-
"
|
|
180
|
+
"actions/release-candidate-promote/index.js",
|
|
181
|
+
"createReleaseInvocation",
|
|
182
182
|
],
|
|
183
183
|
]) {
|
|
184
184
|
if (!read(relative).includes(marker)) {
|
|
@@ -205,7 +205,7 @@ if (
|
|
|
205
205
|
) {
|
|
206
206
|
try {
|
|
207
207
|
process.stdout.write(
|
|
208
|
-
`${JSON.stringify(
|
|
208
|
+
`${JSON.stringify(checkFloatingConsumerPolicyContract(), null, 2)}\n`,
|
|
209
209
|
);
|
|
210
210
|
} catch (error) {
|
|
211
211
|
console.error(error.message);
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { execFileSync } from "node:child_process";
|
|
4
|
+
import { pathToFileURL } from "node:url";
|
|
5
|
+
import ts from "typescript";
|
|
6
|
+
|
|
7
|
+
const ROOTS = new Set([
|
|
8
|
+
"actions",
|
|
9
|
+
"bin",
|
|
10
|
+
"crates",
|
|
11
|
+
"packages",
|
|
12
|
+
"scripts",
|
|
13
|
+
"tests",
|
|
14
|
+
]);
|
|
15
|
+
const GENERATION_PATH = /(?:^|[-_])v\d+(?:[-_]|$)/iu;
|
|
16
|
+
const PROTOCOL_VERSION_SYMBOLS = new Set([
|
|
17
|
+
"createSourceQualificationProofV2",
|
|
18
|
+
"loadedV2",
|
|
19
|
+
]);
|
|
20
|
+
const GENERATION_SYMBOL =
|
|
21
|
+
/(?:^|_)V\d+(?:_|$)|V\d+(?=[A-Z]|$)|^v\d+(?=[A-Z]|$)/u;
|
|
22
|
+
|
|
23
|
+
export function inspectImplementationName(file, source) {
|
|
24
|
+
const issues = [];
|
|
25
|
+
if (!ROOTS.has(file.split("/")[0])) return issues;
|
|
26
|
+
for (const component of file.split("/")) {
|
|
27
|
+
if (GENERATION_PATH.test(component))
|
|
28
|
+
issues.push(`${file}: implementation path contains a product generation`);
|
|
29
|
+
}
|
|
30
|
+
if (file.endsWith(".rs")) {
|
|
31
|
+
for (const match of source.matchAll(
|
|
32
|
+
/\b(?:fn|struct|enum|mod|const|let)\s+([A-Za-z_][A-Za-z0-9_]*)/gu,
|
|
33
|
+
))
|
|
34
|
+
if (
|
|
35
|
+
GENERATION_SYMBOL.test(match[1]) ||
|
|
36
|
+
/(?:^|_)v\d+(?:_|$)/u.test(match[1])
|
|
37
|
+
)
|
|
38
|
+
issues.push(`${file}: ${match[1]} must describe its responsibility`);
|
|
39
|
+
}
|
|
40
|
+
if (!/\.(?:[cm]?js|ts)$/u.test(file) || file.includes("/dist/"))
|
|
41
|
+
return issues;
|
|
42
|
+
const syntax = ts.createSourceFile(
|
|
43
|
+
file,
|
|
44
|
+
source,
|
|
45
|
+
ts.ScriptTarget.Latest,
|
|
46
|
+
true,
|
|
47
|
+
);
|
|
48
|
+
const visit = (node) => {
|
|
49
|
+
if (
|
|
50
|
+
(ts.isFunctionDeclaration(node) ||
|
|
51
|
+
ts.isClassDeclaration(node) ||
|
|
52
|
+
ts.isVariableDeclaration(node) ||
|
|
53
|
+
ts.isParameter(node) ||
|
|
54
|
+
ts.isMethodDeclaration(node) ||
|
|
55
|
+
ts.isBindingElement(node)) &&
|
|
56
|
+
node.name &&
|
|
57
|
+
ts.isIdentifier(node.name) &&
|
|
58
|
+
GENERATION_SYMBOL.test(node.name.text) &&
|
|
59
|
+
!PROTOCOL_VERSION_SYMBOLS.has(node.name.text) &&
|
|
60
|
+
!/_V\d+_SCHEMA$/u.test(node.name.text)
|
|
61
|
+
) {
|
|
62
|
+
const line =
|
|
63
|
+
syntax.getLineAndCharacterOfPosition(node.name.getStart()).line + 1;
|
|
64
|
+
issues.push(
|
|
65
|
+
`${file}:${line}: ${node.name.text} must describe its responsibility`,
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
if (
|
|
69
|
+
(ts.isStringLiteral(node) ||
|
|
70
|
+
ts.isNoSubstitutionTemplateLiteral(node) ||
|
|
71
|
+
ts.isTemplateHead(node) ||
|
|
72
|
+
ts.isTemplateMiddle(node) ||
|
|
73
|
+
ts.isTemplateTail(node)) &&
|
|
74
|
+
/\.buildchain\/[A-Za-z0-9_./-]*\bv\d+-/u.test(node.text)
|
|
75
|
+
)
|
|
76
|
+
issues.push(
|
|
77
|
+
`${file}: runtime directory must describe its responsibility`,
|
|
78
|
+
);
|
|
79
|
+
ts.forEachChild(node, visit);
|
|
80
|
+
};
|
|
81
|
+
visit(syntax);
|
|
82
|
+
return issues;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function checkImplementationNaming(root = process.cwd()) {
|
|
86
|
+
const files = execFileSync("git", ["ls-files", "-z"], {
|
|
87
|
+
cwd: root,
|
|
88
|
+
encoding: "utf8",
|
|
89
|
+
})
|
|
90
|
+
.split("\0")
|
|
91
|
+
.filter(Boolean);
|
|
92
|
+
const issues = files.flatMap((file) => {
|
|
93
|
+
const absolute = path.join(root, file);
|
|
94
|
+
if (!fs.existsSync(absolute))
|
|
95
|
+
return [`${file}: tracked implementation is missing`];
|
|
96
|
+
const source =
|
|
97
|
+
ROOTS.has(file.split("/")[0]) && /\.(?:[cm]?js|ts|rs)$/u.test(file)
|
|
98
|
+
? fs.readFileSync(absolute, "utf8")
|
|
99
|
+
: "";
|
|
100
|
+
return inspectImplementationName(file, source);
|
|
101
|
+
});
|
|
102
|
+
const manifest = JSON.parse(
|
|
103
|
+
fs.readFileSync(path.join(root, "package.json"), "utf8"),
|
|
104
|
+
);
|
|
105
|
+
for (const name of Object.keys(manifest.scripts || {})) {
|
|
106
|
+
if (/(?:^|:)v\d+(?:[-:]|$)/iu.test(name))
|
|
107
|
+
issues.push(`package.json: script ${name} contains a product generation`);
|
|
108
|
+
}
|
|
109
|
+
const policy = JSON.parse(
|
|
110
|
+
fs.readFileSync(
|
|
111
|
+
path.join(root, "architecture/implementation-naming.json"),
|
|
112
|
+
"utf8",
|
|
113
|
+
),
|
|
114
|
+
);
|
|
115
|
+
for (const [file, identities] of Object.entries(policy.wireIdentities)) {
|
|
116
|
+
const source = fs.readFileSync(path.join(root, file), "utf8");
|
|
117
|
+
for (const previousIdentity of identities) {
|
|
118
|
+
const identity =
|
|
119
|
+
policy.implementationIdentityMigrations?.[file]?.[previousIdentity] ||
|
|
120
|
+
previousIdentity;
|
|
121
|
+
if (
|
|
122
|
+
!source.includes(JSON.stringify(identity)) &&
|
|
123
|
+
!source.includes(`'${identity}'`)
|
|
124
|
+
)
|
|
125
|
+
issues.push(
|
|
126
|
+
`${file}: published wire identity changed during implementation relocation: ${identity}`,
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
if (issues.length) throw new Error(issues.join("\n"));
|
|
131
|
+
return { checkedFiles: files.length, issues: [] };
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href)
|
|
135
|
+
console.log(JSON.stringify(checkImplementationNaming(), null, 2));
|
|
@@ -207,7 +207,7 @@ const currentBuildchainContract = JSON.parse(
|
|
|
207
207
|
fs.readFileSync(path.join(root, "dist/site/buildchain-contract.json"), "utf8"),
|
|
208
208
|
);
|
|
209
209
|
const selfDogfoodBootstrapAuthority = JSON.parse(
|
|
210
|
-
fs.readFileSync(path.join(root, "architecture/
|
|
210
|
+
fs.readFileSync(path.join(root, "architecture/bootstrap-authority.json"), "utf8"),
|
|
211
211
|
);
|
|
212
212
|
const selfDogfoodMajorResolution = resolveSelfDogfoodMajor({
|
|
213
213
|
packageVersion: rootPackage.version,
|
|
@@ -546,7 +546,8 @@ if (!coreIndexSource.includes("KFD2_RELEASE_TRUST_PASSPORT_CONTRACT")) {
|
|
|
546
546
|
if (!coreIndexSource.includes("KFD2_TRUST_PROOF_CONTRACT")) {
|
|
547
547
|
throw new Error("packages/core/index.js must export KFD-2 trust proof contract");
|
|
548
548
|
}
|
|
549
|
-
|
|
549
|
+
const publicCore = await import("../packages/core/index.js");
|
|
550
|
+
if (typeof publicCore.createSurfaceTimestampPolicy !== "function") {
|
|
550
551
|
throw new Error("packages/core/index.js must export surface manifest timestamp policy APIs");
|
|
551
552
|
}
|
|
552
553
|
for (const requiredSnippet of [
|
|
@@ -1044,7 +1045,7 @@ for (const requiredSnippet of [
|
|
|
1044
1045
|
"uses: kungfu-systems/buildchain/.github/workflows/.release-candidate-promote.yml@v4-alpha",
|
|
1045
1046
|
"github.event.workflow_run.event == 'push'",
|
|
1046
1047
|
"name: Classify generated product-state finalization",
|
|
1047
|
-
"
|
|
1048
|
+
"selectFinalizedProductPublicationVersion",
|
|
1048
1049
|
"resume-candidate-run-id:",
|
|
1049
1050
|
"resume-expected-source-tree:",
|
|
1050
1051
|
"resume-buildchain-runtime-ref:",
|
|
@@ -1066,9 +1067,9 @@ for (const requiredSnippet of [
|
|
|
1066
1067
|
"name: QUALIFY canonical v4 release invocation inputs",
|
|
1067
1068
|
"name: APPLY one rooted provider transaction",
|
|
1068
1069
|
"name: SETTLE terminal ReleaseReceipt projection",
|
|
1069
|
-
"uses: ./.buildchain/runtime/actions/
|
|
1070
|
+
"uses: ./.buildchain/runtime/actions/release-candidate-promote",
|
|
1070
1071
|
"name: Resolve one exact product publication recovery",
|
|
1071
|
-
"
|
|
1072
|
+
"selectRecoveredProductPublicationVersion",
|
|
1072
1073
|
"publisher-workflow-sha:",
|
|
1073
1074
|
"runtime-commit:",
|
|
1074
1075
|
"runtime-tree:",
|
|
@@ -112,6 +112,13 @@ function ensureMaintainabilityRevisionsAvailable(
|
|
|
112
112
|
);
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
+
function implementationPathAtPresent(root, historicalPath) {
|
|
116
|
+
const policyPath = path.join(root, "architecture/implementation-naming.json");
|
|
117
|
+
if (!fs.existsSync(policyPath)) return historicalPath;
|
|
118
|
+
const policy = readJson(root, "architecture/implementation-naming.json");
|
|
119
|
+
return policy.pathMigrations[historicalPath] || historicalPath;
|
|
120
|
+
}
|
|
121
|
+
|
|
115
122
|
function sourceMetricsAtRevision(root, revision) {
|
|
116
123
|
const files = gitOutput(root, ["ls-tree", "-r", "--name-only", revision])
|
|
117
124
|
.split("\n")
|
|
@@ -119,7 +126,7 @@ function sourceMetricsAtRevision(root, revision) {
|
|
|
119
126
|
.sort();
|
|
120
127
|
return Object.fromEntries(
|
|
121
128
|
files.map((file) => [
|
|
122
|
-
file,
|
|
129
|
+
implementationPathAtPresent(root, file),
|
|
123
130
|
analyzeSource(file, gitOutput(root, ["show", `${revision}:${file}`])),
|
|
124
131
|
]),
|
|
125
132
|
);
|
|
@@ -134,7 +141,7 @@ function testMetricsAtRevision(root, revision) {
|
|
|
134
141
|
.sort();
|
|
135
142
|
return Object.fromEntries(
|
|
136
143
|
files.map((file) => [
|
|
137
|
-
file,
|
|
144
|
+
implementationPathAtPresent(root, file),
|
|
138
145
|
analyzeSource(file, gitOutput(root, ["show", `${revision}:${file}`])),
|
|
139
146
|
]),
|
|
140
147
|
);
|