feat(miner): add a metrics command for the prediction Prometheus renderer - #5473
Closed
real-venus wants to merge 1 commit into
Closed
feat(miner): add a metrics command for the prediction Prometheus renderer#5473real-venus wants to merge 1 commit into
real-venus wants to merge 1 commit into
Conversation
…erer A pure Prometheus text-exposition renderer for miner prediction accuracy (gittensory-engine renderMinerPredictionMetrics) already existed, explicitly designed for cron/scrape use, but nothing ever called it. Add a 'gittensory-miner metrics' subcommand that reads the local prediction ledger, pairs each prediction with its realized PR outcome (event-ledger pr_outcome events) to mark it correct/incorrect, and writes the renderer's output to stdout for a scrape wrapper or cron redirect. Read-only; the renderer itself is unchanged. Closes JSONbored#4838
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
renderMinerPredictionMetricsinpackages/gittensory-engine/src/miner-prediction-metrics.ts) already existed, explicitly designed for cron/scrape use — but nothing in the CLI ever called it (Wire the existing miner-prediction Prometheus renderer into a real command #4838).gittensory-miner metricssubcommand that reads the local prediction ledger, pairs each prediction with its realized PR outcome (event-ledgerpr_outcomeevents, latest per PR) to mark it correct/incorrect, maps the rows to the renderer's shape, and writes the renderer's Prometheus output to stdout — suitable for a scrape wrapper or a cron redirect.gittensory_miner_predictions_total(by conclusion) but not toward correct/incorrect, so the surface is meaningful before outcome-pairing exists and grows once it does.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 newprediction-metrics-cli.jsat 100% line + branch coverage locally via the v8 JSON report; 4 unit tests cover the prediction→outcome pairing (correct/incorrect/unresolved), the latest-outcome-per-PR dedup, skipping non-outcome and malformed events, the well-formed empty-ledger surface, 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/**andtest/**— no workflow, worker, MCP, OpenAPI/API, UI, or dependency surface for those jobs. The fullnpm run test:ciruns 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.