Skip to content

refactor(xslt): qualify compiler and runtime - #293

Merged
polaz merged 1 commit into
mainfrom
refactor/#275-xslt-pedantic
Oct 24, 2026
Merged

polaz merged 1 commit into
mainfrom
refactor/#275-xslt-pedantic

Conversation

@polaz

@polaz polaz commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add an XSLT pedantic CI gate covering standalone and embedded entry graphs.
  • Refactor compiler, parser, XPath, runtime and serialization phases while preserving resource accounting and output semantics.
  • Add allocation-free XPath numeric conversion boundaries and strengthen boundary regression coverage.

Testing

Stable and MSRV component pedantic checks verified locally. Workspace/feature tests, conformance, fuzz and coverage are CI gates; their final results are pending.
Before/after performance qualification remains pending.

Closes #275

Summary by CodeRabbit

  • Bug Fixes
    • Improved XSLT handling of date arithmetic, numeric conversions, stylesheet declarations, and XML parsing within configured resource limits.
    • Improved handling of namespace aliases when stylesheet declarations have equal precedence.
  • Improvements
    • Strengthened XSLT output serialization and resource-size checks while preserving existing output behavior.
  • Tests
    • Expanded coverage for bounded XML parsing, numeric edge cases, stylesheet execution, and serialization.

Add a component pedantic gate across standalone and embedded XSLT entry graphs. Refactor compiler, parser, evaluator and serializer phases while preserving execution budgets and output semantics.

Closes #275
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 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-24T12:04:53.205492Z a4abf62 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 24, 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 d351357 and a4abf62.

Files selected for processing: 31
  • .github/workflows/ci.yml
  • benches/support/xslt.rs
  • crates/xml-sec-xslt/tests/cve_security.rs
  • crates/xml-sec-xslt/tests/engine.rs
  • crates/xml-sec-xslt/tests/libxslt_oracle.rs
  • scripts/check-xml-kernels.mjs
  • scripts/check-xml-kernels.test.mjs
  • scripts/check-xslt.mjs
  • scripts/check-xslt.test.mjs
  • src/xslt/budget.rs
  • src/xslt/compiler.rs
  • src/xslt/compiler/tests.rs
  • src/xslt/environment.rs
  • src/xslt/expression/tests.rs
  • src/xslt/exslt_date.rs
  • src/xslt/lexical.rs
  • src/xslt/lib.rs
  • src/xslt/model.rs
  • src/xslt/model/expansion_workspace_tests.rs
  • src/xslt/model/parser_boundary_tests.rs
  • src/xslt/number.rs
  • src/xslt/number/tests.rs
  • src/xslt/resolver.rs
  • src/xslt/resolver/tests.rs
  • src/xslt/runtime.rs
  • src/xslt/runtime/tests.rs
  • src/xslt/serializer.rs
  • src/xslt/serializer/tests.rs
  • src/xslt/value.rs
  • src/xslt/xpath.rs
  • src/xslt/xpath/tests.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 adds XSLT pedantic lint qualification and refactors core XSLT parsing, compilation, numeric conversion, date handling, and serialization. It also adds targeted tests and reorganizes existing test fixtures.

Changes: XSLT engine and qualification

