Skip to content

fix(dependabot): report why a PR read failed, not just that it did - #132

Merged
twistedmelonman merged 1 commit into
mainfrom
claude/digest-error-detail-dee4868f
Sep 12, 2026
Merged

fix(dependabot): report why a PR read failed, not just that it did#132
twistedmelonman merged 1 commit into
mainfrom
claude/digest-error-detail-dee4868f

Conversation

@twistedmelonman

Copy link
Copy Markdown
Member

What happened

The first real digest run failed, and the error message made it undiagnosable:

collect.sh: nightowlstudiollc/kebab-tax-netlify#280: could not read PR detail
run-digest.sh: collection failed for nightowlstudiollc; not publishing a partial digest

That is all it said. The refusal was correct — a partial survey is the one
output this tool must never produce — but "could not read" gave nothing to act
on, and the cause is not reproducible locally: a personal login reads that repo
and that PR over GraphQL without trouble.

The defect

2>/dev/null on the GraphQL call discarded the reason, and the response body's
errors array was never inspected. GraphQL uses both channels — transport
failures go to stderr, while query-level errors (FORBIDDEN, NOT_FOUND,
RATE_LIMITED) come back in the body with HTTP 200 and exit 0. Both now
surface.

Review caught a real bug in the fix

The adversarial reviewer flagged the error formatter itself:

.errors | map(.type // "?" + ": " + (.message // "?"))

+ binds tighter than // in jq, so that parses as .type // ("?: " + .message)
and prints a bare FORBIDDEN — dropping the message, which is the entire
payload this change exists to print. Confirmed by measurement, not by reading:

buggy: FORBIDDEN
fixed: FORBIDDEN: Resource not accessible by integration

tests/test-render.sh now extracts the formatter from collect.sh and runs it
against a real error body. Validated against the known-bad form, where it fails
with the error formatter dropped part of the error: 'FORBIDDEN'.

What this does not do

It does not fix the underlying access problem, because that problem is not yet
identified. It makes the next run say what the problem is. The three tokens
were all created the same way against all repositories, and the failing repo is
indistinguishable from the two that succeeded — same owner, private, not a
fork, not archived — so the answer has to come from GitHub's own error text.

Advances #120.

https://claude.ai/code/session_01ESsw699T54JHARkQXrdL3o

The first real run failed on nightowlstudiollc/kebab-tax-netlify#280 with
"could not read PR detail" and nothing else. The reason was unrecoverable:
`2>/dev/null` discarded GraphQL's stderr, and the body's `errors` array was
never inspected. That turned a diagnosable permission failure into guesswork
about token grants — none of which was testable locally, because a local login
reads the repo fine.

Both channels now surface, because GraphQL uses both: transport failures land
on stderr, while query-level errors (FORBIDDEN, NOT_FOUND, RATE_LIMITED) come
back in the response body with HTTP 200 and exit 0.

The failure itself was correct behaviour — collect.sh refused to emit a partial
survey, and run-digest.sh refused to publish one. The digest's whole premise is
that nothing goes unseen, so a silent omission is the one outcome it must not
produce. This change does not alter that; it only makes the refusal explain
itself.

Claude-Session: https://claude.ai/code/session_01ESsw699T54JHARkQXrdL3o
@claude

claude Bot commented Sep 12, 2026

Copy link
Copy Markdown

Reviewed against BLOCK criteria (bugs, reliability regressions, security vulnerabilities, missing error handling, data loss).

Temp file lifecycle is correct: created once per loop iteration, cleaned up in both error path (before exit 1) and success path. GraphQL error formatter is properly parenthesized to preserve both type and message. New test validates the formatter against real error data.

No BLOCK-level issues found.

VERDICT: PASS

@twistedmelonman
twistedmelonman merged commit a649746 into main Sep 12, 2026
3 checks passed
@twistedmelonman
twistedmelonman deleted the claude/digest-error-detail-dee4868f branch September 12, 2026 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant