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
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 |
| ast | partial | syntax.json |
| composition | partial | composition |
| cost | symbolic source derived | invariant |
| descriptant | present | descriptant |
| invariant | partial | invariant |
| tests | executed bounded checks | 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 |
reverse_reconstruction | reverse_reconstruction | partial source derived model | reverse_reconstruction |
stable_selection | stable_selection | partial source derived model | stable_selection |
nonfinite_gap | nonfinite_gap | partial source derived model | nonfinite_gap |
mode_projection | mode_projection | partial source derived model | mode_projection |
effect_metadata | effect_metadata | partial source derived model | effect_metadata |
Parts
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.
This page in Markdown โ https://md.groupants.elamur.ai/free/en/mova/layers/src/lib.rs.groupant/