Skip to content

Preserve multiple labels per break position#146

Merged
NewGraphEnvironment merged 2 commits intomainfrom
145-preserve-labels
Apr 12, 2026
Merged

Preserve multiple labels per break position#146
NewGraphEnvironment merged 2 commits intomainfrom
145-preserve-labels

Conversation

@NewGraphEnvironment
Copy link
Copy Markdown
Owner

Summary

Preserve multiple labels per break position in streams_breaks. A gradient_15 and a falls at the same measure both survive — enabling per-barrier overrides, access reporting, and habitat reporting by barrier type.

  • Fix: dedup only removes exact duplicates (same position AND same label), not different labels sharing a position
  • Uses IS NOT DISTINCT FROM for NULL-safe label comparison (code-check caught NULL bypass)
  • Geometry splitting already deduplicates separately in frs_break_apply (no label involved)

Test plan

  • Integration test: two mock break sources at same position, verify both labels survive
  • 692 tests pass
  • Code-check: found NULL label bypass with = operator. Fixed with IS NOT DISTINCT FROM.

Fixes #145
Relates to NewGraphEnvironment/sred-2025-2026#16

NewGraphEnvironment and others added 2 commits April 12, 2026 12:15
The measure-rounding dedup in frs_network_segment deleted rows
at (blue_line_key, downstream_route_measure) — dropping one label
when a gradient barrier and a falls shared the same position.

Fix: add AND a.label = b.label to only remove exact duplicates.
Different labels at the same position survive. Geometry splitting
already deduplicates separately in frs_break_apply (SELECT DISTINCT
blue_line_key, round(drm) — no label involved).

Integration test: two mock break sources at the same position with
different labels, verify both survive in the breaks table.

692 tests pass.

Fixes #145

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@NewGraphEnvironment NewGraphEnvironment merged commit 94a69a6 into main Apr 12, 2026
1 check passed
@NewGraphEnvironment NewGraphEnvironment deleted the 145-preserve-labels branch April 12, 2026 19:31
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.

Keep multiple labels per position in streams_breaks (no barrier identity loss)

1 participant