Repository navigation
Conversation
…-safe helper (leboiko#50) The class parser kept a local `strip_keyword_prefix_ci` that sliced `line[..kw.len()]` at a byte index, so a line such as `動物 <|-- 犬` panicked when a probed keyword length landed inside a multi-byte char. It is the copy the 0.56.1 audit (leboiko#29) missed; use the canonical `parser::common::strip_keyword_prefix` instead, as gantt and journey do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
I am reviewing this fix with the existing regressions and the full workspace checks. I will build any needed additions on your commit and retain your authorship. Thank you for the reproduction and fix. |
leboiko
left a comment
There was a problem hiding this comment.
GPT-6.1 review: the UTF-8-safe helper reuse is correct and preserves ASCII behavior. One minor test finding: pin the exact colon-shorthand parse diagnostic rather than accepting any error. I will address this on top of the contributor commit and run full local checks. No implementation defect found.
leboiko
left a comment
There was a problem hiding this comment.
GPT-6.1 independent security and test review found additional pre-existing panic variants; these are not regressions introduced by the contributor commit. I am fixing all three in this PR under the no-follow-ups requirement.
- Critical —
crates/mermaid-text/src/parser/class.rs:362:+String\u{3000}吠える()slices one byte past a multi-byte Unicode separator and panics. Slice at the matched separator and trim whitespace. - Critical —
crates/mermaid-text/src/parser/class.rs:341:+吠える)(forms a reversed byte range and panics. Validate parentheses and only search for a closing delimiter after the opening one. - Critical —
crates/mermaid-text/src/parser/er.rs:471and:484: the same whitespace-plus-one pattern panics on顧客\u{3000}||--o{ 注文 : placesand on the right separator. Both relationship token splitters must use a character-boundary slice.
The three strong reproductions failed locally before implementation (exit 101), with exact boundary and range panics. All additions will preserve the contributor commit and credit. The local advisory gate also required a narrow Rustls/webpki lockfile update; no advisory ignore was added.
Co-authored-by: worldnine <world9@world9.world>
|
GPT-6.1 fix-review-findings completed in
All local fmt, workspace clippy, stable/MSRV workspace tests, deny, audit, and docs gates pass. Independent security and tests reviews confirm the fixes. No findings deferred. Contributor author commit remains in history and is credited. |
Fixes #50 while preserving the original UTF-8-safe keyword helper change and author commit by @worldnine.
Class parsing handles Japanese/Cyrillic names without panicking. GPT-6.1 review also reproduced and fixed three pre-existing variants: Unicode whitespace in class methods, malformed class-method parentheses, and Unicode relationship separators in ER diagrams. Regression tests pin exact AST structure and diagnostics. The local advisory gate required a narrow Rustls 0.23.45/webpki 0.103.15 lockfile update; no advisory ignore was added.
Validation on macOS:
cargo fmt --all -- --check,cargo clippy --workspace --all-targets -- -D warnings,cargo test --workspaceon stable and Rust 1.92,cargo deny check bans licenses sources advisories,cargo audit, andcargo doc --no-deps --workspaceall pass. Default docs retain existing link warnings. The original regressions and newly discovered variants were verified failing before fixes. Independent GPT-6.1 security and tests passes are complete.Review/findings and variant audit are committed in
PR-51-review.mdanddocs/audit-utf8-parser-variants-2026-10-12.md. Contributor credit is included in both changelogs; versions are markdown-tui-explorer 1.35.2 and mermaid-text 0.57.3. No release or publish was triggered.Closes #50