Skip to content

[codex] fix poetry worktree environment setup#1

Merged
m24927605 merged 1 commit intomainfrom
codex/fix-poetry-worktree-env
May 5, 2026
Merged

[codex] fix poetry worktree environment setup#1
m24927605 merged 1 commit intomainfrom
codex/fix-poetry-worktree-env

Conversation

@m24927605
Copy link
Copy Markdown
Owner

Summary

Fix AIT attempt workspace provisioning for Python/Poetry projects that use local relative path dependencies.

The root cause was that AIT creates attempt worktrees under .ait/workspaces/<attempt>, so Poetry dependencies like ../repo-b no longer resolve to the original sibling repository layout. The new provisioning step detects Poetry local path dependencies after git worktree add, repairs valid source-layout paths with AIT-owned symlinks, creates a worktree-local Poetry virtualenv, and writes VS Code interpreter settings that point at the usable environment.

Changes

  • Add Python/Poetry environment provisioning for attempt worktrees.
  • Repair valid relative Poetry path dependencies without editing pyproject.toml.
  • Run poetry check and poetry install during workspace setup.
  • Write worktree-local .vscode/settings.json with python.defaultInterpreterPath.
  • Exclude .venv/, .vscode/, and poetry.toml from the worktree Git index via local excludes.
  • Record AIT-created symlinks in metadata and clean them up when the workspace is removed.
  • Add regression tests for sibling path dependency resolution, interpreter detection, local ignores, cleanup, and missing path dependency failure.

Validation

  • PYTHONPATH=src python3.14 tests/test_workspace.py
  • PYTHONPATH=src python3.14 tests/test_app_flow.py
  • PYTHONPATH=src python3.14 -m compileall -q src/ait/python_env.py src/ait/workspace.py

Deploy

No docs or package release files changed. This branch does not trigger the GitHub Pages deploy workflow; deployment will occur through the normal main-branch workflow after merge if applicable.

@m24927605 m24927605 merged commit f469c0f into main May 5, 2026
2 checks passed
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