fix: drop empty else branch from describer output#305
Open
hjotha wants to merge 2 commits intomendixlabs:mainfrom
Open
fix: drop empty else branch from describer output#305hjotha wants to merge 2 commits intomendixlabs:mainfrom
hjotha wants to merge 2 commits intomendixlabs:mainfrom
Conversation
When an ExclusiveSplit's FALSE flow jumps straight to the merge point, as the builder emits for `if X then ... end if` without an else body, the describer was still printing `else` followed by nothing. That produced a spurious empty branch in MDL output. Re-parsing normalized the branch away again, but describe/exec/describe no longer stayed byte-identical. Skip the `else` keyword when the FALSE flow's destination is the matching merge point. Explicit false-branch bodies are still emitted normally. Tests cover traversal for an IF without an ELSE body.
AI Code ReviewWhat Looks Good
RecommendationApprove. The PR resolves the issue without introducing new risks, adheres to project conventions, and includes adequate test coverage. No changes are required. Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
Adds an MDL script under mdl-examples/bug-tests/ that exercises the describe → exec → describe fixpoint for IF-without-else, plus a negative control with an explicit else body. 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. It correctly resolves the reported issue with appropriate test coverage and maintains all existing functionality. No changes are requested. Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
29 tasks
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.
Fixes #304.
Summary
DESCRIBE MICROFLOWemitted anelseline for IF statements whose false flow jumps directly to the merge point. That produced a spurious empty branch in MDL output and broke describe/exec/describe equality.Root cause
The split traversal printed
elsewhenever a false flow existed, without checking whether the false flow was only the direct split-to-merge edge that represents "no else body".Fix
Skip the
elsekeyword when the false branch destination is the matching merge point. Explicit false-branch bodies are still emitted normally.Tests
Added focused traversal coverage for an IF without an ELSE body.
Validation
make buildmake testmake lint-gomake test-integrationAgentic Code Testing
Test plan
else.