Delivery surfaces runbook

Status: procedure and history reference. The surface-agnostic contract lives in AGENTS.md §17 and stays always-on. This file holds the guard implementations, the BI trail, and the full §7 decision text. Single source of truth for the decisions themselves remains the unified-delivery-surfaces spec. Relocated from §17 by BI-0020D511 Phase 1; no rule was dropped.

→ Spec (single source of truth): docs/superpowers/specs/2026-06-05-unified-delivery-surfaces-execution-alignment-design.md. This section is the operational pointer; the §7 decisions are WWMD-ratified and final.

§7 decisions — hard rules (WWMD-ratified 2026-06-05):

Task-specific operating rules

Taking over another executor’s work

An executor often reaches its capacity limit before its PR merges, and the operator asks another assistant to finish. The operator usually names only PR numbers. Design: executor takeover (BI-E2871BDE).

  1. Find each room from the PR.
    • Call list_workrooms with pullRequestNumber or headBranch. For your person, this matches rooms another assistant created too.
    • Rooms you have not joined come back with admission: "handover-required" and the exact reassign_workroom_executor call.
    • Do not probe adopt_worktree for branch_occupied.
  2. Read the previous executor’s checkpoint before taking anything over. The workroom_assistant_not_admitted result shows:
    • the latest heartbeat checkpoint: next action, the checks being addressed, uncommitted paths, head SHA and whether it was pushed, open risks;
    • the bound PR and leaseExpiresAt.

    A checkpoint is the previous executor’s claim, not evidence. Check it against git and CI.

  3. Take over the whole set with one approval.
    • Call reassign_workroom_executor with capsuleIds as a dry run.
    • Then apply with the returned planDigest. The person approves once for exactly that set.
    • A room whose lease holder changed in between is skipped and reported, never overwritten.
  4. Reconcile the worktree before editing. Account for every uncommitted path against the checkpoint. Commit, discard or ask; never let a stray file ride along.
  5. Merge current main and re-run the exact-head gate. Merging moves HEAD, so earlier gate evidence no longer applies. Update the PR body’s Local-CI-Evidence: and add a short handover note.
  6. Close out through the merge. A merged room is archived, not completed. Its stage tasks stop with it (BI-1DDCE164).

While you work, send a checkpoint with heartbeat_workroom at each stage boundary, so the next executor can start from step 2.

Same owner, same scope: no approval (BI-F1FC0B62, BI-1986D3C1, BI-53BED66C). Use reassign_workroom_executor with phase: "request", then the receiving session acknowledges with phase: "acknowledge". Between the two steps either party can raise issues on the room. Neither step reaches the owner when all of these hold:

A step the handler refuses comes back as a refusal with its next action, never as an approval. Approving it could not make it run. A lease held by another person, a live coworker lease, an unadmitted receiver, or a build-linked, restricted or archived room keeps the owner’s decision, through the one-call path.

When your plan runs out. Before you stop on a usage limit, send heartbeat_workroom with checkpoint.capacity (provider and the resetAt it gave). The room then reads “expected back by …” in Central time. It is not reaped before that time, and it lists the executors that can take it now. The platform also reads the provider’s own capacity record, so this works if you could not send it. A stated reset is an upper bound: providers reset early, periodically and at random. Any later heartbeat clears the wait. To move the work, use the same two-step handover; it needs no approval.

Running in T3 Code

T3 Code orchestrates a native client (Codex or Claude) in its own thread. Trial record: T3 runtime trial. Design: T3 as a first-class executor.

  1. Claim first, never adopt first. Call claim_backlog_item_for_work with:
    • provider set to the client T3 drives (codex or claude);
    • harness: "t3-code";
    • sessionRef set to the client thread id: CODEX_THREAD_ID for Codex, CLAUDE_CODE_SESSION_ID for Claude;
    • harnessRef: { threadId } set to T3’s own thread id, which T3 exports as T3CODE_THREAD_ID. Add projectId, environmentId and providerInstanceId when you know them (BI-75AB446B).

    The room then shows which T3 thread works in it, and list_workrooms with harnessThreadId finds the room from the thread. The reference describes; sessionRef is still the id the gate records.

    provider: "t3" is refused with provider_harness_only.

  2. Create the worktree under the canonical sibling base, not T3’s default ~/.t3/worktrees.
  3. Gate in the same thread with pnpm gate:wait. The gate records the same thread id. If it cannot, the platform still binds a passing result to your own single live room on that branch at exactly the gated commit.
  4. Land with pnpm land. If the client may not run gh pr merge (an unattended Codex refuses it under the owner’s rules), call queue_workroom_pull_request with the room’s capsuleId through the dpf connector. It queues only when the PR head is the room head and the gate passed there, and the merge queue still runs every required check.
  5. If the plan runs out mid-task, record checkpoint.capacity as above. Hand the room to the Claude (or Codex) side with the two-step handover. T3 can drive either client from the same project.

Contributor preview binding and cleanup

Preview startup resolves the canonical install settings and overlays, then binds /workspace to the clean admitted worktree. The controller generates development password/signing material in memory, validates Compose config before runtime mutation, and uses explicit preview services with --no-deps. Initialization must succeed before dev-portal starts. Docker mount/commit labels and the served health identity must agree. No hand-built live image is an acceptable substitute.

