#124: Finland's remaining R-checks as acceptance tests (R46/R47, R74, R94, R105, R119) #137
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!137
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-124-fi-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 #124
#124: Finland's remaining R-checks as acceptance tests (R46/R47, R74, R94, R105, R119)
Part of the #115 plan. The manual R-checks still listed as candidates for Finland in
docs/country-requirements.md are now acceptance tests in
conf/fimap.yaml; the fimaprun goes 12 -> 26 tests, all passing. Config + doc only — no import was needed,
every test reads data already live in the DB.
What ships
(live 1:398015 > 2:165219 > 3:48532 > 4:11557 > 5:3673, the #121 shape check), and
the coarse zooms stay the documented R47 truncation: z9 4 430 lines against
Sweden's 44 559, z6 111 against 4 655 — an order of magnitude fewer at both zooms,
because only 36312 (2–5 m) is imported and the 16.6M-row 36311 headwater class
stays out. The bounds sit between the live measurements and a complete network
(Sweden-scale), so importing 36311 — the documented fix — fires this test; the
fix PR then updates it. That is the record R47 asks for. Note: the doc's original
figures (3 353 / 12, and the whole histogram) predate the #40 bridges and #62
stitch, which rebuilt the network and lifted both countries' ladders —
docs/country-finland.md's table is refreshed with the live measurement and points
at the test as the standing record.
points (852 = 534 rail of which 359 named / 175 unnamed + 30 metro + 288 tram), and
every NULL-name row is a rail site — a NULL-name metro or tram stop would be a
dropped-name bug, not a documented absence.
the map: Helsingin yliopisto and Aalto-yliopisto on the stations, Saimaa and the ten
lakes on water_bodies, Mänttä-Vilppula on places, no all-caps anywhere. This is the
issue's "assert the known fixed forms" candidate; #130's per-layer R94 tests remain
the blanket-rule half. Merge dependency: the fixed forms are live only because
#130's workers reimported the consumers with the
fi_paikannimi_casedpass — on afresh import from a config without #130 the forms revert to initcap and this test
fires. #130 is ahead of #124 in the queue (issue comment 2026-08-15); merge #124
after it, or together.
requires:list is exactly the 15-namestaging:block (the #123 trap: naming atable the config does not declare silently disables the check).
declared range is empty,
pg_relation_sizeso it costs nothing. The layers withzoom_filtersrecord that none empties a zoom; two deliberate empties are recorded,not fixed:
map_water_bodies_3_fi— the 4-px² floor drops every lake piece (the sameproperty as every other country); the test asserts z4–z14.
map_water_points_8_fi…map_water_points_10_fi— the z10falsefilter("Finland draws no water point below z11", the layer comment's Finland-specific
rule); the test asserts z11–z14.
which enumerate every country's partitions including fi.)
Not shipped
Nothing: every candidate passed against the live DB. The one surprise is that the
documented R47 histogram and z9/z6 figures in docs/country-finland.md were stale — the
live build (with #40 bridges and #62 stitch) shows a much healthier top rung than the
doc's 08-03 measurement (imp5 3 673 vs 479), but the truncation's map-visible
signature (z9/z6 an order of magnitude below Sweden) still holds and is what the test
encodes.
Verification (live DB, no writes)
Review
Verified:
go test ./...green, and the fimap suite runs 26/26 against the live database — the "12 → 26 tests, all passing" claim holds exactly. The R105requires:list matches thestaging:block precisely (15 and 15, no extras, no omissions). Every R119 table list matches its layer's declared zoom range, and the one omission is real:map_water_points_{8,9,10}_fiare genuinely 0 rows while z11 holds 36 689, matching the "z10-filter empties" the test title names.R47's half is a one-sided bound that asserts the bug is still present
The PR body is upfront that importing 36311 fires this test, and I agree that recording the gap is the right instinct — R47 asks for exactly that. The problem is the direction of the bound. Live is z9 = 4 430 and z6 = 111 against ceilings of 10 000 and 1 000, so any value below those passes: if the coarse cascade regressed and z9 collapsed from 4 430 to 40, this test goes green.
The Horton ladder half does not cover that gap, because z9 and z6 are derived downstream of the z14 histogram — the ladder can be perfect while the coarse tables are broken. The R119 test catches a collapse all the way to zero (
pg_relation_size > 0), but not a collapse to a handful of rows.A two-sided window (
BETWEEN 2000 AND 10000, say) would keep the record of the truncation and make the check fail on the regression it currently can't see. It also keeps the "importing 36311 fires this test" property you want.Blocker for the merge:
fi_paikannimi_casedwill fall out of R105's coverage#113 (PR #130) adds a 16th Finland staging table,
fi_paikannimi_cased. This PR's R105 test names 15:fi_paikannimi_casedwould be uncovered, which silently breaks the invariant this test's own comment states — "The list must be thestaging:block's list, and nothing else." And because the whole point of the R94 casing work is that all five consumers read one shared pass, a silently-emptyfi_paikannimi_casedis precisely the failure R105 exists to catch.Whoever resolves the merge needs to add it to both the
requires:list and theUNION ALLbody.Merge order
conf/fimap.yamlconflicts with #130 (both addacceptance_tests:towater_bodiesandstations), anddocs/country-requirements.mdconflicts with #123/#136 once either lands. All of them are additive — both sides want their block kept — so they are mechanical, but they need a human at the merge rather than a button.7f72b74034to683e950bcbRebased onto
issue-123-pl-acceptance-tests(#136), and the R105 gap from the review is fixed here:Force-pushed
7f72b74 → 683e950. This is the branch that carried all the real conflicts, so here is what was resolved and why.R105 now covers all 16 Finland staging tables
fi_paikannimi_casedis on therequires:list and in theUNION ALLbody, and the test reportstables=16against the live DB. Since this branch now sits downstream of #130, the test could simply be written correctly rather than needing a follow-up commit.The comment says why this one matters more than the other fifteen — it is the shared casing pass that places, stations, railways and water_bodies all read, so an empty
fi_paikannimi_casedwould strip names from every label layer at once and each layer's own R94 test would report the symptom without naming the cause.conf/fimap.yaml— two conflicts, both additivewater_bodiesandstationseach had #113's R94 test and this PR's R119/R74 tests landing under the same newacceptance_tests:key. Both sides kept, nothing dropped. All four R94 tests plus R74 and the R119 pair now coexist and pass.docs/country-requirements.md— three conflictsstaging:block outgrows its R105 test loses the check silently, for exactly the table nobody has exercised yet.Verification
go test ./...green. Full acceptance run against the live database on the chain tip:R105 exactness re-checked mechanically after the merge: fimap staging 16 / requires 16 / body 16, plmap 24 / 24 / 24, no drift either way.
The R47 one-sided-bound finding from my earlier review is untouched — that is a judgement call for you, not a merge artefact.