feat: full nanoflow support — CREATE, DROP, SHOW, DESCRIBE, DIFF, MERMAID, security, and agentic skill#301
feat: full nanoflow support — CREATE, DROP, SHOW, DESCRIBE, DIFF, MERMAID, security, and agentic skill#301retran wants to merge 8 commits intomendixlabs:mainfrom
Conversation
1c71d9f to
5b17c36
Compare
AI Code ReviewWhat Looks GoodThe PR implements comprehensive nanoflow support, bringing it to full feature parity with microflows. Key strengths:
The implementation follows all MDL syntax design guidelines:
RecommendationApprove the PR. The implementation is complete, well-tested, and follows all project conventions. The nanoflow support addresses a significant gap in the feature set and enables agentic workflows for nanoflow management as intended. No blocking issues were identified. The PR is ready to merge. Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
2a0f486 to
3ff3064
Compare
- SHOW ACCESS ON NANOFLOW — query nanoflow security grants - DESCRIBE MERMAID for nanoflows via CLI --format mermaid - Nanoflow diff support — unified diff output for modified nanoflows - JavaScript action BSON parsing (read path) - NanoflowCallAction formatter for DESCRIBE output - Hard-code nanoflow $Type to "Microflows$Nanoflow" - Preserve AllowedModuleRoles through drop/recreate cycles - Validate module existence, numeric return types, empty names - Normalize empty-then branches in DESCRIBE for readable if/else - Expression spacing fix (not() parenthesization)
- Document intentional behaviors in nanoflow test plan - Add nanoflow references to ARCHITECTURE, CLAUDE, CHANGELOG - Update MDL_FEATURE_MATRIX, MDL_QUICK_REFERENCE, language reference - Add nanoflow examples to agentic skills (security, pages, validation) - Add nanoflow MDL examples to doctype-tests
- Propagate describeNanoflow errors in diff command - Match create-or-modify pattern in diff output - Add nanoflow-specific fields (@excluded, folder, comment) to MDL output - Guard empty-then swap edge case in if/else normalization - Handle missing JS action references gracefully in formatter - Harden negation expression rendering
…e fix Full pipeline for `call javascript action` syntax: - Grammar rule, AST node, visitor, builder, validator, BSON serializer - JavaScript actions allowed in nanoflows (client-side), disallowed check skips them correctly - Separate JS action reference validation from Java action validation Association retrieve roundtrip fix: - Preserve AssociationRetrieveSource on roundtrip instead of converting to DatabaseRetrieveSource with XPath for reverse traversals
3ff3064 to
74e5ea1
Compare
…ixes
- Add Nanoflow Mapping section to BSON mapping documentation
- Add create_nanoflow Go example with 4 nanoflow patterns
- Update CHANGELOG with JS action syntax and association retrieve entries
- Add nanoflow datasource option to create-page skill
- Update SDK_EQUIVALENCE nanoflow feature list
- Exhaustive nanoflow denylist test (21 disallowed + JS action allowed)
- Document denylist ordering dependency in error handling
- Fix isNumericLiteral: reject trailing dot ("5." → false)
74e5ea1 to
8b23f02
Compare
AI Code ReviewReview SummaryThis PR implements full nanoflow support in mxcli, closing a significant gap in the MDL feature matrix. The changes are thorough and follow the established patterns for MDL feature implementation. Critical IssuesNone found. Moderate IssuesNone found. Minor Issues
What Looks Good
RecommendationApprove the PR. The changes are high-quality, thoroughly tested, and fully address the nanoflow support gap. The minor test coverage gap for diff output is acknowledged in the test plan and covered by manual validation; it does not block merging given the overall strength of the implementation. No blocker issues were identified. The PR successfully enables agentic workflows to scaffold, refactor, Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
Why
Nanoflows are a core Mendix document type for mobile and offline-first apps. Until this PR, mxcli had read-only nanoflow support (SHOW, DESCRIBE) but could not create, modify, or manage nanoflows — blocking agentic workflows that need to scaffold, refactor, or secure nanoflow logic.
This gap was visible in the feature matrix: nanoflows lagged far behind microflows in every dimension. This PR brings nanoflows to full feature parity with microflows across grammar, executor, SDK, validation, visualization, and security management.
Proposal: docs/11-proposals/PROPOSAL_nanoflow_support.md
Test plan: docs/15-testing/nanoflow-test-cases.md (18 sections, 123 test cases)
What Changed
New MDL commands
CREATE [OR MODIFY] NANOFLOWDROP NANOFLOWCALL NANOFLOWCALL JAVASCRIPT ACTIONGRANT EXECUTE ON NANOFLOWREVOKE EXECUTE ON NANOFLOWSHOW ACCESS ON NANOFLOWMOVE NANOFLOWRENAME NANOFLOWDIFF(nanoflow support).mprversionsCLI enhancements
describe nanoflow --format mermaid— generates Mermaid flowchart diagrams for nanoflows (same--formatflag already supported for microflows and domain models)Validation
Type-switch validation rejects 21 actions that Mendix does not allow in nanoflows (e.g., database commit, Java actions, import/export). Entity resolver errors propagate upfront — no silent failures on invalid parameter or return types.
Bug fixes and improvements
call javascript action Module.ActionName(params)— grammar rule, parser, AST node, visitor, builder, validation, serializer. JS actions roundtrip correctly through describe → drop → create cycle.retrieve $X from $Y/Module.Associationsyntax preserved on roundtrip. Previously, the builder converted association retrieves to database retrieves with XPath constraints on reverse traversals.serializeNanoflow()was incomplete — missing ReturnType, ObjectCollection, and Flows. Created nanoflows lost their body when written to.mpr.NanoflowCallActionBSON field corrected fromResultVariableNametoOutputVariableName.$prefix.NanoflowCallActionerror handling type resolved correctly.not()expression spacing preserved on roundtrip.NanoflowCallAction.AllowedModuleRolespreserved through drop/recreate cycle.Agentic skill
New Claude Code skill at
.claude/skills/mendix/write-nanoflows.md— guides AI agents through nanoflow creation with MDL syntax, parameter types, body actions, security management, and validation rules.Shared helpers
buildEntityNamesextracted to eliminate duplication between microflow and nanoflow Mermaid rendering.serializeNanoflow()fully rewritten to serialize body, flows, return type, and parameters.Testing
Automated tests (all pass with
make build && make test && make lint-go):roundtrip_nanoflow_test.go) — CREATE, DROP, CALL, GRANT/REVOKE, SHOW, MOVE, RENAME, MERMAID, validation, error pathscmd_nanoflows_mock_test.go) — not-connected guards, duplicate handling, idempotent grant/revoke, all 21 disallowed actions, nested body validationroundtrip_test.go) — parse→serialize→parse cycle with activities, flows, and rolesManual testing: 18-section test plan (123 test cases) executed against 3 App Gallery demo projects (223 nanoflows total). All tests pass except 2 inconclusive (no test data for page integration scenarios).
Known limitations
find($x,'y')→find($x, 'y'))Documentation updated
MDL_FEATURE_MATRIX.md— nanoflow row reflects implemented stateMDL_QUICK_REFERENCE.md— added CREATE, MOVE, GRANT/REVOKE, SHOW ACCESS nanoflow syntax01-language-reference.md— added CREATE/DROP/GRANT/REVOKE nanoflow sectionsgrammar-reference.md— addedcreateNanoflowStatement,dropNanoflowStatement,callJavaScriptActionStatementPROPOSAL_nanoflow_support.md— rewritten from proposal to feature descriptionnanoflow-test-cases.md— comprehensive QA test plan (18 sections, 123 test cases)10-bson-mapping.md— added Nanoflow Mapping section with type differences, allowed actions, JS action field mappingexamples/create_nanoflow/— new Go example with 4 nanoflow patternsCHANGELOG.md— unreleased entries for all nanoflow featuresSDK_EQUIVALENCE.md— updated nanoflow CRUD feature listStats
79 files changed, +18,227 / −10,284 lines, 8 commits
Grammar → AST → Visitor → Executor → SDK → Tests → Docs — full pipeline coverage.