Skip to content

fix(syntax): resolve statement verbs and qualified topics (mendixlabs/mxcli#1389) - #1127

Merged
ako merged 1 commit into
mainfrom
claude/charming-clarke-d60f4q
Oct 12, 2026
Merged

ako merged 1 commit into
mainfrom
claude/charming-clarke-d60f4q

Conversation

@ako

@ako ako commented Oct 12, 2026

Copy link
Copy Markdown
Owner

Fixes mendixlabs#1389.

Symptom (as reported)

  • mxcli syntax grant → Unknown topic: grant (also revoke, refresh), although grant is a listed keyword of security.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.Lookup only matched against topic paths (from the left, then any segment). It never read the Keywords each topic already carries, and a statement verb doesn't appear in any path.

Fix

  • Keyword fallback (syntax.ByKeyword): this runs last, after the path and segment matches, so it can't override them. It matches whole words only (ant is not grant), and topics that list the word on its own rank first. grant now lists security, security.entity-access, security.microflow-access, security.page-access and rest.published. I didn't add per-verb aliases: the keyword lists already exist and stay in step with their topics.
  • Qualified topic (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 microflow still lists workflow.call-microflow.
  • Match.Heading: mxcli syntax and the REPL's HELP now print the same fallback line, and it says what the fallback matched on (with keyword "grant").

Evidence

  • Control: with the fix stashed, the new tests fail with the reported text exactly:
    mxcli syntax grant reported an unknown topic:
        Unknown topic: grant
    mxcli syntax integration message-definition did not match exactly:
        No topic "integration.message-definition". Showing 1 topic(s) matching "message-definition":
    
  • Exception control: removing the workflow microflow exception makes Lookup(["workflow" "microflow"]).Path = "microflow", Exact = true, which the test catches.
  • Regression MDL: the fix(executor): check references into Protected (add-on) modules (mendixlabs/mxcli#1498) #1389 help cases are added to mdl-examples/bug-tests/syntax-1025-topic-drilldown.mdl. A new file would need a new entry in the session-command allowlists in mdl/conformance and mdl/upgrade, and both lists may only shrink.
  • Finding: .claude/skills/fix-issue/findings/cmd-mxcli/2026-10-12-mxcli-syntax-verb-keyword-qualified-topic.json.
  • Local checks: make build, make test, make lint, make check-mdl and make check-findings all pass.

Not in scope

  • The issue's suggested --search flag is a separate feature.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CkQ5WmhG8gwuMhPQQTsAJz


Generated by Claude Code

…#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
@ako
ako merged commit 9b857cf into main Oct 12, 2026
31 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.

mxcli syntax lookup misses common statement verbs (grant) and two-level names (integration message-definition)

2 participants