Skip to content

check: event handler signatures and attribute defaults the build rejects (MDL120, MDL121) - #2699

Merged
ako merged 2 commits into
mainfrom
fix/check-gap-domain-events
Nov 30, 2026
Merged

ako merged 2 commits into
mainfrom
fix/check-gap-domain-events

Conversation

@ako

@ako ako commented Nov 30, 2026

Copy link
Copy Markdown
Owner

Part of #1258. This is batch A of the gaps from the second check-gap parity sweep (#2698): f40, f41 and f46. Each passed check and exec, and MxBuild 11.16.1 rejected the project.

MDL120: entity event handler signature (CE7247)

  • Every handler except before create calls a microflow that must take exactly one parameter: the entity, or an entity it extends. A specialization, an unrelated entity, a primitive, a list, no parameter, or two parameters are all CE7247.
  • Every before handler (create, commit, delete, rollback) must return Boolean, with or without raise error. After handlers may return anything.
  • The microflow's signature is read from the script, then the project. One that neither declares is not judged, nor is a parameter whose entity's generalization chain can't be fully read.

MDL121: attribute default (CE7247 / CE1613)

Attribute defaults are stricter than constant defaults (MDL113). Measured accepted and rejected values:

type accepted rejected
Integer 5, -5, '+3', ' 12' 'abc', 1.5; 3000000000 is out of range
Long 3000000000 1.5, 99999999999999999999
Decimal 1.5, -2 'abc', '.5', '1,5', '1e3'
Boolean true, false, and the bare True (stored as "true") 'maybe', 'True'
DateTime 'yyyy-mm-dd', '… hh:mm', '… hh:mm:ss', '[%CurrentDateTime%]' the ISO 'T' form, an invalid date, '[%BeginOfCurrentDay%]'
String(n) up to n characters longer than n
Enumeration an existing value a missing value or wrong case: CE1613

Evidence

  • 57 cases measured on 11.16.1, one project per case. check reports MDL120/121 exactly where mx reported an error, and nowhere else.
  • validate_domain_events_defaults_test.go has the reported cases and controls. Stubbing MDL120 fails 13 subtests and stubbing MDL121 fails 20.
  • No doctype, bug-test or deprecated-alias example triggers either rule.
  • Fixtures: check-gap-events-defaults.fail.mdl gives 3× MDL120 and 4× MDL121. On that file mx shows only the CE1613, which masks the rest; without that line it shows the six CE7247s. The control check-gap-events-defaults.mdl is clean under mx.
  • Finding recorded, CHANGELOG updated, check-gap README marks f40/f41/f46. make ci-local passes.

Generated by Claude Code

…cts (MDL120, MDL121)

Check-gap sweep 2, f40/f41/f46: each passed check and exec, and MxBuild
11.16.1 rejected the project.

MDL120: a handler's microflow must take exactly one parameter, the entity or
an entity it extends (none for before create), and every before handler
must return Boolean (CE7247).

MDL121: an attribute default the type does not accept (CE7247), or an
enumeration value the enumeration does not have (CE1613).

Each rule is measured one project per case; all 57 measured cases agree
with mx.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oK82tETa46YQmMS58pQjL
@ako
ako marked this pull request as ready for review November 30, 2026 21:41
@ako
ako merged commit c02b164 into main Nov 30, 2026
19 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.

2 participants