@kungfu-tech/buildchain 3.0.2 → 3.0.3-alpha.1

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.
Files changed (127) hide show
  1. package/AGENTS.md +1 -1
  2. package/CONTRIBUTING.md +1 -1
  3. package/README.md +27 -1
  4. package/actions/promote-buildchain-ref/README.md +90 -19
  5. package/actions/report-buildchain-issue/README.md +20 -2
  6. package/actions/run-lifecycle/README.md +5 -0
  7. package/actions/validate-config/README.md +19 -1
  8. package/bin/buildchain.mjs +56 -2
  9. package/bin/internal/command-registry.mjs +82 -0
  10. package/bin/internal/trust-release-cli.mjs +1 -0
  11. package/contracts/auditable-demo-media-profiles-v1.json +116 -1
  12. package/contracts/buildchain-v2-residuals-v1.json +146 -0
  13. package/contracts/evidence/auditable-demo-responsive-web-delivery-v1.json +143 -0
  14. package/contracts/evidence/auditable-demo-web-delivery-v1.json +7 -3
  15. package/contracts/fixtures/auditable-demo-responsive-web-delivery-v1/complete-transcript.txt +2 -0
  16. package/contracts/fixtures/auditable-demo-responsive-web-delivery-v1/public-projection.json +16 -0
  17. package/contracts/fixtures/auditable-demo-responsive-web-delivery-v1/scene.json +12 -0
  18. package/dist/site/buildchain-contract.json +188 -46
  19. package/dist/site/buildchain-site.json +181 -90
  20. package/dist/site/capability-registry.json +5 -5
  21. package/dist/site/cli-registry.json +860 -98
  22. package/dist/site/controller-registry.json +118 -5
  23. package/dist/site/kfd-claims.json +233 -19
  24. package/dist/site/kfd-upstream-aggregate.json +1 -1
  25. package/dist/site/manual-registry.json +20 -20
  26. package/dist/site/node-api-registry.json +374 -59
  27. package/dist/site/page-registry.json +156 -65
  28. package/dist/site/public-surface-audit.json +231 -22
  29. package/dist/site/publication-registry.json +4 -4
  30. package/dist/site/release-provenance.json +3 -0
  31. package/dist/site/site-manifest.json +24 -24
  32. package/dist/site/workflow-registry.json +575 -79
  33. package/docs/MAP.md +22 -4
  34. package/docs/auditable-demo.md +54 -13
  35. package/docs/aws-us-elastic-runner-burst-plane.md +381 -0
  36. package/docs/cli.md +119 -12
  37. package/docs/consumer-issue-reporting.md +20 -2
  38. package/docs/dev-alpha-candidate-patrol.md +24 -10
  39. package/docs/github-governance-authority.md +24 -31
  40. package/docs/lifecycle-protocol.md +20 -2
  41. package/docs/migration-inventory.md +24 -5
  42. package/docs/observed-evidence-patrol.md +28 -12
  43. package/docs/ownership.md +19 -1
  44. package/docs/publication-artifacts.md +158 -18
  45. package/docs/publication-authority.md +4 -4
  46. package/docs/publish-transaction.md +78 -31
  47. package/docs/release-candidate.md +24 -0
  48. package/docs/release-flow.md +50 -32
  49. package/docs/release-governance.md +39 -32
  50. package/docs/release-passport.md +4 -0
  51. package/docs/release-propagation.md +57 -12
  52. package/docs/reusable-build-surface.md +218 -90
  53. package/docs/runtime-train-validation.md +20 -2
  54. package/docs/shifu-gate-profiles.md +7 -1
  55. package/docs/stable-candidate-patrol.md +6 -6
  56. package/docs/toolkit-observability.md +22 -0
  57. package/docs/versioning.md +46 -24
  58. package/docs/web-surface-deployments.md +82 -1
  59. package/package.json +7 -5
  60. package/packages/core/README.md +60 -4
  61. package/packages/core/artifact-signing.js +1 -0
  62. package/packages/core/buildchain-contract.js +9 -4
  63. package/packages/core/cache-evidence.js +1 -0
  64. package/packages/core/controller-evidence.js +2 -0
  65. package/packages/core/diagnostics.js +105 -30
  66. package/packages/core/github-governance-authority.js +25 -17
  67. package/packages/core/index.js +40 -0
  68. package/packages/core/paper.js +3226 -0
  69. package/packages/core/public-surface-audit.js +3 -0
  70. package/packages/core/publication-artifact.js +1 -6
  71. package/packages/core/publication-authority.js +1 -0
  72. package/packages/core/publication-control-plane-audit.js +28 -0
  73. package/packages/core/publication-reproducibility.js +947 -0
  74. package/packages/core/publication-sealed-bundle.js +190 -0
  75. package/packages/core/publish-transaction.js +147 -17
  76. package/packages/core/release-candidate.js +234 -0
  77. package/packages/core/release-passport.js +519 -228
  78. package/packages/core/release-propagation.js +175 -1
  79. package/packages/core/stable-release-gate.js +4 -1
  80. package/scripts/artifact-signing-delegation.mjs +268 -0
  81. package/scripts/audit-github-governance.mjs +32 -13
  82. package/scripts/audit-publication-control-plane.mjs +17 -8
  83. package/scripts/auditable-demo.mjs +266 -7
  84. package/scripts/aws-codebuild-toolchain.mjs +285 -0
  85. package/scripts/aws-macos-jit-core.mjs +378 -0
  86. package/scripts/aws-macos-jit.mjs +123 -0
  87. package/scripts/aws-runner-burst-core.mjs +248 -0
  88. package/scripts/aws-runner-burst.mjs +79 -0
  89. package/scripts/aws-windows-jit-core.mjs +374 -0
  90. package/scripts/aws-windows-jit.mjs +121 -0
  91. package/scripts/build-contract-core.mjs +69 -6
  92. package/scripts/build-standalone-binary.mjs +23 -0
  93. package/scripts/buildchain-contract-lock.mjs +1 -1
  94. package/scripts/buildchain-patrol.mjs +1 -1
  95. package/scripts/check-internal-architecture.mjs +69 -2
  96. package/scripts/check-inventory.mjs +70 -2
  97. package/scripts/check-javascript-syntax.mjs +31 -0
  98. package/scripts/check-maintainability.mjs +371 -0
  99. package/scripts/compiler-cache-evidence.mjs +221 -0
  100. package/scripts/dev-alpha-candidate-patrol.mjs +288 -43
  101. package/scripts/dispatch-artifact-signing-authority.mjs +7 -1
  102. package/scripts/finalize-native-artifact-signing-result.mjs +185 -31
  103. package/scripts/gate-profile-core.mjs +6 -1
  104. package/scripts/generate-channel-promotion-workflow.mjs +3 -12
  105. package/scripts/generate-release-candidate-passport.mjs +4 -0
  106. package/scripts/generate-site-bundle.mjs +84 -18
  107. package/scripts/import-artifact-signing-results.mjs +64 -5
  108. package/scripts/inspect-artifact-signing-requests.mjs +52 -14
  109. package/scripts/maintainability-metrics.mjs +339 -0
  110. package/scripts/npm-publish-transaction.mjs +57 -6
  111. package/scripts/observed-evidence.mjs +151 -33
  112. package/scripts/paper.mjs +645 -0
  113. package/scripts/promotion-channel-router.mjs +16 -4
  114. package/scripts/publication-reproducibility.mjs +62 -0
  115. package/scripts/reconcile-github-governance.mjs +8 -1
  116. package/scripts/release-propagation.mjs +39 -0
  117. package/scripts/resolve-artifact-signing-upload-route.mjs +55 -0
  118. package/scripts/resolve-build-contract.mjs +6 -0
  119. package/scripts/route-offline-runners.mjs +236 -0
  120. package/scripts/run-candidate-body-prefix-renderer.mjs +187 -0
  121. package/scripts/run-lifecycle-core.mjs +62 -1
  122. package/scripts/runtime-ref-core.mjs +36 -4
  123. package/scripts/seal-artifact-signing-requests.mjs +64 -12
  124. package/scripts/stable-candidate-qualification.mjs +50 -0
  125. package/scripts/verify-artifact-signing-results.mjs +26 -1
  126. package/scripts/web-surface-core.mjs +272 -86
  127. package/scripts/web-surface-production-decision.mjs +19 -3
