feat: add immutable level template lifecycle
This commit is contained in:
@@ -60,22 +60,27 @@ The server stores its tables and migration ledger in the dedicated `osint` schem
|
||||
|
||||
The accepted model stores each playable or editable level as an isolated mutable board of normalized exhibits. Immutable template-version boards are cloned to create levels, and mutable levels can be cloned back into new template versions. Assets remain immutable and reusable across those copies.
|
||||
|
||||
The running POC still uses the earlier `widgets` and `playthrough_*` tables while the exhibit-schema cutover is prepared. They are explicitly transitional; new domain concepts should follow the exhibit model rather than extending those tables.
|
||||
The running POC uses the canonical exhibit schema directly. The earlier JSON case store, `widgets`, and `playthrough_*` tables were removed in migration 006.
|
||||
|
||||
The API surface is:
|
||||
|
||||
- `GET /api/levels`
|
||||
- `POST /api/levels` (editor only)
|
||||
- `GET /api/templates`
|
||||
- `POST /api/templates/:slug/levels` (instantiate a version; editor only)
|
||||
- `GET /api/levels/:id`
|
||||
- `PUT /api/levels/:id`
|
||||
- `POST /api/levels/:id/reset`
|
||||
- `POST /api/levels/:id/templates` (save a new immutable version; editor only)
|
||||
- `POST /api/levels/:id/documents` (editor only)
|
||||
- `GET /api/assets/:id`
|
||||
- `GET /api/health`
|
||||
|
||||
The browser also keeps a local emergency copy so a network interruption does not lose an in-progress board.
|
||||
|
||||
## Level editor
|
||||
|
||||
Set `LEVEL_EDITING_ENABLED=true` and open `/?edit=1`. If the database is empty, this surface creates the first blank level. The target model intentionally makes editing and playing the same operation against a mutable level; authoring additionally exposes “save as template”. The current playthrough overlay remains only until the exhibit-schema migration is complete.
|
||||
Set `LEVEL_EDITING_ENABLED=true` and open `/?edit=1`. If the database is empty, this surface creates the first blank level. Editing and playing are the same operation against a mutable level. Authoring additionally exposes **Save Template** and **New From Template**. Saving creates a new immutable version; instantiating gives every exhibit a fresh ID while sharing immutable binary assets. Reset restores the exact template version from which a level was created.
|
||||
|
||||
In edit mode, files can be dragged from the desktop onto the board or selected with **Import Document**. Images, PDFs, and text files render inside document windows; unknown formats remain downloadable source files. Extracted evidence becomes an editable folder widget. Its editor controls the title, annotation, contained documents, and each source document's publication time. The default upload limit is 25 MB and can be changed with `MAX_DOCUMENT_BYTES`.
|
||||
|
||||
@@ -96,7 +101,7 @@ Folder ownership is stored as a normalized membership. The contained document ex
|
||||
|
||||
An open folder draws a pale red containment band to each expanded file. Each dated file independently projects a grey line to the temporal index. This allows the player to arrange files until those grey lines are vertical, close the folder, and later reopen the same arrangement.
|
||||
|
||||
The frontend widget registry maps an exhibit type, and optionally a document type, to its React visualization. Widgets do not own investigation-domain data.
|
||||
The planned frontend widget registry will map an exhibit type, and optionally a document type, to its React visualization. Widgets do not own investigation-domain data.
|
||||
|
||||
## Deploy at osint.glitch.university
|
||||
|
||||
|
||||
Reference in New Issue
Block a user