---
id: w1/m17/t006
title: Simplify — `/simplify` over what this milestone changed
worker: worker1
status: done
estimate: 20m
depends_on: [w1/m17/t005]
---

## Objective

The standing simplification pass: run `/simplify` over everything this milestone changed (recovery/lifecycle/access Core verbs + adapters, the database controller projections, and the dashboard sections) to remove duplication, tighten the code to the "one core, thin adapters" shape, and cut anything gold-plated — quality only, not bug-hunting.

## Context

- `/simplify` reviews the changed diff for reuse / simplification / efficiency / altitude cleanups and applies fixes (it does not hunt for correctness bugs — that's `/code-review`).
- Surface areas touched: `lego/backend/internal/postgres/`, `lego/operator/internal/controller/database_controller.go`, `lego/types/v1alpha1/database_types.go`, `dashboard/src/features/databases/`.
- Watch for adapter drift creeping back in: each verb should have exactly one Core implementation with thin rest/graphql/mcp fragments (`docs/ADR006-bex-api.md`).

## Steps

1. Run `/simplify` scoped to this milestone's diff.
2. Apply the cleanups; keep the three adapters thin and the controller projections DRY (reuse the backup/pooler/allowlist helpers rather than duplicating).
3. Re-run `make test` (backend) + dashboard tests to confirm the simplification is behavior-preserving.

## Files

- `lego/backend/internal/postgres/`
- `lego/operator/internal/controller/database_controller.go`
- `lego/types/v1alpha1/database_types.go`
- `dashboard/src/features/databases/`

## Acceptance criteria

- [ ] `/simplify` findings applied; no duplicated verb logic across adapters; controller projections share helpers.
- [ ] `make test` + dashboard tests still green after the pass.

## Out of scope

- Correctness bug-hunting (that's `/code-review`, not this task).
- New behavior or features.
