pi-review 1.1.1 → 1.1.2
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/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -3
- package/package.json +1 -1
- package/src/index.ts +20 -3
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAgB,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAgB,MAAM,iCAAiC,CAAC;AAsGlF,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EAAE,EAAE,YAAY,QAmFvD"}
|
package/dist/index.js
CHANGED
|
@@ -3,17 +3,34 @@ import { extractConversation, extractLatestAssistantText, formatConversation, }
|
|
|
3
3
|
const REVIEW_THINKING_LEVEL = "high";
|
|
4
4
|
const REVIEW_METADATA_TYPE = "pi-review";
|
|
5
5
|
const REVIEW_INSTRUCTION = `Review the available work and context.
|
|
6
|
+
|
|
7
|
+
First identify the review surface: current diff, uncommitted changes, conversation context, stated task, requirements, and acceptance criteria. Review small, localized changes directly. For broad, cross-cutting, context-heavy, or high-risk changes, use subagents to improve coverage.
|
|
8
|
+
|
|
9
|
+
When using subagents:
|
|
10
|
+
|
|
11
|
+
1. Reconnaissance:
|
|
12
|
+
Delegate tightly scoped repo-local research on relevant pre-existing subsystems, invariants, interfaces, tests, edge cases, and risk areas. Reconnaissance subagents must not modify source, tests, config, docs, or generated files; they may only write concise markdown notes/reports in a temporary review area and return the note path plus a terse summary.
|
|
13
|
+
|
|
14
|
+
2. Focused review:
|
|
15
|
+
Delegate one or more scoped reviews using the review surface, relevant reconnaissance note paths, and the shared review backbone below. Include the shared review backbone in each focused review prompt. Scope by subsystem, changed area, risk dimension, acceptance criterion, cross-cutting impact, or hypothesis. Allow intentional overlap when risk justifies it, but avoid accidental duplicate work. Focused review subagents must not modify source, tests, config, docs, or generated files; they may only write temporary markdown notes/reports.
|
|
16
|
+
|
|
17
|
+
Shared review backbone for you and focused review subagents:
|
|
6
18
|
Put your strict maintainer hat on.
|
|
7
19
|
Find concrete, high-confidence, material issues introduced by the work or revealed by the additional context.
|
|
8
|
-
Do not stop after the first few findings; keep reviewing until
|
|
20
|
+
Do not stop after the first few findings; keep reviewing until the assigned scope is checked.
|
|
9
21
|
Verify completeness against the stated task, requirements, and acceptance criteria; flag missing or partially implemented requirements as findings.
|
|
10
22
|
Focus on correctness, security, performance, operability, and maintainability.
|
|
11
23
|
Do not speculate; point to the affected behavior, invariant, or code path.
|
|
12
24
|
Prefer issues the author would likely fix before merge.
|
|
13
25
|
Assume existing interfaces and behavior should remain backward compatible unless the user or project instructions explicitly say otherwise.
|
|
14
|
-
If nothing material stands out, say \`looks good\`; otherwise return numbered
|
|
26
|
+
If nothing material stands out in the assigned scope, say \`looks good\`; otherwise return numbered findings sorted by priority.
|
|
15
27
|
Use [P0] for certain severe breakage, data loss, or security issues; [P1] for likely user-facing breakage or major regressions; [P2] for limited-scope correctness, performance, or maintainability issues; [P3] for minor but real issues.
|
|
16
|
-
For each finding, include a [P0]-[P3] tag, location, a concise summary, a concise explanation of the affected behavior, invariant, or code path, and \`Recommendation:\` with the top specific, actionable fix, stated concisely
|
|
28
|
+
For each finding, include a [P0]-[P3] tag, location, a concise summary, a concise explanation of the affected behavior, invariant, or code path, and \`Recommendation:\` with the top specific, actionable fix, stated concisely.
|
|
29
|
+
|
|
30
|
+
After subagents return, read their notes/reports, deduplicate findings, resolve obvious conflicts, preserve legitimate findings, and synthesize the final review. Scale subagent count to context and risk, not file count. Do not fully re-review every subagent finding unless it is internally inconsistent, unsupported, or contradicted by other evidence. Do one final missed-issue pass over the overall review surface before answering. Do not expose orchestration details unless needed to understand a finding.
|
|
31
|
+
|
|
32
|
+
Final answer contract:
|
|
33
|
+
If nothing material stands out, say \`looks good\`; otherwise return numbered sections for findings, sorted by priority. Use the same [P0]-[P3] priority rubric and finding format from the shared review backbone.`;
|
|
17
34
|
function buildReviewInstruction(args) {
|
|
18
35
|
const focusText = args.trim();
|
|
19
36
|
if (!focusText) {
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -17,17 +17,34 @@ type ReviewMetadata = {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
const REVIEW_INSTRUCTION = `Review the available work and context.
|
|
20
|
+
|
|
21
|
+
First identify the review surface: current diff, uncommitted changes, conversation context, stated task, requirements, and acceptance criteria. Review small, localized changes directly. For broad, cross-cutting, context-heavy, or high-risk changes, use subagents to improve coverage.
|
|
22
|
+
|
|
23
|
+
When using subagents:
|
|
24
|
+
|
|
25
|
+
1. Reconnaissance:
|
|
26
|
+
Delegate tightly scoped repo-local research on relevant pre-existing subsystems, invariants, interfaces, tests, edge cases, and risk areas. Reconnaissance subagents must not modify source, tests, config, docs, or generated files; they may only write concise markdown notes/reports in a temporary review area and return the note path plus a terse summary.
|
|
27
|
+
|
|
28
|
+
2. Focused review:
|
|
29
|
+
Delegate one or more scoped reviews using the review surface, relevant reconnaissance note paths, and the shared review backbone below. Include the shared review backbone in each focused review prompt. Scope by subsystem, changed area, risk dimension, acceptance criterion, cross-cutting impact, or hypothesis. Allow intentional overlap when risk justifies it, but avoid accidental duplicate work. Focused review subagents must not modify source, tests, config, docs, or generated files; they may only write temporary markdown notes/reports.
|
|
30
|
+
|
|
31
|
+
Shared review backbone for you and focused review subagents:
|
|
20
32
|
Put your strict maintainer hat on.
|
|
21
33
|
Find concrete, high-confidence, material issues introduced by the work or revealed by the additional context.
|
|
22
|
-
Do not stop after the first few findings; keep reviewing until
|
|
34
|
+
Do not stop after the first few findings; keep reviewing until the assigned scope is checked.
|
|
23
35
|
Verify completeness against the stated task, requirements, and acceptance criteria; flag missing or partially implemented requirements as findings.
|
|
24
36
|
Focus on correctness, security, performance, operability, and maintainability.
|
|
25
37
|
Do not speculate; point to the affected behavior, invariant, or code path.
|
|
26
38
|
Prefer issues the author would likely fix before merge.
|
|
27
39
|
Assume existing interfaces and behavior should remain backward compatible unless the user or project instructions explicitly say otherwise.
|
|
28
|
-
If nothing material stands out, say \`looks good\`; otherwise return numbered
|
|
40
|
+
If nothing material stands out in the assigned scope, say \`looks good\`; otherwise return numbered findings sorted by priority.
|
|
29
41
|
Use [P0] for certain severe breakage, data loss, or security issues; [P1] for likely user-facing breakage or major regressions; [P2] for limited-scope correctness, performance, or maintainability issues; [P3] for minor but real issues.
|
|
30
|
-
For each finding, include a [P0]-[P3] tag, location, a concise summary, a concise explanation of the affected behavior, invariant, or code path, and \`Recommendation:\` with the top specific, actionable fix, stated concisely
|
|
42
|
+
For each finding, include a [P0]-[P3] tag, location, a concise summary, a concise explanation of the affected behavior, invariant, or code path, and \`Recommendation:\` with the top specific, actionable fix, stated concisely.
|
|
43
|
+
|
|
44
|
+
After subagents return, read their notes/reports, deduplicate findings, resolve obvious conflicts, preserve legitimate findings, and synthesize the final review. Scale subagent count to context and risk, not file count. Do not fully re-review every subagent finding unless it is internally inconsistent, unsupported, or contradicted by other evidence. Do one final missed-issue pass over the overall review surface before answering. Do not expose orchestration details unless needed to understand a finding.
|
|
45
|
+
|
|
46
|
+
Final answer contract:
|
|
47
|
+
If nothing material stands out, say \`looks good\`; otherwise return numbered sections for findings, sorted by priority. Use the same [P0]-[P3] priority rubric and finding format from the shared review backbone.`;
|
|
31
48
|
|
|
32
49
|
function buildReviewInstruction(args: string): string {
|
|
33
50
|
const focusText = args.trim();
|