Runtime Gates via Shared Lease

Rule

Runtime-bound verification (build / UX / migration gates) from a worktree goes through the shared lease, always: claim_nonprod_environment_lease(environmentKey="local-integration-ci") is the only sanctioned runtime. Every shared singleton runtime MUST be lease-gated — including the :3001 Contributor preview, which folds into the local-integration-ci lease (spec §7 Q5). Specifically:

Why

The shared lease is the same unleased-shared-mutable-resource discipline applied uniformly. On 2026-06-05, agents inconsistently built their own per-branch CI images (5 orphaned dpf-local-integration-*-build images, ~20 GB; ~50 GB Docker reclaimable). Worse, the :3001 dev-portal was a single shared container bind-mounted to one worktree at a time via DPF_DEV_WORKTREE, writing to the LIVE database, with no lease — so whichever surface ran dev-portal-start last silently re-pointed :3001 to its own worktree, and a coding mistake there mutated production data. That is the same antipattern as a per-branch CI image, but worse (live-DB write). At DPF’s expected scale (1k–10k concurrent worktrees) per-worktree runnable runtimes are structurally untenable; the shared lease is the bounded-runtime answer (worktree-is-source-control-not-runtime), serializing converge + de-conflict + verify before a PR ships.

The exposure clause exists because the lease alone does not close that hazard. The lease decides which thread may bind the shared runtime; it says nothing about who can reach it. An agent that legitimately holds the lease and wants a preview on a phone can satisfy every other rule here and still publish an unauthenticated write path to the live database — the convenience is a normal, widely-shared practice elsewhere, which is exactly why the prohibition has to be written down rather than inferred. Contention and reachability are different threat models, and the lease only ever addressed the first.

How To Apply

Decision Dimensions

Contention decision rule (BI-94A765BD)

When two producers want the same scarce thing, pick the exclusivity mechanism from the scarcity class — do not invent a parallel gate:

  1. Compute scarcity (GPU, model slot, sandbox executor, shared :3001) → admission gate: Inngest concurrency key / atomic MCP lease keyed to the physical resource, acquired by every producer before work starts.
  2. Record/slot exclusivity (booking row, unique hold, single active phase owner) → atomic Postgres constraint (unique partial index / exclusion) so the database decides the winner under concurrency.
  3. Cooperative human coordination only (rare double is tolerable; force is meaningful) → advisory check-then-act UI is acceptable; still prefer a soft unique or optimistic version when cheap.

Never reintroduce check-then-act for compute or record exclusivity. Broaden every new feature against this rule before adding a second mutex.

Origin

Unified Delivery Surfaces spec, 2026-06-05 (WWMD-ratified, Q5 — kernel high confidence, margin 0.63). Fold-:3001 tracked in spec §6 keystone (f); compose isolation BI-63C11CF7.