[Phase 5.4] Automated Deployment Pipeline #66

Closed
opened 2026-04-01 01:59:15 +00:00 by Mark · 1 comment
Owner

Overview

Automatically deploy promoted capabilities from _nerve/ to _muscle/ with safe rollout and rollback.

Problem Statement

Current promotion flow:

Championship → Winner identified → [State change in ledger only]
                                          ↓
                               [Manual: copy to _muscle/]

Promoted capabilities don't automatically become available for production use.

Proposed Solution

5.4.1: Deployment Manager

Create evolution/deployment_manager.py:

class CapabilityDeployer:
    """Manage capability deployment lifecycle."""
    
    def deploy(
        self,
        capability_id: str,
        source: str = "_nerve",
        target: str = "_muscle"
    ) -> dict:
        """Deploy capability from source to target."""
        return {
            "status": "deployed",
            "source": "capabilities/_nerve/writer_v2",
            "target": "capabilities/_muscle/writer_v2",
            "version": "2.0.0",
            "previous_version": "1.5.0"
        }
        
    def rollback(
        self,
        capability_id: str,
        version: str
    ) -> dict:
        """Rollback to previous version."""
        ...
        
    def get_deployment_status(
        self,
        capability_id: str
    ) -> dict:
        """Get current deployment status."""
        ...

5.4.2: Safe Rollout Pipeline

Promotion Decision (championship/rumination)
        ↓
CapabilityDeployer.prepare_deployment()
        ↓
Run integration tests against new capability
        ↓
[If tests pass] → Deploy to _muscle/
        ↓
Update registry.json (state: "stable")
        ↓
Emit `capability.deployed` event
        ↓
Monitor success rate for 24h
        ↓
[If degradation] → Auto-rollback

5.4.3: Deployment Storage

CREATE TABLE capability_deployments (
    id INTEGER PRIMARY KEY,
    capability_id TEXT NOT NULL,
    version TEXT NOT NULL,
    source_path TEXT,
    target_path TEXT,
    deployed_at TIMESTAMP,
    deployed_by TEXT,  -- "championship" or "rumination"
    previous_version TEXT,
    success_rate_24h REAL,
    rolled_back BOOLEAN DEFAULT FALSE,
    rollback_reason TEXT
);

Deliverables

  • evolution/deployment_manager.py - Deployer class
  • deploy() - Copy capability to target directory
  • rollback() - Restore previous version
  • verify_deployment() - Run tests post-deployment
  • Integration with evolution/promote.py
  • Integration with evolution/championship.py
  • capability.deployed event emission
  • Monitoring: 24h success rate tracking
  • Auto-rollback on degradation

Deployment Rules

Scenario Action
Championship winner Deploy to _muscle/
Rumination promote Move _nerve/ → _muscle/
Rumination demote Move _muscle/ → _nerve/
Deployment failure Keep previous version
Success rate < 80% (24h) Auto-rollback

Success Criteria

  • Promoted capabilities auto-deploy within 5 minutes
  • Deployment includes verification tests
  • Rollback restores previous working version
  • Deployment history tracked in ledger
  • Monitoring detects degradation

Dependencies

  • #65 (Capability Fusion) - fused variants need deployment

Estimated Duration

1 week

  • Parent: #62 (Phase 5 Meta)
  • Uses: evolution/promote.py, evolution/championship.py
## Overview Automatically deploy promoted capabilities from `_nerve/` to `_muscle/` with safe rollout and rollback. ## Problem Statement Current promotion flow: ``` Championship → Winner identified → [State change in ledger only] ↓ [Manual: copy to _muscle/] ``` Promoted capabilities don't automatically become available for production use. ## Proposed Solution ### 5.4.1: Deployment Manager Create `evolution/deployment_manager.py`: ```python class CapabilityDeployer: """Manage capability deployment lifecycle.""" def deploy( self, capability_id: str, source: str = "_nerve", target: str = "_muscle" ) -> dict: """Deploy capability from source to target.""" return { "status": "deployed", "source": "capabilities/_nerve/writer_v2", "target": "capabilities/_muscle/writer_v2", "version": "2.0.0", "previous_version": "1.5.0" } def rollback( self, capability_id: str, version: str ) -> dict: """Rollback to previous version.""" ... def get_deployment_status( self, capability_id: str ) -> dict: """Get current deployment status.""" ... ``` ### 5.4.2: Safe Rollout Pipeline ``` Promotion Decision (championship/rumination) ↓ CapabilityDeployer.prepare_deployment() ↓ Run integration tests against new capability ↓ [If tests pass] → Deploy to _muscle/ ↓ Update registry.json (state: "stable") ↓ Emit `capability.deployed` event ↓ Monitor success rate for 24h ↓ [If degradation] → Auto-rollback ``` ### 5.4.3: Deployment Storage ```sql CREATE TABLE capability_deployments ( id INTEGER PRIMARY KEY, capability_id TEXT NOT NULL, version TEXT NOT NULL, source_path TEXT, target_path TEXT, deployed_at TIMESTAMP, deployed_by TEXT, -- "championship" or "rumination" previous_version TEXT, success_rate_24h REAL, rolled_back BOOLEAN DEFAULT FALSE, rollback_reason TEXT ); ``` ## Deliverables - [ ] `evolution/deployment_manager.py` - Deployer class - [ ] `deploy()` - Copy capability to target directory - [ ] `rollback()` - Restore previous version - [ ] `verify_deployment()` - Run tests post-deployment - [ ] Integration with `evolution/promote.py` - [ ] Integration with `evolution/championship.py` - [ ] `capability.deployed` event emission - [ ] Monitoring: 24h success rate tracking - [ ] Auto-rollback on degradation ## Deployment Rules | Scenario | Action | |----------|--------| | Championship winner | Deploy to `_muscle/` | | Rumination promote | Move `_nerve/` → `_muscle/` | | Rumination demote | Move `_muscle/` → `_nerve/` | | Deployment failure | Keep previous version | | Success rate < 80% (24h) | Auto-rollback | ## Success Criteria - [ ] Promoted capabilities auto-deploy within 5 minutes - [ ] Deployment includes verification tests - [ ] Rollback restores previous working version - [ ] Deployment history tracked in ledger - [ ] Monitoring detects degradation ## Dependencies - #65 (Capability Fusion) - fused variants need deployment ## Estimated Duration 1 week ## Related - Parent: #62 (Phase 5 Meta) - Uses: `evolution/promote.py`, `evolution/championship.py`
Author
Owner

⏸️ Blocked - Moved to Future Phase

Automated deployment to _muscle/ is deferred because:

  1. Manual deployment is acceptable for current scale
  2. Human review of promoted capabilities adds safety
  3. Phase 5 self-building core is complete without it

This can be revisited when:

  • Promotion volume exceeds manual review capacity
  • Deployment failures become frequent
  • Rollback automation becomes critical

Phase 5 core complete with #63, #64, #65, #67, #68.

⏸️ **Blocked - Moved to Future Phase** Automated deployment to `_muscle/` is deferred because: 1. Manual deployment is acceptable for current scale 2. Human review of promoted capabilities adds safety 3. Phase 5 self-building core is complete without it This can be revisited when: - Promotion volume exceeds manual review capacity - Deployment failures become frequent - Rollback automation becomes critical Phase 5 core complete with #63, #64, #65, #67, #68.
Mark 2026-05-27 22:47:42 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/mesh-seed#66
No description provided.