Skip to main content

Universal Measurement Contract Protocol (UMCP): contract-first validation, receipts, and runnable casepacks with GCD and RCFT frameworks. Features intelligent caching and progressive optimization.

Project description

CI Production Ready Python 3.12+ Tests Validation Performance Smart Cache


๐Ÿš€ Live System HUD

โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘                    UMCP PRODUCTION SYSTEM STATUS                     โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

  ๐Ÿ” Canon:           UMCP.CANON.v1
  ๐Ÿ“œ Contract:        UMA.INTSTACK.v1
  ๐Ÿ”— Weld:            W-2025-12-31-PHYS-COHERENCE
  
  ๐Ÿ“š DOI References:
     PRE:  10.5281/zenodo.17756705  (The Episteme of Return)
     POST: 10.5281/zenodo.18072852  (Physics of Coherence)
     PACK: 10.5281/zenodo.18226878  (CasePack Publication)

  โš™๏ธ  Tier-1 Kernel:
     p=3  ฮฑ=1.0  ฮป=0.2  ฮท=0.001
     
  ๐ŸŽฏ Regime Gates:
     Stable:   ฯ‰<0.038  F>0.90  S<0.15  C<0.14
     Collapse: ฯ‰โ‰ฅ0.30
     
  ๐Ÿ“Š Current State:
     Status:     CONFORMANT โœ…
     Regime:     Stable
     Errors:     0
     Warnings:   0
     
  โšก Performance:
     Cache:      Intelligent + Persistent
     Speedup:    20-25% faster (warm)
     Skipping:   4/4 casepacks (unchanged)
     Learning:   Progressive acceleration
     
  ๐Ÿ”ง CLI:         umcp validate
  ๐ŸŒ Dashboard:   Port 8501 (Interactive)
  ๐Ÿ”Œ API:         Port 8000 (REST)
  
  ๐Ÿ“ฆ Ledger:      ledger/return_log.csv (continuous append)
  ๐Ÿงช CasePacks:   hello_world | gcd_complete | rcft_complete
  
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
           "No improvisation. Contract-first. Tier-1 reserved."
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

Quick Access:

  • ๐ŸŽจ Visualization Dashboard โ€” Phase space, time series, regime monitoring
  • ๐Ÿ”Œ API Endpoints โ€” /health, /latest-receipt, /ledger, /stats, /regime
  • ๐Ÿ“– Extensions Guide โ€” Dashboard & API usage
  • ๐Ÿงช Theory Docs โ€” Mathematical foundations

UMCP is a production-grade system for creating, validating, and sharing reproducible computational workflows. It enforces mathematical contracts, tracks provenance, generates cryptographic receipts, and validates results against frozen specificationsโ€”ensuring reviewers can verify exactly what was computed, how, and under what assumptions.


๐ŸŽฏ What is UMCP?

UMCP transforms computational experiments into auditable artifacts:

Raw Measurements โ†’ Invariants โ†’ Closures โ†’ Validation โ†’ Receipt
      (CSV)           (JSON)      (Python)    (Contract)   (SHA256)

Key Concepts:

  • Contracts: Frozen mathematical specifications (GCD, RCFT) defining valid computation
  • Invariants: Core metrics (ฯ‰, F, S, C) computed from raw data
  • Closures: Computational functions (energy, collapse, flux, resonance, fractal, recursive, pattern)
  • CasePacks: Self-contained reproducible units (inputs + expected outputs + receipt)
  • Validation: Automated verification that results conform to contract specifications

