From 38bcf47fb14fe7982e827a7f9537c5107e171c26 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 3 Jun 2026 03:12:05 +0100 Subject: [PATCH] Document Mimir Verse service contract --- README.md | 3 + docs/verse-service-contract.md | 144 +++++++++++++++++++++++++++++++++ state/map.yaml | 90 +++++++++++++++++++++ 3 files changed, 237 insertions(+) create mode 100644 docs/verse-service-contract.md diff --git a/README.md b/README.md index 457e692..89b2426 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,9 @@ Start with: - [docs/fensalir-rendering-rebuild-migration.md](docs/fensalir-rendering-rebuild-migration.md) for the current teardown/rebuild migration plan between Mimir's physical evidence window and Fensalir's field-evidence renderer. +- [docs/verse-service-contract.md](docs/verse-service-contract.md) for the + CultCache/CultMesh/Odin/Eve service contract and demotion line for old + dashboards, JSON witnesses, and compatibility transports. Naming note: **Fensalir** is the engine/windowing/rendering/D3D12 layer. Older research notes may still use the previous engine name. diff --git a/docs/verse-service-contract.md b/docs/verse-service-contract.md new file mode 100644 index 0000000..e0aaddd --- /dev/null +++ b/docs/verse-service-contract.md @@ -0,0 +1,144 @@ +# Mimir Verse Service Contract + +Mimir is a Verse service for the measured room. It accepts local and network +sensors, publishes typed observations and capture pages, asks Fensalir to lower +field evidence into program surfaces, and exposes operator controls through +Eve/CultUI surfaces. OBS, browser dashboards, JSON logs, and screenshot streams +are lowerings or witnesses. They are not canonical presentation or state owners. + +## Owner Map + +- Mimir service owner: configuration, launch, calibration truth, sensor + identity, stream identity, synchronization state, Well publication, recorder + receipts, and service contract. +- `Mimir.Runtime`: bounded rolling buffers, source descriptors, source polling, + direct native ingest, audio synchronization analysis, and cached read models. +- Native sensor workers: device reads, closest-to-device timestamps, native or + GPU handles, unavoidable copy counts, and per-device actuator commands. +- `Mimir.Well`: typed live pages, configured composite state, timing pressure, + feature signals, capture-body publication, and the append-side observation + ledger. +- `Mimir.VerseRecorder`: run session receipts, body indexing, replay witnesses, + and `.cc`/CultCache-compatible export for offline reconstruction. +- `Mimir.FensalirDaemon`: reservoir job selection, queue pressure, GPU worker + ownership, program/reservoir surfaces, and daemon state. +- Fensalir: D3D12 resource resolution, field claims, selected lowerings, + temporal guide lanes, reservoir resolve, and program presentation. +- Faust/native DSP: hot audio alignment, sample movement, suppression, + separation, spatialization, and program stems. +- Eve/CultUI lowerings: operator interaction and display of provider-owned + state. They submit commands to owners; they do not own synchronization, + reservoir jobs, OBS composition, or calibration truth. +- Odin: discovery of Mimir's published CultMesh namespaces and Eve surfaces. + +## CultCache Witness Contract + +Durable state should be typed CultCache `.cc`, or CultCache-compatible with a +`.cc` witness/export during migration. The witness set is: + +| State family | Owner | Durable shape | +| --- | --- | --- | +| Sensor state | `Mimir.Runtime` plus native workers | Source inventory, device identity, driver profile, clock domain, format, actuator capability, native handle class, copy count, and last health. | +| Media state | `Mimir.Well` / Fensalir | Capture page metadata, resource keys, body refs, fence refs, page timing, configured composites, and program surface refs. | +| Observation state | `Mimir.Runtime` / Well | Typed audio/video/IMU/feature/path observations with source id, time range, confidence, calibration id, and payload/resource reference. | +| Ledger state | `Mimir.VerseRecorder` | Session receipts, body index, replay cursor, migration version, schema witness, and rejected/drop reasons. | +| Control state | Runtime owners / Fensalir daemon / DSP | Operator commands, accepted command receipts, selected program layer state, reservoir worker pressure, audio actuator commands, and stream/record/live status. | + +JSON may remain only as schema publication, diagnostic text export, external +tool boundary, or temporary replay witness. If a JSON file can decide behavior +without a typed `.cc` witness, it is still an owner and must be migrated. + +## CultMesh Namespaces + +Mimir should publish these namespaces for Odin discovery: + +- `verse.mimir.service.v1`: service manifest, run id, host identity, schema + catalog, transport lanes, and nested Verse roots. +- `mimir.sensor.*`: source inventory, native worker health, device timing, + media format, actuator capability, and producer fences. +- `mimir.media.*`: capture pages, media bodies, resource references, program + texture/fence refs, stem refs, and replay body indexes. +- `mimir.observation.*`: sensor observations, media observations, feature + tracks, audio path evidence, calibration constraints, and local frustum hints. +- `mimir.ledger.*`: recorder session, append cursor, migration state, + body-index records, dropped-page reasons, and evidence receipts. +- `mimir.control.*`: operator commands, command receipts, recording/streaming + state, runtime mode, source placement, DSP actuator state, and reservoir + scheduling pressure. +- `mimir.eve.*`: `gamecult.eve.surface.v1` provider manifests, retained + surfaces, field bindings, assets, command bindings, and lowering metadata. +- `mimir.fensalir.*`: daemon summary, reservoir worker state, reservoir pressure, + program surfaces, resource resolver status, and selected lowering status. + +Existing document names such as `mimir.well_snapshot.v1`, +`mimir.well_capture_page.v1`, `mimir.eve_sensor_observation.v1`, +`mimir.eve_media_observation.v1`, `mimir.eve_dashboard_state.v1`, +`mimir.fensalir_daemon_state.v1`, `mimir.fensalir_reservoir_worker_state.v1`, +and `mimir.fensalir_reservoir_pressure.v1` should be kept as concrete records +inside those namespaces until a schema catalog renames them deliberately. + +## Eve Surfaces + +Mimir publishes operator presentation as Eve/CultUI DSL, preferably +`gamecult.eve.surface.v1`. The expected surfaces are: + +- `mimir.sensor.field.surface`: sensor field view with source health, buffer + depth, timing confidence, calibration status, copy count, media format, + resource residency, and per-source observation pressure. +- `mimir.operator.flow.surface`: operator workflow for source selection, + program placement, audio strips, record/live controls, reservoir pressure, + sync mode, command receipts, and safe degraded-state visibility. +- `mimir.observation.ledger.surface`: session/replay view over observation + counts, body refs, accepted/dropped pages, cursor state, and schema witness. +- `mimir.fensalir.reservoir.surface`: daemon-owned worker queue, ready ratio, + timing confidence, GPU queue pressure, drop causes, and program surface refs. + +The old dashboard broker, WebSocket `/eve/deck` lane, `/eve/dashboard` +compatibility endpoint, JSON health endpoints, JPEG streams, and browser +prototypes are lowerings or transport probes. They may mirror the Eve surface, +but they do not become presentation owners. + +## Nested Verses + +Mimir's service Verse contains smaller Verses with bounded authority: + +- Room Verse: calibration truth, coordinate frame, sensor graph, clock model, + configured composites, and operator identity for one physical room. +- Sensor Verse: one device or logical source, including driver health, timing + domain, media format, actuator surface, and observation stream. +- Stream Verse: one synchronized media/control lane, including rolling-window + cursor, capture pages, resource refs, body refs, and backpressure state. +- Operator Verse: Eve/CultUI command surface, selected source/layer state, + command receipts, record/live state, and degraded-state visibility. + +Nested Verses may publish local surfaces and state, but the parent Mimir service +owns discovery and contract routing. A sensor may report what it observed; it +does not become room clock authority unless explicitly promoted by calibration +state. + +## Migration Order + +1. Publish a `verse.mimir.service.v1` manifest that names active namespaces, + schema ids, run id, nested Verse roots, and the current transport lanes. +2. Give each current JSONL/session/body-index path a `.cc` witness or + CultCache-compatible export, starting with Well capture pages and + `Mimir.VerseRecorder`. +3. Promote sensor, media, observation, ledger, and control state into explicit + `mimir.*` CultMesh namespaces while preserving current document ids. +4. Publish `gamecult.eve.surface.v1` surfaces for sensor field and operator + flows, with typed field bindings back to the owning state documents. +5. Make the old dashboard broker and `/eve/dashboard` compatibility endpoint + consume those provider surfaces instead of assembling private truth. +6. Let Odin discover the service manifest and surfaces, then treat direct HTTP + health/status probes as temporary diagnostics. +7. Delete or neuter any private JSON store, dashboard state cache, or UI callback + path that can still decide service behavior after the typed owner exists. + +## Demotion Line + +Bespoke UI, browser dashboards, retained dashboard node lists, compatibility +WebSockets, JSON status files, JSONL replay logs, screenshot streams, and OBS +bridge scripts are demoted to lowerings, diagnostics, external-boundary export, +or replay witnesses. They may display, transport, inspect, or reconstruct typed +Mimir state. They may not own sensor truth, calibration truth, command state, +reservoir scheduling, program presentation, or synchronization behavior. diff --git a/state/map.yaml b/state/map.yaml index a44e8e4..1aa0365 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -1245,6 +1245,96 @@ accepted_design: - `.voidbot` state is part of repo memory and must be committed separately whenever dirty. +verse_service_contract: + status: documented + source: docs/verse-service-contract.md + objective: > + Make Mimir a discoverable Verse service whose durable state is typed + CultCache `.cc` or CultCache-compatible with `.cc` witness/export, whose + meaningful presentation flows through Eve/CultUI or + `gamecult.eve.surface.v1`, and whose surfaces are published through + CultMesh for Odin discovery. + owner_map: + mimir_service: > + Owns configuration, launch, calibration truth, sensor identity, stream + identity, synchronization state, Well publication, recorder receipts, and + the service contract. + runtime: > + Owns bounded rolling buffers, source descriptors, source polling, direct + native ingest, audio synchronization analysis, and cached read models. + native_workers: > + Own device reads, closest-to-device timestamps, native/GPU handles, + unavoidable copy counts, and narrow per-device actuators. + well: > + Owns typed live pages, configured composite state, timing pressure, + feature signals, capture-body publication, and the append-side + observation ledger. + verse_recorder: > + Owns session receipts, body indexing, replay witnesses, and CultCache + export for offline reconstruction. + fensalir_daemon: > + Owns reservoir job selection, queue pressure, GPU worker ownership, + program/reservoir surfaces, and daemon state. + eve_cultui: > + Owns operator display and command lowerings only; it submits commands to + the state owners and does not own synchronization, reservoir jobs, + calibration truth, or OBS composition. + odin: > + Discovers Mimir's CultMesh namespaces, schema catalog, service manifest, + nested Verse roots, and Eve surfaces. + cultcache_witnesses: + sensor_state: > + Source inventory, device identity, driver profile, clock domain, format, + actuator capability, native handle class, unavoidable copy count, and + health. + media_state: > + Capture page metadata, resource keys, body refs, fence refs, page timing, + configured composites, and program surface refs. + observation_state: > + Typed audio/video/IMU/feature/path observations with source id, time + range, confidence, calibration id, and payload/resource reference. + ledger_state: > + Recorder session receipts, body index, replay cursor, migration version, + schema witness, and rejected/drop reasons. + control_state: > + Operator commands, accepted command receipts, selected program layer + state, reservoir worker pressure, audio actuator commands, and + record/live status. + cultmesh_namespaces: + - verse.mimir.service.v1 + - mimir.sensor.* + - mimir.media.* + - mimir.observation.* + - mimir.ledger.* + - mimir.control.* + - mimir.eve.* + - mimir.fensalir.* + eve_surfaces: + - mimir.sensor.field.surface + - mimir.operator.flow.surface + - mimir.observation.ledger.surface + - mimir.fensalir.reservoir.surface + nested_verses: + room: calibration truth, coordinate frame, sensor graph, and clock model. + sensor: device health, timing domain, media format, actuator surface, and observations. + stream: rolling-window cursor, capture pages, resource refs, body refs, and backpressure. + operator: command surface, selected layer/source state, command receipts, and degraded visibility. + migration_order: + - Publish `verse.mimir.service.v1` manifest with namespaces, schemas, run id, nested roots, and transport lanes. + - Give JSONL/session/body-index paths `.cc` witnesses or CultCache-compatible exports, starting with Well pages and VerseRecorder. + - Promote sensor, media, observation, ledger, and control state into explicit `mimir.*` CultMesh namespaces while preserving current document ids. + - Publish `gamecult.eve.surface.v1` sensor-field and operator-flow surfaces with typed field bindings. + - Make old dashboard broker and `/eve/dashboard` consume provider surfaces instead of assembling private truth. + - Let Odin discover the service manifest and surfaces; keep direct HTTP health/status probes diagnostic. + - Delete or neuter private JSON/dashboard/cache/callback paths that can still decide behavior after typed owners exist. + demotion_line: > + Bespoke UI, browser dashboards, retained dashboard node lists, + compatibility WebSockets, JSON status files, JSONL replay logs, screenshot + streams, and OBS bridge scripts are lowerings, diagnostics, + external-boundary exports, or replay witnesses. They may not own sensor + truth, calibration truth, command state, reservoir scheduling, program + presentation, or synchronization behavior. + active_subgoals: - Make the live Mimir editor behave like an OBS-style 2D compositor for synced video layers and audio stems.