Skip to content

fix: preserve case context during summary preparation - #173

Merged
mldangelo-oai merged 3 commits into
mainfrom
mdangelo/codex/prepared-summary-20260913
Sep 15, 2026
Merged

mldangelo-oai merged 3 commits into
mainfrom
mdangelo/codex/prepared-summary-20260913

Conversation

@mldangelo-oai

@mldangelo-oai mldangelo-oai commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 13, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-15T10:00:20.685423Z 2c8b3da Manual request
🔒 Security Review Completed 2026-09-15T10:01:39.578152Z 2c8b3da Manual request

Security findings

Advisory findings (1)

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@mldangelo-oai
mldangelo-oai requested a lite review from Copilot September 14, 2026 17:27
@mldangelo-oai

Copy link
Copy Markdown
Contributor Author

@codex review
@codex security review

Please run a fresh review of the current head, b6513a32a6de4e261d38822f37489ba8ca2464de, covering correctness, maintainability, and unnecessary complexity.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: b6513a32a6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: b6513a32a6

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ 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.

@mldangelo-oai mldangelo-oai changed the title refactor: share summary preparation across ROUGE metrics fix: preserve case context during summary preparation Sep 15, 2026
@mldangelo-oai

Copy link
Copy Markdown
Contributor Author

The integrated head is 43fb030e0a899c3ba863355ac7841ae773e57854, based on current main. It preserves the whole-summary casing correction and custom callback contracts while retaining #156’s ROUGE-L work limit. All 1,081 tests and local checks pass, and the independent integration review found no actionable issue.

@codex review

@codex security review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 43fb030e0a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved issues block approval.

Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ 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.

Comment thread src/rouge.ts
@mldangelo-oai

Copy link
Copy Markdown
Contributor Author

The final additive head is 2c8b3da8c8b991bb873d382d284e144f09092faf, retaining the contextual-casing integration and adding the independently reviewed fix for custom-callback token-copy amplification. All 1,092 tests and affected local checks pass; source/build/packed-package checks apply to the same source bytes. The confirmed security finding is addressed with a documented copied-token budget and bounded regressions.

@codex review

@codex security review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The reviewed changes and validation address the stated requirements without unresolved issues.

Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 2c8b3da8c8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 2c8b3da8c8

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ 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.

@mldangelo-oai
mldangelo-oai merged commit 3943edb into main Sep 15, 2026
10 checks passed
@mldangelo-oai
mldangelo-oai deleted the mdangelo/codex/prepared-summary-20260913 branch September 15, 2026 10:03
@mldangelo-oai
mldangelo-oai restored the mdangelo/codex/prepared-summary-20260913 branch September 15, 2026 19:02
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