@@ -8,17 +8,17 @@ confidence: high
8
8
  sensitivity: public
9
9
  evidence_grade: A
10
10
  review_state: unreviewed
11
- last_reviewed: 2026-07-27
11
+ last_reviewed: 2026-07-31
12
12
  ai_provenance:
13
13
  model_family: GPT-5
14
14
  product: Codex
15
- generated_at: 2026-07-27
15
+ generated_at: 2026-07-30
16
16
  invisible_context: not asserted
17
17
  ---
18
18
 
19
19
  # Reusable Build Surface
20
20
 
21
- Buildchain v2 provides a reusable build workflow for repositories that need
21
+ Buildchain v3 provides a reusable build workflow for repositories that need
22
22
  Buildchain's release semantics but cannot be described as a simple Node package.
23
23
  The first target shape is `libnode`: expensive native builds, multiple operating
24
24
  systems, self-hosted runner labels, and release artifacts that must be auditable.
@@ -31,9 +31,8 @@ only signs and verifies immutable data. See
31
31
 
32
32
  ## Automatic Channel Router
33
33
 
34
- The preferred consumer surface is one reusable workflow call. After v2.12
35
- reaches the stable major ref, consumers keep this configuration for both alpha
36
- development and stable release work:
34
+ The preferred consumer surface is one reusable workflow call. Consumers keep
35
+ this configuration for both alpha development and stable release work:
37
36
 
38
37
  ```yaml
39
38
  jobs:
@@ -79,10 +78,10 @@ with:
79
78
  buildchain-channel: stable
80
79
  ```
81
80
 
82
- During the v2.12 prerelease evaluation window, canaries use
83
- `build.yml@v3-alpha`. The same router then selects `v3-alpha` or stable `v2` as
84
- the runtime. Production consumers should adopt `build.yml@v3` after the router
85
- has reached stable; this keeps the routing shell itself on a stable ref.
81
+ During v3 prerelease evaluation windows, canaries use `build.yml@v3-alpha`.
82
+ The same router then selects `v3-alpha` or stable `v3` as the runtime.
83
+ Production consumers use `build.yml@v3`; this keeps the routing shell itself on
84
+ a stable ref.
86
85
 
87
86
  The router is generated from `.build.yml`'s input/output surface. Run
88
87
  `node scripts/generate-channel-build-workflow.mjs` after changing the advanced
@@ -116,12 +115,33 @@ jobs:
116
115
 
117
116
  `runner-preset` is the stable first-class surface for known runner fleets:
118
117
 
