Vitruvyan Docs
Sacred Orders Refactoring Plan - Updated Feb 12, 2026
π― Status Attuale
β Synaptic Conclave (Cognitive Bus)
Status: β OPERATIVO - Refactoring completato FASE 1-5
- Architettura: 100% Redis Streams, zero Pub/Sub
- Documentazione: Blueprint completo (
STANDALONE_SERVICES_REFACTORING_PATTERN.md)
ποΈ Sacred Orders Refactoring Status
| Service | LIVELLO 1 | LIVELLO 2 | Conformance | Notes |
|---|---|---|---|---|
| Memory Orders | β 10/10 dirs | β 93 lines | 100% | Template reference |
| Vault Keepers | β 10/10 dirs | β 59 lines | 100% | Template reference |
| Orthodoxy Wardens | β 10/10 dirs | β 87 lines | 95% | Template reference |
| Babel Gardens | β 10/10 dirs | β 87 lines | 100% | β Complete |
| Codex Hunters | β 10/10 dirs | β 75 lines | 100% | β Complete |
| Pattern Weavers | β 10/10 dirs | β 62 lines | 100% | β Complete |
π MILESTONE: 6/6 Sacred Orders at 100% SACRED_ORDER_PATTERN conformance (Feb 12, 2026)
π Documentazione di Riferimento
Blueprint Principale
File: STANDALONE_SERVICES_REFACTORING_PATTERN.md (771 lines)
Sections:
- ποΈ The Cognitive Bus Pattern (reference implementation)
- π The Refactoring Pattern (7 Phases)
- π Service-Specific Guidelines (Neural Engine, LangGraph, Codex, Leo)
- π¨ Common Pitfalls & Solutions
- β Refactoring Checklist (comprehensive)
Supporting Documentation
-
ARCHITECTURAL_REFACTORING_FEB6_2026.md (264 lines)
- Motivazione del refactor
- Cognitive Bus move:
core/cognitive_bus/βvitruvyan_core/core/cognitive_bus/ - Eliminazione
foundation/βagents/,llm/,cache/,governance/
-
COGNITIVE_BUS_REFACTORING_VALIDATION_PROMPT.md (416 lines)
- FASE 1: Listener Separation (6 listeners, 2,153 lines)
- FASE 2: Directory Organization (14 root files β 7 directories)
- FASE 3: Import Path Cleanup
- Validation checklist
-
TODO_API_CONCLAVE_REFACTORING.md
- api_conclave complete rewrite (692 β 229 lines, -67%)
- 100% Streams architecture
- E2E tests passed
ποΈ Pattern di Refactoring (7 Fasi)
FASE 1: Business Logic Separation
Goal: Separare domain logic da deployment code
Example (Cognitive Bus):
Benefit: Business logic testabile senza Docker
FASE 2: Directory Organization
Goal: Struttura flat β Logical grouping
Recommended Structure:
Benefit: Intuitive navigation, "Where is X?" β "Check <directory>/"
FASE 3: Import Path Cleanup
Goal: Fix obsolete imports after moves
Common Patterns:
Test:
FASE 4: Documentation Unification
Goal: Fragmented docs β 3 core guides + README
Required Files:
- README.md (300-400 lines): What, Quick start, Architecture, Links
- _GUIDE.md (800-1,200 lines): Setup, Concepts, API usage, Best practices
- API_REFERENCE.md (500-800 lines): Classes, functions, parameters, examples
- ARCHITECTURAL_DECISIONS.md (600-1,000 lines): Why X over Y, Trade-offs, Evolution
Benefit: 45-min onboarding (vs 4-6h before)
FASE 5: Testing & Validation
Test Checklist:
FASE 6: Git Commit
Message Template:
FASE 7: Listener Integration (Sacred Orders Specific)
Goal: Integrare Streams listener nel container
Actions:
- Verify
streams_listener.pyexists in service directory - Update Dockerfile to copy listener code
- Rebuild container
- Start listener
- Verify consumer groups in Redis
- Test event consumption
Example (Vault Keepers):
π― Priority Queue (Ordine di Refactoring)
P1 - IMMEDIATE (Next 2-3 days)
Services: Orthodoxy Wardens, Vault Keepers
Why: Core governance services, giΓ hanno streams_listener.py, solo manca integrazione container
Tasks:
- β Fix listener crash loop (copy code to containers)
- π FASE 1: Separate audit logic from deployment
- π FASE 2: Organize directories (core, models, api, monitoring, docs)
- π FASE 3: Clean imports
- π FASE 4: Create 4 core docs
- π FASE 5: Test + rebuild
- π FASE 6: Commit
- π FASE 7: Validate listener integration
Estimated Effort: 4-6h per service (8-12h total)
P2 - HIGH (Next 3-5 days)
Services: Babel Gardens, Codex Hunters
Why: Core services, hanno streams_listener.py, alta importanza architetturale
Tasks: Same as P1
Estimated Effort: 4-6h per service (8-12h total)
P3 - MEDIUM (Next 7-10 days)
Services: Memory Orders
Why: Critical for memory coherence, ma piΓΉ stabile quindi meno urgente
Tasks: Full FASE 1-6 (no listener, focus on API structure)
Estimated Effort: 6-8h
P4 - LOWER (Next 10-14 days)
Services: Pattern Weavers
Why: Semantic contextualization, meno critico per operational stability
Tasks: Full FASE 1-6
Estimated Effort: 6-8h
π Per-Service Refactoring Checklist
Orthodoxy Wardens (P1)
Vault Keepers (P1)
Babel Gardens (P2)
Codex Hunters (P2)
π¨ Common Pitfalls (Sacred Orders Specific)
Pitfall 1: PostgresAgent/QdrantAgent Dependency
Issue: Services need PostgresAgent/QdrantAgent but they live in vitruvyan_core/core/agents/
Solution:
- Import from core:
from vitruvyan_core.core.agents import PostgresAgent - Docker PYTHONPATH:
/app/vitruvyan_corein PYTHONPATH - Test:
python3 -c "from vitruvyan_core.core.agents import PostgresAgent"
Pitfall 2: Listener Crash Loop
Issue: streams_listener.py not copied to container during build
Solution:
- Update Dockerfile:
COPY services/<domain>/api_<service> /app/api_<service> - Verify:
docker exec <container> ls -la /app/api_<service>/streams_listener.py
Pitfall 3: Redis Connection Errors
Issue: Listener can't connect to Redis (wrong host) Solution:
- Environment:
REDIS_HOST=omni_redis(NOT localhost) - Network:
networks: [omni-net]in docker-compose.yml - Test:
docker exec <listener> ping omni_redis
Pitfall 4: Consumer Group Conflicts
Issue: Multiple listeners try to create same consumer group Solution:
- Use unique group names:
group:orthodoxy_watcher(NOTgroup:watcher) - Check existing groups:
docker exec omni_redis redis-cli XINFO GROUPS "vitruvyan:stream:X"
Pitfall 5: Missing Sacred Orders Dependencies
Issue: Service needs StreamBus but Synaptic Conclave not imported Solution:
- Import:
from vitruvyan_core.core.synaptic_conclave.transport.streams import StreamBus - Docker volume: Mount
vitruvyan_core/in all containers - Test:
python3 -c "from vitruvyan_core.core.synaptic_conclave import StreamBus"
π― Success Metrics
Container Health
Consumer Groups
Event Flow
Documentation
π Timeline Estimate
| Phase | Services | Duration | Status |
|---|---|---|---|
| Week 1 | Orthodoxy Wardens, Vault Keepers (P1) | 8-12h | π In Progress |
| Week 2 | Babel Gardens, Codex Hunters (P2) | 8-12h | β³ Pending |
| Week 3 | Memory Orders (P3) | 6-8h | β³ Pending |
| Week 4 | Pattern Weavers (P4) | 6-8h | β³ Pending |
Total Effort: 28-40 hours over 4 weeks
β Next Actions (IMMEDIATE)
1. Fix Listener Crash Loop (30 min)
2. Start Orthodoxy Wardens Refactoring (4-6h)
3. Document Progress
π Learning Resources
Primary Blueprint: STANDALONE_SERVICES_REFACTORING_PATTERN.md (771 lines)
Reference Implementation: vitruvyan_core/core/synaptic_conclave/ (Cognitive Bus)
Cognitive Bus Docs: core/synaptic_conclave/docs/COGNITIVE_BUS_GUIDE.md (988 lines)
Industry Examples:
- FastAPI:
fastapi/structure (routing, dependencies, security) - Celery:
celery/structure (app, worker, backends, utils) - SQLAlchemy:
sqlalchemy/structure (engine, orm, sql, ext)
Created: February 8, 2026 18:45 UTC
Status: π ACTIVE - Refactoring in Progress
Next Review: After P1 completion (Orthodoxy Wardens + Vault Keepers)