mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-24 00:51:31 +01:00
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:
1 parent
593d7e1634
commit
ad65f62edf
12 files changed
+468
-52
No files matched your search
@@ -212,13 +212,14 @@ export function unquoteGitPath(p: string): string {
|
||||
return Buffer.from(bytes).toString('utf-8');
|
||||
}
|
||||
|
||||
/** A ---/+++ path; the caller drops the tab git appends after an unquoted name holding a space. */
|
||||
function stripPrefix(p: string, prefix: 'a/' | 'b/'): string {
|
||||
const u = unquoteGitPath(p);
|
||||
return u.startsWith(prefix) ? u.slice(2) : u;
|
||||
}
|
||||
|
||||
/** Split `diff --git a/x b/y` into (x, y); equal paths resolve exactly, renames with spaces fall back to the middle ` b/`. */
|
||||
function splitDiffGitLine(rest: string): [string, string] {
|
||||
export function splitDiffGitLine(rest: string): [string, string] {
|
||||
if (rest.startsWith('"')) {
|
||||
const m = /^("(?:[^"\\]|\\.)*") ("(?:[^"\\]|\\.)*")$/.exec(rest);
|
||||
if (m) return [stripPrefix(m[1], 'a/'), stripPrefix(m[2], 'b/')];
|
||||
@@ -284,8 +285,8 @@ function sectionToFile(sec: Section): FileDiff {
|
||||
else if (h.startsWith('copy to ')) { newPath = unquoteGitPath(h.slice(8)); status = 'copied'; }
|
||||
else if (h.startsWith('new file mode')) status = 'added';
|
||||
else if (h.startsWith('deleted file mode')) status = 'deleted';
|
||||
else if (h.startsWith('--- ') && !h.startsWith('--- /dev/null')) oldPath = stripPrefix(h.slice(4), 'a/');
|
||||
else if (h.startsWith('+++ ') && !h.startsWith('+++ /dev/null')) newPath = stripPrefix(h.slice(4), 'b/');
|
||||
else if (h.startsWith('--- ') && !h.startsWith('--- /dev/null')) oldPath = stripPrefix(h.slice(4).replace(/\t$/, ''), 'a/');
|
||||
else if (h.startsWith('+++ ') && !h.startsWith('+++ /dev/null')) newPath = stripPrefix(h.slice(4).replace(/\t$/, ''), 'b/');
|
||||
if (/\b120000\b/.test(h) && /mode/.test(h)) unsupported = 'symlink';
|
||||
if (/^index [0-9a-f]+\.\.[0-9a-f]+ 160000$/.test(h) || /\b160000\b/.test(h) && /mode/.test(h)) unsupported = 'submodule';
|
||||
if (h.startsWith('Binary files ')) unsupported = unsupported ?? 'binary';
|
||||
|
||||
Reference in new issue
Block a user