fix(mcp): templates use string IDs for SiteNode.children#326
Merged
wass08 merged 1 commit intoMay 21, 2026
Merged
Conversation
PR pascalorg#320 changed SiteNode.children from embedded BuildingNode/ItemNode objects to flat string[] IDs. PR pascalorg#325 updated the runtime call sites but missed the three scene templates, which still mutated the site node's children array to embed full building objects after building the flat dict. This caused AnyNode.safeParse to fail for site_empty, site_2br, and site_garden in bun test --cwd packages/mcp. Remove the obsolete mutation blocks; each template already initialises site.children with the correct string id (e.g. ['building_empty']). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
wass08
added a commit
that referenced
this pull request
May 21, 2026
SiteNode.children is z.array(z.string()) (node ids), but the three scene templates overwrote their inline string-id children with embedded BuildingNode objects — leftover from the pre-PR-#325 schema where children was a union of node objects. Against the current schema that breaks AnyNode.safeParse in templates.test.ts. Drop the stale post-build mutations; each site already declares the correct string-id children inline. (Same fix as the in-flight PR #326; carried here so this branch's CI is green when merged with current main.) Co-Authored-By: Claude Opus 4.7 (1M context) <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.
What does this PR do?
Follow-up to #325. PR #320 changed
SiteNode.childrenfrom embeddedBuildingNode | ItemNodeobjects to flatstring[]IDs. #325 updated the runtime call sites (rehydrate-site-children.ts,generate-variants.ts,nodes/site/renderer.tsx) but missed the three scene templates inpackages/mcp/src/templates/, which still mutated the site node'schildrenarray to embed full building objects after building the flat dict.This caused
AnyNode.safeParseto fail forsite_empty,site_2br, andsite_gardenwhen runningbun test --cwd packages/mcp(part of.github/workflows/mcp-ci.yml):Each template already initialises
site.childrenwith the correct string id (e.g.['building_empty']); the obsolete mutation blocks just need to be removed.How to test
bun test --cwd packages/mcp— confirm all 281 tests pass (previously 3 failing).Screenshots / screen recording
N/A — non-visual fix (schema alignment in template data).
Checklist
bun devbun checkto verify)mainbranch