fix(cli): add evaluation cache to miner score stub#1191
Merged
anderdc merged 1 commit intoMay 14, 2026
Conversation
10 tasks
anderdc
requested changes
May 14, 2026
Collaborator
anderdc
left a comment
There was a problem hiding this comment.
Take the guard at the call site instead. In gittensor/validator/oss_contributions/reward.py:143, wrap the eviction in if penalized_uids: — the single-miner dev flow never produces penalized UIDs, so the attribute is never accessed and the stub stays minimal. Drop the _new_evaluation_cache factory and _StubValidator.evaluation_cache change from this PR. Keep the new test — that lower-mock shape (patching only evaluate_miners_pull_requests) is the right coverage gap to close.
b0a12a0 to
312d352
Compare
Contributor
Author
|
Hi @anderdc how are you? I've solved this correctly. Thanks for reviewing. |
312d352 to
c77ae2d
Compare
c77ae2d to
f7582a1
Compare
anderdc
approved these changes
May 14, 2026
Contributor
Author
|
Thanks @anderdc |
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
gitt miner scoreruns the validator scoring pipeline through_StubValidator, which avoids the real validator runtime dependencies. After #1040,get_rewards()always callsself.evaluation_cache.evict_many(penalized_uids), but the CLI stub did not defineevaluation_cache.This PR adds a lazy
MinerEvaluationCachefactory and wires it onto_StubValidator, matching the validator surface now required byget_rewards()while keeping CLI imports lightweight.Changes
_new_evaluation_cache()to lazily constructMinerEvaluationCache.self.evaluation_cachein_StubValidator.__init__.oss_contributions -> get_rewardspath instead of mockingoss_contributionsaway.Testing