@kungfu-tech/buildchain 2.11.14-alpha.6 → 2.11.14-alpha.7

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.
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "contract": "kungfu-buildchain-site-manifest",
4
- "generatedAt": "2026-07-10T16:41:11.001Z",
5
- "publishedAt": "2026-07-10T16:41:11.001Z",
4
+ "generatedAt": "2026-07-11T00:08:19.877Z",
5
+ "publishedAt": "2026-07-11T00:08:19.877Z",
6
6
  "reproducible": true,
7
7
  "timestampPolicy": "ci-injected",
8
8
  "deterministicInputs": [
@@ -19,7 +19,7 @@
19
19
  "declared Buildchain surface manifest contract"
20
20
  ],
21
21
  "sourceDateEpoch": "0",
22
- "sourceRevision": "4bbf92ba595952dbd22f8656829928991e84f448",
22
+ "sourceRevision": "7d3f049ffc8b567c3afad9fa9f8e974b50fd3b90",
23
23
  "timestampPolicyDetails": {
24
24
  "contract": "kungfu-buildchain-surface-timestamp-policy",
25
25
  "timestampFields": [
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "package": {
39
39
  "name": "@kungfu-tech/buildchain",
40
- "version": "2.11.14-alpha.6",
40
+ "version": "2.11.14-alpha.7",
41
41
  "versionSource": "package.json#version"
42
42
  },
43
43
  "entrypoint": "buildchain-site.json",
@@ -53,7 +53,7 @@
53
53
  "path": "docs/MAP.md",
54
54
  "plane": "use",
55
55
  "exists": true,
56
- "digest": "sha256:53b605e57a5ac2b8d4ed911a4fbb4d1a39352db143db183aa551f9226f2d7a6a"
56
+ "digest": "sha256:02987c6bf99441eddc630fa4050fd109c15923047a4591e26d54a714c124539a"
57
57
  },
58
58
  {
59
59
  "id": "install",
@@ -205,7 +205,7 @@
205
205
  "path": "docs/reusable-build-surface.md",
206
206
  "plane": "use",
207
207
  "exists": true,
208
- "digest": "sha256:b9335434f95e6173f31d50983f8ab492378b065fa203a3b68bee447487883cea"
208
+ "digest": "sha256:4611e4ae47091687f50b489ccc6caba911f13bb1f73b27a5d44581d8a6450d06"
209
209
  },
210
210
  {
211
211
  "id": "publish-transaction",
@@ -221,7 +221,7 @@
221
221
  "path": "docs/release-governance.md",
222
222
  "plane": "why",
223
223
  "exists": true,
224
- "digest": "sha256:8a70f9f2699bcec6102164d6ae67f13549f3ef962d12441fbb80f9d49a1cc2e1"
224
+ "digest": "sha256:69c4146640626bc03b93ac178e250745e45939ba9443f3ba27207a35522036c4"
225
225
  },
226
226
  {
227
227
  "id": "release-flow",
@@ -237,7 +237,7 @@
237
237
  "path": "docs/runtime-train-validation.md",
238
238
  "plane": "verify",
239
239
  "exists": true,
240
- "digest": "sha256:bb053594407bd0f78aa43352a249a2ffa19825374147cc712cd56ca6ad50dfa3"
240
+ "digest": "sha256:1872e511b31c04ba75fc3a005c7a4f857c8b06ecadfedb75bc35b2ce70e7764a"
241
241
  },
242
242
  {
243
243
  "id": "versioning",
@@ -343,6 +343,15 @@
343
343
  "capabilityGroup": "api-cli-reference",
344
344
  "status": "repository-internal"
345
345
  },
346
+ {
347
+ "id": "buildchain-alpha-self-dogfood",
348
+ "path": ".github/workflows/buildchain-alpha-self-dogfood.yml",
349
+ "inputs": [],
350
+ "inputCount": 0,
351
+ "surface": "repository-workflow",
352
+ "capabilityGroup": "api-cli-reference",
353
+ "status": "active"
354
+ },
346
355
  {
347
356
  "id": "buildchain-patrol-daily",
348
357
  "path": ".github/workflows/buildchain-patrol-daily.yml",
package/docs/MAP.md CHANGED
@@ -114,6 +114,8 @@ replace them.
114
114
  - **v2 / v2-alpha / v2.0 / v2.0-alpha / exact tags / floating tags** ->
115
115
  [`release-governance.md`](release-governance.md) and
116
116
  [`release-flow.md`](release-flow.md).
117
+ - **Buildchain self-dogfood / released alpha canary / stable compatibility lane** ->
118
+ [`release-governance.md`](release-governance.md#buildchain-alpha-self-dogfood).
117
119
  - **v2.1 vs v2.2 / when to open a new minor line** ->
118
120
  [`versioning.md`](versioning.md).
119
121
  - **dry-run / what would happen if this channel PR merges** -> [`cli.md`](cli.md)
@@ -167,6 +167,41 @@ This keeps the test channel self-describing. If a consumer checks out
167
167
  alpha ref removes routine consumer edits when Buildchain opens a newer minor,
168
168
  while exact tags and SHAs remain the reproducible audit choice.
169
169
 
170
+ ### Buildchain Alpha Self-Dogfood
171
+
172
+ Buildchain continuously consumes its own current major alpha through
173
+ `.github/workflows/buildchain-alpha-self-dogfood.yml`. The workflow calls the
174
+ released outer reusable workflow at `@v2-alpha` without a runtime override, so
175
+ both the workflow shell and its default runtime must resolve through the same
176
+ floating alpha channel. A parallel stable lane checks out `v2` and runs the
177
+ same declared install, build, and verify lifecycle directly. The direct stable
178
+ lane is intentional: it preserves stable-runtime compatibility without
179
+ requiring the previous stable outer workflow to understand a self-call identity
180
+ fix that has not reached stable yet. Both lanes use a single GitHub-hosted Linux
181
+ fixture to keep the recurring check bounded.
182
+
183
+ The reusable build trust gate reads `job.workflow_ref`, which identifies the
184
+ called workflow and its selected ref. It does not infer the runtime from
185
+ `github.workflow_ref`, because GitHub defines that context as the caller
186
+ workflow identity during a reusable call.
187
+
188
+ The evidence job resolves `v2-alpha` and `v2` through the GitHub refs API,
189
+ compares those immutable SHAs with the reusable workflow outputs, verifies the
190
+ `alpha` and `stable` classifications, and uploads a JSON evidence artifact.
191
+ The canary runs after successful Buildchain ref promotion, on a daily fallback
192
+ schedule, and on manual dispatch. It shares the release-promotion concurrency
193
+ group, so another promotion cannot move the floating refs between runtime
194
+ resolution and evidence comparison.
195
+
196
+ This is a post-publication consumer canary, not a release bootstrap. Source
197
+ verification still runs the current commit, and
198
+ `buildchain-ref-promotion.yml` still passes the verified exact SHA into the
199
+ promotion workflow. Patrol, dev-merge, repair, and promotion defaults remain on
200
+ stable or exact refs so a broken alpha cannot prevent Buildchain from publishing
201
+ its fix. When Buildchain opens a new major, inventory validation requires this
202
+ workflow's fixed GitHub `uses` refs to move from `vN`/`vN-alpha` to the new
203
+ major; GitHub does not allow expressions in a reusable-workflow `uses` ref.
204
+
170
205
  If `dev/vX/vX.Y` has already advanced before generated alpha version-state
171
206
  bookkeeping can sync back, Buildchain records `skipped-non-fast-forward` for the
172
207
  dev sync and still completes the exact and floating alpha tags for the reviewed
@@ -214,6 +214,21 @@ The lock is intentionally small. It does not copy the full contract. The full
214
214
  contract remains in the Buildchain ref and package; the consumer records only
215
215
  what it accepted and the policy used to compare future floating-ref movement.
216
216
 
217
+ Alpha-channel consumers select the matching workflow shell:
218
+
219
+ ```yaml
220
+ jobs:
221
+ build:
222
+ uses: kungfu-systems/buildchain/.github/workflows/.build.yml@v2-alpha
223
+ with:
224
+ buildchain-contract-lock-path: .buildchain/contract-lock.json
225
+ ```
226
+
227
+ The runtime follows the called workflow through `job.workflow_ref`. Callers may
228
+ also pass `buildchain-ref: v2-alpha` explicitly; official floating refs are
229
+ ordinary channel selections and are allowed on pull requests and pushes. Train
230
+ refs and exact SHAs remain trusted manual overrides.
231
+
217
232
  ## Locked Source Checkout Cache
218
233
 
219
234
  Self-hosted runners that build large repositories can opt into a locked source
@@ -309,7 +324,7 @@ The reusable workflow exposes the resolved contract:
309
324
  | `buildchain-runtime-ref` | Runtime ref selected after applying the empty-default or override policy |
310
325
  | `buildchain-runtime-sha` | Immutable Buildchain runtime commit used by all runtime checkouts |
311
326
  | `buildchain-runtime-class` | `stable`, `alpha`, `train`, `exact-sha`, or `development` |
312
- | `buildchain-runtime-override` | `true` when a non-empty `buildchain-ref` override was accepted |
327
+ | `buildchain-runtime-override` | `true` when a train or exact-SHA `buildchain-ref` override was accepted |
313
328
  | `buildchain-runtime-trust-decision` | Runtime override trust decision |
314
329
  | `buildchain-contract-lock-status` | `unchanged`, `compatible-drift`, `breaking-drift`, `missing-lock`, `non-floating-runtime`, or first-release `runtime-contract-unavailable` |
315
330
  | `buildchain-contract-lock-drift` | `true` when the floating runtime SHA or contract digest changed |
@@ -5,6 +5,14 @@ committed workflow YAML. Runtime trains provide a temporary validation pointer
5
5
  for Buildchain changes that are ready for downstream testing but not yet
6
6
  promoted through the normal `dev -> alpha -> release` chain.
7
7
 
8
+ Official floating channels are not runtime overrides. A consumer that
9
+ deliberately follows `@v2-alpha` gets the matching runtime on pull requests and
10
+ pushes because the reusable workflow reads the called workflow identity from
11
+ `job.workflow_ref`. Passing `buildchain-ref: v2-alpha` explicitly is also
12
+ accepted when the caller wants the channel binding visible in its input set.
13
+ The caller's `github.workflow_ref` is not used for this inference because it
14
+ identifies the caller workflow during reusable calls.
15
+
8
16
  ## Train refs
9
17
 
10
18
  A train ref is a branch in the Buildchain repository:
@@ -111,10 +119,12 @@ summary. The evidence should include:
111
119
 
112
120
  ## Trust and limitation
113
121
 
114
- Runtime overrides fail closed unless the event is `workflow_dispatch` and the
115
- actor has write, maintain, or admin permission on the caller repository.
116
- Pull requests, including fork-originated pull requests, cannot use a non-empty
117
- `buildchain-ref`.
122
+ Official floating channel refs such as `v2` and `v2-alpha` may be selected on
123
+ pull requests and pushes. Train refs and arbitrary exact-SHA overrides still
124
+ fail closed unless the event is `workflow_dispatch` and the actor has write,
125
+ maintain, or admin permission on the caller repository. Pull requests,
126
+ including fork-originated pull requests, cannot use train or exact-SHA
127
+ overrides.
118
128
 
119
129
  Runtime train validation covers Buildchain runtime scripts, CLI code, local
120
130
  actions, configuration parsing, and lifecycle behavior. It cannot validate
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kungfu-tech/buildchain",
3
- "version": "2.11.14-alpha.6",
3
+ "version": "2.11.14-alpha.7",
4
4
  "private": false,
5
5
  "description": "Buildchain Release Passport, release governance, CLI toolkit, and site facts.",
6
6
  "repository": "https://github.com/kungfu-systems/buildchain",
@@ -71,6 +71,7 @@ const requiredPaths = [
71
71
  ".github/workflows/buildchain-patrol-daily.yml",
72
72
  ".github/workflows/buildchain-patrol-weekly.yml",
73
73
  ".github/workflows/buildchain-patrol-monthly.yml",
74
+ ".github/workflows/buildchain-alpha-self-dogfood.yml",
74
75
  ".github/workflows/release-candidate-promote.yml",
75
76
  ".github/workflows/release-propagation.yml",
76
77
  ".github/workflows/npm-publish.yml",
@@ -97,6 +98,58 @@ if (rootPackage.name !== "@kungfu-tech/buildchain") {
97
98
  if (rootPackage.private !== false) {
98
99
  throw new Error("root package must be publishable with private=false");
99
100
  }
101
+ const selfDogfoodWorkflow = fs.readFileSync(
102
+ path.join(root, ".github/workflows/buildchain-alpha-self-dogfood.yml"),
103
+ "utf8",
104
+ );
105
+ const selfDogfoodMajor = String(rootPackage.version || "").match(/^(\d+)\./)?.[1];
106
+ if (!selfDogfoodMajor) {
107
+ throw new Error("root package version must expose a numeric major for self-dogfood");
108
+ }
109
+ for (const requiredSnippet of [
110
+ `/.github/workflows/.build.yml@v${selfDogfoodMajor}-alpha`,
111
+ `ref: v${selfDogfoodMajor}`,
112
+ `echo "ref=v${selfDogfoodMajor}"`,
113
+ `const alphaRef = "v${selfDogfoodMajor}-alpha"`,
114
+ `const stableRef = "v${selfDogfoodMajor}"`,
115
+ ]) {
116
+ if (!selfDogfoodWorkflow.includes(requiredSnippet)) {
117
+ throw new Error(`Buildchain self-dogfood workflow missing current-major snippet: ${requiredSnippet}`);
118
+ }
119
+ }
120
+ const reusableBuildWorkflow = fs.readFileSync(
121
+ path.join(root, ".github/workflows/.build.yml"),
122
+ "utf8",
123
+ );
124
+ for (const requiredSnippet of [
125
+ "BUILDCHAIN_WORKFLOW_REF: ${{ job.workflow_ref }}",
126
+ "process.env.BUILDCHAIN_WORKFLOW_REF || process.env.GITHUB_WORKFLOW_REF",
127
+ 'replace(/^refs\\/(?:heads|tags)\\//, "")',
128
+ ]) {
129
+ if (!reusableBuildWorkflow.includes(requiredSnippet)) {
130
+ throw new Error(`reusable build workflow missing called-workflow identity: ${requiredSnippet}`);
131
+ }
132
+ }
133
+ for (const requiredSnippet of [
134
+ "group: buildchain-release-promotion-${{ github.repository }}",
135
+ "cancel-in-progress: false",
136
+ ]) {
137
+ if (!selfDogfoodWorkflow.includes(requiredSnippet)) {
138
+ throw new Error(`Buildchain self-dogfood workflow missing promotion serialization: ${requiredSnippet}`);
139
+ }
140
+ }
141
+ const actionlintConfig = fs.readFileSync(
142
+ path.join(root, ".github/actionlint.yaml"),
143
+ "utf8",
144
+ );
145
+ for (const requiredSnippet of [
146
+ ".github/workflows/.build.yml:",
147
+ 'property "workflow_ref" is not defined in object type',
148
+ ]) {
149
+ if (!actionlintConfig.includes(requiredSnippet)) {
150
+ throw new Error(`actionlint config missing scoped job.workflow_ref compatibility rule: ${requiredSnippet}`);
151
+ }
152
+ }
100
153
  const packageDependencySections = ["dependencies", "optionalDependencies", "peerDependencies"];
101
154
  const exoticDependencyPattern =
102
155
  /^(?:git(?:\+ssh|\+https|\+http|\+file)?:|github:|gitlab:|bitbucket:|https?:|file:|link:|workspace:)/i;
@@ -1,5 +1,6 @@
1
1
  const EXACT_SHA_RE = /^[0-9a-f]{40}$/i;
2
2
  const TRAIN_REF_RE = /^train\/v\d+\/v\d+\.\d+\/[A-Za-z0-9._/-]+$/;
3
+ const OFFICIAL_CHANNEL_REF_RE = /^v\d+(?:\.\d+)?(?:-alpha)?$/;
3
4
 
4
5
  export function parseWorkflowShellRef(workflowRef = "", fallback = "v2", buildchainRepository = "kungfu-systems/buildchain") {
5
6
  const value = String(workflowRef || "");
@@ -8,7 +9,7 @@ export function parseWorkflowShellRef(workflowRef = "", fallback = "v2", buildch
8
9
  return fallback;
9
10
  }
10
11
  const ref = value.split("@").pop()?.trim();
11
- return ref || fallback;
12
+ return (ref || fallback).replace(/^refs\/(?:heads|tags)\//, "");
12
13
  }
13
14
 
14
15
  export function classifyBuildchainRuntimeRef(ref = "") {
@@ -28,13 +29,34 @@ export function classifyBuildchainRuntimeRef(ref = "") {
28
29
  return "development";
29
30
  }
30
31
 
32
+ export function isOfficialBuildchainChannelRef(ref = "") {
33
+ const value = String(ref || "").trim().replace(/^refs\/tags\//, "");
34
+ return OFFICIAL_CHANNEL_REF_RE.test(value);
35
+ }
36
+
31
37
  export function normalizeRequestedRuntimeRef(requestedRef = "") {
32
38
  const requested = String(requestedRef || "").trim();
33
39
  if (!requested) {
34
- return { ref: "", fullRef: "", class: "", exactSha: false };
40
+ return { ref: "", fullRef: "", class: "", exactSha: false, officialChannel: false };
41
+ }
42
+ if (isOfficialBuildchainChannelRef(requested)) {
43
+ const channelRef = requested.replace(/^refs\/tags\//, "");
44
+ return {
45
+ ref: channelRef,
46
+ fullRef: channelRef,
47
+ class: classifyBuildchainRuntimeRef(channelRef),
48
+ exactSha: false,
49
+ officialChannel: true,
50
+ };
35
51
  }
36
52
  if (EXACT_SHA_RE.test(requested)) {
37
- return { ref: requested, fullRef: requested, class: "exact-sha", exactSha: true };
53
+ return {
54
+ ref: requested,
55
+ fullRef: requested,
56
+ class: "exact-sha",
57
+ exactSha: true,
58
+ officialChannel: false,
59
+ };
38
60
  }
39
61
  const trainRef = requested.replace(/^refs\/heads\//, "");
40
62
  if (!TRAIN_REF_RE.test(trainRef)) {
@@ -47,6 +69,7 @@ export function normalizeRequestedRuntimeRef(requestedRef = "") {
47
69
  fullRef: `refs/heads/${trainRef}`,
48
70
  class: "train",
49
71
  exactSha: false,
72
+ officialChannel: false,
50
73
  };
51
74
  }
52
75
 
@@ -71,15 +94,16 @@ export function resolveRuntimeSelection({
71
94
  };
72
95
  }
73
96
  const normalized = normalizeRequestedRuntimeRef(requested);
97
+ const runtimeOverride = !normalized.officialChannel;
74
98
  return {
75
99
  requestedRef: requested,
76
100
  runtimeRef: normalized.ref,
77
101
  runtimeFullRef: normalized.fullRef,
78
102
  runtimeClass: normalized.class,
79
- runtimeOverride: true,
103
+ runtimeOverride,
80
104
  workflowShellRef: workflowShellRef || defaultStableRef,
81
105
  rollbackRef: workflowShellRef || defaultStableRef,
82
- trustDecision: "override-requested",
106
+ trustDecision: normalized.officialChannel ? "official-channel" : "override-requested",
83
107
  };
84
108
  }
85
109
 
@@ -91,6 +115,9 @@ export function validateRuntimeOverrideTrust({
91
115
  if (!String(requestedRef || "").trim()) {
92
116
  return { ok: true, decision: "stable-default" };
93
117
  }
118
+ if (isOfficialBuildchainChannelRef(requestedRef)) {
119
+ return { ok: true, decision: "official-channel" };
120
+ }
94
121
  if (eventName !== "workflow_dispatch") {
95
122
  return {
96
123
  ok: false,