cycle-db-commit
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
| component | label | where |
|---|---|---|
| Approximant | partial | Approximant |
| Ast | partial | ../syntax.json |
| Cost | partial | Invariant and cost |
| Descriptant | present | Descriptant |
| Invariant | partial | Invariant and cost |
| Tests | bounded or representation | Tests |
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.
| relation | type | label | where |
|---|---|---|---|
| Behavior complement | behavior complement | partial source derived model | Behavior complement |
| Reverse reconstruction | reverse reconstruction | partial source derived model | Reverse reconstruction |
| Duplicate index | duplicate index | partial source derived model | Duplicate index |
| Rename boundary | rename boundary | partial source derived model | Rename boundary |
| Validated input snapshot | validated input snapshot | partial source derived model | Validated input snapshot |
| Timestamp scope | timestamp scope | partial source derived model | Timestamp scope |
Model text
Descriptant
Cycle db commit
Descriptant
Prospective inspection identified this relation before additions: Merge current by id, write tmp, rename current, reread input, append history, append event log.
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.
Approximant
Forward relation
Check promotion lock and content-bound policy, read/validate one immutable incoming buffer, reject selected conflicts, merge by ID, write tmp and rename current, append history from the same buffer, append event log. Legacy cross-file effects remain ordered, not atomic.
Composition
This fragment isolates the stated helper relation; parent composition retains surrounding effects and failures.
Catalog
Typed observations: cycle-db-commit
Behavior complement
Successful unique-id replacement cannot append position; post-rename failure cannot imply unchanged current.
Scope: the bound source interval and stated assumptions. Evidence: source inspection plus the checks explicitly named in model.md#tests; no finite check establishes all inputs.
Reverse reconstruction
Old+final current admit overwritten intermediate incoming versions. Counts constrain multiplicity, history may retain bodies but may be partial.
Scope: the bound source interval and stated assumptions. Evidence: source inspection plus the checks explicitly named in model.md#tests; no finite check establishes all inputs.
Duplicate index
Initial map stores last index for duplicate id; incoming duplicates use updated map and append only once.
Scope: the bound source interval and stated assumptions. Evidence: source inspection plus the checks explicitly named in model.md#tests; no finite check establishes all inputs.
Rename boundary
Current commit precedes history open/write and log open/write; error effects partition by this order.
Scope: the bound source interval and stated assumptions. Evidence: source inspection plus the checks explicitly named in model.md#tests; no finite check establishes all inputs.
Validated input snapshot
One incoming read is validated before effects and reused for current and history; a later input-path replacement cannot bypass the reviewed guard. Concurrent database writers remain outside the quiescent guarantee.
Scope: the bound source interval and stated assumptions. Evidence: source inspection plus the checks explicitly named in model.md#tests; no finite check establishes all inputs.
Timestamp scope
One seconds timestamp per call; pre-epoch failure maps zero. Time is not unique event identity.
Scope: the bound source interval and stated assumptions. Evidence: source inspection plus the checks explicitly named in model.md#tests; no finite check establishes all inputs.
Tests
Checks and limits
db::tests::replace_and_append covers positions/counts/current/log. Mid-write failure and concurrent reread gaps.
Exact native outcomes and command metadata are retained in the external wave33 cycle receipt bundle. Selected names run twice in debug and release; syntax is independently regenerated twice. Compiled mutations and source restoration receipts distinguish behavior changes from assertion-only controls. These claims are finalized in ../model.md#evidence. No live teacher, real model/corpus, benchmark CLI or lesson-learning CLI is run.
Invariant and cost
Invariant and cost
Incoming repeated new id adds once then replaces; initial duplicate ids remain except last indexed occurrence. No rollback.
O(old+incoming bytes+events log S), O(old+incoming) memory plus policy validation. Current and history reuse the same incoming snapshot; nontransactional append failures can still leave prefixes.
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%.
History
2026-10-31 · descriptant
Heading #### Epoch 2026-10-31 stays in descriptant as #### Descriptant.
Undated · document
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 model.md#tests; unexecuted effects remain gaps.
Provenance
This page in Markdown → https://md.groupants.elamur.ai/free/en/mova/tools/cycle/src/db.rs.groupant/commit.groupant/