tests: ~19 test_module_metadata cases assert list form of requires_config after ClassVar[tuple] change #120

Closed
opened 2026-09-10 14:26:03 +00:00 by Mark · 4 comments
Owner

Summary

Roughly 19 test_module_metadata tests across the suite still assert the old list[str] form of EvidenceModule.requires_config, but backend/app/modules/base.py now declares it as an immutable tuple:

requires_config: ClassVar[tuple[str, ...]] = ()

The tests were never updated, so they fail on main.

Reproduction

python3.12 -m pytest --no-cov -q backend/tests/unit/test_modules_dehashed.py::TestDeHashedModuleConfig::test_module_metadata
assert self.module.requires_config == ["dehashed_api_key"]
E   AssertionError: assert ('dehashed_api_key',) == ['dehashed_api_key']

Scope

Full-suite baseline on origin/main @ 2930a35 (Python 3.12): 83 failed, 1700 passed, 9 skipped in ~733s. Confirmed pre-existing and unrelated to #117/#119 — the rebased #119 branch produced a byte-identical failure set (comm on the sorted FAILED lists is empty in both directions).

Affected files include:

  • backend/tests/test_email_osint.py
  • backend/tests/test_entity_linker.py
  • backend/tests/test_phone_osint.py
  • backend/tests/test_relationship_builder.py
  • backend/tests/test_report_generator.py
  • backend/tests/test_suspect_tracker.py
  • backend/tests/test_threat_intel_aggregator.py
  • backend/tests/test_timeline_reconstruction.py
  • backend/tests/unit/test_modules_dehashed.py
  • backend/tests/unit/test_modules_reddit.py
  • backend/tests/unit/test_modules_twitter.py
  • backend/tests/unit/test_search_aggregator.py
  • backend/tests/unit/test_social_finder.py
  • backend/tests/unit/test_timeline_reconstruction.py

The remaining failures in the 83 are separate concerns (test_live_scrapers.py needs live network; several security/ tests fail independently) and should be triaged on their own.

Fix

Update the assertions to the tuple form, e.g. requires_config == ("dehashed_api_key",).

Why this matters beyond the tests

This debt actively breaks the automated fixer lane. kilo-gsd's Verify gate falls back to a bare whole-repo pytest when an issue has no plan-specific verification checklist, so it grades this broken baseline rather than the change under test. On #118 that caused three Bugfix rounds to burn against failures the change never caused — the agent got 82 → 69 by patching unrelated tests, but could never reach green. Clearing this baseline makes the fallback gate trustworthy again.

Environment note

The suite must be run with Python 3.12 (requires-python = ">=3.12"). Under 3.11 collection dies early with a misleading SyntaxError: expected '(' at backend/app/services/llm/parsing.py:17, which is just PEP 695 generic syntax the older interpreter cannot parse.

## Summary Roughly 19 `test_module_metadata` tests across the suite still assert the old `list[str]` form of `EvidenceModule.requires_config`, but `backend/app/modules/base.py` now declares it as an immutable tuple: ```python requires_config: ClassVar[tuple[str, ...]] = () ``` The tests were never updated, so they fail on `main`. ## Reproduction ```bash python3.12 -m pytest --no-cov -q backend/tests/unit/test_modules_dehashed.py::TestDeHashedModuleConfig::test_module_metadata ``` ``` assert self.module.requires_config == ["dehashed_api_key"] E AssertionError: assert ('dehashed_api_key',) == ['dehashed_api_key'] ``` ## Scope Full-suite baseline on `origin/main` @ `2930a35` (Python 3.12): **83 failed, 1700 passed, 9 skipped** in ~733s. Confirmed pre-existing and unrelated to #117/#119 — the rebased #119 branch produced a byte-identical failure set (`comm` on the sorted `FAILED` lists is empty in both directions). Affected files include: - `backend/tests/test_email_osint.py` - `backend/tests/test_entity_linker.py` - `backend/tests/test_phone_osint.py` - `backend/tests/test_relationship_builder.py` - `backend/tests/test_report_generator.py` - `backend/tests/test_suspect_tracker.py` - `backend/tests/test_threat_intel_aggregator.py` - `backend/tests/test_timeline_reconstruction.py` - `backend/tests/unit/test_modules_dehashed.py` - `backend/tests/unit/test_modules_reddit.py` - `backend/tests/unit/test_modules_twitter.py` - `backend/tests/unit/test_search_aggregator.py` - `backend/tests/unit/test_social_finder.py` - `backend/tests/unit/test_timeline_reconstruction.py` The remaining failures in the 83 are separate concerns (`test_live_scrapers.py` needs live network; several `security/` tests fail independently) and should be triaged on their own. ## Fix Update the assertions to the tuple form, e.g. `requires_config == ("dehashed_api_key",)`. ## Why this matters beyond the tests This debt actively breaks the automated fixer lane. kilo-gsd's Verify gate falls back to a bare whole-repo `pytest` when an issue has no plan-specific verification checklist, so it grades this broken baseline rather than the change under test. On #118 that caused three Bugfix rounds to burn against failures the change never caused — the agent got 82 → 69 by patching unrelated tests, but could never reach green. Clearing this baseline makes the fallback gate trustworthy again. ## Environment note The suite must be run with Python 3.12 (`requires-python = ">=3.12"`). Under 3.11 collection dies early with a misleading `SyntaxError: expected '('` at `backend/app/services/llm/parsing.py:17`, which is just PEP 695 generic syntax the older interpreter cannot parse.
Author
Owner

