fix(cron): keep bounded diagnostics UTF-16 safe#102624
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 9, 2026, 8:03 AM ET / 12:03 UTC. Summary PR surface: Source +1, Tests +23. Total +24 across 2 files. Reproducibility: yes. source-reproducible: the unchanged exec path raw-slices the retained tail before normalization, and a read-only probe showed the retained string can start with low surrogate Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Make the exec tail use a UTF-16-safe suffix slice too, keep the new entry/summary boundary coverage, add an exec aggregated boundary test, and require redacted runtime proof before merge. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: the unchanged exec path raw-slices the retained tail before normalization, and a read-only probe showed the retained string can start with low surrogate Is this the best way to solve the issue? No. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c9b3358d43f7. Label changesLabel justifications:
Evidence reviewedPR surface: Source +1, Tests +23. Total +24 across 2 files. View PR surface stats
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (2 earlier review cycles) |
|
Merged via squash.
|
* fix(cron): use truncateUtf16Safe for diagnostic entry and summary truncation * test(cron): cover UTF-16 diagnostic boundaries --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Cron run diagnostics bounded entry messages and summaries with raw UTF-16 code-unit slicing. A limit that landed between the halves of an emoji or another supplementary character could persist and display a lone surrogate.
Why This Change Was Made
Both bounded diagnostic surfaces now use the shared
truncateUtf16Safeprimitive before appending their existing ellipsis. This preserves the current caps, redaction, truncation metadata, and short-text behavior without adding another code path.User Impact
Long cron diagnostic entries and summaries remain valid Unicode in run logs and operator-facing control surfaces. Existing bounds and ASCII behavior are unchanged.
Evidence
src/cron/run-diagnostics.test.tssuite passed.git diff --checkpassed.