๐Ÿ“Š System Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                         UMCP WORKFLOW                               โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                     โ”‚
โ”‚  1. INPUT                                                           โ”‚
โ”‚     โ””โ”€ raw_measurements.csv  (your experimental data)               โ”‚
โ”‚                                                                     โ”‚
โ”‚  2. INVARIANTS COMPUTATION                                          โ”‚
โ”‚     โ”œโ”€ ฯ‰ (drift)                                                    โ”‚
โ”‚     โ”œโ”€ F (fidelity)                                                 โ”‚
โ”‚     โ”œโ”€ S (entropy)                                                  โ”‚
โ”‚     โ””โ”€ C (curvature)                                                โ”‚
โ”‚                                                                     โ”‚
โ”‚  3. CLOSURE EXECUTION (choose framework)                            โ”‚
โ”‚     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”           โ”‚
โ”‚     โ”‚ GCD (Tier-1)        โ”‚      โ”‚ RCFT (Tier-2)        โ”‚           โ”‚
โ”‚     โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค      โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค           โ”‚
โ”‚     โ”‚ โ€ข Energy (E)        โ”‚  OR  โ”‚ โ€ข Fractal (D_f)      โ”‚           โ”‚
โ”‚     โ”‚ โ€ข Collapse (ฮฆ_c)    โ”‚      โ”‚ โ€ข Recursive (ฮจ_r)    โ”‚           โ”‚
โ”‚     โ”‚ โ€ข Flux (ฮฆ_gen)      โ”‚      โ”‚ โ€ข Pattern (ฮป, ฮ˜)     โ”‚           โ”‚
โ”‚     โ”‚ โ€ข Resonance (R)     โ”‚      โ”‚ + all GCD closures   โ”‚           โ”‚
โ”‚     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜           โ”‚
โ”‚                                                                     โ”‚
โ”‚  4. VALIDATION                                                      โ”‚
โ”‚     โ”œโ”€ Contract conformance (schema validation)                     โ”‚
โ”‚     โ”œโ”€ Regime classification (Low/Medium/High, etc.)                โ”‚
โ”‚     โ”œโ”€ Mathematical identities (F = 1-ฯ‰, IC โ‰ˆ exp(ฮบ), etc.)         โ”‚
โ”‚     โ””โ”€ Tolerance checks (within tol_seam, tol_id, etc.)             โ”‚
โ”‚                                                                     โ”‚
โ”‚  5. OUTPUT                                                          โ”‚
โ”‚     โ”œโ”€ invariants.json (computed metrics)                           โ”‚
โ”‚     โ”œโ”€ closure_results.json (GCD/RCFT outputs)                      โ”‚
โ”‚     โ”œโ”€ seam_receipt.json (validation status + SHA256)               โ”‚
โ”‚     โ””โ”€ CONFORMANT or NONCONFORMANT status                           โ”‚
โ”‚                                                                     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿš€ Quick Start (5 Minutes)

Installation

git clone https://github.com/calebpruett927/UMCP-Metadata-Runnable-Code.git
cd UMCP-Metadata-Runnable-Code
python3.12 -m venv .venv
source .venv/bin/activate
pip install -e ".[production]"

Verify Installation

umcp health
# โœ“ All systems operational

pytest
# 221 tests passed in ~7s

๐Ÿ“ How to Use UMCP

Step 1: Prepare Your Data

Create a CSV file with your measurements. Example my_data.csv:

timestamp,c,p_x,p_y,p_z
0.0,0.999,0.001,-0.002,0.003
1.0,0.998,0.002,-0.001,0.004
2.0,0.997,0.003,0.000,0.002

Required columns:

  • c: Fidelity measurement (0 to 1)
  • p_x, p_y, p_z: Momentum components

Step 2: Create a CasePack

# Create new casepack directory
mkdir -p casepacks/my_experiment

# Copy your data
cp my_data.csv casepacks/my_experiment/raw_measurements.csv

# Generate manifest (choose framework: GCD or RCFT)
./scripts/create_manifest.sh my_experiment RCFT.INTSTACK.v1

This creates casepacks/my_experiment/manifest.json:

{
  "casepack_id": "my_experiment",
  "contract_id": "RCFT.INTSTACK.v1",
  "version": "1.0.0",
  "description": "My experimental data with RCFT analysis",
  "closures_to_run": [
    "energy_potential",
    "entropic_collapse",
    "generative_flux",
    "field_resonance",
    "fractal_dimension",
    "recursive_field",
    "resonance_pattern"
  ]
}

Step 3: Generate Expected Outputs

# Run computation pipeline
python casepacks/my_experiment/generate_expected.py

# This creates:
# - expected/invariants.json (ฯ‰, F, S, C, ฯ„_R, ฮบ, IC)
# - expected/gcd_energy.json (E_potential, regime)
# - expected/gcd_collapse.json (ฮฆ_collapse, regime)
# - expected/gcd_flux.json (ฮฆ_gen, regime)
# - expected/gcd_resonance.json (R, regime)
# - expected/rcft_fractal.json (D_fractal, regime)
# - expected/rcft_recursive.json (ฮจ_r, regime)
# - expected/rcft_pattern.json (ฮป_p, ฮ˜, pattern_type)
# - expected/seam_receipt.json (validation status)

