@kungfu-tech/buildchain 4.1.3 → 4.1.4

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 (199) hide show
  1. package/AGENTS.md +11 -13
  2. package/CONTRIBUTING.md +32 -9
  3. package/README.md +56 -140
  4. package/actions/release/promotion/ref/README.md +1 -1
  5. package/architecture/action-taxonomy.json +1 -1
  6. package/architecture/agent-change-map.md +32 -45
  7. package/architecture/build-orchestration.json +1 -1
  8. package/architecture/capability-state-machine-manifest.json +5 -5
  9. package/architecture/ci-lane-change-budget.json +92 -92
  10. package/architecture/code-layout.json +2 -12
  11. package/architecture/core-mechanisms.json +38 -39
  12. package/architecture/cross-platform-adopter-qualification.json +1 -1
  13. package/architecture/dev-delivery-orchestration.json +2 -2
  14. package/architecture/floating-consumer-policy.json +3 -3
  15. package/architecture/internal-capabilities.json +27 -28
  16. package/architecture/maintainability-debt.json +60 -94
  17. package/architecture/maintainability-policy.json +7 -13
  18. package/architecture/minimal-consumer-migration.json +43 -5014
  19. package/architecture/platform-stage-checkpoints.json +1 -1
  20. package/architecture/release-tail-contract.json +2 -2
  21. package/architecture/release-topology.json +31 -25
  22. package/architecture/stage-capsule-qualification.json +1 -1
  23. package/architecture/universal-workflow-bootstrap.json +60 -60
  24. package/architecture/universal-workflow-capability-policy.json +3 -3
  25. package/architecture/universal-workflow-fault-campaign.json +7 -7
  26. package/architecture/workflow-taxonomy.json +59 -60
  27. package/contracts/fixtures/v4-tail-reseal-v1/valid.json +1 -1
  28. package/dist/site/buildchain-contract.json +138 -66
  29. package/dist/site/buildchain-site.json +257 -331
  30. package/dist/site/capability-registry.json +4 -4
  31. package/dist/site/cli-registry.json +6 -142
  32. package/dist/site/controller-registry.json +19 -19
  33. package/dist/site/kfd-claims.json +481 -529
  34. package/dist/site/kfd-upstream-aggregate.json +1 -1
  35. package/dist/site/manual-registry.json +22 -22
  36. package/dist/site/node-api-registry.json +82 -339
  37. package/dist/site/page-registry.json +229 -304
  38. package/dist/site/public-surface-audit.json +544 -754
  39. package/dist/site/publication-authority-registry.json +316 -316
  40. package/dist/site/publication-registry.json +1 -1
  41. package/dist/site/site-manifest.json +23 -23
  42. package/dist/site/workflow-registry.json +1071 -1027
  43. package/docs/MAP.md +28 -20
  44. package/docs/auditable-demo.md +17 -49
  45. package/docs/bootstrap-recovery.md +46 -37
  46. package/docs/cli-reference.md +2 -46
  47. package/docs/cli.md +97 -186
  48. package/docs/code-organization.md +7 -5
  49. package/docs/dev-alpha-candidate-patrol.md +19 -42
  50. package/docs/dev-delivery-orchestration.md +15 -11
  51. package/docs/dev-delivery-qualification-landing-adr.md +10 -9
  52. package/docs/dev-delivery-warrant.md +17 -16
  53. package/docs/dev-qualification-patrol.md +25 -20
  54. package/docs/getting-started.md +80 -139
  55. package/docs/github-artifact-attestation.md +31 -81
  56. package/docs/install.md +66 -30
  57. package/docs/lifecycle-protocol.md +19 -57
  58. package/docs/migration-inventory.md +17 -45
  59. package/docs/next-development-transition.md +13 -13
  60. package/docs/node-api-reference.md +122 -138
  61. package/docs/oci-publication.md +13 -10
  62. package/docs/publication-artifacts.md +128 -486
  63. package/docs/publication-authority.md +15 -45
  64. package/docs/publish-transaction.md +13 -11
  65. package/docs/release-candidate.md +126 -355
  66. package/docs/release-discussions.md +36 -67
  67. package/docs/release-flow.md +80 -339
  68. package/docs/release-governance.md +114 -962
  69. package/docs/release-promotion-request.md +45 -43
  70. package/docs/release-propagation.md +13 -27
  71. package/docs/release-tail-provider-plane.md +38 -65
  72. package/docs/reusable-build-surface.md +78 -196
  73. package/docs/runtime-train-validation.md +8 -6
  74. package/docs/stable-candidate-patrol.md +13 -66
  75. package/docs/v4-adopter-delivery.md +15 -15
  76. package/docs/v4-declarative-release-tail-migration.md +19 -17
  77. package/docs/v4-production-release.md +11 -6
  78. package/docs/v4-publication-rehearsal.md +12 -27
  79. package/docs/v4-stage-capsule.md +14 -20
  80. package/docs/v4-tail-reseal.md +34 -20
  81. package/docs/web-surface-deployments.md +26 -264
  82. package/docs/workflow-catalog.md +31 -31
  83. package/docs/workflow-path-migration.md +10 -4
  84. package/package.json +5 -4
  85. package/packages/core/adoption/buildchain-kfd-claims.js +7 -7
  86. package/packages/core/adoption/cli/output.mjs +1 -9
  87. package/packages/core/adoption/cli/product-gate.mjs +1 -15
  88. package/packages/core/adoption/cli/project.mjs +9 -10
  89. package/packages/core/adoption/cli/standards.mjs +1 -14
  90. package/packages/core/adoption/cli/support.mjs +0 -2
  91. package/packages/core/adoption/cli/surface-register.mjs +0 -2
  92. package/packages/core/adoption/commands/init-repo.mjs +77 -485
  93. package/packages/core/adoption/consumer-init.js +279 -0
  94. package/packages/core/adoption/qualification/admission.js +1 -1
  95. package/packages/core/build/cli/cache.mjs +0 -2
  96. package/packages/core/build/cli/facts.mjs +0 -3
  97. package/packages/core/build/cli/homebrew.mjs +0 -4
  98. package/packages/core/build/cli/lifecycle.mjs +0 -3
  99. package/packages/core/build/github-artifact-attestation.js +2 -2
  100. package/packages/core/build/platform-stage-checkpoints.js +1 -1
  101. package/packages/core/build/signing/dispatch.js +1 -1
  102. package/packages/core/consumer/buildchain-config.js +9 -0
  103. package/packages/core/consumer/contract/inspection.js +351 -9
  104. package/packages/core/consumer/contract/javascript-syntax.js +439 -0
  105. package/packages/core/consumer/contract/javascript-values.js +61 -0
  106. package/packages/core/consumer/contract/javascript.js +555 -0
  107. package/packages/core/consumer/contract/local-validation.js +84 -0
  108. package/packages/core/contracts/buildchain-contract.js +39 -8
  109. package/packages/core/contracts/cli/introspection.mjs +1 -9
  110. package/packages/core/contracts/public-surface-cli.js +0 -1
  111. package/packages/core/dev-delivery/dev-delivery-contract-surface.js +2 -2
  112. package/packages/core/governance/buildchain-publication-authority.js +24 -24
  113. package/packages/core/governance/cli/doctor.mjs +58 -42
  114. package/packages/core/governance/commands/architecture.mjs +6 -1
  115. package/packages/core/governance/commands/audit-publication-control-plane.mjs +1 -1
  116. package/packages/core/governance/commands/workflow-friction-report.mjs +1 -1
  117. package/packages/core/governance/github-governance-authority.js +2 -2
  118. package/packages/core/governance/publication/collection.js +1 -1
  119. package/packages/core/index.js +1 -3
  120. package/packages/core/observability/cli/candidate.mjs +0 -2
  121. package/packages/core/observability/cli/context.mjs +0 -5
  122. package/packages/core/observability/cli/diagnostics.mjs +0 -7
  123. package/packages/core/observability/cli/events.mjs +2 -10
  124. package/packages/core/paper/commands/paper-work-fleet-cli.mjs +1 -1
  125. package/packages/core/paper/commands/paper.mjs +33 -422
  126. package/packages/core/paper/consumer-status.js +72 -0
  127. package/packages/core/paper/operations/identity.js +0 -3
  128. package/packages/core/paper/operations/migration.js +460 -0
  129. package/packages/core/paper/operations/preflight-checks.js +8 -68
  130. package/packages/core/paper/operations/scaffold.js +16 -326
  131. package/packages/core/paper/operations/status.js +27 -53
  132. package/packages/core/paper/paper-agent-entry.js +36 -147
  133. package/packages/core/paper/paper-fleet.js +24 -39
  134. package/packages/core/paper/paper-repository.js +16 -0
  135. package/packages/core/paper/paper-runtime-channels.js +1 -1
  136. package/packages/core/paper/paper-scaffold-content.js +153 -162
  137. package/packages/core/paper/paper-work.js +3 -10
  138. package/packages/core/paper/paper.js +43 -5
  139. package/packages/core/providers/github/artifact-attestation.js +1 -1
  140. package/packages/core/providers/github/pipeline-context-artifacts.js +172 -0
  141. package/packages/core/publication/authority/control-plane.js +2 -2
  142. package/packages/core/publication/authority/seal.js +1 -1
  143. package/packages/core/publication/cli/dispatch.mjs +1 -12
  144. package/packages/core/publication/pipeline/actions.js +16 -9
  145. package/packages/core/publication/pipeline/apply.js +17 -9
  146. package/packages/core/publication/pipeline/context.js +29 -0
  147. package/packages/core/publication/pipeline/prepare.js +15 -6
  148. package/packages/core/publication/pipeline/recovery-materials.js +63 -1
  149. package/packages/core/publication/pipeline/recovery-prepare.js +21 -9
  150. package/packages/core/publication/pipeline/stable-entry.js +12 -7
  151. package/packages/core/publication/pipeline/stable-products.js +21 -19
  152. package/packages/core/publication/pipeline/version-actions.js +15 -6
  153. package/packages/core/publication/publication-rehearsal-projection.js +0 -9
  154. package/packages/core/release/cli/dispatch.mjs +1 -4
  155. package/packages/core/release/cli/inspection-handlers.mjs +1 -33
  156. package/packages/core/release/cli/release-handlers.mjs +2 -19
  157. package/packages/core/release/cli/verification-handlers.mjs +4 -25
  158. package/packages/core/release/next-development-projection.js +13 -13
  159. package/packages/core/release/passport/locations.js +13 -8
  160. package/packages/core/release/release-passport.js +70 -5
  161. package/packages/core/web/cli/badges.mjs +0 -4
  162. package/packages/core/web/publication-admission.js +1 -1
  163. package/packages/core/web/publication-capability.js +1 -1
  164. package/packages/core/web/readme-badges.js +1 -1
  165. package/packages/core/workflow/cli/main.mjs +1 -4
  166. package/packages/core/workflow/cli/process.mjs +1 -1
  167. package/packages/core/workflow/commands/buildchain-cli-help.mjs +2 -8
  168. package/packages/core/workflow/engine/conformance.js +1 -1
  169. package/packages/core/workflow/pipeline/build.js +21 -1
  170. package/packages/core/workflow/pipeline/delivery-observation.js +6 -2
  171. package/packages/core/workflow/workflow-taxonomy.mjs +61 -17
  172. package/scripts/check-code-layout.mjs +2 -0
  173. package/scripts/check-core-mechanism-inventory.mjs +29 -13
  174. package/scripts/check-floating-consumer-policy-contract.mjs +3 -3
  175. package/scripts/check-inventory.mjs +27 -27
  176. package/scripts/check-maintainability.mjs +28 -5
  177. package/scripts/check-public-dogfood-contract.mjs +3 -3
  178. package/scripts/check-release-topology.mjs +1 -1
  179. package/scripts/check-self-consumer-contract.mjs +7 -7
  180. package/scripts/check-universal-workflow-bootstrap.mjs +1 -1
  181. package/scripts/generate-channel-promotion-workflow.mjs +1 -1
  182. package/scripts/generate-minimal-consumer-contract.mjs +21 -1
  183. package/scripts/generate-site-bundle.mjs +2 -1
  184. package/scripts/generate-tail-reseal-fixture.mjs +3 -3
  185. package/scripts/inventory/promotion.mjs +1 -1
  186. package/scripts/next-development-self-dogfood-harness.mjs +1 -1
  187. package/scripts/next-development-self-dogfood.mjs +4 -4
  188. package/scripts/site-capability-metadata.mjs +2 -6
  189. package/scripts/source-metric-lineage.mjs +62 -7
  190. package/scripts/verify-golden-path.mjs +31 -35
  191. package/templates/native-dev-delivery.yml +1 -1
  192. package/templates/universal-buildchain-bootstrap.yml +1 -1
  193. package/packages/core/paper/operations/bootstrap.js +0 -75
  194. package/packages/core/paper/operations/plans.js +0 -213
  195. package/packages/core/paper/operations/provisioning.js +0 -113
  196. package/packages/core/paper/operations/scaffold-config.js +0 -77
  197. package/packages/core/paper/operations/scaffold-workflows.js +0 -116
  198. package/packages/core/paper/operations/workspace.js +0 -60
  199. package/packages/core/paper/paper-npm-bootstrap.js +0 -492
