fix: preserve annotations attached inside loop bodies#331
Open
hjotha wants to merge 2 commits intomendixlabs:mainfrom
Open
fix: preserve annotations attached inside loop bodies#331hjotha wants to merge 2 commits intomendixlabs:mainfrom
hjotha wants to merge 2 commits intomendixlabs:mainfrom
Conversation
AI Code ReviewWhat Looks Good
RecommendationApprove. The PR correctly fixes the annotation preservation issue in loop bodies with minimal, well-targeted changes and appropriate test coverage. All relevant checklist items are satisfied for this bug fix. Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
Symptom: annotations attached to statements inside loop or while bodies could disappear after describe/exec because nested annotation flows were not visible from the traversal context. Root cause: loop body builders copied only sequence flows back to the parent builder, describe collected annotation captions only from top-level objects, and loop-local annotation flows were not merged into the annotation map used while traversing loop bodies. Fix: promote nested loop annotation flows to the parent graph, collect annotation captions recursively from nested loop object collections, and merge loop-local annotations into loop body traversal. Tests: add regression coverage for an annotated nested decision built inside a loop body and for annotation flows stored directly in a loop object collection.
Contributor
Author
|
Updated the branch to also cover annotation flows stored directly inside loop object collections. Validation after the update:
|
01d88e0 to
15605e0
Compare
27 tasks
Adds an MDL script under mdl-examples/bug-tests/ exercising an annotated IF nested inside a LOOP. After exec, the describe output must contain `@annotation 'note on nested if'`, confirming the builder propagates nested annotation flows to the parent graph and the describer collects captions recursively. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
AI Code ReviewCritical IssuesNone found. Moderate IssuesNone found. Minor IssuesNone found. What Looks Good
Recommendationapprove - The PR correctly addresses the issue with minimal, well-tested changes that follow existing patterns. No blocking concerns identified. Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
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.
Part of #332.
Summary
Closes #330
Validation
go test ./mdl/executor -run 'TestLoopBodyIfAnnotationPromotedToParentFlows|TestTraverseFlow_LoopBodyUsesNestedAnnotationFlows'make buildmake lint-gomake test