Skip to main content

Crate agentstategraph_migrate

Crate agentstategraph_migrate 

Source
Expand description

Schema migration registry for AgentStateGraph databases.

See spec/UPGRADE-PATH.md for the design.

flow:
  consumer startup → check(repo, target) → CheckResult
    UpToDate       → continue
    Unversioned /  → run migrations
    UpgradeAvailable
    Downgrade      → refuse (exit 64)
    Corrupt        → refuse (exit 65)

Builtin migrations live in migrations/. External siblings may register their own via Registry::register.

Modules§

exit
Exit codes for consumer CLIs that surface check() / run() results.
migrations
Shipped migrations. Each lives in its own submodule and is registered by Registry::builtin().

Structs§

MigrationOutcome
Summary of what a migration accomplished on a single ref.
Registry
Registry of migrations, ordered by to_version then registration order.
Report
StepReport

Enums§

CheckResult
Result of check() — what a consumer should do at startup.
MigrateError
RunMode
StepStatus

Constants§

IMPLICIT_VERSION
Version stamped into a .db when the meta sentinel is absent. This is the pre-/_meta era — everything written before 0.4.0.
META_PATH_PREFIX
Public re-export — migration authors need this. Reserved state path prefix for schema metadata. Writes under this prefix are only permitted on commits tagged IntentCategory::Migrate.

Traits§

Migration
A single named, idempotent migration step.

Functions§

binary_version
Current schema version of this binary, as a parsed semver::Version.
check
Inspect a repository and tell a consumer what to do.
migrate_commit_options
Helper for migration authors: build a CommitOptions tagged IntentCategory::Migrate with the conventional agent_id.
version_object
Helper: produce an Object holding a schema_version string.