Add circuit history commands

This commit is contained in:
2026-07-23 22:18:36 +02:00
parent bd5f4f925f
commit ca13efbfcb
16 changed files with 1402 additions and 85 deletions
+9 -7
View File
@@ -23,13 +23,15 @@ concurrency checks.
- executes the eligible inverse or forward command as a new auditable
revision
The public dispatcher currently supports `circuit.update`,
`circuit-device-row.update`, `circuit-device-row.insert` and
`circuit-device-row.delete`, all with schema version `1`. Other command types
are rejected. Insert commands contain the complete row with its stable id;
delete commands identify the row and its expected circuit. This makes deletion
undoable without generating a replacement identity. The editor does not
consume these endpoints yet.
The public dispatcher currently supports `circuit.update`, `circuit.insert`,
`circuit.delete`, `circuit-device-row.update`,
`circuit-device-row.insert` and `circuit-device-row.delete`, all with schema
version `1`. Other command types are rejected. Insert commands contain the
complete entity or circuit block with stable ids; delete commands include the
expected parent identity. Circuit snapshots contain zero, one or multiple
complete device rows. This makes deletion undoable without generating
replacement identities or renumbering circuits. The editor does not consume
these endpoints yet.
Example:
+7 -4
View File
@@ -82,10 +82,13 @@ die unterstützten Typen `circuit.update` und `circuit-device-row.update` über
`circuit-device-row.insert` und `circuit-device-row.delete` als atomare
Strukturkommandos vorhanden. Beim Löschen wird die vollständige Zeile im
inversen Kommando gesichert, sodass Undo dieselbe UUID und alle Fachwerte
wiederherstellt. Das Grid verwendet diese Endpunkte noch nicht; seine sichtbare
Historie bleibt daher sitzungslokal. Die übrigen Struktur-, Synchronisierungs-
und Löschoperationen müssen vor der Frontend-Umstellung ebenfalls als
persistente Commands modelliert werden.
wiederherstellt. `circuit.insert` und `circuit.delete` behandeln einen
Stromkreis mit null, einer oder mehreren Gerätezeilen als vollständigen Block.
Undo bewahrt dabei sämtliche Circuit-/Row-UUIDs und ändert keine
Betriebsmittelkennzeichen. Das Grid verwendet diese Endpunkte noch nicht; seine
sichtbare Historie bleibt daher sitzungslokal. Verschiebe-, Sortier-,
Neunummerierungs- und Synchronisierungsoperationen müssen vor der
Frontend-Umstellung ebenfalls als persistente Commands modelliert werden.
## Projektgeräte
@@ -176,12 +176,15 @@ Completed foundation:
- `circuit-device-row.insert` and `circuit-device-row.delete` preserve stable
row ids, complete deleted-row snapshots and circuit reserve state through
atomic insert/delete, revision and stack transitions
- `circuit.insert` and `circuit.delete` persist a complete circuit block with
zero, one or multiple device rows; undo restores all ids and fields without
renumbering
Remaining constraints before completing persistent history:
- extend the concrete project-scoped command union and executors beyond the
Circuit field and CircuitDeviceRow field/insert/delete slices; the generic
versioned command envelope is complete
Circuit field/insert/delete and CircuitDeviceRow field/insert/delete slices;
the generic versioned command envelope is complete
- route the remaining structural, synchronization and destructive domain
writes through the shared command, revision and stack transaction boundary
- replace the session-local frontend command stack only after server-side
@@ -393,6 +393,8 @@ Implemented foundation:
- typed CircuitDeviceRow insert/delete commands preserve complete row snapshots
and stable ids; row mutation, circuit reserve state, revision and history
stack transition commit or roll back together
- typed Circuit insert/delete commands treat the circuit and all device rows as
one block, preserve every stable id and never renumber neighbouring circuits
- revision metadata, change-set payloads and the project counter are committed
in one SQLite transaction
- a stale expected revision produces no history writes