Ensure that numeric conversions are lossless by verifying the converted
value matches the original string when converted back. This prevents:
- Loss of leading zeros (0123 stays as string)
- Loss of trailing zeros in floats (1.50 stays as string)
- Loss of plus signs (+123 stays as string)
- Changes in notation (1e10 stays as string)
Only convert to numeric types when the string representation would be
preserved exactly. This maintains data integrity while still providing
convenient type conversions for clean numeric values.
Added comprehensive tests to verify the safety check behavior.
commit e15edaedd786254cf22c291a63a02f7cff33b119
Author: sneak <sneak@sneak.berlin>
Date: Mon Jul 21 15:17:12 2025 +0200
Implement YAML-first interpolation with type preservation
Previously, interpolations were performed during string manipulation before
YAML parsing, which caused issues with quoting and escaping. This commit
fundamentally changes the approach:
- Parse YAML first, then walk the structure to interpolate values
- Preserve types: standalone interpolations can return numbers/booleans
- Mixed content (text with embedded interpolations) always returns strings
- Users control types through YAML syntax, not our quoting logic
- Properly handle nested interpolations without quote accumulation
This gives users explicit control over output types while eliminating
the complex and error-prone manual quoting logic.