# `PhoenixKitCatalogue.Catalogue.AttributeSets.OrphanPruner`
[🔗](https://github.com/BeamLabEU/phoenix_kit_catalogue/blob/v0.19.1/lib/phoenix_kit_catalogue/catalogue/attribute_sets/orphan_pruner.ex#L1)

Subscribes to entities blueprint lifecycle events and prunes item
attachments whose set blueprint was deleted out from under them —
the "suspenders" to the delete guard's "belt" (the guard refuses
deleting attached sets; this cleans up after deletes that bypassed
it, e.g. repo-level operations or a host that never registered the
guard). The design doc always claimed this subscriber; the 2026-08-18
panel review noticed it was never actually wired.

Deliberately NOT a boot-time sweep: pruning consults `get_set/1`,
and sweeping while entities is disabled or mid-migration would read
every set as missing. `prune_orphan_attachments/1` guards on
enablement for the same reason. The trade-off: a blueprint deleted
while the catalogue app was DOWN is never pruned automatically —
the residue is invisible rows (`resolve_for_items/2` skips
unresolvable sets), recoverable by calling
`AttributeSets.prune_orphan_attachments/1` with the deleted uuid.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `start_link`

```elixir
@spec start_link(keyword()) :: GenServer.on_start()
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
