Skip to content

Let an agent update or detach a structure - #1305

Merged
saworbit merged 2 commits into
mainfrom
feature/structure-update-detach
Oct 17, 2026
Merged

saworbit merged 2 commits into
mainfrom
feature/structure-update-detach

Conversation

@saworbit

@saworbit saworbit commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Summary

An agent could build stairs, arches, spiral stairs and domes over the bridge, but every structure was frozen once built. There was no Update or Detach, and nothing an agent read said which brushes were a structure's pieces. Changing a radius meant deleting the pieces and building again, which loses the paint, names, brush entities and visgroups an Update keeps.

  • update_structure and detach_structure through hf_run_command, named by generator_id. The id survives a rebuild; brush ids do not, since every Update gives every piece a new one.
  • Update reads the settings it is given over the structure's current ones, not the defaults, so changing steps leaves width and fill alone. It checks them as create_arch does (unknown key, wrong type, out of range, an enum by label) and then with can_build_generator(). A refusal says what the dock says, through one function now shared by both (HFGeneratorSystem.not_changed_text()).
  • No confirmation, as [MCP] Reach every palette action from the agent bridge through one command registry #1265 decided for every dialog: the call is the confirmation and hf_undo the way back. What the dock would have warned about comes back in the answer: appearance_dropped, edits_replaced, and a warning when the pieces no longer agreed where the structure was.
  • hf_get_brushes (and every brush in an answer) gives structure: null, or the generator_id, type, piece index and settings. It is read through the generator record, not the hf_generator_id tag on the brush: a redone Detach leaves the tag behind, and a test that read the tag failed on exactly that.
  • $N.generator_id in hf_batch, so one batch can build a structure and then update or detach it.
  • Both are registry entries with interactive arms. Update rebuilds from the Structure section's settings and, unlike the section's own button, never builds a new structure. The context toolbar shows Upd and Det when a structure piece is selected, the way it shows the prefab buttons for a prefab copy. Detach was a dock button only.
  • hf_list_commands gives update_structure the same settings_by_type as create_arch.

Design and pre-mortem: docs/superpowers/specs/2026-10-17-structure-update-detach-design.md.

Before / After Behavior

  • Before: an agent could build a structure and never change it. Its brush listing did not say which brushes were pieces of one.
  • After: an agent updates a structure in place (paint and names kept where the pieces line up) or detaches it into plain brushes, each one MCP: ... step. People get Update and Detach on the toolbar when a piece is selected.
  • Known limit: a structure is named one at a time. There is no listing of structures on their own; hf_get_brushes answers through structure.

Related Issue

Closes #1302

Checks

  • python tools/run_local_checks.py passes (28 passed, 4 not run here as usual)
  • GUT: the affected scripts and the bridge, palette and undo sweeps (both new commands in every state), after --import
  • The full GUT suite locally: 322 scripts, 5861 tests, 5854 passing, the usual 7 that assert nothing, no failures. Its one warning (orphans in test_dock_undo_coverage.gd) is on main too, filed as [Tests] The leak gate misses orphans GUT reports per script #1307
  • python tools/check_script_warnings.py passes
  • Docs updated: Agent Bridge guide, MCP README, features, SPEC, ROADMAP (structure Update and Detach come off the not-yet list)
  • A fragment in changelog.d/
  • git diff --check is clean
  • Nothing local committed
  • Real editor: new structures MCP vibe scenario (14 checks, including a person's Ctrl+Z taking an update back and hf_undo/hf_redo of a Detach through the editor's undo manager), and commands still passes. It runs in CI with the other headless scenarios.

Each new test was checked against the bug it pins: with Update merging over the defaults, or the listing reading the raw tag, 8 of the 14 bridge tests fail.

update_structure and detach_structure on the bridge, named by generator_id.
Settings not given keep the structure's values. hf_get_brushes gives each
piece's structure, hf_batch takes $N.generator_id, and the toolbar offers
Update and Detach for a selected piece.
@github-actions github-actions Bot added area: build Brushes, drawing, vertex/edge editing (Build tab) area: docs README, guides, spec, roadmap, changelog area: ci Workflows, contributor tooling, dependency pins tests The GUT suite and its fixtures labels Oct 17, 2026
@saworbit
saworbit merged commit 0a4fe5b into main Oct 17, 2026
11 checks passed
@saworbit
saworbit deleted the feature/structure-update-detach branch October 17, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build Brushes, drawing, vertex/edge editing (Build tab) area: ci Workflows, contributor tooling, dependency pins area: docs README, guides, spec, roadmap, changelog tests The GUT suite and its fixtures

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MCP] Let an agent update or detach a structure

1 participant