ui/phase-14: rename planet end-to-end + order read-back

Wires the first end-to-end command through the full pipeline:
inspector rename action → local order draft → user.games.order
submit → optimistic overlay on map / inspector → server hydration
on cache miss via the new user.games.order.get message type.

Backend: GET /api/v1/user/games/{id}/orders forwards to engine
GET /api/v1/order. Gateway parses the engine PUT response into the
extended UserGamesOrderResponse FBS envelope and adds
executeUserGamesOrderGet for the read-back path. Frontend ports
ValidateTypeName to TS, lands the inline rename editor + Submit
button, and exposes a renderedReport context so consumers see the
overlay-applied snapshot.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Ilia Denisov
2026-05-09 11:50:09 +02:00
parent 381e41b325
commit f80c623a74
86 changed files with 7505 additions and 138 deletions
+21
View File
@@ -18,6 +18,12 @@ const MessageTypeUserGamesCommand = "user.games.command"
// FlatBuffers `order.UserGamesOrder`.
const MessageTypeUserGamesOrder = "user.games.order"
// MessageTypeUserGamesOrderGet is the authenticated gateway message
// type used to read back the player's stored order for a given turn
// through `GET /api/v1/user/games/{game_id}/orders?turn=N`. The
// signed payload is a FlatBuffers `order.UserGamesOrderGet`.
const MessageTypeUserGamesOrderGet = "user.games.order.get"
// UserGamesCommand is the typed payload of MessageTypeUserGamesCommand.
// `GameID` selects the running engine container; `Commands` is the
// player command batch executed atomically by the engine. The `Actor`
@@ -54,6 +60,21 @@ func (o *UserGamesOrder) UnmarshalBinary(data []byte) error {
return json.Unmarshal(data, o)
}
// UserGamesOrderGet is the typed payload of
// MessageTypeUserGamesOrderGet. `Turn` is mandatory and must be
// non-negative; the caller pulls it from the lobby record at game
// boot. Backend rebinds the player from the runtime player mapping
// before forwarding to the engine.
type UserGamesOrderGet struct {
// GameID identifies the running game whose order is being
// read back.
GameID uuid.UUID `json:"game_id"`
// Turn selects the turn the stored order belongs to. Negative
// values are invalid.
Turn int `json:"turn"`
}
func AsCommand[E DecodableCommand](c DecodableCommand) (result E, ok bool) {
if v, ok := c.(E); ok {
return v, true