Python: Version history
Read the project configuration at any point in time, preview and apply a restore, and manage timelines and snapshots with the Python SDK.
Every change to policies, tables, functions, settings, buckets and keys is recorded on the project's timeline. Background: Version history: see, undo and restore changes.
plan = await sovaria.chrono_restore_plan("2026-10-15T09:00:00Z")
for action in plan["actions"]:
print(action["path"], "manual" if action.get("manual") else "auto")
await sovaria.chrono_restore("2026-10-15T09:00:00Z")#Methods
sovaria.chrono_commit
Create a version-history commit.
await sovaria.chrono_commit(
*, timeline: str,
message: str,
author: str,
event_type: str = 'update',
) -> dict[str, Any]Parameters
timelinestrrequiredmessagestrrequiredauthorstrrequiredevent_typestroptionaldefault'update'
Returns
dict[str, Any]
{
"hex_id": "9f3c2a71e4b85d06c1a7f2e9",
"timeline": "main",
"timestamp_ns": 1792310000000000000
}sovaria.chrono_converge
Converge source timeline into target timeline.
await sovaria.chrono_converge(
*, target: str,
source: str,
author: str,
message: str,
) -> dict[str, Any]Parameters
targetstrrequiredsourcestrrequiredauthorstrrequiredmessagestrrequired
Returns
dict[str, Any]
{
"strategy": "THREE_WAY_MERGE",
"new_head_hex": "e5f1…",
"conflict_count": 0
}sovaria.chrono_create_snapshot
Name a point on a branch (timeline, main = production) to go back to; include_database also keeps a checkpoint of that branch's database.
await sovaria.chrono_create_snapshot(
message: str = '',
*, timeline: str | None = None,
env_id: str | None = None,
include_database: bool | None = None,
) -> dict[str, Any]Parameters
messagestroptionaldefault''timelinestr | NoneoptionaldefaultNoneenv_idstr | NoneoptionaldefaultNoneinclude_databasebool | NoneoptionaldefaultNone
Returns
dict[str, Any]
{
"snapshot_id": 12,
"base_chronon_hex": "9f3c2a71e4b85d06c1a7f2e9",
"lock_time_us": 1840,
"engine_pointers": {
"guard": 412,
"forge": 98
},
"created_at_ns": 1792310000000000000,
"degraded": false
}sovaria.chrono_delete_timeline
Delete a timeline.
await sovaria.chrono_delete_timeline(name: str) -> dict[str, Any]Parameters
namestrrequired
Returns
dict[str, Any]
{
"deleted": true,
"timeline": "try-new-rules"
}sovaria.chrono_jump_timeline
Force-jump a timeline head.
await sovaria.chrono_jump_timeline(
name: str,
target_hex: str,
) -> dict[str, Any]Parameters
namestrrequiredtarget_hexstrrequired
Returns
dict[str, Any]
{
"jumped": true,
"previous_head": "9f3c2a71e4b85d06c1a7f2e9",
"new_head": "41aa07d2c96e3b58f0e1d4a2"
}sovaria.chrono_list_snapshots
List known snapshots.
await sovaria.chrono_list_snapshots() -> dict[str, Any]Returns
dict[str, Any]
{
"snapshots": [
{
"snapshot_id": 12,
"message": "before launch",
"created_at_ns": 1792310000000000000,
"base_chronon_hex": "9f3c2a71e4b85d06c1a7f2e9",
"project_id": "f0c3e9a2-…",
"author": "ana@skolist.com",
"degraded": false,
"engine_count": 6
}
]
}sovaria.chrono_list_timelines
List available timelines.
await sovaria.chrono_list_timelines() -> dict[str, Any]Returns
dict[str, Any]
{
"timelines": [
{
"name": "main",
"head_hex": "9f3c2a71e4b85d06c1a7f2e9",
"chronon_count": 412
},
{
"name": "try-new-rules",
"head_hex": "c0de…",
"chronon_count": 3
}
]
}sovaria.chrono_restore
Go back to at on a branch: applies the plan's automated changes with this client's own permissions, in that branch's own environment.
await sovaria.chrono_restore(
at: str,
*, timeline: str = 'main',
include_database: bool = False,
include_schema: bool = False,
env_id: str | None = None,
) -> dict[str, Any]include_schema also rolls back migrations applied since then; include_database also restores the database as of then. The answer has new_head, or recording: True while the new commits are still arriving.
Parameters
atstrrequiredtimelinestroptionaldefault'main'include_databasebooloptionaldefaultFalseinclude_schemabooloptionaldefaultFalseenv_idstr | NoneoptionaldefaultNone
Returns
dict[str, Any]
{
"at": "41aa07d2c96e3b58f0e1d4a2",
"results": [
{
"type": "policy.restore",
"path": "policies/pol_orders_read.spl",
"status": "applied",
"http_status": 200,
"detail": null
}
],
"applied": 1,
"failed": 0,
"manual": 0
}sovaria.chrono_restore_plan
What going back to at on a branch changes, file by file, and who would gain or lose access.
await sovaria.chrono_restore_plan(
at: str,
*, timeline: str = 'main',
env_id: str | None = None,
) -> dict[str, Any]Writes nothing. The branch decides the environment acted on (main = production); env_id is the one you have checked out ('' = production) and a mismatch is refused (ENV_MISMATCH).
Parameters
atstrrequiredtimelinestroptionaldefault'main'env_idstr | NoneoptionaldefaultNone
Returns
dict[str, Any]
{
"at": "41aa07d2c96e3b58f0e1d4a2",
"actions": [
{
"type": "policy.restore",
"path": "policies/pol_orders_read.spl",
"policy_id": "pol_orders_read",
"name": "Signed-in users read orders",
"spl_source": "ALLOW IF ctx.resource.name == \"orders\"",
"exists_now": true
},
{
"type": "settings.restore",
"path": "settings/project.json",
"settings": {
"allowPublicSignup": false
}
}
],
"automated": 2,
"manual": 0,
"database": null,
"preview": {
"violations": [],
"changes": []
}
}sovaria.chrono_restore_snapshot
Go back to a snapshot on its branch (confirm=True; review api.history.restore_snapshot_plan first).
await sovaria.chrono_restore_snapshot(
snapshot_id: int,
*, confirm: bool | None = None,
include_database: bool | None = None,
include_schema: bool | None = None,
env_id: str | None = None,
) -> dict[str, Any]include_database puts the database back from the snapshot's checkpoint.
Parameters
snapshot_idintrequiredconfirmbool | NoneoptionaldefaultNoneinclude_databasebool | NoneoptionaldefaultNoneinclude_schemabool | NoneoptionaldefaultNoneenv_idstr | NoneoptionaldefaultNone
Returns
dict[str, Any]
{
"restored": true,
"snapshot_id": 12,
"total_time_ms": 940,
"engines_acked": [
"guard",
"forge"
],
"engines_requested": [
"guard",
"forge"
],
"restore_status": "full",
"degraded": false
}sovaria.chrono_spawn_timeline
Spawn a new timeline from a source chronon.
await sovaria.chrono_spawn_timeline(
*, name: str,
source_hex_id: str | None = None,
) -> dict[str, Any]Parameters
namestrrequiredsource_hex_idstr | NoneoptionaldefaultNone
Returns
dict[str, Any]
{
"timeline": "try-new-rules",
"spawned_from_hex": "9f3c2a71e4b85d06c1a7f2e9",
"created_at_ns": 1792310000000000000
}sovaria.chrono_state
The project's configuration (policies, schema, functions, settings, buckets, keys) at a commit id or ISO time (now when at is omitted), optionally one folder.
await sovaria.chrono_state(
*, at: str | None = None,
prefix: str = '',
timeline: str = 'main',
) -> dict[str, Any]Parameters
atstr | NoneoptionaldefaultNoneprefixstroptionaldefault''timelinestroptionaldefault'main'
Returns
dict[str, Any]
{
"timeline": "main",
"commit": "9f3c2a71e4b85d06c1a7f2e9",
"timestamp_ns": 1792227600123456789,
"message": "policy pol_orders_read updated",
"files": {
"policies/pol_orders_read.spl": "ALLOW IF ctx.resource.name == \"orders\" AND ctx.actor.is_anonymous == False",
"policies/pol_orders_read.json": "{\"name\": \"Signed-in users read orders\", \"active\": true, \"version\": 3}"
},
"truncated": false
}sovaria.chrono_timeline_history
Fetch timeline history chronons.
await sovaria.chrono_timeline_history(
name: str,
*, limit: int = 50,
offset: int = 0,
) -> dict[str, Any]Parameters
namestrrequiredlimitintoptionaldefault50offsetintoptionaldefault0
Returns
dict[str, Any]
{
"timeline": "main",
"chronons": [
{
"hex_id": "9f3c2a71e4b85d06c1a7f2e9",
"short_hex": "9f3c2a71e4b8",
"message": "policy pol_orders_read updated",
"author": "ana@skolist.com",
"timestamp_ns": 1792227600123456789,
"parent_hex_ids": [
"41aa07d2c96e3b58f0e1d4a2"
],
"changed_domains": [
"policies"
],
"event_type": "policy.updated",
"metadata": {
"policy_id": "pol_orders_read"
}
}
]
}sovaria.chrono_topology
Return timeline graph topology.
await sovaria.chrono_topology(
*, timeline: str = 'main',
limit: int = 50,
) -> dict[str, Any]Parameters
timelinestroptionaldefault'main'limitintoptionaldefault50
Returns
dict[str, Any]
{
"nodes": [
{
"chronon_hex": "9f3c2a71e4b85d06c1a7f2e9",
"message": "policy pol_orders_read updated",
"parents": [
"41aa07d2c96e3b58f0e1d4a2"
]
}
],
"edges": [
{
"from_node": "41aa07d2c96e3b58f0e1d4a2",
"to_node": "9f3c2a71e4b85d06c1a7f2e9"
}
]
}sovaria.chrono_variance
Calculate variance between two chronons.
await sovaria.chrono_variance(
*, old_chronon_hex: str,
new_chronon_hex: str,
domain_filter: str | None = None,
) -> dict[str, Any]Parameters
old_chronon_hexstrrequirednew_chronon_hexstrrequireddomain_filterstr | NoneoptionaldefaultNone
Returns
dict[str, Any]
{
"summary": {
"insertions": 1,
"deletions": 1,
"unchanged": 0
},
"hunks": [
{
"domain": "policies",
"name": "pol_orders_read.spl",
"operations": [
[
"-",
"ALLOW IF ctx.resource.name == \"orders\""
],
[
"+",
"ALLOW IF ctx.resource.name == \"orders\" AND ctx.actor.is_anonymous == False"
]
]
}
],
"truncated": false,
"truncation_reason": null,
"processed_hunks": 1,
"total_hunks": 1
}