Feat/adaptive stability thresholds - #293
Open
viktorbeck98 wants to merge 1 commit into
Open
Conversation
ipmach
approved these changes
Sep 7, 2026
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.
Task
Description
Segment thresholds and the segment count become configurable instead of hardcoded.
ClassificationMethodsgains asegment_thresholds: list[float]field (default[1.1, 0.3, 0.1, 0.01]— the values that were hardcoded). The segment count is thelist's length, not a separate setting.
StabilityClassifierkeeps no thresholds of itsown:
segment_threshs,n_segmentsandmin_samplesare read-only properties over theblock, so reassigning
tracker.classificationchanges all three and a new verdict can betaken from one ingest.
classify()gains a segment floor afterSTATIC/RANDOM: a variable with fewerobservations than segments returns
INSUFFICIENT_DATArather than a verdict scored overempty segments (an empty segment means 0.0 and passes any positive threshold). This is the
only behavioural change at default settings, and it only applies when a segment method is
enabled — a slope-only block cuts no segments and is ungated.
Old snapshots still load: the block wins, a stale top-level
segment_thresholdskey ispicked up when the block has none, and pre-block state maps through
segmentation/require_declining/incline_thresholdas before.docs/detectors.mddocuments the field and the floor.How Has This Been Tested?
45 new tests covering validation, the derived properties, block-swap re-derivation, the
segment-floor table, and each migration row. Full suite: 829 passed, 32 skipped, with the
7 pre-existing failures unchanged. All prek hooks pass, mypy included.
Checklist
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.