Goal
Make the base_cli test suite valid and meaningful both in the monorepo checkout and against an installed distribution.
Background
The supplied review found checkout-only tests that calculate Path(__file__).resolve().parents[4] and then read STANDARDS.md, scan cli/python, or invoke shell scripts under lib/shell and lib/bash. The current source confirms this pattern in test_python_standards.py, test_public_command_lifecycle.py, test_exit_code_adoption.py, and two protocol tests; other tests also reference checkout paths. Those tests will fail or become misleading when the package is installed from a wheel.
Depends on #1742 for the package artifact contract.
Scope
- Audit all
lib/python/base_cli/tests for parent-repository and shell-checkout assumptions, not only the five findings named in the review.
- Separate monorepo contract tests from package unit/integration tests.
- Move checkout-only tests to the top-level repository test suite, or skip them in an installed-package context with an explicit reason while keeping them active in checkout CI.
- Replace package tests' repository-root dependencies with package-local fixtures or stable subprocess fixtures.
- Ensure the installed wheel does not accidentally ship the monorepo-only test suite; if package tests remain supported, provide a package-level pytest configuration and documented invocation.
- Add a clean-environment wheel-install test so missing checkout assets cannot produce a false-green result.
Acceptance Criteria
- Running the supported installed-package test command in a clean temporary environment does not attempt to open
STANDARDS.md, scan cli/python, or invoke unavailable repository shell scripts.
- Checkout-only standards/lifecycle/exit-code tests still run in repository CI and fail when their Base contracts regress.
- Protocol tests validate the Python implementation without requiring shell files that are not part of the distribution, or are clearly classified as checkout integration tests.
- Wheel contents and test discovery are covered by an automated assertion.
- The source-checkout suite and installed-wheel smoke suite both pass without inherited monorepo paths.
Validation
- Run the focused
base_cli tests from the checkout.
- Build and install the wheel in a fresh virtual environment, then run the package-supported test/smoke command from outside the repository.
- Confirm the checkout-only tests remain included in the normal repository test gate.
git diff --check.
Non-Goals
- Do not weaken checkout contract tests by making them silently pass when required source files are missing.
- Do not duplicate the full monorepo test suite inside the published wheel.
- Do not change packaging metadata or publication credentials in this issue.
Project Fields
- Priority: P1
- Size: M
- Area: Packaging
- Initiative: Adoption Polish
Agent Assignment
Human first; this defines the boundary between repository validation and package validation.
Goal
Make the
base_clitest suite valid and meaningful both in the monorepo checkout and against an installed distribution.Background
The supplied review found checkout-only tests that calculate
Path(__file__).resolve().parents[4]and then readSTANDARDS.md, scancli/python, or invoke shell scripts underlib/shellandlib/bash. The current source confirms this pattern intest_python_standards.py,test_public_command_lifecycle.py,test_exit_code_adoption.py, and two protocol tests; other tests also reference checkout paths. Those tests will fail or become misleading when the package is installed from a wheel.Depends on #1742 for the package artifact contract.
Scope
lib/python/base_cli/testsfor parent-repository and shell-checkout assumptions, not only the five findings named in the review.Acceptance Criteria
STANDARDS.md, scancli/python, or invoke unavailable repository shell scripts.Validation
base_clitests from the checkout.git diff --check.Non-Goals
Project Fields
Agent Assignment
Human first; this defines the boundary between repository validation and package validation.