Skip to content

feat(review): read promoted self-tune overrides into the live gate#1495

Merged
JSONbored merged 1 commit into
mainfrom
claude/selftune-readback
Jun 26, 2026
Merged

feat(review): read promoted self-tune overrides into the live gate#1495
JSONbored merged 1 commit into
mainfrom
claude/selftune-readback

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

The self-improvement loop (GITTENSORY_REVIEW_SELFTUNE, default OFF) already shadow-soaks and promotes tightening-only overrides into tunables_overrides — but nothing read them back, so a promoted override sat inert (the read-back was explicitly deferred in selftune-wire.ts pending a gittensory-native tightening tunable).

This wires the live read-back in resolveRepositorySettings:

  • applySelfTuneOverrideToSettings (pure) translates a promoted confidenceFloor [0,1] into gittensory's native readiness tunable by raising an existing qualityGateMinScore to round(confidenceFloor * 100) via max().
  • Tightening-only by construction: it never creates a readiness gate the operator didn't set (a null threshold stays null), and never lowers an existing one. Since the loop only ever populates the would-merge error side (so the advisor can only raise the floor), the recommendation reaches the live gate with zero risk of loosening it.
  • Flag-OFF (default): the override is never read and settings are byte-identical to before.

Closes the last open gap in the converged self-improvement loop.

Scope

  • src/settings/repository-settings.ts — the flag-gated read-back + pure translator
  • src/review/selftune-wire.ts — comment update (the deferred read-back is now wired)
  • test/unit/selftune-readback.test.ts — new

Validation

  • npm run test:coverage — 4618 passed; repository-settings.ts at 100% line+branch on the diff
  • npm run typecheck — clean
  • Tests cover: raise-existing, never-lower (no-op), never-create (null threshold), no-override/no-floor, and flag ON vs OFF end-to-end

Safety

  • No secrets / private terms. No public-surface change. Default-OFF flag; tightening-only invariant tested.

The self-improvement loop (GITTENSORY_REVIEW_SELFTUNE, default OFF) shadow-soaks and
promotes tightening-only overrides into tunables_overrides, but nothing read them back
— a promoted override sat inert. Wire the live read-back in resolveRepositorySettings:
applySelfTuneOverrideToSettings translates a promoted confidenceFloor into gittensory's
native readiness tunable by RAISING an existing qualityGateMinScore to round(floor*100)
via max(). By construction it can only tighten — it never creates a readiness gate the
operator didn't set, and never lowers one — so the always-tightening recommendation
reaches the live gate with no risk of loosening it. Flag-OFF the override is never read
and settings are byte-identical.
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jun 26, 2026
@JSONbored JSONbored self-assigned this Jun 26, 2026
@superagent-security

Copy link
Copy Markdown

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

@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.45%. Comparing base (d984a29) to head (7e31e5a).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1495   +/-   ##
=======================================
  Coverage   95.45%   95.45%           
=======================================
  Files         195      195           
  Lines       21111    21121   +10     
  Branches     7632     7637    +5     
=======================================
+ Hits        20151    20161   +10     
  Misses        383      383           
  Partials      577      577           
Files with missing lines Coverage Δ
src/review/selftune-wire.ts 92.30% <ø> (ø)
src/settings/repository-settings.ts 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored JSONbored merged commit b01f81b into main Jun 26, 2026
18 checks passed
@JSONbored JSONbored deleted the claude/selftune-readback branch June 26, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant