Skip to content

R3: alter sets properties in create's ( Key: value ) list; colons only where R3 puts them (#751) - #778

Merged
ako merged 4 commits into
mainfrom
feature/751-alter-set-property-list
Sep 28, 2026
Merged

ako merged 4 commits into
mainfrom
feature/751-alter-set-property-list

Conversation

@ako

@ako ako commented Sep 28, 2026

Copy link
Copy Markdown
Owner

Closes #751 (the R3 half; R4 landed in #772).

R3 of the beta syntax freeze (PROPOSAL_mdl_beta_syntax_freeze.md §3 R3, §7 item 6): : sets a model property, so an alter takes exactly the ( Key: value, … ) list its create takes, and a colon appears in a property list or an attribute definition and nowhere else.

What changes

The new canonical spelling parses under both mdl 0 and mdl 1. The old spelling keeps parsing as a registered alias (mdl/deprecation) that warns under both versions, and fmt --upgrade rewrites it. None of these changes meaning, so nothing is gated on the language version.

Code Old Canonical
MDL-DEPR060 alter settings runtime|language|workflows K = v, …, alter settings configuration 'X' K = v, create configuration 'X' K = v … ( K: v, … )
MDL-DEPR061 alter consumed|published odata service X set K = v, … set ( K: v, … ): create's own odataPropertyAssignment list, including the client's expression-typed keys
MDL-DEPR062 alter styling … set Class = 'x', 'P' = on (also set K: v without parentheses) set ( Class: 'x', 'P': on )
MDL-DEPR063 alter entity … set allow_create_change_locally = true set ( AllowCreateChangeLocally: true ), the key create external entity uses
MDL-DEPR064 association type: Reference / owner: / storage: type Reference, because a clause takes no colon
MDL-DEPR065 modify attribute A T (also modify column) modify attribute A: T
MDL-DEPR101..103 alter page/snippet/layout set K = v, set K: v, drop widget a these move into the registry (see below)

The MDL-DEPR101..103 fold-in. These moved from the executor's provisional table (mdl/executor/alter_aliases.go, now deleted) into the registry. The visitor records them with an ast.Fix, so fmt --upgrade now rewrites them, which it could not do before. The Legacy marker field on SetPropertyOp/DropWidgetOp is gone. Both spellings build an identical AST, which the registry-example test now checks with DeepEqual. The grammar markers are now /* @alias … */, so TestGrammarAliasesAreRegistered covers them. validateAlterPageAddresses moved unchanged to validate_alter_page_addresses.go.

Describe. describe settings now emits every section (runtime, configuration, language default, workflows) as the canonical list. MDL that mxcli generates now uses the canonical list too: the test runner's after-startup set/restore and the JavaVersion hints in mxcli new / docker detect.

