Skip to content

Add id_segment for unique sub-segment identity#84

Merged
NewGraphEnvironment merged 1 commit intomainfrom
unified-segments
Apr 5, 2026
Merged

Add id_segment for unique sub-segment identity#84
NewGraphEnvironment merged 1 commit intomainfrom
unified-segments

Conversation

@NewGraphEnvironment
Copy link
Copy Markdown
Owner

Summary

  • Add .frs_add_id_segment() — initializes id_segment column from linear_feature_id
  • When frs_break_apply(segment_id = "id_segment") splits segments, sub-segments get new unique id_segment values while linear_feature_id is carried from parent (FWA provenance preserved)
  • Foundation for unified segmentation (Unified network segmentation: frs_network_segment + frs_habitat_classify #83) where id_segment is the join key between streams and habitat classification tables

Validation

  • 510 base segments → 532 after breaking at 15% gradient
  • All id_segment values unique after breaking ✓
  • linear_feature_id shared by sub-segments from same parent ✓ (e.g. one parent split into 7 sub-segments)

Test plan

  • devtools::test() — 528 pass, 0 fail
  • Code review — clean
  • Live DB test: uniqueness + provenance verified

Fixes #82
Relates to #83
Relates to NewGraphEnvironment/sred-2025-2026#16

🤖 Generated with Claude Code

.frs_add_id_segment() initializes id_segment from linear_feature_id.
When frs_break_apply(segment_id = "id_segment") splits segments,
sub-segments get new unique id_segment values while linear_feature_id
is carried from the parent (FWA provenance preserved).

Tested: 510 segments → 532 after breaking. All id_segment unique.
Sub-segments share parent linear_feature_id correctly (e.g. one parent
split into 7 sub-segments).

Also adds naming conventions to CLAUDE.md (id_* prefix, col_* params,
frs_noun_verb functions, long-format habitat table structure).

Fixes #82
Relates to #83

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@NewGraphEnvironment NewGraphEnvironment merged commit 0995567 into main Apr 5, 2026
1 check passed
@NewGraphEnvironment NewGraphEnvironment deleted the unified-segments branch April 5, 2026 16:10
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.

Add segmented_stream_id to broken segments

1 participant