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
+8 -4
View File
@@ -230,10 +230,14 @@ app.post('/api/games/:id/queue/remove', (req, res) => {
res.json({ game: next });
});
// (v0.23, #16 P4a) Resolve a pending nation-op proposal (a rename the LLM
// proposed in an earlier turn, waiting in game.pendingNationOps). No LLM call,
// no turn advance — same fast save → broadcast → respond order as
// /queue/remove. The version bump lets "never go backwards" clients reconcile.
// (v0.23, #16 P4a; v0.24, #16 P4b) Resolve a pending nation-op proposal
// waiting in game.pendingNationOps: a rename takes effect (body.edits.name
// may override the proposed name), a split partitions the nation's territory
// into the proposed parts (body.edits.playerPart picks which part the player
// leads, default 0), and a merge folds its inputs into the survivor
// (body.edits.name may override the merged name). No LLM call, no turn
// advance — same fast save → broadcast → respond order as /queue/remove.
// The version bump lets "never go backwards" clients reconcile.
app.post('/api/games/:id/nation-op/confirm', (req, res) => {
const id = req.params.id;
const game = db.load(id);