[codex] Enhance Mahjong Soul strategy tooling#126
Open
Kuma1338 wants to merge 8 commits into
Open
Conversation
added 8 commits
April 27, 2026 18:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR turns the existing AlphaJong userscript into a more testable, Chinese-friendly, Mahjong Soul Web oriented build with safer runtime diagnostics and strategy controls.
It keeps the original algorithmic approach intact while fixing several decision-path bugs, adding regression coverage, improving 3-player handling, and making the bot easier to tune and inspect from the in-game overlay.
Packaged release for direct testing:
Highlights
AJlauncher and compact panelalert()popups during gameplaybuild/AlphaJong_1.3.2_beta.user.jsto the repository packagebuild.pyRELEASE_NOTES_CN.mdFixed Bugs
src/ai_offense.jstileLefttilesLeftand cover with regression testsrc/ai_defense.js(type, index)into(index, type)APIsrc/utils.js.lengthon numerictilePrio.doradora.lengthNew User-Facing Features
Direct Install Package
The generated userscript is now tracked in:
This makes the GitHub source package immediately usable in Tampermonkey. Users no longer need to run
python3 build.pyjust to get the installable script.Detailed Chinese Release Notes
Added:
It documents:
Compact Floating UI
The old full-width top menu has been replaced with a compact plugin-like overlay:
AJbutton+/ASettings Panel
The overlay now exposes persistent tuning controls for:
Strategy Record Window
The
记录button opens an in-page floating panel instead of a blocking browser popup. It supports:The history is bounded to the latest 20 entries to avoid unbounded memory growth.
Bug Report Export
The exported JSON includes:
Temporary download URLs are revoked after export.
Validation
Full original test suite:
Notes
The script still depends on Mahjong Soul Web internal objects such as
view.DesktopMgr,app.NetAgent, andmjcore.E_PlayOperation. The new compatibility checker is intended to make future frontend breakage easier to diagnose, but it cannot guarantee compatibility with every future Mahjong Soul update.