Elamur Groupants⌕
☰

mova-whale-world-export

The groupant beside tools/whale-world/src/export.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

componentlabelwhere
ApproximantpartialForward approximant
Astpartialsyntax.json
CompositionpartialComposition
CostpartialCost
DescriptantpresentDescriptant
InvariantpartialInvariant
Testsfinite evidencetests.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.

relationtypelabelwhere
Behavior complementbehavior complementpartial source derived modelBehavior complement
Reverse reconstructionreverse reconstructionpartial source derived modelReverse reconstruction

Model text

Descriptant

Export of the Whales' finished descriptions into an editorial texts repository (mova-whale-texts-v1): per passed paper a main article (the last gate-passed round's description with footnotes after each run of sentences sharing their sources, and a bibliography), seo.json, shadows from the paper's dossier (Mova drafts, consultant drafts, earlier descriptions), an index page and a manifest. Dossier originals and web pages are listed by id, URL or file name and licence, never copied. Every Markdown file carries front matter with visibility, licence, provenance hashes and a seal (export_sha256). Source: tools/whale-world/src/export.rs.

Forward approximant

batches.jsonl opened events (batch >= from_batch; later assignment wins) -> learner state papers/<doc>/status.json passed -> last round-NNN with gates.pass, description.txt, draft.json -> meta (library work, else batch-log title/licence) + refs.json -> cite: draft items -> source ids (paper for restated/structure items; knowledge provenance terminal/reread -> consult:<learner>, topic-corpus -> doc, pod:<learner>:<id> in that learner; Surname..YYYY matching a reference -> ref:<k>) -> runs of the same section = paragraphs -> plain text == description.txt ? sentence mode : paragraph mode -> markers after each run of equal source sets -> footnotes in first-use order ; dossier rows -> original/web listed, mova/sol/site-old shadows (distinct sha, main text excluded) -> front matter + seal -> put (unchanged | write via temp + rename | keep edited/foreign) -> index over manifest papers -> manifest.

Invariant

The same inputs give the same bytes (no clock, BTreeMap/BTreeSet order, sorted rounds); a second run writes nothing; a Markdown file is replaced only while its seal and its manifest hash both hold, seo.json only while its manifest hash holds; nothing is deleted; the text of an original or a web page is never written; stripped of its markers, a sentence-mode body equals the description.

Cost

One pass over the batch log, one status, gates, description and draft per paper, the learners' knowledge once per learner, the dossier rows and shadow texts, and one write per changed file. Measured on 83 papers: 6.7 s including the library load (about 10 s budget), 272 files, 4.7 MB.

Composition

Parent: whale-world. Reads dossiers through dossier::Dossier (hash-checked reads; exists before open, so no dossier is created) and the library through topic_corpus::library::Library (get, bibliography, resolve, bare_doi). Called by main (export-texts). The texts repository's own conventions (main article, shadows, seo.json) are its contract; the exporter does not commit.

Behavior complement

Does not run learners, ask a terminal, import dossiers, fetch, publish, commit, merge, delete files, or rewrite a file that a person edited or that it did not write; does not judge the quality of a description; does not export papers that never passed, rounds that failed, or texts outside the dossier and the round; does not follow citations inside shadow texts. Evidence status: source-derived model with finite checks, not a proof.

Reverse reconstruction

From a main article: description_sha256 and draft_sha256 name the exact round files, batch, round and the describer name the learner state; removing the footnote markers recovers description.txt in sentence mode (checked in tests). From a shadow: text_id and sha256 recover the dossier row and its exact text. From the manifest: every written file's hash, so an edit is detectable. Machine paths are reduced to file names and are recovered from the dossier row, not from the repository.

tests.md

cargo test --release --manifest-path tools/whale-world/Cargo.toml --offline (export::tests, 5 tests, no model needed; whole crate 14 tests green with WORLD_EN_MODEL=en.bin.2026-11-05-redact, 2026-11-05): selection by batch and gates with a from_batch negative control; sentence-run citations, markers stripped equal to the description, shadows without the duplicate Mova draft, second run writes nothing, a fresh repository byte-identical; an edited article and an edited seo.json kept on two runs, the upstream change let through once the edit is undone, a foreign file kept; a CC BY-SA page and the original cited by URL/file name and licence, their sentences absent from every file (the dossier holds them: control); reference mentions with wrong-year and no-surname controls; seal and intact.

Negative controls 2026-11-05 (each red, then restored): edit gate disabled (edited test red); held original and page texts written as shadows (idempotence and never-copied tests red); a clock value in the front matter (idempotence test red).

Live 2026-11-05: 83 papers into a texts-repository worktree, second run 0 written / 272 unchanged; a fresh export into a scratch directory identical by diff -r.

These are finite fixtures and live samples; not a proof.

History

2026-11-05 · Cost

One pass over the batch log, one status, gates, description and draft per paper, the learners' knowledge once per learner, the dossier rows and shadow texts, and one write per changed file. Measured 2026-11-05 on 83 papers: 6.7 s including the library load (about 10 s budget), 272 files, 4.7 MB.

Provenance

This page in Markdown → https://md.groupants.elamur.ai/free/en/mova/tools/whale-world/src/export.rs.groupant/