Skip to content

feat(d2): remove backward-compat migration; require MIN_SIM_VERSION=22#154

Merged
LightAxe merged 2 commits into
mainfrom
d2-impl
May 27, 2026
Merged

feat(d2): remove backward-compat migration; require MIN_SIM_VERSION=22#154
LightAxe merged 2 commits into
mainfrom
d2-impl

Conversation

@LightAxe
Copy link
Copy Markdown
Owner

Summary

  • Set MIN_ACCEPTED_SIM_VERSION = SIM_VERSION_V22_DIFFICULTY = 22 (= LATEST_SIM_VERSION). Saves older than V22 now throw OldSimVersionError and are deleted on boot; saves newer than V22 still throw FutureSimVersionError and are preserved.
  • Removed all version-gated sim code paths (V3/V5/V6/V8/V9/V10/V13/V15/V17/V21 guards) — all behavior is now unconditionally the latest.
  • Removed legacy migration helpers migrateBehaviorRatio and migrateInputLogCommand from save.ts.
  • Made all SerializedWorldState fields required (dropped optional ?).
  • Removed resolveCombatOnTile_v15 export; V16+ coin-flip path is always used.
  • Deleted issue-42 and issue-44 snapshot-replay test files (fixtures were pre-V22).
  • Deleted and updated tests that were pinned to legacy simVersion values.

Test plan

  • All 2183 tests pass (npx vitest run)
  • No TypeScript errors (npx tsc --noEmit)
  • Fresh game boots and plays correctly
  • Attempting to load a pre-V22 save deletes it and boots fresh (manual test)

🤖 Generated with Claude Code

…ION=22

Set MIN_ACCEPTED_SIM_VERSION = SIM_VERSION_V22_DIFFICULTY = 22 (= LATEST).
Saves older than V22 throw OldSimVersionError and are deleted on boot; saves
newer than V22 still throw FutureSimVersionError and are preserved.

- Remove all version-gated code paths in sim (V3/V5/V6/V8/V9/V10/V13/V15/V17/V21 guards)
- Remove legacy migration helpers in save.ts (migrateBehaviorRatio, migrateInputLogCommand)
- Make all SerializedWorldState fields required (drop optional `?`)
- Remove V15 resolveCombatOnTile_v15 export; keep V16+ coin-flip path
- Delete issue-42 / issue-44 snapshot-replay tests (fixtures pre-date MIN_ACCEPTED)
- Delete / update all tests pinned to legacy simVersion values

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@LightAxe
Copy link
Copy Markdown
Owner Author

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1140791433

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/render/game-scene.ts
A pre-V22 save that has a valid envelope would pass hasSave() and show
the Continue prompt, then silently delete the save and boot fresh with
default difficulty when OldSimVersionError fires in bootFromSave. Gate
the prompt on hasSave() && !hasIncompatibleSave() so only truly loadable
saves show the Continue option; incompatible saves are bypassed and
overwritten by the first autosave of the new game.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@LightAxe
Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@LightAxe LightAxe merged commit 16e4201 into main May 27, 2026
1 check passed
@LightAxe LightAxe deleted the d2-impl branch May 29, 2026 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant