roundtrip-site-dictionary-codec
The groupant beside tools/roundtrip/src/blocks/site_learn.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-and-cost |
| descriptant | present | descriptant |
| invariant | partial | invariant-and-cost |
| 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 |
escape_order | escape_order | partial source derived model | escape_order |
markup_order | markup_order | partial source derived model | markup_order |
once_lock | once_lock | partial source derived model | once_lock |
training_boundary | training_boundary | partial source derived model | training_boundary |
Parts
Model text
descriptant
Description and epoch memory
esc doubles backslashes then escapes tabs/newlines; unesc interprets t/n, drops slash on unknown escaped scalar, preserves trailing slash. markup_of emits Markup pieces then each block's marks. load_dict parses tab records and first OnceLock set wins. copier_for selects corpus before colon. held_out_book checks corpus/part/final basename. main samples train blocks, filters held-out ids, ranks literals count*bytes with lexical ties, writes dictionary/lexicon before optional model adaptation.
Epoch 2026-10-31
Prospective model retained externally before edits. Existing production bytes preserved; only bounded inline tests appended to six owned files. Models distinguish byte reconstruction with residual from semantic understanding and persistent learning. Finite tests and compiled mutants support selected boundaries only. Source inspection identified noninjective projections and explicit admissibility restrictions; no bug repair or performance claim.
Combiner input is this source snapshot, syntax projection, models, costs and retained receipts. Proposed next epoch: target the stated unexecuted branches with bounded witnesses before expanding any claim. AST remains partial, macros opaque; no name resolution or proof.
approximant
Forward relation
esc doubles backslashes then escapes tabs/newlines; unesc interprets t/n, drops slash on unknown escaped scalar, preserves trailing slash. markup_of emits Markup pieces then each block's marks. load_dict parses tab records and first OnceLock set wins. copier_for selects corpus before colon. held_out_book checks corpus/part/final basename. main samples train blocks, filters held-out ids, ranks literals count*bytes with lexical ties, writes dictionary/lexicon before optional model adaptation.
Domain: String codec all UTF-8. Count/saved-byte products representable. Pure helpers only; CLI learning, model adaptation, global installation and filesystem writes unexecuted.
No executable percentage surrogate is supplied: these categorical codec/effect observations have no justified lossy metric. Future caps are 1/2/5/10% only after defining metric, zero behavior and differential reference.
composition
Local composition
esc doubles backslashes then escapes tabs/newlines; unesc interprets t/n, drops slash on unknown escaped scalar, preserves trailing slash. markup_of emits Markup pieces then each block's marks. load_dict parses tab records and first OnceLock set wins. copier_for selects corpus before colon. held_out_book checks corpus/part/final basename. main samples train blocks, filters held-out ids, ranks literals count*bytes with lexical ties, writes dictionary/lexicon before optional model adaptation.
Children scope selected internal mechanisms by byte ranges; remaining branches are covered only by the parent partial model. Their costs are included in parent costs, not added again. Shared values and caller order are those named above; sibling fragments are tagged independent where no direct call is named.
catalog
Source-bound typed models
Each section is a partial source-derived relation on the bound snapshot and declared domain; finite checks are falsification evidence, not a universal proof. Observation horizon is one call unless history is explicitly named.
behavior_complement
esc output cannot contain literal tabs/newlines. markup_of excludes non-Markup pieces. Held-out predicate does not classify arbitrary filenames outside corpora/Tanakh parts. No persistent-learning claim from codec checks.
Domain and held state: String codec all UTF-8. Count/saved-byte products representable. Pure helpers only; CLI learning, model adaptation, global installation and filesystem writes unexecuted.
Status: partial source-derived model. Oracle: the named scoped tests in tests.md; unexercised branches remain inspection hypotheses.
reverse_reconstruction
unesc(esc(s))=s. For arbitrary encoded input, unesc is noninjective: unknown slash escapes and literal characters can coincide. markup list loses original piece/block placement; dictionary serialization loses counts and rejected candidates.
Domain and held state: String codec all UTF-8. Count/saved-byte products representable. Pure helpers only; CLI learning, model adaptation, global installation and filesystem writes unexecuted.
Status: partial source-derived model. Oracle: the named scoped tests in tests.md; unexercised branches remain inspection hypotheses.
escape_order
Backslash must be escaped before tab/newline; trailing slash survives unesc.
Domain and held state: String codec all UTF-8. Count/saved-byte products representable. Pure helpers only; CLI learning, model adaptation, global installation and filesystem writes unexecuted.
Status: partial source-derived model. Oracle: the named scoped tests in tests.md; unexercised branches remain inspection hypotheses.
markup_order
Pieces precede all inline marks even if page render order interleaves them.
Domain and held state: String codec all UTF-8. Count/saved-byte products representable. Pure helpers only; CLI learning, model adaptation, global installation and filesystem writes unexecuted.
Status: partial source-derived model. Oracle: the named scoped tests in tests.md; unexercised branches remain inspection hypotheses.
once_lock
load_dict reads/parses even when prior set exists; ignores failed set and returns Ok.
Domain and held state: String codec all UTF-8. Count/saved-byte products representable. Pure helpers only; CLI learning, model adaptation, global installation and filesystem writes unexecuted.
Status: partial source-derived model. Oracle: the named scoped tests in tests.md; unexercised branches remain inspection hypotheses.
training_boundary
no-lin returns after markup/hebrew writes; punct-only returns after model/annotation and punct write.
Domain and held state: String codec all UTF-8. Count/saved-byte products representable. Pure helpers only; CLI learning, model adaptation, global installation and filesystem writes unexecuted.
Status: partial source-derived model. Oracle: the named scoped tests in tests.md; unexercised branches remain inspection hypotheses.
tests
Actual checks
blocks::site_learn::tests::escaped_literals_come_back
The listed parent/source tests exercise only their named mechanisms; other model statements are source inspection. Sixteen selected actual roundtrip library tests passed twice debug and twice release (64 exact-name executions), with identical sorted test outcomes. Eight compiled production-behavior mutants, one per source, failed assertions; exact originals were restored and the selected check passed. No assertion-only mutants or surviving compiled mutants. An initial mutation selector was ambiguous and stopped before writing that source; corrected selector retained separately.
Raw logs, numeric statuses, original/restored hashes, prospective.md, native-commands.json and syntax pairs: $MOVA_DATA/runs/octopus-wave32-rt_blocks-2026-10-31. No live model/corpus/site/learning workflow or full pipeline was executed.
invariant-and-cost
Invariants and cost
esc output cannot contain literal tabs/newlines. markup_of excludes non-Markup pieces. Held-out predicate does not classify arbitrary filenames outside corpora/Tanakh parts. No persistent-learning claim from codec checks.
unesc(esc(s))=s. For arbitrary encoded input, unesc is noninjective: unknown slash escapes and literal characters can coincide. markup list loses original piece/block placement; dictionary serialization loses counts and rejected candidates.
Cost
esc/unesc O(bytes) output; markup_of O(pieces+marks+copied bytes). Dictionary counts O(L log U), ranking O(U log U), cap4096 after count>=3,len>=4. Full main costs corpus scan, annotation and adaptation outside measured scope.
Integer additions/products and allocation sizes must fit native types. Floating costs require finite values; no throughput or all-input guarantee follows from synthetic tests.
This page in Markdown â https://md.groupants.elamur.ai/free/en/mova/tools/roundtrip/src/blocks/site_learn.rs.groupant/