Repository navigation
Description
Overview
A two-keystroke command that prints the sync state of every PyAuto repo against
its origin tracking branch. Catches commit drift early — the 2026-04-27 audit
found 12 repos up to 101 commits behind origin and only noticed by accident.
Wires into the PyAuto / PyAutoGPU / PyAutoNoJAX venv activation aliases
so the dashboard prints automatically every time the user enters the workspace.
Plan
- Create
PyAutoPrompt/scripts/pyauto_status.shdefining apyauto-statusshell function - The function dynamically discovers all git repos under
~/Code/PyAutoLabs/, fetches in parallel, and prints one line per repo: branch, upstream, behind/ahead counts, dirty count, flag glyphs - Handle the failure modes the audit surfaced: missing upstream →
NONEflag, renamed default branch → use@{u}not hard-codedorigin/main, non-git directories → skip cleanly, fetch failures → don't crash the sweep - Source the script from
~/.bashrcso the function is available in every shell - Modify the
PyAuto,PyAutoGPU,PyAutoNoJAXshell functions in~/.bashrcto callpyauto-statusat the end so the dashboard prints automatically after venv activation - Optionally extend
PyAutoPrompt/scripts/status.shwith a--reposflag that delegates topyauto-status - Verify acceptance: full sweep <10s, all repos one screen, non-default branches visible, no-upstream flagged
Detailed implementation plan
Affected Repositories
- PyAutoPrompt (primary — only tracked changes)
Plus a manual append/edit to ~/.bashrc (personal env, no PR).
Work Classification
Library (treated as such for the standard /start_library → worktree → /ship_library flow, even though PyAutoPrompt is workflow tooling rather than a runtime library).
Branch Survey
| Repository | Current Branch | Dirty? |
|---|---|---|
| ./PyAutoPrompt | main | 1 modified + 1 untracked (both pre-existing, unrelated — weak/1_simulator.md and autolens/point_simulator_errors.md.txt) |
Suggested branch: feature/pyauto-status-shell
Worktree root: ~/Code/PyAutoLabs-wt/pyauto-status-shell/ (created later by /start_library)
Implementation Steps
-
PyAutoPrompt/scripts/pyauto_status.sh(new) — sourceable script definingpyauto-status().- Discovery:
find ~/Code/PyAutoLabs -maxdepth 2 \( -name .git -type d -o -name .git -type f \) -printf '%h\n' | sort(the-type fclause picks up linked worktrees, whose.gitis a file). - Parallel fetch: spawn
git -C "$repo" fetch --quiet origin &per repo, thenwait. - Per repo collect: branch (
rev-parse --abbrev-ref HEAD, mark(detached)if literalHEAD), upstream (rev-parse --abbrev-ref @{u} 2>/dev/null→NONEif empty), behind/ahead (rev-list --left-right --count "$upstream"...HEAD), dirty count (status --porcelain | wc -l). - Print: header + per-repo row via
printfwith fixed columns. Flag glyphs:↓behind,↑ahead,*dirty,!no upstream or fetch failed. - Wrap each repo's collection in error handling so one bad repo doesn't kill the sweep.
- Discovery:
-
PyAutoPrompt/scripts/status.sh(edit) — add a--reposarg near the top of the script that sourcespyauto_status.shand runspyauto-status, then exits. Leave--fulland default behavior untouched. -
~/.bashrc(edit, personal env, no PR) — done after the PR merges:- Append a sourcing line so the function loads in every shell:
`bashPyAuto cross-repo sync status
[ -f ~/Code/PyAutoLabs/PyAutoPrompt/scripts/pyauto_status.sh ] &&
source ~/Code/PyAutoLabs/PyAutoPrompt/scripts/pyauto_status.sh
` - Edit the
PyAuto(),PyAutoGPU(),PyAutoNoJAX()functions to addpyauto-statusas the last line inside each. SkipPyAutoOld()(it targets/mnt/c/Users/Jammy/Code/PyAuto, not the labs root).
- Append a sourcing line so the function loads in every shell:
Key Files
PyAutoPrompt/scripts/pyauto_status.sh— new shell function (the bulk of the work).PyAutoPrompt/scripts/status.sh— extended with--reposflag.~/.bashrc— sourced once + venv aliases extended (out-of-PR personal config).
Acceptance Verification
time pyauto-statusfrom a fresh shell — assert wall-clock < 10s.- Verify all ~19 repos under
~/Code/PyAutoLabs/appear in the output. - Temporarily checkout a feature branch in one repo and re-run — confirm no auto-checkout, flag column shows
↑/*correctly. - Confirm a no-upstream repo (e.g.
autolens_workspace_developerper prompt 06) printsNONEand!flag. - Open a fresh shell, run
PyAuto— dashboard prints automatically right aftercd ~/Code/PyAutoLabs.
Naming clash to be aware of
There is already a /pyauto-status slash command in PyAutoPrompt/skills/pyauto-status/ that prints the workflow-registry dashboard (planned/active/complete tasks). The shell function reuses the name in the terminal namespace for git drift. Different surfaces, no collision, but worth noting in the README/docstring.
Out of scope
- Auto-pulling — handled by prompt 05's
/syncslash command later. - Pretty colors / TUI — plain text only.
Original Prompt
Click to expand starting prompt
Cross-repo sync status dashboard
⚠️ Caveat — drafted from a stale repo state. This prompt was drafted on 2026-04-27 during a forensic sweep that found local checkouts up to 101 commits behind origin. The trigger looked like a structural workflow flaw, but later analysis showed the drift was largely driven by stale local checkouts being edited withoutgit pullfirst, not by missing tooling. Now that PyAutoPrompt is the canonical source-of-truth andskills/install.shauto-discovers across both repos, some of the recommendations below may be over-engineered for the day-to-day case. Re-evaluate whether each measure is still warranted — the cheap habits (pull before edit, never rewrite history) buy most of the win.
Drift across PyAuto repos is currently invisible — there's no single command
that shows whether each library and workspace is in sync with origin/main.
The 2026-04-27 audit found 12 repos with up to 101 commits of behind-origin
state, and we only noticed because of an unrelated investigation. Catching it
early needs a dashboard that's two keystrokes away.
What to build
A shell function pyauto-status (loaded via ~/.bashrc or ~/.local/bin/)
that, for every git repo under ~/Code/PyAutoLabs/, prints:
- repo name
- current branch
- upstream tracking ref (or
NONEif missing — a real failure mode that hid
autolens_workspace_developerfor weeks) - behind / ahead counts vs
@{u} - dirty file count
- a single-glyph flag column:
↓for behind,↑for ahead,*for dirty
Implementation notes:
- Run
git fetch origin --quietper repo before counting (a stale dashboard is
worse than none). - Skip directories that aren't git repos cleanly (warn, don't crash).
- Use the upstream branch from
git rev-parse --abbrev-ref @{u}, not a
hardcodedorigin/main. PyAutoFit recently moved frommain_build→main
and a hardcoded version would have hidden that.
A working draft is included in
PyAutoPrompt/autoprompt/snippets/pyauto_status.sh (see file). Test it; tune the
column widths; either inline it into ~/.bashrc or symlink from ~/.local/bin/.
Acceptance
- Running
pyauto-statusfrom any directory shows all 12 repos in one screen. - A repo on a non-default branch is visible (don't auto-checkout
main). - A repo with no upstream is flagged, not silently skipped.
- The whole sweep finishes in well under 10 seconds (parallel-friendly fetch).
Out of scope
- Auto-pulling. This is a status command only — fixing drift is a separate
prompt (05_sync_slash_command.md). - Pretty colors / TUI. Plain text is faster to read and pipe.
Files touched
~/.bashrc(or~/.local/bin/pyauto-status+chmod +x)- Optionally:
PyAutoPrompt/scripts/status.shalready prints prompt-registry
counts; consider adding a--reposflag that delegates to this function.
Activity
prompt: route pyauto-status-shell (#2) → /start_library
feat: pyauto-status shell function for cross-repo drift dashboard (#3)
audit: add pyauto-audit shell function and drop rejected prompt 04 (#12)
prompt: autofit-assistant-birth ALL PHASES to PR-open (#2+#3); comple…
prompt: retire autofit-assistant-birth (merged #2+#3, issue closed) -…
prompt: finalise autofit-assistant-birth autonomy-log outcomes (#2 me…
prompt: autocti-assistant Phase 2 skills authored (#2 open), all vali…
prompt: autocti-assistant Phase 2 MERGED (#2); wiki-currency green, l…
prompt: record the euclid reproduction of the psf_weighted_data garbage
prompt: update stale autoconf package references in draft/ backlog
prompt: file issue for slam-base-driver (#2)
prompt: route slam-base-driver (#2) → start_workspace
complete: slam-base-driver
state: eclipse-catalogue-site PR #2 open