Mercury's New Architecture - FDD and Divine Naming
After observing our development flow and documentation challenges, we're implementing key architectural improvements to make Mercury's development more maintainable and clear. This post documents these decisions for future reference.
Module Naming: The Divine Approach
We've chosen to use god names for our modules instead of functional names. This decision might seem unconventional, but it offers several significant advantages:
Why Divine Names?
-
Unique Namespacing
- No collisions with technical terms
- Clear, distinct module boundaries
- Memorable and unambiguous references
-
AI Interaction
- Creates unique contexts for AI understanding
- Avoids confusion with general programming terms
- Provides rich metaphorical framework for capabilities
-
Communication Clarity
- "Fix in Apollo" vs "Fix in portfolio-analysis" (more specific)
- "Minerva's API" vs "technical-analysis API" (clearer scope)
- "THOTH integration" vs "knowledge-base integration" (unique identifier)
Current Divine Mapping
- APOLLO: Portfolio Analysis System
- MINERVA: Advanced Technical Analysis
- THOTH: Knowledge Retrieval and Augmentation
- ZEPHYR: Foundational Technical Analysis
- MORPHEUS: Shadow Portfolio System
- ATLAS: System Orchestration
- MAAT: Validation System
- KAIROS: Strategy Execution
- HERMES: News and Information
- DIKE: Tournament System
- CASSANDRA: Counter-algorithmic Strategies
- TYCHE: Sweet Spot Detection
Improved FDD Organization
We're moving from a centralized FDD to a module-level approach while maintaining visibility through Docusaurus.
Key Changes
-
One FDD Per Module
mercury/
├── apollo/
│ └── apollo.fdd.md
├── minerva/
│ └── minerva.fdd.md
├── thoth/
│ └── thoth.fdd.md -
Docusaurus Integration
- Custom plugin to collect
.fdd.mdfiles - Automatic documentation generation
- Maintained searchability and cross-referencing
- Custom plugin to collect
-
Documentation Structure
- Module root contains single FDD file
- High-level architecture in main docs
- Clear ownership and update responsibility
FDD File Convention
Each *.fdd.md should contain:
# DEITY_NAME: System Purpose
## Overview
Brief description of the module's role in Mercury
## Divine Powers (Capabilities)
- Core functionalities
- Key features
- Integration points
## Sacred Artifacts (Key Components)
- Important classes/modules
- Critical algorithms
- Essential data structures
## Divine Interactions (Dependencies)
- Required modules
- External services
- Key integrations
## Prophecies (Roadmap)
- Planned features
- Known limitations
- Future improvements
Migration Plan
-
Phase 1: Documentation
- Create template for module FDDs
- Migrate existing documentation
- Update Docusaurus configuration
-
Phase 2: Module Organization
- Rename modules to divine names
- Update import paths
- Adjust CI/CD pipelines
-
Phase 3: Integration
- Implement Docusaurus plugin
- Set up documentation automation
- Update build processes
Benefits of New Structure
-
Documentation and Code Proximity
- FDD lives with its module
- Natural updates during development
- Clear ownership
-
Improved Maintainability
- Reduced risk of outdated docs
- Easier to keep in sync
- Part of normal code review
-
Better Visibility
- Integrated in Docusaurus
- Searchable and connected
- Clear module boundaries
-
Enhanced Communication
- Unique, unambiguous module names
- Rich metaphorical framework
- Clear responsibility boundaries
Implementation Notes
-
Docusaurus Plugin
// Example configuration
const fddPlugin = {
name: 'fdd-plugin',
getPathsToWatch() {
return ['../**/*.fdd.md'];
},
async loadContent() {
// Collect FDD files
},
async contentLoaded({ content, actions }) {
// Generate documentation
},
}; -
Module Headers
/**
* APOLLO: Portfolio Analysis System
* Divine analyst of trading performance and metrics
*/
Conclusion
This new approach combines the benefits of distributed documentation with centralized visibility, while using a unique and powerful naming convention that aids both human and AI understanding. The divine naming scheme provides clear boundaries and rich context, while the module-level FDDs ensure documentation stays current and relevant.
May your code be blessed by the divine order of Mercury.
