qagen-select-pipeline
The groupant beside qagen/src/select.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 source model | forward |
| ast | partial | ../syntax.json |
| cost | partial source model | cost |
| descriptant | partial source model | epoch-memory |
| invariant | partial source model | invariant |
| tests | partial source model | checks |
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 |
|---|---|---|---|
qagen-select-pipeline-complement | behavior_complement | partial source model | behavior-complement |
qagen-select-pipeline-reverse | reverse_reconstruction | partial source model | reverse-reconstruction |
qagen-select-pipeline-specialization | selection_observation | partial source model | specialization |
Model text
forward
Sum all paragraph sentence counts per book before filters. Eligible unskipped indices form dialogue/narration pools and caps. Apply quotas, assign d=min(floor(k/2),D), n=min(k-d,N), d=min(k-n,D), rank each pool with seeds seed and seed xor 0x5eed, then sort selected indices.
behavior-complement
Exclude ineligible/skip-key paragraphs and duplicate indices. Odd quota initially favors narration; deficits fill from the other pool. Supplied Para words/dialogue are authoritative; select does not normalize them.
reverse-reconstruction
All Para/Pick/skip triples with the same selected index set form the preimage; arbitrary title/author changes are compatible antecedents. Output indices alone do not recover text, rejected rows, seed or quota weights.
invariant
Source-bound operational relation over supplied finite inputs; deterministic observations under fixed order and seed. No corpus/distribution assumption. Integer quota arithmetic assumes 32/64-bit usize.
cost
Combine quota cost with O(P log B+P log P+key bytes) ranking/grouping and O(P+B) temporary storage. Addressable stored sentence vectors bound aggregate sentence counts.
specialization
Type selection_observation: scoped observation above, exact intended relation, no approximation-error budget asserted.
checks
selection_order_filter_skip_balance_and_rounds. See ../evidence.md for actual profiles and negative controls.
epoch-memory
2026-10-30: model written from the existing mechanism before numerical repair. Source hash "0c35caf4eda91c0a5d36bce728f3846b360b483a66fa4ca3c884964839cd2554". Finite witnesses constrain this relation, not a general proof.
This page in Markdown โ https://md.groupants.elamur.ai/free/en/mova/qagen/src/select.rs.groupant/pipeline.groupant/