Skip to content

fix(#69): skip tests of removed preflight contracts (12f25eb)#82

Merged
Knapp-Kevin merged 1 commit into
BicameralAI:devfrom
Knapp-Kevin:fix/69-preflight-stale-test-imports
Apr 28, 2026
Merged

fix(#69): skip tests of removed preflight contracts (12f25eb)#82
Knapp-Kevin merged 1 commit into
BicameralAI:devfrom
Knapp-Kevin:fix/69-preflight-stale-test-imports

Conversation

@Knapp-Kevin

Copy link
Copy Markdown
Collaborator

Closes #69.

Summary

Two test files failed to collect on main:

  • tests/test_v055_region_anchored_preflight.py — imports _merge_decision_matches from handlers.preflight
  • tests/test_v0412_preflight.py — imports _has_actionable_signal_in_search from handlers.preflight

Both helpers were removed in commit 12f25eb (v0.10.0 — hierarchical dashboard, history-based preflight, per-section ingest). The preflight refactor dropped BM25 topic search entirely; preflight now reads bicameral.history() and uses LLM reasoning to identify relevant feature groups. The contracts these test files exercised no longer exist on the new code path.

Fix

Module-level pytest.skip(... allow_module_level=True) on both files with a reason that points at the v0.10.0 commit and explains what was removed.

The original imports are kept (with # noqa: E402, F401) below the skip — they document the original surface area for future port-forward work, but are unreachable. The module docstrings are extended with a "Status (issue #69)" paragraph so anyone opening the file sees why it's quarantined before they go looking for the imports.

Why skip rather than delete?

The scenarios documented in these files (region-anchored decision retrieval, "actionable signal" detection on search responses) informed the v0.10.0 redesign. Keeping the files preserves that history; deleting them would lose the design rationale for anyone reading git log later. If/when the maintainers prefer outright removal, this is a one-commit cleanup.

Why not port forward?

Three of the v0.4.12 helpers (_validate_topic, _dedup_key_for, _check_dedup) still exist on the new code path, so a partial port is possible — but the handler-level mock tests are tied to the old BM25 pipeline and would need full rewrites against the LLM-reasoning-based preflight. That's a separate, scoped refactor; out of band for this unblocking fix.

Note on tests/test_extraction_metrics.py

Issue #69 also listed test_extraction_metrics.py as failing collection. On the current main (6bdff24) it collects fine (16 tests). The file is left untouched.

Verification

  • pytest tests/test_v055_region_anchored_preflight.py tests/test_v0412_preflight.py --collect-only -q — 0 collection errors, 2 skipped with reasons
  • No code changes outside tests/

Test plan

Issue BicameralAI#69: ``tests/test_v055_region_anchored_preflight.py`` and
``tests/test_v0412_preflight.py`` failed to collect with:

  ImportError: cannot import name '_merge_decision_matches' from 'handlers.preflight'
  ImportError: cannot import name '_has_actionable_signal_in_search' from 'handlers.preflight'

Both helpers were removed in commit 12f25eb (v0.10.0 — hierarchical
dashboard, history-based preflight, per-section ingest). The preflight
refactor dropped BM25 topic search entirely; preflight now reads
``bicameral.history()`` and uses LLM reasoning to identify relevant
feature groups. The contracts these test files exercised no longer
exist on the new code path.

Fix:

- Module-level ``pytest.skip(... allow_module_level=True)`` on both
  files with a reason that points at the v0.10.0 commit and explains
  what was removed.
- The original imports are kept (with ``# noqa: E402, F401``) below
  the skip — they document the test files' original surface area for
  future port-forward work, but are unreachable.
- The module docstrings are extended with a "Status (issue BicameralAI#69)"
  paragraph so anyone opening the file sees why it's quarantined
  before they look for the imports.

Note: ``tests/test_extraction_metrics.py`` was also listed in BicameralAI#69 but
collects fine on this branch (16 tests). It is left untouched.

Tests: ``pytest`` collects both files cleanly (0 errors); each shows
as 1 ``skipped`` with a readable reason.
@coderabbitai

coderabbitai Bot commented Apr 28, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@Knapp-Kevin has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 32 minutes and 50 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9b544bda-c264-4c45-aa93-32561a365f6a

📥 Commits

Reviewing files that changed from the base of the PR and between a340750 and 359c2ef.

📒 Files selected for processing (2)
  • tests/test_v0412_preflight.py
  • tests/test_v055_region_anchored_preflight.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Knapp-Kevin Knapp-Kevin changed the base branch from main to dev April 28, 2026 20:22
@Knapp-Kevin Knapp-Kevin added the bug Something isn't working label Apr 28, 2026
@Knapp-Kevin Knapp-Kevin merged commit b9faefc into BicameralAI:dev Apr 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ImportError: cannot import name '_merge_decision_matches' from 'handlers.preflight' (3 test modules cannot be collected)

1 participant