119
- | Preset | Platforms |
120
- | ----------------------- | ------------------------------------------------------------------------ |
121
- | `github-hosted` | `ubuntu-24.04`, `macos-latest`, `windows-2022` |
122
- | `kungfu-v4-self-hosted` | Kungfu Linux x64, macOS ARM64, and Windows x64 self-hosted runner labels |
118
+ | Preset | Platforms |
119
+ | ----------------------- | -------------------------------------------------------------------------------------------------------------- |
120
+ | `github-hosted` | `ubuntu-24.04`, `macos-latest`, `windows-2022` |
121
+ | `kungfu-v4-self-hosted` | Kungfu Linux x64, macOS ARM64, and Windows x64 self-hosted runner labels |
123
122
  | `kungfu-v4-native` | Kungfu Linux x64, Linux ARM64, macOS ARM64, and Windows x64; Linux ARM64 uses GitHub-hosted `ubuntu-24.04-arm` |
124
- | `custom` | Requires `platforms-json` |
123
+ | `custom` | Requires `platforms-json` |
124
+
125
+ Set `self-hosted-offline-fallback: true` to inspect every exact-label
126
+ self-hosted lane from the trusted Buildchain workflow shell before the matrix
127
+ starts. A lane with no matching online runner is replaced independently by its
128
+ supported GitHub-hosted runner: Kungfu Linux x64 uses `ubuntu-24.04`, macOS ARM64
129
+ uses `macos-15`, and Windows x64 uses `windows-2022`. Online-but-busy runners
130
+ remain online and keep their declared self-hosted route. Organization-owned
131
+ repositories inspect organization runner inventory so selected-repository runner
132
+ groups are not mistaken for an empty repository runner inventory. If the
133
+ inventory token, permission, or API is unavailable, Buildchain preserves the
134
+ original matrix instead of guessing that the fleet is offline. The public
135
+ workflow output `runner-routing-json` records only de-identified counts,
136
+ inventory scope, and routing decisions.
137
+
138
+ ```yaml
139
+ with:
140
+ runner-preset: kungfu-v4-native
141
+ self-hosted-offline-fallback: true
142
+ secrets:
143
+ BUILDCHAIN_PROMOTION_TOKEN: ${{ secrets.KUNGFU_GITHUB_TOKEN }}
144
+ ```
125
145
 
126
146
  Callers can still provide a custom matrix with `platforms-json`. Each platform
127
147
  object has:
@@ -268,23 +288,30 @@ jobs:
268
288
 
269
289
  Allowed override refs are deliberately narrow:
270
290
 
271
- | Ref form | Meaning |
272
- | --- | --- |
273
- | `train/v3/v3.0/<capability>` | Temporary capability train under the active minor line |
274
- | `refs/heads/train/v3/v3.0/<capability>` | Explicit branch ref for the same train |
275
- | `<40-character SHA>` | Exact immutable Buildchain runtime commit |
291
+ | Ref form | Meaning |
292
+ | --------------------------------------- | ------------------------------------------------------ |
293
+ | `train/v3/v3.0/<capability>` | Temporary capability train under the active minor line |
294
+ | `refs/heads/train/v3/v3.0/<capability>` | Explicit branch ref for the same train |
295
+ | `<40-character SHA>` | Exact immutable Buildchain runtime commit |
276
296
 
277
297
  Override requests fail closed unless the event is `workflow_dispatch` and the
278
- actor has write, maintain, or admin permission on the caller repository.
298
+ actor has write, maintain, or admin permission on the caller repository. One
299
+ non-override exact-pin case is also admitted: when the reusable workflow itself
300
+ is invoked from an exact Buildchain SHA and `buildchain-ref` names that identical
301
+ SHA, the run records `pinned-self`. The input cannot select code other than the
302
+ already-running workflow shell, so protected push and pull-request publication
303
+ jobs can retain one immutable runtime root. Different SHA and train requests
304
+ still fail closed outside trusted manual dispatch.
305
+
279
306
  Pull requests, including same-repository pull requests and fork-originated pull
280
- requests, cannot use `buildchain-ref` override. This keeps automated PR builds on
281
- the stable runtime surface.
307
+ requests, cannot select an independent `buildchain-ref` override. This keeps
308
+ automated PR builds on the stable or exact pinned-self runtime surface.
282
309
 
283
310
  Every run resolves the runtime ref to an immutable SHA before checkout. The job
284
311
  summary and aggregate build summary record the workflow shell ref, requested
285
312
  runtime ref, resolved runtime ref, runtime SHA, stability class, trust decision,
286
313
  and rollback ref. Train refs are development validation refs: they do not move
287
- `v2`, `vX.Y`, `vX.Y-alpha`, npm dist-tags, or production release refs, and they
314
+ `v3`, `vX.Y`, `vX.Y-alpha`, npm dist-tags, or production release refs, and they
288
315
  must not be pinned as long-term production dependencies.
289
316
 
290
317
  Runtime override validates Buildchain runtime scripts, CLI code, local actions,
@@ -304,13 +331,13 @@ major line, and compatibility policy they reviewed.
304
331
 
305
332
  The reusable build trust gate checks this lock before any heavy matrix job:
306
333
 
307
- 1. resolve the Buildchain runtime ref, for example `v2`, to an immutable SHA;
334
+ 1. resolve the Buildchain runtime ref, for example `v3`, to an immutable SHA;
308
335
  2. read `dist/site/buildchain-contract.json` from that checked-out Buildchain
309
336
  ref;
310
337
  3. read the consumer's `.buildchain/contract-lock.json`;
311
338
  4. compare the accepted contract with the current contract.
312
339
 
313
- SHA drift alone is not a failure. `v2` is expected to advance. Buildchain only
340
+ SHA drift alone is not a failure. `v3` is expected to advance. Buildchain only
314
341
  fails fast when the accepted contract is no longer compatible, for example a
315
342
  required input is removed, a required output disappears, a protected behavior
316
343
  promise changes, or the major line changes. Additive changes such as optional
@@ -416,11 +443,11 @@ jobs:
416
443
 
417
444
  `checkout-cache-mode` accepts:
