Skip to content

feat(ci_status): feed run conclusions from an MCP drop point #179

Closed

Description

@Jammy2211

Mind prompt: draft/feature/pyautoheart/feed_ci_status_run_conclusions_from_an.md

Second half of the no-gh mobile path. The HEAD-sha half is #178.

Problem

heart/checks/ci_status.sh fetches each repo's recent main workflow runs with
gh api. On a mobile/cloud session there is no gh, so every polled repo
records status="unavailable" and CI is unknown per-library.

Why this is small

gh is only transport. The reasoning already lives in
heart/checks/ci_status.py, which reads a REST-shaped {"workflow_runs": [...]}
payload. mcp__github__actions_list(list_workflow_runs) returns exactly that
shape, snake_case keys included — so the MCP tools already emit byte-compatible
input for the existing parser and nothing is reshaped on the way in.

Mirrors the proven test_run.py cloud_validation.json hand-off rather than
inventing a second idiom.

Change

  • HEART_CLOUD_CI_DIR ($HEART_STATE_DIR/cloud_ci/<Name>.json) holding
    {ts, runs}; ts optional, file mtime used when absent.
  • ci_status.cloud_runs() reads and age-bounds it, returning (runs, "") or
    (None, reason).
  • main gains --cloud-runs, consulted only when the live fetch already
    failed
    — so the dev box is byte-for-byte unchanged.
  • New source field on the sidecar ("gh" | "cloud") recording provenance.

Keeping it fast

  • The tick does no network work for this. It only reads the drop point, as
    it already reads cloud_validation.json. Population is a separate one-shot
    leg. This is the decision that keeps the <30s budget intact.
  • No MCP call for the sha — that half is git ls-remote (feat(ci_status): resolve main HEAD sha without gh via ls-remote #178), halving the
    round trips and needing no repo attachment.
  • Age bound (HEART_CLOUD_CI_MAX_AGE, default 3600s): past it, the payload
    degrades to the same unavailable the failed fetch already produced, never a
    stale green.

Verification

13 new tests across cloud_runs freshness/fail-closed paths and main's
ordering. Verified end-to-end in a gh-less container against a drop point built
from a real MCP list_workflow_runs response: consumed with source="cloud"
and the fetch error cleared.

Worth recording from that run: the rollup still declined to report success,
because PyAutoFit's main advanced between fetching the runs and the tick, so
the existing on_head guard correctly marked them off-HEAD. That is the guard
doing its job, and it is the reason the age bound alone is not sufficient — a
payload can be fresh by clock and still stale by commit.

Remaining constraint

The Actions API needs each repo attached to the session, and attachment can be
refused (it was, for one library, during the session that motivated this). A
repo that cannot be reached degrades to unavailable, which is the correct
outcome rather than an error — but it does mean this half delivers less on
mobile than #178 does.

Activity

  1. added a commit that references this issue on Aug 25, 2026
    d29fe7d
  2. Jammy2211 commented on Aug 25, 2026

    @Jammy2211
    ContributorAuthor

    Shipped in #180 (merged as a570d0a).

    HEART_CLOUD_CI_DIR drop point, read by ci_status.cloud_runs() and consulted only when the live fetch has already failed — so dev-box behaviour is byte-for-byte unchanged. Age-bounded via HEART_CLOUD_CI_MAX_AGE (default 3600s), with a new source field on the sidecar recording "gh" vs "cloud".

    Verified end-to-end in a gh-less container against a drop point built from a real MCP list_workflow_runs response: consumed with source="cloud" and the fetch error cleared.

    The finding worth keeping from that run: the rollup still declined to report success, because PyAutoFit's main advanced between fetching the runs and the tick, so the existing on_head guard marked them off-HEAD. That is the guard working as intended — and it is why the age bound alone is not sufficient. A payload can be fresh by clock and stale by commit. The on-HEAD success path is covered by a unit test rather than by rewriting the sha to force a green.

    Standing constraint, unchanged by this: the Actions API needs each repo attached to the session, and attachment can be refused. Such a repo degrades to unavailable, which is correct — but it means this half delivers less on mobile than #178 does.


    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