Elamur Groupants⌕
☰

cycle-db

The groupant beside tools/cycle/src/db.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
approximantpartialmodel.md
astpartialsyntax.json
compositionpartialComposition
costpartialinvariant-and-cost
descriptantpresentdescriptant
invariantpartialinvariant-and-cost
testsbounded or representationtests

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
behavior_complementbehavior_complementpartial source derived modelbehavior_complement
reverse_reconstructionreverse_reconstructionpartial source derived modelreverse_reconstruction
vote_ordervote_orderpartial source derived modelvote_order
tree_domaintree_domainpartial source derived modeltree_domain
heldout_first_sourceheldout_first_sourcepartial source derived modelheldout_first_source
effect_prefixeffect_prefixpartial source derived modeleffect_prefix

Parts

Model text

descriptant

cycle-db

Epoch 2026-10-31

Prospective inspection identified this relation before additions: blocks takes first sent_id per double-newline block. update merges by id preserving positions, renames current before history/log append. agree picks strongest newest base, aggregates weighted head/relation votes and falls back if tree_ok fails. same_text whitespace-normalizes and copies lexicographically first matching id. training_file excludes heldout ids and takes first database occurrence.

The production implementation is unchanged; only selected inline tests are appended. Source-bound syntax is generated twice and compared. Native checks exercise bounded helpers; entry orchestration, teacher calls, models and corpora remain source-derived. Partial syntax is not semantic proof. Preserve failure prefixes and ambiguity when refining this model.

Epoch 2026-11-01

Implemented explicit content-bound reviewed selection, separate train/dev authorization, full-tag/head preservation after agree, and no-separator normalization with preamble ownership. A real old-vote negative control demonstrates why a current-only correction is lost. Legacy update effects outside reviewed selection still lack a multi-file transaction. Bounded tests do not establish semantic quality.

approximant

Forward relation

blocks takes first sent_id per double-newline block. update merges by id preserving positions, renames current before history/log append. agree picks strongest newest base, aggregates weighted head/relation votes and falls back if tree_ok fails. same_text whitespace-normalizes and copies lexicographically first matching id. training_file excludes heldout ids and takes first database occurrence.

Composition

update establishes current/history/log consumed by agree/trainer; failures may leave inconsistent observations. same_text joins update then update_prag. training_file shares ids_of. Children isolate commit and vote boundaries.

Epoch 2026-11-01 current relation

blocks now separates each sent_id and carries contiguous preamble comments to its following sentence. Current writes validate persistent reviewed selection; update/prag reject conflicting selected content. agree applies the entire selected tree after its ordinary source-weight vote. training_file intersects explicit train decisions with heldout exclusions, and strict primary policy rejects unreviewed secondary DBs. Reviewed promotion/snapshot/rollback lives in reviewed.rs; legacy update remains nontransactional.

catalog

Typed observations: cycle-db

Subject: tools/cycle/src/db.rs, SHA-256 34f08db359c4d620f91bb9b5a586653ff948019524e4b21ff1b21f37c413c5b9. Domain: bounded source inputs, declared filesystem/environment state and normal allocations. Each view is a partial source-derived relation, not a universal proof. Observation is one helper call or the explicitly described trace. Checks are in tests.md; unexecuted effects remain gaps.

behavior_complement

Successful unique-id update preserves existing positions, appends new ids once. with_drafts excludes replacement of known DB ids but permits repeated new draft ids. No rollback guarantee.

Scope: the bound source interval and stated assumptions. Evidence: source inspection plus the checks explicitly named in tests.md; no finite check establishes all inputs.

reverse_reconstruction

Current trees admit arbitrarily many replaced histories. Added/replaced counts constrain event multiplicity, not bodies. Voted tree admits many weighted multisets and invalid-vote fallback antecedents.

Scope: the bound source interval and stated assumptions. Evidence: source inspection plus the checks explicitly named in tests.md; no finite check establishes all inputs.

vote_order

Best maximizes (weight,time,order). Candidate score=(sum weights,max time,max order), independent maxima possibly from different versions. Equal score chooses largest ordered key.

Scope: the bound source interval and stated assumptions. Evidence: source inspection plus the checks explicitly named in tests.md; no finite check establishes all inputs.

