# Two-Direction Index

> A mechanism that generates an index from the directory on every run and checks it both ways, reporting an entry with no file and a file with no entry, with every scan independent of depth.

Record: `architecture:two-direction-index`
Kind: mechanism
Layer: [Execution Core](https://banes-lab.com/records/layer/execution-core.md)
Severity: mandatory
Scope: index, directory
Canonical: https://banes-lab.com/ontology#architecture-two-direction-index

Listed in [Architecture principles](https://banes-lab.com/api/records/architecture.md), after [Projection Channel](https://banes-lab.com/records/architecture/projection-channel.md) and before [Independent Lifetime Axes](https://banes-lab.com/records/architecture/independent-lifetime-axes.md).

## Repair

- Refactored by: Generate the Index, Check Both Directions
- Detected by: an index entry that resolves to no file, or a file no entry names
- Violated by: writing an index by hand, or checking it in one direction only
- Measured by: index entries and files missing their counterpart
- Enforced by: coordination review

## Requires

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

## Reinforces

- [Single Source of Truth](https://banes-lab.com/records/architecture/single-source-of-truth.md)

## Enables

- [Traceable Guarantee](https://banes-lab.com/records/lexicon/traceable-guarantee.md)

## Conflicts with

- [Hand-Kept Index](https://banes-lab.com/records/architecture/hand-kept-index.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

- [Schema / Canonical Data / Semantics](https://banes-lab.com/ontology/principles/architecture-category-schema-canonical-data-semantics.md)
- [Coordination Surfaces](https://banes-lab.com/ontology/principles/architecture-category-coordination-surfaces.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/coordination.model.md](https://banes-lab.com/source/coordination/models/coordination.model.md.md)
