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>
This commit is contained in:
garrytanandcapy-ai[bot] committed 2026-10-16 22:32:15 +00:00
1 parent 7958b78377
commit c7c57436a9
3 files changed
+12 -3

No files matched your search

+9 -1
View File
@@ -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<Record<string, unknown>>) => ['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:<path>:<item>"');
expect(DX_ERROR_COMPACT).toContain('as a High finding titled "CAP6:<path>:<item>"');
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([]);
+1 -1
View File
@@ -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);
+2 -1
View File
@@ -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<string>(DX_ERROR_ITEMS);
const ALIASES: Record<string, string> = { terminal: 'channel', exit: 'channel', 'exit-code': 'channel', secret: 'redaction' };
function pathId(raw: string): string | undefined {