@in-the-loop-labs/pair-review 5.4.2 → 5.4.4
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 +1 -1
- 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-balanced.md +1 -1
- package/plugin-code-critic/skills/analyze/references/level1-thorough.md +1 -1
- package/plugin-code-critic/skills/analyze/references/level2-balanced.md +2 -2
- package/plugin-code-critic/skills/analyze/references/level2-thorough.md +2 -2
- package/plugin-code-critic/skills/analyze/references/level3-balanced.md +2 -2
- package/plugin-code-critic/skills/analyze/references/level3-thorough.md +2 -2
- package/plugin-code-critic/skills/analyze/references/orchestration-balanced.md +3 -3
- package/plugin-code-critic/skills/analyze/references/orchestration-fast.md +1 -1
- package/plugin-code-critic/skills/analyze/references/orchestration-thorough.md +3 -3
- package/plugin-pair-loop/.claude-plugin/plugin.json +1 -1
- package/public/css/pr.css +0 -108
- package/public/css/toast.css +147 -0
- package/public/index.html +1 -0
- package/public/js/components/CouncilProgressModal.js +2 -9
- package/public/js/components/Toast.js +39 -4
- package/public/js/pr.js +21 -8
- package/public/js/utils/category-emoji.js +1 -1
- package/public/js/utils/header-anchor.js +38 -0
- package/public/local.html +4 -0
- package/public/pr.html +4 -0
- package/src/ai/antigravity-provider.js +57 -7
- package/src/ai/codex-provider.js +65 -17
- package/src/ai/executable-provider.js +1 -1
- package/src/ai/pi-format.js +42 -1
- package/src/ai/pi-style-provider.js +25 -10
- package/src/ai/prompts/baseline/consolidation/balanced.js +2 -2
- package/src/ai/prompts/baseline/consolidation/thorough.js +2 -2
- package/src/ai/prompts/baseline/level1/balanced.js +1 -1
- package/src/ai/prompts/baseline/level1/thorough.js +1 -1
- package/src/ai/prompts/baseline/level2/balanced.js +2 -2
- package/src/ai/prompts/baseline/level2/thorough.js +2 -2
- package/src/ai/prompts/baseline/level3/balanced.js +2 -2
- package/src/ai/prompts/baseline/level3/thorough.js +2 -2
- package/src/ai/prompts/baseline/orchestration/balanced.js +2 -2
- package/src/ai/prompts/baseline/orchestration/thorough.js +2 -2
- package/src/ai/prompts/shared/output-schema.js +6 -201
- package/src/utils/category-emoji.js +1 -1
|
@@ -180,7 +180,7 @@ Output JSON with this structure:
|
|
|
180
180
|
"description": "Detailed explanation mentioning why full file context was needed",
|
|
181
181
|
"suggestion": "How to fix/improve based on file context (omit for praise items)",
|
|
182
182
|
"confidence": 0.0-1.0,
|
|
183
|
-
"reasoning": ["
|
|
183
|
+
"reasoning": ["Concise code evidence and impact supporting this issue"]
|
|
184
184
|
}],
|
|
185
185
|
"fileLevelSuggestions": [{
|
|
186
186
|
"file": "path/to/file",
|
|
@@ -190,7 +190,7 @@ Output JSON with this structure:
|
|
|
190
190
|
"description": "Explanation of the file-level observation (architecture, organization, naming, etc.)",
|
|
191
191
|
"suggestion": "How to address the file-level concern (omit for praise items)",
|
|
192
192
|
"confidence": 0.0-1.0,
|
|
193
|
-
"reasoning": ["
|
|
193
|
+
"reasoning": ["Concise code evidence and impact supporting this issue"]
|
|
194
194
|
}],
|
|
195
195
|
"summary": "Brief summary of file context findings"
|
|
196
196
|
}
|
|
@@ -147,7 +147,7 @@ Output JSON with this structure:
|
|
|
147
147
|
"description": "Detailed explanation mentioning why codebase context was needed",
|
|
148
148
|
"suggestion": "How to fix/improve based on codebase context (omit for praise items)",
|
|
149
149
|
"confidence": 0.0-1.0,
|
|
150
|
-
"reasoning": ["
|
|
150
|
+
"reasoning": ["Concise code evidence and impact supporting this issue (optional)"]
|
|
151
151
|
}],
|
|
152
152
|
"fileLevelSuggestions": [{
|
|
153
153
|
"file": "path/to/file",
|
|
@@ -157,7 +157,7 @@ Output JSON with this structure:
|
|
|
157
157
|
"description": "Explanation of the file-level observation from codebase perspective",
|
|
158
158
|
"suggestion": "How to address the file-level concern (omit for praise items)",
|
|
159
159
|
"confidence": 0.0-1.0,
|
|
160
|
-
"reasoning": ["
|
|
160
|
+
"reasoning": ["Concise code evidence and impact supporting this issue (optional)"]
|
|
161
161
|
}],
|
|
162
162
|
"summary": "Brief summary of how these changes connect to and impact the codebase"
|
|
163
163
|
}
|
|
@@ -170,7 +170,7 @@ Output JSON with this structure:
|
|
|
170
170
|
"description": "Detailed explanation mentioning why codebase context was needed",
|
|
171
171
|
"suggestion": "How to fix/improve based on codebase context (omit for praise items)",
|
|
172
172
|
"confidence": 0.0-1.0,
|
|
173
|
-
"reasoning": ["
|
|
173
|
+
"reasoning": ["Concise code evidence and impact supporting this issue"]
|
|
174
174
|
}],
|
|
175
175
|
"fileLevelSuggestions": [{
|
|
176
176
|
"file": "path/to/file",
|
|
@@ -180,7 +180,7 @@ Output JSON with this structure:
|
|
|
180
180
|
"description": "Explanation of the file-level observation from codebase perspective",
|
|
181
181
|
"suggestion": "How to address the file-level concern (omit for praise items)",
|
|
182
182
|
"confidence": 0.0-1.0,
|
|
183
|
-
"reasoning": ["
|
|
183
|
+
"reasoning": ["Concise code evidence and impact supporting this issue"]
|
|
184
184
|
}],
|
|
185
185
|
"summary": "Brief summary of how these changes connect to and impact the codebase"
|
|
186
186
|
}
|
|
@@ -149,7 +149,7 @@ Output JSON with this structure:
|
|
|
149
149
|
"description": "Clear explanation of the issue and why this guidance matters to the human reviewer",
|
|
150
150
|
"suggestion": "Specific, actionable guidance for the reviewer. For praise items this can be omitted. For other types always include specific, actionable suggestions.",
|
|
151
151
|
"confidence": 0.0-1.0,
|
|
152
|
-
"reasoning": ["
|
|
152
|
+
"reasoning": ["Concise code evidence and impact supporting this issue (optional)"]
|
|
153
153
|
}],
|
|
154
154
|
"fileLevelSuggestions": [{
|
|
155
155
|
"file": "path/to/file",
|
|
@@ -159,7 +159,7 @@ Output JSON with this structure:
|
|
|
159
159
|
"description": "Explanation of the file-level observation",
|
|
160
160
|
"suggestion": "How to address the file-level concern (omit for praise items)",
|
|
161
161
|
"confidence": 0.0-1.0,
|
|
162
|
-
"reasoning": ["
|
|
162
|
+
"reasoning": ["Concise code evidence and impact supporting this issue (optional)"]
|
|
163
163
|
}],
|
|
164
164
|
"summary": "Formatted markdown summary following the Summary Structure guidance above."
|
|
165
165
|
}
|
|
@@ -255,7 +255,7 @@ Output JSON with this structure:
|
|
|
255
255
|
"description": "Clear explanation of the issue and why this guidance matters to the human reviewer",
|
|
256
256
|
"suggestion": "Specific, actionable guidance for the reviewer (omit for praise items)",
|
|
257
257
|
"confidence": 0.0-1.0,
|
|
258
|
-
"reasoning": ["
|
|
258
|
+
"reasoning": ["Concise code evidence and impact supporting this issue"]
|
|
259
259
|
}],
|
|
260
260
|
"fileLevelSuggestions": [{
|
|
261
261
|
"file": "path/to/file",
|
|
@@ -265,7 +265,7 @@ Output JSON with this structure:
|
|
|
265
265
|
"description": "Explanation of the file-level observation",
|
|
266
266
|
"suggestion": "How to address the file-level concern (omit for praise items)",
|
|
267
267
|
"confidence": 0.0-1.0,
|
|
268
|
-
"reasoning": ["
|
|
268
|
+
"reasoning": ["Concise code evidence and impact supporting this issue"]
|
|
269
269
|
}],
|
|
270
270
|
"summary": "Formatted markdown summary following the Summary Synthesis Guidance above."
|
|
271
271
|
}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
// Copyright 2026 Tim Perkins (tjwp) | SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
/**
|
|
3
|
-
* Output schema
|
|
3
|
+
* Output schema documentation shared across prompt types.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* CRITICAL: Output schemas are sacred - they must be identical across
|
|
9
|
-
* all providers to ensure consistent parsing.
|
|
5
|
+
* Each baseline prompt defines its own locked `output-schema` section inline
|
|
6
|
+
* (see src/ai/prompts/baseline/). This module holds only the input schema docs
|
|
7
|
+
* that the orchestration prompts embed to describe the suggestions they receive.
|
|
10
8
|
*/
|
|
11
9
|
|
|
12
10
|
/**
|
|
@@ -24,202 +22,9 @@ const ORCHESTRATION_INPUT_SCHEMA_DOCS = `Each level provides suggestions as a JS
|
|
|
24
22
|
- suggestion: remediation advice
|
|
25
23
|
- severity: "critical", "medium", or "minor" (omit for praise items)
|
|
26
24
|
- confidence: 0.0-1.0 score
|
|
27
|
-
- reasoning: (optional) array of strings with
|
|
25
|
+
- reasoning: (optional) array of strings with concise code evidence and impact
|
|
28
26
|
- is_file_level: true if this is a file-level suggestion (no line numbers)`;
|
|
29
27
|
|
|
30
|
-
/**
|
|
31
|
-
* Level 1 output schema (diff analysis - changes in isolation)
|
|
32
|
-
*/
|
|
33
|
-
const LEVEL1_OUTPUT_SCHEMA = {
|
|
34
|
-
level: 1,
|
|
35
|
-
suggestions: [{
|
|
36
|
-
file: 'path/to/file',
|
|
37
|
-
line_start: 42,
|
|
38
|
-
line_end: 42,
|
|
39
|
-
old_or_new: 'NEW',
|
|
40
|
-
type: 'bug|improvement|praise|suggestion|design|performance|security|code-style',
|
|
41
|
-
severity: 'critical|medium|minor (omit for praise)',
|
|
42
|
-
title: 'Brief title',
|
|
43
|
-
description: 'Detailed explanation',
|
|
44
|
-
suggestion: 'How to fix/improve (omit this field for praise items - no action needed)',
|
|
45
|
-
confidence: '0.0-1.0',
|
|
46
|
-
reasoning: ['Step 1: ...', 'Step 2: ...']
|
|
47
|
-
}],
|
|
48
|
-
summary: 'Brief summary of findings'
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Level 2 output schema (file context analysis)
|
|
53
|
-
*/
|
|
54
|
-
const LEVEL2_OUTPUT_SCHEMA = {
|
|
55
|
-
level: 2,
|
|
56
|
-
suggestions: [{
|
|
57
|
-
file: 'path/to/file',
|
|
58
|
-
line_start: 42,
|
|
59
|
-
line_end: 42,
|
|
60
|
-
old_or_new: 'NEW',
|
|
61
|
-
type: 'bug|improvement|praise|suggestion|design|performance|security|code-style',
|
|
62
|
-
severity: 'critical|medium|minor (omit for praise)',
|
|
63
|
-
title: 'Brief title',
|
|
64
|
-
description: 'Detailed explanation mentioning why full file context was needed',
|
|
65
|
-
suggestion: 'How to fix/improve based on file context (omit for praise items)',
|
|
66
|
-
confidence: 0.8,
|
|
67
|
-
reasoning: ['Step 1: ...', 'Step 2: ...']
|
|
68
|
-
}],
|
|
69
|
-
fileLevelSuggestions: [{
|
|
70
|
-
file: 'path/to/file',
|
|
71
|
-
type: 'bug|improvement|praise|suggestion|design|performance|security|code-style',
|
|
72
|
-
severity: 'critical|medium|minor (omit for praise)',
|
|
73
|
-
title: 'Brief title describing file-level concern',
|
|
74
|
-
description: 'Explanation of the file-level observation (architecture, organization, naming, etc.)',
|
|
75
|
-
suggestion: 'How to address the file-level concern (omit for praise items)',
|
|
76
|
-
confidence: 0.8,
|
|
77
|
-
reasoning: ['Step 1: ...', 'Step 2: ...']
|
|
78
|
-
}],
|
|
79
|
-
summary: 'Brief summary of file context findings'
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Level 3 output schema (codebase context analysis)
|
|
84
|
-
*/
|
|
85
|
-
const LEVEL3_OUTPUT_SCHEMA = {
|
|
86
|
-
level: 3,
|
|
87
|
-
suggestions: [{
|
|
88
|
-
file: 'path/to/file',
|
|
89
|
-
line_start: 42,
|
|
90
|
-
line_end: 42,
|
|
91
|
-
old_or_new: 'NEW',
|
|
92
|
-
type: 'bug|improvement|praise|suggestion|design|performance|security|code-style',
|
|
93
|
-
severity: 'critical|medium|minor (omit for praise)',
|
|
94
|
-
title: 'Brief title',
|
|
95
|
-
description: 'Detailed explanation mentioning why codebase context was needed',
|
|
96
|
-
suggestion: 'How to fix/improve based on codebase context (omit for praise items)',
|
|
97
|
-
confidence: '0.0-1.0',
|
|
98
|
-
reasoning: ['Step 1: ...', 'Step 2: ...']
|
|
99
|
-
}],
|
|
100
|
-
fileLevelSuggestions: [{
|
|
101
|
-
file: 'path/to/file',
|
|
102
|
-
type: 'bug|improvement|praise|suggestion|design|performance|security|code-style',
|
|
103
|
-
severity: 'critical|medium|minor (omit for praise)',
|
|
104
|
-
title: 'Brief title describing file-level concern',
|
|
105
|
-
description: 'Explanation of the file-level observation from codebase perspective',
|
|
106
|
-
suggestion: 'How to address the file-level concern (omit for praise items)',
|
|
107
|
-
confidence: '0.0-1.0',
|
|
108
|
-
reasoning: ['Step 1: ...', 'Step 2: ...']
|
|
109
|
-
}],
|
|
110
|
-
summary: 'Brief summary of how these changes connect to and impact the codebase'
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Orchestration output schema (curated multi-level analysis)
|
|
115
|
-
*/
|
|
116
|
-
const ORCHESTRATION_OUTPUT_SCHEMA = {
|
|
117
|
-
level: 'orchestrated',
|
|
118
|
-
suggestions: [{
|
|
119
|
-
file: 'path/to/file',
|
|
120
|
-
line_start: 42,
|
|
121
|
-
line_end: 42,
|
|
122
|
-
old_or_new: 'NEW',
|
|
123
|
-
type: 'bug|improvement|praise|suggestion|design|performance|security|code-style',
|
|
124
|
-
severity: 'critical|medium|minor (omit for praise)',
|
|
125
|
-
title: 'Brief title describing the curated insight',
|
|
126
|
-
description: 'Clear explanation of the issue and why this guidance matters to the human reviewer',
|
|
127
|
-
suggestion: 'Specific, actionable guidance for the reviewer (omit for praise items)',
|
|
128
|
-
confidence: '0.0-1.0',
|
|
129
|
-
reasoning: ['Step 1: ...', 'Step 2: ...']
|
|
130
|
-
}],
|
|
131
|
-
fileLevelSuggestions: [{
|
|
132
|
-
file: 'path/to/file',
|
|
133
|
-
type: 'bug|improvement|praise|suggestion|design|performance|security|code-style',
|
|
134
|
-
severity: 'critical|medium|minor (omit for praise)',
|
|
135
|
-
title: 'Brief title describing file-level concern',
|
|
136
|
-
description: 'Explanation of the file-level observation',
|
|
137
|
-
suggestion: 'How to address the file-level concern (omit for praise items)',
|
|
138
|
-
confidence: '0.0-1.0',
|
|
139
|
-
reasoning: ['Step 1: ...', 'Step 2: ...']
|
|
140
|
-
}],
|
|
141
|
-
summary: 'Brief summary of orchestration results and key patterns found'
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Helper to build a locked output schema section
|
|
146
|
-
* @param {Object} schema - The output schema object
|
|
147
|
-
* @returns {Object} Section definition
|
|
148
|
-
*/
|
|
149
|
-
function buildOutputSchemaSection(schema) {
|
|
150
|
-
return {
|
|
151
|
-
name: 'output-schema',
|
|
152
|
-
locked: true,
|
|
153
|
-
content: `## Output Format
|
|
154
|
-
|
|
155
|
-
### CRITICAL OUTPUT REQUIREMENT
|
|
156
|
-
Output ONLY valid JSON with no additional text, explanations, or markdown code blocks. Do not wrap the JSON in \`\`\`json blocks. The response must start with { and end with }.
|
|
157
|
-
|
|
158
|
-
Output JSON with this structure:
|
|
159
|
-
${JSON.stringify(schema, null, 2)}
|
|
160
|
-
|
|
161
|
-
### GitHub Suggestion Syntax
|
|
162
|
-
When suggesting a specific change, **embed** a GitHub suggestion block within the "suggestion" field:
|
|
163
|
-
|
|
164
|
-
\`\`\`suggestion
|
|
165
|
-
replacement content here
|
|
166
|
-
\`\`\`
|
|
167
|
-
|
|
168
|
-
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.`
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Section definition for output schema (Level 1)
|
|
174
|
-
*/
|
|
175
|
-
const level1OutputSchemaSection = buildOutputSchemaSection(LEVEL1_OUTPUT_SCHEMA);
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* Section definition for output schema (Level 2)
|
|
179
|
-
* @deprecated Use getOutputSchemaSection(2) instead
|
|
180
|
-
*/
|
|
181
|
-
const outputSchemaSection = buildOutputSchemaSection(LEVEL2_OUTPUT_SCHEMA);
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* Section definition for output schema (Level 3)
|
|
185
|
-
*/
|
|
186
|
-
const level3OutputSchemaSection = buildOutputSchemaSection(LEVEL3_OUTPUT_SCHEMA);
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* Section definition for output schema (Orchestration)
|
|
190
|
-
*/
|
|
191
|
-
const orchestrationOutputSchemaSection = buildOutputSchemaSection(ORCHESTRATION_OUTPUT_SCHEMA);
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* Get the output schema section for a specific level
|
|
195
|
-
* @param {number|string} level - Analysis level (1, 2, 3, or 'orchestration')
|
|
196
|
-
* @returns {Object} Section definition
|
|
197
|
-
*/
|
|
198
|
-
function getOutputSchemaSection(level) {
|
|
199
|
-
if (level === 1) {
|
|
200
|
-
return level1OutputSchemaSection;
|
|
201
|
-
}
|
|
202
|
-
if (level === 2) {
|
|
203
|
-
return outputSchemaSection;
|
|
204
|
-
}
|
|
205
|
-
if (level === 3) {
|
|
206
|
-
return level3OutputSchemaSection;
|
|
207
|
-
}
|
|
208
|
-
if (level === 'orchestration') {
|
|
209
|
-
return orchestrationOutputSchemaSection;
|
|
210
|
-
}
|
|
211
|
-
throw new Error(`Output schema for level ${level} not yet implemented`);
|
|
212
|
-
}
|
|
213
|
-
|
|
214
28
|
module.exports = {
|
|
215
|
-
|
|
216
|
-
LEVEL2_OUTPUT_SCHEMA,
|
|
217
|
-
LEVEL3_OUTPUT_SCHEMA,
|
|
218
|
-
ORCHESTRATION_OUTPUT_SCHEMA,
|
|
219
|
-
ORCHESTRATION_INPUT_SCHEMA_DOCS,
|
|
220
|
-
outputSchemaSection,
|
|
221
|
-
level1OutputSchemaSection,
|
|
222
|
-
level3OutputSchemaSection,
|
|
223
|
-
orchestrationOutputSchemaSection,
|
|
224
|
-
getOutputSchemaSection
|
|
29
|
+
ORCHESTRATION_INPUT_SCHEMA_DOCS
|
|
225
30
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Canonical category-to-emoji mapping for AI suggestion types.
|
|
4
4
|
* Used by server-side code to format adopted comments.
|
|
5
5
|
*
|
|
6
|
-
* Canonical types from src/ai/prompts/
|
|
6
|
+
* Canonical types from the output-schema sections in src/ai/prompts/baseline/:
|
|
7
7
|
* bug|improvement|praise|suggestion|design|performance|security|code-style
|
|
8
8
|
*/
|
|
9
9
|
|