Docs. Updated skills (.claude/skills/mendix/*, then make sync-skills), docs-site, mxcli syntax entries and docs/01-project/MDL_QUICK_REFERENCE.md. The fenced MDL code blocks were rewritten mechanically with these rewrites (parse, apply only these codes' fixes), and the tables and prose by hand. I also fixed a quick-reference row that showed a form that never parsed: modify (attr: T).

Design choices the ADRs did not settle

  • Codes 101–103 are kept, not renumbered into 06x. They shipped with the generic alter and are cited in mxcli syntax and docs-site. The registry says a code is never renumbered.
  • Settings take the list with no set: alter settings runtime ( K: v ). This follows the proposal's own After example. OData, styling and entity keep their set verb, because it is part of those statements.
  • Layout of the rewrite. For a list that starts on a new line (describe's old layout), the rewrite opens ( on the statement line and closes ) on its own line, indented like the statement. A one-line list gets ( … ). Page set keeps its tight (…), which is how existing docs spell it.
  • The association colon is only reachable in the clause form. The parenthesised association form is already refused by the visitor.
  • Studio Pro check. I did not do a Studio Pro/MCP round for this change. It is spelling only and writes the same model. The proof is the execute-both property test below, plus a local control: the old and new alter settings runtime on two PedApp copies left every mprcontents file byte-identical, and the new describe output replays cleanly with exec.

Test plan (what I ran)

  • make build, make lint (Go and TS): pass.
  • go test ./mdl/visitor ./mdl/grammar ./mdl/deprecation ./mdl/upgrade ./mdl/executor ./mdl/langver ./mdl/ast ./cmd/mxcli/...: pass.
  • go test -tags integration ./mdl/roundtrip/: pass, including TestUpgradeExecutesToTheSameModel (execute-both), the PedApp and TestApp describe canonical-spelling and terminator tests, and both round trips. It was run in three -run groups with -p 1 because the full run was OOM-killed on the shared machine. No allowlist entries were added.
  • New tests:
    • mdl/visitor/r3_property_lists_test.go: every old/canonical pair builds identical statements, only the old one records its code with a fix, and the canonical lists carry their values.
    • mdl/upgrade/r3_property_lists_test.go: exact rewrite output (inline, multi-line, indented, upper-case, and a nested R8 respelling inside a page set) and idempotence.
    • mdl/executor/cmd_settings_describe_canonical_test.go: describe output parses under no header and under mdl 1; with zero deprecations. The control is the property count and a " = " check.
  • Revert checks:
    • Stubbed recordOldList and ExitAlterStylingAction: 12 R3 pair tests and the MDL-DEPR060/061/062 registry examples fail.
    • Stubbed the canonical-list branch of eachSettingsProperty: the settings pairs and TestR3CanonicalListsCarryTheirValues fail.
    • Restored cmd_settings.go from main: the describe test fails with four MDL-DEPR060 records.

Not in this PR (follow-ups)

These are other set k = v spellings outside the issue's list:

  • alter module … add jar dependency (group = …), which is in the proposal's R3 After example
  • alter published rest service … set path = …
  • the agent-editor alters (alter model/knowledge base/consumed mcp service … set K = v, alter agent … set)
  • the bulk alter pages … set 'P' = on where …
  • set layout = M.L in alter page / alter pages

The mdl-examples scripts still use the old spellings. They now warn, and they exercise the aliases through the execute-both test.

🤖 Generated with Claude Code

ako and others added 4 commits September 28, 2026 05:44
…ere R3 puts them (#751)

R3 of the beta syntax freeze: `:` sets a model property, so every `alter`
takes the same `( Key: value, … )` list its `create` does, and a colon is
written in a property list or an attribute definition and nowhere else.

Canonical forms, parsed under mdl 0 and mdl 1; the old spellings keep
parsing as registered aliases that warn and that `fmt --upgrade` rewrites:

- MDL-DEPR060 alter settings <section> / configuration 'X' and
  create configuration: `Key = v, …` -> `( Key: v, … )`
- MDL-DEPR061 alter consumed|published odata service X set Key = v
  -> set ( Key: v, … ), exactly create's property list
- MDL-DEPR062 alter styling … set Class = 'x', 'P' = on -> set ( … )
- MDL-DEPR063 alter entity … set allow_create_change_locally = v
  -> set ( AllowCreateChangeLocally: v )
- MDL-DEPR064 association `type: Reference` / owner: / storage: -> no colon
- MDL-DEPR065 modify attribute A T -> modify attribute A: T
- MDL-DEPR101..103, the generic alter page/snippet/layout aliases, move
  from the executor's provisional table into the registry, with rewrites.

describe settings now writes the canonical lists, and the MDL mxcli
generates (testrunner, new-project hints) uses them. Docs, skills,
`mxcli syntax` and the quick reference follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…#751)

fmt --upgrade promises to keep comments, but the MDL-DEPR103, -064, -060..063
rewrites replaced whole gaps: 'drop widget -- c\n a' became 'drop a',
'type: /* c */ Reference' became 'type Reference'. A gap that holds more than
whitespace now keeps its text; only the old token goes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…list (#751)

The MDL-WIDGET renamed-property suggestion told users to write
`set 'Key' = 'Value'`, the spelling this PR deprecates as MDL-DEPR062.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ako
ako merged commit ae89cb8 into main Sep 28, 2026
31 checks passed
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.

R3/R4: one argument-binding form (Param = expr) and alter set ( Key: value ) everywhere (3.1)

1 participant