0004 — Validated transactions for design data
Status: accepted · protocol: Collaboration protocol
Context
Electrical connectivity and geometry have invariants: references must exist, a schematic keeps at least one sheet, ids are unique. A last-writer-wins map or a naive CRDT can merge into states that are each valid separately but invalid together.
Decision
Every edit to structured design data is a transaction of entity operations (create, update, delete, set). It is checked against the entity schema, referential integrity and whole-document constraints, and applied atomically. The same engine powers:
- local undo/redo (an undo is the inverse transaction),
- crash recovery (a journal of applied transactions),
- collaboration (the server serializes transactions per document and rejects one that touches an entity changed since the client’s base, so the client rebases),
- review flows (extensions and MCP clients propose transactions; a person approves them after seeing a field-by-field summary).
Text documents (HDL, firmware, notes) and presence (cursors, selections) are the cases where CRDT or last-writer-wins semantics are acceptable. Text CRDT support is planned.
Consequences
- A TypeScript reference implementation and shared conformance vectors keep the C# server and the clients identical.
- Concurrent edits to different entities merge automatically. Edits to the same entity are never silently overwritten.