Thread per-WSG cw/mad habitat model through classify (#286) - #298
Merged
NewGraphEnvironment merged 9 commits intoOct 2, 2026
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
fresh 0.35.0 added params_method to frs_habitat_classify(); the floor moves there and Remotes to the latest tag. lnk_preflight_fresh() gains required_formals so an install that exports the function but predates the argument fails before a WSG reaches classify. fresh 0.36.0 reversed frs_db_conn()'s env precedence (PG* before PG_*_SHARE). The vignette context fetch moves to lnk_db_conn(), which still reads PG_*_SHARE first, and stale v0.33.0 / frs_db_conn() notes are corrected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
Each base bundle declares parameters_habitat_method.csv, a frozen copy of bcfishpass example_newgraph (188 groups, all cw). Its provenance source is deliberately not the bcfishpass URL: csv-sync auto-merges any entry with that source, which would let an upstream cw -> mad flip change default unreviewed. A bundle that declares none falls back to fresh's copy, hashed into config_hash by a fixed name. The discharge table joins log_input's primitives, and the thresholds dictionary no longer says *_mad_* never apply. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
lnk_pipeline_classify() resolves method_csv (argument, then the bundle's files, then fresh's copy) and hands it to fresh as params_method. Prepare joins mad_m3s from fwa_stream_networks_discharge onto the working streams only; the persisted shape is unchanged. A mad group skips the stream-order rearing bypass, which bcfishpass applies in its cw branch alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
ADMS and BULK classify byte-identically on branch and main, on fresh 0.33.0 and 0.36.2, and with or without mad_m3s on the working streams. Putting ADMS on mad keeps every stream segment inside its MAD range and removes all BT/RB stream habitat; BULK, which has no discharge, loses all stream habitat without an error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
NewGraphEnvironment
deleted the
286-thread-fresh-params-method-per-wsg-cw-ma
branch
October 2, 2026 07:07
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
parameters_habitat_method.csv(cwormad).lnk_pipeline_classify()passes it tofresh::frs_habitat_classify(params_method =), and a newmethod_csv =argument overrides it. A custom bundle without the file falls back to fresh's copy, which is hashed intoconfig_hash.cw: a frozen copy ofsmnorris/bcfishpass@1fae4eaparameters/example_newgraph. They are deliberately not csv-synced.sync_bcfishpass_csvs.Rselects onsource:, and byte drift auto-merges, so an upstreamcw→madflip would otherwise have changeddefaultunreviewed.mad_m3sis joined onto the working streams fromfwa_stream_networks_discharge. It is never persisted, so the persist shape is unchanged.log_inputnow fingerprints the discharge table.madgroup skips the stream-order rearing bypass; bcfishpass applies it only in its cw branch.lnk_preflight_fresh()gainsrequired_formalsand asserts theparams_methodargument rather than a version.frs_db_conn()'s env precedence.data-raw/wsg_vignette_data.Rtherefore moves tolnk_db_conn().Related Issues
Test plan
devtools::test(): FAIL 0, PASS 2298, WARN 16 (the warning baseline).devtools::check(): 0 errors. The 3 warnings and 3 notes were already there; no added line is non-ASCII.default). The per-speciesstreams_habitatdigests are identical across branch, main + fresh 0.36.2, and main + fresh 0.33.0, on ADMS (5 species) and BULK (7 species). ADMS also matches withmad_m3sdropped.mad. No stream segment falls outside its MAD range, and BT/RB lose all stream habitat. BULK onmad(no discharge coverage) loses all stream habitat, without an error.test-lnk_log.Rred./code-checkrounds plus a plan review. One real bug was found (the csv-sync enrollment) and fixed.Evidence:
data-raw/logs/params_method_286/. Mechanics: RUNBOOK §7, "Channel width or discharge, per watershed group".Notes
config_hashchanges for every bundle, because a new file is declared. No model output changed.lnk_habitat_validate()is still cw-only. A follow-up issue body is drafted inplanning/archive/2026-10-issue-286-params-method/findings.mdand has not been filed.cw.Draft NEWS (for the release commit):
🤖 Generated with Claude Code
https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx