Mova0.6 pre-release⌕
☰
home / docs / repo-docs / Architecture

Architecture

This page is the map of Mova: how a text flows through the language core, how the knowledge is organised in three levels of logic, how the model learns, how its students are measured, and which crate does what. What Mova is, its mascot and the contract of its three layers (linguistic, combinatorial, operational) are in the hybrid-system page. Details live in each crate's README and in the pages linked below.

The pipeline: from text to an answer

text ──► en ──► UD tree ──► prag ──► frames ──► world ──► answer + reason
          │                   │                  │
          │  tokens, tags,    │  who did what to │  entities, holdings,
          │  heads, relations,│  whom, where,    │  states, what changed;
          │  lemmas, FEATS    │  why, what next  │  the students read here
          ▼                   ▼                  ▼
        global: compiled knowledge — verb classes, measures, values, absurdity matrix
  1. en parses. A sentence becomes a Universal Dependencies tree (UPOS, XPOS, FEATS, lemma, head, relation). The tagger and the arc-standard transition parser are averaged perceptrons with beam search. The lexicon is compiled into the binary. On the GPU, gparse gives the same kind of tree with a transformer trained from scratch. See English.
  2. prag reads the tree into frames. A frame is one event or fact: its verb (with negation), agent, patient, recipient, place, attributes, obliques, and links to its cause, to what came next and to what was said. Roles come from VerbNet classes where the verb is known, and from tree heuristics otherwise. The same crate labels speech acts, implicatures and irony candidates. See pragmatics.
  3. world keeps the world of the text: entities with their states, who has what, and the order of events. The readers and students live here.
  4. global is the compiled knowledge underneath: verb classes (give, get, lose, have), measures (a week is seven days), values as principles, shortcuts between concepts, and the absurdity matrix (knowledge). It is compiled from seed files at build time: no disk reads at run time, and a link to an undeclared concept breaks the build.

No component works from a bag of words. A reader matches the roles of frames, never the raw words of whole lines.

Three levels of logic

Mova's logic has three levels. They are an axis of computation; where knowledge is stored (skeleton, important graph in RAM, durable global graph) is a separate axis described in knowledge.

levelwhat it holdswhen it runshow it is built
1. Globalprinciples of existence and values; exact mathematics (rationals, expressions, units, number theory); the world model (concepts, parts, typical actions and consequences); shortcuts and links between all of thesealways, on every sentencecompiled into the binary: Rust types and tables from seeds (build.rs), no disk reads
2. Domain modulesone field each, such as customs classification (onto hs), research-level mathematics with Lean, tables and statistics (mlab); many, each separateonly when the context calls ita compiled module with its own version, licence and access level
3. Contextthe current document, task or conversation: the story world, pragmatics, working memory, the quantities of a task, the justification of each stepthe whole time the text runsworking state with access to the persistent graphs: world, prag, coref, math::steps

Global shortcuts join knowledge in one hop: "the apple falls → accelerates → hits the head → hurts"; "gave away half → divide by 2 → the quantity decreased"; "lying harms trust". Every shortcut carries an explanation and the law or principle it comes from, so every judgment shows why.

Values are part of the global level, not a filter on the side. Humanism, basic Christian values, friendship, peace and harmony are the principles by which the SLM judges a story (who harmed whom, who helped, what is fair), its motivation (what to strive for, what to avoid) and its answers (do not advise harm, explain respectfully). A principle is a declarative seed: essence, conditions and exceptions, examples, source. A conclusion always prints which principle fired. The SLM judges its own work by the same principles (global::self_judge): many branches tried is perseverance, an independent check is diligence, asking for help when unsure is humility, a confident error violates humility.

Context judgments are predicates over the world state (who owns what, who is in what state, who caused what); concepts and principles come from level 1. Whatever the context cannot explain with level 1 links it prints as a gap (world values: "action gnaw — no class"). Gaps go into a learning queue: for durable graph knowledge, RAM activation, or a slower, tested revision of seeds and parameters. Level 1 covers general human knowledge at the level of a beginning scientist or a strong linguist; where it is too thin, level 1 changes through a tested build. Cultural or trick logic (a culture where a death is a joy) is not level 1: it is a domain or a viewpoint module that gives its answer next to the classic one, with its source.

Concept codes. A concept's code is lang:word or lang:word:sense: en:give_up, en:apple:fruit, en:apple:company. Bare names in the seeds are English concepts. One concept per code is a build gate. global::senses(lang, word) lists a word's senses; global::sense_of(lang, word, text) picks one by the cue words in the text (seeds in global/seeds/senses/).

Interfaces

Global  ── concept(id) → world-model class
        ── law(name) / eval(expr) → exact core (math; later physics, chemistry)
        ── principle(situation) → judgment + which principle
        ── shortcut(from, to) → chain of links with explanation
        ── needs_domain(query) → which domains and why

Domain  ── id, version, licence, access (public / extended / private)
        ── covers(query) → [0..1], why
        ── solve(query, context) → answer + justification | "not mine"
        ── compile() → classes (at module build time, not at run time)

Context ── document state: world, quantities, pragmatics, memory
        ── route(query): global → domain (covers ≥ threshold) → escalate
        ── justify(answer) → steps, laws, principles, sources

