record_domain_result
Save a domain's audit result after validating verdict completeness, finding consistency, and source attribution, preventing silent skips or invalid citations; replace=true overwrites existing records.
Instructions
Record the audit result for one domain.
The payload itself is pydantic-validated by DomainResult (finding and
verdict consistency, could-not-run reason, could-not-evaluate and
not-applicable notes, both of which are the verdict's stated reason,
every finding's precondition, the completed domain's
uninspected_evidence, and that every consulted_sources entry has a
non-blank url, title and why). On top of that: the domain must be one of the domains
selected for this run, a completed result must carry a verdict for
every rule the domain defines, and every consulted_sources rule_id
must be one of this domain's own rules; a completed result missing a
verdict raises IncompleteResultError listing exactly which rule ids
are missing, and an unattributable consulted source raises
UnknownRuleIdError, so the agent can fix and resubmit rather than a
skipped rule silently passing or a citation silently pointing at
nothing. Re-recording an already-recorded domain requires
replace=True, to guard against an accidental overwrite.
Verdicts for a domain get_domain was never called for during this run
are recorded, not refused, and the response says "rules_fetched": false
and carries a warning naming what that means. The report names the
domain too. Recording rather than refusing is deliberate: refusing
would be trivially satisfied by fetching the text and ignoring it,
which destroys the signal, while the verdicts and the fact that they
were unsupported both survive this way. Tell the user when you see it.
Two fields are refused outright rather than recorded with a warning,
because unlike an unfetched domain there is no signal to preserve by
letting them through: a finding without a `precondition` (issue #178)
and a completed domain without `uninspected_evidence` (issue #179).
Both are one sentence the auditor already knows the answer to, and in
both cases being unable to write it is the finding. A finding whose
precondition cannot be named belongs at not-applicable, and a domain
that cannot say what it did not read has not established what its
absence claims are worth. See AUDIT.md step 3 and step 4.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes | ||
| replace | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||