Skip to content
This repository was archived by the owner on Apr 25, 2026. It is now read-only.

fix: address issues #93 (false-positive eyebrow defect) and #94 (game crash when both open) - #95

Merged
frankieg33 merged 1 commit into
mainfrom
fix/issues-93-94
Apr 21, 2026
Merged

frankieg33 merged 1 commit into
mainfrom
fix/issues-93-94

Conversation

@frankieg33

Copy link
Copy Markdown
Owner

Summary

  • bug: nonexistent birth defect detected on stray cat #93 — eyebrow-701 ("no eyebrows") was always flagged as a birth defect because a hardcoded 700–706 range check ran before GPAK data had a chance to weigh in. GPAK's tag birth_defect marker is now authoritative when present; the range heuristic is only a fallback for legacy/missing entries. Every detected defect is also logged at INFO with its slot/ID/source so users uploading logs let us pinpoint mis-detections.
  • BUG game crashes when both it and mewgenics is open #94 — the game crashes on Windows when both it and the manager are open. Both save readers (SaveLoadWorker full parse and QuickRoomRefreshWorker fast path) now copy the .sav (plus any -wal/-shm/-journal sidecars) to a temp directory first and read the copy, so there's no co-access with the running game. Added a shared save_snapshot helper and INFO-level timing/size logs around snapshot and parse so uploaded logs contain a complete trace of every read.

If #94 keeps reproducing after this, the logs will capture:

  • save load start path=… size=… mtime=…
  • save snapshot path=… bytes=… copy_s=…
  • save parse ok parse_s=…
  • save load summary cats=… errors=…
  • Every defect detected slot=… mutation_id=… defect_source=… name=… line

Closes #93. Addresses #94 (keep open pending user confirmation).

Test plan

  • Launch the game and the manager simultaneously; exercise breed/save loop and confirm no game crashes.
  • Load a save that previously showed the phantom eyebrow defect and verify the chip no longer appears on cats without a GPAK-tagged defect.
  • Inspect %APPDATA%/MewgenicsBreedingManager/logs/mewgenics.log after a load and confirm the new snapshot/parse/defect lines are present.
  • pytest tests/test_game_update_crash_fixes.py still passes (monkey-patched sqlite / parse_save shims still exercise the post-snapshot path).

Issue #93: the eyebrow-701 ("no eyebrows") mutation was always flagged
as a birth defect because a 700-706 range heuristic was applied before
GPAK data had a chance to correct it. Trust GPAK's `tag birth_defect`
when present; keep the range heuristic only as a fallback for missing
or legacy GPAK entries. Also log every detected defect at INFO with
its slot/ID/source so users uploading logs can pinpoint mis-detections.

Issue #94 (game crashes when both it and the manager are open):
snapshot the live .sav (and any -wal/-shm/-journal sidecars) to a
temp directory before opening it, for both the full SaveLoadWorker
and the QuickRoomRefreshWorker. Eliminates any co-access between the
running game and our SQLite readers. Log the snapshot size and copy
duration plus parse timing so uploaded logs expose the full read path.

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

Copy link
Copy Markdown

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: 94b4d86808

ℹ️ 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/save_parser.py
Comment on lines +1087 to 1091
elif not is_sentinel_missing and 700 <= mutation_id <= 706:
# No GPAK data at all — use the range heuristic as a best guess.
is_defect = True
defect_source = "range_fallback_no_gpak"
raw_name = str(raw_name).strip()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Move GPAK name/detail mapping out of no-GPAK fallback

The GPAK-to-display mapping (raw_name/stat_desc → display_name/detail) now only runs inside the elif not is_sentinel_missing and 700 <= mutation_id <= 706 fallback branch, so normal entries that do have gpak_info skip that mapping entirely. In practice this makes most non-defect visual mutations fall back to synthetic labels ("<slot> <id>") with empty details, which is a regression from prior behavior where GPAK names were shown.

Useful? React with 👍 / 👎.

Comment thread src/save_parser.py
Comment on lines 1091 to 1092
raw_name = str(raw_name).strip()
detail = str(stat_desc).strip()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Initialize GPAK fields before fallback defect formatting

This fallback branch references raw_name and stat_desc, but those variables are only assigned in the earlier if gpak_info: block. If a 700–706 mutation is present without GPAK metadata (but with a catalog fallback), this path raises UnboundLocalError during parse and the save load fails instead of continuing.

Useful? React with 👍 / 👎.

@frankieg33
frankieg33 merged commit 1524c48 into main Apr 21, 2026
3 checks passed
@frankieg33
frankieg33 deleted the fix/issues-93-94 branch April 22, 2026 00:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: nonexistent birth defect detected on stray cat

1 participant