# MoonEdit responsibility and testability

MoonEdit is editor functionality consumed by a host. It is not a standalone
application, agent runtime, workspace daemon, or domain pack. MoonDesk owns the
visible editor surface and executes every filesystem or language-provider
effect that MoonEdit describes.

## Package ownership

| Package | Responsibility | Deliberate boundary |
| --- | --- | --- |
| `src/core` | document, revision, selection, edit, and undo/redo invariants | no filesystem, UI, or provider transport |
| `src/input` | input normalization and edit intent | no DOM/browser event ownership |
| `src/commands` | deterministic command vocabulary | no host shortcuts or menus |
| `src/surface` | host-neutral surface projection | no Rabbita application |
| `src/workspace` | typed load/save/reload effects and version reconciliation | the host performs the effect |
| `src/language` | typed semantic query coordination and stale-result rejection | the host owns LSP transport |
| `src/merge` | deterministic three-way merge, conflicts, and resolution receipts | agent proposals cannot self-apply |
| `src/browser` | public browser-provider contract | browser mechanics remain in `internal/browser` |

Public concrete types stay in the package named by consumers. The
`internal/browser` package may implement browser mechanics but must not become
the owner of public editor types.

## Test seams

| Responsibility | Focused evidence |
| --- | --- |
| edit and history invariants | core black-box tests over revisions, selections, atomic edits, undo and redo |
| host effects | workspace tests that correlate request, revision, file version, success, stale and conflict callbacks |
| language results | query-result tests that reject mismatched document and provider versions |
| merge safety | exact clean-merge and conflict fixtures plus explicit resolution-receipt tests |
| browser boundary | provider-contract tests; a host integration test owns real browser behavior |

The ordinary integration proof is host-owned: open a file in MoonDesk, edit it,
save through a correlated effect, surface a stale remote revision, recover with
an explicit reload or merge choice, and preserve the selected document. That
workflow belongs in MoonDesk's UI-to-UI record rather than a fabricated
MoonEdit application.
