Mova0.6 pre-release

prag — Mova pragmatics: LLM silver and a transparent SLM

prag is Mova's pragmatics: the frames reader (who did what to whom, why, what came next), speech acts and their labeller, implicatures, irony candidates, expressions read by their meaning, and the agreer that checks our labels against open witnesses. Pragmatics: frames — who did what to whom, why, and what came next is the guide to the frames; the implicature, irony and Rational Speech Acts pieces are described in algorithms from the literature and the lens in expressions by their real meaning. This README covers the speech-act labeller and the crate's commands.

The SLM learns pragmatics with memory models (something like a graph) next to a perceptron, and the models are compared on the same features.

A separate crate that depends on en, not the other way round. It holds:

Schema (Context, layers and memory)

fieldvalues
formdecl · q · wh · imp · excl · frag · intj · other
actassert · narrate · ask · request · offer · suggest · promise · thank · apologize · greet · agree · disagree · evaluate · express · warn · other
indirect0/1 — the form is not the usual one for the act ("Can you open the window?" — q, but request)
hedge0/1 — maybe, I think, sort of, perhaps
polaritypos · neg · none — the speaker's evaluation; grammatical negation by itself is not neg
voicenarrator · character (direct speech) · none (a standalone sentence outside a story)
meanswhat was meant, up to ~15 words in English; "-" means nothing beyond the literal. Written only by the LLM

A sentence with direct speech inside a narrator frame ("‘Pay me my wages,’ said Hans.") is labelled by the speech itself: voice=character, the frame is ignored. Full definitions are in the prompt (src/silver.rs, RULES). Closed sets are enums (src/schema.rs).

Data

Only texts with a commercial licence. The gate is en::license::commercial_gate; the sources are added to en/data/train-licenses.tsv:

LLM silver

The teacher is Codex CLI through the shared mova-teacher crate (src/opus.rs calls it): model from MOVA_TEACHER_MODEL or PRAG_MODEL (default gpt-6.1-terra), PRAG_EFFORT medium by default, no fallback to the Claude API. Sentences go in batches; the output is an 8-column TSV with numbers local to the batch.

Gates (silver::gate), all with negative controls in tests:

Rejects go to rejects.tsv, with no repeated calls.

Database (mova.duckdb, schema v2 — migration in tools/db/schema.sql, command db migrate):

SLM

Features (src/feats.rs) — 32 slots with symbolic values, the same for all three models:

If a sentence contains direct speech, the words and the tree are taken from the quoted text. Quotes are tracked across the sentences of a paragraph. "’" between letters is an apostrophe. Titles in quotes ("the title of “Gentlemen Weavers.”") are not treated as direct speech.

Models (src/model.rs) — a shared trait Classifier (predict → class, confidence, explanation; bytes; info). The models run side by side on the same features:

Mined silver (2026-11-06)

The first silver holds few conventional indirect requests, offers, suggestions, thanks, apologies and greetings (4 / 40 / 64 / 3 / 2 / 16 sentences of 2 986). prag mine finds more in our own open corpora and prag mine-check has the Codex teacher verify them (prag/src/mine.rs).

prag mine OUT --model EN_MODEL [--seed 26] [--books 200] [--batch 25]
prag mine-check OUT [--jobs 2] [--max-calls 30]
prag mine-eval FIRST_SILVER OUT EN_MODEL

Evaluation

prag eval splits the silver 80/20 (tales by document, Tatoeba by sentence) and also runs 5-fold cross-validation on the whole silver; the cross-validated predictions are what is written to the database. Each field, in both tables, is compared with the majority-class baseline and with a negative control: the same model (the same folds) trained on shuffled labels must land at baseline level. The report also gives the agreement of the three models per field, the confusion matrix of each model, and form against GUM test s_type (evaluation only; GUM ger, inf, sub map to frag, multiple is excluded, GUM has no excl).

The report also checks whether each model's confidence (perceptron: margin over the runner-up; IGTree: class share in the node; k-NN: vote share) orders its correctness: on the cross-validated predictions, accuracy by confidence quintile for every field, the lowest and highest fifth with Wilson 95% intervals, the inversions, and a control with the confidences permuted across sentences (reliability_md). 2026-11-16, silver prag-2026-09-26 (2 986 sentences), seed 26: the perceptron's margin orders correctness in every field (act 39.8 % in the least confident fifth to 99.0 % in the most confident, no inversion); IGTree's node share does not (act top fifth 65.2 % below the fourth 95.3 %: pure small leaves claim share 1; polarity −0.9 points); controls within ±3.8 points. A confidence threshold for asking the teacher is to be chosen on this table, per model and field, not assumed.

The perceptron is the main model; memory (k-NN or IGTree) runs alongside, and disagreement of the models marks a sentence for the LLM.

Decision explanations

Numbers next to perceptron features are the contribution to the margin of the chosen class over the runner-up. In an IGTree path — the node's default label and count.

Example. The Innkeeper said, “Why do you howl so fearfully?” — silver: wh, ask, character.

prag eval writes more explanations from all three models to examples.md.

How to run

export PATH=$HOME/.cargo/bin:$PATH
cargo build --release -p prag
P=target/release/prag; R=$MOVA_DATA/runs/<run>; N=<run>; M=$MOVA_DATA/models/mova.mlm#en
$P select $MOVA_DATA/db/mova.duckdb $MOVA_DATA/annot/src/tatoeba-eng-cc0.tsv $M $R   # items.jsonl, tatoeba-ud.conllu, select.md
$P prompt $R 5                          # batch prompt without a call
$P silver $R --batches 5,37 --jobs 2    # a pilot; then without --batches — the rest (finished batches are skipped)
$P gate $R                              # gates only: silver.tsv, rejects.tsv, silver-params.json
$P eval $R $M --gum $MOVA_DATA/en/ud/ud-treebanks-v2.18/UD_English-GUM/en_gum-ud-test.conllu   # report.md, results.json, examples.md, rust-*.tsv
D=target/release/db; B=$MOVA_DATA/db/mova.duckdb
$D migrate $B
$D load $B bronze ud-2.18 --kind prag --docs idprefix --match auto --run $N:tatoeba-ud --origin $N/tatoeba-ud $R/tatoeba-ud.conllu
$D prag $B $R/silver.tsv --run $N --source silver --tool opus --origin $N/silver --params $R/silver-params.json --path $R
$D prag $B $R/rust-perceptron.tsv --run $N:perceptron --source rust --origin $N/perceptron --params $R/results.json   # likewise igtree, knn
$D sql $B prag/sql/silver-vs-rust.sql

Other commands (usage at the top of src/main.rs):

prag roles <in.conllu> <out.tsv>        the reader's frames as (sent_id, dependent, predicate, role); the input of the private GPU training parser's GP_PRAG
prag label <silver run dir> <en model> <in.conllu> <out.tsv>   the pragmatics SLM labels sentences read as documents
prag agree <labels.tsv> <witness.tsv> <trees.conllu> <out.tsv> <report.md>   the pragmatics agreer
prag world <in.conllu> <out.tsv>        the temporary world before each sentence, for the teacher's prompt
prag lens <en model> <text>             expressions with their real meanings and the domains to switch on
prag infer <en model> <text>            implicatures, presuppositions and irony candidates, each with its reason
prag rsa scalar|reference               Rational Speech Acts on a built-in game
prag lexicon convert <verbnet dir> <propbank dir> <nombank dir> <out dir> [<test-only dir>]
prag lexicon nominals <wordnet dict dir> <out dir>

Variables: PRAG_MODEL, PRAG_EFFORT, DUCKDB. Tests: cargo test --release. They check:

Limits

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/prag/