feat(calibration): deterministic seeded held-out/visible split of the backtest corpus - #8097
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8097 +/- ##
==========================================
- Coverage 92.01% 92.00% -0.01%
==========================================
Files 755 756 +1
Lines 77201 77211 +10
Branches 23337 23338 +1
==========================================
+ Hits 71034 71040 +6
Misses 5061 5061
- Partials 1106 1110 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-22 22:36:48 UTC
Review summary Nits — 4 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Summary
packages/loopover-engine/src/calibration/backtest-split.tswithsplitBacktestCorpus(cases, heldOutFraction, seed): a deterministic, content-hashed partition of aBacktestCase[]corpus (calibration: pure BacktestCase corpus builder from RuleFiredEvent/HumanOverrideEvent pairs #8083) into visible and held-out slices, so a candidate rule fix can be iterated against the visible slice but scored against both.sha256(${seed}:${ruleId}:${targetKey})(first 8 hex chars over0xffffffff, held out when strictly below the fraction) — the samecreateHashapproach asstableProposalIdinpackages/loopover-engine/src/miner/deny-hook-synthesis.ts, so a case's bucket depends only on(seed, ruleId, targetKey), never on its array position or corpus size: a corpus that grows over time never reshuffles previously held-out cases.heldOutFractionthrows a plainErrornaming the invalid value (the negated compound guard also fails closed onNaN).Math.random(), no wall-clock reads. Deliberately no barrel export (per the issue's deliverables, which specify only the new file + test).Closes #8087
Test plan
packages/loopover-engine/test/backtest-split.test.ts(node:test, per the issue's deliverable): fraction 0 → all visible; fraction 1 → all held out; byte-identical determinism on repeat calls; per-bucket input-order preservation with both buckets populated (12-case fixture); a different seed produces a different split; both out-of-range directions throw naming the valuetest/unit/backtest-split-engine.test.ts(vitest, importing the engine source): same cases — this is what exercises the.tsforcodecov/patch, since@loopover/engineimports resolve todist(the trap that has already failed prior PRs in this issue family)npm run test --workspace @loopover/enginegreen;npm run typecheckgreen