@in-the-loop-labs/pair-review 5.4.1 → 5.4.3

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.
Files changed (46) hide show
  1. package/README.md +3 -3
  2. package/package.json +2 -2
  3. package/plugin/.claude-plugin/plugin.json +1 -1
  4. package/plugin-code-critic/.claude-plugin/plugin.json +1 -1
  5. package/plugin-code-critic/skills/analyze/references/level1-balanced.md +1 -1
  6. package/plugin-code-critic/skills/analyze/references/level1-thorough.md +1 -1
  7. package/plugin-code-critic/skills/analyze/references/level2-balanced.md +2 -2
  8. package/plugin-code-critic/skills/analyze/references/level2-thorough.md +2 -2
  9. package/plugin-code-critic/skills/analyze/references/level3-balanced.md +2 -2
  10. package/plugin-code-critic/skills/analyze/references/level3-thorough.md +2 -2
  11. package/plugin-code-critic/skills/analyze/references/orchestration-balanced.md +3 -3
  12. package/plugin-code-critic/skills/analyze/references/orchestration-fast.md +1 -1
  13. package/plugin-code-critic/skills/analyze/references/orchestration-thorough.md +3 -3
  14. package/plugin-pair-loop/.claude-plugin/plugin.json +1 -1
  15. package/public/index.html +3 -0
  16. package/public/js/components/CouncilProgressModal.js +2 -9
  17. package/public/js/index.js +29 -0
  18. package/public/js/pr.js +21 -8
  19. package/public/js/utils/category-emoji.js +1 -1
  20. package/public/js/utils/header-anchor.js +38 -0
  21. package/public/local.html +3 -0
  22. package/public/pr.html +3 -0
  23. package/src/ai/antigravity-provider.js +76 -35
  24. package/src/ai/claude-provider.js +115 -39
  25. package/src/ai/codex-provider.js +84 -41
  26. package/src/ai/copilot-provider.js +38 -46
  27. package/src/ai/cursor-agent-provider.js +78 -135
  28. package/src/ai/executable-provider.js +1 -1
  29. package/src/ai/pi-format.js +42 -1
  30. package/src/ai/pi-style-provider.js +25 -10
  31. package/src/ai/prompts/baseline/consolidation/balanced.js +2 -2
  32. package/src/ai/prompts/baseline/consolidation/thorough.js +2 -2
  33. package/src/ai/prompts/baseline/level1/balanced.js +1 -1
  34. package/src/ai/prompts/baseline/level1/thorough.js +1 -1
  35. package/src/ai/prompts/baseline/level2/balanced.js +2 -2
  36. package/src/ai/prompts/baseline/level2/thorough.js +2 -2
  37. package/src/ai/prompts/baseline/level3/balanced.js +2 -2
  38. package/src/ai/prompts/baseline/level3/thorough.js +2 -2
  39. package/src/ai/prompts/baseline/orchestration/balanced.js +2 -2
  40. package/src/ai/prompts/baseline/orchestration/thorough.js +2 -2
  41. package/src/ai/prompts/shared/output-schema.js +6 -201
  42. package/src/ai/provider.js +3 -3
  43. package/src/chat/session-manager.js +1 -1
  44. package/src/main.js +7 -3
  45. package/src/routes/bulk-analysis-configs.js +1 -1
  46. package/src/utils/category-emoji.js +1 -1
@@ -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": ["Step-by-step reasoning explaining why this issue was flagged (optional)"]
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": ["Step-by-step reasoning explaining why this issue was flagged (optional)"]
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": ["Step-by-step reasoning explaining why this issue was flagged"]
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": ["Step-by-step reasoning explaining why this issue was flagged"]
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": ["Step-by-step reasoning explaining why this issue was flagged (optional)"]
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": ["Step-by-step reasoning explaining why this issue was flagged (optional)"]
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": ["Step-by-step reasoning explaining why this issue was flagged"]
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": ["Step-by-step reasoning explaining why this issue was flagged"]
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 section - shared across prompt types
3
+ * Output schema documentation shared across prompt types.
4
4
  *
5
- * This section defines the JSON structure for AI responses.
6
- * It is LOCKED and cannot be modified by variants.
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 step-by-step reasoning
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
- LEVEL1_OUTPUT_SCHEMA,
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
  };
@@ -594,7 +594,7 @@ function resolveCliModelConfig(builtIn, configModel, modelId) {
594
594
  * Match a model definition against a selector that may be the model's canonical
595
595
  * id OR one of its aliases. Used by config-driven selectors (`default_model`,
596
596
  * `models` overrides) so legacy config naming an alias (e.g.
597
- * `opus`, an alias of the canonical `opus-5.5-xhigh`) keeps working.
597
+ * `opus`, an alias of the canonical `opus-5.5-high`) keeps working.
598
598
  *
