check: explain that XPath constraints can't compute values - #35
Merged
Conversation
ako
force-pushed
the
fix/xpath-arithmetic
branch
from
July 26, 2026 04:40
c047c69 to
766b697
Compare
`retrieve … where [Seq = $Game/MoveSeq + 1]` failed with a bare `mismatched input '+' expecting ']'`, with no hint that Mendix XPath constraints take a literal/token/variable/path on the value side — never an arithmetic expression. This is a Mendix limitation, not an mxcli bug, so adding grammar support would only let through XPath that mxbuild rejects. Add an error hint keyed on `mismatched input '<+|*|div|mod>' expecting ']'` (the `expecting ']'` shape only occurs inside a bracketed constraint) that names the limitation and the workaround: compute the value into a variable first, then compare against it. Documented in xpath-constraints.md; visitor test + negative bug-test example. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JXnEgoc2NQP1Y2TWMCMXC4
ako
force-pushed
the
fix/xpath-arithmetic
branch
from
July 26, 2026 04:58
766b697 to
f8f6f76
Compare
ako
pushed a commit
that referenced
this pull request
Jul 31, 2026
…s (TraceOps #35) CATALOG.WIDGETS records a widget's action/datasource flow (MicroflowRef / NanoflowRef), but the linter's Widget projection dropped those fields, so a custom Starlark rule could not detect e.g. a microflow-datasource ListView (no database pushdown) — a rule keyed on the flow ref returned zero hits at any threshold. Carry MicroflowRef/NanoflowRef from the catalog through the Widget struct and the Widgets() query, and expose microflow_ref / nanoflow_ref on the Starlark widget struct (mirroring entity_ref). Documented in the write-lint-rules skill's widget field table. Test: TestWidgets_ProjectsMicroflowNanoflowRef. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JXnEgoc2NQP1Y2TWMCMXC4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sudoku-app finding #8:
retrieve … where [Seq = $Game/MoveSeq + 1]fails with a baremismatched input '+' expecting ']', with no hint about the actual cause.This is a Mendix limitation, not an mxcli bug: XPath constraints take a literal / token / variable / path on the value side, never an arithmetic expression. So adding grammar support would be the wrong fix — it would let through XPath that mxbuild then rejects. The right fix (matching the finding's own framing — "the failure is a parse error rather than a message about XPath") is a clear diagnostic.
Fix
Add an error hint keyed on
mismatched input '<+|*|div|mod>' expecting ']'. Theexpecting ']'shape only occurs inside a bracketed constraint, so the signal is precise — a normal-expression arithmetic error (e.g.expecting ';') does not trigger it. The hint names the limitation and shows the workaround:Tests & docs
+/*/div/modinside a constraint and not for a normal-expression arithmetic error.f8-xpath-arithmetic.fail.mdl.xpath-constraints.mdgains an "arithmetic on value" row + workaround note;fix-issue.mdsymptom row.🤖 Generated with Claude Code
Generated by Claude Code