'use strict'; /** * Which stats serve a calibrated number, and on what basis. * * The claim that survived on this sample is the bias DIRECTION, tested model-free * and map-free. What did not survive is any certification of a specific map's * stability. These lock that distinction into the serving path. */ const snapshotService = require('../../src/services/snapshotService'); const lp = require('../../src/services/model/lowParamCalibrator'); describe('the deploy set rides a low-parameter correction, not isotonic', () => { it('serves NOTHING while the maps are stale against the repaired champion', () => { // hits and total_bases were deployed at 74cf1ce on maps fitted to the OLD // forecast, whose base rate was a ten-game frequency. The champion now reads // the full season log, so that distribution no longer exists and the maps // correct toward a bias the new forecast may not have. expect(snapshotService.CALIBRATION_DEPLOYED).toEqual([]); }); it('WITHDRAWS rbi — the low-parameter fit does not beat raw', () => { // rbi was deployed at ced4042 on isotonic. Its CI vs raw is [-0.0007, 0], // which touches zero, so it serves raw again. expect(snapshotService.CALIBRATION_DEPLOYED).not.toContain('rbi'); }); it('does NOT serve runs — its fitted slope would invert the forecast', () => { expect(snapshotService.CALIBRATION_DEPLOYED).not.toContain('runs'); }); it('carries no basis claim while nothing is deployed', () => { expect(snapshotService.CALIBRATION_BASIS).toEqual({}); }); it('the served correction cannot encode a single odd day', () => { // Two parameters over the whole curve is the entire reason for the swap. expect(typeof lp.fitPlatt).toBe('function'); expect(lp.MIN_SLOPE).toBeGreaterThan(0); }); it('is frozen, so a stat cannot be added at runtime', () => { expect(Object.isFrozen(snapshotService.CALIBRATION_DEPLOYED)).toBe(true); expect(() => { snapshotService.CALIBRATION_DEPLOYED.push('hits'); }).toThrow(); }); });