ADR-061: Migrate recorded scalar answers¶
Status¶
Accepted. Partially supersedes ADR-041 and ADR-055's restrictions on recorded scalar conversion.
Context¶
Saved answers outlive the question schema that originally validated them. Changing an integer question to string should not require every project to edit its configuration manually. Recorded-answer origins already distinguish compatibility migrations from strict explicit answer-file inputs.
Decision¶
Extend recorded-only evaluation compatibility before normal validation:
- Convert integers, finite floats and booleans to strings for
stringquestions. - Parse strings for integer, float and boolean questions using the existing CLI scalar parser.
- Preserve the existing comma-separated string migration for array questions.
Already accepted values retain their representation, including integers supplied to float questions.
Scalar formatting is deterministic and value-based, not a reconstruction of original TOML spelling.
In particular, float 1.0 becomes string "1".
Numeric parsing trims surrounding whitespace; boolean parsing uses existing case-insensitive aliases without trimming.
All ordinary constraints run afterward, including numeric finiteness and bounds, string length and pattern.
Parsing or validation failures remain errors and never discard answers in favor of defaults.
Do not add direct number/boolean casts, float-to-integer casts, scalar-to-choice conversion, or stringification of structured values, null or nonfinite floats. Explicit answer files, defaults, composed forwarding and historical replay retain strict typing. Switch candidates retain their existing validation-and-fallback semantics. No historical schema lookup is required: the saved value and current question suffice.
Consequences¶
Existing update persistence saves resolved types as unstaged configuration edits, including with identical rendered output.
Dry runs and shared dirty previews use the same conversion without saving configuration.
No stored format, public type or diagnostic code changes are needed.
Conversions preserve useful values but are not necessarily reversible:
float 1.0 can become string "1" and later integer 1 across separate schema changes.