Skip to content

feat(calibration): consume the ai_review_close_confidence override and flip the knob to live#8197

Merged
JSONbored merged 1 commit into
mainfrom
feat/close-confidence-knob-live
Jul 23, 2026
Merged

feat(calibration): consume the ai_review_close_confidence override and flip the knob to live#8197
JSONbored merged 1 commit into
mainfrom
feat/close-confidence-knob-live

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

What

The #8176 gate-authority change: the second registry knob gets its consumption plumbing and flips report_onlylive, mirroring the satisfaction floor's discipline exactly.

How

  • One bounds-validated resolution point: getKnobOverride reads the knob's system_flags row only when its own wrangler var (AI_REVIEW_CLOSE_CONFIDENCE_AUTOTUNE_ENABLED, false by default — the deploy is behavior-identical until an operator opts in) is ON, and refuses anything not strictly below the shipped 0.93 or under the 0.85 hard minimum. gateCheckPolicy threads it as the LAST-resort default at all four call sites — an explicit per-repo gate.aiReview.closeConfidence setting always wins; the advisory twins are untouched.
  • Generic machinery, not duplication (knob-loosening-run.ts): the satisfaction run/status/tick generalized over the registry entry. The satisfaction floor keeps its legacy module and event shape (its currentFloor/proposedFloor metadata is a load-bearing operator contract); the shared cron tick now runs every OTHER live knob, double-gated per knob, one-shot alert per applied step. Report-only refusal is enforced in the write path itself, whatever the evaluator claims.
  • Registry entries carry their apply plumbing (override flag key, event type, autotune var), pinned to the legacy constants by invariant tests.
  • Operator surface: GET /v1/internal/calibration/knobs — the calibration: operator visibility for applied loosenings — live floor + history on the internal calibration surface #8161 status generalized: per-live-knob flag state, shipped/live/override values, applied history with both split verdicts, one projector reading both proposal spellings.

Validation

Full npm run test:ci green locally (1115 test files passed; the only 3 failures in that run were main's pre-#8192 docs breakage, since merged and re-verified green on the rebase). 100% line+branch coverage on every touched src range, including the defense-in-depth refusals, forced write rejections, and the non-Error alert-formatter arm.

Closes #8176

…d flip the knob to live

The #8176 gate-authority change, mirroring the satisfaction floor's
consumption discipline exactly:

- One bounds-validated resolution point: getKnobOverride reads the knob's
  system_flags row only when its own wrangler var
  (AI_REVIEW_CLOSE_CONFIDENCE_AUTOTUNE_ENABLED, false by default) is ON, and
  refuses anything not strictly below the shipped 0.93 or under the 0.85
  hard minimum. gateCheckPolicy threads it as the LAST-resort default — an
  explicit per-repo gate.aiReview.closeConfidence setting always wins.
- Generic apply machinery (knob-loosening-run.ts): the satisfaction
  run/status/tick generalized over the registry entry rather than
  duplicated. The satisfaction floor keeps its legacy module and event
  shape; the shared cron tick now runs every OTHER live knob, double-gated
  per knob. Report-only refusal stays enforced in the write path itself.
- Registry entries carry their apply plumbing (override flag key, event
  type, autotune var), pinned against the legacy constants by invariant
  tests; the close-confidence knob flips to applyMode live.
- Operator surface: GET /v1/internal/calibration/knobs renders every live
  knob's flag state, shipped/live/override values, and applied history
  through one projector that reads both proposal spellings.

Closes #8176
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@JSONbored JSONbored self-assigned this Jul 23, 2026
@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.07%. Comparing base (9d021ad) to head (d2a733c).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8197   +/-   ##
=======================================
  Coverage   92.07%   92.07%           
=======================================
  Files         771      772    +1     
  Lines       77942    78008   +66     
  Branches    23545    23566   +21     
=======================================
+ Hits        71767    71828   +61     
  Misses       5062     5062           
- Partials     1113     1118    +5     
Flag Coverage Δ
shard-1 56.69% <93.05%> (-1.80%) ⬇️
shard-2 56.06% <23.61%> (+6.29%) ⬆️
shard-3 49.85% <19.44%> (-4.99%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/api/routes.ts 95.29% <100.00%> (+<0.01%) ⬆️
src/queue/gate-checks.ts 100.00% <100.00%> (ø)
src/queue/job-dispatch.ts 99.31% <100.00%> (+<0.01%) ⬆️
src/queue/processors.ts 95.73% <100.00%> (+<0.01%) ⬆️
src/services/knob-loosening-run.ts 100.00% <100.00%> (ø)
src/services/loosening-knobs.ts 100.00% <ø> (ø)
src/services/satisfaction-floor-loosening-run.ts 98.70% <100.00%> (-1.30%) ⬇️

... and 1 file with indirect coverage changes

@JSONbored
JSONbored merged commit 3539934 into main Jul 23, 2026
14 checks passed
@JSONbored
JSONbored deleted the feat/close-confidence-knob-live branch July 23, 2026 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

calibration: wire ai_review_close_confidence override consumption and flip the knob to live

1 participant