Repository navigation
fix(segment): enforce maxReps exactly - #41
Merged
shadowhand merged 1 commit intoOct 17, 2026
Merged
shadowhand merged 1 commit into
shadowhand merged 1 commit into
Conversation
A 0-based repetition index was compared to the 1-based maximum with >, so every capped field accepted one repetition too many. Compare with >= instead, and report the 1-based repetition number in the exception message so it agrees with the allowed count. Refs SV-83
|
There was a problem hiding this comment.
The Robin Hood of code review
Heads up: this is a point-in-time review. Push fixes freely, then comment
/robinwhenever you want another pass.
✅ No issues found
Summary
The change fixes the off-by-one check so capped fields accept no more than their configured repetition count, and reports repetition ordinals consistently as 1-based. The added tests cover both a general cap and parsing a repeated PID. I found no actionable issues in the diff.
shadowhand
deleted the
feature/sv-83-maxreps-allows-one-more-repetition-than-declared
branch
October 17, 2026 12:09
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.
Goal
Make a field declared with
maxReps: Naccept exactly N repetitions, as SV-83 specifies.Changes
>=, so indices0..N-1are allowed and the (N+1)th throwsOutOfBoundsException.maxReps: 1andPID|1~2||X.Refs SV-83