fix(cli): distinguish inconclusive PAT reply from no-response in miner check#1407
Merged
anderdc merged 2 commits intoMay 29, 2026
Merged
Conversation
anderdc
requested changes
May 29, 2026
Collaborator
anderdc
left a comment
There was a problem hiding this comment.
too many tests for a two line change, remove the tests
…r check After entrius#1107 a validator emits has_pat=True, pat_valid=None on a transient GitHub failure, but _pat_check_row_category had no branch for it and collapsed it into 'no_response' — indistinguishable from a validator that never answered, in both the table and --json output. Add an 'inconclusive' category in the categorizer, the aggregate-counts dict, and the check.py status-markup map (the table does a bare _PAT_CHECK_STATUS_MARKUP[category] lookup, so the markup entry is required to avoid a KeyError). success = valid_count > 0 is unchanged.
0300bec to
58513ab
Compare
Contributor
Author
|
Hi @anderdc, how are you. I've fixed. Thanks for the review. |
anderdc
approved these changes
May 29, 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
Fixes #1406
After #1107,
handle_pat_checkreturnshas_pat=True, pat_valid=Noneon a transient GitHub failure — a validator that has the miner's PAT but couldn't confirm validity because GitHub's/userlookup momentarily failed. The CLI consumer_pat_check_row_categoryhad no branch for that shape, so it fell through tono_response, rendering a healthy validator identically to one that never replied:— no response(contradicting the truthful "retry in a few minutes" reason in the adjacent column).--jsonmode: counted underno_response, excluded fromvalid, and can flipsuccesstofalse.This adds a fifth
inconclusivecategory so the two states are distinguishable. It does not change exit codes or thesuccess = valid_count > 0rule (cf. the closed #1129 / #542, which were exit-code/successpolicy for a valid zero result) — it only fixes the categorization of a reply that genuinely arrived. This is the same class of accuracy fix as the merged #724 / #807 in this same file.Relationship to existing work
pat_valid=Nonestate, touching onlyvalidator/pat_handler.py+ its test — it never updated the CLI consumer. This PR is that missing consumer-side half.pat_handlertreats transient GitHub/userfailures as invalid PATs in validator-side broadcast/check handlers #1106 notedpat_valid=None"fits the existing CLI classification … maps that state tono_response, notinvalid_pat." That only establishes the inconclusive reply isn't mislabeled asinvalid_pat(true). The defect fixed here is different: it was indistinguishable fromno_response(never answered) — lost, operator-actionable information.Changes
gittensor/cli/miner_commands/helpers.pyinconclusivebranch in_pat_check_row_category, placed after theinvalid_patbranch and guarded onhas_pat is Trueso a genuinely silent validator (has_pat=None, pat_valid=None) still resolves tono_response.inconclusivekey added to_pat_check_aggregate_counts(auto-surfaces in--jsonvia the existing**countsspread).gittensor/cli/miner_commands/check.pyinconclusiveentry in_PAT_CHECK_STATUS_MARKUP. Required, not cosmetic: the table renders via a bare_PAT_CHECK_STATUS_MARKUP[category]lookup, so a new category without a markup entry would raiseKeyError.tests/cli/test_miner_commands.pyTestPatCheckRowCategory: every category, includinginconclusive≠no_response, silent-validator →no_response, and missing-keys →no_response.inconclusive, plus a non-collapse test.test_every_category_has_table_markup) so a future category addition can't silently reintroduce theKeyError.gitt miner check --jsonintegration tests (parity with the siblingminer posttest): inconclusive surfaces distinctly,successstaysFalsefor an inconclusive-only result, and the table render does notKeyError.Testing
pytest tests/→ 892 passed.ruff check/ruff format --check→ clean.Scope
Consumer-side categorization only. Out of scope: the validator producer (
pat_handler.py, already merged in #1107), exit-code /success-rule changes, PAT-whitespace handling (#1392/#1393), andgitt miner postcategorization (different reply shape —PatBroadcastSynapsehas nopat_validfield).