---
title: "layers-lib — Mova code model"
description: "Mova code model of layers/src/lib.rs: components with their labels, obernants and the model text."
url: "https://groupants.elamur.ai/free/en/mova/layers/src/lib.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/layers/src/lib.rs.groupant/>

# layers-lib

The groupant beside layers/src/lib.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:** [`layers/src/lib.rs`](https://github.com/ElamurAI/mova-free/blob/main/layers/src/lib.rs)
- **source SHA-256:** `f7a2576c1bcd7945…`
- **repository folder:** [`layers/src/lib.rs.groupant`](https://github.com/ElamurAI/mova-free/tree/main/layers/src/lib.rs.groupant)
- **repository commit:** `855da7bd4a7b`

> **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 | [approximant](#approximant) |
| **ast** | partial | `syntax.json` |
| **composition** | partial | [composition](#composition) |
| **cost** | symbolic source derived | [invariant](#invariant) |
| **descriptant** | present | [descriptant](#descriptant) |
| **invariant** | partial | [invariant](#invariant) |
| **tests** | executed bounded checks | [tests](#tests) |

## 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) |
| `stable_selection` | stable_selection | partial source derived model | [stable_selection](#stable-selection) |
| `nonfinite_gap` | nonfinite_gap | partial source derived model | [nonfinite_gap](#nonfinite-gap) |
| `mode_projection` | mode_projection | partial source derived model | [mode_projection](#mode-projection) |
| `effect_metadata` | effect_metadata | partial source derived model | [effect_metadata](#effect-metadata) |

## Parts

- [layers-lib-global-math](https://md.groupants.elamur.ai/free/en/mova/layers/src/lib.rs.groupant/global-math.groupant/)
- [layers-lib-routing](https://md.groupants.elamur.ai/free/en/mova/layers/src/lib.rs.groupant/routing.groupant/)

## Model text


### descriptant

#### layers-lib

Independent three-level query routing: global exact math, finite-score domain selection, escalation value and decision log. No call to mlab exists.

##### Epoch 2026-10-31

Prospective source model preceded test additions. No production semantics changed. Seven legacy files are modeled, with source-scoped fragments for complex files. Retain parse-before-effects versus runtime partial effects, output equality versus correctness, and independent layers routing as distinct observations.

##### Limits

Partial lexical syntax, no macro expansion or semantic resolution. Finite synthetic CPU checks are not a proof. Frozen suites, corpus, teacher, GPU, allocation exhaustion and host IO failure injection were not run. No useful executable percent surrogate for categorical control/effects; unsupported gap, no 1/2/5/10% claim.

##### Epoch notes

- Comments repointed to consolidated docs, 2026-11-04.

### approximant

#### Forward relation

Query detects lowercase explanation substrings. route strips these phrases for global math; if successful clear why only in Answer mode. Otherwise score original query in all domains, stable-sort descending partial comparison, try scores satisfying !(score<threshold) until a solver returns Some (equivalent to score>=threshold for finite scores and finite threshold); else construct empty Escalate answer with context facts.

##### Domain

Valid source-generated AST/values within memory and integer/index limits; deterministic bounded synthetic observations. Arbitrary public malformed representations are outside safety claims.

##### Executable approximant gap

Exact categorical state/dispatch behavior has no supported percentage-error surrogate here.

### invariant

#### Invariant

Global math wins over domains; finite equal scores preserve registration order. Exact threshold is eligible. Context logs register and route decisions; escalation does not contact teacher. Nonfinite/malformed scores are not validated.

##### Cost

Query normalization O(text); routing global math cost under Limits5seconds then D coverage calls, stable O(D log D) sorting and attempted solvers plus log bytes. Trait callbacks can be arbitrary; access is metadata, not enforced authorization.

### composition

#### Parent composition

global-math admission precedes routing scores; route strips explanation phrases only for math, while domains see the original query. This subsystem is independently tagged with mlab execution; no caller/callee edge between layers and mlab.

##### Limits

Partial lexical syntax, no macro expansion or semantic resolution. Finite synthetic CPU checks are not a proof. Frozen suites, corpus, teacher, GPU, allocation exhaustion and host IO failure injection were not run. No useful executable percent surrogate for categorical control/effects; unsupported gap, no 1/2/5/10% claim.

### models

## Typed models

### behavior_complement

Successful global math excludes domain scoring/solve. Below finite threshold excludes solver attempt once sorted boundary reached. Escalate constructs metadata and no remote LLM call.

### reverse_reconstruction

An answer admits many queries and callback states. Domain solve may return arbitrary Route; route output alone cannot recover the selecting domain. Explanation removal makes text normalization many-to-one.

### stable_selection

For finite equal0.5 scores, first registered solver returning Some wins; higher0.9 declining permits next. Equality with threshold is admitted because rejection uses <.

### nonfinite_gap

partial_cmp(None) becomes Equal and NaN<threshold is false; no normalization into0..1. Claims restrict ordering to finite scores.

### mode_projection

Answer clears global why; Explain retains it. Domain answer explanations are returned unchanged, independent of mode.

### effect_metadata

register appends log; route appends chosen/global/escalation log. Access is reported, not filtered. math eval/check can reject parse/eval or independent disagreement.


### tests

#### Executed checks — 2026-10-31

Selected exact names: tests::global_math_first, tests::domain_by_coverage_and_escalation, tests::explain_mode_only_when_asked, tests::garbage_is_not_math, wave30_tests::finite_ties_declines_and_threshold. All selected native commands ran twice debug and twice release with matching sorted named outcomes (12 distinct tests, 48 positive executions across subsystem). Five compiled assertion mutants fail with exit101; restored byte-exactly and rerun green. Per-source associations appear in external source-test-map.json.

Controls change expected parse state, VM persisted value, suite factory count, SHA known digest and routing tie winner. These are compiled assertion controls exercising real code, not claims of implementation-mutant completeness. lib.rs is compile/type identity evidence only.

No frozen suites, Monte Carlo or recursion-heavy EDGE runs. No speed claim. Scoped Clippy limits retained externally; lexical syntax generated twice identically.
