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:
Operate value types –
Action,Affordance,Observation,ActionResult,ProgressSignal. Theseare the deterministic, model-free currency of the
operate/“hands”.Capture artifacts –
Artifact,JourneyStep,CaptureRun. What a browser session records.Inferred facts –
Scored,TechFinding,Endpoint. Probabilistic conclusions that always carry confidence andprovenance (D2: outputs are never ground truth).
Analysis outputs –
Evidence,Severity,Finding,EvidenceBundle. The normalized currency of theanalysis lenses and the grounded LLM layer (D3 + D4).
Review/regression outputs –
FindingDelta,RunDiff. The own-target drift between a run and a stored prior baseline (review mode, §10); cheap by design because artifacts are content-addressed.
Design notes#
IDs are generated by
new_id()(prefix + short uuid) so artifacts and findings are addressable and joinable across the store.confidenceappears twice on purpose, matching the spec:Scoreduses an integer 0-100 (Wappalyzer-style) for detected technologies;Findingcarries a float 0-1 for analysis judgments.
Functions
|
Return a short, unique, prefixed id, e.g. |
|
Timezone-aware current UTC time (the project's canonical timestamp). |
Classes
|
A single deterministic operation against the target. |
|
Outcome of |
|
One actionable element as perceived by a perception strategy. |
|
A content-addressed blob in the store, referenced by id everywhere else. |
|
Everything one |
|
One synthesized API endpoint, with GenSON-merged request/response schemas. |
|
The addressable unit an LLM claim must cite (D4). |
|
The grounded bundle a vision LLM reasons over (assembled model-free; §8.1). |
|
SSOT for every UX / a11y / perf / arch / robustness finding (D3 + D4). |
|
One finding's status between a run and its baseline (review-mode currency). |
|
One recorded step of the user journey -- doubles as UX evidence (§2.3). |
|
The uniform result of any perception strategy (a pure read). |
|
Deterministic loop / no-progress facts (the package never decides to stop). |
|
Own-target regression: a run vs a stored prior baseline run (review mode, §10). |
|
Mixin for every inferred (non-observed) fact. |
|
D3: |
|
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:
BaseModelA 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 humandescriptionso the journal records intent legibly.
- class ov.base.ActionResult(*, action, ok, error=None, observation=None, t_ms=0.0)[source]#
Bases:
BaseModelOutcome of
ov.operate.act.act()– success/error plus a fresh read.The fresh
Observationis the contract that lets the host (policy layer) decide the next step without a second explicit observe call.
- class ov.base.Affordance(*, ref, role, name='', bbox=None, enabled=True, editable=False)[source]#
Bases:
BaseModelOne actionable element as perceived by a perception strategy.
bboxis(x, y, w, h)in CSS pixels when a strategy can compute it (always for Screenshot/Hybrid, optional for pure AX snapshots).
- class ov.base.Artifact(*, artifact_id=<factory>, kind, step_id=None, uri='', content_hash=None, content_type=None, size=None, meta=<factory>)[source]#
Bases:
BaseModelA content-addressed blob in the store, referenced by id everywhere else.
- 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:
BaseModelEverything one
observeproduced; artifacts live in the store by id.
- 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:
ScoredOne synthesized API endpoint, with GenSON-merged request/response schemas.
- class ov.base.Evidence(*, evidence_id=<factory>, kind, artifact_id=None, summary='', meta=<factory>)[source]#
Bases:
BaseModelThe addressable unit an LLM claim must cite (D4).
The model is shown the derived
summary(a fact, not raw bytes); theartifact_idresolves – via a lookup tool – to the screenshot crop, network record or metric, for just-in-time retrieval during verification.
- 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:
BaseModelThe 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.
- 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:
BaseModelSSOT for every UX / a11y / perf / arch / robustness finding (D3 + D4).
The hard fact/judgment split lives here:
evidence_refsare cited (never authored by a model),judgmentis model interpretation only. A finding with no resolvable evidence is rejected (cite-or-abstain); the honest “can’t tell from the evidence” outcome istype="undetermined".
- 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:
BaseModelOne finding’s status between a run and its baseline (review-mode currency).
statusis the per-finding cross-run verdict;directionrolls it into the regression/improvement framing a downstream modification agent acts on. A finding is matched across runs by a stable semantickey(seeov.analysis.diff.finding_key()) – never by its per-runfinding_id.
- 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:
BaseModelOne recorded step of the user journey – doubles as UX evidence (§2.3).
- 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:
BaseModelThe uniform result of any perception strategy (a pure read).
obs_hashis a content hash of the salient observable state; it is whatProgressSignaluses to detect no-progress without an LLM.
- 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:
BaseModelDeterministic 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.”
- 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:
BaseModelOwn-target regression: a run vs a stored prior baseline run (review mode, §10).
Produced by
ov.analysis.diff.diff_runs()from two analyzedCaptureRun`s of the same target. The :attr:`finding_deltaslist is the SSOT;counts/has_driftare derived (@computed_field, so they serialize) andregressions/improvementsare 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 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:
BaseModelMixin for every inferred (non-observed) fact.
Map-backed reconstructions must rank above name-lost (un-mapped) ones; that ordering is expressed through
confidence+provenance.
- class ov.base.Severity(*, impact_tier, reach=<factory>, score=0.0)[source]#
Bases:
BaseModelD3:
severity = impact_tier x reach(prioritizes high-reach over rare-critical).
- class ov.base.TechFinding(*, confidence=50, provenance=<factory>, name, categories=<factory>, version=None)[source]#
Bases:
ScoredOne detected technology (framework, library, CDN, analytics, hosting).