Skip to content

ViewPolicy

autogen.beta.network.views.base.ViewPolicy #

Bases: Protocol

Per-participant projection.

Implementations must be deterministic functions of the input WAL slice — calling project twice with the same input must produce the same events.

name instance-attribute #

name

project async #

project(wal, *, participant_id, session, render_envelope)

Convert the WAL slice this participant should see into model events. render_envelope is provided by the session's adapter so the view stays adapter-neutral.

Source code in autogen/beta/network/views/base.py
async def project(
    self,
    wal: list[Envelope],
    *,
    participant_id: str,
    session: SessionMetadata,
    render_envelope: EnvelopeRenderer,
) -> list[BaseEvent]:
    """Convert the WAL slice this participant should see into model
    events. ``render_envelope`` is provided by the session's
    adapter so the view stays adapter-neutral."""
    ...