The canonical image must contain the bounded-clone and initialization-diagnostic entry files before runtime mutation. Initialization keeps the same install, client-generation, migration and sanitization commands. Its controller retains only bounded, validated step/state/category/exit records in the existing log as they arrive, so container removal cannot erase the failed step. Command arguments, environment values and raw child stdout/stderr are never diagnostic output. Missing or invalid records establish no inner cause. Failure still prevents portal startup and invokes owned cleanup. Even exit zero requires complete, ordered success records for all four steps. Use a qualified delivered helper for both the initial claim and durable child; a frozen feature checkout or stale install-root checkout is not assumed updated. A fresh diagnostic attempt requires the reviewed remedy’s canonical containment and ordinary lease admission.

The keeper handles failed child launches before reading optional process streams, reports controlled error categories, and attempts owned container cleanup even when child termination is unverified. Failed cleanup remains unverified. Client loss also has an independent native safety net: the existing five-minute lease-wait reconciliation, capacity events and hourly expiry owner fence only proven ended previews, behind their normal quiescence gate. They reuse the durable Task owner pins, admitted source Workroom, actual development environment, mount and full container ID. Unknown bindings and live data services are held. Renewal shares the admission/release/expiry environment lock; a stale read cannot revive a committed terminal reservation. Gate claims are excluded because their separate settlement contract can revive them.

The native fence uses a fixed bounded Docker socket stop, never a subprocess or stored cleanup command. A timeout is followed by exact-ID readback; stopped or absent state must be confirmed. Pending cleanup is retained as pending for normal reconciliation. Expiry alone is never proof of process termination, and periodic reconciliation does not promise an instantaneous stop. Each pass checks at most four unique container IDs. Sorted IDs rotate through bounded windows using the existing five-minute cadence, so held containers do not permanently hide later candidates in a stable inventory. Capacity events reuse the current window. A changing inventory supplies no fixed cleanup deadline.

A queued claim stops its shell caller: the returned durable TaskRun resumes the wait. A terminal claim stops too; never scan historical :rerun-N keys. A new explicitly wanted attempt may supply a new DPF_DEV_PORTAL_CLAIM_KEY. Durable resume supplies its original lease and task through DPF_DEV_PORTAL_RESUME_LEASE_ID and DPF_DEV_PORTAL_TASK_RUN_ID. The caller sends the existing relative lease timing contract: the resource TTL uses the heartbeat lifetime (two minutes by default, at most twenty), while --expires-minutes bounds admission waiting to at most two hours. Durable resume preserves the original DPF_DEV_PORTAL_WAIT_DEADLINE; it neither substitutes the short returned lease expiry nor extends the admission deadline on each resume.

WWMD DI-E1203C00715D supports ordinary cleanup for a verified owner and exact session. The current routineLeaseRelease predicate uses the canonical durable Task provenance to release a proven own process-free reservation; already-ended or lapsed reservations are also routine (BI-1986D3C1, BI-88D51B8F). Unproven or foreign live reservations retain authority approval. Use the returned native classification, surface the exact lease/session/action and any approval link, and never suppress a justified request or infer ownership from a session string. The existing obsolete-release reconciliation settles only proven obsolete requests; Concierge envelope expiry settles lapsed proposed/approved requests through the state machine. Neither silently approves or replays them. Restricted connections never receive grants from the client.

Native preview fencing consumes the database-owned admission-history witness without ordering it against application admission, terminal or observer clocks. A finite first witness and history version1 prove admission; the committed, irreversible terminal state and exact owner/source/full-ID recheck authorize cleanup. Only retain timestamp ordering guaranteed by the writer: expiry selects its deadline against a supplied now and records that same now as releasedAt. Clock offsets or rollback never substitute for a terminal decision, and unknown history, gate reservations and mismatched owners/containers remain held.

Preview browser authentication uses issue_ux_verification_sign_in with the admitted preview lease and active verification Workroom session. The source Workroom may remain paused under its original session: WWMD DI-FBEC4720D1DA requires the same authenticated principal and repository for both rooms, an active verifier lease, and the source room’s exact recorded SHA. The platform checks those identities again before returning the session and issues in the preview database with its own signing key. The sweep consumes that one-time link and saves its own browser storage state. Production cookies and operator passwords are not preview inputs.

Next development declarations use one controller-owned file bind at /workspace/apps/web/next-env.d.ts, outside the admitted worktree. Config and actual mount inspection verify that file; full source cleanliness remains mandatory, including after initialization. Seed bytes are read through one regular file descriptor whose identity and metadata match the source pathname before and after reading. The read-only descriptor is opened before pathname checks; its first stat anchors the identity, and the pathname must match it before any bytes are read. Replacement or concurrent writes refuse before backing storage is created, and the descriptor closes before that creation. The keeper removes verified owned writers before deleting backing storage. Foreign file references, writable ancestor binds or uncertain cleanup retain storage and fail closed. Existing readonly directory mounts of canonical state remain untouched.

For shared-header changes, record the complete touched-route inventory first. Use desktop (1280×900), mobile (390×844), normal and Simple (worker) navigation, light/dark themes and representative persona/account states. The local 40-route feedback cap is not coverage: --exhaustive --fixture-map <file> selects all touched static and dynamic routes. A fixture map must name the admitted source SHA, lease, base URL and every dynamic concrete route. Missing fixture paths, redirects, failed routes or incomplete accounting block the sweep.