Elamur GroupantsโŒ•
โ˜ฐ

qagen-main

The groupant beside qagen/src/main.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
approximantpartial source modelforward
astpartialsyntax.json
compositionpartial source modelcomposition
costpartial source modelcost
descriptantpartial source modelepoch-memory
invariantpartial source modelinvariant
testspartial source modelchecks

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.

idtypelabelwhere
qagen-main-behavior-complementbehavior_complementpartial source modelbehavior-complement
qagen-main-reverse-reconstructionreverse_reconstructionpartial source modelreverse-reconstruction
qagen-main-option-valuesoption_valuespartial source modeloption-values
qagen-main-duplicatesduplicatespartial source modelduplicates
qagen-main-effect-boundaryeffect_boundarypartial source modeleffect-boundary
qagen-main-teacher-docsteacher_docspartial source modelteacher-docs

Parts

Model text

model

qagen-main

forward

Parse command/positionals and key-value options, reject missing/unknown flags before dispatch, then select, prompt, run, gate, sample or fix operations.

invariant

Duplicate option retains last value. A following --token is not consumed as a value. Command whitelist is checked before file/model/database dispatch.

behavior-complement

Unknown flags cannot silently fall through. Parser does not implement -- terminator or --key=value. Semantic numeric errors can still occur after some dispatch reads; no universal effect-free validation claim.

reverse-reconstruction

Parsed option map loses duplicate overwritten values and original option ordering. Identical dispatch values admit defaults or explicit equal values.

cost

O(argument bytes) cloning and O(K log K) ordered insertion; downstream costs dominate, with unbounded supplied filenames and text sizes.

composition

opts -> validate_options -> command positional arity -> typed parsing and existing module calls. Fix prompt/run use checked batches; gate/select still load requested lemma model in real CLI.

option-values

Empty key or following --value errors; explicit empty-string value remains a value and numeric parse rejects it where required.

duplicates

Last duplicate wins intentionally preserved; BTreeMap imposes deterministic unknown-key error order.

effect-boundary

Whitelist errors occur before dispatch effects. CLI was tested only through pure helpers; live teacher/model/db operations prohibited.

teacher-docs

Command comments identify Codex CLI through mova-teacher and configured PRAG_MODEL; behavior transport remains unchanged.

checks

Synthetic embedded Rust tests, 1024 independent coverage cases, preflight sentinel artifacts, callback trace and compiled branch/arithmetic controls; debug and release twice, model-loading test explicitly skipped. See parent evidence.md for observed outcomes, not proof.

epoch-memory

Prospective model was saved before repair on 2026-10-30. Old source failed four library witnesses and one CLI witness. The tie control initially survived because [2,1,2] selects 2 for both first and last ties; the corrected [2,1] witness distinguishes them. Preserve this observation: duplicate-endpoint fixtures can hide tie regressions.

references

Original project implementation and rule v2: docs/context.md, qagen/src/gate.rs and qagen/src/run.rs. Model conventions: docs/groupants.md, docs/mathematical-modeling.md and docs/mathematical-modeling.md. No external solution code copied.

limitations

Finite local tests and partial syntax projections, no semantic AST or universal proof. Allocation failure and callback panic are outside successful-return model; filesystem races and write failures can interrupt publication. No live model/teacher/database/corpus used. No useful certified numeric surrogate is attached to these categorical/effectful interfaces; no invented error budget, substitution or speed claim.

evidence

Evidence, 2026-10-30

Source SHA256: 7d4410bf5d85e04c46475fe0fef9e8e5a24b44fc37973f8420b950517ef05222. External receipts: $MOVA_DATA/runs/octopus-wave20-qagen-2026-10-30/.

Old library witnesses: 49 passed, four failed, one model test explicitly filtered. Old CLI: duplicate-last-wins passed, missing-value witness failed. New final suites: 56 library tests and three CLI tests pass twice in debug and twice in release; one model-loading test explicitly skipped. Nine compiled production mutants reached named failing tests, source restored after each. A tie mutant initially survived the duplicate-endpoint witness; corrected fixture detects it. Strict focused Clippy and paired syntax projections recorded. No live model/teacher/database/corpus operations. Cover removes a content-reference Vec; no end-to-end speed claim.

External log hashes

prospective

Prospective qagen repairs

Domain: finite synthetic paragraphs/items, UTF-8 replies, local scratch filesystem and stub Lemmas. No live teacher/model/db/corpus. cover computes hit/content count, None for zero content; replacing collected content references by count/filtered iterator removes one allocation without changing f64 quotient. Pool can be skipped with zero content. doubt validates all one-based anchors first; valid-input callback order and count remain answer then each anchor, including duplicates (trait does not promise purity). Equal best coverage retains first anchor. Fallible try_doubt exposes invalid input, legacy doubt maps error to None.

Fixes try_new validates unique paragraph keys and item (paragraph,k) keys, membership, batch agreement and nonempty/in-range anchors; legacy new remains compatible. collect uses checked preparation, strict raw lookup and calls accounting before any output writes. Four artifact writes remain nontransactional; races/crashes outside scope. Gate uses UTF8-safe prefix lookup instead of byte slicing. Current threshold/tie decisions unchanged. Costs validation O((P+I) log(P+I)+anchors), cover O(A+S) expected hash time with O(S) pool, doubt sum of callback and cover costs.

CLI missing option values (including another option token) and unknown flags error before dispatch effects; duplicate values retain last-wins behavior. Pure parsing tests establish finite witnesses, not all external dispatch contracts. Codex teacher docs align existing transport.

Negative behavior relations: invalid anchors never invoke callback in try_doubt; Unicode junk never panics; accounting/raw preparation errors never replace artifact bytes. Inverse: coverage ratio admits many word lists and anchor permutations; fixed QA loses rejected text; parsed options lose overwritten duplicate values. Old-code witnesses and compiled mutations will demonstrate real gate failures; twice debug/release outcomes must match. No useful numerical surrogate for categorical/effectful operations, no generic error cap or measured speed claim planned.

This page in Markdown โ†’ https://md.groupants.elamur.ai/free/en/mova/qagen/src/main.rs.groupant/