From 0a3c5f210507f187b19c488f5cbb3c4aa3370892 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Sun, 7 Jun 2026 17:52:03 -0700 Subject: [PATCH] test: E2 data-driven carve static ordering guard (gate) Per-PR backstop for every carved skill, one test() per skill, driven by CARVE_GUARDS staticInvariants. Generalizes + retires the ceo-specific ordering test. Co-Authored-By: Claude Opus 4.8 (1M context) --- test/carve-section-ordering.test.ts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 test/carve-section-ordering.test.ts diff --git a/test/carve-section-ordering.test.ts b/test/carve-section-ordering.test.ts new file mode 100644 index 000000000..73184823e --- /dev/null +++ b/test/carve-section-ordering.test.ts @@ -0,0 +1,27 @@ +/** + * E2 — carve static ordering guard (GATE tier, free, deterministic). + * + * The per-PR mechanical backstop for EVERY carved skill: it fails CI the moment a + * regen drops/weakens a skeleton's STOP-Read directive, strands a section, leaks + * heavy body back into the skeleton, or moves a post-STOP gate above the STOP. + * + * Data-driven from the canonical CARVE_GUARDS registry (EQ1) with per-skill + * invariants (codex outside-voice #3 — NOT a copy of the ceo-specific test, which + * this generalizes and retires). One test() per skill so a failure names the skill. + */ + +import { describe, test, expect } from 'bun:test'; +import * as path from 'path'; +import { CARVE_GUARDS } from './helpers/carve-guards'; +import { checkOrdering } from './helpers/carve-guard-checks'; + +const ROOT = path.resolve(import.meta.dir, '..'); + +describe('carve static ordering (gate, free)', () => { + for (const guard of Object.values(CARVE_GUARDS)) { + test(`${guard.skill}: skeleton routes to sections correctly`, () => { + const failures = checkOrdering(ROOT, guard); + expect({ skill: guard.skill, failures }).toEqual({ skill: guard.skill, failures: [] }); + }); + } +});