Repository navigation
maintenance: resolve the workspace root through the shared contract - #283
Merged
Merged
Conversation
board.py's `_workspace_root()` was a byte-identical twin of Heart's and carried the same bug: it fell back to ~/Code, not ~/Code/PyAutoLabs, so `root/"PyAutoBrain"` named a path that does not exist. It was masked only because it is the last candidate in a chain an earlier candidate satisfies. run_all.py and pre_build.sh derived the root by fixed depth. autohands/_workspace.py is now the single door, reaching PyAutoBrain's resolver the same way board.theme() already finds the Brain and degrading the same way when none is in reach — so importing autohands still never requires a Brain. pre_build.sh adopts it only when the resolver is actually present, because its test harness runs the real script in a throwaway base. ADMIN_JAMMY in bin/autohands had no consumer anywhere in the repo; admin_jammy is not part of the PyAutoLabs ecosystem. Removing it left PYAUTOBASE with no consumer either (the file is executed, never sourced), so both are gone. Hands has no grading path — board.py's root is theme discovery and run_all.py runs the tree you are in — so unlike Heart it needs no canonical/workspace split. Suite 460 passed (baseline 460). Part of PyAutoBrain#391 (phase 1a). No directory layout changes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0161NLKVzbBMzhaBfjpGogor
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.
Part of PyAutoLabs/PyAutoBrain#391 (phase 1a). Changes no directory layout. Companion to PyAutoLabs/PyAutoBrain#392 and PyAutoLabs/PyAutoHeart#232; mergeable in any order.
What was wrong
autohands/board.py:57was a byte-identical twin of Heart's_workspace_root()and carried the same bug: it fell back to~/Code, not~/Code/PyAutoLabs, soroot/"PyAutoBrain"named a path that does not exist. Masked only because it is the last candidate in a chain an earlier candidate satisfies:run_all.py:37andpre_build.sh:20derived the root by fixed depth.The change
autohands/_workspace.pyis the single door. It reaches PyAutoBrain's resolver the wayboard.theme()already finds the Brain, and degrades the same way when none is in reach — so importingautohandsstill never requires a Brain present. It loads the module by file path rather thansys.path.insert, so importing Hands cannot change what any other import in the process resolves to.pre_build.shadopts it only when the resolver is actually present: its test harness runs the real script in a throwaway base with an inherited environment, so the env-honouring path must not fire there, and a bare PyAutoHands checkout keeps working.Hands needs no canonical/workspace split, unlike Heart:
board.py's root is theme discovery andrun_all.pyruns the tree you are in, so there is no grading path whose verdict could be relaxed by cwd.admin_jammy
ADMIN_JAMMYinbin/autohands:16had no consumer anywhere in the repo — only the assignment. admin_jammy is not part of the PyAutoLabs ecosystem, so it is removed. That leftPYAUTOBASEon line 14 with no consumer either (the file is executed, never sourced), so both are gone.autohands helpstill renders.Verification
pytest tests→ 460 passed (baseline 460).board._workspace_root(),board.theme(),run_all.PYAUTOBASE,bin/autohands helpandpre_build.shall exercised live;pre_build.shreaches its clean-main guard, i.e. it resolved$PYAUTOBASE/PyAutoHands.🤖 Generated with Claude Code
https://claude.ai/code/session_0161NLKVzbBMzhaBfjpGogor