Coherence Rules
Define cross-field quality rules on a Spec. List, create, update, delete, and auto-propose coherence rules that penalize confidence on violating cells.
Coherence rules are cross-field quality rules attached to a Spec (a user_schema). Where a validation stage gates the pipeline at a position, a coherence rule expresses a relationship that should hold between fields in a record, for example "field A must not equal field B" or "if field A has a value then field B must be non-zero". When a rule is violated, the platform applies a confidence_penalty to the affected cells so they surface for review.
A rule has a rule_type (such as not_equal, implies_value, non_zero_when_sibling_filled, value_range, or custom) and a config object that names the fields and thresholds for that type. The service stores config verbatim and infers sane defaults for omitted fields. Rules carry a status of proposed, active, or rejected.
You can have Claude auto-propose rules from the Spec fields via the propose endpoint. Proposed rules land with status proposed. Approve one by updating it to status: active, or dismiss it with status: rejected. This keeps the human in the loop while letting the model surface candidate relationships you might not have hand-written.
/v1/schemas/{id}/coherence-rules/v1/schemas/{id}/coherence-rules/v1/schemas/{id}/coherence-rules/propose/v1/schemas/{id}/coherence-rules/{ruleId}/v1/schemas/{id}/coherence-rules/{ruleId}Response
Rule fields
Response
[
{
"id": "c0ffee00-1111-2222-3333-444455556666",
"rule_type": "non_zero_when_sibling_filled",
"config": {
"trigger_field": "tax_rate",
"required_field": "tax_amount"
},
"description": "If a tax rate is present, tax amount must be non-zero.",
"confidence_penalty": 0.3,
"status": "active"
}
]Errors
Error responses