# Changelog

All notable changes to this project are documented in this file.

The project follows Semantic Versioning. Dates use the ISO `YYYY-MM-DD`
format.

## [0.5.0] - 2026-08-15

### Added

- `unified_diff_standard` for preserving whether every line, especially the
  final line, is terminated by a newline.
- Conventional `\ No newline at end of file` markers for unterminated deleted,
  inserted, and context lines.
- EOF-newline tests for both directions, empty files, non-BMP lines, and
  multiple terminated hunks.

### Compatibility

- Existing `unified_diff` and `unified_diff_with_context` output remains
  unchanged. Consumers can opt into exact EOF semantics with the new API.

## [0.4.0] - 2026-08-15

### Added

- `apply` for safely applying raw or compacted edit scripts to validated source
  text.
- `invert` for reversing an edit script and transforming new text back to old
  text.
- Structured `ApplyError` cases for exhausted, mismatched, and unconsumed
  Unicode source text.
- Tests covering forward and reverse application, compact scripts, non-BMP
  mismatches, empty scripts, and every validation error.
- A single-install CI pipeline that checks all three backends without parallel
  toolchain-download flakiness.

## [0.3.0] - 2026-08-15

### Changed

- Replaced the character-level LCS matrix traceback with a true Myers
  furthest-reaching trace.
- Reused the same generic Myers implementation for line-level Unified Diff.
- Reduced memory use for long inputs with a small edit distance from an
  unconditional `O(N*M)` matrix to `O((N+M)*D)` trace storage.

### Added

- Deterministic round-trip coverage across 81 Unicode input pairs.
- A long-input regression test and benchmark with a 2048-character shared
  middle span.
- Detailed algorithm and complexity documentation.

## [0.2.0] - 2026-08-15

### Added

- `compact` for merging adjacent edit operations.
- `reconstruct_old` and `reconstruct_new` for edit-script round trips.
- `DiffStats` and `stats` for Unicode character counts.
- `unified_diff_with_context` with custom labels, bounded context, and multiple
  hunks.
- Tests for Unicode round trips, compact scripts, hunk coordinates, zero-line
  ranges, label sanitization, and normalized line endings.
- Multi-backend CI coverage and contributor documentation.

### Changed

- Expanded the runnable example to demonstrate the complete public workflow.
- Documented Unicode scalar-value semantics, complexity, and current limits.

## [0.1.0] - 2026-08-15

### Added

- Unicode-safe character-level text diff.
- Line-oriented Unified Diff rendering.
- CRLF, LF, and CR normalization.
- Runnable example, CI, MoonDoc comments, and non-BMP regression tests.

[0.5.0]: https://github.com/pei0331/moon-diff/compare/v0.4.0...v0.5.0
[0.4.0]: https://github.com/pei0331/moon-diff/compare/v0.3.0...v0.4.0
[0.3.0]: https://github.com/pei0331/moon-diff/compare/v0.2.0...v0.3.0
[0.2.0]: https://github.com/pei0331/moon-diff/compare/4aff55d...v0.2.0
[0.1.0]: https://github.com/pei0331/moon-diff/tree/4aff55d
