schema: pin the 64-bit bounds at the precision a validator has #230

Merged
natsukium merged 1 commit from issue-179 into main 2026-09-08 22:14:16 +09:00
Owner

The integer-bounds fixtures claimed to pin the 64-bit boundary but never came near it: out-check-errors-above-u64
carried ~1e20, four orders of magnitude past u64::MAX, so it would have passed against a bound wrong by nearly any
amount. The boundary cannot be pinned exactly — i64::MAX and u64::MAX are not representable as f64, and a stock
validator (boon included) compares JSON numbers as f64, so it admits everything within one f64 step of the bound.
This moves the fixtures to the first value past that step, the closest a validator can reject, adds the signed twin
that was missing, and pins the remaining gap as its own test so a future validator that closes it fails loudly instead
of leaving the fixtures quietly over-strict. The published bounds stay exact rather than narrowing to what a validator
can enforce (narrowing would reject counts the daemon really emits); x-bound-exceeds-f64-precision discloses the gap
the same way x-max-utf8-bytes discloses the id byte limit.

  • out-check-errors-above-u64.json now carries 18446744073709555712 (2^64 + 4096, the first f64 above the bound)
    against its exact-u64::MAX twin; new out-capture-row-above-i64.json does the same for CaptureRow.row with
    9223372036854777856 (2^63 + 2048) against exact i64::MAX.
  • a_64_bit_bound_is_enforced_only_to_f64_precision pins all three points per sign: the exact maximum validates, one
    past it still validates (the limitation), the next representable f64 is rejected.
  • Every int64/uint64 field in both published schemas gained x-bound-exceeds-f64-precision; the hand-composed
    count, exit_code and dropped envelope fields moved to the format annotation their generated siblings already
    carried, so the bound and the disclosure have one source.
  • Docs: docs/reference/cli.md "JSON Schema" states the gap and the annotation, docs/reference/testing.md and the
    fixture README say why the fixtures sit where they do, and control-surfaces.md records why the bound is published
    exact rather than narrowed. CHANGELOG under Unreleased, since the annotation is part of the published surface.

Fixes #179

The integer-bounds fixtures claimed to pin the 64-bit boundary but never came near it: `out-check-errors-above-u64` carried ~1e20, four orders of magnitude past `u64::MAX`, so it would have passed against a bound wrong by nearly any amount. The boundary cannot be pinned exactly — `i64::MAX` and `u64::MAX` are not representable as `f64`, and a stock validator (boon included) compares JSON numbers as `f64`, so it admits everything within one `f64` step of the bound. This moves the fixtures to the first value past that step, the closest a validator can reject, adds the signed twin that was missing, and pins the remaining gap as its own test so a future validator that closes it fails loudly instead of leaving the fixtures quietly over-strict. The published bounds stay exact rather than narrowing to what a validator can enforce (narrowing would reject counts the daemon really emits); `x-bound-exceeds-f64-precision` discloses the gap the same way `x-max-utf8-bytes` discloses the id byte limit. - `out-check-errors-above-u64.json` now carries `18446744073709555712` (`2^64 + 4096`, the first `f64` above the bound) against its exact-`u64::MAX` twin; new `out-capture-row-above-i64.json` does the same for `CaptureRow.row` with `9223372036854777856` (`2^63 + 2048`) against exact `i64::MAX`. - `a_64_bit_bound_is_enforced_only_to_f64_precision` pins all three points per sign: the exact maximum validates, one past it still validates (the limitation), the next representable `f64` is rejected. - Every `int64`/`uint64` field in both published schemas gained `x-bound-exceeds-f64-precision`; the hand-composed `count`, `exit_code` and `dropped` envelope fields moved to the `format` annotation their generated siblings already carried, so the bound and the disclosure have one source. - Docs: `docs/reference/cli.md` "JSON Schema" states the gap and the annotation, `docs/reference/testing.md` and the fixture README say why the fixtures sit where they do, and `control-surfaces.md` records why the bound is published exact rather than narrowed. CHANGELOG under Unreleased, since the annotation is part of the published surface. Fixes #179
schema: pin the 64-bit bounds at the precision a validator has
Some checks failed
bench / Criterion full-suite snapshot (pull_request) Has been skipped
fuzz / cargo fuzz nightly long-run (pull_request) Has been skipped
darwin / detect relevant changes (pull_request) Successful in 3s
darwin / darwin docs-only no-op (pull_request) Has been skipped
bench / Criterion regression gate (pull_request) Successful in 2m5s
darwin / build felis (aarch64-darwin) (pull_request) Successful in 50s
fuzz / cargo fuzz smoke (per target) (pull_request) Successful in 1m16s
pr / nix flake check (pull_request) Successful in 35s
pr / cargo build / clippy / test / deny (pull_request) Failing after 1m36s
pr / wire schema is compatible with the base (pull_request) Successful in 18s
pr / frontend smoke (x86_64-linux) (pull_request) Successful in 1m13s
pr / publish felis (x86_64-linux) (pull_request) Has been skipped
windows / detect relevant changes (pull_request) Successful in 3s
windows / windows docs-only no-op (pull_request) Has been skipped
windows / cargo nextest (Windows) (pull_request) Successful in 4m56s
windows / frontend smoke (Windows) (pull_request) Successful in 2m7s
windows / package felis (x86_64-pc-windows-msvc) (pull_request) Has been skipped
windows / cargo clippy (Windows cross) (pull_request) Has been cancelled
948bb77283
The integer-bounds fixtures never reached the boundary they claimed.
`out-check-errors-above-u64` carried ~1e20, four orders of magnitude
past `u64::MAX`, so it would have passed against a bound wrong by any
amount short of that; nothing sat where a wrong bound actually shows.

