Skip to content

Add config compatibility matrix tests and document alias precedence#62

Merged
Disaster-Terminator merged 1 commit intoreview/route-contract-hardening-2026-05-05from
add-tests-for-config-loading-combinations-y386y1
May 5, 2026
Merged

Add config compatibility matrix tests and document alias precedence#62
Disaster-Terminator merged 1 commit intoreview/route-contract-hardening-2026-05-05from
add-tests-for-config-loading-combinations-y386y1

Conversation

@Disaster-Terminator
Copy link
Copy Markdown
Owner

Motivation

  • Ensure backward-compatible loading of legacy config keys while introducing clearer product terminology for entry_model/route_model and fallback_route_id/default_route.
  • Prevent accidental regressions by codifying a small compatibility matrix and recursion guards in tests.
  • Preserve existing runtime behavior unless tests detect an ambiguity or bug.

Description

  • Added tests in tests/test_config.py covering entry_model only, route_model only, both keys present (deterministic precedence), fallback_route_id and legacy default_route alias, omitted target_model defaulting to the route_id, and missing fallback_route_id validation.
  • Documented deterministic alias precedence in router/config.py comment indicating that route_model takes precedence via AliasChoices ordering for deterministic compatibility.
  • Kept runtime logic unchanged other than a clarifying comment; test additions exercise recursive protections such as preventing route_model or target_model from referring back to configured route ids and requiring fallback_route_id to exist.

Testing

  • Ran uv run python -m pytest -q and all tests passed (156 passed, 1 warning).
  • Ran uv run python scripts/eval_routes.py --mock-embeddings and the evaluation harness passed all sample cases (10 eval case(s) passed).

Codex Task

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Disaster-Terminator! 👋

Your private repo does not have access to Sourcery.

Please upgrade to continue using Sourcery ✨

@qodo-code-review
Copy link
Copy Markdown

ⓘ You've reached your Qodo monthly free-tier limit. Reviews pause until next month — upgrade your plan to continue now, or link your paid account if you already have one.

@Disaster-Terminator Disaster-Terminator merged commit 3eee07a into review/route-contract-hardening-2026-05-05 May 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant