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

# 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

- **kind:** groupant_fragment
- **status:** partial source bound model
- **source:** [`qagen/src/select.rs`](https://github.com/ElamurAI/mova-free/blob/main/qagen/src/select.rs)
- **source SHA-256:** `0c35caf4eda91c0a…`
- **covers:** 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. (bytes 9177–10499)
- **part of:** [qagen-select](https://md.groupants.elamur.ai/free/en/mova/qagen/src/select.rs.groupant/)
- **repository folder:** [`qagen/src/select.rs.groupant/pipeline.groupant`](https://github.com/ElamurAI/mova-free/tree/main/qagen/src/select.rs.groupant/pipeline.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 source model | [forward](#forward) |
| **ast** | partial | `../syntax.json` |
| **cost** | partial source model | [cost](#cost) |
| **descriptant** | partial source model | [epoch-memory](#epoch-memory) |
| **invariant** | partial source model | [invariant](#invariant) |
| **tests** | partial source model | [checks](#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](#behavior-complement) |
| `qagen-select-pipeline-reverse` | reverse_reconstruction | partial source model | [reverse-reconstruction](#reverse-reconstruction) |
| `qagen-select-pipeline-specialization` | selection_observation | partial source model | [specialization](#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.
