feat(miner): add structured reviewer-consensus calibration signal - #3406
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-05 07:01:51 UTC
⏸️ Suggested Action - Manual Review Review summary Nits — 5 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 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
Adds a new pure engine module,
packages/gittensory-engine/src/reviewer-consensus-calibration.ts, in the same opt-in calibration family as objective-anchor, pairwise-judge, gate-verdict, and finding-severity calibration. It gives the miner replay harness a structured, default-off signal for how well a review's verdicts agree across independent reviewers.When a review runs more than one independent reviewer (multiple models, or the same model sampled multiple times), each reviewer casts a per-dimension verdict (
pass/warn/fail). This module ingests, per replayed PR, the set of votes per gate dimension and scores the consensus:fail/warndown topass), and the agreement fraction is the plurality's share of the definite votes.computeReviewerConsensusCompositeCalibrationScore, renormalizing weights when a signal is absent.It complements the pairwise judge (which measures the order-stability of a single judge) by measuring agreement across independent reviewers, and it is distinct from gate-verdict calibration (which scores the outcome) and finding-severity calibration (which scores per-tier confirmation). Exactly like the sibling signals, the type surface is deliberately narrow — repo/run ids and per-dimension votes only. No raw review text, secrets, trust scores, reward values, private rankings, or maintainer evidence is represented, and
renderReviewerConsensusCalibrationAuditMarkdownMarkdown-escapes and newline-collapses every caller-supplied id.Public API (exported from the package barrel)
resolveReviewerConsensusCalibrationConfig(manifest)— default-off opt-in fromminer.calibration.shareStructuredReviewerConsensus(with a top-levelcalibration.*alias) plus an optional non-negative weight; malformed values fail closed with warnings.ingestReviewerConsensusCalibrationSignals(signals)— validates + normalizes opted-in signals, rejecting with a specific reason (not_opted_in/empty_dimensions/invalid_repo/invalid_run_id); aggregates repeated dimensions and normalizes dimension + vote aliases.computeReviewerConsensusCompositeCalibrationScore(input)— blends objective-anchor + pairwise + reviewer-consensus (numbers or the sibling score objects), renormalizing weights and falling back to objective-only when all weights are zero.renderReviewerConsensusCalibrationAuditMarkdown(result)— deterministic, public-safe Markdown.This is deliberately default-off and safe to call at ingestion time. No app routes, deploy config, or existing modules change — only the new module, its barrel export, its
README.mdsection, and its unit test._Resubmit of #3396 (auto-closed on one AI-reviewer blocker): the composite scorer's
normalizeCompositeWeightssubstituted the default 45/35/20 blend on all-zero input weights, making the documented objective-only fallback unreachable soweights: {0,0,0}silently got the default blend. Fixed to preserve zero weights (the reviewer's suggested change), and the all-zero test now asserts the objective-only fallback (weights {1,0,0}, composite == the objective score) instead of a loose range.No linked issue: it sits in the established calibration-signal family and is a self-contained, additive, default-off engine module whose rationale is fully described here (issue creation on this repo is collaborator-only).
Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.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:
npm run test:ciaggregate ran green (includingbuild:miner, which compiles the enginesrc/— the new module and barrel export type-check clean — andtypecheck) plusnpm audit --audit-level=moderate(0 vulnerabilities). A dedicated node:test suite (packages/gittensory-engine/test/reviewer-consensus-calibration.test.ts, mirroring the sibling calibration tests) covers config resolution, ingestion/rejection reasons, dimension + vote normalization, plurality tie-breaking, agreement weighting, composite weight renormalization, and the Markdown renderer. The module lives underpackages/(outside the rootsrc/**Codecov scope), so the 99% patch rule does not apply to it.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.The module's type surface is deliberately private-data-free (repo/run ids + per-dimension votes only), it is default-off (ingestion requires an explicit
shareStructuredReviewerConsensus: trueopt-in), and the renderer escapes and newline-collapses all caller-supplied ids. Pure and deterministic: no auth/CORS/session surface, no API/OpenAPI shape change, no UI.Notes
reviewer-consensus-calibration.ts+ its barrel export + aREADME.mdsection + anode:testsuite. No schema, migration, OpenAPI, wrangler, or generated-artifact impact.