Skip to content

fix: bound and validate review titles - #615

Draft
Xiangyu7 wants to merge 1 commit into
nashsu:mainfrom
Xiangyu7:codex/fix-review-title-parsing
Draft

fix: bound and validate review titles#615
Xiangyu7 wants to merge 1 commit into
nashsu:mainfrom
Xiangyu7:codex/fix-review-title-parsing

Conversation

@Xiangyu7

Copy link
Copy Markdown

Summary

  • require REVIEW headers and titles to remain on a single line
  • normalize review titles and cap them at 120 characters before storing them
  • tell the review-suggestion model to keep titles within the same limit
  • add a regression test covering a malformed header followed by a valid review block

Root cause

The previous review-block regular expression allowed the title capture to cross line boundaries. If a model omitted the closing --- on a REVIEW header, the parser could consume the description and later review blocks as one oversized title.

The updated parser rejects that malformed header instead of swallowing subsequent valid blocks. Full review explanations remain in the description; only the title is bounded.

Impact

Malformed model output can no longer turn an entire REVIEW payload into a title or contaminate later valid review suggestions. This also gives persistence layers a predictable title size without discarding the detailed explanation.

Validation

  • npm run test:mocks — 118 test files, 1722 tests passed
  • TypeScript build/typecheck passed

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.

2 participants