@kungfu-tech/buildchain 4.0.1-alpha.4 → 4.0.1-alpha.5
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.
- package/architecture/decisions/0002-next-development-transition.md +101 -0
- package/architecture/internal-capabilities.json +52 -3
- package/architecture/maintainability-policy.json +22 -10
- package/architecture/v3-core-mechanism-inventory.json +89 -0
- package/architecture/v4-capability-state-machine-manifest.json +73 -0
- package/architecture/v4-compatibility-facts-parity.json +77 -0
- package/architecture/v4-next-development-parity.json +192 -0
- package/architecture/v4-release-train-parity.json +1 -0
- package/architecture/v4-tail-reseal-parity.json +150 -0
- package/bin/buildchain.mjs +16 -1
- package/bin/internal/command-registry.mjs +2 -0
- package/bin/internal/compatibility-facts-cli.mjs +101 -0
- package/contracts/fixtures/next-development-transition-v1/anchored-manual-waiting.json +47 -0
- package/contracts/fixtures/next-development-transition-v1/semver-auto-planned.json +47 -0
- package/contracts/fixtures/next-development-transition-v1/version-model-cases.json +40 -0
- package/contracts/fixtures/v4-compatibility-facts-v1/shared.json +1129 -0
- package/contracts/fixtures/v4-floating-consumer-policy-v1/cases.json +7 -1
- package/contracts/fixtures/v4-tail-reseal-v1/valid.json +229 -0
- package/contracts/next-development-request-v1.schema.json +66 -0
- package/contracts/next-development-transition-v1.schema.json +292 -0
- package/contracts/v4-compatibility-facts-v1.schema.json +230 -0
- package/contracts/v4-tail-reseal-v1.schema.json +276 -0
- package/dist/site/agent-index.json +1 -0
- package/dist/site/artifact-schemas.json +2 -0
- package/dist/site/buildchain-contract.json +1388 -23
- package/dist/site/buildchain-site.json +257 -19
- package/dist/site/capability-registry.json +10 -8
- package/dist/site/cli-registry.json +106 -0
- package/dist/site/kfd-claims.json +187 -12
- package/dist/site/kfd-upstream-aggregate.json +1 -1
- package/dist/site/manual-registry.json +35 -4
- package/dist/site/node-api-registry.json +6579 -4493
- package/dist/site/page-registry.json +233 -11
- package/dist/site/public-surface-audit.json +241 -7
- package/dist/site/publication-authority-registry.json +6 -1
- package/dist/site/publication-registry.json +4 -4
- package/dist/site/release-provenance.json +7 -0
- package/dist/site/schemas/v4-compatibility-facts-v1.schema.json +230 -0
- package/dist/site/site-manifest.json +24 -8
- package/dist/site/workflow-registry.json +36 -4
- package/docs/MAP.md +4 -1
- package/docs/cli-reference.md +125 -0
- package/docs/dev-alpha-candidate-patrol.md +8 -0
- package/docs/next-development-transition.md +118 -0
- package/docs/node-api-reference.md +250 -117
- package/docs/v4-compatibility-facts.md +91 -0
- package/docs/v4-tail-reseal.md +73 -0
- package/docs/versioning.md +4 -3
- package/package.json +14 -5
- package/packages/core/buildchain-agent-manuals.js +2 -0
- package/packages/core/buildchain-compatibility-authority.js +336 -0
- package/packages/core/buildchain-compatibility-fact.js +394 -0
- package/packages/core/buildchain-compatibility-facts.json +217 -0
- package/packages/core/buildchain-compatibility-proof.js +566 -0
- package/packages/core/buildchain-contract.js +93 -141
- package/packages/core/channel-candidate.js +8 -0
- package/packages/core/channel-promotion-baseline.js +55 -0
- package/packages/core/dev-alpha-candidate-selection.js +10 -2
- package/packages/core/dev-delivery-execution-transfer.js +21 -1
- package/packages/core/dev-delivery-process-boundary.js +19 -6
- package/packages/core/dev-delivery-provider-heartbeat.js +18 -6
- package/packages/core/kungfu-temporal-fact.js +557 -0
- package/packages/core/next-development-candidate-reservation.js +186 -0
- package/packages/core/next-development-controller.js +728 -0
- package/packages/core/next-development-projection.js +287 -0
- package/packages/core/next-development-transition.js +738 -0
- package/packages/core/paper-agent-entry.js +11 -5
- package/packages/core/paper.js +16 -5
- package/packages/core/v4-canonical-contracts.js +5 -0
- package/packages/core/v4-floating-consumer-policy.js +29 -9
- package/packages/core/v4-tail-reseal-contract.js +26 -0
- package/packages/core/v4-tail-reseal-github.js +178 -0
- package/packages/core/v4-tail-reseal-receipt.js +225 -0
- package/packages/core/v4-tail-reseal.js +594 -0
- package/scripts/buildchain-cli-help.mjs +20 -0
- package/scripts/check-inventory.mjs +11 -0
- package/scripts/dev-alpha-candidate-patrol.mjs +22 -1
- package/scripts/generate-next-development-guidance.mjs +49 -0
- package/scripts/generate-site-bundle.mjs +16 -3
- package/scripts/init-repo.mjs +22 -4
- package/scripts/next-development-self-dogfood-harness.mjs +460 -0
- package/scripts/next-development-self-dogfood.mjs +597 -0
- package/scripts/next-development-transition.mjs +47 -0
- package/scripts/site-capability-metadata.mjs +12 -0
- package/scripts/v4-consumer-policy.mjs +1 -5
- package/scripts/v4-tail-reseal-macos-rehearsal.mjs +134 -0
- package/scripts/v4-tail-reseal.mjs +416 -0
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
candidateFromDecision,
|
|
21
21
|
selectLatestQualifiedSource,
|
|
22
22
|
} from "../packages/core/dev-alpha-candidate-selection.js";
|
|
23
|
+
import { readGitHubNextDevelopmentVersionReservation } from "../packages/core/next-development-candidate-reservation.js";
|
|
23
24
|
|
|
24
25
|
export { reconcileActiveReleaseTrain, selectLatestQualifiedSource };
|
|
25
26
|
|
|
@@ -617,6 +618,7 @@ export async function runDevAlphaCandidatePatrol(
|
|
|
617
618
|
comparison,
|
|
618
619
|
workflowEvidence,
|
|
619
620
|
skippedNewerCommitCount,
|
|
621
|
+
versionReservation,
|
|
620
622
|
qualificationError,
|
|
621
623
|
} = await resolvePatrolSourceInputs({
|
|
622
624
|
client,
|
|
@@ -646,6 +648,7 @@ export async function runDevAlphaCandidatePatrol(
|
|
|
646
648
|
observedSourceHeadSha,
|
|
647
649
|
skippedNewerCommitCount,
|
|
648
650
|
...(targetBaseline ? { targetBaseline } : {}),
|
|
651
|
+
...(versionReservation ? { versionReservation } : {}),
|
|
649
652
|
},
|
|
650
653
|
workflowEvidence,
|
|
651
654
|
requiredWorkflowPaths,
|
|
@@ -992,6 +995,20 @@ export function createGitHubChannelCandidateClient({
|
|
|
992
995
|
targetBranch,
|
|
993
996
|
parseCandidate: managedCandidateFromPullRequest,
|
|
994
997
|
}),
|
|
998
|
+
async readNextDevelopmentVersionReservation({
|
|
999
|
+
reservationSha,
|
|
1000
|
+
candidateSha,
|
|
1001
|
+
targetVersion,
|
|
1002
|
+
}) {
|
|
1003
|
+
return readGitHubNextDevelopmentVersionReservation({
|
|
1004
|
+
api,
|
|
1005
|
+
owner,
|
|
1006
|
+
repo,
|
|
1007
|
+
reservationSha,
|
|
1008
|
+
candidateSha,
|
|
1009
|
+
targetVersion,
|
|
1010
|
+
});
|
|
1011
|
+
},
|
|
995
1012
|
async listCompletedWorkflowRuns(workflowPathValue, sourceBranch) {
|
|
996
1013
|
const runs = [];
|
|
997
1014
|
for (let page = 1; page <= 10; page += 1) {
|
|
@@ -1015,7 +1032,11 @@ export function createGitHubChannelCandidateClient({
|
|
|
1015
1032
|
for (const commit of rows) {
|
|
1016
1033
|
const commitSha = text(commit.sha);
|
|
1017
1034
|
if (commitSha === targetSha) return commits;
|
|
1018
|
-
commits.push(
|
|
1035
|
+
commits.push({
|
|
1036
|
+
sha: commitSha,
|
|
1037
|
+
message: text(commit.commit?.message),
|
|
1038
|
+
parents: (commit.parents || []).map((parent) => text(parent.sha)),
|
|
1039
|
+
});
|
|
1019
1040
|
}
|
|
1020
1041
|
if (rows.length < 100) return commits;
|
|
1021
1042
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import fs from "node:fs";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { pathToFileURL } from "node:url";
|
|
6
|
+
|
|
7
|
+
import { nextDevelopmentManual } from "../packages/core/next-development-projection.js";
|
|
8
|
+
|
|
9
|
+
export const NEXT_DEVELOPMENT_MANUAL_PATH =
|
|
10
|
+
"docs/next-development-transition.md";
|
|
11
|
+
|
|
12
|
+
export function generateNextDevelopmentGuidance({
|
|
13
|
+
cwd = process.cwd(),
|
|
14
|
+
check = false,
|
|
15
|
+
} = {}) {
|
|
16
|
+
const target = path.resolve(cwd, NEXT_DEVELOPMENT_MANUAL_PATH);
|
|
17
|
+
const expected = nextDevelopmentManual();
|
|
18
|
+
const current = fs.existsSync(target) ? fs.readFileSync(target, "utf8") : "";
|
|
19
|
+
if (check) {
|
|
20
|
+
if (current !== expected) {
|
|
21
|
+
throw new Error(
|
|
22
|
+
`${NEXT_DEVELOPMENT_MANUAL_PATH} drifted from its contract source`,
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
return { ok: true, changed: false, path: NEXT_DEVELOPMENT_MANUAL_PATH };
|
|
26
|
+
}
|
|
27
|
+
fs.mkdirSync(path.dirname(target), { recursive: true });
|
|
28
|
+
if (current !== expected) fs.writeFileSync(target, expected);
|
|
29
|
+
return {
|
|
30
|
+
ok: true,
|
|
31
|
+
changed: current !== expected,
|
|
32
|
+
path: NEXT_DEVELOPMENT_MANUAL_PATH,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (
|
|
37
|
+
process.argv[1] &&
|
|
38
|
+
import.meta.url === pathToFileURL(process.argv[1]).href
|
|
39
|
+
) {
|
|
40
|
+
try {
|
|
41
|
+
const result = generateNextDevelopmentGuidance({
|
|
42
|
+
check: process.argv.includes("--check"),
|
|
43
|
+
});
|
|
44
|
+
process.stdout.write(`${JSON.stringify(result)}\n`);
|
|
45
|
+
} catch (error) {
|
|
46
|
+
process.stderr.write(`next-development guidance: ${error.message}\n`);
|
|
47
|
+
process.exitCode = 1;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -50,6 +50,10 @@ const DEV_DELIVERY_AUTHORITY_SCHEMA =
|
|
|
50
50
|
"schemas/dev-delivery-authority-v2.schema.json";
|
|
51
51
|
const DEV_DELIVERY_AUTHORITY_SCHEMA_SOURCE =
|
|
52
52
|
"contracts/dev-delivery-authority-v2.schema.json";
|
|
53
|
+
const V4_COMPATIBILITY_FACTS_SCHEMA =
|
|
54
|
+
"schemas/v4-compatibility-facts-v1.schema.json";
|
|
55
|
+
const V4_COMPATIBILITY_FACTS_SCHEMA_SOURCE =
|
|
56
|
+
"contracts/v4-compatibility-facts-v1.schema.json";
|
|
53
57
|
const root = path.resolve(import.meta.dirname, "..");
|
|
54
58
|
const outputDir = path.join(root, "dist", "site");
|
|
55
59
|
const requireFromHere = createRequire(import.meta.url);
|
|
@@ -78,9 +82,9 @@ function stableJson(value) {
|
|
|
78
82
|
}
|
|
79
83
|
|
|
80
84
|
function siteFileBytes(name, value) {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
85
|
+
if (name === DEV_DELIVERY_AUTHORITY_SCHEMA) return readText(DEV_DELIVERY_AUTHORITY_SCHEMA_SOURCE);
|
|
86
|
+
if (name === V4_COMPATIBILITY_FACTS_SCHEMA) return readText(V4_COMPATIBILITY_FACTS_SCHEMA_SOURCE);
|
|
87
|
+
return stableJson(value);
|
|
84
88
|
}
|
|
85
89
|
|
|
86
90
|
function writeSiteFile(name, value) {
|
|
@@ -383,10 +387,12 @@ const manualMetaById = new Map(Object.entries({
|
|
|
383
387
|
"release-activation-transaction": { capabilityGroup: "release-passport-trust", audience: ["release-operator", "agent"], maturity: "preview", order: 125 },
|
|
384
388
|
"release-candidate": { capabilityGroup: "reusable-build", audience: ["release-operator", "consumer"], maturity: "stable", order: 130 },
|
|
385
389
|
"release-train": { capabilityGroup: "governance-versioning", audience: ["release-operator", "consumer", "agent"], maturity: "preview", order: 132 },
|
|
390
|
+
"next-development-transition": { capabilityGroup: "governance-versioning", audience: ["release-operator", "consumer", "agent"], maturity: "preview", order: 133 },
|
|
386
391
|
"stable-candidate-patrol": { capabilityGroup: "governance-versioning", audience: ["release-operator", "consumer"], maturity: "preview", order: 135 },
|
|
387
392
|
"dev-qualification-patrol": { capabilityGroup: "governance-versioning", audience: ["release-operator", "consumer", "agent"], maturity: "preview", order: 136 },
|
|
388
393
|
"dev-alpha-candidate-patrol": { capabilityGroup: "governance-versioning", audience: ["release-operator", "consumer", "agent"], maturity: "preview", order: 137 },
|
|
389
394
|
"v4-canonical-contracts": { capabilityGroup: "governance-versioning", audience: ["developer", "maintainer", "agent"], maturity: "preview", order: 138 },
|
|
395
|
+
"v4-compatibility-facts": { capabilityGroup: "governance-versioning", audience: ["developer", "maintainer", "agent"], maturity: "preview", order: 139 },
|
|
390
396
|
"observed-evidence-patrol": { capabilityGroup: "governance-versioning", audience: ["release-operator", "consumer", "agent"], maturity: "preview", order: 140 },
|
|
391
397
|
"engineering-housekeeper": { capabilityGroup: "governance-versioning", audience: ["maintainer", "consumer", "agent"], maturity: "preview", order: 145 },
|
|
392
398
|
"reusable-build-surface": { capabilityGroup: "reusable-build", audience: ["consumer", "release-operator"], maturity: "stable", order: 200 },
|
|
@@ -753,6 +759,7 @@ function buildSiteBundle() {
|
|
|
753
759
|
"docs/reusable-build-surface.md",
|
|
754
760
|
"docs/release-candidate.md",
|
|
755
761
|
"docs/release-train.md",
|
|
762
|
+
"docs/next-development-transition.md",
|
|
756
763
|
"docs/stable-candidate-patrol.md",
|
|
757
764
|
"docs/dev-qualification-patrol.md",
|
|
758
765
|
"docs/dev-alpha-candidate-patrol.md",
|
|
@@ -948,6 +955,7 @@ function buildSiteBundle() {
|
|
|
948
955
|
"schemas/kfd-agent-hub-adoption.schema.json",
|
|
949
956
|
"schemas/kfd-product-gate-input-v1.schema.json",
|
|
950
957
|
"schemas/dev-delivery-authority-v2.schema.json",
|
|
958
|
+
"schemas/v4-compatibility-facts-v1.schema.json",
|
|
951
959
|
"kfd-support.json",
|
|
952
960
|
"artifact-evidence.json",
|
|
953
961
|
"product-mechanism.json",
|
|
@@ -983,6 +991,7 @@ function buildSiteBundle() {
|
|
|
983
991
|
"schemas/kfd-agent-hub-adoption.schema.json",
|
|
984
992
|
"schemas/kfd-product-gate-input-v1.schema.json",
|
|
985
993
|
"schemas/dev-delivery-authority-v2.schema.json",
|
|
994
|
+
"schemas/v4-compatibility-facts-v1.schema.json",
|
|
986
995
|
"buildchain-contract.json",
|
|
987
996
|
"kfd-claims.json",
|
|
988
997
|
"product-mechanism.json",
|
|
@@ -1114,6 +1123,7 @@ function buildSiteBundle() {
|
|
|
1114
1123
|
"schemas/kfd-agent-hub-adoption.schema.json",
|
|
1115
1124
|
"schemas/kfd-product-gate-input-v1.schema.json",
|
|
1116
1125
|
"schemas/dev-delivery-authority-v2.schema.json",
|
|
1126
|
+
"schemas/v4-compatibility-facts-v1.schema.json",
|
|
1117
1127
|
"buildchain-contract.json",
|
|
1118
1128
|
"kfd-upstream-aggregate.json",
|
|
1119
1129
|
"kfd-claims.json",
|
|
@@ -1291,6 +1301,9 @@ function buildSiteBundle() {
|
|
|
1291
1301
|
[DEV_DELIVERY_AUTHORITY_SCHEMA]: readJson(
|
|
1292
1302
|
DEV_DELIVERY_AUTHORITY_SCHEMA_SOURCE,
|
|
1293
1303
|
),
|
|
1304
|
+
[V4_COMPATIBILITY_FACTS_SCHEMA]: readJson(
|
|
1305
|
+
V4_COMPATIBILITY_FACTS_SCHEMA_SOURCE,
|
|
1306
|
+
),
|
|
1294
1307
|
"badge-endpoint-registry.json": badgeEndpointRegistry,
|
|
1295
1308
|
"publication-registry.json": publicationRegistry,
|
|
1296
1309
|
"buildchain-contract.json": createBuildchainContractWorld({ root, controllerRegistry }),
|
package/scripts/init-repo.mjs
CHANGED
|
@@ -4,6 +4,11 @@ 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
6
|
import { detectPackageManager, assertPackageManager } from "../packages/core/package-manager.js";
|
|
7
|
+
import {
|
|
8
|
+
appendNextDevelopmentToml,
|
|
9
|
+
mergeNextDevelopmentAgentInstructions,
|
|
10
|
+
nextDevelopmentWorkflowHeader,
|
|
11
|
+
} from "../packages/core/next-development-projection.js";
|
|
7
12
|
|
|
8
13
|
const BUILDCHAIN_WORKFLOW_REF = "kungfu-systems/buildchain/.github/workflows/.build.yml@v4";
|
|
9
14
|
const DEFAULT_PUBLICATION_LATEX_IMAGE = "ghcr.io/kungfu-systems/build-images/latex-pdf-builder";
|
|
@@ -327,7 +332,7 @@ function workflowArtifactPaths(type) {
|
|
|
327
332
|
}
|
|
328
333
|
|
|
329
334
|
function publicationWorkflowYaml() {
|
|
330
|
-
return
|
|
335
|
+
return `${nextDevelopmentWorkflowHeader()}# Commit both .buildchain/contract-lock.json and .buildchain/alpha-contract-lock.json.
|
|
331
336
|
# Persist only @v4 or @v4-alpha; pass temporary train/SHA runtimes through workflow_dispatch.
|
|
332
337
|
name: Build
|
|
333
338
|
|
|
@@ -361,7 +366,7 @@ jobs:
|
|
|
361
366
|
}
|
|
362
367
|
|
|
363
368
|
function workflowYaml({ type, runnerPreset, artifactName }) {
|
|
364
|
-
return
|
|
369
|
+
return `${nextDevelopmentWorkflowHeader()}# Buildchain v4 lifecycle checkpoints are governed by architecture/v4-platform-stage-checkpoints.json.
|
|
365
370
|
# Do not add undeclared runner-only inputs, outputs, environment, or provider effects.
|
|
366
371
|
# Commit both .buildchain/contract-lock.json and .buildchain/alpha-contract-lock.json.
|
|
367
372
|
# Persist only @v4 or @v4-alpha; pass temporary train/SHA runtimes through workflow_dispatch.
|
|
@@ -407,6 +412,13 @@ function writeIfAllowed(filePath, content, { force }) {
|
|
|
407
412
|
return filePath;
|
|
408
413
|
}
|
|
409
414
|
|
|
415
|
+
function writeManagedAgentEntry(filePath, current) {
|
|
416
|
+
const content = mergeNextDevelopmentAgentInstructions(current);
|
|
417
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
418
|
+
fs.writeFileSync(filePath, content);
|
|
419
|
+
return filePath;
|
|
420
|
+
}
|
|
421
|
+
|
|
410
422
|
export function initBuildchainRepo({
|
|
411
423
|
cwd = process.cwd(),
|
|
412
424
|
type = "package",
|
|
@@ -417,7 +429,7 @@ export function initBuildchainRepo({
|
|
|
417
429
|
} = {}) {
|
|
418
430
|
const resolvedCwd = path.resolve(cwd);
|
|
419
431
|
const manager = detectOrDefaultPackageManager(resolvedCwd, packageManager);
|
|
420
|
-
const toml = (() => {
|
|
432
|
+
const toml = appendNextDevelopmentToml((() => {
|
|
421
433
|
if (type === "package") {
|
|
422
434
|
return packageToml(resolvedCwd, manager);
|
|
423
435
|
}
|
|
@@ -437,7 +449,12 @@ export function initBuildchainRepo({
|
|
|
437
449
|
return anchoredPackageToml(resolvedCwd, manager);
|
|
438
450
|
}
|
|
439
451
|
throw new Error("init --type must be one of package, native, web-surface, infra-contract, publication-artifact, or anchored-package");
|
|
440
|
-
})();
|
|
452
|
+
})());
|
|
453
|
+
|
|
454
|
+
const agentsPath = path.join(resolvedCwd, "AGENTS.md");
|
|
455
|
+
const currentAgents = fs.existsSync(agentsPath)
|
|
456
|
+
? fs.readFileSync(agentsPath, "utf8")
|
|
457
|
+
: "";
|
|
441
458
|
|
|
442
459
|
const written = [
|
|
443
460
|
writeIfAllowed(path.join(resolvedCwd, BUILDCHAIN_CONFIG_PATH), toml, { force }),
|
|
@@ -452,6 +469,7 @@ export function initBuildchainRepo({
|
|
|
452
469
|
}),
|
|
453
470
|
{ force },
|
|
454
471
|
),
|
|
472
|
+
writeManagedAgentEntry(agentsPath, currentAgents),
|
|
455
473
|
];
|
|
456
474
|
|
|
457
475
|
if (type === "anchored-package" && !fs.existsSync(path.join(resolvedCwd, "release.json"))) {
|