fix: preserve nested loop body flow traversal#329
fix: preserve nested loop body flow traversal#329hjotha wants to merge 2 commits intomendixlabs:mainfrom
Conversation
Symptom: describe could omit loop-body continuation activities when a loop stored boundary flows locally but stored the real body continuation in the parent graph. Root cause: loop traversal preferred the loop-local origin map whenever an origin already existed there, so parent-level flows for the same origin were not merged into the loop body. Nested loop descendants also did not receive the relevant parent-level body flows. Fix: collect loop body object IDs recursively, merge missing parent-level body flows into loop-local flow maps, and choose loop body starts from the merged flow graph. Tests: add a nested-loop traversal regression where local boundary flows and parent-level continuation flows share origins.
AI Code ReviewWe are given a PR titled "fix: preserve nested loop body flow traversal" The PR summary says:
The changes are in two files:
We are to review against the provided checklist. First, note that the PR does not introduce any new MDL syntax (it's a fix to the executor's traversal logic for loops). Therefore, we skip the MDL syntax design section. Now, let's go through the checklist: Overlap & duplication
Full-stack consistency (for MDL features)Since this is a bug fix and not a new MDL feature, we do not expect changes to the grammar, AST, visitor, etc. The changes are confined to the executor. Therefore, we skip the full-stack consistency check for MDL features. Test coverage
Security & robustness
Scope & atomicity
Code quality
Bugs & correctness
Now, let's look at the changes in detail: In
In the test file:
Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
Adds an MDL script under mdl-examples/bug-tests/ exercising nested loops where the inner loop's body activities live in the parent microflow graph. The describe → exec → describe fixpoint confirms the describer merges parent-level body flows into the loop-local traversal map. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
AI Code ReviewReview SummaryCritical Issues: None
Recommendation: Approve Detailed FindingsOverlap & Duplication
MDL Syntax Design
Full-Stack Consistency
Test Coverage
Security & Robustness
Scope & Atomicity
Code Quality
ConclusionThe PR correctly addresses bug #328 by ensuring parent-level continuation flows are merged into loop-local traversal maps for nested loop bodies. The solution is minimal, well-tested, and maintains existing code quality standards. No checklist violations found. Ready for merge. Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
Part of #332.
Summary
Closes #328
Validation
go test ./mdl/executor -run TestTraverseFlow_LoopBodyMergesParentFlowsForExistingOriginmake buildmake lint-gomake test