Example generate_expected.py:

import numpy as np
import json
from pathlib import Path
from closures.gcd.energy_potential import compute_energy_potential
from closures.rcft.fractal_dimension import compute_fractal_dimension, compute_trajectory_from_invariants

# Load raw data
data = np.genfromtxt('raw_measurements.csv', delimiter=',', skip_header=1)

# Compute invariants
omega = np.mean(data[:, 1] - 1.0)  # drift from fidelity
F = np.mean(data[:, 1])            # fidelity
S = np.std(data[:, 1])             # entropy
C = np.mean(np.abs(np.diff(data[:, 1])))  # curvature

invariants = {"omega": omega, "F": F, "S": S, "C": C}

# Save invariants
Path("expected").mkdir(exist_ok=True)
with open("expected/invariants.json", "w") as f:
    json.dump(invariants, f, indent=2)

# Run GCD closures
energy = compute_energy_potential(omega, S, C)
with open("expected/gcd_energy.json", "w") as f:
    json.dump(energy, f, indent=2)

# Run RCFT closures
trajectory = compute_trajectory_from_invariants({
    "omega": data[:, 1] - 1.0,
    "S": np.full(len(data), S),
    "C": np.full(len(data), C)
})
fractal = compute_fractal_dimension(trajectory)
with open("expected/rcft_fractal.json", "w") as f:
    json.dump(fractal, f, indent=2)

# Generate receipt
receipt = {
    "casepack_id": "my_experiment",
    "contract_id": "RCFT.INTSTACK.v1",
    "run_status": "CONFORMANT",
    "tier_hierarchy_validated": True,
    "sha256_manifest": "...",
    "timestamp": "2026-01-18T00:00:00Z"
}
with open("expected/seam_receipt.json", "w") as f:
    json.dump(receipt, f, indent=2)

Step 4: Validate Your CasePack

# Validate against contract
umcp validate casepacks/my_experiment

# Expected output:
# โœ“ Schema validation passed
# โœ“ Invariants conform to contract
# โœ“ All closures executed successfully
# โœ“ Regime classifications valid
# โœ“ Mathematical identities satisfied
# โ†’ Status: CONFORMANT

Step 5: Compare Results

# Generate new results from same data
python casepacks/my_experiment/generate_expected.py

# Compare with original expected outputs
umcp diff \
  casepacks/my_experiment/expected/seam_receipt.json \
  casepacks/my_experiment/new_receipt.json

# Shows differences in:
# - Invariant values
# - Closure outputs
# - Regime classifications
# - Validation status

๐ŸŽ“ Framework Selection Guide

When to Use GCD (Tier-1)

Best for:

  • Energy and collapse dynamics analysis
  • Boundary-interior coupling (resonance)
  • Generative potential extraction
  • Basic regime classification

Example use cases:

  • Phase transitions
  • Thermodynamic systems
  • Field theories
  • Quantum collapse models

Closure outputs:

  • E_potential: Total system energy
  • ฮฆ_collapse: Collapse potential
  • ฮฆ_gen: Generative flux
  • R: Boundary-interior resonance

When to Use RCFT (Tier-2)

Best for:

  • Geometric complexity analysis
  • Memory and history effects
  • Oscillatory pattern detection
  • Multi-scale recursive structures

Example use cases:

  • Fractal attractors
  • Time series with memory
  • Periodic or quasi-periodic systems
  • Chaotic dynamics

Closure outputs (includes all GCD outputs plus):

  • D_fractal: Trajectory complexity (1 โ‰ค D_f โ‰ค 3)
  • ฮจ_recursive: Collapse memory (ฮจ_r โ‰ฅ 0)
  • ฮป_pattern: Resonance wavelength
  • ฮ˜_phase: Phase angle [0, 2ฯ€)

Decision Matrix:

