Skip to content

feat(coverage): reconstruct exact-base uv workspaces without local-package leakage #750

Description

@seonghobae

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, root pyproject.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-packages semantics while omitting the root and all local workspace packages (--no-emit-workspace or 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.toml fails 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions