fix: remove destructive migrate rewrite, add replay source attribution and warning drain

This commit is contained in:
John Dvorak
2026-05-22 11:41:43 -07:00
parent 1de735ee08
commit 6e4656add5
6 changed files with 50 additions and 31 deletions
@@ -2,7 +2,7 @@
* Route rewriter for APOPHIS migrate command.
*
* Responsibilities:
* - Rewrite route schema annotations (e.g., x-validate-runtime → runtime)
* - Rewrite route schema annotations
* - Preserve schema structure and formatting
* - Handle annotations in Fastify route definitions
* - Detect ambiguous annotations and require manual choice
@@ -40,10 +40,12 @@ export interface AmbiguousRoutePattern {
/**
* Mapping of deprecated route schema annotations to their modern equivalents.
* x-validate-runtime is intentionally NOT here — it is the current, active annotation
* used by contract.ts and hook-validator.ts for per-route runtime validation opt-out.
* Rewriting it to 'runtime' would break it, since 'runtime' is a top-level plugin
* config option, not a valid route schema annotation.
*/
export const LEGACY_ROUTE_ANNOTATIONS: Record<string, string> = {
'x-validate-runtime': 'runtime',
};
export const LEGACY_ROUTE_ANNOTATIONS: Record<string, string> = {};
/**
* Ambiguous route patterns that require manual choice.