Track item updatedBy as readonly metadata and inspect field

This commit is contained in:
Jage9
2026-02-27 02:27:16 -05:00
parent ac88195c6e
commit 4fcd006856
12 changed files with 35 additions and 4 deletions

View File

@@ -10,6 +10,7 @@
"x": 0,
"y": 0,
"createdBy": "user-id",
"updatedBy": "user-id",
"createdAt": 1735689600000,
"updatedAt": 1735689600000,
"version": 1,
@@ -24,6 +25,7 @@
- `useSound`: optional client-played one-shot sound when item `use` succeeds; global item field and not user-editable in V1.
- `emitSound`: optional continuously-looping spatial sound emitted from the item on the grid; global item field and not user-editable in V1.
- `capabilities`, `useSound`, and `emitSound` are derived from global item-type definitions at runtime (not stored per-instance in persisted state).
- `updatedBy` tracks the user account that last changed item state.
- `useCooldownMs`: global per item type (`radio_station=1000`, `dice=1000`, `wheel=4000`, `clock=1000`, `widget=1000`, `piano=1000`), not per-instance editable.
- `emitRange`: global spatial range default per item type (`radio_station=10`, `dice=15`, `wheel=15`, `clock=10`, `widget=15`, `piano=15`).
- `radio_station` can override this per instance via `params.emitRange` (`5..20`).
@@ -39,6 +41,7 @@
"x": 0,
"y": 0,
"createdBy": "user-id",
"updatedBy": "user-id",
"createdAt": 1735689600000,
"updatedAt": 1735689600000,
"version": 1,

View File

@@ -13,6 +13,7 @@ This is behavior-focused documentation for item types and their defaults.
- `emitRange` (spatial range in squares)
- `directional` (directional attenuation enabled)
- Instance fields are persisted in `server/runtime/items.json`.
- Read-only inspect fields include `createdBy` and `updatedBy` for ownership/change tracking.
## `radio_station`

View File

@@ -46,7 +46,7 @@ This is a behavior guide for packet semantics beyond raw schemas.
## Item Packet Behavior
- `item_upsert` is full-state replacement for one item, not partial patch.
- `item_upsert.item.display` is server-owned display text for readonly/system properties (for example: `createdAt`, `updatedAt`, `capabilities`, `useSound`, `emitSound`).
- `item_upsert.item.display` is server-owned display text for readonly/system properties (for example: `createdBy`, `updatedBy`, `createdAt`, `updatedAt`, `capabilities`, `useSound`, `emitSound`).
- `item_action_result` messages are intended for direct screen-reader/user status feedback.
- Piano runtime control no longer depends on parsing `item_action_result.message` text.
- `item_piano_status` carries machine-readable piano events (`use_mode_entered`, record/playback transitions).