fix: pair microflow splits with nearest merge#327
fix: pair microflow splits with nearest merge#327hjotha wants to merge 3 commits intomendixlabs:mainfrom
Conversation
Symptom: sequential if-without-else structures could be described with the continuation of the first split nested inside that split. Root cause: split/merge pairing selected an arbitrary common reachable merge from map iteration, so a later downstream merge could be chosen before the immediate branch convergence. Fix: rank common merge candidates by nearest branch distance, then total distance and ID, while ignoring non-normal flows for structural pairing. Tests: add unit coverage for nearest-merge selection and for keeping the continuation after a sequential split at top level.
AI Code ReviewCritical IssuesNone found. Moderate IssuesNone found. Minor Issues
What Looks Good
RecommendationApprove. The PR correctly fixes the split/merge pairing issue with thoughtful algorithmic improvements, includes relevant regression tests, and maintains code quality. Minor cleanups (unused parameters) are trivial and do not block merging. Note: No MDL syntax changes were introduced, so syntax design and full-stack consistency checks were not applicable. Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
Adds an MDL script under mdl-examples/bug-tests/ exercising sequential if-without-else blocks. The describe → exec → describe fixpoint confirms the first split is paired with its nearest merge, keeping the ifs as siblings rather than nesting the continuation inside the first if's body. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
AI Code ReviewCritical IssuesNone found. Moderate IssuesNone found. Minor Issues
What Looks Good
RecommendationApprove. The PR correctly fixes issue #326 with appropriate tests and minimal, focused changes. No blockers identified. Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
The ctx and activityMap parameters were carried over from a sibling helper but never used by the BFS traversal. Removes them and the matching `_ = ctx; _ = activityMap` discard lines, addressing AI review feedback on PR mendixlabs#327. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
AI Code ReviewWhat Looks GoodThe PR correctly addresses issue #326 by fixing the split/merge pairing logic in the microflow describer:
RecommendationApprove the PR. The fix correctly implements the nearest-common-merge pairing logic while ignoring error-handler flows, includes appropriate test coverage, and maintains consistency with the project's architecture and coding standards. No changes to MDL syntax or full-stack feature wiring were needed since this is a behavioral fix to existing DESCRIBE functionality. Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
Part of #332.
Summary
Closes #326
Validation
make buildmake lint-gomake test