A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.
docs,tools: Unity-MCP fix round 1 (CI mode, per-project port, token)
eyalgolan1c045762d468
diff --git a/BUILDING.md b/BUILDING.mdindex 3eeb34a61..cde7b9665 100644--- a/BUILDING.md+++ b/BUILDING.md@@ -19,7 +19,7 @@ git clone https://github.com/eyalgolan/statecraft-israel.git && cd statecraft-istools/build_sim_for_unity.sh # the sim DLLs Unity loads (build output, not committed)export UNITY="/Applications/Unity/Hub/Editor/6000.3.25f1/Unity.app/Contents/MacOS/Unity" # macOS path# Windows: "C:\Program Files\Unity\Hub\Editor\6000.3.25f1\Editor\Unity.exe"; Linux: ~/Unity/Hub/Editor/6000.3.25f1/Editor/Unity-"$UNITY" -batchmode -quit -projectPath unity -buildTarget WebGL -executeMethod Statecraft.Game.EditorTools.Build.Web -compression disabled -logFile "$PWD/unity-build-web.log"+"$UNITY" -batchmode -CI false -quit -projectPath unity -buildTarget WebGL -executeMethod Statecraft.Game.EditorTools.Build.Web -compression disabled -logFile "$PWD/unity-build-web.log"python3 -m http.server 8000 --directory unity/Builds/Web-disabled # then open http://localhost:8000/```@@ -37,6 +37,7 @@ The game scene is `Assets/Map.unity`, and it opens automatically. If it doesn'tTroubleshooting:- `error CS0246: The type or namespace name 'PlayerPrefsBool' could not be found`: the Unity-MCP package (`com.ivanmurzak.unity.mcp`) was installed without its OpenUPM registry (`https://package.openupm.com`), so its dependency `extensions.unity.playerprefsex` is missing. Restore `Packages/manifest.json` and `Packages/packages-lock.json` from git (`git checkout -- unity/Packages`); they already carry the package and the registry.+- About 2,000 `error CS0234` (for example `'Json' does not exist in the namespace 'System.Text'`) from `com.ivanmurzak.unity.mcp` on a first open, and a batch run that then hangs: Unity ran with `CI=true` in its environment, so the plugin skipped its NuGet download but added its defines. Run `git checkout -- unity/ProjectSettings/ProjectSettings.asset`, then run Unity again with `-CI false` (every batch command in these docs has it).- Compile errors from a package that isn't in our `Packages/manifest.json`: remove that package from your local manifest or update it. Unity can't run while there is any compile error.- macOS says "Unity is damaged and can't be opened. Move to Trash": this can happen when the editor is launched outside Unity Hub after Hub installed modules (such as Mac Build Support) inside the app. Click **Cancel**, never Move to Trash. Open the project through Unity Hub. If Hub refuses too, reinstall that editor version (6000.3.25f1) through Unity Hub.@@ -44,15 +45,19 @@ Troubleshooting:[Unity-MCP](https://github.com/IvanMurzak/Unity-MCP) (Apache-2.0) is the project's standard way to let an AI agent (Claude Code, Cursor, Copilot and others) work in the Unity editor: read the Console, inspect scenes, run tests. It runs locally, with no account and no cloud.-- **Install:** nothing to do. The package (`com.ivanmurzak.unity.mcp` 0.93.3) and the OpenUPM registry it needs are already in `unity/Packages/manifest.json`. On the first open, the plugin downloads its NuGet DLLs from nuget.org into `Assets/Plugins/NuGet/` (git-ignored) and its local server from the plugin's GitHub releases into `Library/`. Then Unity compiles once more.+- **Install:** nothing to do. The package (`com.ivanmurzak.unity.mcp` 0.93.3) and the OpenUPM registry it needs are already in `unity/Packages/manifest.json`. On the first open, the plugin downloads its NuGet DLLs from nuget.org into `Assets/Plugins/NuGet/` (git-ignored) and its local server, `gamedev-mcp-server`, from the plugin's GitHub releases into `Library/`. Then Unity compiles once more.- **Open** Window → AI Game Developer — MCP.-- **Connection → Custom** (local). Set the Server URL to `http://localhost:27766` and the transport to `http`. Never choose Cloud, and never sign in: nothing in this project needs an ai-game.dev account. These settings are per user, in `unity/UserSettings/AI-Game-Developer-Config.json` (git-ignored, and it holds your local token), so every contributor sets them once.-- **Choose your agent** and click **Configure**, or click **Generate** to write skill files instead. The files these steps write (`.mcp.json`, `unity/.claude/` and the other agent folders) are git-ignored; don't commit them.+- **Connection: Custom, held by the project.** `UnityMcpGuard` keeps the plugin in Custom (local) mode in every editor, so Cloud is disabled: choosing it in the window snaps back to Custom. Never sign in: nothing in this project needs an ai-game.dev account. The plugin's own `UNITY_MCP_CONNECTION_MODE` variable would override this; the project doesn't support that. Your settings file, `unity/UserSettings/AI-Game-Developer-Config.json` (per user, git-ignored, holds your local token), may still say Cloud: the project's choice is applied in memory and never written there, so don't edit the file by hand.+- **Server URL:** leave it as the window shows it, with the transport `http`. The port is derived from your project's path, so every clone and worktree gets its own server. A second editor finds an already-running server on its port and attaches to it, so two projects never share one as long as their ports differ.+- **Authorization: token, held by the project.** The local server checks a Bearer token (your local token). Never choose "Account sign-in" (oauth): it makes the local server validate tokens online against ai-game.dev.+- **The local server starts with the editor.** If you don't use an agent, turn off *Keep server running* in the window.+- **Choose your agent** and click **Configure**, or click **Generate** to write skill files instead. Configure writes the server URL and the Bearer header into `unity/.mcp.json` (for Claude Code). Start your agent in `unity/`, or point it at that file. The files these steps write (`.mcp.json`, `unity/.claude/` and the other agent folders) are git-ignored; don't commit them.- **The rules still apply:** no game rules in Unity (they live in the sim), tests first, sources for every fact in `content/`, and disclose the AI assistance in your pull request (see "Rules every change follows" and "AI-assisted contributions" in [CONTRIBUTING.md](CONTRIBUTING.md)).-- **Security:** the local server lets the agent run editor actions, including editing files and executing code in the editor. Keep it local: never expose port 27766 (no port forwarding, tunnels or `0.0.0.0` binds), and stop the server when you're done.-- **Not connecting?** Connect only works in an interactive editor: in batch mode (tests and builds) the plugin is held offline on purpose, and its window doesn't open. Check that the Server URL port matches the running server (the plugin's default port is derived from the project path, which is why everyone sets 27766), that the server shows Running, then click Connect. The first attempt can fail while the server is still starting; the plugin retries. If the editor is stopped without quitting, the `gamedev-mcp-server` process can stay behind on the port: stop it with the window's Stop button or by its PID.-- **Batch mode and builds:** `UnityMcpGuard` (`unity/Assets/Editor/UnityMcpGuard.cs`) keeps the plugin from connecting or starting its server in batch mode (tests and builds), and drops its assemblies from every player build. The browser build's golden hashes don't change.+- **Security:** the local server lets the agent run editor actions, including editing files and executing code in the editor. It listens on loopback only and rejects browser pages from other sites, and the token keeps other local programs out. Keep it local: never expose the server's port (no port forwarding, tunnels or `0.0.0.0` binds), and stop the server when you're done.+- **Not connecting?** Connect only works in an interactive editor: in batch mode (tests and builds) the plugin is held offline on purpose, and its windows don't open. Check that the server shows Running on the port in the Server URL, then click Connect. The first attempt can fail while the server is still starting; the plugin retries. If the editor is stopped without quitting, `gamedev-mcp-server` can stay behind on the port: stop it with the window's Stop button or by its PID.+- **Batch mode and builds:** `UnityMcpGuard` (`unity/Assets/Editor/UnityMcpGuard.cs`) keeps the plugin from connecting, starting its server or opening a window in batch mode (tests and builds), and drops its assemblies from every player build. The browser build's golden hashes don't change. Run batch Unity with `-CI false` (as every command in these docs does): with `CI=true` in the environment (any CI runner, and some agent shells), the plugin skips its NuGet download but still adds its defines, and a fresh clone fails to compile. The update popup is off for the team (`unity/ProjectSettings/AI-Game-Developer-UpdateSettings.asset`); version bumps come by pull request. On every Unity-MCP version bump, run the Unity EditMode tests in batch mode and paste the `UnityMcpGuardTests` result in the pull request.- **Leave one change uncommitted:** the plugin adds `UNITY_MCP_READY;UNITY_MCP_DEPS_7` to the scripting defines in `unity/ProjectSettings/ProjectSettings.asset` once its DLLs are in place. Don't commit that change: on a fresh clone the defines would arrive before the DLLs, and the plugin wouldn't compile. A policy test refuses it. The post-build cleanup (`git checkout -- unity/Assets/Settings unity/ProjectSettings/ProjectSettings.asset`) drops the defines too; the plugin adds them back on the next open, at the cost of one extra compile.+- **Per-user state the plugin keeps:** besides the settings file, it stores `Unity-MCP.MainWindow.Initialized` and `Unity_MCP_SelectedAiAgent` in this project's editor PlayerPrefs, and the server's PID and update-check state in EditorPrefs.## Testsdiff --git a/CHANGELOG.md b/CHANGELOG.mdindex c182488b6..f528eb566 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -16,4 +16,5 @@ adds a line under **Unreleased**; CI's `Changelog` job checks this (see `CONTRIBand art, CC0 for AI-only images), asset provenance (`ASSETS.yaml`), contributorand content policies, CI for the sim, tools and repository policy.- Unity-MCP 0.93.3 (`com.ivanmurzak.unity.mcp`, from OpenUPM) as the standard AI-agent bridge in the editor, local- Custom mode only. It stays offline in batch mode and is left out of player builds (`UnityMcpGuard`).+ Custom mode with token auth only (held by `UnityMcpGuard`). It stays offline in batch mode, opens no window there, and is+ left out of player builds.diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex a509f655c..f636b94ba 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -41,7 +41,7 @@ Follow [docs/dev-setup.md](docs/dev-setup.md). In short:- the repository policy checks:`uv run --with pytest==9.1.1 --with pyyaml==6.0.3 --with requests==2.32.5 pytest scripts/oss/tests -q` and `uv run scripts/oss/check_repo.py` (the command CI runs);- Unity EditMode tests, if you touched `unity/` (`-buildTarget OSXUniversal` keeps an earlier WebGL build from leaving the editor on the wrong platform):- `"$UNITY" -batchmode -projectPath unity -buildTarget OSXUniversal -runTests -testPlatform EditMode -testResults "$PWD/unity-editmode.xml" -logFile unity-tests.log`. There must be 0 `warning CS` in the log.+ `"$UNITY" -batchmode -CI false -projectPath unity -buildTarget OSXUniversal -runTests -testPlatform EditMode -testResults "$PWD/unity-editmode.xml" -logFile unity-tests.log`. There must be 0 `warning CS` in the log.4. **Text the player sees** has no internal ids, gives dates as "15 May 1948", and shows money as "IL 1.2m" or "$1.2m". The tests enforce this.5. **Keep the pull request focused:** one change per PR, and no unrelated refactors.6. **Changelog.** If you change `sim/`, `content/` or `unity/` (tests excepted), add a line under `## [Unreleased]` in [CHANGELOG.md](CHANGELOG.md). CI's `Changelog` job checks it; the maintainer can add the `no-changelog` label to a change no player would notice.@@ -63,15 +63,19 @@ AI-assisted work is welcome. Say so in the pull request: which parts, and how yo[Unity-MCP](https://github.com/IvanMurzak/Unity-MCP) (Apache-2.0) is the project's standard way to let an AI agent (Claude Code, Cursor, Copilot and others) work in the Unity editor: read the Console, inspect scenes, run tests. It runs locally, with no account and no cloud.-- **Install:** nothing to do. The package (`com.ivanmurzak.unity.mcp` 0.93.3) and the OpenUPM registry it needs are already in `unity/Packages/manifest.json`. On the first open, the plugin downloads its NuGet DLLs from nuget.org into `Assets/Plugins/NuGet/` (git-ignored) and its local server from the plugin's GitHub releases into `Library/`. Then Unity compiles once more.+- **Install:** nothing to do. The package (`com.ivanmurzak.unity.mcp` 0.93.3) and the OpenUPM registry it needs are already in `unity/Packages/manifest.json`. On the first open, the plugin downloads its NuGet DLLs from nuget.org into `Assets/Plugins/NuGet/` (git-ignored) and its local server, `gamedev-mcp-server`, from the plugin's GitHub releases into `Library/`. Then Unity compiles once more.- **Open** Window → AI Game Developer — MCP.-- **Connection → Custom** (local). Set the Server URL to `http://localhost:27766` and the transport to `http`. Never choose Cloud, and never sign in: nothing in this project needs an ai-game.dev account. These settings are per user, in `unity/UserSettings/AI-Game-Developer-Config.json` (git-ignored, and it holds your local token), so every contributor sets them once.-- **Choose your agent** and click **Configure**, or click **Generate** to write skill files instead. The files these steps write (`.mcp.json`, `unity/.claude/` and the other agent folders) are git-ignored; don't commit them.+- **Connection: Custom, held by the project.** `UnityMcpGuard` keeps the plugin in Custom (local) mode in every editor, so Cloud is disabled: choosing it in the window snaps back to Custom. Never sign in: nothing in this project needs an ai-game.dev account. The plugin's own `UNITY_MCP_CONNECTION_MODE` variable would override this; the project doesn't support that. Your settings file, `unity/UserSettings/AI-Game-Developer-Config.json` (per user, git-ignored, holds your local token), may still say Cloud: the project's choice is applied in memory and never written there, so don't edit the file by hand.+- **Server URL:** leave it as the window shows it, with the transport `http`. The port is derived from your project's path, so every clone and worktree gets its own server. A second editor finds an already-running server on its port and attaches to it, so two projects never share one as long as their ports differ.+- **Authorization: token, held by the project.** The local server checks a Bearer token (your local token). Never choose "Account sign-in" (oauth): it makes the local server validate tokens online against ai-game.dev.+- **The local server starts with the editor.** If you don't use an agent, turn off *Keep server running* in the window.+- **Choose your agent** and click **Configure**, or click **Generate** to write skill files instead. Configure writes the server URL and the Bearer header into `unity/.mcp.json` (for Claude Code). Start your agent in `unity/`, or point it at that file. The files these steps write (`.mcp.json`, `unity/.claude/` and the other agent folders) are git-ignored; don't commit them.- **The rules still apply:** no game rules in Unity (they live in the sim), tests first, sources for every fact in `content/`, and disclose the AI assistance in your pull request (see "Rules every change follows" and "AI-assisted contributions" above).-- **Security:** the local server lets the agent run editor actions, including editing files and executing code in the editor. Keep it local: never expose port 27766 (no port forwarding, tunnels or `0.0.0.0` binds), and stop the server when you're done.-- **Not connecting?** Connect only works in an interactive editor: in batch mode (tests and builds) the plugin is held offline on purpose, and its window doesn't open. Check that the Server URL port matches the running server (the plugin's default port is derived from the project path, which is why everyone sets 27766), that the server shows Running, then click Connect. The first attempt can fail while the server is still starting; the plugin retries. If the editor is stopped without quitting, the `gamedev-mcp-server` process can stay behind on the port: stop it with the window's Stop button or by its PID.-- **Batch mode and builds:** `UnityMcpGuard` (`unity/Assets/Editor/UnityMcpGuard.cs`) keeps the plugin from connecting or starting its server in batch mode (tests and builds), and drops its assemblies from every player build. The browser build's golden hashes don't change.+- **Security:** the local server lets the agent run editor actions, including editing files and executing code in the editor. It listens on loopback only and rejects browser pages from other sites, and the token keeps other local programs out. Keep it local: never expose the server's port (no port forwarding, tunnels or `0.0.0.0` binds), and stop the server when you're done.+- **Not connecting?** Connect only works in an interactive editor: in batch mode (tests and builds) the plugin is held offline on purpose, and its windows don't open. Check that the server shows Running on the port in the Server URL, then click Connect. The first attempt can fail while the server is still starting; the plugin retries. If the editor is stopped without quitting, `gamedev-mcp-server` can stay behind on the port: stop it with the window's Stop button or by its PID.+- **Batch mode and builds:** `UnityMcpGuard` (`unity/Assets/Editor/UnityMcpGuard.cs`) keeps the plugin from connecting, starting its server or opening a window in batch mode (tests and builds), and drops its assemblies from every player build. The browser build's golden hashes don't change. Run batch Unity with `-CI false` (as every command in these docs does): with `CI=true` in the environment (any CI runner, and some agent shells), the plugin skips its NuGet download but still adds its defines, and a fresh clone fails to compile. The update popup is off for the team (`unity/ProjectSettings/AI-Game-Developer-UpdateSettings.asset`); version bumps come by pull request. On every Unity-MCP version bump, run the Unity EditMode tests in batch mode and paste the `UnityMcpGuardTests` result in the pull request.- **Leave one change uncommitted:** the plugin adds `UNITY_MCP_READY;UNITY_MCP_DEPS_7` to the scripting defines in `unity/ProjectSettings/ProjectSettings.asset` once its DLLs are in place. Don't commit that change: on a fresh clone the defines would arrive before the DLLs, and the plugin wouldn't compile. A policy test refuses it. The post-build cleanup (`git checkout -- unity/Assets/Settings unity/ProjectSettings/ProjectSettings.asset`) drops the defines too; the plugin adds them back on the next open, at the cost of one extra compile.+- **Per-user state the plugin keeps:** besides the settings file, it stores `Unity-MCP.MainWindow.Initialized` and `Unity_MCP_SelectedAiAgent` in this project's editor PlayerPrefs, and the server's PID and update-check state in EditorPrefs.## Pull requests@@ -83,7 +87,7 @@ AI-assisted work is welcome. Say so in the pull request: which parts, and how yoEvery pull request and every push to `main` runs `Sim (dotnet test)`, `Tools (pytest)`, `Repo policy`, and, on pull requests, `Changelog`. The jobs use no secrets, call no paid API, run no AI agent and push nothing.-**Unity EditMode tests are not in CI.** Running Unity in CI needs the maintainer's Unity account credentials stored as repository secrets. GitHub never gives secrets to pull requests from forks, so the job could not run on the pull requests that most need it, and those credentials would sit on machines that run outside code. So the Unity tests are a local gate: paste their result in your PR, and the maintainer re-runs them before merging any change under `unity/`.+**Unity EditMode tests are not in CI.** Running Unity in CI needs the maintainer's Unity account credentials stored as repository secrets. GitHub never gives secrets to pull requests from forks, so the job could not run on the pull requests that most need it, and those credentials would sit on machines that run outside code. So the Unity tests are a local gate: paste their result in your PR, and the maintainer re-runs them before merging any change under `unity/`. A future Unity job must run Unity with `-CI false` (runners set `CI=true`, and the Unity-MCP plugin would then skip its NuGet download and fail to compile), or commit the plugin's DLLs.## Securitydiff --git a/README.he.md b/README.he.mdindex 3bca5e453..3953dfe5c 100644--- a/README.he.md+++ b/README.he.md@@ -55,6 +55,7 @@פתרון בעיות:- השגיאה <span dir="ltr">`error CS0246 'PlayerPrefsBool'`</span> פירושה שחבילת Unity-MCP (<span dir="ltr">`com.ivanmurzak.unity.mcp`</span>) הותקנה בלי מאגר OpenUPM שלה (<span dir="ltr">`https://package.openupm.com`</span>), ולכן חסרה התלות <span dir="ltr">`extensions.unity.playerprefsex`</span>. שחזרו מ־git את <span dir="ltr">`Packages/manifest.json`</span> ואת <span dir="ltr">`Packages/packages-lock.json`</span>; החבילה והמאגר כבר מוגדרים בהם.+- כ־2,000 שגיאות <span dir="ltr">`error CS0234`</span> מ־<span dir="ltr">`com.ivanmurzak.unity.mcp`</span> בפתיחה ראשונה, והרצת batch שנתקעת אחריהן: Unity רץ כשבסביבה מוגדר <span dir="ltr">`CI=true`</span>, ולכן התוסף דילג על הורדת ה־NuGet אבל הוסיף את ההגדרות שלו. הריצו <span dir="ltr">`git checkout -- unity/ProjectSettings/ProjectSettings.asset`</span> והפעילו את Unity שוב עם <span dir="ltr">`-CI false`</span>.- שגיאות קומפילציה מחבילה שאינה ב־<span dir="ltr">`Packages/manifest.json`</span> שלנו: הסירו את החבילה מקובץ ה־manifest המקומי שלכם או עדכנו אותה. Unity אינו יכול לרוץ כל עוד יש שגיאת קומפילציה.- ב־macOS מופיעה ההודעה "Unity is damaged and can't be opened. Move to Trash": זה יכול לקרות כשמפעילים את העורך מחוץ ל־Unity Hub אחרי ש־Hub התקין מודולים (כמו Mac Build Support) בתוך האפליקציה. לחצו **Cancel**, ולעולם לא Move to Trash. פתחו את הפרויקט דרך Unity Hub. אם גם Hub מסרב, התקינו מחדש את גרסת העורך (6000.3.25f1) דרך Unity Hub.@@ -74,14 +75,19 @@[Unity-MCP](https://github.com/IvanMurzak/Unity-MCP) (רישיון Apache-2.0) היא הדרך המקובלת בפרויקט לתת לסוכן בינה מלאכותית (Claude Code, Cursor, Copilot ואחרים) לעבוד בעורך של Unity. היא רצה מקומית, בלי חשבון ובלי ענן. הפירוט המלא (באנגלית) ב־[<span dir="ltr">CONTRIBUTING.md</span>](CONTRIBUTING.md).-- **התקנה:** אין מה להתקין. החבילה (<span dir="ltr">`com.ivanmurzak.unity.mcp`</span> בגרסה 0.93.3) ומאגר OpenUPM שהיא צריכה כבר נמצאים ב־<span dir="ltr">`unity/Packages/manifest.json`</span>. בפתיחה הראשונה התוסף מוריד את קובצי ה־DLL שלו מ־nuget.org ואת השרת המקומי שלו, ו־Unity מקמפל פעם נוספת.+- **התקנה:** אין מה להתקין. החבילה (<span dir="ltr">`com.ivanmurzak.unity.mcp`</span> בגרסה 0.93.3) ומאגר OpenUPM שהיא צריכה כבר נמצאים ב־<span dir="ltr">`unity/Packages/manifest.json`</span>. בפתיחה הראשונה התוסף מוריד את קובצי ה־DLL שלו מ־nuget.org ואת השרת המקומי שלו, <span dir="ltr">`gamedev-mcp-server`</span>, ו־Unity מקמפל פעם נוספת.- **פתיחה:** <span dir="ltr">Window → AI Game Developer — MCP</span>.-- **חיבור:** בחרו Connection ← Custom (מקומי), כתובת השרת <span dir="ltr">`http://localhost:27766`</span> ותעבורה http. לעולם אל תבחרו Cloud ואל תתחברו לשום חשבון. ההגדרות האלה אישיות ונשמרות ב־<span dir="ltr">`unity/UserSettings/AI-Game-Developer-Config.json`</span> (מחוץ ל־git, ויש בו גם הטוקן המקומי שלכם), ולכן כל תורם מגדיר אותן פעם אחת.-- **הסוכן:** בחרו את הסוכן שלכם ולחצו Configure, או לחצו Generate כדי ליצור קובצי skills. הקבצים שנוצרים (<span dir="ltr">`.mcp.json`</span> ותיקיות הסוכנים) נמצאים מחוץ ל־git; אל תוסיפו אותם.+- **חיבור: Custom, נקבע בפרויקט.** <span dir="ltr">`UnityMcpGuard`</span> מחזיק את התוסף במצב Custom (מקומי) בכל עורך, ולכן Cloud מנוטרל: בחירה בו בחלון חוזרת ל־Custom. לעולם אל תתחברו לשום חשבון; הפרויקט לא צריך חשבון ai-game.dev. המשתנה <span dir="ltr">`UNITY_MCP_CONNECTION_MODE`</span> של התוסף היה עוקף את זה, והפרויקט לא תומך בכך. קובץ ההגדרות האישי, <span dir="ltr">`unity/UserSettings/AI-Game-Developer-Config.json`</span> (מחוץ ל־git, ויש בו גם הטוקן המקומי שלכם), עשוי עדיין להראות Cloud: בחירת הפרויקט מוחלת בזיכרון ולא נכתבת לקובץ, אז אל תערכו אותו ידנית.+- **כתובת השרת:** השאירו אותה כפי שהחלון מציג, עם תעבורה http. הפורט נגזר מנתיב הפרויקט, כך שלכל שכפול ו־worktree יש שרת משלו. עורך נוסף שמוצא שרת שכבר רץ על הפורט שלו מתחבר אליו, ולכן שני פרויקטים לא חולקים שרת כל עוד הפורטים שלהם שונים.+- **הרשאה: token, נקבע בפרויקט.** השרת המקומי בודק טוקן Bearer (הטוקן המקומי שלכם). לעולם אל תבחרו "Account sign-in" (oauth): הוא גורם לשרת המקומי לאמת טוקנים ברשת מול ai-game.dev.+- **השרת המקומי עולה עם העורך.** אם אינכם עובדים עם סוכן, כבו את *Keep server running* בחלון.+- **הסוכן:** בחרו את הסוכן שלכם ולחצו Configure, או לחצו Generate כדי ליצור קובצי skills. Configure כותב את כתובת השרת ואת כותרת ה־Bearer אל <span dir="ltr">`unity/.mcp.json`</span> (עבור Claude Code); הפעילו את הסוכן בתיקייה <span dir="ltr">`unity`</span> או הפנו אותו לקובץ הזה. הקבצים שנוצרים (<span dir="ltr">`.mcp.json`</span> ותיקיות הסוכנים) נמצאים מחוץ ל־git; אל תוסיפו אותם.- **הכללים בתוקף:** כללי המשחק נשארים בסימולציה ולא ב־Unity, בדיקות קודם, מקור לכל עובדה, ומצהירים בבקשת המיזוג על הסיוע של בינה מלאכותית.-- **אבטחה:** השרת המקומי מאפשר לסוכן להריץ פעולות בעורך, כולל עריכת קבצים והרצת קוד. השאירו אותו מקומי ולעולם אל תחשפו את הפורט 27766 החוצה.-- **אין חיבור?** Connect עובד רק בעורך אינטראקטיבי: במצב batch (בדיקות ובנייה) התוסף מנותק בכוונה, והחלון שלו לא נפתח. ודאו שהפורט בכתובת השרת תואם לשרת שרץ (פורט ברירת המחדל של התוסף נגזר מנתיב הפרויקט, ולכן כולם מגדירים 27766), שהשרת מסומן Running, ולחצו Connect. הניסיון הראשון יכול להיכשל בזמן שהשרת עולה; התוסף מנסה שוב. אם העורך נעצר בלי יציאה מסודרת, התהליך <span dir="ltr">`gamedev-mcp-server`</span> עלול להישאר על הפורט: עצרו אותו בכפתור Stop בחלון או לפי ה־PID שלו.-- **שינוי שלא מוסיפים ל־git:** אחרי שקובצי ה־DLL במקומם, התוסף מוסיף את <span dir="ltr">`UNITY_MCP_READY;UNITY_MCP_DEPS_7`</span> להגדרות הסקריפטים ב־<span dir="ltr">`unity/ProjectSettings/ProjectSettings.asset`</span>. אל תוסיפו את השינוי הזה ל־commit: בשכפול חדש ההגדרות יגיעו לפני קובצי ה־DLL והתוסף לא יתקמפל. בדיקת מדיניות חוסמת אותו.+- **אבטחה:** השרת המקומי מאפשר לסוכן להריץ פעולות בעורך, כולל עריכת קבצים והרצת קוד. הוא מאזין רק לכתובות המקומיות ודוחה דפי דפדפן מאתרים אחרים, והטוקן מונע מתוכנות מקומיות אחרות להשתמש בו. השאירו אותו מקומי ולעולם אל תחשפו את הפורט שלו החוצה.+- **אין חיבור?** Connect עובד רק בעורך אינטראקטיבי: במצב batch (בדיקות ובנייה) התוסף מנותק בכוונה, והחלונות שלו לא נפתחים. ודאו שהשרת מסומן Running על הפורט שבכתובת השרת, ולחצו Connect. הניסיון הראשון יכול להיכשל בזמן שהשרת עולה; התוסף מנסה שוב. אם העורך נעצר בלי יציאה מסודרת, <span dir="ltr">`gamedev-mcp-server`</span> עלול להישאר על הפורט: עצרו אותו בכפתור Stop בחלון או לפי ה־PID שלו.+- **מצב batch ובנייה:** <span dir="ltr">`UnityMcpGuard`</span> (<span dir="ltr">`unity/Assets/Editor/UnityMcpGuard.cs`</span>) מונע מהתוסף להתחבר, להפעיל את השרת או לפתוח חלון במצב batch (בדיקות ובנייה), ומוציא את הרכיבים שלו מכל בניית נגן. ערכי הגיבוב (hash) של בדיקות ה־golden בגרסת הדפדפן לא משתנים. הריצו Unity במצב batch עם <span dir="ltr">`-CI false`</span> (כמו בכל הפקודות במסמכים): כשבסביבה מוגדר <span dir="ltr">`CI=true`</span> (בכל שרת CI ובחלק מסביבות הסוכנים), התוסף מדלג על הורדת ה־NuGet אבל עדיין מוסיף את ההגדרות שלו, ושכפול חדש לא מתקמפל. חלון העדכונים כבוי לכל הצוות (<span dir="ltr">`unity/ProjectSettings/AI-Game-Developer-UpdateSettings.asset`</span>); עדכוני גרסה מגיעים בבקשת מיזוג.+- **שינוי שלא מוסיפים ל־git:** אחרי שקובצי ה־DLL במקומם, התוסף מוסיף את <span dir="ltr">`UNITY_MCP_READY;UNITY_MCP_DEPS_7`</span> להגדרות הסקריפטים ב־<span dir="ltr">`unity/ProjectSettings/ProjectSettings.asset`</span>. אל תוסיפו את השינוי הזה ל־commit: בשכפול חדש ההגדרות יגיעו לפני קובצי ה־DLL והתוסף לא יתקמפל. בדיקת מדיניות חוסמת אותו. הניקוי שאחרי בנייה (<span dir="ltr">`git checkout -- unity/Assets/Settings unity/ProjectSettings/ProjectSettings.asset`</span>) מוחק גם את ההגדרות; התוסף מחזיר אותן בפתיחה הבאה, במחיר קומפילציה נוספת אחת.+- **מצב אישי שהתוסף שומר:** מלבד קובץ ההגדרות, הוא שומר את <span dir="ltr">`Unity-MCP.MainWindow.Initialized`</span> ואת <span dir="ltr">`Unity_MCP_SelectedAiAgent`</span> ב־PlayerPrefs של העורך בפרויקט הזה, ואת ה־PID של השרת ואת מצב בדיקת העדכונים ב־EditorPrefs.## שימוש בבינה מלאכותיתdiff --git a/THIRD-PARTY-NOTICES.md b/THIRD-PARTY-NOTICES.mdindex 859bc1469..acb269c4e 100644--- a/THIRD-PARTY-NOTICES.md+++ b/THIRD-PARTY-NOTICES.md@@ -33,10 +33,10 @@ The AI-agent bridge used in the editor (see `CONTRIBUTING.md`) is also fetched,|---|---|---|---|| Unity-MCP, `com.ivanmurzak.unity.mcp` 0.93.3 (Ivan Murzak, https://github.com/IvanMurzak/Unity-MCP) | OpenUPM (`https://package.openupm.com`), pinned in `unity/Packages/manifest.json` and `packages-lock.json` | Apache-2.0 | `unity/Library/PackageCache/` || `extensions.unity.playerprefsex` 2.1.5 (Ivan Murzak), a dependency of the above | OpenUPM | MIT | `unity/Library/PackageCache/` |-| NuGet DLLs the plugin's resolver downloads on first open: com.IvanMurzak.McpPlugin and McpPlugin.Common 8.7.0 and com.IvanMurzak.ReflectorNet 5.4.1 (Apache-2.0), R3 1.3.0 (MIT), and Microsoft.AspNetCore.SignalR.\*, Microsoft.Extensions.\*, Microsoft.CodeAnalysis.\*, System.\* and Microsoft.Bcl.\* packages (.NET Foundation and Microsoft, MIT) | nuget.org | Apache-2.0 or MIT, per package | `unity/Assets/Plugins/NuGet/` (git-ignored) |-| GameDev-MCP-Server 9.2.10, the local MCP server binary (https://github.com/IvanMurzak/GameDev-MCP-Server) | that repository's GitHub releases, SHA-256 checked by the plugin | Apache-2.0 | `unity/Library/mcp-server/` |+| NuGet DLLs the plugin's resolver downloads on first open: com.IvanMurzak.McpPlugin and McpPlugin.Common 8.7.0 and com.IvanMurzak.ReflectorNet 5.4.1 (Apache-2.0), R3 1.3.0 (MIT), and Microsoft.AspNetCore.SignalR.\*, Microsoft.Extensions.\*, Microsoft.CodeAnalysis.\*, System.\* and Microsoft.Bcl.\* packages (.NET Foundation and Microsoft, MIT) | nuget.org, pinned versions over HTTPS, with no hash or signature check (nuget.org versions are immutable) | Apache-2.0 or MIT, per package | `unity/Assets/Plugins/NuGet/` (git-ignored) |+| GameDev-MCP-Server 9.2.10, the local MCP server binary (https://github.com/IvanMurzak/GameDev-MCP-Server) | that repository's GitHub releases; the plugin checks its SHA-256 against the release's own `SHA256SUMS` (integrity, not authenticity: a compromised release would pass) | Apache-2.0 | `unity/Library/mcp-server/` |-None of these is redistributed by this repository or shipped in a build: `UnityMcpGuard` (`unity/Assets/Editor/UnityMcpGuard.cs`) drops the plugin's assemblies and its NuGet DLLs from every player build. Their licence texts come with each download.+None of these is redistributed by this repository or shipped in a build: `UnityMcpGuard` (`unity/Assets/Editor/UnityMcpGuard.cs`) drops the plugin's assemblies and its NuGet DLLs from every player build. The licence texts come with the OpenUPM packages, with each package on nuget.org (the resolver keeps only the DLLs) and with the server's GitHub releases.## Builds (what a WebGL or desktop build carries)diff --git a/docs/RELEASING.md b/docs/RELEASING.mdindex 6e30d958e..388663a17 100644--- a/docs/RELEASING.md+++ b/docs/RELEASING.md@@ -16,7 +16,7 @@ GitHub Releases page (and, from M4, on itch.io). Steps 1–3 are a normal pull r5. **Build and package** on the owner's machine, from the merged `main`:```bash- "$UNITY" -batchmode -quit -projectPath unity -buildTarget WebGL -executeMethod Statecraft.Game.EditorTools.Build.Web -compression brotli -shareable -logFile "$PWD/unity-build-web-br.log"+ "$UNITY" -batchmode -CI false -quit -projectPath unity -buildTarget WebGL -executeMethod Statecraft.Game.EditorTools.Build.Web -compression brotli -shareable -logFile "$PWD/unity-build-web-br.log"git checkout -- unity/Assets/Settings unity/ProjectSettings/ProjectSettings.assetuv run tools/web_check.py unity/Builds/Web-brotli --query "golden&smoke=5" \--expect "GOLDEN OK 1950 71e9904d0ee48083db9bbba281f3f046136482ba83ee056e48d57b62e76a5b07" \diff --git a/docs/determinism.md b/docs/determinism.mdindex 124c31a7f..858fbf482 100644--- a/docs/determinism.md+++ b/docs/determinism.md@@ -61,9 +61,9 @@ IL2CPP player in Chrome (M3 Task 22). Re-checked at the M3 merge candidate (2026Re-check with:```-"$UNITY" -batchmode -quit -projectPath unity -buildTarget WebGL -executeMethod Statecraft.Game.EditorTools.Build.Web -compression disabled -logFile unity-build-web.log+"$UNITY" -batchmode -CI false -quit -projectPath unity -buildTarget WebGL -executeMethod Statecraft.Game.EditorTools.Build.Web -compression disabled -logFile unity-build-web.loguv run tools/web_check.py unity/Builds/Web-disabled --query golden --expect "GOLDEN OK 1950" --expect "GOLDEN OK 1952"-"$UNITY" -batchmode -quit -projectPath unity -buildTarget OSXUniversal -executeMethod Statecraft.Game.EditorTools.Build.Mac -logFile unity-build-mac.log+"$UNITY" -batchmode -CI false -quit -projectPath unity -buildTarget OSXUniversal -executeMethod Statecraft.Game.EditorTools.Build.Mac -logFile unity-build-mac.log"unity/Builds/Mac/Statecraft.app/Contents/MacOS/Statecraft Israel" -batchmode -nographics -golden -logFile "$PWD/unity-golden-mac.log"; echo exit=$?```diff --git a/docs/dev-setup.md b/docs/dev-setup.mdindex d606fdd6f..8bc504b8e 100644--- a/docs/dev-setup.md+++ b/docs/dev-setup.md@@ -13,9 +13,9 @@- Run `tools/build_sim_for_unity.sh` before opening `unity/`. The sim DLLs are build output and are git-ignored.## Builds and browser checks (M3)-- Web build: `"$UNITY" -batchmode -quit -projectPath unity -buildTarget WebGL -executeMethod Statecraft.Game.EditorTools.Build.Web -compression disabled -logFile "$PWD/unity-build-web.log"`+- Web build: `"$UNITY" -batchmode -CI false -quit -projectPath unity -buildTarget WebGL -executeMethod Statecraft.Game.EditorTools.Build.Web -compression disabled -logFile "$PWD/unity-build-web.log"`(`-compression` is `disabled`, `gzip` or `brotli`; output in `unity/Builds/Web-<compression>/`, about 2 minutes).-- macOS IL2CPP build: `"$UNITY" -batchmode -quit -projectPath unity -buildTarget OSXUniversal -executeMethod Statecraft.Game.EditorTools.Build.Mac -logFile "$PWD/unity-build-mac.log"`+- macOS IL2CPP build: `"$UNITY" -batchmode -CI false -quit -projectPath unity -buildTarget OSXUniversal -executeMethod Statecraft.Game.EditorTools.Build.Mac -logFile "$PWD/unity-build-mac.log"`(output `unity/Builds/Mac/Statecraft.app`).- Browser check: `uv run tools/web_check.py unity/Builds/Web-disabled --query "golden&smoke=5"` with the three full `--expect`values pinned in `docs/determinism.md` (both goldens and the smoke line).diff --git a/docs/m3-release.md b/docs/m3-release.mdindex b9f967de1..21104b78f 100644--- a/docs/m3-release.md+++ b/docs/m3-release.md@@ -5,7 +5,7 @@ start of M4, as a private Draft (owner ruling, 2026-10-10); their sections below## What ships- **Folder and zip:** `unity/Builds/Web-brotli/` uses Brotli compression with no decompression fallback. It is zipped as `unity/Builds/statecraft-m3-web.zip`, with `index.html` at the zip root. Both are build output and are not committed.-- **Built by:** `"$UNITY" -batchmode -quit -projectPath unity -buildTarget WebGL -executeMethod Statecraft.Game.EditorTools.Build.Web -compression brotli -logFile "$PWD/unity-build-web-br.log"`, then `python3 tools/package_release.py` (it zips the folder, `index.html` at the root, and refuses until the sensitivity review below is done). Never zip by hand.+- **Built by:** `"$UNITY" -batchmode -CI false -quit -projectPath unity -buildTarget WebGL -executeMethod Statecraft.Game.EditorTools.Build.Web -compression brotli -logFile "$PWD/unity-build-web-br.log"`, then `python3 tools/package_release.py` (it zips the folder, `index.html` at the root, and refuses until the sensitivity review below is done). Never zip by hand.- **After building:** drop the build's rewrites of the settings with`git checkout -- unity/Assets/Settings unity/ProjectSettings/ProjectSettings.asset` (as in `dev-setup.md`), so nobuild-cache change gets committed.diff --git a/docs/unity-mcp-upstream-request.md b/docs/unity-mcp-upstream-request.mdnew file mode 100644index 000000000..1d5bdd7ad--- /dev/null+++ b/docs/unity-mcp-upstream-request.md@@ -0,0 +1,34 @@+# Draft feature request for IvanMurzak/Unity-MCP++For the owner to file on https://github.com/IvanMurzak/Unity-MCP/issues (not filed by the project's agents). It was+drafted in the Unity-MCP adoption review of 2026-10-10.++## Title++Gate the main asmdefs without writing scripting defines into ProjectSettings.asset++## Body++We use Unity-MCP 0.93.3 from OpenUPM in an open-source project and git-ignore `Assets/Plugins/NuGet`, so the resolver+downloads the DLLs on each machine's first open. That part works well.++On every healthy resolve, `RecompileGate.EnsureReadyDefine()` writes `UNITY_MCP_READY;UNITY_MCP_DEPS_7` into the+scripting defines of every build target group in `ProjectSettings/ProjectSettings.asset`. For a team that does not commit+the NuGet DLLs, this leaves a permanent local change in a tracked file. That change must never be committed: a fresh clone+then gets the defines before the DLLs, the plugin's assemblies compile against missing references (about 2,000+`error CS0234`), and batch mode aborts. We now guard against it with a policy test. We found no setting, env var or menu+item that changes this.++Proposal: gate the main asmdefs with `versionDefines` keyed on a resolver-generated local marker package (for example+`Packages/com.ivanmurzak.unity.mcp.nuget-ready`, a git-ignorable embedded package whose version encodes the deps+generation), instead of writing `UNITY_MCP_READY` and `UNITY_MCP_DEPS_n` into ProjectSettings. That keeps the same+static, pre-code-execution gate (#957, #966) while leaving `ProjectSettings.asset` untouched for teams that don't commit+`Assets/Plugins/NuGet`. Alternatively, add an opt-in that writes the gate only when absent and never on every resolve.++Related, smaller observations from the same adoption, in case they are useful:++- With `CI=true` in the environment and the DLLs not committed, the resolver skips the download but still adds the gate+ defines, so a fresh clone fails to compile. A check that the DLLs exist before `EnsureReadyDefine()` on the CI path+ would avoid that.+- In batch mode the first-run window (`MainWindowInitializer`) opens, and its server panel can start the local server+ during a test run. Skipping it when `Application.isBatchMode` would help teams that run EditMode tests headless.diff --git a/scripts/oss/tests/test_readme.py b/scripts/oss/tests/test_readme.pyindex da394958d..53c4b6119 100644--- a/scripts/oss/tests/test_readme.py+++ b/scripts/oss/tests/test_readme.py@@ -183,22 +183,30 @@ def test_unity_mcp_section_is_in_contributing_and_building_with_the_same_facts()for rel in ("CONTRIBUTING.md", "BUILDING.md"):text = section(read(rel), MCP_HEADING)for fact in ("https://github.com/IvanMurzak/Unity-MCP", "0.93.3", "Packages/manifest.json",- "Window → AI Game Developer", "Custom", "http://localhost:27766", "http", "Configure",- "Generate", "Cloud", "sign in", "UserSettings/AI-Game-Developer-Config.json",+ "Window → AI Game Developer", "Custom", "held by the project", "Cloud", "sign in",+ "UNITY_MCP_CONNECTION_MODE", "UserSettings/AI-Game-Developer-Config.json", "Server URL",+ "derived from your project's path", "http", "token", "Bearer", "Account sign-in",+ "Keep server running", "Configure", "Generate", "unity/.mcp.json","no game rules in Unity", "tests first", "sources", "AI assistance",- "editor actions", "never expose", "batch mode", "UnityMcpGuard", "player build",+ "editor actions", "never expose", "batch mode", "UnityMcpGuard", "player build", "-CI false",+ "CI=true", "AI-Game-Developer-UpdateSettings.asset", "UnityMcpGuardTests","ProjectSettings.asset", "UNITY_MCP_READY", "nuget.org", "Not connecting?", "gamedev-mcp-server",- "PID"):+ "PID", "Unity-MCP.MainWindow.Initialized", "Unity_MCP_SelectedAiAgent"):assert fact in text, (rel, fact)+ for rel in ("CONTRIBUTING.md", "BUILDING.md", "README.he.md", "README.md"):+ assert "27766" not in read(rel), rel # the port is per project; a shared fixed port made clones share a serverdef test_hebrew_readme_carries_the_unity_mcp_facts():he = section(read("README.he.md"), "## איך משתתפים")- for fact in ("Unity-MCP", "0.93.3", "Window → AI Game Developer", "Custom", "http://localhost:27766", "http",- "Configure", "Generate", "Cloud", "UserSettings/AI-Game-Developer-Config.json", "ProjectSettings.asset",- "UNITY_MCP_READY", "nuget.org", "gamedev-mcp-server", "PID", "batch"):+ for fact in ("Unity-MCP", "0.93.3", "Window → AI Game Developer", "Custom", "Cloud", "UNITY_MCP_CONNECTION_MODE",+ "UserSettings/AI-Game-Developer-Config.json", "http", "token", "Bearer", "Account sign-in",+ "Keep server running", "Configure", "Generate", "unity/.mcp.json", "ProjectSettings.asset",+ "UNITY_MCP_READY", "nuget.org", "gamedev-mcp-server", "PID", "batch", "UnityMcpGuard", "-CI false",+ "CI=true", "AI-Game-Developer-UpdateSettings.asset", "git checkout -- unity/Assets/Settings",+ "Unity-MCP.MainWindow.Initialized", "Unity_MCP_SelectedAiAgent"):assert fact in he, fact- for idea in ("כללי המשחק", "בדיקות", "מקור", "בינה מלאכותית", "פורט"):+ for idea in ("כללי המשחק", "בדיקות", "מקור", "בינה מלאכותית", "פורט", "נתיב"):assert idea in he, idea@@ -215,3 +223,10 @@ def test_playerprefsbool_error_points_at_the_openupm_registry():text = read(rel)for fact in ("PlayerPrefsBool", "https://package.openupm.com"):assert fact in text, (rel, fact)+++def test_ci_true_troubleshooting_is_in_building_and_hebrew():+ for rel in ("BUILDING.md", "README.he.md"):+ text = read(rel)+ for fact in ("error CS0234", "CI=true", "-CI false", "git checkout -- unity/ProjectSettings/ProjectSettings.asset"):+ assert fact in text, (rel, fact)diff --git a/scripts/oss/tests/test_unity_mcp.py b/scripts/oss/tests/test_unity_mcp.pyindex b16ed65e8..0f47d7980 100644--- a/scripts/oss/tests/test_unity_mcp.py+++ b/scripts/oss/tests/test_unity_mcp.py@@ -54,14 +54,50 @@ def test_downloads_and_generated_agent_files_are_ignored():# local token) was already ignored.ignore = (ROOT / ".gitignore").read_text(encoding="utf-8").splitlines()for rule in ("unity/Assets/Plugins/NuGet/", "unity/Assets/Plugins/NuGet.meta", ".mcp.json", "unity/.claude/",- "unity/UserSettings/", "unity/Library/"):+ "unity/UserSettings/", "unity/Library/", "unity/Assets/packages-merged-link/",+ "unity/Assets/packages-merged-link.meta", "unity/.agent/", "unity/.agents/", "unity/.cline/",+ "unity/.codex/", "unity/.cursor/", "unity/.gemini/", "unity/.github/", "unity/.junie/",+ "unity/.kilocode/", "unity/.opencode/", "unity/.roo/", "unity/opencode.json"):assert rule in ignore, ruledef test_notices_and_licensing_name_the_plugin_and_its_dependencies():notices = (ROOT / "THIRD-PARTY-NOTICES.md").read_text(encoding="utf-8")for fact in (PKG, "Apache-2.0", "extensions.unity.playerprefsex", "ReflectorNet", "GameDev-MCP-Server", "nuget.org",- "UnityMcpGuard"):+ "UnityMcpGuard", "integrity, not authenticity", "no hash or signature check",+ "with each package on nuget.org"):assert fact in notices, factrow = next(l for l in (ROOT / "LICENSING.md").read_text(encoding="utf-8").splitlines() if "`unity/Packages/`" in l)assert "OpenUPM" in row and PKG in row and "Apache-2.0" in row+++def test_update_popup_is_off_for_the_team():+ # The plugin's own team kill-switch (ProjectSettings, meant to be committed): no update popup in any editor, batch+ # runs included, and no OpenUPM ping. Version bumps come by pull request.+ text = (ROOT / "unity/ProjectSettings/AI-Game-Developer-UpdateSettings.asset").read_text(encoding="utf-8")+ assert "UnityMcpUpdateProjectSettings" in text and "disableUpdateNotificationsForTeam: 1" in text+++def test_every_documented_batch_unity_command_turns_the_plugins_ci_mode_off():+ # With CI=true in the environment the plugin's resolver skips its NuGet download but still adds its gate defines,+ # so a fresh clone fails to compile (2026-10-10, fix round 1). "-CI false" wins over the environment.+ files = [f for f in subprocess.run(["git", "-C", str(ROOT), "ls-files", "-z", "*.md", "tools/*.sh", "scripts/*.sh"],+ capture_output=True, check=True, text=True).stdout.split("\0") if f]+ files = [f for f in files if not f.startswith(("docs/superpowers/", "reports/", "research_notes/", "spikes/"))]+ seen = 0+ for rel in files:+ for n, line in enumerate((ROOT / rel).read_text(encoding="utf-8").splitlines(), 1):+ if '"$UNITY" -batchmode' in line:+ seen += 1+ assert "-CI false" in line, f"{rel}:{n}"+ assert seen >= 8+++def test_ci_section_says_a_unity_job_must_turn_ci_mode_off():+ text = (ROOT / "CONTRIBUTING.md").read_text(encoding="utf-8").split("## What CI runs", 1)[1].split("\n## ", 1)[0]+ assert "-CI false" in text+++def test_upstream_feature_request_draft_is_kept_for_the_owner():+ text = (ROOT / "docs/unity-mcp-upstream-request.md").read_text(encoding="utf-8")+ assert "versionDefines" in text and "ProjectSettings.asset" in text and "not filed" in textdiff --git a/tools/art_checkpoint.sh b/tools/art_checkpoint.shindex d57de5a14..7910aaf0b 100755--- a/tools/art_checkpoint.sh+++ b/tools/art_checkpoint.sh@@ -24,7 +24,7 @@ if ! git diff --quiet -- "${guarded[@]}"; thenfitrap 'git checkout -- "${guarded[@]}"' EXITif [[ $build == 1 ]]; then- shared "$UNITY" -batchmode -quit -projectPath unity -buildTarget WebGL -executeMethod Statecraft.Game.EditorTools.Build.Web -compression disabled -logFile "$root/unity-build-web-art.log"+ shared "$UNITY" -batchmode -CI false -quit -projectPath unity -buildTarget WebGL -executeMethod Statecraft.Game.EditorTools.Build.Web -compression disabled -logFile "$root/unity-build-web-art.log"git checkout -- unity/Assets/Settings unity/ProjectSettings/ProjectSettings.assetif grep -n "Shader error" "$root/unity-build-web-art.log"; then echo "art_checkpoint: shader errors in the WebGL build" >&2; exit 1; fifi@@ -39,7 +39,7 @@ poses=$(grep -o 'new PromoPose("[A-Za-z0-9_]*"' unity/Assets/Scripts/Map/PromoPofor pose in $poses; do[[ -s "$out/$pose.png" ]] || { echo "art_checkpoint: $out/$pose.png is missing" >&2; exit 1; }done-shared "$UNITY" -batchmode -quit -projectPath unity -buildTarget OSXUniversal -executeMethod MapCapture.Promo -captureDir "$root/$out/editor" -logFile "$root/unity-capture-promo.log"+shared "$UNITY" -batchmode -CI false -quit -projectPath unity -buildTarget OSXUniversal -executeMethod MapCapture.Promo -captureDir "$root/$out/editor" -logFile "$root/unity-capture-promo.log"git checkout -- unity/ProjectSettings/QualitySettings.asset # SetQualityLevel may have written m_CurrentQuality (no unstaged edits: checked above)uv run tools/art_compare.py "$out" "$name" --log "$main_root/captures/visual/art-log.tsv"echo "ART CHECKPOINT $name: $(ls "$out"/*-compare*.png "$out"/editor/*-compare*.png | tr '\n' ' ')"