From c7c57436a991990a23164f5ea870c637ff07317a Mon Sep 17 00:00:00 2001 From: garrytan Date: Fri, 16 Oct 2026 22:32:15 +0000 Subject: [PATCH] test(dx): grader items come from the contract; paid-file count includes the new case Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --- test/dx-error-contract-grader.test.ts | 10 +++++++++- test/eng-finding-retry-budget.test.ts | 2 +- test/fixtures/dx-error-contract-case.ts | 3 ++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/test/dx-error-contract-grader.test.ts b/test/dx-error-contract-grader.test.ts index 2f911ecf7..b1441c3a1 100644 --- a/test/dx-error-contract-grader.test.ts +++ b/test/dx-error-contract-grader.test.ts @@ -1,5 +1,6 @@ import { describe, expect, test } from 'bun:test'; -import { DX_ERROR_CONTRACT_PLAN, gradeDxContractReview } from './fixtures/dx-error-contract-case'; +import { DX_ERROR_COMPACT, DX_ERROR_ITEMS } from '../lib/dx-error-contract'; +import { DX_ERROR_CONTRACT_PLAN, capFindings, gradeDxContractReview } from './fixtures/dx-error-contract-case'; const fence = (rows: Array>) => ['INPUT: dx abc', 'Review prose.', '```gstack-findings', ...rows.map(row => JSON.stringify(row)), '```'].join('\n'); const PASSING = [ @@ -18,6 +19,13 @@ describe('dx-error-contract-review grader (free controls for the paid case)', () expect(DX_ERROR_CONTRACT_PLAN).toContain('(PROJECT_NOT_FOUND); fix: run'); }); + test('the grader keys on the title and severity shapes the product prompt asks for', () => { + expect(DX_ERROR_COMPACT).toContain('as a Critical finding titled "CAP4::"'); + expect(DX_ERROR_COMPACT).toContain('as a High finding titled "CAP6::"'); + const rows = DX_ERROR_ITEMS.map((item, index) => ({ id: `F${index}`, severity: 'High', title: `CAP6:P1:${item} gap` })); + expect(capFindings(fence(rows)).map(cap => cap.item)).toEqual([...DX_ERROR_ITEMS]); + }); + test('a review meeting every bar passes', () => { const grade = gradeDxContractReview(fence(PASSING)); expect(grade.reasons).toEqual([]); diff --git a/test/eng-finding-retry-budget.test.ts b/test/eng-finding-retry-budget.test.ts index b0d503522..9d35a6f0a 100644 --- a/test/eng-finding-retry-budget.test.ts +++ b/test/eng-finding-retry-budget.test.ts @@ -141,7 +141,7 @@ test('live periodic census fits the declared CI wall including setup', () => { test('registered allocation is deterministic and preserves every discovered file', () => { const files = collectPaidTestFiles(); - expect(files).toHaveLength(108); // + skill-e2e-gate-integrity (HONEST_WORK_GATE_INTEGRITY W8); + skill-e2e-autoplan-schema-canary, -guard-pty and -long-session (Oct 7 wave, CEO-13, ENG-18, CEO-15); + skill-e2e-ship-measure-seeded-flake (v1.91.32.0); W5a: 15 carve wrappers became one case-sharded file; + codex-e2e-multiblock-live and skill-e2e-design-model-smoke (v1.91.30.0); + expect(files).toHaveLength(109); // + skill-e2e-dx-error-contract (#3226); + skill-e2e-gate-integrity (HONEST_WORK_GATE_INTEGRITY W8); + skill-e2e-autoplan-schema-canary, -guard-pty and -long-session (Oct 7 wave, CEO-13, ENG-18, CEO-15); + skill-e2e-ship-measure-seeded-flake (v1.91.32.0); W5a: 15 carve wrappers became one case-sharded file; + codex-e2e-multiblock-live and skill-e2e-design-model-smoke (v1.91.30.0); expect(files).toContain('test/skill-e2e-ship-skip.test.ts'); const m = livePlan(files); expect(livePlan([...files].reverse())).toEqual(m); diff --git a/test/fixtures/dx-error-contract-case.ts b/test/fixtures/dx-error-contract-case.ts index 552fc4fd9..7aae347af 100644 --- a/test/fixtures/dx-error-contract-case.ts +++ b/test/fixtures/dx-error-contract-case.ts @@ -13,6 +13,7 @@ * - labels every CAP4 finding Critical and every CAP6 finding High. */ import { parseRecordFindings } from '../../lib/autoplan-reconcile'; +import { DX_ERROR_ITEMS } from '../../lib/dx-error-contract'; export const DX_ERROR_CONTRACT_PLAN = `# Plan: acmesync 2.0 CLI error handling @@ -61,7 +62,7 @@ export type CapLevel = 4 | 6; export interface CapFinding { level: CapLevel; path: string; item: string; severity?: string; title: string } export interface DxContractGrade { pass: boolean; reasons: string[]; caps: CapFinding[] } -const ITEMS = new Set(['what', 'fix', 'recovery', 'code', 'context', 'trace', 'redaction', 'channel']); +const ITEMS = new Set(DX_ERROR_ITEMS); const ALIASES: Record = { terminal: 'channel', exit: 'channel', 'exit-code': 'channel', secret: 'redaction' }; function pathId(raw: string): string | undefined {