Sessions 7e+7f: Grade adapter, normalize consolidation, computeFeatures, analyzeViaEngine1, scan/parlay migrated to engine1

This commit is contained in:
Kev
2026-06-10 09:28:30 -04:00
parent 012c0ef47e
commit 4815ceac03
10 changed files with 952 additions and 11 deletions
+10 -1
View File
@@ -1,4 +1,13 @@
const express = require('express');
// ARCH-1 ESCAPE HATCH (Session 7f): /api/analyze stays on the legacy
// analyzeProp path. The unification's adapter + computeFeatures +
// analyzeViaEngine1 helpers are built and tested, but the integration
// test for this route asserts specific grade VALUES that the legacy
// engine produced for specific input mocks. Swapping in engine1
// preserves the SHAPE (verified) but produces different VALUES because
// the engine logic is intentionally different. Per the session rule
// "tests pass unmodified", reverted. See docs/SYSTEM-MANIFEST.md §8
// ARCH-1 for the migration roadmap.
const { analyzeProp } = require('../services/propAnalyzer');
const { cacheGet, cacheSet } = require('../utils/redis');
const { createRateLimit } = require('../middleware/rateLimit');
@@ -11,7 +20,7 @@ const router = express.Router();
const analyzeLimit = createRateLimit({ windowMs: 60_000, max: 10 });
router.use(analyzeLimit);
// PERF-1 (Session 7d): cache analyzeProp results in Redis. Same prop hit
// PERF-1 (Session 7d): cache analyze results in Redis. Same prop hit
// twice within 60s reuses the previous analysis instead of re-doing the
// upstream chain. 60s is short enough that line moves still surface.
const ANALYZE_TTL_SECONDS = 60;