Skip to content

fix: Brain tests not hermetic against a task worktree's activate.sh - #678

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/brain-tests-hermetic-worktree-env
Nov 18, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/brain-tests-hermetic-worktree-env

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Summary

A task worktree's activate.sh (written by bin/worktree.sh) exports PYAUTO_TASK, PYAUTO_ROOT, PYAUTO_BRAIN, PYAUTO_MIND, PYAUTO_HEART and PYAUTO_HANDS. Resolvers honour these as hard overrides; for example, _hygiene_repos.candidate_map_paths does for PYAUTO_MIND. So test_grouped_organ_consumers::test_hygiene_map_and_heart_board_find_grouped_checkouts failed locally after /start_library's activation step, while CI, which sets none of them, stayed green. The #676 ship needed env -u PYAUTO_MIND to get past it.

A new autouse fixture in tests/conftest.py clears those variables, so every test starts from CI's environment. A test that needs one still sets it itself.

Closes #677

API Changes

None — test-suite isolation only.
See full details below.

Full API Changes (for automation & release notes)

Added

  • tests/conftest.py::_no_task_worktree_paths — autouse fixture (tests only).

Migration

  • None.

Test Plan

  • Full suite with the task worktree's activate.sh sourced: 2370 passed, 1 skipped (previously 1 failed).
  • Full suite in a plain environment: 2370 passed, 1 skipped.
  • Tenant firewall (organ code): OK.

Readiness

Heart dev-ship gate (PyAutoBrain): GREEN.

Merge mode: auto-merge on green (declared Consequence: notify).

🤖 Generated with Claude Code

…metic

A task worktree's activate.sh exports PYAUTO_ROOT/BRAIN/MIND/HEART/HANDS/TASK
and resolvers honour them as hard overrides, so the suite failed locally
(test_grouped_organ_consumers) while CI, which sets none, stayed green.
An autouse fixture now starts every test from CI's environment.

Closes #677

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit a3f4ac4 into main Nov 18, 2026
2 checks passed
@Jammy2211
Jammy2211 deleted the feature/brain-tests-hermetic-worktree-env branch November 18, 2026 10:20
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: Brain tests not hermetic against a task worktree's activate.sh

1 participant