tree_domain

Empty false; exactly one root, heads≤W and no self-head precede W+1-link traversals. Detached cycles reject despite one root.

Scope: the bound source interval and stated assumptions. Evidence: source inspection plus the checks explicitly named in tests.md; no finite check establishes all inputs.

heldout_first_source

Explicit DB first then configured paths; exclude ids before seen insertion. No guarantee of text-level heldout dedup.

Scope: the bound source interval and stated assumptions. Evidence: source inspection plus the checks explicitly named in tests.md; no finite check establishes all inputs.

effect_prefix

Directory creation precedes input read; old-current read errors become empty. Rename precedes second input read, history and log append. same_text prag follows tree commit.

Scope: the bound source interval and stated assumptions. Evidence: source inspection plus the checks explicitly named in tests.md; no finite check establishes all inputs.

reviewed_selection

Behavior complement: conflicting or stale selected content excludes normal DB writes/training; full selected tags/heads cannot be replaced by ordinary votes. Reverse reconstruction: current alone admits many histories; complete before snapshot and transaction inventory constrain prior bytes under quiescence. SHA256 binds byte content, not semantics or operator identity.

tests

Checks and limits

Legacy db::tests and db::wave33_tests remain. reviewed::tests now executes real agree old-vote conflict and selected full-tree preservation, conflicting update/prag rejection, train/dev/heldout filtering, duplicate/hash/header/phase rejection and interrupted snapshot rollback on synthetic temporary DBs. joined_preambles_belong_to_following_sentence checks metadata ownership without blank separators. Run with one test thread due to existing process-environment fixtures.

No canonical DB, model, corpus, GPU, teacher or heldout evaluation is executed. Source-bound syntax and model declarations remain partial; no universal durability or semantic accuracy proof.

evidence

Wave33 evidence — 2026-10-31

Across this nine-source slice, 14 exact native names passed twice in debug and twice in release (56 runs); sorted target-qualified outcomes agree. Six compiled behavior controls fail named assertions and exact restored bytes pass again. One exploratory parser-count control failed by unwrap panic; it was restored and replaced by a form-column assertion control. No assertion-only control is counted.

Nine syntax projections were generated twice and byte compared. Production source prefixes match the base exactly; four files append only formatted cfg(test) blocks. Local groupants validation reports valid=true, zero diagnostics. Counts: nine source roots, ten scoped children, 114 typed views.

See tests.md for this source's precise executed or representation-only coverage. Native evidence does not apply to ignored live teacher or lesson execution. No teacher/API, model/corpus, learning or benchmark CLI was run. Receipts retain numeric statuses, exact names, log/source hashes, original backups, unique mutation replacements and restoration assertions. The external bundle is named octopus-wave33-cycle-2026-10-31.

Epoch 2026-11-01

Native synthetic reviewed selection test now executes actual db::agree conflict/overlay paths, normal update/prag conflict rejection, training split/heldout exclusions and interrupted rollback. Separate joined-preamble regression protects newdoc/version/source metadata. Current suite results are retained in the external DB policy report; historical wave33 evidence above is unchanged.

invariant-and-cost

Invariant and cost

No three-file transaction. Draft union uses snapshot known ids, not within-draft dedup. Vote requires one root and acyclic in-range nonself heads; fallback base is not validated. Weights 8/4/2/1 follow source names.

B bytes,S sentences,V versions,W words: O(B+S log S) merge, O(V W log V+W²) vote/tree check, output/history I/O. same_text O(B+S log S). train_dbs path dedup O(D²).

No executable percentage surrogate is claimed: effects, categorical acceptance and report text have no justified approximate metric here. Future profiles require a useful metric, zero case, reference and evidence at caps 1/2/5/10%.

Reviewed selection

One full-tree/prag policy batch overrides votes without changing source weights. Guards validate selected hashes/current equality before effects. Parsing is linear in bytes and sentence boundaries; policy adds full-file maps and selected structural checks. Explicit reviewed promotion/rollback require quiescent callers and use full snapshots, staging and journal; no cross-file atomicity.

This page in Markdown → https://md.groupants.elamur.ai/free/en/mova/tools/cycle/src/db.rs.groupant/