Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
77a586d
chore(repo): add comment policy to AGENTS.md and trim cli/complete.ts…
Coly010 Sep 10, 2026
3f5497a
chore(repo): trim comments, shard 12 (538 -> 343 comment lines)
Coly010 Sep 10, 2026
5236220
chore(repo): trim comments, shard 06 (1740 -> 1192 comment lines)
Coly010 Sep 10, 2026
12f1da9
chore(repo): trim comments, shard 10 (1144 -> 582 comment lines)
Coly010 Sep 10, 2026
5ff1eee
chore(repo): trim comments, shard 08 (1021 -> 518 comment lines)
Coly010 Sep 10, 2026
4c38bd1
chore(repo): trim comments, shard 22 (1572 -> 855 comment lines)
Coly010 Sep 10, 2026
61cb528
chore(repo): trim comments, shard 11 (1742 -> 826 comment lines)
Coly010 Sep 10, 2026
22b2c1b
chore(repo): trim comments, shard 04 (1768 -> 835 comment lines)
Coly010 Sep 10, 2026
abce6d0
chore(repo): trim comments, shard 19 (533 -> 230 comment lines)
Coly010 Sep 10, 2026
21235cb
chore(repo): trim comments, shard 18 (765 -> 362 comment lines)
Coly010 Sep 10, 2026
a0b0265
chore(repo): trim comments, shard 06 (1010 -> 722 comment lines)
Coly010 Sep 10, 2026
1aace03
chore(repo): trim comments, shard 15 (1224 -> 675 comment lines)
Coly010 Sep 10, 2026
7bb39a4
chore(repo): trim comments, shard 13 (1568 -> 480 comment lines)
Coly010 Sep 10, 2026
48b4e0b
chore(repo): trim comments, shard 17 (1260 -> 735 comment lines)
Coly010 Sep 10, 2026
69a0118
chore(repo): trim comments, shard 14 (1764 -> 669 comment lines)
Coly010 Sep 10, 2026
cb26d73
chore(repo): trim comments, shard 07 (1776 -> 1160 comment lines)
Coly010 Sep 10, 2026
7fd38cc
chore(repo): trim comments, shard 21 (1569 -> 987 comment lines)
Coly010 Sep 10, 2026
e825aef
chore(repo): trim comments, shard 16 (1641 -> 725 comment lines)
Coly010 Sep 10, 2026
251f5aa
chore(repo): trim comments, shard 24 (1196 -> 525 comment lines)
Coly010 Sep 10, 2026
06afd75
chore(repo): trim comments, shard 25 (1607 -> 758 comment lines)
Coly010 Sep 10, 2026
525fdf1
chore(repo): trim comments, shard 20 (1739 -> 934 comment lines)
Coly010 Sep 10, 2026
ae2fcc5
chore(repo): trim comments, shard 30 (453 -> 248 comment lines)
Coly010 Sep 10, 2026
99d07a7
chore(repo): trim comments, shard 05 (1774 -> 769 comment lines)
Coly010 Sep 10, 2026
cd68a8b
chore(repo): trim comments, shard 23 (1599 -> 762 comment lines)
Coly010 Sep 10, 2026
ee11166
chore(repo): trim comments, shard 36 (455 -> 241 comment lines)
Coly010 Sep 10, 2026
b14974b
chore(repo): trim comments, shard 29 (693 -> 399 comment lines)
Coly010 Sep 10, 2026
db822a1
chore(repo): trim comments, shard 09 (1788 -> 1024 comment lines)
Coly010 Sep 10, 2026
6eff3a5
chore(repo): trim comments, shard 37 (714 -> 390 comment lines)
Coly010 Sep 10, 2026
a97dec5
chore(repo): trim comments, shard 28 (804 -> 405 comment lines)
Coly010 Sep 10, 2026
207d2a7
chore(repo): trim comments, shard 32 (697 -> 447 comment lines)
Coly010 Sep 10, 2026
4de8426
chore(repo): trim comments, shard 40 (1050 -> 732 comment lines)
Coly010 Sep 10, 2026
0374a15
chore(repo): fix stale comment pointers and tighten long headers (fin…
Coly010 Sep 10, 2026
75d6322
chore(repo): trim comments, shard 42 (845 -> 597 comment lines)
Coly010 Sep 10, 2026
9dbaf05
chore(repo): trim comments, shard 27 (957 -> 359 comment lines)
Coly010 Sep 10, 2026
134ab92
chore(repo): trim comments, shard 34 (1422 -> 719 comment lines)
Coly010 Sep 10, 2026
4bfa127
chore(repo): trim comments, shard 31 (1439 -> 677 comment lines)
Coly010 Sep 10, 2026
233e575
chore(repo): trim comments, shard 44 (1193 -> 373 comment lines)
Coly010 Sep 10, 2026
f6ee330
chore(repo): trim comments, shard 48 (330 -> 246 comment lines)
Coly010 Sep 10, 2026
afca53d
chore(repo): trim comments, shard 47 (299 -> 282 comment lines)
Coly010 Sep 10, 2026
52c7f19
chore(repo): trim comments, shard 26 (1591 -> 694 comment lines)
Coly010 Sep 10, 2026
0fdcbc9
chore(repo): tighten remaining long module headers (final pass 2)
Coly010 Sep 10, 2026
690925b
chore(repo): trim comments, shard 38 (1499 -> 614 comment lines)
Coly010 Sep 10, 2026
b31578c
chore(repo): trim comments, shard 39 (1529 -> 865 comment lines)
Coly010 Sep 10, 2026
afd2a16
chore(repo): tighten bearer-jwt docs, re-anchor misplaced JSDoc (fina…
Coly010 Sep 10, 2026
0737002
chore(repo): trim comments, shard 33 (1560 -> 723 comment lines)
Coly010 Sep 10, 2026
36b1b41
chore(cli): re-anchor describeWorker doc comment
Coly010 Sep 10, 2026
b4a483e
chore(repo): trim comments, shard 41 (1688 -> 1104 comment lines)
Coly010 Sep 10, 2026
04b5715
chore(repo): trim comments, shard 46 (776 -> 361 comment lines)
Coly010 Sep 10, 2026
73896b2
chore(repo): trim comments, shard 02 (534 -> 272 comment lines)
Coly010 Sep 10, 2026
6ea34fd
chore(repo): trim comments, shard 43 (1617 -> 679 comment lines)
Coly010 Sep 10, 2026
b0e532b
ci(repo): trim workflow and JSONC config comments (803 -> 507 comment…
Coly010 Sep 10, 2026
2f90e3f
chore(repo): trim comments, shard 01 (1037 -> 700 comment lines)
Coly010 Sep 10, 2026
6585746
chore(repo): trim comments, shard 35 (1611 -> 843 comment lines)
Coly010 Sep 10, 2026
3dd47f3
chore(cli): tighten stop teardown comment
Coly010 Sep 10, 2026
147280a
chore(repo): trim comments, shard 45 (1711 -> 744 comment lines)
Coly010 Sep 10, 2026
f010af1
chore(repo): sweep residual provenance comments and restore knip @pub…
Coly010 Sep 10, 2026
12db64f
chore(repo): merge origin/develop into chore/concise-comments
Coly010 Sep 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
38 changes: 7 additions & 31 deletions .github/scripts/ai-review/post-review.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ import {
truncateReviewBody,
} from "./post-review.ts";

// A single hunk touching file.ts lines 10-14 on the new side: line 10 is
// context, line 11 replaces a removed line, 12 is a pure addition, 13-14 are
// trailing context. Hand-computed RIGHT-side anchors: {10, 11, 12, 13, 14}.
// One hunk on file.ts; RIGHT-side anchors: {10, 11, 12, 13, 14}.
const SINGLE_HUNK_DIFF = `diff --git a/file.ts b/file.ts
index 111..222 100644
--- a/file.ts
Expand All @@ -41,8 +39,7 @@ index 111..222 100644
context line 14
`;

// Two hunks in the same file: {1,2,3} from the first hunk, {20,21,22} from
// the second (the RIGHT counter resets to each hunk's own header).
// Two hunks in one file; each resets the RIGHT counter to its own header.
const MULTI_HUNK_DIFF = `diff --git a/multi.ts b/multi.ts
index 1..2 100644
--- a/multi.ts
Expand Down Expand Up @@ -101,8 +98,7 @@ index 0..6
+line three
`;

// A trailing "\ No newline at end of file" marker on both sides must not
// perturb the RIGHT counter: anchors are still {1,2}.
// A trailing "\ No newline at end of file" marker must not perturb the RIGHT counter.
const NO_NEWLINE_DIFF = `diff --git a/nonewline.ts b/nonewline.ts
index 7..8 100644
--- a/nonewline.ts
Expand All @@ -115,9 +111,7 @@ index 7..8 100644
\\ No newline at end of file
`;

// git appends a literal TAB after a `+++` path that needs quoting (here,
// because it contains a space); the tab must be stripped so anchors key on
// "has space.ts", not "has space.ts\t".
// git appends a literal TAB after a quoted `+++` path; it must be stripped.
const TAB_PATH_DIFF = `diff --git a/has space.ts b/has space.ts
index 9..a 100644
--- a/has space.ts
Expand All @@ -127,10 +121,7 @@ index 9..a 100644
+added line
`;

// A pure rename (100% similarity) carries no `---`/`+++`/`@@` lines at all,
// followed by a normal file's diff — the parser must not leak state (e.g. a
// leftover `currentFile`) from the header-less rename section into the next
// file.
// A pure rename carries no `---`/`+++`/`@@` lines; state must not leak into the next file's diff.
const RENAME_ONLY_THEN_NORMAL_DIFF = `diff --git a/old-name.ts b/new-name.ts
similarity index 100%
rename from old-name.ts
Expand All @@ -144,10 +135,7 @@ index 1..2 100644
+added
`;

// An added line whose literal content is "++ b/not-a-real-header.ts" appears
// in the diff, prefixed by the diff's own "+", as "+++ b/not-a-real-header.ts"
// — a `+++`-lookalike that must not hijack `currentFile` because it occurs
// inside a hunk, not between a `diff --git` boundary and the first `@@`.
// An added line whose content looks like a `+++` header must not hijack `currentFile`.
const PLUS_LOOKALIKE_DIFF = `diff --git a/lookalike.ts b/lookalike.ts
index 1..2 100644
--- a/lookalike.ts
Expand Down Expand Up @@ -828,10 +816,6 @@ describe("buildReviewPayload", () => {
});

test("truncates the very first payload's body when it already exceeds the cap with zero comments to fold", () => {
// Not anchorable (line 999 is outside the diff hunk), so this produces a
// body-only payload with no inline comments — the 422-retry fold path
// never runs, so only truncating `buildReviewPayload`'s own body catches
// an oversized initial POST.
const finding = makeFinding({ file: "file.ts", line: 999, claim: "x".repeat(70_000) });
const review = makeMergedReview({ findings: [finding] });
const payload = buildReviewPayload(review, anchors, footer);
Expand Down Expand Up @@ -1045,10 +1029,7 @@ describe("post flow via injected ReviewIo", () => {
if (opts.failSupersede) {
return Promise.reject(new Error("listReviews failed"));
}
// Mirror real GitHub: a review posted earlier in the same run shows
// up in later listings as a marker-bearing bot review. The supersede
// pass must snapshot BEFORE posting or it would wrap the fresh
// review as "superseded" too.
// Mirrors real GitHub: a review posted earlier in the same run shows up in later listings.
const alreadyPosted = postedReviews.map((payload, i) => ({
id: 900 + i,
body: payload.body,
Expand Down Expand Up @@ -1141,9 +1122,6 @@ describe("post flow via injected ReviewIo", () => {

await postConsolidatedReview(io, 42, review, footer);

// With no prior AI review on the PR, nothing may be wrapped as superseded
// — especially not the review this run just posted (which the fake's
// listReviews, like real GitHub, includes in post-POST listings).
expect(postedReviews).toHaveLength(1);
expect(updatedReviews).toEqual([]);
expect(updatedComments).toEqual([]);
Expand Down Expand Up @@ -1230,8 +1208,6 @@ describe("post flow via injected ReviewIo", () => {
});

test("posts a truncated body on the very first attempt for an oversized body-only review (no comments to fold)", async () => {
// Not anchorable, so there's no inline comment for GitHub to 422 on — the
// old behavior threw here instead of posting a truncated body.
const finding = makeFinding({ file: "file.ts", line: 999, claim: "x".repeat(70_000) });
const review = makeMergedReview({ findings: [finding] });
const { io, postedReviews } = makeReviewIo({ diff: SINGLE_HUNK_DIFF });
Expand Down
Loading
Loading