example/code-review-companion
Add cross-file awareness to runReview
Threads a new crossFile option through the reviewer, but one caller downstream wasn't updated to match.
CriticalWarningSuggestion
Full diff context, line-anchored findings, saved to your history — one paste, not a chat window.
Start reviewing a PRsrc/review/runReview.ts
+1 -1
| 12 | 12 | const { files } = await fetchDiff(prUrl); |
| 13 | const findings = await runReview(files); | |
| 13 | const findings = await runReview(files, { crossFile: true }); | |
| 14 | 14 | return { |
| 15 | 15 | summary: summarize(findings), |
| 16 | 16 | findings, |
| 17 | 17 | }; |
src/webhooks/pullRequestHandler.ts
+4 -0
| 14 | 14 | const prUrl = payload.pull_request.html_url; |
| 15 | 15 | const { findings, summary } = await reviewPullRequest(prUrl); |
| 16 | if (findings.some((f) => f.severity === "critical")) { | |
| 17 | await notifySlackChannel(summary, findings); | |
| 18 | } | |
| 19 | ||
| 16 | 20 | await postReviewComment(prUrl, findings); |
| 17 | 21 | } |
notifySlackChannel is awaited before postReviewComment — if Slack fails, the PR comment never posts.
src/review/runReview.test.ts
+8 -0
| 20 | 20 | expect(findings).toHaveLength(0); |
| 21 | 21 | }); |
| 22 | ||
| 23 | it("flags cross-file signature drift", async () => { | |
| 24 | const files = [changedSignatureFile, staleCallerFile]; | |
| 25 | const findings = await runReview(files, { crossFile: true }); | |
| 26 | expect(findings.some((f) => f.category === "cross-file")).toBe(true); | |
| 27 | }); | |
| 22 | 28 | }); |
Assert on the specific finding's filePath too, not just its category.
example/code-review-companion
Threads a new crossFile option through the reviewer, but one caller downstream wasn't updated to match.
New crossFile option isn't threaded through every runReview call site — check other callers.