fix(review): design-lite rows keep the detector's [rule-id]; the e2e detector rows point at the diff

The output template had no rule-id slot, so rows merged with checklist items
dropped the detector id (census t2, local t1). Rows now carry [rule-id]. The
fake engine's sample rows named a foreign fixture path at line 0; the e2e remaps
them to landing.html/styles.css so trials stop spending turns reconciling it.
This commit is contained in:
garrytan committed 2026-09-30 22:07:25 +00:00
1 parent a487a09bf1
commit 746f9b9cf1
3 files changed
+25 -10

No files matched your search

+13 -2
View File
@@ -13,7 +13,7 @@ import { spawnSync } from 'child_process';
import * as fs from 'fs';
import * as path from 'path';
import * as os from 'os';
import { carriesDetectorRows, installFakeImpeccable } from './helpers/fake-impeccable';
import { carriesDetectorRows, DETECT_SAMPLE, installFakeImpeccable } from './helpers/fake-impeccable';
const evalCollector = createEvalCollector('e2e-review');
// Capture cleanup and recording must finish before Bun starts its retry.
@@ -231,6 +231,17 @@ describeIfSelected('Review design lite E2E', ['review-design-lite'], () => {
fs.copyFileSync(path.join(ROOT, 'review', 'greptile-triage.md'), path.join(designDir, 'review-greptile-triage.md'));
// Fake impeccable engine OUTSIDE the repo (the wrapper ignores an in-repo IMPECCABLE_BIN).
fakeEngineDir = installFakeImpeccable('skill-e2e-fake-impeccable-').dir;
// Point the sample's rows at this diff's files so the review does not spend
// turns mapping a foreign fixture path; rule ids and snippets are unchanged.
const lineOf = (file: string, needle: string) => fs.readFileSync(path.join(designDir, file), 'utf-8').split('\n').findIndex(line => line.includes(needle)) + 1;
const locations: Array<[string, string, string]> = [['#8b5cf6', 'styles.css', 'linear-gradient'], ['#6366f1', 'styles.css', 'background: #6366f1'],
['#1e1b4b', 'styles.css', 'background: #1e1b4b'], ['<h3>', 'landing.html', '<h3>'], ['Purple', 'styles.css', 'linear-gradient'], ['streamline', 'landing.html', 'streamline']];
const rows = JSON.parse(fs.readFileSync(DETECT_SAMPLE, 'utf-8')).map((row: { snippet: string }) => {
const [, file, needle] = locations.find(([key]) => row.snippet.includes(key))!;
return { ...row, file, line: lineOf(file, needle) };
});
if (rows.some((row: { line: number }) => row.line < 1)) throw new Error('review-design-lite: a detector row did not map to the diff');
fs.writeFileSync(path.join(fakeEngineDir, 'landing-detect.json'), JSON.stringify(rows, null, 2));
});
afterAll(() => {
@@ -259,7 +270,7 @@ Important: The design checklist should catch issues like blacklisted fonts, smal
runId,
env: {
IMPECCABLE_BIN: path.join(fakeEngineDir, 'impeccable'),
IMPECCABLE_FAKE_OUTPUT: path.join(ROOT, 'test', 'fixtures', 'impeccable-detect-sample.json'),
IMPECCABLE_FAKE_OUTPUT: path.join(fakeEngineDir, 'landing-detect.json'),
},
});