fix: preserve case context during summary preparation - #173
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
Security findingsAdvisory findings (1)
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved review comments remain, and all supplied assessments approve it.
Pull request overview
Refactors ROUGE preprocessing into shared summary preparation while preserving Unicode case context and isolating custom LCS callbacks.
Changes:
- Adds shared token preparation and counts.
- Updates ROUGE-L and LCS handling for readonly, protected inputs.
- Adds regression tests and documents case-folding behavior.
File summaries
| File | Summary |
|---|---|
test/tests.ts |
Adds regression coverage. |
src/rouge.ts |
Integrates preparation and protects callbacks. |
src/prepare.ts |
Adds shared summary preparation. |
src/lcs.ts |
Supports readonly token arrays. |
README.md |
Documents Unicode case behavior. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
The integrated head is @codex review @codex security review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: 43fb030e0a
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
|
The final additive head is @codex review @codex security review |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
Preserve whole-summary Unicode casing across built-in sentence splits, so Greek sigma retains its original context during case-insensitive scoring. Share prepared sentence tokens and counts across the metrics, and protect those tokens from mutating custom LCS callbacks. Custom segmenters keep their existing input and casing contracts. This supplies the case-context correction needed by #169’s mark-only sentence boundary.
Retain the existing 100,000 built-in sentence-pair limit. Custom LCS callbacks receive fresh mutable arrays, with a separate limit of 1,000,000 copied token slots per scoring call. Oversized copying throws before any LCS callback runs; empty-token comparisons return zero first. This bounds the library’s new copying cost; custom callback invocation counts and callback work remain caller-controlled.
Validation: 1,092 tests passed, including all prior main/contextual-casing regressions, both custom callback forms, asymmetric exact-budget and over-budget cases, mutation isolation, and the reported large input in bounded subprocesses. Types, strict Biome, Markdown, build and packed CJS/ESM/TypeScript consumers passed. Local checks used the existing Biome 2.5.10 / @types/node 24.13.3 toolchain; final-head GitHub CI validates the exact locked dependencies before merge. No development dependency installation or registry workaround was attempted.