---
id: w6/m4/t008
title: "Simplify: workspace-datastore labeling + purger changes"
worker: worker6
status: done
estimate: 25m
depends_on: [w6/m4/t007]
---

## Objective

Run `/simplify` over the code this milestone changed — reuse, simplification, and efficiency cleanups, behavior-preserving only.

## Context

- Touches `lego/backend/internal/postgres/`, `lego/backend/internal/keyvalue/`, `lego/backend/internal/secrets/`, `lego/backend/internal/workspaces/`, `lego/backend/cmd/api/main.go`.
- Watch specifically for duplicated purger boilerplate across `postgres`/`keyvalue` (t004) that could share a small helper without breaking the one-service-per-feature layering rule.

## Steps

1. Run `/simplify` scoped to the files this milestone touched.
2. Apply surfaced fixes.
3. Re-run `go build ./...` and `go test ./...` in `lego/backend/` to confirm no behavior change.

## Files

- All files touched by t001-t007.

## Acceptance criteria

- [ ] `/simplify` run and findings applied or explicitly dismissed with reason
- [ ] No behavior change (tests still pass)

## Out of scope

- New functionality.
