Skip to content

test(structex): unique basename for gti receipt test to fix full-tree collection#8492

Merged
scarmani merged 1 commit into
mainfrom
structex/p2-pytest-collision
Jun 16, 2026
Merged

test(structex): unique basename for gti receipt test to fix full-tree collection#8492
scarmani merged 1 commit into
mainfrom
structex/p2-pytest-collision

Conversation

@scarmani

Copy link
Copy Markdown
Collaborator

What & why (HEALTH-5 #8262 — unblocks p2-docs scrutiny)

tests/gti/test_receipt.py (added by #7877, 2026-06-15) and the pre-existing
tests/heterogeneity/test_receipt.py share a basename, and neither directory
has a package __init__.py. Under pytest's default prepend import mode,
full-tree collection (pytest tests/, used by the smoke tier
scripts/test_tiers.sh smoke = pytest tests/ -m smoke) imports both as the
top-level module test_receipt and raises import file mismatch, so the
mission smoke gate is RED on origin/main.

Sibling dirs tests/gauntlet/ and tests/review/ (also test_receipt.py)
already have __init__.py and do not collide. The preferred __init__.py fix
is path-frozen: open PR #8460 already adds both tests/gti/__init__.py and
tests/heterogeneity/__init__.py (currently BLOCKED on aragora-merge-quorum),
and PR #8382 renames the heterogeneity side but is Tier-4 (parked for operator).
This PR takes the equivalent, path-freeze-clean route: rename the gti file to a
unique basename. Pure git mv, no test-body change.

Validation (fresh origin/main worktree)

  • Before: python3 -m pytest --collect-only tests/ -qrc=2, import file mismatch, 1 collection error.
  • After: python3 -m pytest --collect-only tests/ -qrc=0, 228930 collected, 0 errors.
  • AWS_…=/dev/null make test-smokerc=0 (Smoke tests passed).
  • PYTEST_BIN="python3 -m pytest" bash scripts/test_tiers.sh smokerc=0, 138 passed (matches clean-main baseline).
  • make lintrc=0.

Risk

Tier 0 (tests-only rename). No test bodies change. No CI/workflow/script
references the gti path (only tests/gauntlet/test_receipt.py is referenced, in
scripts/ci_core_suites.sh, which is untouched). Composes cleanly with #8460 /
#8382 if either later lands (disjoint files).

… collection

tests/gti/test_receipt.py (added by #7877) and the pre-existing
tests/heterogeneity/test_receipt.py shared a basename with no package
__init__.py in either dir, so pytest's default prepend-import full-tree
collection raised "import file mismatch", breaking `pytest tests/ -m smoke`
(the mission smoke gate). Rename the gti file to a unique basename so the two
modules no longer collide. Pure git mv; no test-body change.

Validation (fresh origin/main worktree):
  python3 -m pytest --collect-only tests/ -q          rc=2 -> rc=0 (0 errors)
  PYTEST_BIN="python3 -m pytest" scripts/test_tiers.sh smoke   rc=0 (138 passed)

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@scarmani scarmani marked this pull request as ready for review June 16, 2026 23:06
@scarmani scarmani requested a review from an0mium as a code owner June 16, 2026 23:06
@github-actions

Copy link
Copy Markdown
Contributor

Aragora Code Review

Advisory-only review. No issues found.

@scarmani

Copy link
Copy Markdown
Collaborator Author

Claude independent model review

Reviewer: claude (anthropic) — independent adversarial model review via the Aragora Claude reviewer, grounded on the exact PR head.
Head: 7087e87 (7087e87), committed 2026-06-16T23:01:46Z.
PR: #8492.
Model family: claude

Verdict: PASS

  • Pure git rename, 100% similarity — no content change. Content of tests/gti/test_gti_receipt.py preserved (verified head: imports aragora.gti.receipt, no internal references to its own module name).
  • Root cause confirmed: neither tests/gti/ nor tests/heterogeneity/ has __init__.py, so pytest's rootdir-basename collection collides on test_receipt.py. Renaming the gti file to a unique basename resolves the collision. The other two tests/gauntlet/test_receipt.py and tests/review/test_receipt.py are inside packages (have __init__.py), so they don't participate in the basename clash.
  • No Python imports referenced the old module path tests.gti.test_receipt (grep clean; only unrelated string literals like "test_receipt.json" matched).
  • Stale __pycache__/test_receipt.cpython-311-pytest-9.0.2.pyc will linger in tests/gti/__pycache__/ on local dev checkouts after pulling. Harmless (pytest won't collect a .pyc without a matching .py), but worth a one-line note in the PR if anyone is debugging locally. Not blocking.
  • No security, correctness, or regression risk surface in a test-file rename.

No blocking issues. Suggest a follow-up to add tests/gti/__init__.py (and audit other rootdir test dirs) as a more durable fix, but out of scope here.

dogfood: yes

@scarmani

Copy link
Copy Markdown
Collaborator Author

Grok independent model review

Reviewer: grok (xai) — independent adversarial model review via Grok Build CLI harness, grounded on the exact PR head.
Head: 7087e87 (7087e87), committed 2026-06-16T23:01:46Z.
PR: #8492.
Model family: grok

Reviewing the rename for references, pytest discovery, and collision risks.
Verdict: PASS

  • No blocking issues. Pure git mv (0 line changes); test logic, imports, and assertions are unchanged.
  • [P3] tests/gti/test_gti_receipt.py — Collision fix is correct: tests/gti/ and tests/heterogeneity/ are both flat (no __init__.py); only those two shared the test_receipt.py basename among flat dirs. Full-tree pytest --collect-only tests/ now succeeds locally (228,930 collected, 0 errors); renamed module runs 13/13.
  • [P3] tests/gti/ (unchanged) — Still lacks __init__.py; future generic basenames in this flat dir could collide again. Out of scope here; optional hardening is tests/gti/__init__.py or a gti_ naming convention.
  • [P3] docs/superpowers/plans/2026-06-06-ground-truth-integrity-benchmark.md (not in diff) — Still references tests/gti/test_receipt.py; no CI/script hits found, but copy-paste from that plan will fail.
  • No security or production-code regression risk; no hardcoded node IDs or CI paths for the old GTI filename.

dogfood: yes

@scarmani scarmani merged commit 5da7716 into main Jun 16, 2026
136 of 138 checks passed
@scarmani scarmani deleted the structex/p2-pytest-collision branch June 16, 2026 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant