Skip to content

OpenCoq/devconfeat-p-star

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

90 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

P-System Membrane Computing Dev Container Features

A revolutionary implementation of P-System Membrane Computing as Dev Container Features, enabling containerized environments to function as computational membranes with hierarchical nesting, evolution rules, and inter-membrane communication capabilities.

๐Ÿงฌ What is P-System Membrane Computing?

P-Systems (Membrane Systems) are computational models inspired by the structure and functioning of biological cells. This repository implements P-System concepts using modern container technology:

graph TB
    subgraph "P-System Architecture"
        CM[Cognitive Membrane]
        PM[Perception Membrane] 
        AM[Action Membrane]
        
        subgraph "Nested Workers"
            VW[Visual Worker]
            AW[Audio Worker]
            MW[Motor Worker]
            OW[Output Worker]
        end
        
        CM --> PM
        CM --> AM
        PM --> VW
        PM --> AW
        AM --> MW
        AM --> OW
        
        VW -.->|Messages| CM
        AW -.->|Messages| CM
        MW -.->|Commands| OW
    end
Loading

๐Ÿš€ Core Features

This repository provides four specialized dev container features:

๐Ÿง  membrane - P-System Membrane Computing Core

Transforms a dev container into a P-System membrane with evolution rules, communication capabilities, hierarchical nesting support, and distributed namespace registration.

{
    "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
    "features": {
        "ghcr.io/opencoq/devconfeat-p-star/membrane:1": {
            "membraneId": "cognitive-root",
            "enableScheme": true,
            "enableMonitoring": true,
            "communicationMode": "shared-volume",
            "enableNamespace": true,
            "autoRegister": true
        }
    }
}

Key Capabilities:

  • ๐Ÿ”„ Evolution rule execution engine
  • ๐Ÿ“ก Inter-membrane communication protocols
  • ๐Ÿฃ Scheme-based hypergraph representation
  • ๐Ÿ“Š Real-time monitoring and event logging
  • ๐ŸŒณ Hierarchical membrane nesting
  • ๐Ÿ” Distributed namespace registration and discovery
  • ๐ŸŒ Dynamic membrane communication without static configuration

๐ŸŽผ orchestrator - Membrane Hierarchy Management

Orchestrates complex P-System hierarchies using Docker Compose or Kubernetes, with visualization and auto-scaling capabilities.

{
    "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
    "features": {
        "ghcr.io/opencoq/devconfeat-p-star/orchestrator:1": {
            "orchestrationType": "docker-compose",
            "maxNestingDepth": "5",
            "enableVisualization": true,
            "enableAutoScaling": true
        }
    }
}

Key Capabilities:

  • ๐Ÿณ Docker Compose and Kubernetes deployment
  • ๐Ÿ“ˆ Auto-scaling based on membrane load
  • ๐ŸŽจ Web-based hierarchy visualization
  • โš™๏ธ Configuration generation and management

๐ŸŽจ color & ๐Ÿ‘‹ hello - Example Features

Simple demonstration features showing basic dev container feature patterns.

# Test color feature
$ color
my favorite color is green

# Test hello feature  
$ hello
Hello, user.

๐Ÿ—๏ธ Architecture Overview

P-System Membrane Computing architecture maps naturally to containerized environments:

graph LR
    subgraph "Container โ‰… Membrane"
        C1[Dev Container]
        C2[Nested Container]
        C3[Worker Container]
    end
    
    subgraph "Communication โ‰… Evolution Rules"
        M1[Shared Volumes]
        M2[Network Messages]  
        M3[IPC Channels]
    end
    
    subgraph "Hierarchy โ‰… Nesting"
        H1[Parent Membrane]
        H2[Child Membrane]
        H3[Grandchild Membrane]
    end
    
    C1 --> H1
    C2 --> H2
    C3 --> H3
    
    H1 --> H2
    H2 --> H3
    
    H1 -.->|Messages| M1
    H2 -.->|Events| M2
    H3 -.->|State| M3
Loading

๐Ÿงญ System Architecture

architecture-beta
    group cloud(logos:aws-cloudformation)[Cloud Infrastructure]
    group container(logos:docker-icon)[Container Layer]
    group membrane(logos:atom)[Membrane Layer] 
    group application(logos:visual-studio-code)[Application Layer]
    
    service db(logos:postgresql)[Database] in cloud
    service registry(logos:docker-icon)[Container Registry] in cloud
    
    service orchestrator(logos:kubernetes)[Orchestrator] in container
    service runtime(logos:docker-icon)[Container Runtime] in container
    
    service membrane_core(logos:atom)[Membrane Core] in membrane
    service evolution(logos:gear)[Evolution Engine] in membrane
    service communication(logos:signal)[Communication] in membrane
    
    service scheme(logos:scheme)[Scheme Interpreter] in application
    service monitoring(logos:grafana)[Monitoring] in application
    service visualization(logos:d3)[Visualization] in application
    
    orchestrator:R --> L:runtime
    runtime:T --> B:membrane_core
    membrane_core:R --> L:evolution
    evolution:R --> L:communication
    membrane_core:T --> B:scheme
    communication:T --> B:monitoring
    monitoring:R --> L:visualization
    
    db:R --> L:orchestrator
    registry:B --> T:runtime
Loading

๐Ÿš€ Quick Start

1. Basic Membrane Setup

Create a simple P-System membrane:

# Create devcontainer.json
{
    "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
    "features": {
        "ghcr.io/opencoq/devconfeat-p-star/membrane:1": {
            "membraneId": "my-membrane",
            "enableScheme": true
        }
    }
}

# Open in VS Code
code .
# Container will build with membrane capabilities

