Add a small YAML routing config schema (schema_version 1) and a
parser-only loader at src/infospace_bench/routing_config.py. The
loader validates the declarative shape — task_types with candidates,
optional per-task quality_floor, optional default_quality_floor,
optional ledger_path, optional stage_to_task_type override map — and
refuses bad shapes before any network or workspace work happens.
Supported provider names: openrouter, claude_code, openai, gemini.
Unknown providers, missing required candidate fields, out-of-range
quality floors, negative max_cost_per_1k, duplicate candidate ids
within a task type, and non-mapping stage_to_task_type all raise
focused InfospaceError codes that callers can pattern-match.
docs/routing-config.md documents the schema with two annotated
examples (OpenRouter-only two-tier, and adaptive with a ClaudeCode
baseline) plus the full "what fails fast" list.
16 parser tests cover happy-path round-trip, file load, missing file,
malformed YAML, and every validation surface (wrong/missing schema
version, empty task_types, empty candidates, missing required fields,
unsupported provider, negative cost, out-of-range quality_floor,
duplicate ids, non-mapping stage_map, non-string ledger_path).
T02 will turn a RoutingConfig into a live llm-connect RoutingPolicy /
AdaptiveRoutingPolicy with constructed LLMAdapter instances.
160 tests pass, 1 skipped.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Open a workplan that turns the IB-WP-0018 RoutingAssistedGenerationAdapter
bridge into a first-class CLI option. Adds --provider routing, a YAML
routing config schema, --quality-floor and --shadow-rate /
--shadow-baseline opt-in flags so a real multi-chapter Lefevre live
run can use adaptive cost-quality routing without writing any Python.
Workstream registered with state-hub
(172bb082-610a-477b-b5e0-26c9f4bdfd95) with five tasks:
- T01 routing config file schema (medium)
- T02 routing config loader (high)
- T03 --provider routing + --routing-config + --quality-floor CLI flags
(high)
- T04 example config + optional live routing smoke test (medium)
- T05 --shadow-rate / --shadow-baseline opt-in flags (medium)
Depends on IB-WP-0018 (already done) and LLM-WP-0004 (already done in
~/llm-connect).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>