@kungfu-tech/buildchain 4.0.8 → 4.0.9-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 (57) hide show
  1. package/AGENTS.md +12 -19
  2. package/CONTRIBUTING.md +6 -9
  3. package/README.md +11 -1
  4. package/architecture/agent-change-map.md +11 -4
  5. package/architecture/build-environments.json +71 -0
  6. package/architecture/build-orchestration.json +18 -0
  7. package/architecture/ci-lane-change-budget.json +51 -2
  8. package/architecture/internal-capabilities.json +17 -4
  9. package/architecture/maintainability-debt.json +37 -126
  10. package/architecture/maintainability-policy.json +19 -210
  11. package/architecture/release-topology.json +9 -7
  12. package/architecture/universal-workflow-bootstrap.json +5 -4
  13. package/architecture/universal-workflow-train-admission.json +2 -2
  14. package/architecture/workflow-taxonomy.json +13 -0
  15. package/bin/buildchain.mjs +1 -1
  16. package/contracts/fixtures/v4-tail-reseal-v1/valid.json +1 -1
  17. package/dist/site/buildchain-contract.json +41 -1131
  18. package/dist/site/buildchain-site.json +48 -153
  19. package/dist/site/capability-registry.json +2 -2
  20. package/dist/site/cli-registry.json +1 -1
  21. package/dist/site/controller-registry.json +30 -868
  22. package/dist/site/kfd-claims.json +148 -396
  23. package/dist/site/kfd-upstream-aggregate.json +1 -1
  24. package/dist/site/manual-registry.json +7 -7
  25. package/dist/site/node-api-registry.json +37 -37
  26. package/dist/site/page-registry.json +36 -141
  27. package/dist/site/public-surface-audit.json +93 -402
  28. package/dist/site/publication-authority-registry.json +22 -1
  29. package/dist/site/publication-registry.json +4 -4
  30. package/dist/site/site-manifest.json +11 -11
  31. package/dist/site/workflow-registry.json +165 -391
  32. package/docs/MAP.md +5 -4
  33. package/docs/cli-reference.md +1 -1
  34. package/docs/getting-started.md +8 -7
  35. package/docs/node-api-reference.md +85 -85
  36. package/docs/release-governance.md +19 -18
  37. package/docs/reusable-build-surface.md +160 -1430
  38. package/docs/runtime-train-validation.md +45 -172
  39. package/docs/workflow-catalog.md +1 -0
  40. package/package.json +1 -1
  41. package/packages/core/build-configuration.js +117 -0
  42. package/packages/core/buildchain-config.js +2 -0
  43. package/packages/core/buildchain-contract.js +14 -44
  44. package/packages/core/buildchain-publication-authority.js +1 -0
  45. package/packages/core/controller-evidence.js +2 -9
  46. package/scripts/buildchain-cli-help.mjs +1 -1
  47. package/scripts/check-floating-consumer-policy-contract.mjs +4 -7
  48. package/scripts/check-inventory.mjs +91 -77
  49. package/scripts/check-maintainability.mjs +23 -8
  50. package/scripts/check-universal-workflow-bootstrap.mjs +12 -2
  51. package/scripts/generate-channel-build-workflow.mjs +50 -410
  52. package/scripts/generate-site-bundle.mjs +2 -1
  53. package/scripts/generate-universal-workflow-facades.mjs +1 -0
  54. package/scripts/init-repo.mjs +25 -26
  55. package/scripts/resolve-build-configuration.mjs +105 -0
  56. package/scripts/universal-workflow-self-dogfood.mjs +8 -1
  57. package/scripts/verify-golden-path.mjs +3 -3
package/AGENTS.md CHANGED
@@ -19,26 +19,19 @@ restating them.
19
19
 
20
20
  ## Using this repo as a Buildchain consumer
21
21
 
22
- Consumers that want Buildchain to select alpha for development/prerelease work
23
- and stable for production releases use the channel router. The router defaults
24
- to `auto`; repositories only add channel configuration when they intentionally
25
- override that policy:
22
+ Ordinary builds read project configuration from `buildchain.toml`. Single-project
23
+ consumers call the public workflow with no inputs:
26
24
 
27
25
  ```yaml
28
- uses: kungfu-systems/buildchain/.github/workflows/build.yml@v3
26
+ uses: kungfu-systems/buildchain/.github/workflows/build.yml@v4
29
27
  ```
30
28
 
