Skip to content

MAD (discharge) ranges for BT, GR, KO and RB in default_tuned, scored on held-out groups (#302) - #303

Merged
NewGraphEnvironment merged 11 commits into
mainfrom
302-tune-mad-discharge-thresholds-for-bt-gr-
Oct 2, 2026
Merged

NewGraphEnvironment merged 11 commits into
mainfrom
302-tune-mad-discharge-thresholds-for-bt-gr-

Conversation

@NewGraphEnvironment

Copy link
Copy Markdown
Owner

Summary

Related Issues

Test plan

Notes

  • Decisions you made mid-run:
    • a thin spawn cell falls back to any stage;
    • the expected-count floor is the floor of record;
    • an underpowered walk lands P05, unscored.
  • Not filed: a fresh issue. fresh's main rear predicate ignores a wetland rule's wetland_ha_min. The draft is in the session for your review.
  • NEWS and the version bump are left for the release commit (/gh-pr-merge).
  • Runs: build 145 min, 20-group closure, schemas score302_* / working_score302_* in local docker fwapg.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx

NewGraphEnvironment and others added 11 commits October 2, 2026 07:24
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
data-raw/query_habitat_thresholds_mad.R measures mean annual discharge at
fish observation locations for BT, GR, KO and RB, using lnk_habitat_validate()
on every discharge-covered fresh_default WSG put on the mad model. The tested
segment set per stage is fresh's own compiled waterbody SQL; it was checked
against fresh's mad predicates over every fresh_default segment.

PWF: plan review, three code-check rounds, literature review, operator
decisions (thin-spawn fallback, expected-count floor, underpowered walk).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
Full run of query_habitat_thresholds_mad.R over the 46 discharge-covered
fresh_default WSGs (link a7f919e, clean). Candidates (P05, floored to 2
s.f., max open): BT spawn and rear 0.027, GR 0.095 and 0.095, KO spawn
0.57, RB spawn 0.011 and rear 0.0094 m3/s; BT and GR spawning take the
operator's any-stage fallback (17 and 7 spawn-staged locations).

width_mad_equivalent.txt: the BC-native discharge at the current width
minima (1.5 m ~ 0.021, 2 m ~ 0.041, 4 m ~ 0.20 m3/s).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
habitat_variants_build.R / habitat_variants_score.R:
- optional variants.csv columns: model (cw|mad; a mad variant's bundle
  carries a method table putting its role WSGs on mad) and set (fixed
  *_mad_* cells, e.g. the other stage's range a clustered rearing ladder
  needs)
- an anchor rung (cw base to the first mad rung) is taken by
  construction and reported both ways; lowering a _min adds habitat
- a MAD ladder's core is its mad rungs (the cw base would cut it on width)
- --floor=found|expected names the n-floor of record; an underpowered
  first step past an anchor lands its value unscored
- built.csv records the method sha; the score checks every set cell,
  each bundle's model and ladder consistency
- --working-prefix derived from --prefix; a non-#284 variants file needs
  an explicit --prefix and --out

query_habitat_thresholds_fiss.R: --species, --out, snapped segment
mad_m3s; defaults reproduce #284.

Three code-check rounds, the last an enumeration of 83 derivation sites;
re-scoring #284's build reproduces all ten committed outputs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
… FISS

research/habitat_thresholds.md gains a MAD section written before any
build: the Phase 1 candidates, method and the operator's thin-spawn
fallback, literature, FISS (no separation at the candidates), and the
scoring design (anchor P10 -> P05 -> P02 per species x stage, core = the
mad rungs, expected-count floor of record, an underpowered first step
lands P05 unscored, KO unscorable).

variants_302.csv / wsg_roles_302.csv: six ladders; held-out BT 7, GR 3,
RB 6 WSGs, PARS/KOTL in-sample (20-WSG closure). power_windows.*: counts
per window before the build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
Build: link c2fed37 clean, 20-WSG closure (LHAF pre-flighted), 18 mad
variants on one shared segmentation, every invariant asserted, 145 min.
Score: --floor=expected (pre-registered). Every P10 -> P05 loosening is
refused on the held-out WSGs (density 0.12-0.46 of the core rate) except
RB spawning (0.80, taken; P05 -> P02 underpowered). Walked values: BT
0.078, GR 0.97 rear / 0.96 spawn, RB 0.019 rear / 0.011 spawn.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
default_tuned/parameters_habitat_thresholds.csv: the walked values of
record from the pre-registered scoring (BT 0.078 spawn and rear, GR 0.96
spawn / 0.97 rear, RB 0.011 spawn / 0.019 rear; KO 0.57, the unscored
candidate), every maximum open. Inert while every group is on cw.

research/habitat_thresholds.md: verdict and results, including what the
landed values cost against cw (at least -33 % BT and -82 % GR stream
rearing on the held-out WSGs) and that stream size and sampling effort
are not separated. RUNBOOK 7: lake/wetland bucket columns are gated by a
rear range; default_tuned carries MAD ranges. config.yaml checksum and
provenance, README and the default_tuned test updated. Lint-only edits to
the Phase 1 driver (outputs byte-identical).

Three code-check rounds, the last an enumeration of 58 claims.

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
NewGraphEnvironment merged commit 3e7a74c into main Oct 2, 2026
1 check passed
@NewGraphEnvironment
NewGraphEnvironment deleted the 302-tune-mad-discharge-thresholds-for-bt-gr- branch October 2, 2026 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tune MAD (discharge) thresholds for BT, GR, KO and RB rather than leave them missing

1 participant