Plan

The actions a command would perform, plus the inputs they depend on.

Usage

Source

Plan(
    command,
    actions=list(),
    context=dict(),
    notes=list(),
    preconditions=list(),
    created_at=(lambda: datetime.now(UTC).isoformat(timespec="seconds"))(),
    tether_version=_running_version(),
    saved_digest=None
)

Parameter Attributes

command: str

commit, new, gc, promote, import, publish, or repair.

actions: list[Action] = list()

Store-writing steps, in execution order.

context: dict[str, Any] = dict()

Inputs the plan was computed from (states, manifest hash, message, …); apply re-validates these before writing.

notes: list[str] = list()

Non-actions worth showing (objects skipped and why).

preconditions: list[Precondition] = list()

What must still hold at apply time; see Precondition.

created_at: str = (lambda: datetime.now(UTC).isoformat(timespec="seconds"))()
tether_version: str = _running_version()

The tether version that made the plan. A saved plan loads only under that same version (see from_dict()): what the preconditions check, and how apply reads its actions, are that version’s.

saved_digest: str | None = None
The digest a loaded plan was saved with (None: made in this process); Repo._verify_plan refuses a plan whose content no longer matches it.