Commit 06c15db
committed
fix(domain-instances): OSM IDs are flat per-type spaces; adapter constructs prefix from coordinates
Closes Codex P2 on PR #41 (now merged).
# The error
§2.6 said:
> "OSM IDs are *already* prefix-structured
> (`country/region/city/street/house`), so the adapter is doing
> identity-*extraction*, not identity-construction"
That's wrong on two axes:
1. OSM IDs are NOT hierarchical. Per the OSM data model
(https://wiki.openstreetmap.org/wiki/Data_model), Node, Way,
and Relation each have their own per-element-type flat numeric
ID space. `Node 100`, `Way 100`, and `Relation 100` are
unrelated; IDs carry no spatial information.
2. The "country/region/city/street/house" hierarchy I cited is
what Nominatim CONSTRUCTS from geocoding queries — it's an
*output* of geocoding, not a property of OSM IDs. Relying on
identity-extraction from raw OSM IDs would produce non-local
or colliding NiblePath keys (the Codex P2's specific concern).
# The fix
Rewrite the §2.6 lead paragraph to correctly describe:
- OSM elements use per-element-type flat numeric ID spaces (with
Wikipedia-link to the OSM data model spec for citation).
- The adapter does identity *construction*, not extraction:
* Computes the Cesium TMS quadkey FROM the element's
coordinates (for Node/Way with geometry).
* For Relations without coordinates, derives from the
centroid of members OR from an admin_level boundary walk.
* Prepends the quadkey to the per-type OSM ID, yielding
`osm/<quadkey>/<type>/<id>` as the NiblePath form.
- Pins the architectural distinction: "The quadkey IS the spatial
frame; the per-type ID is the leaf inside it."
# Internal consistency
- The "Spatial prefix-locality" bullet's example
`osm/<quadkey>/way/123` matches the corrected lead's form
`osm/<quadkey>/<type>/<id>`. Unchanged.
- The verbatim §6 callout ("Marienplatz is_in Munich in sub-
microsecond") still holds: Marienplatz IS routed via
`osm/<munich-quadkey>/way/<id>`, and `is_in Munich` IS a
quadkey-prefix-containment check. The mechanism is unchanged;
only the lead's origin-story was wrong.
- The §3 capability matrix row "Spatial prefix routing (Cesium
TMS quadkey via NiblePath)" already correctly named quadkey
(not OSM ID) as the prefix source. Unchanged.
- The Q2 coordination outcome (Cesium TMS quadkey as NiblePath)
is unchanged — this fix tightens the prose that explains WHY
the outcome was correct.
# Verification
cargo check --workspace --all-targets -> clean (docs-only)
PII abort-guard (word-boundary) -> CLEAN
# Note
The error was framing-grade, not architecture-grade. The runtime
session's lance-graph PR #473 §2 already correctly specified
"Cesium TMS quadkey as NiblePath prefix" (Q2 outcome) — the
mistake was in my §2.6 lead claiming the prefix came from the
OSM ID structure rather than from the coordinate-derived quadkey.
The corrected text now matches the Q2 outcome's design intent
exactly.
https://claude.ai/code/session_01PBTGaPCSnnt6u3pjXpbLwY1 parent 03b2f87 commit 06c15db
1 file changed
Lines changed: 14 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
133 | 140 | | |
134 | 141 | | |
| 142 | + | |
| 143 | + | |
135 | 144 | | |
136 | 145 | | |
137 | 146 | | |
| |||
0 commit comments