Prior Art¶
Plushy is assembled from ideas proven elsewhere. This page credits them, and says what was taken and what was left.
Pluggy¶
Pluggy is the hook engine of pytest, tox and devpi. Hookspecs, hookimpls, result modes, wrappers, ordering and signature validation are Pluggy's: Plushy calls Pluggy to do them. Pluggy leaves discovery, instantiation, lifecycle and configuration to its users, and is synchronous. Plushy supplies those.
Plux¶
LocalStack's plugin loader. Plushy takes its plugin model: a PluginSpec of namespace, name and factory; a Plugin with should_load() and load(); the stages resolve, instantiate, load; lifecycle listeners; failures isolated per plugin. Plux's signature feature, generating entry points from the code at build time, works only as a setuptools build hook; Plushy keeps discovery independent of the build backend instead, with an optional index generated by an explicit command.
Trac¶
Trac's component architecture made host-controlled enablement a first-class concern: plugins are installed, but configuration decides which are active. Plushy keeps that idea, as an EnablementPolicy, and leaves Trac's service locator and its coupling to the host environment.
Cordis¶
Cordis, the framework behind the Koishi bot ecosystem, and its accompanying paper on dynamic composition, start from a question the systems above do not ask: when a component leaves, what undoes what it did? Every change a Cordis component makes comes with its inverse, run in reverse order on removal. Components declare their dependencies, so that dependents stop before what they depend on. Plushy borrows the two properties that hold for one plugin against its manager (cleanup paired with setup, and declared requirements with dependents unloaded first) without Cordis's context tree or its reactive re-resolution.
Dishka¶
Dishka is not used yet. It is the dependency-injection container Plushy's single instantiation point is shaped for, so that scoped instances (per request, per tenant) can be added later without changing plugin code.