codecritique 1.2.1 → 1.2.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.
- package/package.json +1 -1
- package/src/content-retrieval.js +20 -16
- package/src/custom-documents.js +19 -19
- package/src/custom-documents.test.js +11 -9
- package/src/feedback-loader.js +31 -31
- package/src/index.js +99 -119
- package/src/llm.js +4 -3
- package/src/project-analyzer.js +32 -39
- package/src/project-analyzer.test.js +3 -5
- package/src/prompt-cache.js +1 -0
- package/src/rag-analyzer.js +199 -178
- package/src/rag-analyzer.test.js +57 -0
- package/src/rag-review.js +105 -74
- package/src/rag-review.test.js +115 -3
- package/src/zero-shot-classifier-open.js +3 -2
|
@@ -272,7 +272,6 @@ describe('ProjectAnalyzer', () => {
|
|
|
272
272
|
await analyzer.storeAnalysis(mockProjectPath, summary);
|
|
273
273
|
|
|
274
274
|
expect(mockEmbeddingsSystem.storeProjectSummary).toHaveBeenCalledWith(mockProjectPath, summary);
|
|
275
|
-
expect(console.log).toHaveBeenCalledWith(expect.stringContaining('Project analysis stored'));
|
|
276
275
|
});
|
|
277
276
|
|
|
278
277
|
it('should handle storage errors gracefully', async () => {
|
|
@@ -319,7 +318,7 @@ describe('ProjectAnalyzer', () => {
|
|
|
319
318
|
await analyzer.validateAndUpdateKeyFiles(existingFiles, mockProjectPath);
|
|
320
319
|
|
|
321
320
|
// With 1 of 3 files found (33%), it should trigger fresh discovery
|
|
322
|
-
expect(
|
|
321
|
+
expect(mockEmbeddingsSystem.initialize).toHaveBeenCalled();
|
|
323
322
|
});
|
|
324
323
|
|
|
325
324
|
it('should filter out missing files and keep existing ones', async () => {
|
|
@@ -366,7 +365,7 @@ describe('ProjectAnalyzer', () => {
|
|
|
366
365
|
await analyzer.validateAndUpdateKeyFiles(existingFiles, mockProjectPath);
|
|
367
366
|
|
|
368
367
|
// Should trigger discoverKeyFilesWithLLM
|
|
369
|
-
expect(
|
|
368
|
+
expect(mockEmbeddingsSystem.initialize).toHaveBeenCalled();
|
|
370
369
|
});
|
|
371
370
|
});
|
|
372
371
|
|
|
@@ -410,7 +409,7 @@ describe('ProjectAnalyzer', () => {
|
|
|
410
409
|
const result = await analyzer.mineKeyFilesFromEmbeddings(mockProjectPath);
|
|
411
410
|
|
|
412
411
|
expect(result).toEqual([]);
|
|
413
|
-
expect(console.
|
|
412
|
+
expect(console.warn).toHaveBeenCalledWith(expect.stringContaining('legacy index format'));
|
|
414
413
|
});
|
|
415
414
|
|
|
416
415
|
it('should return empty array on query error', async () => {
|
|
@@ -496,7 +495,6 @@ describe('ProjectAnalyzer', () => {
|
|
|
496
495
|
await analyzer.selectFinalKeyFiles(candidates, mockProjectPath);
|
|
497
496
|
|
|
498
497
|
expect(console.error).toHaveBeenCalled();
|
|
499
|
-
expect(console.log).toHaveBeenCalledWith(expect.stringContaining('Falling back to automatic selection'));
|
|
500
498
|
});
|
|
501
499
|
|
|
502
500
|
it('should fallback if LLM returns invalid response', async () => {
|
package/src/prompt-cache.js
CHANGED
|
@@ -195,6 +195,7 @@ Code suggestions enable reviewers to apply fixes directly as GitHub suggestions.
|
|
|
195
195
|
*/
|
|
196
196
|
const LINE_NUMBERS_RULE = `**CRITICAL 'lineNumbers' RULE - MANDATORY COMPLIANCE**:
|
|
197
197
|
- **ALWAYS provide line numbers** - this field is REQUIRED for every issue
|
|
198
|
+
- **Line numbers are shown in the file content** as a prefix on each line (e.g., " 42 | const x = 1;"). Use THESE line numbers directly - do NOT try to count lines yourself.
|
|
198
199
|
- If you can identify specific lines, provide them (max 3-5 for repeated issues)
|
|
199
200
|
- If the issue affects the entire file or cannot be pinpointed, provide [1] or relevant section line numbers
|
|
200
201
|
- For ANY issue that occurs multiple times in a file, list ONLY the first 3-5 occurrences maximum
|