@kungfu-tech/buildchain 3.0.9-alpha.1 → 3.0.9-alpha.3

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 (51) hide show
  1. package/contracts/fixtures/next-development-transition-v1/anchored-manual-waiting.json +47 -0
  2. package/contracts/fixtures/next-development-transition-v1/semver-auto-planned.json +47 -0
  3. package/contracts/fixtures/next-development-transition-v1/version-model-cases.json +40 -0
  4. package/contracts/next-development-request-v1.schema.json +66 -0
  5. package/contracts/next-development-transition-v1.schema.json +292 -0
  6. package/dist/site/buildchain-contract.json +6 -6
  7. package/dist/site/buildchain-site.json +92 -21
  8. package/dist/site/capability-registry.json +4 -3
  9. package/dist/site/kfd-claims.json +65 -5
  10. package/dist/site/kfd-upstream-aggregate.json +1 -1
  11. package/dist/site/manual-registry.json +20 -4
  12. package/dist/site/node-api-registry.json +1017 -37
  13. package/dist/site/page-registry.json +76 -13
  14. package/dist/site/public-surface-audit.json +7 -3
  15. package/dist/site/publication-registry.json +4 -4
  16. package/dist/site/release-provenance.json +3 -0
  17. package/dist/site/site-manifest.json +16 -8
  18. package/dist/site/workflow-registry.json +4 -4
  19. package/docs/MAP.md +2 -1
  20. package/docs/aws-us-elastic-runner-burst-plane.md +11 -3
  21. package/docs/dev-alpha-candidate-patrol.md +8 -0
  22. package/docs/next-development-transition.md +119 -0
  23. package/docs/node-api-reference.md +126 -73
  24. package/docs/release-governance.md +5 -3
  25. package/docs/versioning.md +1 -1
  26. package/package.json +8 -3
  27. package/packages/core/buildchain-agent-manuals.js +1 -0
  28. package/packages/core/channel-candidate.js +8 -0
  29. package/packages/core/channel-promotion-baseline.js +52 -0
  30. package/packages/core/dev-alpha-candidate-selection.js +10 -2
  31. package/packages/core/kfd-adopter-manifest.js +3 -3
  32. package/packages/core/next-development-candidate-reservation.js +186 -0
  33. package/packages/core/next-development-controller.js +726 -0
  34. package/packages/core/next-development-projection.js +288 -0
  35. package/packages/core/next-development-transition.js +738 -0
  36. package/packages/core/paper-agent-entry.js +7 -4
  37. package/packages/core/paper.js +14 -7
  38. package/scripts/aws-macos-jit-controller-core.mjs +83 -2
  39. package/scripts/aws-macos-jit-controller.mjs +32 -1
  40. package/scripts/aws-macos-jit-instance-rehydrate.mjs +260 -0
  41. package/scripts/check-inventory.mjs +11 -0
  42. package/scripts/dev-alpha-candidate-patrol.mjs +22 -1
  43. package/scripts/generate-buildchain-kfd-witnesses.mjs +2 -2
  44. package/scripts/generate-next-development-guidance.mjs +49 -0
  45. package/scripts/generate-site-bundle.mjs +2 -0
  46. package/scripts/init-repo.mjs +119 -62
  47. package/scripts/next-development-self-dogfood-harness.mjs +409 -0
  48. package/scripts/next-development-self-dogfood.mjs +532 -0
  49. package/scripts/next-development-transition.mjs +47 -0
  50. package/scripts/site-capability-metadata.mjs +3 -0
  51. package/scripts/stable-candidate-qualification.mjs +7 -7
