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

# treeagree-tree

The groupant beside tools/treeagree/src/tree.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:** [`tools/treeagree/src/tree.rs`](https://github.com/ElamurAI/mova-free/blob/main/tools/treeagree/src/tree.rs)
- **source SHA-256:** `6e034fd13c47961f…`
- **repository folder:** [`tools/treeagree/src/tree.rs.groupant`](https://github.com/ElamurAI/mova-free/tree/main/tools/treeagree/src/tree.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 | `model.md` |
| **ast** | partial | `syntax.json` |
| **composition** | partial | [Composition](#composition) |
| **cost** | partial | [invariant-and-cost](#invariant-and-cost) |
| **descriptant** | present | [descriptant](#descriptant) |
| **invariant** | partial | [invariant-and-cost](#invariant-and-cost) |
| **tests** | 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) |
| `shape_precedence` | shape_precedence | partial source derived model | [shape_precedence](#shape-precedence) |
| `punctuation_geometry` | punctuation_geometry | partial source derived model | [punctuation_geometry](#punctuation-geometry) |
| `lex_tie` | lex_tie | partial source derived model | [lex_tie](#lex-tie) |
| `length_domain` | length_domain | partial source derived model | [length_domain](#length-domain) |

## Parts

- [treeagree-tree-arc-crossing](https://md.groupants.elamur.ai/free/en/mova/tools/treeagree/src/tree.rs.groupant/arc-crossing.groupant/)

## Model text


### descriptant

#### Descriptant

blocks groups comments/rows; final comments-only suffix drops while a blank-terminated comments block remains. read_ref enforces ten columns and sequential ids then UPOS/FEATS/DEPREL/HEAD parsing; read_wit defaults missing fields. shape checks paired range/self/root-relation first, root count next and bounded parent walks last. violations emits first registry complaint per token, POS mismatches, then one shape error or punctuation crossings. no_worse requires shape and subset by exact Bad equality. Lex chooses maximum count then smallest key.

##### Epoch 2026-10-31

Prospective source reading identified conditional input alignment, information loss and failure order before tests. Existing production code is retained; added tests use actual helpers. Finite results update this source-bound model, not all parser/corpus semantics.

No executable percentage surrogate has a justified observation metric for these categorical/effectful APIs. Future profiles require metric, domain and real-reference evidence at caps 1/2/5/10%; no higher cap. Syntax is partial lexical Rust projection without macro expansion or semantic resolution.

### approximant

## Forward approximant

blocks groups comments/rows; final comments-only suffix drops while a blank-terminated comments block remains. read_ref enforces ten columns and sequential ids then UPOS/FEATS/DEPREL/HEAD parsing; read_wit defaults missing fields. shape checks paired range/self/root-relation first, root count next and bounded parent walks last. violations emits first registry complaint per token, POS mismatches, then one shape error or punctuation crossings. no_worse requires shape and subset by exact Bad equality. Lex chooses maximum count then smallest key.

### Composition

Child fragments model one narrow helper each; their correctness alone does not establish orchestration.

The containing source wires this scoped relation to its callers. Treeagree proposal→gate→commit and treebanks parse→match→collect→render are actual joins; parsecmp is an independent diagnostic path. The external group model distinguishes these tags.

### catalog

## Typed models for treeagree-tree

Subject: source SHA-256 `6e034fd13c47961fb03e46caddbd17d7ec53d236af64ea9cb2a46bdc3834f8fd`; manifest supplies exact source/byte scope. Domain: admitted states in forward model, nonoverflow arithmetic and successful allocations. Observation: one terminating invocation, except explicitly described file trace. Source-derived partial relations; named finite tests constrain selected cases only. Each entry holds arguments and environment fixed except its stated intervention.

### behavior_complement

With equal-length head/rel vectors, shape rejects self/out-of-range before cycles. no_worse never accepts malformed shape even when same error is in base. Successful read_ref does not establish shape validity.

Operator: inner exclusion on admitted domain. Evidence: source branch derivation plus tests.md; unexercised branches remain hypotheses. Oracle: evaluate the scoped actual helper on admissible fixtures and compare this observation. No universal proof.

### reverse_reconstruction

Parsed tokens preserve raw columns but comments metadata selects first matching key. Lex summaries admit permutations and count-preserving corpora; max/tie observations do not identify full learned distribution.

Operator: compatible antecedent relation, retaining ambiguity. Evidence: source branch derivation plus tests.md; unexercised branches remain hypotheses. Oracle: evaluate the scoped actual helper on admissible fixtures and compare this observation. No universal proof.

### shape_precedence

Per-token Head then RootRel precede Roots then Cycle; first ordered failure is reported, not complete graph diagnosis.

Operator: specialized observation relation under the stated fixed inputs. Evidence: source branch derivation plus tests.md; unexercised branches remain hypotheses. Oracle: evaluate the scoped actual helper on admissible fixtures and compare this observation. No universal proof.

### punctuation_geometry

crossed uses strict endpoint interleaving, shared endpoints and root arcs are not crossings.

Operator: specialized observation relation under the stated fixed inputs. Evidence: source branch derivation plus tests.md; unexercised branches remain hypotheses. Oracle: evaluate the scoped actual helper on admissible fixtures and compare this observation. No universal proof.

### lex_tie

Maximum frequency ties choose lexicographically smallest key, independent of insertion order on fixed nonoverflow counts.

Operator: specialized observation relation under the stated fixed inputs. Evidence: source branch derivation plus tests.md; unexercised branches remain hypotheses. Oracle: evaluate the scoped actual helper on admissible fixtures and compare this observation. No universal proof.

### length_domain

shape zips heads/rels without equal-length validation; violations indexes by tokens. Valid lengths are a precondition, not guaranteed rejection behavior.

Operator: specialized observation relation under the stated fixed inputs. Evidence: source branch derivation plus tests.md; unexercised branches remain hypotheses. Oracle: evaluate the scoped actual helper on admissible fixtures and compare this observation. No universal proof.

### tests

#### Bounded evidence — 2026-10-31

Source `tools/treeagree/src/tree.rs` at SHA-256 `6e034fd13c47961fb03e46caddbd17d7ec53d236af64ea9cb2a46bdc3834f8fd`. Selected actual-source tests in `treeagree`:

- `tests::rules_fire_on_evidence_and_only_then`
- `tests::gates_reject_bad_trees`
- `tests::swap_needs_both_edits`
- `tests::retag_rides_with_the_relation`

These names passed twice in debug and twice in release; the complete treebank/comparison slice has 25 target-qualified names and identical sorted outcomes in all four runs. Ten compiled behavior mutations (one per owned source) failed named runtime assertions; exact original/restored SHA-256 equality and positive reruns were checked. Zero assertion-only mutants, zero surviving exploratory mutants, zero production fixes. Fresh raw logs, numeric exits, commands and mutation hashes are external in the wave33 trees receipt set.

##### Scope and gaps

Only named finite assertions cover selected inputs; other branches and invalid-domain behavior remain source-derived. No corpus, network, downloads, annotation model, live teacher, full release build or site execution. The treebanks join is entirely in memory and parsecmp uses a tiny uniquely named temporary directory. Treeagree Registry::load uses the embedded UD registry. Tests are finite CPU observations, not universal semantic proof, title-match quality estimates or corpus accuracy.

### invariant-and-cost

#### Invariant and cost

Parsing O(bytes); shape O(n²) parent hops and O(n) temporary vectors in callers; crossings O(n²) worst. Registry cost additional; Lex learning ordered maps O(tokens*log distinct) with string copies, get scans candidate counts. u32 frequency counters assume no overflow.

With equal-length head/rel vectors, shape rejects self/out-of-range before cycles. no_worse never accepts malformed shape even when same error is in base. Successful read_ref does not establish shape validity.

The complement and specialized catalog constrain preserved coordinates and effect boundaries. Empty/malformed domains are only guaranteed where explicitly admitted. No whole-program cost bound follows from a helper bound.
