Mova0.6 pre-release

world — worlds, schools and students

world is where Mova keeps the world of a text and where its students live: the course pupil of the primary schools, the maths student, the readers of fables and tales, and the self-directed learners (induce, selfplay). This README describes the tale world in detail and lists the other commands of the binary; Architecture gives the overview, and Context, layers and memory holds the specification it implements.

The tale world

The SLM module specified in Context, layers and memory: «Tale world: entities, registries, cursor», «Minimal objects», «Immutable states — the alternative variant», «World-change language», «Non-linear narrative».

The change language has three layers, run by one executor. The layer names v1, v2, v3 are also the names of the commands, tests and run files that belong to each layer:

layerwhat it holdschecked on
v1, the baseplaces, objects, characters, relations, events, utterancesAesop fables (Project Gutenberg #21)
v2intentions, beliefs, joint agents, feeling sets, parts, quantity, negation, a second time axis (about=/when=/before=)FairytaleQA tales (Xu et al., ACL 2022, 2022.acl-long.34)
v3, the narrative layercanonical events with identity, story time as a partial order, frames with their own worlds, reality branches, observers' claims and knowledge, reveals«The Speckled Band», Scheherazade's frames

A linear narrative without frames and placements is the special case of v3: v1 and v2 runs give byte-for-byte the same output on the v3 executor (below).

Two question readers answer natural-language questions from the state: reader v1 (ans.rs) and reader v2 (index.rs, qframe.rs, span.rs, reader.rs), which merges the state answer with a span of the anchor sentence and logs the reason for every choice. Narrative-layer questions are asked through formal qa3 queries.

How it works

Model (world.rs, types.rs)

Change language, base layer v1 (lang.rs)

One command per line, anchors ^sN at the end. A line spanning two sentences has two anchors: ^s3 ^s4.

commandwhat it does
cursor [chapter= para= sent=] [at=L] [time=]where the narrative moved
loc L type= [class=] [name=] [in=L]a location, nested in another via in=
obj O type= [class=] [name=] [at=L|C]an object in a place or held by a character
char C type= class= [name=] [at=L] [attributes…]a character
move C to=L / move O to=L|C [cause=E]change of place: a character goes; an item fell or was picked up
have C O [cause=E]first possession of an item that has no place yet
give C O to=C [cause=E]handing over an item
set X key=value … [cause=E]an attribute
rel R kind= a=C b=C [cause=E] · rel R kind= cause=E · rel R fact=Ea relation: start, change, fact
event E verb= [agent= patient= to= at= instr=] [why= how=]an event
say C|narrator [to=C] act= [indirect=0|1] [sincere=0|1] [means=] [why=] id=Ean utterance; act is the closed set prag::schema::Act

Closed sets:

Parsing is strict; a format error is a rejection. This rejects:

Layer v2: intentions, beliefs, parts (lang.rs, world.rs)

Registries: P — intentions, B — beliefs. Both are classes with their own immutable states, like relations. Bidirectional links:

command / keywhat it does
plan P kind= who=C[+C] [to=C] what="…" [src=E]an intention is opened. Kinds: promise plan agreement wish threat order task curse prophecy bargain bet
plan P status=kept|broken|dropped by=Ethe intention is closed by a fulfilment or violation event, once
believe B who=C claim="…" [about=X] [from=E] [true=0|1]a belief: the claim, what it is about, where it came from, whether it is true in the tale world
believe B status=dropped by=E · believe B true=0|1 by=Eabandoned; truth established
done C cause=Ethe goal is reached: goal becomes unknown, state done with a cause
unset C <key> cause=E [why="…"]a goal abandoned, a feeling or status passed; why is stored in the state
feel C +a +b -c [cause=E]feelings are a set: add and remove, the rest stays; set C feeling=a,b sets the whole set
detach O to=L|C cause=E · attach O to=C|O cause=Ea part is detached (lying or in hand) · attached
mention X [Y…]a mention of existing entities with no changes and no cursor shift
obj … part=C|O · num=a body part or part of a thing; a quantity (digits or some few several many all pair)
loc … here=0a place only mentioned: the narrative cursor does not move there
event … agent=C1+C2 … neg=1 cause=E about=X when=<word> before=Ejoint agents (likewise patient, to); an event that did not happen; a causing event; about a past event, intention or entity; story time separate from place in the text; a memory (happened before E)
say C1+C2 to=C3+C4 act=request+promise … cause= about= when=in chorus; up to 3 acts per utterance
rel … kind=benefactor|master|parent|ruler|captor|suitor|mentordirected: "a is the <kind> of b" (the Mouse is the Lion's benefactor, the Lion is the debtor). Also spouse

The closed sets include the general vocabulary of tales (places, items, 26 feelings).

A feeling with a single tag is a Tag, as in v1, so the v1 tests and fables give the same output.

Executor gates

A command is applied to a copy of the world. A violation is a rejection; the world does not change (test rejected_command_leaves_world_unchanged).

gatewhen red
referencethe id is not in the registry; an id is created twice; cause/fact points to an event not yet written
typethe id is from the wrong registry (move C1 to=C2); the attribute does not belong to this registry
bidirectional linkafter the write some link is not mutual: have C2 O1 while the meat is still with C1 or lies on the ground; changing a relation endpoint
teleportationset … at=; an item "jumps" from character to character without give
nearbypicking up, handing over, dropping is possible only in the same location or a nested one (in=)
silent changea known attribute value or relation kind changes without cause=E. Unknown → known is not a change but a discovery (like "Jackie was a boy" in the specification)
continuityevent at=L while the agent is not there; give of an item that is not there; giving to oneself
anchoran anchor outside the text; anchors go backwards; cursor para= does not match the database

v2 gates (negative controls — v2_gates_are_not_mute, v2_links_catch_injected_mismatch, v2_format_is_strict):

gatewhen red (v2)
silent changean intention closed without by=E; a belief changed without by=E; done/unset/detach/attach without a cause; a known feeling changed without cause=; relation direction (a ↔ b) changed without a cause; a known num changed without a cause
continuityan intention closed a second time; kept by an event with neg=1; move/give/have/detach/attach/done through an event that did not happen; done without a goal; unset of an unknown; feel -x when x is absent; a belief abandoned a second time; attach of something already a part; detach of something that is not a part
linka part moved by move, give, have without detach; a part also lying separately; plans, beliefs, parts without a counterpart
nearbydetach/attach far from the whole
referencesrc=/from=/by=/cause=/before=/about= to something not yet written; an event referring to itself; mention of a nonexistent entity; a nonexistent joint agent
continuity (joint)event at=L while at least one of the joint agents is elsewhere

The link gate is not built into the executor.

Narrative layer v3 (story.rs, narr.rs)

Specification — Context, layers and memory: "Non-linear narrative" (event identity, the v3 pipeline, partial order of time), "Hierarchical and global worlds", "Checking claims against the world", "Immutable states".

Layers v1 and v2 hold linear causality. Layer v3 holds three things separately:

Architecture

A canonical event is one. An event gets an E id at its first mention.

Two axes.

The frame's narrative line.

Frame stack. A frame is who tells, to whom, the level, its own cursor and its own world. The narrative level (Genette) is counted by narrators (Story::narr_level): a recollection by the same narrator is a time frame, not a new level. Frame nesting is a separate number.

frameown worldtime axiswhat passes into the parent world on close
root (level 0)the document worldown—
world=same time=past (testimony, recollection, explanation)projection of the parent world: identity and structure of entities, without places and transient states (feeling, sleep, goal, status, life)the same, everything in the frame is before before=/src=new entities (identity, stable fields, place); for existing ones only what the parent does not know; the past does not overwrite the present
time=nowthe parent's world and linethe same—
world=new (story within a story)a new empty worldown, separateevents are foreign: they can be talked about, but they do not cause changes in the listener's world
branch=dream|lie|plan|ifa copy of the parent worldownnothing (it did not happen)

Reality branches. Branches: real (happened), dream, plan, intent, lie, if, report, belief.

Observers' knowledge. An observer is a character, the reader (reader) or the narrator.

Pipeline (World::apply, exactly per the specification):

  1. Sentence cursor (anchors, monotonicity).
  2. Frame: top of the stack, its world and line.
  3. Mention of an event or claim.
  4. Resolution into a canonical event (id reference) or a new event.
  5. Story time axis: nodes, a line or placement edge, past-frame boundaries.
  6. Reality branch.
  7. Observer knowledge.
  8. Gates decide whether the canonical world changes. On refusal the world is unchanged: the command runs on a copy of the root together with the frame worlds.

Commands of layer v3 (lang.rs)

commandwhat it does
frame open F<n> narrator=C|narrator [to=C+…|reader] level=<n> [world=same|new] [time=past|now] [before=E] [src=E] [branch=…]frame: level one deeper than the current; level=0 names the root narrator (once, as the first frame); the same id again continues an interrupted frame
frame close F<n>close the deepest open frame; what passes into the parent world is in the table above
claim K<n> who=C|reader|narrator about=E status=believes|doubts|wrong|knows interp="…" [from=E]an observer's claim about an existing event
claim K<n> status=… by=Ethe observer changed their mind because of an event
time E1 BEFORE|AFTER|DURING|SAME E2relation on the story axis (one world)
time E at="…"time in the words of the anchor sentence — absolute time only from the text
branch E dream|plan|intent|lie|if|report|belief|real [by=E]the event's reality branch
know who=C|reader fact=E|K|P|… from=^sN [how=saw|heard|told|inferred|revealed|guessed] [by=E]who knows a fact and from which sentence
reveal E [to=…] [by=E] [interp="…"] [wrong=K+…] [right=K] [agent= patient= instr=] [cause=E] [before=|after=|during=|same=E]revealing the truth about an existing event
event … after=E | during=E | same=Eplacement at creation, in addition to v2's before=; only one

Closed sets: branches, claim statuses, knowledge sources, frame world and time. Parsing is strict:

All of these are format refusals (v3_format_is_strict). mention E… remains a format error, as in v2: an existing event is mentioned by reference (claim, know, reveal, time), not as a new event.

Gates of layer v3

gatewhen red
framethe level is not exactly one deeper; closing a frame that is not the deepest; closing the root; naming the root a second time; continuing with a different parent, level or narrator
story timea cycle in the partial order (time, placement, reveal, frame boundary); an at="…" that is not in the anchor sentence
teleportation (in story time)in the present, an event where the character was not just before on the story axis: a recollection without a time marker. In a past frame — the same inside its world, where the neighbours are the frame's states, not the present ones
brancha state change by an event not of this branch (dream, lie, plan); branch of an event that has already changed the world; know of an event not in the real branch
world boundarytime or placement across worlds; a change in the listener's world caused by an event of a story within a story
event identitya character's second death with a different cause — the same event twice; reveal overwrites an existing role
referenceclaim/know/reveal/time/branch about something nonexistent; reveal of a new event ("a reveal does not create events"); a claim about a different event in wrong=
continuitya dead character acts in the present
anchorknow from=^sN later than the command's sentence
silent changea claim's status changed without by=E

Linear narrative is the special case

Queries (query.rs, qa.rs)

world query <doc> <dir> <query>. Entity description — C1, char:fox, obj:meat|flesh, loc:tree. a || b — a second reading if the first gave no answer.

State and place:

Events:

Relations:

Working memory (context_at, the view from the cursor):

md graph: md.rs builds a human view — the text, the cursor by sentence, registries, hero states as deltas, relations, chronology, working memory and gates.

LLM (vmm.rs)

Prompt:

Call:

Accounting — calls.jsonl.

Layer v2 prompt and calls (rules_v2, body_v2, call_v2):

world depends on prag (opus, schema::Act, data::duck_query) and on en — only dictionary reads in code: lemmas of question words and past tense of verbs in answers.

Layer v3 prompt and calls. Parts of up to 95 sentences (V3_PART). The second and later parts receive the preceding text and a compact v3 world: entities of the current frame's world, frames with open ones marked, claims, off-line events, the latest events from all worlds, free ids from all worlds. The prompt forbids forward references (an event referred to before the line that writes it). One format repair per part, only for rejected lines. v3-estimate gives an upper cost bound before a run (800 output tokens per sentence), and a ceiling (WORLD_V3_BUDGET) is checked before every call.

Question reader v1 (ans.rs)

Reader v1 answers natural-language questions from the state alone, with no teacher:

Reproducible evaluations bind the reader source, executable, model and inputs in their run artifacts (freeze*.txt); reader v1 (ans.rs) is the freeze-2 reference column of the reader reports. A historical freeze does not establish the identity of the current build.

Question reader v2 (index.rs, qframe.rs, span.rs, reader.rs)

Reader v2 is a set of separate modules next to v1, with no teacher calls. It works on already built worlds.

  1. A single fact index (index.rs). Facts of a tale, each with sentence anchors, a cause (cause) and story order:

    • events: agent, object, addressee, place, instrument, how, why, when, about, negation;
    • utterances: speaker, addressee, acts, means, why;
    • intentions: kind, holders, text, toward whom, state and the fulfilling event; beliefs: proposition, about what, truth value;
    • attributes by state: traits, status, goal, feeling (only added tags), age, sex, sleep, freedom, life, number, name, place — with the unset … why= explanation;
    • objects in hand, parts, names of characters and places with in= ancestors, relations.

    Search uses lemmas from the en dictionary with field weights: predicate +3; subject in its role +3, elsewhere +1, absent −2; another participant +1.5; content word — the field weight (predicate 1.5; texts and participants 1; time and "about" 0.5); the question's section +3, adjacent +0.5, farther −1.5; for a prediction the next section +2.5.

  2. Parsing the question with a UD tree (qframe.rs; the model is WORLD_EN_MODEL or en.bin).

    • A subordinate clause ("when/after/because/if/as soon as …") is a separate clause: the reader first looks up its fact — the time anchor — and then answers about the main clause.
    • Main clause: question word, auxiliary, predicate; participants come from the tree of the declarative sentence "subject + did + predicate + rest". The tagger knows such sentences better than lowercase questions.
    • Predicate repair with the en dictionary: the candidate must be a VERB in the declarative tree; "to V" is an xcomp of the previous candidate.
    • Names outside the dictionary (assipattle) are capitalized before tagging; "ashamed" is not (a familiar suffix).
    • Question type → index field: feel → feeling; why → why / causing event / goal / intention / traits of the loved one; happen → consequences (cause= anchors), otherwise the following events; have → objects and parts; who in the passive → patient; "who did X think" → belief; "what would happen if" → content of the utterance.
  3. Span of the anchor sentence (span.rs). FairytaleQA answers to explicit questions are text spans. Predicate node (lemma from the question or from the fact) → the subtree of the role:

    • subject, object, place, time, cause (advcl because/for/to; "X, so V"; "so ADJ that"), manner;
    • feeling — only feeling words with an intensifier ("sorely troubled");
    • "what happened when X" — the main clause after the subordinate one, or the following coordinated predicates;
    • a question echo (a span made mostly of the question's own words) is not an answer.
  4. Merging (reader.rs) — a transparent rule; the reason is written to the log of every answer:

    • fact score < 6 (CONF) or no fact → baseline sentence: "state not confident (score 4.0 < 6)", "state is silent";
    • otherwise, if the question's words cover ≥ 50% of the fact's anchor sentence (COVER; explicit by our measure, not by the dataset label) and a span is found → span with the rule name: "state: score 10.0 ≥ 6; question in sentence ^s38 at 50% → span [conj-after]";
    • otherwise → fact field: "state: score 12.5 ≥ 6 → fact field";
    • a feeling with a feeling word in the anchor sentence, and "what happened" — always a span; description and number — a field.

    A search without a predicate match and with fewer than two words is never confident.

Evaluation data and protocol

Commands

export PATH=$HOME/.cargo/bin:$PATH
cargo build --release        # from the repository root; all paths below are root-relative
# layer v1: fables
target/release/world prompt 2451                                   # prompt without a call
target/release/world vmm 2451 $MOVA_DATA/runs/<run>      # LLM → cmds-2451.txt
target/release/world build 2451 $MOVA_DATA/runs/<run> --questions world/data/questions.tsv
target/release/world query 2451 $MOVA_DATA/runs/<run> diff char:crow 1 7

# layer v2 on FairytaleQA
R=$MOVA_DATA/runs/<v2-run>
target/release/world ftqa-import $MOVA_DATA/raw/fairytaleqa/hf-test.csv $MOVA_DATA/raw/fairytaleqa
target/release/world ftqa-prompt golden-goose                  # v2 prompt without a call
target/release/world ftqa-vmm golden-goose $R                  # LLM v2 in chunks → cmds-golden-goose.txt
target/release/world ftqa-build golden-goose $R                # gates → world-golden-goose.md
target/release/world ftqa-eval $R --sample 10 --seed 2 --exclude $R/seen-questions.tsv
target/release/world ftqa-parse questions.tsv --frame          # question parsing (development)

# Question reader v2 (en model: WORLD_EN_MODEL or $MOVA_DATA/en/models/en.bin)
O=$MOVA_DATA/runs/<reader-run>
target/release/world reader-parse questions.tsv                # UD tree parsing (validation)
target/release/world reader-span-dev $O/valid [--show why]     # spans on validation, without the world
target/release/world reader-eval $R $O --dev $O/dev-questions.tsv   # development: seen questions only
target/release/world reader-ask golden-goose $R 4 [--facts]    # one (allowed) question in detail
target/release/world reader-eval $R $O --sample 10 --seed <seed> \
    --exclude $O/dev-questions.tsv --exclude $R/freeze-2/manual-sample.tsv --exclude $O/excluded-extra.tsv
target/release/world reader-eval $R $O --skip $O/dev-questions.tsv  # table on the non-dev questions
target/release/world reader-eval $R $O --control shuffle|noindex    # negative controls

# narrative layer v3
R=$MOVA_DATA/runs/<v3-run>
# sources: manifest → plan → curl → verification
target/release/sources plan $MOVA_DATA/raw $R/queues $R/sources.jsonl
curl -sS --fail -K $R/queues/curl-www.gutenberg.org.cfg --create-dirs
target/release/sources verify $MOVA_DATA/raw $R/sources.jsonl
# testbeds: cut out a story, sentences (en::tok)
target/release/world poly-prep $MOVA_DATA/raw/en-narr-pg1661-doyle-holmes/pg1661.txt \
    "VIII. THE ADVENTURE OF THE SPECKLED BAND" "IX. THE ADVENTURE OF THE ENGINEER’S THUMB" $R/stories/speckled-band.tsv
target/release/world poly-prep $MOVA_DATA/raw/en-narr-pg128-lang-arabian-nights/pg128.txt \
    "The Arabian Nights" "The Story of the Fisherman" $R/stories/arabian-nights.tsv
target/release/world v3-estimate $R speckled-band arabian-nights   # cost estimate before the run
target/release/world v3-prompt arabian-nights $R 1                # prompt of a part, no call
target/release/world v3-vmm arabian-nights $R                     # LLM in parts, cap WORLD_V3_BUDGET
target/release/world v3-build arabian-nights $R                   # gates → story-arabian-nights.md
target/release/world v3-query speckled-band $R order ev:die/char:julia ev:arrive/char:helen@s10-40
target/release/world v3-eval $R $R/questions-v3.tsv               # frozen questions → answers-v3.md
target/release/world v3-cost $R
WORLD_V3=1 target/release/world ftqa-build golden-goose $MOVA_DATA/runs/<v2-run>   # v1/v2 runs on the v3 executor

Other commands

The binary has many more subcommands than the layers above. One line each, with the page that documents it (run from the repository root as target/release/world <command> …):

commandswhat they dodocumented in
babi, babi-contrast, babi-learn, babi-probebAbI tasks 1–20, the contrast set, learning, one-sentence probeTests, architecture.md
stepgame, stepgame-contrastStepGame relative positions and its contrast setTests
spartqa, spartqa-contrastSpartQA-Human spatial questions (NC data, measurement only)Tests
school, treereadthe school's maths student (school actors cv, held) and the tree reader for word problemsTests, architecture.md
knowledgeknowledge courses: course, retain, bench, diagnose, lesson checks and safe editsschool.md
lessons, meanings, numbers, mentions, opchoice, primerslessons as data, word meanings from the pupils' dictionary, number words, quantity mentions, choice of operation, arithmetic primersmodule docs in world/src/<name>.rs
quant-vmm, quant-stats, quant-checkthe quantitative layer: teacher-written world scripts for dataset problems, their statistics and a check of one scriptmodule docs in world/src/quant.rs
state, selfplay, self, brain, family, letters, tune, big-explore, big-judge, big-diffstates with deltas and rollback, self-play, the brain, the family channel, big-text samplestraining.md
storethe tree store of book sentences per model versionrelease 0.3 notes
induce, rediscover, rediscover-random, repair-eval, conllu-splitinduced tree-repair rules, their evaluation, the even/odd tales splittraining.md
derive, derive-learn, derive-scantrees by logical derivationenglish.md
absurd-check, absurd-events, absurd-learn, absurd-repair, absurd-rerank, sense-check, idiomsthe absurdity matrix and what uses itknowledge.md
events, events-show, book-answer, gapsevent statistics of books, answering from a book's event index, the gap journalpragmatics.md
frames, qudpragmatic frames and questions under discussionpragmatics.md
domains, domains-eval, register-statsdomains and registers of expressionspragmatics.md
read, read-*, valuesthe reader of levels 1–3 and its checksarchitecture.md
nerves, triggerthe nerve graph and triggers (words hooked to code)knowledge.md
know, ideas, principlesgeneral statements, the global graph of ideas, derived principlesmodule docs in world/src/<name>.rs
tabulartables (Kaggle-style tasks) read into the world with an explained decision listtraining.md
worldbook, worldbook-*world books of one topic with a citation per sentencemodule docs in world/src/worldbook.rs

Limits

The world.

The readers.

The evaluation.

Tests

The tale-world tests are in src/tests.rs (v1, v2, reader v2) and src/tests3.rs (v3); cargo test --release -p world runs them with the rest of the crate's tests. Every gate has a negative control that must turn red.

Files

Crate:

Run directory (<run>, written by the commands above):

Licence

Elamur Cosmic License (Elamur Cosmic License). Third-party data keeps its own terms, as noted where it is used.

This page in Markdown https://md.mova.elamur.ai/free/en/docs/world/