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

# annot-batch-envelopes

The groupant beside annot/src/batch.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_fragment
- **status:** partial source bound model
- **source:** [`annot/src/batch.rs`](https://github.com/ElamurAI/mova-free/blob/main/annot/src/batch.rs)
- **source SHA-256:** `511700bb12c59c2e…`
- **covers:** request builds the compatibility envelope; parse_results consumes replies with text-only, last-id-wins semantics. (bytes 1809–6541)
- **part of:** [annot-batch](https://md.groupants.elamur.ai/free/en/mova/annot/src/batch.rs.groupant/)
- **repository folder:** [`annot/src/batch.rs.groupant/envelopes.groupant`](https://github.com/ElamurAI/mova-free/tree/main/annot/src/batch.rs.groupant/envelopes.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 | [approximant](#approximant) |
| **ast** | partial | `../syntax.json` |
| **descriptant** | present | [descriptant](#descriptant) |
| **invariant** | partial | [invariant](#invariant) |
| **tests** | executed 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) |
| `reply_overwrite` | reply_overwrite | partial source derived model | [reply_overwrite](#reply-overwrite) |
| `pricing_threshold` | pricing_threshold | partial source derived model | [pricing_threshold](#pricing-threshold) |
| `preparation_effects` | preparation_effects | partial source derived model | [preparation_effects](#preparation-effects) |
| `timestamp_projection` | timestamp_projection | partial source derived model | [timestamp_projection](#timestamp-projection) |

## Model text


### descriptant

#### annot-batch-envelopes

request builds the compatibility envelope; parse_results consumes replies with text-only, last-id-wins semantics.

Epoch 2026-10-31: scoped source-derived model. Byte scope [1809,6541); AST is shared partial projection, not a separate semantic proof.

### approximant

#### Scoped forward relation

request builds the compatibility envelope; parse_results consumes replies with text-only, last-id-wins semantics.

Parent composition and symbolic resource costs remain in ../approximant.md. No executable percentage surrogate is supplied for this categorical/effect scope.

### invariant

#### Scoped fragment: envelopes

Local scope: request builds the compatibility envelope; parse_results consumes replies with text-only, last-id-wins semantics.

The following parent relations supply composition context; claims apply only where this byte scope implements the stated operation. Other operations remain sibling/parent obligations.

#### Invariants and limits

With valid unique item ids, complete matching drafts and in-range chunks, request k refers to exactly that chunk. Parsing skips thinking blocks and preserves text-block concatenation order. These assumptions are unchecked on deserialized State; indexing can panic. The two preparation writes are not atomic together.

- No prepare/apply/blind end-to-end fixture; optional training, corpus append and external teacher are unexecuted.
- No corrupt State index/panic or numeric overflow injection.

### models

## Scoped fragment: envelopes

Local scope: request builds the compatibility envelope; parse_results consumes replies with text-only, last-id-wins semantics.

The following parent relations supply composition context; claims apply only where this byte scope implements the stated operation. Other operations remain sibling/parent obligations.

### behavior_complement

For every succeeded Reply, text excludes non-text content and usage missing/non-u64 fields contributes zero. Failed result types cannot become success Reply. Unknown pricing model has compatibility zero; no subscription cost inference. prepare rejects non-Codex model before flow checking or output writes.

### reverse_reconstruction

The preimage of a result map includes any blank lines, any overwritten earlier duplicate ids, and arbitrary discarded thinking blocks; final occurrences must decode to the observed Reply/errors. State roundtrip recovers serialized fields, not external files or teacher execution. Cost alone has many usage/model antecedents.

### reply_overwrite

Result ids are BTreeMap keys; last line for each id wins, while any malformed earlier JSON aborts the whole parse.

### pricing_threshold

Haiku5.5 prompt=input+cache_read+cache_write uses strict >100000. Dated eight-digit suffix is removed before lookup. Unknown model returns 0; arithmetic has no adversarial-overflow assurance.

### preparation_effects

Model then patch-flow then hint-load failure precedence precedes serialization and request/state writes. Empty items makes empty JSONL and zero chunks. Missing drafts panic before writes.

### timestamp_projection

epoch reads fixed numeric slices and optional decimal fraction; it does not validate separators/calendar/timezone. processing_time may be negative and missing status returns None. Seconds are f64, not measured worker duration.


### tests

#### Scoped fragment: envelopes

Local scope: request builds the compatibility envelope; parse_results consumes replies with text-only, last-id-wins semantics.

The following parent relations supply composition context; claims apply only where this byte scope implements the stated operation. Other operations remain sibling/parent obligations.

#### Bounded source evidence

Selected actual-code tests (twice debug, twice release):

- batch::tests::request_has_cached_fixed_block_and_same_prompt
- batch::tests::results_parse_and_patch
- batch::tests::state_roundtrip_and_epoch
- batch::wave27_tests::duplicate_result_last_wins_and_price_boundary

Run command: cargo test -p annot --bin annot --test codex_batches [--release] -- --test-threads=1 --skip ann:: --skip bfs_transfer_checks. The fake executable fixture uses temporary files, no live teacher/API. Paired named outcomes must match. Six compiled production mutations target batch last-wins, llm closed-set, repair shape gate, hints severity, main seed alias and queue resume. Each compilation exits0, test exits101, exact source restored and focused positive rerun exits0. The fixture itself has no separate mutation. Existing repair test may early-return without dictionary; independent added repair test always runs.

Unexecuted limits:
- No prepare/apply/blind end-to-end fixture; optional training, corpus append and external teacher are unexecuted.
- No corrupt State index/panic or numeric overflow injection.
