feat(search): hard-clip Photon to US + Census lane (PR 1 of 5) - #3
Merged
Conversation
Adds four-lane search (local POI / Census / Photon / discovery) and a
build pipeline that extracts ~100k pre-snapped POIs from the same OSM
PBF the walking graph uses. Discovery lane runs a bounded WASM
Dijkstra so category queries ("coffee", "park") return reachable POIs
ranked by walking minutes, not crow-flight distance.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Five PRs, each independently shippable: (1) tune Photon + Census lane, (2) POI build pipeline + binary, (3) local POI lane, (4) WASM reachable_nodes, (5) discovery lane + map pins. Every task is TDD with concrete code in each step. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Two real bugs surfaced by '485 W Valley Stream Blvd':
- Photon's parameter is `countrycode` (singular), not `countrycodes`.
With the wrong name Photon returned 200 + {message: "..."} (no
`features` key), which silently produced empty dropdowns for ALL
queries since PR 1 went up. Also harden `geocode()` to treat
non-array `features` as empty rather than throwing.
- Census needs a state hint for ambiguous suburban addresses. If the
bare query returns 0 matches AND has no state token, retry with
", NY" / ", NJ" / ", CT" until one matches.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
taddyb
force-pushed
the
feat/richer-geocoding-pr1
branch
from
May 20, 2026 00:22
334fad3 to
f8411ec
Compare
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.
Summary
First PR in the richer-geocoding + discovery rollout (full plan in
docs/superpowers/plans/2026-05-18-richer-geocoding.md, spec indocs/superpowers/specs/2026-05-18-richer-geocoding-design.md— both included in this PR).Search bar gets two immediate, visible improvements without touching the data pipeline:
countrycodes=us) and softly biases to the basemap bbox. Eliminates the failure where140 W 25th Streturned Wyandanch, NY or Ontario, CA./^\d+\s+\S/(digits + space + word). Free, keyless, NY/NJ/CT-filtered.js/search-merge.jsorchestrates lanes with 50 m geographic dedup and a score-based merge — designed to extend in PRs 3 and 5.js/tokenize.jsships a sharednormalize()(build pipeline and runtime will both import it) plus an emptyCATEGORY_KEYWORDSmap filled in by PR 5.tests/unit/runner with 18 passingnode --testcases; CI gate added via.github/workflows/pr-checks.yml.Test plan
node --test tests/unit/**/*.test.mjspasses (18/18) locally140 W 25th Stresolves to Manhattan, not WyandanchSmithtown NYstill resolves (Photon path not regressed)83 Elm Pl Brooklynresolves via CensusSubsequent PRs in this series
🤖 Generated with Claude Code