@kungfu-tech/buildchain 2.12.1-alpha.2 → 2.12.1-alpha.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.
- package/bin/buildchain.mjs +18 -0
- package/dist/site/buildchain-contract.json +5 -5
- package/dist/site/buildchain-site.json +23 -13
- package/dist/site/capability-registry.json +1 -1
- package/dist/site/cli-registry.json +12 -0
- package/dist/site/kfd-claims.json +71 -7
- package/dist/site/kfd-upstream-aggregate.json +1 -1
- package/dist/site/manual-registry.json +3 -3
- package/dist/site/node-api-registry.json +7 -7
- package/dist/site/page-registry.json +16 -6
- package/dist/site/public-surface-audit.json +29 -4
- package/dist/site/publication-registry.json +4 -4
- package/dist/site/site-manifest.json +7 -7
- package/docs/binary-distribution.md +20 -1
- package/docs/cli.md +17 -0
- package/docs/kfd-support.md +44 -1
- package/package.json +2 -1
- package/packages/core/buildchain-kfd-claims.js +51 -2
- package/packages/core/buildchain-layout.js +46 -0
- package/packages/core/index.js +4 -0
- package/packages/core/kfd3-surface-register.js +59 -2
- package/scripts/build-standalone-binary.mjs +2 -1
- package/scripts/check-inventory.mjs +2 -1
- package/scripts/generate-site-bundle.mjs +2 -1
- package/scripts/init-repo.mjs +1 -1
- package/scripts/npm-publish-dry-run.mjs +1 -1
- package/scripts/publication-artifact.mjs +1 -1
- package/scripts/publication-package.mjs +1 -1
- package/scripts/release-propagation.mjs +1 -1
package/docs/cli.md
CHANGED
|
@@ -77,6 +77,7 @@ import { verifyReleasePassport } from "@kungfu-tech/buildchain/release-passport"
|
|
|
77
77
|
import { createReleasePropagationPlan } from "@kungfu-tech/buildchain/release-propagation";
|
|
78
78
|
import { planReleaseLineBootstrap } from "@kungfu-tech/buildchain/release-line-bootstrap";
|
|
79
79
|
import { collectPublicSurfaceReverseAudit } from "@kungfu-tech/buildchain/public-surface-audit";
|
|
80
|
+
import { createBuildchainLayoutDiscovery } from "@kungfu-tech/buildchain/buildchain-layout";
|
|
80
81
|
import contractWorld from "@kungfu-tech/buildchain/site/buildchain-contract.json" with { type: "json" };
|
|
81
82
|
import capabilityRegistry from "@kungfu-tech/buildchain/site/capability-registry.json" with { type: "json" };
|
|
82
83
|
import manualRegistry from "@kungfu-tech/buildchain/site/manual-registry.json" with { type: "json" };
|
|
@@ -90,6 +91,22 @@ floating-ref contract world for a runtime such as `@v2`.
|
|
|
90
91
|
|
|
91
92
|
## Commands
|
|
92
93
|
|
|
94
|
+
`buildchain layout` is the stable machine question for repository layout. Tools
|
|
95
|
+
such as Shifu should call it instead of copying `.buildchain/` path constants:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
buildchain layout --cwd /path/to/repository --json
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
The result identifies the Buildchain version pin, repository root and config,
|
|
102
|
+
the canonical and currently resolved KFD-3 registry paths, and the KFD field
|
|
103
|
+
used to declare Shifu jurisdiction. A repository is in Shifu's distribution
|
|
104
|
+
jurisdiction only when a KFD-3 surface explicitly declares
|
|
105
|
+
`distribution.registrar="shifu"`; the presence of Buildchain configuration is
|
|
106
|
+
not sufficient. The same contract is available through
|
|
107
|
+
`createBuildchainLayoutDiscovery()` from
|
|
108
|
+
`@kungfu-tech/buildchain/buildchain-layout`.
|
|
109
|
+
|
|
93
110
|
`buildchain init` writes a starter `.buildchain/buildchain.toml` and a reusable workflow
|
|
94
111
|
caller at `.github/workflows/build.yml`.
|
|
95
112
|
|
package/docs/kfd-support.md
CHANGED
|
@@ -279,6 +279,49 @@ detect standard public surfaces, write a small product-owned registry, audit the
|
|
|
279
279
|
registry against the current artifact/source tree, generate a release-passport
|
|
280
280
|
compatible witness, and query the resulting capability map.
|
|
281
281
|
|
|
282
|
+
## Shifu Discovery and Distribution Declarations
|
|
283
|
+
|
|
284
|
+
Buildchain owns the repository-layout question; product tools must not copy its
|
|
285
|
+
internal paths. Shifu and other consumers use this sequence:
|
|
286
|
+
|
|
287
|
+
1. read the welded `.buildchain-version` pin to select Buildchain;
|
|
288
|
+
2. run `buildchain layout --cwd <repository> --json`;
|
|
289
|
+
3. read the returned `kfd.registries["kfd-3"].path`;
|
|
290
|
+
4. treat a surface as Shifu-managed only when its declaration contains
|
|
291
|
+
`distribution.registrar="shifu"`.
|
|
292
|
+
|
|
293
|
+
The layout response uses the
|
|
294
|
+
`kungfu-buildchain-layout-discovery` contract with an explicit schema version.
|
|
295
|
+
Changing or removing its fields is a public contract change. Consumers must not
|
|
296
|
+
fall back to a hard-coded registry location when the command is unavailable or
|
|
297
|
+
returns an unsupported contract.
|
|
298
|
+
|
|
299
|
+
A Shifu distribution declaration must contain at least one task and one
|
|
300
|
+
artifact. Every artifact declares `kind`, `platform`, and `pathGlob`; an
|
|
301
|
+
optional `sha256` is a lowercase 64-character hexadecimal digest. This makes
|
|
302
|
+
artifact form and platform machine-readable without asking Shifu to infer them
|
|
303
|
+
from filenames:
|
|
304
|
+
|
|
305
|
+
```json
|
|
306
|
+
{
|
|
307
|
+
"distribution": {
|
|
308
|
+
"registrar": "shifu",
|
|
309
|
+
"tasks": ["binary:build"],
|
|
310
|
+
"artifacts": [
|
|
311
|
+
{
|
|
312
|
+
"kind": "binary",
|
|
313
|
+
"platform": "linux",
|
|
314
|
+
"pathGlob": "dist/binary/example-x86_64-unknown-linux-gnu.tar.gz"
|
|
315
|
+
}
|
|
316
|
+
]
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
Buildchain validates this shape whenever a KFD-3 registry is read or written.
|
|
322
|
+
Repositories that do not declare the registrar remain outside Shifu's
|
|
323
|
+
distribution jurisdiction.
|
|
324
|
+
|
|
282
325
|
## Detected, Declared, Enforced
|
|
283
326
|
|
|
284
327
|
KFD-3 surface registration uses three states.
|
|
@@ -402,7 +445,7 @@ Buildchain dogfoods this model in two ways:
|
|
|
402
445
|
`buildchain kfd 2 trust-assessment --json` expose and validate the KFD
|
|
403
446
|
package's foundation KFD-2 trust facts against the latest KFD taxonomy;
|
|
404
447
|
- `dist/site/kfd-claims.json` declares Buildchain's own KFD-3 collaboration
|
|
405
|
-
interface;
|
|
448
|
+
interface, including a Shifu-owned standalone binary distribution surface;
|
|
406
449
|
- `buildchain kfd 3 query buildchain --json` resolves the packaged
|
|
407
450
|
Buildchain capability map from that site fact source.
|
|
408
451
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kungfu-tech/buildchain",
|
|
3
|
-
"version": "2.12.1-alpha.
|
|
3
|
+
"version": "2.12.1-alpha.4",
|
|
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",
|
|
@@ -84,6 +84,7 @@
|
|
|
84
84
|
"check:site": "node scripts/generate-site-bundle.mjs --check",
|
|
85
85
|
"test:unit": "node --test tests/*.test.mjs",
|
|
86
86
|
"build": "pnpm -r --filter \"./actions/**\" build",
|
|
87
|
+
"binary:build": "node scripts/build-standalone-binary.mjs",
|
|
87
88
|
"package": "npm pack --dry-run --json --registry=https://registry.npmjs.org/",
|
|
88
89
|
"pack:check": "npm pack --dry-run --json --registry=https://registry.npmjs.org/"
|
|
89
90
|
},
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
BUILDCHAIN_PUBLIC_SURFACE_AUDIT_CONTRACT,
|
|
7
7
|
collectPublicSurfaceReverseAudit,
|
|
8
8
|
} from "./public-surface-audit.js";
|
|
9
|
+
import { normalizeKfd3DistributionDeclaration } from "./kfd3-surface-register.js";
|
|
9
10
|
|
|
10
11
|
export const BUILDCHAIN_KFD_CLAIM_REGISTRY_CONTRACT = "kungfu-buildchain-kfd-claim-registry";
|
|
11
12
|
export const BUILDCHAIN_KFD_COLLABORATION_INTERFACE_CONTRACT = "kungfu-buildchain-kfd-collaboration-interface";
|
|
@@ -307,6 +308,23 @@ export function createBuildchainPublicClaimDefinitions() {
|
|
|
307
308
|
"dist/site/public-surface-audit.json",
|
|
308
309
|
],
|
|
309
310
|
},
|
|
311
|
+
{
|
|
312
|
+
id: "claim:buildchain-shifu-kfd-discovery",
|
|
313
|
+
claim: "Buildchain exposes a versioned repository-layout discovery contract and KFD-3 distribution declarations so Shifu can locate the registry and determine jurisdiction without copying Buildchain layout paths.",
|
|
314
|
+
sourcePaths: [
|
|
315
|
+
"packages/core/buildchain-layout.js",
|
|
316
|
+
"packages/core/buildchain-kfd-claims.js",
|
|
317
|
+
"packages/core/kfd3-surface-register.js",
|
|
318
|
+
"bin/buildchain.mjs",
|
|
319
|
+
"scripts/build-standalone-binary.mjs",
|
|
320
|
+
"docs/kfd-support.md",
|
|
321
|
+
],
|
|
322
|
+
artifactPaths: [
|
|
323
|
+
"dist/site/kfd-claims.json",
|
|
324
|
+
"dist/site/cli-registry.json",
|
|
325
|
+
"dist/site/node-api-registry.json",
|
|
326
|
+
],
|
|
327
|
+
},
|
|
310
328
|
{
|
|
311
329
|
id: "claim:buildchain-readme-badge-facts",
|
|
312
330
|
claim: "Buildchain README status badges are generated from repository-owned facts and verified release-passport evidence, not hand-maintained README prose.",
|
|
@@ -431,6 +449,37 @@ export function createBuildchainKfdSurfaceRegistry({ root = process.cwd() } = {}
|
|
|
431
449
|
];
|
|
432
450
|
const siteConsumptionContracts = SITE_CONTRACT_FILES.map((relPath) => surface(`site:${relPath}`, "site-consumption-contract", relPath));
|
|
433
451
|
const controlSurfaces = WORKFLOW_AND_ACTION_FILES.map((relPath) => surface(`control:${relPath}`, relPath.includes("actions/") ? "action" : "workflow", relPath));
|
|
452
|
+
const standaloneDistribution = surface(
|
|
453
|
+
"distribution:buildchain-standalone",
|
|
454
|
+
"binary-distribution",
|
|
455
|
+
"scripts/build-standalone-binary.mjs",
|
|
456
|
+
{
|
|
457
|
+
name: "Buildchain standalone binary distribution",
|
|
458
|
+
artifactPath: "dist/binary",
|
|
459
|
+
evidencePath: ".github/workflows/binary-distribution.yml",
|
|
460
|
+
distribution: normalizeKfd3DistributionDeclaration({
|
|
461
|
+
registrar: "shifu",
|
|
462
|
+
tasks: ["binary:build"],
|
|
463
|
+
artifacts: [
|
|
464
|
+
{
|
|
465
|
+
kind: "binary",
|
|
466
|
+
platform: "linux",
|
|
467
|
+
pathGlob: "dist/binary/buildchain-x86_64-unknown-linux-gnu.tar.gz",
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
kind: "binary",
|
|
471
|
+
platform: "macos",
|
|
472
|
+
pathGlob: "dist/binary/buildchain-aarch64-apple-darwin.tar.gz",
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
kind: "binary",
|
|
476
|
+
platform: "windows",
|
|
477
|
+
pathGlob: "dist/binary/buildchain-x86_64-pc-windows-msvc.zip",
|
|
478
|
+
},
|
|
479
|
+
],
|
|
480
|
+
}, { surfaceId: "distribution:buildchain-standalone" }),
|
|
481
|
+
},
|
|
482
|
+
);
|
|
434
483
|
const reverseEnumeratedSurfaces = uniqueById([
|
|
435
484
|
...reverseAudit.enumerated.cliCommands.map((entry) => surface(`cli:${entry.id}`, "cli-command", "bin/buildchain.mjs", {
|
|
436
485
|
name: entry.usage,
|
|
@@ -463,8 +512,8 @@ export function createBuildchainKfdSurfaceRegistry({ root = process.cwd() } = {}
|
|
|
463
512
|
siteConsumptionContracts,
|
|
464
513
|
reverseEnumeratedSurfaces,
|
|
465
514
|
},
|
|
466
|
-
additionalSurfaces: controlSurfaces,
|
|
467
|
-
publicSurfaceCount: docs.length + schemas.length + standardsMetadata.length + exports.length + siteConsumptionContracts.length + reverseEnumeratedSurfaces.length + controlSurfaces.length,
|
|
515
|
+
additionalSurfaces: [...controlSurfaces, standaloneDistribution],
|
|
516
|
+
publicSurfaceCount: docs.length + schemas.length + standardsMetadata.length + exports.length + siteConsumptionContracts.length + reverseEnumeratedSurfaces.length + controlSurfaces.length + 1,
|
|
468
517
|
};
|
|
469
518
|
}
|
|
470
519
|
|
|
@@ -2,6 +2,8 @@ import fs from "node:fs";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
|
|
4
4
|
export const BUILDCHAIN_DIR = ".buildchain";
|
|
5
|
+
export const BUILDCHAIN_VERSION_PIN_PATH = ".buildchain-version";
|
|
6
|
+
export const BUILDCHAIN_LAYOUT_DISCOVERY_CONTRACT = "kungfu-buildchain-layout-discovery";
|
|
5
7
|
export const BUILDCHAIN_CONFIG_PATH = ".buildchain/buildchain.toml";
|
|
6
8
|
export const LEGACY_BUILDCHAIN_CONFIG_PATH = "buildchain.toml";
|
|
7
9
|
export const BUILDCHAIN_CONTRACT_LOCK_PATH = ".buildchain/contract-lock.json";
|
|
@@ -94,6 +96,50 @@ export function resolveReleasePassportPath(cwd = process.cwd()) {
|
|
|
94
96
|
]);
|
|
95
97
|
}
|
|
96
98
|
|
|
99
|
+
export function createBuildchainLayoutDiscovery({
|
|
100
|
+
cwd = process.cwd(),
|
|
101
|
+
buildchainVersion = "",
|
|
102
|
+
} = {}) {
|
|
103
|
+
const resolvedCwd = path.resolve(cwd);
|
|
104
|
+
const configPath = resolveBuildchainConfigPath(resolvedCwd);
|
|
105
|
+
const kfd3RegistryPath = resolveKfd3SurfaceRegistryPath(resolvedCwd);
|
|
106
|
+
return {
|
|
107
|
+
schemaVersion: 1,
|
|
108
|
+
contract: BUILDCHAIN_LAYOUT_DISCOVERY_CONTRACT,
|
|
109
|
+
buildchain: {
|
|
110
|
+
version: String(buildchainVersion || ""),
|
|
111
|
+
versionPinPath: BUILDCHAIN_VERSION_PIN_PATH,
|
|
112
|
+
},
|
|
113
|
+
repository: {
|
|
114
|
+
root: resolvedCwd,
|
|
115
|
+
managed: fs.existsSync(repoPath(resolvedCwd, configPath))
|
|
116
|
+
|| fs.existsSync(repoPath(resolvedCwd, BUILDCHAIN_VERSION_PIN_PATH))
|
|
117
|
+
|| fs.existsSync(repoPath(resolvedCwd, kfd3RegistryPath)),
|
|
118
|
+
configPath,
|
|
119
|
+
},
|
|
120
|
+
kfd: {
|
|
121
|
+
root: BUILDCHAIN_KFD_ROOT,
|
|
122
|
+
registries: {
|
|
123
|
+
"kfd-3": {
|
|
124
|
+
standard: "kfd-3",
|
|
125
|
+
schemaVersion: 1,
|
|
126
|
+
path: kfd3RegistryPath,
|
|
127
|
+
canonicalPath: BUILDCHAIN_KFD3_SURFACE_REGISTRY_PATH,
|
|
128
|
+
exists: fs.existsSync(repoPath(resolvedCwd, kfd3RegistryPath)),
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
shifu: {
|
|
133
|
+
jurisdiction: {
|
|
134
|
+
source: "kfd-3-distribution-declaration",
|
|
135
|
+
registryStandard: "kfd-3",
|
|
136
|
+
field: "surfaces[].distribution.registrar",
|
|
137
|
+
value: "shifu",
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
97
143
|
export function discoverBuildchainRepoFiles(cwd = process.cwd()) {
|
|
98
144
|
const files = [
|
|
99
145
|
{
|
package/packages/core/index.js
CHANGED
|
@@ -292,6 +292,8 @@ export {
|
|
|
292
292
|
BUILDCHAIN_CONFIG_PATH,
|
|
293
293
|
BUILDCHAIN_CONTRACT_LOCK_PATH,
|
|
294
294
|
BUILDCHAIN_DIR,
|
|
295
|
+
BUILDCHAIN_LAYOUT_DISCOVERY_CONTRACT,
|
|
296
|
+
BUILDCHAIN_VERSION_PIN_PATH,
|
|
295
297
|
BUILDCHAIN_GENERATED_DIRS,
|
|
296
298
|
BUILDCHAIN_KFD_ROOT,
|
|
297
299
|
BUILDCHAIN_KFD1_CONTRACT_WORLD_WITNESS_PATH,
|
|
@@ -317,6 +319,7 @@ export {
|
|
|
317
319
|
LEGACY_BUILDCHAIN_KFD3_SURFACE_REGISTRY_PATHS,
|
|
318
320
|
LEGACY_BUILDCHAIN_RELEASE_PASSPORT_PATH,
|
|
319
321
|
discoverBuildchainRepoFiles,
|
|
322
|
+
createBuildchainLayoutDiscovery,
|
|
320
323
|
migrateBuildchainLayout,
|
|
321
324
|
planBuildchainLayoutMigration,
|
|
322
325
|
resolveBuildchainConfigPath,
|
|
@@ -359,6 +362,7 @@ export {
|
|
|
359
362
|
auditKfd3Surfaces,
|
|
360
363
|
createKfd3SurfaceWitness,
|
|
361
364
|
detectKfd3Surfaces,
|
|
365
|
+
normalizeKfd3DistributionDeclaration,
|
|
362
366
|
queryKfd3Capabilities,
|
|
363
367
|
readKfd3SurfaceRegistry,
|
|
364
368
|
registerKfd3Surfaces,
|
|
@@ -67,6 +67,63 @@ function normalizeKinds(kinds = []) {
|
|
|
67
67
|
return [...new Set(selected.map(normalizeKind))].sort();
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
export function normalizeKfd3DistributionDeclaration(distribution, { surfaceId = "surface" } = {}) {
|
|
71
|
+
if (!distribution || typeof distribution !== "object" || Array.isArray(distribution)) {
|
|
72
|
+
throw new Error(`KFD-3 surface ${surfaceId} distribution must be an object`);
|
|
73
|
+
}
|
|
74
|
+
const registrar = String(distribution.registrar || "").trim();
|
|
75
|
+
if (!registrar) {
|
|
76
|
+
throw new Error(`KFD-3 surface ${surfaceId} distribution.registrar is required`);
|
|
77
|
+
}
|
|
78
|
+
const tasks = Array.isArray(distribution.tasks)
|
|
79
|
+
? [...new Set(distribution.tasks.map((entry) => String(entry || "").trim()).filter(Boolean))]
|
|
80
|
+
: [];
|
|
81
|
+
if (tasks.length === 0) {
|
|
82
|
+
throw new Error(`KFD-3 surface ${surfaceId} distribution.tasks must contain at least one task`);
|
|
83
|
+
}
|
|
84
|
+
const sourceArtifacts = Array.isArray(distribution.artifacts) ? distribution.artifacts : [];
|
|
85
|
+
if (sourceArtifacts.length === 0) {
|
|
86
|
+
throw new Error(`KFD-3 surface ${surfaceId} distribution.artifacts must contain at least one artifact`);
|
|
87
|
+
}
|
|
88
|
+
const artifacts = sourceArtifacts.map((artifact, index) => {
|
|
89
|
+
if (!artifact || typeof artifact !== "object" || Array.isArray(artifact)) {
|
|
90
|
+
throw new Error(`KFD-3 surface ${surfaceId} distribution.artifacts[${index}] must be an object`);
|
|
91
|
+
}
|
|
92
|
+
const normalized = {
|
|
93
|
+
...artifact,
|
|
94
|
+
kind: String(artifact.kind || "").trim(),
|
|
95
|
+
platform: String(artifact.platform || "").trim(),
|
|
96
|
+
pathGlob: String(artifact.pathGlob || "").trim(),
|
|
97
|
+
};
|
|
98
|
+
for (const field of ["kind", "platform", "pathGlob"]) {
|
|
99
|
+
if (!normalized[field]) {
|
|
100
|
+
throw new Error(`KFD-3 surface ${surfaceId} distribution.artifacts[${index}].${field} is required`);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (artifact.sha256 !== undefined) {
|
|
104
|
+
normalized.sha256 = String(artifact.sha256 || "").trim().toLowerCase();
|
|
105
|
+
if (!/^[a-f0-9]{64}$/.test(normalized.sha256)) {
|
|
106
|
+
throw new Error(`KFD-3 surface ${surfaceId} distribution.artifacts[${index}].sha256 must be 64 lowercase hex characters`);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return normalized;
|
|
110
|
+
});
|
|
111
|
+
return {
|
|
112
|
+
...distribution,
|
|
113
|
+
registrar,
|
|
114
|
+
tasks,
|
|
115
|
+
artifacts,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function normalizeRegistrySurface(entry) {
|
|
120
|
+
if (!entry?.distribution) return entry;
|
|
121
|
+
return {
|
|
122
|
+
...entry,
|
|
123
|
+
distribution: normalizeKfd3DistributionDeclaration(entry.distribution, { surfaceId: entry.id || "surface" }),
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
|
|
70
127
|
function stableId(value) {
|
|
71
128
|
return String(value || "")
|
|
72
129
|
.toLowerCase()
|
|
@@ -366,7 +423,7 @@ export function readKfd3SurfaceRegistry({ cwd = process.cwd(), registryPath = ""
|
|
|
366
423
|
contract: registry.contract || KFD3_SURFACE_REGISTRY_CONTRACT,
|
|
367
424
|
product: registry.product || {},
|
|
368
425
|
registryPath: registry.registryPath || effectiveRegistryPath,
|
|
369
|
-
surfaces: Array.isArray(registry.surfaces) ? registry.surfaces : [],
|
|
426
|
+
surfaces: Array.isArray(registry.surfaces) ? registry.surfaces.map(normalizeRegistrySurface) : [],
|
|
370
427
|
policy: registry.policy || {},
|
|
371
428
|
};
|
|
372
429
|
}
|
|
@@ -379,7 +436,7 @@ export function writeKfd3SurfaceRegistry({ cwd = process.cwd(), registryPath = "
|
|
|
379
436
|
product: registry.product || {},
|
|
380
437
|
registryPath: effectiveRegistryPath,
|
|
381
438
|
surfaces: uniqueSurfaces(registry.surfaces || []).map((entry) => ({
|
|
382
|
-
...entry,
|
|
439
|
+
...normalizeRegistrySurface(entry),
|
|
383
440
|
state: entry.state || "declared",
|
|
384
441
|
declaration: entry.declaration || {
|
|
385
442
|
owner: "product",
|
|
@@ -176,9 +176,10 @@ function bundleCli({ cwd, tempDir, version, logger }) {
|
|
|
176
176
|
sourcemap: false,
|
|
177
177
|
dts: false,
|
|
178
178
|
shims: true,
|
|
179
|
-
noExternal: ["smol-toml"],
|
|
179
|
+
noExternal: ["smol-toml", /^@kungfu-tech\\/kfd(?:\\/|$)/],
|
|
180
180
|
define: {
|
|
181
181
|
"process.env.BUILDCHAIN_EMBEDDED_PACKAGE_VERSION": ${JSON.stringify(JSON.stringify(version || packageVersion(cwd)))},
|
|
182
|
+
"process.env.BUILDCHAIN_EMBEDDED_ENTRYPOINT": ${JSON.stringify(JSON.stringify("1"))},
|
|
182
183
|
},
|
|
183
184
|
};
|
|
184
185
|
`);
|
|
@@ -732,7 +732,8 @@ for (const requiredSnippet of [
|
|
|
732
732
|
"../packages/core/logging.js",
|
|
733
733
|
"standalone.cli-bundle.create",
|
|
734
734
|
"BUILDCHAIN_EMBEDDED_PACKAGE_VERSION",
|
|
735
|
-
"
|
|
735
|
+
"BUILDCHAIN_EMBEDDED_ENTRYPOINT",
|
|
736
|
+
"noExternal: [\"smol-toml\",",
|
|
736
737
|
"--macho-segment-name",
|
|
737
738
|
"mainFormat: \"commonjs\"",
|
|
738
739
|
"standalone.sea-blob.create",
|
|
@@ -395,6 +395,7 @@ function cliCommandMeta(id) {
|
|
|
395
395
|
"inspect-artifact": { group: "release-passport-trust", purpose: "Inspect artifact evidence." },
|
|
396
396
|
"inspect-release": { group: "release-passport-trust", purpose: "Inspect release passport evidence." },
|
|
397
397
|
kfd: { group: "kfd-trust", purpose: "Inspect KFD standards, schemas, and versioned KFD command families." },
|
|
398
|
+
layout: { group: "kfd-trust", purpose: "Return the versioned repository-layout and KFD registry discovery contract for tools such as Shifu." },
|
|
398
399
|
"kfd-schema": { group: "kfd-trust", purpose: "Inspect KFD schema command families." },
|
|
399
400
|
"kfd-schema-list": { group: "kfd-trust", purpose: "List machine-readable schemas exposed by the KFD package standards metadata." },
|
|
400
401
|
"kfd-schema-show": { group: "kfd-trust", purpose: "Print a machine-readable KFD schema from the KFD package standards metadata." },
|
|
@@ -479,7 +480,7 @@ function nodeApiMeta(exportName) {
|
|
|
479
480
|
"./buildchain-contract": { group: "governance-versioning", summary: "Runtime contract world and compatibility digest APIs for floating-ref drift checks." },
|
|
480
481
|
"./surface-manifest": { group: "site-and-propagation", summary: "Surface manifest timestamp and reproducibility policy APIs." },
|
|
481
482
|
"./issue-reporting": { group: "observability-diagnostics", summary: "Buildchain-owned issue reporting API for workflow friction feedback." },
|
|
482
|
-
"./buildchain-layout": { group: "kfd-trust", summary: "
|
|
483
|
+
"./buildchain-layout": { group: "kfd-trust", summary: "Versioned Buildchain repository-layout discovery contract plus canonical .buildchain path resolution and migration APIs." },
|
|
483
484
|
"./kfd": { group: "kfd-trust", summary: "Unified KFD standards, schema discovery, KFD-1/KFD-2/KFD-3 grouped APIs, KFD-4 schema discovery, upstream KFD aggregate facts, and Buildchain KFD claim helpers." },
|
|
484
485
|
"./public-surface-audit": { group: "kfd-trust", summary: "Reverse audit APIs for CLI, workflow, action, site page, and documentation command surfaces." },
|
|
485
486
|
"./kfd-gate": { group: "kfd-trust", summary: "KFD-1/KFD-2/KFD-3 release gate evidence and validation APIs." },
|
package/scripts/init-repo.mjs
CHANGED
|
@@ -477,7 +477,7 @@ function readArg(name, fallback = "") {
|
|
|
477
477
|
return process.argv[index + 1] || "";
|
|
478
478
|
}
|
|
479
479
|
|
|
480
|
-
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
480
|
+
if (!process.env.BUILDCHAIN_EMBEDDED_ENTRYPOINT && process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
481
481
|
try {
|
|
482
482
|
const result = initBuildchainRepo({
|
|
483
483
|
cwd: readArg("cwd", process.cwd()),
|
|
@@ -155,7 +155,7 @@ function usage() {
|
|
|
155
155
|
`;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
158
|
+
if (!process.env.BUILDCHAIN_EMBEDDED_ENTRYPOINT && process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
159
159
|
try {
|
|
160
160
|
const argv = process.argv.slice(2);
|
|
161
161
|
if (hasFlag(argv, "help") || hasFlag(argv, "h")) {
|
|
@@ -57,7 +57,7 @@ export function runPublicationArtifactCli(args = process.argv.slice(2)) {
|
|
|
57
57
|
return result;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
60
|
+
if (!process.env.BUILDCHAIN_EMBEDDED_ENTRYPOINT && process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
61
61
|
try {
|
|
62
62
|
runPublicationArtifactCli();
|
|
63
63
|
} catch (error) {
|
|
@@ -28,7 +28,7 @@ export function runPublicationPackageCli(args = process.argv.slice(2)) {
|
|
|
28
28
|
return result;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
31
|
+
if (!process.env.BUILDCHAIN_EMBEDDED_ENTRYPOINT && process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
32
32
|
try {
|
|
33
33
|
runPublicationPackageCli();
|
|
34
34
|
} catch (error) {
|
|
@@ -93,6 +93,6 @@ export function runReleasePropagationCli(argv = process.argv.slice(2)) {
|
|
|
93
93
|
throw new Error(`unsupported release-propagation command: ${mode}`);
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
96
|
+
if (!process.env.BUILDCHAIN_EMBEDDED_ENTRYPOINT && process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
97
97
|
runReleasePropagationCli();
|
|
98
98
|
}
|