Skip to content

fix: reject duplicate and empty source map entries - #276

Merged
Teakowa merged 1 commit into
mainfrom
fix/source-map-entry-validation
Sep 24, 2026
Merged

Teakowa merged 1 commit into
mainfrom
fix/source-map-entry-validation

Conversation

@e54-bot

@e54-bot e54-bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #274 (implements #272), carrying review fixes that landed on the branch after the merge.

Summary

  • SourceMap::apply rejects duplicate node entries (DuplicateEntry) and declaration entries with neither span nor name_span (EmptyEntry); both were previously accepted silently.
  • Docs: apply drops retained source documents, spans may be empty, decoders ignore unknown members.
  • ADR-0013: the shape guard also counts variable and subroutine declarations.

Behavior of attaching after shape drift is unchanged.

Test plan

  • cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace --all-targets (new duplicate/empty-entry tests)
  • git diff --check

Address review findings: SourceMap::apply now rejects duplicate node
entries and declaration entries without a span. Document that apply drops
retained source documents, that spans may be empty, and that decoders
ignore unknown members; amend ADR-0013 for the declaration counts in the
shape.

Refs #272
@Teakowa
Teakowa merged commit 5548976 into main Sep 24, 2026
5 checks passed
@Teakowa
Teakowa deleted the fix/source-map-entry-validation branch September 24, 2026 08:41
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