31
- During v3 prerelease evaluation windows, canaries call the same router through
32
- the matching prerelease ref:
33
-
34
- ```yaml
35
- uses: kungfu-systems/buildchain/.github/workflows/build.yml@v3-alpha
36
- ```
37
-
38
- The default policy selects `vN-alpha` for pull requests, development, nightly,
39
- and prerelease intent; it selects stable `vN` for stable release intent. The
40
- advanced `.build.yml` surface and explicit `buildchain-ref` train/SHA validation
41
- remain available when a repository needs precise control.
29
+ Use `@v4-alpha` for the alpha runtime. The called workflow ref and SHA determine
30
+ runtime identity and the matching contract lock. A nested project may supply
31
+ only `config-path`; all project settings belong in TOML and infrastructure
32
+ settings belong to a governed Buildchain environment profile. `.build.yml`
33
+ remains the core install/build/verify backbone. Historical build inputs and
34
+ runtime overrides are removed.
42
35
 
43
36
  For new repositories, prefer the CLI:
44
37
 
@@ -65,9 +58,9 @@ See [`docs/cli.md`](docs/cli.md), [`docs/lifecycle-protocol.md`](docs/lifecycle-
65
58
  and [`docs/reusable-build-surface.md`](docs/reusable-build-surface.md) for the
66
59
  consumer contract.
67
60
 
68
- For temporary validation of an unreleased Buildchain runtime, keep the committed
69
- workflow ref on `@v3` and use the trusted `workflow_dispatch` `buildchain-ref`
70
- pass-through. See [`docs/runtime-train-validation.md`](docs/runtime-train-validation.md).
61
+ Ordinary builds do not accept runtime overrides. Specialized release/recovery
62
+ contracts retain their bounded, non-persistent validation mechanisms; see
63
+ [`docs/runtime-train-validation.md`](docs/runtime-train-validation.md).
71
64
 
72
65
  ## Building this repo
73
66
 
package/CONTRIBUTING.md CHANGED
@@ -161,15 +161,12 @@ release/vX/vX.Y -> publish-gate/major
161
161
  wrapper to merge ready, conflict-free dev PRs. The wrapper is policy-gated:
162
162
  required checks, ready/block labels, same-repository heads, approvals,
163
163
  branch prefixes, max merges, and dry-run are all declared inputs.
164
- - When a Buildchain change needs downstream validation before stable refs move,
165
- publish a temporary runtime train ref such as
166
- `train/v3/v3.0/<capability>` and ask consumers to run trusted
167
- `workflow_dispatch` with `buildchain-ref` set to that train. Keep the pull
168
- request against the `dev/*` branch; the train is only a validation pointer,
169
- not a pending merge target. After validation succeeds, merge into the active
170
- `dev/*` mainline and run the requested alpha or release promotion. The train
171
- may remain for a retention window as a fast-use and rollback channel; old
172
- trains are cleaned by a separate periodic cleanup task.
164
+ - Ordinary build callers use `build.yml@v4` or `build.yml@v4-alpha` with
165
+ project settings in `buildchain.toml`. They have no runtime override input.
166
+ Validate the implementation and exact contract before merging into protected
167
+ Dev, publish Alpha, then qualify the public Alpha build before Stable.
168
+ Specialized release/recovery train admission follows its own bounded
169
+ contract in `docs/runtime-train-validation.md`.
173
170
  - Merging into `alpha/*`, `release/*`, or `publish-gate/major` expresses a
174
171
  release intent. Buildchain promotion then creates version-state commits,
175
172
  exact tags, floating tags, npm publish evidence, and next-alpha state.
package/README.md CHANGED
@@ -283,7 +283,7 @@ plus fail-closed product-evidence gates for KFD-4, KFD-5, and KFD-7. These
283
283
  gates preserve product-owned qualification and support decisions; they do not
284
284
  turn a schema-valid record into certification or shipped support.
285
285
 
286
- Buildchain's action registry currently contains seven active entries. Five are
286
+ Buildchain's action registry contains fourteen active entries. Six are
287
287
  direct consumer integration actions:
288
288
 
289
289
  - `actions/validate-config`
@@ -298,6 +298,16 @@ Two additional release-authority components are also registered and versioned:
298
298
  - `actions/github-artifact-attestation`
299
299
  - `actions/macos-credential-island`
300
300
 
301
+ Six shared build components have explicit ownership in
302
+ `architecture/build-orchestration.json`:
303
+
304
+ - [`actions/build-lifecycle-stage`](actions/build-lifecycle-stage/action.yml)
305
+ - [`actions/build-signing-request`](actions/build-signing-request/action.yml)
306
+ - [`actions/build-verification-evidence`](actions/build-verification-evidence/action.yml)
307
+ - [`actions/build-attestation-policy`](actions/build-attestation-policy/action.yml)
308
+ - [`actions/build-agent-hub-evidence`](actions/build-agent-hub-evidence/action.yml)
309
+ - [`actions/build-artifact-transfer`](actions/build-artifact-transfer/action.yml)
310
+
301
311
  `dist/site/workflow-registry.json#actions` is the machine-readable inventory;
302
312
  this split keeps the older four-action consumer snapshot from being mistaken for
303
313
  the complete current registry.
@@ -129,9 +129,6 @@ Safe change route: Reduce one owned responsibility behind the stable facade, run
129
129
  - tests: `tests/floating-consumer-policy.test.mjs`
130
130
  - tests: `tests/publication-rehearsal.test.mjs`
131
131
  - tests: `tests/web-surface.test.mjs`
132
- - tests: `tests/build-surface-reusable-build.test.mjs`
133
- - tests: `tests/build-surface-reusable-build-signing.test.mjs`
134
- - tests: `tests/build-surface-reusable-build-artifacts.test.mjs`
135
132
  - tests: `tests/promote-buildchain-ref-durable-recovery.test.mjs`
136
133
  - tests: `tests/promote-buildchain-ref-major-promotion.test.mjs`
137
134
  - tests: `tests/promote-buildchain-ref-recovery-alpha-finalization.test.mjs`
@@ -142,7 +139,6 @@ Safe change route: Reduce one owned responsibility behind the stable facade, run
142
139
  - workflows: `.github/workflows/.release-candidate-promote.yml`
143
140
  - workflows: `.github/workflows/.release-verify.yml`
144
141
  - workflows: `.github/workflows/.web-surface.yml`
145
- - workflows: `.github/workflows/build.yml`
146
142
  - workflows: `.github/workflows/check.yml`
147
143
  - workflows: `.github/workflows/dev-pr-auto-merge.yml`
148
144
  - workflows: `.github/workflows/paper-release-sealed.yml`
@@ -607,11 +603,21 @@ Owner: Buildchain workflow maintainers
607
603
  - `scripts/resolve-artifact-transfer-mode.mjs`
608
604
  - `scripts/resolve-build-summary-names.sh`
609
605
  - `scripts/run-lifecycle-core.mjs`
606
+ - `packages/core/build-configuration.js`
607
+ - `scripts/resolve-build-configuration.mjs`
610
608
 
611
609
  ### Contracts
612
610
 
613
611
  - `.github/workflows/.build.yml`
614
612
  - `.github/workflows/build.yml`
613
+ - `architecture/build-environments.json`
614
+ - `actions/build-lifecycle-stage/action.yml`
615
+ - `actions/build-signing-request/action.yml`
616
+ - `actions/build-verification-evidence/action.yml`
617
+ - `actions/build-attestation-policy/action.yml`
618
+ - `actions/build-agent-hub-evidence/action.yml`
619
+ - `actions/build-artifact-transfer/action.yml`
620
+ - `architecture/build-orchestration.json`
615
621
 
616
622
  ### Tests
617
623
 
@@ -621,6 +627,7 @@ Owner: Buildchain workflow maintainers
621
627
  - `tests/build-surface.test.mjs`
622
628
  - `tests/build-surface-promotion.test.mjs`
623
629
  - `tests/controller-evidence.test.mjs`
630
+ - `tests/build-configuration.test.mjs`
624
631
 
625
632
  ### Generated outputs
626
633
 
@@ -0,0 +1,71 @@
1
+ {
2
+ "schema": "buildchain.build-environments/v1",
3
+ "owner": "Buildchain infrastructure maintainers",
4
+ "defaults": {
5
+ "runners": {
6
+ "preset": "github-hosted",
7
+ "platforms_json": "",
8
+ "control_json": "[\"ubuntu-24.04\"]",
9
+ "codebuild_project": "",
10
+ "windows_label": "",
11
+ "macos_label": "",
12
+ "offline_fallback": false,
13
+ "container_preset": "",
14
+ "container_image": ""
15
+ },
16
+ "tools": {
17
+ "rustup_dist_server": "",
18
+ "rustup_update_root": "",
19
+ "cargo_registry_index": "",
20
+ "kfd_agent_hub": "off"
21
+ },
22
+ "signing": {
23
+ "upload_no_proxy": "",
24
+ "environment": ""
25
+ },
26
+ "transfer": {
27
+ "mode": "github-artifacts",
28
+ "bucket": "",
29
+ "region": "",
30
+ "prefix": "",
31
+ "upload_role_arn": "",
32
+ "download_role_arn": "",
33
+ "oidc_audience": ""
34
+ },
35
+ "checkout": {
36
+ "mode": "off",
37
+ "mirror_url_template": "",
38
+ "reference_repository_template": "",
39
+ "fallback": "github",
40
+ "timeout_seconds": 60.0,
41
+ "github_timeout_seconds": 600.0,
42
+ "fetch_attempts": 3.0,
43
+ "history_mode": "shallow"
44
+ },
45
+ "cache": {
46
+ "profile_ref": "",
47
+ "profile_digest": "",
48
+ "provider": "none",
49
+ "platforms_json": "[]",
50
+ "required": false
51
+ }
52
+ },
53
+ "profiles": {
54
+ "github-hosted": {},
55
+ "github-hosted-container": {
56
+ "runners": {
57
+ "container_preset": "kungfu-verify"
58
+ }
59
+ },
60
+ "kungfu-v4-native": {
61
+ "runners": {
62
+ "preset": "kungfu-v4-native"
63
+ }
64
+ },
65
+ "kungfu-v4-self-hosted": {
66
+ "runners": {
67
+ "preset": "kungfu-v4-self-hosted"
68
+ }
69
+ }
70
+ }
71
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "schema": "buildchain.build-orchestration/v1",
3
+ "configurationAuthority": "buildchain.toml",
4
+ "ordinaryInputs": ["config-path"],
5
+ "backbone": ".github/workflows/.build.yml",
6
+ "facade": ".github/workflows/build.yml",
7
+ "maximumBackboneLines": 2300,
8
+ "maximumFacadeLines": 200,
9
+ "lifecycleOrder": ["install", "build", "verify"],
10
+ "owners": {
11
+ "actions/build-lifecycle-stage/action.yml": "Buildchain workflow maintainers",
12
+ "actions/build-signing-request/action.yml": "Buildchain signing maintainers",
13
+ "actions/build-verification-evidence/action.yml": "Buildchain verification maintainers",
14
+ "actions/build-attestation-policy/action.yml": "Buildchain signing maintainers",
15
+ "actions/build-agent-hub-evidence/action.yml": "Buildchain verification maintainers",
16
+ "actions/build-artifact-transfer/action.yml": "Buildchain artifact transport maintainers"
17
+ }
18
+ }
@@ -625,6 +625,57 @@
625
625
  "expectedContributionSeconds": 0,
626
626
  "rationale": "Runs only after completed exact-source public installation qualification; no merge-critical runner lane is added."
627
627
  }
