Skip to content

cayu.evals.runtime_replay

Public Cayu API. Definitions are grouped by their public source module, and definitions from private implementation modules appear on their package’s page; adding a symbol does not move existing links. The import shown at each entry is a supported public namespace. Read the Python API overview and install the required extra.

from cayu.evals import replay_session

Replay one promoted two-step tool round through an isolated ordinary runtime.

Recorded model completions and tool results are fixtures. The operation never calls a live provider, registered tool, environment, runner, vault, or source session store. A match proves only the versioned runtime/request contracts represented by the retained identities.

async replay_session(app: CayuApp, request: RuntimeReplayRequest) -> RuntimeReplayReport

Release source · Runtime guarantees · Capability guides

from cayu.evals import RUNTIME_REPLAY_DEFAULT_MAX_EVENTS
RUNTIME_REPLAY_DEFAULT_MAX_EVENTS = 10000

Release source · Runtime guarantees · Capability guides

from cayu.evals import RUNTIME_REPLAY_DEFAULT_MAX_MODEL_STEPS
RUNTIME_REPLAY_DEFAULT_MAX_MODEL_STEPS = 2

Release source · Runtime guarantees · Capability guides

from cayu.evals import RUNTIME_REPLAY_DEFAULT_MAX_TOOL_CALLS
RUNTIME_REPLAY_DEFAULT_MAX_TOOL_CALLS = 16

Release source · Runtime guarantees · Capability guides

RUNTIME_REPLAY_DEFAULT_MAX_TRANSCRIPT_MESSAGES

Section titled “RUNTIME_REPLAY_DEFAULT_MAX_TRANSCRIPT_MESSAGES”
from cayu.evals import RUNTIME_REPLAY_DEFAULT_MAX_TRANSCRIPT_MESSAGES
RUNTIME_REPLAY_DEFAULT_MAX_TRANSCRIPT_MESSAGES = 1000

Release source · Runtime guarantees · Capability guides

from cayu.evals import RUNTIME_REPLAY_DEFAULT_TIMEOUT_SECONDS
RUNTIME_REPLAY_DEFAULT_TIMEOUT_SECONDS = 30.0

Release source · Runtime guarantees · Capability guides

from cayu.evals import RUNTIME_REPLAY_HARD_MAX_EVENTS
RUNTIME_REPLAY_HARD_MAX_EVENTS = 100000

Release source · Runtime guarantees · Capability guides

from cayu.evals import RUNTIME_REPLAY_HARD_MAX_MODEL_STEPS
RUNTIME_REPLAY_HARD_MAX_MODEL_STEPS = 16

Release source · Runtime guarantees · Capability guides

from cayu.evals import RUNTIME_REPLAY_HARD_MAX_TOOL_CALLS
RUNTIME_REPLAY_HARD_MAX_TOOL_CALLS = 256

Release source · Runtime guarantees · Capability guides

RUNTIME_REPLAY_HARD_MAX_TRANSCRIPT_MESSAGES

Section titled “RUNTIME_REPLAY_HARD_MAX_TRANSCRIPT_MESSAGES”
from cayu.evals import RUNTIME_REPLAY_HARD_MAX_TRANSCRIPT_MESSAGES
RUNTIME_REPLAY_HARD_MAX_TRANSCRIPT_MESSAGES = 10000

Release source · Runtime guarantees · Capability guides

from cayu.evals import RUNTIME_REPLAY_HARD_TIMEOUT_SECONDS
RUNTIME_REPLAY_HARD_TIMEOUT_SECONDS = 300.0

Release source · Runtime guarantees · Capability guides

from cayu.evals import RUNTIME_REPLAY_SCHEMA_VERSION
RUNTIME_REPLAY_SCHEMA_VERSION = 1

Release source · Runtime guarantees · Capability guides

from cayu.evals import RuntimeReplayAttemptComparison

Bases: BaseModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
index StrictInt Field(ge=1)
source_event_id str Field(min_length=1, max_length=512)
source_footprint_schema_version StrictInt Field(ge=1)
candidate_footprint_schema_version StrictInt Field(ge=1)
source_provider_name str Field(min_length=1, max_length=256)
source_model str Field(min_length=1, max_length=512)
candidate_provider_name str Field(min_length=1, max_length=256)
candidate_model str Field(min_length=1, max_length=512)
source_provider_neutral RuntimeReplayFingerprintIdentity required
candidate_provider_neutral RuntimeReplayFingerprintIdentity required
source_provider_wire RuntimeReplayFingerprintIdentity | None None
candidate_provider_wire RuntimeReplayFingerprintIdentity | None None
matched StrictBool required
RuntimeReplayAttemptComparison.validate_match() -> RuntimeReplayAttemptComparison

Release source · Runtime guarantees · Capability guides

from cayu.evals import RuntimeReplayBoundaryKind

Bases: StrEnum.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
PREFLIGHT class attribute 'preflight'
EXECUTION_PROFILE class attribute 'execution_profile'
MODEL_REQUEST class attribute 'model_request'
TOOL_POLICY class attribute 'tool_policy'
TOOL_CALL class attribute 'tool_call'
TOOL_RESULT class attribute 'tool_result'
TERMINAL_OUTCOME class attribute 'terminal_outcome'

