ov.base#

Single source of truth (SSOT) for the ov artifact schema.

One Pydantic v2 model tree defines what a capture is and *what an analysis produces*. Every other module reads from these models rather than inventing its own shapes – this is the SSOT discipline from the build specification (§3.3).

The tree has four families:

Design notes#

  • IDs are generated by new_id() (prefix + short uuid) so artifacts and findings are addressable and joinable across the store.

  • confidence appears twice on purpose, matching the spec: Scored uses an integer 0-100 (Wappalyzer-style) for detected technologies; Finding carries a float 0-1 for analysis judgments.

Functions

new_id([prefix])

Return a short, unique, prefixed id, e.g. "step_3f9a1c2b".

utcnow()

Timezone-aware current UTC time (the project's canonical timestamp).

Classes

Action(*, type[, ref, description, text, ...])

A single deterministic operation against the target.

ActionResult(*, action, ok[, error, ...])

Outcome of ov.operate.act.act() -- success/error plus a fresh read.

Affordance(*, ref, role[, name, bbox, ...])

One actionable element as perceived by a perception strategy.

Artifact(*[, artifact_id, step_id, uri, ...])

A content-addressed blob in the store, referenced by id everywhere else.

CaptureRun(*[, run_id, target_url, mode, ...])

Everything one observe produced; artifacts live in the store by id.

Endpoint(*[, confidence, provenance, kind, ...])

One synthesized API endpoint, with GenSON-merged request/response schemas.

Evidence(*[, evidence_id, artifact_id, ...])

The addressable unit an LLM claim must cite (D4).

EvidenceBundle(*[, step_id, contract, ...])

The grounded bundle a vision LLM reasons over (assembled model-free; §8.1).

Finding(*[, finding_id, title, ...])

SSOT for every UX / a11y / perf / arch / robustness finding (D3 + D4).

FindingDelta(*, key, status[, direction, ...])

One finding's status between a run and its baseline (review-mode currency).

JourneyStep(*[, id, intent, action, ...])

One recorded step of the user journey -- doubles as UX evidence (§2.3).

Observation(*, strategy[, url, affordances, ...])

The uniform result of any perception strategy (a pure read).

ProgressSignal(*[, repeated_action, ...])

Deterministic loop / no-progress facts (the package never decides to stop).

RunDiff(*, run_id, baseline_run_id[, ...])

Own-target regression: a run vs a stored prior baseline run (review mode, §10).

Scored(*[, confidence, provenance])

Mixin for every inferred (non-observed) fact.

Severity(*, impact_tier[, reach, score])

D3: severity = impact_tier x reach (prioritizes high-reach over rare-critical).

TechFinding(*[, confidence, provenance, ...])

One detected technology (framework, library, CDN, analytics, hosting).

class ov.base.Action(*, type, ref=None, description=None, text=None, url=None, key=None, value=None, args=<factory>)[source]#

Bases: BaseModel

A single deterministic operation against the target.

Mirrors Playwright-MCP’s require-description-and-ref safety: actions that touch an element carry a ref (a stable affordance handle) and a human description so the journal records intent legibly.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ov.base.ActionResult(*, action, ok, error=None, observation=None, t_ms=0.0)[source]#

Bases: BaseModel

Outcome of ov.operate.act.act() – success/error plus a fresh read.

The fresh Observation is the contract that lets the host (policy layer) decide the next step without a second explicit observe call.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ov.base.Affordance(*, ref, role, name='', bbox=None, enabled=True, editable=False)[source]#

Bases: BaseModel

One actionable element as perceived by a perception strategy.

bbox is (x, y, w, h) in CSS pixels when a strategy can compute it (always for Screenshot/Hybrid, optional for pure AX snapshots).

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ov.base.Artifact(*, artifact_id=<factory>, kind, step_id=None, uri='', content_hash=None, content_type=None, size=None, meta=<factory>)[source]#

Bases: BaseModel

A content-addressed blob in the store, referenced by id everywhere else.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ov.base.CaptureRun(*, run_id=<factory>, target_url='', mode='reconstruct', started_at=<factory>, finished_at=None, steps=<factory>, artifacts=<factory>, fingerprint=<factory>, rendering_model=None, source_maps_present=None, api_surface=<factory>, findings=<factory>, settings_snapshot=<factory>, notes=<factory>)[source]#

Bases: BaseModel

Everything one observe produced; artifacts live in the store by id.

artifact_by_id(artifact_id)[source]#

Return the Artifact with artifact_id or None.

Return type:

Artifact | None

model_config: ClassVar[ConfigDict] = {'validate_assignment': False}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ov.base.Endpoint(*, confidence=50, provenance=<factory>, method, path_template, kind='rest', request_schema=None, response_schema=None, auth=None, coverage=<factory>)[source]#

Bases: Scored

One synthesized API endpoint, with GenSON-merged request/response schemas.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ov.base.Evidence(*, evidence_id=<factory>, kind, artifact_id=None, summary='', meta=<factory>)[source]#

Bases: BaseModel

The addressable unit an LLM claim must cite (D4).

The model is shown the derived summary (a fact, not raw bytes); the artifact_id resolves – via a lookup tool – to the screenshot crop, network record or metric, for just-in-time retrieval during verification.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ov.base.EvidenceBundle(*, step_id=None, contract='', marked_image_artifact_ids=<factory>, crop_artifact_ids=<factory>, facts=<factory>, marks=<factory>, token_budget=<factory>, task='')[source]#

Bases: BaseModel

The grounded bundle a vision LLM reasons over (assembled model-free; §8.1).

Layout contract: [role/system + cite-or-abstain] -> [marked image(s)] -> [facts keyed to mark/fact ids] -> [task last]. Token cost is computed (token_budget), not hoped for.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ov.base.Finding(*, finding_id=<factory>, type, signal, category, title='', wcag_criterion=None, heuristic=None, engine_rule_id=None, severity=None, evidence_refs=<factory>, judgment=None, location=None, observed='', metric_detail=None, suggested_fix=None, source_layer='deterministic', confidence=1.0, needs_human_review=False, diff_status=None)[source]#

Bases: BaseModel

SSOT for every UX / a11y / perf / arch / robustness finding (D3 + D4).

The hard fact/judgment split lives here: evidence_refs are cited (never authored by a model), judgment is model interpretation only. A finding with no resolvable evidence is rejected (cite-or-abstain); the honest “can’t tell from the evidence” outcome is type="undetermined".

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ov.base.FindingDelta(*, key, status, direction='neutral', signal='', category='', title='', finding_id=None, baseline_finding_id=None, severity_score=None, baseline_severity_score=None, severity_tier=None, detail=None)[source]#

Bases: BaseModel

One finding’s status between a run and its baseline (review-mode currency).

status is the per-finding cross-run verdict; direction rolls it into the regression/improvement framing a downstream modification agent acts on. A finding is matched across runs by a stable semantic key (see ov.analysis.diff.finding_key()) – never by its per-run finding_id.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ov.base.JourneyStep(*, id=<factory>, intent='', action=None, affordances_seen=<factory>, outcome='ok', artifact_ids=<factory>, pre_obs_hash=None, post_obs_hash=None, network_delta=0, console_delta=0, note=None, t_ms=0.0)[source]#

Bases: BaseModel

One recorded step of the user journey – doubles as UX evidence (§2.3).

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ov.base.Observation(*, strategy, url=None, affordances=<factory>, aria_snapshot=None, screenshot_artifact_id=None, obs_hash='', title=None, t_ms=0.0)[source]#

Bases: BaseModel

The uniform result of any perception strategy (a pure read).

obs_hash is a content hash of the salient observable state; it is what ProgressSignal uses to detect no-progress without an LLM.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ov.base.ProgressSignal(*, repeated_action=False, no_new_signal_steps=0, url_stasis=False, ax_stasis=False, repeated_error=False, loop_suspected=False, detail=<factory>)[source]#

Bases: BaseModel

Deterministic loop / no-progress facts (the package never decides to stop).

The host (policy layer) interprets these against its budgets. See §2.3: “the package detects and reports no-progress; the host decides to abort.”

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ov.base.RunDiff(*, run_id, baseline_run_id, target_url='', created_at=<factory>, finding_deltas=<factory>, tech_added=<factory>, tech_removed=<factory>, endpoints_added=<factory>, endpoints_removed=<factory>, rendering_model_change=None, source_maps_change=None, notes=<factory>)[source]#

Bases: BaseModel

Own-target regression: a run vs a stored prior baseline run (review mode, §10).

Produced by ov.analysis.diff.diff_runs() from two analyzed CaptureRun`s of the same target. The :attr:`finding_deltas list is the SSOT; counts/has_drift are derived (@computed_field, so they serialize) and regressions/improvements are views over the deltas – nothing is stored twice.

>>> d = RunDiff(run_id="run_b", baseline_run_id="run_a", finding_deltas=[
...     FindingDelta(key="k1", status="new", direction="regression"),
...     FindingDelta(key="k2", status="resolved", direction="improvement"),
... ])
>>> d.counts["new"], d.counts["resolved"], d.has_drift
(1, 1, True)
>>> [r.key for r in d.regressions], [i.key for i in d.improvements]
(['k1'], ['k2'])
property counts: dict[str, int]#

Per-status tallies derived from the deltas (the headline of a diff).

property has_drift: bool#

True if anything changed across runs (findings, stack, API, or model).

property improvements: list[FindingDelta]#

Deltas that were resolved or got better since the baseline.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

property regressions: list[FindingDelta]#

Deltas that got worse or are newly present (a downstream fix list).

class ov.base.Scored(*, confidence=50, provenance=<factory>)[source]#

Bases: BaseModel

Mixin for every inferred (non-observed) fact.

Map-backed reconstructions must rank above name-lost (un-mapped) ones; that ordering is expressed through confidence + provenance.

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ov.base.Severity(*, impact_tier, reach=<factory>, score=0.0)[source]#

Bases: BaseModel

D3: severity = impact_tier x reach (prioritizes high-reach over rare-critical).

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class ov.base.TechFinding(*, confidence=50, provenance=<factory>, name, categories=<factory>, version=None)[source]#

Bases: Scored

One detected technology (framework, library, CDN, analytics, hosting).

model_config: ClassVar[ConfigDict] = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

ov.base.new_id(prefix='id')[source]#

Return a short, unique, prefixed id, e.g. "step_3f9a1c2b".

>>> i = new_id("run")
>>> i.startswith("run_")
True
>>> len(new_id("x").split("_")[1])
8
Return type:

str

ov.base.utcnow()[source]#

Timezone-aware current UTC time (the project’s canonical timestamp).

Return type:

datetime