@kungfu-tech/buildchain 3.0.5 → 3.0.6-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 (83) hide show
  1. package/README.md +31 -0
  2. package/actions/macos-credential-island/README.md +8 -0
  3. package/bin/buildchain.mjs +1 -1
  4. package/contracts/auditable-demo-media-profiles-v1.json +61 -0
  5. package/contracts/auditable-demo-scenario-v1.schema.json +164 -0
  6. package/contracts/evidence/auditable-demo-responsive-web-delivery-v1.json +3 -3
  7. package/contracts/evidence/auditable-demo-web-delivery-v1.json +3 -3
  8. package/dist/site/buildchain-contract.json +107 -26
  9. package/dist/site/buildchain-site.json +126 -49
  10. package/dist/site/capability-registry.json +3 -3
  11. package/dist/site/cli-registry.json +9 -3
  12. package/dist/site/controller-registry.json +27 -3
  13. package/dist/site/kfd-claims.json +103 -16
  14. package/dist/site/kfd-upstream-aggregate.json +9 -9
  15. package/dist/site/manual-registry.json +10 -9
  16. package/dist/site/node-api-registry.json +540 -31
  17. package/dist/site/page-registry.json +110 -29
  18. package/dist/site/public-surface-audit.json +186 -12
  19. package/dist/site/publication-authority-registry.json +62 -1
  20. package/dist/site/publication-registry.json +4 -4
  21. package/dist/site/site-manifest.json +13 -13
  22. package/dist/site/workflow-registry.json +120 -5
  23. package/docs/MAP.md +5 -1
  24. package/docs/auditable-demo.md +90 -7
  25. package/docs/aws-us-elastic-runner-burst-plane.md +181 -16
  26. package/docs/cli-reference.md +35 -2
  27. package/docs/dev-alpha-candidate-patrol.md +14 -5
  28. package/docs/dev-qualification-patrol.md +108 -0
  29. package/docs/node-api-reference.md +123 -72
  30. package/docs/publish-transaction.md +7 -5
  31. package/docs/release-flow.md +4 -0
  32. package/docs/release-governance.md +47 -1
  33. package/docs/release-propagation.md +93 -0
  34. package/docs/reusable-build-surface.md +53 -12
  35. package/docs/stable-candidate-patrol.md +5 -2
  36. package/package.json +3 -2
  37. package/packages/core/buildchain-contract.js +36 -1
  38. package/packages/core/buildchain-publication-authority.js +3 -0
  39. package/packages/core/public-surface-audit.js +4 -35
  40. package/packages/core/release-propagation-agent-entry.js +185 -0
  41. package/packages/core/release-propagation-pickup.js +387 -0
  42. package/packages/core/release-propagation-push.js +293 -0
  43. package/packages/core/release-propagation-release.js +61 -18
  44. package/packages/core/release-propagation-stage-evidence.js +36 -0
  45. package/packages/core/release-propagation-work.js +8 -4
  46. package/packages/core/release-propagation.js +27 -2
  47. package/packages/core/workflow-call-contract.js +308 -0
  48. package/packages/core/workflow-yaml-contract.js +272 -0
  49. package/scripts/artifact-signing-controller-core.mjs +525 -0
  50. package/scripts/artifact-signing-controller.mjs +302 -0
  51. package/scripts/artifact-signing-delegation.mjs +51 -3
  52. package/scripts/auditable-demo-platform.mjs +564 -0
  53. package/scripts/auditable-demo-renditions.mjs +7 -2
  54. package/scripts/auditable-demo-transport-smoke.mjs +176 -0
  55. package/scripts/auditable-demo.mjs +27 -21
  56. package/scripts/aws-macos-jit-controller-core.mjs +389 -0
  57. package/scripts/aws-macos-jit-controller-runtime.mjs +82 -0
  58. package/scripts/aws-macos-jit-controller.mjs +558 -0
  59. package/scripts/aws-macos-jit-job-controller.mjs +401 -0
  60. package/scripts/aws-windows-jit-campaign-core.mjs +295 -0
  61. package/scripts/aws-windows-jit-campaign.mjs +202 -0
  62. package/scripts/aws-windows-jit-controller-core.mjs +20 -2
  63. package/scripts/aws-windows-jit-controller.mjs +185 -109
  64. package/scripts/aws-windows-jit-core.mjs +21 -3
  65. package/scripts/aws-windows-jit.mjs +2 -0
  66. package/scripts/build-standalone-binary.mjs +6 -0
  67. package/scripts/buildchain-cli-help.mjs +2 -1
  68. package/scripts/capture-package-release-propagation.mjs +24 -1
  69. package/scripts/check-inventory.mjs +6 -0
  70. package/scripts/compiler-cache-evidence.mjs +90 -7
  71. package/scripts/dev-alpha-candidate-patrol.mjs +80 -5
  72. package/scripts/dev-pr-auto-merge.mjs +15 -15
  73. package/scripts/dev-qualification-patrol.mjs +594 -0
  74. package/scripts/dispatch-artifact-signing-authority.mjs +310 -61
  75. package/scripts/finalize-native-artifact-signing-result.mjs +37 -15
  76. package/scripts/generate-site-bundle.mjs +5 -0
  77. package/scripts/inspect-artifact-signing-requests.mjs +12 -0
  78. package/scripts/locked-source-checkout.mjs +17 -3
  79. package/scripts/release-propagation.mjs +150 -2
  80. package/scripts/run-lifecycle-core.mjs +25 -0
  81. package/scripts/site-capability-metadata.mjs +1 -1
  82. package/scripts/stable-candidate-patrol.mjs +30 -4
  83. package/scripts/workflow-call-contract.mjs +133 -0
