You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Snapshot bcfp dependencies into local fwapg fresh.* schema so Surface 2 mapping_code (lnk_pipeline_access / lnk_pipeline_mapping_code) works against local data without tunnel reads at runtime.
Weekly drift-monitor pattern, same shape as #117 (auto-merge clean / halt on shape drift):
Wed cron (after db_newgraph#4 populates s3) → pull view shapes from s3://newgraph/*.fgb.zip
→ pull bchamp gpkg layer schema
→ crate schema-validate against committed fingerprints
↓
baseline-row append only → auto-merge PR
fingerprint shift (column add/drop) → halt + review
no change → exit clean
PR'd artifacts:
Appended row in data-raw/logs/bcfp_baselines.csv (model_run_id, model_version, date_completed).
Updated schema fingerprints in inst/extdata/bcfp_view_schemas/<view>.json (column lists per fgb).
Optional sample fixtures in inst/testdata/ for unit tests.
crate gate: crt_schema_validate against the committed fingerprints. Catches when bcfp views or the bchamp gpkg add/rename/drop columns.
Auto-merge: baseline-row append only (proves the snapshot ran with stable shapes).
Halt + review: schema fingerprint shift — real work for link to track.
Snapshot side effect: workflow can also run snapshot_bcfp_dependencies.sh against a long-lived cypher schema so parity runs see fresh data. Either via tailscale-bridged GHA or a self-hosted runner.
Acceptance
data-raw/snapshot_bcfp_dependencies.sh runs end-to-end against local fwapg with no SSH/tunnel access.
lnk_pipeline_access(barrier_sources = list(anthropogenic = "fresh.barriers_anthropogenic", ...)) returns matching counts to a tunnel-pointed run.
Plan (revised 2026-05-07)
Snapshot bcfp dependencies into local fwapg
fresh.*schema so Surface 2 mapping_code (lnk_pipeline_access/lnk_pipeline_mapping_code) works against local data without tunnel reads at runtime.Inputs (no tunnel pg_dump needed)
bcfishpass.*views — pull from public S3:aws s3 cp s3://newgraph/bcfishpass.crossings_vw.fgb.zip→ogr2ogr → fresh.crossingsaws s3 cp s3://newgraph/bcfishpass.streams_vw.fgb.zip→ogr2ogr → fresh.streams_bcfp(if needed for parity comparison)aws s3 cp s3://newgraph/bcfishobs.fiss_fish_obsrvtn_events_vw.fgb.zip→ ogr2ogr →fresh.fiss_fish_obsrvtn_eventscurl https://nrs.objectstore.gov.bc.ca/bchamp/modelled_stream_crossings.gpkg.zip+ogr2ogr→fresh.modelled_stream_crossings(mirrorsbcfishpass/jobs/load_modelled_stream_crossings).s3://fresh-bc/bcfishpass/csvs/(populated by NewGraphEnvironment/db_newgraph#4). csv-sync: switch to weekly cadence SHA-pinned to tunnel rebuild for comparison stability #117 wires this for the link bundle.Habitat: use link's per-species tables, not bcfp's wide rollup
lnk_pipeline_mapping_codecurrently takes bcfp'sstreams_habitat_linearshape (numeric km columns). Adapt to consume link's per-species<bundle>.streams_habitat_<sp>tables (booleans):habitat_per_sp = list(bt = "...streams_habitat_bt", ...).> 0/< 1CASE conditions work without rewrite.No
streams_habitat_lineardependency on tunnel.Run
data-raw/snapshot_bcfp_dependencies.sh— manual run on demand by anyone with local fwapg write access. ~5 min end-to-end (no SSH, no pg_dump).SHA pinning
bcfp_baselines.csvwith themodel_run_id+model_versionfroms3://fresh-bc/bcfishpass/log.json. Same paper trail as csv-sync: switch to weekly cadence SHA-pinned to tunnel rebuild for comparison stability #117.Automation
Weekly drift-monitor pattern, same shape as #117 (auto-merge clean / halt on shape drift):
data-raw/logs/bcfp_baselines.csv(model_run_id,model_version,date_completed).inst/extdata/bcfp_view_schemas/<view>.json(column lists per fgb).inst/testdata/for unit tests.crt_schema_validateagainst the committed fingerprints. Catches when bcfp views or the bchamp gpkg add/rename/drop columns.snapshot_bcfp_dependencies.shagainst a long-lived cypher schema so parity runs see fresh data. Either via tailscale-bridged GHA or a self-hosted runner.Acceptance
data-raw/snapshot_bcfp_dependencies.shruns end-to-end against local fwapg with no SSH/tunnel access.lnk_pipeline_access(barrier_sources = list(anthropogenic = "fresh.barriers_anthropogenic", ...))returns matching counts to a tunnel-pointed run.lnk_pipeline_mapping_codeconsumes link's per-species habitat tables; ADMS parity preserved..github/workflows/snapshot-bcfp-dependencies.yamlruns Wed, opens PR on drift, auto-merges baseline-only changes.Cross-refs
bcfishpass.crossings+barriers_*snapshot with a link-side build (further reduces footprint).