Skip to content

fix(driver): drop the unreachable retained-source validation fallback - #628

Merged
e54-bot merged 1 commit into
mainfrom
fix/626-drop-span-fallback
Oct 11, 2026
Merged

e54-bot merged 1 commit into
mainfrom
fix/626-drop-span-fallback

Conversation

@e54-bot

@e54-bot e54-bot commented Oct 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

Removes the #583 retained-source recovery fallback in session.rs, which #626 shows is unreachable after the workshop-rs 1.13 bump (#624/#625): set_file_source prunes provenance spans that do not resolve in the attached document, and the only source-dependent validate() check (wir/validate.rs byte_range) runs on spans pruning already removed. A remaining validate() failure is therefore source-independent — the unretained re-parse could only re-surface the same error, never recover.

Test plan

  • cargo test -p wright-driver --test source_provider — 37/37, including mapped_span_outside_retained_source_degrades_extents_not_the_load
  • cargo fmt --all -- --check, git diff --check
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo test --workspace --all-targets --all-features — full workspace green
  • git grep source-map-span-overflow — no remaining references

Fixes #626

workshop-rs 1.13's set_file_source prunes provenance spans that do not resolve in the attached document, and the only source-dependent validate check runs on spans pruning already removed; a remaining validate() failure is source-independent, so the unretained re-parse could only re-surface the same error. The fallback, the retained_source flag, and the source-map-span-overflow warning are removed; validation errors now return directly. The span-pruning regression test keeps its assert and gains the new issue reference.

Fixes #626

@e54-bot e54-bot left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Independent review — LGTM. Verified unreachability end to end: SourceMap::apply rebinds the file table, bounds/validates all mapped spans, and settings.clear_spans() covers the non-provenance spans; set_file_source's prune_spans_outside covers every provenance slot; to_wir sources WIR spans only from provenance; check_span's byte_range is the only source-dependent check and runs only for files with attached source, where post-prune all spans resolve. The !retained_source early-return is equivalent to the new error path (same &source_files-iff-Mapped argument). No dangling source-map-span-overflow references, no dead imports; test comment accurate.

@e54-bot
e54-bot merged commit bb7f496 into main Oct 11, 2026
24 checks passed
@e54-bot
e54-bot deleted the fix/626-drop-span-fallback branch October 11, 2026 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

Remove the now-unreachable retained-source validation fallback in session.rs

2 participants