feat: nation-op split/merge — apply on confirm (playerPart, fresh ids, relations union) (P4b, #16)

This commit is contained in:
2026-10-14 13:42:46 +00:00
parent f72a59bf5e
commit 458e9be419
5 changed files with 562 additions and 71 deletions
+13 -12
View File
@@ -138,18 +138,19 @@ export interface GameState {
*/
unowned: string[];
/**
* (v0.23, #16 P4a) Nation-management ops the LLM has proposed but the player
* has not yet resolved: a *pending proposal* list, as opposed to `pending`
* (the current round's queued player actions). A turn NEVER applies one —
* `applyTurnResult` appends the turn's `nationOps` to this list, and each
* proposal survives across turns until the player resolves it: confirming
* applies it (a rename changes `Nation.name` only — the id, its territory,
* its relations, and the player pointer all stay valid) and removes it;
* rejecting removes it without applying. Split/merge are declared for P4b
* and are a safe no-op on confirm until then. Always `[]` on a fresh game;
* rows saved before v0.23 load with this defaulted to `[]` (see server/db.ts).
* (The `NationOp` type lives in protocol.ts; the import there is type-only,
* so this file still has no runtime dependencies.)
* (v0.23, #16 P4a; v0.24, #16 P4b) Nation-management ops the LLM has
* proposed but the player has not yet resolved: a *pending proposal* list,
* as opposed to `pending` (the current round's queued player actions). A
* turn NEVER applies one — `applyTurnResult` appends the turn's
* `nationOps` to this list, and each proposal survives across turns until
* the player resolves it: confirming applies it (a rename changes
* `Nation.name` only; a split partitions the nation's region-key territory
* into the new nations' territories; a merge folds the inputs' territory
* into the survivor) and removes it; rejecting removes it without
* applying. Always `[]` on a fresh game; rows saved before v0.23 load with
* this defaulted to `[]` (see server/db.ts). (The `NationOp` type lives in
* protocol.ts; the import there is type-only, so this file still has no
* runtime dependencies.)
*/
pendingNationOps: NationOp[];
}