Release source · Runtime guarantees · Capability guides

from cayu.evals import RuntimeReplayBounds

Hard limits for one isolated replay attempt.

Bases: BaseModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
max_events StrictInt Field(default=RUNTIME_REPLAY_DEFAULT_MAX_EVENTS, ge=1, le=RUNTIME_REPLAY_HARD_MAX_EVENTS)
max_transcript_messages StrictInt Field(default=RUNTIME_REPLAY_DEFAULT_MAX_TRANSCRIPT_MESSAGES, ge=1, le=RUNTIME_REPLAY_HARD_MAX_TRANSCRIPT_MESSAGES)
max_model_steps StrictInt Field(default=RUNTIME_REPLAY_DEFAULT_MAX_MODEL_STEPS, ge=1, le=RUNTIME_REPLAY_HARD_MAX_MODEL_STEPS)
max_tool_calls StrictInt Field(default=RUNTIME_REPLAY_DEFAULT_MAX_TOOL_CALLS, ge=0, le=RUNTIME_REPLAY_HARD_MAX_TOOL_CALLS)
timeout_seconds StrictFloat Field(default=RUNTIME_REPLAY_DEFAULT_TIMEOUT_SECONDS, gt=0, le=RUNTIME_REPLAY_HARD_TIMEOUT_SECONDS)

Release source · Runtime guarantees · Capability guides

from cayu.evals import RuntimeReplayDisposition

Bases: StrEnum.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
MATCHED class attribute 'matched'
DIVERGED class attribute 'diverged'
UNAVAILABLE class attribute 'unavailable'
BOUNDS_EXCEEDED class attribute 'bounds_exceeded'
FAILED class attribute 'failed'

Release source · Runtime guarantees · Capability guides

from cayu.evals import RuntimeReplayDivergence

Bases: BaseModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
kind RuntimeReplayDivergenceKind required
boundary RuntimeReplayBoundaryKind required
index StrictInt | None Field(default=None, ge=1)
source_event_id str | None Field(default=None, min_length=1, max_length=512)

Release source · Runtime guarantees · Capability guides

from cayu.evals import RuntimeReplayDivergenceKind

Bases: StrEnum.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
EXECUTION_PROFILE_MISMATCH class attribute 'execution_profile_mismatch'
REQUEST_FOOTPRINT_MISMATCH class attribute 'request_footprint_mismatch'
POLICY_DECISION_MISMATCH class attribute 'policy_decision_mismatch'
TOOL_CALL_MISMATCH class attribute 'tool_call_mismatch'
RECORDED_OUTCOME_MISMATCH class attribute 'recorded_outcome_mismatch'
TERMINAL_OUTCOME_MISMATCH class attribute 'terminal_outcome_mismatch'

Release source · Runtime guarantees · Capability guides

from cayu.evals import RuntimeReplayFingerprintIdentity

Bases: BaseModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
algorithm Literal['hmac-sha256'] 'hmac-sha256'
canonicalization_version Literal[1] 1
key_id str Field(min_length=1, max_length=64, pattern='^[a-z0-9](?:[a-z0-9._-]{0,62}[a-z0-9])?$')
value str Field(pattern='^[0-9a-f]{64}$')

Release source · Runtime guarantees · Capability guides

from cayu.evals import RuntimeReplayReason

