feat(calibration): render backtest score/comparison reports as Markdown - #8120
Closed
kai392 wants to merge 1 commit into
Closed
feat(calibration): render backtest score/comparison reports as Markdown#8120kai392 wants to merge 1 commit into
kai392 wants to merge 1 commit into
Conversation
Contributor
|
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 #8120 +/- ##
===========================================
+ Coverage 64.35% 92.01% +27.65%
===========================================
Files 759 760 +1
Lines 77327 77335 +8
Branches 23376 23380 +4
===========================================
+ Hits 49766 71162 +21396
+ Misses 23344 5061 -18283
+ Partials 4217 1112 -3105
Flags with carried forward coverage won't be shown. Click here to find out more.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
packages/loopover-engine/src/calibration/backtest-report.tswithrenderBacktestScoreReportandrenderBacktestComparison: the deterministic, pure Markdown "receipt" renderers forBacktestScoreReport(calibration: pure confusion-matrix scorer for a candidate rule classifier against the backtest corpus #8085) andBacktestComparison(calibration: Pareto-floor comparator between two BacktestScoreReports #8086) — byte-identical output for byte-identical input, no IO, no wall-clock reads.renderBacktestScoreReportrenders the rule ID,caseCount, all four confusion-matrix counts, andprecision/recallas a Markdown table, withnullratios rendered as the literalN/A— never0, the wordnull, or an empty cell (the null-is-not-zero discipline from calibration: pure confusion-matrix scorer for a candidate rule classifier against the backtest corpus #8085), pinned by an exact-string snapshot test.renderBacktestComparisonrenders clearly separated Regressed/Improved sections (an empty side renders(none), so an empty regression list can never read as if something regressed) and a closing verdict line; the regressed line is the pinned literalVerdict: REGRESSED — do not merge, so the follow-up CI-wiring consumer can detect the regressed case by string match without re-implementing the comparison.packages/loopover-engine/src/index.tson its own line immediately after thebacktest-compare.jsline, per the issue's deliverable.Closes #8088
Test plan
packages/loopover-engine/test/backtest-report.test.ts(node:test, per the issue's deliverable): exact-string snapshot of a non-null report;N/A(never0/null/empty) for null ratios; the literalREGRESSEDwording on a regressed comparison; improved comparison claims no regressed axis; unchanged comparison lists no axis on either side; byte-identical determinism for both rendererstest/unit/backtest-report-engine.test.ts(vitest, importing the engine source): same cases — this is what exercises the.tsforcodecov/patch, since@loopover/engineimports resolve todistnpm run test --workspace @loopover/enginegreen;npm run typecheckgreen