Skip to content

refactor(xml)!: qualify kernels and group ci - #289

Merged
polaz merged 3 commits into
mainfrom
refactor/#274-xml-kernel-pedantic
Oct 23, 2026
Merged

polaz merged 3 commits into
mainfrom
refactor/#274-xml-kernel-pedantic

Conversation

@polaz

@polaz polaz commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Qualify DOM, C14N, maintained parser kernels and safe XPath engines with enforced pedantic checks, without lint suppressions.
  • Group CI build, lint and test jobs while retaining separately resolved feature configurations and required checks for ordinary and stacked pull requests.
  • Adopt coordinated shared primitives and independently qualify the published PKIX and XAdES alloc-only graphs.

Testing

macOS MSRV/stable builds, tests, doctests, lints, native oracle and token checks; bare-metal and WASM checks, fuzz smoke, and canonical line coverage with an 85% gate.

BREAKING CHANGE: Public resolver account and PKIX evidence types use the coordinated shared-primitives generation. Consumers must upgrade their direct shared dependencies together with xml-sec.

Closes #274
Part of #272

Summary by CodeRabbit

  • Bug Fixes

    • Improved XML and XPath processing reliability, including namespace handling, numeric comparisons, XML parsing, and XML base resolution.
    • Corrected reverse namespace iteration and strengthened checks for oversized identifiers.
  • Documentation

    • Clarified API behavior, errors, and resource limits.
  • Chores

    • Updated cryptographic support packages.
    • Reorganized CI checks and expanded coverage for XML, FIPS, benchmarks, and shared package compatibility.

polaz added 3 commits October 23, 2026 23:09
Enforce scoped pedantic checks for maintained XML kernels and safe XPath paths. Preserve isolated feature graphs while grouping CI runner setup and adopt coordinated shared primitives.

Closes #274
BREAKING CHANGE: Public resolver account and PKIX evidence types use shared primitives 0.13. Consumers must upgrade their direct shared dependencies together with xml-sec.
Run the existing read-only PR checks for feature-branch bases as well as main. Preserve main-only push qualification and verify the stacked-PR trigger contract.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 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-10-23T20:34:18.433842Z d432e47 PR opened
ℹ️ 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.

@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between e30264f and d432e47.

📒 Files selected for processing: 97
  • .github/workflows/ci.yml
  • Cargo.toml
  • crates/xml-sec-xades/Cargo.toml
  • docs/ci-hardening.md
  • scripts/check-shared-pkix.sh
  • scripts/check-shared-pkix.test.mjs
  • scripts/check-xml-kernels.mjs
  • scripts/check-xml-kernels.test.mjs
  • scripts/ci-test-blocks.mjs
  • scripts/ci-test-blocks.test.mjs
  • scripts/import-xml-backends.sh
  • scripts/patches/roxmltree-0.21.1.patch
  • scripts/patches/xmloxide-0.5.0.patch
  • scripts/xml-kernel-examples.pl
  • src/c14n/mod.rs
  • src/c14n/ns_common.rs
  • src/c14n/ns_exclusive.rs
  • src/c14n/ns_inclusive.rs
  • src/c14n/prefix.rs
  • src/c14n/scratch.rs
  • src/c14n/scratch/namespace_tests.rs
  • src/c14n/serialize.rs
  • src/c14n/xml_base.rs
  • src/document.rs
  • src/encoding.rs
  • src/hard_limits/xpath.rs
  • src/key_manager.rs
  • src/lib.rs
  • src/parser_roxmltree/documentation_tests.rs
  • src/parser_roxmltree/iterator_tests.rs
  • src/parser_roxmltree/lib.rs
  • src/parser_roxmltree/parse.rs
  • src/parser_roxmltree/tokenizer.rs
  • src/parser_roxmltree/tokenizer_tests.rs
  • src/parser_xmloxide/documentation_tests.rs
  • src/parser_xmloxide/parser/input.rs
  • src/parser_xmloxide/parser/xml.rs
  • src/parser_xmloxide/serial/xml.rs
  • src/parser_xmloxide/tree/mod.rs
  • src/parser_xmloxide/validation/dtd.rs
  • src/sxd_document/dom_no_unsafe.rs
  • src/sxd_document/dom_no_unsafe/current.rs
  • src/sxd_document/lazy_hash_map.rs
  • src/sxd_document/lib.rs
  • src/sxd_document/parser.rs
  • src/sxd_document/raw_no_unsafe.rs
  • src/sxd_document/raw_no_unsafe/current.rs
  • src/sxd_document/storage.rs
  • src/sxd_document/str.rs
  • src/sxd_document/str_ext.rs
  • src/sxd_document/string_pool_no_unsafe.rs
  • src/sxd_document/thindom_no_unsafe.rs
  • src/sxd_document/writer_no_unsafe.rs
  • src/sxd_xpath/arena.rs
  • src/sxd_xpath/axis.rs
  • src/sxd_xpath/context.rs
  • src/sxd_xpath/expression.rs
  • src/sxd_xpath/function.rs
  • src/sxd_xpath/function/core.rs
  • src/sxd_xpath/grammar.rs
  • src/sxd_xpath/lib.rs
  • src/sxd_xpath/macros.rs
  • src/sxd_xpath/node_test.rs
  • src/sxd_xpath/nodeset.rs
  • src/sxd_xpath/nodeset/storage.rs
  • src/sxd_xpath/number_tests.rs
  • src/sxd_xpath/parser.rs
  • src/sxd_xpath/runtime.rs
  • src/sxd_xpath/tokenizer.rs
  • src/xml.rs
  • src/xml/dom/differential.rs
  • src/xml/dom/mod.rs
  • src/xml/dom/preflight.rs
  • src/xml/dom/roxmltree.rs
  • src/xml/dom/storage.rs
  • src/xml/dom/storage/lexical.rs
  • src/xml/dom/tree.rs
  • src/xml/dom/xmloxide.rs
  • src/xml_input/lexical.rs
  • src/xml_input/lexical/storage.rs
  • src/xml_input/shared.rs
  • src/xml_input/shared/codec_tests.rs
  • src/xmldsig/builder.rs
  • src/xmldsig/mutation.rs
  • src/xmldsig/sign.rs
  • src/xmldsig/verify.rs
  • src/xmldsig/xpath.rs
  • src/xmlenc/cipher_reference.rs
  • src/xmlenc/decrypt.rs
  • src/xmlenc/encrypt.rs
  • src/xmlenc/hkdf_agreement.rs
  • src/xmlenc/key_derivation.rs
  • src/xmlenc/parse.rs
  • src/xslt/compiler.rs
  • tools/xmlsec1/Cargo.toml
  • vendor/sxd-document-no-unsafe/Cargo.toml
  • vendor/sxd-xpath-no-unsafe/tests/integration.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The pull request refactors XML, DOM, XPath, canonicalization, and parser code. It adds scoped XML-kernel linting and CI block scripts, updates interoperability and dependency checks, and upgrades shared structured dependencies to version 0.13.0.

