Skip to content

fix: skip reference checks for excluded microflows#313

Open
hjotha wants to merge 2 commits intomendixlabs:mainfrom
hjotha:submit/validate-skip-excluded-microflows
Open

fix: skip reference checks for excluded microflows#313
hjotha wants to merge 2 commits intomendixlabs:mainfrom
hjotha:submit/validate-skip-excluded-microflows

Conversation

@hjotha
Copy link
Copy Markdown
Contributor

@hjotha hjotha commented Apr 26, 2026

Part of #332.

Fixes #312.

Summary

Reference validation now skips excluded microflows. Included microflows are still validated normally.

Root cause

The validator walked every microflow body and collected missing microflow/page/java-action references without considering the microflow's excluded flag.

Fix

Skip reference collection for excluded CreateMicroflowStmt values. This aligns validation with writer behavior and Studio Pro's treatment of excluded documents.

Tests

Added paired regression tests:

  • Excluded microflow with a missing call passes reference validation.
  • Included microflow with the same missing call still reports an error.

Validation

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

Agentic Code Testing

  • No new authoring syntax.
  • Synthetic validation coverage verifies excluded microflows do not create false positives.

Test plan

  • Excluded stale references are ignored.
  • Included stale references remain errors.

Studio Pro allows excluded documents to keep stale references because they are not part of the runnable app.

The reference validator still walked excluded microflow bodies and reported missing microflow, page, or java-action references. That made project audits fail on intentionally excluded legacy scaffolding instead of actionable included-model errors.

Skip reference collection for excluded `CreateMicroflowStmt` values while keeping included microflows validated normally.

Tests cover both sides: excluded missing references are ignored, and included missing references still report errors.
@github-actions
Copy link
Copy Markdown

AI Code Review

Critical Issues

  • None found

Moderate Issues

  • None found

Minor Issues

  • None found

What Looks Good

  • The fix correctly addresses the root cause by skipping reference validation for excluded microflows in validateMicroflowReferences.
  • The regression tests are well-structured and cover both scenarios (excluded microflow should pass, included microflow should fail).
  • The change is minimal and focused, aligning with the project's atomicity principle.
  • The comment explains the rationale clearly, referencing Studio Pro behavior.
  • No MDL syntax changes were made, so syntax design and full-stack consistency checks are not applicable.
  • All validation steps pass (make build, make test, etc.) as indicated in the PR.
  • The fix does not introduce duplication or overlap with existing functionality.

Recommendation

Approve the PR. The change is correct, well-tested, and maintains consistency with the project's architecture and guidelines. No further action is required.


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

…tion

Adds an MDL script under mdl-examples/bug-tests/ pairing an excluded
microflow with a broken call against an included microflow with a valid
call. `mxcli check --references` must pass; removing `@excluded` makes
the same script surface the broken call as an error.

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

  • The PR correctly addresses the root cause by adding an early return for excluded microflows in validate.go.
  • The bug test file (mdl-examples/bug-tests/312-validate-skip-excluded-microflows.mdl) is well-documented and follows the project's bug test conventions.
  • The unit tests in bugfix_regression_test.go cover both the fixed behavior (excluded microflows skip validation) and the negative case (included microflows still validate).
  • The change is minimal, scoped to a single concern, and aligns with Studio Pro's behavior.
  • All validation steps (make build, make test, make lint-go, make test-integration) pass per the PR.

Recommendation

Approve the PR. The fix is correct, well-tested, and maintains consistency with the project's architecture and guidelines. No changes are needed.


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.

Reference validation reports stale references inside excluded microflows

2 participants