Repository navigation
Description
Summary
When non-review GraphQL is blocked (the HTTP 403 shape #3170 documented for cloud sessions), morning-brief.sh cannot read any section because every one of its gh subcommands rides GraphQL. Serve sections 1-4 from repository-scoped REST endpoints in that case, and let section 5 report UNREADABLE, so a cloud session gets a mostly complete brief instead of an honest empty one.
Depends on the degraded-mode contract in #4038 landing first, so a REST failure degrades the same way a GraphQL failure does.
Motivation
The daily operator pass increasingly runs from cloud sessions. #3234 documented REST substitutes for other skills; morning-brief has none. Note the limit: in the session that surfaced this, REST was also 403 (the org GitHub App was not connected to the gh proxy). This change helps #3170-shaped sessions where REST works, not that one.
Design decisions (from interview)
gh-subcommand-first stays the primary path. REST is a fallback keyed on the observed 403 shape, not a rewrite.- Section 5 (stranded findings) needs
reviewThreads, which is GraphQL-only and not in the served pinned set. It renders UNREADABLE under the fallback. Never an all-clear. - Merge-ready via REST needs one
GET /repos/{o}/{r}/pulls/{n}per open PR formergeable_state. Cap it (a--pr-limitdefault is the implementer's call) and say when the cap truncated the read. - Queue counts via REST use
GET /repos/{o}/{r}/issues?labels=...&state=openwith pagination;search/issuesis not repository-scoped and is blocked in cloud sessions. - Parked decisions and telemetry via REST use the repository issues and comments endpoints.
Acceptance criteria
- WHILE non-review GraphQL is blocked, sections 1-4 are served from REST and section 5 renders UNREADABLE.
- The header names the transport in use when it is not the default.
- Live and REST paths render byte-identical output for identical data (fixture-proven with a REST-shaped fixture per section).
- The merge-ready REST path states when the per-PR cap truncated the read; a truncated read is never rendered as complete.
- No new sections.
Verification
- Fixture tests for each REST-shaped payload.
- A test proves the 403 shape triggers the fallback and a REST failure still renders UNREADABLE per the fix(claude-ops): morning-brief renders an all-clear when a data source is unreadable #4038 contract.
scripts/affected-tests.sh --rungreen.
Out of scope
- A model-side MCP rebuild of the brief.
- Widening the served GraphQL set (not owned by this repo).
Related
- Bug: fix(claude-ops): morning-brief renders an all-clear when a data source is unreadable #4038 (blocks this).
- Cloud sessions 403 non-review GraphQL: documented
gh issue view --jsonandgh pr createboth fail; REST equivalents work #3170 (closed by fix(docs): give the GraphQL-backed gh commands their sandboxed-session REST substitutes #3234): the environment and the REST-substitute precedent.
Activity