Session 32: Grades pipeline + NFL/NHL wiring + rate limiting + audit cleanup (1718 tests)

- gradeSlateService writes grades:{sport} cache (closes content pipeline →
  dataLevel full); fire-and-forget from oddsService.recordDownstream, gated
  by shouldGradeSlate (off in test, GRADE_SLATE_ON_FETCH override)
- NFL/NHL wired: oddsService SPORT_KEYS/SPORT_MARKETS (correct the-odds-api
  keys americanfootball_nfl/icehockey_nhl), proplineAdapter MARKETS, NHL
  MARKET_MAP keys to avoid silent-zero
- rate limiting mounted on 8 public cached routers (odds/parlay 30/min,
  rest 60/min)
- jsonlLogger writes to temp under test (no more dirtied tracked artifact);
  5MB pipeline test given 20s timeout

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Kev
2026-06-15 18:21:32 -04:00
parent 2ba3958c7a
commit f0c8b4f29b
20 changed files with 667 additions and 9 deletions
+10 -1
View File
@@ -13,9 +13,18 @@
*/
const fs = require('fs');
const os = require('os');
const path = require('path');
const ROOT = path.join(process.cwd(), 'data', 'training');
// Under test, write to a throwaway temp dir instead of the tracked
// data/training corpus — otherwise every `npm test` appends resolution rows
// to data/training/resolutions-YYYY-MM.jsonl and dirties the git tree
// (Session 31 audit finding; fixed Session 32). `TRAINING_DATA_DIR` lets
// operators override the location explicitly.
const ROOT = process.env.TRAINING_DATA_DIR
|| (process.env.NODE_ENV === 'test'
? path.join(os.tmpdir(), 'vyndr-training-test')
: path.join(process.cwd(), 'data', 'training'));
let initialized = false;
function ensureDir() {