caller-pins: read callers from raw, and never trust the session sentinel - #20
Merged
Merged
Conversation
The first live census (run 30860781598) failed two ways, both of which the guards caught rather than hid. RATE LIMIT. Unauthenticated api.github.com allows 60 requests/hour and the census makes one per repo (~90). It took 23 consecutive 403s and still printed a confident 'callers: 43' -- truncated to whichever repos sorted early. Reading callers from raw.githubusercontent instead: a CDN, unmetered against that budget, no credential needed. The org listing stays on the API because it has no raw equivalent, but that is one call, not ninety. Authenticating was not the fix: github.token is scoped to THIS repo and cannot read another repo's contents at all. SENTINEL. A cloud session's GH_TOKEN is the literal string 'proxy-injected' -- set, non-empty, and not a credential. Forwarding it as a Bearer made raw 404 every file, i.e. 'no repo has a caller'. Only the empty-census guard caught it. real_token() now treats the sentinel as absent. Private repos are skipped and COUNTED (unexamined_private) rather than attempted: without a credential they 404 on raw, which is indistinguishable from having no caller. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017RMKHpGXzw9Zkv49fzVssg
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.
Follow-up to #19. The first live census (run 30860781598) failed two ways — and both are worth reading, because in each case a guard is the only reason we found out.
1. Rate limit — the census truncated itself and still looked confident
Unauthenticated
api.github.comallows 60 requests/hour. The census makes one call per repo (~90 for this org), so it took 23 consecutive HTTP 403s and still printed:callers: 43reads like a census. It is a census of whichever repos sorted alphabetically before the budget ran out. The run failed only because unreadable reposraiserather than being treated as "no caller" — hadfetch_callerswallowed non-404s, this would have been a green run reporting a truncated fleet, which is precisely the failure the whole lane exists to catch, reproduced inside the lane itself on its first outing.Authenticating is not the fix.
github.tokenis scoped to this repo and cannot read another repo's contents at all — it would have made the census smaller, not larger. Callers now come from raw.githubusercontent: a CDN, unmetered against that 60/hour budget, no credential. The org listing stays on the API because it has no raw equivalent, but that is one call rather than ninety.2. The session sentinel — every file 404'd, which looks exactly like "no callers"
A cloud session's
GH_TOKENis the literal stringproxy-injected— set, non-empty, and not a credential; the real one is injected at the egress proxy. The tool forwarded it asAuthorization: Bearer proxy-injected, and raw 404s every file under a bad bearer. A 404 means "not a caller", so the census came back empty:The empty-census guard is the only reason this surfaced instead of being read as "the fleet has no callers."
real_token()now treats the sentinel as absent.3. Private repos are skipped and counted, not attempted
Without a credential a private repo 404s on raw — indistinguishable from having no caller. They are now excluded up front and reported as
unexamined_private, rather than silently folded into the 404 path.Verified
authenticated: falsefrom a session that hasGH_TOKENset is the sentinel fix working. 20 tests pass (4 new forreal_token, 2 forcaller_url).Worth noting from the partial data
Even truncated, the first run corrected my picture: 13 of 43 callers were already current. The fleet is split by when a repo adopted — the 2026-07-30 wave sits at
62990dd, later adopters came in at162accb. So the re-pin backlog is smaller than "~44", andgh-action-brand-checks/-contracts/-node-uniquenessnow have callers despite being recorded as empty repos in #2. The full number lands with the next clean dispatch.🤖 Generated with Claude Code
https://claude.ai/code/session_017RMKHpGXzw9Zkv49fzVssg
Generated by Claude Code