πŸ› fix: a push in a cloud session moves the board through REST

Merged
AT
1mo ago
+428-148

Slice: #128

Fixes State #138 of P-45: the board moves an agent's push makes went through GitHub's GraphQL API, which Claude's GitHub proxy refuses, so a cloud session's push printed "could not read where #N and its work item are on the board (GitHub's GraphQL API refused: HTTP 403)" and moved nothing.

  • src/board.ts, boardStarted: GitHub's REST API alone. It reads the slice and its parent (/issues/{n}, /issues/{n}/parent), the open Work items (/issues?state=open&type=Work item, every page), the repository owner's Projects (/orgs/{org}/projectsV2 or /users/{user}/projectsV2), each open one's Status and Step single-select fields, its items with those values, and moves an item with PATCH …/projectsV2/{n}/items/{id}. Pages follow the Link header. A closed Project, an archived item, a pull request or draft, and another repository's issue are left alone; a Project with neither field has no items read. Every part has a REST equivalent, so no GraphQL is left in the push. The moves, their order and their lines are as before; a refusal now names the REST call, e.g. GitHub's REST API refused GET /orgs/example-org/projectsV2?per_page=100: HTTP 403 Forbidden.
  • Differences from GraphQL: only the repository owner's Projects are read (onboard makes the board there), closed Projects are skipped, and every open Work item is read rather than the newest hundred.
  • onboard keeps its GraphQL setup: it runs on the owner's Mac, not in sessions.
  • README: the board paragraph says the moves use REST and work through the proxy.
  • Tests: a REST Projects fake (RestBoard in src/fake-board.test.ts); the push tests in src/work.test.ts now run on it and check no GraphQL is asked; src/board.test.ts covers a user-owned board, one-item pages, a closed Project, items of other repositories, PRs, drafts and archived items, no parent or a non-Work-item parent, and refused reads.

Checked against GitHub: the field, item and Link shapes the fake serves match athya-hq's own Projects (read-only). pnpm check passes (881 tests, board.ts 100% lines).

πŸ€– Generated with Claude Code


Summary by cubic

Fixes board moves on push in Claude cloud sessions: they went through GitHub's GraphQL API, which the session's proxy refuses, so a push printed a 403 and moved nothing. They now use GitHub's REST API for Projects alone, and a refused read names the REST call.

  • Only the repository owner's open Projects are read; closed Projects are skipped, and every open Work item is read rather than the newest hundred.
  • A missing parent reads as no parent only when the response is a 404 saying so; any other failure is a refused read and names the call.
  • onboard keeps its GraphQL setup because it runs on the owner's Mac, not in sessions.