ProblemparsePositiveInt in src/api/routes.ts (and identical copies in src/github/webhook.ts and src/orb/webhook.ts) uses Number.parseInt(value, 10) without validating that the input is a well-formed numeric string. When the input contains non-numeric characters or is malformed, parseInt can return NaN or partial results, which then fail the Number.isFinite(parsed) check and return
ull. However, the function does not validate the input shape before parsing, so malformed strings like 123abc would partially parse to 123 instead of being rejected entirely.## Expected behaviorMalformed numeric strings should be rejected entirely, not partially parsed. The function should validate that the entire string consists only of digits before attempting parseInt.## Scope- Update parsePositiveInt in src/api/routes.ts to validate input shape- Update identical copies in src/github/webhook.ts and src/orb/webhook.ts- Add unit tests for edge cases (malformed strings, partial numeric strings, valid strings)## Acceptance criteria- [ ] Malformed strings like 123abc return
ull instead of 123- [ ] Valid numeric strings like 123 return 123- [ ] Empty/null/undefined inputs return
ull- [ ] Full
pm run test:ci green
ProblemparsePositiveInt in src/api/routes.ts (and identical copies in src/github/webhook.ts and src/orb/webhook.ts) uses Number.parseInt(value, 10) without validating that the input is a well-formed numeric string. When the input contains non-numeric characters or is malformed, parseInt can return NaN or partial results, which then fail the Number.isFinite(parsed) check and return
ull. However, the function does not validate the input shape before parsing, so malformed strings like 123abc would partially parse to 123 instead of being rejected entirely.## Expected behaviorMalformed numeric strings should be rejected entirely, not partially parsed. The function should validate that the entire string consists only of digits before attempting parseInt.## Scope- Update parsePositiveInt in src/api/routes.ts to validate input shape- Update identical copies in src/github/webhook.ts and src/orb/webhook.ts- Add unit tests for edge cases (malformed strings, partial numeric strings, valid strings)## Acceptance criteria- [ ] Malformed strings like 123abc return
ull instead of 123- [ ] Valid numeric strings like 123 return 123- [ ] Empty/null/undefined inputs return
ull- [ ] Full
pm run test:ci green