IMPLEMENTATION GUIDES 12 MIN READ 2026.03.03

> ECM Protocol Extension Development Guide

Guide to developing custom ECM Protocol extensions for domain-specific requirements.

ECM Protocol Extension Development Guide

Extension Architecture

ECM Protocol supports extensions for domain-specific needs. Extensions add capabilities while maintaining base protocol compatibility.

Extension Namespacing

Namespace Convention

// Extensions use x-ecm- prefix with domain
{
  "ecm_version": "1.0",
  "payload": {...},
  "x-ecm-healthcare": {
    "phi_classification": "protected",
    "retention_policy": "7_years"
  },
  "x-ecm-audit": {
    "access_justification": "Customer support request #12345"
  }
}

Extension Types

Metadata Extensions

Add custom metadata fields:

interface HealthcareExtension {
  namespace: 'x-ecm-healthcare';
  fields: {
    phi_classification: 'public' | 'limited' | 'protected';
    hipaa_categories: string[];
    retention_policy: string;
    consent_references: string[];
  };
}

Operation Extensions

Extend standard operations:

// Extended put with healthcare validation
{
  "operation": "context.put",
  "payload": {...},
  "x-ecm-healthcare": {
    "validate_phi": true,
    "redact_on_store": ["ssn", "dob"]
  }
}

Query Extensions

Add custom query operators:

{
  "filter": {
    "x-ecm-geographic": {
      "within_radius": {
        "center": {"lat": 40.7, "lng": -74.0},
        "radius_km": 50
      }
    }
  }
}

Extension Registration

Extension Manifest

{
  "extension_id": "ecm-healthcare",
  "version": "1.0.0",
  "description": "Healthcare domain extensions for PHI handling",
  "namespace": "x-ecm-healthcare",
  "dependencies": ["ecm-core:1.x"],
  "schemas": {
    "metadata": "./schemas/healthcare-metadata.json",
    "operations": "./schemas/healthcare-operations.json"
  },
  "implementation": {
    "validators": "./validators.js",
    "processors": "./processors.js"
  }
}

Implementation Guidelines

Backward Compatibility

Extensions must not break base protocol: non-extension clients must ignore extensions, extension-aware clients degrade gracefully, and core operations work without extensions.

Documentation

Document extensions thoroughly: schema definitions, semantic meaning, example usage, and migration guides.

Testing Extensions

describe('Healthcare Extension', () => {
  it('should validate PHI classification', async () => {
    const context = {
      data: { patient_name: 'John Doe' },
      'x-ecm-healthcare': { phi_classification: 'protected' }
    };
    
    await expect(store.put(context)).resolves.toBeDefined();
  });
  
  it('should reject invalid PHI classification', async () => {
    const context = {
      data: { patient_name: 'John Doe' },
      'x-ecm-healthcare': { phi_classification: 'invalid' }
    };
    
    await expect(store.put(context)).rejects.toThrow(ValidationError);
  });
});

Conclusion

ECM Protocol extensions enable domain-specific functionality while maintaining interoperability. Use proper namespacing, document thoroughly, and test for compatibility with base protocol.

//TAGS

EXTENSIONS CUSTOMIZATION DEVELOPMENT PROTOCOL