# Change leases: one writer per production object until its change is verified

Two changes on one flag, one route or one alert rule inside one window can cause an incident, and
they make both verdicts impossible to read: which of the two moved the error rate? A **change
lease** makes that impossible. When a governed change applies to a production object, it holds a
lease on that object until its post-change watch ends. While the lease stands, a second plan on
the same object is refused, with the reason it was refused and the time it may try again.

A lease only orders writes. It never approves anything, never widens what an agent may do, and is
never an action of its own: it is taken by the apply step of a governed change, inside the same
transaction, so a lease exists exactly when a change applied.

## What is leased

- **The object the change names**: a flag, an alert rule, a monitor, a route, a release. A family
  whose change touches more than its own target (a route group, the services a rollout names)
  states the extra objects, and each is leased.
- **Production only.** An environment your project maps as non-production takes no lease. An
  environment that is not mapped, or not stated, counts as production.
- **Never a whole project or organization.** A setting that touches nothing specific takes no
  lease, so a project-level change never blocks every other change in the project.
- **At most 25 objects per change.** A larger change is refused with `TOO_MANY_LEASES`; split it.

## When a plan is refused

A plan on a leased object is refused before anyone is asked to approve it, with HTTP 409 and
`refusalCode: CHANGE_LEASED`. The refusal names:

| Field | What it says |
| --- | --- |
| `objectKind`, `objectRef` | The object that is leased. |
| `holder` | The operation, principal and act that hold it. |
| `reason` | The holder's own stated reason, cut to 300 characters. |
| `expiresAt`, `retryAt` | When the lease lapses, and when this plan may try again. |

The same check runs again when an approved change applies, so two plans approved at the same
moment cannot both land: one applies, and the other is refused with its approval left unspent.
The holder's own second plan on the same object is refused too: one writer means one writer.

`decision_preview` shows a `lease` block when the object it previews is leased: who holds it, when
it lapses, and whether this act would be refused or would preempt. The block carries no free text;
use `change_leases_list` to read the holder's reason.

## Safety acts always go through

A change that moves toward safety is **never** refused by a lease: a kill switch, a narrowing, a
pause, a rollback. It takes the object over: the holder's lease becomes `contested` (so the
holder's verdict says its window was shared) and the safety act takes its own lease.

A change the classifier derives as a *loosening* is never treated as a safety act, whatever its
verb: pausing an alert rule or disabling a monitor takes protection away, so it waits like any
other plan.

A revert of a change ends that change's lease instead of waiting behind it.

## When a lease ends

- **With its watch.** Once the change's watch opens, the lease ends when the watch ends, and a watch
  that closes early frees the object. This is read, not swept: a worker that is down cannot make a
  lease outlive its change.
- **Released by its holder.** `change_lease.release` lets the principal whose change holds a lease
  let go of it early. Only the holder may release, and a contested lease stays contested.
- **Broken by a person.** `change_lease.break` is human-only: an agent, an OAuth client and a
  delegated session are refused whatever scope they hold. It needs a reason of at least 8
  characters, which is recorded on the audit row; the holder is told; and the holder's verdict reads
  `confounded`, because two writers acted inside its window.
- **When the change fails.** A change whose apply does not complete lets its leases go.

## Changes Bucker did not make

A change that lands on a leased object from outside Bucker, such as a flag flipped in your flag
vendor's own dashboard, marks the lease **contested** and closes every approval pending on that
object as inapplicable (`TARGET_CHANGED`): a yes given before the outside change was a yes to a
world that no longer exists. The contested lease keeps blocking other plans until it lapses.

- The vendor's webhook for a change Bucker itself just applied arrives seconds later. A flip within
  one minute before or two minutes after the holder's apply is read as that echo and contests
  nothing. The cost is stated: an outside change in the same two minutes reads as the echo.
- A flip in an environment your project maps as non-production contests nothing.
- A webhook delivered twice contests nothing the second time.
- A flip reported for one project never reaches a lease in another project or organization.

## What the verdict says about its window

Every post-change verdict carries `windowState` in its evidence:

| `windowState` | Meaning |
| --- | --- |
| `clean` | The change held its object alone for its whole window. |
| `shared` | Another change landed inside the window: an outside change, or a safety act that preempted. |
| `confounded` | A person broke the lease. The window cannot be interpreted. |
| `unleased` | The change took no lease (non-production, or a project-level change). |

`windowState` is evidence only. It never changes the verdict's kind.

## Reading leases

The MCP tool `change_leases_list` (`project:read`, `agents` toolset) lists a project's leases newest
first with a cursor: the object, the holding change and act, the lapse time, the effective state
(`ended` for a lease whose end passed or whose watch closed) and the window state. The holder's
reason and a break reason are text written by people and agents, so both are sanitized and
declared untrusted in the answer. Until the SG-059 review completes, the tool is held: a token a
production path can mint does not list it.

## Review mode

Review mode never lifts a lease refusal: the lease check runs after the approvals engine, so a deny,
an invariant, an ask floor or a dual-control requirement is decided exactly as before, and a lease
only adds a refusal of its own.
