# Reversible Channel Encoding

> A rule or precondition that a channel name is a total and invertible encoding of the scope it belongs to, with an alphabet that excludes the separator, so a retention check can read the scope back out of the name.

Record: `architecture:reversible-channel-encoding`
Kind: constraint
Layer: [Execution Core](https://banes-lab.com/records/layer/execution-core.md)
Severity: recommended
Scope: channel, naming
Canonical: https://banes-lab.com/ontology#architecture-reversible-channel-encoding

Listed in [Architecture principles](https://banes-lab.com/api/records/architecture.md), after [One-Sided Liveness](https://banes-lab.com/records/architecture/one-sided-liveness.md) and before [Declare-Before-Read Order](https://banes-lab.com/records/architecture/declare-before-read-order.md).

## Repair

- Refactored by: Encode the Scope Reversibly, Declare the Remover
- Detected by: a channel whose name decodes to no scope
- Violated by: naming a channel by a digest of its scope, which separates channels but cannot be decoded
- Measured by: channels no remover can attribute to a scope
- Enforced by: the coordination channel check, which reports a channel whose decoded scope resolves to nothing

## Requires

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

## Reinforces

- [Stable Identity](https://banes-lab.com/records/lexicon/stable-identity.md)

## Enables

- [Governed Removal](https://banes-lab.com/records/lexicon/governed-removal.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

- [Coordination Surfaces](https://banes-lab.com/ontology/lexicon/lexicon-category-coordination-surfaces.md)
- [Domain Architecture](https://banes-lab.com/ontology/lexicon/lexicon-category-domain-architecture.md)
- [Severity levels](https://banes-lab.com/ontology/schema/the-vocabulary-severity.md)

## Evidence in the code

- [staleChannels](https://banes-lab.com/source/coordination/tools/core/validators/channel.validator.ts.md)
- [misnamedChannels](https://banes-lab.com/source/coordination/tools/core/validators/channel.validator.ts.md)
- [models/invocation.model.md](https://banes-lab.com/source/coordination/models/invocation.model.md.md)
