# MoonEdit product contract

Class: library/functionality
Maturity: editor-core alpha
Last reviewed: 2026-07-31

## Outcome

MoonEdit gives MoonDesk and other hosts a deterministic, host-independent text
and code editing core with revisions, selections, undo/redo, workspace effects
and typed language-provider coordination.

## Ownership

MoonEdit owns document state, UTF-16 positions, edit application, revision
identity, bounded history, workspace effect contracts and in-memory language
orchestration. It does not own filesystem persistence, host transport, desktop
UI, model execution or accepted book truth.

## Capability status

| Capability | Status |
| --- | --- |
| Document editing and revision model | available |
| Atomic edits, selection and bounded undo/redo | available |
| Workspace save/load/reload effect contracts | available |
| Typed semantic token/completion/definition lanes | available |
| Deterministic three-way merge and conflict receipts | available |
| Host LSP transport | planned |
| Persistence adapter | planned/integration-owned |
| Merge/conflict-resolution UI | planned/host-owned |
| Large-file performance claim | not established |

## Host contract

Hosts execute explicit effects and return callbacks bound to exact request,
revision and file-version identities. Unknown or mismatched versions produce a
stale/conflict state. MoonDesk owns the concrete file picker, persistence, LSP
transport and UI.

The [merge contract](MERGE_CONTRACT.md) binds base/local/remote text to those
exact identities, composes only unambiguous edits and records every ambiguous
overlap. Agent resolution proposals require a separate named-human acceptance
receipt before Workspace can apply them.

Feature worktrees such as `moonedit-browser` and `moonedit-input` are branches
of this library, not separate products.

## Verification

```sh
moon check --target all --warn-list +73
moon test --target all
moon info
moon fmt
```

## Release gates and next milestones

- Integrate direct code editing into MoonDesk.
- Add a real persistence host and LSP transport.
- Add the host-owned conflict presentation and choice UI.
- Establish large-file performance limits and recovery behavior.
