Skip to content

render_osm/render_python: merge colliding rail tiles + CLASS_ID as ClassVar (#154 review)#155

Merged
AdaWorldAPI merged 1 commit into
mainfrom
claude/osm-emit-review-fixes
Jul 5, 2026
Merged

render_osm/render_python: merge colliding rail tiles + CLASS_ID as ClassVar (#154 review)#155
AdaWorldAPI merged 1 commit into
mainfrom
claude/osm-emit-review-fixes

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

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_a rail keys normalise to the same emitted identifier
(foo? and foo both → foo), the loop continue-skipped the second and the
tile 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_osm had the same latent drop —
fixed in lockstep.

2. CLASS_ID as ClassVar (Codex P2, #154)
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): stable per-class identity, not
mutable record data.

Verified

  • Snapshots regenerated (source re-cloned): 50 models + 318 DO-arm fns
    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-domain builds; py_compile green.
  • CLASS_ID no longer appears in dataclasses.fields(Node) (verified:
    fields = ['changeset','old_nodes','way_nodes'], Node.CLASS_ID == 0xf01).
  • Re-exported osm.nodes.show callable.

#153's one review thread was already outdated — it flagged the -ies→Movy
inflector 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

…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
@AdaWorldAPI AdaWorldAPI merged commit 76dcb27 into main Jul 5, 2026
2 checks passed
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.

2 participants