MicroFish/backend/app/services/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): YAML instrument loader with pydantic validation and hash freezing 2026-05-23 12:06:52 +02:00
adapters.py fix(interviews): wire Zep updater/memory/hooks correctly for production runs (C1-C5) 2026-05-23 13:27:47 +02:00
base.py fix(interviews): accept stringified ints in all 4 subagent validators 2026-05-23 14:03:34 +02:00
delphi.py fix(interviews): accept stringified ints in all 4 subagent validators 2026-05-23 14:03:34 +02:00
diversity.py fix(interviews): accept stringified ints in all 4 subagent validators 2026-05-23 14:03:34 +02:00
instrument_loader.py feat(interviews): YAML instrument loader with pydantic validation and hash freezing 2026-05-23 12:06:52 +02:00
lifecycle.py feat(interviews): auto-trigger lifecycle hooks + bridge SimulationRunner→Manager on COMPLETED 2026-05-23 12:51:13 +02:00
longitudinal.py fix(interviews): accept stringified ints in all 4 subagent validators 2026-05-23 14:03:34 +02:00
scenario.py fix(interviews): accept stringified ints in all 4 subagent validators 2026-05-23 14:03:34 +02:00
storage.py feat(interviews): capture raw LLM output on schema-validation failures 2026-05-23 13:40:43 +02:00
zep_writer.py fix(interviews): wire Zep updater/memory/hooks correctly for production runs (C1-C5) 2026-05-23 13:27:47 +02:00