Spaces:
Sleeping
Sleeping
Commit History
-
Diagnose HF push: surface token role + fine-grained scope + email status
The first pass of the diagnostic only verified identity (token user matches Space owner) and existence. The user's actual failure had identity + ownership both correct, so the cause must be in: * token role (Read vs Write vs Fine-grained), or * email verification status, or * fine-grained scope coverage of the target Space. This pass reads auth.accessToken.role and auth.accessToken.fineGrained from /api/whoami-v2, plus emailVerified, then prints a tailored fix ladder per case: - read-scope token -> 'create Write token' (return 8) - fine-grained, no Space -> 'add space:JoeTach/cdpr-simulator to token permissions, or make a classic Write token' (return 9) - unverified email -> 'click HF's verify-email link' (return 7) - everything OK -> push should work; if it doesn't, look at Space settings / HF status page Also fixed the SyntaxWarning from \d in the module do…b2af897 -
Add scripts/diagnose_hf_push.py to definitively diagnose the HF auth failure
The 'pre-receive hook declined' pattern combined with successful object upload means the token authenticates but the token's account lacks write permission on JoeTach/cdpr-simulator. This script calls HF's REST API directly with the user's token and reports: 1. Whether the token is valid (whoami-v2) 2. Which HF account the token actually belongs to 3. Whether the target Space exists and who owns it 4. The exact mismatch and three concrete fix paths Uses only stdlib urllib --- no install required. Token never echoes in any output; only the last 6 characters appear in the diagnostic header. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>0ee834d