Layer / File(s) Summary
Pedantic check setup
.github/workflows/ci.yml, scripts/check-*.mjs, scripts/check-*.test.mjs, benches/support/xslt.rs
CI now runs the XSLT test suite and a standalone XSLT check. The check shares the XML-kernel diagnostic gate and defines four Cargo configurations.
Numeric conversion and date functions
src/xslt/number*, src/xslt/exslt_date.rs, src/xslt/value.rs, src/xslt/budget.rs
New numeric helpers define integer and floating-point conversions and equality. EXSLT date calculations use conversion helpers and checked conversions.
Bounded XML parsing and accounting
src/xslt/model.rs, src/xslt/model/*tests.rs
The parser delegates event handling to a stream builder and extracted attribute and entity helpers. Added tests cover workspace limits, entity expansion, and parser boundaries.
Stylesheet compilation
src/xslt/compiler.rs, src/xslt/compiler/tests.rs, src/xslt/lexical.rs
Compilation logic is split into helpers for module discovery, declarations, and instructions. Base-URI handling and namespace-alias precedence are updated, and attribute-set validation now traverses function-result content.
Output configuration and serialization
src/xslt/serializer.rs, src/xslt/serializer/tests.rs
Output explicitness flags are grouped in ExplicitOutput. The iterative renderer delegates node, text, element, namespace, attribute, and metadata handling to helpers.
Resolver APIs and engine test updates
src/xslt/resolver*, src/xslt/environment.rs, src/xslt/runtime/tests.rs, src/xslt/xpath/tests.rs, src/xslt/expression/tests.rs
resolve_uri_reference returns a string directly, with resolution choices unchanged. Related documentation and tests are updated.
Engine and oracle test coverage
crates/xml-sec-xslt/tests/*, src/xslt/compiler/tests.rs
Engine tests add borrowed-options coverage and reorganize fixture setup. Oracle comparisons and DTD and markup parsing are split into helpers, with new boundary coverage.

Priority: Normal

Estimated code review effort: 4 (Complex) | ~60 minutes

Change: Refactor

Merge Risk: Minimal · up to a4abf

This refactor adds the XSLT pedantic lint gate and restructures internal code. No behavior regression was found in the areas checked. The CI conformance and performance results are still pending, but the review found no merge-blocking risk.

Pre-merge checks: Passed 3 · Failed 1 · Inconclusive 1

Failed Failed checks: 1 warning · 1 inconclusive

Check name Status Explanation Resolution
Linked Issues check Warning Issue #275 requires warning-free component pedantic lint, native and embedded qualification, complete pinned libxslt/W3C and XML signature-chain tests, full workspace and feature matrices, at least 85… Complete and report the required CI matrices, pinned conformance and XML signature-chain tests, native and embedded qualification, fuzz and coverage checks with coverage at least 85%, and before/after performance evidence. Resolve any failu…
Docstring Coverage Inconclusive Docstring coverage is 9.77% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 256 functions across 27 files. (2 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title accurately identifies the XSLT refactor and qualification work. It is concise and related to the primary changes, although it does not mention the added CI gate or parser and serializer upda…
Out of Scope Changes check Passed The changed files support issue #275. The new XSLT gate covers shared source ownership and standalone and embedded entry graphs. Compiler, parser, XPath, runtime, serializer, budget, and numeric-bound…
Full details: Title check

Explanation

The title accurately identifies the XSLT refactor and qualification work. It is concise and related to the primary changes, although it does not mention the added CI gate or parser and serializer updates.

Full details: Out of Scope Changes check

Explanation

The changed files support issue #275. The new XSLT gate covers shared source ownership and standalone and embedded entry graphs. Compiler, parser, XPath, runtime, serializer, budget, and numeric-boundary changes support pedantic qualification or the stated semantic and resource-accounting checks. Test and benchmark edits support those checks. No unrelated change is demonstrated.

Full details: Linked Issues check

Explanation

Issue #275 requires warning-free component pedantic lint, native and embedded qualification, complete pinned libxslt/W3C and XML signature-chain tests, full workspace and feature matrices, at least 85% coverage, and before/after evidence for performance-sensitive changes. The PR adds the shared XSLT gate with standalone and three embedded graphs, updates CI, and adds boundary tests. The current testing statement says workspace and feature tests, conformance, fuzzing, coverage, and performance qualification remain pending. The acceptance requirements are therefore incomplete at the reviewed head.

Resolution

Complete and report the required CI matrices, pinned conformance and XML signature-chain tests, native and embedded qualification, fuzz and coverage checks with coverage at least 85%, and before/after performance evidence. Resolve any failures without weakening conformance assertions or adding blanket lint suppression.

Full details: Docstring Coverage

Explanation

Docstring coverage is 9.77% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 256 functions across 27 files. (2 skipped: 1 unsupported, 1 too large.)

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.

@polaz
polaz enabled auto-merge (squash) October 24, 2026 12:21
@polaz
polaz merged commit 1d4546c into main Oct 24, 2026
30 checks passed
@polaz
polaz deleted the refactor/#275-xslt-pedantic branch October 24, 2026 12:26
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 XSLT pedantic lint

1 participant