628
+ },
629
+ {
630
+ "laneId": ".github/workflows/.build.yml#configure",
631
+ "authorityClass": "evidence",
632
+ "triggerClass": "reusable",
633
+ "concurrencyPolicy": {
634
+ "mode": "none",
635
+ "cancelInProgress": false
636
+ },
637
+ "expectedRunnerMinutes": 5,
638
+ "cancellationBehavior": "finish-started",
639
+ "sloImpact": {
640
+ "mergeCritical": false,
641
+ "metric": "configured build planning and execution latency",
642
+ "expectedContributionSeconds": 20,
643
+ "rationale": "Resolve exact source TOML and runtime-owned environment before admission or matrix scheduling."
644
+ }
645
+ },
646
+ {
647
+ "laneId": ".github/workflows/build.yml#build",
648
+ "authorityClass": "governed-delegation",
649
+ "triggerClass": "reusable",
650
+ "concurrencyPolicy": {
651
+ "mode": "none",
652
+ "cancelInProgress": false
653
+ },
654
+ "expectedRunnerMinutes": 120,
655
+ "cancellationBehavior": "finish-started",
656
+ "sloImpact": {
657
+ "mergeCritical": false,
658
+ "metric": "configured build planning and execution latency",
659
+ "expectedContributionSeconds": 0,
660
+ "rationale": "The public facade delegates once to the backbone; no additional build or controller runs."
661
+ }
662
+ },
663
+ {
664
+ "laneId": ".github/workflows/self-build-stable-dogfood.yml#stable-consumer",
665
+ "authorityClass": "governed-delegation",
666
+ "triggerClass": "mixed",
667
+ "concurrencyPolicy": {
668
+ "mode": "ref-scoped",
669
+ "cancelInProgress": false
670
+ },
671
+ "expectedRunnerMinutes": 20,
672
+ "cancellationBehavior": "finish-started",
673
+ "sloImpact": {
674
+ "mergeCritical": false,
675
+ "metric": "Published stable TOML build qualification latency",
676
+ "expectedContributionSeconds": 0,
677
+ "rationale": "Independent thin public stable fixture caller permits producer-first channel upgrades without duplicating build orchestration."
678
+ }
628
679
  }
