Skip to content

feat(selftune): fold the REGRESSED-verdict track record into the self-tune tick's rec list - #8788

Merged
JSONbored merged 2 commits into
mainfrom
feat/track-record-selftune-rec
Jul 26, 2026
Merged

feat(selftune): fold the REGRESSED-verdict track record into the self-tune tick's rec list#8788
JSONbored merged 2 commits into
mainfrom
feat/track-record-selftune-rec

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

Closes an OPEN feedback loop from adversarial-audit epic #8757: scripts/backtest-track-record.ts computes the REGRESSED-verdict rollup that #8105's Phase-2 merge-gating decision needs, but nothing scheduled it — a human had to remember to run the CLI against prod. The self-tune tick already appends report-only rec lines (buildKnobReliabilityRecs, #8227), so the rollup now rides the same channel.

Changes

  • src/review/selftune-wire.tsloadBacktestTrackRecord(env): reads the same three persisted event types the CLI queries (THRESHOLD_BACKTEST_EVENT_TYPE imported for real from its Worker-side writer; the logic + counterfactual literals hand-mirrored with kept-in-sync comments, matching the CLI's own posture toward Worker modules in the other direction), extracts metadata.comparison, aggregates via the shared engine computeRegressedVerdictTrackRecord. Fail-open per event type. Wired into runSelfTune's once-per-pass rec block.
  • src/review/loosening-recs.tsbuildTrackRecordRecs: one payload-less rec line; zero runs → no line (steady-state silence), regressed > 0 → info, all-clean → good. The apply path can never promote it (no overridePayload), same as every builder in that file.
  • CLI unchanged — it stays the ad-hoc deep-dive view.

Test plan

  • npm run typecheck — clean
  • 44 tests across selftune-wiring / loosening-recs / selftune-readback, including: cross-event-type aggregation with a comparison-less row skipped, empty steady state, poisoned-read fail-open, and all four builder rendering arms
  • Changed hunks: 0 uncovered statements, 0 uncovered branches

Closes #8763

…-tune tick's rec list (#8763)

scripts/backtest-track-record.ts computed the rollup #8105's Phase-2 gating
decision needs, but had zero non-manual callers — a human had to remember to
run it against prod. The self-tune tick already appends report-only rec lines
(the #8227 reliability-curve precedent), so the same rollup now rides along:

- loadBacktestTrackRecord (selftune-wire.ts) reads the same three persisted
  event types the CLI queries (threshold run imported for real; the two
  scripts-side literals hand-mirrored with sync comments, matching the CLI's
  own posture in the other direction), extracts metadata.comparison, and
  aggregates via the shared engine computeRegressedVerdictTrackRecord.
  Fail-open per event type — a poisoned read degrades to fewer comparisons,
  never breaks the tick.
- buildTrackRecordRecs (loosening-recs.ts) renders it as one payload-less rec:
  zero runs → no line (no steady-state noise); any regressed run → info
  severity; all-clean → good. The CLI stays the deep-dive view.
@JSONbored JSONbored self-assigned this Jul 26, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

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

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 26, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
loopover-ui 3bc5ada Commit Preview URL

Branch Preview URL
Jul 26 2026, 05:54 AM

@JSONbored
JSONbored merged commit 39ea0a5 into main Jul 26, 2026
5 checks passed
@JSONbored
JSONbored deleted the feat/track-record-selftune-rec branch July 26, 2026 06:04
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 26, 2026
@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.26%. Comparing base (f1be340) to head (3bc5ada).
⚠️ Report is 4 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8788      +/-   ##
==========================================
- Coverage   93.81%   92.26%   -1.55%     
==========================================
  Files         797      797              
  Lines       79540    79556      +16     
  Branches    24108    24112       +4     
==========================================
- Hits        74618    73401    -1217     
- Misses       3556     5090    +1534     
+ Partials     1366     1065     -301     
Flag Coverage Δ
backend 92.93% <100.00%> (-2.16%) ⬇️

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

Files with missing lines Coverage Δ
src/review/loosening-recs.ts 100.00% <100.00%> (ø)
src/review/selftune-wire.ts 97.72% <100.00%> (+0.66%) ⬆️

... and 3 files with indirect coverage changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

selftune: fold the REGRESSED-verdict track-record rollup into the self-tune cron tick

1 participant