418
445
 
419
- | Mode | Behavior |
420
- | --- | --- |
421
- | `off` | Default. Buildchain fetches the locked commit from GitHub. |
422
- | `auto` | Try the trusted cache first; on miss, record the miss and fall back according to `checkout-cache-fallback`. |
423
- | `require` | Require the cache to provide the locked commit and fail before lifecycle work if unavailable. |
446
+ | Mode | Behavior |
447
+ | --------- | ----------------------------------------------------------------------------------------------------------- |
448
+ | `off` | Default. Buildchain fetches the locked commit from GitHub. |
449
+ | `auto` | Try the trusted cache first; on miss, record the miss and fall back according to `checkout-cache-fallback`. |
450
+ | `require` | Require the cache to provide the locked commit and fail before lifecycle work if unavailable. |
424
451
 
425
452
  The cache can be a local/LAN mirror URL template or a runner-local bare
426
453
  reference repository template. Templates support `{owner}`, `{repo}`,
@@ -466,6 +493,33 @@ Runtime checkout evidence is uploaded separately as `runtime-checkout.json`,
466
493
  including cache transport, fallback attempts, and exact runtime `HEAD`
467
494
  verification, even when a later lifecycle step fails.
468
495
 
496
+ ## Auditable Compiler Cache
497
+
498
+ Consumers can prepare `sccache` on selected platforms after the install
499
+ lifecycle and before compilation:
500
+
501
+ ```yaml
502
+ with:
503
+ compiler-cache-provider: sccache
504
+ compiler-cache-platforms-json: '["windows-x64"]'
505
+ compiler-cache-required: true
506
+ ```
507
+
508
+ The consumer remains responsible for installing and pinning the tool before
509
+ the preparation step. Buildchain probes its version, runs `sccache
510
+ --zero-stats`, and writes
511
+ `compiler-cache-preparation.json`. The receipt binds the source commit/tree,
512
+ Buildchain runtime, platform, cache profile, and any declared dependency,
513
+ toolchain, or policy roots. It resets counters only; it does not delete cached
514
+ compiler outputs.
515
+
516
+ Final diagnostics admit sccache hit/miss outcomes as current-run evidence only
517
+ when that preparation receipt is present and valid. A bare `sccache
518
+ --show-stats` result without the reset receipt remains cumulative and is
519
+ reported as unavailable for the current run. The preparation receipt is copied
520
+ into the small diagnostics artifact and sealed by
521
+ `diagnostics-manifest.json`.
522
+
469
523
  When a Buildchain maintainer asks for downstream validation, the expected
470
524
  request is:
471
525
 
@@ -484,38 +538,38 @@ separate periodic cleanup task.
484
538
 
485
539
  The reusable workflow exposes the resolved contract:
486
540
 
