Elamur GroupantsโŒ•
โ˜ฐ

mova-topic-corpus-corpus

The groupant beside tools/topic-corpus/src/corpus.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.

idtypelabelwhere
behavior_complementbehavior_complementpartial source derived modelbehavior_complement
reverse_reconstructionreverse_reconstructionpartial source derived modelreverse_reconstruction

Model text

Descriptant

Stage 3: the closed topic corpus, lazy: a registry of documents (paper, author note, web page, consultant draft) whose originals stay where they are and stay compressed (library texts, Sea Spider's zstd store, zstd originals/), parsed on request whole (one discourse context per document) into UD words, frames and issues; the hot neighbourhood parsed at build and pinned; a bounded LRU parse cache; explanations of terms; the public gate and export. Source: tools/topic-corpus/src/corpus.rs.

Forward approximant

register(doc,text): internal_only := true, public_admissible := licence rule, sha256, stored originals compressed. parsed(id): cache hit (sha, reader) -> decode; else text -> sha check -> annotate (whale reader parts/admitted sentences -> frames::read with one Ctx -> words with original forms, frames, issues incl. no_skeleton) -> zstd cache -> evict LRU non-hot over cap -> hard cases recorded. explain: text prefilter, then parse only documents containing the term; score definitional patterns and roles.

Invariant

Every document is internal; only open-licensed library texts are public-admissible; a changed original is refused, not silently re-read; hot documents are never evicted; files are 0600 in 0700 directories.

Cost

Build: ~16 s for 80 registered and 12 hot documents (2,508 sentences) on bryant-2017; explain parses documents lazily (first ERRANT query 49 s, cached afterwards).

Composition

Parent: topic-corpus.

behavior_complement

Does not copy library texts, does not parse documents nobody asks for, does not export web pages, drafts or notes, does not publish anything itself. Evidence status: source-derived model with finite checks, not a proof.

reverse_reconstruction

Originals are recoverable through the registry (path, Sea Spider URL+store, zstd original) and their hash; parses are recoverable from the cache only while cached. No unique inverse is claimed.

tests.md

corpus::tests (lazy registration, hot parse only, explain parses on request, byte-identical rebuild, cache cap keeps only hot, changed original refused; web page under CC BY stays internal and is refused by public_export; forged web/sol/note records refused). Negative controls 2026-11-04: assert_public without origin checks, ignoring the hot pin each turn tests red.

cargo test --manifest-path tools/topic-corpus/Cargo.toml --offline with WORLD_EN_MODEL=$MOVA_DATA/download/0/0.4/en.bin (18 unit tests; fixture library, fake papers binary, fake terminal, local Sea Spider store; two identical runs on 2026-11-04). Without the model the model-dependent tests report a skip.

Negative controls 2026-11-04 (each red, then restored): public admission without the origin condition; assert_public without the Sea Spider/draft/note refusals; seeding without the learner lock; shadow-library filter off; public citing that ignores refusals; cache eviction ignoring the hot pin.

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

This page in Markdown โ†’ https://md.groupants.elamur.ai/free/en/mova/tools/topic-corpus/src/corpus.rs.groupant/