# Declared Subject

> A rule or precondition that a record carries an allocated id and a declared subject key as two fields, so a moved surface keeps the id, a renamed subject keeps the key, and two records sharing a key are a finding.

Record: `architecture:declared-subject`
Kind: constraint
Layer: [Execution Core](https://banes-lab.com/records/layer/execution-core.md)
Severity: mandatory
Scope: record, identity
Canonical: https://banes-lab.com/ontology#architecture-declared-subject

Listed in [Architecture principles](https://banes-lab.com/api/records/architecture.md), after [Derived Record State](https://banes-lab.com/records/architecture/derived-record-state.md) and before [Write Barrier](https://banes-lab.com/records/architecture/write-barrier.md).

## Repair

- Refactored by: Allocate the Id Once, Declare the Subject Beside It
- Detected by: a record whose id changes when its surface moves, or two records about one subject
- Violated by: deriving a record's identity from its location or from its subject, so one of the two renames breaks it
- Measured by: records sharing a subject key
- Enforced by: coordination review

## Requires

- [Coordination Record](https://banes-lab.com/records/lexicon/coordination-record.md)

## Reinforces

- [Stable Identity](https://banes-lab.com/records/lexicon/stable-identity.md)

## Enables

- [Rederivation Detection](https://banes-lab.com/records/lexicon/rederivation-detection.md)

## Severity

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

## Category

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

## Linked from

- [Coordination Surfaces](https://banes-lab.com/ontology/lexicon/lexicon-category-coordination-surfaces.md)
- [Domain Architecture](https://banes-lab.com/ontology/lexicon/lexicon-category-domain-architecture.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)
