# Feature Toggle

> A mechanism that switches a code path on or off at runtime from externally held flag state, so a release can happen without a deploy.

Record: `architecture:feature-toggle`
Kind: mechanism
Layer: [Extensibility Core](https://banes-lab.com/records/layer/extensibility-core.md)
Severity: contextual
Scope: application, release, runtime
Canonical: https://banes-lab.com/ontology#architecture-feature-toggle

Listed in [Architecture principles](https://banes-lab.com/api/records/architecture.md), after [Service Locator Pattern](https://banes-lab.com/records/architecture/service-locator-pattern.md) and before [Self-Healing Architecture](https://banes-lab.com/records/architecture/self-healing-architecture.md).

## Repair

- Refactored by: Introduce Runtime Feature Flags
- Detected by: compile-time flags requiring redeploy to flip
- Violated by: release paths gated by a hardcoded boolean constant
- Measured by: redeploys per behavior change
- Enforced by: release review

## Requires

- [Externalized Flag State](https://banes-lab.com/records/lexicon/externalized-flag-state.md)

## Reinforces

- [Continuous Delivery](https://banes-lab.com/records/lexicon/continuous-delivery.md)
- [Runtime Extensibility](https://banes-lab.com/records/architecture/runtime-extensibility.md)

## Enables

- [Decoupled Deploy and Release](https://banes-lab.com/records/lexicon/decoupled-deploy-and-release.md)
- [Gradual Rollout](https://banes-lab.com/records/lexicon/gradual-rollout.md)

## Conflicts with

- [Hardcoded Branch Constant](https://banes-lab.com/records/lexicon/hardcoded-branch-constant.md)

## In tension with

- [Flag Debt](https://banes-lab.com/records/lexicon/flag-debt.md)

## Tensions

- [Feature Toggle / Flag Debt](https://banes-lab.com/records/tension/feature-toggle-flag-debt.md)

## Severity

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

## Category

- [Plugin / Extensibility / IoC](https://banes-lab.com/records/architecture-category/plugin-extensibility-ioc.md)

## Linked from

- [A system is a graph](https://banes-lab.com/software-architecture/model/a-system-is-a-graph.md)
- [Runtime Discovery / Dynamic Binding](https://banes-lab.com/ontology/principles/architecture-category-runtime-discovery-dynamic-binding.md)
- [Plugin / Extensibility / IoC](https://banes-lab.com/ontology/lexicon/lexicon-category-plugin-extensibility-ioc.md)
- [Severity levels](https://banes-lab.com/ontology/schema/the-vocabulary-severity.md)
- [The resolutions](https://banes-lab.com/ontology/schema/the-resolutions.md)
