# DEPS — mgf-alembic's bidirectional dependency manifest

> **§1** — what mgf-alembic depends on. **§2** — who depends on
> mgf-alembic. Knowing both directions makes deprecation,
> breaking-change blast-radius, and feature-prioritisation tractable.
>
> **Maintained by:** the mgf-common owner (Bassam — mgf-common owns the
> federation per the one-big-library mindset).
> **Per standard DOC-16** (v2.12): every project ships a `DEPS.md`.
> Replaces the former `USERS.md` (its roster is now §2 below).

Last verified: 2026-05-28.

---

## §1 What mgf-alembic depends on

mgf-alembic composes two federation siblings with the upstream
`alembic` engine to collapse env.py boilerplate into one call.

| Dependency        | Window         | Why                                                          | Tier |
|-------------------|----------------|--------------------------------------------------------------|------|
| `mgf-common`      | `>=0.40,<0.42` | typed-exception hierarchy / bootstrap                        | runtime (sibling) |
| `mgf-sqlalchemy`  | `>=0.1,<0.2`   | engine factory the env.py helper composes for offline introspection | runtime (sibling) |
| `alembic`         | `>=1.13`       | the migration engine itself                                  | runtime |
| `aiosqlite`       | `>=0.20`       | async sqlite driver for async-driver round-trip tests        | `[test]` (lazy) |

*Federation siblings depended on: `mgf-common` (typed exceptions /
bootstrap) and `mgf-sqlalchemy` (engine factory). Per AP-03's 0.x
discipline, sibling pins walk one minor at a time.*

---

## §2 Who depends on mgf-alembic

Consumer projects + federation siblings that import `mgf.alembic.*`.
(Inverse of each consumer's `MGF_ADOPTION.md`.)

### Consumer projects (external users)

| Project          | Location                                     | Import sites | Status                              | Surfaces used                          |
|------------------|----------------------------------------------|-------------:|-------------------------------------|----------------------------------------|
| **PlasmaMapper** | `/home/bassam/PycharmProjects/PlasmaMapper`  | 1            | Active — multi-tenant FastAPI SaaS  | `import_versioned_models` (single use) |

**Single-consumer reality.** mgf-alembic is currently a one-consumer
library. The v0.4.0 drift detector (`detect_drift(...)`) was shipped
ahead of broad adoption based on the shape PlasmaMapper would need; the
user count will grow when other federation consumers adopt Alembic.

### Federation siblings (`mgf-*` libraries)

No siblings depend on mgf-alembic today. mgf-fastapi remains
Alembic-agnostic (consumers wire it up); mgf-django uses Django's own
migration system.

---

## §3 Maintenance

Updated every MINOR release + whenever a dependency or consumer
changes. Re-run the `mgf.alembic` import survey before each MINOR
release; update the §2 table when a count moves.

```sh
for proj in vm-vmanager-app inthewords PlasmaMapper figrecovery; do
  grep -rE "(from|import) +mgf\.alembic" "/home/bassam/PycharmProjects/$proj" \
    --include='*.py' | wc -l
done
```
