Elamur GroupantsโŒ•
โ˜ฐ

mova-serve-text

The groupant beside tools/mova-serve/src/text.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
ApproximantpartialApproximant
Astpartialsyntax.json
Costsymbolic source derivedCost
DescriptantpresentDescriptant
InvariantpartialInvariant
Testsexecuted bounded checksTests

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.

relationtypelabelwhere
Behavior complementbehavior complementpartial source derived modelBehavior complement
Reverse reconstructionreverse reconstructionpartial source derived modelReverse reconstruction
Model presencemodel presencepartial source derived modelModel presence

Model text

Descriptant

Text helpers: the normalised text (line ends, runs of spaces, empty lines), URL percent-coding, HTML escaping, FNV-1a 64, and the UTC calendar (Hinnant's civil_from_days).

Approximant

normalize = join("\n", nonempty(map(collapse_spaces โˆ˜ trim, lines))); url_decode โˆ˜ url_encode = id; utc(s) = civil(s / 86400).

Invariant

normalize is idempotent and keeps every word; the codecs round-trip; the hash and the calendar are pure functions.

Cost

Linear in the text.

Behavior complement

No Unicode normalisation (NFC), no locale, no time zones besides UTC.

Reverse reconstruction

normalize loses only space amounts and empty lines; url_decode inverts url_encode exactly; civil is a bijection on days.

Model presence

Every function is total on its input type.

Tests

text::tests: normalisation (with a negative control: a changed word is not normalised away), codec round trips, the calendar on 1970, 2000-02-29 and 2026-11-06, the hash of the empty and one-letter strings.

Provenance

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