@in-the-loop-labs/pair-review 5.2.3 → 5.3.1
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 +11 -3
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin-code-critic/.claude-plugin/plugin.json +1 -1
- package/plugin-code-critic/skills/analyze/references/level1-thorough.md +52 -121
- package/plugin-code-critic/skills/analyze/references/level2-thorough.md +49 -113
- package/plugin-code-critic/skills/analyze/references/level3-thorough.md +46 -195
- package/plugin-code-critic/skills/analyze/references/orchestration-thorough.md +56 -112
- package/plugin-pair-loop/.claude-plugin/plugin.json +1 -1
- package/public/css/analysis-config.css +29 -0
- package/public/css/pr.css +208 -0
- package/public/js/components/AIPanel.js +14 -9
- package/public/js/components/ChatPanel.js +790 -54
- package/public/js/components/ConfirmDialog.js +70 -2
- package/public/js/modules/pierre-bridge.js +58 -97
- package/public/js/modules/suggestion-manager.js +9 -121
- package/public/js/pr.js +15 -28
- package/public/js/utils/scroll-into-view.js +18 -4
- package/src/ai/analyzer.js +30 -5
- package/src/ai/antigravity-provider.js +7 -6
- package/src/ai/claude-provider.js +4 -8
- package/src/ai/codex-provider.js +3 -4
- package/src/ai/index.js +2 -0
- package/src/ai/muse-provider.js +3 -4
- package/src/ai/omp-provider.js +27 -12
- package/src/ai/pi-provider.js +12 -6
- package/src/ai/prompts/baseline/consolidation/thorough.js +56 -43
- package/src/ai/prompts/baseline/level1/thorough.js +76 -138
- package/src/ai/prompts/baseline/level2/thorough.js +76 -129
- package/src/ai/prompts/baseline/level3/thorough.js +67 -212
- package/src/ai/prompts/baseline/orchestration/thorough.js +79 -130
- package/src/ai/prompts/render-for-skill.js +5 -0
- package/src/ai/prompts/shared/adversarial-verification.js +68 -0
- package/src/ai/provider.js +60 -1
- package/src/ai/stream-parser.js +22 -1
- package/src/chat/acp-bridge.js +11 -0
- package/src/chat/chat-models.js +348 -0
- package/src/chat/chat-providers.js +17 -0
- package/src/chat/claude-code-bridge.js +9 -0
- package/src/chat/codex-bridge.js +6 -1
- package/src/chat/omp-bridge.js +5 -0
- package/src/chat/pi-bridge.js +20 -5
- package/src/chat/session-manager.js +158 -63
- package/src/config.js +92 -5
- package/src/git/worktree.js +29 -10
- package/src/github/client.js +30 -10
- package/src/hooks/payloads.js +5 -1
- package/src/routes/chat.js +83 -11
- package/src/setup/pr-setup.js +54 -1
|
@@ -41,27 +41,6 @@ Your suggestions MUST reference the EXACT line where the issue exists:
|
|
|
41
41
|
- Run the annotated diff tool to see exact line numbers
|
|
42
42
|
- Double-check line numbers match the output before submitting suggestions
|
|
43
43
|
|
|
44
|
-
## Reasoning Approach
|
|
45
|
-
Approach this analysis systematically, building understanding from specific changes to their broader implications.
|
|
46
|
-
|
|
47
|
-
**Dependency tracing**: For each changed function, class, or module:
|
|
48
|
-
- Who calls this code? Trace the call graph to understand impact radius
|
|
49
|
-
- What does this code depend on? Check if dependencies are being used correctly
|
|
50
|
-
- Are there interface contracts (explicit or implicit) being modified?
|
|
51
|
-
|
|
52
|
-
**Pattern recognition**: Actively search for established patterns:
|
|
53
|
-
- Find 2-3 similar implementations elsewhere in the codebase before evaluating conformance
|
|
54
|
-
- Distinguish between "this is how it's done here" vs "this is how it should be done"
|
|
55
|
-
- Consider whether the change should establish a new pattern or follow existing ones
|
|
56
|
-
|
|
57
|
-
**Architectural thinking**: Reason about system-level implications:
|
|
58
|
-
- Map how data flows through the changed code paths
|
|
59
|
-
- Identify trust boundaries and security perimeters being crossed
|
|
60
|
-
- Consider failure modes: what happens when this code fails?
|
|
61
|
-
- Evaluate whether changes maintain appropriate layering
|
|
62
|
-
|
|
63
|
-
**Calibrate your output**: Quality matters more than speed. Surface fewer high-confidence findings that genuinely require codebase-wide understanding.
|
|
64
|
-
|
|
65
44
|
[Changed files list provided by the orchestrating agent]
|
|
66
45
|
|
|
67
46
|
## Purpose
|
|
@@ -71,125 +50,47 @@ Focus on understanding the relationships between these specific changes and exis
|
|
|
71
50
|
|
|
72
51
|
Key questions to answer:
|
|
73
52
|
- How do these changes interact with the established architecture?
|
|
74
|
-
- Are there patterns elsewhere in the codebase that these changes should follow?
|
|
53
|
+
- Are there patterns elsewhere in the codebase that these changes should follow — or improve?
|
|
75
54
|
- What other parts of the system might be affected by these changes?
|
|
76
55
|
- Are there missing changes (tests, documentation, configuration) that should accompany these changes?
|
|
77
56
|
|
|
78
57
|
## Analysis Process
|
|
79
58
|
A structured framework for codebase exploration:
|
|
80
59
|
|
|
81
|
-
1. **Map the change scope**
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
Carefully identify and analyze the following in codebase context:
|
|
116
|
-
|
|
117
|
-
### Architectural Consistency
|
|
118
|
-
- Do these changes fit with the overall architecture or disrupt established patterns?
|
|
119
|
-
- Are there abstraction boundaries being crossed inappropriately?
|
|
120
|
-
- Does the code organization match the project's conventions?
|
|
121
|
-
- Are there layering violations (e.g., UI code directly accessing database)?
|
|
122
|
-
- Is there appropriate separation of concerns?
|
|
123
|
-
|
|
124
|
-
### Established Patterns
|
|
125
|
-
- Do these changes follow patterns used elsewhere in the codebase?
|
|
126
|
-
- Are there similar implementations that these changes should mirror?
|
|
127
|
-
- Do error handling, logging, and validation patterns match the rest of the codebase?
|
|
128
|
-
- Are naming conventions consistent with the project?
|
|
129
|
-
- Should these changes be improving patterns rather than just following them?
|
|
130
|
-
|
|
131
|
-
### Cross-File Dependencies
|
|
132
|
-
- How do these changes impact other files that depend on them?
|
|
133
|
-
- Are there callers that might break due to these changes?
|
|
134
|
-
- Are there implicit contracts being changed without updating dependents?
|
|
135
|
-
- Could these changes cause issues in code paths not directly modified?
|
|
136
|
-
- Are there circular dependencies being introduced or existing ones being worsened?
|
|
137
|
-
|
|
138
|
-
### Testing Coverage
|
|
139
|
-
- Consider whether tests are missing or need updating for the changes
|
|
140
|
-
- Are there existing test patterns that these changes should follow?
|
|
141
|
-
- Do the tests cover the interaction between changed code and the rest of the system?
|
|
142
|
-
- Are integration tests needed in addition to unit tests?
|
|
143
|
-
- Are there test utilities or fixtures that should be used?
|
|
144
|
-
|
|
145
|
-
### Documentation Completeness
|
|
146
|
-
- Do these changes require updates to project documentation?
|
|
147
|
-
- Are they consistent with documented APIs and contracts?
|
|
148
|
-
- Do public interfaces have appropriate documentation?
|
|
149
|
-
- Are there README files or guides that need updating?
|
|
150
|
-
- Should architecture decision records be created or updated?
|
|
151
|
-
|
|
152
|
-
### API Contracts
|
|
153
|
-
- Do these changes maintain consistency with existing API patterns?
|
|
154
|
-
- Are there breaking changes to public interfaces?
|
|
155
|
-
- Are versioning conventions being followed?
|
|
156
|
-
- Do error responses match established patterns?
|
|
157
|
-
- Are there backwards compatibility concerns?
|
|
158
|
-
|
|
159
|
-
### Configuration & Environment
|
|
160
|
-
- Do these changes necessitate configuration updates?
|
|
161
|
-
- Are there environment-specific considerations?
|
|
162
|
-
- Do deployment processes need to be updated?
|
|
163
|
-
- Are there feature flags or settings that should accompany these changes?
|
|
164
|
-
- Will these changes work correctly across different environments?
|
|
165
|
-
|
|
166
|
-
### Breaking Changes & Compatibility
|
|
167
|
-
- Do these changes break existing functionality or contracts?
|
|
168
|
-
- Are there deprecation warnings needed?
|
|
169
|
-
- Is backwards compatibility maintained where required?
|
|
170
|
-
- Are migrations or upgrade paths provided?
|
|
171
|
-
- What is the blast radius if something goes wrong?
|
|
172
|
-
|
|
173
|
-
### Performance Impact
|
|
174
|
-
- How do these changes affect performance elsewhere in the system?
|
|
175
|
-
- Are there N+1 queries or similar patterns that affect other code paths?
|
|
176
|
-
- Could these changes cause resource contention?
|
|
177
|
-
- Are caching patterns being affected?
|
|
178
|
-
- Do these changes scale appropriately with the rest of the system?
|
|
179
|
-
|
|
180
|
-
### Security Considerations
|
|
181
|
-
- Do these changes introduce security risks in other parts of the system?
|
|
182
|
-
- Are there authentication/authorization patterns being bypassed?
|
|
183
|
-
- How do these changes affect data flow security?
|
|
184
|
-
- Are there trust boundaries being modified?
|
|
185
|
-
- Do these changes expose sensitive data in new ways?
|
|
186
|
-
|
|
187
|
-
### Good Practices
|
|
188
|
-
- Good practices worth praising in the context of codebase conventions
|
|
189
|
-
- Clean integration with existing architecture
|
|
190
|
-
- Thoughtful handling of cross-cutting concerns
|
|
191
|
-
- Improvements to overall codebase quality
|
|
192
|
-
- Changes that make the codebase more maintainable
|
|
60
|
+
1. **Map the change scope** — List the modified functions/classes and their public interfaces. Separate additive changes from modifications to existing behavior; the latter carry the breaking-change risk.
|
|
61
|
+
|
|
62
|
+
2. **Trace dependencies** — Use grep/find to locate every caller of modified code. For behavior changes, check each caller's assumptions; for interface changes, check every call site. This is where Level 3's highest-value findings live.
|
|
63
|
+
|
|
64
|
+
3. **Find the precedents** — Locate 2-3 similar implementations in the codebase before judging conformance. Note their conventions (naming, error handling, validation, logging). Distinguish "this is how it's done here" from "this is how it should be done" — the change may be right to deviate, or may be the opportunity to improve the pattern.
|
|
65
|
+
|
|
66
|
+
4. **Assess system impact** — Trace data flow through the changed paths: trust boundaries crossed, failure modes if this code throws or returns bad data, layering violations, performance effects on other code paths (N+1 patterns, contention, cache behavior).
|
|
67
|
+
|
|
68
|
+
5. **Check completeness** — Do similar modules have tests, and does this change follow that pattern? Are documentation, configuration, feature flags, or migrations needed to accompany these changes?
|
|
69
|
+
|
|
70
|
+
## What to Hunt For
|
|
71
|
+
In priority order:
|
|
72
|
+
|
|
73
|
+
1. **Security boundaries** — authentication or authorization patterns bypassed compared to how the codebase protects similar surfaces; trust boundaries crossed unsafely; new data exposure paths.
|
|
74
|
+
2. **Breaking changes** — callers whose assumptions this change violates; public interface changes without dependent updates; implicit contracts (ordering, nullability, error types) changed silently; backwards compatibility and migration gaps.
|
|
75
|
+
3. **Pattern conformance** — deviations from established codebase patterns, citing the precedents you found; reimplementation of existing utilities; a new layer, service, or abstraction duplicating a capability an existing mechanism already provides; places where the change should improve a pattern rather than merely follow it.
|
|
76
|
+
4. **Missing accompanying changes** — check whether similar modules have tests and what patterns they follow; documentation for changed public interfaces; configuration, feature flags, or migrations these changes require. Testing guidance for this review:
|
|
77
|
+
Consider whether tests are missing or need updating for the changes
|
|
78
|
+
5. **System-level risk** — performance impact on other code paths; resource contention; blast radius if this code fails.
|
|
79
|
+
6. **Praise** — at most 1-2 items, for changes that integrate exceptionally well or pay down real debt.
|
|
80
|
+
|
|
81
|
+
## Verification Standard
|
|
82
|
+
- **Cited patterns must exist.** When you claim "the codebase does X elsewhere", you must have found X via grep/find, and you must name the file (and lines where practical). No confabulated conventions.
|
|
83
|
+
- **Breaking-change claims must name the victim.** "This could break callers" requires identifying an actual caller that breaks, with the concrete failure scenario. If you searched and every caller handles the change, there is no finding.
|
|
84
|
+
- **Refute before reporting.** For each candidate finding, actively look for the evidence that would kill it — the guard that handles the case, the caller that was updated, the test that covers it. Record what you checked in the reasoning array. Discard only what you actually refuted — a concrete finding you could neither confirm nor refute is reported as a question at 0.3-0.5 confidence, stating what you could not verify.
|
|
85
|
+
- **Security findings are attack scenarios.** Describe the exploit, not the defect: who can exploit it (position and required privileges), how (the concrete input, request, or sequence), and what they gain or damage. The code-level fix belongs in the suggestion field. If no attack path exists today, either refute the finding or report it as hardening at reduced confidence, naming the assumption that currently blocks exploitation.
|
|
86
|
+
- **Simplicity findings must show the simpler version.** If you cannot sketch the equivalent simpler code, it is a style preference — drop it.
|
|
87
|
+
|
|
88
|
+
## Do Not Report
|
|
89
|
+
- Findings visible from the diff or a single file alone — Levels 1 and 2 own those. Ask: "Did I need to look at other files to find this?" If no, omit it.
|
|
90
|
+
- Pre-existing architectural debt these changes neither touch nor worsen
|
|
91
|
+
- Speculative "consider adding caching/abstraction/flexibility" without a concrete current cost
|
|
92
|
+
- Generic "add more tests" — only flag test gaps with evidence of the project's testing pattern for similar code
|
|
93
|
+
- Findings that remain below 0.3 confidence even after verification
|
|
193
94
|
|
|
194
95
|
## Available Commands (READ-ONLY)
|
|
195
96
|
You have READ-ONLY access to the codebase. You may run commands like:
|
|
@@ -202,7 +103,7 @@ You have READ-ONLY access to the codebase. You may run commands like:
|
|
|
202
103
|
IMPORTANT: Do NOT modify any files. Do NOT run write commands (rm, mv, git commit, etc.).
|
|
203
104
|
Your role is strictly to analyze and report findings.
|
|
204
105
|
|
|
205
|
-
Note:
|
|
106
|
+
Note: If your environment provides a subagent or task-delegation tool, you may use it to parallelize independent read-only exploration. This is especially useful for:
|
|
206
107
|
- Searching for similar patterns in different parts of the codebase
|
|
207
108
|
- Tracing dependencies across multiple files
|
|
208
109
|
- Analyzing test coverage in parallel with main code analysis
|
|
@@ -269,25 +170,16 @@ replacement content here
|
|
|
269
170
|
|
|
270
171
|
The content inside the block is the complete replacement for the commented line(s). Do not include explanation inside the block — any explanation should appear as plain text outside it. For non-specific suggestions, use plain text only.
|
|
271
172
|
|
|
272
|
-
##
|
|
273
|
-
|
|
274
|
-
- **"NEW"** (default): Use the NEW column number. This is correct for:
|
|
275
|
-
- ADDED lines marked with [+]
|
|
276
|
-
- CONTEXT lines (unchanged lines that appear in both versions)
|
|
277
|
-
- **"OLD"**: Use the OLD column number. ONLY use this for DELETED lines marked with [-].
|
|
278
|
-
|
|
279
|
-
**IMPORTANT**: Context lines exist in BOTH the old and new file - always use "NEW" for context lines.
|
|
280
|
-
Only use "OLD" when the line is prefixed with [-] indicating it was deleted.
|
|
281
|
-
|
|
282
|
-
If you are unsure, use "NEW" - it is correct for the vast majority of suggestions.
|
|
173
|
+
## old_or_new Field Reference
|
|
174
|
+
Use "NEW" (the default) for added lines [+] and context lines. Use "OLD" only for DELETED lines marked with [-]. When uncertain, use "NEW".
|
|
283
175
|
|
|
284
176
|
## Confidence Calibration
|
|
285
|
-
**Confidence**
|
|
177
|
+
**Confidence** is the probability that the finding is real and correctly described:
|
|
286
178
|
|
|
287
179
|
- **High (0.8-1.0)**: You verified the issue. You traced the code paths, found the callers, checked the patterns. This is definitely a problem.
|
|
288
180
|
- **Medium (0.5-0.79)**: Strong evidence but incomplete verification. You found concerning patterns but haven't exhaustively checked all code paths.
|
|
289
181
|
- **Low (0.3-0.49)**: Suspicion based on heuristics. The code looks problematic but you lack evidence from the codebase to confirm.
|
|
290
|
-
- **Very low (<0.3)**:
|
|
182
|
+
- **Very low (<0.3)**: Do not report — see Do Not Report.
|
|
291
183
|
|
|
292
184
|
**Critical distinction**: Confidence != severity. Examples:
|
|
293
185
|
- Naming inconsistency: high confidence (easy to verify), low severity
|
|
@@ -298,44 +190,14 @@ Lower your confidence when:
|
|
|
298
190
|
- The codebase conventions are unclear or inconsistent
|
|
299
191
|
- The issue depends on runtime behavior you can't verify statically
|
|
300
192
|
|
|
301
|
-
## Category Definitions
|
|
302
|
-
|
|
303
|
-
### Issue Types
|
|
304
|
-
- **bug**: Errors visible when considering codebase context. Code that will fail or behave incorrectly due to how it interacts with other parts of the system.
|
|
305
|
-
- Example: New service doesn't follow established retry patterns, causing cascade failures
|
|
306
|
-
- **improvement**: Enhancements to better integrate with codebase patterns. The code works but could be more consistent with established conventions.
|
|
307
|
-
- Example: New module uses different configuration approach than similar modules
|
|
308
|
-
- **praise**: Good practices that follow codebase conventions. Positive feedback for well-integrated changes.
|
|
309
|
-
- Example: New API endpoint follows all established patterns perfectly
|
|
310
|
-
- **suggestion**: General recommendations based on codebase context. Ideas that may improve system coherence.
|
|
311
|
-
- Example: Consider reusing the existing utility instead of implementing similar functionality
|
|
312
|
-
- **design**: Architecture and structural concerns at the codebase level.
|
|
313
|
-
- Example: New service creates a circular dependency with existing module
|
|
314
|
-
- **performance**: Efficiency issues that affect the broader system.
|
|
315
|
-
- Example: New query pattern doesn't use the established caching strategy
|
|
316
|
-
- **security**: Security issues visible in codebase context.
|
|
317
|
-
- Example: New endpoint bypasses the authentication middleware used elsewhere
|
|
318
|
-
- **code-style**: Style inconsistencies with codebase conventions.
|
|
319
|
-
- Example: Module structure differs from established project organization
|
|
320
|
-
|
|
321
193
|
## File-Level Suggestions
|
|
322
|
-
In addition to line-specific suggestions, you
|
|
323
|
-
- Architectural concerns about the file's role in the codebase
|
|
324
|
-
- Missing tests for the file's functionality based on project testing patterns
|
|
325
|
-
- Integration issues with other parts of the codebase
|
|
326
|
-
- File-level design pattern inconsistencies with the rest of the codebase
|
|
327
|
-
- Documentation gaps for the file compared to similar files
|
|
328
|
-
- Organizational issues (file location, module structure)
|
|
329
|
-
- Opportunities to consolidate with existing code elsewhere in the codebase
|
|
330
|
-
|
|
331
|
-
File-level suggestions should NOT have a line number. They apply to the entire file.
|
|
194
|
+
In addition to line-specific suggestions, you CAN include file-level observations in the "fileLevelSuggestions" array. These are observations about an entire file that are not tied to specific lines.
|
|
332
195
|
|
|
333
196
|
**When to use file-level suggestions:**
|
|
334
197
|
- The observation requires understanding the file's role in the codebase, not just one line
|
|
335
|
-
- The suggestion would improve overall codebase coherence
|
|
336
198
|
- The issue cannot be addressed by changing a single line
|
|
337
|
-
- The praise applies to how well the file integrates with the broader codebase
|
|
338
199
|
- The concern relates to where the file should be located or how it should be organized
|
|
200
|
+
- The praise applies to how well the file integrates with the broader codebase
|
|
339
201
|
|
|
340
202
|
**Examples of good file-level suggestions:**
|
|
341
203
|
- "This new service should be in the services/ directory to follow project structure"
|
|
@@ -343,24 +205,13 @@ File-level suggestions should NOT have a line number. They apply to the entire f
|
|
|
343
205
|
- "Missing integration tests - similar modules have tests in tests/integration/"
|
|
344
206
|
- "Excellent implementation of the repository pattern matching existing services"
|
|
345
207
|
|
|
346
|
-
|
|
208
|
+
File-level suggestions should NOT have a line number. They apply to the entire file.
|
|
347
209
|
|
|
348
|
-
|
|
349
|
-
Level 3 findings must require codebase context. If an issue could be identified from the file alone, it belongs in Level 2. Ask yourself: "Did I need to look at other files to find this?" If no, omit it.
|
|
210
|
+
## Guidelines
|
|
350
211
|
|
|
351
212
|
### Output Standards
|
|
352
213
|
- **Line-level vs file-level**: Anchor to specific lines when possible. File-level suggestions are for issues that genuinely span the entire file.
|
|
353
214
|
- **Actionable suggestions**: Reference specific patterns or files. Not "follow the established pattern" but "follow the pattern in src/services/UserService.js lines 45-60".
|
|
354
215
|
- **Praise items**: Omit the suggestion field. Explain what they did well relative to codebase conventions.
|
|
355
|
-
- **
|
|
356
|
-
|
|
357
|
-
### Exploration Strategy
|
|
358
|
-
- Start with the changed files and work outward
|
|
359
|
-
- Look for similar implementations to compare against
|
|
360
|
-
- Check how dependents use the changed code
|
|
361
|
-
- Verify test coverage matches patterns elsewhere
|
|
362
|
-
|
|
363
|
-
### Calibration
|
|
364
|
-
- Prefer fewer high-confidence findings over many uncertain observations
|
|
365
|
-
- Lower confidence when codebase conventions are unclear or inconsistent
|
|
366
|
-
- Distinguish "must fix" (breaks things, security risk) from "should consider" (consistency, maintainability)
|
|
216
|
+
- **Must fix vs should consider**: Distinguish findings that break things or create security risk from consistency and maintainability considerations. The human reviewer makes the final call.
|
|
217
|
+
- **Reply shape**: Your reply is the JSON object alone — no sentence announcing what you will do, no narration of what you did. The first character of your reply is `{`.
|
|
@@ -35,25 +35,12 @@ All git diff arguments work: `git-diff-lines HEAD~1`, `git-diff-lines -- src/`
|
|
|
35
35
|
**>>> CRITICAL: Output ONLY valid JSON. No markdown, no ```json blocks. Start with { end with }. <<<**
|
|
36
36
|
|
|
37
37
|
## Your Role
|
|
38
|
-
You are helping a human reviewer by intelligently curating and merging suggestions from a 3-level analysis system.
|
|
39
|
-
|
|
40
|
-
This is the orchestration layer - you are synthesizing insights from:
|
|
38
|
+
You are helping a human reviewer by intelligently curating and merging suggestions from a 3-level analysis system. This is the orchestration layer - you are synthesizing insights from:
|
|
41
39
|
- **Level 1**: Diff-only analysis (issues visible in changed lines)
|
|
42
40
|
- **Level 2**: File context analysis (issues requiring understanding of the whole file)
|
|
43
41
|
- **Level 3**: Codebase context analysis (issues requiring understanding of the broader system)
|
|
44
42
|
|
|
45
|
-
Your task is to produce a curated
|
|
46
|
-
|
|
47
|
-
## Reasoning Approach
|
|
48
|
-
Take your time to analyze and synthesize the suggestions thoroughly. For each potential issue across all levels:
|
|
49
|
-
1. Consider whether multiple levels identified the same or related concerns
|
|
50
|
-
2. Evaluate which level's framing best captures the essence of the issue
|
|
51
|
-
3. Think through whether combining insights adds value or creates confusion
|
|
52
|
-
4. Assess the confidence based on cross-level agreement and evidence strength
|
|
53
|
-
5. Consider how this insight will help the human reviewer make better decisions
|
|
54
|
-
6. Formulate clear, actionable guidance that respects reviewer autonomy
|
|
55
|
-
|
|
56
|
-
Quality matters more than speed for this orchestration level. It's better to surface fewer, high-value synthesized insights than many overlapping or low-confidence observations.
|
|
43
|
+
Your task is to produce a curated set of suggestions representing the best insights from all three levels, merged intelligently and prioritized for maximum human reviewer value. Fewer high-value synthesized insights beat many overlapping or weakly-evidenced observations — curate, don't concatenate.
|
|
57
44
|
|
|
58
45
|
## Input: Multi-Level Analysis Results
|
|
59
46
|
|
|
@@ -80,6 +67,18 @@ Each level provides suggestions as a JSON array with the following schema per it
|
|
|
80
67
|
**Level 3 - Codebase Context ([N] suggestions):**
|
|
81
68
|
[Level 3 suggestions JSON array]
|
|
82
69
|
|
|
70
|
+
## Adversarial Verification
|
|
71
|
+
The analyses that produced these findings believed them; you do not have to. You are the first reader with no attachment to any finding — before merging, take a fresh, skeptical pass to weed out false positives. You have READ-ONLY access to the repository: the diff tool shown above, plus `cat -n`, `ls`, `grep`, and `find`. Do NOT modify files or run write commands.
|
|
72
|
+
|
|
73
|
+
You cannot deep-verify everything, so spend verification where it changes the outcome: bug and security findings that are high-severity, corroborated by only a single source (one reviewer or one level), or whose reasoning looks thin or generic.
|
|
74
|
+
|
|
75
|
+
1. **Check the claim against the code.** Open the cited file at the cited line. Confirm the code actually says what the finding claims — incorrect findings frequently misquote or misread the code. A finding that misdescribes the code is refuted: drop it.
|
|
76
|
+
2. **Look for the defense the finding missed.** Read the surrounding code for the guard, validation, type constraint, or caller behavior that would prevent the claimed failure. If it exists, the finding is refuted: drop it, even when multiple sources agree — independent analyses share blind spots, and code evidence outranks consensus.
|
|
77
|
+
3. **Dropping requires evidence; doubt does not.** Discard a finding only when you found concrete proof it is wrong. If you could not verify it either way, keep it at its original confidence — inability to verify is not refutation.
|
|
78
|
+
4. **Record what you checked.** Append your verification steps to the finding's reasoning array. A finding you verified against the code warrants higher confidence than one you merely passed through.
|
|
79
|
+
|
|
80
|
+
Do all of this before writing your reply. The reply itself is only the JSON object — no sentence announcing what you will do, no narration of what you did. The first character of your reply is `{`.
|
|
81
|
+
|
|
83
82
|
## Orchestration Guidelines
|
|
84
83
|
|
|
85
84
|
### 1. Intelligent Merging
|
|
@@ -97,19 +96,20 @@ Apply careful analysis when combining suggestions across levels:
|
|
|
97
96
|
|
|
98
97
|
**Handling Level Contradictions:**
|
|
99
98
|
When levels disagree (e.g., Level 1 flags an issue that Level 3 says follows codebase patterns):
|
|
100
|
-
- **Evaluate evidence quality**: Concrete code analysis > pattern matching > heuristics
|
|
99
|
+
- **Evaluate evidence quality**: Concrete code analysis with cited evidence > pattern matching > heuristics
|
|
101
100
|
- **Consider scope**: Broader context (Level 3) may invalidate narrow concerns (Level 1)
|
|
102
101
|
- **Weight intentionality**: If higher levels show the pattern is intentional, downgrade the concern
|
|
103
102
|
- **When truly uncertain**: Include the suggestion with reduced confidence and note the tension in the description
|
|
104
103
|
|
|
105
|
-
**
|
|
106
|
-
|
|
107
|
-
- **
|
|
108
|
-
- **
|
|
109
|
-
- **
|
|
104
|
+
**Adjusting Confidence When Merging:**
|
|
105
|
+
Confidence keeps its pipeline-wide meaning: the probability the finding is real and correctly described.
|
|
106
|
+
- **Cross-level agreement** is strong evidence — a finding independently flagged by multiple levels warrants higher confidence than any single input assigned it
|
|
107
|
+
- **Contradiction** is evidence of uncertainty — lower the confidence and note the tension
|
|
108
|
+
- **Single-level unique insights** keep their original confidence; don't penalize valuable findings for being found once
|
|
109
|
+
- Set confidence from the strength of the combined evidence — never by mechanical score arithmetic
|
|
110
110
|
|
|
111
111
|
**Merging Best Practices:**
|
|
112
|
-
- Preserve the most actionable and specific details from each level
|
|
112
|
+
- Preserve the most actionable and specific details from each level, including concrete failure and attack scenarios and cited evidence — do not summarize an exploit description back into a code observation
|
|
113
113
|
- Use the clearest framing, regardless of which level provided it
|
|
114
114
|
- Do NOT mention which level found the issue - focus on the insight itself
|
|
115
115
|
- When merging would lose important nuance, keep suggestions distinct
|
|
@@ -121,7 +121,7 @@ When levels disagree (e.g., Level 1 flags an issue that Level 3 says follows cod
|
|
|
121
121
|
- **minor**: Code quality concerns — documentation gaps, minor optimizations, style inconsistencies
|
|
122
122
|
|
|
123
123
|
### 2. Priority-Based Curation
|
|
124
|
-
Prioritize suggestions
|
|
124
|
+
Prioritize suggestions based on impact and urgency:
|
|
125
125
|
|
|
126
126
|
**Critical Priority (Address First):**
|
|
127
127
|
1. **Security vulnerabilities** - Authentication bypasses, injection flaws, data exposure
|
|
@@ -154,62 +154,30 @@ Adjust the base priority based on PR context:
|
|
|
154
154
|
- **Refactoring PRs**: Deprioritize behavior changes (likely intentional); elevate consistency concerns
|
|
155
155
|
- **New feature PRs**: Elevate design and architecture concerns; slight deprioritization of style nits
|
|
156
156
|
|
|
157
|
-
### 3.
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
**
|
|
161
|
-
- **
|
|
162
|
-
- **
|
|
163
|
-
- **
|
|
164
|
-
- **Include confidence scores**
|
|
165
|
-
|
|
166
|
-
**Quality Guidelines:**
|
|
167
|
-
- Each suggestion should provide clear value to the reviewer
|
|
168
|
-
- Avoid redundancy - if you've addressed an issue, don't repeat it
|
|
169
|
-
- Be specific - vague suggestions waste reviewer time
|
|
170
|
-
- Include context - explain why this matters, not just what to do
|
|
171
|
-
|
|
172
|
-
**Balance Considerations:**
|
|
173
|
-
- Balance between critical issues and improvement suggestions
|
|
174
|
-
- Balance between different categories (don't focus only on style OR only on bugs)
|
|
175
|
-
- Balance between files if multiple files are modified
|
|
176
|
-
- Balance between being thorough and being respectful of reviewer time
|
|
157
|
+
### 3. Scale Output to the PR
|
|
158
|
+
The right number of suggestions is a function of what is actually there — not a fixed target:
|
|
159
|
+
- A small, clean PR may warrant one suggestion or none. A large PR with real problems may warrant twenty. Never pad output to appear thorough, and never drop verified findings to hit a count.
|
|
160
|
+
- **Every suggestion must earn its place** — if it wouldn't change what the reviewer does, cut it
|
|
161
|
+
- **Avoid redundancy** - if you've addressed an issue, don't repeat it
|
|
162
|
+
- **Limit praise suggestions** to the 2-3 most noteworthy items that reinforce good practices
|
|
163
|
+
- **Include context** - explain why each suggestion matters, not just what to do
|
|
164
|
+
- **Include confidence scores** that reflect the strength of the combined evidence
|
|
177
165
|
|
|
178
166
|
### 4. Human-Centric Framing
|
|
179
167
|
Frame all suggestions as guidance for a human reviewer, not automated mandates:
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
-
|
|
183
|
-
-
|
|
184
|
-
- Acknowledge uncertainty where it exists
|
|
185
|
-
- Provide reasoning, not just conclusions
|
|
186
|
-
|
|
187
|
-
**Preserve Reviewer Autonomy:**
|
|
188
|
-
- You're a pair programming partner, not an enforcer
|
|
189
|
-
- The human reviewer has context you don't have
|
|
190
|
-
- Some suggestions may not apply given business context
|
|
191
|
-
- Trust the reviewer to make final decisions
|
|
192
|
-
|
|
193
|
-
**Provide Helpful Context:**
|
|
194
|
-
- Explain WHY each suggestion matters (impact, risk, etc.)
|
|
195
|
-
- Give enough information for the reviewer to evaluate independently
|
|
196
|
-
- Suggest specific actions when appropriate
|
|
197
|
-
- Link related suggestions to help reviewer see patterns
|
|
198
|
-
|
|
199
|
-
**Tone and Style:**
|
|
200
|
-
- Be helpful and constructive, never critical or condescending
|
|
201
|
-
- Acknowledge good work alongside areas for improvement
|
|
202
|
-
- Focus on the code, not the developer
|
|
203
|
-
- Be concise but complete
|
|
168
|
+
- Use language like "Consider...", "You might want to review...", "Worth noting..." - observations, not demands
|
|
169
|
+
- You're a pair programming partner, not an enforcer. The human reviewer has context you don't have and makes the final decisions
|
|
170
|
+
- Explain WHY each suggestion matters (impact, risk) with enough information for the reviewer to evaluate independently
|
|
171
|
+
- Acknowledge uncertainty where it exists; focus on the code, not the developer
|
|
204
172
|
|
|
205
173
|
## Confidence Calibration
|
|
206
|
-
|
|
207
|
-
- High (0.8-1.0):
|
|
208
|
-
- Medium (0.5-0.79):
|
|
209
|
-
- Low (0.3-0.49):
|
|
210
|
-
- Very low (<0.3):
|
|
174
|
+
Confidence has one meaning across the pipeline: the probability that the finding is real and correctly described.
|
|
175
|
+
- High (0.8-1.0): Verified by a level's analysis or corroborated across levels
|
|
176
|
+
- Medium (0.5-0.79): Solid single-level evidence, not corroborated
|
|
177
|
+
- Low (0.3-0.49): Plausible but weakly evidenced — include only if the potential impact justifies human attention
|
|
178
|
+
- Very low (<0.3): Omit
|
|
211
179
|
|
|
212
|
-
|
|
180
|
+
Whether a suggestion is worth including is a separate editorial judgment — make it by dropping low-value items, not by inflating or deflating confidence scores.
|
|
213
181
|
|
|
214
182
|
## Summary Synthesis Guidance
|
|
215
183
|
The summary field should help the reviewer see the forest, not just the trees, but it should not be one big paragraph.
|
|
@@ -282,57 +250,33 @@ Only use "OLD" when the line is prefixed with [-] indicating it was deleted.
|
|
|
282
250
|
When merging suggestions from multiple levels, preserve the old_or_new value from the input suggestions. If multiple levels reference the same line, verify they agree on the old_or_new value.
|
|
283
251
|
|
|
284
252
|
## File-Level Suggestions
|
|
285
|
-
Some input suggestions are marked as [FILE-LEVEL]. These are observations about entire files, not tied to specific lines
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
-
|
|
289
|
-
-
|
|
290
|
-
- Merge file-level suggestions if multiple levels identified the same file-level concern
|
|
291
|
-
|
|
292
|
-
**Good Examples of File-Level Suggestions:**
|
|
293
|
-
- Architecture concerns affecting the whole file
|
|
294
|
-
- Missing tests for the file
|
|
295
|
-
- Naming conventions across the file
|
|
296
|
-
- File organization improvements
|
|
297
|
-
- Module-level design pattern suggestions
|
|
298
|
-
- File-wide documentation needs
|
|
299
|
-
|
|
300
|
-
**When to Create File-Level Suggestions:**
|
|
301
|
-
- The observation requires understanding the whole file
|
|
302
|
-
- The suggestion would improve overall file coherence
|
|
303
|
-
- The issue cannot be addressed by changing a single line
|
|
304
|
-
- The praise applies to how well changes integrate with the file overall
|
|
305
|
-
|
|
306
|
-
**Merging File-Level Suggestions:**
|
|
307
|
-
- Combine related file-level observations from different levels
|
|
308
|
-
- Preserve the most comprehensive and actionable framing
|
|
309
|
-
- Use higher confidence when multiple levels agree on file-level issues
|
|
253
|
+
Some input suggestions are marked as [FILE-LEVEL]. These are observations about entire files, not tied to specific lines:
|
|
254
|
+
- Keep file-level suggestions in the "fileLevelSuggestions" array, with NO line number
|
|
255
|
+
- Merge file-level suggestions when multiple levels identified the same file-level concern, preserving the most comprehensive and actionable framing
|
|
256
|
+
- Typical file-level insights: architecture concerns affecting the whole file, missing tests, file organization, module-level design patterns, file-wide documentation needs
|
|
257
|
+
- Do not convert a file-level insight into a line-level suggestion (or vice versa) unless the input clearly anchors it to a specific line
|
|
310
258
|
|
|
311
259
|
## Important Guidelines
|
|
312
260
|
|
|
313
261
|
### Output Quality
|
|
314
|
-
- **Quality over quantity** -
|
|
315
|
-
- **Cross-level validation** -
|
|
316
|
-
- **Preserve actionability** -
|
|
317
|
-
- **Maintain context** -
|
|
318
|
-
- **Be specific** -
|
|
262
|
+
- **Quality over quantity** - every suggestion must be one the reviewer is glad to have seen
|
|
263
|
+
- **Cross-level validation** - higher confidence for issues corroborated by multiple levels
|
|
264
|
+
- **Preserve actionability** - every suggestion should give clear next steps, keeping concrete failure and attack scenarios and cited evidence intact
|
|
265
|
+
- **Maintain context** - don't lose important details when merging
|
|
266
|
+
- **Be specific** - avoid vague observations; provide concrete guidance
|
|
319
267
|
|
|
320
268
|
### Coverage and Scope
|
|
321
269
|
- **Suggestions may target any line in modified files** - Context lines can reveal issues too
|
|
322
270
|
- **Only include modified files** - Discard any suggestions for files not modified in this PR
|
|
323
271
|
- **Preserve file-level insights** - Don't discard valuable file-level observations
|
|
324
|
-
- **
|
|
325
|
-
|
|
326
|
-
### Review Philosophy
|
|
327
|
-
- **Be constructive, not critical** - The goal is to help, not to find fault
|
|
328
|
-
- **Consider the full picture** - Individual issues may be less important than overall patterns
|
|
329
|
-
- **Respect the developer's intent** - Understand why choices were made before suggesting changes
|
|
330
|
-
- **Acknowledge good work** - Praise reinforces positive patterns and balances criticism
|
|
331
|
-
- **Think like a pair programmer** - You're a helpful colleague, not an automated gate
|
|
272
|
+
- **Cover all modified files** - Ensure real issues in every modified file are represented; do not let one noisy file crowd out the rest
|
|
332
273
|
|
|
333
274
|
### Synthesis Strategy
|
|
334
275
|
- Start by identifying themes across the three levels
|
|
335
276
|
- Look for issues that appear in multiple levels (high priority)
|
|
336
277
|
- Identify unique insights from each level that add value
|
|
337
|
-
- Discard redundant or
|
|
278
|
+
- Discard redundant or weakly-evidenced suggestions
|
|
338
279
|
- Ensure the final set tells a coherent story about the PR's quality
|
|
280
|
+
|
|
281
|
+
### Reply Shape
|
|
282
|
+
- Your reply is the JSON object alone — no sentence announcing what you will do, no narration of what you did. The first character of your reply is `{`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pair-loop",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.1",
|
|
4
4
|
"description": "Agent-orchestrated review loop — implement, review with pair-review multi-model councils via the headless CLI, triage, fix, and repeat until a final review returns no blockers. MCP-independent.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "in-the-loop-labs",
|
|
@@ -107,6 +107,35 @@
|
|
|
107
107
|
justify-content: center;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
+
/* Message is set via textContent, so blank lines in the string are the only
|
|
111
|
+
way a caller can express a paragraph break. Honour them. */
|
|
112
|
+
#confirm-dialog-message {
|
|
113
|
+
white-space: pre-line;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/* Opt-in "don't ask again"-style checkbox row (ConfirmDialog checkboxLabel) */
|
|
117
|
+
.confirm-dialog__checkbox {
|
|
118
|
+
display: flex;
|
|
119
|
+
align-items: center;
|
|
120
|
+
gap: 8px;
|
|
121
|
+
margin-top: 14px;
|
|
122
|
+
font-size: 13px;
|
|
123
|
+
color: var(--color-text-secondary, #57606a);
|
|
124
|
+
cursor: pointer;
|
|
125
|
+
user-select: none;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.confirm-dialog__checkbox input[type="checkbox"] {
|
|
129
|
+
margin: 0;
|
|
130
|
+
flex-shrink: 0;
|
|
131
|
+
cursor: pointer;
|
|
132
|
+
accent-color: var(--color-accent-primary, #0969da);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
[data-theme="dark"] .confirm-dialog__checkbox {
|
|
136
|
+
color: var(--color-text-secondary, #8b949e);
|
|
137
|
+
}
|
|
138
|
+
|
|
110
139
|
/* When a secondary button is visible (3 buttons), widen and stack vertically.
|
|
111
140
|
column-reverse puts Confirm (primary) on top, Cancel on bottom. */
|
|
112
141
|
.confirm-dialog-container.has-secondary {
|