Skip to content

PCEA BT rearing vs bcfishpass: segmentation, annotated (#324) - #325

Merged
NewGraphEnvironment merged 18 commits into
mainfrom
324-pcea-link-bcfishpass-config-flags-differ
Oct 11, 2026
Merged

NewGraphEnvironment merged 18 commits into
mainfrom
324-pcea-link-bcfishpass-config-flags-differ

Conversation

@NewGraphEnvironment

@NewGraphEnvironment NewGraphEnvironment commented Oct 11, 2026 •

Copy link
Copy Markdown
Owner

Summary

PCEA's +1.87 % BT rearing against bcfishpass (bcfishpass config, after #319) is explained and annotated. No package code changes.

  • Main cause: where streams break. link breaks at every 15 / 20 % gradient position for every configured species, whatever is present (BT/ST accessible_km over-credit: access segmentation drops the accessibility frontier #223). bcfishpass builds its 15 / 20 % models only where those species are present, and breaks at minimal positions.
    • In groups with none of CH, CM, CO, PK, SK, ST or WCT (PCEA, FINA, PARS), link's segments are finer.
    • On those finer segments, spawn and rear gradient tests flip both ways, and the flips join or cut rearing clusters.
  • Two rule differences sit beside it.
  • What the branch adds:
    • data-raw/habitat_diff_segments.R: a segment-level diff joined on measure overlap. It asserts that it reconciles.
    • data-raw/logs/rearing_diff_324/: attribution (mechanism.R, with net tables for the flag, the rearing row and the rearing_stream slice) and a break census (breaks.R).
    • Taxonomy class SEGMENTATION plus two class-B entries.
    • research/bcfp_segmentation_parity.md, and a CLAUDE.md status entry.
rearing row, link − bcfp km segmentation net moved in both directions row net
PCEA +26.22 70.8 +30.33
FINA −13.04 73.4 −12.88
PARS +9.81 84.9 −13.83 (width exception −24.78)
LKEL (salmon present) +1.41 1.4 +1.65

Related Issues

Test plan

  • No R/, tests/ or inst/ change. test-lnk_parity_annotate.R passes 55 / 0 against the edited taxonomy, and the YAML parses.
  • lnk_parity_annotate() tags the PCEA / FINA / PARS rearing, spawning and connection-line rows with the new entries. LKEL comes out WITHIN_TOLERANCE.
  • The diff script reproduces itself: a re-run gives a byte-identical pcea_bt_pieces.csv. Coverage and flag-total gaps are 0.0 m on all four groups.
  • The rearing and rearing_stream scopes were recomputed from the DB (lnk_rollup_wsg() against .lnk_sql_lake_connection() on the view) and match the CSVs to 0.01 km.
  • /code-check branch: six rounds. Rounds 2–5 each found a defect inside the previous fix. The loop ended by enumeration: every claim is in planning/archive/2026-10-issue-324-pcea-bt-segmentation/review-enumeration.md, and round 6 swept all of them.

Notes

  • Upstream SQL was read at smnorris/bcfishpass@620dbe4. The cited access and habitat files changed on or before 2026-04-16, before the local fresh.streams_vw_bcfp snapshot.
  • Open, not done here. A follow-up issue is drafted for review, not filed. It asks:
    • should the bcfishpass config break where bcfishpass does? That would re-segment every group.
    • should the bundle take the order-1 bypass? fresh's frs_order_child() has no width test, so as written it would also admit NULL-width lines that bcfishpass leaves out.
    • should spawning use width > 2.0 m, as bcfishpass does?
    • the 1.8 km PCEA access residual.
  • The taxonomy's hors-class-stream-order-bypass still reads INTENTIONAL_FRESH_DEFERRED. fresh#158 is closed and the bundle declines the bypass. Its status is left for that follow-up.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx

NewGraphEnvironment and others added 18 commits October 9, 2026 08:58
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
Interval-overlap join of link's rearing flag against fresh.streams_vw_bcfp per
blue_line_key, since the two segmentations differ (PCEA 106,079 vs 37,957).
Reconciles coverage and the flag-total difference before writing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
The diff now takes a flag (rearing | spawning) and is renamed
habitat_diff_segments.R. mechanism.R attributes each disagreeing piece and
breaks.R censuses segment breaks: link breaks at every 15 / 20 % gradient
position, which bcfishpass does not in BT-only groups, and the finer segments
flip gradient tests and cluster connectivity both ways.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
New taxonomy class SEGMENTATION (bt-gradient-segmentation-over / -under) for
PCEA, FINA and PARS, and research/bcfp_segmentation_parity.md with the
measurement, the upstream rules it rests on and the two smaller mechanisms
(bcfishpass's order-1 width exception, an access residual).

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
Annotate PCEA's rearing_lake_connection row (bcfishpass's order-1 width
exception); the diff script always loads the source tree and sorts its pieces
on a unique key; the break census labels FWA base-segment starts; four
wording corrections in the write-up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
Drop sub-centimetre overlap slivers, which paired the reach above a shared
break with the one below and counted as gradient splits; mechanism.R writes
the net table the docs quote; every quantitative claim re-checked against the
regenerated artifacts (planning/active/review-enumeration.md).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
Correct the sliver cause (within-side measure overshoot from FWA, not a
shared-break mismatch); attribute spawning's width rule (bcfishpass > 2.0 m,
fresh >= 2.0 m); cite accessible km, not mapping-code parity, for access
agreement; qualify 'superset'; deterministic sort in breaks.R; causal claims
added to the ledger.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
Segmentation-only net and gross written by mechanism.R and quoted instead of
the all-mechanism gross; PARS rearing re-tagged to bcfishpass's width
exception, which drives its sign; spawning gets its own entry
(NEEDS_INVESTIGATION, the width rule is open); the width exception never
admits a NULL width; the split test counts only gradient spawning flips.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
mechanism.R writes the net table for three scopes (flag, the rollup's rearing
row, its stream slice); the rearing scope reconciles to the parity
cross-section and the research doc quotes it. Connectivity not tied to a
split is kept out of segmentation; taxonomy mechanisms carry no figures; the
fresh width test is cited where it runs (.frs_rules_to_sql).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
Define 'BT-only' as no species with a 15 / 20 % access model present
(bcfishpass's ct_dv_rb model has no presence filter but is 25 / 30 %), and
state the connection-line row as -8.37 km of width exception offset by
+0.17 km of link-only rearing (-8.21 km).

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
Both configs will filter the break set by species presence; the bcfishpass
config spawns on width > min, default keeps the tie (an intentional departure,
default_vs_bcfishpass.md section 6). #223's "matches bcfishpass" break set was
asserted, not measured: habitat byte-identity was LKEL only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
…s; order-1 exception in bcfishpass config

#223's over-credit came from reducing the pre-override barrier set, not from
reducing as such; bcfishpass reduces after overrides. In practice bcfishpass's
order-1 exception admits measured widths only (fwapg models none on order 1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJE2szSCkeV9R3qKhuSwyx
Lines up bcfishpass's five access scripts (groups, lifts, reduction after
lifts) against link's break set, with the history: link never filtered by
presence (#45 chose not to), and #223 dropped the reduction instead of moving
it after the lifts. Records why exact-key parity numbers could not see it, and
corrects ct_dv_rb: a fixed list of 14 groups, not every group.

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 79c4f4b into main Oct 11, 2026
1 check passed
@NewGraphEnvironment
NewGraphEnvironment deleted the 324-pcea-link-bcfishpass-config-flags-differ branch October 11, 2026 23:12
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.

PCEA: link (bcfishpass config) flags different BT rearing segments than bcfishpass (−8.2 km connection, +30.3 km other)

1 participant