/** * Measures packed creation for one template and merges per-template results into the capability * table CI publishes. A template that fails or is not measured is listed as untested; only a failed * default minimal template fails the merge, because it blocks the release. * * Results live in the ignored `test-results/creation-capability` directory; the merged table is * written there as `capability-table.json` and printed as Markdown for the CI job summary. * * bun scripts/create-capability-table.ts measure --template api * bun scripts/create-capability-table.ts merge */ import { mkdir, readdir, readFile, writeFile } from "node:fs/promises"; import { join, resolve } from "node:path"; import { CREATE_TEMPLATES, type CreateCapabilityEvidence, type CreateTemplate, } from "create-relkit"; import { templateDigest, validateCreationReport } from "./release-create-evidence.js"; import { pullTemplateImages } from "./local-images.js"; /** One template's measurement outcome, written next to its reports. */ export type TemplateResult = | { readonly template: CreateTemplate; readonly status: "tested"; readonly entry: CreateCapabilityEvidence; } | { readonly template: CreateTemplate; readonly status: "untested"; readonly reason: string }; /** Capability table published as a CI output. */ export interface CapabilityTable { readonly version: 1; readonly runtime: { readonly name: "bun"; readonly version: string }; readonly entries: readonly CreateCapabilityEvidence[]; readonly untested: readonly { readonly template: CreateTemplate; readonly reason: string }[]; } const root = resolve(import.meta.dir, ".."); /** * Runs fresh and restart readiness for one template and records the outcome. * @param template - Public template to measure. * @param output - Directory receiving `