Skip to main content

ValidationReport Class

Report produced by running a ContractRegistry. More...

Declaration

class simaai::neat::ValidationReport { ... }

Included Headers

#include <ValidationReport.h>

Public Constructors Index

ValidationReport ()=default

Construct an empty report. More...

Public Member Functions Index

voidadd_issue (ValidationIssue issue)

Append an issue to the report. More...

voidadd_info (std::string contract_id, std::string code, std::string msg, int node_index=-1, std::string node_kind={}, std::string node_label={})

Append an Info issue. More...

voidadd_warning (std::string contract_id, std::string code, std::string msg, int node_index=-1, std::string node_kind={}, std::string node_label={})

Append a Warning issue. More...

voidadd_error (std::string contract_id, std::string code, std::string msg, int node_index=-1, std::string node_kind={}, std::string node_label={})

Append an Error issue. More...

voidnote_contract_run (std::string id)

Record that a contract id participated in this validation pass. More...

voidset_mode (int mode)

Record which Graph mode produced this report (integer to avoid Contract.h include). More...

intmode () const

Mode integer set via set_mode(). More...

const std::vector< ValidationIssue > &issues () const noexcept

All issues collected, in insertion order. More...

const std::vector< std::string > &contracts_run () const noexcept

Ids of all contracts that ran (in evaluation order). More...

boolok () const noexcept

True if the report contains no errors (warnings/info are still allowed). More...

boolhas_errors () const noexcept

True if at least one issue with Error severity is present. More...

std::size_terror_count () const noexcept

Count of Error issues in the report. More...

std::size_twarning_count () const noexcept

Count of Warning issues in the report. More...

std::size_tinfo_count () const noexcept

Count of Info issues in the report. More...

std::stringto_string () const

Render the report as a deterministic, human-readable text block. More...

std::stringto_json () const

Serialize the report as a JSON string (CI/dashboard-friendly). More...

Private Member Attributes Index

intmode_ = 0
std::vector< std::string >contracts_run_
std::vector< ValidationIssue >issues_

Private Static Functions Index

static std::stringjson_escape_ (const std::string &s)

Description

Report produced by running a ContractRegistry.

Aggregates all issues emitted by every contract that was run, plus the list of contract ids that participated. STL-only, CI-friendly, and safe to serialize via to_string() (text) or to_json() (JSON).

See Also

ValidationIssue

See Also

ContractRegistry

Definition at line 82 of file ValidationReport.h.

Public Constructors

ValidationReport()

simaai::neat::ValidationReport::ValidationReport ()
default

Construct an empty report.

Definition at line 85 of file ValidationReport.h.

Public Member Functions

add_error()

void simaai::neat::ValidationReport::add_error (std::string contract_id, std::string code, std::string msg, int node_index=-1, std::string node_kind={}, std::string node_label={})
inline

Append an Error issue.

Definition at line 109 of file ValidationReport.h.

add_info()

void simaai::neat::ValidationReport::add_info (std::string contract_id, std::string code, std::string msg, int node_index=-1, std::string node_kind={}, std::string node_label={})
inline

Append an Info issue.

Definition at line 95 of file ValidationReport.h.

add_issue()

void simaai::neat::ValidationReport::add_issue (ValidationIssue issue)
inline

Append an issue to the report.

Definition at line 90 of file ValidationReport.h.

add_warning()

void simaai::neat::ValidationReport::add_warning (std::string contract_id, std::string code, std::string msg, int node_index=-1, std::string node_kind={}, std::string node_label={})
inline

Append a Warning issue.

Definition at line 102 of file ValidationReport.h.

contracts_run()

const std::vector< std::string > & simaai::neat::ValidationReport::contracts_run ()
inline noexcept

Ids of all contracts that ran (in evaluation order).

Definition at line 136 of file ValidationReport.h.

error_count()

std::size_t simaai::neat::ValidationReport::error_count ()
inline noexcept

Count of Error issues in the report.

Definition at line 155 of file ValidationReport.h.

has_errors()

bool simaai::neat::ValidationReport::has_errors ()
inline noexcept

True if at least one issue with Error severity is present.

Definition at line 146 of file ValidationReport.h.

info_count()

std::size_t simaai::neat::ValidationReport::info_count ()
inline noexcept

Count of Info issues in the report.

Definition at line 173 of file ValidationReport.h.

issues()

const std::vector< ValidationIssue > & simaai::neat::ValidationReport::issues ()
inline noexcept

All issues collected, in insertion order.

Definition at line 132 of file ValidationReport.h.

mode()

int simaai::neat::ValidationReport::mode ()
inline

Mode integer set via set_mode().

Definition at line 125 of file ValidationReport.h.

note_contract_run()

void simaai::neat::ValidationReport::note_contract_run (std::string id)
inline

Record that a contract id participated in this validation pass.

Definition at line 116 of file ValidationReport.h.

ok()

bool simaai::neat::ValidationReport::ok ()
inline noexcept

True if the report contains no errors (warnings/info are still allowed).

Definition at line 141 of file ValidationReport.h.

set_mode()

void simaai::neat::ValidationReport::set_mode (int mode)
inline

Record which Graph mode produced this report (integer to avoid Contract.h include).

Definition at line 121 of file ValidationReport.h.

to_json()

std::string simaai::neat::ValidationReport::to_json ()
inline

Serialize the report as a JSON string (CI/dashboard-friendly).

Definition at line 210 of file ValidationReport.h.

to_string()

std::string simaai::neat::ValidationReport::to_string ()
inline

Render the report as a deterministic, human-readable text block.

Definition at line 184 of file ValidationReport.h.

warning_count()

std::size_t simaai::neat::ValidationReport::warning_count ()
inline noexcept

Count of Warning issues in the report.

Definition at line 164 of file ValidationReport.h.

Private Member Attributes

contracts_run_

std::vector<std::string> simaai::neat::ValidationReport::contracts_run_

Definition at line 294 of file ValidationReport.h.

issues_

std::vector<ValidationIssue> simaai::neat::ValidationReport::issues_

Definition at line 295 of file ValidationReport.h.

mode_

int simaai::neat::ValidationReport::mode_ = 0

Definition at line 293 of file ValidationReport.h.

Private Static Functions

json_escape_()

std::string simaai::neat::ValidationReport::json_escape_ (const std::string & s)
inline static

Definition at line 251 of file ValidationReport.h.


The documentation for this class was generated from the following file:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.