@@ -1668,6 +1668,28 @@ buildchain release-governance reconcile --repository <owner/repo> --branch <dev|
1668
1668
  buildchain release-propagation
1669
1669
  ```
1670
1670
 
1671
+ ### `buildchain release-propagation entry`
1672
+
1673
+ - Help: `buildchain release-propagation entry --help`
1674
+ - Canonical id: `release-propagation`
1675
+ - Options: none declared
1676
+ - Syntax:
1677
+
1678
+ ```text
1679
+ buildchain release-propagation <plan|write-lock|work|entry|pickup> ...
1680
+ ```
1681
+
1682
+ ### `buildchain release-propagation pickup`
1683
+
1684
+ - Help: `buildchain release-propagation pickup --help`
1685
+ - Canonical id: `release-propagation`
1686
+ - Options: none declared
1687
+ - Syntax:
1688
+
1689
+ ```text
1690
+ buildchain release-propagation <plan|write-lock|work|entry|pickup> ...
1691
+ ```
1692
+
1671
1693
  ### `buildchain release-propagation plan`
1672
1694
 
1673
1695
  - Help: `buildchain release-propagation plan --help`
@@ -1676,7 +1698,18 @@ buildchain release-propagation
1676
1698
  - Syntax:
1677
1699
 
1678
1700
  ```text
1679
- buildchain release-propagation <plan|write-lock> ...
1701
+ buildchain release-propagation <plan|write-lock|work|entry|pickup> ...
1702
+ ```
1703
+
1704
+ ### `buildchain release-propagation work`
1705
+
1706
+ - Help: `buildchain release-propagation work --help`
1707
+ - Canonical id: `release-propagation`
1708
+ - Options: none declared
1709
+ - Syntax:
1710
+
1711
+ ```text
1712
+ buildchain release-propagation <plan|write-lock|work|entry|pickup> ...
1680
1713
  ```
1681
1714
 
1682
1715
  ### `buildchain release-propagation write-lock`
@@ -1687,7 +1720,7 @@ buildchain release-propagation <plan|write-lock> ...
1687
1720
  - Syntax:
1688
1721
 
1689
1722
  ```text
