Skip to content

interchange: use shared XML and JSON nesting preflight - #3783

Merged
dylanmtaylor merged 3 commits into
mainfrom
refactor/interchange-shared-preflight
Nov 16, 2026
Merged

dylanmtaylor merged 3 commits into
mainfrom
refactor/interchange-shared-preflight

Conversation

@dylanmtaylor

@dylanmtaylor dylanmtaylor commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Scope

Part of storytold/craft-libs#782. Replace local XML/JSON lexical depth scanners with craft_timeline::preflight. The shared implementation is an attributed extraction of the same source, not a different validating parser.

Dependencies / merge hold

Stacked on #3773, which must land first. Shared storytold/craft-libs#1910 is a prerequisite; this currently pins its review head, not merged main. Repin to its merge, retarget to main and rerun fresh hosted gates/review before landing. Keep #3773's unresolved issues visible, including marker-color parity; do not merge around them.

Safety and parity

Retains MAX_DEPTH=256, entity refusal, format selection and all existing malicious entity/deep nesting tests unchanged. No app-specific policy is removed. Removes 72 app production lines; reusable lexical scanning remains shared. This is not full XML/JSON validation or whole-app completion.

Validation

Generated lockfile, locked metadata and diff check passed. No local build/tests. Shared extraction independently reviewed; consumer delta review and GitHub CI pending.

Summary by CodeRabbit

  • Refactor
    • Import depth handling now uses a shared implementation. No user-facing behavior changes are noted in this update; importing content should continue to work as before, with the same depth handling and results. This update does not add new user-facing features or change the available import options.

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The workspace adds craft-timeline at a pinned Git revision. The interchange crate declares the dependency and re-exports its JSON and XML depth scanners from craft_timeline::preflight, replacing local implementations.

Changes: Interchange depth scanners

Layer / File(s) Summary
Dependency and scanner integration
Cargo.toml, crates/interchange/Cargo.toml, crates/interchange/src/import.rs
The workspace and interchange crate declare craft-timeline. The import module re-exports its XML and JSON depth scanners in place of local implementations.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Refactor

Suggested reviewers: echelon, fredapps

Merge Risk: Minimal · up to e57aa

The change swaps the local XML and JSON nesting scanners for shared ones from craft-timeline. No concrete defect was established. Before landing, repin the dependency to its merged revision and confirm the hosted build and the existing deep-nesting and entity tests pass.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "interchange: use shared XML and JSON nesting preflight" matches the main change. The PR removes the local XML and JSON depth scanners in crates/interchange/src/import.rs and re-exports json…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "interchange: use shared XML and JSON nesting preflight" matches the main change. The PR removes the local XML and JSON depth scanners in crates/interchange/src/import.rs and re-exports json_depth and xml_depth from craft_timeline::preflight. The Cargo.toml changes add the craft-timeline workspace dependency that supports this. The title is specific and short, and it names the affected crate and the shared preflight.

Finishing Touches

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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between e2cbc08 and e57aa56.

Files ignored due to path filters: 1

  • Cargo.lock is excluded by !**/*.lock
Files selected for processing: 1

  • Cargo.toml

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

@FredApps FredApps left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scoped source review of b6d2598: compared the removed scanners with craft_timeline::preflight at the exact pinned a2560df0 revision. The lexical algorithms are preserved, including quoted XML attributes, comment/CDATA/declaration skipping, escaped JSON strings and saturating closing-depth behavior. The shared module is available without default features. Effect retains MAX_DEPTH=256, format selection and explicit XML entity refusal before calling Film's parser; existing hostile-input tests are unchanged. No blocking defect found in this narrow extraction, which is not full XML/JSON validation.

Hosted Ubuntu CI43907724588 passes both deeply_nested_documents_error_instead_of_overflowing_the_stack and xml_timelines_declaring_entities_are_refused; 6,453 tests passed,45 skipped. Nix and the four-shard Sonar workflow also passed. No local build/tests run for this review.

Merge hold remains: #3773 and storytold/craft-libs#1910 are both still open, this PR targets the #3773 branch, and craft-timeline remains pinned to a review revision rather than a merged prerequisite. Land the prerequisites, repin to the actual shared merge and retarget/integrate main, then renew exact-head validation and review. This comment does not qualify the broader Film dependency refresh or authorize bypassing its blockers.

@dylanmtaylor
dylanmtaylor changed the base branch from refactor/interchange-current-shared-film to main November 16, 2026 18:15
@sonarqubecloud

Copy link
Copy Markdown

@dylanmtaylor
dylanmtaylor merged commit 60e2cbb into main Nov 16, 2026
12 checks passed
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.

2 participants