ADR-001: Plugin Architecture

Status: Accepted (revised 2026-05-18) Date: 2026-01-04 Deciders: Brandon

Decision

Every plugin implements similar interfaces for equivalent work and follows the same lifecycle. The plugin maintainer decides how much of the provided contract they want to implement.

Plugin Boundary

Plugin Model

All plugins are standalone binaries loaded at runtime via gRPC (Plugin gRPC API):

From the Registry's perspective, all plugins are identical:

registry.Register(externalProxy)

Plugin characteristics:

Interface Contract

The base interface every plugin implements:

type DomainPlugin interface {
    Metadata() Metadata                                              // Plugin info, version
    Initialize(ctx context.Context, services ServiceRegistry) error  // Lifecycle
    Shutdown(ctx context.Context) error
    RegisterHTTP(mux *http.ServeMux) error                          // HTTP API
    RegisterWebSocket() (map[string]WebSocketHandler, error)        // Real-time features
    Health(ctx context.Context) HealthStatus                         // Monitoring
}

Optional interfaces extend the base — a plugin opts in by implementing them:

Security Model

Failure Handling

Versioning

HTTP Routing

"any plugin to be its own signum without the plugin having to define it"

"the plugin should just be able to declare routes"

Consequences

Positive

Negative

Neutral

Implementation History

Alternatives Considered

Monolithic with Feature Flags

Microservices per Domain

Lua/WebAssembly Scripting

Related