Skip to content

feat(xml): inspect original expanded QNames - #234

Merged
polaz merged 1 commit into
mainfrom
feat/#233-scoped-qname
Oct 16, 2026
Merged

polaz merged 1 commit into
mainfrom
feat/#233-scoped-qname

Conversation

@polaz

@polaz polaz commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Summary

Add ScalarType::QName to scoped original-XML inspection. Return borrowed expanded namespace/local components separately from the original lexical spelling, with distinct malformed and unbound-prefix facts.

Resolution uses the original owner's inherited, shadowed and default bindings, default undeclarations and the implicit xml binding. Unprefixed QName values use the default namespace, unlike unqualified attribute names. No schema loading, declaration lookup or profile-validity claim is added.

Contiguous inspection allocates no normalization buffer. Fragmented text uses the existing accounted join. Supplied current Work admits lexical scans, namespace comparisons and returned URI bytes, preserving local/aggregate refusal and original document/generation identity.

Validation

  • Default: 4,411 tests passed; all-feature isolated SoftHSM: 4,606 passed, no skips.
  • All-target build/lint, formatting, documentation tests and C14N-only lint passed.
  • Alloc-only stable/MSRV, thumb and actual C14N WASM execution passed. This preserves existing alloc-only paths; it does not introduce alloc-only XMLDSig.
  • Seven new public tests passed on MSRV with roxmltree, xmloxide and differential backends: syntax/Unicode, namespace provenance, original xsi attributes, split text/release, identity rejection, exact local/aggregate limits and depth 126–130.

Stacked on #232 to expose the combined scalar API to extension consumers. This change does not alter selected-key receipts or reference replay.

Closes #233

Summary by CodeRabbit

  • New Features
    • Added support for inspecting QName scalar values, including resolution of default, inherited, and prefixed namespace bindings.
    • QName inspection distinguishes malformed values from valid prefixed names whose prefix is not bound.
  • Documentation
    • Documented QName as a supported XSD 1.0 base type and clarified that QName inspection does not validate schema declarations.

@polaz
polaz added this pull request to stack #231 October 16, 2026 04:03
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 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-16T10:53:01.676508Z 82f0ab6 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.

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Repository: structured-world/xml-sec/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f490ffc7-38e9-429b-ab50-3be7cff67518
📥 Commits

Reviewing files that changed from the base of the PR and between 85fc464 and 82f0ab6.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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: 02184d9b-d503-4e28-9400-59a6c0a239c5
📥 Commits

Reviewing files that changed from the base of the PR and between 04ce5ee and 85fc464.

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

Adds QName to scalar inspection. It validates QName lexical forms, resolves namespace bindings from the original owner, and returns borrowed namespace and local-name values or malformed and unbound-prefix facts. Tests cover work accounting, identity, callbacks, and memory lifetime. The documentation describes the added behavior and its limits.

Changes: QName scalar inspection

Layer / File(s) Summary
QName scalar API and dispatch
src/xmldsig/extension/scalar.rs
Adds public QName datatype, value, and unbound-prefix fact variants. Routes QName interpretation through scalar inspection and uses the original lexical text without whitespace-collapse allocation.
QName parsing and namespace resolution
src/xmldsig/extension/scalar.rs, tests/xml_qname_inspection.rs, docs/xmldsig.md
Trims XML whitespace, validates QName components, and resolves prefixes using the owner’s namespace bindings. Tests cover lexical forms, namespace contexts, and XSI attributes. Documentation describes QName inspection and its limits.
Source handling and work accounting
tests/xml_qname_inspection.rs
Tests split-content joining and memory release, absent or complex content, stale or foreign identities, namespace lookup work limits, and inherited bindings at deep nesting levels.

Priority: ⬇️ Low

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

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant with_scalar
  participant inspect_qname
  participant OwnerNamespaceContext
  Caller->>with_scalar: request QName inspection
  with_scalar->>inspect_qname: interpret original lexical value
  inspect_qname->>OwnerNamespaceContext: resolve prefix in owner bindings
  OwnerNamespaceContext-->>inspect_qname: namespace binding
  inspect_qname-->>with_scalar: QName value or interpretation fact
  with_scalar-->>Caller: deliver inspection result
Loading
Merge Risk: ⚪ Minimal · up to 85fc4

No confirmed issue blocks merging.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 61.54% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 2 files. (1 skipped: … 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 identifies the main change: adding inspection of original expanded QNames in XML.
Linked Issues check Passed Issue #233 is directly linked and has coding requirements. The supplied PR summary reports ScalarType::QName in the existing scoped with_scalar API, borrowed namespace and local-name results, reta…
Out of Scope Changes check Passed The changed paths are src/xmldsig/extension/scalar.rs, tests/xml_qname_inspection.rs, and docs/xmldsig.md. Each change supports Issue #233 by implementing QName inspection, testing its contract,…
Full details: Docstring Coverage

Explanation

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

✨ Finishing Touches
📝 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.

@greptile-apps

greptile-apps Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] No identified issues block merging this PR.

Summary

Adds ScalarType::QName to original XML inspection.

  • Scoped XML inspection now returns expanded QName values.

No actionable issues were found. No tests or builds were run during this review.

Reviews (3) · Last reviewed commit: "feat(xml): inspect original expanded QNa..." · Reviewed by Greptile

@polaz
polaz force-pushed the feat/#233-scoped-qname branch from 85fc464 to 1f95547 Compare October 16, 2026 09:23
Base automatically changed from feat/#227-scoped-xsd-integer to main October 16, 2026 10:49
Resolve scoped QName values in the original namespace context with current execution accounting and borrowed results. Distinguish malformed names and unbound prefixes without schema loading.

Closes #233
@polaz
polaz force-pushed the feat/#233-scoped-qname branch from 1f95547 to 82f0ab6 Compare October 16, 2026 10:49
@polaz
polaz merged commit 674509b into main Oct 16, 2026
44 checks passed
@polaz
polaz deleted the feat/#233-scoped-qname branch October 16, 2026 11:35
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: inspect original expanded QName values

1 participant