- server/scenario.ts: buildGeneratePrompt / buildRegeneratePrompt, defensive
parseGenerate / parseRegenerate (fence-strip + balanced-object + validate),
generateDraft (draft world + advisor checkpoints) and finalizeWorld (final
world constrained to approved checkpoints -> playable GameState), all over
the injectable LlmClient with a nudge re-send. SCENARIO_* markers for the
stub.
- server/stubScenario.ts: deterministic scenario stub transport (fixed 3-nation
world + checkpoint list; finalize refines stability per approved checkpoint)
+ makeScenarioStubLlmClient. Distinct from and never touching turn stub.ts.
- server/regions.ts: validCountryCodes() accessor (ISO_A3 parents) for draft
territory validation.
- shared/scenario.ts: worldDraftToGameState now guards a dangling playerNationId
(falls back to the first nation) so a finalize that drops it stays playable.
- server/scenario.test.ts: 16 tests (prompt builders, defensive parsing,
generateDraft/finalizeWorld over a fake client + the stub).
Fixes#52