0085. MX discovers a dialect's tags from declared folders (target design)
0085. MX discovers a dialect’s tags from declared folders (target design)
Status
Accepted as a target design. Nothing is built. Row: DOM-07.
Date
2026-10-11
Deciders
operator (Saulo Vallory), with MX, 2026-10-11 (the directory name at 09:08). The hook’s design is worked out with MX’s dialect squad, for any dialect and not only Mesh.
Context
Concepts (and later other tags) should be files the user writes, not code in the Mesh repository. MX, as of 2026-10-11:
lowerSourceruns no discovery; the caller passesgetCustomTags.- Only
tags/x.tag.tsortags/x.mxdefines a tag. - A dotted basename such as
money.mesh.mxis skipped. - A
tags/entry silently replaces anmx.contractstag of the same name.
Decision
- A dialect’s static
mx.dialectmanifest declarestagDirs(scanned in the usual upward walk; Mesh’s includeconcepts, and Mesh may add others), optionaltagExtensions, whether its tags accept.tag.tssidecars, andreservedTags. - Scoping is MX’s usual: per file, the nearest wins.
- A tag’s name is its file name minus the claimed extension:
concepts/money.mesh.mxismoney. - Overriding a reserved tag gets a positioned, branded diagnostic, never a throw.
- A generic, synchronous dialect hook turns a tag file into a contract.
- In the user docs,
conceptsis a folder Mesh loads by itself: concepts are found and loaded automatically, so you do not import them.
Options considered
Mesh scans and passes getCustomTags itself (rejected: every dialect would redo it); an MX feature driven by the manifest (chosen); explicit imports of concept files (ADR-0067’s way, kept for entities).
Trade-off analysis
Discovery in MX serves every dialect and gives the same scoping rules, but it depends on MX work not yet scheduled. The facts above are why Mesh cannot do it alone today.
Consequences
Concepts (ADR-0080) wait for it. No existing record changes. The user docs describe the behaviour only when it is built.
Action items
- MX lead: the manifest keys and the hook (with the MX dialect squad).