Skip to content

fix(devtools): stop test ownership from overcounting package imports #608

Closed as not planned

Description

@Sinity

Problem

devtools verify-test-ownership can overcount broad package imports as unit-test ownership for every descendant module.

Evidence from current master:

  • devtools verify-test-ownership --json reports production_modules: 689 and covered: 771. A per-module ownership gate should not be able to cover more modules than exist.
  • devtools/verify_test_ownership.py resolves imports with this descendant rule:
    • if a test imports imp, every production module whose dotted name starts with imp + "." is counted as covered.
  • A broad import such as from devtools import verify is parsed as importing devtools, which then marks all devtools.* modules as covered.
  • tests/unit/devtools/test_verify_test_ownership.py checks that the committed manifest passes, but does not include a regression proving package imports cannot cover unrelated descendants.

This makes the gate a false-assurance mechanism: it can say every production module has an importing unit test even when a package/facade import is doing most of the work.

Acceptance criteria

  • Make ownership matching exact by default: importing a package or facade does not cover all descendants.
  • If facade ownership is desired, declare it explicitly in docs/plans/test-ownership.yaml or another manifest with a bounded path/prefix and reason.
  • covered in JSON output cannot exceed production_modules.
  • Add regression tests where from devtools import verify or import polylogue does not cover unrelated modules.
  • Re-run devtools verify-test-ownership --json and address any newly uncovered modules honestly.

Ref #604

Activity

  1. added
    type:fix
    theme:verifiability
    area:devtools
    on May 1, 2026
  2. Sinity commented on May 1, 2026

    @Sinity
    OwnerAuthor

    Superseded by #590. I consolidated this finding into the composite issue so the work can be handled as one coherent slice instead of as a tiny standalone ticket. The original evidence remains available in this issue history.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:devtoolsarea:qatheme:verifiabilitytool:codextype:fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions