judgevet.domain.policy_reports

Status: draft.

judgevet.domain.policy_reports

Immutable ordered policy reports.

Examples:

from judgevet.domain.policy_reports import RuleReport, PolicyReport

report = PolicyReport((RuleReport("q", False, "unmet"),))
assert not report.passed
See Also

PolicyReport dataclass

All rule outcomes in policy order with a derived aggregate.

Attributes:

Name Type Description
rules tuple

Nonempty immutable rule reports.

passed bool

Whether every rule passed.

Examples:

report = PolicyReport((RuleReport("q", True, "met"),))

passed property

Return the conjunction of all rule outcomes.

Returns:

Type Description
bool

True only when every rule passed.

__post_init__()

Copy and validate reports.

Raises:

Type Description
PolicyDefinitionError

If reports are empty, malformed or duplicated.

RuleReport dataclass

The outcome of one rule.

Attributes:

Name Type Description
question str

Question name.

passed bool

Whether every predicate passed.

detail str

Human-readable comparisons.

Examples:

report = RuleReport("q", True, "met")

__post_init__()

Require a name, boolean outcome and textual detail.

Raises:

Type Description
PolicyDefinitionError

If report fields are malformed.