fix(cli): miner post JSON drops no_response into rejected bucket#807
Conversation
…ification Human mode renders three response categories (accepted / rejected / no_response), but JSON mode emitted only `accepted` and `rejected`, silently bucketing no_response into rejected via `rejected = total - accepted`. JSON consumers could not distinguish "validator rejected my PAT" from "validator unreachable". Mirror entrius#724's fix for the sibling `gitt miner check` command: extract `_pat_post_row_category` and `_pat_post_aggregate_counts` shared helpers so both renderings consume the same classification, and spread `**counts` into the JSON output so all three buckets surface.
|
Hi @anderdc how are you? could you review this? |
|
fix conflicts we just added some changes to those files |
@anderdc I've fixed conflicts. Thanks. |
anderdc
left a comment
There was a problem hiding this comment.
post.py:163-164 still has explicit 'accepted' and 'rejected' keys after the **counts spread, so rejected = len(results) - accepted_count overrides the correct value from counts and still bundles no_response. Drop those two keys (same shape as #724's change to check.py:107-114). Add an envelope-level test asserting accepted + rejected + no_response == total_validators.
Thanks @anderdc I’ve updated this following you. |
|
Thanks @anderdc |
Summary
Mirror of #724 for the sibling
gitt miner postcommand. Three response states (accepted=True/False/None) are rendered as three distinct buckets in human mode, but JSON mode emits onlyacceptedandrejected, silently bucketingno_responseintorejectedviarejected = total - accepted.Fixes #806
Problem
gittensor/cli/miner_commands/post.pyhad two divergent classifications of the same per-validator response:[green]✓[/green]/[red]✗[/red]/[yellow]—[/yellow]acceptedandrejected = total - accepted— silently includes no-responsesExample with 5 validators (2 accept, 1 reject, 2 unreachable):
JSON consumers cannot distinguish "validator rejected my PAT" from "validator unreachable" — operationally distinct conditions that need different follow-up.
Fix
Mirror the structure #724 used for
gitt miner check:_pat_post_row_category(row) -> {'accepted'|'rejected'|'no_response'}and_pat_post_aggregate_counts(results) -> {accepted, rejected, no_response}togittensor/cli/miner_commands/helpers.py, sibling to the existing_pat_check_*pair.post.py's human-mode loop with a_PAT_POST_STATUS_MARKUP[category]lookup driven by the same row-category helper.**countsinto the JSON envelope so all three buckets surface in the output.After the fix:
Out of scope
This PR fixes only the JSON/human classification mismatch. Exit-code behavior on zero acceptances is intentionally not changed — the maintainer's position on that case is settled by #542 ("I wouldn't call that an operational failure, it's simply the output, no one accepted the PAT") and by the prior PR attempts #559, #550, #679.