Skip to content

API Reference parrot_formdesigner.core.audit_trail

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_formdesigner.core.audit_trail

View source

Deterministic validation audit-trail models (FEAT-732).

Declares the per-form FormSchema.audit_trail block, the stable check vocabulary, and the sealed ValidationTrace persisted into FormSubmission.context["validation"].

Class AuditDetail

How much deterministic validation evidence to retain.

Class AuditTrailConfig

Per-form deterministic-audit settings (FormSchema.audit_trail).

Fields:

Field Type Default Description
detail AuditDetail AuditDetail.SUMMARY
max_bytes int | None None Hard cap on the serialized trace. None resolves per detail via DEFAULT_MAX_BYTES; an explicit value always wins, in either direction.

Attributes:

Attribute Type Description
effective_max_bytes int Return max_bytes, or the DEFAULT_MAX_BYTES entry for detail.

Class CheckId

Stable identifier for one deterministic validation check.

Values are a published contract: they are persisted into submission rows and read back by auditors, so they are NEVER derived from a helper name or a localised error message, and an existing value is never renamed.

Class CheckOutcome

Result of one recorded check.

Class CheckRecord

One check, as retained under full detail (and every failure, at any detail).

Fields:

Field Type Default Description
check CheckId
outcome CheckOutcome
bound str | None None
skip_reason SkipReason | None None
message str | None None

Attribute DEFAULT_MAX_BYTES

Type: dict[AuditDetail, int]

Class FieldTrace

Per-field evidence.

Fields:

Field Type Default Description
field_id str
required_effective bool
visible_effective bool
checks_ran list[CheckId]
records list[CheckRecord]
failures list[CheckRecord]

Class SkipReason

Why a declared check did not run. A skip is evidence, not an absence of evidence.

Undeclared checks are never recorded at all — their absence is provable from ValidationTrace.schema_fingerprint.

Class ValidationTrace

Deterministic validation evidence for one submission.

checks_run / FieldTrace.checks_ran count every non-skipped record, including the two always-passing resolution.* records written for each field, so a field with no declared constraints still reports a handful of checks.

Fields:

Field Type Default Description
trace_schema int 1
detail AuditDetail
form_uid uuid.UUID
form_id str
form_version str
schema_fingerprint str
ruleset_version str
locale str
validated_at datetime
duration_ms int
checks_run int
checks_failed int
is_valid bool
form_checks list[CheckRecord]
fields list[FieldTrace]
truncated bool False
omitted_fields int 0
omitted_checks int 0

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally