Results PRs with large agent transcripts can be reviewed again (GST-3273) (#4574)

Results PRs that commit captured agent sessions no longer stop at the 2
MB review limit: a data file kept in review only because a session
quotes a lint pragma, an env check or a `--no-verify` push now reaches
readers as those lines with context.

Why: harness-evals#494 (25 transcripts, 11.3 MB) could not be reviewed
at all. Only a strict set of files is cut, so anything in doubt still
goes to readers whole.

Nothing to do: the gate review still runs, and the change follows the
review policy you already have.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
Garry Tanandcapy-ai[bot] authored and GitHub committed 2026-11-20 21:34:22 +00:00
1 parent 593d7e1634
commit ad65f62edf
12 files changed
+468 -52

No files matched your search

+3 -3
View File
@@ -330,7 +330,7 @@ function ceiling(context: string, base: string, outDir: string, readers: Readonl
}
/**
* Each reader's secret-line excerpt, written once beside the briefs under its sha256 (the brief names the file, its bytes and
* Each reader's excerpt (secret-line and gate-tagged data files), written once beside the briefs under its sha256 (the brief names the file, its bytes and
* hash); a file the excerpt could not be built for moves to the reader's keep list, so its whole diff reaches the reader.
*/
function settleExcerpts(m: Manifest): void {
@@ -339,13 +339,13 @@ function settleExcerpts(m: Manifest): void {
function settleExcerpt(r: Pick<PassReader, 'reader' | 'exclude' | 'keep' | 'excerpt' | 'excerpt_file'>, diffBase: string, dir: string): void {
if (!r.excerpt?.length) return;
const d = selectionOf(diffBase, r.exclude, r.keep, r.excerpt);
if (!d.ok) throw new BriefError(`git diff ${diffBase} failed for ${r.reader}'s secret-line excerpt`);
if (!d.ok) throw new BriefError(`git diff ${diffBase} failed for ${r.reader}'s excerpt`);
const whole = r.excerpt.filter(s => d.whole?.includes(s));
if (whole.length) r.keep = [...(r.keep ?? []), ...whole];
r.excerpt = r.excerpt.filter(s => !whole.includes(s));
if (!r.excerpt.length || !d.excerpt) { delete r.excerpt; return; }
const sha256 = createHash('sha256').update(d.excerpt).digest('hex');
const file = path.join(dir, `secret-excerpt-${sha256.slice(0, 16)}.md`);
const file = path.join(dir, `excerpt-${sha256.slice(0, 16)}.md`);
fs.mkdirSync(path.dirname(file), { recursive: true, mode: 0o700 });
fs.writeFileSync(file, d.excerpt, { mode: 0o600 });
r.excerpt_file = { file, sha256, bytes: Buffer.byteLength(d.excerpt), files: r.excerpt.length };