'use strict'; /** * Which stats serve a calibrated number, and on what basis. * * The thing these lock is that "could not test" never reads as "passed". LODO * has 1.4%-9.3% power at this date count, so no deployed stat claims stability * from it — each rides a thin date-clustered interval and auto-demotion alone. */ const snapshotService = require('../../src/services/snapshotService'); const { LODO_TEST, LODO_POWER_FLOOR } = require('../../src/services/model/calibrationRegistry'); describe('the deploy set rests on the CI, not on a passed LODO', () => { it('serves the three stats with a point-in-time interval excluding zero', () => { expect(snapshotService.CALIBRATION_DEPLOYED).toEqual(['hits', 'total_bases', 'rbi']); }); it('does NOT serve runs — no fittable map, so no CI to stand on', () => { expect(snapshotService.CALIBRATION_DEPLOYED).not.toContain('runs'); }); it('labels every deployed stat as LODO-untestable rather than LODO-stable', () => { for (const stat of snapshotService.CALIBRATION_DEPLOYED) { expect(snapshotService.CALIBRATION_BASIS[stat]).toBe('ci_only_lodo_untestable'); } }); it('no stat may claim LODO stability, because the test cannot fail', () => { for (const t of Object.values(LODO_TEST)) expect(t.power).toBeLessThan(LODO_POWER_FLOOR); }); it('rbi and runs were FALSE FAILS under the old zero-reversal rule', () => { // Re-read under the binomial cutoff: 1 and 2 reversals, cutoff 2 for both. expect(LODO_TEST.rbi.cutoff).toBe(2); expect(LODO_TEST.runs.cutoff).toBe(2); // rbi returns to the deploy set on CI support; runs still has none. expect(snapshotService.CALIBRATION_DEPLOYED).toContain('rbi'); }); it('is frozen, so a stat cannot be added at runtime', () => { expect(Object.isFrozen(snapshotService.CALIBRATION_DEPLOYED)).toBe(true); expect(() => { snapshotService.CALIBRATION_DEPLOYED.push('runs'); }).toThrow(); }); });