export const PROMOTION_FORMULA = Object.freeze({ MERGE_READY: Object.freeze([ "FE-GATE-001", "FE-GATE-002", "FE-GATE-003", "FE-GATE-004", "FE-GATE-005", "FE-GATE-006", "FE-GATE-007", "FE-GATE-008", "FE-GATE-009", "FE-GATE-010", "FE-GATE-011", // 15-01. Bundle budget: a PR that exceeds it is not merge-ready. "FE-GATE-012", "FE-GATE-013", "FE-GATE-020", ]), RELEASE_READY: Object.freeze([ "FE-GATE-014", "FE-GATE-015", "FE-GATE-026", // FE-GATE-027. A candidate is only release-ready once it has been admitted // to a named environment; coherence alone never proved it belonged there. "FE-GATE-027", // FE-GATE-028 (08-06). The signed human accessibility review belongs to a // release candidate, so it gates release; merge checks the record format. "FE-GATE-028", ]), PROD_PROMOTION_READY: Object.freeze([ // FE-GATE-019 (13-05, D-14). Live hosting headers of the deployed promoted // release; the declared-header fixture alone is UNVERIFIED, not PASS. "FE-GATE-019", // FE-GATE-016 is retired (D-14): it repeated FE-GATE-025's FE-RB-005 drill. "FE-GATE-021", "FE-GATE-022", "FE-GATE-023", "FE-GATE-024", "FE-GATE-025", ]), FIELD_SLO_READY: Object.freeze(["FE-GATE-018"]), DOCUMENTATION_READY: Object.freeze(["FE-GATE-017"]), // F2 (design-docs repo-structure/03-ci.md 7.3). The checkers' negative // fixtures and the gating coverage check run after a merge to main. They // test the checkers, not the change, so they hold no promotion. // FE-GATE-030 (owner decision 2026-11-12 p): the optional runtime removal // drills moved here from FE-GATE-020. A failure turns main red, and the next // pull request fixes it before it merges. MAIN_READY: Object.freeze(["FE-GATE-029", "FE-GATE-030"]), }); export type GateResult = "PASS" | "FAIL" | "UNVERIFIED"; export function evaluatePromotionReadiness( gateResults: Readonly>, ) { const allPass = (gateIds: readonly string[]) => gateIds.every((gateId) => gateResults[gateId] === "PASS"); const mergeReady = allPass(PROMOTION_FORMULA.MERGE_READY); const releaseReady = mergeReady && allPass(PROMOTION_FORMULA.RELEASE_READY); const productionReady = releaseReady && allPass(PROMOTION_FORMULA.PROD_PROMOTION_READY); const fieldReady = productionReady && allPass(PROMOTION_FORMULA.FIELD_SLO_READY); const documentationReady = allPass(PROMOTION_FORMULA.DOCUMENTATION_READY); const mainReady = allPass(PROMOTION_FORMULA.MAIN_READY); return Object.freeze({ MERGE_READY: mergeReady, RELEASE_READY: releaseReady, PROD_PROMOTION_READY: productionReady, FIELD_SLO_READY: fieldReady, DOCUMENTATION_READY: documentationReady, MAIN_READY: mainReady, }); }