Repository navigation
Description
Mind prompt: draft/feature/pyautoheart/read_ci_status_head_shas_without_gh.md
Problem
heart/checks/ci_status.sh reads each repo's main HEAD sha with
gh api repos/<owner>/<name>/commits/main --jq .sha. On a mobile/cloud session
gh is not installed, so the sha comes back empty. Readiness then cannot confirm
an ingested release-validation report against the live HEADs and reports
release validation source unconfirmed (current HEADs unknown).
Observed 2026-08-25 in a cloud session: all three named evidence gaps were
cleared (test-run verdict, install verification, release validation), yet
readiness stayed STALE on this reason alone.
High-level plan
- Extract HEAD-sha resolution out of
check_one_repo_ciinto a named shell function. - Try
ghfirst — unchanged dev-box behaviour, and the only source that works for a private repo — then fall back to anonymousgit ls-remote. - Bound the fallback with a timeout and disable credential prompting, so it can never hang the
<30stick. - Return empty on failure exactly as today; never a fabricated sha.
- Add unit coverage for the new function with stubbed
gh/git. - Confirm readiness stops emitting
release validation source unconfirmedin a gh-less session.
Detailed plan
heart/checks/ci_status.sh — add ci_head_sha <owner/name> above
check_one_repo_ci; replace the inline gh api .../commits/main (line 47) with
a call to it. The gh path stays guarded by command -v gh; the fallback is
GIT_TERMINAL_PROMPT=0 timeout 10 git ls-remote "https://github.com/$owner_name" refs/heads/main,
taking field 1 of the first line.
tests/test_ci_status_script.py (new) — follows the existing
tests/test_verify_install_script.py precedent: source the shell file, invoke
the single function, stub gh/git via a temp dir placed first on PATH.
Cases: gh succeeds → gh's sha and no fallback; gh absent → ls-remote's sha;
both fail → empty; fallback stalls → empty within the timeout.
Key trade-offs
ghfirst, notls-remotefirst. Preserves dev-box behaviour
byte-for-byte and keeps private repos working — anonymousls-remotewould
fail on those. Cost: the mobile path is only exercised where it is needed.- Hard-coded
https://github.com/<owner/name>.config/repos.yamlcarries
owner/name, not URLs. Fine today since every polled repo is GitHub, but it is
an assumption worth naming. timeout 10so that even if all ~20 parallel fallbacks stall, the tick
stays inside its budget.
Why this works standalone
build_sidecar writes head_sha unconditionally (heart/checks/ci_status.py:274),
independent of the runs fetch error. So supplying a real sha reaches readiness
even while the runs fetch still fails: the CI row keeps reading unavailable,
but the release gate can confirm commit_shas.
The CI conclusions half needs the Actions API and is tracked separately as
draft/feature/pyautoheart/feed_ci_status_run_conclusions_from_an.md.
Acceptance
- With
ghabsent,pyauto-heart tickrecords a realhead_shafor each polled
repo and readiness no longer emitsrelease validation source unconfirmed (current HEADs unknown). - The tick stays inside its
<30sbudget. - A failed
ls-remotestill yields an empty sha, not a wrong one.
Activity
feat(ci_status): feed run conclusions from an MCP drop point
Jammy2211 commentedon Aug 25, 2026
Shipped in #180 (merged as
a570d0a).ci_head_shanow keepsghfirst and falls back to an anonymousgit ls-remote, which needs neither authentication nor a session repo attachment.Verified in a gh-less container: 25 repos scanned in 3.3s, all five release-gate libraries resolving their real shas, and readiness no longer emitting
release validation source unconfirmed (current HEADs unknown)— it advances to the next condition in the same chain.Two things worth recording beyond the original plan:
timeoutis coreutils, so a macOS box withoutghwould have lost the fallback silently — or worse, runls-remoteunbounded inside the tick. It now resolvestimeout/gtimeoutonce and skips the fallback when neither exists, since a stalledls-remoteis a worse failure than the empty sha that is already today's answer.ghandgitare both stubbed in that test, so a real repo string bought nothing.Generated by Claude Code