ov.analysis.context#

The analysis context + analyzer output – the currency of the pure analyzers.

Analyzers are pure functions over captured artifacts: they never touch a browser or a model. AnalysisContext injects the run + store + config and gives small helpers for reading artifacts by kind; AnalyzerOutput is what every analyzer returns, which the orchestrator merges back into the run.

This is the testability seam: feed an analyzer synthetic artifacts and assert on the :class:`~ov.base.Finding`s it returns – no network, no browser, no LLM.

Classes

AnalysisContext(run, store[, config, extras])

Everything an analyzer needs, plus artifact-reading helpers.

AnalyzerOutput([findings, endpoints, tech, ...])

What an analyzer produces; merged into the run by the orchestrator.

class ov.analysis.context.AnalysisContext(run, store, config=OvConfig(), extras=dict())[source]#

Bases: object

Everything an analyzer needs, plus artifact-reading helpers.

artifacts(kind)[source]#

All artifacts of kind in run order.

Return type:

list[Artifact]

by_step(kind)[source]#

Group artifacts of kind by their step_id.

Return type:

dict[str | None, list[Artifact]]

json(artifact)[source]#

Parse an artifact’s bytes as JSON (None on failure).

Return type:

Any

jsons(kind)[source]#

Parse every artifact of kind as JSON, dropping unparseable ones.

Return type:

list[Any]

latest(kind)[source]#

The last artifact of kind (or None).

Return type:

Artifact | None

raw(artifact)[source]#

Raw bytes for an artifact.

Return type:

bytes

text(artifact)[source]#

Decode an artifact’s bytes as UTF-8 text.

Return type:

str

class ov.analysis.context.AnalyzerOutput(findings=list(), endpoints=list(), tech=list(), run_fields=dict(), summary=dict())[source]#

Bases: object

What an analyzer produces; merged into the run by the orchestrator.