WorkspaceState

Untracked per-workspace working state.

Usage

Source

WorkspaceState(
    workspace_id=(lambda: uuid.uuid4().hex)(),
    bookmark=None,
    base_states=dict(),
    working_refs=dict(),
    pending_forks=dict(),
    pending_resets=dict(),
    fork_points=dict(),
    last_snapshot=dict(),
    last_snapshot_at=None,
    last_snapshot_errors=dict()
)

base_states maps object key -> the committed state this workspace’s working ref corresponds to (set when the branch is forked and whenever this workspace commits the object); a manifest that says something else was changed by someone else, and the workspace is stale for that object. working_refs maps object key -> native working ref that exists. pending_forks maps object key -> the branch name new decided on but has not created yet (lazy forking: it is created on the first writable open); pending_resets records, for a pending fork whose branch already existed when new planned it, the head new saw and agreed to reset – the open resets only if it is still there. fork_points maps object key -> the state its working branch was created from; promote compares the base branch against it to tell a fast-forward from a divergence. bookmark is the dataset bookmark this checkout works on: its store branches are this workspace’s working refs (None: read-only, no working refs). last_snapshot caches the most recent fan-out fingerprints; last_snapshot_errors the objects that fan-out could not read, with the branch it tried (ref, empty for upstream) and the error.

Parameter Attributes

workspace_id: str = (lambda: uuid.uuid4().hex)()
bookmark: str | None = None
base_states: dict[str, State] = dict()
working_refs: dict[str, str] = dict()
pending_forks: dict[str, str] = dict()
pending_resets: dict[str, State] = dict()
fork_points: dict[str, State] = dict()
last_snapshot: dict[str, State] = dict()
last_snapshot_at: str | None = None
last_snapshot_errors: dict[str, dict[str, str]] = dict()