fix(check,describe,lsp,lint): #962 — CE0109 on void call outputs, flow-wide duplicate warning, LSP void calls, MPR010 on native - #967
Merged
Conversation
…structure and the catalog (#963) list workflows and show structure recursed over outcome flows only and skipped boundary-event flows and event sub-processes, so TestApp Workflow1 listed 5 activities where the catalog counted 8. The catalog's walk moves to wfnames.WalkActivities/CountActivities and all three use it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, CE0109) A call to a void Java/JavaScript action keeps its output name and declares nothing (#953), so reading the name is CE0109 "Undefined variable" in mxbuild 11.13.0. check now reports it for microflows and nanoflows when the script or the project says the action is void. The void resolver returns whether it knows the action, so an unresolvable call is never reported. Part of #962 (item 1). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…g create/change (#963) commit $Order on a loop variable wrote no refs row because refs had no commit kind. A commit action, or a create/change with commit Yes/YesWithoutEvents, now emits FLOW -> ENTITY 'commit', resolved through the same intra-flow variable map as change/delete. It stays out of the analysis graph and the caller kinds. The ref_kind skill test now reads every RefKind constant, so a new kind cannot ship undocumented. Catalog schema version 19. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The same output name in each if/else branch, or inside a loop and again after it, is CE0111 in mxbuild 11.13.0. describe only warned when one assignment reached the other, so it treated branches and loop bodies as scopes. Count names over the whole flow instead; void calls stay excluded. The test that pinned branch scoping now asserts the warning. Part of #962 (item 2). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The language server ran the flow rules without a project, so two calls to a stored void action with the same output name were flagged MDL063. It now uses executor.FlowRules: actions resolve through the script and the workspace project, an unresolvable action is treated as possibly void (for MDL063 only, never MDL093), and project answers are cached for 30s between keystrokes because one read costs ~300ms on PedApp. Part of #962 (item 3). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tion widgets_data gains ParentWidgetId (nearest indexed ancestor, so skipped wrappers, layout grid rows/columns, tab pages and pluggable property / object-list items are transparent), Depth (0 at the page or snippet root; a list view template is a level), Class, Style, DynamicClasses, ActionType (raw $Type of Action, else OnClickAction, else ClickAction) and HasConfirmation (ConfirmationInfo on a microflow/nanoflow/workflow call). Catalog schema 19. Tested on hand-built shapes and on Studio Pro-authored TestApp pages. mendixlabs#1268 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…gets() widgets() structs gain parent_widget_id, depth, class_name, style, dynamic_classes, action_type, has_confirmation and page_ref. mendixlabs#1268 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The widget table moves to write-lint-rules/catalog-tables.md (SKILL.md was over the 700-line bound) with an example rule for inline styles, a class allow-list and direct delete buttons. The vocabulary test scopes action_type per section (activity vs widget), holds documented widget action types to codec-registered storage names, and pins that only flow calls carry a ConfirmationInfo. mendixlabs#1268 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ction' into c24-965 # Conflicts: # CHANGELOG.md # mdl/catalog/tables.go
#963's commit refs and mendixlabs#1268's widget columns both bumped 18 -> 19 on parallel branches. A cache built at 19 by either alone would never rebuild for the other, the 15/16 collision again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The TUI checker (after every change) and the eval runner's mx_check ran a plain `mx check <project>`, which writes theme-cache/web/ and deployment/sass/ into the project. Measured with mx 11.14 on a v1 and a v2 copy of the testapp: the model is left alone, those two folders are added. New docker.MxCheckOnCopy runs `mx check` on copyProjectToTemp's copy (the #956 helper, renamed now that it is not check-only) with output paths rewritten to the project's, and applies PrepareMxCommand, which these two callers lacked. mxCheckCmd takes extra args for the TUI's -j/-w/-d. Part of #961. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tory `docker build` (and docker run / reload, which call it) ran update-widgets on the project under a snapshot that restored only MPRv2 storage, then mx check and MxBuild on the project itself. Measured on the 11.14 testapp: an MPRv1 .mpr was rewritten, every MPRv2 .mxunit was rewritten and put back with new mtimes, and theme-cache/, deployment/, 160 javasource/ proxies, the .launch file, .classpath and .project were written into it. buildOnCopy now runs all three tools on one copyProjectToTemp copy and writes only the PAD output directory (absolute, default .docker/build). MxBuild still sees the widget-normalised model, from the copy. The PAD differs from an in-place build in the same 9 files in which two in-place builds of identical copies differ (cache-bust stamps, operation ids, native metro paths), and the rebuild time is unchanged (58s vs 59s). runUpdateWidgets (the v2 snapshot) has no caller left and is removed with its tests; build_readonly_test.go covers v1 and v2 with stub tools, and TestBuild_LeavesProjectUntouched with real mx and MxBuild. Part of #961. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…c24-966 # Conflicts: # CHANGELOG.md
The layout-grid advice is about Bootstrap label/input columns, which a native page does not have. Measured on mxbuild 11.13.0 (PedApp copy): a bare form DataView on a NativePhone_Default page, or in a native snippet, builds clean, and wrapping it in a layoutgrid as advised is CE6858. lint skips pages on a native layout (LintContext.NativePages, so the rule now declares CatalogFull) and snippets of Type Native; check -p asks the project whether a reported page's layout is native. Part of #962 (item 4). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without checkCmd.InheritedFlags() the test only saw the project when another test had merged the flags first. Part of #962. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… c24-967 # Conflicts: # CHANGELOG.md
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.
Closes #962. All four items.
Measurements (mxbuild 11.13.0, PedApp copy,
exec --no-checkthendocker check, compared with the baseline error list)$V1 = …, thenlog … + $V1$V3 = …(storedJS_RevokeUploadedFileFromMemory), then$V3as a call argument$V2 = …, thenlog … + $V2$V4 = …,declare $V4 …, then a read$Rin each if/else branchretrieve $Tin each if/else branch$Linside a loop, and again after itAtlas_Core.NativePhone_DefaultpageAtlas_DefaultpageNative(raw-patched from Web)1.
checkreports a read of a void call's output name (MDL093)A new rule,
checkVoidCallOutputUse, runs for microflows and nanoflows. It reports a name if three things hold: the only thing naming it is a call known to be void (from the script, or from the project with-p), nothing else in the flow defines it (a parameter, a declare, or a non-void producer, anywhere in the flow), and the flow reads it. It reports each name once, as an error that names CE0109.The void resolver now returns
voidness{void, known}instead of a bool. An unresolvable action is never reported as MDL093, whatever the duplicate-name policy says. Severity is error, soexecrefuses it through the sharedValidateProgram.Note: I picked rule ID MDL093 as the next free one. A parallel PR may pick the same ID.
2. describe's duplicate-output warning is flow-wide
duplicateOutputVariableWarningsnow counts non-void output names over every object collection, loop bodies included, and warns for any name that is created twice. The reachability walk is gone, and #710's cost concern goes with it because the count is linear (the 120-diamond test still passes). Void calls are still excluded.TestFormatMicroflowActivitiesDoesNotWarnForExclusiveBranchOutputspinned the old scoping. It is now…WarnsForExclusiveBranchOutputs, and there is a new loop-body test. On the scratch app, describe now warns for the three CE0111 microflows above. Every Studio Pro-authored microflow and nanoflow in PedApp still describes without the warning.3. The LSP resolves void action calls through the project
runSemanticValidationusedexecutor.ValidateMicroflow/ValidateNanoflow, which pass a nil resolver. It now uses the newexecutor.FlowRules(NewFlowRules(prog, s.findMprPath(), s.codeActions)):CodeActionCache).checkkeeps the strict reading from #958: an unresolvable call still counts as a declaration. The issue text says "ascheckdoes", butcheckdoes not treat unknown as void. I leftcheckas it is, since #958 chose that deliberately to avoid hiding a real CE0111.4. MPR010 on native pages
The advice does not apply, as the measurements above show.
LintContext.NativePages()and snippets whose storedTypeisNative. The rule now declaresRequiredCatalogMode() = CatalogFull, becauseLayoutRefis only recorded by a full build. A defaultlintalready builds full because of MPR012.NativePagesis added to the catalog-mode guard list, so a future rule that reads it without declaring full fails the test.ValidatePageLayoutGrid(prog, nativeLayout). With-p, it asks the project (layoutIsNative) whether a page's layout is native, and only for a page that has something to report. Without a project it warns as before.Test plan
mdl/executor/validate_void_call_output_test.go: MDL093 table with controls (non-void, declare, parameter, unresolvable, unread), plus possibly-void vs known-voidcmd/mxcli/check_void_calls_test.goTestCheck_ReadOfAStoredVoidCallOutput: PedApp stored void JS action, Boolean and unresolvable controlscmd_microflows_duplicate_output_test.go: branches and loop bodycmd/mxcli/lsp_void_calls_test.go: PedApp, with and without a project, Boolean control, MDL093 only with the projectTestCodeActionCache_SharesProjectAnswersAcrossRunsmdl/linter/rules/dataview_layout_grid_test.goTestDataViewLayoutGridRule_SkipsNativePagesAndSnippets: real catalog plus a raw-unit reader, with web page and web snippet controlsvalidate_page_layout_test.goTestValidatePageLayoutGrid_SkipsNativeLayoutscmd/mxcli/check_native_layout_grid_test.go: PedAppcheck -pduplicateOutputVariableWarnings(both describe tests fail)ValidateMicroflow/ValidateNanoflow(3 assertions fail)unknownIsVoidline (no-project assertion fails)RequiredCatalogMode(each fails its test, the last via the catalog-mode guard)projectNativeLayouts→ nil (cmd test fails)check -preports MDL093 for the CE0109 flows only.lint --rules MPR010reports only the web page, and also the snippet once it is flipped back to Web.make build,go test ./mdl/executor/ ./mdl/linter/... ./cmd/mxcli/,make check-conformance,make lint,make check-findings,make check-skill-mdl,make sync-skillsFindings appended to
mdl-executor.jsonl(items 1 and 2),cmd-mxcli.jsonl(item 3) andmdl-other.jsonl(item 4). CHANGELOG has entries under Unreleased / Fixed.Not done
check-mxbuild-drift.md) is not re-synced.🤖 Generated with Claude Code