Skip to content

Retire hardcoded legacy → v1 redirect map #265

Description

@kilodesodiq-arch

Problem Statement. app/ai-service/main.py defines _LEGACY_TO_V1 and
_LEGACY_PREFIX_MAP as Python literals. When new legacy routes accumulate, the map
becomes the de-facto registry.

Why it matters. Operationally fragile. A new legacy route can be missed.

Technical Context. main.py::_LEGACY_TO_V1.

Expected Outcome. A legacy_redirects.yaml shipped with the service; the middleware
reads from it at startup. New entries are added without code changes.

Acceptance Criteria.

  • Migration of all current entries to YAML.
  • A test fails if entries exist in code but not YAML (or vice versa).
  • Plan: every 6 months retire legacy paths entirely.

Implementation Notes. Use pydantic-settings to load YAML; fail boot if the file is
not present.

Files or modules likely to be affected.
app/ai-service/main.py,
new app/ai-service/config/legacy_redirects.yaml,
new app/ai-service/tests/test_legacy_redirects.py.

Difficulty. Medium
Estimated effort. S



Backlog item #57 from `docs/maintainer-issue-backlog.md.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions