/** * 1101/13-05. The only fields an operator may change in a deployed config.json * without a rebuild (docs/runbooks/FE-RB-001.md). Every other field belongs to * the build: BUILD_ID and RELEASE_ID must still match the deployed HTML and * release manifest, or every boot stops with CONFIG_BUILD_MISMATCH. * * 1103/13-01. The live hosting probe (FE-GATE-019) compares the served * config.json with the promoted candidate's by the same rule, so the release * admission and the probe agree on what an edited document may change. */ export const RUNTIME_CONFIG_EMERGENCY_SWITCHES: ReadonlySet = new Set([ "CAPABILITY_OVERRIDES", "FEATURE_OVERRIDES", ]); /** Fields other than the emergency switches whose values differ, sorted. */ export function changedRuntimeConfigBuildFields(original: object, edited: object): string[] { const before = new Map(Object.entries(original)); const after = new Map(Object.entries(edited)); return [...new Set([...before.keys(), ...after.keys()])] .filter( (field) => !RUNTIME_CONFIG_EMERGENCY_SWITCHES.has(field) && JSON.stringify(before.get(field)) !== JSON.stringify(after.get(field)), ) .sort(); }