Skip to content

feat(board): inject GitHub data so the overnight legs render without gh #303

Closed

Description

@Jammy2211

Overview

The Brain board is the morning door, and on mobile it is mostly blind: eleven of its legs read GitHub through gh api, and a Claude Code remote session has no gh at all. The render is honest about it — could not read, a degraded banner, no green badge from a partial view — but honest-and-blind is still blind.

Phase 1 of PyAutoMind/draft/feature/pyautobrain/board_without_gh_phase1_seam.md (parent: board_without_gh.md, which holds the design and the measurements). The parent's Phase 0 probe was run on 2026-08-27 and selected this option: $GH_TOKEN returns 200 on /user and /rate_limit and 403 on every repo-scoped path ("GitHub access is not enabled for this session"), so enabling raw REST (option 2) needs an org-admin action that has not happened, and installing gh (option 3) rides the same credential.

board/_board.py is a subprocess and cannot call mcp__github__* tools — those are an agent capability. That is why this is a seam and not a substitution.

Plan

  • board/_board.py accepts pre-fetched GitHub JSON via --github-data <file>; gh_json() reads from it when present.
  • The gh path is untouched, so a developer box behaves exactly as it does today.
  • The /board skill — which is the agent — gathers that JSON via mcp__github__* when command -v gh fails, writes the file, and invokes the renderer with the flag.
  • Prove it on one leg family: the seven overnight: could not read <repo>/<workflow> rows, the largest block of the eleven.
  • Document the file's shape as a contract in board/AGENTS.md, because it outlives whoever writes it.
  • A leg with no injected data still reports could not read — no leg may substitute an empty answer for an unasked question.
Detailed implementation plan

Affected Repositories

  • PyAutoBrain (primary)

Branch Survey

Repository Current Branch Dirty?
./PyAutoBrain claude/mobile-workflow-review-tyv13y clean
./PyAutoMind claude/mobile-workflow-review-tyv13y clean

Suggested branch: feature/board-github-data-seam

Implementation Steps

  1. board/_board.py — add --github-data <path> to the argument parser. Load it once into a mapping keyed by the same identity gh_json() already uses for its calls (repo + endpoint), so the injected data and the live path are interchangeable by construction rather than by convention.
  2. board/_board.py — gh_json() consults the injected mapping first, falls back to gh when it is absent, and returns the existing "could not ask" sentinel when neither is available. Do not add a third outcome: the 2026-08-26 work established that asked and got nothing and could not ask are the only two, and green is emitted only by a render that read everything.
  3. skills/board/board.md — the gathering half. Probe command -v gh once; when absent, collect the overnight legs' data with mcp__github__actions_list (list_workflow_runs) per watched workflow, write the file, and invoke the renderer with --github-data. Note that list_workflow_runs has no head_sha filter — filter by branch and match head_sha in the gatherer, the same trap recorded in skills/prm/prm.md's mcp lane.
  4. board/AGENTS.md — extend "Reading the board in a remote session" with the file's schema, the identity key, and the rule that an absent key means could not ask, not nothing.
  5. Tests — drive the seam from a fixture file, never a live call: a full fixture renders the overnight rows live; a partial fixture leaves the uncovered legs reading could not read and keeps the badge non-green; the gh path is unchanged when no flag is passed.

Key Files

  • board/_board.py — gh_json(), argument parsing
  • skills/board/board.md — the MCP-gathering half (agent-side)
  • board/AGENTS.md — the documented contract
  • tests/test_board_degraded.py — the invariants this must not break

Trade-offs

The seam costs a documented contract between a skill and a script. It was chosen over the alternatives because the probe closed them: it works today and needs no external permission. If an org admin later connects the Claude GitHub App, gh_json() can become a plain REST helper on every surface and the seam becomes removable — so keep the contract small enough to delete.

Original Prompt

Click to expand starting prompt
# Board phase 1: the injection seam, proven on the overnight legs

Type: feature
Target: pyautobrain
Repos:
- PyAutoBrain
Difficulty: medium
Autonomy: supervised
Priority: normal
Status: formalised
Filed: 2026-08-27
Parent: draft/feature/pyautobrain/board_without_gh.md

Phase 1 of the board's gh-less work. The parent prompt holds the design, the
measurements and the 2026-08-27 probe that selected this option; read it first
and do not re-derive them.

## Scope

Build the seam and prove it on **one** leg family — the seven `overnight:
could not read <repo>/<workflow>` rows, the largest block of the eleven.

- `board/_board.py` accepts pre-fetched GitHub JSON (`--github-data <file>`),
  and `gh_json()` reads from it when present. The `gh` path is untouched, so a
  dev box behaves exactly as today.
- The `/board` skill — which *is* the agent, and so is the only thing that can
  call `mcp__github__*` — gathers that JSON when `command -v gh` fails, writes
  it, and invokes the renderer with the flag. `_board.py` stays a pure
  renderer; a subprocess cannot reach MCP tools and this is the whole reason
  the seam exists.
- The file's shape is a documented contract in `board/AGENTS.md` (extend
  "Reading the board in a remote session"), because it outlives whoever writes
  it.

## Guards

- Tests drive the seam from a **fixture file**, never a live call.
- A leg with no injected data still reports `could not read` — the invariant
  from the 2026-08-26 work: no leg may substitute an empty answer for an
  unasked question. A green badge still requires a render that read everything.

## Done when

The overnight rows are live in a remote render, the degraded count drops by
seven, the dev-box path is byte-identical, and `tests/test_board_degraded.py`
plus the new fixture tests pass.

Activity

  1. Jammy2211 commented on Aug 27, 2026

    @Jammy2211
    ContributorAuthor

    Shipped

    PR #305 merged as ef887f8 (main at 71b62f5).

    _board.py takes --github-data <file> — {endpoint: response}, keyed by the endpoint string exactly as gh_json() receives it, so injected and live data are interchangeable by construction. The /board skill gathers via mcp__github__* when gh is absent; the renderer stays pure, because MCP tools are an agent capability a subprocess cannot reach.

    Proved in a session with no gh: one injected endpoint renders ✓ PyAutoLabs/PyAutoBrain/nightly-release.yml — success (6h) with its run link, while the six uninjected legs still read could not read and the board stays degraded and non-green.

    The three rules the seam does not bend — a miss is could not ask, an explicit null says the gatherer's own fetch failed, a malformed file is fatal rather than degrading — are the 2026-08-26 degraded-render invariant restated, and are pinned by 8 fixture-driven tests (569 total, ruff clean).

    One contract detail found by doing rather than designing: the row's age reads created_at, not updated_at. A gatherer that stores the wrong field renders ?, which reads as a render bug rather than a bad file. Documented in board/AGENTS.md and skills/board/board.md, and asserted in the tests.

    Phase 2 — the remaining four legs (versions, community, resume, upkeep) — is PyAutoMind/draft/feature/pyautobrain/board_without_gh_phase2_legs.md, now unblocked.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions