Skip to content

DESCRIBE emits widget-action microflow args as 'Name = value' but grammar wants 'Name: value' (roundtrip break) #640

Description

@ako

Summary

DESCRIBE of a page/snippet emits widget-action microflow/nanoflow arguments as ParamName = $value (a bare identifier followed by =), but the page-action argument grammar (microflowArgV3) accepts only:

microflowArgV3
    : IDENTIFIER COLON expression       // Param: $value   (canonical)
    | VARIABLE EQUALS expression        // $Param = $value
    ;

The emitted ParamName = $value is IDENTIFIER EQUALS — matching neither alternative (it needs either a colon, or a $ to make the LHS a VARIABLE). So the output fails to re-parse, breaking the DESCRIBE roundtrip for any action button / widget action that passes microflow parameters.

Reproduction

A button calling a microflow with a parameter describes as:

actionbutton btn (
  Caption: 'Retry',
  Action: microflow MyMod.Retry(ChatContext = $ChatContext)
)
$ mxcli check dump.mdl
  - line N:M mismatched input '=' expecting ':'

The canonical colon form re-parses:

Action: microflow MyMod.Retry(ChatContext: $ChatContext)   -- ✓

Root cause

mdl/executor/cmd_pages_describe_output.go, both extractMicroflowParameters and extractNanoflowParameters:

params = append(params, paramName+" = "+value)   // lines ~1166 and ~1227

Fix

Emit the canonical colon form: paramName+": "+value.

Note: two roundtrip_page_test.go assertions ("Product = $Product") encode the buggy output and pass without re-parsing — they should be flipped to the colon form.

Real-world trigger

describe module OntologyViewer with all — the last remaining round-trip error after #633/#634/#637/#638; with this fixed the whole module dump re-executes.

Environment

mxcli built from current main; reproduced via mxcli check.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions