secondpair 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -3
- package/dist/bitbucket/auth.d.ts +13 -0
- package/dist/bitbucket/auth.js +37 -0
- package/dist/bitbucket/auth.js.map +1 -0
- package/dist/bitbucket/comments.d.ts +20 -14
- package/dist/bitbucket/comments.js +59 -45
- package/dist/bitbucket/comments.js.map +1 -1
- package/dist/cli.js +104 -43
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +11 -0
- package/dist/config.js +68 -4
- package/dist/config.js.map +1 -1
- package/dist/diff/github.d.ts +2 -0
- package/dist/diff/github.js +10 -0
- package/dist/diff/github.js.map +1 -1
- package/dist/finding-id.d.ts +5 -3
- package/dist/finding-id.js +18 -11
- package/dist/finding-id.js.map +1 -1
- package/dist/github/auth.d.ts +4 -0
- package/dist/github/auth.js +16 -0
- package/dist/github/auth.js.map +1 -0
- package/dist/github/comments.d.ts +11 -2
- package/dist/github/comments.js +30 -4
- package/dist/github/comments.js.map +1 -1
- package/dist/gitlab/auth.d.ts +11 -0
- package/dist/gitlab/auth.js +22 -0
- package/dist/gitlab/auth.js.map +1 -0
- package/dist/gitlab/comments.d.ts +10 -9
- package/dist/gitlab/comments.js +34 -27
- package/dist/gitlab/comments.js.map +1 -1
- package/dist/host.d.ts +3 -0
- package/dist/host.js +15 -0
- package/dist/host.js.map +1 -0
- package/dist/llm/prompt.d.ts +21 -0
- package/dist/llm/prompt.js +57 -1
- package/dist/llm/prompt.js.map +1 -1
- package/dist/report/cli.d.ts +8 -3
- package/dist/report/cli.js +11 -1
- package/dist/report/cli.js.map +1 -1
- package/dist/report/json.d.ts +5 -0
- package/dist/report/json.js +2 -0
- package/dist/report/json.js.map +1 -1
- package/dist/retry.d.ts +1 -0
- package/dist/retry.js +16 -0
- package/dist/retry.js.map +1 -0
- package/dist/review-state.d.ts +16 -0
- package/dist/review-state.js +24 -0
- package/dist/review-state.js.map +1 -0
- package/dist/review.d.ts +29 -0
- package/dist/review.js +165 -29
- package/dist/review.js.map +1 -1
- package/dist/specialized-review.d.ts +29 -0
- package/dist/specialized-review.js +50 -0
- package/dist/specialized-review.js.map +1 -0
- package/dist/types.d.ts +18 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comments.js","sourceRoot":"","sources":["../../src/gitlab/comments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpF,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"comments.js","sourceRoot":"","sources":["../../src/gitlab/comments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpF,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAoB,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,cAAc,EAAc,MAAM,WAAW,CAAC;AAQvD,SAAS,KAAK,CAAC,GAAU;IACvB,OAAO,GAAG,GAAG,CAAC,SAAS,oBAAoB,GAAG,CAAC,SAAS,mBAAmB,GAAG,CAAC,KAAK,EAAE,CAAC;AACzF,CAAC;AAED,KAAK,UAAU,OAAO,CAAC,GAAW,EAAE,OAAoB,EAAE;IACxD,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;QAC3B,GAAG,IAAI;QACP,OAAO,EAAE;YACP,eAAe,EAAE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C;IAC3F,CAAC;IAED,GAAG,CACD,kBAAkB,MAAM,uBAAuB;QAC7C,CAAC,OAAO,CAAC,CAAC,CAAC,aAAa,OAAO,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC;QACpD,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,YAAY,CAAC,MAAM,0BAA0B,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/E,GAAG,CACN,CAAC;IAEF,MAAM,WAAW,GAAG,MAAM,CAAC,cAAc,EAAE,QAAQ,IAAI,EAAE,CAAC;IAC1D,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3B,MAAM,QAAQ,GAAG,MAAM,0BAA0B,CAAC,GAAG,EAAE,WAAW,EAAE,GAAG,CAAC,CAAC;QACzE,IAAI,QAAQ;YAAE,GAAG,CAAC,oBAAoB,QAAQ,oCAAoC,CAAC,CAAC;IACtF,CAAC;AACH,CAAC"}
|
package/dist/host.d.ts
ADDED
package/dist/host.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Resolve which platform to talk to: explicit --host flag, else detected from CI env vars. */
|
|
2
|
+
export function detectHost(explicit) {
|
|
3
|
+
const env = process.env;
|
|
4
|
+
const host = explicit ??
|
|
5
|
+
(env.BITBUCKET_WORKSPACE || env.BITBUCKET_PR_ID
|
|
6
|
+
? "bitbucket"
|
|
7
|
+
: env.GITLAB_CI
|
|
8
|
+
? "gitlab"
|
|
9
|
+
: "github");
|
|
10
|
+
if (host !== "github" && host !== "bitbucket" && host !== "gitlab") {
|
|
11
|
+
throw new Error(`--host must be github, bitbucket, or gitlab, got "${explicit}".`);
|
|
12
|
+
}
|
|
13
|
+
return host;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=host.js.map
|
package/dist/host.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host.js","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAEA,+FAA+F;AAC/F,MAAM,UAAU,UAAU,CAAC,QAA4B;IACrD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IACxB,MAAM,IAAI,GACR,QAAQ;QACR,CAAC,GAAG,CAAC,mBAAmB,IAAI,GAAG,CAAC,eAAe;YAC7C,CAAC,CAAC,WAAW;YACb,CAAC,CAAC,GAAG,CAAC,SAAS;gBACb,CAAC,CAAC,QAAQ;gBACV,CAAC,CAAC,QAAQ,CAAC,CAAC;IAClB,IAAI,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,WAAW,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;QACnE,MAAM,IAAI,KAAK,CAAC,qDAAqD,QAAQ,IAAI,CAAC,CAAC;IACrF,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/llm/prompt.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { FileDiff, ReviewConfig } from "../types.js";
|
|
2
2
|
export declare const REVIEW_SYSTEM_PROMPT = "You are a senior software engineer reviewing a pull request. You are rigorous but pragmatic: you flag real problems, not style preferences the team hasn't asked for.\n\nReview the diff for these categories:\n- bug: logic errors, off-by-one mistakes, incorrect conditions, broken error handling, race conditions, wrong API usage\n- security: injection, unsafe deserialization, secrets in code, missing authorization or validation at trust boundaries, path traversal\n- missing-tests: changed or new behavior with no corresponding test change, especially branches and error paths\n- naming: identifiers inconsistent with the surrounding codebase's conventions, or misleading about what they do\n- complexity: functions that grew too long or deeply nested to reason about, duplicated logic that already exists elsewhere in the repo\n- custom: anything the repository's custom instructions ask you to flag\n\nRules:\n1. Comment ONLY on lines that appear as added (+) lines in the diff. Use the new-file line numbers printed at the start of each line.\n2. Use the REPOSITORY CONTEXT section (summaries and symbols of related files) to judge consistency, spot callers the change might break, and avoid flagging things the codebase already handles elsewhere. Do not report findings about context files themselves \u2014 only about the diff.\n3. Severity rubric:\n - critical: will corrupt data, break production, or is an exploitable vulnerability\n - high: incorrect behavior on realistic inputs, or a security weakness\n - medium: likely bug under edge cases, missing tests for risky logic, significant maintainability problem\n - low: minor issues worth fixing but not blocking\n - info: observations and suggestions, no action strictly required\n4. Report every real issue you find, including ones you are uncertain about \u2014 set confidence accordingly; a downstream filter handles thresholds. Do not pad the review with nitpicks to seem thorough.\n5. When you provide a suggestion, it must be a drop-in replacement for exactly the lines in start_line..end_line, complete and correctly indented.\n6. Keep each finding's body focused: what is wrong, why it matters, how to fix it.\n7. When the REPOSITORY CONTEXT contradicts a suspicion (the pattern is established elsewhere, a caller already handles the case, a convention explains the choice), do not report it as high or critical unless you can cite the specific added lines that break it \u2014 cite that evidence in the body, or lower the severity and confidence accordingly. Never report a critical/high finding that rests on guesses about code you cannot see.";
|
|
3
|
+
export declare const HIGH_LEVEL_SYSTEM_PROMPT = "You are a senior software engineer giving a high-level-only review of a large pull request. It is too large for a thorough line-by-line pass, so this review only surfaces the issues serious enough to matter regardless.\n\nReview categories: bug, security, missing-tests, naming, complexity, custom (same meanings as a normal review).\n\nRules:\n1. Comment ONLY on lines that appear as added (+) lines in the diff. Use the new-file line numbers printed at the start of each line.\n2. Report ONLY critical and high severity findings \u2014 architectural risks, likely bugs, security issues. Do not report medium, low, or info findings in this pass.\n3. In your summary, explicitly recommend splitting this PR into smaller, independently reviewable pieces, and say why \u2014 do not soften or omit this recommendation.\n4. Never report a critical/high finding that rests on guesses about code you cannot see \u2014 cite the specific added lines that justify it.";
|
|
4
|
+
export declare const SECURITY_LENS_SYSTEM_PROMPT = "You are a senior application security engineer reviewing a pull request. You ONLY report the \"security\" category: injection, unsafe deserialization, secrets in code, missing authorization or validation at trust boundaries, path traversal, and similar exploitable weaknesses. Do not report bugs, missing tests, naming, or complexity issues \u2014 other reviewers own those; report only what a specialized security pass would catch.\n\nRules:\n1. Comment ONLY on lines that appear as added (+) lines in the diff. Use the new-file line numbers printed at the start of each line.\n2. Use the REPOSITORY CONTEXT section (when present) to judge consistency and spot callers the change might break. Do not report findings about context files themselves \u2014 only about the diff.\n3. Severity rubric:\n - critical: will corrupt data, break production, or is an exploitable vulnerability\n - high: incorrect behavior on realistic inputs, or a security weakness\n - medium: likely bug under edge cases, missing tests for risky logic, significant maintainability problem\n - low: minor issues worth fixing but not blocking\n - info: observations and suggestions, no action strictly required\n4. Report every real issue you find, including ones you are uncertain about \u2014 set confidence accordingly; a downstream filter handles thresholds. Do not pad the review with nitpicks to seem thorough.\n5. When you provide a suggestion, it must be a drop-in replacement for exactly the lines in start_line..end_line, complete and correctly indented.\n6. Keep each finding's body focused: what is wrong, why it matters, how to fix it.\n7. Never report a critical/high finding that rests on guesses about code you cannot see \u2014 cite the specific added lines that justify it.";
|
|
5
|
+
export declare const CORRECTNESS_LENS_SYSTEM_PROMPT = "You are a senior software engineer reviewing a pull request for correctness. You ONLY report these categories:\n- bug: logic errors, off-by-one mistakes, incorrect conditions, broken error handling, race conditions, wrong API usage\n- missing-tests: changed or new behavior with no corresponding test change, especially branches and error paths\nDo not report security, naming, or complexity issues \u2014 other reviewers own those.\n\nRules:\n1. Comment ONLY on lines that appear as added (+) lines in the diff. Use the new-file line numbers printed at the start of each line.\n2. Use the REPOSITORY CONTEXT section (when present) to judge consistency and spot callers the change might break. Do not report findings about context files themselves \u2014 only about the diff.\n3. Severity rubric:\n - critical: will corrupt data, break production, or is an exploitable vulnerability\n - high: incorrect behavior on realistic inputs, or a security weakness\n - medium: likely bug under edge cases, missing tests for risky logic, significant maintainability problem\n - low: minor issues worth fixing but not blocking\n - info: observations and suggestions, no action strictly required\n4. Report every real issue you find, including ones you are uncertain about \u2014 set confidence accordingly; a downstream filter handles thresholds. Do not pad the review with nitpicks to seem thorough.\n5. When you provide a suggestion, it must be a drop-in replacement for exactly the lines in start_line..end_line, complete and correctly indented.\n6. Keep each finding's body focused: what is wrong, why it matters, how to fix it.\n7. Never report a critical/high finding that rests on guesses about code you cannot see \u2014 cite the specific added lines that justify it.";
|
|
6
|
+
export declare const QUALITY_LENS_SYSTEM_PROMPT = "You are a senior software engineer reviewing a pull request for code quality and maintainability. You ONLY report these categories:\n- naming: identifiers inconsistent with the surrounding codebase's conventions, or misleading about what they do\n- complexity: functions that grew too long or deeply nested to reason about, duplicated logic that already exists elsewhere in the repo\n- custom: anything the repository's custom instructions ask you to flag\nDo not report bugs, missing tests, or security issues \u2014 other reviewers own those.\n\nRules:\n1. Comment ONLY on lines that appear as added (+) lines in the diff. Use the new-file line numbers printed at the start of each line.\n2. Use the REPOSITORY CONTEXT section (when present) to judge consistency and spot callers the change might break. Do not report findings about context files themselves \u2014 only about the diff.\n3. Severity rubric:\n - critical: will corrupt data, break production, or is an exploitable vulnerability\n - high: incorrect behavior on realistic inputs, or a security weakness\n - medium: likely bug under edge cases, missing tests for risky logic, significant maintainability problem\n - low: minor issues worth fixing but not blocking\n - info: observations and suggestions, no action strictly required\n4. Report every real issue you find, including ones you are uncertain about \u2014 set confidence accordingly; a downstream filter handles thresholds. Do not pad the review with nitpicks to seem thorough.\n5. When you provide a suggestion, it must be a drop-in replacement for exactly the lines in start_line..end_line, complete and correctly indented.\n6. Keep each finding's body focused: what is wrong, why it matters, how to fix it.\n7. Never report a critical/high finding that rests on guesses about code you cannot see \u2014 cite the specific added lines that justify it.";
|
|
3
7
|
export declare const CRITIQUE_SYSTEM_PROMPT = "You are re-reading your own PR review before it is posted. Your ONLY job is to remove findings you would walk back if a developer pushed back \u2014 speculative issues, style opinions dressed as bugs, problems the surrounding code or repository context already handles, or duplicates.\n\nRules:\n1. You may ONLY drop findings. Never edit, merge, reword, or add findings.\n2. Keep every finding you would defend in a face-to-face review \u2014 when in doubt, keep it. Dropping a real bug is far worse than keeping a borderline nitpick.\n3. Return the ids of the findings to KEEP.";
|
|
4
8
|
export declare function buildCritiqueUserPrompt(input: {
|
|
5
9
|
findings: {
|
|
@@ -12,6 +16,21 @@ export declare function buildCritiqueUserPrompt(input: {
|
|
|
12
16
|
}[];
|
|
13
17
|
changeDescription: string;
|
|
14
18
|
}): string;
|
|
19
|
+
export declare const DEDUP_SYSTEM_PROMPT = "You are comparing NEW pull-request review findings against PRIOR findings already posted as comments on the same PR. Findings can be worded very differently (different title, different body) yet describe the exact same underlying issue in the exact same code.\n\nRules:\n1. Match a new finding to a prior one ONLY when they are in the same file and describe the same root cause \u2014 not merely the same category or nearby lines.\n2. A new finding about a genuinely different problem in the same file/lines is NOT a duplicate, even if related.\n3. Return only the pairs you are confident are duplicates.";
|
|
20
|
+
export declare function buildDedupUserPrompt(input: {
|
|
21
|
+
newFindings: {
|
|
22
|
+
id?: string;
|
|
23
|
+
file: string;
|
|
24
|
+
start_line: number;
|
|
25
|
+
title: string;
|
|
26
|
+
body: string;
|
|
27
|
+
}[];
|
|
28
|
+
priorFindings: {
|
|
29
|
+
id?: string;
|
|
30
|
+
file: string;
|
|
31
|
+
title: string;
|
|
32
|
+
}[];
|
|
33
|
+
}): string;
|
|
15
34
|
export interface ReviewPromptInput {
|
|
16
35
|
files: FileDiff[];
|
|
17
36
|
/** Rendered repository context from the codemap; empty when no index exists. */
|
|
@@ -19,5 +38,7 @@ export interface ReviewPromptInput {
|
|
|
19
38
|
config: ReviewConfig;
|
|
20
39
|
/** e.g. "PR #42: Add session refresh" or "local diff vs origin/main" */
|
|
21
40
|
changeDescription: string;
|
|
41
|
+
/** Rendered `detectSignals` output; empty when signal_detector is off or nothing fired. */
|
|
42
|
+
signals?: string;
|
|
22
43
|
}
|
|
23
44
|
export declare function buildReviewUserPrompt(input: ReviewPromptInput): string;
|
package/dist/llm/prompt.js
CHANGED
|
@@ -22,6 +22,44 @@ Rules:
|
|
|
22
22
|
5. When you provide a suggestion, it must be a drop-in replacement for exactly the lines in start_line..end_line, complete and correctly indented.
|
|
23
23
|
6. Keep each finding's body focused: what is wrong, why it matters, how to fix it.
|
|
24
24
|
7. When the REPOSITORY CONTEXT contradicts a suspicion (the pattern is established elsewhere, a caller already handles the case, a convention explains the choice), do not report it as high or critical unless you can cite the specific added lines that break it — cite that evidence in the body, or lower the severity and confidence accordingly. Never report a critical/high finding that rests on guesses about code you cannot see.`;
|
|
25
|
+
export const HIGH_LEVEL_SYSTEM_PROMPT = `You are a senior software engineer giving a high-level-only review of a large pull request. It is too large for a thorough line-by-line pass, so this review only surfaces the issues serious enough to matter regardless.
|
|
26
|
+
|
|
27
|
+
Review categories: bug, security, missing-tests, naming, complexity, custom (same meanings as a normal review).
|
|
28
|
+
|
|
29
|
+
Rules:
|
|
30
|
+
1. Comment ONLY on lines that appear as added (+) lines in the diff. Use the new-file line numbers printed at the start of each line.
|
|
31
|
+
2. Report ONLY critical and high severity findings — architectural risks, likely bugs, security issues. Do not report medium, low, or info findings in this pass.
|
|
32
|
+
3. In your summary, explicitly recommend splitting this PR into smaller, independently reviewable pieces, and say why — do not soften or omit this recommendation.
|
|
33
|
+
4. Never report a critical/high finding that rests on guesses about code you cannot see — cite the specific added lines that justify it.`;
|
|
34
|
+
const REVIEW_RULES = `Rules:
|
|
35
|
+
1. Comment ONLY on lines that appear as added (+) lines in the diff. Use the new-file line numbers printed at the start of each line.
|
|
36
|
+
2. Use the REPOSITORY CONTEXT section (when present) to judge consistency and spot callers the change might break. Do not report findings about context files themselves — only about the diff.
|
|
37
|
+
3. Severity rubric:
|
|
38
|
+
- critical: will corrupt data, break production, or is an exploitable vulnerability
|
|
39
|
+
- high: incorrect behavior on realistic inputs, or a security weakness
|
|
40
|
+
- medium: likely bug under edge cases, missing tests for risky logic, significant maintainability problem
|
|
41
|
+
- low: minor issues worth fixing but not blocking
|
|
42
|
+
- info: observations and suggestions, no action strictly required
|
|
43
|
+
4. Report every real issue you find, including ones you are uncertain about — set confidence accordingly; a downstream filter handles thresholds. Do not pad the review with nitpicks to seem thorough.
|
|
44
|
+
5. When you provide a suggestion, it must be a drop-in replacement for exactly the lines in start_line..end_line, complete and correctly indented.
|
|
45
|
+
6. Keep each finding's body focused: what is wrong, why it matters, how to fix it.
|
|
46
|
+
7. Never report a critical/high finding that rests on guesses about code you cannot see — cite the specific added lines that justify it.`;
|
|
47
|
+
export const SECURITY_LENS_SYSTEM_PROMPT = `You are a senior application security engineer reviewing a pull request. You ONLY report the "security" category: injection, unsafe deserialization, secrets in code, missing authorization or validation at trust boundaries, path traversal, and similar exploitable weaknesses. Do not report bugs, missing tests, naming, or complexity issues — other reviewers own those; report only what a specialized security pass would catch.
|
|
48
|
+
|
|
49
|
+
${REVIEW_RULES}`;
|
|
50
|
+
export const CORRECTNESS_LENS_SYSTEM_PROMPT = `You are a senior software engineer reviewing a pull request for correctness. You ONLY report these categories:
|
|
51
|
+
- bug: logic errors, off-by-one mistakes, incorrect conditions, broken error handling, race conditions, wrong API usage
|
|
52
|
+
- missing-tests: changed or new behavior with no corresponding test change, especially branches and error paths
|
|
53
|
+
Do not report security, naming, or complexity issues — other reviewers own those.
|
|
54
|
+
|
|
55
|
+
${REVIEW_RULES}`;
|
|
56
|
+
export const QUALITY_LENS_SYSTEM_PROMPT = `You are a senior software engineer reviewing a pull request for code quality and maintainability. You ONLY report these categories:
|
|
57
|
+
- naming: identifiers inconsistent with the surrounding codebase's conventions, or misleading about what they do
|
|
58
|
+
- complexity: functions that grew too long or deeply nested to reason about, duplicated logic that already exists elsewhere in the repo
|
|
59
|
+
- custom: anything the repository's custom instructions ask you to flag
|
|
60
|
+
Do not report bugs, missing tests, or security issues — other reviewers own those.
|
|
61
|
+
|
|
62
|
+
${REVIEW_RULES}`;
|
|
25
63
|
export const CRITIQUE_SYSTEM_PROMPT = `You are re-reading your own PR review before it is posted. Your ONLY job is to remove findings you would walk back if a developer pushed back — speculative issues, style opinions dressed as bugs, problems the surrounding code or repository context already handles, or duplicates.
|
|
26
64
|
|
|
27
65
|
Rules:
|
|
@@ -34,11 +72,26 @@ export function buildCritiqueUserPrompt(input) {
|
|
|
34
72
|
.join("\n");
|
|
35
73
|
return `Change under review: ${input.changeDescription}\n\n# FINDINGS\n${list}\n\nReturn the ids to keep.`;
|
|
36
74
|
}
|
|
75
|
+
export const DEDUP_SYSTEM_PROMPT = `You are comparing NEW pull-request review findings against PRIOR findings already posted as comments on the same PR. Findings can be worded very differently (different title, different body) yet describe the exact same underlying issue in the exact same code.
|
|
76
|
+
|
|
77
|
+
Rules:
|
|
78
|
+
1. Match a new finding to a prior one ONLY when they are in the same file and describe the same root cause — not merely the same category or nearby lines.
|
|
79
|
+
2. A new finding about a genuinely different problem in the same file/lines is NOT a duplicate, even if related.
|
|
80
|
+
3. Return only the pairs you are confident are duplicates.`;
|
|
81
|
+
export function buildDedupUserPrompt(input) {
|
|
82
|
+
const prior = input.priorFindings
|
|
83
|
+
.map((f) => `- id: ${f.id}\n file: ${f.file}\n title: ${f.title}`)
|
|
84
|
+
.join("\n");
|
|
85
|
+
const news = input.newFindings
|
|
86
|
+
.map((f) => `- id: ${f.id}\n location: ${f.file}:${f.start_line}\n title: ${f.title}\n body: ${f.body}`)
|
|
87
|
+
.join("\n");
|
|
88
|
+
return `# PRIOR FINDINGS (already posted on this PR)\n${prior}\n\n# NEW FINDINGS (candidates to post)\n${news}\n\nReturn the new_id/prior_id pairs that are duplicates.`;
|
|
89
|
+
}
|
|
37
90
|
export function buildReviewUserPrompt(input) {
|
|
38
91
|
const parts = [];
|
|
39
92
|
parts.push(`Reviewing: ${input.changeDescription}`);
|
|
40
93
|
if (input.config.custom_instructions.trim()) {
|
|
41
|
-
parts.push(`# CUSTOM REVIEW INSTRUCTIONS (
|
|
94
|
+
parts.push(`# CUSTOM REVIEW INSTRUCTIONS (repository-provided)\n${input.config.custom_instructions.trim()}`);
|
|
42
95
|
}
|
|
43
96
|
if (input.context.trim()) {
|
|
44
97
|
parts.push(`# REPOSITORY CONTEXT\nSummaries and exported symbols of files related to this change (importers listed first — they depend on the changed code):\n\n${input.context}`);
|
|
@@ -46,6 +99,9 @@ export function buildReviewUserPrompt(input) {
|
|
|
46
99
|
else {
|
|
47
100
|
parts.push(`# REPOSITORY CONTEXT\n(none available — no codemap index; review the diff on its own)`);
|
|
48
101
|
}
|
|
102
|
+
if (input.signals?.trim()) {
|
|
103
|
+
parts.push(`# SIGNALS\nDeterministic pointers into added lines that touch error handling, control flow, or framework hooks. Not findings by themselves — use them to decide where to look closer.\n\n${input.signals.trim()}`);
|
|
104
|
+
}
|
|
49
105
|
const diffs = input.files.map((f) => renderDiffForPrompt(f)).join("\n\n");
|
|
50
106
|
parts.push(`# DIFF\nEach line is prefixed with its new-file line number. Only '+' lines are commentable.\n\n${diffs}`);
|
|
51
107
|
return parts.join("\n\n");
|
package/dist/llm/prompt.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/llm/prompt.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,MAAM,CAAC,MAAM,oBAAoB,GAAG;;;;;;;;;;;;;;;;;;;;;;8aAsB0Y,CAAC;AAE/a,MAAM,CAAC,MAAM,sBAAsB,GAAG;;;;;2CAKK,CAAC;AAE5C,MAAM,UAAU,uBAAuB,CAAC,KAGvC;IACC,MAAM,IAAI,GAAG,KAAK,CAAC,QAAQ;SACxB,GAAG,CACF,CAAC,CAAC,EAAE,EAAE,CACJ,SAAS,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,UAAU,KAAK,CAAC,CAAC,QAAQ,eAAe,CAAC,CAAC,KAAK,aAAa,CAAC,CAAC,IAAI,EAAE,CACjH;SACA,IAAI,CAAC,IAAI,CAAC,CAAC;IACd,OAAO,wBAAwB,KAAK,CAAC,iBAAiB,mBAAmB,IAAI,6BAA6B,CAAC;AAC7G,CAAC;
|
|
1
|
+
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/llm/prompt.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,MAAM,CAAC,MAAM,oBAAoB,GAAG;;;;;;;;;;;;;;;;;;;;;;8aAsB0Y,CAAC;AAE/a,MAAM,CAAC,MAAM,wBAA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10 @@
|
|
|
1
1
|
import { type Finding, type ReviewResult, type Severity } from "../types.js";
|
|
2
|
-
export declare function formatReport(result: ReviewResult
|
|
2
|
+
export declare function formatReport(result: ReviewResult & {
|
|
3
|
+
highLevelReview?: boolean;
|
|
4
|
+
reviewBrief?: {
|
|
5
|
+
blastRadius: string[];
|
|
6
|
+
};
|
|
7
|
+
}): string;
|
|
3
8
|
export declare function summaryCounts(findings: Finding[]): string;
|
|
4
|
-
/** True when any finding meets or exceeds the fail_on severity threshold. */
|
|
5
|
-
export declare function shouldFail(findings: Finding[], failOn: Severity): boolean;
|
|
9
|
+
/** True when any finding meets or exceeds the fail_on severity threshold. "off" never fails. */
|
|
10
|
+
export declare function shouldFail(findings: Finding[], failOn: Severity | "off"): boolean;
|
package/dist/report/cli.js
CHANGED
|
@@ -11,8 +11,16 @@ export function formatReport(result) {
|
|
|
11
11
|
const lines = [];
|
|
12
12
|
lines.push(pc.bold("PR Review"));
|
|
13
13
|
lines.push("");
|
|
14
|
+
if (result.highLevelReview) {
|
|
15
|
+
lines.push(pc.yellow("⚠ Large diff — high-level review only (critical/high). Consider splitting this PR."));
|
|
16
|
+
lines.push("");
|
|
17
|
+
}
|
|
14
18
|
lines.push(result.summary.trim());
|
|
15
19
|
lines.push("");
|
|
20
|
+
if (result.reviewBrief?.blastRadius.length) {
|
|
21
|
+
lines.push(pc.dim(`blast radius: ${result.reviewBrief.blastRadius.length} downstream file(s)`));
|
|
22
|
+
lines.push("");
|
|
23
|
+
}
|
|
16
24
|
if (result.findings.length === 0) {
|
|
17
25
|
lines.push(pc.green("✓ No findings."));
|
|
18
26
|
return lines.join("\n");
|
|
@@ -55,8 +63,10 @@ export function summaryCounts(findings) {
|
|
|
55
63
|
.map(([sev, n]) => `${n} ${sev}`);
|
|
56
64
|
return pc.bold(`${findings.length} finding(s): ${parts.join(", ")}`);
|
|
57
65
|
}
|
|
58
|
-
/** True when any finding meets or exceeds the fail_on severity threshold. */
|
|
66
|
+
/** True when any finding meets or exceeds the fail_on severity threshold. "off" never fails. */
|
|
59
67
|
export function shouldFail(findings, failOn) {
|
|
68
|
+
if (failOn === "off")
|
|
69
|
+
return false;
|
|
60
70
|
const threshold = severityRank(failOn);
|
|
61
71
|
return findings.some((f) => severityRank(f.severity) <= threshold);
|
|
62
72
|
}
|
package/dist/report/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/report/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAkD,MAAM,aAAa,CAAC;AAE3F,MAAM,cAAc,GAA4C;IAC9D,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;IAC3D,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IACpC,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IACzC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IACpC,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;CACrC,CAAC;AAEF,MAAM,UAAU,YAAY,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/report/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAkD,MAAM,aAAa,CAAC;AAE3F,MAAM,cAAc,GAA4C;IAC9D,QAAQ,EAAE,CAAC,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AAED,MAAM,UAAU,aAAa,CAAC,QAAmB;IAC/C,MAAM,MAAM,GAAG,IAAI,GAAG,EAAoB,CAAC;IAC3C,KAAK,MAAM,CAAC,IAAI,QAAQ;QAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACpF,MAAM,KAAK,GAAG,CAAC,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;SAChC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACvD,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC;IACpC,OAAO,EAAE,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,gBAAgB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvE,CAAC;AAED,gGAAgG;AAChG,MAAM,UAAU,UAAU,CAAC,QAAmB,EAAE,MAAwB;IACtE,IAAI,MAAM,KAAK,KAAK;QAAE,OAAO,KAAK,CAAC;IACnC,MAAM,SAAS,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IACvC,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,SAAS,CAAC,CAAC;AACrE,CAAC"}
|
package/dist/report/json.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ReviewBrief } from "../review.js";
|
|
1
2
|
import type { Finding, Reconciliation, ReviewResult, RunStats } from "../types.js";
|
|
2
3
|
export interface JsonReport {
|
|
3
4
|
meta: {
|
|
@@ -10,9 +11,13 @@ export interface JsonReport {
|
|
|
10
11
|
findings: ReviewResult["findings"];
|
|
11
12
|
reconciliation?: Reconciliation;
|
|
12
13
|
stats?: RunStats;
|
|
14
|
+
highLevelReview?: boolean;
|
|
15
|
+
reviewBrief?: ReviewBrief;
|
|
13
16
|
}
|
|
14
17
|
export declare function buildJsonReport(result: ReviewResult & {
|
|
15
18
|
stats?: RunStats;
|
|
19
|
+
highLevelReview?: boolean;
|
|
20
|
+
reviewBrief?: ReviewBrief;
|
|
16
21
|
}, meta: {
|
|
17
22
|
model: string;
|
|
18
23
|
changeDescription: string;
|
package/dist/report/json.js
CHANGED
|
@@ -7,6 +7,8 @@ export function buildJsonReport(result, meta) {
|
|
|
7
7
|
findings: result.findings,
|
|
8
8
|
reconciliation: result.reconciliation,
|
|
9
9
|
stats: result.stats,
|
|
10
|
+
highLevelReview: result.highLevelReview,
|
|
11
|
+
reviewBrief: result.reviewBrief,
|
|
10
12
|
};
|
|
11
13
|
}
|
|
12
14
|
/** One structured log line for CI parsing: counts, tokens, model. */
|
package/dist/report/json.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../src/report/json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../src/report/json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAmBvD,MAAM,UAAU,eAAe,CAC7B,MAAiG,EACjG,IAAwE;IAExE,OAAO;QACL,IAAI,EAAE,EAAE,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE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AAE,CAAC,WAAW,EAAE,CAAC,CAAC;QAC1E,KAAK,MAAM,EAAE,IAAI,GAAG,CAAC,cAAc,EAAE,UAAU,IAAI,EAAE;YAAE,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;IACnF,CAAC;IAAC,MAAM,CAAC;QACP,YAAY;IACd,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,iFAAiF;AACjF,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,UAAkB;IAC3D,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC;QAAE,OAAO,EAAE,CAAC;IACvC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,CAExD,CAAC;QACF,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC;IAC1F,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
|
package/dist/retry.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function withRetry<T>(fn: () => Promise<T>, attempts?: number): Promise<T>;
|
package/dist/retry.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export async function withRetry(fn, attempts = 3) {
|
|
2
|
+
let last;
|
|
3
|
+
for (let i = 0; i < attempts; i++) {
|
|
4
|
+
try {
|
|
5
|
+
return await fn();
|
|
6
|
+
}
|
|
7
|
+
catch (err) {
|
|
8
|
+
last = err;
|
|
9
|
+
if (i < attempts - 1) {
|
|
10
|
+
await new Promise((r) => setTimeout(r, 500 * 2 ** i));
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
throw last;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=retry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry.js","sourceRoot":"","sources":["../src/retry.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,KAAK,UAAU,SAAS,CAAI,EAAoB,EAAE,QAAQ,GAAG,CAAC;IACnE,IAAI,IAAa,CAAC;IAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC;QAClC,IAAI,CAAC;YACH,OAAO,MAAM,EAAE,EAAE,CAAC;QACpB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,GAAG,GAAG,CAAC;YACX,IAAI,CAAC,GAAG,QAAQ,GAAG,CAAC,EAAE,CAAC;gBACrB,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACxD,CAAC;QACH,CAAC;IACH,CAAC;IACD,MAAM,IAAI,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Finding } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Full review state (head sha + every active finding) embedded in the
|
|
4
|
+
* summary comment, so the next CI run — a fresh checkout with no local
|
|
5
|
+
* report file — can recover exactly what was found last time without
|
|
6
|
+
* scraping/re-parsing individual inline comments. Same encoding on every
|
|
7
|
+
* platform: only "fetch the latest agent summary comment" differs.
|
|
8
|
+
*/
|
|
9
|
+
export interface ReviewState {
|
|
10
|
+
headSha: string;
|
|
11
|
+
findings: Finding[];
|
|
12
|
+
}
|
|
13
|
+
/** Append (or replace) the hidden state blob at the end of a summary comment body. */
|
|
14
|
+
export declare function embedReviewState(body: string, state: ReviewState): string;
|
|
15
|
+
/** Recover the previously embedded state, or null if absent/corrupt. */
|
|
16
|
+
export declare function parseReviewState(body: string): ReviewState | null;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const STATE_MARKER_PREFIX = "[secondpair-state]: # (";
|
|
2
|
+
const STATE_RE = /\[secondpair-state\]:\s*#\s*\(([A-Za-z0-9+/=]+)\)/;
|
|
3
|
+
/** Append (or replace) the hidden state blob at the end of a summary comment body. */
|
|
4
|
+
export function embedReviewState(body, state) {
|
|
5
|
+
const encoded = Buffer.from(JSON.stringify(state), "utf8").toString("base64");
|
|
6
|
+
const stripped = body.replace(STATE_RE, "").trimEnd();
|
|
7
|
+
return `${stripped}\n\n${STATE_MARKER_PREFIX}${encoded})`;
|
|
8
|
+
}
|
|
9
|
+
/** Recover the previously embedded state, or null if absent/corrupt. */
|
|
10
|
+
export function parseReviewState(body) {
|
|
11
|
+
const m = STATE_RE.exec(body);
|
|
12
|
+
if (!m)
|
|
13
|
+
return null;
|
|
14
|
+
try {
|
|
15
|
+
const parsed = JSON.parse(Buffer.from(m[1], "base64").toString("utf8"));
|
|
16
|
+
if (typeof parsed?.headSha === "string" && Array.isArray(parsed.findings))
|
|
17
|
+
return parsed;
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=review-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-state.js","sourceRoot":"","sources":["../src/review-state.ts"],"names":[],"mappings":"AAcA,MAAM,mBAAmB,GAAG,yBAAyB,CAAC;AACtD,MAAM,QAAQ,GAAG,mDAAmD,CAAC;AAErE,sFAAsF;AACtF,MAAM,UAAU,gBAAgB,CAAC,IAAY,EAAE,KAAkB;IAC/D,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC9E,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;IACtD,OAAO,GAAG,QAAQ,OAAO,mBAAmB,GAAG,OAAO,GAAG,CAAC;AAC5D,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,MAAM,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9B,IAAI,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;QACxE,IAAI,OAAO,MAAM,EAAE,OAAO,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC;YAAE,OAAO,MAAM,CAAC;QACzF,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
package/dist/review.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ContextEntry, type Signal } from "repocairn";
|
|
1
2
|
import { type FileDiff, type Finding, type ReviewConfig, type ReviewResult, type RunStats } from "./types.js";
|
|
2
3
|
export interface RunReviewOptions {
|
|
3
4
|
cwd: string;
|
|
@@ -12,13 +13,41 @@ export interface RunReviewOptions {
|
|
|
12
13
|
previousFindings?: import("./reconcile.js").PreviousFinding[];
|
|
13
14
|
/** Ids listed in `.pr-review-suppressions.yml`. */
|
|
14
15
|
suppressedIds?: Iterable<string>;
|
|
16
|
+
/**
|
|
17
|
+
* Paths changed since the last reviewed commit. When set, only these
|
|
18
|
+
* files are sent to the LLM — everything else in the diff is assumed
|
|
19
|
+
* untouched since the last review and skipped entirely (see
|
|
20
|
+
* `carryForwardFindings`). Undefined means a full review of every file.
|
|
21
|
+
*/
|
|
22
|
+
changedFiles?: Set<string>;
|
|
23
|
+
/**
|
|
24
|
+
* Findings from files NOT in `changedFiles` (untouched since the last
|
|
25
|
+
* review) — merged straight into the result as persistent, without any
|
|
26
|
+
* LLM call, since nothing about them could have changed.
|
|
27
|
+
*/
|
|
28
|
+
carryForwardFindings?: Finding[];
|
|
15
29
|
log?: (msg: string) => void;
|
|
16
30
|
}
|
|
17
31
|
export interface RunReviewOutput extends ReviewResult {
|
|
18
32
|
files: FileDiff[];
|
|
19
33
|
usedContext: boolean;
|
|
20
34
|
stats: RunStats;
|
|
35
|
+
/** Files that import the changed files, ranked by import count — the "blast radius" of this PR. */
|
|
36
|
+
blastRadius: ContextEntry[];
|
|
37
|
+
/** True if the diff exceeded `huge_pr_token_threshold` and only a critical/high, split-recommending pass ran. */
|
|
38
|
+
highLevelReview: boolean;
|
|
39
|
+
/** Deterministic summary of the change, assembled from Phase A/B output before any LLM call. */
|
|
40
|
+
reviewBrief: ReviewBrief;
|
|
21
41
|
}
|
|
42
|
+
export interface ReviewBrief {
|
|
43
|
+
files: string[];
|
|
44
|
+
/** Paths of files that import the changed files (blastRadius, path-only). */
|
|
45
|
+
blastRadius: string[];
|
|
46
|
+
signals: Signal[];
|
|
47
|
+
totalTokens: number;
|
|
48
|
+
}
|
|
49
|
+
/** Sum of the same per-file token cost `chunkFiles` uses, across the whole diff. */
|
|
50
|
+
export declare function totalDiffTokens(files: FileDiff[]): number;
|
|
22
51
|
export declare function runReview(opts: RunReviewOptions): Promise<RunReviewOutput>;
|
|
23
52
|
/**
|
|
24
53
|
* Collapse findings that share a fingerprint id — the same underlying issue
|