Skip to content

fix: suppress default anchor fragments in describe#321

Open
hjotha wants to merge 2 commits intomendixlabs:mainfrom
hjotha:submit/describer-suppress-default-anchor-fragments
Open

fix: suppress default anchor fragments in describe#321
hjotha wants to merge 2 commits intomendixlabs:mainfrom
hjotha:submit/describer-suppress-default-anchor-fragments

Conversation

@hjotha
Copy link
Copy Markdown
Contributor

@hjotha hjotha commented Apr 26, 2026

Part of #332.

Fixes #320.

Summary

DESCRIBE MICROFLOW now omits anchor fragments when all emitted sides match the MDL defaults.

Root cause

Anchor formatting printed every known from/to side even when the side matched the statement default. These explicit defaults were semantically redundant and created cosmetic roundtrip drift.

Fix

Suppress default fragments for regular flows and split branches. Non-default sides are still emitted.

This intentionally changes describe output for flows that only used default sides.

Tests

Added regression coverage for omitted defaults and non-default anchor preservation.

Validation

  • make build
  • make test
  • make lint-go
  • make test-integration

Agentic Code Testing

  • No new authoring syntax.
  • Synthetic regression coverage verifies default anchors are omitted while non-default anchors remain visible.

Test plan

  • Regular default anchors are omitted.
  • Split branch default anchors are omitted.
  • Non-default anchors are still emitted.

Symptom: microflow describe emitted explicit @anchor fragments for flows that used the MDL default connection sides, creating cosmetic drift in round-trip output.

Root cause: anchor formatting printed every known from/to side even when the value matched the statement default: regular flows use right-to-left, true branches use right-to-left, and false branches use bottom-to-top.

Fix: omit default anchor fragments and skip the annotation entirely when all sides are defaults, while preserving explicit non-default sides.

Tests: added regression coverage for omitted regular and split defaults, and adjusted existing split-anchor tests to assert that non-default branch anchors are still emitted.
@github-actions
Copy link
Copy Markdown

AI Code Review

Critical Issues

None

Moderate Issues

None

Minor Issues

None

What Looks Good

  • The PR is narrowly focused on fixing anchor fragment omission in DESCRIBE MICROFLOW output, addressing issue DESCRIBE MICROFLOW emits default anchor fragments that create cosmetic drift #320.
  • Changes are consistent: default anchor suppression applied to both regular flows (emitAnchorAnnotation) and split branches (emitSplitAnchorAnnotation).
  • Test coverage is comprehensive:
    • New tests verify omission of default anchors for regular flows and split branches
    • Existing tests updated to reflect new expected output (concurrent test, split anchor tests)
    • Non-default anchor preservation validated
  • No new MDL syntax introduced, so full-stack consistency and syntax design checklists don't apply.
  • Validation passes: make build, make test, make lint-go, make test-integration.
  • Changes follow existing code patterns (e.g., using empty string sentinel for omitted values).
  • No duplication or overlap with existing functionality.
  • Atomic scope: single concern (anchor fragment suppression) with corresponding tests.

Recommendation

Approve the PR. The fix is correct, well-tested, and maintains backward compatibility for non-default cases while improving roundtrip fidelity by omitting semantically redundant default values. No changes requested.


Automated review via OpenRouter (Nemotron Super 120B) — workflow source

Adds an MDL script under mdl-examples/bug-tests/ verifying that linear
flows produce zero @anchor lines (all defaults) while non-default
sides like `to: top` survive a describe → exec → describe cycle.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

AI Code Review

Critical Issues

None found.

Moderate Issues

None found.

Minor Issues

None found.

What Looks Good

  • Bug fix correctness: The changes correctly suppress default anchor fragments (from: right, to: left for regular flows, from: right, to: left for true branches, from: bottom, to: top for false branches) while preserving non-default annotations.
  • Test coverage:
    • Added unit tests verifying default anchors are omitted (TestEmitAnchorAnnotation_OmitsDefaultRightToLeft, TestEmitSplitAnchor_OmitsDefaultBranchAnchors)
    • Updated existing tests to reflect new expected outputs
    • Added comprehensive bug test file (mdl-examples/bug-tests/320-describer-suppress-default-anchor-fragments.mdl) with validation scenarios
  • Minimal scope: Changes are focused on exactly two helper functions (emitAnchorAnnotation, emitSplitAnchorAnnotation) and their test coverage
  • Clear intent: The PR description explicitly states this intentionally changes describe output for flows using only default sides, eliminating cosmetic roundtrip drift
  • Consistency: Applied the same default-suppression logic to both regular flows and split branches
  • Follows patterns: Uses existing helper structure and naming conventions

Recommendation

Approve. The PR correctly fixes issue #320 by suppressing redundant default anchor fragments in DESCRIBE MICROFLOW output while preserving non-default annotations. The changes are minimal, well-tested, and maintain backward compatibility for cases where non-default anchors exist. All checklist items are satisfied for this bug fix.


Automated review via OpenRouter (Nemotron Super 120B) — workflow source

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.

DESCRIBE MICROFLOW emits default anchor fragments that create cosmetic drift

2 participants