Manifold DSL
The Manifold DSL is the declarative source language for a Manifold model. A source file can declare condition vocabularies, entities, permitted mutations, and tasks that describe desired state.
The current pipeline has four visible stages:
- The lexer recognizes tokens and retains source spans.
- The parser builds a syntax tree and expression arena.
- The resolver decodes identities, resolves references and roles, and builds a syntax-independent model.
- Validation rejects duplicate identities, invalid component paths, unsupported state values, incompatible capacities, and undeclared mutation role values.
The manifold-dsl check command runs these stages and renders source
diagnostics. Engine materialization and planning are not implemented by this
pipeline yet.
Declarations
A source file accepts four top-level declarations:
| Declaration | Purpose | Identity form |
|---|---|---|
condition | Declares a named set of condition variants. | Identifier |
entity | Declares an identity and its current components. | Quoted string |
mutation | Declares roles, requirements, resource uses, and changes. | Quoted string |
task | Declares predicates for a desired state. | Quoted string |
The resolver collects declarations before it resolves their bodies. A local entity can therefore refer to an entity declared later in the same file.
Read Language structure for lexical rules and block syntax. The complete example is the same representative source checked by the DSL test suite and the documentation recipe.