Session 47: Name normalization + grade intel + ticker polish (2149 tests)

- Name normalization completed: NICKNAMES table (Matt↔Matthew, Mike↔Michael...)
  resolved in nameKey, parenthetical team-tag strip "(STL)", verified accent-fold
  (Iván/Ivan, José/Jose). Slate strip now DISPLAYS the normalized de-dotted name
  ("AJ Ewing" not "A.J. Ewing") via buildPlayerStripsFromProps.
- Complete MLB VYNDR INTELLIGENCE: mlbGameLogFeatures derives rest_days (days off
  between latest games; 0=B2B) + ab_per_game (usage). buildIntelFields renders
  usage as "X AB/G", rest as B2B/Xd, matchup from bvp_advantage fallback.
- Ticker SCAN dedup: pushTickerItems keeps one SCAN per sport (sport field or
  text-prefix parse for legacy); MOVE/GRADE preserved; cap 50.
- BOMBER threshold prorated for mid-season (hr>=15 strong / >=10 mod) so June
  sluggers classify BOMBER not FLEX/DRIVER.

Backend 2122 -> 2149 tests (+27), 179 suites. Web build clean (exit 0).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Kev
2026-06-19 01:45:36 -04:00
parent c8fc9f577e
commit 78db55d499
13 changed files with 346 additions and 32 deletions
+17
View File
@@ -118,6 +118,23 @@ function mlbGameLogFeatures(res, statType) {
} else if (out.l10_avg != null) {
out.l20_avg = out.l10_avg; // baseline so form has a reference
}
// Session 47 — complete VYNDR INTELLIGENCE for MLB:
// - rest_days: days between the two most recent games (0 = back-to-back).
// - ab_per_game: at-bats per game, the MLB "usage" equivalent.
const dated = logs.filter((g) => g && g.date);
if (dated.length >= 2) {
const last = new Date(dated[dated.length - 1].date).getTime();
const prev = new Date(dated[dated.length - 2].date).getTime();
const gap = Math.round((last - prev) / 86_400_000);
// rest_days = days OFF (0 = played the day before = B2B), matching the
// NBA convention buildIntelFields uses. Consecutive calendar days → 0.
if (Number.isFinite(gap) && gap >= 1 && gap <= 14) out.rest_days = gap - 1;
}
const ab = parseFloat(res.season && res.season.atBats);
if (Number.isFinite(ab) && Number.isFinite(games) && games > 0) {
out.ab_per_game = ab / games;
}
return out;
}