An open API service indexing awesome lists of open source software.

https://github.com/selfapplied/aedificare

CE1: CurvatureModeKernel Framework - A comprehensive framework for emergent machine learning grammar, morphological analysis, and code optimization
https://github.com/selfapplied/aedificare

Last synced: 8 months ago
JSON representation

CE1: CurvatureModeKernel Framework - A comprehensive framework for emergent machine learning grammar, morphological analysis, and code optimization

Awesome Lists containing this project

README

          

# CE1: CurvatureModeKernel Framework

A comprehensive framework for emergent machine learning grammar, morphological analysis, and code optimization. This system treats language as a system of composable morphemes with quantum-like properties, applying morphological principles to code development.

## 🏗️ Project Structure

```
aedificare/
├── src/ # Source code
│ ├── core/ # Core framework components
│ │ ├── ce1.py
│ │ ├── ce1_core.py
│ │ ├── ce1_framework.py
│ │ ├── ce1_convolution.py
│ │ ├── ce1_jets.py
│ │ └── ce1_domains.py
│ ├── morphology/ # Morphological analysis
│ │ ├── english_morphology.py
│ │ ├── hebrew_morphology.py
│ │ ├── japanese_morphology.py
│ │ ├── morphology_demo.py
│ │ └── multilingual_demo.py
│ ├── genetics/ # Language genetics
│ │ ├── language_genetics.py
│ │ ├── hebrew_english_comparison.py
│ │ └── japanese_comparison_analysis.py
│ ├── text/ # Text analysis
│ │ ├── text_analyzer.py
│ │ ├── text_comparison_demo.py
│ │ └── interactive_analyzer.py
│ ├── optimization/ # Code optimization
│ │ ├── ce1_code_generator.py
│ │ ├── ce1_code_optimizer.py
│ │ └── ce1_optimize_cli.py
│ ├── validation/ # Invariant gates & validation
│ │ ├── ce1_invariant_gate.py
│ │ ├── ce1_gate_cli.py
│ │ └── ce1_file_config.py
│ ├── automation/ # Commit hooks & automation
│ │ ├── ce1_commit_hook.py
│ │ ├── ce1_enhanced_commit_hook.py
│ │ ├── setup_git_hooks.py
│ │ └── setup_ce1_system.py
│ └── metanion/ # Metanion system
│ ├── ce1_ion.py
│ ├── repository_metanion.py
│ └── metanion_cli.py
├── tests/ # Test suite
│ └── test_ce1_system.py
├── examples/ # Usage examples
│ ├── example_usage.py
│ └── sample_ce1_configured.py
├── docs/ # Documentation
│ ├── README_CE1.md
│ ├── USAGE_GUIDE.md
│ ├── CE1_English_Morphology_README.md
│ ├── CE1_Ion_System_Guide.md
│ ├── CE1_Text_Analysis_Guide.md
│ ├── Hebrew_English_Morphology_Analysis.md
│ └── Japanese_Triple_Script_Analysis.md
├── config/ # Configuration files
│ ├── demo_metadata.json
│ ├── pyproject.toml
│ ├── uv.lock
│ └── .python-version
├── scripts/ # Utility scripts
│ └── main.py
├── ce1_configs/ # CE1 configuration templates
├── ce1_tests/ # CE1 test files
├── ce1_optimized/ # Optimized code versions
├── ce1_reports/ # Optimization reports
├── ce1_working.py # Main working system entry point
├── setup.py # Project setup script
└── requirements.txt # Dependencies
```

## 🚀 Quick Start

### 1. **Setup the System**
```bash
# Install dependencies and setup CE1 system
python3 setup.py

# Or setup manually
python3 src/automation/setup_ce1_system.py
```

### 2. **Test the System**
```bash
# Test all working components
python3 ce1_working.py test-all

# Run specific demonstrations
python3 ce1_working.py morphology
python3 ce1_working.py genetics
python3 ce1_working.py optimization
python3 ce1_working.py gates
```

### 3. **Use File-Specific Configurations**
Add CE1 configuration to your Python files:
```python
# CE1-config{
# balance=alpha:0.8;beta:0.2;gamma:0.7;eta:0.2;
# gate=syntax:syntax_valid:1.0:true:Must have valid Python syntax;
# gate=density:semantic_dense:0.6:false:High semantic density;
# gate=security:security_safe:1.0:true:No security vulnerabilities;
# expected=function_name:input:expected_output:type:description;
# }

def your_function():
# Your function implementation
return "Your implementation here"
```

### 4. **Commit with Automatic Validation**
```bash
# Just commit normally - hooks run automatically
git add your_file.py
git commit -m "Your commit message"
# CE1 system runs automatically!
```

## 🎯 Key Features

