Skip to content

Lesson 3 of 9 · 22m

Flag Types, Lifetimes, and Ownership

Classify release, experiment, operational, permission, and migration flags so each one gets the right review, lifetime, and retirement path.

Teams get into trouble when every flag is treated as the same kind of object. A rollout toggle that should live for two weeks, an experiment that lives for a quarter, and a circuit breaker that may live forever have different risk profiles and cleanup rules. Naming them differently is not bureaucracy; it is how you keep the codebase honest.

The five types that cover most reality

release       expose incomplete or risky code gradually
experiment    compare behavior or outcomes across variants
operational   change runtime behavior during incidents or load
permission    entitle capabilities by plan, role, or contract
migration     coordinate old and new implementations during cutover

The type drives policy. Release and migration flags should be short-lived. Operational flags may be permanent but need runbooks and access control. Permission flags are product configuration, not delivery scaffolding; do not count them as temporary debt.

Give every flag a birth certificate

A lightweight registry beats archaeology:

flags:
  - key: billing.usage-reports
    type: release
    owner: team-billing
    created: 2026-11-02
    expires: 2026-12-02
    cleanup_ticket: BILL-1842

Store this in the repository or synchronize it with the flag platform. What matters is that ownership is inspectable where engineers work. A dashboard full of flags with owners who left the company is not governance; it is decorative metadata.

Permanent does not mean unexamined

Operational controls such as disable-image-ocr-under-load can be legitimate permanent architecture. They still need constraints:

  • documented safe and unsafe states
  • alerting when active for too long
  • permission to change restricted to on-call or service owners

A permanent flag without a runbook is a hidden configuration language.

Migration flags need end-state criteria

A migration flag is not finished when the new implementation works. It is finished when old data, rollback paths, retries, asynchronous jobs, downstream consumers, and observability all agree that the legacy path can disappear. Write the end-state in the flag record:

Done means:
1. 100% of new orders use orchestrator for 14 days
2. legacy capture path has zero non-test invocations
3. legacy code and flag removed in one cleanup PR

Review age by type, not vibes

A monthly review can be simple: release flags older than thirty days, migration flags past their cutover date, experiments past analysis, operational flags active outside an incident. The review output should be delete, extend with reason, or convert to product configuration. Still useful is not a lifecycle state.

Field notes

  • Do not use permission flags as a licensing system unless entitlement evaluation is consistent server-side.
  • Ownership must follow the service, not the individual who wrote the first pull request.
  • If a cleanup ticket is routinely deprioritized, make cleanup part of the definition of done for launch.

Was this lesson helpful?

Sign in to rate