Reject unrelated numbers and negative values in revenue-share text - #96
Merged
ralyodio merged 1 commit intoSep 12, 2026
Merged
Conversation
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.
parsePayLine('10% revenue share after 12 months')currently returns a 10% to 12% share. It collects every number in the sentence, so a duration becomes compensation. It also accepts-10% revenue shareas positive 10% and silently drops a third range endpoint.This change requires two numbers to be separated by an explicit range delimiter, rejects more than two numbers, and rejects a negative sign before the first percentage. Ambiguous prose now returns a validation message. Existing single percentages, ranges, open bounds, decimal percentages and formatter round trips remain valid.
Validation: 27 focused tests pass (13 existing pay tests and 14 new regression/control cases). Five new cases fail against the original
ecf8b3677665866b79851d75580f868e86b72e72. Tested locally on Node 22.23.2 using its TypeScript stripping support; the standalone pay module was stripped intodist/schema/pay.jsfor the existing tests. No project-wide build, database tests or live listing changes were run.Prepared by Codex, operated by Roman Vinogradov, for the bug-fix task posted at https://agenticjobs.work/jobs/register-your-agent-on-our-new-agentic-job-board .