599
599
  * Optional-chaining is intentional: a model with no `aliases` short-circuits to
600
600
  * undefined/falsy, so no Array.isArray guard is needed.
@@ -785,7 +785,7 @@ function applyConfigOverrides(config) {
785
785
 
786
786
  // Canonicalize alias-keyed override ids to their built-in canonical id.
787
787
  // A config entry may key a model by a short alias (e.g. `opus` for the
788
- // canonical `opus-5.5-xhigh`). mergeModels() already resolves aliases for the
788
+ // canonical `opus-5.5-high`). mergeModels() already resolves aliases for the
789
789
  // display/metadata path, but the runtime path forwards this raw `models` array
790
790
  // to the provider instance, where per-model config is looked up by EXACT id
791
791
  // (e.g. `configOverrides.models.find(m => m.id === model)`). The frontend
@@ -897,7 +897,7 @@ function mergeModels(builtInModels, configModels) {
897
897
  }
898
898
  // Replace overridden built-ins in-place to preserve display order. An override
899
899
  // matched by alias (e.g. config `{ id: 'opus' }` against built-in
900
- // `opus-5.5-xhigh`) still replaces, but keeps the canonical built-in id.
900
+ // `opus-5.5-high`) still replaces, but keeps the canonical built-in id.
901
901
  const matched = new Set();
902
902
  const merged = builtInModels.map(bm => {
903
903
  const override = configModels.find(cm => modelMatches(bm, cm.id));
@@ -110,7 +110,7 @@ class ChatSessionManager extends EventEmitter {
110
110
  const selector = model || providerDef?.model || null;
111
111
 
112
112
  // Canonicalise BEFORE the INSERT. Both the request and `chat_providers.<id>.model`
113
- // may name a model by alias (`opus` -> `opus-5.5-xhigh`); storing the alias would
113
+ // may name a model by alias (`opus` -> `opus-5.5-high`); storing the alias would
114
114
  // leave the sessions list, the hook payload, and the picker's checkmark disagreeing
115
115
  // with the catalog. `resolution.id` is exactly what to store: the canonical id when
116
116
  // known, the raw selector for a passthrough (raw CLI strings are supported), and
package/src/main.js CHANGED
@@ -234,12 +234,16 @@ OPTIONS:
234
234
  The web UI also starts for the human reviewer.
235
235
  --model <name> Override the AI model. Claude Code is the default provider.
236
236
  Available models: opus, sonnet, haiku (Claude Code);
237
- also: fable-5.1-xhigh, fable-5.1-high,
237
+ also: fable-5.2-xhigh, fable-5.2-high,
238
+ fable-5.1-xhigh, fable-5.1-high,
238
239
  fable-5-xhigh, fable-5-high, opus-5.5-xhigh,
239
240
  opus-5.5-high, opus-5.5-medium, opus-5.5-low,
240
241
  opus-5-xhigh, opus-5-high,
241
- sonnet-5-xhigh, sonnet-5-high, sonnet-4.6
242
- (default is opus-5.5-high; opus is Opus 5.5 XHigh;
242
+ sonnet-5.5-xhigh, sonnet-5.5-high,
243
+ sonnet-5-xhigh, sonnet-5-high, sonnet-4.6,
244
+ haiku-5.5-medium
245
+ (default is opus-5.5-high; opus is Opus 5.5 High;
246
+ fable is Fable 5.2 High;
243
247
  a saved default_model wins over the default)
244
248
  or use provider-specific models with Antigravity/Codex
245
249
  --provider <name> Override the AI provider for headless modes
@@ -152,7 +152,7 @@ function sanitizeSingleConfig(config) {
152
152
  // to the provider's own default rather than forwarding an invalid pair. Unknown
153
153
  // providers (custom/unavailable, not in the registry) pass through unchanged.
154
154
  // A model "belongs" to the provider if config.model matches a model id OR one of
155
- // its aliases (e.g. 'opus' is an alias of the canonical 'opus-5.5-xhigh'). Matching
155
+ // its aliases (e.g. 'opus' is an alias of the canonical 'opus-5.5-high'). Matching
156
156
  // id-only would wrongly treat a valid alias as a mismatched pair and silently coerce
157
157
  // it to the provider default.
158
158
  let normalizedModel = config.model;
@@ -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/shared/output-schema.js:
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