Assert the altitude a location carries, and stop claiming a strictness four ports lack - #41
Merged
Merged
Conversation
…s four ports lack Two findings from the cumulative review of v0.4.1..HEAD, both zero-behaviour. `conformance/models.json` asserted latitude, longitude and place on the bounds fixture but never altitude, while three ports had just stopped decoding GeoPoint as a unit and started rebuilding it field by field from a private Wire struct. Dropping `altitude` from any of those mappings passed all thirty-six fixtures in all five ports while every asset silently lost its altitude — the exact failure the round-trip assert exists to catch. Verified by doing it: the Rust mapping now fails with `expected 2835.0, got null`. The docstring added alongside said "GeoPoint stays strict wherever a client sends one". That holds in TypeScript alone; Rust, Python, Kotlin and Swift carry a bare float pair and will send a latitude of 200 happily. Since #27 made every port drop an out-of-range location on the way back, the round trip is silently lossy from those four. The comment now says which port is strict and points at #40, rather than promising a guarantee the contract does not make. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release preparation for v0.5.0. Two significants from the pre-release cumulative review of
v0.4.1..HEAD, both zero-behaviour changes. Closes no issue — this is the "fix what the cumulative review found, then tag" step.1.
conformance/never assertedlocation.altitude59baedeand1dea642moved three ports (Rust, Kotlin, Swift) from decodingGeoPointas a unit to rebuilding it field by field from a privateWirestruct. All three copyaltitudecorrectly — but nothing checked. The bounds fixture's assert block listedlatitude,longitudeandplaceonly, while its payload carriesaltitude: 2835.0.So dropping
altitudefrom any of those three mappings passed all thirty-six fixtures in all five ports while every asset silently lost its altitude. That is precisely the failure CONTRIBUTING says the round-trip assert exists to catch — "a field the type forgot, which would otherwise decode fine and vanish on the way back out".Verified rather than assumed. With
altitude: wire.altitudereplaced byaltitude: Nonein the Rust mapping:Before this change that mutation was green. The assert counts rise accordingly — TypeScript 322 → 323
expect()calls, Swift 228 → 229 checks.2. The new docstring claimed a strictness four ports do not have
All five ports gained the line "Only the response path gives:
GeoPointstays strict wherever a client sends one." That is true in TypeScript, whereGeoPointisz.number().min(-90).max(90). In Rust, Python, Kotlin and Swift it is a baref64/float/Doublepair with no range check, soAssetUploadMetadataandUploadSessionCreatewill sendlatitude: 200without complaint.Since #27 made every port drop an out-of-range location on the way back, the round trip is now silently lossy from those four: upload a coordinate, read it back as
location: null, with nothing anywhere saying why.imogen-clialready reimplements the bounds check itself because the Rust port does not — and its manifest path bypasses even that.The comment in each port now names which port is strict and points at #40, where the actual asymmetry is tracked. Adding request-path bounds to the four is a behaviour change and belongs there, not in a release-prep PR.
Verification
All five ports, from this branch:
clippy --all-targets+fmt --checkcleanFound, not fixed
The same review surfaced three pre-existing items, all now filed and none gating this release: #36 (
favorite: z.coerce.boolean()reads the string"false"astrue— a live data bug that ships in v0.4.1 today), #37 (Swift is the last port with an unescaped upload filename), #39 (the TypeScript conformance suite silently skips ten of thirty-six fixtures), and #40 (the request-path asymmetry above).🤖 Generated with Claude Code