diff --git a/src/routes/internal.js b/src/routes/internal.js index 6ad2f73..d960e91 100644 --- a/src/routes/internal.js +++ b/src/routes/internal.js @@ -177,8 +177,12 @@ router.get('/snapshot/status', async (req, res) => { router.post('/snapshot/:sport', async (req, res) => { const snapshot = require('../services/snapshotService'); try { - const summary = await snapshot.runSnapshot(req.params.sport); - return res.json({ ok: true, summary }); + // ?limit= is a BISECT HOOK, not a production knob: it bounds the graded + // slate for one run so a cap regression can be isolated by measurement + // rather than guessed at. Omitted => gradeSlateService's real DEFAULT_LIMIT. + const limit = Number(req.query.limit) > 0 ? Number(req.query.limit) : undefined; + const summary = await snapshot.runSnapshot(req.params.sport, limit ? { limit } : {}); + return res.json({ ok: true, ...(limit ? { limit_override: limit } : {}), summary }); } catch (err) { const message = err && err.message ? err.message : String(err); console.error('[internal/snapshot] failed:', message); diff --git a/src/services/snapshotService.js b/src/services/snapshotService.js index a6cb1c0..0832ea2 100644 --- a/src/services/snapshotService.js +++ b/src/services/snapshotService.js @@ -400,6 +400,11 @@ async function runSnapshot(sport, opts = {}) { // letting it write (we re-write an ENRICHED version below). let envelope = null; await deps.gradeAndCacheSlate(sp, props, { + // Bisect hook (2026-08-01): lets the internal trigger run a bounded slate + // without a prod env change, so a cap regression can be isolated by + // measurement instead of guessed at. Omitted => gradeSlateService's own + // DEFAULT_LIMIT (the real production value). + ...(Number(opts.limit) > 0 ? { limit: Number(opts.limit) } : {}), source: (odds && odds.provider) || 'odds-api', now: deps.now, cacheSet: async (_k, v) => { envelope = v; },