Skip to content

Track and GeometryEncoding: one geometry shape, and the encoding named apart from it - #1210

Open
EgorPPS wants to merge 1 commit into
mainfrom
add-track-and-geometry-encoding
Open

EgorPPS wants to merge 1 commit into
mainfrom
add-track-and-geometry-encoding

Conversation

@EgorPPS

@EgorPPS EgorPPS commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Two platforms had independently written byte-identical route blocks inside differently-named envelopes: W3DS Health's Workout (a polyline5 route) and Meshenger's live location share. Neither was registered, so a reader arriving at somebody's vault cannot tell that one shape serves both, and has to know which application wrote which record in order to find a route at all. That is the split this fixes.

Track carries geometry and says nothing about why the thing moved

A run, a commute and a parcel delivery are the same geometry. The meaning belongs to whatever record points at the track, not to the track. So Track's subject is a thing, not an eName: a parcel's movement belongs to no account, and narrowing the subject to people is precisely what forced the duplicate shapes in the first place.

GeometryEncoding is a published list, in the same style as Domain

GeoJSON is canonical, as FieldBoundary already uses. polyline5 is declared as an encoding of it rather than a peer, with its mapping stated: lossy at five decimals, and latitude-first where GeoJSON is longitude-first. That axis difference does not fail loudly — it silently places a point in another hemisphere — so it is written down once here instead of being rediscovered by every reader.

The encoding is separate from the shape rather than embedded in it, because an encoding is reusable by more than one shape (a polyline can encode a polygon ring). Adding one then stays a single change to a single file.

Two rules travel with the list, because they generalise past geometry

  1. A reader may REFUSE an encoding it does not know, but must never REWRITE the declared value. A record would then decode as something it never claimed to be. This is not hypothetical: the bug that prompted it set format: "polyline5" unconditionally, so somebody else's polyline6 or GeoJSON track would have been relabelled by our own hand and then misdecoded by an order of magnitude.
  2. pointCount is required, so a reader that cannot decode the data still knows whether there was anything to decode. An unknown encoding with pointCount above zero must say so rather than render as empty — an empty drawing is indistinguishable from an absent one.

Checks

No duplicate schemaId across the repository's existing schemas; both domain values exist in domain.json; both files parse.

Provenance and one disclosure

Carved with the DigitalSelf platform over several rounds, after the question was put plainly: how is a reading application supposed to know that one app recorded a position share and another recorded a workout? The direction chosen was a graph of triples — geometry apart from activity apart from sport — rather than a new entity type per use.

Disclosure: Meshenger is already writing Track under the schemaId in this branch, on a small number of records. Adopting the id before the merge was deliberate — migrating a one-day-old envelope with a handful of records costs less than re-minting later — but it does mean that if review wants a different id or shape, say so and we will migrate rather than argue from installed base.

Two platforms had independently written byte-identical route blocks inside
differently-named envelopes: W3DS Health's Workout (polyline5 route) and
Meshenger's live location share. Neither is registered, so a reader arriving
at somebody's vault cannot tell that one shape serves both, and must know
which application wrote which record in order to find a route at all.

Track carries the geometry and says nothing about why the thing moved. A run,
a commute and a parcel delivery are the same geometry; the meaning belongs to
whatever record points at the track. Its subject is a THING rather than an
eName, because a parcel's movement belongs to no account and narrowing it to
people is what forced the duplicate shapes.

GeometryEncoding is a published list in the same style as Domain — the list
itself, not a copy of it. GeoJSON is canonical, as FieldBoundary already uses,
and polyline5 is declared as an encoding OF it rather than as a peer, with its
mapping stated: lossy at five decimals, and latitude-first where GeoJSON is
longitude-first. That axis difference does not fail loudly; it places a point
in another hemisphere, so it is written down once here instead of being
rediscovered by each reader.

Separating the encoding from the shape rather than embedding it: an encoding
is reusable by more than one shape (a polyline can encode a polygon ring), so
adding one stays a single change to a single file.

Two rules live with the list because they generalise past geometry. A reader
may REFUSE an encoding it does not know, but must never REWRITE the declared
value — a record then decodes as something it never claimed to be. And
pointCount is required so that a reader which cannot decode the data still
knows whether there was anything to decode: an unknown encoding with
pointCount above zero must say so rather than render as empty, because an
empty drawing is indistinguishable from an absent one.

Checked against the repository's own rules: no duplicate schemaId across the
73 schemas, both domains exist in domain.json, both files parse.
@EgorPPS
EgorPPS requested a review from coodos as a code owner October 28, 2026 09:32
@coderabbitai

coderabbitai Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 95c699db-e8a7-404f-941d-afadb950f173
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant