public.wsg_outlet (per-WSG outlet wscode_ltree) drives study-area drainage
closure + downstream-first ordering via fresh::frs_wsg_drainage() ->
link::lnk_wsg_resolve(). No repo builds it — it is an assumed-preexisting fwapg
table, "materialized ad-hoc," so it vanishes when the local docker volume is
recreated. Symptom: test-lnk_wsg_resolve.R closure-mode tests error
relation "public.wsg_outlet" does not exist.
Related footgun: data-raw/wsg_run_one.R computes a WSG's access on whatever
downstream barriers happen to be persisted, with no guard — run standalone on an
empty/incomplete DB it silently misses downstream dams.
Two fixes:
- A reproducible
wsg_outlet builder (fresh data-raw/ or documented SQL) wired
into setup so it survives volume rebuilds.
- A precondition guard so a single-WSG run fails loud if its downstream closure
is not persisted.
Surfaced during #223 validation. NOT a #223 correctness issue — the single-WSG
re-runs were correct because full provincial state pre-existed (proven by exact
dam_dnstr_ind match on FINA/PCEA). Relates to #223.
public.wsg_outlet(per-WSG outletwscode_ltree) drives study-area drainageclosure + downstream-first ordering via
fresh::frs_wsg_drainage()->link::lnk_wsg_resolve(). No repo builds it — it is an assumed-preexisting fwapgtable, "materialized ad-hoc," so it vanishes when the local docker volume is
recreated. Symptom:
test-lnk_wsg_resolve.Rclosure-mode tests errorrelation "public.wsg_outlet" does not exist.Related footgun:
data-raw/wsg_run_one.Rcomputes a WSG's access on whateverdownstream barriers happen to be persisted, with no guard — run standalone on an
empty/incomplete DB it silently misses downstream dams.
Two fixes:
wsg_outletbuilder (freshdata-raw/or documented SQL) wiredinto setup so it survives volume rebuilds.
is not persisted.
Surfaced during #223 validation. NOT a #223 correctness issue — the single-WSG
re-runs were correct because full provincial state pre-existed (proven by exact
dam_dnstr_indmatch on FINA/PCEA). Relates to #223.