Skip to content

fix(meta): replace hand-crafted placeholder GUIDs with random ones#12

Open
BadranRaza wants to merge 1 commit intoAnkleBreaker-Studio:mainfrom
BadranRaza:fix/placeholder-meta-guids
Open

fix(meta): replace hand-crafted placeholder GUIDs with random ones#12
BadranRaza wants to merge 1 commit intoAnkleBreaker-Studio:mainfrom
BadranRaza:fix/placeholder-meta-guids

Conversation

@BadranRaza
Copy link
Copy Markdown

Fixes #11.

Summary

Three .cs.meta files ship with obviously hand-typed placeholder GUIDs (monotonic hex sequences, no entropy) rather than randomly-generated Unity GUIDs. Under embedded install (Packages/) Unity's Asset DB tolerates them; under UPM git install (Library/PackageCache/) Unity 6 silently refuses to index the three associated .cs files, cascading into 8+ CS0103: The name 'X' does not exist in the current context compile errors. See #11 for the full diagnosis, reproduction on Unity 6000.3.10f1, and counter-evidence ruling out source-code / asmdef / UMA causes.

Fix

Regenerated the three GUIDs with openssl rand -hex 16. That's the whole diff — 3 lines across 3 files:

Editor/MCPPrefsCommands.cs.meta:       8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f → 435b201593b245cd38bc841f437d3257
Editor/MCPConstraintCommands.cs.meta:  3f6e7d8c9a1b2e5d4a6c8e9f0a2b3d5e → bf3012be38b3a628bd5f2fd63d03e293
Editor/MCPProfilerCommands.cs.meta:    3f7a2c8e19d04b6d8e5c1a9f4b3d7e2a → 56a99aaa30daa3acf48c3f468f508646

No source code, asmdef, namespace, or API changes.

Verification

  1. Pointed a Unity 6 project's Packages/manifest.json at this branch:
    "com.anklebreaker.unity-mcp": "https://github.com/BadranRaza/unity-mcp-plugin.git#fix/placeholder-meta-guids"
  2. Wiped Library/PackageCache/com.anklebreaker.unity-mcp@* so UPM re-resolved from scratch.
  3. Opened Unity. Compile clean. Zero CS0103 errors.

Before the fix (same project, manifest pointing at v2.27.0): the exact 8-error cascade reported in #11. After the fix: clean.

Safety

These three classes (MCPPrefsCommands, MCPConstraintCommands, MCPProfilerCommands) are pure editor-side command handlers reached by CLR type name from MCPBridgeServer and MCPSelfTest in the same assembly. No scene / prefab / ScriptableObject / CustomEditor references target them by GUID, so regenerating the GUIDs cannot break any user project or internal reference.

Scanned all 71 .meta files in the repo; only these three had the monotonic-hex pattern, so the fix is complete — no other suspicious GUIDs to clean up.

Related (follow-up, not this PR)

Editor/AnkleBreaker.UnityMCP.Editor.asmdef unconditionally references UMA_Core / UMA_Core_Editor even though MCPUMACommands.cs is #if UMA_INSTALLED-guarded. Harmless today (Unity warns, doesn't error, when those assemblies are missing), but cleaner to split into a child asmdef with "defineConstraints": ["UMA_INSTALLED"]. Happy to send as a separate PR if you're interested — kept it out of this diff to keep the fix surgical.

Three .meta files ship with hand-authored placeholder GUIDs composed of
a monotonic hex sequence rather than randomly-generated values:

  Editor/MCPPrefsCommands.cs.meta       8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f
  Editor/MCPConstraintCommands.cs.meta  3f6e7d8c9a1b2e5d4a6c8e9f0a2b3d5e
  Editor/MCPProfilerCommands.cs.meta    3f7a2c8e19d04b6d8e5c1a9f4b3d7e2a

Under embedded install (Packages/), Unity's import pipeline tolerates
these. Under UPM git install (Library/PackageCache/), Unity 6 silently
fails to register the three .cs files. The result is cascading
CS0103 compile errors in files that reference the affected classes:

  Library/PackageCache/com.anklebreaker.unity-mcp@<sha>/Editor/MCPBridgeServer.cs(1196,28):
    error CS0103: The name 'MCPPrefsCommands' does not exist in the current context
  Library/PackageCache/com.anklebreaker.unity-mcp@<sha>/Editor/MCPSelfTest.cs(1043,30):
    error CS0103: The name 'MCPPrefsCommands' does not exist in the current context
  (7 more lines in MCPBridgeServer.cs for the same class)

Reproduced on Unity 6000.3.10f1 (macOS) with a fresh UPM install
pinned to v2.27.0 — same source tree that compiles clean when
embedded compiled the three offending files in via the asmdef once
their metas were regenerated with random GUIDs. The other ~50 .cs
files in Editor/ have proper random GUIDs and were never affected.

Regenerate the three GUIDs with `openssl rand -hex 16`. This is the
minimal fix; no source-code or asmdef changes needed.

Note: since these are editor-only utility classes (no scene or
ScriptableObject references target them by GUID), changing the GUIDs
does not break any user project. Internal type-name references
(MCPPrefsCommands.GetEditorPref, etc.) are GUID-independent.
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.

UPM install fails with CS0103 cascade: three .cs.meta files ship with hand-crafted placeholder GUIDs

1 participant