Skip to content

fix: a splice making room leaves the flow's parameters where they are (#1547) - #1548

Merged
ako merged 1 commit into
fix/1508-splice-shift-stated-positionsfrom
fix/1547-splice-shift-leaves-parameters
Oct 22, 2026
Merged

ako merged 1 commit into
fix/1508-splice-shift-stated-positionsfrom
fix/1547-splice-shift-leaves-parameters

Conversation

@ako

@ako ako commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Fixes #1547. Stacked on #1546 (which is stacked on #1528): it changes shifted(), which #1546 introduces. Retarget down the chain as each base merges.

The bug

A splice that makes room for an inserted fragment (create or modify, alter microflow … insert) moved the flow's parameters along with the row. Inserting one if/else into NF_Do ($Flag: Boolean) moved $Flag from its derived (200, 53) to (539, 53), and a longer replace then moved it to (699, 53). From then on describe printed a parameter @position that no script stated, and the row drifted further with every insert.

Cause: mfmutator.shift moves every top-level node past the cut, and a Microflows$MicroflowParameter is a top-level object in the stored object collection. mxcli's derived parameter row is absolute (200 + idx*pitch, 53), right of the start event, so almost every insert's cut falls left of it.

Why parameters stay

A parameter isn't on the line the room is made on. It belongs to the flow as a whole. Measured on Studio Pro-authored apps:

app parameters at the start event's x above every other node within 60px of the flow line
PedApp 20 19 16 0
JTSBootLogboek 51 44 51 0

Inserting an activity in Studio Pro moves nothing. So shifted() now leaves parameters out, and therefore so does pinnedPast: a stated parameter position can no longer block a splice it isn't in the way of.

Evidence

  • TestSplice_MakingRoomLeavesTheParameters (mfmutator): an insert and a longer replace; the activity after the gap moves (control), the parameter stays.
  • TestCreateOrModify_InsertDoesNotMoveStatedNodes1508's control subtest (PedApp) now also asserts $Flag stays at (200, 53).

Control (old shifted back in):

--- FAIL: TestSplice_MakingRoomLeavesTheParameters (0.00s)
    --- FAIL: TestSplice_MakingRoomLeavesTheParameters/an_insert (0.00s)
        splice_parameters_test.go:46: the parameter moved to (650, 53), want it left at (500, 53)
    --- FAIL: TestSplice_MakingRoomLeavesTheParameters/a_replace_longer_than_what_it_replaces (0.00s)
        splice_parameters_test.go:46: the parameter moved to (670, 53), want it left at (500, 53)
FAIL
FAIL	github.com/mendixlabs/mxcli/mdl/backend/mfmutator	0.004s
--- FAIL: TestCreateOrModify_InsertDoesNotMoveStatedNodes1508 (2.18s)
    --- FAIL: TestCreateOrModify_InsertDoesNotMoveStatedNodes1508/control:_no_position_stated_after_the_insert (0.52s)
        flow_modify_stated_positions_1508_test.go:168: $Flag moved to (699, 53), want it left at (200, 53):
FAIL
FAIL	github.com/mendixlabs/mxcli/mdl/executor	2.243s
FAIL

Real binary on a PedApp copy, running mdl-examples/bug-tests/flow-geometry-1547-splice-leaves-parameters.mdl (insert before the first statement of a two-parameter microflow): fixed → describe prints no parameter @position; with the fault forced back → @position(410, 53) on $Count.

Gates

  • make build, make test, make lint, make check-mdl, make check-findings: pass.

  • Integration (-tags integration ./mdl/roundtrip, the TestFlowRerunProperty / TestPedAppFlowSpliceParity / TestPedAppSpliceParity_* / TestFlowModify_* / TestSpliceRerun_* / TestFlowVerdictAgreement_* set): 55 pass; 2 skipped because this checkout has no TestApp fixture (TestTestAppFlowSpliceParity, TestFlowModify_TestAppHeaderAndPositions).

  • Bug-test: mdl-examples/bug-tests/flow-geometry-1547-splice-leaves-parameters.mdl

  • Finding: .claude/skills/fix-issue/findings/mdl-backend/2026-10-21-splice-shift-moves-parameters.json

A side effect of a fragment no longer pushing parameters aside: one whose box reaches up into the parameter row (y ≈ 53) and lands under a parameter is now refused by checkRoom ("move that object aside in Studio Pro first") instead of shoving the parameter along. No such case appears in the tests or the measured apps.

🤖 Generated with Claude Code

shift moved every top-level node past the cut, and a parameter is a
top-level object of the stored object collection: one if/else inserted
into NF_Do moved `$Flag` from its derived (200, 53) to (539, 53), a longer
replace then to (699, 53), and from then on describe printed a parameter
@position no script stated. mxcli's derived parameter row is absolute and
right of the start event, so almost every insert's cut falls left of it.

A parameter is not on the line the room is made on. Studio Pro authors
draw it above the start event — 63 of 71 in PedApp and JTSBootLogboek sit
at the start's x, none within 60px of the flow line — and an insert in
Studio Pro moves nothing. shifted() now leaves parameters out, and with it
pinnedPast, so a stated parameter position no longer blocks a splice it is
not in the way of.

Fixes #1547.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ako
ako merged commit 27b064b into fix/1508-splice-shift-stated-positions Oct 22, 2026
36 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant