/** * Gate: the hand-maintained dev fixture `public/release-manifest.json` must * declare the same `contractSet` the build compiles. * * `corepack pnpm dev` serves that file verbatim, and `verifyContractSet` runs * unconditionally at boot, so a stale fixture is a hard boot failure of * `pnpm dev` in the default `MOCK` mode — not an `HTTP`-mode caveat. Nothing * else in the gate set reads `public/*.json`, which is how a completely broken * `pnpm dev` shipped with every static check green. * * `--write` refreshes the block instead of failing; that is what * `corepack pnpm generate:tech-log-contract` calls. */ import process from "node:process"; import { DEV_RELEASE_MANIFEST_PATH, checkDevReleaseManifestContractSet, refreshDevReleaseManifestContractSet, } from "./lib/dev-release-manifest.ts"; const write = process.argv.includes("--write"); if (write) { const { changed, contractSet } = await refreshDevReleaseManifestContractSet(); process.stdout.write( `${changed ? "Updated" : "Already in sync"}: ${DEV_RELEASE_MANIFEST_PATH} contractSet ` + `(${contractSet.packages.length} package(s), ${contractSet.setDigest})\n`, ); } else { const failures = await checkDevReleaseManifestContractSet(); if (failures.length > 0) { process.stderr.write( `dev release manifest drift:\n- ${failures.join("\n- ")}\n` + `Run: corepack pnpm generate:dev-release-manifest\n`, ); process.exit(1); } process.stdout.write( `${DEV_RELEASE_MANIFEST_PATH} contractSet matches the compiled contract set.\n`, ); }