Skip to content

feat(miner-selfimprove): calibration accuracy-trend view over a snapshot series - #4639

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
davion-knight:feat-calibration-trend-v2
Jul 10, 2026
Merged

feat(miner-selfimprove): calibration accuracy-trend view over a snapshot series#4639
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
davion-knight:feat-calibration-trend-v2

Conversation

@davion-knight

Copy link
Copy Markdown
Contributor

Extends the single-snapshot calibration dashboard (#4261 / merged #4504, buildCalibrationDashboardView) into an accuracy trend over a series of accumulated snapshots — the trend-over-time view #4268 asks for, now that both prerequisites have landed (the browser-extension scaffold #4557 and the prediction-ledger #4263).

What this adds

A pure, read-only engine module packages/gittensory-engine/src/calibration-trend.ts (mirrors the sibling calibration-dashboard.ts):

  • buildCalibrationTrendView(snapshots){ direction, headline, sparkline, points, latestAccuracy, changeOverWindow, sampleCount, baselineAccuracy }
  • direction: improving / degrading / flat / insufficient
  • sparkline: a ▁▂▃▄▅▆▇█ line normalized across the window (no divide-by-zero on a flat window)
  • per-point deltaFromBaseline (whole percentage points) + aboveBaseline
  • calibrationSnapshotFromResult(result, observedAt) bridges a computed Phase7CalibrationLoopResult into a trend snapshot

Deliverables from the issue

  • ✅ Trend of combined accuracy vs the documented baseline (DOCUMENTED_CALIBRATION_BASELINE) over a rolling window, sourced from accumulated snapshots (a series input, not a single live call).
  • ✅ Read-only — surfaces only accuracies, baseline, and timestamps; no weights/thresholds/autonomy controls, no scores/rewards.
  • ✅ Graceful empty/sparse-history state — zero snapshots → "No calibration history yet"; a single point → explicit "insufficient history" rather than a broken chart; warming-up snapshots (null accuracy) are dropped from the line.

Validation

  • New suite test/unit/calibration-trend.test.ts covers the issue's required fixture series (empty, single-point, improving, degrading) plus flat, null-filtering, baseline-from-latest, and the result-bridge — every branch exercised.
  • codecov/patch → 100% branch coverage (22/22) on the new module — verified locally with v8. (Resubmit of feat(miner-selfimprove): calibration accuracy-trend view over a snapshot series #4630, which passed the gate with no blockers but missed patch coverage at 96.29% on one dead branch; that branch is removed.)
  • npm run engine-parity:drift-check → ok. Pure/deterministic, no I/O.

Closes #4268

…hot series

Extend the single-snapshot calibration dashboard (JSONbored#4261/JSONbored#4504) into an accuracy
*trend* over accumulated snapshots (JSONbored#4268): direction (improving/degrading/flat),
a normalized sparkline, per-point delta vs baseline, and latest/change-over-window.
Read-only and pure. A brand-new install has no snapshots and warming-up snapshots
carry a null accuracy, so empty/single-point history renders an explicit
insufficient-history state instead of a broken chart.

Closes JSONbored#4268
@davion-knight
davion-knight requested a review from JSONbored as a code owner July 10, 2026 08:50
@superagent-security

Copy link
Copy Markdown
Contributor

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

@loopover-orb loopover-orb Bot added gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier. labels Jul 10, 2026
@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.11%. Comparing base (66e4943) to head (f6e4b91).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4639   +/-   ##
=======================================
  Coverage   94.10%   94.11%           
=======================================
  Files         432      433    +1     
  Lines       38441    38468   +27     
  Branches    14014    14023    +9     
=======================================
+ Hits        36176    36203   +27     
  Misses       1604     1604           
  Partials      661      661           
Files with missing lines Coverage Δ
...ackages/gittensory-engine/src/calibration-trend.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.

@loopover-orb

loopover-orb Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Tip

🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩

✅ Gittensory review result - approve/merge recommended

Review updated: 2026-07-10 09:01:39 UTC

3 files · 1 AI reviewer · no blockers · readiness 100/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
The AI review returned non-blocking notes for this change but did not include a separate narrative summary. Review the nits below before deciding this PR.

Nits — 3 non-blocking
  • calibration-trend.ts's `sparkline()` uses `Math.min(...values)`/`Math.max(...values)` spread, which is fine at expected window sizes but would blow the call stack on a pathologically large series — worth a `reduce` if snapshot windows are ever unbounded.
  • The JSDoc on `buildCalibrationTrendView` could call out more explicitly (as the code already does correctly) that `baselineAccuracy` is sourced from the raw `snapshots` array, not the null-filtered `points` array, since that's a subtle distinction a future maintainer could get wrong when refactoring.
  • None beyond the nits above — the module is a clean, minimal mirror of `calibration-dashboard.ts`'s conventions and doesn't need structural changes.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #4268
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 106 registered-repo PR(s), 65 merged, 3 issue(s).
Contributor context ✅ Confirmed Gittensor contributor davion-knight; Gittensor profile; 106 PR(s), 3 issue(s).
Gate result ✅ Passing No configured blocker found.
Linked issue satisfaction

Partially addressed
The diff delivers a solid, well-tested pure trend-computation module (buildCalibrationTrendView/calibrationSnapshotFromResult) that satisfies the accuracy-trend, baseline-comparison, empty/sparse-history, and fixture-test deliverables, but the issue's core ask is a panel 'inside the miner's browser extension surface' and the diff contains no extension panel component or panel-registration wiring —

Review context
  • Author: davion-knight
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 106 PR(s), 3 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gittensory approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit 2e9bbb6 into JSONbored:main Jul 10, 2026
10 checks passed
@loopover-orb loopover-orb Bot added gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. and removed gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier. labels Jul 10, 2026
@JSONbored JSONbored added gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier. and removed gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. labels Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(miner-selfimprove): calibration dashboard extension panel — accuracy trend view

2 participants