Module adcp.types.domains.property.validation_result
Classes
class Feature (**data: Any)-
Expand source code
class Feature(AdCPBaseModel): model_config = ConfigDict( extra='forbid', ) feature_id: Annotated[ str, Field( description="Which feature was evaluated. Data features come from the governance agent's feature catalog (e.g., 'mfa_score', 'carbon_score'). Record-level structural checks use reserved namespaces: 'record:list_membership', 'record:excluded', 'delivery:seller_authorization', 'delivery:click_url_presence'. Reserved prefixes: 'record:', 'delivery:'." ), ] status: feature_check_status.FeatureCheckStatus policy_id: Annotated[ str | None, Field( description='Optional attribution — when this feature was evaluated for the purpose of a specific policy, policy_id references the authorizing PolicyEntry. Property-list agents populate when the validation was motivated by a specific policy. See /docs/governance/policy-attribution.' ), ] = None explanation: Annotated[ str | None, Field(description='Directional human-readable explanation of the result.') ] = None requirement: Annotated[ Requirement | None, Field( description='The feature requirement that was not met. MAY be present on failed features when the caller authored the requirement (e.g., feature_requirements on a property list). The buyer set these thresholds — echoing them back enables fix-and-retry loops without looking up the list definition.' ), ] = None confidence: Annotated[ StrictFloat | None, Field( description='Optional evaluator confidence in this result (0-1). Distinguishes certain verdicts from ambiguous ones.', ge=0.0, le=1.0, ), ] = NoneBase model for AdCP types with spec-compliant serialization.
Defaults to
extra='ignore'so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas setadditionalProperties: trueoverride this withextra='allow'in their ownmodel_config.Set
ADCP_STRICT_VALIDATION=1in the environment ("1","true","yes","on"are accepted) to flip the default toextra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.Important
The env var is resolved once at module import time. Set it in your shell or CI environment before
import adcpruns — mutatingos.environ["ADCP_STRICT_VALIDATION"]after the firstadcpimport has no effect on already-imported model classes (they captured the policy at class-body evaluation).Consumers who want per-model strict validation can override
model_configon their subclass.Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.Ancestors
- AdCPBaseModel
- pydantic.main.BaseModel
Class variables
var confidence : float | Nonevar explanation : str | Nonevar feature_id : strvar model_configvar policy_id : str | Nonevar requirement : Requirement | Nonevar status : FeatureCheckStatus
Inherited members
class Requirement (**data: Any)-
Expand source code
class Requirement(AdCPBaseModel): model_config = ConfigDict( extra='forbid', ) min_value: Annotated[ StrictFloat | None, Field(description='Minimum value that was required') ] = None max_value: Annotated[ StrictFloat | None, Field(description='Maximum value that was allowed') ] = None allowed_values: Annotated[ list[Any] | None, Field(description='Values that would have been acceptable') ] = NoneBase model for AdCP types with spec-compliant serialization.
Defaults to
extra='ignore'so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas setadditionalProperties: trueoverride this withextra='allow'in their ownmodel_config.Set
ADCP_STRICT_VALIDATION=1in the environment ("1","true","yes","on"are accepted) to flip the default toextra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.Important
The env var is resolved once at module import time. Set it in your shell or CI environment before
import adcpruns — mutatingos.environ["ADCP_STRICT_VALIDATION"]after the firstadcpimport has no effect on already-imported model classes (they captured the policy at class-body evaluation).Consumers who want per-model strict validation can override
model_configon their subclass.Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.Ancestors
- AdCPBaseModel
- pydantic.main.BaseModel
Class variables
var allowed_values : list[typing.Any] | Nonevar max_value : float | Nonevar min_value : float | Nonevar model_config
Inherited members
class Status (*args, **kwds)-
Expand source code
class Status(StrEnum): compliant = 'compliant' non_compliant = 'non_compliant' not_covered = 'not_covered' unidentified = 'unidentified'Enum where members are also (and must be) strings
Ancestors
- enum.StrEnum
- builtins.str
- enum.ReprEnum
- enum.Enum
Class variables
var compliantvar non_compliantvar not_coveredvar unidentified
class ValidationResult (**data: Any)-
Expand source code
class ValidationResult(AdCPBaseModel): model_config = ConfigDict( extra='forbid', ) identifier: Annotated[ identifier_1.Identifier, Field(description='The identifier that was validated') ] record_id: Annotated[ str | None, Field(description='Client-provided ID from the delivery record (if provided)') ] = None status: Annotated[ Status, Field( description='Validation status: compliant (in list), non_compliant (not in list), not_covered (identifier recognized but no data available), unidentified (identifier type not resolvable by this governance agent)' ), ] impressions: Annotated[ SchemaInt, Field(description='Number of impressions from this record', ge=0) ] features: Annotated[ list[Feature] | None, Field( description='Per-feature breakdown for this record. SHOULD include all failed and warning features. MAY include passed features. For property validation the buyer authored the requirement, so the `requirement` that was not met MAY be echoed back on failures — this is contract data, not evaluator IP.' ), ] = None authorization: Annotated[ authorization_result.AuthorizationResult | None, Field( description='Authorization validation result (only present if sales_agent_url was provided in the delivery record)' ), ] = None ext: ext_1.ExtensionObject | None = NoneBase model for AdCP types with spec-compliant serialization.
Defaults to
extra='ignore'so unknown fields from newer spec versions are silently dropped rather than causing validation errors. Generated types whose schemas setadditionalProperties: trueoverride this withextra='allow'in their ownmodel_config.Set
ADCP_STRICT_VALIDATION=1in the environment ("1","true","yes","on"are accepted) to flip the default toextra='forbid'. Use this during spec upgrades to catch silently-dropped renamed fields in tests. See :func:_resolve_extra_policy.Important
The env var is resolved once at module import time. Set it in your shell or CI environment before
import adcpruns — mutatingos.environ["ADCP_STRICT_VALIDATION"]after the firstadcpimport has no effect on already-imported model classes (they captured the policy at class-body evaluation).Consumers who want per-model strict validation can override
model_configon their subclass.Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.Ancestors
- AdCPBaseModel
- pydantic.main.BaseModel
Class variables
var ext : ExtensionObject | Nonevar features : list[Feature] | Nonevar identifier : Identifiervar impressions : intvar model_configvar record_id : str | Nonevar status : Status
Inherited members