# Hatch development branch: bounded block-edit overlay

This independent Apache-2.0 implementation is based on RustMC commit
`cf5cac9742db9ae06625a1922bc63e57730c5f74`. It is not accepted upstream.
External contributions are currently paused under CONTRIBUTING.md; no PR,
maintainer endorsement, or completed multiplayer milestone is implied.

## Implemented

`world::edits::EditOverlay` stores accepted changes separately from generated
terrain. It uses an explicit entry cap, never evicts accepted edits, rejects
stale expected values, assigns monotonically increasing revisions, and
materializes fresh chunk copies for consumers. Restoring a cell to its baseline
value releases its slot. Rejected edits leave revision and content unchanged.
Eight new tests exercise regeneration, independent readers, conflicting writes,
capacity, restoring terrain, negative chunk boundaries, invalid coordinates,
no-ops, and revision overflow.

## Validation on Linux, Rust 1.98.1

- Targeted edit-overlay tests: 8 passed.
- Full workspace: 272 tests passed, 12 ignored (operator-owned fixtures required).
- Formatting, check, clippy with warnings denied, build, documentation,
  dependency-license checker and example configuration validation passed.
- Baseline server library before the change: 209 passed, 12 ignored.

These are executed local results, not GitHub CI results or a two-client demo.

## Boundaries and next work

The module is not wired into the Java preview. It does not validate player
permissions, reach, collision, inventory, session sequences or tick admission;
these belong before the mutation primitive. No disk persistence, packet
broadcast, player visibility, authentication or cross-play is added.
The caller must supply fresh immutable baseline chunks from the SAME generator
and must serialize writes through one authoritative owner. A useful next step
is a bounded owner that pins the generator and validates loaded-chunk access,
followed by session sequencing and reproducible two-reader integration tests.
Do not expose a network gameplay endpoint or mark world_ready true.

## Provenance

Original Rust code written for Hatch from RustMC's public world API and its
M3 authoritative block-interaction design. No other server implementation,
Mojang code, assets, registry data or private materials were copied.

## Reproduce

Check out the base commit, then run `git apply changes.patch`. Use the pinned toolchain and commands recorded in validation.txt.
