Repository navigation
fix(syntax): resolve statement verbs and qualified topics (mendixlabs/mxcli#1389) - #1127
Merged
Merged
Conversation
…#1389) `mxcli syntax grant` (also revoke, refresh) answered "Unknown topic: grant" although grant is a listed keyword of security.entity-access: syntax.Lookup only consulted topic paths, and a verb is nobody's path segment. It now falls back to the topics' keyword lists (whole words, exact keyword ranked first) after the segment match, so it cannot shadow a path hit. `mxcli syntax integration message-definition` printed `No topic "integration.message-definition"` and recovered only through the fallback. A leading word that names a topic, in front of words that name a different topic exactly, now resolves to that topic — unless the leading topic has its own segment match for the word (`workflow microflow` keeps workflow.call-microflow). The fallback heading moves to Match.Heading so `mxcli syntax` and the REPL's HELP say the same thing, and say what a fallback matched on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CkQ5WmhG8gwuMhPQQTsAJz
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.
Fixes mendixlabs#1389.
Symptom (as reported)
mxcli syntax grant→Unknown topic: grant(alsorevoke,refresh), althoughgrantis a listed keyword ofsecurity.entity-access.mxcli syntax integration message-definition→No topic "integration.message-definition". Showing 1 topic(s) matching "message-definition", which recovers only through the fallback.Cause
syntax.Lookuponly matched against topic paths (from the left, then any segment). It never read theKeywordseach topic already carries, and a statement verb doesn't appear in any path.Fix
syntax.ByKeyword): this runs last, after the path and segment matches, so it can't override them. It matches whole words only (antis notgrant), and topics that list the word on its own rank first.grantnow listssecurity,security.entity-access,security.microflow-access,security.page-accessandrest.published. I didn't add per-verb aliases: the keyword lists already exist and stay in step with their topics.qualifiedPath): a leading word that names a topic, in front of words that name a different topic exactly, now resolves to that topic as an exact match. The exception is when the leading topic has its own segment match for the word.workflow microflowstill listsworkflow.call-microflow.Match.Heading:mxcli syntaxand the REPL'sHELPnow print the same fallback line, and it says what the fallback matched on (with keyword "grant").Evidence
workflow microflowexception makesLookup(["workflow" "microflow"]).Path = "microflow", Exact = true, which the test catches.helpcases are added tomdl-examples/bug-tests/syntax-1025-topic-drilldown.mdl. A new file would need a new entry in the session-command allowlists inmdl/conformanceandmdl/upgrade, and both lists may only shrink..claude/skills/fix-issue/findings/cmd-mxcli/2026-10-12-mxcli-syntax-verb-keyword-qualified-topic.json.make build,make test,make lint,make check-mdlandmake check-findingsall pass.Not in scope
--searchflag is a separate feature.🤖 Generated with Claude Code
https://claude.ai/code/session_01CkQ5WmhG8gwuMhPQQTsAJz
Generated by Claude Code