Triaged: ~19 test assertions need list-form fix. Small scope, low risk → fixit lane.

Triaged: ~19 test assertions need list-form fix. Small scope, low risk → fixit lane.
Author
Owner

Launcher t_a0f329d0 (kilo-gsd-runner) blocked on preflight before spawn: .gsd/gates/pre-dispatch.sh 120 exit 1 — main worktree has 8 modified files in backend/app/services/investigations/... (unrelated to this issue) plus ?? .worktrees/ containing 5 leftover worktrees from prior #100/#116/#117/#118 runs. Contract forbids the launcher from running git reset / git clean / git worktree remove; the runner / janitor / triage lane must reconcile the working tree before #120 can be claimed. Card blocked kind=capability for operator / janitor follow-up.

Launcher `t_a0f329d0` (kilo-gsd-runner) blocked on **preflight** before spawn: `.gsd/gates/pre-dispatch.sh 120` exit 1 — main worktree has 8 modified files in `backend/app/services/investigations/...` (unrelated to this issue) plus `?? .worktrees/` containing 5 leftover worktrees from prior #100/#116/#117/#118 runs. Contract forbids the launcher from running `git reset` / `git clean` / `git worktree remove`; the runner / janitor / triage lane must reconcile the working tree before #120 can be claimed. Card blocked `kind=capability` for operator / janitor follow-up.
Author
Owner

Fixed via PR #157 (commit b2a646e).

Fix scope — 15 test_module_metadata cases updated from list-literal to tuple-literal:

  • 13 files: assert self.module.requires_config == [] → assert self.module.requires_config == ()
  • 2 files (dehashed, search_aggregator): == ["<key>"] → == ("<key>",)

The two test_module_metadata cases in test_base.py and tests/unit/test_module_base.py test synthetic ConcreteEvidenceModule subclasses that themselves declare requires_config: ClassVar[list] = [...]; those assertions are correct as-is and were left untouched.

Verification

  • Targeted (15 cases + 2 synthetic + 1 membership): pytest -k 'test_module_metadata or test_module_requires_api_key' → 8/8 pass.
  • File-by-file full suite across the 15 patched files: 331/331 pass.
  • Whole-repo python3.12 -m pytest --no-cov (751s): 1724 passed, 59 failed, 9 skipped (vs baseline 1700 passed / 83 failed → +24 pass / −24 fail from this change). The remaining 59 are unrelated integration/security/live-network failures called out in the issue body.
  • Forgejo Actions ci.yml on commit b2a646e: success (3:12).

backend/app/modules/base.py is NOT modified — this is a tests-only fix as the issue called for.

Closes #120.

Fixed via PR #157 (commit b2a646e). **Fix scope** — 15 `test_module_metadata` cases updated from list-literal to tuple-literal: - 13 files: `assert self.module.requires_config == []` → `assert self.module.requires_config == ()` - 2 files (dehashed, search_aggregator): `== ["<key>"]` → `== ("<key>",)` The two `test_module_metadata` cases in `test_base.py` and `tests/unit/test_module_base.py` test synthetic `ConcreteEvidenceModule` subclasses that themselves declare `requires_config: ClassVar[list] = [...]`; those assertions are correct as-is and were left untouched. **Verification** - Targeted (15 cases + 2 synthetic + 1 membership): `pytest -k 'test_module_metadata or test_module_requires_api_key'` → 8/8 pass. - File-by-file full suite across the 15 patched files: 331/331 pass. - Whole-repo `python3.12 -m pytest --no-cov` (751s): **1724 passed, 59 failed, 9 skipped** (vs baseline 1700 passed / 83 failed → +24 pass / −24 fail from this change). The remaining 59 are unrelated integration/security/live-network failures called out in the issue body. - Forgejo Actions `ci.yml` on commit `b2a646e`: **success** (3:12). `backend/app/modules/base.py` is NOT modified — this is a tests-only fix as the issue called for. Closes #120.
Mark closed this issue 2026-09-18 13:48:00 +00:00
Author
Owner

Landed via merge commit d9dc0f8 on main (PR #157). Fix commit: b2a646e — test: align test_module_metadata assertions with tuple form of requires_config. Spot-check tests/unit/test_modules_dehashed.py::TestDeHashedModuleConfig::test_module_metadata passes; broad -m 'not integration and not performance and not security' run is 1293 passed / 4 failed, with all 4 failures being pre-existing unrelated DB-fixture / FK / evidence-review cases (not from this PR). Issue closed automatically by the merge commit's closes #120 keyword.

Landed via merge commit `d9dc0f8` on `main` (PR [#157](https://forgejo.tail018ac4.ts.net/Mark/osint-hub/pulls/157)). Fix commit: `b2a646e` — *test: align test_module_metadata assertions with tuple form of requires_config*. Spot-check `tests/unit/test_modules_dehashed.py::TestDeHashedModuleConfig::test_module_metadata` passes; broad `-m 'not integration and not performance and not security'` run is 1293 passed / 4 failed, with all 4 failures being pre-existing unrelated DB-fixture / FK / evidence-review cases (not from this PR). Issue closed automatically by the merge commit's `closes #120` keyword.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/osint-hub#120
No description provided.