# Online Deployment Framework

`deployments/online` is the repo-managed home for the production D3 runtime,
supporting host policy, and operator documentation.

## Current authority

- Prod workflow: `.github/workflows/deploy-multi-prod-d3-environment.yml`.
- Runtime operator: `scripts/run_serviceification_d3_prod.py`.
- Runtime helpers: `runtime/`.
- Operator procedure: `runbooks/prod.md`.

Prod rotates four physical runtime slots over one shared TiDB database:

```text
3103 -> 3104 -> 3105 -> 3106 -> 3103
```

Blue and green are dynamic current/target roles. The current release is
published through `multi_prod/d3/current` and `current.json`; a release being
prepared is fenced by `in-progress.json`. The target must become completely
ready before nginx cutover. After successful public target readback, closeout
stops and verifies the pending-authority-bound predecessor, re-proves the public
target, then publishes current authority and clears pending authority. A failed
retirement retains pending authority for the same exact-Tag retry. Stopped
containers and release files remain for separately authorized retention cleanup.

## Directory ownership

- `env/` holds sanitized environment contracts;
- `nginx/` holds public routing and frontend-serving rules;
- `runtime/` holds D3 Tag consumption, slot selection, runtime preparation,
  retention, and host guard helpers;
- `systemd/` holds supporting host guard templates;
- `runbooks/` holds D3 production procedures, incident response, and explicitly
  governed recovery operations.

Classic Candidate, phase-ledger, and multi-prod deployment code under
`deploy/online` is retired. Any files still present there are quarantined
migration or maintenance dependencies and do not create another release lane.
