# controlplane9

Kill the shared dev cluster. Ship faster.

## The Problem

TiDB Cloud's dev environment is a fleet of always-on EKS clusters — 112+ nodes, 6 cluster types, 73 services running 24/7 for a team that uses a fraction of them at any given moment. Most compute is idle. What isn't idle is causing trouble: shared state breeds flakiness, cross-team deployments step on each other, and every feature that needs E2E validation joins a queue.

Features that should take days take weeks. Agents can now write the code — but they can't ship it, because shipping still requires a human to deploy to a shared environment and wait.

That stops here.

## How It Works

```
Session AWS EC2 Host
├── k3d cluster
│   ├── source build     — services built from synchronized developer source
│   ├── staging-aligned  — reviewed product images pinned by the persona
│   └── stub             — generated or recording stubs for off-path deps
└── AWS resources (per-developer, tagged, reaped on destroy)
```

For features that cross the cloud boundary — crossplane, cluster lifecycle, real TiDB dataplanes — cp9 runs the **production code path** against a dev account, not a simulation. Real cloud resources are created, tagged with your identity, and destroyed when you're done. No fake infrastructure; no false confidence.

`cp9 destroy` is a two-stage guarantee: local cleanup first, then provable-scope
cloud cleanup for resources with your session tags or trusted-parent proof. It
exits non-zero if a provably session-owned resource survives.

## Docs

- User-facing wiki: https://github.com/tidbcloud/controlplane9/wiki
- Agent-facing skills: https://github.com/tidbcloud/controlplane9/blob/main/skills/get-started/SKILL.md
- Developer-facing tech details: https://github.com/tidbcloud/controlplane9/tree/main/docs

## Development

```bash
make build            # build binary to bin/cp9
make test             # fast unit tests
make test-race        # unit tests with race detection
make test-coverage    # unit tests with coverage profile
make test-integration # integration tests (k3d/AWS prereqs; skips with explicit reasons)
make test-functional  # explicitly selected final behavior functional tests
make lint             # golangci-lint
make fmt              # auto-format
```

All work starts from a [GitHub issue](https://github.com/tidbcloud/controlplane9/issues). Issues are self-contained with context, dependencies, and acceptance criteria — written to be picked up by an agent or a human without a kickoff meeting.
