fix(doctor): keep scrubbed error truncation UTF-16 safe#102066
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 8, 2026, 11:34 PM ET / 03:34 UTC. Summary PR surface: Source +2, Tests +13. Total +15 across 2 files. Reproducibility: yes. at source level. Current main can cut a surrogate pair with raw slice in the doctor scrubber, and the PR body provides a concrete boundary string plus after-fix runtime proof on the doctor lint path. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Next step before merge
Security Review detailsBest possible solution: Land the narrow doctor scrubber fix after normal exact-head CI and maintainer review, preserving the existing cap, control-character stripping, and shared helper contract. Do we have a high-confidence way to reproduce the issue? Yes at source level. Current main can cut a surrogate pair with raw slice in the doctor scrubber, and the PR body provides a concrete boundary string plus after-fix runtime proof on the doctor lint path. Is this the best way to solve the issue? Yes. Replacing the raw slice in the shared scrubber is the narrowest maintainable fix because lint and repair already centralize thrown-check error formatting there. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e90bf3182927. Label changesLabel justifications:
Evidence reviewedPR surface: Source +2, Tests +13. Total +15 across 2 files. View PR surface stats
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 (1 earlier review cycle)
|
|
Maintainer verification complete on exact head
ANSI stripping, error coercion, the existing cap, and finding behavior are unchanged; only an astral boundary now backs off safely. |
|
Merged via squash.
|
) * fix(doctor): keep scrubbed error truncation UTF-16 safe * test(doctor): assert exact scrubbed error output --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Doctor/lint/repair errors are scrubbed and capped before reaching terminal findings. The shared scrubber used raw slicing at its 253-unit content boundary, which could retain a lone high surrogate before the existing
...suffix.Why This Change Was Made
scrubDoctorErrorMessagenow delegates the cut to the canonicaltruncateUtf16Safehelper. ANSI stripping, error coercion, the 256-unit total cap, suffix, check execution, and finding policy remain unchanged.The maintainer fixup replaces a 20-line surrogate scanner with one exact assertion through
runDoctorLintChecks, covering the complete thrown-error-to-finding path.User Impact
Long doctor errors remain readable when the cap crosses an emoji or another astral character.
Evidence
runDoctorLintChecks.git diff --check: pass.28991884349, OpenGrep run28991884305, CodeQL Critical Quality run28991884323, and CodeQL run28991884318on56727ca1c7ef06c6706401e3a122719403284006: success.AI-assisted: yes. Maintainer-reviewed and tightened.