Skip to content

merge-check: report whether the projected tree matches main - #8541

Closed
Arkex-ai wants to merge 3 commits into
ProjectLeonida:mainfrom
Arkex-ai:dev/merge-check-tree-result
Closed

Arkex-ai wants to merge 3 commits into
ProjectLeonida:mainfrom
Arkex-ai:dev/merge-check-tree-result

Conversation

@Arkex-ai

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as the item described here.

What and why

A historical squash match can survive a later revert. Add tree_matches_main to the JSON result and explain in the text report when a clean replay would change the current main tree. Preserve the existing verdict, exit code and conflict diagnostic.

Tested

Windows native, 17 tests passed. Compared JSON and text output against Git in a synthetic repository for an identical squash, a clean replay after revert and a conflicting replay. Head 2e6c9d693.

AI-assisted: yes

Checklist

  • No game data, keys or decryption. Synthetic inputs only.
  • Translator contract table is unaffected.

@molodayamama

Copy link
Copy Markdown
Contributor

Verified commit 2e6c9d6932d280c1d862c261ebaae2ea100d9008. All 17 merge-check tests passed with native Git on Windows. The new fixture checks the actual projected Git tree and the JSON/text results after a squash, after a revert, and with a conflict. It demonstrates that the historical already-merged verdict can stay true even when replay would change the current tree.

AI-assisted verification.

@Atomic258

Copy link
Copy Markdown
Contributor

Tested 2e6c9d69 on Windows Server 2022, CPython 3.13.12: pass

  • python -I tests/test_merge_check.py -> OK

git diff --check clean; python -m compileall -q exit 0. No game files, no GPU. AI-assisted (Devin).

@sds-228 sds-228 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Focused suite passes 17/17 at this head. The new replay-tree cases fail against the pre-change script; the added flag distinguishes a squash replay that matches main from one that would change it, including after a revert.

AI-assisted (OpenCode).

@garuspl

garuspl commented Nov 23, 2026

Copy link
Copy Markdown

Tested 2e6c9d6 on Windows 11 (CPU only, no GPU needed): pass

Windows 11 Pro, Python 3.14.7, no GPU or game files involved; pytest/numpy/Pillow pinned from tests/requirements.txt in a fresh venv. Method: PR head merged onto main 867d922, the PR's test files run with python -m pytest before and after the merge, plus python -m compileall -q on the changed files (clean).

  • tests/test_merge_check.py: main 16 passed; with the PR 17 passed, 3 subtests passed.

AI-assisted (Claude Code, Claude Opus 5.5).

@Arkex-ai

Copy link
Copy Markdown
Contributor Author

Compatibility check with #8807 at 8ba1089b3: Git merges the two heads cleanly (tree 6b61234c7). The combined Windows CPU suite ran 21 tests. Two subcases in our historical-verdict test failed. After a reverted squash, the combined result changes from exit 1 to 0. With a subsequent conflicting replay it reports conflict where our test expected already-merged. The individual heads passed their suites (17 and 20 tests).

The JSON tree comparison in this PR and the new revert-aware verdicts in #8807 can coexist. If #8807 lands first, I will update our branch to assert the tree comparison alongside the accepted verdicts and rerun the combined cases. For review, please keep the replay-after-revert and conflicting-replay cases in the suite. AI-assisted.

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.

6 participants