---
title: "mova-whale-world-query — Mova code model"
description: "Mova code model of tools/whale-world/src/query.rs: components with their labels, obernants and the model text."
url: "https://groupants.elamur.ai/free/en/mova/tools/whale-world/src/query.rs.groupant/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Research](https://md.research.elamur.ai/free/en/) · **Groupants**

This page as HTML: <https://groupants.elamur.ai/free/en/mova/tools/whale-world/src/query.rs.groupant/>

# mova-whale-world-query

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

- **kind:** groupant
- **status:** partial source bound model
- **source:** [`tools/whale-world/src/query.rs`](https://github.com/ElamurAI/mova-free/blob/main/tools/whale-world/src/query.rs)
- **source SHA-256:** `6a316a1fa7dbb333…`
- **repository folder:** [`tools/whale-world/src/query.rs.groupant`](https://github.com/ElamurAI/mova-free/tree/main/tools/whale-world/src/query.rs.groupant)
- **repository commit:** `9057160b1fff`

> **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](#forward-approximant) |
| **ast** | partial | `syntax.json` |
| **composition** | partial | [Composition](#composition) |
| **cost** | partial | [Cost](#cost) |
| **descriptant** | present | [Descriptant](#descriptant) |
| **invariant** | partial | [Invariant](#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](#behavior-complement) |
| `reverse_reconstruction` | reverse_reconstruction | partial source derived model | [reverse_reconstruction](#reverse-reconstruction) |

## Model text


### Descriptant

Queries for writers over world(e): entity (kinds, forms, mentions, docs, grouped expansions), explain (explain_score plus a text-kind bonus, two per document, duplicates dropped), related (cites, cited by, same author, similar, idf shared-entity share), neighbourhood (breadth-first nearest documents with texts; --content streams every sentence), sentences (round-robin diverse examples), context (entities with explanations from the neighbourhood, related documents, every statement of the neighbourhood, optional byte cut); paging by offset and k. Source: `tools/whale-world/src/query.rs`.

### Forward approximant

entity: key -> bucket -> visible postings -> by_doc, grouped definitions. explain: entity postings U rarest-word postings -> visible -> sentence -> explain_score (+ case-folded retry) + kind bonus -> sort (score, doc, text, s) -> two per doc, dedup -> page. related: edges both ways + idf of shared doc entities -> score -> sort. nearest: BFS over related up to radius and max_docs. context: nearest -> doc entities -> explain_in(within neighbourhood, excluding doc) -> statements of texts_of each near doc -> cut an eighth of the larger list until it fits.

### Invariant

Answers are deterministic (ties by doc, text, sentence); every citation names a document of docs.jsonl and a sentence of that text's shard; nothing in the store is dropped to answer.

### Cost

entity 10 ms, explain 0.2-0.3 s, related 70 ms, sentences 18 ms, neighbourhood 73 ms, its content 0.2 s, context 0.9-1.1 s on the six-paper world (cold process, 2026-11-05); explain and context scan all candidate postings (no cap).

### Composition

Parent: whale-world; reads world::World; uses topic_corpus::corpus::explain_score.

### behavior_complement

Does not write the store, rank by truth, read texts of later epochs than asked, or include documents without visible texts in related; shared-entity strength counts general nouns too. Evidence status: source-derived model with finite checks, not a proof.

### reverse_reconstruction

Each answer item carries {doc, text, s}, from which the sentence is recovered exactly from the world; scores do not recover their components beyond the listed edges.

### tests.md


cargo test --manifest-path tools/whale-world/Cargo.toml --offline with WORLD_EN_MODEL=$MOVA_DATA/download/0/0.4/en.bin (9 unit tests: dossier append-only/select/changed files, licence negative controls, citation markers, importers incl. a topic corpus with a Sea Spider page and a consultant draft, entity extraction, LRU, two byte-identical world builds with cited queries, incremental epochs with old worlds intact and a changed file refused; 2026-11-05). Live 2026-11-05 on six papers: two independent imports and builds byte-identical.

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