feat(engine): AMS calibration corpus — pair predicted gate verdicts with realized PR outcomes#8200
Merged
Merged
Conversation
…ith realized PR outcomes The #8172 epic's foundation (#8183): buildAmsPredictionCorpus turns the miner's own prediction-ledger rows + pr_outcome events into the exact labeled BacktestCase shape the shared calibration primitives consume. Class mapping: agreement between a directional prediction (merge/close) and the realized outcome labels confirmed; contradiction labels reversed — the miner's reversal analog. Hold-shaped/unrecognized predictions, pending PRs, non-terminal outcomes, and malformed rows all skip conservatively. Re-predictions of one head collapse to the latest; distinct heads each stand as their own correctly-labeled case. The readiness score (0-100) normalizes into the [0,1] confidence field the threshold classifier replays against, and engineVersion rides case metadata with a filterCasesByEngineVersion helper for comparable-build slicing. Everything downstream (score/compare/split/render) is reused untouched — adapters over the miner ledger, not new math. Miner side: two thin projections in calibration-cli.ts and a corpus stats line (aggregates only, corpus content never prints) in both text and --json output — the local evidence base #8184's backtest will replay against. Fully local: a node's corpus never leaves the node. Closes #8183
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
loopover-ui | 23766f0 | Commit Preview URL Branch Preview URL |
Jul 23 2026, 11:19 AM |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8200 +/- ##
=======================================
Coverage 92.07% 92.08%
=======================================
Files 771 772 +1
Lines 77942 78002 +60
Branches 23545 23564 +19
=======================================
+ Hits 71767 71827 +60
Misses 5062 5062
Partials 1113 1113
Flags with carried forward coverage won't be shown. Click here to find out more.
|
This was referenced Jul 23, 2026
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.
What
The #8172 epic's foundation (#8183):
buildAmsPredictionCorpusturns the miner's own prediction-ledger rows +pr_outcomeevents into the exact labeledBacktestCaseshape the shared calibration primitives consume — adapters over the miner ledger, not new math.How
merge/close) whose realized outcome agrees labelsconfirmed; contradiction labelsreversed. Hold-shaped/unrecognized predictions, pending PRs, non-terminal outcomes, and malformed rows all skip conservatively.confidencefield the threshold classifier replays against;engineVersionrides case metadata withfilterCasesByEngineVersionfor comparable-build slicing.calibration-cli.tsand a corpus-stats line (aggregates only — corpus content never prints) in both text and--jsonoutput.Validation
Full
npm run test:ciran with zero test failures (1119 files); the run's only red was a since-fixed local-artifact prettier gap (#8199 —coverage/reports in a reused worktree; CI checkouts are clean). 100% line+branch on the engine module and the touched CLI ranges via the root mirror suite (engine blind-spot rule) + pack tests.Closes #8183