487
- | Output | Meaning |
488
- | --------------------------------- | ------------------------------------------------------------------------------- |
489
- | `runner-preset` | Resolved preset, or `custom` when `platforms-json` was provided |
490
- | `platforms-json` | Exact matrix JSON used by the build job |
491
- | `platform-count` | Number of matrix platforms |
492
- | `linux-container-enabled` | `true` when Linux platforms are routed through a job container |
493
- | `linux-container-image` | Resolved digest-pinned Linux job container image |
494
- | `build-summary-artifact` | Uploaded aggregate summary artifact name |
495
- | `build-diagnostics-summary-artifact` | Uploaded aggregate diagnostics summary artifact name |
496
- | `release-candidate-passport-artifact` | Uploaded PR-stage release-candidate passport artifact name when `release-candidate` is enabled |
497
- | `release-candidate-passport-json` | Compact release-candidate passport JSON when `release-candidate` is enabled |
498
- | `build-summary-json` | Compact aggregate JSON with platform count, file count, and byte total |
499
- | `build-diagnostics-summary-json` | Compact aggregate diagnostics JSON with platform, lifecycle warning/error, diagnostics contract warning, and sidecar manifest warning totals |
500
- | `trusted-event` | `true` when the event is trusted enough to reach build runners |
501
- | `buildchain-runtime-ref` | Runtime ref selected after applying the empty-default or override policy |
502
- | `buildchain-runtime-sha` | Immutable Buildchain runtime commit used by all runtime checkouts |
503
- | `buildchain-runtime-class` | `stable`, `alpha`, `authority`, `train`, `exact-sha`, or `development` |
504
- | `buildchain-runtime-override` | `true` when an authority, train, or exact-SHA `buildchain-ref` override was accepted |
505
- | `buildchain-runtime-trust-decision` | Runtime override trust decision |
506
- | `buildchain-contract-lock-status` | `unchanged`, `compatible-drift`, `breaking-drift`, `missing-lock`, `non-floating-runtime`, or first-release `runtime-contract-unavailable` |
507
- | `buildchain-contract-lock-drift` | `true` when the floating runtime SHA or contract digest changed |
508
- | `buildchain-contract-digest` | Current Buildchain runtime contract digest |
509
- | `publish-channel` | Resolved publish channel requested by the caller |
510
- | `publish-allowed` | `true` only when this event/ref may publish after verification |
511
- | `publish-reason` | Human-readable reason for the publish gate decision |
512
- | `publish-source-ref` | Gate source ref that was resolved before checkout |
513
- | `publish-source-sha` | Exact source commit used by checkout, build, verify, and artifacts |
514
- | `publish-source-locked` | `true` when a `publish-gate/*` source ref was explicitly locked |
515
- | `publish-source-channel` | `alpha`, `release`, `anchor`, or `major` parsed from the source ref |
516
- | `publish-source-line` | Product line parsed from source refs such as `v22/v22.22` |
517
- | `publish-source-consumer-version` | Consumer package version parsed from source refs |
518
- | `release-manifest-json` | Resolved release manifest including source lock, version state, and anchor data |
541
+ | Output | Meaning |
542
+ | ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
543
+ | `runner-preset` | Resolved preset, or `custom` when `platforms-json` was provided |
544
+ | `platforms-json` | Exact matrix JSON used by the build job |
545
+ | `platform-count` | Number of matrix platforms |
546
+ | `linux-container-enabled` | `true` when Linux platforms are routed through a job container |
547
+ | `linux-container-image` | Resolved digest-pinned Linux job container image |
548
+ | `build-summary-artifact` | Uploaded aggregate summary artifact name |
549
+ | `build-diagnostics-summary-artifact` | Uploaded aggregate diagnostics summary artifact name |
550
+ | `release-candidate-passport-artifact` | Uploaded PR-stage release-candidate passport artifact name when `release-candidate` is enabled |
551
+ | `release-candidate-passport-json` | Compact release-candidate passport JSON when `release-candidate` is enabled |
552
+ | `build-summary-json` | Compact aggregate JSON with platform count, file count, and byte total |
553
+ | `build-diagnostics-summary-json` | Compact aggregate diagnostics JSON with platform, lifecycle warning/error, diagnostics contract warning, and sidecar manifest warning totals |
554
+ | `trusted-event` | `true` when the event is trusted enough to reach build runners |
555
+ | `buildchain-runtime-ref` | Runtime ref selected after applying the empty-default or override policy |
556
+ | `buildchain-runtime-sha` | Immutable Buildchain runtime commit used by all runtime checkouts |
557
+ | `buildchain-runtime-class` | `stable`, `alpha`, `authority`, `train`, `exact-sha`, or `development` |
558
+ | `buildchain-runtime-override` | `true` when an authority, train, or exact-SHA `buildchain-ref` override was accepted |
559
+ | `buildchain-runtime-trust-decision` | Runtime override trust decision |
560
+ | `buildchain-contract-lock-status` | `unchanged`, `compatible-drift`, `breaking-drift`, `missing-lock`, `non-floating-runtime`, or first-release `runtime-contract-unavailable` |
561
+ | `buildchain-contract-lock-drift` | `true` when the floating runtime SHA or contract digest changed |
562
+ | `buildchain-contract-digest` | Current Buildchain runtime contract digest |
563
+ | `publish-channel` | Resolved publish channel requested by the caller |
564
+ | `publish-allowed` | `true` only when this event/ref may publish after verification |
565
+ | `publish-reason` | Human-readable reason for the publish gate decision |
566
+ | `publish-source-ref` | Gate source ref that was resolved before checkout |
567
+ | `publish-source-sha` | Exact source commit used by checkout, build, verify, and artifacts |
568
+ | `publish-source-locked` | `true` when a `publish-gate/*` source ref was explicitly locked |
569
+ | `publish-source-channel` | `alpha`, `release`, `anchor`, or `major` parsed from the source ref |
570
+ | `publish-source-line` | Product line parsed from source refs such as `v22/v22.22` |
571
+ | `publish-source-consumer-version` | Consumer package version parsed from source refs |
572
+ | `release-manifest-json` | Resolved release manifest including source lock, version state, and anchor data |
519
573
 
520
574
  The aggregate summaries are intentionally artifacts as well as outputs. GitHub
521
575
  Actions matrix outputs are not a reliable place to carry every platform's full
@@ -562,11 +616,46 @@ lifecycle and before verification. Buildchain binds the exact artifact bytes or
562
616
  the caller repository, source commit, source tree, immutable runtime, platform,
563
617
  and requested signature semantics, then publishes a deterministic
564
618
  `<artifact>-signing-request-<platform>-<source-sha>` request. No consumer
565
- workflow step is required.
619
+ workflow step is required. The lifecycle runner automatically adds declarations
620
+ selected for the current platform to the `build` manifest scan, including
621
+ subjects outside the caller's ordinary `artifact-paths`; this extends the
622
+ evidence preimage without silently adding those subjects to the ordinary
623
+ artifact upload.
624
+
625
+ The request root is a Buildchain-owned generated output. After the declaration,
626
+ lifecycle manifest, and source paths pass validation, sealing replaces that root
627
+ before materializing the current request set. This keeps repeated jobs on a
628
+ self-hosted runner idempotent and prevents stale requests from an earlier run
629
+ from entering the uploaded request artifact. An output root that contains the
630
+ workspace, working directory, lifecycle manifest, or any declared subject is
631
+ rejected before cleanup.
632
+
633
+ Self-hosted runners whose network requires different routes for Artifact upload
634
+ and download can scope an upload-only proxy bypass to the sealed signing request:
635
+
636
+ ```yaml
637
+ with:
638
+ artifact-signing-request-upload-no-proxy: ".blob.core.windows.net"
639
+ ```
640
+
641
+ The caller repository variable
642
+ `BUILDCHAIN_ARTIFACT_SIGNING_REQUEST_UPLOAD_NO_PROXY` provides the same value
643
+ without changing a consumer workflow; an explicit workflow input takes
644
+ precedence. When neither is set, Buildchain preserves the runner's existing
645
+ `NO_PROXY` and `no_proxy` values. The resolved value applies only to the
646
+ Buildchain-owned signing-request upload. Authority dispatch and immutable
647
+ signed-result download keep the runner's original proxy route. This is a
648
+ transport control only: it does not change request bytes, signing authority,
649
+ artifact identity, or verification policy.
566
650
 
567
651
  `profile = "auto"` resolves signable Apple artifacts such as Mach-O files,
