# Declare-Before-Read Order

> A mechanism that orders two simultaneous starters without a lock by writing each entry before reading the set, with the start stamp and then the party identity breaking a tie.

Record: `architecture:declare-before-read-order`
Kind: mechanism
Layer: [Execution Core](https://banes-lab.com/records/layer/execution-core.md)
Severity: recommended
Scope: run, concurrency
Canonical: https://banes-lab.com/ontology#architecture-declare-before-read-order

Listed in [Architecture principles](https://banes-lab.com/api/records/architecture.md), after [Reversible Channel Encoding](https://banes-lab.com/records/architecture/reversible-channel-encoding.md) and before [Period-Decided Disposition](https://banes-lab.com/records/architecture/period-decided-disposition.md).

## Repair

- Refactored by: Write the Entry, Then Read the Set
- Detected by: two runs over one scope that both proceeded
- Violated by: reading the set of live runs before writing one's own entry, so two starters each see an empty set
- Measured by: simultaneous starters that both proceeded
- Enforced by: coordination review

## Requires

- [Write Scope](https://banes-lab.com/records/lexicon/write-scope.md)

## Reinforces

- [Determinism](https://banes-lab.com/records/architecture/determinism.md)

## Enables

- [Shared Invocation](https://banes-lab.com/records/lexicon/shared-invocation.md)

## Severity

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

## Category

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

## Linked from

- [Correctness / Determinism / Verification](https://banes-lab.com/ontology/principles/architecture-category-correctness-determinism-verification.md)
- [Coordination Surfaces](https://banes-lab.com/ontology/lexicon/lexicon-category-coordination-surfaces.md)
- [Severity levels](https://banes-lab.com/ontology/schema/the-vocabulary-severity.md)

## Evidence in the code

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