Skip to content

Answer node removes and moves with what the tree now holds - #1066

Merged
saworbit merged 2 commits into
mainfrom
fix/node-moves-read-back
Sep 29, 2026
Merged

saworbit merged 2 commits into
mainfrom
fix/node-moves-read-back

Conversation

@saworbit

Copy link
Copy Markdown
Owner

Description

Part of #1019: removing and moving a node.

scene_remove_node and scene_reparent_node answered action alone. Nothing was read after the commit, and the reparented node's new path was not in the answer, so a caller had to work it out to reach the node again.

  • scene_remove_node checks after the commit that the path it named no longer resolves, and answers exists: false.
  • scene_reparent_node reads the node's parent and logical path after the commit, and answers node_path, the path to reach it by from now on.
  • Either refuses with a 500 a change the tree does not reflect, rather than reporting success.

Related Issues

Part of #1019. Stacked on #1065, which merges first.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds new MCP tools or capabilities)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist

  • My code adheres to the project's coding style guidelines (C++20, 4 spaces).
  • I have added automated tests in tests/ covering new functionality. Two observed-state cases.
  • All native unit tests pass (946/946 locally).
  • Live bridge changes pass tests/run_godot_integration.ps1 on Godot 4.5.1, 4.6.2 and 4.7.2.
  • Runtime-session changes cover editor and game descriptors, authentication, attach rollback, pause/step/stop, cursor polling, cleanup, and token redaction. Not touched.
  • Expression changes cover the strict read-only grammar, receiver allowlist, output/depth bounds, and cooperative-timeout wording. Not touched.
  • The exact MCP smoke starts with an explicit Godot project, matches the manifest emitted by didi --dump-tool-manifest from the same build, preserves the Phase 4/5/6 contracts, and keeps reserved runtime debugger tools marked unimplemented.
  • Any new tool name has an accepted record in docs/SURFACE_AMENDMENTS.md. No new tool.
  • Capability metadata, reference docs, roadmap, and changelog are current. Published tool counts are derived from the manifest, never hand-edited.
  • If this starts or finishes a Build Queue item, its row in docs/BUILD_QUEUE.md says IN PROGRESS, or COMPLETE (#<this pull request>). Not a queue item.
  • Tests added or removed: test_inventory.py --check agrees.
  • I have updated relevant documentation in docs/ and README.md.

Tests

  • Both move from exempt to observed in tests/observed_post_state.json. The new cases take the copy the duplicate case just made, move it under Subject, then remove it. Each compares the answer with node_info through the witness. On 4.5.1, 4.6.2 and 4.7.2: 38 cases over 36 tools agreed.
  • I made the reparent report a wrong path. The harness failed with scene_reparent_node.node_path answered "/root/ObservedRoot/Subject/SpawnedCopyMoved" but the engine reports the real one.

Local: native 946/946, Python 540 OK, docs validator clean, inventory 1486.

scene_add_to_group and scene_remove_from_group answered added and
removed as constants. Membership was read only before the write, so a
commit the node did not take would still have read as done.

Both now read is_in_group again after the undo action commits and
answer in_group from it. A change the node does not reflect is refused
rather than reported. They move from exempt to observed, and a case for
each compares in_group with the node's own is_in_group through the
witness. Reporting the opposite of what was read fails the harness on
both tools.

Part of #1019.
scene_remove_node and scene_reparent_node answered action alone. Nothing
was read after the commit, and the reparented node's new path was not in
the answer, so a caller had to guess it to reach the node again.

A remove now checks that the path it named no longer resolves and
answers exists: false. A reparent reads the node's parent and path after
the commit and answers node_path. Either refuses a change the tree does
not reflect. Both move from exempt to observed, with cases that move and
then remove the duplicate the case before them makes. Reporting a wrong
path fails the harness on scene_reparent_node.node_path.

Part of #1019.
@github-actions github-actions Bot added documentation Improvements or additions to documentation tests Test suites and the contracts they assert addon The Godot addon and the in-engine GDExtension labels Sep 29, 2026
@saworbit
saworbit merged commit 209e35f into main Sep 29, 2026
28 checks passed
@saworbit
saworbit deleted the fix/node-moves-read-back branch September 29, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

addon The Godot addon and the in-engine GDExtension documentation Improvements or additions to documentation tests Test suites and the contracts they assert

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant