ov.capture.session

CaptureSession – owns the browser and orchestrates the probes (§3.1).

The session is the deterministic capture spine: it resolves and dependency-orders the enabled probes, attaches their listeners before navigation, snapshots state on demand (the snapshot_state primitive of §2.3), finalizes and flushes them at the end, stores the HAR, and persists the CaptureRun.

It exposes page so the operate primitives and the scripted driver can act on the same browser, and is a context manager for safe teardown.

class ov.capture.session.CaptureSession(*, target_url: str, config: OvConfig | None = None, store: CaptureStore | str | None = None, mode: str = 'reconstruct', probes='default', record_har: bool = True)[source]

Drive one target and record everything into the store (zero-config default).

Typical use is via the ov.observe() facade, but the session is directly usable:

with CaptureSession(target_url="https://example.com") as s:
    s.open()                 # navigate to target_url + capture the load state
    run = s.run
capture_step(step: JourneyStep) JourneyStep[source]

Run per-state probes for an externally-built step (used by the driver).

close() None[source]

Finalize if needed and tear down (idempotent).

finalize() None[source]

Flush every probe (page still alive), close the browser, store the HAR.

navigate(url: str) None[source]

Navigate the page to url (waits for the default load state).

open(url: str | None = None, *, intent: str = 'load') JourneyStep[source]

Navigate to the target (or url) and capture the initial state.

property page

The active Playwright Page for operate primitives / the driver.

snapshot_state(*, intent: str = 'observe', strategy: str = 'ax_snapshot') JourneyStep[source]

Capture all probes for the current state and journal a JourneyStep.

Bundles the §2.3 snapshot_state primitive: observe affordances, run per-state probes, and record one step keyed to the produced artifacts.

start() CaptureSession[source]

Launch the browser, attach CDP (Chromium), and attach all probes.