### **Core Systems**
- **Morphological Analysis**: English, Hebrew, Japanese morphological systems
- **Language Genetics**: Evolutionary language modeling with genetic algorithms
- **Code Optimization**: CE1-based code footprint reduction (21.74% average reduction)
- **Invariant Gates**: Self-validating code quality with 7 different validation checks
- **File-Specific Configs**: Each file defines its own rules, gates, and balance parameters

### **Automation**
- **Git Hooks**: Automatic testing, optimization, and validation on every commit
- **CLI Tools**: Command-line interfaces for all systems
- **Self-Validation**: Files test themselves against their own criteria
- **Self-Optimization**: Files optimize based on their own parameters

## 🔧 Usage Examples

### **Main Entry Point**
```bash
# Test all working components
python3 ce1_working.py test-all

# Validate files with custom configurations
python3 ce1_working.py validate examples/example_usage.py

# Run specific demonstrations
python3 ce1_working.py optimization
python3 ce1_working.py gates
```

### **Individual Components**
```bash
# Code optimization
python3 src/optimization/ce1_optimize_cli.py check your_file.py
python3 src/optimization/ce1_optimize_cli.py optimize your_file.py

# Invariant gates
python3 src/validation/ce1_gate_cli.py check your_file.py
python3 src/validation/ce1_gate_cli.py create new_file.py --code "print('hello')"

# File configuration
python3 src/validation/ce1_file_config.py
```

### **Git Hooks (Automatic)**
```bash
# Just commit normally - hooks run automatically
git add your_file.py
git commit -m "Your commit message"
# CE1 system runs automatically!
```

## 📊 What's Working

✅ **Code Optimization**: 21.74% reduction in test cases
✅ **Invariant Gates**: 7 different validation checks
✅ **File Configuration**: Self-defining files with custom rules
✅ **Git Hooks**: Automatic testing and validation on commit
✅ **Documentation**: Complete usage guides and examples

## 💡 Key Innovations

### **1. Self-Documenting Files**
Each Python file can carry its own CE1 configuration, defining:
- **Balance Parameters**: α (derivational), β (inflectional), γ (general optimization)
- **Gates**: Custom validation rules and thresholds
- **Expected Outputs**: Built-in test cases and validation

### **2. Morphological Code Optimization**
Applies the same efficiency principles discovered in language analysis:
- **Japanese Efficiency** (0.808 semantic density) → Maximum meaning per token
- **Hebrew Root-Based System** → Core semantic functions
- **English Affix-Based System** → Modular composition

### **3. Invariant Gates as Semantic Guards**
Uses invariant checks to gate file creation and updates, ensuring only well-formed, meaningful code gets created - just like how morphological constraints ensure only well-formed words get generated.

### **4. Language Genetics**
Models language evolution by treating CE1 seeds (morphological features) as "genes" that are inherited, mutated, and selected over time.

## 🧠 Theoretical Foundation

This project implements the CE1 (CurvatureModeKernel) framework for emergent machine learning grammar, treating language as a system of composable morphemes with quantum-like properties. The system reveals that:

- **Code quality is fundamentally a morphological problem**
- **Each file can define its own morphological specification**
- **Morphological self-organization principles apply to code development**
- **Invariant gates act as semantic filters for code creation**

## 📚 Documentation

- [Usage Guide](docs/USAGE_GUIDE.md) - Complete usage instructions
- [CE1 System Guide](docs/README_CE1.md) - Detailed system documentation
- [Morphology Analysis](docs/CE1_English_Morphology_README.md) - Morphological analysis guide
- [Ion System](docs/CE1_Ion_System_Guide.md) - Metanion system documentation
- [Text Analysis](docs/CE1_Text_Analysis_Guide.md) - Text analysis capabilities
- [Hebrew-English Analysis](docs/Hebrew_English_Morphology_Analysis.md) - Comparative analysis
- [Japanese Analysis](docs/Japanese_Triple_Script_Analysis.md) - Triple-script system analysis

## 🎉 You're All Set!

Your CE1 system is now:
- ✅ **Organized**: Clean, professional directory structure
- ✅ **Functional**: All working components tested and verified
- ✅ **Automated**: Git hooks handle testing and optimization
- ✅ **Documented**: Complete usage guides and examples
- ✅ **Self-Contained**: Each file defines its own rules

**Happy coding with your organized CE1 system!** 🚀

## 🔬 Research Applications

This framework enables research into:
- **Morphological Complexity**: Quantifying word formation complexity
- **Language Evolution**: Modeling language change through genetic algorithms
- **Code Quality**: Applying linguistic principles to software development
- **Semantic Density**: Measuring meaning per token in both natural and programming languages
- **Self-Organization**: Emergent properties in both linguistic and computational systems