Repository navigation
Exclude unused files: a BGM plan ships with the files it names - #101
Merged
Psychronic-Games merged 1 commit intoNov 30, 2026
Merged
Conversation
A plan (audio/<folder>/plan.json, played by AudioManager.playBgmPlan) is the only thing in a project that names its pieces, and the pruner never read it, so a deployment with Exclude unused files left every piece out. The plan itself usually stayed, because "plan" is a word somewhere in any project: a build that ships a plan without its files and stops on Retry when it plays. analyze() now reads each audio/**/plan.json shaped like a plan. The plan ships when its folder would (named in the project, Always include, a plugin listing it, a playtest loading the plan or any of its files), and then every file it names ships too; a path out of the plan's folder keeps nothing. A plan nothing keeps is left out whole. Reasons reuse the existing ones, so no new strings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
The problem
AudioManager.playBgmPlan(folder)(the BGM plan player, a separate PR) playsaudio/<folder>/plan.json, and the plan names the audio files it plays. Nothing else in a project names them. The deployment pruner (editor/build-scripts/unused-assets.cjs) never readplan.json, so a build with Exclude unused files left every piece out.The plan file itself usually stayed, because the word "plan" appears somewhere in any project's text. That is the worst outcome: a build that ships the plan without its files, and stops on the Retry screen as soon as the plan plays. This was measured on a real project, where all 14 pieces of two plans were reported "nothing in the project names it".
What changed
analyze()reads everyaudio/**/plan.jsonshaped like a plan: afilesmap of{ path }plus aclipsarray. Any other file namedplan.jsonis judged by name as before. A plan is played by its folder, so it ships when its folder would. That means one of the following:When a plan ships, every file it names ships with it.
\separator is accepted.The per-file reasons reuse the existing ones ("named in the project", "loaded in a playtest", "in the Always include list"), so there are no new strings.
Verification
A new test in
editor/tests/unused-assets.test.cjsuses synthetic plans only. It covers:plan.jsonthat is not a plan is judged by name;.wav_pieces and the plainplan.json.The file passes 14 of 14, also on this branch cut from
upstream/main.On a real project, with a read-only
analyze:plan.json: that plan and its own pieces ship, and nothing else does.Full
npm test(Git Bash, Windows): the failing-test names are identical to themainbaseline, the known environmental set.Limits
"plans/" + area, or any name that does not share a start of three or more characters with something in the project's text.🤖 Generated with Claude Code