mova-topic-corpus-graph
The groupant beside tools/topic-corpus/src/graph.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
Stage 1: the neighbourhood of one paper: topics (taxonomy names), concepts, tags, authors (homepage, h-index), references (bibliography entries resolved to library works or kept external with ids), library citers, similar works, works of the same authors; every node with ids, licence class, public admissibility and the text we hold. Source: tools/topic-corpus/src/graph.rs.
Forward approximant
build: find paper -> bibliography + resolved refs (deduplicated) -> citers sorted by cited_by -> similar = idf-weighted keyword cosine + 0.5 * shared topic share + 0.2 shared concept (>=0.05 or a shared topic), top k, ties by id -> same author by OpenAlex author ids. members(): paper, references, similar, cited_by, same_author, each id once with its roles.
Invariant
Deterministic: same library -> byte-identical JSON (checked twice on bryant-2017, 2026-11-04). Scores rounded to 4 decimals.
Cost
O(N * keywords) for similarity over all works plus one pass each over citations and refs.
Composition
Parent: topic-corpus.
behavior_complement
Does not include citers outside the library (OpenAlex citing works are not in the slim snapshot); does not read texts. Evidence status: source-derived model with finite checks, not a proof.
reverse_reconstruction
Reference entries are kept verbatim; similarity scores do not identify which keywords matched. No unique inverse is claimed.
tests.md
graph::tests::neighbourhood_of_the_fixture_paper; live run 2026-11-04: 23 references (19 in the library, all with text), 251 library citers, 20 similar, 10 same-author.
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/graph.rs.groupant/