Match "North Kerby Avenue" to "N Kerby Ave." when deduplicating #2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/address-normalisation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The 2026 form has its first real response and it reads "3704 North Kerby Avenue". The 2025 export has "3704 N Kerby Ave." for the same house.
addressKeylower-cased and squashed whitespace, so those were two different keys. Consequences: the deduplication misses and the map grows a second pin on a house that signed up once, and the geocoder is called again for an address already in the cache.Found by rendering the site against the real published sheet instead of the 2025 fixture.
Solution
addressKeymaps spelled-out directions and street types onto their abbreviations before keying, so both spellings collapse to3704 n kerby ave. A direction word that is also part of a street name still survives —100 N North Aveand100 N Avestay distinct, and there's a test for it.The geocode cache is re-keyed to the same normal form. Two of its 34 entries moved (
375 northeast shaver street apt 502,750 n fremont street). Re-running the pipeline against the 2025 CSV makes zero network calls, so nothing was orphaned.Verification
bunx tsc --noEmitcleanbun test— 13 pass, 0 failbun run convert-csvstill keeps 33 sales and drops the same 2, with no geocoding🤖 Generated with Claude Code
https://claude.ai/code/session_01PyCzDSqUNGDS5W3bznaQW5
The 2026 form already has its first real response, and it reads "3704 North Kerby Avenue". The 2025 export has "3704 N Kerby Ave." for the same house. addressKey lower-cased and squashed whitespace but treated those as two different addresses, so the deduplication would have missed and the map would have grown a second pin on a house that signed up once. It would also have re-geocoded an address already in the cache. addressKey now maps spelled-out directions and street types onto the abbreviations before keying, so the two forms collapse. A direction that is also part of a street name still survives, which the tests cover. The geocode cache is re-keyed to the same normal form. Two of its 34 entries moved ("375 northeast shaver street apt 502" and "750 n fremont street"), and re-running the pipeline against the 2025 CSV makes zero network calls, so nothing was orphaned. Verified the tests fail against the old implementation before they passed against the new one: two of them, on exactly the two conversions. Found by rendering the site against the real published sheet rather than the 2025 fixture. Same run surfaced two copy defects in the mock, fixed there: a street name that came out "North kerby", and a tally that said "1 sales". Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PyCzDSqUNGDS5W3bznaQW5