Repository navigation
v0.40.1: lnk_pipeline_run mapping_code uses active_species (#192) - #193
Merged
NewGraphEnvironment merged 3 commits intoMay 19, 2026
Merged
Conversation
…ed bcfp 8 (#192) v0.40.0 hardcoded sp_set = c("bt","ch","cm","co","pk","sk","st","wct") and called lnk_barriers_views without a species arg (defaults to bcfp 8). Working streams_access got 8-species cols; persist streams_access (created by lnk_persist_init with active_species = bundle species) had the bundle subset. Persist INSERT projection failed with ERROR: column a.has_barriers_ko_dnstr does not exist for any bundle that wasn't the full bcfishpass 8. Fix: - lnk_barriers_views(species = active_species) - lnk_pipeline_access barriers_per_sp keyed by active_species - lnk_mapping_code species_<role> args = intersection of bcfp residence defaults with active_species. Species in active_species not in any bcfp residence category (GR/KO/RB in default bundle) fall through to species_resident (placeholder until #189 data-drives this from dimensions.csv). Verified by live smoke: lnk_pipeline_run(aoi="PARS", cfg=lnk_config("default"), mapping_code=TRUE) → fresh_default.streams_mapping_code has 48559 rows for PARS with mapping_code_bt / _gr / _ko / _rb columns populated with valid ACCESS/SPAWN/REAR token distributions. Wall: 213.1s. No regression in bcfishpass-bundle path (active_species = full bcfp 8 → identical behavior to v0.40.0). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The Phase 2 comment in pipeline_run's mapping_code block (post-#192 fix) claimed lnk_barriers_views still created views for all 8 bcfp species and the access call picked a subset. Actually the fix passes `species = active_species` to lnk_barriers_views — views are created only for active species. Comment reworded to match. No functional change. Caught by code-check on the v0.40.1 PR before merge. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
NewGraphEnvironment
deleted the
192-pipeline-run-mapping-code-bundle-species
branch
May 19, 2026 15:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
v0.40.0 hotfix.
lnk_pipeline_run(mapping_code = TRUE)hardcoded the bcfp 8-species set instead of using the bundle'sactive_species→ workingstreams_accesscolumn shape mismatched persiststreams_access(created with bundle species) → INSERT errored on every non-bcfp bundle. Closes #192.Live smoke verified the fix:
lnk_pipeline_run(aoi="PARS", cfg=lnk_config("default"), mapping_code=TRUE)againstfresh_default→ 48559 rows infresh_default.streams_mapping_codefor PARS, populatedmapping_code_bt/_gr/_ko/_rbwith valid ACCESS/SPAWN/REAR token distributions. Wall: 213.1s.Fix
In
R/lnk_pipeline_run.Rmapping_code phase:lnk_barriers_views(species = active_species, ...)— was using bcfp 8 defaultlnk_pipeline_access(barriers_per_sp = setNames(..., active_species))— was hardcoded bcfp 8lnk_mapping_code(species_resident = ..., species_anadromous = ..., species_spawn_only = ...)— intersection of bcfp residence defaults withactive_species; species inactive_speciesnot in any bcfp category (e.g. GR/KO/RB) fall through tospecies_resident. Placeholder until Data-drive species residence (species_resident/anadromous/spawn_only) from dimensions.csv #189 data-drives this fromdimensions.csv.How this got past v0.40.0
The pre-merge code-check rounds caught the bcfp-naming-leakage in
lnk_compare_wsg(Phase 5) and the param shadowing (Phase 6). What they couldn't catch: the species-set assumption baked into pipeline_run's mapping_code phase, because the existing 1119 tests don't exercise that branch with a non-bcfp bundle. The default-bundle smoke (Phase 7) was deferred. #191 tracks the test catch-up that would have caught this.Test plan
/code-checkround 1 caught a misleading comment in the fix (claimedlnk_barriers_viewsstill creates 8 views with caller picking subset; actually creates only active_species views). Fixed in commit 2.devtools::test()1119 PASS / 0 FAIL — covered by pre-existing suiteRelated