fix(scoring): correct constant name + fallback to match upstream values (#806, #807)#815
Conversation
Two real upstream-sync correctness bugs found in the 2026-06-17 scoring audit. Both affect the value gittensory shows contributors (and the PMF conversion hook). - #806: the treasury emission share was keyed `ISSUE_TREASURY_EMISSION_SHARE` but upstream entrius/gittensor uses `ISSUES_TREASURY_EMISSION_SHARE` (plural). The name never matched, so the value was frozen at the local default forever AND upstream's real constant was reported as "unmodeled" drift. Renamed to the upstream spelling; SCORING_CONSTANT_NAMES derives from the keys, so it now syncs. - #807: the MAX_CONTRIBUTION_BONUS fallback was 25 but upstream is 5. The hourly fetch normally overwrites it, but on any fetch failure the contribution bonus was silently 5x-inflated. Fallback set to 5 in model.ts and the preview.ts literal. Regression test asserts the upstream name/value and that the plural name is no longer flagged unmodeled; updated the fetch-failure-fallback test to expect 5. Closes #806 Closes #807
|
Note Gittensory Gate skippedPR closed before full evaluation. No late first comment was created.
💰 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. |
|
gittensory · advisory review Reviewed 3 changed file(s) — two independent AI reviewers. Changed files: Suggested action: 🛠️ Request changes. (reviewers split: request changes / merge) Address the suggestions below before merging. Reviewer A · Suggestions
Worth double-checking
Reviewer B · No blocking issues spotted. |
|
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 #815 +/- ##
=======================================
Coverage 96.76% 96.76%
=======================================
Files 97 97
Lines 13992 13992
Branches 5098 5098
=======================================
Hits 13540 13540
Misses 86 86
Partials 366 366 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Internal gittensory fix — two verified scoring-sync correctness bugs (2026-06-17 audit). The values mirror the documented upstream gittensor scoring constants; nothing is filed upstream.
#806 — treasury emission-share never synced
gittensory keyed
ISSUE_TREASURY_EMISSION_SHARE; upstream publishes it asISSUES_TREASURY_EMISSION_SHARE(plural). The mismatch froze it at the local default forever and produced a false 'unmodeled' drift warning. Renamed;SCORING_CONSTANT_NAMESderives from the keys, so it now syncs.#807 — MAX_CONTRIBUTION_BONUS fallback was 5x the real value
Fallback was
25; the real value is5. Hourly fetch normally overwrites it, but on a fetch failure the contribution bonus was silently 5x inflated. Set to5in model.ts + the preview.ts literal.Tests
New regression + updated the fetch-failure-fallback test (had codified the buggy 25).
vitest run test/unit/scoring.test.ts-> 31 passed; scoring files typecheck clean.Closes #806
Closes #807