Module adcp.types.domains.creative.audit_observation

Classes

class ClaimedValue (**data: Any)
Expand source code
class ClaimedValue(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    human_oversight: Annotated[
        HumanOversight,
        Field(description='Human oversight level declared by the creative provenance.'),
    ]
    disclosure_required: Annotated[
        Literal[False],
        Field(description='Disclosure-required claim declared by the creative provenance.'),
    ]

Base 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 set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='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 adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import 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_config on 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.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var disclosure_required : Literal[False]
var human_oversight : HumanOversight
var model_config

Inherited members

class CreativeAuditObservation (**data: Any)
Expand source code
class CreativeAuditObservation(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    code: Annotated[
        Literal['OVERSIGHT_DISCLOSURE_CARVEOUT_CLAIMED'],
        Field(
            description='Machine-readable observation code. `OVERSIGHT_DISCLOSURE_CARVEOUT_CLAIMED` means provenance declares `human_oversight` as `edited` or `directed` while also declaring `disclosure.required: false`; the verifier is surfacing the carve-out claim for audit, not adjudicating it.'
        ),
    ] = 'OVERSIGHT_DISCLOSURE_CARVEOUT_CLAIMED'
    severity: Annotated[
        Literal['audit-worthy'],
        Field(
            description='Routing severity. `audit-worthy` means the observation should be retained and may be routed to human or downstream audit review, but it is not a protocol rejection signal.'
        ),
    ] = 'audit-worthy'
    recovery: Annotated[
        Literal['informational'],
        Field(
            description='Caller recovery category for audit observations, distinct from the canonical error-code recovery enum. `informational` means the creative can continue through the normal flow; the observation is audit context rather than a required correction.'
        ),
    ] = 'informational'
    field: Annotated[
        str,
        Field(
            description='Resolved creative manifest path for the risky claim side of the observation, for example `creative_manifest.provenance.disclosure.required`. Some observations are triggered by a combination of fields; `field` anchors the primary claim, not necessarily every field in the trigger condition.'
        ),
    ]
    message: Annotated[
        str,
        Field(
            description='Human-readable summary suitable for an audit queue. Do not include PII, cross-tenant data, or vendor-only report details.'
        ),
    ]
    details: Annotated[
        Details,
        Field(
            description='Audit-safe structured details. Mirrors the safe allowlist keys used for `PROVENANCE_CLAIM_CONTRADICTED`; value shapes remain observation-specific. Top-level `ext` remains the standard protocol extension point, but details do not allow arbitrary verifier response fields.'
        ),
    ]
    ext: ext_1.ExtensionObject | None = None

Base 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 set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='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 adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import 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_config on 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.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var code : Literal['OVERSIGHT_DISCLOSURE_CARVEOUT_CLAIMED']
var details : Details
var ext : ExtensionObject | None
var field : str
var message : str
var model_config
var recovery : Literal['informational']
var severity : Literal['audit-worthy']

Inherited members

class Details (**data: Any)
Expand source code
class Details(AdCPBaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    agent_url: Annotated[
        AnyUrl, Field(description='Governance agent URL that produced the observation.')
    ]
    feature_id: Annotated[
        str | None, Field(description='Feature or policy check that produced the observation.')
    ] = None
    claimed_value: Annotated[
        ClaimedValue,
        Field(
            description='Compact object of claimed provenance values that triggered the observation.'
        ),
    ]
    observed_value: Annotated[
        StrictBool | StrictFloat | str | None,
        Field(description='Verifier observation relevant to the claim, when applicable.'),
    ] = None
    confidence: Annotated[
        StrictFloat | None,
        Field(description='Confidence score for the observation, when applicable.', ge=0.0, le=1.0),
    ] = None
    substituted_for: Annotated[
        AnyUrl | None,
        Field(
            description='Buyer-nominated verifier URL when the seller or orchestrator used a different on-list governance agent.'
        ),
    ] = None

Base 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 set additionalProperties: true override this with extra='allow' in their own model_config.

Set ADCP_STRICT_VALIDATION=1 in the environment ("1", "true", "yes", "on" are accepted) to flip the default to extra='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 adcp runs — mutating os.environ["ADCP_STRICT_VALIDATION"] after the first adcp import 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_config on 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.

self is explicitly positional-only to allow self as a field name.

Ancestors

Class variables

var agent_url : pydantic.networks.AnyUrl
var claimed_value : ClaimedValue
var confidence : float | None
var feature_id : str | None
var model_config
var observed_value : str | float | bool | None
var substituted_for : pydantic.networks.AnyUrl | None

Inherited members

class HumanOversight (*args, **kwds)
Expand source code
class HumanOversight(StrEnum):
    edited = 'edited'
    directed = 'directed'

Enum where members are also (and must be) strings

Ancestors

  • enum.StrEnum
  • builtins.str
  • enum.ReprEnum
  • enum.Enum

Class variables

var directed
var edited