mova-whale-dossier
The groupant beside tools/whale/src/dossier.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
The epoch's one integration point with two stores it does not own: the document dossiers (ROOT/<doc>/texts/<epoch>-<kind>-<n>.md + texts.jsonl) and the global world's neighbourhood of a document (CLI neighbourhood DOC --radius R --max-docs N, a closed topic corpus, or a fixture). Source: tools/whale/src/dossier.rs.
Forward approximant
register(NewText) -> TextRow: under texts.lock, an existing row with the same (epoch, kind, sha256) is returned; else n = rows of (epoch, kind) + 1, the file is created (create_new, 0600, synced) and the row appended (fsynced). public_ok = open && kind not in {mova, sol}. licence_class(kind, licence) in {internal, cc0, pd, by, restricted, unknown}. WorldConfig::neighbourhood(doc) -> [NearDoc] nearest first (distance, then the source's own order), the document itself left out; topic_corpus: graph.json lists references, similar, same_author, cited_by with registry texts, at most max_docs.
Invariant
A text file is never rewritten; generated texts are never public; document ids are single safe path components; no neighbour order is alphabetical (the source's order is kept, a stable sort by distance only).
Cost
register: O(rows) to read texts.jsonl plus one file write; neighbourhood: one child process (cli) or reading graph.json and documents.jsonl (topic_corpus).
Composition
Parent: whale-workers. Used by epoch.rs only. The dossier contract is shared with the global world's builder; the CLI format is parsed leniently (documents or neighbours, doc or id, relations or relation).
behavior_complement
Not done: building the world or the dossier's original/site-old/web texts (another tool registers them; the epoch registers only the original when missing, and its own mova and sol texts), deleting or rewriting texts, paging a neighbourhood, timeouts on the world CLI, locking across machines. Evidence status: source-derived model with finite checks, not a proof.
reverse_reconstruction
Every row names its file by id, its sha256 and its inputs; a text's provenance is recovered from source, inputs and citations; the neighbourhood is recomputed from the world, not stored.
Epoch 2026-11-05 (created)
Coded against the stated dossier contract and an assumed neighbourhood JSON while the global world's CLI did not exist yet; measured with the topic_corpus adapter on five papers (12 nearest documents each).
Epoch 2026-11-05 (world tool)
The world tool appeared during the work: DossierConfig (files | world: its CLI dossier list|text|add; texts read through it because its originals may be zstd) opens a Store with rows/file/read/register (idempotent by (epoch, kind, sha256) before add; a generated text it marks public is an error). WorldConfig::World replaces the generic CLI: world neighbourhood … --epoch N (meta), world related (edge kinds), world neighbourhood … --content (sentences grouped per text id, rebuilt as Markdown under one ## Text heading, five sentences per paragraph); the document itself stays at distance 0. NearText holds a path or content. Measured read-only on a world of 85 documents: 3 child calls per document, 8–10 s per paper including Mova's writing.
tests.md
dossier::tests (2026-11-05): a text registered twice gives one row; numbering per (epoch, kind); a consultant text is never public while an original with the same flag is (negative control: public_ok = open turns the test red); unknown kinds and path-escaping ids refused; a neighbourhood is nearest first without the document.
This page in Markdown → https://md.groupants.elamur.ai/free/en/mova/tools/whale/src/dossier.rs.groupant/