Skip to content

Scrub active project environment for explicit project setup #1368

Description

@codeforester

Problem

When running from an active Base project shell, basectl setup <other-project>
can inherit active-project environment such as BASE_PROJECT_VENV_DIR and route
the explicit target project to the wrong virtual environment.

During Ubuntu dogfooding, running from the active base shell:

basectl setup base-demo

failed because base-demo was evaluated against the base project venv:

Project virtual environment '/home/parallels/.base.d/base/.venv' uses Python 3.12,
but python.requires_python '3.13' selects Python 3.13.

The immediate manual workaround is to scrub active project variables:

env -u BASE_PROJECT -u BASE_PROJECT_ROOT -u BASE_PROJECT_MANIFEST -u BASE_PROJECT_VENV_DIR \
  basectl setup base-demo --recreate-venv

Base should do the safe thing automatically when the user passes an explicit
project name.

Desired Behavior

  • basectl setup <project>, check <project>, and doctor <project> should
    not reuse active-project env from a different project.
  • Explicit project setup should route to the explicit project's venv contract.
  • Existing override behavior should remain intentional: if users explicitly
    pass an override for the same target project, Base should preserve the
    supported override path.
  • Error messages should point at the target project, not the previously active
    shell project.

Acceptance Criteria

  • Add regression coverage for running basectl setup other-project while
    BASE_PROJECT, BASE_PROJECT_ROOT, BASE_PROJECT_MANIFEST, and
    BASE_PROJECT_VENV_DIR are set for a different project.
  • Confirm the fix covers setup and the read-only check/doctor paths where the
    same route helper is used.
  • Validate with focused shell/Python tests and the Base test gate.

Metadata

Metadata

Assignees

Labels

bugSomething is not workingtype:fix

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions