audit: add pyauto-audit shell function and drop rejected prompt 04 - #12
Merged
Conversation
`scripts/pyauto_audit.sh` defines a `pyauto-audit` shell function (sourced
from ~/.bashrc next to pyauto_status.sh) that scans ~/Code/PyAutoLabs/
for state the dashboard can't show:
1. Top-level directories with no .git (skip "." and "z_" prefixes
for hidden / personal-staging dirs).
2. Stashes older than PYAUTO_AUDIT_STASH_DAYS (default 14 days).
3. Local-only branches with no upstream and last commit older than
PYAUTO_AUDIT_BRANCH_DAYS (default 30 days).
Three sections, plain text, sections suppressed when empty, single
"clean" message when all clear. Always exits 0 — informational, the
user reads and decides. Run on demand. PYAUTO_AUDIT_ROOT,
PYAUTO_AUDIT_STASH_DAYS, PYAUTO_AUDIT_BRANCH_DAYS env-var overrides.
Re-scoped from autoprompt 06 (the heavyweight monthly cron audit
spec). The dashboard's `b` flag (shipped in #10) covers prompt 06's
findings #1 + #2; prompts 02 + 07 cover #4 + #7. Only the genuinely
structural checks remain.
Also deletes autoprompt/04_source_of_truth_rule.md — already-rejected
during this sweep. The pyauto-status BEHIND counts and prompt 03's
history-rewrite guard cover the failure modes that 04 was trying to
address; keeping a rejected prompt in autoprompt/ is just noise.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Jammy2211
pushed a commit
that referenced
this pull request
May 28, 2026
Jammy2211
pushed a commit
that referenced
this pull request
Jul 17, 2026
Jammy2211
pushed a commit
that referenced
this pull request
Jul 17, 2026
Jammy2211
pushed a commit
that referenced
this pull request
Sep 4, 2026
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013HsZA1ufn3msgPiDFxEXa6
Jammy2211
pushed a commit
that referenced
this pull request
Sep 4, 2026
…ge order for all three phases Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013HsZA1ufn3msgPiDFxEXa6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scripts/pyauto_audit.shdefining apyauto-auditshell function: 3-section structural audit (non-git dirs / old stashes / abandoned branches). On-demand, no cron, no severity tags, no snooze file.bad/,path/,priors/,scripts/), 3 old stashes (PyAutoFit / PyAutoGalaxy / PyAutoLens, all >20 days), 1 abandoned branch (PyAutoFit/feature/ep, last commit 2026-02-18).autoprompt/04_source_of_truth_rule.md— already-rejected; the dashboard + prompt 03's history guard cover the failure modes.Closes #11.
Test plan
PYAUTO_AUDIT_BRANCH_DAYS=20lowers threshold and surfaces 3 abandoned branches (including currently-on-iteuclid_strong_lens_modeling_pipeline/fix/extra-galaxies-gui-vis-index).PYAUTO_AUDIT_STASH_DAYS=999suppresses the stash section.PYAUTO_AUDIT_ROOT=<empty-tmpdir>printspyauto-audit: clean (no findings under <dir>).Bug found and fixed during smoke testing
First implementation used
IFS=\$'\t'to splitfor-each-ref --format='...%09...'output. Bash treats consecutive whitespace IFS chars as one delimiter, which collapsed the empty-upstream column into the timestamp column for local-only branches. Switched to|delimiter (matching Section 2's stash format) —for-each-refformatting allows arbitrary separators, and git refnames disallow|.🤖 Generated with Claude Code