Skip to content

Default-language captions (CE4899), drop names lost grants, theme names unvendored fonts (#944 items 2-4) - #948

Merged
ako merged 15 commits into
mainfrom
fix/944-captions-drop-fonts
Oct 3, 2026
Merged

ako merged 15 commits into
mainfrom
fix/944-captions-drop-fonts

Conversation

@ako

@ako ako commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Part of #944 — items 2, 3 and 4 (items 1 and 5 are another group's).

Item 2 — CE4899: a required caption with no text in the default language

Measured first (fresh 11.14.0 app, cached mxbuild): a page title, tab page caption, group box caption, action and link button captions, data grid column header, input labels, dynamic text, title widget, enumeration value captions, a navigation menu item and a show-message text were written en_US-only; the default was then switched to de_DE (once with en_US still enabled, once with it dropped). mx check reported CE4899 only on the tab pages (both runs: the new tpA and the stock Administration.Account_Overview tabPage2). A snippet's tab page fails too; the 22 en_US-only tab pages in Atlas_Web_Content's page templates / building blocks are not checked by mxbuild. So only Forms$TabPage.Caption in pages, snippets and layouts is flagged.

How mxcli writes a caption literal: into the project's default language (authoringLanguage, #970) — so a script's own captions are fine unless the script changes the default. That surfaced a real bug: the authoring language was cached once per session, so a page created after alter settings language (DefaultLanguageCode: 'de_DE') in the same script was still written in en_US and failed the build (measured: tpAfter CE4899). Fixed — the cache is dropped when the default changes.

  • (a) lint rule QUAL006 (RequiredCaptionMissingDefaultLanguage, error): reads the stored units through the backend, so it does not depend on refresh catalog full. (Note: mxcli lint's built-in list never included QUAL005 at all — only the REPL lint ran it; left as is, see follow-up.)
  • (b) check -p → MDL-I18N01 for a script that changes the default: stored tab captions, plus tab pages a create page/snippet wrote before the change; a document created/altered/dropped after the change is not reported.
  • (c) alter settings language (DefaultLanguageCode: …) prints how many required captions lack the new default, lists up to 10, and names the fixing statement (alter page P { set (Caption: '…') on tabPage2; };).
  • Shared core: translations.MissingRequiredCaptions (+ Site.OwnerName).

mx check evidence (11.14.0, scratch app):

Scenario mx check mxcli
stock app, de_DE default, en_US dropped 1× CE4899 (tabPage2) lint QUAL006: 1 error (tabPage2) — before the template filter it said 23
same, control: pristine en_US app 0 errors lint QUAL006: no issues
script: snippet + page before switch, page after 3× CE4899 (tpSnip, tabPage2, tpBefore) — tpAfter was a 4th before the cache fix check -p: 3 MDL-I18N01 errors (same three); exec note: same three
after alter page/snippet … { set (Caption: …) on … } for each 0 errors lint QUAL006: no issues

Item 3 — drop names the grants it removes

drop microflow, drop nanoflow and drop page now print the removed module roles, whether a create carries them (flows: only later in the same script/session; a page never — it is not remembered), and the grant that restores them. Snippets have no access roles. The splice-refusal message now says to drop and create in the same script, and why; the write-microflows (via reference/pitfalls.md, SKILL.md is held to 700 lines) and write-nanoflows skills say the same. Verified on the scratch app: drop microflow MyFirstModule.DoIt prints Removed its execute grants to MyFirstModule.User ….

Item 4 — theme create --from names unvendored fonts

The primary (first) family of each seeded --mxt-font* stack that the base theme does not load with @font-face is reported (CreateResult.UnvendoredFonts) and printed as a note naming mxcli-fonts/ and the partial. Generic stacks (system-ui, sans-serif, …) and vendored families are silent. Verified: theme create acme --from design.css with "Inter", system-ui, sans-serif prints the note.

Test plan

  • make build, make lint, make check-conformance, make check-findings, make check-skill-mdl, make check-mdl
  • go test ./mdl/executor/ ./mdl/catalog/ ./mdl/translations/ ./mdl/linter/... ./cmd/mxcli/... — all pass
  • New tests: mdl/translations/required_test.go, mdl/linter/rules/required_captions_test.go, mdl/executor/default_language_captions_test.go, mdl/executor/drop_grants_note_test.go, flow_verdict_test.go (refusal text), cmd/mxcli/theme/create_seeded_test.go (TestCreate_NamesSeededFontsItDoesNotVendor), each with controls (en_US present / no switch / rewritten after the switch / no grants / vendored font / generic stack)
  • Revert checks (fix removed → test fails with the symptom, restored → passes):
    • fonts: dropping res.UnvendoredFonts = … → UnvendoredFonts = [], want [Inter]
    • drop: removing the three writeDroppedGrantsNote calls → all three drop tests fail
    • (c) removing the note → TestAlterDefaultLanguage_ReportsRequiredCaptionsWithoutIt fails
    • cache: removing the authoring-language reset → TestAlterDefaultLanguage_NewTextsUseTheNewDefault fails (and tpAfter CE4899 in the mx check run)
    • (b) disabling CheckDefaultLanguageCaptions → TestCheckDefaultLanguageCaptions fails
    • lint: the end-to-end count against mx check (23 → 1 after skipping templates) was the control for the unit-type filter
  • Findings appended (cmd-mxcli, mdl-executor ×2); CHANGELOG entries under Unreleased; docs: builtin-rules.md (QUAL006, MDL-I18N01), error-messages.md (MDL-I18N01), mxcli syntax settings.alter text corrected (it said mx check is 0 errors either way).

Follow-up (not done here)

  • mxcli lint (CLI) does not run QUAL005 at all — only the REPL lint does. Adding it changes what every project reports, so it is a decision, not a fix.
  • MDL-I18N01 does not model an alter page … set Caption issued before the switch, or a create that carries a stored translation in the new default; both would only make it over-report on unusual scripts.
  • Layout tab pages are flagged by the shared check (pages/snippets/layouts) but only page and snippet were measured; no alter layout exists, so the suggestion points at Studio Pro.

🤖 Generated with Claude Code

ako and others added 15 commits October 3, 2026 11:39
Part of #944 (item 4).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
drop microflow/nanoflow/page print the removed roles, whether a create
carries them (same script or session for flows, never for a page) and
the grant that restores them. The splice refusal and the flow skills say
to drop and create in one script.

Part of #944 (item 3).

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

A call passing the task to a callee that claims it — created in the script,
or stored (exec -p / check -p via StoredTaskClaimViolations) — counts as a
claim; nested calls recurse with a depth limit. An unresolvable callee is a
possible claim.

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

check connects to the project before the semantic report and applies the
DropSettledCommitNotes filter exec's preflight applies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mxcli test no longer warns MDL-DEPR001 / MDL-V1-SLASH about its own script.

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
write-microflows/SKILL.md is held to 700 lines; the advice to drop and
create in one script lives in reference/pitfalls.md with a one-line link.

Part of #944 (item 3).

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

Measured on 11.14: of eleven caption kinds written en_US-only, a switch of
the default to de_DE fails the build (CE4899 "Empty caption") only on tab
page captions, in pages, snippets and layouts (not page templates or
building blocks).

- lint rule QUAL006 lists each one (error)
- alter settings language (DefaultLanguageCode: ...) prints them
- check -p reports MDL-I18N01 for a script that changes the default
- the cached authoring language is dropped when the default changes, so
  a page created after the switch in the same script uses the new one

Part of #944 (item 2).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nt diff (#942)

`commit … with events` never matched its stored bare commit: matchValue
compared MfCommitStmt.ExplicitWithEvents, which only records that the
redundant clause was written. An unchanged re-run re-spliced the commit, and a
loop-body change next to it made a run of two that bypassed the loop-body
refusal, rebuilding the loop with new $IDs under mdl 1.

The audit found the same class in InheritanceSplitStmt.LegacyCaseKeyword /
LegacyElseKeyword (skipped as spelling fields) and in an empty `else`
(IfStmt.HasElse), which canonicalFlow now drops since describe never prints
one. `without events` is still compared.

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

The sameLoopShell refusal was asked only when one declared statement met one
stored one. A loop-body change beside another real change (a commit gaining
`without events`) made a longer run, which was replaced: the loop rebuilt
with new $IDs under mdl 1, where the same change alone is refused.

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

A loop's object collection holds no flows; Mendix stores them all in the
microflow's collection. droppedMergeWarnings recursed with the loop's own
collection, so every in-loop merge had in-degree 0 and the merge closing an
`if` at the end of a loop body was reported as one describe -> exec deletes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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