diff --git a/src/contracts/env.ts b/src/contracts/env.ts index 9c86dc71..48c874be 100644 --- a/src/contracts/env.ts +++ b/src/contracts/env.ts @@ -58,6 +58,11 @@ export const ENV_REGISTRY = Object.freeze(withProductRows({ AUTH_MODE: runtime("public", true, "external"), CONFIG_SCHEMA_VERSION: runtime("public", true, null), RELEASE_MANIFEST_URL: runtime("public", true, "/release-manifest.json"), + // F-6. The release identity the build writes into config.json. It must match + // the deployed HTML and release manifest, or boot stops with + // CONFIG_BUILD_MISMATCH (scripts/check-release-admission.ts). + RELEASE_ID: runtime("public-metadata", false, null), + BUILD_ID: runtime("public-metadata", false, null), // §3.5: overrides may only disable an installed capability, never enable one. CAPABILITY_OVERRIDES: runtime("public", false, null), // §3.5: likewise for features — subtractive, keyed by installed feature id. diff --git a/tests/unit/env-registry-coverage.test.ts b/tests/unit/env-registry-coverage.test.ts new file mode 100644 index 00000000..f28118d0 --- /dev/null +++ b/tests/unit/env-registry-coverage.test.ts @@ -0,0 +1,19 @@ +import { describe, expect, it } from "vitest"; + +import { ENV_REGISTRY } from "../../src/contracts/env.ts"; +import { runtimeConfigV2ArtifactSchema } from "../../src/contracts/release-artifacts.ts"; + +// 09-02. A key the deployed config.json may carry needs an FE-REG-ENV row, so +// check:registries sees it. A product key added to +// PRODUCT_RUNTIME_CONFIG_FIELDS without a PRODUCT_ENV_REGISTRY row fails here. +describe("FE-REG-ENV coverage", () => { + it("has a runtime row for every V2 runtime config key", () => { + const missing = Object.keys(runtimeConfigV2ArtifactSchema.shape).filter( + (key) => + !Object.hasOwn(ENV_REGISTRY, key) || + ENV_REGISTRY[key as keyof typeof ENV_REGISTRY].phase !== "runtime", + ); + + expect(missing).toEqual([]); + }); +});