fix: address Codex review findings (parser/mutator/serializer hardening)#10
Merged
Conversation
…izer Hardens the marxml crate against adversarial inputs and tightens semantics flagged in review: - parse: enforce MAX_DEPTH (1024) and MAX_INPUT_BYTES (u32::MAX); scope duplicate-id detection to sibling-under-same-parent (was global) - tokenizer: emit TokenStream with trivia preserved for round-trips - escape: extract escape_attr/escape_text/is_valid_name into dedicated module; consistent entity handling without double-escaping - mutate: refactored update / replace_content / replace_in paths; additional safety around invalid attr names - serialize: pretty-print fixes for mixed content, self-close handling, and multi-root separation - schema/validate: regex constraints fully anchored; clearer error messages - selector: parser/matcher tightening for edge cases Also adds proptest regression file and ignores local agent/skills tooling directories. Co-Authored-By: Claude <noreply@anthropic.com>
…quired semantics The compliant-doc fixture relied on a child element satisfying contentRequired. After tightening that rule to mean "direct text content" (see structural_only_body_fails_content_required in the Rust suite), the fixture needs a text body too. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MAX_DEPTH=1024andMAX_INPUT_BYTES=u32::MAXbounds; duplicate-id detection scoped to siblings-under-same-parent rather than global.TokenStreamcarrying trivia so round-trips preserve whitespace/comments.escapemodule consolidatesescape_attr/escape_text/is_valid_name, eliminating double-escape paths..claude/,.agents/,skills-lock.json.Test plan
cargo fmt --all -- --checkcargo clippy --all-targets --all-features -- -D warningscargo test --all-features --workspace(all 198 tests pass locally)