@kungfu-tech/buildchain 2.10.2 → 2.10.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.
@@ -205,11 +205,15 @@ function sitePage(relPath, category, routePrefix, extra = {}) {
205
205
  const slug = extra.slug || (baseName.toLowerCase() === "readme" ? slugify(parentName) : slugify(baseName));
206
206
  const route = extra.route || `${routePrefix}/${slug}`;
207
207
  const title = markdownTitle(markdown, extra.title || slug);
208
+ const meta = pageCapabilityMeta(relPath, category);
208
209
  return {
209
210
  id: extra.id || `${category}:${slug}`,
210
211
  title,
211
212
  route,
212
213
  category,
214
+ capabilityGroup: meta.capabilityGroup,
215
+ audience: meta.audience,
216
+ maturity: meta.maturity,
213
217
  sourcePath: relPath,
214
218
  digest: sha256File(relPath),
215
219
  headings: markdownHeadings(markdown),
@@ -218,6 +222,292 @@ function sitePage(relPath, category, routePrefix, extra = {}) {
218
222
  };
219
223
  }
220
224
 
225
+ const CAPABILITY_GROUPS = Object.freeze([
226
+ {
227
+ id: "getting-started",
228
+ title: "Getting Started",
229
+ summary: "Install Buildchain, understand the product mechanism, and choose the right entrypoint.",
230
+ audience: ["consumer", "agent"],
231
+ maturity: "stable",
232
+ },
233
+ {
234
+ id: "release-passport-trust",
235
+ title: "Release Passport and Trust",
236
+ summary: "Create, verify, explain, and publish release passports, KFD trust evidence, GitHub Releases, and binary assets.",
237
+ audience: ["release-operator", "agent"],
238
+ maturity: "stable",
239
+ },
240
+ {
241
+ id: "reusable-build",
242
+ title: "Reusable Build and Lifecycle",
243
+ summary: "Run reusable package/native builds, lifecycle stages, release candidates, source locks, and self-hosted artifact transfer.",
244
+ audience: ["consumer", "release-operator"],
245
+ maturity: "stable",
246
+ },
247
+ {
248
+ id: "kfd-trust",
249
+ title: "KFD Trust and Surface Closure",
250
+ summary: "Discover KFD-1, KFD-2, and KFD-3 support, public surface reverse audits, and product capability queries.",
251
+ audience: ["agent", "maintainer"],
252
+ maturity: "stable",
253
+ },
254
+ {
255
+ id: "site-and-propagation",
256
+ title: "Site Bundle, Web Surfaces, and Propagation",
257
+ summary: "Publish package-owned site facts, web-surface previews/staging/production, and downstream release propagation.",
258
+ audience: ["site", "release-operator", "agent"],
259
+ maturity: "stable",
260
+ },
261
+ {
262
+ id: "distribution-indexes",
263
+ title: "Distribution Indexes and Badges",
264
+ summary: "Generate README badge facts and distribution-index projections such as Homebrew taps from release passport evidence.",
265
+ audience: ["consumer", "site", "agent"],
266
+ maturity: "stable",
267
+ },
268
+ {
269
+ id: "observability-diagnostics",
270
+ title: "Build Facts, Observability, and Diagnostics",
271
+ summary: "Collect source/module/product facts, lifecycle logs, diagnostics summaries, and process-tree evidence.",
272
+ audience: ["maintainer", "agent"],
273
+ maturity: "stable",
274
+ },
275
+ {
276
+ id: "governance-versioning",
277
+ title: "Governance, Versioning, and Runtime Drift",
278
+ summary: "Operate protected dev lines, semver line bootstrap, runtime trains, floating-ref contract locks, and ownership boundaries.",
279
+ audience: ["maintainer", "release-operator"],
280
+ maturity: "stable",
281
+ },
282
+ {
283
+ id: "api-cli-reference",
284
+ title: "CLI and Node API Reference",
285
+ summary: "Enumerate supported CLI commands, Node package exports, workflow/action inputs, and packaged manuals.",
286
+ audience: ["agent", "developer"],
287
+ maturity: "stable",
288
+ },
289
+ ]);
290
+
291
+ const CAPABILITY_GROUP_BY_ID = new Map(CAPABILITY_GROUPS.map((group) => [group.id, group]));
292
+
293
+ function capabilityGroup(id) {
294
+ if (!CAPABILITY_GROUP_BY_ID.has(id)) {
295
+ throw new Error(`unknown capability group: ${id}`);
296
+ }
297
+ return id;
298
+ }
299
+
300
+ const manualMetaById = new Map(Object.entries({
301
+ map: { capabilityGroup: "getting-started", audience: ["agent", "consumer"], maturity: "stable", order: 10 },
302
+ install: { capabilityGroup: "getting-started", audience: ["consumer"], maturity: "stable", order: 20 },
303
+ "product-mechanism": { capabilityGroup: "getting-started", audience: ["agent", "maintainer"], maturity: "stable", order: 30 },
304
+ cli: { capabilityGroup: "api-cli-reference", audience: ["agent", "developer"], maturity: "stable", order: 40 },
305
+ "release-passport": { capabilityGroup: "release-passport-trust", audience: ["release-operator", "agent"], maturity: "stable", order: 100 },
306
+ "binary-distribution": { capabilityGroup: "release-passport-trust", audience: ["release-operator", "agent"], maturity: "stable", order: 110 },
307
+ "publish-transaction": { capabilityGroup: "release-passport-trust", audience: ["release-operator"], maturity: "stable", order: 120 },
308
+ "release-candidate": { capabilityGroup: "reusable-build", audience: ["release-operator", "consumer"], maturity: "stable", order: 130 },
309
+ "reusable-build-surface": { capabilityGroup: "reusable-build", audience: ["consumer", "release-operator"], maturity: "stable", order: 200 },
310
+ "lifecycle-protocol": { capabilityGroup: "reusable-build", audience: ["consumer", "developer"], maturity: "stable", order: 210 },
311
+ "runtime-train-validation": { capabilityGroup: "governance-versioning", audience: ["maintainer", "consumer"], maturity: "stable", order: 220 },
312
+ "kfd-support": { capabilityGroup: "kfd-trust", audience: ["agent", "maintainer"], maturity: "stable", order: 300 },
313
+ "site-bundle-contract": { capabilityGroup: "site-and-propagation", audience: ["site", "agent"], maturity: "stable", order: 400 },
314
+ "web-surface-deployments": { capabilityGroup: "site-and-propagation", audience: ["site", "release-operator"], maturity: "stable", order: 410 },
315
+ "release-propagation": { capabilityGroup: "site-and-propagation", audience: ["release-operator", "agent"], maturity: "preview", order: 420 },
316
+ "readme-badges": { capabilityGroup: "distribution-indexes", audience: ["consumer", "site"], maturity: "stable", order: 500 },
317
+ homebrew: { capabilityGroup: "distribution-indexes", audience: ["consumer", "release-operator"], maturity: "stable", order: 510 },
318
+ "build-facts": { capabilityGroup: "observability-diagnostics", audience: ["maintainer", "agent"], maturity: "stable", order: 600 },
319
+ "toolkit-observability": { capabilityGroup: "observability-diagnostics", audience: ["developer", "maintainer"], maturity: "stable", order: 610 },
320
+ "consumer-issue-reporting": { capabilityGroup: "observability-diagnostics", audience: ["consumer", "maintainer"], maturity: "stable", order: 620 },
321
+ "release-governance": { capabilityGroup: "governance-versioning", audience: ["maintainer", "release-operator"], maturity: "stable", order: 700 },
322
+ "release-flow": { capabilityGroup: "governance-versioning", audience: ["release-operator", "agent"], maturity: "stable", order: 710 },
323
+ versioning: { capabilityGroup: "governance-versioning", audience: ["maintainer"], maturity: "stable", order: 720 },
324
+ ownership: { capabilityGroup: "governance-versioning", audience: ["maintainer"], maturity: "stable", order: 730 },
325
+ "migration-inventory": { capabilityGroup: "governance-versioning", audience: ["maintainer", "agent"], maturity: "stable", order: 740 },
326
+ "infra-contract": { capabilityGroup: "governance-versioning", audience: ["maintainer", "consumer"], maturity: "preview", order: 750 },
327
+ }).map(([id, meta]) => [id, { ...meta, capabilityGroup: capabilityGroup(meta.capabilityGroup) }]));
328
+
329
+ function manualMeta(id) {
330
+ const meta = manualMetaById.get(id);
331
+ if (!meta) {
332
+ throw new Error(`missing manual capability metadata: ${id}`);
333
+ }
334
+ return meta;
335
+ }
336
+
337
+ function pageCapabilityMeta(relPath, category) {
338
+ if (relPath === README_PATH) {
339
+ return { capabilityGroup: capabilityGroup("getting-started"), audience: ["consumer", "agent"], maturity: "stable" };
340
+ }
341
+ const manual = BUILDCHAIN_AGENT_MANUALS.find((entry) => entry.path === relPath);
342
+ if (manual) {
343
+ return manualMeta(manual.id);
344
+ }
345
+ if (category === "action") {
346
+ return { capabilityGroup: capabilityGroup("api-cli-reference"), audience: ["developer", "agent"], maturity: "stable" };
347
+ }
348
+ if (category === "fixture") {
349
+ return { capabilityGroup: capabilityGroup("reusable-build"), audience: ["developer", "agent"], maturity: "stable" };
350
+ }
351
+ if (category === "api") {
352
+ return { capabilityGroup: capabilityGroup("api-cli-reference"), audience: ["developer", "agent"], maturity: "stable" };
353
+ }
354
+ return { capabilityGroup: capabilityGroup("getting-started"), audience: ["agent"], maturity: "stable" };
355
+ }
356
+
357
+ function cliCommandMeta(id) {
358
+ const map = new Map(Object.entries({
359
+ badges: { group: "distribution-indexes", purpose: "Inspect README badge command families." },
360
+ "badges-bundle": { group: "distribution-indexes", purpose: "Generate or verify the combined KFD and Release Passport badge bundle." },
361
+ "badges-readme": { group: "distribution-indexes", purpose: "Generate or verify managed README badge blocks." },
362
+ "build-contract": { group: "governance-versioning", purpose: "Resolve Buildchain runtime contract metadata for floating-ref drift checks." },
363
+ "build-facts": { group: "observability-diagnostics", purpose: "Collect and verify Git source, version, module output, product artifact, and legacy Kungfu buildinfo facts." },
364
+ collect: { group: "release-passport-trust", purpose: "Inspect release evidence collection command families." },
365
+ "collect-github-release": { group: "release-passport-trust", purpose: "Collect GitHub Release assets into a release passport." },
366
+ diagnostics: { group: "observability-diagnostics", purpose: "Inspect diagnostics command families." },
367
+ "diagnostics-summary": { group: "observability-diagnostics", purpose: "Summarize diagnostics artifacts into JSON and cross-platform lifecycle timing tables." },
368
+ doctor: { group: "getting-started", purpose: "Report local integration readiness." },
369
+ explain: { group: "release-passport-trust", purpose: "Inspect release and artifact explanation command families." },
370
+ "explain-artifact": { group: "release-passport-trust", purpose: "Explain artifact evidence for humans or agents." },
371
+ "explain-release": { group: "release-passport-trust", purpose: "Explain a release passport for humans or agents." },
372
+ facts: { group: "observability-diagnostics", purpose: "Inspect build facts command families." },
373
+ help: { group: "getting-started", purpose: "Print Buildchain CLI help." },
374
+ homebrew: { group: "distribution-indexes", purpose: "Inspect Homebrew distribution-index command families." },
375
+ "homebrew-check": { group: "distribution-indexes", purpose: "Verify Homebrew tap metadata against upstream release passport evidence." },
376
+ "homebrew-update-formula": { group: "distribution-indexes", purpose: "Generate Homebrew Formula metadata from upstream release passport evidence." },
377
+ "infra-contract": { group: "governance-versioning", purpose: "Validate and publish provider-neutral infrastructure contract evidence." },
378
+ init: { group: "getting-started", purpose: "Bootstrap a repository with Buildchain configuration and caller workflow files." },
379
+ inspect: { group: "release-passport-trust", purpose: "Inspect release and artifact evidence command families." },
380
+ "inspect-artifact": { group: "release-passport-trust", purpose: "Inspect artifact evidence." },
381
+ "inspect-release": { group: "release-passport-trust", purpose: "Inspect release passport evidence." },
382
+ "kfd-3": { group: "kfd-trust", purpose: "Inspect KFD-3 surface detection, registry, witness, audit, and query command families." },
383
+ "kfd-3-audit": { group: "kfd-trust", purpose: "Compare detected, declared, and enforced KFD-3 public surfaces." },
384
+ "kfd-3-detect": { group: "kfd-trust", purpose: "Detect standard KFD-3 public surface candidates from source and artifact metadata." },
385
+ "kfd-3-query": { group: "kfd-trust", purpose: "Return an agent-readable KFD-3 capability map for a product, registry, or release passport." },
386
+ "kfd-3-register": { group: "kfd-trust", purpose: "Declare detected KFD-3 public surfaces into a product-owned surface registry." },
387
+ "kfd-3-witness": { group: "kfd-trust", purpose: "Generate release-passport-compatible KFD-3 surface witnesses from a product registry." },
388
+ lifecycle: { group: "reusable-build", purpose: "Run configured lifecycle commands and write deterministic artifact manifests." },
389
+ log: { group: "observability-diagnostics", purpose: "Inspect Buildchain logging command families." },
390
+ logging: { group: "observability-diagnostics", purpose: "Emit timestamped build events, summarize logs, and enforce required phases." },
391
+ mark: { group: "observability-diagnostics", purpose: "Emit a single Buildchain log event." },
392
+ npm: { group: "release-passport-trust", purpose: "Inspect npm publishing command families." },
393
+ "npm-dry-run": { group: "release-passport-trust", purpose: "Verify npm publish shape before a release transaction." },
394
+ "publish-source": { group: "release-passport-trust", purpose: "Create, inspect, or verify publish-gate source-lock refs." },
395
+ "release-dry-run": { group: "governance-versioning", purpose: "Explain what a channel merge would publish before the PR is merged." },
396
+ "release-line-open": { group: "governance-versioning", purpose: "Plan or write the initial version-state commit for a new minor release line." },
397
+ "release-propagation": { group: "site-and-propagation", purpose: "Plan channel-preserving downstream release PRs and write exact upstream release locks." },
398
+ "release-transaction": { group: "release-passport-trust", purpose: "Inspect, recover, finalize, or abort durable release transactions." },
399
+ sample: { group: "observability-diagnostics", purpose: "Inspect sampler command families." },
400
+ "sample-process-tree": { group: "observability-diagnostics", purpose: "Sample process-tree diagnostics for a wrapped command." },
401
+ span: { group: "observability-diagnostics", purpose: "Run a command inside a Buildchain log span." },
402
+ "transaction-inspect": { group: "release-passport-trust", purpose: "Inspect durable release transaction state." },
403
+ validate: { group: "getting-started", purpose: "Validate buildchain.toml and declared lifecycle surfaces." },
404
+ verify: { group: "release-passport-trust", purpose: "Inspect release and artifact verification command families." },
405
+ "verify-artifact": { group: "release-passport-trust", purpose: "Verify artifact subjects against release passport evidence." },
406
+ "verify-infra-contract-evidence-bundle": { group: "governance-versioning", purpose: "Fail closed unless an infra-contract lifecycle evidence bundle is complete, hash-bound, and validation-consistent." },
407
+ "verify-observability-log": { group: "observability-diagnostics", purpose: "Verify Buildchain observability log events." },
408
+ "verify-release-passport": { group: "release-passport-trust", purpose: "Fail closed unless a release passport and its evidence are complete." },
409
+ version: { group: "getting-started", purpose: "Print the package or embedded binary version." },
410
+ "web-surface": { group: "site-and-propagation", purpose: "Plan, verify, and apply Buildchain web-surface deployments." },
411
+ }));
412
+ const meta = map.get(id);
413
+ if (!meta) {
414
+ throw new Error(`missing CLI command capability metadata: ${id}`);
415
+ }
416
+ return { capabilityGroup: capabilityGroup(meta.group), purpose: meta.purpose, audience: ["agent", "operator"], maturity: "stable" };
417
+ }
418
+
419
+ function nodeApiMeta(exportName) {
420
+ const map = new Map(Object.entries({
421
+ ".": { group: "api-cli-reference", summary: "Root toolkit export for Buildchain's public Node API." },
422
+ "./core": { group: "api-cli-reference", summary: "Alias for the root public toolkit export." },
423
+ "./badges": { group: "distribution-indexes", summary: "Badge bundle facts, rendering, checking, and update APIs." },
424
+ "./readme-badges": { group: "distribution-indexes", summary: "Managed README badge block facts, rendering, drift checks, and updates." },
425
+ "./homebrew": { group: "distribution-indexes", summary: "Homebrew tap fact collection, Formula rendering, update, and check APIs." },
426
+ "./build-facts": { group: "observability-diagnostics", summary: "Git source, version, module output, product artifact, and legacy Kungfu build fact APIs." },
427
+ "./diagnostics": { group: "observability-diagnostics", summary: "Native diagnostics collection, summarization, cache, compiler, and process-sampler APIs." },
428
+ "./logging": { group: "observability-diagnostics", summary: "Buildchain JSONL logging, span, summary, and verification APIs." },
429
+ "./artifact-passport": { group: "release-passport-trust", summary: "Artifact passport digest and evidence helper APIs." },
430
+ "./release-passport": { group: "release-passport-trust", summary: "Release passport collection, verification, explanation, and evidence APIs." },
431
+ "./release-candidate": { group: "reusable-build", summary: "PR-stage release-candidate artifact, passport, and promote-only resolver APIs." },
432
+ "./release-propagation": { group: "site-and-propagation", summary: "Release propagation graph, plan, and exact upstream lock APIs." },
433
+ "./release-line-bootstrap": { group: "governance-versioning", summary: "Semver release-line bootstrap planning and version-state APIs." },
434
+ "./buildchain-contract": { group: "governance-versioning", summary: "Runtime contract world and compatibility digest APIs for floating-ref drift checks." },
435
+ "./surface-manifest": { group: "site-and-propagation", summary: "Surface manifest timestamp and reproducibility policy APIs." },
436
+ "./issue-reporting": { group: "observability-diagnostics", summary: "Buildchain-owned issue reporting API for workflow friction feedback." },
437
+ "./kfd-3-surfaces": { group: "kfd-trust", summary: "KFD-3 detection, registration, audit, witness, and capability query APIs." },
438
+ "./public-surface-audit": { group: "kfd-trust", summary: "Reverse audit APIs for CLI, workflow, action, site page, and documentation command surfaces." },
439
+ "./kfd-gate": { group: "kfd-trust", summary: "KFD-1/KFD-2/KFD-3 release gate evidence and validation APIs." },
440
+ "./buildchain-kfd-claims": { group: "kfd-trust", summary: "Buildchain self KFD claim registry, witnesses, and public claim APIs." },
441
+ }));
442
+ const meta = map.get(exportName);
443
+ if (!meta) {
444
+ throw new Error(`missing Node API capability metadata: ${exportName}`);
445
+ }
446
+ return { capabilityGroup: capabilityGroup(meta.group), summary: meta.summary, audience: ["developer", "agent"], maturity: "stable" };
447
+ }
448
+
449
+ function buildCapabilityRegistry({ docs, pages, cliRegistry, manualRegistry, nodeApiRegistry, workflowRegistry }) {
450
+ const groupCounts = new Map(CAPABILITY_GROUPS.map((group) => [group.id, {
451
+ manualCount: 0,
452
+ pageCount: 0,
453
+ cliCommandCount: 0,
454
+ nodeApiCount: 0,
455
+ workflowCount: 0,
456
+ actionCount: 0,
457
+ }]));
458
+ for (const entry of manualRegistry.manuals) groupCounts.get(entry.capabilityGroup).manualCount += 1;
459
+ for (const entry of pages) groupCounts.get(entry.capabilityGroup).pageCount += 1;
460
+ for (const entry of cliRegistry.commands) groupCounts.get(entry.capabilityGroup).cliCommandCount += 1;
461
+ for (const entry of nodeApiRegistry.exports) groupCounts.get(entry.capabilityGroup).nodeApiCount += 1;
462
+ for (const entry of workflowRegistry.workflows) {
463
+ const group = workflowCapabilityGroup(entry);
464
+ groupCounts.get(group).workflowCount += 1;
465
+ }
466
+ for (const entry of workflowRegistry.actions) {
467
+ const group = actionCapabilityGroup(entry.id);
468
+ groupCounts.get(group).actionCount += 1;
469
+ }
470
+ return {
471
+ schemaVersion: 1,
472
+ contract: "kungfu-buildchain-capability-registry",
473
+ package: readJson("package.json").name,
474
+ sourceOfTruth: "npm package @kungfu-tech/buildchain/dist/site/capability-registry.json",
475
+ groups: CAPABILITY_GROUPS.map((group) => ({
476
+ ...group,
477
+ counts: groupCounts.get(group.id),
478
+ manuals: docs.filter((entry) => manualMeta(entry.id).capabilityGroup === group.id).map((entry) => entry.path),
479
+ factSources: [
480
+ "page-registry.json",
481
+ "manual-registry.json",
482
+ "cli-registry.json",
483
+ "node-api-registry.json",
484
+ "workflow-registry.json",
485
+ "kfd-claims.json",
486
+ ],
487
+ })),
488
+ navigationPolicy: {
489
+ defaultOrder: CAPABILITY_GROUPS.map((group) => group.id),
490
+ rule: "Render Buildchain documentation by capability group first, then by manual order or command/API registry within the selected group.",
491
+ },
492
+ };
493
+ }
494
+
495
+ function workflowCapabilityGroup(entry) {
496
+ if (["web-surface", "release-propagation"].includes(entry.id)) return capabilityGroup("site-and-propagation");
497
+ if (["build", "release-candidate-promote"].includes(entry.id)) return capabilityGroup("reusable-build");
498
+ if (["buildchain-ref-promotion", "release-line-bootstrap"].includes(entry.id)) return capabilityGroup("release-passport-trust");
499
+ if (entry.id.includes("patrol") || entry.id.includes("dev-pr-auto-merge")) return capabilityGroup("governance-versioning");
500
+ if (entry.status === "repository-internal" || entry.status === "compatibility-fixture") return capabilityGroup("api-cli-reference");
501
+ return capabilityGroup("api-cli-reference");
502
+ }
503
+
504
+ function actionCapabilityGroup(id) {
505
+ if (id === "promote-buildchain-ref") return capabilityGroup("release-passport-trust");
506
+ if (id === "run-lifecycle" || id === "validate-config") return capabilityGroup("reusable-build");
507
+ if (id === "report-buildchain-issue") return capabilityGroup("observability-diagnostics");
508
+ return capabilityGroup("api-cli-reference");
509
+ }
510
+
221
511
  function buildSitePages() {
222
512
  const docsPages = listMarkdownFiles("docs").map((relPath) => sitePage(relPath, "manual", "/docs"));
223
513
  const actionPages = immediateReadmes("actions").map((relPath) => sitePage(relPath, "action", "/actions"));
@@ -282,58 +572,22 @@ function buildSiteBundle() {
282
572
  artifactDigestScope: "npm package dist/site JSON files",
283
573
  });
284
574
 
285
- const cliPurposeById = new Map([
286
- ["version", "Print the package or embedded binary version."],
287
- ["help", "Print Buildchain CLI help."],
288
- ["init", "Bootstrap a repository with Buildchain configuration and caller workflow files."],
289
- ["validate", "Validate buildchain.toml and declared lifecycle surfaces."],
290
- ["doctor", "Report local integration readiness."],
291
- ["lifecycle", "Run configured lifecycle commands and write deterministic artifact manifests."],
292
- ["release-dry-run", "Explain what a channel merge would publish before the PR is merged."],
293
- ["release-line-open", "Plan or write the initial version-state commit for a new minor release line."],
294
- ["release-transaction", "Inspect, recover, finalize, or abort durable release transactions."],
295
- ["transaction-inspect", "Inspect durable release transaction state."],
296
- ["collect-github-release", "Collect release assets into a release passport."],
297
- ["verify-release-passport", "Fail closed unless a release passport and its evidence are complete."],
298
- ["verify-artifact", "Verify artifact subjects against release passport evidence."],
299
- ["verify-infra-contract-evidence-bundle", "Fail closed unless an infra-contract lifecycle evidence bundle is complete, hash-bound, and validation-consistent."],
300
- ["verify-observability-log", "Verify Buildchain observability log events."],
301
- ["explain-release", "Explain a release passport for humans or agents."],
302
- ["explain-artifact", "Explain artifact evidence for humans or agents."],
303
- ["inspect-release", "Inspect release passport evidence."],
304
- ["inspect-artifact", "Inspect artifact evidence."],
305
- ["release-propagation", "Plan channel-preserving downstream release PRs and write exact upstream release locks."],
306
- ["logging", "Emit timestamped build events, summarize logs, and enforce required phases."],
307
- ["mark", "Emit a single Buildchain log event."],
308
- ["span", "Run a command inside a Buildchain log span."],
309
- ["diagnostics-summary", "Summarize diagnostics artifacts into JSON and cross-platform lifecycle timing tables."],
310
- ["build-facts", "Collect and verify Git source, version, module output, product artifact, and legacy Kungfu buildinfo facts."],
311
- ["kfd-3-detect", "Detect standard KFD-3 public surface candidates from source and artifact metadata."],
312
- ["kfd-3-register", "Declare detected KFD-3 public surfaces into a product-owned surface registry."],
313
- ["kfd-3-audit", "Compare detected, declared, and enforced KFD-3 public surfaces."],
314
- ["kfd-3-witness", "Generate release-passport-compatible KFD-3 surface witnesses from a product registry."],
315
- ["kfd-3-query", "Return an agent-readable KFD-3 capability map for a product, registry, or release passport."],
316
- ["sample-process-tree", "Sample process-tree diagnostics for a wrapped command."],
317
- ["npm-dry-run", "Verify npm publish shape before a release transaction."],
318
- ["infra-contract", "Validate and publish provider-neutral infrastructure contract evidence."],
319
- ["web-surface", "Plan, verify, and apply Buildchain web-surface deployments."],
320
- ["badges-readme", "Generate or verify managed README badge blocks."],
321
- ["badges-bundle", "Generate or verify the combined KFD and Release Passport badge bundle."],
322
- ["homebrew-update-formula", "Generate Homebrew Formula metadata from upstream release passport evidence."],
323
- ["homebrew-check", "Verify Homebrew tap metadata against upstream release passport evidence."],
324
- ["publish-source", "Create, inspect, or verify publish-gate source-lock refs."],
325
- ["build-contract", "Resolve Buildchain runtime contract metadata."],
326
- ]);
327
575
  const cliRegistry = {
328
576
  schemaVersion: 1,
329
577
  contract: "kungfu-buildchain-cli-registry",
330
578
  binary: "buildchain",
331
579
  npmPackage: packageJson.name,
332
580
  commandSource: "bin/buildchain.mjs reverse enumeration",
333
- commands: enumerateCliCommandsFromBin({ root }).map((entry) => ({
334
- ...entry,
335
- purpose: cliPurposeById.get(entry.id) || "Public Buildchain CLI surface. Add a specific purpose in scripts/generate-site-bundle.mjs when this command graduates.",
336
- })),
581
+ commands: enumerateCliCommandsFromBin({ root }).map((entry) => {
582
+ const meta = cliCommandMeta(entry.id);
583
+ return {
584
+ ...entry,
585
+ purpose: meta.purpose,
586
+ capabilityGroup: meta.capabilityGroup,
587
+ audience: meta.audience,
588
+ maturity: meta.maturity,
589
+ };
590
+ }),
337
591
  };
338
592
 
339
593
  const manualRegistry = {
@@ -341,13 +595,20 @@ function buildSiteBundle() {
341
595
  contract: "kungfu-buildchain-agent-manual-registry",
342
596
  package: packageJson.name,
343
597
  source: "npm package docs/",
344
- manuals: docs.map((entry) => ({
345
- id: entry.id,
346
- title: entry.title,
347
- path: entry.path,
348
- plane: entry.plane,
349
- digest: entry.digest,
350
- })),
598
+ manuals: docs.map((entry) => {
599
+ const meta = manualMeta(entry.id);
600
+ return {
601
+ id: entry.id,
602
+ title: entry.title,
603
+ path: entry.path,
604
+ plane: entry.plane,
605
+ digest: entry.digest,
606
+ capabilityGroup: meta.capabilityGroup,
607
+ audience: meta.audience,
608
+ maturity: meta.maturity,
609
+ order: meta.order,
610
+ };
611
+ }),
351
612
  requiredAgentManuals: [
352
613
  "docs/MAP.md",
353
614
  "docs/install.md",
@@ -381,6 +642,7 @@ function buildSiteBundle() {
381
642
  },
382
643
  pageCount: pages.length,
383
644
  categories: [...new Set(pages.map((page) => page.category))].sort(),
645
+ capabilityGroups: CAPABILITY_GROUPS.map((group) => group.id),
384
646
  pages,
385
647
  };
386
648
 
@@ -391,12 +653,19 @@ function buildSiteBundle() {
391
653
  moduleSystem: packageJson.type || "module",
392
654
  exports: Object.entries(packageJson.exports || {})
393
655
  .filter(([specifier]) => !specifier.startsWith("./site/") && specifier !== "./package.json")
394
- .map(([specifier, target]) => ({
395
- specifier: specifier === "." ? packageJson.name : `${packageJson.name}/${specifier.replace(/^\.\//, "")}`,
396
- export: specifier,
397
- target,
398
- digest: typeof target === "string" ? sha256File(target.replace(/^\.\//, "")) : "",
399
- })),
656
+ .map(([specifier, target]) => {
657
+ const meta = nodeApiMeta(specifier);
658
+ return {
659
+ specifier: specifier === "." ? packageJson.name : `${packageJson.name}/${specifier.replace(/^\.\//, "")}`,
660
+ export: specifier,
661
+ target,
662
+ digest: typeof target === "string" ? sha256File(target.replace(/^\.\//, "")) : "",
663
+ summary: meta.summary,
664
+ capabilityGroup: meta.capabilityGroup,
665
+ audience: meta.audience,
666
+ maturity: meta.maturity,
667
+ };
668
+ }),
400
669
  docs: [
401
670
  { id: "cli-and-node-package", path: "docs/cli.md", digest: sha256File("docs/cli.md") },
402
671
  { id: "build-facts", path: "docs/build-facts.md", digest: sha256File("docs/build-facts.md") },
@@ -439,12 +708,17 @@ function buildSiteBundle() {
439
708
  return {
440
709
  ...entry,
441
710
  surface: surfaceById.get(entry.id) || (entry.path.includes("/.") ? "reusable-workflow" : "repository-workflow"),
711
+ capabilityGroup: workflowCapabilityGroup({
712
+ ...entry,
713
+ status: statusById.get(entry.id) || "active",
714
+ }),
442
715
  status: statusById.get(entry.id) || "active",
443
716
  };
444
717
  }),
445
718
  actionSource: "actions/*/action.yml reverse input enumeration",
446
719
  actions: enumerateActionInputs({ root }).map((entry) => ({
447
720
  ...entry,
721
+ capabilityGroup: actionCapabilityGroup(entry.id),
448
722
  status: "active",
449
723
  })),
450
724
  };
@@ -454,6 +728,14 @@ function buildSiteBundle() {
454
728
  workflowRegistry,
455
729
  pageRegistry,
456
730
  });
731
+ const capabilityRegistry = buildCapabilityRegistry({
732
+ docs,
733
+ pages,
734
+ cliRegistry,
735
+ manualRegistry,
736
+ nodeApiRegistry,
737
+ workflowRegistry,
738
+ });
457
739
 
458
740
  const releaseModel = {
459
741
  schemaVersion: 1,
@@ -521,6 +803,7 @@ function buildSiteBundle() {
521
803
  "site-manifest.json",
522
804
  "badge-endpoint-registry.json",
523
805
  "page-registry.json",
806
+ "capability-registry.json",
524
807
  "cli-registry.json",
525
808
  "manual-registry.json",
526
809
  "node-api-registry.json",
@@ -600,6 +883,7 @@ function buildSiteBundle() {
600
883
  docs,
601
884
  facts: [
602
885
  "page-registry.json",
886
+ "capability-registry.json",
603
887
  "cli-registry.json",
604
888
  "manual-registry.json",
605
889
  "node-api-registry.json",
@@ -620,6 +904,7 @@ function buildSiteBundle() {
620
904
  contract: "kungfu-buildchain-site-agent-index",
621
905
  readOrder: [
622
906
  "site-manifest.json",
907
+ "capability-registry.json",
623
908
  "page-registry.json",
624
909
  "product-mechanism.json",
625
910
  "release-model.json",
@@ -724,6 +1009,12 @@ function buildSiteBundle() {
724
1009
  humanFirst: true,
725
1010
  agentFirst: true,
726
1011
  entrypoints: siteManifest.facts.concat(["site-manifest.json"]),
1012
+ capabilityRegistry: {
1013
+ path: "capability-registry.json",
1014
+ contract: capabilityRegistry.contract,
1015
+ groupCount: capabilityRegistry.groups.length,
1016
+ defaultOrder: capabilityRegistry.navigationPolicy.defaultOrder,
1017
+ },
727
1018
  pages,
728
1019
  pageRegistry: {
729
1020
  path: "page-registry.json",
@@ -755,6 +1046,7 @@ function buildSiteBundle() {
755
1046
  "homepage title and text",
756
1047
  "homepage section projection from README.md",
757
1048
  "complete markdown page registry for Buildchain public docs, action manuals, Node API overview, and fixtures",
1049
+ "capability-grouped navigation registry for docs, CLI, Node API, workflows, actions, and KFD claims",
758
1050
  "release model facts",
759
1051
  "workflow and action registries",
760
1052
  "CLI command registry",
@@ -780,6 +1072,7 @@ function buildSiteBundle() {
780
1072
  "buildchain-site.json": siteBundle,
781
1073
  "site-manifest.json": siteManifest,
782
1074
  "page-registry.json": pageRegistry,
1075
+ "capability-registry.json": capabilityRegistry,
783
1076
  "cli-registry.json": cliRegistry,
784
1077
  "manual-registry.json": manualRegistry,
785
1078
  "node-api-registry.json": nodeApiRegistry,