568
- `.dylib`, `.framework`, `.app`, `.xpc`, `.plugin`, `.pkg`, and `.dmg` to the
569
- native `apple-developer-id` provider. Windows `pe` and `binary` artifacts
652
+ `.dylib`, `.framework`, `.app`, `.xpc`, `.plugin`, `.pkg`, `.dmg`, and macOS
653
+ archives containing native code to the native `apple-developer-id` provider.
654
+ For a declared macOS `archive`, the authority safely extracts the sealed
655
+ container, signs and verifies every Mach-O payload, signs Mach-O payloads inside
656
+ embedded Python wheels, rebuilds each affected wheel's PEP 427 `RECORD`, and
657
+ recreates the original zip or tar.gz before returning the exact final bytes.
658
+ Windows `pe` and `binary` artifacts
570
659
  resolve to timestamped native `windows-authenticode`; Windows PE never falls
571
660
  back to a detached signature. Linux and other non-native binary files,
572
661
  archives, blobs, and directories resolve to `detached-signature-v1`. Buildchain records that as a
@@ -582,9 +671,40 @@ evidence. Consumer repositories neither receive nor duplicate credential-island
582
671
  material. The reusable workflow dispatches the sealed request to the
583
672
  Buildchain repository, waits for its protected authority workflow, verifies the
584
673
  immutable result, replaces only the declared artifact with the returned final