@@ -368,6 +368,7 @@ const manualMetaById = new Map(Object.entries({
368
368
  "release-activation-transaction": { capabilityGroup: "release-passport-trust", audience: ["release-operator", "agent"], maturity: "preview", order: 125 },
369
369
  "release-candidate": { capabilityGroup: "reusable-build", audience: ["release-operator", "consumer"], maturity: "stable", order: 130 },
370
370
  "release-train": { capabilityGroup: "governance-versioning", audience: ["release-operator", "consumer", "agent"], maturity: "preview", order: 132 },
371
+ "next-development-transition": { capabilityGroup: "governance-versioning", audience: ["release-operator", "consumer", "agent"], maturity: "preview", order: 133 },
371
372
  "stable-candidate-patrol": { capabilityGroup: "governance-versioning", audience: ["release-operator", "consumer"], maturity: "preview", order: 135 },
372
373
  "dev-qualification-patrol": { capabilityGroup: "governance-versioning", audience: ["release-operator", "consumer", "agent"], maturity: "preview", order: 136 },
373
374
  "dev-alpha-candidate-patrol": { capabilityGroup: "governance-versioning", audience: ["release-operator", "consumer", "agent"], maturity: "preview", order: 137 },
@@ -733,6 +734,7 @@ function buildSiteBundle() {
733
734
  "docs/reusable-build-surface.md",
734
735
  "docs/release-candidate.md",
735
736
  "docs/release-train.md",
737
+ "docs/next-development-transition.md",
736
738
  "docs/stable-candidate-patrol.md",
737
739
  "docs/dev-qualification-patrol.md",
738
740
  "docs/dev-alpha-candidate-patrol.md",
@@ -3,21 +3,35 @@ import fs from "node:fs";
3
3
  import path from "node:path";
4
4
  import { pathToFileURL } from "node:url";
5
5
  import { BUILDCHAIN_CONFIG_PATH } from "../packages/core/buildchain-layout.js";
6
- import { detectPackageManager, assertPackageManager } from "../packages/core/package-manager.js";
6
+ import {
7
+ detectPackageManager,
8
+ assertPackageManager,
9
+ } from "../packages/core/package-manager.js";
7
10
  import {
8
11
  PUBLICATION_REHEARSAL_WORKFLOW_PATH,
9
12
  appendPublicationRehearsalToml,
10
13
  mergePublicationRehearsalAgentInstructions,
11
14
  publicationRehearsalWorkflow,
12
15
  } from "../packages/core/publication-rehearsal-projection.js";
13
-
14
- const BUILDCHAIN_WORKFLOW_REF = "kungfu-systems/buildchain/.github/workflows/.build.yml@v3";
15
- const DEFAULT_PUBLICATION_LATEX_IMAGE = "ghcr.io/kungfu-systems/build-images/latex-pdf-builder";
16
- const DEFAULT_PUBLICATION_LATEX_DIGEST = "sha256:c20f3809e96836c1c78e97c76939d12f1de3fed0ea9b7c40c43332ec2ea480f8";
17
- const DEFAULT_PUBLICATION_LATEX_COMMAND = "latexmk -pdf -outdir=_build paper/main.tex";
16
+ import {
17
+ appendNextDevelopmentToml,
18
+ mergeNextDevelopmentAgentInstructions,
19
+ nextDevelopmentWorkflowHeader,
20
+ } from "../packages/core/next-development-projection.js";
21
+
22
+ const BUILDCHAIN_WORKFLOW_REF =
23
+ "kungfu-systems/buildchain/.github/workflows/.build.yml@v3";
24
+ const DEFAULT_PUBLICATION_LATEX_IMAGE =
25
+ "ghcr.io/kungfu-systems/build-images/latex-pdf-builder";
26
+ const DEFAULT_PUBLICATION_LATEX_DIGEST =
27
+ "sha256:c20f3809e96836c1c78e97c76939d12f1de3fed0ea9b7c40c43332ec2ea480f8";
28
+ const DEFAULT_PUBLICATION_LATEX_COMMAND =
29
+ "latexmk -pdf -outdir=_build paper/main.tex";
18
30
 
19
31
  function posixPath(value) {
20
- return String(value || "").split(path.sep).join("/");
32
+ return String(value || "")
33
+ .split(path.sep)
34
+ .join("/");
21
35
  }
22
36
 
23
37
  function repoName(cwd) {
@@ -282,34 +296,42 @@ command = "make check"
282
296
  }
283
297
 
284
298
  function infraContractDesiredJson(cwd) {
285
- return `${JSON.stringify({
286
- service: repoName(cwd),
287
- environment: "staging",
288
- resources: [
289
- {
290
- kind: "static-site",
291
- name: repoName(cwd),
292
- desiredState: {
293
- hostname: "staging.example.com",
294
- accessControl: "managed-network",
295
- owner: "platform",
299
+ return `${JSON.stringify(
300
+ {
301
+ service: repoName(cwd),
302
+ environment: "staging",
303
+ resources: [
304
+ {
305
+ kind: "static-site",
306
+ name: repoName(cwd),
307
+ desiredState: {
308
+ hostname: "staging.example.com",
309
+ accessControl: "managed-network",
310
+ owner: "platform",
311
+ },
296
312
  },
297
- },
298
- ],
299
- }, null, 2)}\n`;
313
+ ],
314
+ },
315
+ null,
316
+ 2,
317
+ )}\n`;
300
318
  }
301
319
 
302
320
  function infraContractOutputsJson(cwd) {
303
- return `${JSON.stringify({
304
- service: repoName(cwd),
305
- environment: "staging",
306
- observedMode: "manual-observed",
307
- outputs: {
308
- hostname: "staging.example.com",
309
- distributionId: "observed-distribution-id",
310
- bucket: "observed-bucket-name",
321
+ return `${JSON.stringify(
322
+ {
323
+ service: repoName(cwd),
324
+ environment: "staging",
325
+ observedMode: "manual-observed",
326
+ outputs: {
327
+ hostname: "staging.example.com",
328
+ distributionId: "observed-distribution-id",
329
+ bucket: "observed-bucket-name",
330
+ },
311
331
  },
312
- }, null, 2)}\n`;
332
+ null,
333
+ 2,
334
+ )}\n`;
313
335
  }
314
336
 
315
337
  function workflowArtifactPaths(type) {
@@ -333,7 +355,7 @@ function workflowArtifactPaths(type) {
333
355
  }
334
356
 
335
357
  function publicationWorkflowYaml() {
336
- return `name: Build
358
+ return `${nextDevelopmentWorkflowHeader()}name: Build
337
359
 
338
360
  on:
339
361
  workflow_dispatch:
@@ -365,7 +387,7 @@ jobs:
365
387
  }
366
388
 
367
389
  function workflowYaml({ type, runnerPreset, artifactName }) {
368
- return `name: Build
390
+ return `${nextDevelopmentWorkflowHeader()}name: Build
369
391
 
370
392
  on:
371
393
  workflow_dispatch:
@@ -400,7 +422,9 @@ jobs:
400
422
 
401
423
  function writeIfAllowed(filePath, content, { force }) {
402
424
  if (fs.existsSync(filePath) && !force) {
403
- throw new Error(`${posixPath(filePath)} already exists; pass --force to overwrite`);
425
+ throw new Error(
426
+ `${posixPath(filePath)} already exists; pass --force to overwrite`,
427
+ );
404
428
  }
405
429
  fs.mkdirSync(path.dirname(filePath), { recursive: true });
406
430
  fs.writeFileSync(filePath, content);
@@ -408,7 +432,9 @@ function writeIfAllowed(filePath, content, { force }) {
408
432
  }
409
433
 
410
434
  function writeManagedAgentEntry(filePath, current) {
411
- const content = mergePublicationRehearsalAgentInstructions(current);
435
+ const content = mergeNextDevelopmentAgentInstructions(
436
+ mergePublicationRehearsalAgentInstructions(current),
437
+ );
412
438
  fs.mkdirSync(path.dirname(filePath), { recursive: true });
413
439
  fs.writeFileSync(filePath, content);
414
440
  return filePath;
@@ -424,27 +450,33 @@ export function initBuildchainRepo({
424
450
  } = {}) {
425
451
  const resolvedCwd = path.resolve(cwd);
426
452
  const manager = detectOrDefaultPackageManager(resolvedCwd, packageManager);
427
- const toml = appendPublicationRehearsalToml((() => {
428
- if (type === "package") {
429
- return packageToml(resolvedCwd, manager);
430
- }
431
- if (type === "native") {
432
- return nativeToml(resolvedCwd);
433
- }
434
- if (type === "web-surface") {
435
- return webSurfaceToml(resolvedCwd);
436
- }
437
- if (type === "infra-contract") {
438
- return infraContractToml(resolvedCwd);
439
- }
440
- if (type === "publication-artifact") {
441
- return publicationArtifactToml(resolvedCwd);
442
- }
443
- if (type === "anchored-package") {
444
- return anchoredPackageToml(resolvedCwd, manager);
445
- }
446
- throw new Error("init --type must be one of package, native, web-surface, infra-contract, publication-artifact, or anchored-package");
447
- })());
453
+ const toml = appendNextDevelopmentToml(
454
+ appendPublicationRehearsalToml(
455
+ (() => {
456
+ if (type === "package") {
457
+ return packageToml(resolvedCwd, manager);
458
+ }
459
+ if (type === "native") {
460
+ return nativeToml(resolvedCwd);
461
+ }
462
+ if (type === "web-surface") {
463
+ return webSurfaceToml(resolvedCwd);
464
+ }
465
+ if (type === "infra-contract") {
466
+ return infraContractToml(resolvedCwd);
467
+ }
468
+ if (type === "publication-artifact") {
469
+ return publicationArtifactToml(resolvedCwd);
470
+ }
471
+ if (type === "anchored-package") {
472
+ return anchoredPackageToml(resolvedCwd, manager);
473
+ }
474
+ throw new Error(
475
+ "init --type must be one of package, native, web-surface, infra-contract, publication-artifact, or anchored-package",
476
+ );
477
+ })(),
478
+ ),
479
+ );
448
480
 
449
481
  const agentsPath = path.join(resolvedCwd, "AGENTS.md");
450
482
  const currentAgents = fs.existsSync(agentsPath)
@@ -452,7 +484,9 @@ export function initBuildchainRepo({
452
484
  : "";
453
485
 
454
486
  const written = [
455
- writeIfAllowed(path.join(resolvedCwd, BUILDCHAIN_CONFIG_PATH), toml, { force }),
487
+ writeIfAllowed(path.join(resolvedCwd, BUILDCHAIN_CONFIG_PATH), toml, {
488
+ force,
489
+ }),
456
490
  writeIfAllowed(
457
491
  path.join(resolvedCwd, ".github", "workflows", "build.yml"),
458
492
  type === "publication-artifact"
@@ -472,14 +506,31 @@ export function initBuildchainRepo({
472
506
  writeManagedAgentEntry(agentsPath, currentAgents),
473
507
  ];
474
508
 
475
- if (type === "anchored-package" && !fs.existsSync(path.join(resolvedCwd, "release.json"))) {
476
- written.push(writeIfAllowed(path.join(resolvedCwd, "release.json"), "{\n \"upstream\": \"\",\n \"version\": \"0.0.0\"\n}\n", { force }));
509
+ if (
510
+ type === "anchored-package" &&
511
+ !fs.existsSync(path.join(resolvedCwd, "release.json"))
512
+ ) {
513
+ written.push(
514
+ writeIfAllowed(
515
+ path.join(resolvedCwd, "release.json"),
516
+ '{\n "upstream": "",\n "version": "0.0.0"\n}\n',
517
+ { force },
518
+ ),
519
+ );
477
520
  }
478
521
 
479
522
  if (type === "infra-contract") {
480
523
  written.push(
481
- writeIfAllowed(path.join(resolvedCwd, "infra", "desired.json"), infraContractDesiredJson(resolvedCwd), { force }),
482
- writeIfAllowed(path.join(resolvedCwd, "infra", "outputs.json"), infraContractOutputsJson(resolvedCwd), { force }),
524
+ writeIfAllowed(
525
+ path.join(resolvedCwd, "infra", "desired.json"),
526
+ infraContractDesiredJson(resolvedCwd),
527
+ { force },
528
+ ),
529
+ writeIfAllowed(
530
+ path.join(resolvedCwd, "infra", "outputs.json"),
531
+ infraContractOutputsJson(resolvedCwd),
532
+ { force },
533
+ ),
483
534
  );
484
535
  }
485
536
 
@@ -489,7 +540,9 @@ export function initBuildchainRepo({
489
540
  cwd: resolvedCwd,
490
541
  packageManager: manager,
491
542
  workflowRef: BUILDCHAIN_WORKFLOW_REF,
492
- written: written.map((filePath) => posixPath(path.relative(resolvedCwd, filePath))),
543
+ written: written.map((filePath) =>
544
+ posixPath(path.relative(resolvedCwd, filePath)),
545
+ ),
493
546
  };
494
547
  }
495
548
 
@@ -501,7 +554,11 @@ function readArg(name, fallback = "") {
501
554
  return process.argv[index + 1] || "";
502
555
  }
503
556
 
504
- if (!process.env.BUILDCHAIN_EMBEDDED_ENTRYPOINT && process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
557
+ if (
558
+ !process.env.BUILDCHAIN_EMBEDDED_ENTRYPOINT &&
559
+ process.argv[1] &&
560
+ import.meta.url === pathToFileURL(process.argv[1]).href
561
+ ) {
505
562
  try {
506
563
  const result = initBuildchainRepo({
507
564
  cwd: readArg("cwd", process.cwd()),