Changes: XML kernel and parser implementation

Layer / File(s) Summary
XML, DOM, XPath, and canonicalization refactors
src/document.rs, src/xml_input/..., src/parser_xmloxide/..., src/parser_roxmltree/..., src/c14n/..., src/sxd_document/..., src/sxd_xpath/...
Parser, storage, namespace, XPath, DOM, serialization, and canonicalization code are reorganized. Several resource, conversion, iterator, and error paths are made explicit.
Shared dependency and policy wiring
Cargo.toml, crates/xml-sec-xades/Cargo.toml, tools/xmlsec1/Cargo.toml, vendor/*/Cargo.toml, src/xmldsig/..., src/xmlenc/...
Structured dependencies are upgraded from 0.11.0 to 0.13.0. XML policy values are passed by value at parsing and validation call sites.
CI qualification and validation scripts
.github/workflows/ci.yml, scripts/check-xml-kernels.mjs, scripts/ci-test-blocks.mjs, scripts/check-shared-pkix.sh, scripts/*.test.mjs
CI uses grouped test blocks, scoped XML-kernel Clippy checks, revised interoperability jobs, and coordinated shared-package checks. New tests cover planning, execution, diagnostics, package discovery, and workflow wiring.
Documentation and maintained parser patch
docs/ci-hardening.md, scripts/patches/roxmltree-0.21.1.patch, scripts/import-xml-backends.sh, scripts/xml-kernel-examples.pl, src/**/*.rs
Hardening documentation, generated examples, parser patch maintenance, API error documentation, and code formatting are updated. Tests cover storage behavior, namespace iteration, numeric conversion, codec round trips, and parser limits.

Priority: ➖ Normal

Estimated code review effort: 5 (Critical) | ~90 minutes

Merge Risk: ⚪ Minimal · up to d432e

This refactor mainly qualifies lint and CI and upgrades dependencies, and the checks of the behavior-sensitive spots found no regression. No merge-blocking risk was identified in the supplied context.

Pre-merge checks: Passed 2 · Inconclusive 3

Failed Failed checks: 3 inconclusive

Check name Status Explanation Resolution
Linked Issues check Inconclusive Directly linked issue #274 is the only active target. Coding requirements from #274 and their evidence:

1. Reverse namespace iteration [#274]: PASS by evidence. src/parser_roxmltree/lib.rs changes Na…
Provide the following evidence:
- The result of the scoped pedantic Clippy run in scripts/check-xml-kernels.mjs at the reviewed head, with zero owned-source warnings.
- The mapping from each former CI job and matrix entry to its new block i…
Out of Scope Changes check Inconclusive Most changes support #274. They include lint-driven cleanup such as #[must_use], lifetime elision, explicit imports, let-else rewrites, removed allow attributes, function extraction, shared-dependency… For each behavior-affecting item, provide one of the following:
- Evidence that #274 or the roxmltree kernel qualification requires the change, together with the regression test that covers it. Name the test path.
- Otherwise, a separate is…
Docstring Coverage Inconclusive Docstring coverage is 50.52% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 675 functions across 50 files. (46 skippe… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 2 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely identifies the two main changes: XML-kernel qualification and CI job grouping. The breaking-change marker is also consistent with the stated public dependency update.
Full details: Linked Issues check

Explanation

Directly linked issue #274 is the only active target. Coding requirements from #274 and their evidence:

  1. Reverse namespace iteration [#274]: PASS by evidence. src/parser_roxmltree/lib.rs changes NamespaceIter::next_back to advance from the back. src/parser_roxmltree/iterator_tests.rs adds a mixed-ended test.
  2. Scoped pedantic lint, no blanket suppression [#274]: Partly supported. scripts/check-xml-kernels.mjs runs Clippy with pedantic forced on four configurations and fails on owned-source warnings. Several allow attributes are removed, for example clippy::too_many_lines in parser_xmloxide/parser/xml.rs and serial/xml.rs. Large functions are split. The warning-free result cannot be confirmed from the summary or the diff.
  3. Exact XPath binary64 semantics [#274]: Supported. src/sxd_xpath/lib.rs adds xpath_size_number and same_xpath_number, with IEEE boundary tests in number_tests.rs.
  4. Coordinated 0.13.0 shared graph and alloc-only qualification [#274]: Supported. Cargo.toml, crates/xml-sec-xades/Cargo.toml and tools/xmlsec1/Cargo.toml move to 0.13.0. scripts/check-shared-pkix.sh requires five coordinated packages on one registry version and runs alloc-only checks for structured-pkix and structured-xades. No CAdES dependency is added.
  5. CI grouping without dropping checks or feature graphs [#274]: Unverified. ci.yml merges the build, test, documentation, benchmark, PKCS11 and XAdES jobs into five test blocks and a feature-contract minimal path. Several required check names change, for example 'test-matrix (...)' to 'test block (...)', and jobs such as build-matrix, documentation, security-corpus and benchmark-contract are removed or renamed. The summary does not show that each former feature graph is kept. Examples to confirm are experimental-pq, legacy-aws-fips, xslt-xmloxide and the fat-runtime variants. The coverage job keeps the 85% gate name.
  6. Reusable primitive transfer to signature-primitives with a blocker issue [#274]: No evidence in this pull request. Whether a reusable primitive was duplicated here is unknown.

No unmet coding requirement is demonstrated. Items 2, 5 and 6 cannot be confirmed from the available evidence.

Resolution

Provide the following evidence:

  • The result of the scoped pedantic Clippy run in scripts/check-xml-kernels.mjs at the reviewed head, with zero owned-source warnings.
  • The mapping from each former CI job and matrix entry to its new block in scripts/ci-test-blocks.mjs. Show that every former feature configuration still runs, and that every former required check name is kept or replaced under an explicit list.
  • Confirmation of whether any reusable missing primitive was implemented in this repository. If so, provide the signature-primitives issue number recorded as a blocker.
Full details: Out of Scope Changes check

Explanation

Most changes support #274. They include lint-driven cleanup such as #[must_use], lifetime elision, explicit imports, let-else rewrites, removed allow attributes, function extraction, shared-dependency upgrades, CI and tooling changes, and documentation.

The following changes alter behavior or public API and need linked evidence. #274 requires boundary evidence and regression tests for behavior-affecting changes:

  • scripts/patches/roxmltree-0.21.1.patch (+743/-198): XML 1.0 prefixed namespace undeclarations now return EmptyPrefixedNamespace. The patch also adjusts XML name-character and BOM/declaration parsing logic. The summary lists no regression test for these two behaviors.
  • src/parser_xmloxide/parser/xml.rs and parser/input.rs: entity replacement parsing dispatches to the markup parser when replacement text contains '<' or '&'. This changes parser flow.
  • src/xml/dom/differential.rs: resource-error classification for xmloxide errors changes.
  • src/xml/dom/xmloxide.rs: syntax errors map to ParseError::Backend. This is equivalent by inspection, because the match covers only the Resource and Syntax variants.
  • src/c14n/ns_exclusive.rs: unprefixed elements record utilization of the empty prefix through a new insertion path. This can affect canonical bytes. The summary cites no canonical-byte regression test for it.
  • Public API changes: Error<E> is generic, new_owned is removed from roxmltree, Factory::build_bounded changes from a method to an associated function, and several evaluate signatures change lifetime form.

Checked by diff: src/c14n/xml_base.rs. The summary states that unmatched leading '..' segments are now removed. The diff does not show that. The parse_base fallback is restructured with let-else and calls the same remove_dot_segments_in path. No behavior change is shown in that file.

Unrelated change is not demonstrated. The behavior-affecting items above lack the linked justification and regression evidence that #274 requires.

Resolution

For each behavior-affecting item, provide one of the following:

  • Evidence that #274 or the roxmltree kernel qualification requires the change, together with the regression test that covers it. Name the test path.
  • Otherwise, a separate issue or split of the change.
    For the ns_exclusive change, provide the canonical-byte test that shows unchanged output.
Full details: Docstring Coverage

Explanation

Docstring coverage is 50.52% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 675 functions across 50 files. (46 skipped: 8 unsupported, 38 over the file limit.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

refactor: qualify XML kernel pedantic lint

1 participant