Skip to content

Dependency-gate guard cannot distinguish PyPCAP from PCAP_CT, so a wrong install is a false pass #762

Closed

Description

@JarryShaw

Describe the bug

tests/_dependency_gates.py's liveness guard cannot tell PyPCAP from PCAP_CT, so a CI job
installing one while reaching the other's gate is reported as satisfied rather than as a gap.
Both distributions install a top-level pcap module, and extras_providing() resolves either
import name to both extras.

Reproduction

import _dependency_gates as g
print(sorted(g.extras_providing('pcap')))        # ['PCAP_CT', 'PyPCAP']
print(sorted(g.extras_providing('pcap._pcap')))  # ['PCAP_CT', 'PyPCAP']

Doctoring one install line each way, against the real guard:

doctored job reaches guard says unexplained gaps workflow-wide
pypcap-parity installs PCAP_CT 4 HAS_PYPCAP gates no gap 0
engine-tests installs PyPCAP 1 HAS_PCAP_CT gate no gap 0

It is blind in both directions. Liveness still passes in both worlds because HAS_PYPCAP's
exclusion lists integration+gate, which are real gaps — so the wrong non-gap is never examined.

Expected behavior

A job installing PCAP_CT should be reported as not satisfying HAS_PYPCAP, and vice versa.

Additional context

The conflation is not at the flag level. flag_requirements() resolves them apart correctly —
('tests/foundation/engines/test_new_engine_parity_runtime.py', 'HAS_PYPCAP') -> {'pcap'} and
('tests/foundation/engines/test_pcap_ct_engine.py', 'HAS_PCAP_CT') -> {'pcap._pcap'}. It is
extras_providing() one level down that collapses both.

Proposed fix, same shape as the existing machinery and no per-distribution model needed: assert that
every (job, gate) pair deemed satisfied is satisfied through an import name with exactly one
providing extra, else require an explicit allowlist entry. That fails loudly on both rows above.

Found while cross-reviewing #755; the guard itself landed in #745.

Activity

  1. added
    bugIssues reporting a defect (set by the bug report template; a default, not an assessment)
    testPull requests that add or correct tests (test: subject prefix)
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Sep 25, 2026
  2. JarryShaw commented on Sep 25, 2026

    @JarryShaw
    OwnerAuthor

    Being fixed in #755 rather than in its own PR: #755 is what adds the two jobs (engine-tests, pypcap-parity) whose gates this falsely clears, and it already owns tests/_dependency_gates.py, so a separate PR would only contend on the same file.

  3. added 5 commits that reference this issue on Sep 25, 2026
    f172874
    e902ede
    4aa44ae
    d242c86
    01f4566
  4. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Sep 25, 2026
  5. added this to the 1.5 milestone on Oct 6, 2026
  6. moved this to Done in PyPCAPKiton Oct 6, 2026
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

    bugIssues reporting a defect (set by the bug report template; a default, not an assessment)testPull requests that add or correct tests (test: subject prefix)

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions