Skip to content

check: type view entity columns over script-declared and inherited source attributes (CE6770) - #2760

Merged
ako merged 4 commits into
mainfrom
fix/view-column-source-types
Dec 2, 2026
Merged

ako merged 4 commits into
mainfrom
fix/view-column-source-types

Conversation

@ako

@ako ako commented Dec 2, 2026

Copy link
Copy Markdown
Owner

Found while measuring check-gap sweep 5 (#1258). A view entity column reading a source entity the same script declares, or an attribute the source inherits, was left untyped. check -p therefore passed any declared type, and MxBuild 11.16.1 reported CE6770 "View Entity is out of sync with the OQL Query."

Change

  • Script-declared sources: while check types a view entity's columns, a source entity the script declares answers from its declaration, through ExecContext.viewSourceScript, set only around validateViewEntityTypes. This follows the scriptFlows precedent.
  • Inherited attributes: the source attribute is looked up through the source's generalizations (viewSourceAttributeType). The retrieve and XPath checks keep their existing lookup.
  • Superseded declarations: only a view's last declaration in the script is judged against the script's sources. An earlier one, restated by a later create or modify, is gone before the build. 01-domain-model-examples.mdl widens a source and then the view in two steps, and judging the first step was a false positive.

Measured on MxBuild 11.16.1, one project per case

A view column must match its source attribute exactly:

  • Clean:
    • a String(100) column over a String(100) attribute
    • a String(10) column over an inherited String(10) attribute
    • a Decimal column over an inherited Decimal attribute
  • CE6770:
    • a String(50) or unlimited column over a String(100) attribute
    • a String(100) column over an inherited String(10) attribute
    • an Integer attribute declared as a String or as a Long column (Long is not a widening here)
    • an inherited Decimal attribute declared as an Integer column

Evidence

  • Agreement: all nine cases agree with mx.
  • Stub proof: with the old lookup restored, the six rejected cases pass again.
  • Example sweep: over the 35 example scripts with view entities, check -p findings are identical before and after.
  • Local gate: make ci-local passed.

Generated by Claude Code

…urce attributes (CE6770)

A view entity column reading a source entity the same script declares, or an
attribute the source inherits, was left untyped, so check -p passed any
declared type and MxBuild 11.16.1 reported CE6770 "View Entity is out of sync
with the OQL Query.". The column's source attribute is now read from the
script's declaration (while check types the view) and through the source's
generalizations. Only the view's last declaration is judged against the
script: one a later `create or modify` restates is gone before the build.

All nine measured cases agree with mx; over the example scripts the findings
are unchanged.

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 12:38
@ako
ako merged commit 99b9ab4 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