Entry Points
The main entry points for Shannon’s Temporal-based orchestration:Temporal Workflow System
src/temporal/workflows.ts- Main workflow definition (pentestPipelineWorkflow)src/temporal/activities.ts- Thin activity wrappers with heartbeat and error classificationsrc/temporal/worker.ts- Worker entry point that registers activities and workflowssrc/temporal/client.ts- CLI client for starting and managing workflows
CLI Interface
shannon- Main CLI script at repository rootdocker-compose.yml- Docker orchestration for Temporal and worker containers
Core Logic
Business logic modules (Temporal-agnostic, testable):Agent Management
src/session-manager.ts- Agent definitions (AGENTSregistry), phase mappings, MCP agent assignments, and validatorssrc/services/agent-execution.ts- Complete agent lifecycle: config loading, prompt execution, git checkpoints, validation, and audit logging
AI Integration
src/ai/claude-executor.ts- Claude Agent SDK integration with retry logic and spending cap detection
Configuration
src/config-parser.ts- YAML configuration parsing with JSON Schema validationconfig-schema.json- JSON Schema for configuration validation
Services Layer
All services insrc/services/ are Temporal-agnostic and return Result<T,E> types:
src/services/error-handling.ts- Error classification, retry logic, andPentestErrorclasssrc/services/container.ts- Dependency injection container (per-workflow scope)src/services/queue-validation.ts- Validates vulnerability queues before exploitationsrc/services/config-loader.ts- Configuration loading servicesrc/services/prompt-manager.ts- Prompt template loading with variable substitutionsrc/services/git-manager.ts- Git checkpoint and rollback operations
Type Definitions
Consolidated TypeScript types insrc/types/:
src/types/index.ts- Barrel export for all typessrc/types/agents.ts-AgentName,AgentDefinition,AgentValidator,VulnTypesrc/types/errors.ts-ErrorCodeenum,PentestErrorType, error contextssrc/types/result.ts-Result<T,E>discriminated union for explicit error handlingsrc/types/metrics.ts-AgentMetricsinterface for cost and timing datasrc/types/audit.ts-SessionMetadata,AgentEndResultsrc/types/config.ts- Configuration type definitionssrc/types/activity-logger.ts-ActivityLoggerinterface for structured logging
Audit System
Crash-safe append-only logging inaudit-logs/{hostname}_{sessionId}/:
src/audit/index.ts-AuditSessionmain class for agent loggingsrc/audit/metrics-tracker.ts-MetricsTrackerfor session.json managementsrc/audit/workflow-logger.ts-WorkflowLoggerfor unified human-readable logssrc/audit/log-stream.ts-LogStreamshared stream primitivesrc/audit/utils.ts- Path generation and utility functions
Temporal Support
Temporal-specific modules:src/temporal/shared.ts- Types, interfaces, and query definitions for workflowssrc/temporal/activity-logger.ts-TemporalActivityLoggerimplementation ofActivityLoggersrc/temporal/summary-mapper.ts- MapsPipelineSummarytoWorkflowSummarysrc/temporal/workspaces.ts- Workspace listing and management
Configuration Files
Prompts
Prompt templates inprompts/ with variable substitution ({{TARGET_URL}}, {{CONFIG_CONTEXT}}):
prompts/pre-recon-code.txt- Code analysis promptprompts/recon.txt- Attack surface mapping promptprompts/vuln-*.txt- Vulnerability analysis prompts (injection, xss, auth, authz, ssrf)prompts/exploit-*.txt- Exploitation promptsprompts/report-executive.txt- Executive report generation promptprompts/shared/- Shared prompt partials (login instructions, etc.)
YAML Configs
Application configurations inconfigs/:
- Target URL and authentication settings
- MFA/TOTP configuration
- Per-application testing parameters
Utilities
Shared utility functions insrc/utils/:
src/utils/file-io.ts- File system operations (atomic writes, JSON reading)src/utils/formatting.ts- Timestamp and percentage formattingsrc/utils/concurrency.ts- Parallel execution helperssrc/utils/billing-detection.ts- Spending cap and billing error detection
Output Locations
Audit Logs
Default location:./audit-logs/{hostname}_{sessionId}/
session.json- Session metadata and metricsworkflow.log- Human-readable workflow log{agent-name}/- Per-agent directories with prompts and logs
Deliverables
Saved todeliverables/ in the target repository via the save_deliverable MCP tool.
Directory Structure
Key Design Patterns
Services Boundary
Activities are thin Temporal wrappers;src/services/ owns business logic:
- Accept
ActivityLoggerinterface - Return
Result<T,E>types - No Temporal imports in services
- Testable without Temporal infrastructure
Configuration-Driven
- YAML configs with JSON Schema validation
- Prompt templates with variable substitution
- Registry-based agent definitions
Progressive Analysis
Each phase builds on previous results:- Pre-recon creates
code_analysis_deliverable.md - Recon creates
recon_deliverable.md - Vulnerability agents create
{type}_analysis_deliverable.mdand{type}_queue.json - Exploitation agents consume queues and create
{type}_exploitation_evidence.md - Report agent synthesizes all deliverables
Related Documentation
- Agent Registry - Complete AGENTS registry reference
- Error Handling - Error codes and classification
- Metrics Tracking - Session metrics and cost tracking
