fix: update mcp and nodes for SiteNode.children string[] schema change#325
Merged
wass08 merged 1 commit intoMay 21, 2026
Merged
Conversation
Fixes breakage introduced by pascalorg#320 which changed `SiteNode.children` from embedded `BuildingNode | ItemNode` objects to flat `string[]` IDs. - `packages/mcp/src/lib/rehydrate-site-children.ts`: replace now-obsolete re-embedding logic with a no-op passthrough (call-site compatible) - `packages/mcp/src/tools/variants/generate-variants.ts`: drop the inline copy of the same function and its call - `packages/nodes/src/site/renderer.tsx`: cast `childId as AnyNodeId` since `SiteNode.children` is now `string[]`, not `AnyNodeId[]` Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
4 tasks
Collaborator
|
Thank you! |
4 tasks
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>
wass08
pushed a commit
that referenced
this pull request
May 21, 2026
PR #320 changed SiteNode.children from embedded BuildingNode/ItemNode objects to flat string[] IDs. PR #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>
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?
Fixes breakage introduced by #320, which changed
SiteNode.childrenfrom embeddedBuildingNode | ItemNodeobjects to flatstring[]IDs. Three call sites inpackages/mcpandpackages/nodeswere not updated.mcp/lib/rehydrate-site-children.ts— replace now-obsolete re-embedding logic with a passthrough (call-site compatible, callers become no-ops)mcp/tools/variants/generate-variants.ts— drop the inline copy of the same function and its callnodes/src/site/renderer.tsx— castchildId as AnyNodeIdsinceSiteNode.childrenis nowstring[]How to test
bun dev— confirm the build completes with no TS errors in@pascal-app/mcpand@pascal-app/nodesgenerate_variantsMCP tool — confirm variants produce valid node countsScreenshots / screen recording
N/A — non-visual fix (type correctness and schema alignment).
Checklist