Repository navigation
feat(coverage): reconstruct exact-base uv workspaces without local-package leakage #750
Description
Buyer-visible problem
The central coverage sandbox can now export a nested standalone pyproject.toml/uv.lock pair, but a true uv workspace may require member project metadata in addition to the root files. Reconstructing only the root pair can make a valid modular repository fail its central review, while silently ignoring missing members would produce incomplete dependency evidence.
This is a central MSA concern: each product and service must remain independently usable, while the organization review plane must also understand a repository that composes several standalone modules through a uv workspace.
Required design
- Read the root
uv.lock, rootpyproject.toml, and every workspace member/exclusion only from one validated 40-character base commit SHA. - Parse TOML with Python
tomllib; do not execute project code or import project packages. - Expand workspace member patterns against the exact base tree with anchored POSIX semantics.
- Reject absolute paths,
.., control characters, unsafe glob constructs, symlinks, submodules, duplicate members, and paths outside the workspace root. - Materialize only the metadata required for
uv export; document every copied file class. - Use the pinned, checksum-verified Astral uv executable and the isolated environment defined by fix(coverage): materialize trusted uv lock dependencies #743.
- Export the complete third-party closure for all workspace members with reviewed
--all-packagessemantics while omitting the root and all local workspace packages (--no-emit-workspaceor an equivalently verified contract). - Keep
--frozen,--offline, cacheless execution, dotenv suppression, and managed-Python-download prohibition. - Reject nonempty output unless every logical line is an exact package
==pin with complete SHA-256 hashes. - Fail closed on missing required member metadata, stale workspace locks, unsupported local source forms, or exporter errors.
Realistic verification
- Standalone nested project remains supported and unchanged.
- Root project plus two workspace members exports the union of third-party dependencies exactly once.
- Virtual workspace without a root
[project]exports all members. - Excluded members are not reconstructed or exported.
- Member globs cannot escape the root or traverse symlinks.
- Local workspace packages never appear as path/direct/editable requirements.
- A missing member
pyproject.tomlfails before coverage execution. - An actual BandScope-style nested analysis service remains a passing integration fixture.
- A true multi-member temporary uv workspace is exported with the pinned real uv binary in a bounded integration test.
- Production statement and branch coverage remain 100%; all production symbols retain docstrings.
Documentation and standards
Record the design in docs/doctoring/ with APA 7th references to current Astral uv workspace/export documentation and the approved SLSA 1.2 specification. State the precise conformance boundary; do not claim a SLSA level solely from these controls.
Sequencing
Land the standalone uv materialization baseline in #743 first. Implement this workspace slice as a separate reviewed PR so the broader metadata surface cannot dilute the standalone trust boundary.
Activity