Need Framework Why
Basic energy/collapse analysis GCD Simpler, faster, foundational
Trajectory complexity RCFT Box-counting fractal dimension
History/memory effects RCFT Exponential decay field
Oscillation detection RCFT FFT-based pattern analysis
Zero entropy (S=0) state Either Both handle deterministic states
Maximum insight RCFT Includes all GCD + 3 new metrics

๐Ÿ“š Example CasePacks

Hello World (Zero Entropy)

cd casepacks/hello_world
cat raw_measurements.csv
# timestamp,c,p_x,p_y,p_z
# 0.0,0.99999999,0.0,0.0,0.0
# 1.0,0.99999999,0.0,0.0,0.0
# 2.0,0.99999999,0.0,0.0,0.0

python generate_expected.py
umcp validate .

# Result: CONFORMANT
# - ฯ‰ = 0, F = 1.0, S = 0, C = 0
# - All GCD regimes: Low/Minimal/Dormant/Coherent
# - RCFT: D_f=0 (point), ฮจ_r=0 (no memory), ฮป=โˆž (constant)

RCFT Complete (Full Analysis)

cd casepacks/rcft_complete
umcp validate .

# Result: CONFORMANT with tier_hierarchy_validated=true
# - Validates UMCP โ†’ GCD โ†’ RCFT tier chain
# - All 7 closures executed
# - Zero entropy example with RCFT overlay

๐Ÿ› ๏ธ Advanced Usage

Programmatic API

from closures.gcd.energy_potential import compute_energy_potential
from closures.rcft.fractal_dimension import compute_fractal_dimension
import numpy as np

# Compute GCD metrics
omega, S, C = 0.01, 0.05, 0.02
energy = compute_energy_potential(omega, S, C)
print(f"Energy: {energy['E_potential']:.6f} ({energy['regime']})")
# Energy: 0.001234 (Low)

# Compute RCFT metrics
trajectory = np.array([[0, 0, 0], [0.01, 0, 0], [0.02, 0.01, 0]])
fractal = compute_fractal_dimension(trajectory)
print(f"Fractal dimension: {fractal['D_fractal']:.4f} ({fractal['regime']})")
# Fractal dimension: 1.0234 (Smooth)

Custom Validation Rules

Edit validator_rules.yaml to add custom checks:

semantic_rules:
  - rule_id: "CUSTOM-001"
    description: "Custom regime boundary check"
    check_type: "regime_check"
    target: "energy"
    condition: "E_potential < custom_threshold"
    severity: "error"

Health Monitoring

# System health check
umcp health
# Output:
# โœ“ Python version: 3.12.1
# โœ“ Dependencies: numpy, scipy, jsonschema
# โœ“ Closures: 7 registered (4 GCD + 3 RCFT)
# โœ“ Schemas: 10 valid
# โœ“ Contracts: 2 loaded (GCD, RCFT)
# โ†’ Status: OPERATIONAL

# Performance metrics
umcp validate --verbose casepacks/my_experiment
# Output includes:
# - Validation duration
# - Memory usage
# - CPU utilization
# - Schema validation time
# - Closure execution time

Production Deployment

# Enable JSON logging
export UMCP_JSON_LOGS=1

# Run with strict validation
umcp validate --strict --out result.json

# Integrate with monitoring systems (ELK, Splunk, CloudWatch)
umcp validate --strict 2>&1 | tee validation.log

See Production Deployment Guide for Docker, Kubernetes, and CI/CD integration.


๐Ÿ“– Documentation

Core Documentation

Framework Documentation

Contract Specifications

API Reference


๐Ÿงช Testing

Run All Tests

pytest                    # All 221 tests (~7s)
pytest -v                 # Verbose output
pytest -k "gcd"           # GCD tests only
pytest -k "rcft"          # RCFT tests only
pytest --cov              # Coverage report

Test Structure

tests/
โ”œโ”€โ”€ test_00_schemas_valid.py           # Schema validation
โ”œโ”€โ”€ test_10_canon_contract_closures_validate.py  # Core validation
โ”œโ”€โ”€ test_100_gcd_canon.py              # GCD canon tests
โ”œโ”€โ”€ test_101_gcd_closures.py           # GCD closure tests
โ”œโ”€โ”€ test_102_gcd_contract.py           # GCD contract tests
โ”œโ”€โ”€ test_110_rcft_canon.py             # RCFT canon tests
โ”œโ”€โ”€ test_111_rcft_closures.py          # RCFT closure tests
โ”œโ”€โ”€ test_112_rcft_contract.py          # RCFT contract tests
โ”œโ”€โ”€ test_113_rcft_tier2_layering.py    # Tier hierarchy tests
โ””โ”€โ”€ test_*                             # Additional integration tests

