Elamur: **Mova** · [Parse](https://mova.elamur.ai/free/en/parse/) · [Research](https://md.research.elamur.ai/free/en/) · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/) · [Shryfti](https://md.shryfti.elamur.ai/free/en/)

[Mova](https://md.mova.elamur.ai/free/en/) · [this page in HTML](https://mova.elamur.ai/free/en/docs/tools/beaver/)

[Mova](https://md.mova.elamur.ai/free/en/) / [docs](https://md.mova.elamur.ai/free/en/docs/) / [tools](https://md.mova.elamur.ai/free/en/docs/tools/) / 🦫 Beaver: bridges between texts

# 🦫 Beaver: bridges between texts

The Beaver crawls the deep dives of the research site and finds the links their prose is missing. These include internal links to our paper, author, topic and concept pages and to Mova's page, and external links to a cited work's DOI or arXiv record and to the paper's own code or data page. It inserts a link itself only when the match is safe. It asks Sol one small batched question per article about the uncertain candidates. Whatever stays uncertain goes into the recommendations that the Whales' Sol help reads for that paper's next epoch.

The Beaver is deterministic Rust on Mova. Its consultant is Sol (`gpt-6.2-sol`) through `mova-teacher`, Codex only, with no Claude route. The pipeline is open. Its data stays internal: the run state, the journals and the recommendations live outside the repository.

```
mova-beaver scan   CONFIG [PAPER…|--recent N|--lowest N]            read only: every candidate with its decision
mova-beaver apply  CONFIG [PAPER…|--recent N|--lowest N] [--no-sol] insert, ask Sol, recommend, re-attach
mova-beaver status CONFIG                                             totals, papers due, Sol pause
mova-beaver watch  CONFIG                                             periodic pass (the Crab worker)
mova-beaver audit  CONFIG --out DIR [--per N] [--plant-every K] [--batch B] [--seed S] [--effort E] [--dry]
```

`--recent N` takes the N papers that Sol help accepted most recently (newest first, from `solhelp_journals`) whose deep-dive source and page both exist. `--lowest N` takes the N sparsest of them, fewest links per 1000 words first. A path in `solhelp_journals` may hold one `*` component (`/runs/owl-solhelp-*/journal.jsonl`), expanded each time the list is read, so new Owl shards join. `order: "sparsest"` makes `watch` take the due papers sparsest first.

## The precision audit

`audit` reads inserts from the original run root and every shard under it. It samples up to `--per` inserts of each kind and `auto`/`sol` stratum (deterministic for a `--seed`), reads each one's sentence from the current source, and counts a link the text no longer holds as gone. One item in `--plant-every` gets a planted twin: the same sentence and anchor with the target of another insert of that kind, from the same article when one exists, so it is wrong by construction. Sol judges the mixed items blind (it sees the sentence, the words and the target page, not the Beaver's reason) in batches of `--batch`. `items.tsv` and `summary.tsv` (precision per stratum) go to `--out`. The plants are the negative control: if Sol accepts more than 20 % of them, or nothing was planted, the audit fails. Sol judging its own earlier «yes» is not independent; the plants bound only its leniency.

## What it reads

The Beaver reads the indexes that already exist and builds none of its own:

- `library/meta/works.tsv`: titles, years, DOIs and arXiv ids.
- `library/meta/authors.tsv`: first authors, for «Author et al. YEAR».
- `library/citations.tsv`: what the paper cites and who cites it.
- The site's `research-site/slugs.tsv` and `release.tsv`: which works have a published page, read the way the site's `deepdive::Lib::load` reads them.
- The page sources: the `<h1>` of every author, topic and concept page, and the paper page's reference list (our pages and the ↗ DOI/arXiv links of works without one).
- The paper's e-print in the Sponge's raw root, for the code and data URLs the paper itself names.

## Model

A **mention** is a span of free prose that names a target. Free prose excludes:

- the `DESCRIPTION:` line and headings;
- code spans and fences, inline and block math;
- tables, HTML, figure lines;
- brackets and existing links, and bare URLs.

The rule lives in `text::mask`, and every excluded class is a red control in the tests.

| Kind | Target | Safe (inserted without Sol) when |
| --- | --- | --- |
| `arxiv_id`, `doi` | our page, else arxiv.org / doi.org | the id is in the library, or written in the paper's e-print |
| `title` | our page; for a cited work without one, its DOI or arXiv record | exact title, three words or more, or set off by emphasis or quotes; one work has these words |
| `short_title` | our page | the part before the colon, set off and exact, unambiguous |
| `title_loose` | our page | never (other case, or an ambiguous title): Sol |
| `author` | `/free/en/authors/…` | the full name as on the page, one page with that name |
| `topic`, `concept` | `/free/en/topics/…`, `/free/en/concepts/…` | the page name or a multi-word variant («Language models» of «Language models & pretraining»), or a distinctive single word written in its case (GloVe, BLEU) |
| `mova` | the site's Mova page | the word Mova |
| `author_year` | our page or DOI/arXiv | the paper cites exactly one such work («Smith et al. (2020)», or «Smith et al.» with no year through the paper's own citations only); otherwise Sol, and «Surname et al.» with no year and no single cited match gets nothing |
| `system` | our page | never: Sol (the one-word name before a related work's colon, or a mixed-case name such as WordNet carried by one work of the whole library) |
| `mova_doc` | Mova's public docs (configured phrases) | never: Sol, and only inside «How Mova uses it» |
| `code` | a URL of the paper's e-print, outside its references, in a sentence saying it is released or available | never: Sol |

Then the Beaver resolves the candidates:

- It drops a target that is the article's own page, is already linked anywhere in the article, has no page source (internal) or is listed in `skip_targets`. The paper's own title is masked.
- Overlapping mentions keep the higher score.
- Each target keeps only its first mention.
- Ordinary single words that name a page (Reasoning, Semantics) and library-wide system names go to Sol, at most `max_common_words` of each kind per article.

Every candidate has a score and a reason in plain words. The score orders the candidates and ranks them for the Sol batch. Only the safety rule decides.

**Invariant:**

- Every inserted span is free prose.
- No two inserted links overlap.
- No target is linked twice, and no internal link leads to a missing page.
- An inserted link is either safe or a Sol «yes».
- New links stay within `max_per_section` (per `##` section, in text order) and `max_per_article`.

**Cost:**

- Reading the indexes takes about 1 s.
- An article costs linear time in its words, multiplied by the phrases that share a first word.
- Sol gets at most one call per article and `max_sol_calls_per_pass` calls per pass.
- A Sol verdict on the same text, span and target is reused, never asked again (`verdicts.tsv`).

## The noun-compound rule and `rules-eval`

`np` parses a sentence with Mova's English model (`mova-parse`, en.bin) and says when the words to link are only part of a larger name. Its `Left` side looks for a noun before the span that modifies it («output parsing», «K80 GPU»). Its `RightDep` side looks for a word after the span that hangs on it, so the name goes on («SWE-bench Verified»). Its `RightHead` side looks for a noun after the span that the span modifies («WordNet relations», usually still a fine link).

```
mova-beaver rules-eval CONFIG --log WATCH_LOG --out DIR [--model EN_BIN] [--split dev|held|all]
```

With `np_filter: true` the Beaver loads the model once per process and sends a concept candidate the rules would insert to Sol instead when its `Left` side fires. This is the measured filter. On the held-out half (2026-11-28), Sol said no to 0.42 of those candidates, against 0.20 by chance. A scan of 400 recent texts routed 4 of 125 safe concept candidates («Blank Language Model», «few-shot text classification»). A model that does not load is an error, never a silent fallback.

`rules-eval` reads the Beaver's own Sol verdicts with their sentences from the watch log and splits the papers in two by the SHA-256 of their id. Rules are chosen on `dev` and measured once on `held`. For each variant and kind it reports how often the rule fires and the share of Sol «no» among those items, against a control that fires at random as often (the base share of «no»).

## `sense-eval`

```
mova-beaver sense-eval CONFIG --log WATCH_LOG --forms FORMS_TSV --out DIR [--min N] [--prec P] [--held]
```

`sense-eval` learns a decision list over sense features on the `dev` half and, with `--held`, measures it once on `held`. The features are: the anchor as a noun in Mova's general dictionary of forms and its count there; specificity, its share of the deep dives' words against the general count; whether it is the page's exact name; its case, number of words and section. A rule is a kind with one or two features. It enters the list with at least `--min` items and at least `--prec` of one verdict. On 2026-11-28, at 0.9, the list held 28 rules, all of them «yes» for system and short_title. On held-out it decided 38 of 1352 items (0.028), agreeing with Sol on 0.947. No «no» rule reached 0.85: these features do not separate Sol's «no». It is a measurement, not a gate.

## The Sol batch

The batch lists the candidates numbered, each with its sentence, the words to link, the target and the reason. Sol answers `N: yes|no|unsure` per item, and `sol::parse` reads the answer strictly:

- A missing answer counts as unsure.
- An item answered twice with different verdicts counts as unsure.
- An answer outside the item range is ignored.
- «yesterday» does not count as yes.

The Beaver inserts a «yes» and drops a «no». An unsure item, an item over the batch bound and an item over a cap become recommendations. A Sol error stops the pass, with no retry. Sol then pauses for `sol_pause_secs` and the paper stays as it was.

## Writing

An apply pass writes a change only if the source on disk still has the SHA-256 that the pass read. A text republished in the meantime is left alone. The steps are:

1. Back up the source to `backups/<paper>/<unix>-<sha>.md`.
2. Write the new source in place. The source stays the record.
3. Record the change in the ledger `links_dir/derived.tsv` (`paper base_sha256 linked_sha256`).
4. Re-attach with the site's own `site deepdive attach --one-text <paper>` (`site_bin`, run with the real home), so the page updates on the fly without a build.

If the site withholds the page (for example, a link to no page), the Beaver restores the source and its ledger row.

The Beaver logs every insert to `inserts.tsv` (unix, paper, kind, `auto` or `sol`, anchor, target, reason) and to `journal.jsonl`.

The Beaver rewrites `links_dir/<paper>.md` after each apply. The file lists the Beaver's links still in the text, to keep, and the recommendations, for example «link «REPLUG» to `[REPLUG: …](/free/en/papers/…)` — reason; as in: «sentence»». Sol help (`tools/whale`, `deepdive.links_dir`) puts this file into the next epoch's prompt and reads the ledger. Its catch-up publish therefore treats the linked version of an accepted text as unchanged instead of copying the unlinked text back.

## State

The local run directory is `run_root` for a single Beaver and `run_root/shard-COUNT-INDEX` for a shard. It holds:

- `state.json`: per paper, the SHA-256 the Beaver last left (a periodic pass takes only new or rewritten texts), plus the Sol pause and the total calls.
- `journal.jsonl`, `inserts.tsv`, `verdicts.tsv`.
- `backups/`.
- `sol/`: the teacher's scratch directory.
- `beaver.lock` holds one pass at a time for this worker.
- `STOP`: the stop marker of `watch`.

## Configuration

See [config.example.json](https://md.mova.elamur.ai/free/en/docs/tools/beaver/) (schema `mova-beaver-v1`, unknown fields refused). With `sol: true` the model must be a `gpt-*` model.

For four workers, give all four configurations the former single Beaver's `run_root` and the same site, work list and `links_dir` settings. Put `"shard": {"index": 0, "count": 4}` in the first configuration and use indices 1 through 3 in the others. Indices start at zero and must be less than the count. Set `"effort": "medium"` in each configuration to use medium effort. Omitting `shard` gives a single worker.

The owner of a paper is the first eight bytes of the SHA-256 of its slug, interpreted as a big-endian integer modulo `count`. This applies to periodic selection, recent and lowest selection, and explicit paper IDs. An explicitly requested ID from another shard is refused.

Stop the old watch before starting the shards, and stop all watches before changing the count. The common lock excludes simultaneous passes with different counts or with a single Beaver. Shards keep their pass limits, Sol pauses, journals and STOP markers in their local directories. The common `links_dir/derived.tsv` ledger is updated under its own lock.

Keep the original `state.json` and history files, and leave old shard directories under `run_root`. All workers read completed source hashes, verdicts and inserts across that history. A paper with the same completed source is skipped by `watch`. A rewritten source becomes due for its owner. A legacy journal can recover a completed write when its hash is recorded. Keep the legacy state checkpoint for older completions that lack a source hash in the journal. Run the daily audit once with any of the configurations sharing the root.

## Running under Crab

Add [crab-worker.example.json](https://md.mova.elamur.ai/free/en/docs/tools/beaver/) to a deployment's `crab.json`. Each `watch` pass takes at most `max_articles_per_pass` due papers, every `interval_secs`. A pass ends early once its Sol calls are used up, and the rest stays due for the next pass. The `STOP` marker under `run_root` ends it between passes for a single Beaver. For shards, use the marker inside each worker's local run directory.

## Checks

```
CARGO_TARGET_DIR=… cargo test --release --offline --manifest-path tools/beaver/Cargo.toml
```

The tests cover these cases:

- **Masking red controls:** no link in headings, code, math, fences, tables, HTML or existing links; no double link; no link to a missing page. A negative control (heading masking switched off) turns the masking test red.
- **The safe-insert rules:** exact title versus other case versus an ambiguous title; system names; author pages; distinctive and ordinary concept words; Mova; a cited work's DOI; hyphen-joined names (Global-MMLU in Global-MMLU-Lite); the own title.
- **The caps** and «Author et al. (YEAR)».
- **«Surname et al.» without a year:** only a cited work resolves; red controls for an uncited work with a page, two cited works by the same surname, a surname in no citation and a planted wrong surname. Switching the rule to all works with a page turns the test red.
- **The Sol batch parse.**
- **A whole apply:** write, backup, ledger, recommendations, `inserts.tsv`, verdict reuse, idempotence, and a refused attach that restores the source.
- **Shards:** exactly one owner per paper slug, incompatible passes excluded, shared checkpoints and audit inputs, invalid indices refused at startup, and a republished text left due. Set `BEAVER_PAPER_STATE` to a saved Beaver `state.json` to check assignment on a real run's paper list.

## Measurements

The pilot ran on 2026-11-07 over the five most recent accepted Sol texts:

- 13 links inserted: 6 by the rules, 7 Sol «yes» (internal and external: 2 code or data pages, 5 system names, 3 Mova, 2 topics, 1 concept).
- 6 Sol «no», 1 recommendation left.
- 5 Sol calls of 1 to 5 items each, about 10.3k input and 7 to 86 output tokens per call.
- All five pages re-attached.

A read-only scan of all 114 deep dives took 1.6 s and printed the same bytes twice.

## Limits

- Matching is lexical. Sol, not the Beaver, judges meaning.
- Titles shorter than three words count only when set off.
- A system name needs a colon in its work's title.
- Code and data pages come only from the paper's e-print and need a release cue near the URL.
- Mova docs are a configured phrase list.
- Most older deep dives have no «How Mova uses it» section, so they get no `mova` or `mova_doc` candidates.
- [← previous mova-articles](https://md.mova.elamur.ai/free/en/docs/tools/articles/)
- [next → bench — one row of fixed measurements](https://md.mova.elamur.ai/free/en/docs/tools/bench/)
- [↑ back to tools](https://md.mova.elamur.ai/free/en/docs/tools/)

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://mova.elamur.ai/sitemap.xml) · [llms.txt](https://mova.elamur.ai/llms.txt)