Bases: StrEnum.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
SOURCE_SESSION_MISSING class attribute 'source_session_missing'
SOURCE_SESSION_NOT_COMPLETED class attribute 'source_session_not_completed'
SOURCE_TRAJECTORY_INVALID class attribute 'source_trajectory_invalid'
SOURCE_CHILDREN_UNSUPPORTED class attribute 'source_children_unsupported'
SOURCE_INPUT_EVIDENCE_UNAVAILABLE class attribute 'source_input_evidence_unavailable'
SOURCE_INPUT_EVIDENCE_INCONSISTENT class attribute 'source_input_evidence_inconsistent'
SOURCE_SHAPE_UNSUPPORTED class attribute 'source_shape_unsupported'
SOURCE_MODEL_EVIDENCE_UNAVAILABLE class attribute 'source_model_evidence_unavailable'
SOURCE_TOOL_EVIDENCE_UNAVAILABLE class attribute 'source_tool_evidence_unavailable'
SOURCE_TOOL_ARGUMENT_EVIDENCE_UNAVAILABLE class attribute 'source_tool_argument_evidence_unavailable'
SOURCE_REQUEST_FOOTPRINT_UNAVAILABLE class attribute 'source_request_footprint_unavailable'
SOURCE_EXECUTION_PROFILE_UNAVAILABLE class attribute 'source_execution_profile_unavailable'
SOURCE_BILLING_EVIDENCE_UNAVAILABLE class attribute 'source_billing_evidence_unavailable'
SOURCE_INVOCATION_EVIDENCE_UNAVAILABLE class attribute 'source_invocation_evidence_unavailable'
REQUEST_FINGERPRINT_INCOMPARABLE class attribute 'request_fingerprint_incomparable'
CANDIDATE_AGENT_UNAVAILABLE class attribute 'candidate_agent_unavailable'
CANDIDATE_MODEL_TARGET_UNAVAILABLE class attribute 'candidate_model_target_unavailable'
CANDIDATE_ENVIRONMENT_UNSUPPORTED class attribute 'candidate_environment_unsupported'
CANDIDATE_KNOWLEDGE_CONTEXT_UNSUPPORTED class attribute 'candidate_knowledge_context_unsupported'
CANDIDATE_HOOKS_UNSUPPORTED class attribute 'candidate_hooks_unsupported'
CANDIDATE_LOOP_POLICIES_UNSUPPORTED class attribute 'candidate_loop_policies_unsupported'
CANDIDATE_CONTEXT_POLICY_UNSUPPORTED class attribute 'candidate_context_policy_unsupported'
CANDIDATE_TOOL_POLICY_UNSUPPORTED class attribute 'candidate_tool_policy_unsupported'
CANDIDATE_COMMAND_POLICY_UNSUPPORTED class attribute 'candidate_command_policy_unsupported'
CANDIDATE_TOOL_EXPOSURE_UNSUPPORTED class attribute 'candidate_tool_exposure_unsupported'
CANDIDATE_TOOL_LIFECYCLE_UNSUPPORTED class attribute 'candidate_tool_lifecycle_unsupported'
CANDIDATE_TOOL_DISCOVERY_UNSUPPORTED class attribute 'candidate_tool_discovery_unsupported'
CANDIDATE_MCP_UNSUPPORTED class attribute 'candidate_mcp_unsupported'
CANDIDATE_HOSTED_TOOLS_UNSUPPORTED class attribute 'candidate_hosted_tools_unsupported'
CANDIDATE_TOOL_RESULT_PROJECTION_UNSUPPORTED class attribute 'candidate_tool_result_projection_unsupported'
CANDIDATE_PROVIDER_OPERATION_UNSUPPORTED class attribute 'candidate_provider_operation_unsupported'
CANDIDATE_PROFILE_UNAVAILABLE class attribute 'candidate_profile_unavailable'
CANDIDATE_EXECUTION_FAILED class attribute 'candidate_execution_failed'
EVENT_BOUND_EXCEEDED class attribute 'event_bound_exceeded'
TRANSCRIPT_BOUND_EXCEEDED class attribute 'transcript_bound_exceeded'
MODEL_STEP_BOUND_EXCEEDED class attribute 'model_step_bound_exceeded'
TOOL_CALL_BOUND_EXCEEDED class attribute 'tool_call_bound_exceeded'
WALL_CLOCK_BOUND_EXCEEDED class attribute 'wall_clock_bound_exceeded'

Release source · Runtime guarantees · Capability guides

from cayu.evals import RuntimeReplayReport

Secret-safe, versioned proof boundary for one runtime-contract replay.

Bases: BaseModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
schema_version Literal[1] RUNTIME_REPLAY_SCHEMA_VERSION
disposition RuntimeReplayDisposition required
reason RuntimeReplayReason | None None
source_session_identity str | None Field(default=None, pattern='^sha256:[0-9a-f]{64}$')
trajectory_identity str | None Field(default=None, pattern='^sha256:[0-9a-f]{64}$')
source_execution_profile ExecutionProfileIdentity | None None
candidate_execution_profile ExecutionProfileIdentity | None None
changed_execution_profile_components tuple[str, ...] Field(default=(), max_length=32)
request_attempts tuple[RuntimeReplayAttemptComparison, ...] Field(default=(), max_length=RUNTIME_REPLAY_HARD_MAX_MODEL_STEPS)
compared_model_steps StrictInt Field(default=0, ge=0)
compared_tool_rounds StrictInt Field(default=0, ge=0)
first_divergence RuntimeReplayDivergence | None None
supporting_source_event_ids tuple[str, ...] Field(default=(), max_length=RUNTIME_REPLAY_HARD_MAX_SUPPORTING_SOURCE_EVENTS)
warnings tuple[RuntimeReplayWarning, ...] Field(default=(), max_length=16)
RuntimeReplayReport.validate_disposition() -> RuntimeReplayReport

Release source · Runtime guarantees · Capability guides

from cayu.evals import RuntimeReplayRequest

Candidate app and immutable promoted trajectory selected for replay.

Bases: BaseModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
trajectory SkipValidation[Trajectory] Field(exclude=True, repr=False)
agent_name str | None None
bounds RuntimeReplayBounds Field(default_factory=RuntimeReplayBounds)
RuntimeReplayRequest.validate_trajectory(value: object) -> Trajectory
RuntimeReplayRequest.validate_agent_name(value: str | None) -> str | None

Release source · Runtime guarantees · Capability guides

from cayu.evals import RuntimeReplayWarning

Bases: StrEnum.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
SOURCE_USAGE_UNAVAILABLE class attribute 'source_usage_unavailable'
PROVIDER_WIRE_IDENTITY_UNAVAILABLE class attribute 'provider_wire_identity_unavailable'

Release source · Runtime guarantees · Capability guides