From f7ec2cd7f9fa949a59a61b2d08f9080da119c01f Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Sun, 7 Jun 2026 17:52:03 -0700 Subject: [PATCH] test: E1 carve-guard completeness meta-guard (gate) Asserts filesystem carved set == CARVE_GUARDS set both directions, so a future carve without a registry entry fails CI. Co-Authored-By: Claude Opus 4.8 (1M context) --- test/carve-guard-completeness.test.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 test/carve-guard-completeness.test.ts diff --git a/test/carve-guard-completeness.test.ts b/test/carve-guard-completeness.test.ts new file mode 100644 index 000000000..65765083f --- /dev/null +++ b/test/carve-guard-completeness.test.ts @@ -0,0 +1,22 @@ +/** + * E1 — carve-guard completeness meta-guard (GATE tier, free). + * + * Makes the carve gap impossible to reopen: every skill carved on disk (owns a + * sections/manifest.json) MUST be in the canonical CARVE_GUARDS registry, and + * vice-versa. Because the static (E2) and behavioral (T2) guards are data-driven + * FROM the registry, registry membership IS guard coverage — so this set-parity + * check is the whole game (codex #2: no need to grep test source). Carve a 7th + * skill without a registry entry and this fails CI. + */ + +import { describe, test, expect } from 'bun:test'; +import * as path from 'path'; +import { checkCompleteness } from './helpers/carve-guard-checks'; + +const ROOT = path.resolve(import.meta.dir, '..'); + +describe('carve-guard completeness (gate, free)', () => { + test('filesystem carved set == CARVE_GUARDS set, and every entry is consistent', () => { + expect(checkCompleteness(ROOT)).toEqual([]); + }); +});