๐Ÿค What's New in v1.1.0

Recursive Collapse Field Theory (RCFT) - Complete Tier-2 framework:

  • 3 New Closures: Fractal dimension, recursive field, resonance pattern
  • Complete Integration: 221 tests passing (100% success), full backward compatibility
  • Production Ready: Comprehensive documentation, validated examples
  • Performance: 7s test execution (was 12s for 30 tests, now 221 tests!)

See CHANGELOG.md for full release notes.

Contents

  1. Canon anchors โ€“ Stable identifiers and default numeric thresholds (UMCP, GCD, RCFT).
  2. Contracts โ€“ Frozen boundaries defining Tierโ€‘1 and Tier-2 semantics (GCD.INTSTACK.v1, RCFT.INTSTACK.v1).
  3. Closures โ€“ Explicit complements implementing the frameworks:
    • GCD Tier-1 (4 closures): Energy potential, entropic collapse, generative flux, field resonance
    • RCFT Tier-2 (3 closures): Fractal dimension, recursive field, resonance pattern
  4. Schemas โ€“ JSON Schema files describing valid structures for all artifacts.
  5. Validator rules โ€“ Portable semantic checks enforced at runtime.
  6. Validator CLI โ€“ A Python entrypoint (umcp validate, umcp health) with structured logging.
  7. CasePacks โ€“ Runnable publication units (inputs, invariants, receipts) for GCD and RCFT.
  8. Tests โ€“ Comprehensive pytest suite (221 tests: 142 original + 56 RCFT + 23 integration).
  9. CI workflow โ€“ GitHub Actions configuration (validate.yml) that runs the validator and tests.
  10. Production deployment โ€“ Complete guide for enterprise deployment.
  11. Monitoring & Observability โ€“ Structured JSON logging, performance metrics, health checks.
  12. RCFT Documentation โ€“ Theory and Usage Guide for Tier-2 overlay.

Production Features โญ

  • ๐Ÿฅ Health Checks: umcp health command for system readiness monitoring
  • ๐Ÿ“Š Performance Metrics: Track validation duration, memory usage, CPU utilization
  • ๐Ÿ“ Structured Logging: JSON-formatted logs for ELK, Splunk, CloudWatch integration
  • ๐Ÿณ Container Ready: Docker support with health check endpoints
  • โ˜ธ๏ธ Kubernetes: Liveness and readiness probe examples
  • ๐Ÿ” Audit Trail: Cryptographic SHA256 receipts with git provenance
  • โšก High Performance: <5 second validation for typical repositories
  • ๐ŸŽฏ Zero Technical Debt: No TODO/FIXME/HACK markers, production-grade code quality

See the Production Deployment Guide for details.


Quick Start

Installation

# Clone and install
git clone https://github.com/calebpruett927/UMCP-Metadata-Runnable-Code.git
cd UMCP-Metadata-Runnable-Code
python3.12 -m venv .venv
source .venv/bin/activate
pip install -e ".[production]"

Basic Usage

# Check system health
umcp health

# Validate repository (development mode)
umcp validate .

# Validate repository (production/strict mode)
umcp validate --strict

# Enable performance monitoring
umcp validate --strict --verbose

# Output validation receipt
umcp validate --strict --out validation-result.json

# Compare two receipts
umcp diff old-receipt.json new-receipt.json

JSON Logging for Production

# Enable structured JSON logs for monitoring systems
export UMCP_JSON_LOGS=1
umcp validate --strict --verbose 2>&1 | tee validation.log

Merge Verification

To verify that content has been successfully merged and the repository is in a healthy state, run:

./scripts/check_merge_status.sh

This script checks:

  • Git status (clean working tree)
  • Merge conflict artifacts
  • Test suite (all tests passing)
  • UMCP validator (CONFORMANT status)

For a detailed merge verification report, see MERGE_VERIFICATION.md.


Root-Level UMCP Files

In addition to CasePacks, this repository includes root-level UMCP configuration files for direct reference:

