# Bounded Nesting Depth

> A rule or precondition that a file sits within a fixed number of folders below its governed root, with each folder taking a later role than the one above it.

Record: `architecture:bounded-nesting-depth`
Kind: constraint
Layer: [Structural Core](https://banes-lab.com/records/layer/structural-core.md)
Severity: mandatory
Scope: folder, root
Canonical: https://banes-lab.com/ontology#architecture-bounded-nesting-depth

Listed in [Architecture principles](https://banes-lab.com/api/records/architecture.md), after [Declared Jurisdiction](https://banes-lab.com/records/architecture/declared-jurisdiction.md) and before [Sideways Overflow](https://banes-lab.com/records/architecture/sideways-overflow.md).

## Repair

- Refactored by: Take the Variant Slot, Add a Sibling Subject Folder
- Detected by: a path over the cap, or a role repeated or revisited along it
- Violated by: adding a level to relieve collision or breadth pressure
- Measured by: over-cap path count
- Enforced by: placement gate

## Requires

- [Depth Cap](https://banes-lab.com/records/lexicon/depth-cap.md)
- [Ordered Role Sequence](https://banes-lab.com/records/lexicon/ordered-role-sequence.md)

## Reinforces

- [Placement Predictability](https://banes-lab.com/records/lexicon/placement-predictability.md)

## Enables

- [Sideways Overflow](https://banes-lab.com/records/architecture/sideways-overflow.md)

## Conflicts with

- [Downward Nesting](https://banes-lab.com/records/lexicon/downward-nesting.md)

## In tension with

- [Tree Compactness](https://banes-lab.com/records/lexicon/tree-compactness.md)

## Tensions

- [Bounded Nesting Depth / Tree Compactness](https://banes-lab.com/records/tension/bounded-nesting-depth-tree-compactness.md)

## Contracts

- [Path Role Walk](https://banes-lab.com/records/algorithms/path-role-walk.md)

## Severity

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

## Category

- [Taxonomy / Classification / Naming](https://banes-lab.com/records/architecture-category/taxonomy-classification-naming.md)

## Enforced by

- [rules/entrypoints/taxonomy.entrypoint.ts](https://banes-lab.com/source/governance/rules/entrypoints/taxonomy.entrypoint.ts.md)

## Enabled by

- [Declared Jurisdiction](https://banes-lab.com/records/architecture/declared-jurisdiction.md)

## Linked from

- [Placement is a grammar](https://banes-lab.com/disciplined-methodology/build/placement-is-a-grammar.md)
- [The structural domain](https://banes-lab.com/software-architecture/principles/the-structural-domain.md)
- [Taxonomy / Classification / Naming](https://banes-lab.com/ontology/principles/architecture-category-taxonomy-classification-naming.md)
- [Taxonomy / Classification / Naming](https://banes-lab.com/ontology/lexicon/lexicon-category-taxonomy-classification-naming.md)
- [Taxonomy](https://banes-lab.com/ontology/algorithms/algorithms-domain-taxonomy.md)
- [Severity levels](https://banes-lab.com/ontology/schema/the-vocabulary-severity.md)
- [The resolutions](https://banes-lab.com/ontology/schema/the-resolutions.md)

## Evidence in the code

- [checkPlacement](https://banes-lab.com/source/coordination/tools/core/validators/taxonomy.validator.ts.md)
