render_osm/render_python: merge colliding rail tiles + CLASS_ID as ClassVar (#154 review)#155
Merged
Merged
Conversation
…ssVar Follow-up to the review on #154 (merged), fixing two emitter defects: - Colliding is_a → dropped tile (Bugbot Medium). When two distinct is_a rail keys normalise to the same emitted identifier (`foo?` and `foo` both → `foo`), the loop `continue`-skipped the second and lost the tile. Both emitters now GROUP by the emitted name and MERGE the colliding keys' sources + labels into one stub (all cited), so no rail tile silently vanishes. The Rust render_osm had the same latent drop; fixed in lockstep. - CLASS_ID as ClassVar (codex P2). The Python model emitted `CLASS_ID: int`, a dataclass INSTANCE field — so it entered __init__/repr/eq and `Node(5)` would set CLASS_ID=5. Now `CLASS_ID: ClassVar[int]` (+ ClassVar import): a stable per-class identity, not mutable record data. Regenerated both snapshots (source re-cloned): 50 models + 318 DO-arm fns unchanged (no collisions in the OSM corpus today — the fix is against the latent case). Verified: osm-domain builds; py_compile green; CLASS_ID no longer appears in dataclasses.fields(Node); re-exported osm.nodes.show callable. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EYvNjD8M8LMNYbRy3gq2FP
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.
What
Follow-up to the Cursor/Codex review on #154 (already merged) — two emitter
defects in
render_osm/render_python.Fixes
1. Colliding rail tiles dropped (Bugbot Medium, #154)
When two distinct
is_arail keys normalise to the same emitted identifier(
foo?andfooboth →foo), the loopcontinue-skipped the second and thetile vanished from the package. Both emitters now group by the emitted name
and merge the colliding keys' sources + labels into one stub (all cited), so
no rail tile is silently lost. The Rust
render_osmhad the same latent drop —fixed in lockstep.
2.
CLASS_IDasClassVar(Codex P2, #154)The Python model emitted
CLASS_ID: int— a dataclass instance field, so itentered
__init__/repr/eqandNode(5)would setCLASS_ID=5. NowCLASS_ID: ClassVar[int](+ClassVarimport): stable per-class identity, notmutable record data.
Verified
unchanged — no collisions in the OSM corpus today, so the collision fix is
against the latent case; the count staying put confirms no regression.
osm-domainbuilds;py_compilegreen.CLASS_IDno longer appears indataclasses.fields(Node)(verified:fields = ['changeset','old_nodes','way_nodes'],Node.CLASS_ID == 0xf01).osm.nodes.showcallable.#153's one review thread was already outdated — it flagged the
-ies→Movyinflector rule, but that whole singulariser was deleted in the final #153
(verbatim now), so it's moot.
🤖 Generated with Claude Code
https://claude.ai/code/session_01EYvNjD8M8LMNYbRy3gq2FP
Generated by Claude Code