Skip to content

feat(miner): wire Phase 7 calibration runner into calibration snapshot CLI#8503

Merged
loopover-orb[bot] merged 7 commits into
JSONbored:mainfrom
andriypolanski:feat/8317-wire-phase7-calibration-snapshot-cli-v2
Jul 24, 2026
Merged

feat(miner): wire Phase 7 calibration runner into calibration snapshot CLI#8503
loopover-orb[bot] merged 7 commits into
JSONbored:mainfrom
andriypolanski:feat/8317-wire-phase7-calibration-snapshot-cli-v2

Conversation

@andriypolanski

Copy link
Copy Markdown
Contributor

Summary

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves (e.g. Closes #123) — a linked open issue is required for every contributor PR.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npx vitest run test/unit/miner-calibration-cli.test.ts test/unit/miner-calibration-run.test.ts — 49 passed
  • npm run build --workspace @loopover/miner
  • npm run test:coverage
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • Miner package is not Codecov-gated (packages/loopover-miner/**). Untouched CI surfaces left to CI. Local miner build regenerated ignored lib/*.js for tests.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests.
  • API/OpenAPI/MCP behavior is updated and tested where needed.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks.
  • Visible UI changes include a UI Evidence section below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

UI Evidence

Not applicable — miner CLI calibration wiring only.

Notes

  • Example: loopover-miner calibration snapshot --json
  • Text form: one line per project + a persisted-count footer; empty report prints the no-decided-predictions message and writes nothing.

@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.67%. Comparing base (b554e15) to head (27a26f1).
⚠️ Report is 30 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8503      +/-   ##
==========================================
- Coverage   92.50%   89.67%   -2.84%     
==========================================
  Files         791       99     -692     
  Lines       79335    22943   -56392     
  Branches    23964     3966   -19998     
==========================================
- Hits        73388    20573   -52815     
+ Misses       4807     2187    -2620     
+ Partials     1140      183     -957     
Flag Coverage Δ
shard-1 37.97% <2.70%> (-19.80%) ⬇️
shard-2 72.99% <97.29%> (+25.68%) ⬆️
shard-3 ?

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

Files with missing lines Coverage Δ
packages/loopover-miner/lib/calibration-cli.ts 96.59% <100.00%> (+1.06%) ⬆️
packages/loopover-miner/lib/calibration-run.ts 100.00% <100.00%> (ø)

... and 692 files with indirect coverage changes

@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 24, 2026
@loopover-orb

loopover-orb Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-24 16:48:08 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR wires the Phase 7 calibration runner into a new `loopover-miner calibration snapshot` CLI subcommand, mapping each `buildCalibrationReport` project row through a new `prOutcomeFromCalibrationRow` helper and calling `runHistoricalReplayCalibrationCycle` once per project, with the AMS backtest track record forwarded when runs exist. The implementation is correct and closely mirrors the existing `runBacktestThreshold` open/run/persist/print/finally shape, `backtestTrackRecord` is threaded end-to-end through `calibration-run.ts`'s `RunCalibrationCycleInput`/`SnapshotMeta`/`snapshotPayloadFromResult` with proper null-vs-populated distinction, and the test suite (multi-project persistence, null/populated track record, no-signal short-circuit, error paths, nowMs forwarding, both text-render branches) genuinely exercises the new code rather than fabricating unreachable states. The console.log/debug-leftover and magic-number flags from the external brief are false positives — these are the CLI's actual output mechanism and a data-transform index, not debug artifacts.

Nits — 5 non-blocking
  • The external brief notes issue feat(miner): wire the Phase 7 calibration runner (calibration-run.ts) into calibration-cli.ts — it has zero real callers #8317 is only partially closed since `calibration-run.ts` still has no callers outside this new CLI path — worth confirming with the maintainer whether this fully satisfies the linked issue's scope.
  • calibration-cli.ts: `runCalibrationSnapshot` loops over `report.rows` calling `runHistoricalReplayCalibrationCycle` synchronously per project with no cap — fine at current scale but could grow slow with many projects; consider noting this as a known scaling limit.
  • The JSDoc comments on the new functions are quite long (multi-line blocks) which is more verbose than the terse commenting style elsewhere in some parts of the codebase, though it does match this file's existing convention of dense doc comments explaining WHY.
  • Confirm with the maintainer that this PR's scope (wiring the runner into the CLI) is what issue feat(miner): wire the Phase 7 calibration runner (calibration-run.ts) into calibration-cli.ts — it has zero real callers #8317 asked for, given the brief flags only partial coverage.
  • Consider whether `prOutcomeFromCalibrationRow` should live in `calibration-run.ts` next to `PrOutcomeCalibrationInput` rather than in the CLI file, since it's a pure mapping function reusable outside the CLI (mirrors the reuse rationale already given for `toPredictionRecords`/`toAmsPredictionRecords` in the same file).

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #8317
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: 222 registered-repo PR(s), 135 merged, 22 issue(s).
Contributor context ✅ Confirmed Gittensor contributor andriypolanski; Gittensor profile; 222 PR(s), 22 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The PR adds a `calibration snapshot [--json]` subcommand mirroring the required open/run/persist/print/finally shape, maps each CalibrationRow to PrOutcomeCalibrationInput and calls runHistoricalReplayCalibrationCycle once per project row (verified by a test asserting two separate ledger events for two projects), and threads backtestTrackRecord from computeAmsBacktestTrackRecord into the snapshot

Review context
  • Author: andriypolanski
  • 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: 222 PR(s), 22 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Triage stale or unlinked PRs.
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.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 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 LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver 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.

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

@loopover-orb
loopover-orb Bot merged commit 4bfb322 into JSONbored:main Jul 24, 2026
12 checks passed
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(miner): wire the Phase 7 calibration runner (calibration-run.ts) into calibration-cli.ts — it has zero real callers

2 participants