treeagree-dispute
The groupant beside tools/treeagree/src/dispute.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 | model.md |
| ast | partial | syntax.json |
| composition | partial | Composition |
| cost | partial | invariant-and-cost |
| descriptant | present | descriptant |
| invariant | partial | invariant-and-cost |
| tests | 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 |
option_identity | option_identity | partial source derived model | option_identity |
answer_language | answer_language | partial source derived model | answer_language |
commit_boundary | commit_boundary | partial source derived model | commit_boundary |
coordinate_transport | coordinate_transport | partial source derived model | coordinate_transport |
Parts
Model text
descriptant
Descriptant
disputes starts option A at draft head/relation, then appends unique different heads from witnesses, excluding punctuation and unknown relations; head zero forces Root. parse_answers accepts exactly three whitespace fields and leading S in sentence index; trailing punctuation around letter is stripped. apply accumulates selected non-A alternatives, computes no_worse against draft, then commits whole sentence or returns zero. Repeated picks increase return count even if same word repeats. groups uses chunks(per); by_id overwrites repeated sentence ids.
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
disputes starts option A at draft head/relation, then appends unique different heads from witnesses, excluding punctuation and unknown relations; head zero forces Root. parse_answers accepts exactly three whitespace fields and leading S in sentence index; trailing punctuation around letter is stripped. apply accumulates selected non-A alternatives, computes no_worse against draft, then commits whole sentence or returns zero. Repeated picks increase return count even if same word repeats. groups uses chunks(per); by_id overwrites repeated sentence ids.
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-dispute
Subject: source SHA-256 1c2bb1e172fd4dfcc5ea465d577e94607347635f93f1deb0aae3e5e648a43ff2; 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
Under admitted aligned valid indices, punctuation tokens never create disputes and A/unknown picks cannot alone commit edits. A newly introduced full Bad value prevents all candidate writes. This inner exclusion does not validate arbitrary public Dispute objects.
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
A committed tree admits every draft/pick history whose last effective picks yield those heads and pass no_worse. Silent or rejected picks and repeated identical options are indistinguishable from final state; return count constrains attempts, not unique changed words.
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.
option_identity
Duplicate witness heads are collapsed irrespective of relation; first surviving head relation wins, so witness order can affect choices.
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.
answer_language
Exactly three fields required; S prefix may repeat, first alphabetic uppercase option prefix selects A..D; OK yields empty picks.
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.
commit_boundary
Candidate vectors change before validation but original Sent changes only after nonzero picks and successful no_worse.
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.
coordinate_transport
Prompt local sentence index maps through group ids; word positions are one-based while options use zero-based indices.
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/dispute.rs at SHA-256 1c2bb1e172fd4dfcc5ea465d577e94607347635f93f1deb0aae3e5e648a43ff2. Selected actual-source tests in treeagree:
dispute::tests::answers_parse_and_silence_keeps_the_drafttests::rules_fire_on_evidence_and_only_thentests::gates_reject_bad_treestests::swap_needs_both_editstests::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
For n words, w witnesses and d disputes, option generation O(nw²) worst-case uniqueness scans; apply O(pd+n²+registry) for p picks; prompt copies token text per group and formatting bytes. Domain requires per>0, aligned sentence arrays, valid dispute positions/heads and <=4 prompt options; allocation may fail.
Under admitted aligned valid indices, punctuation tokens never create disputes and A/unknown picks cannot alone commit edits. A newly introduced full Bad value prevents all candidate writes. This inner exclusion does not validate arbitrary public Dispute objects.
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.
This page in Markdown → https://md.groupants.elamur.ai/free/en/mova/tools/treeagree/src/dispute.rs.groupant/