ADR-020: Amanda Agent Registry-First Migration
ADR-020: Amanda Agent Registry-First Migration
Status: Proposed Date: 2025-08-26 Authors: Architecture Guardian, Registry Guardian, Feature Integrator Deciders: Eden Academy Technical LeadershipContext
Amanda (the art collecting agent) currently has fragmented data across multiple systems:This violates the core principle that Registry = Protocol Layer and creates risk of data inconsistencies.
Decision
Migrate Amanda to be fully Registry-first with the Registry as the single source of truth for all canonical data.
Architecture
Data Flow
``
Registry (Source of Truth)
↓ API calls via SDK
Academy UI (Consumer)
↓ API calls via SDK
Standalone Agent (Consumer + Producer)
`
Migration Phases
Phase 1: Registry Schema Enhancement (Week 1-2)
• Extend Agent schema with art collector specialization
• Add collections and artworks tables
• Create activity logging structure
Phase 2: SDK Integration (Week 2-3)
• Replace raw axios with generated SDK
• Implement Registry consumption in standalone agent
• Add bidirectional state synchronization
Phase 3: Academy UI Update (Week 3-4)
• Remove static mappings (TRAINER_MAP, ECONOMIC_DATA)
• Update to consume Registry API via migrationService
• Make profile pages Registry-driven
Phase 4: Feature Flag Rollout (Week 4-5)
• REGISTRY_DRIVEN_PROFILE (default: false)
• REGISTRY_DRIVEN_STATE (default: false)
• SDK_ONLY_MODE (default: false)
• LEGACY_STANDALONE_MODE (default: true for rollback)
Phase 5: Production Migration (Week 5-6)
• Run migration SQL scripts
• Enable feature flags progressively
• Monitor for data drift
• Complete migration validation
Implementation Details
Registry Schema Extensions
`sql
ALTER TABLE agents ADD COLUMN agent_type VARCHAR(50);
ALTER TABLE agents ADD COLUMN specialization TEXT;
ALTER TABLE agents ADD COLUMN capabilities JSONB;
ALTER TABLE agents ADD COLUMN personality JSONB;
ALTER TABLE agents ADD COLUMN metrics JSONB;
ALTER TABLE agents ADD COLUMN operational_config JSONB;
`
SDK Usage Pattern
`typescript
// BEFORE: Raw axios
this.client = axios.create({...});
await this.client.post('/api/agents', data);
// AFTER: Generated SDK
this.sdk = new EdenRegistrySDK({...});
await this.sdk.agents.create(data);
`
Feature Flag Configuration
`typescript
export const AMANDA_MIGRATION_FLAGS = {
REGISTRY_DRIVEN_PROFILE: process.env.ENABLE_REGISTRY_SYNC === 'true',
LEGACY_STANDALONE_MODE: process.env.ENABLE_REGISTRY_SYNC !== 'true'
};
`
Rollback Strategy
Immediate Rollback Triggers:
• Registry API unavailable > 5 minutes
• Data corruption detected
• Performance degradation > 50%
Rollback Process:
Set ENABLE_REGISTRY_SYNC=false`
Consequences
Positive
Negative
Risks
Validation Criteria
Technical
Operational
Business
References
Decision Record
Notes
This migration establishes the pattern for all future Eden Academy agents to be Registry-first from inception, preventing similar fragmentation issues.