feat(calibration): bounded loosenable-knob registry generalizing the backtest-gated loosening - #8190
Merged
Merged
Conversation
…backtest-gated loosening (#8159) The #8121 narrow start hardcoded one loosenable value. LOOSENABLE_KNOBS now declares each knob the way KNOWN_THRESHOLDS/KNOWN_LOGIC_RULES declare their surfaces -- rule id, nearest-first candidate steps, hard minimum, sample floors, per-knob fixed split seed -- evaluated by ONE generic evaluateKnobLoosening carrying the narrow start's invariants verbatim. evaluateSatisfactionFloorLoosening now delegates to it; the registry entry is test-pinned to the legacy constants and seed, so behavior and held-out membership are byte-stable across the refactor (all pre-existing evaluator tests pass unchanged). Second knob: ai_review_close_confidence (DEFAULT_AI_REVIEW_CLOSE_CONFIDENCE, corpus ai_consensus_defect -- real today via the #8157 backfill) enters REPORT-ONLY: loadReportOnlyKnobProposals evaluates it fail-safe per knob, and buildReportOnlyKnobRecs surfaces the full split evidence in the selftune advisor pass (once per pass, payload-less -- the apply path provably cannot touch it), with the action line stating that applying requires shipping its override-consumption plumbing as its own reviewed change. Bounds are tight by design: candidates 0.9/0.85, hard floor 0.85, higher sample minimums. Registry structural invariants (candidates strictly below shipped, at/above the hard minimum, descending; unique ids and seeds) are themselves pinned by tests. 100% line+branch coverage on every touched module. Advances #8159.
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 #8190 +/- ##
==========================================
- Coverage 92.07% 89.60% -2.47%
==========================================
Files 770 102 -668
Lines 77925 22768 -55157
Branches 23541 3903 -19638
==========================================
- Hits 71750 20402 -51348
+ Misses 5062 2187 -2875
+ Partials 1113 179 -934
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.
What
Generalizes #8121's satisfaction-floor loosening into a declarative LOOSENABLE_KNOBS registry (#8159) and registers a second, REPORT-ONLY knob:
ai_review_close_confidence(candidates 0.9 → 0.85, hard minimum 0.85, backtested against the realai_consensus_defectcorpus).How
src/services/loosening-knobs.ts— the registry +evaluateKnobLoosening, the generic backtest-gated evaluator (visible improvement + held-out non-regression + bounded candidate ladder). Each knob declares itsapplyMode:live(satisfaction floor — unchanged behavior, now delegating to the generic evaluator, pinned byte-stable by the existing tests) orreport_only(the new knob: proposals surface with full evidence, nothing can apply them until consumption plumbing ships as its own reviewed change — calibration: wire ai_review_close_confidence override consumption and flip the knob to live #8176).loadReportOnlyKnobProposalsin the loosening run module +buildReportOnlyKnobRecsin the advisor: report-only proposals appear in the tuning advisor with the same evidence shape as calibration: surface backtest-cleared loosening proposals in the tuning advisor with evidence payloads #8160's, and an explicit refused-apply line.Validation
Full
npm run test:cigreen locally; 100% branch coverage on all touchedsrcranges; satisfaction-floor behavior pinned unchanged by the pre-existing suites.Closes #8159