You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: run activation discovery from Base runtime - #2611
Real bleach-style interactive runtime reproduction with Click absent from the project venv
Root cause
basectl setup installs Click in Base virtualenv, not every project virtualenv. Runtime startup was invoking activation discovery through the project Python, so a correctly isolated project environment without Click produced the misleading base_cli import error.
Workaround addresses the symptom, not the root cause (lib/bash/runtime/bashrc ~line 141): the fix bolts on --project base --workspace <root> to force activation discovery through a different code path, instead of fixing the actual cause. bin/base-wrapper:114 unconditionally sets BASE_PROJECT="$project" (here "base") and exports it; project_discovery.py:72's resolve_active_project() checks os.environ.get("BASE_PROJECT") != project_name where project_name is the actual project being activated (e.g. "demo") - confirmed directly, this mismatch means the cheap, single-manifest-read shortcut is skipped unconditionally for every activation that mixes --project base with a different logical project name. A more targeted fix would be in base-wrapper itself - e.g. only setting BASE_PROJECT when unset, or using a separate venv-selection variable - rather than forcing every caller down the slow path and leaving the broken shortcut in place for the next caller that hits the same combination.
New workspace-wide dependency for a single-project operation (lib/bash/runtime/bashrc ~line 142): forcing discovery through --workspace $BASE_PROJECT_ROOT/.. makes basectl activate <project> depend on every sibling project's manifest in the workspace being valid and uniquely named, not just the project being activated. activation_sources_project_command -> resolve_named_project -> find_named_project now always takes the workspace is not None path, which calls discover_projects_cached() -> read_project() on every sibling manifest, then validate_unique_project_names() across all of them. If any unrelated sibling project has a malformed manifest or a name collision, activation of the working project fails with "Unable to resolve project activation scripts," even though the project actually being activated is fine. The previous direct BASE_PROJECT_MANIFEST read only ever looked at the one project being activated and was immune to problems elsewhere in the workspace.
Weakened test assertion (cli/bash/commands/basectl/tests/runtime-shell.bats ~line 9): the OR'd argument-position check added to the four pre-existing activation-source tests accepts both the old (now-unreachable) call shape and the new one, so these four tests no longer pin down the exact argv base_projects is invoked with. A future accidental regression that shifts the invocation shape back toward the old form would still pass these four tests - only the newly-added fifth test pins the current shape exactly.
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
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.
Summary
Fixes #2610
Validation
Root cause
basectl setup installs Click in Base virtualenv, not every project virtualenv. Runtime startup was invoking activation discovery through the project Python, so a correctly isolated project environment without Click produced the misleading base_cli import error.