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

# qagen-run-scheduler

The groupant beside qagen/src/run.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/run.rs`](https://github.com/ElamurAI/mova-free/blob/main/qagen/src/run.rs)
- **source SHA-256:** `a34e297bdb69e178…`
- **covers:** Build todo, read existing call count, reserve calls, dispatch workers, persist raw/accounting, check format and stop outer loops on errors. (bytes 4561–8461)
- **part of:** [qagen-run](https://md.groupants.elamur.ai/free/en/mova/qagen/src/run.rs.groupant/)
- **repository folder:** [`qagen/src/run.rs.groupant/scheduler.groupant`](https://github.com/ElamurAI/mova-free/tree/main/qagen/src/run.rs.groupant/scheduler.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` |
| **composition** | partial source model | [composition](#composition) |
| **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-run-scheduler-complement` | behavior_complement | partial source model | [behavior-complement](#behavior-complement) |
| `qagen-run-scheduler-reverse` | reverse_reconstruction | partial source model | [reverse-reconstruction](#reverse-reconstruction) |
| `qagen-run-scheduler-reservation` | reservation | partial source model | [reservation](#reservation) |
| `qagen-run-scheduler-retry` | retry | partial source model | [retry](#retry) |
| `qagen-run-scheduler-failure-stop` | failure_stop | partial source model | [failure-stop](#failure-stop) |
| `qagen-run-scheduler-durability-gap` | durability_gap | partial source model | [durability-gap](#durability-gap) |

## Model text


### forward
Build todo, read existing call count, reserve calls, dispatch workers, persist raw/accounting, check format and stop outer loops on errors.

### invariant
Only first-stage format rejection requests retry; second-stage rejection never requests a third call. Transport errors exit current batch.

### behavior-complement
Universe: finite supplied values and filesystem observations, return values, errors and writes in this scope. No scheduler transport seam or live execution added. Stop flag cannot cancel already in-flight calls or prevent every retry after another worker fails.

### reverse-reconstruction
F^-1(y) contains all compatible inputs and initial states yielding y. Identical durable files/logs admit many worker schedules. Missing accounting cannot distinguish never-called from interrupted persistence. No complete inverse solver or unique recovery claim.

### cost
O(B*W) selection plus resume/read_calls; J threads and worker-sized prompts/text. Mutex serializes append and check while its guard remains live.

### composition
Reservation before ask, rename before append, append before check. Error aggregation is schedule-dependent; there is no transaction.

### reservation
Reservation counts attempts including failures; prior count >= cap prevents ask.

### retry
stage=1 and format.is_some() ->2; all other successful checks ->0.

### failure-stop
Global stop is checked at outer loop, not each inner retry.

### durability-gap
Rename-success/append-failure leaves raw without accounting. No fsync claim.

### checks
Finite synthetic Rust tests in owned sources; broad offline qagen lib suite twice per profile, explicitly skipping lemma::tests::doubt_with_en_model. Compiled production mutations reach named assertion failures. Exact outcomes and hashes are in the file groupant evidence.md.

### epoch-memory
2026-10-30 prospective model saved before repairs. Old-code witnesses demonstrated token overflow, JSON null from float overflow, premature report replacement, and masked metadata errors. Ordinary output keys, finite negative history and legacy Option lookup semantics are preserved. Scheduler was not redesigned.

### limitations
Partial source models and finite observations, not proof of all concurrent/filesystem states. Syntax projection is partial; macros opaque. Allocation failure, races and crashes may prevent completion. No live teacher/model/corpus/database was used. No useful certified metric for a numerical surrogate of these error-sensitive operations was identified; executable approximant is absent, with no invented error budget or speed claim.