The boundary cannot be reached exactly: `i64::MAX` and `u64::MAX` are
not representable as `f64`, and a stock validator compares JSON numbers
as `f64`, so it admits everything within one `f64` step of the bound.
The fixtures now sit at the first value past that step, the closest a
validator can reject, and a test pins the gap itself, so a rejection
one past the maximum would fail loudly rather than silently make the
fixtures over-strict.

The published bounds stay exact rather than narrowing to what a
validator can enforce: narrowing would reject counts the daemon really
emits, and `x-bound-exceeds-f64-precision` discloses the gap the same
way `x-max-utf8-bytes` discloses the id byte limit. The envelope's
`count`, `exit_code` and `dropped` move to the `format` annotation the
generated fields already use, so the bound and the disclosure have one
source.

Assisted-by: Claude Code
natsukium force-pushed issue-179 from 948bb77283
Some checks failed
bench / Criterion full-suite snapshot (pull_request) Has been skipped
fuzz / cargo fuzz nightly long-run (pull_request) Has been skipped
darwin / detect relevant changes (pull_request) Successful in 3s
darwin / darwin docs-only no-op (pull_request) Has been skipped
bench / Criterion regression gate (pull_request) Successful in 2m5s
darwin / build felis (aarch64-darwin) (pull_request) Successful in 50s
fuzz / cargo fuzz smoke (per target) (pull_request) Successful in 1m16s
pr / nix flake check (pull_request) Successful in 35s
pr / cargo build / clippy / test / deny (pull_request) Failing after 1m36s
pr / wire schema is compatible with the base (pull_request) Successful in 18s
pr / frontend smoke (x86_64-linux) (pull_request) Successful in 1m13s
pr / publish felis (x86_64-linux) (pull_request) Has been skipped
windows / detect relevant changes (pull_request) Successful in 3s
windows / windows docs-only no-op (pull_request) Has been skipped
windows / cargo nextest (Windows) (pull_request) Successful in 4m56s
windows / frontend smoke (Windows) (pull_request) Successful in 2m7s
windows / package felis (x86_64-pc-windows-msvc) (pull_request) Has been skipped
windows / cargo clippy (Windows cross) (pull_request) Has been cancelled
to b9631297b5
All checks were successful
bench / Criterion full-suite snapshot (pull_request) Has been skipped
fuzz / cargo fuzz nightly long-run (pull_request) Has been skipped
darwin / build felis (aarch64-darwin) (pull_request) Successful in 53s
fuzz / cargo fuzz smoke (per target) (pull_request) Successful in 1m8s
bench / Criterion regression gate (pull_request) Successful in 2m1s
darwin / detect relevant changes (pull_request) Successful in 3s
darwin / darwin docs-only no-op (pull_request) Has been skipped
pr / nix flake check (pull_request) Successful in 6s
pr / wire schema is compatible with the base (pull_request) Successful in 8s
pr / cargo build / clippy / test / deny (pull_request) Successful in 1m47s
pr / frontend smoke (x86_64-linux) (pull_request) Successful in 59s
pr / publish felis (x86_64-linux) (pull_request) Has been skipped
windows / detect relevant changes (pull_request) Successful in 3s
windows / windows docs-only no-op (pull_request) Has been skipped
windows / cargo nextest (Windows) (pull_request) Successful in 4m56s
windows / cargo clippy (Windows cross) (pull_request) Successful in 14s
windows / frontend smoke (Windows) (pull_request) Successful in 2m38s
windows / package felis (x86_64-pc-windows-msvc) (pull_request) Has been skipped
2026-09-08 21:22:10 +09:00
Compare
natsukium deleted branch issue-179 2026-09-08 22:14:16 +09:00
Sign in to join this conversation.
No description provided.