Configuration (YAML):

Data Files:

Outputs:

Integrity:

Programmatic Access

from umcp import get_umcp_files, get_closure_loader, get_root_validator

# Load any UMCP file
umcp = get_umcp_files()
manifest = umcp.load_manifest()
contract = umcp.load_contract()
invariants = umcp.load_invariants()

# Execute closures
loader = get_closure_loader()
result = loader.execute_closure("F_from_omega", omega=10.0, r=0.5, m=1.0)

# Validate system integrity
validator = get_root_validator()
validation_result = validator.validate_all()
print(f"Status: {validation_result['status']}")

See docs/file_reference.md and docs/interconnected_architecture.md for complete documentation.

Demonstration

Run the interconnected system demonstration:

python examples/interconnected_demo.py

CasePacks (runnable publication units)

A CasePack is a selfโ€‘contained folder under casepacks/<id>/ that holds:

  • manifest.json โ€“ Pins the contract ID, version, closure registry ID, and any explicit overrides.
  • raw_measurements.* โ€“ Inputs used to produce a bounded trace (optional for L0 examples).
  • expected/psi.csv โ€“ Bounded trace row(s) with out-of-range (OOR) and missingness flags.
  • expected/invariants.json โ€“ Tierโ€‘1 invariants (ฯ‰, F, S, C, ฯ„_R, ฮบ, IC) computed onย ฮจ_ฮต(t).
  • expected/ss1m_receipt.json โ€“ The minimum audit receipt for the run.
  • expected/seam_receipt.json โ€“ Only when continuity (weld) is claimed.

Example CasePack: casepacks/hello_world/


Quick start

All commands assume you are in the repository root (the folder containing pyproject.toml). Python 3.11 or later is required (3.12+ recommended).

Set up a virtual environment

Linux/macOS:

python3 -m venv .venv
source .venv/bin/activate
python -m pip install -U pip
pip install -e ".[test]"

---

## ๐Ÿ” Repository Structure

UMCP-Metadata-Runnable-Code/ โ”œโ”€โ”€ canon/ # Canonical anchors (specifications) โ”‚ โ”œโ”€โ”€ anchors.yaml # Core UMCP definitions โ”‚ โ”œโ”€โ”€ gcd_anchors.yaml # GCD Tier-1 specification โ”‚ โ””โ”€โ”€ rcft_anchors.yaml # RCFT Tier-2 specification โ”œโ”€โ”€ contracts/ # Frozen contracts โ”‚ โ”œโ”€โ”€ GCD.INTSTACK.v1.yaml # GCD Tier-1 contract โ”‚ โ””โ”€โ”€ RCFT.INTSTACK.v1.yaml # RCFT Tier-2 contract โ”œโ”€โ”€ closures/ # Computational functions โ”‚ โ”œโ”€โ”€ gcd/ # 4 GCD closures โ”‚ โ”‚ โ”œโ”€โ”€ energy_potential.py โ”‚ โ”‚ โ”œโ”€โ”€ entropic_collapse.py โ”‚ โ”‚ โ”œโ”€โ”€ generative_flux.py โ”‚ โ”‚ โ””โ”€โ”€ field_resonance.py โ”‚ โ”œโ”€โ”€ rcft/ # 3 RCFT closures โ”‚ โ”‚ โ”œโ”€โ”€ fractal_dimension.py โ”‚ โ”‚ โ”œโ”€โ”€ recursive_field.py โ”‚ โ”‚ โ””โ”€โ”€ resonance_pattern.py โ”‚ โ””โ”€โ”€ registry.yaml # Closure registry (all 7) โ”œโ”€โ”€ casepacks/ # Reproducible examples โ”‚ โ”œโ”€โ”€ hello_world/ # Zero entropy example โ”‚ โ””โ”€โ”€ rcft_complete/ # Full RCFT validation โ”œโ”€โ”€ schemas/ # JSON schemas (10 files) โ”œโ”€โ”€ tests/ # Test suite (221 tests) โ”œโ”€โ”€ docs/ # Documentation โ”‚ โ”œโ”€โ”€ rcft_theory.md # RCFT mathematical foundation โ”‚ โ””โ”€โ”€ rcft_usage.md # RCFT usage guide โ”œโ”€โ”€ scripts/ # Utility scripts โ”œโ”€โ”€ src/umcp/ # UMCP CLI and core โ”œโ”€โ”€ validator_rules.yaml # Validation rules โ””โ”€โ”€ pyproject.toml # Project config (v1.1.0)


