Claude
Skills
Sign in
Back

proof-composer

Included with Lifetime
$97 forever

Validates entire engineering proof chain. Verifies architecture, backend maps, backend code, standardization, frontend types, infrastructure topology all compose correctly. This is the final DEPLOYMENT GATE - deployment blocked if proof chain invalid. Use when engineering thread completes all actions.

Web Dev

What this skill does


# proof-composer: System-Wide Proof Validation (DEPLOYMENT GATE)

## Purpose

Validate entire engineering proof chain and authorize deployment. This is the **final deployment gate** - nothing deploys without a valid composed proof.

**Key insight:** Each skill generates local proofs. proof-composer verifies they compose into a valid system-wide proof.

**Process:**
1. Collect all proofs (architecture, backend, frontend, infrastructure)
2. Verify version consistency (all use same spec version)
3. Validate proof chain (architecture → backend → standardization → frontend → infrastructure)
4. Check for gaps (missing proofs, incomplete verification)
5. Generate composed proof certificate (authorizes deployment)

---

## Position in Engineering Layer

You are skill #6 of 6 (FINAL GATE):

1. **system-architect** - Requirements → Specifications + Curry-Howard proofs
2. **backend-prover** - Specifications → Maps → Code + Runtime monitors
3. **standardization-layer** - Code → Middleware injection (naturality proofs)
4. **frontend-prover** - OpenAPI → TypeScript + Framework bindings + Type correspondence
5. **infrastructure-prover** - Services spec → Deployment configs + Topology isomorphism
6. **proof-composer** (YOU) - Validates entire chain + Authorizes deployment

---

## Input Requirements

**All proofs from previous skills:**
```
artifacts/engineering/proofs/
├── architecture/
│   ├── adt-correctness/
│   ├── functor-laws/
│   ├── composition-correctness/
│   ├── state-machines/
│   └── curry-howard-proofs/
│
├── backend/
│   ├── map-validation/
│   │   └── validation-report.json
│   ├── implementation-correctness/
│   ├── standardization/
│   │   └── naturality-certificate.proof
│   └── runtime-verification/
│
├── frontend/
│   └── type-correspondence/
│       └── openapi-to-typescript.proof
│
└── infrastructure/
    └── topology/
        └── deployment-isomorphism.proof
```

**Specification manifest:**
```
artifacts/engineering/specifications/manifest.json
```

**Generated artifacts:**
```
artifacts/engineering/
├── specifications/v{X}/          # From system-architect
├── maps/backend/                 # From backend-prover Phase 1
├── code/backend/                 # From backend-prover Phase 2
├── code/frontend/                # From frontend-prover
└── configs/                      # From infrastructure-prover
```

---

## Validation Process

### Step 1: Collect All Proofs

```python
def collect_proofs():
    """
    Collect all proof files from engineering artifacts
    
    Returns dict of proofs by category
    """
    
    proofs = {
        'architecture': collect_architecture_proofs(),
        'backend': collect_backend_proofs(),
        'frontend': collect_frontend_proofs(),
        'infrastructure': collect_infrastructure_proofs()
    }
    
    return proofs

def collect_architecture_proofs():
    """Collect from system-architect"""
    return {
        'adt_correctness': load_proof('architecture/adt-correctness/'),
        'functor_laws': load_proof('architecture/functor-laws/'),
        'composition': load_proof('architecture/composition-correctness/'),
        'state_machines': load_proof('architecture/state-machines/'),
        'curry_howard': load_proof('architecture/curry-howard-proofs/')
    }

def collect_backend_proofs():
    """Collect from backend-prover + standardization-layer"""
    return {
        'map_validation': load_json('backend/map-validation/validation-report.json'),
        'implementation': load_proof('backend/implementation-correctness/'),
        'standardization': load_json('backend/standardization/naturality-certificate.proof'),
        'runtime': load_proof('backend/runtime-verification/')
    }

def collect_frontend_proofs():
    """Collect from frontend-prover"""
    return {
        'type_correspondence': load_json('frontend/type-correspondence/openapi-to-typescript.proof')
    }

def collect_infrastructure_proofs():
    """Collect from infrastructure-prover"""
    return {
        'topology': load_json('infrastructure/topology/deployment-isomorphism.proof')
    }
```

---

### Step 2: Verify Version Consistency

```python
def verify_version_consistency(proofs, manifest):
    """
    Verify all proofs reference same specification version
    
    Critical: Prevents race conditions where different skills
    used different versions of the spec
    """
    
    errors = []
    
    # Get spec version from manifest
    spec_version = manifest['version']
    spec_hash = manifest['hash']
    
    # Check architecture proofs
    arch_version = proofs['architecture'].get('specification_version')
    if arch_version != spec_version:
        errors.append({
            "type": "version_mismatch",
            "skill": "system-architect",
            "expected": spec_version,
            "actual": arch_version
        })
    
    # Check backend proofs
    backend_version = proofs['backend']['map_validation'].get('specification_version')
    if backend_version != spec_version:
        errors.append({
            "type": "version_mismatch",
            "skill": "backend-prover",
            "expected": spec_version,
            "actual": backend_version
        })
    
    # Check frontend proofs
    frontend_version = proofs['frontend']['type_correspondence'].get('specification_version')
    if frontend_version != spec_version:
        errors.append({
            "type": "version_mismatch",
            "skill": "frontend-prover",
            "expected": spec_version,
            "actual": frontend_version
        })
    
    # Check infrastructure proofs
    infra_version = proofs['infrastructure']['topology'].get('specification_version')
    if infra_version != spec_version:
        errors.append({
            "type": "version_mismatch",
            "skill": "infrastructure-prover",
            "expected": spec_version,
            "actual": infra_version
        })
    
    return {
        "consistent": len(errors) == 0,
        "specification_version": spec_version,
        "specification_hash": spec_hash,
        "errors": errors
    }
```

---

### Step 3: Validate Proof Chain

```python
def validate_proof_chain(proofs):
    """
    Verify proof chain composes correctly:
    
    Requirements → Architecture (system-architect) ✓
        ↓
    Backend Maps (backend-prover Phase 1) ✓
        ↓
    Backend Code (backend-prover Phase 2) ✓
        ↓
    Standardization (standardization-layer) ✓
        ↓
    Frontend (frontend-prover) ✓
        ↓
    Infrastructure (infrastructure-prover) ✓
    """
    
    errors = []
    
    # 1. Architecture proofs valid
    if not architecture_proofs_valid(proofs['architecture']):
        errors.append({
            "type": "invalid_architecture_proof",
            "details": "Architecture proofs failed validation"
        })
    
    # 2. Backend maps validated
    if proofs['backend']['map_validation']['status'] != 'valid':
        errors.append({
            "type": "invalid_backend_maps",
            "details": "Backend maps not validated"
        })
    
    # 3. Backend code matches maps
    if not backend_code_matches_maps(proofs['backend']['implementation']):
        errors.append({
            "type": "code_map_mismatch",
            "details": "Backend code doesn't match verified maps"
        })
    
    # 4. Standardization preserves composition
    if not standardization_preserves_composition(proofs['backend']['standardization']):
        errors.append({
            "type": "standardization_broken",
            "details": "Standardization doesn't preserve composition laws"
        })
    
    # 5. Frontend types correspond to backend API
    if not proofs['frontend']['type_correspondence']['bijection']:
        errors.append({
            "type": "type_correspondence_failed",
            "details": "Frontend types don't match backend API"
        })
    
    # 6. Infrastructure topology matches architecture
    if not proofs['infrastructure']['topology']['isomorphism'

Related in Web Dev