Skip to content

Mobile workflow: wait for CI by being woken, and carry the mcp lane inline - #304

Merged
Jammy2211 merged 5 commits into
mainfrom
claude/mobile-workflow-review-tyv13y
Aug 27, 2026
Merged

Jammy2211 merged 5 commits into
mainfrom
claude/mobile-workflow-review-tyv13y

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

A pass over the mobile workflow, measured in this session rather than recalled. Companion PR in PyAutoMind carries the session/environment half and must merge after this one — Mind's firewall_gate.yml pins PyAutoBrain to main, and that PR touches scripts/repos_sync.py, the gate's path filter.

What changes

/prm waits by being woken, not by polling. Step 3 polled every ~90s, which on mobile is a turn — and a context re-read — per poll, for as long as CI runs. Where the harness exposes subscribe_pr_activity, the run subscribes once and ends the turn; the check-suite rollup wakes it. Two things are written down rather than left to be rediscovered: webhooks are best-effort and a successful rollup is the event most likely to go missing (hence the send_later check-in), and an event is a reason to re-judge from step 2, never evidence of green. Step 4 drops the subscription once the PR reads MERGED, so it cannot outlive the run.

The mcp lane is inline, so a mobile close-out reads one page. /prm is ~4k words of gh mechanics; a run without gh loaded those and GITHUB_ACCESS.md, then translated step by step — paying twice for what is now the common surface. The close-out's GitHub calls are few and stable, so they are named per step, including two that are traps rather than lookups:

  • actions_list list_workflow_runs has no head_sha filter (workflow_runs_filter is actor/branch/event/status only) — filter by branch and match head_sha yourself, or judge a stale run green.
  • issue_write update with state: closed and no state_reason leaves the issue reading "closed as not planned".

A shallow clone makes the merge proof lie. Close-out step 1 proves each branch merged with merge-base --is-ancestor. This session's clones arrived shallow (PyAutoMind at 78 of 4478 commits), and that command answers "not an ancestor" for a commit whose ancestry is merely absent — so a merged branch reads UNMERGED and the close-out stops on nothing. Named at the step that acts on the answer, with git rev-parse --is-shallow-repository as the check.

The remote-session block is now generated from PyAutoMind/policy/remote_sessions.md (the generator and its drift check are in the Mind PR). Content is unchanged apart from losing this repo's test count and timings, which rot.

Validation

561 tests green, ruff clean on the files touched. The three new guards in tests/test_gh_surface.py were each confirmed to FAIL against the pre-fix tree before being trusted.


Generated by Claude Code

claude added 5 commits August 27, 2026 17:59
/prm step 3 polled every ~90s, which on mobile is one turn — and one context
re-read — per poll, for as long as CI runs. This harness can be woken instead:
subscribe_pr_activity delivers the check-suite rollup as an event, so the wait
costs one turn per event and the phone can be put down between them.

The wake path is offered first where the tools exist; the poll stays for a
local CLI, which has no wake mechanism. Two details are load-bearing and
written down rather than left to be rediscovered: webhooks are best-effort and
a *successful* rollup is the event most likely to go missing (hence the
send_later check-in), and an event is a reason to re-judge from step 2, never
evidence of green.

Step 4 now drops the subscription once the PR reads MERGED, so a live
subscription cannot outlive the run and wake later sessions.

GITHUB_ACCESS.md carries the mapping row: this is the one operation where the
MCP surface beats gh rather than merely matching it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016c1SLkLDW6aEZCVf95XXeu
The remote-session block told a session to bootstrap if pytest misbehaved. That
trigger stopped firing: measured 2026-08-27, the container ships Python 3.12
with pytest, mypy, ruff and flake8 on it, so the session looks correct while
`pytest -n auto` still dies on `unrecognized arguments: -n` — which reads like
a bad flag, not a stale environment.

Reordered so the bootstrap comes before the parallel-test line it supplies
xdist for. The probe defect behind it is fixed in PyAutoMind.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016c1SLkLDW6aEZCVf95XXeu
Close-out step 1 proves each branch merged with `merge-base --is-ancestor`. A
remote session clones shallow (measured 2026-08-27: PyAutoMind at 78 of 4478
commits), and that command reports "not an ancestor" for a commit whose
ancestry is merely absent — so a merged branch reads UNMERGED and the close-out
stops on nothing.

The bootstrap unshallows; the reference now says so at the step that acts on
the answer, with `git rev-parse --is-shallow-repository` as the check for a
session that skipped it. Same line added to the always-loaded remote-session
block, which previously named only the pytest consequences.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016c1SLkLDW6aEZCVf95XXeu
/prm is ~4k words of gh mechanics. A run without gh loaded those AND
GITHUB_ACCESS.md's mapping table, then translated step by step — paying twice
for the surface that is now the common one.

The close-out's GitHub calls are few and stable, so they are named inline: one
row per step, with the parameters a run would otherwise re-derive. Two of them
are traps rather than lookups, and cost turns:

- `actions_list list_workflow_runs` has NO head_sha filter — workflow_runs_filter
  is actor/branch/event/status only. Filter by branch and match head_sha
  yourself, or judge a stale run green.
- `issue_write update` with state closed and no state_reason leaves the issue
  reading "closed as not planned".

GITHUB_ACCESS.md stays the index for everything else; it is no longer a
required second read for this command.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016c1SLkLDW6aEZCVf95XXeu
The block is now single-sourced in PyAutoMind/policy/remote_sessions.md and
written here by repos_sync.py --write, with a drift check. Content is
unchanged apart from losing this repo's test count and timings, which rot and
now live in the commit record instead.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016c1SLkLDW6aEZCVf95XXeu
@Jammy2211
Jammy2211 merged commit 7be4bd6 into main Aug 27, 2026
2 checks passed
@Jammy2211
Jammy2211 deleted the claude/mobile-workflow-review-tyv13y branch August 27, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants