codecritique 2.1.1 → 2.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/README.md +1 -1
- package/package.json +1 -1
- package/src/index.js +1 -1
- package/src/llm.js +1 -1
- package/src/llm.test.js +1 -1
- package/src/project-analyzer.js +4 -1
- package/src/project-analyzer.test.js +3 -1
- package/src/rag-analyzer.js +1 -1
package/README.md
CHANGED
|
@@ -415,7 +415,7 @@ jobs:
|
|
|
415
415
|
| `anthropic-api-key` | Anthropic API key for Claude models | **Yes** | - |
|
|
416
416
|
| `skip-label` | Label name to skip AI review | No | `ai-review-disabled` |
|
|
417
417
|
| `verbose` | Show verbose output | No | `false` |
|
|
418
|
-
| `model` | LLM model to use (e.g., `claude-sonnet-4-
|
|
418
|
+
| `model` | LLM model to use (e.g., `claude-sonnet-4-6`) | No | Auto-selected |
|
|
419
419
|
| `max-tokens` | Maximum tokens for LLM response | No | Auto-calculated |
|
|
420
420
|
| `cache-ttl` | Cache TTL for LLM prompts: "5m" (default, no extra cost) or "1h" (extended, extra cost for cache writes) | No | `5m` |
|
|
421
421
|
| `concurrency` | Concurrency for processing multiple files | No | `3` |
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -62,7 +62,7 @@ program
|
|
|
62
62
|
.option('--output-file <file>', 'Save output to file (useful with --output json)')
|
|
63
63
|
.option('--no-color', 'Disable colored output')
|
|
64
64
|
.option('--verbose', 'Show verbose output')
|
|
65
|
-
.option('--model <model>', 'LLM model to use (e.g., claude-sonnet-4-
|
|
65
|
+
.option('--model <model>', 'LLM model to use (e.g., claude-sonnet-4-6)')
|
|
66
66
|
.option('--temperature <number>', 'LLM temperature', parseFloat, 0.2)
|
|
67
67
|
.option('--max-tokens <number>', 'LLM max tokens', parseInt, 8192)
|
|
68
68
|
.option('--cache-ttl <ttl>', 'Cache TTL for LLM prompts: "5m" (default, no extra cost) or "1h" (extended, extra cost for writes)', '5m')
|
package/src/llm.js
CHANGED
package/src/llm.test.js
CHANGED
package/src/project-analyzer.js
CHANGED
|
@@ -17,6 +17,7 @@ import { verboseLog } from './utils/logging.js';
|
|
|
17
17
|
import { escapeSqlString } from './utils/string-utils.js';
|
|
18
18
|
|
|
19
19
|
const TERM_SEARCH_CONTENT_CANDIDATE_LIMIT = 500;
|
|
20
|
+
const PROJECT_ANALYSIS_MODEL = 'claude-haiku-4-5';
|
|
20
21
|
|
|
21
22
|
// Consolidated file classification configuration
|
|
22
23
|
const FILE_PATTERNS = {
|
|
@@ -586,6 +587,7 @@ Select files following the criteria in the system instructions.`;
|
|
|
586
587
|
};
|
|
587
588
|
|
|
588
589
|
const response = await this.llm.sendPromptToClaude(prompt, {
|
|
590
|
+
model: PROJECT_ANALYSIS_MODEL,
|
|
589
591
|
system: FILE_SELECTION_SYSTEM_PROMPT,
|
|
590
592
|
temperature: 0.1,
|
|
591
593
|
maxTokens: 1000,
|
|
@@ -878,6 +880,7 @@ Follow the analysis guidelines from the system instructions to identify custom i
|
|
|
878
880
|
};
|
|
879
881
|
|
|
880
882
|
const response = await this.llm.sendPromptToClaude(prompt, {
|
|
883
|
+
model: PROJECT_ANALYSIS_MODEL,
|
|
881
884
|
system: PROJECT_SUMMARY_SYSTEM_PROMPT,
|
|
882
885
|
temperature: 0.1,
|
|
883
886
|
maxTokens: 4000,
|
|
@@ -886,7 +889,7 @@ Follow the analysis guidelines from the system instructions to identify custom i
|
|
|
886
889
|
|
|
887
890
|
const summary = response.json;
|
|
888
891
|
if (summary) {
|
|
889
|
-
// Validate and ensure required fields exist
|
|
892
|
+
// Validate and ensure required fields exist across model responses
|
|
890
893
|
const validatedSummary = this.validateProjectSummary(summary);
|
|
891
894
|
|
|
892
895
|
// Add metadata
|
|
@@ -556,7 +556,7 @@ describe('ProjectAnalyzer', () => {
|
|
|
556
556
|
|
|
557
557
|
const result = await analyzer.selectFinalKeyFiles(candidates, mockProjectPath);
|
|
558
558
|
|
|
559
|
-
expect(llm.sendPromptToClaude).
|
|
559
|
+
expect(llm.sendPromptToClaude).toHaveBeenCalledWith(expect.any(String), expect.objectContaining({ model: 'claude-haiku-4-5' }));
|
|
560
560
|
expect(result.length).toBe(1);
|
|
561
561
|
expect(result[0].relativePath).toBe('package.json');
|
|
562
562
|
});
|
|
@@ -668,9 +668,11 @@ describe('ProjectAnalyzer', () => {
|
|
|
668
668
|
content: JSON.stringify(mockSummary),
|
|
669
669
|
json: mockSummary,
|
|
670
670
|
});
|
|
671
|
+
analyzer.llm = llm;
|
|
671
672
|
|
|
672
673
|
const result = await analyzer.generateProjectSummary(mockKeyFiles, mockProjectPath);
|
|
673
674
|
|
|
675
|
+
expect(llm.sendPromptToClaude).toHaveBeenCalledWith(expect.any(String), expect.objectContaining({ model: 'claude-haiku-4-5' }));
|
|
674
676
|
expect(result.projectName).toBe('test-project');
|
|
675
677
|
expect(result.analysisDate).toBeDefined();
|
|
676
678
|
expect(result.projectPath).toBe(mockProjectPath);
|
package/src/rag-analyzer.js
CHANGED
|
@@ -764,7 +764,7 @@ function prepareContextForLLM(filePath, content, language, finalCodeExamples, fi
|
|
|
764
764
|
async function callLLMForAnalysis(context, options = {}) {
|
|
765
765
|
try {
|
|
766
766
|
let prompt;
|
|
767
|
-
const model = options.model || 'claude-sonnet-4-
|
|
767
|
+
const model = options.model || 'claude-sonnet-4-6';
|
|
768
768
|
const maxTokens = options.maxTokens || 8192; // Default to a safe limit
|
|
769
769
|
|
|
770
770
|
if (options.isHolisticPRReview) {
|