markitect-main/tests/unit/infospace
tegwick c0615c2d50 feat(infospace,llm): stabilize free-tier eval workflow
Five improvements that eliminate most of the agent-in-the-loop friction
observed while closing out the 988-entity WoN evaluation (C.1):

1. Gemini adapter now retries on 429 + 5xx with exponential backoff
   (same pattern already used by OpenRouter/OpenAI). Removes the need
   for shell-level retry wrappers when hitting free-tier rate limits.

2. evaluate CLI prints the underlying error ("ERROR — HTTP 503 …")
   instead of a bare "ERROR", so agents don't have to drop into Python
   to diagnose transient failures.

3. --entity/--chapter now respect existing evaluation files by default
   (previously only the full-collection pass did). New --force flag
   opts into re-evaluation. Stops silently burning free-tier quota on
   re-runs of the same slug.

4. --entity accepts hyphenated slugs (matching entity filenames) and
   normalizes them to the underscore form used on disk. On a miss the
   CLI suggests near matches instead of a bare "not found".

5. eval-summary --update-metrics is no longer destructive:
   read_metrics_file/write_metrics_file preserve structured values
   (type_distribution) and don't flatten ints to floats. Fixes a
   silent data loss observed on every run.

Bonus: the evaluator field in written evaluation frontmatter now
falls back from run_config.model_name to the adapter's resolved model
(or the model echoed back in the API response), so rows no longer
show `evaluator: null` when --model is omitted.

Tests: new tests/unit/llm/test_gemini.py covers retry behavior;
tests/unit/infospace/test_history.py gains a round-trip test that
pins the type_distribution / int-preservation invariants.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-22 00:51:00 +02:00
..
__init__.py feat(infospace): add entity metadata parser (S1.1) 2026-02-19 00:27:45 +01:00
test_checks.py feat(infospace): add collection-level quality checks C1–C5 (S2.4) 2026-02-19 01:54:22 +01:00
test_cli.py feat(infospace): add lifecycle CLI commands — init, status, entities, viability (S2.2) 2026-02-19 01:46:54 +01:00
test_composition.py feat(infospace): add composition model for discipline binding (S2.6) 2026-02-19 02:03:54 +01:00
test_config.py feat(infospace): add infospace configuration model and state (S2.1) 2026-02-19 01:44:14 +01:00
test_entity_parser.py feat(infospace): add entity metadata parser (S1.1) 2026-02-19 00:27:45 +01:00
test_evaluate.py feat(infospace): add per-entity evaluation pipeline and CLI command (S2.3) 2026-02-19 01:48:34 +01:00
test_evaluation.py feat(infospace): add structured evaluation output with history and diffing (S1.5) 2026-02-19 01:35:22 +01:00
test_history.py feat(infospace,llm): stabilize free-tier eval workflow 2026-04-22 00:51:00 +02:00
test_schema_validator.py feat(infospace): add schema compliance validator (S1.2) 2026-02-19 00:48:57 +01:00