Repository navigation
Record the cuts a bake applies, name a moved cutter past its sibling, answer commit_cuts callers of a freed level - #1361
Merged
Merged
Conversation
… answer commit_cuts callers of a freed level A bake applied the pending cuts with no undo step. Every dock bake that applies cuts now records "Apply Pending Cuts" first, a step only when something was pending, and the bridge's hf_bake records it through the dispatcher so hf_undo takes the cuts back. A cut moved between containers landed beside a same-named sibling as @Box_0@N, which the record drops, so the cutter a redo rebuilt came back as Box_0; the moves add with a readable name now. prepare_commit_cuts() and commit_cuts() hand back the bake system's answer, so a caller resumes with false when the level is freed mid-bake.
saworbit
enabled auto-merge (squash)
October 20, 2026 23:12
The scenario pinned the old chain end: hf_undo refused after a bake had applied a cut. The apply is the agent's own step now (#1353), so the scenario undoes it, sees the cut pending again, and redoes it for the bakes that follow.
3 tasks done
saworbit
added a commit
that referenced
this pull request
Oct 20, 2026
The Agent Bridge guide said no undo step records the cuts a bake applies, which #1361 changed. The roadmap's bridge section lists the day's other bridge fixes beside floor paint. DEVELOPMENT's capture paragraph names the prefs the swap now puts back, and the undo sweep's header no longer claims an undo before a bake leaves the bake standing.
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.
Summary
HFBakeSystem._bake_impl()callsroot.apply_pending_cuts()and no caller recorded that move; the bridge'shf_bakebumped the revision by hand and ended the agent's undo chain. The step belongs to the callers, since the bake system has no undo manager:HFDockManageHandler.apply_pending_cuts_as_a_step()commits "Apply Pending Cuts" throughcommit_if_changed()(a step only when something was pending) before every dock bake that applies cuts: Bake, Bake Changed, the three Quick Plays (before the spawn's temporary move, so the capture never holds the spawn at the camera), Export Playtest, the game scene export, Validate Spawn and Spawn Preview. The bake then finds nothing to apply.hf_bakerecordsMCP: apply pending cutsthrough the dispatcher's own capture and commit, so the revision moves throughversion_changedandhf_undotakes the cuts back;hf_bakeitself is still no step. Bothpending_cutKNOWN cases come off the undo sweep.apply_pending_cutsreparents withadd_child(child), and a node landing beside a same-named sibling is named@Box_0@N(both the box and the cut areBox_0); the record leaves@names out (Every undo moves the brushes it touched to the end of the level, so a save after an undo rewrites the file #660) and the rebuild names itBox_0. The four container moves useadd_child(node, true), Godot's readable-name rule, which numbers past the sibling as a new brush is numbered and keeps a mapper's stem. KNOWN case off.prepare_commit_cuts()andcommit_cuts()returnbake_system.answer_to(...), the [Bake] Let a caller of a level's bake resume when the level is freed mid-bake #1294 shape, and the brush system'sprepare_commit_cutsreturns false when the root is gone after its bake instead of touching it.Docs:
hammerforge_mcp/README.md,catalogue.py'shf_bakedescription, one SPEC sentence and the bridge design spec.Before / After Behavior
commit_cuts()on a closed tab never resumed.commit_cuts()callers get false when the level goes.Related Issue
Fixes #1353
Fixes #1354
Fixes #1357
Checks
test_undo_sweep6/6 with no KNOWN left,test_bake_applies_cuts_as_a_step3/3,test_commit_cuts_names_the_cutter5/5,test_bake_survives7/7,test_mcp_dispatcher_bake24/24,test_cutting34/34,test_quick_play32/32,test_dock_history_and_playtest8/8, plus the builder's wider set (test_bake19 scripts,test_mcp19 scripts, cuts, cordons, dock, prefab, registry)@Node3D@19names, null answers, no step,undo_conflict)pytest hammerforge_mcp110 passed; ruff clean; CI's gdformat and gdlint commands pass;check_script_warnings.pyclean;.durations.jsonentry for the new bake testchangelog.d/, no edit to CHANGELOG.md