# Narrowed Aggregate

> A defect in which a run over a narrowed scope overwrites the whole-scope aggregate, so the aggregate reports a smaller population as though it were the whole.

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

Listed in [Architecture principles](https://banes-lab.com/api/records/architecture.md), after [Invocation-Keyed Report](https://banes-lab.com/records/architecture/invocation-keyed-report.md) and before [Cyclic Tiebreak](https://banes-lab.com/records/architecture/cyclic-tiebreak.md).

## Repair

- Refactored by: Write the Aggregate Only From a Full Run
- Detected by: an aggregate whose recorded population is smaller than the declared one
- Violated by: writing the aggregate from a run that measured part of its population
- Measured by: aggregate writes from narrowed runs
- 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

- [Single Aggregate](https://banes-lab.com/records/architecture/single-aggregate.md)

## Linked from

- [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/substrate.model.md](https://banes-lab.com/source/coordination/models/substrate.model.md.md)
