System Design Principles
Services Boundary Pattern
Shannon maintains a clear separation between orchestration and business logic:- Temporal Layer (
src/temporal/) - Workflow orchestration, activity wrappers, retry policies - Services Layer (
src/services/) - Pure domain logic, no Temporal dependencies - Activities Delegate to Services - Activities are thin wrappers that handle Temporal concerns
src/temporal/activities.ts:105-155
Dependency Injection Container
Services are wired through a DI container (src/services/container.ts) with explicit constructor injection:
src/services/container.ts:46-60
Container Scoping:
- One container per workflow ID
- Created on first agent execution
- Removed when workflow completes
- Services reused across all agents in a workflow
src/services/container.ts:28-35
Module Boundaries
Core Modules
Agent Registry
All agents are defined in a single source of truth (src/session-manager.ts:14-108):
src/session-manager.ts:14-108
Configuration System
Shannon uses YAML configuration with strict JSON Schema validation:Config Loading Pipeline
src/config-parser.ts:179-382
Configuration Distribution
Configs are transformed into a distributed format for agent consumption:Error Handling Strategy
Result Type Pattern
Services return explicitResult<T, E> types instead of throwing:
src/services/agent-execution.ts:93-98 and src/temporal/activities.ts:133-144
Error Classification
Errors are classified into retryable vs non-retryable:src/temporal/workflows.ts:49-64
Parallel Execution Strategy
The vulnerability and exploitation phases run 5 agents concurrently:src/temporal/workflows.ts:389-447
Key Design Points:
- No synchronization barrier between vuln and exploit phases
- Each pipeline (vuln→exploit) runs independently
- Exploits start immediately when their vuln completes
- Graceful degradation: failed pipelines don’t block others
Progressive Analysis Flow
Each phase builds on previous results through deliverable files:Related Documentation
- Core Modules - Detailed module documentation
- Temporal Workflow - Workflow implementation
- MCP Integration - MCP server architecture
- Audit System - Logging and metrics tracking
