Skip to content

Core Architectural Patterns

This document provides an overview of the core architectural patterns that make up the NERV architecture. These patterns build upon the foundational design primitives to create powerful, composable building blocks for Atlas’s core services.

Pattern Overview

NERV defines six core architectural patterns that together create a flexible, introspectable, and composable system:

PatternPurposeKey ImplementationLibrary Foundation
Reactive Event MeshDecoupled communicationEventBusBlinker
Temporal VersioningComplete history trackingTemporalStoreEventsourcing
Perspective ShiftingContext-appropriate viewsPerspectiveAwareMarshmallow
State ProjectionEfficient state evolutionStateProjectorPyrsistent
Effect SystemExplicit side effectsEffectMonadEffect
Quantum PartitioningOptimal parallelismQuantumPartitionerTaskMap

Library Implementation

Each pattern is implemented using specific Python libraries that provide proven, robust foundations:

PatternPrimary LibraryKey FeaturesUsage in NERV
Reactive Event MeshBlinkerSignal dispatch system, lightweight, thread-safeEvent distribution and subscription
Temporal VersioningEventsourcingEvent-based persistence, temporal storageHistorical state management
Perspective ShiftingMarshmallowSchema-based validation and transformationPerspective-based data conversion
State ProjectionPyrsistentImmutable data structures, structural sharingEfficient state evolution
Effect SystemEffectMonadic effect tracking, functional compositionExplicit side effect management
Quantum PartitioningTaskMapDependency-based execution, parallel processingOptimized concurrent execution

Core Type Foundations

These patterns build upon foundational types and interfaces:

  • Types: Core type definitions and data classes
  • Interfaces: Foundational protocol definitions
  • Boundaries: System boundary concepts

Pattern Relationships

The core patterns interact in meaningful ways:

Key Benefits

These architectural patterns provide several key benefits:

PatternKey Benefits
Reactive Event MeshDecoupling, Observability, Extensibility
Temporal VersioningUndo/Redo, Debugging, Reproducibility
Perspective ShiftingAdaptability, Separation of Concerns, Multiple Views
State ProjectionEfficiency, Consistency, Traceability
Effect SystemExplicit Side Effects, Composability, Testability
Quantum PartitioningParallelism, Resource Optimization, Dependency Management

Primitive Foundations

Each pattern is built on specific primitive design patterns:

NERV PatternPrimitive CompositionImplementation Library
Reactive Event MeshObserver + Command + FactoryBlinker
Temporal VersioningCommand + Decorator + FactoryEventsourcing
Perspective ShiftingStrategy + Decorator + FactoryMarshmallow
State ProjectionCommand + Strategy + BuilderPyrsistent
Effect SystemCommand + Monad + DecoratorEffect
Quantum PartitioningBuilder + DAG + FactoryTaskMap

Components and Implementation

Each pattern has a corresponding component implementation:

These components are then combined into composite systems to create complete architectural solutions.

Integration Architecture

The integration between patterns and their library implementations creates a cohesive architecture:

Learn More

Explore each pattern in detail:

Or explore the foundation types:

Released under the MIT License.