Skip to content

fix: clean_slate misses grouped repos; tidy recommends deleting claimed branches - #587

Merged
Jammy2211 merged 2 commits into
mainfrom
feature/brain-hygiene-cleanup-bugs
Nov 5, 2026
Merged

Jammy2211 merged 2 commits into
mainfrom
feature/brain-hygiene-cleanup-bugs

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Summary

This fixes two hygiene remedies that disagreed with the scan recommending them. There is one commit for each.

1. clean_slate.sh missed grouped repos. It enumerated repos with for dir in */ at the workspace root. The workspace groups repos (fit/PyAutoFit, organs/PyAutoNerves, ...), so every scope silently found nothing; on 2026-11-04, --packaging reported nothing while 10 egg-info/build directories existed.

  • It now iterates pyauto_repo_list from bin/_repo_paths.sh. $repo stays the root-relative path, and the name-keyed lists (is_dataset_repo, is_packaging_repo) match on the basename.
  • When nothing resolves, it now exits 1 with "no checkouts resolved", instead of reproducing the old silent no-op.

2. hygiene tidy recommended deleting live task branches. enumerate_condemn_candidates spared only the canonical checkout's HEAD. A task branch lives in its own worktree, and before its first commit it reads merged=yes, so tidy recommended a straight delete of claimed branches (feature/magnification-maps-wiring).

  • It now skips every branch checked out in any worktree of the repo (git worktree list --porcelain).
  • It also skips every branch claimed in PyAutoMind/active.md, read through the worktree guard's own worktree_list_claimed.

Closes #586.

Tests

  • test_packaging_reaches_repos_grouped_under_a_family_directory and test_no_resolved_checkout_is_an_error_not_a_silent_no_op.
  • test_tidy_never_condemns_a_branch_held_by_another_worktree and test_tidy_never_condemns_a_branch_claimed_in_the_registry. In both, an unprotected spent branch is still condemned.
  • Control check: all 4 new tests fail against the old code.
  • test_provenance_helper_failure_aborts_the_sweep copies clean_slate.sh alone, so its fixture now symlinks _repo_paths.sh beside the copy.
  • Suites: hygiene, clean_slate and worktree tests give 142 passed. Tenant firewall: OK.
  • Live tree:
    • DRY_RUN=1 clean_slate.sh --packaging now lists the grouped library build products.
    • hygiene tidy goes from 25 to 15 candidates. The dropped 10 are all live-task or worktree-held branches, such as magnification-maps-wiring and pyautodna-stack-management.

🤖 Generated with Claude Code

Jammy2211 and others added 2 commits November 5, 2026 12:24
…lver (#586)

for dir in */ at the workspace root saw none of the grouped repos (fit/PyAutoFit, organs/PyAutoNerves, ...), so every scope silently found nothing. Iterate pyauto_repo_list, match the name-keyed lists on the basename, and fail loudly when nothing resolves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…anches (#586)

enumerate_condemn_candidates spared only the canonical checkout's HEAD. A task branch lives in its own worktree, and with no commits it reads merged=yes, so tidy recommended a straight delete of live task branches (feature/magnification-maps-wiring on 2026-11-04). Skip every branch checked out in any worktree of the repo and every branch claimed in PyAutoMind/active.md (worktree_list_claimed).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit 1d53b2a into main Nov 5, 2026
2 checks passed
@Jammy2211
Jammy2211 deleted the feature/brain-hygiene-cleanup-bugs branch November 5, 2026 12:33
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.

fix: clean_slate misses grouped repos; tidy recommends deleting claimed branches

1 participant