585
- bytes, and then runs the consumer's normal verification. Platform manifests,
586
- KFD evidence, checksums, and Release Passport inputs therefore observe the
587
- final signed artifact rather than the pre-signing build output.
674
+ bytes. The ordinary platform lane completes the consumer's functional
675
+ verification before delegation. A GitHub-hosted finalization lane then verifies
676
+ the authority result against the sealed request, imports the exact signed bytes,
677
+ and recomputes the final manifest before replacing the deterministic artifact.
678
+ The signing result is never downloaded back to a self-hosted native runner.
679
+ Platform manifests, KFD evidence, checksums, and Release Passport inputs
680
+ therefore observe the final signed artifact rather than the pre-signing build
681
+ output.
682
+
683
+ For a standalone Mach-O request, the authority requires strict Developer ID
684
+ verification, the declared Team ID, hardened runtime, and an `Accepted`
685
+ `notarytool` result for the exact submission. Apple creates the notarization
686
+ ticket for that binary and publishes it online, but
687
+ [standalone binaries do not support stapling](https://developer.apple.com/documentation/security/customizing-the-notarization-workflow).
688
+ Buildchain therefore records
689
+ `standalone-notary-ticket-online` and does not misapply app-bundle
690
+ `spctl --assess --type execute` semantics to the raw executable.
691
+
692
+ For a compound archive request, the authority notarizes the complete extracted
693
+ signed product tree and records `compound-notary-ticket-online`. A generic
694
+ archive container cannot carry a stapled ticket and is not itself a Gatekeeper
695
+ execution target; Gatekeeper evaluates the extracted signed code. Archive path
696
+ and symlink validation fail closed before any payload is signed.
697
+
698
+ For a declared `app-bundle`, the same protected authority extracts the sealed
699
+ application, derives and verifies its bundle identity, signs nested native code,
700
+ submits both the application and disk image for notarization, staples and
701
+ Gatekeeper-assesses both deliverables, and returns a ZIP, DMG, evidence document,
702
+ and source-bound manifest. The reusable workflow verifies those returned bytes
703
+ on GitHub-hosted infrastructure, adds them to the normal macOS platform payload,
704
+ and publishes a separate `<artifact>-macos-credential-<source-sha>` projection
705
+ for release pipelines that consume the credential-island evidence contract.
706
+ Consumers declare the `.app` under `[[signing.artifacts]]`; they do not configure
707
+ an environment, certificate, notary credential, or authority workflow.
588
708
 
589
709
  The durable v3 authority runtime is
590
710
  `authority/v3/v3.0/artifact-signing`. It is channel-neutral: alpha and stable
@@ -606,8 +726,17 @@ to GitHub artifacts:
606
726
  ```yaml
607
727
  with:
608
728
  artifact-transfer-mode: github-artifacts
729
+ artifact-compression-level: 0
609
730
  ```
610
731
 
732
+ Direct GitHub Artifact payloads default to compression level `0`. Buildchain
733
+ artifacts are commonly already-compressed archives; storing them without a
734
+ second compression pass shortens the upload window while preserving the same
735
+ artifact name, run/id/digest binding, retention, and no-overwrite behavior.
736
+ Callers may select `1` through `9` for payloads that materially benefit from
737
+ compression. Manifests and diagnostics retain their existing small-artifact
738
+ behavior.
739
+
611
740
  Large self-hosted native builds can opt into the first-class S3 relay path:
612
741
 
613
742
  ```yaml
@@ -643,15 +772,15 @@ The relay configuration is intentionally generic. Buildchain does not hard-code
643
772
  organization buckets, regions, or role ARNs. Callers may pass explicit inputs,
644
773
  or set repository/organization variables and secrets using these names:
645
774
 
646
- | Variable or secret | Meaning |
647
- | --- | --- |
648
- | `BUILDCHAIN_ARTIFACT_RELAY_S3_BUCKET` | Relay bucket name |
649
- | `BUILDCHAIN_ARTIFACT_RELAY_S3_REGION` | Relay bucket region |
650
- | `BUILDCHAIN_ARTIFACT_RELAY_S3_PREFIX` | Relay object prefix; defaults to `buildchain-artifacts` |
651
- | `BUILDCHAIN_ARTIFACT_RELAY_S3_ROLE_ARN` | Shared OIDC role ARN for upload and download |
652
- | `BUILDCHAIN_ARTIFACT_RELAY_S3_UPLOAD_ROLE_ARN` | Upload OIDC role ARN for self-hosted build jobs |
653
- | `BUILDCHAIN_ARTIFACT_RELAY_S3_DOWNLOAD_ROLE_ARN` | Download OIDC role ARN for the GitHub-hosted relay job |
654
- | `BUILDCHAIN_ARTIFACT_RELAY_S3_OIDC_AUDIENCE` | Optional OIDC audience override |
775
+ | Variable or secret | Meaning |
776
+ | ------------------------------------------------ | ------------------------------------------------------- |
777
+ | `BUILDCHAIN_ARTIFACT_RELAY_S3_BUCKET` | Relay bucket name |
778
+ | `BUILDCHAIN_ARTIFACT_RELAY_S3_REGION` | Relay bucket region |
779
+ | `BUILDCHAIN_ARTIFACT_RELAY_S3_PREFIX` | Relay object prefix; defaults to `buildchain-artifacts` |
780
+ | `BUILDCHAIN_ARTIFACT_RELAY_S3_ROLE_ARN` | Shared OIDC role ARN for upload and download |
781
+ | `BUILDCHAIN_ARTIFACT_RELAY_S3_UPLOAD_ROLE_ARN` | Upload OIDC role ARN for self-hosted build jobs |
782
+ | `BUILDCHAIN_ARTIFACT_RELAY_S3_DOWNLOAD_ROLE_ARN` | Download OIDC role ARN for the GitHub-hosted relay job |
783
+ | `BUILDCHAIN_ARTIFACT_RELAY_S3_OIDC_AUDIENCE` | Optional OIDC audience override |
655
784
 
656
785
  For AWS China regions, Buildchain defaults the OIDC audience to
657
786
  `sts.amazonaws.com.cn`; other regions default to `sts.amazonaws.com`. The caller
@@ -842,15 +971,14 @@ promotion starts:
842
971
  `vN`, and `buildchain-stable-contract-lock-path`.
843
972
 
844
973
  The generated router also owns the stable-shell layout transition through
845
- `.buildchain/promotion-shell-routing.json`. Stable `v2.14.13` contains the hidden
846
- advanced workflow, so the stable lane calls that workflow at the exact immutable
847
- SHA behind the released `v2` state and forwards the complete internal promotion
848
- identity surface. The logical shell identity remains `vN`, and the router
849
- retains it in the public audit outputs. The internal advanced-shell call receives
850
- the exact call ref selected by the routing configuration, so its called-workflow
851
- ref check and checkout SHA both bind to the same immutable identity. Updating the
852
- routing pin after a stable release does not require any consumer declaration
853
- change.
974
+ `.buildchain/promotion-shell-routing.json`. The v3 stable and alpha lanes call
975
+ the hidden advanced workflow at the exact immutable SHA behind their selected
976
+ v3 channel state and forward the complete internal promotion identity surface.
977
+ The logical shell identity remains `vN`, and the router retains it in the public
978
+ audit outputs. The internal advanced-shell call receives the exact call ref
979
+ selected by the routing configuration, so its called-workflow ref check and
980
+ checkout SHA both bind to the same immutable identity. Updating a routing pin
981
+ after a release does not require any consumer declaration change.
854
982
 
855
983
  The router resolves immutable SHAs and the selected lock digest before candidate
856
984
  download. The advanced shell verifies the same router, shell, runtime, lock,
@@ -922,7 +1050,7 @@ main`, marks the rest as `role: platform`, and passes the generated
922
1050
  side effect. Downloaded platform manifests are still passed into the release
923
1051
  passport unless `release-passport-platform-manifest-paths` is set explicitly.
924
1052
  The same Buildchain contract lock check runs before release-candidate
925
- resolution and before publish. A compatible `v2` drift leaves an issue in the
1053
+ resolution and before publish. A compatible `v3` drift leaves an issue in the
926
1054
  consumer repository but does not trigger a second heavy build; an incompatible
927
1055
  drift fails before publish side effects.
928
1056
 
@@ -965,7 +1093,7 @@ publish side effect:
965
1093
  with:
966
1094
  sha: ${{ needs.build.outputs.publish-source-sha }}
967
1095
  target-ref: release/v22/v22.22
968
- require-publish-source-lock: 'true'
1096
+ require-publish-source-lock: "true"
969
1097
  publish-source-ref: ${{ needs.build.outputs.publish-source-ref }}
970
1098
  publish-source-sha: ${{ needs.build.outputs.publish-source-sha }}
971
1099
  publish-source-locked: ${{ needs.build.outputs.publish-source-locked }}
@@ -1087,7 +1215,7 @@ Supported placeholders are `{artifact}`, `{artifactName}`, `{platform}`,
1087
1215
  `{platformId}`, `{platformName}`, `{sha}`, `{shortSha}`, `{ref}`, `{runId}`,
1088
1216
  and `{runAttempt}`. Invalid GitHub artifact name characters are normalized to
1089
1217
  `-`, so `{ref}` remains deterministic even for refs such as
1090
- `refs/heads/dev/v2/v2.0`.
1218
+ `refs/heads/dev/v3/v3.0`.
1091
1219
 
1092
1220
  Each platform also writes and uploads:
1093
1221
 
@@ -1,3 +1,21 @@
1
+ ---
2
+ status: active
3
+ period: ongoing
4
+ theme: buildchain-runtime-train-validation
5
+ doc_type: technical-reference
6
+ source_level: local-files
7
+ confidence: high
8
+ sensitivity: public
9
+ evidence_grade: A
10
+ review_state: unreviewed
11
+ last_reviewed: 2026-07-31
12
+ ai_provenance:
13
+ model_family: GPT-5
14
+ product: Codex
15
+ generated_at: 2026-07-31
16
+ invisible_context: not asserted
17
+ ---
18
+
1
19
  # Runtime Train Validation
2
20
 
3
21
  Buildchain consumers should keep stable workflow refs such as `@v3` in
@@ -23,7 +41,7 @@ train/v3/v3.0/<capability>
23
41
 
24
42
  It is a validation pointer, not a release channel:
25
43
 
26
- - it does not move `v2`, `vX.Y`, `vX.Y-alpha`, exact tags, npm dist-tags, or
44
+ - it does not move `v3`, `vX.Y`, `vX.Y-alpha`, exact tags, npm dist-tags, or
27
45
  production refs;
28
46
  - it must not be pinned as a long-term production dependency;
29
47
  - it should point at the Buildchain commit that downstream maintainers are
@@ -140,7 +158,7 @@ summary. The evidence should include:
140
158
 
141
159
  ## Trust and limitation
142
160
 
143
- Official floating channel refs such as `v2` and `v3-alpha` may be selected on
161
+ Official floating channel refs such as `v3` and `v3-alpha` may be selected on
144
162
  pull requests and pushes. Train refs and arbitrary exact-SHA overrides still
145
163
  fail closed unless the event is `workflow_dispatch` and the actor has write,
146
164
  maintain, or admin permission on the caller repository. Pull requests,
@@ -8,7 +8,7 @@ confidence: high
8
8
  sensitivity: public
9
9
  evidence_grade: B
10
10
  review_state: self-reviewed
11
- last_reviewed: 2026-07-13
11
+ last_reviewed: 2026-07-29
12
12
  ai_provenance:
13
13
  model_family: GPT-5
14
14
  product: Codex
@@ -54,6 +54,12 @@ matrix and aggregate. Matrix entries retain the Shifu plan digest, ordered gate
54
54
  groups, required/advisory modes, action ids, definition digests, skips, and
55
55
  unsupported selections.
56
56
 
57
+ Each matrix job timeout reserves the sum of the selected Gate action budgets
58
+ plus 30 minutes for Buildchain-owned checkout, toolchain setup, plan download,
59
+ receipt validation, and artifact upload. The total remains capped at GitHub's
60
+ six-hour job limit. This control-plane allowance does not enlarge any Shifu
61
+ Gate's own declared action budget or change its definition digest.
62
+
57
63
  `github-hosted` declares only the inherent `node` capability. Projects that
58
64
  need a native compiler, product artifacts, devices, or other facilities must
59
65
  use a suitable preset or declare a custom matrix. Capabilities are scheduling
@@ -8,7 +8,7 @@ confidence: high
8
8
  sensitivity: public
9
9
  evidence_grade: A
10
10
  review_state: self-reviewed
11
- last_reviewed: 2026-07-11
11
+ last_reviewed: 2026-07-31
12
12
  ai_provenance:
13
13
  model_family: GPT-5
14
14
  product: Codex
@@ -162,15 +162,15 @@ returned a GraphQL error in the response body.
162
162
 
163
163
  ## Exact-source stable promotion
164
164
 
165
- For a selected `2.12.0-alpha.4`, Patrol creates the immutable source branch:
165
+ For a selected `3.0.2-alpha.4`, Patrol creates the immutable source branch:
166
166
 
167
167
  ```text
168
- publish-gate/release/v2/v2.12/2.12.0-alpha.4
168
+ publish-gate/release/v3/v3.0/3.0.2-alpha.4
169
169
  ```
170
170
 
171
- and opens it against `release/v2/v2.12`. This is an existing strict Buildchain
172
- governance path. The PR freezes the qualified candidate even if `v2.12-alpha`
173
- or `alpha/v2/v2.12` has already moved to alpha.5. Normal Verify,
171
+ and opens it against `release/v3/v3.0`. This is an existing strict Buildchain
172
+ governance path. The PR freezes the qualified candidate even if `v3.0-alpha`
173
+ or `alpha/v3/v3.0` has already moved to alpha.5. Normal Verify,
174
174
  release-candidate resolution, source-tree equivalence, publish transaction,
175
175
  passport, registry, tag, and floating-ref checks still run.
176
176
 
@@ -1,3 +1,21 @@
1
+ ---
2
+ status: draft
3
+ period: ongoing
4
+ theme: buildchain-observability
5
+ doc_type: technical-reference
6
+ source_level: local-files
7
+ confidence: high
8
+ sensitivity: public
9
+ evidence_grade: A
10
+ review_state: unreviewed
11
+ last_reviewed: 2026-07-31
12
+ ai_provenance:
13
+ model_family: GPT-5
14
+ product: Codex
15
+ generated_at: 2026-07-31
16
+ invisible_context: not asserted
17
+ ---
18
+
1
19
  # Toolkit Observability
2
20
 
3
21
  Buildchain ships a small logging toolkit for repository workflows and project
@@ -232,6 +250,10 @@ are recorded as unavailable instead of failing the diagnostics artifact. Call
232
250
  compiler cache data. Native diagnostics also expose `compilerCaches` and
233
251
  `nativeCacheDirs` as top-level fields in each diagnostics artifact and aggregate
234
252
  summary, so reviewers do not have to dig through nested cache sections first.
253
+ For reusable builds, sccache outcomes enter structured current-run evidence only
254
+ when a sibling `compiler-cache-preparation.json` proves the counters were reset
255
+ after install and before build; cumulative stats without that receipt remain
256
+ explicitly unavailable.
235
257
 
236
258
  Process samples are intentionally summarized before they become long-lived
237
259
  artifacts. The summary records requested parallelism, the source of that value