Kitaru

replay

Replay planning utilities.

Translates Kitaru's unified replay override surface into ZenML replay inputs consumed by Pipeline.replay(...) plus a small runtime context consumed by Kitaru checkpoints during the live replay tail.

attributelogger
= logging.getLogger(__name__)
attributeREPLAY_SKIPPED_STEPS_METADATA_KEY
= 'kitaru_replay_skipped_steps_v1'
attributeREPLAY_RESERVED_KWARGS
= frozenset({'at', 'flow_overrides', 'checkpoint_overrides', 'invocation_overrides', 'skip', 'tag', 'wait', 'on_error', 'stack', 'image', 'cache', 'retries'})
attributeReplayAtStatus
= Literal['present', 'missing', 'ambiguous', 'no_checkpoints']
funcsafe_compare_url_for_executions(exec_ids) -> str | None

Build a compare URL without letting URL lookup break replay results.

paramexec_idsSequence[str]

Returns

str | None
funcreplay_skipped_steps_metadata(steps_to_skip) -> dict[str, Any]

Return deterministic replay skip metadata for an execution.

paramsteps_to_skipIterable[str]

Returns

dict[str, typing.Any]
funcparse_replay_skipped_steps_metadata(metadata) -> set[str]

Parse replay skip evidence from execution metadata safely.

parammetadataMapping[str, Any]

Returns

set[str]
funcreplay_step_invocation_id(step) -> str

Return the invocation ID Kitaru uses when planning replay skips.

paramstepStepRunResponse

Returns

str
funcsafe_persist_replay_submission_metadata(*, replay_exec_id, original_exec_id, submission_id, tag, steps_to_skip=None) -> None

Best-effort replay correlation metadata and tag persistence.

paramreplay_exec_idstr
paramoriginal_exec_idstr
paramsubmission_idstr
paramtagstr | None
paramsteps_to_skipIterable[str] | None
= None

Returns

None
funcnew_replay_submission_id() -> str

Return a non-sensitive replay submission correlation ID.

Returns

str
funcreplay_at_status(*, run, at) -> ReplayAtStatus

Return whether at resolves for a source execution.

paramrunPipelineRunResponse
paramatstr

Returns

kitaru.replay.ReplayAtStatus
funcreplay_at_skip_reason(*, run, at) -> str

Return a human-readable skip/failure reason for a replay at selector.

paramrunPipelineRunResponse
paramatstr

Returns

str
funcbuild_replay_request_document(*, flow_overrides=None, checkpoint_overrides=None, invocation_overrides=None, skip=None) -> ReplayPlanDocument

Validate and serialize the public replay request shape.

paramflow_overridesMapping[str, Any] | None
= None
paramcheckpoint_overridesMapping[str, Any] | None
= None
paraminvocation_overridesMapping[str, Any] | None
= None
paramskipSequence[str] | None
= None

Returns

kitaru.replay.ReplayPlanDocument
funcplan_requires_runtime_transport(plan) -> bool

Return whether this replay plan needs KITARU_REPLAY_CONTEXT transport.

paramplanReplayPlan

Returns

bool
funcbuild_replay_plan(*, run, at, flow_overrides=None, checkpoint_overrides=None, invocation_overrides=None, skip=None) -> ReplayPlan

Build a replay plan for a completed or paused execution.

Checkpoints before at are skipped. at and its downstream descendants re-execute unless an output override injects a value or skip asks to play back a recorded result. Checkpoint-scope overrides intentionally fan out to every matching invocation; invocation-scope overrides target exactly one invocation/call ID and win over checkpoint-scope values.

paramrunPipelineRunResponse
paramatstr
paramflow_overridesMapping[str, Any] | None
= None
paramcheckpoint_overridesMapping[str, Any] | None
= None
paraminvocation_overridesMapping[str, Any] | None
= None
paramskipSequence[str] | None
= None

Returns

kitaru.replay.ReplayPlan