Skip to content

feat: resolve MDI source spans - #75

Merged
Iktahana merged 1 commit into
mainfrom
agent/source-span-resolution
Aug 13, 2026
Merged

feat: resolve MDI source spans#75
Iktahana merged 1 commit into
mainfrom
agent/source-span-resolution

Conversation

@Iktahana

Copy link
Copy Markdown
Contributor

Summary

  • add Rust-owned resolve_mdi_source_span resolution from half-open UTF-8 source spans to canonical block/grapheme ranges
  • expose typed Node and browser WASM APIs with explicit coverage, relation, channel, ordering, and validation semantics
  • retain comprehensive Rust, TypeScript, projection-version, round-trip, and packed-browser contract tests
  • document boundary, delimiter, ruby, synthetic/unmapped, multi-block, and non-bijective behavior in English, Japanese, and Traditional Chinese

Related issue

Closes #74.

Validation

  • cargo fmt --check
  • cargo clippy -- -D warnings
  • cargo test
  • cargo llvm-cov --locked --fail-under-lines 90 --fail-under-functions 90 --fail-under-regions 90 --summary-only
    • lines 96.88%, functions 93.12%, regions 95.52%
  • pnpm install --frozen-lockfile
  • pnpm typecheck
  • pnpm build
  • pnpm test:browser (Chromium, Firefox, WebKit)
  • node --test nodejs/scripts/pack-publishable-package.test.mjs
  • pnpm test:coverage

Checklist

  • This PR is focused and does not include unrelated changes.
  • I added or updated tests for behavior changes.
  • I updated the specification and/or documentation when public behavior changed.
  • I ran the relevant checks and recorded them above.
  • The repository's release workflow computes patch releases from the merged diff; no Changeset file is used.
  • I have not added secrets, credentials, or sensitive data.

Notes for reviewers

The projection wire shape and MDI_TEXT_PROJECTION_VERSION remain 1.0; this adds a separate result boundary without changing the existing projection envelope. Package versions are intentionally left to the repository's post-merge release workflows.

@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.64804% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
mdi-core/src/text_projection.rs 96.64% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

@Iktahana
Iktahana marked this pull request as ready for review August 13, 2026 06:43
@Iktahana
Iktahana merged commit dceb7af into main Aug 13, 2026
22 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.

Expose source-span → canonical text-range resolution

1 participant