feat(miner): add a calibration-report CLI command - #5460
Conversation
Join the miner's own predicted gate verdicts (prediction-ledger) with the realized PR outcomes it later observed (event-ledger pr_outcome events) into a per-project accuracy report, and surface it via 'gittensory-miner calibration [--json]'. buildCalibrationReport is a pure join over the existing record shapes; the CLI opens both local stores read-only, maps their rows, renders a text or JSON report, and closes. Does not touch the live scoring/calibration logic that feeds the gate. Closes JSONbored#4849
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5460 +/- ##
=======================================
Coverage 94.48% 94.49%
=======================================
Files 554 556 +2
Lines 44453 44520 +67
Branches 14662 14662
=======================================
+ Hits 42002 42069 +67
Misses 1776 1776
Partials 675 675
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-12 21:51:03 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands 🟩 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.
|
|
@JSONbored |
Summary
gittensory-miner calibration [--json], a read-only report that finally joins the two data sources the miner already tracks independently — its own predicted gate verdicts (the prediction ledger) and the realized PR outcomes it later observed (pr_outcomeevents in the event ledger) — into a per-project accuracy report. Before this, an operator had no way to see their own prediction accuracy even though all the raw data existed (Build the missing calibration-report join #4849).buildCalibrationReport(predictions, outcomes)is a pure join over the existing record shapes: it matches by(project, targetId)only when an outcome resolves to a clear merge/close, builds a per-project confusion matrix (wouldMerge/mergeConfirmed/mergeFalse, same for close, plushold), and computes merge/close precision (null below one sample).--json), and closes. OutcomerecordedAtcomes from the event's own timestamp so an outcome is never dropped for lacking aclosedAt, and only the latest outcome per(repo, PR)is counted.Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run typechecknpm run test:coverage— verified the changed files at 100% line + branch coverage locally via the v8 JSON report (calibration.js,calibration-cli.js); 16 dedicated unit tests acrosstest/unit/miner-calibration.test.tsandtest/unit/miner-calibration-cli.test.tscover the join's confusion-matrix buckets, precision-null boundaries, the latest-outcome-per-PR dedup, malformed/non-outcome event skipping, the text and--jsonrenderers, and the unknown-option path.npm run command-reference:check(green — the added help line does not desync the generated command reference).If any required check was skipped, explain why:
actionlint,test:workers,build:mcp/test:mcp-pack,ui:openapi:check,ui:lint/ui:typecheck/ui:build, andnpm auditwere not run because this change touches onlypackages/gittensory-miner/**(miner CLI/lib) andtest/**— it adds no workflow, worker, MCP, OpenAPI/API, UI, or dependency changes for those jobs to act on. The fullnpm run test:ciwill run all of them on CI.Safety
Auth/CORS/session, API/OpenAPI/MCP, and UI safety boxes are not applicable — this PR changes none of those surfaces.