Void::Data::StrictJson cannot represent JSON numbers outside int64/double range, and decimal numbers are stored only as double. Grammar-valid JSON is then rejected, and the integer/fraction distinction is lost.
Tested revision: main e6745ac8cbd0ed5dc8c8d8c254d99cbb20321e39 (2026-12-05), include/Void/Data/StrictJson.hpp (parseNumber).
Defect 1: valid numbers outside machine range are parse errors
{"n":9223372036854775808} (2^63) -> fail("integer is out of range")
{"n":1e-400} -> std::from_chars underflow -> fail("number is out of range")
Both are grammar-valid JSON numbers per RFC 8259. A consumer should receive a value (or a non-fatal "out of range" marker), not a document parse failure. Downstream, a JSON-RPC server must be able to answer -32600 Invalid Request rather than -32700 Parse error for an out-of-range id, and must still accept such numbers in unrelated parameters.
Defect 2: decimal lexemes lose exactness
1.0000000000000001 parses to double{1.0}, indistinguishable from 1. A JSON-RPC layer that promotes integral doubles to integer ids accepts the fractional id 1.0000000000000001 as id 1, so a rounded fractional id can change server lifecycle (e.g. trigger shutdown).
Expected
Preserve the raw number lexeme (or an exact decimal representation) so integral vs fractional and out-of-range can be decided exactly.
Accept out-of-range numbers without failing the document parse; expose their range state to consumers.
Keep allowDecimals for consumers that reject decimals.
Downstream evidence
VoidLanguageServer's vls_json_capabilities suite fails exactly these two cases against this revision:
rounded_fractional_id_cannot_change_lifecycle
valid_number_outside_machine_range_is_still_json
## Summary
`Void::Data::StrictJson` cannot represent JSON numbers outside `int64`/`double` range, and decimal numbers are stored only as `double`. Grammar-valid JSON is then rejected, and the integer/fraction distinction is lost.
Tested revision: main `e6745ac8cbd0ed5dc8c8d8c254d99cbb20321e39` (2026-12-05), `include/Void/Data/StrictJson.hpp` (`parseNumber`).
## Defect 1: valid numbers outside machine range are parse errors
- `{"n":9223372036854775808}` (2^63) -> `fail("integer is out of range")`
- `{"n":1e-400}` -> `std::from_chars` underflow -> `fail("number is out of range")`
Both are grammar-valid JSON numbers per RFC 8259. A consumer should receive a value (or a non-fatal "out of range" marker), not a document parse failure. Downstream, a JSON-RPC server must be able to answer `-32600 Invalid Request` rather than `-32700 Parse error` for an out-of-range `id`, and must still accept such numbers in unrelated parameters.
## Defect 2: decimal lexemes lose exactness
`1.0000000000000001` parses to `double{1.0}`, indistinguishable from `1`. A JSON-RPC layer that promotes integral doubles to integer ids accepts the fractional id `1.0000000000000001` as id `1`, so a rounded fractional id can change server lifecycle (e.g. trigger shutdown).
## Expected
- Preserve the raw number lexeme (or an exact decimal representation) so integral vs fractional and out-of-range can be decided exactly.
- Accept out-of-range numbers without failing the document parse; expose their range state to consumers.
- Keep `allowDecimals` for consumers that reject decimals.
## Downstream evidence
VoidLanguageServer's `vls_json_capabilities` suite fails exactly these two cases against this revision:
- `rounded_fractional_id_cannot_change_lifecycle`
- `valid_number_outside_machine_range_is_still_json`
New Void::Json::Strict::Number variant alternative preserves the exact lexeme plus exact isInteger, fitsInt64/int64Value, Range (in_range/overflow/underflow) and the nearest approximate double.
Grammar-valid numbers outside int64/double range now parse instead of failing: 9223372036854775808, -9223372036854775809, 1e309, -1e309, 1e-400.
Decimal lexemes that are not the shortest round-trip form of their double keep the lexeme: 1.0000000000000001 is no longer double{1.0} and is_integral reports false; exact decimals (0.5, 1.0, 1e-3) still parse as double.
Serialization emits the preserved lexeme verbatim (round-trip).
allowDecimals still rejects decimal lexemes, in range or not.
Downstream: an out-of-range JSON-RPC id now fails as invalid request (non-int64 alternative) instead of a parse error, while unrelated parameters still accept it.
Tests: new/updated cases in tests/standalone/Data/StrictJson.cpp. Data+Testing suite: 641 tests, 638 passed, 3 skipped, 0 failed. src/MCP/Envelope.cpp and src/Update/Feed.cpp still compile.
Fixed in 9cb86f8 on `main`.
- New `Void::Json::Strict::Number` variant alternative preserves the exact lexeme plus exact `isInteger`, `fitsInt64`/`int64Value`, `Range` (in_range/overflow/underflow) and the nearest `approximate` double.
- Grammar-valid numbers outside int64/double range now parse instead of failing: `9223372036854775808`, `-9223372036854775809`, `1e309`, `-1e309`, `1e-400`.
- Decimal lexemes that are not the shortest round-trip form of their double keep the lexeme: `1.0000000000000001` is no longer `double{1.0}` and `is_integral` reports false; exact decimals (`0.5`, `1.0`, `1e-3`) still parse as `double`.
- Serialization emits the preserved lexeme verbatim (round-trip).
- `allowDecimals` still rejects decimal lexemes, in range or not.
- Helpers: `as_number`, `is_integral`, `is_finite_number`.
- Downstream: an out-of-range JSON-RPC id now fails as invalid request (non-int64 alternative) instead of a parse error, while unrelated parameters still accept it.
- Tests: new/updated cases in `tests/standalone/Data/StrictJson.cpp`. Data+Testing suite: 641 tests, 638 passed, 3 skipped, 0 failed. `src/MCP/Envelope.cpp` and `src/Update/Feed.cpp` still compile.
Verified fixed on main 9cb86f8f978668215328ead51ee6f132552847c1 (2026-12-05): VoidLanguageServer rebuilt against this revision, and the full vls_json_capabilities suite passes, including rounded_fractional_id_cannot_change_lifecycle and valid_number_outside_machine_range_is_still_json. All 12 native test targets pass. Closing.
Verified fixed on main `9cb86f8f978668215328ead51ee6f132552847c1` (2026-12-05): VoidLanguageServer rebuilt against this revision, and the full `vls_json_capabilities` suite passes, including `rounded_fractional_id_cannot_change_lifecycle` and `valid_number_outside_machine_range_is_still_json`. All 12 native test targets pass. Closing.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Void::Data::StrictJsoncannot represent JSON numbers outsideint64/doublerange, and decimal numbers are stored only asdouble. Grammar-valid JSON is then rejected, and the integer/fraction distinction is lost.Tested revision: main
e6745ac8cbd0ed5dc8c8d8c254d99cbb20321e39(2026-12-05),include/Void/Data/StrictJson.hpp(parseNumber).Defect 1: valid numbers outside machine range are parse errors
{"n":9223372036854775808}(2^63) ->fail("integer is out of range"){"n":1e-400}->std::from_charsunderflow ->fail("number is out of range")Both are grammar-valid JSON numbers per RFC 8259. A consumer should receive a value (or a non-fatal "out of range" marker), not a document parse failure. Downstream, a JSON-RPC server must be able to answer
-32600 Invalid Requestrather than-32700 Parse errorfor an out-of-rangeid, and must still accept such numbers in unrelated parameters.Defect 2: decimal lexemes lose exactness
1.0000000000000001parses todouble{1.0}, indistinguishable from1. A JSON-RPC layer that promotes integral doubles to integer ids accepts the fractional id1.0000000000000001as id1, so a rounded fractional id can change server lifecycle (e.g. trigger shutdown).Expected
allowDecimalsfor consumers that reject decimals.Downstream evidence
VoidLanguageServer's
vls_json_capabilitiessuite fails exactly these two cases against this revision:rounded_fractional_id_cannot_change_lifecyclevalid_number_outside_machine_range_is_still_jsonFixed in
9cb86f8onmain.Void::Json::Strict::Numbervariant alternative preserves the exact lexeme plus exactisInteger,fitsInt64/int64Value,Range(in_range/overflow/underflow) and the nearestapproximatedouble.9223372036854775808,-9223372036854775809,1e309,-1e309,1e-400.1.0000000000000001is no longerdouble{1.0}andis_integralreports false; exact decimals (0.5,1.0,1e-3) still parse asdouble.allowDecimalsstill rejects decimal lexemes, in range or not.as_number,is_integral,is_finite_number.tests/standalone/Data/StrictJson.cpp. Data+Testing suite: 641 tests, 638 passed, 3 skipped, 0 failed.src/MCP/Envelope.cppandsrc/Update/Feed.cppstill compile.Verified fixed on main
9cb86f8f978668215328ead51ee6f132552847c1(2026-12-05): VoidLanguageServer rebuilt against this revision, and the fullvls_json_capabilitiessuite passes, includingrounded_fractional_id_cannot_change_lifecycleandvalid_number_outside_machine_range_is_still_json. All 12 native test targets pass. Closing.