Concepts

State Model: Records, Artifacts, and Operations

A scenario's state is its records, its artifacts and the commits that changed them. This page is for authors of storage or artifact backends and for debugging recovery; operators start with recovery and backups.

How it works #

Records #

Each trainer tracks the record IDs it consumed; consuming does not delete a record. Retention removes record bodies, and recovery cannot rebuild an evicted body.

The snapshot chain #

An artifact is an immutable component output with an opaque artifact_id. A selection maps components to artifacts. An operation records a change or a training outcome, skipped ones included; selecting an existing artifact adds an operation, not an artifact. Publishing to the repository does not change the active selection, and a snapshot's revision is not an artifact ID.

Commit ordering #

The scenario store's transaction is the commit point: it appends the commit and updates the samples' training counts together. A commit with a new artifact runs in this order:

  1. Publish the content and bind the artifact IDs.

  2. Append the commit, with the activation decision.

  3. Install the committed selections and move the repository pointer.

  4. Apply the trainer's prepared state.

What you can rely on #

  • Inference loads an artifact only after its commit is stored.

  • A failed pointer move does not undo the commit; later commits wait for the pointer.

  • Recovery reconciles history with the checkpoints, repairs repository pointers, and can adopt a checkpoint ahead of history. Each trainer restores its state and consumed IDs, then rereads the retained records from the start, skipping those IDs. The stored high-water mark is not a recovery cursor.

  • Training runs outside the transaction: a retried job reuses its result or reconciles its progress, and unsaved optimizer work can run again (checkpoint cadence).

  • Prepare-and-commit cycles run one at a time, but external effects must still be idempotent or recoverable. Expected commit numbers do not replace the single active control writer. Several trainers need durable history.

Reference #

The docstrings state each contract: append_commit and recover in ScenarioStore, artifact binding and publication in RepositoryBackend, the commit steps in ScenarioCommitter, and retention in the record store.