Skip to content

feat(xml): inspect scoped XSD integers - #232

Merged
polaz merged 1 commit into
mainfrom
feat/#227-scoped-xsd-integer
Oct 16, 2026
Merged

polaz merged 1 commit into
mainfrom
feat/#227-scoped-xsd-integer

Conversation

@polaz

@polaz polaz commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add ScalarType::Integer to original attribute/simple-content inspection. Valid base XSD 1.0 integer spellings return ScalarValue::Integer; original XML-normalized lexical bytes remain available in the scoped callback.
  • Accept arbitrary finite digit sequences, optional signs, leading zeros and signed zero without finite-width conversion or canonical-form restrictions.
  • Validate contiguous spellings without allocating a whitespace-normalized copy. Internal whitespace and non-ASCII digits remain malformed; only XML whitespace is trimmed.
  • Preserve current local/aggregate Work, retained document/generation identity, typed callback failures and accounted temporary joins. This does not validate derived-type facets, authenticate an owner or apply XAdES profile acceptance.

Stacked on #229. QName/xsi inspection, independent current-query reference continuations, alloc-only XMLDSig and provider streaming are separate work.

Validation

  • Four public-path tests cover both source forms, 10,000-digit values, signs/zeros/whitespace/Unicode, original lexical fragments, absence/complex content, foreign/stale identity, typed refusal, allocation release, and exact/one-less/repeated local/aggregate work.
  • The initial Integer implementation passed default 4,403/all-feature isolated SoftHSM 4,598 tests and the complete backend/FIPS/PQ/legacy/MSRV matrix, builds/lint/docs, canonical alloc-only stable/MSRV checks, thumb and actual C14N WASM execution.
  • After integrating the latest prerequisite heads and the trailing-child admission fix: default 4,404/all-feature isolated SoftHSM 4,599 tests, build/lint/doc tests, C14N-only lint, alloc stable/MSRV, thumb and actual WASM checks passed. Moving onto the squash-merged prerequisite changed ancestry only; tested and published Git trees are identical. The earlier full matrix and final-tree qualification are reported separately.

Closes #227

Summary by CodeRabbit

  • New Features
    • Added support for inspecting XML Schema 1.0 integer values in XML text and attributes. Valid values can include an optional sign and leading zeros, and are inspected without numeric conversion or normalization. Invalid integer forms are reported as malformed. Derived-type constraints and authentication or profile acceptance remain separate from base-type validation.

@polaz
polaz added this pull request to stack #231 October 15, 2026 23:27
@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: structured-world/xml-sec/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 05838eca-2b54-41dc-9cb2-218b25dafad8
📥 Commits

Reviewing files that changed from the base of the PR and between eaf1296 and 09909f8.

📒 Files selected for processing: 3
  • docs/xmldsig.md
  • src/xmldsig/extension/scalar.rs
  • tests/xml_integer_inspection.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

Scalar inspection now supports XSD integer lexical validation for simple content and attributes. It returns a typed marker for valid spellings without converting or normalizing them. Tests cover lexical forms, content handling, node ownership, visitor behavior, and resource limits.

Changes: XSD integer inspection

Layer / File(s) Summary
Integer lexical validation
src/xmldsig/extension/scalar.rs, tests/xml_integer_inspection.rs, docs/xmldsig.md
ScalarType and ScalarValue now include Integer. Validation trims XML whitespace at the ends and accepts an optional sign followed by one or more ASCII digits. Tests cover simple content, attributes, split text and CDATA, node ownership, visitor refusal, and resource admission. The documentation describes the lexical rules and distinguishes base-type validity from derived-type constraints.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to 09909

No concrete merge-blocking issue remains; the change is ready for normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 55.56% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 2 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 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 describes the main change: adding scoped inspection for XSD integers.
Linked Issues check Passed The PR implements #227. ScalarType::Integer and ScalarValue::Integer are present in the scoped API. Integer validation accepts an optional ASCII sign and ASCII digits after XML-whitespace trimming…
Out of Scope Changes check Passed The changed documentation, scalar implementation, and public tests directly support #227. The changes do not add an XSD engine, a second XML representation, implicit resource access, XAdES profile pol…
Full details: Linked Issues check

Explanation

The PR implements #227. ScalarType::Integer and ScalarValue::Integer are present in the scoped API. Integer validation accepts an optional ASCII sign and ASCII digits after XML-whitespace trimming. It preserves arbitrary length, leading zeros, signed zero, and the original lexical text. It rejects empty, sign-only, internal-whitespace, non-ASCII-digit, decimal, and exponent forms. The implementation preserves absent and complex-content facts, document/generation identity, typed visitor errors, and resource errors. It pre-admits traversal, join, and pass work. The added public tests cover attributes, simple content, split text and CDATA, lexical boundaries, nested elements, identity, visitor refusal, allocation release, and local/aggregate resource limits. No ignored files affect this assessment.

Full details: Out of Scope Changes check

Explanation

The changed documentation, scalar implementation, and public tests directly support #227. The changes do not add an XSD engine, a second XML representation, implicit resource access, XAdES profile policy, or the separate QName/xsi, continuation, XMLDSig allocation, or provider-streaming work described as out of scope.

Full details: Docstring Coverage

Explanation

Docstring coverage is 55.56% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 2 files. (1 skipped: 1 unsupported.)

Resolution

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

  • Fix all pre-merge checks with AI
✨ 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 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-16T09:25:08.886682Z 09909f8 New commits
ℹ️ 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.

@greptile-apps

greptile-apps Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] No merge-blocking issues identified in the reviewed changes.

Summary

Adds scoped XSD integer inspection without converting the text to a machine number.

  • Scoped XML inspection can check XSD integer spellings.

Reviews (3) · Last reviewed commit: "feat(xml): inspect scoped XSD integers" · Reviewed by Greptile

@polaz
polaz force-pushed the feat/#227-scoped-xsd-integer branch from 69edf6d to 04ce5ee Compare October 16, 2026 00:29
Base automatically changed from feat/#224-selected-key-receipts to main October 16, 2026 09:23
Validate arbitrary-precision integer spellings without numeric conversion or normalization allocation. Preserve original lexical bytes, current execution budgets and typed refusal.

Closes #227
@polaz
polaz force-pushed the feat/#227-scoped-xsd-integer branch from 04ce5ee to 09909f8 Compare October 16, 2026 09:23
@polaz
polaz merged commit b3a1af6 into main Oct 16, 2026
44 checks passed
@polaz
polaz deleted the feat/#227-scoped-xsd-integer branch October 16, 2026 10:49
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.

feat: add scoped XSD integer validation

1 participant