mova-whale-paper
The groupant beside tools/whale/src/paper.rs in the Mova repository: what the code computes, what it never does, how to go back from its outputs, its invariants, cost and checks.
Facts
Implementation material. A Mova code model describes this code at one source revision: partial models, finite checks and their stated scope. It is not a reviewed general exposition, and its labels are shown as written, never raised.
Components
| component | label | where |
|---|---|---|
| approximant | partial | Forward approximant |
| ast | partial | syntax.json |
| composition | partial | Composition |
| cost | partial | Cost |
| descriptant | present | Descriptant |
| invariant | partial | Invariant |
| tests | finite evidence | tests.md |
Obernants
The typed relations around the forward model: the behaviour complement (what the code never does), the reverse reconstruction (every input compatible with an output) and specialised views.
| id | type | label | where |
|---|---|---|---|
behavior_complement | behavior_complement | partial source derived model | behavior_complement |
reverse_reconstruction | reverse_reconstruction | partial source derived model | reverse_reconstruction |
Model text
Descriptant
One Whale, one paper: pin check, new private run root, terminal lease, read through Mova, own description journaled before any question, bounded questions asked once each (limit/timeout/failure ends consulting), answers re-read into a glossary, teaching records with licence admissibility, metrics. Source: tools/whale/src/paper.rs.
Forward approximant
run(config, terminal): validate (schema, labels, absolute paths, terminal id prefixed by the Whale name), terminal id match, paper SHA-256, refuse an existing run_root, private_dir, TerminalLease::take, journal start; reader::read -> reading.json, journal read; reader::write -> description.txt, journal draft; gaps -> questions; for each: journal question, ask once; answer -> journal answer, Mova skeletons into glossary.txt; error -> journal no_answer and stop asking; questions.jsonl, glossary.txt, teaching.jsonl (open_licence), metrics.json, journal finish. check_pod: no shared Whale, terminal, lock or run root.
Invariant
The description is written before any answer and never contains answer text; a question is asked at most once and none after an error; a run root is never reused; one terminal per Whale.
Cost
Reading cost plus at most max_questions terminal calls (<= 16).
Composition
Parent: whale-workers; composes reader.rs and terminal.rs; CLI in main.rs.
behavior_complement
Not done: revising the description from answers, retries, resuming an interrupted run, fetching papers, admitting teaching records to the open school (a reviewer does), any live terminal. Evidence status: source-derived model with finite checks, not a proof.
reverse_reconstruction
From journal.jsonl and the run files one recovers the paper pin, terminal id, draft hash, each question and answer hash, how consulting ended and the metrics; the terminal's internal reasoning and timing inside a call are not recoverable. No unique inverse is claimed.
Epoch 2026-11-04 (terminal adapter)
Epoch 2026-11-04 (terminal adapter): the terminal is a mova-terminal profile whose animal is the Whale; run refuses another animal's terminal, holds ROOT/holder.lock for the run, journals the terminal's question id; check_pod refuses a shared run root, profile file, session, owner marker or terminal root.
Epoch 2026-11-04
Unknown terms are normalized by the reader; questions use the paper's own spelling (forms).
tests.md
Command: cargo test --manifest-path tools/whale/Cargo.toml --offline --locked with MOVA_OCTOPUS_TEST_MODEL=$MOVA_DATA/download/0/0.4/en.bin (paper/terminal/reader tests: fixture paper with a fake terminal, pod config gates, lease exclusivity, licence admissibility; Mova-only dry run on five CC BY 4.0 papers, two byte-identical runs; 2026-11-04)
Negative controls 2026-11-04: appending answers to the description, asking on after a usage limit, and a lease that does not lock each turn the tests red; restored afterwards. These are finite fixtures and a Mova-only dry run; no live terminal or teacher; not a proof.
2026-11-04: cargo test --manifest-path tools/whale/Cargo.toml --offline --locked with MOVA_OCTOPUS_TEST_MODEL=$MOVA_DATA/download/0/0.4/en.bin; tests/terminal_adapter.rs (3 tests: answer, usage limit, a full Whale run) against a fake bash LLM in a real tmux server on a private socket, tmux required, never a model (2026-11-04) Negative control 2026-11-04: ignoring the limit text makes the limit test wait out the timeout and fail; restored afterwards.
This page in Markdown โ https://md.groupants.elamur.ai/free/en/mova/tools/whale/src/paper.rs.groupant/