RFC: Self-describing syntax feature registry for LLM-friendly help discovery#172
RFC: Self-describing syntax feature registry for LLM-friendly help discovery#172engalar wants to merge 6 commits intomendixlabs:mainfrom
Conversation
…y help discovery Current help system is flat (26 monolithic .txt topics) with no drill-down, no structured output, and no way for LLMs to bridge from business concepts to MDL syntax. Proposes a SyntaxFeature registry where each syntax construct self-registers with metadata (path, summary, keywords, example), enabling: - `mxcli syntax --json` for one-shot LLM discovery - Hierarchical drill-down (workflow → user-task → targeting) - Single-file changes when adding new features
c7e5398 to
06afead
Compare
AI Code ReviewWhat Looks GoodThe proposal document is well-structured and addresses a genuine pain point: the flat, monolithic help system that hinders LLM discovery and hierarchical navigation. The design thoughtfully considers:
The document clearly articulates the problem, solution, trade-offs (registry vs enhanced .txt files), and implementation path. It aligns with the project's goals of improving LLM-friendly tooling while maintaining usability for human users. RecommendationApprove - This is a well-considered RFC/proposal document that requires no code changes at this stage. The design is sound, addresses real user needs, and follows appropriate processes for proposing significant enhancements. No issues were found in the proposal itself that would block moving forward to implementation phases. When the actual implementation occurs in subsequent PRs, it will need to undergo full checklist review for MDL syntax changes (particularly the Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
Registry core with workflow (12) and security (8) features registered, --json output, hierarchical drill-down, legacy .txt fallback. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
95 features registered across 7 domain files: domain-model (18), microflow (13), page/snippet/fragment (16), navigation/settings/misc (12), integration/odata/rest/sql/xpath (20), workflow (12), security (8). Legacy topic aliases map old names to new registry paths. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
HELP WORKFLOW; HELP WORKFLOW USER TASK; HELP SECURITY ENTITY ACCESS; all now query the syntax feature registry. Greedy path resolver merges space-separated words into hyphenated registry paths. Grammar extended: helpStatement accepts optional identifierOrKeyword*. AST HelpStmt gains Topic []string field. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Delete 25 .txt files, embedded FS, switch statement, showKeywords/ showTypes/showDeleteBehaviors functions, and reservedKeywords/ attributeTypes/deleteBehaviors data. All topics now served from the syntax feature registry with full alias map for backward compat. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Implementation Complete — Syntax Feature RegistryAll 4 phases from the proposal are now implemented and verified. What was built
Feature inventory: 99 features across 21 domains
Test report — 18 scenarios, all passing
Key design decisions
Typical LLM flow# 1. Get full index (cache in context)
mxcli syntax --json
# 2. Match keywords → find relevant path
# 3. Drill down for detail
mxcli syntax workflow user-task targeting --json |
Drill-Down Evidence: From Business Question to Exact SyntaxEach scenario starts from a vague business question. The user doesn't know the registry path — they discover it step by step. Chain A: "Who can approve this user task?"Step 1 — Don't know where to start → Step 2 — Enter workflow → Step 3 — Drill into user-task → Step 4 — Get the answer → 4 steps: vague question → topic → sub-topic → exact syntax with working example. Chain B: "How do I grant a role access to entity data?"Step 1 → Step 2 → 2 steps. The summary line "Grant or revoke entity-level access" is enough to identify the right feature. Chain C: "Import data from an external database into Mendix"Step 1 → Step 2 → 2 steps. Summary lines are the discovery mechanism — no need to know the path upfront. LLM flow (programmatic)LLMs don't drill down interactively. They get the full index in one call: mxcli syntax --json # 99 features with keywords, cached in contextThen match the business question against keywords:
One index call + keyword matching = direct path. No drill-down needed. |
…help topic - Move topicAliases to syntax package so HELP <topic> works in REPL (was broken: HELP entity returned "No syntax help found") - Add duplicate path detection in Register() (panic on duplicate) - Register missing 'test' help topic (replaced deleted test.txt) - Fix capitalize() for UTF-8 safety - Add unit tests for resolveHelpPath and ResolveAlias - Add TestAliasTargetsExist to verify all aliases point to valid paths - Add doctype-test for HELP command Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
.txttopics) — no drill-down, no structured output, no LLM-friendly discoverySyntaxFeatureregistry where each syntax construct self-registers with metadata (path, summary, keywords, example)mxcli syntax --jsonfor one-shot LLM discovery, hierarchical drill-down, and single-file changes for new featuresKey Design Decisions (seeking feedback)
syntax/package — keeps syntax docs out of executor logicdomain.concept.detail— e.g.workflow.user-task.targetingHELP <topic>in MDL REPL — requires grammar change, worth it?Design Doc
See
docs/11-proposals/syntax-feature-registry.mdTest plan
HELP <topic>grammar change is worthwhile🤖 Generated with Claude Code