Add persistent history stacks

This commit is contained in:
2026-07-23 21:48:24 +02:00
parent 2d0aa11d9c
commit 1e4dd26bb8
24 changed files with 2294 additions and 15 deletions
+8 -1
View File
@@ -7,7 +7,14 @@ All paths below are mounted below `/api`. There is no Consumer application API.
Project responses from `GET /projects` and `GET /projects/:projectId` include
`currentRevision`. It currently exposes the persisted revision foundation only;
no public history, undo or redo endpoint exists yet.
no public undo or redo command exists yet.
### Project History State
- `GET /projects/:projectId/history`
- returns `currentRevision`, `undoDepth`, `redoDepth` and the current top
change-set id for both persistent stacks
- is read-only; the editor does not consume it yet
## Circuit-First Endpoints
+6 -3
View File
@@ -73,9 +73,12 @@ angeschlossen. Für Circuit- und Gerätezeilen-Feldänderungen existieren intern
Command-Stores, die Fachänderung, automatisch erzeugtes inverses Kommando und
Revision gemeinsam committen beziehungsweise zurückrollen können.
Gerätezeilen-Kommandos bewahren dabei auch lokale ProjectDevice-Overrides und
prüfen Projektzugehörigkeit von Verknüpfungen und Räumen. Die Stores sind noch
nicht über die API oder das Grid aktiviert; serverseitiges Undo/Redo ist daher
noch nicht verfügbar.
prüfen Projektzugehörigkeit von Verknüpfungen und Räumen. Projektweite,
persistente Undo-/Redo-Stacks verwalten die zulässige LIFO-Reihenfolge und
verwerfen den Redo-Zweig bei einem neuen Benutzerkommando. Ihr Status ist über
`GET /api/projects/:projectId/history` lesbar. Die schreibenden Command-Stores
sind noch nicht über die API oder das Grid aktiviert; serverseitiges Undo/Redo
ist daher noch nicht verfügbar.
## Projektgeräte
@@ -160,16 +160,24 @@ Completed foundation:
- integration tests apply the generated inverse as a new `undo` revision and
verify rollback for stale revisions and late history failures on both update
command types
- project-scoped relational undo/redo stacks persist eligible original change
sets independently from immutable audit revisions
- stack transitions enforce LIFO order, keep undo/redo revisions out of the
eligibility stacks and clear the redo branch on a new user command
- domain writes, audit revisions and stack transitions share one transaction;
a forced stack failure rolls all of them back
- `GET /api/projects/:projectId/history` exposes current revision, stack depths
and top change-set ids without enabling mutation endpoints
Remaining constraints before implementing history:
Remaining constraints before completing persistent history:
- extend the concrete project-scoped command union and executors beyond the
internal Circuit and CircuitDeviceRow update slices; the generic versioned
command envelope is complete
- route domain writes and revision recording through one shared project
transaction boundary; the current revision repository only commits history
records and the counter together
- expose revision state and history eligibility through the application API
- route the remaining structural, synchronization and destructive domain
writes through the shared command, revision and stack transaction boundary
- add public command execution plus undo/redo endpoints; read-only revision and
stack eligibility state is already exposed
- replace the session-local frontend command stack only after server-side
command execution and inverse application are complete
- do not model IFCGUID as an overloaded circuit equipment identifier
+7 -1
View File
@@ -361,7 +361,7 @@ Tasks:
- route domain writes and history records through one shared transaction
- define concrete serializable domain command descriptions and executors
outside React
- persist undo/redo eligibility on the server
- [x] persist undo/redo eligibility on the server
- add named and periodic logical project snapshots
- restore a historical snapshot as a new revision
- keep database backups separate from logical history
@@ -379,6 +379,12 @@ Implemented foundation:
- an internal typed `circuit-device-row.update` command uses the same boundary,
records derived ProjectDevice override metadata and rejects cross-project
rows, device links and rooms
- relational project-wide undo/redo stacks persist eligible original change
sets, enforce LIFO order and clear redo on a new user command
- stack transitions are part of the domain/revision transaction and have
late-failure rollback coverage
- a read-only project history endpoint exposes revision, stack depths and top
change-set ids
- revision metadata, change-set payloads and the project counter are committed
in one SQLite transaction
- a stale expected revision produces no history writes