Sessions 7e+7f: Grade adapter, normalize consolidation, computeFeatures, analyzeViaEngine1, scan/parlay migrated to engine1
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
// PERF-2 (Session 7d): proves analyzeProp runs in parallel inside
|
||||
// scanParlay. We mock analyzeProp to sleep — a sequential loop would
|
||||
// take N × delay, parallel allSettled takes ~delay.
|
||||
// scanParlay. ARCH-1 Step 4 (Session 7f): the call target rotated from
|
||||
// `propAnalyzer.analyzeProp` to `intelligence/analyzeViaEngine1`. Mock
|
||||
// target updated to follow; the assertion (parallel timing) is
|
||||
// unchanged.
|
||||
|
||||
let mockAnalyzeDelayMs = 100;
|
||||
let mockAnalyzeCallTimes = [];
|
||||
let mockAnalyzeRejectIndices = new Set();
|
||||
|
||||
jest.mock('../../src/services/propAnalyzer', () => ({
|
||||
analyzeProp: async (leg) => {
|
||||
jest.mock('../../src/services/intelligence/analyzeViaEngine1', () => ({
|
||||
analyzeViaEngine1: async (leg) => {
|
||||
const startedAt = Date.now();
|
||||
mockAnalyzeCallTimes.push(startedAt);
|
||||
await new Promise((r) => setTimeout(r, mockAnalyzeDelayMs));
|
||||
@@ -16,8 +18,11 @@ jest.mock('../../src/services/propAnalyzer', () => ({
|
||||
}
|
||||
return {
|
||||
...leg,
|
||||
// Mock keeps the legacy-shape 4-letter grade so the existing
|
||||
// value-level assertion ('A-') is preserved verbatim. Real
|
||||
// analyzeViaEngine1 also emits the 4-letter shape via the adapter.
|
||||
grade: 'A-',
|
||||
confidence: 0.78,
|
||||
confidence: 78,
|
||||
edge_pct: 5.2,
|
||||
reasoning: { summary: 'ok', steps: {} },
|
||||
kill_conditions_triggered: [],
|
||||
|
||||
Reference in New Issue
Block a user