feat(miner): add a metrics command that renders prediction-calibration Prometheus text (#4838) - #5470
Conversation
…n Prometheus text (JSONbored#4838)
|
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 #5470 +/- ##
=======================================
Coverage 94.71% 94.71%
=======================================
Files 556 557 +1
Lines 44546 44562 +16
Branches 14664 14664
=======================================
+ Hits 42192 42208 +16
Misses 1619 1619
Partials 735 735
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:56:29 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.
|
Summary
gittensory-miner metricssubcommand that prints the miner's prediction-calibration counters in Prometheus text-exposition format to stdout, suitable for a scrape wrapper or a cron redirect.renderMinerPredictionMetrics(packages/gittensory-engine/src/miner-prediction-metrics.ts, feat(miner-selfimprove): calibration metrics exporter — Prometheus-style counters for prediction accuracy #4264) into the CLI without touching the renderer itself, per the issue's boundary. The command only reads the local prediction ledger (prediction-ledger.jsreadPredictions) and feeds the rows in.conclusioncounts populategittensory_miner_predictions_total{conclusion="…"}; thecorrect/incorrectcounters stay zero until an outcome-join exists, exactly as the renderer is designed to degrade before outcome-pairing.status/doctor: it is dispatched before the opportunistic npm-registry update check and makes no network calls and no writes.Closes #4838.
Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #123) — a linked open issue is required for every contributor PR.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally;codecov/patchrequires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
packages/gittensory-miner/libchange with no worker, MCP, UI, API/OpenAPI, DB, or Cloudflare surface. Ran locally and green:git diff --check,actionlint,typecheck,build:miner(whichnode --checks the new files),test:miner-pack,miner:env-reference:check,npm audit, and vitest coverage scoped to the changed files —metrics-cli.jsreports 100% of changed lines and 100% of branches (9/9), and the onlycli.jschange is a covered help-text line.test/unit/miner-metrics-cli.test.ts) cover the command's rendered happy path, the self-owned default-ledger open/close path, unexpected-argument rejection, and both theErrorand non-Errorthrow paths; the existingtest/unit/miner-cli.test.tshelp assertion is extended for the new command line.test:workers/build:mcp/test:mcp-pack/ui:*checks exercise surfaces this PR does not touch; they are left to the requiredvalidateCI job, which runs the fullnpm run test:cichain.Safety
UI Evidencesection 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. — N/A: CLI-only change, no visible UI/frontend/extension surface.gittensory-miner --help; no changelog edit.Notes
console.logso exactly one trailing newline is emitted (no doubled blank line), keeping the output byte-clean for a scrape/cron consumer.