629
680
  ],
630
681
  "declarationFamilies": [
@@ -646,7 +697,6 @@
646
697
  "laneIds": [
647
698
  ".github/workflows/.auditable-demo.yml#universal-bootstrap",
648
699
  ".github/workflows/.binary-release-assets.yml#universal-bootstrap",
649
- ".github/workflows/.build.yml#universal-bootstrap",
650
700
  ".github/workflows/.bump-minor-version.yml#universal-bootstrap",
651
701
  ".github/workflows/.declarative-auditable-demo.yml#universal-bootstrap",
652
702
  ".github/workflows/.gate-profile.yml#universal-bootstrap",
@@ -658,7 +708,6 @@
658
708
  ".github/workflows/.sync-remote-git.yml#universal-bootstrap",
659
709
  ".github/workflows/.web-surface.yml#universal-bootstrap",
660
710
  ".github/workflows/.wheel-verify.yml#universal-bootstrap",
661
- ".github/workflows/build.yml#universal-bootstrap",
662
711
  ".github/workflows/buildchain-patrol.yml#universal-bootstrap",
663
712
  ".github/workflows/check.yml#universal-bootstrap",
664
713
  ".github/workflows/dev-alpha-candidate-patrol.yml#universal-bootstrap",
@@ -150,7 +150,9 @@
150
150
  "scripts/maintainability-metrics.mjs",
151
151
  "scripts/generate-agent-change-map.mjs",
152
152
  "scripts/maintainability-domain-metrics.mjs",
153
- "scripts/maintainability-governance.mjs"
153
+ "scripts/maintainability-governance.mjs",
154
+ "packages/core/build-configuration.js",
155
+ "scripts/resolve-build-configuration.mjs"
154
156
  ],
155
157
  "ownershipRules": [
156
158
  {
@@ -383,7 +385,9 @@
383
385
  "scripts/generate-channel-build-workflow.mjs",
384
386
  "scripts/resolve-artifact-transfer-mode.mjs",
385
387
  "scripts/resolve-build-summary-names.sh",
386
- "scripts/run-lifecycle-core.mjs"
388
+ "scripts/run-lifecycle-core.mjs",
389
+ "packages/core/build-configuration.js",
390
+ "scripts/resolve-build-configuration.mjs"
387
391
  ],
388
392
  "tests": [
389
393
  "tests/artifact-transfer-mode.test.mjs",
@@ -391,11 +395,20 @@
391
395
  "tests/build-surface-reusable-build-artifacts.test.mjs",
392
396
  "tests/build-surface.test.mjs",
393
397
  "tests/build-surface-promotion.test.mjs",
394
- "tests/controller-evidence.test.mjs"
398
+ "tests/controller-evidence.test.mjs",
399
+ "tests/build-configuration.test.mjs"
395
400
  ],
396
401
  "contracts": [
397
402
  ".github/workflows/.build.yml",
398
- ".github/workflows/build.yml"
403
+ ".github/workflows/build.yml",
404
+ "architecture/build-environments.json",
405
+ "actions/build-lifecycle-stage/action.yml",
406
+ "actions/build-signing-request/action.yml",
407
+ "actions/build-verification-evidence/action.yml",
408
+ "actions/build-attestation-policy/action.yml",
409
+ "actions/build-agent-hub-evidence/action.yml",
410
+ "actions/build-artifact-transfer/action.yml",
411
+ "architecture/build-orchestration.json"
399
412
  ],
400
413
  "generatedOutputs": [
401
414
  ".github/workflows/build.yml",