Skip to content

Put floor paint on the agent bridge - #1362

Merged
saworbit merged 1 commit into
mainfrom
feature/mcp-floor-paint
Oct 20, 2026
Merged

saworbit merged 1 commit into
mainfrom
feature/mcp-floor-paint

Conversation

@saworbit

Copy link
Copy Markdown
Owner

Summary

The palette's paint commands act on the tool's own memory and the mouse: Raise lifts the last stroke's cells, Stamp Room stamps the last rectangle's size at the hovered cell, Confirm Connector keeps the pending ghosts. Nothing took a layer and cells, so an agent could not paint. Spec: docs/superpowers/specs/2026-10-21-floor-paint-bridge.md.

Two layers:

  • HFPaintSystem calls in cell space: paint_cells(layer, from, to, filled, material_id), raise_cells(layer, from, to, height), stamp_room(layer, at, width, depth, height), connector_candidates() / confirm_connectors(layer, from, to, to_layer), plus paint_layer_at, find_paint_layer and describe_paint_layers. Each writes through set_cell / set_cell_material / set_wall_height, consumes the dirtied chunks and reconciles them through the existing reconciler; with region streaming on, the rectangle's regions are loaded and pinned for the call. Limits: cells within 100000 of the origin, at most 65536 cells per rectangle, refused mid-stroke. One implementation: the rectangle's cells are HFPaintTool.rect_cells() (the Rect stroke, its preview and the room stamp use it), confirming is HFPaintTool.add_connector_defs() (which confirm_connector_ghosts() now calls), and the connector settings sync is one function.
  • Bridge forms on the palette entries that are their human surface: paint_ramp carries paint_rect (layer, from, to, filled, material), paint_raise carries raise_rect (height), paint_room carries stamp_room (at, width, depth, height), paint_confirm_connector carries confirm_connector (to_layer). New param types cell ([x, z]) and layer (index or name; absent is the level's active layer, which is level state). Answers carry the layer used, the rectangle, bounds in world metres on the floor's top, and cell, height and connector counts. Every run goes through _run_mutation, so each is one MCP: ... step, hf_undo reverses it, and each may be an hf_batch op. hf_list_commands gives each paint entry paint_layers.

Out of scope, written in the spec: the gesture strokes, mirror axes, inference cleanup, layer management, heightmaps and reading cells back.

Before / After Behavior

  • Before: an agent could not paint a floor, raise it or join two layers.
  • After: hf_run_command paint_rect, raise_rect, stamp_room and confirm_connector do each in one undo step, and the listing says which layers the level has.

Related Issue

Fixes #1299

Checks

  • test_paint_cells 17/17, test_mcp_dispatcher_paint 16/16, test_mcp_command_sweep 1/1 (14 commands in 10 states), test_mcp_dispatcher_commands 27/27 (the numeric-range test rewritten to take each entry's target count), test_paint 13 scripts 181/181, test_command_registry 10/10, test_undo_sweep, test_dirty_tags, test_bake_system; .durations.json entries for the two new scripts
  • With the reconcile removed from paint_cells, the floor and wall assertions fail; restored, green
  • New MCP vibe scenario tools/vibe/mcp/scenarios/paint.py run against a headless editor: 19 ok, nothing flagged
  • pytest hammerforge_mcp 110 passed; ruff clean; CI's gdformat and gdlint commands pass; check_script_warnings.py clean
  • Agent Bridge docs, SPEC, ROADMAP (floor paint moved to done), features, server README, catalogue and the MCP vibe README updated
  • A fragment in changelog.d/, no edit to CHANGELOG.md

HFPaintSystem gains calls in cell space with no screen or mouse in them:
paint_cells, raise_cells, stamp_room and confirm_connectors, each writing
the layer through the same primitives the Paint tool uses and reconciling
the chunks it dirtied. The Rect stroke, its preview and the room stamp now
share rect_cells(), and confirming a connector is one add_connector_defs().
Four bridge forms sit on the palette's paint entries: paint_rect,
raise_rect, stamp_room and confirm_connector, with cell and layer param
types, each one undo step through the dispatcher. hf_list_commands gives
the paint entries the level's layers.
@saworbit
saworbit enabled auto-merge (squash) October 20, 2026 23:17
@github-actions github-actions Bot added area: paint Surface paint, terrain, heightmaps, materials (Paint tab) area: docs README, guides, spec, roadmap, changelog area: ci Workflows, contributor tooling, dependency pins tests The GUT suite and its fixtures labels Oct 20, 2026
@saworbit
saworbit merged commit 6d4bed5 into main Oct 20, 2026
11 checks passed
@saworbit
saworbit deleted the feature/mcp-floor-paint branch October 20, 2026 23:25
saworbit added a commit that referenced this pull request Oct 20, 2026
Seventeen fragments from PRs #1344 to #1362, written into the week of
19 Oct, and deleted. Highlights unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci Workflows, contributor tooling, dependency pins area: docs README, guides, spec, roadmap, changelog area: paint Surface paint, terrain, heightmaps, materials (Paint tab) tests The GUT suite and its fixtures

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MCP] Put floor paint on the agent bridge

1 participant