#123: Poland's remaining R-checks as acceptance tests (R105, R119) #136
No reviewers
Labels
No labels
blocked
claude-wip
map-report
map:is
map:se
needs-review
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
art/ismap!136
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-123-pl-acceptance-tests"
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?
Closes #123
#123 — Poland: acceptance tests for the remaining R-checks
Part of the #115 plan: the manual R-checks still listed as candidates for Poland in
docs/country-requirements.mdare now acceptance tests inconf/plmap.yaml, run onevery import of the layer and in
-acceptance-onlyreview runs. Config + doc only; noimport was needed — every test reads data already live in the DB.
What was added (11 tests, all 10 s bucket; measured 0–1 ms live)
staging:block exactly)Design decisions worth the reviewer's eye
map_water_bodies_3_plandmap_ferries_3_pl…map_ferries_6_plempty. Both are thedocumented-knob case (R31's family), so each test asserts the populated range and names
the empties in its comment:
the same property as every other country (fi 0, is 0 rows at z3). Poland's lone z3
row is the #43 mislabel, which is exactly the bug the R58 fix removes; the test
asserts z4–z14 so it survives that fix unchanged.
min_length_pixels: 1at those zooms is 19.6–2.4 km of ground perpixel, and BDOT10k SKPP carries crossings, not Baltic routes — the longest merged
Polish ferry chain is ~1 km, so nothing survives until z7 (1.2 km/px, 1 row) and the
133 routes only fully appear at z14.
roads' road_class cuts, railways' rail_class cuts, stations' importance cuts or
places' rank caps empties a zoom; each test's comment records the floor count that
proves it.
Recorded, not shipped — the checks that fail against the live data
Three of the issue's candidates are not in this PR because the live DB does not
satisfy them yet. Each is written down with its measurement and its exact fix, so the
fix PR can land it as a fail→pass pair (the #120 pattern; #121 did the same for R139).
polygon is an order-of-magnitude area outlier that sits on the country mask's
boundary", on
water_bodies. Measured live it FAILS — correctly:map_water_bodies_14_plstill carries the 5 845 km² (3857)
Morze Bałtyckieslab (29× the next-largest lake,Śniardwy at 200 km²), sharing 49 km of edge with the national boundary. It survives to
z3 (it is the lone row there). The predicate:
water_class = 'lake' AND area > 10× the second-largest lake AND ST_Intersects(ST_Boundary(poland_mask), geom)— the R58 checkverbatim (order-of-magnitude outlier + seaward-edge cross-check). The fix is #43's
option 2 ("exclude by geometry"); I commented #43 with the measurement and this
predicate, so the fix PR is a ~5-line query change plus a cheap water_bodies reimport.
check,
count(*) = 0 FROM map_roads_14_pl WHERE ref ~ '[;,]'. Measured live it FAILS:114 rows still carry comma-delimited refs (
75, 28× 82,964,768,222, 211207G, 211208G, …). The #19 split handles the;form (E77;S7;62— issue #39) but not thecomma form BDOT10k also delivers; the fix is extending
regexp_replace(numerdrogi, ';', '|', 'g')to'[;,]'plus a roads reimport. Filed asa new issue (the fix + test land together).
WHERE INsync is a staticproperty of the config text; no SQL can witness it without duplicating the very list
the check is meant to keep singular (that duplicate would be the drift hazard). It is a
query-comment review surface — recorded as such in the doc. The #123 pass did the
review: every Polish
CASEis total (single-kind BDOT10k files, R43's own allowance),and the one shared-column
WHERE IN/CASE pair (water_points'rodzaj IN ('wodospad', 'źródło')) matches —źródłois theELSE's referent, the least-specific class stillcorrect for the file. Same shape as #121's R50/R51 and #122's R92 records.
Verification (live DB, no writes)
New-test highlights from the plmap run:
Merge interaction
#122's PR (#134) is open and touches the same R119 paragraph in
docs/country-requirements.md; whoever merges second needs a small doc rebase to foldthe Sweden and Poland paragraphs together. Nothing else overlaps.
Nothing left undone that I know of: R58's and R63's tests ship with their fix PRs (both
specified above and tracked — #43 commented, new issue filed for the comma split), and
R43 is recorded as a review surface.
Review
Verified:
go test ./...green, and the plmap suite runs 24/24 against the live database. Two checks I made against the config and the data rather than taking the PR body's word for it, both clean:requires:, no extras and no omissions. The comment's argument for why that exactness matters (requires:disables the test rather than strengthening it when it names a table the config doesn't declare) is the right reasoning and worth having written down.map_ferries_{3,4,5,6}_plare 0 rows with z7 at 1, and every R119 table list matches its layer's declared zoom range with only the documented gaps missing.The ferries test is the right shape for a documented knob
Worth calling out because the parallel PR does it differently: this test asserts only that z7–z14 are populated, and says nothing about z3–z6. So when someone eventually tunes
min_length_pixelsand the coarse zooms fill in, the test stays green — it records the current floor without freezing it. #124's R47 check takes the opposite approach (an upper bound that fires when the documented fix lands), and I think yours is the better default: a test that goes red when a bug is fixed trains people to edit tests reflexively.Minor: Poland's z3 is not actually empty
The test title reads
R119: no water_bodies zoom table is empty (z4–z14; z3 is the deliberate empty), but Poland's z3 has a row:The exclusion from the list is still right — one row at z3 is the same "everything below the area floor" story, and the shared-contract reasoning in the comment already records
pl 1 rowsaccurately. It is only the title that overstates it for Poland specifically. Something likez3 is below the area floorwould match both the data and the comment.Merge order
docs/country-requirements.mdconflicts with #124/#137 once either lands — additive on both sides, so mechanical, but it needs a human at the merge.5e9513cff4to305e1f3113Rebased onto
issue-122-se-acceptance-tests(#134):Force-pushed
5e9513c → 305e1f3. One conflict resolved, indocs/country-requirements.md§14: Sweden's and Poland's R119 paragraphs both appended to the same spot and both ended in the fragment that joins to "manual form:". Kept both paragraphs, dropped the duplicated connector from Sweden's.Re-verified after the rebase:
go test ./...green, plmap 24/24 against the live DB.