feat(scripts): backfill the risk-control calibration set from decision history - #8944
Merged
Conversation
…n history ai_review_cache has retained per-finding confidence since 2026-06-28 and review_audit holds every acted gate decision, so the risk-control label floor can be cleared from existing evidence instead of weeks of live accrual. Pure core stages acted closes (close_arm; closed-then-merged is the definitive incorrect class) and AI-judgment-only holds (holdout_close, the below-floor strata a lower certified threshold needs); the wrapper reuses buildDecisionRecord/canonicalJson so backfilled records are byte-compatible, with configDigest 'backfill:unavailable' as the honest provenance sentinel and no ledger writes (the chain attests live finalizations only).
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 | d8bf3f8 | Commit Preview URL Branch Preview URL |
Jul 26 2026, 02:13 PM |
When no env alpha pins an arm, the close arm's error budget now follows a deterministic schedule of usable-label count: 0.05 under 350 pairs, 0.025 from 350, 0.015 from 700. Sample size is information, not the test statistic, so walking the schedule as labels accrue is not outcome snooping and each daily recalibration still runs exactly one level-delta test; the published guarantee self-tightens 95% -> 97.5% -> 98.5% with no human step. Also documents the backfill population finding: staged holdout_close rows are analysis-only — surviving holds are not valid close counterfactuals; only acted closes enter calibration.
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
This was referenced Jul 26, 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.
Advances #8828.
The risk-control guarantee (#8835) needs adjudicated (confidence, correct?) pairs and the naive path is weeks of live label accrual. But
ai_review_cachehas retained per-finding confidence since 2026-06-28 andreview_auditholds every acted gate decision — this backfill stages calibration candidates from that existing evidence, and adds the pre-registered α(n) tightening schedule so the published guarantee strengthens itself as labels accrue.scripts/backfill-decision-labels-core.ts): acted closes stage asclose_arm(a close whose realized outcome ismerged= reopened-and-merged = the definitive incorrect class). Holds whose only blockers were AI-judgment findings stage asholdout_closefor ANALYSIS only — adjudicating the backfill proved surviving holds are not valid close counterfactuals (a hold that survived means a non-confidence criterion blocked the close), so apply inserts close_arm rows only; the live ε-holdout (calibration: randomized ε-holdout on would-close PRs with propensity logging #8831) samples the would-close population and stays the valid source going forward.{records, labels, worklist}. Records reusebuildDecisionRecord/canonicalJson(byte-identical digests);configDigest: "backfill:unavailable"is the honest provenance sentinel; no decision-ledger writes (the chain attests live finalizations only). Labels stagestatus='pending'— invisible toloadCalibrationPairsuntil adjudication flips them.src/review/risk-control-wire.ts): when no env α pins an arm, the close arm's budget follows a deterministic function of usable-label count — 0.05 under 350 pairs, 0.025 from 350, 0.015 from 700. Sample size is information, not the test statistic, so the walk is not outcome-snooping and each daily recalibration still runs exactly one level-δ test; the homepage claim self-tightens 95% → 97.5% → 98.5% with zero human steps. (The α-grid alternative needs a Bonferroni δ-split that raises every floor ~35% and certifies nothing at today's volume.)Ran against production history: 653 candidates → 331 staged (232 close_arm, 99 analysis-only holdout_close), 280 mixed-blocker holds excluded, 42 duplicates deduped. Adjudicated close_arm set: 226 usable pairs, 9 incorrect (96.0% acted-close precision, coherent with the published 95.7% baseline); at today's volume the schedule's first tier certifies λ̂=0.62 at 57% coverage.