Skip to content

fix: address PR #28 review follow-ups - #48

Merged
ako merged 2 commits into
mainfrom
fix/pr28-followup
Mar 28, 2026
Merged

fix: address PR #28 review follow-ups#48
ako merged 2 commits into
mainfrom
fix/pr28-followup

Conversation

@ako

@ako ako commented Mar 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fix gallery .mxcli/widgets/gallery.def.json to match embedded definition: FILTERSPLACEHOLDERFILTER, add missing "default": "Single" for itemSelection
  • Log LoadUserDefinitions errors in cmd_widget.go and lsp_completion.go instead of silently swallowing
  • Translate Chinese headers in design doc to English

Test plan

  • make build — compiles clean
  • make test — all tests pass
  • Verified gallery defs match between embedded and project-level

🤖 Generated with Claude Code

ako and others added 2 commits March 28, 2026 08:56
Load mermaid v11 from CDN and render ```mermaid code blocks client-side.
No build dependency needed — works with existing CI workflow.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix gallery .mxcli/widgets/gallery.def.json: FILTERSPLACEHOLDER → FILTER
  to match embedded def and DESCRIBE output
- Fix gallery .mxcli/widgets/gallery.def.json: add missing "default": "Single"
  for itemSelection to match embedded def
- Fix cmd_widget.go: log LoadUserDefinitions errors instead of swallowing
- Fix lsp_completion.go: log LoadUserDefinitions errors instead of swallowing
- Translate Chinese headers in design doc to English
- Fix FILTERSPLACEHOLDER → FILTER in design doc examples

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ako
ako merged commit 62196a2 into main Mar 28, 2026
8 of 10 checks passed
@ako
ako temporarily deployed to github-pages March 28, 2026 09:27 — with GitHub Actions Inactive
ako pushed a commit that referenced this pull request Jul 29, 2026
Ledger finding #48 reported "association navigation must be the whole RHS or it
fails CE0117". Verification against mx check (11.12.1, ~15 isolation cases)
disproved that rule — `'x' + $obj/Assoc/Attr`, `toString(..) + $obj/Assoc/Attr`,
and a bare `set $x = $obj/Assoc/Attr` all build clean. The real trigger is
narrower: a RENDER function (formatDateTime/formatDecimal/…) that takes, or
co-occurs with, an association-navigated value:

  formatDateTime($obj/Mod.Assoc/Date, 'd MMM')             -> CE0117
  formatDateTime($obj/Date, 'd MMM') + $obj/Mod.Assoc/Name -> CE0117

while `formatDateTime($obj/Date, …)` (plain member access) is fine.

MDL050 flags a set/declare/return value that contains BOTH a `format*`-family
call AND an AttributePathExpr with a module-qualified (association) segment. The
curated function set (formatDateTime/DateTimeUTC/Decimal/Float/Boolean) means no
false positives — toString/length + assoc-nav build clean and are not flagged;
an untested render fn is a conservative miss. Fix: materialize the associated
value into a variable first. `make check-mdl` shows no existing example regressed.

Test: TestValidateMicroflow_FormatWithAssociation. Repro:
ledger-48-format-with-association.fail.mdl. Symptom table records the corrected
rule + the lesson (reproduce the passing neighbours, not just the failing case).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JXnEgoc2NQP1Y2TWMCMXC4
ako pushed a commit that referenced this pull request Jul 29, 2026
…edger #48 root cause)

`$T/Mod.Assoc/Attr` in a microflow expression (Change Variable, if-condition,
return) passed mxcli check but mx check rejected it with CE0117. Mendix
expression syntax needs the target-entity step in the path
(`$T/Mod.Assoc/Mod.Entity/Attr`), which the builder inserts via
resolveAssociationPaths — but two bugs skipped that insertion:

1. shouldPreserveExpressionSource treated a `.` preceded by a digit as a
   decimal literal, so a module/entity name ending in a digit (`L48.`,
   `Account2.` — very common) froze the whole expression's source and
   bypassed association resolution, writing `$T/L48.Assoc/Attr` with no
   entity step.
2. A legitimately source-frozen expression (a real decimal literal or
   preserved whitespace) also bypassed resolution, so an association nav
   co-occurring with a decimal (`$T/Mod.Assoc/Bal + 2.0`) broke even for
   non-digit modules.

Fixes:
1. A `.` is a decimal point only when its adjacent digit run is a standalone
   number — not when the preceding token contains a letter or underscore (a
   qualified-name segment). New dotIsQualifiedNameSeparator distinguishes
   `L48.Transaction` (name) from `2.0` (decimal).
2. For a source-preserved expression, rewrite association paths inside the
   raw source: for each AttributePathExpr, compare its rendered form before
   and after resolution and ReplaceAll in the source when they differ. This
   keeps decimal/whitespace fidelity while inserting the entity step.

Verified with mx check on Mendix 11.12.1: 0 errors for plain
attribute-over-association navigation, an if-then-else enum comparison over
an association, and an association nav mixed with a decimal literal — all
previously CE0117.

Example: mdl-examples/bug-tests/ledger-48-assoc-nav-digit-module.mdl.
Test: TestShouldPreserveExpressionSource_Decimals extended with
digit-ending qualified-name cases.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JXnEgoc2NQP1Y2TWMCMXC4
ako pushed a commit that referenced this pull request Jul 29, 2026
MDL050 flagged expressions combining a format function with an association
navigation (e.g. formatDateTime($obj/Mod.Assoc/Date, …)) as CE0117. Once the
real #48 root cause was fixed — association navigation dropped its
target-entity step — re-verification against mx check on 11.12.1 showed the
rule's premise was wrong on both of its cases:

- formatDateTime($obj/Assoc/Date, …) now builds CLEAN (it only failed because
  the entity step was missing, which affected ALL association navigation, not
  just inside format calls). MDL050 was rejecting valid code.
- formatDecimal($x, 2) fails CE0117 even on a PLAIN local decimal with no
  association — a formatDecimal-signature bug, unrelated to associations.

So the "format-function + association" correlation was an artifact of two
independent bugs, neither about format functions. Removed the check, its call
sites, its test, and its bug-test.

The remaining real issue — formatDecimal($x, precision) failing CE0117
regardless of associations — is a separate open finding (likely a wrong
function signature/arity) to investigate and fix in the executor or the
function-name checker.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JXnEgoc2NQP1Y2TWMCMXC4
ako pushed a commit that referenced this pull request Jul 30, 2026
…ll gaps (FINDINGS #42/#36/#23/#48/#47)

- #42 DESCRIBE WORKFLOW dropped the `with (...)` param mappings: the modelsdk read
  path built a CallMicroflowTask with only Microflow+Outcomes and never populated
  ParameterMappings, so describe→drop→exec silently lost the mapping (which nothing
  then reports). Added microflowParamMappingsFromGen and wired it into both the
  CallMicroflowTask and CallMicroflowActivity read cases; the legacy sdk/mpr parser
  already read them. Round-trip test added; verified `describe workflow` now emits
  `call microflow M.ACT_Do with (Item = '$workflowContext')`.
- #36 SEC005 lint suggested `ALTER PROJECT SECURITY STRICT MODE ON`, a statement the
  parser doesn't implement. Strict mode is Studio Pro-only — the suggestion now says
  so instead of naming an unrunnable command.
- #23 documented `create or modify association` (the idempotent form) in the
  domain-model skill: plain `create association` is not idempotent and its failure
  aborts the rest of the script.
- #48 documented `set task outcome $Task '<Outcome>'` (there is no `complete task`)
  and the other workflow task statements in write-workflows.
- #47 documented that System-module enumerations are read from the runtime, not the
  .mpr, so mxcli can't resolve them — constrain on an attribute instead.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JXnEgoc2NQP1Y2TWMCMXC4
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.

1 participant