Session
yosoi.surface.Session
class Session:
In-memory evidence session for an external live adapter.
Args: index: Initial immutable evidence. policy: Reader, history and event bounds, defaulting to one cursor.
Attaching declares that the adapter is observing its source. This class does not launch a browser, install a DOM observer or dispatch actions by itself.
Source: python/yosoi/surface.py:1363
Members below are declared on this class. Inherited Pydantic methods and generated constructor signatures are not expanded.
Methods
Section titled “Methods”def __init__(self, index: Surface, policy: SessionPolicy | None=None) -> None:
Create detached state with no action authority.
Source: python/yosoi/surface.py:1374
cursor
Section titled “cursor”def cursor(self) -> Cursor:
Allocate a reader within policy; Rust rejects capacity exhaustion.
Source: python/yosoi/surface.py:1380
attach
Section titled “attach”def attach(self) -> None:
Declare the external observer live, without promoting any cursor.
Source: python/yosoi/surface.py:1384
detach
Section titled “detach”def detach(self) -> None:
Detach observation and revoke hot authority and pending leases.
Source: python/yosoi/surface.py:1388
invalidate
Section titled “invalidate”def invalidate(self, reason: str) -> None:
Mark observation uncertain until an adapter publishes fresh evidence.
Source: python/yosoi/surface.py:1392
publish
Section titled “publish”def publish(self, index: Surface) -> None:
Publish a new immutable capture, invalidating stale focused evidence.
Source: python/yosoi/surface.py:1396
outcome
Section titled “outcome”def outcome(self) -> Outcome | None:
Snapshot retained evidence, or return None when archive policy is off.
Source: python/yosoi/surface.py:1400
def close(self) -> Outcome | None:
Close logical readers and return the final policy outcome.
This revokes authority and preserves pending effects as unknown. External provider cleanup remains caller-owned. Repeated calls return the same data.
Source: python/yosoi/surface.py:1405
current
Section titled “current”@property
def current(self) -> Surface:
Return an immutable index safe to retain after subsequent publication.
Source: python/yosoi/surface.py:1415
hot_owner
Section titled “hot_owner”@property
def hot_owner(self) -> int | None:
Return the single hot cursor identity, or None.