1690
- buildchain release-propagation <plan|write-lock> ...
1723
+ buildchain release-propagation <plan|write-lock|work|entry|pickup> ...
1691
1724
  ```
1692
1725
 
1693
1726
  ## `sample`
@@ -8,12 +8,12 @@ confidence: high
8
8
  sensitivity: public
9
9
  evidence_grade: A
10
10
  review_state: self-reviewed
11
- last_reviewed: 2026-07-29
11
+ last_reviewed: 2026-08-03
12
12
  ai_provenance:
13
13
  model_family: GPT-5
14
14
  product: Codex
15
15
  generated_at: 2026-07-29
16
- visible_context: Existing Buildchain source locks, Kungfu exact-source Alpha preflight, Dev Patrol, repository release governance, and the consumer-owned settlement renderer threat model.
16
+ visible_context: Existing Buildchain source locks, Kungfu exact-source Alpha preflight, Dev Patrol, protected auto-merge policy, repository release governance, and the consumer-owned settlement renderer threat model.
17
17
  invisible_context_boundary: No credentials, private logs, or private configuration were used.
18
18
  ---
19
19
 
@@ -114,12 +114,21 @@ service. Once the active PR settles or is abandoned, the next execution
114
114
  recomputes current exact-SHA qualification and creates only the newest still
115
115
  fresh candidate. It never trusts a `workflow_run` trigger SHA as evidence.
116
116
 
117
+ The caller may additionally set `auto-merge: true` and choose `merge-method`
118
+ from `merge`, `squash`, or `rebase`. Buildchain only arms GitHub auto-merge for
119
+ the single managed, open, exact-source candidate after the write-permission
120
+ settlement has revalidated the observation. GitHub still owns every required
121
+ review, required check, branch-protection, and merge-queue gate; Buildchain does
122
+ not approve or directly merge the PR. Invalid merge methods and GraphQL
123
+ refusals fail the patrol run.
124
+
117
125
  Consumers should invoke this workflow after relevant qualification workflow
118
126
  completion and from an offset periodic fallback. GitHub may delay scheduled
119
127
  runs, so the event path supplies low latency while the fallback supplies
120
128
  recovery. Workflow concurrency plus the server-side open-PR reconciliation
121
129
  makes duplicate or delayed events idempotent.
122
130
 
123
- The workflow never moves the Alpha ref directly, merges or auto-merges the pull
124
- request, publishes npm, creates a Git tag or GitHub Release, or changes branch
125
- protection. Those remain repository-owned protected settlement actions.
131
+ The workflow never moves the Alpha ref directly, directly merges the pull
132
+ request, approves it, publishes npm, creates a Git tag or GitHub Release, or
133
+ changes branch protection. Optional auto-merge only registers repository-owned
134
+ intent with GitHub; protected settlement remains authoritative.
@@ -0,0 +1,108 @@
1
+ ---
2
+ status: preview
3
+ period: ongoing
4
+ theme: dev-qualification-patrol
5
+ doc_type: architecture-and-usage
6
+ source_level: local-files
7
+ confidence: high
8
+ sensitivity: public
9
+ evidence_grade: A
10
+ review_state: self-reviewed
11
+ last_reviewed: 2026-08-03
12
+ ai_provenance:
13
+ model_family: GPT-5
14
+ product: Codex
15
+ generated_at: 2026-08-03
16
+ visible_context: Existing Buildchain Shifu Gate receipts, Kungfu Dev Patrol, Alpha preflight, candidate patrol, and GitHub failed-job rerun semantics.
17
+ invisible_context_boundary: No credentials, private logs, or private configuration were used.
18
+ ---
19
+
20
+ # Dev Qualification Patrol
21
+
22
+ Buildchain provides a reusable controller for repositories whose development
23
+ branch advances faster than a heavy cross-platform qualification workflow can
24
+ settle. The controller keeps no external queue. On every wakeup it derives the
25
+ only pending item from the current source-branch head and maintains these
26
+ states:
27
+
28
+ - `qualified`: the current source SHA already has a successful Dev run;
29
+ - `running`: one Dev run is active, with a different current SHA retained as
30
+ the implicit latest pending item;
31
+ - `waiting-preflight`: the current SHA has not passed its lightweight exact-SHA
32
+ preflight;
33
+ - `waiting-priority`: a declared Alpha or release workflow is queued or active;
34
+ - `dispatch-ready`: the latest SHA is preflight-qualified and no Dev or
35
+ priority run is active;
36
+ - `retry-ready`: the latest exact-SHA Dev run failed only at a classified
37
+ external boundary and remains inside the attempt limit; or
38
+ - `blocked`: the failure was deterministic, unknown, or exhausted its bounded
39
+ retry policy.
40
+
41
+ This is an event-driven, coalescing controller rather than a FIFO build queue.
42
+ If ten commits arrive during one slow Dev run, the next reconciliation observes
43
+ only the newest branch head. Intermediate unqualified SHAs are superseded
44
+ without consuming the shared native runners.
45
+
46
+ ## Exact-source and priority contract
47
+
48
+ Call `.github/workflows/dev-qualification-patrol.yml` from a thin consumer
49
+ workflow after the lightweight preflight, Dev Patrol, and declared priority
50
+ workflows complete. Add an offset schedule as recovery for delayed or missed
51
+ GitHub events. Repeated wakeups are idempotent.
52
+
53
+ The controller requires a successful preflight whose `head_sha` equals the
54
+ current source head. It dispatches the heavy workflow on the source branch and
55
+ adds a controller-owned `source-sha` input. The consumer must reject the run
56
+ before qualification if that input differs from the workflow event SHA. This
57
+ closes the race where the branch advances between observation and workflow
58
+ startup. The heavy reusable Gate workflow then receives the exact SHA as its
59
+ `source-ref`, so every platform receipt remains source-bound.
60
+
61
+ `priority-workflows-json` is a JSON array of workflow paths. Any queued,
62
+ waiting, pending, requested, or in-progress run in those workflows prevents a
63
+ new Dev dispatch or automatic retry. This lets Alpha and release work keep
64
+ priority on shared self-hosted runners. A successful current Dev result remains
65
+ qualified even when priority work is active; priority only governs new heavy
66
+ work.
67
+
68
+ ## Bounded local retry
69
+
70
+ The controller uses GitHub's failed-jobs rerun endpoint, not a fresh workflow
71
+ dispatch, for classified transient failures. Successful matrix jobs and their
72
+ exact-source receipts remain in the same workflow-run transaction. Failed jobs
73
+ and dependent aggregation run again. The Shifu Gate profile uploads platform,
74
+ diagnostic, aggregate, and controller artifacts with overwrite enabled so a
75
+ later attempt can replace only the same-run artifact names.
76
+
77
+ Automatic retry is deliberately narrow:
78
+
79
+ - whole-run `cancelled`, `timed_out`, or `startup_failure` conclusions qualify;
80
+ - checkout, setup, toolchain, download, upload, environment exposure, and
81
+ runner-workspace reset steps qualify;
82
+ - Gate execution, Gate enforcement, aggregation, and controller-receipt
83
+ failures never qualify; and
84
+ - an unknown failing step fails closed.
85
+
86
+ `max-attempts` counts the original attempt. The default `2` therefore permits
87
+ at most one automatic failed-jobs rerun. This policy reduces retry friction for
88
+ network, runner, and provider failures without laundering a product or Gate
89
+ failure into an infrastructure retry.
90
+
91
+ ## Permission and mutation boundary
92
+
93
+ The reusable workflow always performs `observe` with Actions and contents read
94
+ permissions. The separate `mutate` job runs only when the observation proposes
95
+ `dispatch` or `rerun-failed-jobs`, `mutation-authorized` is true, and `dry-run`
96
+ is false. Before writing, it re-resolves the branch and all workflow state and
97
+ requires the action and source SHA to match the read-only observation. A race
98
+ fails closed and the next event recomputes from current truth.
99
+
100
+ Start a consumer in dry-run mode. Its observation and mutation decisions are
101
+ retained as exact-source artifacts with a canonical decision root. Enabling
102
+ mutation requires a repository token that can write Actions; no contents,
103
+ pull-request, tag, release, package, or publication permission is used.
104
+
105
+ The controller does not merge a PR, publish an Alpha, create a tag, create a
106
+ release, or settle a Release Passport. Once Dev and Alpha preflight evidence
107
+ both succeed for one SHA, the separate
108
+ [Dev to Alpha Candidate Patrol](dev-alpha-candidate-patrol.md) may select it.