---

## ๐Ÿ’ก Common Questions

**Q: What's the difference between GCD and RCFT?**
- **GCD (Tier-1)**: Energy, collapse, flux, resonance analysis
- **RCFT (Tier-2)**: Adds fractal, recursive, pattern analysis + all GCD

**Q: Can I use both frameworks together?**
- Yes! RCFT includes all GCD closures. Just specify `RCFT.INTSTACK.v1` as your contract.

**Q: How do I know which framework to use?**
- Use GCD for basic energy/collapse analysis
- Use RCFT when you need trajectory complexity, memory effects, or oscillation detection

**Q: What if my tests fail?**
- Check `validator_rules.yaml` for tolerance settings
- Verify your raw data format matches expected schema
- Run `umcp validate --verbose` for detailed error messages

**Q: How do I contribute new closures?**
- Add closure to `closures/` directory
- Register in `closures/registry.yaml`
- Add tests to `tests/`
- Update contract YAML if needed

**Q: Can I use UMCP without Python?**
- Core validation works with any language that can write JSON/CSV
- Closures are Python-based, but outputs are language-agnostic

---

## ๐Ÿšฆ CI/CD Integration

### GitHub Actions

```yaml
name: UMCP Validation
on: [push, pull_request]
jobs:
  validate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v4
        with:
          python-version: '3.12'
      - run: pip install -e ".[production]"
      - run: umcp health
      - run: pytest
      - run: umcp validate --strict

Docker

# Build container
docker build -t umcp:latest .

# Run validation
docker run -v $(pwd)/casepacks:/data umcp:latest validate /data/my_experiment

# Health check
docker run umcp:latest health

See Production Deployment for Kubernetes, monitoring, and enterprise setup.


๐Ÿ“Š Performance

  • Test Execution: 221 tests in ~7 seconds
  • Validation: <5 seconds for typical casepacks
  • Memory: <100MB for most operations
  • Scalability: Sublinear growth with test count

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Add tests for new functionality
  4. Ensure all tests pass (pytest)
  5. Validate code quality (ruff check, mypy)
  6. Commit changes (git commit -m 'feat: Add amazing feature')
  7. Push to branch (git push origin feature/amazing-feature)
  8. Open a Pull Request

See Python Coding Standards for style guide.


๐Ÿ“„ License

MIT License - see LICENSE for details.


๐Ÿ™ Acknowledgments

Framework: UMCP (Universal Measurement Contract Protocol)
Tier-1: GCD (Generative Collapse Dynamics)
Tier-2: RCFT (Recursive Collapse Field Theory)
Author: Clement Paulus
Version: 1.1.0
Tests: 221 passing (100% success)


๐Ÿ“ž Support


Built with โค๏ธ for reproducible science

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

umcp-1.3.1.tar.gz (74.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

umcp-1.3.1-py3-none-any.whl (38.4 kB view details)

Uploaded Python 3

File details

Details for the file umcp-1.3.1.tar.gz.

File metadata

  • Download URL: umcp-1.3.1.tar.gz
  • Upload date:
  • Size: 74.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for umcp-1.3.1.tar.gz
Algorithm Hash digest
SHA256 117ea4ad5a33e9f7c3c2d71dc5f6d3a7f5b5145c90d0914a506b8ac28962e76f
MD5 69575fb0968e9825f8b18ffa8651fa69
BLAKE2b-256 03605754071fa23009572dae51b599ea71cf10164a459998f8b44619a97a4c56

See more details on using hashes here.

File details

Details for the file umcp-1.3.1-py3-none-any.whl.

File metadata

  • Download URL: umcp-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 38.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for umcp-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fc60dd469144ad80de2bca899ed8dc9cdca76e271dbc43cbd1bac7039a6ea44b
MD5 7b5ae1bdcbf0b1cab446c30e1c0a2a2f
BLAKE2b-256 154e24c519d04b53e06a4241d4e1ac4cde99d732300d4ff3478aa37cedd8b150

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page