Files
SubMiner/backlog/tasks/task-69 - Harden-legacy-config-migration-validation-and-deprecation-handling.md

1.6 KiB

id, title, status, assignee, created_date, updated_date, labels, dependencies, priority
id title status assignee created_date updated_date labels dependencies priority
TASK-69 Harden legacy config migration validation and deprecation handling To Do
2026-02-18 11:35 2026-02-18 11:35
config
validation
safety
high

Description

src/config/service.ts still applies many legacy ankiConnect keys via unchecked casts (as string|number|boolean) in the mapLegacy block. Invalid legacy values can enter resolved runtime config without warnings and break downstream behavior.

Action Steps

  1. Inventory every legacy key currently handled in mapLegacy.
  2. Replace unchecked assignment with typed validators (asString, asNumber, asBoolean, enum guards).
  3. Emit deprecation warnings for accepted legacy keys and validation warnings for invalid values.
  4. Preserve backward compatibility for valid legacy configs.
  5. Add regression tests for invalid legacy value types and accepted legacy values.
  6. Update configuration docs with migration/deprecation notes.

Acceptance Criteria

  • #1 No legacy key path writes directly to resolved config without type validation
  • #2 Invalid legacy values produce warnings and safe fallback behavior
  • #3 Valid legacy configs still map to equivalent resolved config
  • #4 Config test suite includes legacy-invalid regression coverage

Definition of Done

  • #1 bun run test:config:dist passes
  • #2 Any doc changes for migration/deprecation are committed