# Contradicted Invariant

> A defect in which one surface states the opposite of an invariant another relies on, so every mechanism faithfully implementing either statement stays green while the invariant is violated.

Record: `architecture:contradicted-invariant`
Kind: anti-pattern
Layer: [Execution Core](https://banes-lab.com/records/layer/execution-core.md)
Severity: discouraged
Scope: topology
Canonical: https://banes-lab.com/ontology#architecture-contradicted-invariant

Listed in [Architecture principles](https://banes-lab.com/api/records/architecture.md), after [Single Aggregate](https://banes-lab.com/records/architecture/single-aggregate.md) and before [Written Status Marker](https://banes-lab.com/records/architecture/written-status-marker.md).

## Repair

- Refactored by: Treat the Set of Statements as the Unit, Re-Derive Every Copy on Change
- Detected by: two statements of one invariant that no single query ranges over
- Violated by: restating an invariant in a second surface and changing only one of the copies
- Measured by: invariants whose copies disagree
- Enforced by: coordination review

## Severity

- [discouraged](https://banes-lab.com/records/vocabulary/severity-discouraged.md)

## Category

- [Coordination Surfaces](https://banes-lab.com/records/architecture-category/coordination-surfaces.md)

## Negated by

- [Stated Invariant](https://banes-lab.com/records/architecture/stated-invariant.md)
- [Operand-Free Outcome Surface](https://banes-lab.com/records/architecture/operand-free-outcome-surface.md)

## Linked from

- [Stating an invariant](https://banes-lab.com/disciplined-methodology/collaborate/stating-an-invariant.md)
- [Coordination Surfaces](https://banes-lab.com/ontology/principles/architecture-category-coordination-surfaces.md)
- [Severity levels](https://banes-lab.com/ontology/schema/the-vocabulary-severity.md)

## Evidence in the code

- [models/coordination.model.md](https://banes-lab.com/source/coordination/models/coordination.model.md.md)
