@kungfu-tech/buildchain 3.0.9-alpha.9 → 4.0.0-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 +39 -0
- package/README.md +17 -13
- package/actions/promote-buildchain-ref/README.md +0 -10
- package/actions/release-tail/README.md +6 -10
- package/architecture/internal-capabilities.json +502 -0
- package/architecture/maintainability-baseline.json +59 -0
- package/architecture/maintainability-policy.json +1384 -0
- package/architecture/release-tail-contract-inventory.json +587 -0
- package/architecture/v3-core-mechanism-inventory.json +1043 -0
- package/architecture/v3-core-mechanism-inventory.md +67 -0
- package/architecture/v4-adopter-delivery-parity.json +47 -0
- package/architecture/v4-architecture-constitution.md +210 -0
- package/architecture/v4-bootstrap-authority.json +56 -0
- package/architecture/v4-canonical-contract-fixtures.json +105 -0
- package/architecture/v4-capability-state-machine-manifest.json +480 -0
- package/architecture/v4-capability-state-machine-manifest.schema.json +202 -0
- package/architecture/v4-delivery-warrant-shadow-bootstrap-plan.json +830 -0
- package/architecture/v4-delivery-warrant-shadow-bootstrap-plan.md +223 -0
- package/architecture/v4-delivery-warrant-shadow-bootstrap-plan.schema.json +318 -0
- package/architecture/v4-delivery-warrant-shadow-fixtures.json +227 -0
- package/architecture/v4-delivery-warrant-shadow-fixtures.schema.json +67 -0
- package/architecture/v4-exception-ledger.json +5 -0
- package/architecture/v4-exception-ledger.schema.json +56 -0
- package/architecture/v4-partial-mutation-recovery-qualification.json +65 -0
- package/architecture/v4-platform-stage-checkpoints.json +97 -0
- package/architecture/v4-provider-operation-journal-contract.json +113 -0
- package/architecture/v4-release-activation-shadow-domain.json +61 -0
- package/architecture/v4-release-train-parity.json +68 -0
- package/architecture/v4-rust-libnode-bridge-evaluation.json +107 -0
- package/architecture/v4-rust-libnode-bridge-spike.md +85 -0
- package/architecture/v4-stable-publication-fence.json +66 -0
- package/architecture/v4-stage-capsule-contract.json +90 -0
- package/architecture/v4-stage-capsule-qualification.json +99 -0
- package/architecture/v4-stage-capsule-resume-planner.json +52 -0
- package/architecture/v4-stage-capsule-store-contract.json +72 -0
- package/bin/buildchain.mjs +15 -10
- package/contracts/auditable-demo-scenario-v1.schema.json +1 -1
- package/contracts/buildchain-v2-residuals-v1.json +2 -2
- package/contracts/fixtures/v4-delivery-warrant-trace-v1/golden.json +158 -0
- package/contracts/fixtures/v4-delivery-warrant-trace-v1/property.json +380 -0
- package/contracts/fixtures/v4-delivery-warrant-trace-v1/replay.json +163 -0
- package/contracts/fixtures/v4-partial-mutation-recovery-v1/shared.json +155 -0
- package/contracts/fixtures/v4-provider-operation-journal-v1/shared.json +457 -0
- package/contracts/fixtures/v4-provider-readback-idempotency-v1/shared.json +682 -0
- package/contracts/fixtures/v4-release-activation-shadow-v1/shared.json +53 -0
- package/contracts/fixtures/v4-stable-publication-fence-v1/shared.json +56 -0
- package/contracts/fixtures/v4-stage-capsule-resume-v1/late-platform-failure.json +176 -0
- package/contracts/fixtures/v4-stage-capsule-store-v1/shared.json +132 -0
- package/contracts/fixtures/v4-stage-capsule-v1/shared.json +111 -0
- package/contracts/v4-canonical-contracts-v1.schema.json +182 -0
- package/contracts/v4-delivery-warrant-semantic-diff-report-v1.schema.json +284 -0
- package/contracts/v4-delivery-warrant-trace-v1.schema.json +215 -0
- package/contracts/v4-host-contract-v1.schema.json +135 -0
- package/contracts/v4-partial-mutation-recovery-v1.schema.json +168 -0
- package/contracts/v4-provider-operation-journal-v1.schema.json +381 -0
- package/contracts/v4-release-activation-shadow-v1.schema.json +186 -0
- package/contracts/v4-stable-publication-fence-v1.schema.json +125 -0
- package/contracts/v4-stage-capsule-resume-v1.schema.json +225 -0
- package/contracts/v4-stage-capsule-store-v1.schema.json +154 -0
- package/contracts/v4-stage-capsule-v1.schema.json +178 -0
- package/crates/buildchain-v4-bridge/Cargo.lock +213 -0
- package/crates/buildchain-v4-bridge/Cargo.toml +12 -0
- package/crates/buildchain-v4-bridge/src/main.rs +495 -0
- package/dist/site/agent-index.json +0 -4
- package/dist/site/artifact-schemas.json +0 -8
- package/dist/site/buildchain-contract.json +103 -397
- package/dist/site/buildchain-site.json +302 -386
- package/dist/site/capability-registry.json +9 -11
- package/dist/site/cli-registry.json +8 -53
- package/dist/site/controller-registry.json +48 -8
- package/dist/site/kfd-claims.json +129 -167
- package/dist/site/kfd-upstream-aggregate.json +9 -9
- package/dist/site/manual-registry.json +18 -49
- package/dist/site/node-api-registry.json +4345 -7345
- package/dist/site/page-registry.json +278 -346
- package/dist/site/public-surface-audit.json +85 -404
- package/dist/site/publication-authority-registry.json +11 -1
- package/dist/site/publication-registry.json +4 -4
- package/dist/site/release-provenance.json +3 -9
- package/dist/site/schemas/kfd-support-projection-v1.schema.json +106 -0
- package/dist/site/site-manifest.json +22 -38
- package/dist/site/workflow-registry.json +78 -35
- package/docs/MAP.md +8 -5
- package/docs/auditable-demo.md +2 -2
- package/docs/aws-us-elastic-runner-burst-plane.md +7 -59
- package/docs/cli-reference.md +15 -213
- package/docs/cli.md +14 -14
- package/docs/dev-alpha-candidate-patrol.md +3 -11
- package/docs/dev-delivery-warrant.md +29 -194
- package/docs/engineering-housekeeper.md +12 -4
- package/docs/getting-started.md +1 -1
- package/docs/install.md +5 -5
- package/docs/kfd-support.md +2 -7
- package/docs/lifecycle-protocol.md +2 -4
- package/docs/node-api-reference.md +414 -554
- package/docs/release-flow.md +31 -31
- package/docs/release-governance.md +16 -28
- package/docs/release-passport.md +2 -15
- package/docs/release-tail-contract.md +13 -6
- package/docs/release-tail-provider-plane.md +13 -19
- package/docs/release-train.md +4 -4
- package/docs/reusable-build-surface.md +14 -27
- package/docs/site-bundle-contract.md +1 -5
- package/docs/stable-candidate-patrol.md +7 -7
- package/docs/v4-canonical-contracts.md +92 -0
- package/docs/v4-delivery-warrant-read-candidate.md +73 -0
- package/docs/v4-delivery-warrant-semantic-diff.md +75 -0
- package/docs/v4-production-release.md +63 -0
- package/docs/v4-stage-capsule.md +193 -0
- package/docs/versioning.md +3 -5
- package/package.json +19 -19
- package/packages/core/adopter-delivery-gate.js +576 -0
- package/packages/core/adopter-delivery-json.js +66 -0
- package/packages/core/artifact-signing.js +0 -61
- package/packages/core/artifact-verification-envelope.js +5 -5
- package/packages/core/build-facts.js +12 -4
- package/packages/core/buildchain-agent-manuals.js +0 -2
- package/packages/core/buildchain-channel-identity.js +3 -2
- package/packages/core/buildchain-config.js +4 -69
- package/packages/core/buildchain-contract.js +232 -46
- package/packages/core/buildchain-kfd-claims.js +1 -1
- package/packages/core/channel-candidate.js +0 -8
- package/packages/core/channel-promotion-baseline.js +0 -52
- package/packages/core/controller-evidence.js +3 -4
- package/packages/core/dev-alpha-candidate-selection.js +2 -10
- package/packages/core/dev-delivery-warrant-cancellation.js +0 -1
- package/packages/core/dev-delivery-warrant-settlement.js +20 -67
- package/packages/core/dev-delivery-warrant.js +50 -138
- package/packages/core/diagnostics.js +3 -8
- package/packages/core/github-governance-authority.js +3 -1
- package/packages/core/kfd-adopter-category-driver.js +167 -0
- package/packages/core/kfd-adopter-manifest.js +47 -46
- package/packages/core/kfd-gate.js +15 -45
- package/packages/core/paper-agent-entry.js +7 -16
- package/packages/core/paper-fleet.js +2 -2
- package/packages/core/paper-repository.js +2 -3
- package/packages/core/paper-scaffold-content.js +2 -23
- package/packages/core/paper.js +11 -43
- package/packages/core/publication-reproducibility.js +4 -4
- package/packages/core/release-line-bootstrap.js +21 -8
- package/packages/core/release-passport-contract.js +5 -5
- package/packages/core/release-passport.js +20 -131
- package/packages/core/self-dogfood-version.js +48 -35
- package/packages/core/spawn-command.js +232 -8
- package/packages/core/v4-adopter-delivery-parity.js +219 -0
- package/packages/core/v4-canonical-contracts.js +284 -0
- package/packages/core/v4-delivery-warrant-fixture-runner.js +371 -0
- package/packages/core/v4-delivery-warrant-read-candidate.js +279 -0
- package/packages/core/v4-delivery-warrant-semantic-diff-gate.js +352 -0
- package/packages/core/v4-delivery-warrant-shadow-adapter.js +447 -0
- package/packages/core/v4-partial-mutation-recovery-qualification.js +395 -0
- package/packages/core/v4-platform-stage-checkpoints.js +471 -0
- package/packages/core/v4-provider-operation-journal.js +531 -0
- package/packages/core/v4-provider-readback-idempotency.js +394 -0
- package/packages/core/v4-release-activation-shadow.js +519 -0
- package/packages/core/v4-stable-publication-fence.js +357 -0
- package/packages/core/v4-stage-capsule-local-store.js +426 -0
- package/packages/core/v4-stage-capsule-qualification-campaign.js +512 -0
- package/packages/core/v4-stage-capsule-qualification.js +456 -0
- package/packages/core/v4-stage-capsule-resume-planner.js +397 -0
- package/packages/core/v4-stage-capsule-store.js +401 -0
- package/packages/core/v4-stage-capsule.js +319 -0
- package/scripts/assemble-self-publication-admission.mjs +1 -1
- package/scripts/audit-publication-control-plane.mjs +5 -5
- package/scripts/auditable-demo-bundle-verification.mjs +3 -2
- package/scripts/auditable-demo-platform.mjs +2 -2
- package/scripts/auditable-demo-renditions.mjs +1 -1
- package/scripts/auditable-demo.mjs +2 -2
- package/scripts/aws-macos-jit-controller-core.mjs +13 -346
- package/scripts/aws-macos-jit-controller-runtime.mjs +2 -210
- package/scripts/aws-macos-jit-controller.mjs +37 -275
- package/scripts/aws-macos-jit-core.mjs +3 -41
- package/scripts/aws-macos-jit.mjs +0 -12
- package/scripts/aws-windows-jit-campaign.mjs +2 -2
- package/scripts/aws-windows-jit-controller-core.mjs +1 -1
- package/scripts/aws-windows-jit-controller.mjs +3 -3
- package/scripts/build-contract-core.mjs +3 -8
- package/scripts/build-standalone-binary.mjs +3 -14
- package/scripts/buildchain-channel-router.mjs +4 -0
- package/scripts/buildchain-cli-help.mjs +7 -16
- package/scripts/buildchain-contract-lock.mjs +0 -6
- package/scripts/check-action-bundles.mjs +3 -4
- package/scripts/check-internal-architecture.mjs +7 -6
- package/scripts/check-inventory.mjs +30 -25
- package/scripts/check-v4-public-dogfood-contract.mjs +270 -0
- package/scripts/create-release-bundle.mjs +8 -4
- package/scripts/dev-alpha-candidate-patrol.mjs +1 -22
- package/scripts/dev-delivery-proof.mjs +2 -64
- package/scripts/dev-delivery-warrant.mjs +61 -86
- package/scripts/dev-pr-auto-merge.mjs +4 -30
- package/scripts/dev-pr-delivery-warrant.mjs +0 -55
- package/scripts/dispatch-artifact-signing-authority.mjs +7 -4
- package/scripts/generate-buildchain-kfd-witnesses.mjs +94 -88
- package/scripts/generate-channel-build-workflow.mjs +54 -24
- package/scripts/generate-channel-promotion-workflow.mjs +15 -6
- package/scripts/generate-site-bundle.mjs +8 -27
- package/scripts/git-fetch-process-tree.mjs +34 -1
- package/scripts/init-repo.mjs +64 -159
- package/scripts/inspect-artifact-signing-requests.mjs +0 -6
- package/scripts/locked-source-checkout.mjs +3 -4
- package/scripts/maintainability-metrics.mjs +8 -2
- package/scripts/npm-publish-dry-run.mjs +2 -2
- package/scripts/npm-publish-transaction.mjs +2 -2
- package/scripts/publication-commit-evidence.mjs +23 -69
- package/scripts/release-candidate-resolver.mjs +11 -17
- package/scripts/release-tail.mjs +3 -49
- package/scripts/resume-from-candidate-run.mjs +9 -123
- package/scripts/run-lifecycle-core.mjs +12 -13
- package/scripts/seal-artifact-signing-requests.mjs +17 -21
- package/scripts/site-capability-metadata.mjs +3 -20
- package/scripts/stable-candidate-qualification.mjs +10 -10
- package/scripts/v4-architecture.mjs +12 -2
- package/scripts/v4-bridge-bootstrap.mjs +141 -0
- package/scripts/v4-bridge-evidence.mjs +141 -0
- package/scripts/v4-host-adapter.mjs +182 -0
- package/scripts/v4-platform-stage-checkpoint-rehearsal.mjs +207 -0
- package/scripts/v4-stage-capsule-qualification.mjs +528 -0
- package/scripts/v4-stage-capsule-resume-rehearsal.mjs +57 -0
- package/scripts/v4-warrant-shadow-plan.mjs +601 -0
- package/scripts/verify-golden-path.mjs +5 -5
- package/scripts/web-surface-cloudfront-rewrite.mjs +15 -15
- package/scripts/web-surface-core.mjs +2 -8
- package/scripts/workflow-call-contract.mjs +5 -184
- package/contracts/dev-delivery-authority-v2.schema.json +0 -253
- package/contracts/fixtures/kfd-adopter-release-v1/kfd-4-perspective.json +0 -16
- package/contracts/fixtures/kfd-adopter-release-v1/kfd-4-replay.json +0 -57
- package/contracts/fixtures/next-development-transition-v1/anchored-manual-waiting.json +0 -47
- package/contracts/fixtures/next-development-transition-v1/semver-auto-planned.json +0 -47
- package/contracts/fixtures/next-development-transition-v1/version-model-cases.json +0 -40
- package/contracts/next-development-request-v1.schema.json +0 -66
- package/contracts/next-development-transition-v1.schema.json +0 -292
- package/contracts/publication-rehearsal-capsule-v1.schema.json +0 -173
- package/dist/site/schemas/dev-delivery-authority-v2.schema.json +0 -442
- package/dist/site/schemas/publication-rehearsal-capsule-v1.schema.json +0 -269
- package/dist/site/schemas/release-tail-capabilities-v1.schema.json +0 -353
- package/dist/site/schemas/release-tail-provider-bindings-v1.schema.json +0 -94
- package/docs/dev-delivery-qualification-landing-adr.md +0 -137
- package/docs/next-development-transition.md +0 -119
- package/docs/publication-rehearsal.md +0 -94
- package/packages/core/buildchain-compatibility-proof.js +0 -631
- package/packages/core/dev-delivery-authority.js +0 -996
- package/packages/core/dev-delivery-native-proof.js +0 -418
- package/packages/core/dev-delivery-warrant-shadow.js +0 -502
- package/packages/core/next-development-candidate-reservation.js +0 -186
- package/packages/core/next-development-controller.js +0 -726
- package/packages/core/next-development-projection.js +0 -288
- package/packages/core/next-development-transition.js +0 -738
- package/packages/core/publication-rehearsal-projection.js +0 -173
- package/packages/core/publication-rehearsal-runtime.js +0 -921
- package/scripts/aws-macos-jit-instance-rehydrate.mjs +0 -260
- package/scripts/aws-macos-jit-source-rebind.mjs +0 -724
- package/scripts/dev-delivery-authority.mjs +0 -368
- package/scripts/dev-delivery-native-run.mjs +0 -235
- package/scripts/dev-delivery-two-phase-resume.mjs +0 -90
- package/scripts/dev-delivery-two-phase.mjs +0 -577
- package/scripts/generate-next-development-guidance.mjs +0 -49
- package/scripts/materialize-self-release-candidate-version.mjs +0 -137
- package/scripts/next-development-self-dogfood-harness.mjs +0 -409
- package/scripts/next-development-self-dogfood.mjs +0 -532
- package/scripts/next-development-transition.mjs +0 -47
- package/scripts/release-candidate-tail-reseal.mjs +0 -426
- package/templates/native-dev-delivery.yml +0 -86
package/scripts/init-repo.mjs
CHANGED
|
@@ -3,35 +3,15 @@ import fs from "node:fs";
|
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
5
5
|
import { BUILDCHAIN_CONFIG_PATH } from "../packages/core/buildchain-layout.js";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
appendPublicationRehearsalToml,
|
|
13
|
-
mergePublicationRehearsalAgentInstructions,
|
|
14
|
-
publicationRehearsalWorkflow,
|
|
15
|
-
} from "../packages/core/publication-rehearsal-projection.js";
|
|
16
|
-
import {
|
|
17
|
-
appendNextDevelopmentToml,
|
|
18
|
-
mergeNextDevelopmentAgentInstructions,
|
|
19
|
-
nextDevelopmentWorkflowHeader,
|
|
20
|
-
} from "../packages/core/next-development-projection.js";
|
|
21
|
-
|
|
22
|
-
const BUILDCHAIN_WORKFLOW_REF =
|
|
23
|
-
"kungfu-systems/buildchain/.github/workflows/.build.yml@v3";
|
|
24
|
-
const DEFAULT_PUBLICATION_LATEX_IMAGE =
|
|
25
|
-
"ghcr.io/kungfu-systems/build-images/latex-pdf-builder";
|
|
26
|
-
const DEFAULT_PUBLICATION_LATEX_DIGEST =
|
|
27
|
-
"sha256:c20f3809e96836c1c78e97c76939d12f1de3fed0ea9b7c40c43332ec2ea480f8";
|
|
28
|
-
const DEFAULT_PUBLICATION_LATEX_COMMAND =
|
|
29
|
-
"latexmk -pdf -outdir=_build paper/main.tex";
|
|
6
|
+
import { detectPackageManager, assertPackageManager } from "../packages/core/package-manager.js";
|
|
7
|
+
|
|
8
|
+
const BUILDCHAIN_WORKFLOW_REF = "kungfu-systems/buildchain/.github/workflows/.build.yml@v4";
|
|
9
|
+
const DEFAULT_PUBLICATION_LATEX_IMAGE = "ghcr.io/kungfu-systems/build-images/latex-pdf-builder";
|
|
10
|
+
const DEFAULT_PUBLICATION_LATEX_DIGEST = "sha256:c20f3809e96836c1c78e97c76939d12f1de3fed0ea9b7c40c43332ec2ea480f8";
|
|
11
|
+
const DEFAULT_PUBLICATION_LATEX_COMMAND = "latexmk -pdf -outdir=_build paper/main.tex";
|
|
30
12
|
|
|
31
13
|
function posixPath(value) {
|
|
32
|
-
return String(value || "")
|
|
33
|
-
.split(path.sep)
|
|
34
|
-
.join("/");
|
|
14
|
+
return String(value || "").split(path.sep).join("/");
|
|
35
15
|
}
|
|
36
16
|
|
|
37
17
|
function repoName(cwd) {
|
|
@@ -296,42 +276,34 @@ command = "make check"
|
|
|
296
276
|
}
|
|
297
277
|
|
|
298
278
|
function infraContractDesiredJson(cwd) {
|
|
299
|
-
return `${JSON.stringify(
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
owner: "platform",
|
|
311
|
-
},
|
|
279
|
+
return `${JSON.stringify({
|
|
280
|
+
service: repoName(cwd),
|
|
281
|
+
environment: "staging",
|
|
282
|
+
resources: [
|
|
283
|
+
{
|
|
284
|
+
kind: "static-site",
|
|
285
|
+
name: repoName(cwd),
|
|
286
|
+
desiredState: {
|
|
287
|
+
hostname: "staging.example.com",
|
|
288
|
+
accessControl: "managed-network",
|
|
289
|
+
owner: "platform",
|
|
312
290
|
},
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
2,
|
|
317
|
-
)}\n`;
|
|
291
|
+
},
|
|
292
|
+
],
|
|
293
|
+
}, null, 2)}\n`;
|
|
318
294
|
}
|
|
319
295
|
|
|
320
296
|
function infraContractOutputsJson(cwd) {
|
|
321
|
-
return `${JSON.stringify(
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
bucket: "observed-bucket-name",
|
|
330
|
-
},
|
|
297
|
+
return `${JSON.stringify({
|
|
298
|
+
service: repoName(cwd),
|
|
299
|
+
environment: "staging",
|
|
300
|
+
observedMode: "manual-observed",
|
|
301
|
+
outputs: {
|
|
302
|
+
hostname: "staging.example.com",
|
|
303
|
+
distributionId: "observed-distribution-id",
|
|
304
|
+
bucket: "observed-bucket-name",
|
|
331
305
|
},
|
|
332
|
-
|
|
333
|
-
2,
|
|
334
|
-
)}\n`;
|
|
306
|
+
}, null, 2)}\n`;
|
|
335
307
|
}
|
|
336
308
|
|
|
337
309
|
function workflowArtifactPaths(type) {
|
|
@@ -355,7 +327,7 @@ function workflowArtifactPaths(type) {
|
|
|
355
327
|
}
|
|
356
328
|
|
|
357
329
|
function publicationWorkflowYaml() {
|
|
358
|
-
return
|
|
330
|
+
return `name: Build
|
|
359
331
|
|
|
360
332
|
on:
|
|
361
333
|
workflow_dispatch:
|
|
@@ -377,7 +349,7 @@ permissions:
|
|
|
377
349
|
|
|
378
350
|
jobs:
|
|
379
351
|
publication:
|
|
380
|
-
uses: kungfu-systems/buildchain/.github/workflows/publication-artifact.yml@
|
|
352
|
+
uses: kungfu-systems/buildchain/.github/workflows/publication-artifact.yml@v4
|
|
381
353
|
with:
|
|
382
354
|
buildchain-ref: \${{ inputs.buildchain-ref || '' }}
|
|
383
355
|
toolchain-type: config
|
|
@@ -387,7 +359,9 @@ jobs:
|
|
|
387
359
|
}
|
|
388
360
|
|
|
389
361
|
function workflowYaml({ type, runnerPreset, artifactName }) {
|
|
390
|
-
return
|
|
362
|
+
return `# Buildchain v4 lifecycle checkpoints are governed by architecture/v4-platform-stage-checkpoints.json.
|
|
363
|
+
# Do not add undeclared runner-only inputs, outputs, environment, or provider effects.
|
|
364
|
+
name: Build
|
|
391
365
|
|
|
392
366
|
on:
|
|
393
367
|
workflow_dispatch:
|
|
@@ -420,32 +394,15 @@ jobs:
|
|
|
420
394
|
`;
|
|
421
395
|
}
|
|
422
396
|
|
|
423
|
-
function devDeliveryWorkflowYaml() {
|
|
424
|
-
return fs.readFileSync(
|
|
425
|
-
new URL("../templates/native-dev-delivery.yml", import.meta.url),
|
|
426
|
-
"utf8",
|
|
427
|
-
);
|
|
428
|
-
}
|
|
429
397
|
function writeIfAllowed(filePath, content, { force }) {
|
|
430
398
|
if (fs.existsSync(filePath) && !force) {
|
|
431
|
-
throw new Error(
|
|
432
|
-
`${posixPath(filePath)} already exists; pass --force to overwrite`,
|
|
433
|
-
);
|
|
399
|
+
throw new Error(`${posixPath(filePath)} already exists; pass --force to overwrite`);
|
|
434
400
|
}
|
|
435
401
|
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
436
402
|
fs.writeFileSync(filePath, content);
|
|
437
403
|
return filePath;
|
|
438
404
|
}
|
|
439
405
|
|
|
440
|
-
function writeManagedAgentEntry(filePath, current) {
|
|
441
|
-
const content = mergeNextDevelopmentAgentInstructions(
|
|
442
|
-
mergePublicationRehearsalAgentInstructions(current),
|
|
443
|
-
);
|
|
444
|
-
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
445
|
-
fs.writeFileSync(filePath, content);
|
|
446
|
-
return filePath;
|
|
447
|
-
}
|
|
448
|
-
|
|
449
406
|
export function initBuildchainRepo({
|
|
450
407
|
cwd = process.cwd(),
|
|
451
408
|
type = "package",
|
|
@@ -456,43 +413,30 @@ export function initBuildchainRepo({
|
|
|
456
413
|
} = {}) {
|
|
457
414
|
const resolvedCwd = path.resolve(cwd);
|
|
458
415
|
const manager = detectOrDefaultPackageManager(resolvedCwd, packageManager);
|
|
459
|
-
const toml =
|
|
460
|
-
|
|
461
|
-
(
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
throw new Error(
|
|
481
|
-
"init --type must be one of package, native, web-surface, infra-contract, publication-artifact, or anchored-package",
|
|
482
|
-
);
|
|
483
|
-
})(),
|
|
484
|
-
),
|
|
485
|
-
);
|
|
486
|
-
|
|
487
|
-
const agentsPath = path.join(resolvedCwd, "AGENTS.md");
|
|
488
|
-
const currentAgents = fs.existsSync(agentsPath)
|
|
489
|
-
? fs.readFileSync(agentsPath, "utf8")
|
|
490
|
-
: "";
|
|
416
|
+
const toml = (() => {
|
|
417
|
+
if (type === "package") {
|
|
418
|
+
return packageToml(resolvedCwd, manager);
|
|
419
|
+
}
|
|
420
|
+
if (type === "native") {
|
|
421
|
+
return nativeToml(resolvedCwd);
|
|
422
|
+
}
|
|
423
|
+
if (type === "web-surface") {
|
|
424
|
+
return webSurfaceToml(resolvedCwd);
|
|
425
|
+
}
|
|
426
|
+
if (type === "infra-contract") {
|
|
427
|
+
return infraContractToml(resolvedCwd);
|
|
428
|
+
}
|
|
429
|
+
if (type === "publication-artifact") {
|
|
430
|
+
return publicationArtifactToml(resolvedCwd);
|
|
431
|
+
}
|
|
432
|
+
if (type === "anchored-package") {
|
|
433
|
+
return anchoredPackageToml(resolvedCwd, manager);
|
|
434
|
+
}
|
|
435
|
+
throw new Error("init --type must be one of package, native, web-surface, infra-contract, publication-artifact, or anchored-package");
|
|
436
|
+
})();
|
|
491
437
|
|
|
492
438
|
const written = [
|
|
493
|
-
writeIfAllowed(path.join(resolvedCwd, BUILDCHAIN_CONFIG_PATH), toml, {
|
|
494
|
-
force,
|
|
495
|
-
}),
|
|
439
|
+
writeIfAllowed(path.join(resolvedCwd, BUILDCHAIN_CONFIG_PATH), toml, { force }),
|
|
496
440
|
writeIfAllowed(
|
|
497
441
|
path.join(resolvedCwd, ".github", "workflows", "build.yml"),
|
|
498
442
|
type === "publication-artifact"
|
|
@@ -504,49 +448,16 @@ export function initBuildchainRepo({
|
|
|
504
448
|
}),
|
|
505
449
|
{ force },
|
|
506
450
|
),
|
|
507
|
-
writeIfAllowed(
|
|
508
|
-
path.join(resolvedCwd, PUBLICATION_REHEARSAL_WORKFLOW_PATH),
|
|
509
|
-
publicationRehearsalWorkflow("v3"),
|
|
510
|
-
{ force },
|
|
511
|
-
),
|
|
512
|
-
writeManagedAgentEntry(agentsPath, currentAgents),
|
|
513
451
|
];
|
|
514
452
|
|
|
515
|
-
if (type === "
|
|
516
|
-
written.push(
|
|
517
|
-
writeIfAllowed(
|
|
518
|
-
path.join(resolvedCwd, ".github", "workflows", "dev-delivery.yml"),
|
|
519
|
-
devDeliveryWorkflowYaml(),
|
|
520
|
-
{ force },
|
|
521
|
-
),
|
|
522
|
-
);
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
if (
|
|
526
|
-
type === "anchored-package" &&
|
|
527
|
-
!fs.existsSync(path.join(resolvedCwd, "release.json"))
|
|
528
|
-
) {
|
|
529
|
-
written.push(
|
|
530
|
-
writeIfAllowed(
|
|
531
|
-
path.join(resolvedCwd, "release.json"),
|
|
532
|
-
'{\n "upstream": "",\n "version": "0.0.0"\n}\n',
|
|
533
|
-
{ force },
|
|
534
|
-
),
|
|
535
|
-
);
|
|
453
|
+
if (type === "anchored-package" && !fs.existsSync(path.join(resolvedCwd, "release.json"))) {
|
|
454
|
+
written.push(writeIfAllowed(path.join(resolvedCwd, "release.json"), "{\n \"upstream\": \"\",\n \"version\": \"0.0.0\"\n}\n", { force }));
|
|
536
455
|
}
|
|
537
456
|
|
|
538
457
|
if (type === "infra-contract") {
|
|
539
458
|
written.push(
|
|
540
|
-
writeIfAllowed(
|
|
541
|
-
|
|
542
|
-
infraContractDesiredJson(resolvedCwd),
|
|
543
|
-
{ force },
|
|
544
|
-
),
|
|
545
|
-
writeIfAllowed(
|
|
546
|
-
path.join(resolvedCwd, "infra", "outputs.json"),
|
|
547
|
-
infraContractOutputsJson(resolvedCwd),
|
|
548
|
-
{ force },
|
|
549
|
-
),
|
|
459
|
+
writeIfAllowed(path.join(resolvedCwd, "infra", "desired.json"), infraContractDesiredJson(resolvedCwd), { force }),
|
|
460
|
+
writeIfAllowed(path.join(resolvedCwd, "infra", "outputs.json"), infraContractOutputsJson(resolvedCwd), { force }),
|
|
550
461
|
);
|
|
551
462
|
}
|
|
552
463
|
|
|
@@ -556,9 +467,7 @@ export function initBuildchainRepo({
|
|
|
556
467
|
cwd: resolvedCwd,
|
|
557
468
|
packageManager: manager,
|
|
558
469
|
workflowRef: BUILDCHAIN_WORKFLOW_REF,
|
|
559
|
-
written: written.map((filePath) =>
|
|
560
|
-
posixPath(path.relative(resolvedCwd, filePath)),
|
|
561
|
-
),
|
|
470
|
+
written: written.map((filePath) => posixPath(path.relative(resolvedCwd, filePath))),
|
|
562
471
|
};
|
|
563
472
|
}
|
|
564
473
|
|
|
@@ -570,11 +479,7 @@ function readArg(name, fallback = "") {
|
|
|
570
479
|
return process.argv[index + 1] || "";
|
|
571
480
|
}
|
|
572
481
|
|
|
573
|
-
if (
|
|
574
|
-
!process.env.BUILDCHAIN_EMBEDDED_ENTRYPOINT &&
|
|
575
|
-
process.argv[1] &&
|
|
576
|
-
import.meta.url === pathToFileURL(process.argv[1]).href
|
|
577
|
-
) {
|
|
482
|
+
if (!process.env.BUILDCHAIN_EMBEDDED_ENTRYPOINT && process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
578
483
|
try {
|
|
579
484
|
const result = initBuildchainRepo({
|
|
580
485
|
cwd: readArg("cwd", process.cwd()),
|
|
@@ -82,10 +82,6 @@ export function inspectArtifactSigningRequests({
|
|
|
82
82
|
if (seen.has(key))
|
|
83
83
|
throw new Error(`duplicate artifact signing request: ${key}`);
|
|
84
84
|
seen.add(key);
|
|
85
|
-
const {
|
|
86
|
-
entitlementsProfile = "none",
|
|
87
|
-
entitlementsPaths = [],
|
|
88
|
-
} = request.signature;
|
|
89
85
|
const item = {
|
|
90
86
|
id: request.artifact.id,
|
|
91
87
|
slug: safeId(request.artifact.id),
|
|
@@ -108,8 +104,6 @@ export function inspectArtifactSigningRequests({
|
|
|
108
104
|
sourceSha: request.source.sha,
|
|
109
105
|
sourceTreeSha: request.source.treeSha,
|
|
110
106
|
transportFormat: request.artifact.transport?.format || "",
|
|
111
|
-
entitlementsProfile,
|
|
112
|
-
entitlementsPaths: entitlementsPaths.join(","),
|
|
113
107
|
};
|
|
114
108
|
if (request.signature.profile === "detached-signature-v1")
|
|
115
109
|
matrices.detached.push(item);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { execFileSync } from "node:child_process";
|
|
3
2
|
import crypto from "node:crypto";
|
|
4
3
|
import fs from "node:fs";
|
|
5
4
|
import path from "node:path";
|
|
@@ -113,12 +112,12 @@ function ensureCheckoutTarget(targetPath, workspace) {
|
|
|
113
112
|
function git(args, { cwd, env = {}, timeoutMs = 60000, stdio = ["ignore", "pipe", "pipe"] } = {}) {
|
|
114
113
|
try {
|
|
115
114
|
const commandEnv = { ...process.env, ...env };
|
|
116
|
-
const output =
|
|
115
|
+
const output = runGitFetchSync({
|
|
116
|
+
args,
|
|
117
117
|
cwd,
|
|
118
118
|
env: commandEnv,
|
|
119
|
-
|
|
119
|
+
timeoutMs,
|
|
120
120
|
stdio,
|
|
121
|
-
timeout: timeoutMs,
|
|
122
121
|
});
|
|
123
122
|
return output ? String(output).trim() : "";
|
|
124
123
|
} catch (error) {
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
} from "./check-internal-architecture.mjs";
|
|
12
12
|
|
|
13
13
|
const JS_EXTENSIONS = new Set([".js", ".mjs", ".cjs"]);
|
|
14
|
+
const HAND_MAINTAINED_EXTENSIONS = new Set([...JS_EXTENSIONS, ".rs"]);
|
|
14
15
|
const GENERATED_PATTERN = /^actions\/[^/]+\/dist\/.*\.js$/u;
|
|
15
16
|
|
|
16
17
|
function gitText(root, args, encoding = "utf8") {
|
|
@@ -50,7 +51,7 @@ function isGeneratedFile(file) {
|
|
|
50
51
|
|
|
51
52
|
function isHandMaintainedSource(file) {
|
|
52
53
|
return (
|
|
53
|
-
|
|
54
|
+
HAND_MAINTAINED_EXTENSIONS.has(path.extname(file)) &&
|
|
54
55
|
!isTestFile(file) &&
|
|
55
56
|
!isGeneratedFile(file)
|
|
56
57
|
);
|
|
@@ -260,7 +261,12 @@ function collectMaintainabilityMetrics({
|
|
|
260
261
|
const sourceMetrics = Object.fromEntries(
|
|
261
262
|
sourceFiles.map((file) => {
|
|
262
263
|
const source = readTrackedFile(root, file, revision);
|
|
263
|
-
return [
|
|
264
|
+
return [
|
|
265
|
+
file,
|
|
266
|
+
JS_EXTENSIONS.has(path.extname(file))
|
|
267
|
+
? analyzeJavaScript(file, source)
|
|
268
|
+
: { lines: lineCount(source), complexity: 0, functions: [] },
|
|
269
|
+
];
|
|
264
270
|
}),
|
|
265
271
|
);
|
|
266
272
|
const sumLines = (entries) =>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { spawnSync } from "node:child_process";
|
|
3
2
|
import fs from "node:fs";
|
|
4
3
|
import path from "node:path";
|
|
5
4
|
import { pathToFileURL } from "node:url";
|
|
5
|
+
import { spawnSyncCommand } from "../packages/core/spawn-command.js";
|
|
6
6
|
|
|
7
7
|
const EXACT_TAG_PATTERN = /^v\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/;
|
|
8
8
|
|
|
@@ -27,7 +27,7 @@ function hasFlag(argv, name) {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
function runCommand({ cwd, cmd, args }) {
|
|
30
|
-
const result =
|
|
30
|
+
const result = spawnSyncCommand(cmd, args, {
|
|
31
31
|
cwd,
|
|
32
32
|
env: process.env,
|
|
33
33
|
encoding: "utf8",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { spawnSync } from "node:child_process";
|
|
3
2
|
import crypto from "node:crypto";
|
|
4
3
|
import fs from "node:fs";
|
|
5
4
|
import path from "node:path";
|
|
6
5
|
import { pathToFileURL } from "node:url";
|
|
6
|
+
import { spawnSyncCommand } from "../packages/core/spawn-command.js";
|
|
7
7
|
|
|
8
8
|
const EXACT_TAG_PATTERN = /^v\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/;
|
|
9
9
|
|
|
@@ -24,7 +24,7 @@ function readEnv(name, fallback = "") {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
function runNpm({ cwd, args, allowFailure = false }) {
|
|
27
|
-
const result =
|
|
27
|
+
const result = spawnSyncCommand("npm", args, {
|
|
28
28
|
cwd,
|
|
29
29
|
env: process.env,
|
|
30
30
|
encoding: "utf8",
|
|
@@ -7,12 +7,6 @@ import { pathToFileURL } from "node:url";
|
|
|
7
7
|
|
|
8
8
|
const SCHEMA = "kungfu-buildchain-publication-commit-evidence/v1";
|
|
9
9
|
const INSTALLER_BUNDLE_SCHEMA = "kungfu.installer-publication-bundle/v1";
|
|
10
|
-
const RELEASE_REDIRECT_STATUSES = new Set([301, 302, 303, 307, 308]);
|
|
11
|
-
const RELEASE_REDIRECT_HOSTS = new Set([
|
|
12
|
-
"github.com",
|
|
13
|
-
"release-assets.githubusercontent.com",
|
|
14
|
-
"objects.githubusercontent.com",
|
|
15
|
-
]);
|
|
16
10
|
|
|
17
11
|
function requiredString(value, label) {
|
|
18
12
|
if (typeof value !== "string" || value.trim() === "") {
|
|
@@ -110,7 +104,7 @@ function validateInstallerBundle(evidence, expected) {
|
|
|
110
104
|
}
|
|
111
105
|
if (
|
|
112
106
|
exactSha(bundle.sourceCommit, "installerBundle.sourceCommit") !==
|
|
113
|
-
expected.
|
|
107
|
+
expected.sourceSha ||
|
|
114
108
|
!["alpha", "stable"].includes(bundle.channel)
|
|
115
109
|
) {
|
|
116
110
|
throw new Error("installer bundle release identity mismatch");
|
|
@@ -234,7 +228,6 @@ function validateInstallerBundle(evidence, expected) {
|
|
|
234
228
|
return {
|
|
235
229
|
schema: bundle.schema,
|
|
236
230
|
bundleRoot,
|
|
237
|
-
sourceCommit: bundle.sourceCommit,
|
|
238
231
|
manifestDigest: bundle.manifestDigest,
|
|
239
232
|
channel: bundle.channel,
|
|
240
233
|
channelPayloadRoot: bundle.channelPayloadRoot,
|
|
@@ -245,9 +238,10 @@ function validateInstallerBundle(evidence, expected) {
|
|
|
245
238
|
assets: bundle.assets,
|
|
246
239
|
};
|
|
247
240
|
}
|
|
241
|
+
|
|
248
242
|
export function validatePublicationCommitEvidence(
|
|
249
243
|
evidence,
|
|
250
|
-
{ version, sourceSha,
|
|
244
|
+
{ version, sourceSha, releaseSha, releaseTag } = {},
|
|
251
245
|
) {
|
|
252
246
|
if (!evidence || typeof evidence !== "object" || Array.isArray(evidence)) {
|
|
253
247
|
throw new Error("publication commit evidence must be an object");
|
|
@@ -270,17 +264,6 @@ export function validatePublicationCommitEvidence(
|
|
|
270
264
|
throw new Error(`publication commit evidence ${field} mismatch`);
|
|
271
265
|
}
|
|
272
266
|
}
|
|
273
|
-
expected.candidateSourceSha = exactSha(
|
|
274
|
-
candidateSourceSha ?? identity.candidateSourceSha ?? expected.sourceSha,
|
|
275
|
-
"expected candidateSourceSha",
|
|
276
|
-
);
|
|
277
|
-
if (
|
|
278
|
-
identity.candidateSourceSha !== undefined &&
|
|
279
|
-
exactSha(identity.candidateSourceSha, "identity.candidateSourceSha") !==
|
|
280
|
-
expected.candidateSourceSha
|
|
281
|
-
) {
|
|
282
|
-
throw new Error("publication commit evidence candidateSourceSha mismatch");
|
|
283
|
-
}
|
|
284
267
|
const publicUrl = publicHttps(evidence.publication?.url, "publication.url");
|
|
285
268
|
const payloadRoot = sha256Root(
|
|
286
269
|
evidence.publication?.payloadRoot,
|
|
@@ -330,47 +313,15 @@ export async function verifyInstallerBundleReadback(
|
|
|
330
313
|
if (typeof fetchImpl !== "function") {
|
|
331
314
|
throw new Error("installer bundle read-back requires fetch");
|
|
332
315
|
}
|
|
333
|
-
const
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
throw new Error(`${label} failed: HTTP ${response.status}`);
|
|
343
|
-
}
|
|
344
|
-
if (hop === 3) {
|
|
345
|
-
throw new Error(`${label} exceeded the bounded redirect limit`);
|
|
346
|
-
}
|
|
347
|
-
const location = response.headers?.get?.("location");
|
|
348
|
-
if (!location) {
|
|
349
|
-
throw new Error(`${label} redirect omitted Location`);
|
|
350
|
-
}
|
|
351
|
-
const redirect = new URL(location, current);
|
|
352
|
-
if (
|
|
353
|
-
redirect.protocol !== "https:" ||
|
|
354
|
-
redirect.username ||
|
|
355
|
-
redirect.password ||
|
|
356
|
-
!RELEASE_REDIRECT_HOSTS.has(redirect.hostname) ||
|
|
357
|
-
(redirect.hostname === "github.com" &&
|
|
358
|
-
!redirect.pathname.startsWith(
|
|
359
|
-
"/kungfu-systems/kungfu/releases/download/",
|
|
360
|
-
))
|
|
361
|
-
) {
|
|
362
|
-
throw new Error(
|
|
363
|
-
`${label} redirected outside trusted GitHub release storage`,
|
|
364
|
-
);
|
|
365
|
-
}
|
|
366
|
-
current = redirect.href;
|
|
367
|
-
}
|
|
368
|
-
throw new Error(`${label} failed without a terminal response`);
|
|
369
|
-
};
|
|
370
|
-
const manifestResponse = await fetchReleaseReadback(
|
|
371
|
-
result.publicUrl,
|
|
372
|
-
"installer bundle manifest read-back",
|
|
373
|
-
);
|
|
316
|
+
const manifestResponse = await fetchImpl(result.publicUrl, {
|
|
317
|
+
redirect: "manual",
|
|
318
|
+
cache: "no-store",
|
|
319
|
+
});
|
|
320
|
+
if (manifestResponse.status !== 200) {
|
|
321
|
+
throw new Error(
|
|
322
|
+
`installer bundle manifest read-back failed: HTTP ${manifestResponse.status}`,
|
|
323
|
+
);
|
|
324
|
+
}
|
|
374
325
|
const manifestBytes = Buffer.from(await manifestResponse.arrayBuffer());
|
|
375
326
|
if (digest(manifestBytes) !== bundle.manifestDigest) {
|
|
376
327
|
throw new Error("installer bundle manifest digest mismatch");
|
|
@@ -385,7 +336,7 @@ export async function verifyInstallerBundleReadback(
|
|
|
385
336
|
semanticRoot(unsigned) !== bundle.bundleRoot ||
|
|
386
337
|
manifest.package?.name !== "@kungfu-tech/site" ||
|
|
387
338
|
typeof manifest.package?.version !== "string" ||
|
|
388
|
-
manifest.identity?.sourceCommit !== result.identity.
|
|
339
|
+
manifest.identity?.sourceCommit !== result.identity.sourceSha ||
|
|
389
340
|
manifest.identity?.releaseSha !== result.identity.releaseSha ||
|
|
390
341
|
manifest.identity?.releaseTag !== result.identity.releaseTag ||
|
|
391
342
|
manifest.identity?.version !== result.identity.version ||
|
|
@@ -414,10 +365,15 @@ export async function verifyInstallerBundleReadback(
|
|
|
414
365
|
for (const asset of bundle.assets) {
|
|
415
366
|
let observation = byUrl.get(asset.releaseUrl);
|
|
416
367
|
if (!observation) {
|
|
417
|
-
const response = await
|
|
418
|
-
|
|
419
|
-
"
|
|
420
|
-
);
|
|
368
|
+
const response = await fetchImpl(asset.releaseUrl, {
|
|
369
|
+
redirect: "manual",
|
|
370
|
+
cache: "no-store",
|
|
371
|
+
});
|
|
372
|
+
if (response.status !== 200) {
|
|
373
|
+
throw new Error(
|
|
374
|
+
`installer bundle asset read-back failed: HTTP ${response.status}`,
|
|
375
|
+
);
|
|
376
|
+
}
|
|
421
377
|
const bytes = Buffer.from(await response.arrayBuffer());
|
|
422
378
|
observation = {
|
|
423
379
|
releaseUrl: asset.releaseUrl,
|
|
@@ -438,7 +394,7 @@ export async function verifyInstallerBundleReadback(
|
|
|
438
394
|
schema: "kungfu-buildchain-installer-publication-bundle-seal/v1",
|
|
439
395
|
bundleRoot: bundle.bundleRoot,
|
|
440
396
|
manifestDigest: bundle.manifestDigest,
|
|
441
|
-
sourceCommit: result.identity.
|
|
397
|
+
sourceCommit: result.identity.sourceSha,
|
|
442
398
|
releaseTag: result.identity.releaseTag,
|
|
443
399
|
releasePassport: bundle.releasePassport,
|
|
444
400
|
observations,
|
|
@@ -453,8 +409,6 @@ async function main(args) {
|
|
|
453
409
|
if (value === "--evidence") options.evidence = args[++index];
|
|
454
410
|
else if (value === "--version") options.version = args[++index];
|
|
455
411
|
else if (value === "--source-sha") options.sourceSha = args[++index];
|
|
456
|
-
else if (value === "--candidate-source-sha")
|
|
457
|
-
options.candidateSourceSha = args[++index];
|
|
458
412
|
else if (value === "--release-sha") options.releaseSha = args[++index];
|
|
459
413
|
else if (value === "--release-tag") options.releaseTag = args[++index];
|
|
460
414
|
else throw new Error(`unknown argument: ${value}`);
|
|
@@ -291,7 +291,7 @@ function readNpmPackageJsonFromTarball(tarballPath) {
|
|
|
291
291
|
const errors = [];
|
|
292
292
|
for (const candidate of candidates) {
|
|
293
293
|
try {
|
|
294
|
-
return JSON.parse(execFileSync("tar", ["-xOf", tarballPath, candidate], { encoding: "utf8" }));
|
|
294
|
+
return JSON.parse(execFileSync("tar", ["-xOf", path.basename(tarballPath), candidate], { cwd: path.dirname(tarballPath), encoding: "utf8" }));
|
|
295
295
|
} catch (error) {
|
|
296
296
|
errors.push(error.stderr?.toString?.().trim() || error.message);
|
|
297
297
|
}
|
|
@@ -351,22 +351,16 @@ export function generatePublishRequiredArtifacts({
|
|
|
351
351
|
const files = Array.isArray(manifest.files) ? manifest.files : [];
|
|
352
352
|
return files
|
|
353
353
|
.filter((file) => file?.sha256)
|
|
354
|
-
.map((file) => {
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
? String(file.sha256)
|
|
365
|
-
: `sha256:${file.sha256}`,
|
|
366
|
-
role: "platform",
|
|
367
|
-
platform,
|
|
368
|
-
};
|
|
369
|
-
});
|
|
354
|
+
.map((file) => ({
|
|
355
|
+
kind,
|
|
356
|
+
name: packageNameFromArtifactPath(file.path || file.name || manifest.artifactName || platform),
|
|
357
|
+
ref,
|
|
358
|
+
digest: String(file.sha256).startsWith("sha256:")
|
|
359
|
+
? String(file.sha256)
|
|
360
|
+
: `sha256:${file.sha256}`,
|
|
361
|
+
role: "platform",
|
|
362
|
+
platform,
|
|
363
|
+
}));
|
|
370
364
|
});
|
|
371
365
|
}
|
|
372
366
|
|