fix(review): meter tie-break judge budget - #3671
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-06 04:11:47 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 6 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.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3671 +/- ##
=======================================
Coverage 93.34% 93.34%
=======================================
Files 315 315
Lines 32107 32111 +4
Branches 11769 11772 +3
=======================================
+ Hits 29969 29973 +4
Misses 1507 1507
Partials 631 631
🚀 New features to boost your workflow:
|
The reserved worst-case tieBreakAiCalls budget had an untested branch: a self-host reviewer pair with no distinct fallback model (primaryFallback === primary.model) falls to the x1 multiplier instead of x2, which the original single regression test never exercised.
7071bcc to
b84aec0
Compare
Closes #3679
Summary
per-model fallback — that were never counted against the free daily AI neuron budget, letting a
contributor spend extra provider usage beyond the configured limit by triggering repeated consensus
disagreements.
tieBreakAiCallsbudget (2 judge calls x up to 3 attempts x a per-modelfallback multiplier) and adds it to
estimatedNeuronsinrunGittensoryAiReview(
src/services/ai-review.ts), gated onmode === "block" && dual && combine === "consensus"— theonly path that can actually reach the tie-break judge.
single-model configuration where a reviewer has no distinct fallback (
primaryFallback === primary.model), exercising the x1 multiplier branch.Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.md; nosite//CNAME/VitePress changes.Closes #3679.Validation
git diff --checknpm run actionlint— not run; no workflow files touched.npm run typecheck(clean)npm run test:coverage(full/unsharded) — not run locally; ran the affected test file(
test/unit/ai-review.test.ts, 153 tests, all green) plus the fullqueue.test.tsintegrationsuite (732 tests). Cross-referenced the exact new-diff line/branch ranges against a fresh
coverage-final.json(--coverage.include='src/services/ai-review.ts'): 100% of the newstatements and branches are covered (the original patch was missing the x1-fallback-multiplier
branch; closed with a second new test). GitHub CI runs the full suite/gate on push.
npm run test:workers/npm run build:mcp/npm run test:mcp-pack— not run; nothing inthose surfaces touched.
npm run ui:openapi:check/ui:lint/ui:typecheck/ui:build— not run; no API/schema orapps/gittensory-ui/**changes.npm audit --audit-level=moderate— not run; no dependency changes.ternary, plus the existing quota-exceeded assertion pattern already used elsewhere in this file.
If any required check was skipped, explain why:
test:ci/test:coverage/npm auditpass, since GitHub CI runs the complete gate on push andre-running the whole suite by hand for every change is redundant.
Safety
exposed.
UI Evidencesection included.