Skip to content

fix: create or modify does not move a node the script places (#1508 case 6) — re-land of #1546 - #1569

Merged
ako merged 5 commits into
mainfrom
fix/1508-splice-shift-stated-positions
Oct 22, 2026
Merged

ako merged 5 commits into
mainfrom
fix/1508-splice-shift-stated-positions

Conversation

@ako

@ako ako commented Oct 22, 2026

Copy link
Copy Markdown
Owner

Re-lands ako/mxcli#1546 on main.

#1546 was stacked on fix/flow-graph-geometry (#1528). #1528 merged into main on 2026-10-21; #1546 was then merged on 2026-10-22 into its base, the already-merged fix/flow-graph-geometry, so its three commits never reached main:

  • 01c3a846e fix: a restated if outweighs a new one whose condition differs
  • a4ed9b61a fix: create or modify does not move a node the script places (mdl 1)
  • c4f43e80d docs: list the stated-position refusal among mdl 1's splice refusals

This PR is the same branch (fix/1508-splice-shift-stated-positions, head c4f43e80d) against main. No new changes; the description, evidence and control runs are on #1546. Fixes case 6 of #1508 (mendixlabs#1598).

After this merges, retarget #1548 (stacked on this branch) to main.

🤖 Generated with Claude Code

ako and others added 5 commits October 21, 2026 10:38
`create or modify` pairing a new `if` and a restated one against the same
stored decision weighed "the same if but for its condition" exactly like
"the same if with a change in a branch", and lcsStatements breaks a tie
toward the earlier pair. So in

    if $Out then …; end if;          -- new, no @position
    @position(-299, 200)
    if $Flag then …; end if;         -- restated, branch edited

the new `if $Out` took over the stored decision (its condition set in
place) and the restated `if $Flag` was inserted as a new node at its stated
position, on top of it: two decisions at (-299, 200), both merges at
(186, 200).

The weights are doubled and a changed condition now weighs 1, below every
other partial match, so the restated if pairs with its stored decision and
the new one is an insert. Every other ratio is unchanged.

Part of #1508 case 6 (mendixlabs#1598).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A `create or modify` that inserts statements without @position into a
flow whose later statements state theirs made room by moving everything
past the gap along. The stored flow then said something other than the
script: in #1508 case 6 `if $Flag` went -299 -> 40, its merge
186 -> 525 and the return 530 -> 869, while the calls replaced in its
branch — placed at their own stated positions, never shifted — stayed at
(-124, 100) and (60, 100), left of their decision. Re-running the script
was refused (the @merge no longer matched), and shifting "consistently"
cannot fix that: the next run must move the nodes back.

Under mdl 1 every point the script states a node at — @position,
@merge, @start, a note's position:, a parameter's @position; loop bodies
skipped, their coordinates are relative — is pinned on the mutator
(MicroflowMutator.Pin), and a make-room shift (an insert, or a replace
longer than what it replaces) that would move a pinned node is refused,
naming the room it needs and the node in the way, with the two ways out:
state @position on the new statements, or leave the positions after them
unstated so they can move along. Pinning is by point, so a node a placed
fragment puts at its stated position is pinned too.

mdl 0 is unchanged (ADR-0011): there the refusal would fall back to the
whole-flow rebuild, losing the merges, curves and $IDs the shift keeps —
TestFlowModify_InsertIsSpliced, ADR-0012's headerless describe+insert
acceptance test, caught exactly that.

Fixes #1508 case 6 (mendixlabs#1598).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
versions.md enumerates what `create or modify` refuses under mdl 1 where
mdl 0 rebuilds; add the insert that needs room past a node the script
places. The review command gains the pattern that #1508 case 6 hit: a new
splice refusal changes mdl 0 into a rebuild unless it is gated on the
language version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
…ters

fix: a splice making room leaves the flow's parameters where they are (#1547)
@ako
ako merged commit 676ad81 into main Oct 22, 2026
33 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