# Forward-Only Processing

> A rule or precondition that a stream is read once in order, keeping only rolling state, so no decision ever needs to revisit earlier input.

Record: `architecture:forward-only-processing`
Kind: constraint
Layer: [Execution Core](https://banes-lab.com/records/layer/execution-core.md)
Severity: contextual
Scope: stream, parser, iterator
Aliases: No Backtracking Requirement
Canonical: https://banes-lab.com/ontology#architecture-forward-only-processing

Listed in [Architecture principles](https://banes-lab.com/api/records/architecture.md), after [Sequential Access](https://banes-lab.com/records/architecture/sequential-access.md) and before [Dataflow Architecture](https://banes-lab.com/records/architecture/dataflow-architecture.md).

## Repair

- Refactored by: Add Rolling State, Redesign Parser
- Detected by: buffering full stream to look back
- Violated by: requiring prior/future full data in stream path
- Measured by: buffer size, pass count
- Enforced by: memory tests

## Reinforces

- [Single-Pass Processing](https://banes-lab.com/records/architecture/single-pass-processing.md)

## Enables

- [Streaming Parsers](https://banes-lab.com/records/lexicon/streaming-parsers.md)

## In tension with

- [Complex Grammar/Global State](https://banes-lab.com/records/lexicon/complex-grammar-global-state.md)
- [Backtracking Algorithm](https://banes-lab.com/records/lexicon/backtracking-algorithm.md)

## Tensions

- [Forward-Only Processing / Complex Grammar/Global State](https://banes-lab.com/records/tension/complex-grammar-global-state-forward-only-processing.md)
- [Forward-Only Processing / Backtracking Algorithm](https://banes-lab.com/records/tension/backtracking-algorithm-forward-only-processing.md)

## Severity

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

## Category

- [Streaming / Pipeline / Dataflow Processing](https://banes-lab.com/records/architecture-category/streaming-pipeline-dataflow-processing.md)

## Linked from

- [Streaming / Pipeline / Dataflow Processing](https://banes-lab.com/ontology/principles/architecture-category-streaming-pipeline-dataflow-processing.md)
- [Streaming / Pipeline / Dataflow Processing](https://banes-lab.com/ontology/lexicon/lexicon-category-streaming-pipeline-dataflow-processing.md)
- [Severity levels](https://banes-lab.com/ontology/schema/the-vocabulary-severity.md)
- [The resolutions](https://banes-lab.com/ontology/schema/the-resolutions.md)
