Skip to content

check: calculated attributes, calculated indexes, grid constraint literals and view entity members - #2751

Merged
ako merged 4 commits into
mainfrom
fix/check-gap-sweep5-domain
Dec 2, 2026
Merged

ako merged 4 commits into
mainfrom
fix/check-gap-sweep5-domain

Conversation

@ako

@ako ako commented Dec 2, 2026

Copy link
Copy Markdown
Owner

Check-gap sweep 5, batch B (#1258), covering f99, f100, f114, f117, f119 and f125. Three of them (f114, f117, f119) passed check -p and MxBuild 11.16.1 rejected the project. The other three (f99, f100, f125) passed check -p but exec refused them.

What check now rejects

  • MDL131, calculated attributes:
    • A calculated attribute on a non-persistent entity (exec already refused this).
    • A calculation microflow that takes another entity, takes more than one parameter, or returns another type (exec already refused this).
    • A calculation microflow the script creates only later (exec already refused this). The script is walked in statement order, as exec runs it. The message says to add the attribute afterwards with alter entity … add attribute, because the microflow takes the entity.
    • An index on a calculated attribute (CE0083).
  • Database data source constraints (check -p, CE0161): a constraint comparing an attribute with a literal of another type, such as [Qty = 'abc']. This applies the retrieve's literal-type table to pages.
  • View entities (check -p, CE0174): OQL reading a member its source entity does not have. OQL member names are case-sensitive, which was measured.

Example fixed (separate commit)

mdl-examples/bug-tests/security-524-autonumber-write-rights.mdl named a calculation microflow before creating it, so exec refused the script. It now adds the attribute after the microflow, runs through exec, and builds clean in mx.

Not fixed, found on the way

  • mdl-examples/shop/shop.mdl: its TaskQueue view entity reads pqt.status and pqt.created; the attributes are Status and Created. MxBuild rejects this with CE0174, which the new check now reports under -p. Correcting the case still leaves CE6770, so the example needs its own fix.
  • View entity column type: a view entity column declared String(100) over a String(10) source passes check and is CE6770. It is recorded in the check-gap README.

Evidence

  • Agreement: every measured case (one project per case) and all six fixtures agree with mx and exec. The new control check-gap-calculated-attributes.mdl builds clean.
  • Stub proof: switching off each check fails only its reported cases (5, 2 and 2).
  • False-positive sweep: check -p over every example script raised nothing beyond the two real defects above.
  • Local gate: make ci-local passed. After merging main, the batch tests passed again.

Generated by Claude Code

The script created the entity with `Summary … calculated by
Issue524.CALC_Summary` before creating that microflow, so exec refused it
("microflow not found"). The microflow takes the entity, so the attribute is
now added after it with `alter entity … add attribute`. The fixed script
execs and MxBuild 11.16.1 builds it clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oK82tETa46YQmMS58pQjL
…erals and view entity members

Check-gap sweep 5, batch B (f99 f100 f114 f117 f119 f125): f114 f117 f119
passed check -p and MxBuild 11.16.1 rejected the project; f99 f100 f125
passed check -p and exec refused them.

- MDL131: a calculated attribute on a non-persistent entity; a calculation
  microflow taking another entity, several parameters, or returning another
  type; a calculation microflow the script creates only later (walked in
  statement order, as exec runs); an index on a calculated attribute
  (CE0083).
- A database source constraint comparing an attribute with a literal of
  another type (CE0161), the retrieve's table applied on the page.
- A view entity whose OQL reads a member its source entity does not have
  (CE0174). OQL member names are case-sensitive, measured.

All measured cases and the six fixtures agree with mx and exec; the new
control file builds clean.

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 December 2, 2026 08:07
…domain

# Conflicts:
#	CHANGELOG.md
#	mdl-examples/check-gap/README.md
#	mdl/executor/validate_program.go
@ako
ako merged commit 13a8eee into main Dec 2, 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