feat(engine): aggregate REGRESSED-verdict track-record statistics from persisted backtest CI results - #8143
Conversation
…m persisted backtest CI results (JSONbored#8140)
|
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 #8143 +/- ##
=======================================
Coverage 92.03% 92.03%
=======================================
Files 763 764 +1
Lines 77506 77520 +14
Branches 23425 23430 +5
=======================================
+ Hits 71332 71346 +14
Misses 5062 5062
Partials 1112 1112
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-23 03:33:17 UTC
Review summary Nits — 5 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
Closes #8140.
Adds the aggregation #8105's Phase-2 merge-gating decision needs:
computeRegressedVerdictTrackRecord(packages/loopover-engine/src/calibration/backtest-track-record.ts) — a pure function turning an array of historicalBacktestComparisonresults (#8086) into the decision summary (total runs, REGRESSED count, aregressedRatethat staysnullfor zero runs — the module's established never-coerce-unknown-to-0 discipline — and a per-ruleIdMapbreakdown of total/regressed/improved/unchanged), plus the thin CLI (scripts/backtest-track-record.ts) that reads the rows the advisory backtest CI check persists (#8138,calibration.threshold_backtest_runinaudit_events,metadata.comparison) and prints the summary.THRESHOLD_BACKTEST_EVENT_TYPEinsrc/services/threshold-backtest-run.tswith a keep-in-sync comment — that module is Worker-bound (D1 repository import graph) and deliberately not imported into a standalone script, the same posture the mergedbacktest-corpus-export.tstakes towardsignal-tracking-wire's private helpers.export-d1-data.ts'sparseArgs/d1Queryshell-out exactly (read-only, fail-loud) and contains no logic beyond the read, the JSON-parse (fail-open per-row, matchinglistAuditEventsByType's own posture), the pure-function call, and printing — per the epic's established pure-core/thin-IO exemption, no dedicated wrapper test.backtest-report.jsline, continuing the module's export order.Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #123) — a linked open issue is required for every contributor PR.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally;codecov/patchrequires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
npm run build --workspace @loopover/engine(green), the enginenode --teston the mandated new test file (4/4 — zero runs → null rate, all-clean, some-regressed, multi-rule breakdown, exactly the issue's enumerated cases) and the root-side vitest coverage twin (4/4, direct engine-src import — the pattern this module's merged calibration: pure BacktestCase corpus builder from RuleFiredEvent/HumanOverrideEvent pairs #8083/calibration: Pareto-floor comparator between two BacktestScoreReports #8086/calibration: render a backtest score/comparison report as Markdown #8088 twins established so the new file's coverage is visible tocodecov/patch), plus the CLI's usage-guard smoke. Real CI re-runs typecheck and the sharded suite here.Safety
UI Evidencesection below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.The three unchecked Safety boxes are N/A: no auth/session/UI change — a pure engine module + read-only CLI.
UI Evidence
N/A — no UI change.
Notes
tsx scripts/backtest-track-record.ts --db <db> --remotegives the maintainer the one-command summary Decide + implement whether a REGRESSED backtest verdict should ever gate a merge (Phase 2) #8105 asks for, instead of reading individual PR comments.