The context is the conductor: it tracks what the text is about, passes every sentence through the global level, decides whether to call a domain, composes the justification, and, when even the domains cannot cope, escalates with the task already decomposed. Routing is transparent: every decision prints the coverage scores and the threshold. A disagreement between the global level and a domain is an escalation, like a disagreement between models in prag.

Which crates implement which level

levelcrates and modules
globalglobal (values, shortcuts, verb classes, senses, categories, feelings and object uses from seeds), math (the exact core: rationals, expressions, units, number theory, polynomials), onto (the compiled world-model core and word-sense selection), the en lexicon
domainsonto hs (customs classification), math with Lean (research-level mathematics), mlab (tables and statistics)
contextworld (tale worlds, the quantitative layer), prag, coref, math::steps and deduct (decomposing a task with justification)
conductorlayers: the Global, Domain and Context types, the domain registry, routing with a threshold and a log, Mode::{Answer, Explain(Training | Debug | UserAsked)}

layers makes no model call: Route::Escalate only marks the query.

Compilation into classes

The problem solver

The maths student is the first consumer of the three levels:

In explanation mode a step is a chain of level 1 links ("lose → decrease → subtract"); where a link is missing the step reads "teach me why", and those reports feed level 1 seeds. During training the student never calls an LLM: when its first opinion and its judge disagree and the judge is unsure, it files a report (the branches tried, both opinions, the words unknown to level 1) instead of answering.

Direction

How Mova learns: the teacher loop

Mova's parser and pragmatics learn from silver data that several witnesses agree on and that a teacher has checked. The teacher never answers in Mova's place.

school sentences ──► drafts: en (CPU) + gparse (GPU)
                 ──► witnesses: Stanza, Trankit, spaCy-trf; open NLI models for pragmatics
                 ──► treeagree: written rules R1–R8 agree the trees, gates keep them valid UD
                 ──► prag agree: Mova's pragmatic labels stand unless agreeing witnesses and rules say otherwise
                 ──► teacher: Codex CLI through mova-teacher patches the agreed draft
                 ──► parse database: every version kept, agreed by weighted vote
                                     (teacher round 2, agreed seed 1; older teacher versions 8 and 4)
                 ──► trainer: the GPU parser fine-tuned on the fresh agreed trees, asynchronously

Mova also finds its own patterns: world induce learns readable tree-repair rules from its own parsing errors (transformation-based learning, Brill 1995), and world selfplay tries changes to its rule set on held-out data and keeps only significant gains, with a journal of every experiment. Both, and the self-study step mova-enrich improve, are described in training.

The students

Mova is measured by what its students can do, never by the teacher.

Knowledge, durable learning and execution modes

The crates

groupcratewhat it is
language coreenEnglish UD: tokenizer, tagger, parser, morphology, lemmas; the compressor text → graph → text
globalcompiled knowledge: values, shortcuts, verb classes, measures, senses, the absurdity matrix
pragframes, speech acts, implicatures, irony, expressions read by their meaning, the pragmatics labeller and agreer
corefcoreference: a multi-pass sieve with a reason for every link; CorefUD scoring
ontothe world model: concepts from WordNet, FrameNet and Wikidata, kept apart from the narrative
annotthe teacher side of annotation: prompts, batches, gates, drafts
teachermova-teacher, the shared Codex CLI teacher transport
tools/treebanksUD treebank facts (treebanks/cards.tsv, INDEX.md) from the release; converters between treebank conventions live in dialects/ and treebanks/ (dialect)
world and studentsworldworlds of texts, schools, the course pupil, the maths student, readers, induce and self-play
layersthe conductor of the three levels of logic
mathexact rationals, symbolic expressions, units with dimensions, step-by-step solving
qagentraining questions on tale paragraphs, written by the teacher
kga compact knowledge graph of facts
algorithms and modelsalgorithmsmova-algorithms: deterministic algorithms with tests and groupants
tools/modelcheck, tools/approx, tools/correspondencegroupant and registry checks, executable Rust approximants, typed correspondences (groupants, mathematical modeling, correspondences)
tools/twinmova-twin: prospective cost predictions, measured runs and online calibration
tools/enrichmova-enrich: bounded corpus enrichment and self-study steps (training)
GPUgparsethe GPU parser: transformer encoder, biaffine heads, Eisner decoding; a library and a CLI
other domainsmlab, latexa MATLAB-like language, LaTeX formulas
yom-hadinlaws read out of the Torah and the Talmud as rules, jurisdictions as data, and a court that enumerates every way a case can be judged, with the why of each path (a study, not legal advice)
sandboxvfs, wasi-hostan in-memory file system and a WASI host for running untrusted modules
toolstools/*the teacher loop (cycle, treeagree), parser comparison (parsecmp), the round trip of the layers (roundtrip), the translator through a meta-world (translate), benchmarks (bench), jobs with memory and time limits (jobs, logging estimate and actual), data tools
workerstools/crab, tools/octopus, tools/fish*, tools/eel, tools/whale, tools/seaspider, tools/nautilus, tools/turtle, tools/terminal, tools/agent-runner, tools/agent-mova, tools/module-overlaythe sea animals of Mova, each a standalone workspace (animals)

Where things live

This page in Markdown → https://md.mova.elamur.ai/free/en/docs/repo-docs/architecture/