@@ -0,0 +1,279 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+ import { stringify } from "smol-toml";
4
+ import { compileConsumerPlan, CONFIG_PATH } from "../consumer/contract/plan.js";
5
+ import { consumerWorkflows } from "../consumer/contract/entries.js";
6
+ import {
7
+ assertPackageManager,
8
+ detectPackageManager,
9
+ } from "../build/package-manager.js";
10
+
11
+ const TYPES = {
12
+ package: "npm",
13
+ npm: "npm",
14
+ native: "binary",
15
+ binary: "binary",
16
+ "publication-artifact": "paper",
17
+ paper: "paper",
18
+ "anchored-package": "npm",
19
+ };
20
+ const START = "<!-- buildchain:consumer:start -->";
21
+ const END = "<!-- buildchain:consumer:end -->";
22
+
23
+ function packageManager(cwd, requested) {
24
+ if (requested) return assertPackageManager(requested);
25
+ try {
26
+ return detectPackageManager(cwd).name;
27
+ } catch {
28
+ return "pnpm";
29
+ }
30
+ }
31
+
32
+ function product(type, manager, artifactName) {
33
+ const lifecycle = {
34
+ npm: {
35
+ install: [
36
+ manager === "npm"
37
+ ? "npm ci"
38
+ : manager === "yarn"
39
+ ? "corepack yarn install --immutable"
40
+ : "corepack pnpm install --frozen-lockfile",
41
+ ],
42
+ build: [
43
+ manager === "npm" ? "npm run build" : `corepack ${manager} run build`,
44
+ ],
45
+ verify: [
46
+ manager === "npm" ? "npm run check" : `corepack ${manager} run check`,
47
+ ],
48
+ },
49
+ binary: {
50
+ build: [
51
+ "cmake -S . -B build -DCMAKE_BUILD_TYPE=Release",
52
+ "cmake --build build --config Release",
53
+ "cmake --install build --prefix dist/stage",
54
+ "cmake -E tar czf dist/product.tar.gz --format=gnutar dist/stage",
55
+ ],
56
+ verify: ["ctest --test-dir build --output-on-failure"],
57
+ },
58
+ paper: { build: ["make pdf"], verify: ["make check"] },
59
+ }[type];
60
+ const artifact = {
61
+ npm: { path: ".", kind: "npm-package", extension: ".tgz" },
62
+ binary: {
63
+ path: "dist/product.tar.gz",
64
+ kind: "archive",
65
+ extension: ".tar.gz",
66
+ },
67
+ paper: { path: "_build/main.pdf", kind: "pdf", extension: ".pdf" },
68
+ }[type];
69
+ return {
70
+ id: "main",
71
+ type,
72
+ platforms: ["linux-x64"],
73
+ ...lifecycle,
74
+ artifacts: [
75
+ {
76
+ id: "main",
77
+ path: artifact.path,
78
+ kind: artifact.kind,
79
+ ...(artifactName
80
+ ? {
81
+ filename: artifactName.endsWith(artifact.extension)
82
+ ? artifactName
83
+ : `${artifactName}${artifact.extension}`,
84
+ }
85
+ : {}),
86
+ },
87
+ ],
88
+ targets: [
89
+ {
90
+ provider: type === "npm" ? "npm" : "github-release",
91
+ artifacts: ["main"],
92
+ ...(type === "npm" ? { access: "public" } : {}),
93
+ },
94
+ ],
95
+ };
96
+ }
97
+
98
+ function versionSource(cwd, type) {
99
+ const packagePath = path.join(cwd, "package.json");
100
+ for (const file of ["package.json", "release.json"]) {
101
+ const stat = fs.lstatSync(path.join(cwd, file), { throwIfNoEntry: false });
102
+ if (stat && !stat.isFile())
103
+ throw new Error(`${file}: version authority must be a regular file`);
104
+ }
105
+ const manifest = fs.existsSync(packagePath)
106
+ ? JSON.parse(fs.readFileSync(packagePath, "utf8"))
107
+ : null;
108
+ if (type === "npm" && typeof manifest?.version !== "string")
109
+ throw new Error(
110
+ "npm initialization requires the product's package.json with a version",
111
+ );
112
+ const file = manifest?.version ? "package.json" : "release.json";
113
+ const existing =
114
+ file === "package.json"
115
+ ? manifest
116
+ : fs.existsSync(path.join(cwd, file))
117
+ ? JSON.parse(fs.readFileSync(path.join(cwd, file), "utf8"))
118
+ : null;
119
+ if (existing && typeof existing.version !== "string")
120
+ throw new Error(`${file}: version must be a string`);
121
+ const version = existing?.version || "0.1.0-alpha.0";
122
+ return {
123
+ file,
124
+ version,
125
+ files: existing
126
+ ? {}
127
+ : { [file]: `${JSON.stringify({ version }, null, 2)}\n` },
128
+ };
129
+ }
130
+
131
+ function versionLine(version) {
132
+ const line =
133
+ /^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/u.exec(
134
+ version,
135
+ );
136
+ if (!line)
137
+ throw new Error("The product version must be semantic version text");
138
+ return `v${line[1]}/v${line[1]}.${line[2]}`;
139
+ }
140
+
141
+ export function consumerAgentInstructions(current = "") {
142
+ for (const name of ["next-development", "paper-agent-entry"]) {
143
+ const legacyStart = `<!-- buildchain:${name}:v1:start -->`;
144
+ const legacyEnd = `<!-- buildchain:${name}:v1:end -->`;
145
+ if (current.includes(legacyStart) || current.includes(legacyEnd)) {
146
+ const start = current.indexOf(legacyStart),
147
+ end = current.indexOf(legacyEnd);
148
+ if (
149
+ start < 0 ||
150
+ end < start ||
151
+ current.indexOf(legacyStart, start + 1) !== -1 ||
152
+ current.indexOf(legacyEnd, end + 1) !== -1
153
+ )
154
+ throw new Error(
155
+ "Incomplete or ambiguous legacy Buildchain instructions",
156
+ );
157
+ current = current.slice(0, start) + current.slice(end + legacyEnd.length);
158
+ }
159
+ }
160
+ const section = `${START}
161
+ ## Buildchain consumer
162
+
163
+ Maintain product install, build and verification commands in schema-2
164
+ \`.buildchain/buildchain.toml\`. Keep the generated \`buildchain.yml\` and
165
+ \`buildchain-recover.yml\` caller bytes unchanged across product types.
166
+ Open a protected channel PR to request delivery or publication. The published
167
+ runtime owns version preparation, publication and next-development completion.
168
+ Recover only an exact attempt, with an optional temporary repaired runtime.
169
+ Tool-maintained \`.buildchain/contract-lock.json\` and
170
+ \`.buildchain/alpha-contract-lock.json\` bind the published runtime.
171
+ Consumer scripts must not implement release controllers or provider protocols.
172
+ ${END}`;
173
+ if (current.includes(START) !== current.includes(END))
174
+ throw new Error("Incomplete managed Buildchain consumer instructions");
175
+ if (current.includes(START)) {
176
+ const start = current.indexOf(START),
177
+ end = current.indexOf(END) + END.length;
178
+ if (
179
+ end < start ||
180
+ current.indexOf(START, start + START.length) !== -1 ||
181
+ current.indexOf(END, end) !== -1
182
+ )
183
+ throw new Error("Ambiguous managed Buildchain consumer instructions");
184
+ return current.slice(0, start) + section + current.slice(end);
185
+ }
186
+ const header =
187
+ current.trimEnd() ||
188
+ `---
189
+ status: active
190
+ period: ongoing
191
+ theme: buildchain-consumer
192
+ doc_type: process-rule
193
+ source_level: generated-template
194
+ confidence: high
195
+ sensitivity: public
196
+ evidence_grade: B
197
+ review_state: unreviewed
198
+ last_reviewed: 2026-09-20
199
+ ---
200
+
201
+ # Repository instructions`;
202
+ return `${header}\n\n${section}\n`;
203
+ }
204
+
205
+ export function planConsumerInitialization({
206
+ cwd,
207
+ type,
208
+ requestedManager = "",
209
+ artifactName = "",
210
+ }) {
211
+ const productType = TYPES[type];
212
+ if (!productType)
213
+ throw new Error(
214
+ "init supports npm/package, binary/native, paper/publication-artifact, and anchored-package; legacy web-surface and infra-contract initialization is not part of the schema-2 pipeline",
215
+ );
216
+ const manager = packageManager(cwd, requestedManager);
217
+ const version = versionSource(cwd, productType);
218
+ return {
219
+ manager,
220
+ productType,
221
+ files: {
222
+ ...version.files,
223
+ [CONFIG_PATH]: consumerConfiguration({
224
+ type,
225
+ manager,
226
+ artifactName,
227
+ version: version.version,
228
+ versionFile: version.file,
229
+ }),
230
+ ...consumerWorkflows(),
231
+ },
232
+ };
233
+ }
234
+
235
+ // Shared pure plan construction for init and product-source scaffolders.
236
+ export function consumerConfiguration({
237
+ type,
238
+ manager = "pnpm",
239
+ artifactName = "",
240
+ version,
241
+ versionFile = "package.json",
242
+ }) {
243
+ const productType = TYPES[type];
244
+ if (!productType)
245
+ throw new Error(`Unsupported consumer product type: ${type}`);
246
+ if (productType === "npm") assertPackageManager(manager);
247
+ const line = versionLine(version);
248
+ const plan = {
249
+ schema: 2,
250
+ products: [product(productType, manager, artifactName)],
251
+ version: {
252
+ strategy: type === "anchored-package" ? "anchored" : "semver",
253
+ files: [{ path: versionFile, format: "json", key: "version" }],
254
+ },
255
+ channels: [
256
+ ...["feature", "fix", "chore", "docs", "ci", "refactor"].map(
257
+ (prefix) => ({
258
+ from: `${prefix}/*`,
259
+ to: `dev/${line}`,
260
+ operation: "develop",
261
+ }),
262
+ ),
263
+ {
264
+ from: `dev/${line}`,
265
+ to: `alpha/${line}`,
266
+ operation: "alpha",
267
+ },
268
+ {
269
+ from: `alpha/${line}`,
270
+ to: `release/${line}`,
271
+ operation: "stable",
272
+ },
273
+ ],
274
+ review: { minimum_approvals: 1, code_owners: true, merge_queue: true },
275
+ };
276
+ const toml = stringify(plan);
277
+ compileConsumerPlan(toml);
278
+ return toml;
279
+ }
@@ -83,7 +83,7 @@ export function admitAdopterPolicy({
83
83
  invocationRoot: consumerRoot,
84
84
  repository,
85
85
  sourceSha: consumerSha,
86
- invokedWorkflow: ".github/workflows/public-build-adopter-qualification.yml",
86
+ invokedWorkflow: ".github/workflows/.build-adopter-qualification.yml",
87
87
  invocationSourcePath,
88
88
  resolvedWorkflowSha: runtimeSha,
89
89
  resolvedRuntimeSha: runtimeSha,
@@ -10,8 +10,6 @@ import {
10
10
  readBooleanFlag,
11
11
  readFlag,
12
12
  readJsonInput,
13
- readRepeatedFlag,
14
- readRepeatedJsonInputs,
15
13
  writeJsonFile,
16
14
  } from "../../contracts/cli/options.mjs";
17
15
 
@@ -9,10 +9,7 @@ import {
9
9
  printJson,
10
10
  readBooleanFlag,
11
11
  readFlag,
12
- readJsonInput,
13
12
  readRepeatedFlag,
14
- readRepeatedJsonInputs,
15
- writeJsonFile,
16
13
  } from "../../contracts/cli/options.mjs";
17
14
  import { runCompatibilityFactsCli } from "../../governance/cli/compatibility-facts.mjs";
18
15
  import { root } from "../../contracts/cli/context.mjs";
@@ -9,10 +9,6 @@ import {
9
9
  printJson,
10
10
  readBooleanFlag,
11
11
  readFlag,
12
- readJsonInput,
13
- readRepeatedFlag,
14
- readRepeatedJsonInputs,
15
- writeJsonFile,
16
12
  } from "../../contracts/cli/options.mjs";
17
13
 
18
14
  export async function runHomebrewCli(args = []) {
@@ -4,10 +4,7 @@ import {
4
4
  printJson,
5
5
  readBooleanFlag,
6
6
  readFlag,
7
- readJsonInput,
8
7
  readRepeatedFlag,
9
- readRepeatedJsonInputs,
10
- writeJsonFile,
11
8
  } from "../../contracts/cli/options.mjs";
12
9
  import { runScript } from "../../workflow/cli/process.mjs";
13
10
 
@@ -13,7 +13,7 @@ export const GITHUB_ARTIFACT_ATTESTATION_VERIFICATION_CONTRACT =
13
13
  export const GITHUB_ARTIFACT_ATTESTATION_PREDICATE_TYPE =
14
14
  "https://buildchain.libkungfu.dev/attestations/github-artifact/v1";
15
15
  export const GITHUB_ARTIFACT_ATTESTATION_WORKFLOW =
16
- ".github/workflows/public-release-artifact-attestation.yml";
16
+ ".github/workflows/.release-artifact-attestation.yml";
17
17
 
18
18
  const SHA256 = /^sha256:([0-9a-f]{64})$/;
19
19
  const COMMIT = /^[0-9a-f]{40}$/;
@@ -127,7 +127,7 @@ function normalizeSigner(value) {
127
127
  if (signerRepository !== "kungfu-systems/buildchain") {
128
128
  throw new Error("policy.signer.repository must be kungfu-systems/buildchain");
129
129
  }
130
- if (workflowPath !== GITHUB_ARTIFACT_ATTESTATION_WORKFLOW) {
130
+ if (![GITHUB_ARTIFACT_ATTESTATION_WORKFLOW, ".github/workflows/public-release-artifact-attestation.yml"].includes(workflowPath)) {
131
131
  throw new Error(`policy.signer.workflowPath must be ${GITHUB_ARTIFACT_ATTESTATION_WORKFLOW}`);
132
132
  }
133
133
  return {
@@ -225,7 +225,7 @@ export function validatePlatformStageCheckpointDeclaration(value) {
225
225
  tokens([...stageIds].sort(), "$/declaration/stageIds");
226
226
  exactKeys(
227
227
  value.projections,
228
- ["protectedWorkflow", "generatedTemplate", "agentGuidance", "manual"],
228
+ ["protectedWorkflow", "productVerification", "agentGuidance", "manual"],
229
229
  "$/declaration/projections",
230
230
  );
231
231
  exactKeys(
@@ -14,7 +14,7 @@ function repository(value, label) {
14
14
  return normalized;
15
15
  }
16
16
 
17
- const AUTHORITY_WORKFLOW = "public-release-signing-authority.yml";
17
+ const AUTHORITY_WORKFLOW = ".release-signing-authority.yml";
18
18
 
19
19
  export function resolveAuthorityDispatchRef(value = "v4") {
20
20
  if (!["v4", "v4-alpha"].includes(value))
@@ -7,6 +7,7 @@ import {
7
7
  BUILDCHAIN_CONFIG_PATH,
8
8
  } from "../contracts/buildchain-layout.js";
9
9
  import { readProductConfiguration } from "./contract/reader.js";
10
+ import { consumerConfigurationSummary } from "./contract/local-validation.js";
10
11
  import { runShellCommandSync } from "../runtime/spawn-command.js";
11
12
  import { normalizeBuildConfiguration } from "../build/build-configuration.js";
12
13
 
@@ -1637,6 +1638,14 @@ export function validateBuildchainConfig(
1637
1638
  throw new Error("version state is required but no version.files are configured");
1638
1639
  }
1639
1640
 
1641
+ if (loadedConfig.config.schema === 2)
1642
+ return consumerConfigurationSummary(
1643
+ loadedConfig,
1644
+ versionFiles,
1645
+ discoverConfiguredDerivedVersionMaterial(cwd, loadedConfig),
1646
+ requireLifecycleStages,
1647
+ );
1648
+
1640
1649
  const lifecycleStages = configuredLifecycleStages(loadedConfig);
1641
1650
  const stageNames = new Set(lifecycleStages.map((stage) => stage.name));
1642
1651
  const missingStages = requireLifecycleStages.filter((stage) => !stageNames.has(stage));