yera 0.11.1

yera.ui.activity_trace

Project persisted logging records into a local activity trace.

Symbols

class ActivityTraceRow — Describe one correlated operation in a persisted activity trace.
def project_activity_trace — Project persisted logging phases into chronological activity rows.

ActivityTraceRow

Describe one correlated operation in a persisted activity trace.

Fields

operation_id
type: uuid.UUID (required)

Stable identity shared by the operation's logging phases.

parent_operation_id
type: uuid.UUID | None (required)

Enclosing operation, when recorded.

depth
type: int (required)

Display indentation derived from available parent operations.

occurred_at
type: datetime.datetime (required)

Storage time of the operation's first observed phase.

actor
type: Literal['runtime', 'app', 'user', 'model', 'tool'] (required)

Kind of component that performed the operation.

activity
type: Literal['session', 'runtime', 'app', 'input', 'model', 'tool'] (required)

Kind of operation that was performed.

status
type: Literal['completed', 'failed', 'cancelled', 'in_progress', 'interrupted'] (required)

Projected terminal or active state.

elapsed_seconds
type: float | None (required)

Recorded duration for a terminal operation.

attributes
type: yera.runtime.models.block_data.LoggingAttributes (required)

Privacy-reviewed metadata associated with the operation.

ended_at
type: datetime.datetime | None = None

Storage time of the terminal phase, when one was recorded.

Methods


ActivityTraceRow.__init__

__init__(
    operation_id: UUID,
    parent_operation_id: UUID | None,
    depth: int,
    occurred_at: datetime,
    actor: LoggingActor,
    activity: LoggingActivity,
    status: ActivityTraceStatus,
    elapsed_seconds: float | None,
    attributes: LoggingAttributes,
    ended_at: datetime | None = None,
) → None

project_activity_trace

project_activity_trace(
    records: Iterable[StoredEventRecord],
    session_status: SessionStatus,
) → tuple[ActivityTraceRow, ...]

Project persisted logging phases into chronological activity rows.

Non-logging records are ignored. Logging phases sharing an operation ID produce one row positioned by the first phase observed in append order. Missing parents do not remove a row, and malformed parent cycles are bounded while deriving display depth.

Parameters

records
type: Iterable[StoredEventRecord]

Timestamped session records in persisted append order.

session_status
type: SessionStatus

Current persisted lifecycle state of the session.

Returns

type: tuple[ActivityTraceRow, ...]

Activity rows in first-observed operation order.