Skip to content

maintenance: resolve the workspace root through the shared contract - #283

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/workspace-location-contracts
Sep 18, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/workspace-location-contracts

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

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:57 was a byte-identical twin of Heart's _workspace_root() and carried the same bug: it fell back to ~/Code, not ~/Code/PyAutoLabs, so root/"PyAutoBrain" named a path that does not exist. Masked only because it is the last candidate in a chain an earlier candidate satisfies:

_workspace_root() -> /home/jammy/Code
  root/"PyAutoBrain" -> /home/jammy/Code/PyAutoBrain   exists: False

run_all.py:37 and pre_build.sh:20 derived the root by fixed depth.

The change

autohands/_workspace.py is the single door. It reaches PyAutoBrain's resolver the way board.theme() already finds the Brain, and degrades the same way when none is in reach — so importing autohands still never requires a Brain present. It loads the module by file path rather than sys.path.insert, so importing Hands cannot change what any other import in the process resolves to.

pre_build.sh adopts 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 and run_all.py runs the tree you are in, so there is no grading path whose verdict could be relaxed by cwd.

admin_jammy

ADMIN_JAMMY in bin/autohands:16 had no consumer anywhere in the repo — only the assignment. admin_jammy is not part of the PyAutoLabs ecosystem, so it is removed. That left PYAUTOBASE on line 14 with no consumer either (the file is executed, never sourced), so both are gone. autohands help still renders.

Verification

pytest tests → 460 passed (baseline 460). board._workspace_root(), board.theme(), run_all.PYAUTOBASE, bin/autohands help and pre_build.sh all exercised live; pre_build.sh reaches its clean-main guard, i.e. it resolved $PYAUTOBASE/PyAutoHands.

🤖 Generated with Claude Code

https://claude.ai/code/session_0161NLKVzbBMzhaBfjpGogor

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
@Jammy2211
Jammy2211 merged commit 41ad5f6 into main Sep 18, 2026
3 checks passed
@Jammy2211
Jammy2211 deleted the feature/workspace-location-contracts branch September 18, 2026 19:50
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.

1 participant