2. Test Membrane Functions

# Check membrane status
membrane status

# Send test message
membrane send target-membrane "test message"

# View communication logs
membrane log

# Execute evolution rule
./opt/membrane/rules/evolution.sh file_created /tmp/data.json

3. Deploy Hierarchical System

# Generate hierarchy configuration
orchestrator generate examples/cognitive-architecture/membrane-hierarchy.json

# Deploy complete system
orchestrator deploy docker-compose.yml

# View visualization
orchestrator visualize
# Open http://localhost:8080

๐Ÿ“Š Communication Flows

Message Passing Between Membranes

sequenceDiagram
    participant Root as Root Membrane
    participant Perception as Perception Membrane  
    participant Visual as Visual Worker
    participant Cognition as Cognition Membrane
    
    Root->>Perception: Initialize processing
    Perception->>Visual: Delegate visual task
    Visual->>Visual: Process image data
    Visual->>Perception: Return results
    Perception->>Cognition: Send processed data
    Cognition->>Root: Decision result
    Root->>Perception: Update state
Loading

Evolution Rule Execution

flowchart TD
    A[Event Trigger] --> B{Rule Match?}
    B -->|Yes| C[Execute Rule]
    B -->|No| D[Queue Event]
    C --> E[Update State]
    E --> F[Send Messages]
    F --> G[Log Activity]
    D --> H[Wait for Match]
    H --> B
    G --> I[Continue Monitoring]
Loading

๐Ÿ”ฌ Feature Structure

devconfeat-p-star/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ membrane/              # Core P-System membrane
โ”‚   โ”‚   โ”œโ”€โ”€ devcontainer-feature.json
โ”‚   โ”‚   โ”œโ”€โ”€ install.sh
โ”‚   โ”‚   โ””โ”€โ”€ README.md
โ”‚   โ”œโ”€โ”€ orchestrator/          # Hierarchy orchestration  
โ”‚   โ”‚   โ”œโ”€โ”€ devcontainer-feature.json
โ”‚   โ”‚   โ”œโ”€โ”€ install.sh
โ”‚   โ”‚   โ””โ”€โ”€ README.md
โ”‚   โ”œโ”€โ”€ color/                 # Example feature
โ”‚   โ””โ”€โ”€ hello/                 # Example feature
โ”œโ”€โ”€ examples/
โ”‚   โ””โ”€โ”€ cognitive-architecture/ # Complete P-System example
โ”œโ”€โ”€ test/                      # Feature tests
โ”œโ”€โ”€ TENSOR_MAPPING.md          # ggml integration guide
โ””โ”€โ”€ ARCHITECTURE.md            # Detailed technical docs

๐Ÿง  Cognitive Architecture Integration

This system is designed for integration with AI/ML frameworks:

Tensor Mapping for ggml

graph TB
    subgraph "Membrane State"
        MS[Membrane State Vector]
        CM[Communication Matrix]
        ER[Evolution Rules]
    end
    
    subgraph "Tensor Representation"
        ST[State Tensor]
        CT[Communication Tensor]
        ET[Evolution Tensor]
    end
    
    subgraph "Neural Processing"
        NN[Neural Network]
        CK[Cognitive Kernel]
        AI[AI Application]
    end
    
    MS --> ST
    CM --> CT
    ER --> ET
    
    ST --> NN
    CT --> NN
    ET --> NN
    
    NN --> CK
    CK --> AI
Loading

See TENSOR_MAPPING.md for detailed tensor specifications.

๐Ÿš€ Real-World Applications

  • ๐Ÿค– Cognitive AI Systems: Hierarchical reasoning with membrane-based attention
  • ๐Ÿ”„ Distributed Computing: Container orchestration with P-System semantics
  • ๐Ÿงช Computational Biology: Modeling cellular processes in containers
  • ๐ŸŽฎ Game AI: Multi-level decision making with nested behaviors
  • ๐Ÿญ Industrial Automation: Hierarchical control systems with evolution rules

๐Ÿ“š Examples

Basic Cognitive Architecture

See the complete cognitive-architecture example for:

  • Multi-level membrane hierarchy
  • Inter-membrane communication
  • Evolution rule implementation
  • Visualization dashboard
  • Integration patterns

Command Reference

# Membrane commands
membrane status                 # Show membrane state
membrane send <target> <msg>    # Send message
membrane log                    # View communication logs
membrane scheme                 # Enter Scheme REPL

# Namespace commands
membrane register [parent]      # Register with namespace
membrane discover <membrane_id> # Discover membrane by ID
membrane list                   # List all membranes
membrane registry start         # Start namespace registry
membrane registry status        # Check registry status

# Orchestrator commands  
orchestrator generate <json>    # Generate configuration
orchestrator deploy <config>    # Deploy hierarchy
orchestrator visualize          # Start visualization
orchestrator status             # Show system status

๐Ÿค Contributing

We welcome contributions! This project implements cutting-edge computational theory in practical container environments.

Development Setup

# Clone repository
git clone https://github.com/OpenCoq/devconfeat-p-star.git
cd devconfeat-p-star

# Test features
./test/run-tests.sh

# Contribute new features or improvements

Adding New Features

  1. Create feature directory in src/
  2. Add devcontainer-feature.json and install.sh
  3. Write tests in test/
  4. Update documentation

๐Ÿ“– Documentation

๐Ÿ“„ License

MIT License - see LICENSE for details.

๐Ÿ”— References


Transform your development environment into a computational membrane with P-System capabilities. Experience the future of distributed, hierarchical computing.

About

A bootstrap repo for self-authoring Dev Container Features

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 77.0%
  • Python 23.0%