chore(architecture): enforce layer boundaries

This commit is contained in:
syntaxbullet
2026-07-03 09:34:21 +02:00
parent a8dbd26474
commit d7406e803a
14 changed files with 354 additions and 17 deletions

10
commands/AGENTS.md Normal file
View File

@@ -0,0 +1,10 @@
# Commands Rules
- `commands/` is the only place state changes are implemented.
- Commands may change persistent `ImageDocument` state and transient `EditorState`.
- Commands must be deterministic, testable, and side-effect free.
- Do not import React, DOM UI, renderer/WebGL internals, storage, network, timers, or filesystem APIs.
- Validate payloads before applying changes.
- Preserve all `core/` and `editor/` invariants.
- Return the next `AppState`; do not mutate existing state objects in place.
- Every command needs a stable id, clear payload type, and focused responsibility.