MicroFish/backend/tests/interviews
Christian Moellmann 895a5fbaee fix(interviews): accept stringified ints in all 4 subagent validators
Real LLMs (observed with anthropic/claude-haiku-4-5 on a 23-agent run)
sometimes return Likert values as JSON strings ('3' not 3). The 4 subagent
validators rejected this with isinstance(v, int), losing ~30% of agents at
N=23. Added a shared coerce_int helper in base.py that accepts ints and
numeric strings, rejects bools/floats/garbage, and is now used by:

- Longitudinal: response values 1-5
- Diversity: Q-sort placements -3..+3 and 6 Likert axes 1-7
- Delphi: R2 and R3 importance/plausibility 1-5
- Scenario: 4 dimensions 1-7

Validators now coerce in place so downstream code sees ints regardless of
the wire format. Added 8 tests (4 unit on coerce_int + 4 per-subagent
contract tests showing stringified values are accepted).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 14:03:34 +02:00
..
__init__.py feat(interviews): add pydantic models for instruments and responses 2026-05-23 12:04:45 +02:00
test_adapters.py fix(interviews): wire Zep updater/memory/hooks correctly for production runs (C1-C5) 2026-05-23 13:27:47 +02:00
test_api_interview.py fix(interviews): wire Zep updater/memory/hooks correctly for production runs (C1-C5) 2026-05-23 13:27:47 +02:00
test_base_interviewer.py fix(interviews): accept stringified ints in all 4 subagent validators 2026-05-23 14:03:34 +02:00
test_delphi.py fix(interviews): accept stringified ints in all 4 subagent validators 2026-05-23 14:03:34 +02:00
test_diversity.py fix(interviews): accept stringified ints in all 4 subagent validators 2026-05-23 14:03:34 +02:00
test_instrument_loader.py feat(interviews): YAML instrument loader with pydantic validation and hash freezing 2026-05-23 12:06:52 +02:00
test_lifecycle.py feat(interviews): auto-trigger lifecycle hooks + bridge SimulationRunner→Manager on COMPLETED 2026-05-23 12:51:13 +02:00
test_llm_stub.py feat(interviews): LLM stub mode for deterministic CI tests 2026-05-23 12:08:29 +02:00
test_longitudinal.py fix(interviews): accept stringified ints in all 4 subagent validators 2026-05-23 14:03:34 +02:00
test_models.py feat(interviews): add pydantic models for instruments and responses 2026-05-23 12:04:45 +02:00
test_orchestrator.py feat(interviews): capture raw LLM output on schema-validation failures 2026-05-23 13:40:43 +02:00
test_scenario.py fix(interviews): accept stringified ints in all 4 subagent validators 2026-05-23 14:03:34 +02:00
test_simulation_hooks.py fix(interviews): wire Zep updater/memory/hooks correctly for production runs (C1-C5) 2026-05-23 13:27:47 +02:00
test_storage.py feat(interviews): JSONL/JSON storage layout with run_id directories and latest pointer 2026-05-23 12:23:06 +02:00
test_synthesizer.py feat(interviews): synthesiser emits cross-method report + tidy CSV + limitations section 2026-05-23 12:32:14 +02:00
test_zep_writer.py fix(interviews): wire Zep updater/memory/hooks correctly for production runs (C1-C5) 2026-05-23 13:27:47 +02:00