Skip to content

fix: reject GraphQL viewer:null in gitt miner post local PAT preflight (#1195)#1196

Closed
alpurkan17 wants to merge 4 commits into
entrius:testfrom
alpurkan17:fix/1195-pat-preflight-viewer-null
Closed

fix: reject GraphQL viewer:null in gitt miner post local PAT preflight (#1195)#1196
alpurkan17 wants to merge 4 commits into
entrius:testfrom
alpurkan17:fix/1195-pat-preflight-viewer-null

Conversation

@alpurkan17
Copy link
Copy Markdown
Contributor

@alpurkan17 alpurkan17 commented May 12, 2026

Summary

The local PAT preflight only checks the GraphQL HTTP status code, but validators reject fine-grained PATs that return data.viewer: null (validator-side fix #764). Miners see a false "PAT valid" locally and broadcast tokens that validators deterministically reject.

Port the viewer:null check from pat_handler.py:189 to the CLI preflight so both paths reject the same response shapes.

Validation

  • uv run ruff check — clean
  • uv run ruff format --check — clean
  • uv run pyright — 0 errors
  • uv run pytest tests/cli/test_miner_commands.py -q — passed

Closes #1195

@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label May 12, 2026
@alpurkan17 alpurkan17 changed the title fix: reject GraphQL viewer:null in gitt miner post local PAT preflight (#1195) fix(cli): reject viewer-null PAT preflight responses (#1195) May 12, 2026
@alpurkan17 alpurkan17 changed the title fix(cli): reject viewer-null PAT preflight responses (#1195) fix: reject GraphQL viewer:null in gitt miner post local PAT preflight (#1195) May 12, 2026
anderdc
anderdc previously approved these changes May 14, 2026
Copy link
Copy Markdown
Collaborator

@anderdc anderdc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mirrors the validator-side viewer:null check at pat_handler.py:189. Small UX win on the preflight path.

@alpurkan17
Copy link
Copy Markdown
Contributor Author

@anderdc this PR is approved — mind hitting merge when you get a chance? Thanks!

@alpurkan17
Copy link
Copy Markdown
Contributor Author

@anderdc synced branch with latest test (includes #1285, #1276). The only change in this PR remains the +7 line viewer:null check in post.py — the other diff lines are from the merge. Dismissed the previous approval — mind re-reviewing? Thanks!

@alpurkan17
Copy link
Copy Markdown
Contributor Author

@anderdc review was dismissed — could you please re-review? The diff is +7 lines unchanged (post.py); the rest is from upstream merge commits.

@anderdc
Copy link
Copy Markdown
Collaborator

anderdc commented May 17, 2026

Duplicate of #1197, which is better scoped and implemented — it ports the full validator-side check (errors, data, viewer:null) in a clean 2-file diff with regression tests. This PR is conflicting, its 20-file diff is dominated by unrelated pioneer/scoring changes, and it only adds the viewer:null check while missing the errors check #1195 asks for. Closing.

@anderdc anderdc closed this May 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gitt miner post local PAT preflight accepts GraphQL viewer:null tokens

2 participants