ADR-001: Plugin Architecture

Status: Accepted (revised 2026-05-18) Date: 2026-01-04 Deciders: QNTX Core Team

Context

QNTX initially had software development functionality (git ingestion, GitHub integration, gopls language server, code editor) tightly coupled to the core. This created challenges:

  1. Scope Creep: Core repository accumulated domain-specific code (code, biotech, finance, etc.)
  2. Coupling: Domain logic mixed with core attestation/graph infrastructure
  3. Maintenance: Changes to one domain risked breaking others
  4. Third-Party Extensions: No mechanism for private/external domain implementations

Decision

We adopt a plugin architecture where all non-core functionality is implemented as plugins. Every plugin implements the same interface and follows the same lifecycle. A plugin decides how much it implements — it can provide HTTP endpoints, WebSocket handlers, gRPC services, custom glyph types, or any combination. Improvements to QNTX core services benefit all plugins automatically.

Minimal Core Philosophy

QNTX core is minimal and runs without any plugins:

This ensures QNTX core remains focused on infrastructure, not domain logic.

Plugin Boundary

Plugin Model

All plugins are external — 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

Consequences

Positive

Negative

Neutral

Implementation History

Alternatives Considered

Monolithic with Feature Flags

Microservices per Domain

Lua/WebAssembly Scripting

Related