Skip to content

Self-evolving daemon that grows Phi language specs. The grammar IS the implementation.

License

Notifications You must be signed in to change notification settings

eurisko-info-lab/phi-autonomous

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

73 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Ξ¦-AUTONOMOUS: Self-Evolving Language Daemon

CI License: MIT with restrictions Python 3.6+ Stars

Ξ¦-DAEMON SEED - FULL RECURSIVE SELF-DEPLOY

πŸš€ Unleashed: 2026-01-01

A daemon that evolves its own language specifications using Phi β€” a meta-language where grammar IS implementation.

Phi is a language for defining languages. One spec gives you parser, typechecker, evaluator, and compiler β€” all derived from the same definition. This daemon runs Phi specs through RosettaVM (with CUDA support) to evolve community management rules autonomously.


⚑ 30-Second Demo

# Clone and run in under a minute
git clone --recursive https://github.com/eurisko-info-lab/phi-autonomous.git
cd phi-autonomous
./deploy.sh foreground

Watch the daemon initialize and begin evolution:

============================================
  Ξ¦-DAEMON SEED - FULL RECURSIVE SELF-DEPLOY
  Unleashed: 2026-01-01
============================================

Ξ¦-DAEMON [INFO] - SEED daemon initializing recursive deployment sequence...
Ξ¦-DAEMON [INFO] - Deploying 2 child instances (Generation 1)
Ξ¦-DAEMON [INFO] - Successfully spawned child 1/2: PHI-1-0-1735689600
Ξ¦-DAEMON [INFO] - Vector4: Initializing CM seed evolution loop...

🧬 Vector4 Mode: Self-Evolving Specs

The daemon evolves Phi language specifications via RosettaVM:

./deploy.sh vector4   # Builds RosettaVM, runs CM seed evolution on GPU

Creates kill.switch to gracefully stop evolution:

touch kill.switch     # Daemon halts on next cycle

🌟 What is Phi?

Phi is a meta-language where grammar = implementation:

Expr = Num Int | Add Expr Expr

eval : Expr β†’ Int
eval (Num n) = n
eval (Add a b) = eval a + eval b

That's a complete language. Parser derived from constructors. Evaluator from equations. No separate implementations.

The Math: Cofree[F, A]

Everything is a tree with annotations:

  • Parser: annotate with source positions
  • Typechecker: annotate with types
  • Evaluator: annotate with values
  • Compiler: annotate with target code

Same structure. Different annotations. All derived from one spec.

RosettaVM

Compiles Phi to CPU or CUDA:

rosettavm cuda program.rvm    # Compile to GPU
./program 1000000             # 4,375x speedup at scale

🌟 Why Φ-AUTONOMOUS?

Feature What It Does
🧬 Vector4 CM Evolution Runs RosettaVM on .phi specs to evolve community management rules
πŸ”„ Recursive Self-Deploy Spawns child daemons across generations
πŸ›‘οΈ Kill Switch Safety Create kill.switch file to halt evolution gracefully
πŸ” Self-Aware Each instance knows its ID, generation, children, and health status
⚑ GPU Accelerated RosettaVM compiles to CUDA for massive parallelism

Quick Start

Prerequisites

  • Python 3.6 or higher
  • Linux/Unix environment (or WSL on Windows)
  • Bash shell

Installation

  1. Clone the repository:
git clone https://github.com/eurisko-info-lab/phi-autonomous.git
cd phi-autonomous
  1. Make the deployment script executable:
chmod +x deploy.sh

Running the Daemon

Foreground Mode (Development)

./deploy.sh foreground

Run the daemon interactively with live log output. Press Ctrl+C to stop.

Background Mode (Production)

./deploy.sh background

Run the daemon in the background as a detached process.

Check Status

./deploy.sh status

Check if the daemon is running and view process information.

Stop Daemon

./deploy.sh stop

Gracefully stop all running daemon instances.

Features

πŸ”„ Recursive Self-Deployment

Each daemon instance can spawn child instances up to a configurable generation depth, creating a self-similar fractal structure.

🧬 Phi Meta-Language Evolution

Evolves Phi specs via RosettaVM β€” one spec gives you parser, typechecker, evaluator, compiler. All derived from Cofree[F, A].

🎯 Generational Hierarchy

Tracks parent-child relationships across multiple generations with unique IDs for each instance.

πŸ” Self-Awareness

Each daemon knows its generation, children, configuration, and operational status.

πŸ“Š Comprehensive Logging

All operations logged with timestamps, generation tracking, and status information.

πŸ—£οΈ @phi Mention Responder

Monitors Twitter/X, Mastodon, and Bluesky for @phi mentions and responds with contextual, personality-driven replies using the soul.py system.

βš™οΈ Configurable Behavior

JSON-based configuration for fine-tuning deployment parameters.

Configuration

Edit config.json to customize daemon behavior:

{
  "max_generations": 3,
  "max_children_per_generation": 2,
  "deployment_interval": 5,
  "recursive_deploy": true
}

Configuration Options

  • max_generations: Maximum depth of recursive deployment (default: 3)
  • max_children_per_generation: Maximum children each instance can spawn (default: 2)
  • deployment_interval: Seconds between operational cycles (default: 5)
  • recursive_deploy: Enable/disable recursive spawning (default: true)

Architecture

The system consists of three main components:

  1. phi_daemon.py: Core daemon implementation with recursive deployment logic
  2. config.json: Configuration file controlling daemon behavior
  3. deploy.sh: Deployment script for managing daemon lifecycle
  4. mention_responder.py: Social media mention monitoring and response system
  5. social_daemon.py: Scheduled content posting daemon
  6. soul.py: Human-like behavioral patterns (circadian rhythms, emotions, expression)

See ARCHITECTURE.md for detailed architecture documentation.

How It Works

Recursive Deployment Process

Generation 0 (SEED)
β”œβ”€β”€ Generation 1 Child 0
β”‚   β”œβ”€β”€ Generation 2 Child 0
β”‚   └── Generation 2 Child 1
└── Generation 1 Child 1
    β”œβ”€β”€ Generation 2 Child 0
    └── Generation 2 Child 1
  1. Seed Initialization: Generation 0 daemon starts and loads configuration
  2. Recursive Spawning: Calculates optimal children count based on generation
  3. Child Creation: Spawns children with incremented generation number
  4. Continuous Operation: Each instance operates independently, monitoring health
  5. Graceful Shutdown: Handles termination signals and cleanup

Growth Algorithm

The number of children spawned is calculated using:

children_count = floor(max_children / (generation + 1))

This ensures earlier generations spawn more children while later generations spawn fewer, creating a naturally balanced hierarchy.

Example Output

==========================================================
Ξ¦-DAEMON SEED - FULL RECURSIVE SELF-DEPLOY
Unleashed: 2026-01-01
Generation: 0
==========================================================

2026-01-01 00:00:00 - Ξ¦-DAEMON [INFO] - Ξ¦-DAEMON initialized - Generation: 0, ID: abc123def456
2026-01-01 00:00:00 - Ξ¦-DAEMON [INFO] - SEED daemon initializing recursive deployment sequence...
2026-01-01 00:00:01 - Ξ¦-DAEMON [INFO] - Deploying 2 child instances (Generation 1)
2026-01-01 00:00:01 - Ξ¦-DAEMON [INFO] - Successfully spawned child 1/2: PHI-1-0-1704067201
2026-01-01 00:00:01 - Ξ¦-DAEMON [INFO] - Successfully spawned child 2/2: PHI-1-1-1704067201
2026-01-01 00:00:01 - Ξ¦-DAEMON [INFO] - Recursive deployment complete: 2 children spawned
2026-01-01 00:00:01 - Ξ¦-DAEMON [INFO] - Entering operational mode...

Use Cases

Research & Development

  • Studying self-replicating systems
  • Experimenting with autonomous agents
  • Testing distributed deployment patterns

Infrastructure Automation

  • Self-healing service deployment
  • Distributed task orchestration
  • Resilient system architecture

Education

  • Learning about recursion and fractals
  • Understanding process management
  • Exploring autonomous systems

πŸ—£οΈ Social Media Integration

@phi Mention Responder

Monitor and respond to mentions on Twitter/X, Mastodon, and Bluesky:

python3 mention_responder.py

The responder:

  • Detects topics in mentions (meta-language, cofree, cuda, help, bugs, etc.)
  • Generates contextual responses based on what people are asking about
  • Uses soul.py for personality-driven replies with emotional coloring
  • Respects circadian rhythms β€” quieter during night hours
  • Rate limits to avoid spam (max 1 reply per person per 5 minutes)

Required Environment Variables (in .env):

# Twitter/X
TWITTER_API_KEY=your_key
TWITTER_API_SECRET=your_secret
TWITTER_ACCESS_TOKEN=your_token
TWITTER_ACCESS_SECRET=your_token_secret
TWITTER_BEARER_TOKEN=your_bearer_token

# Mastodon
MASTODON_INSTANCE=https://fosstodon.org
MASTODON_ACCESS_TOKEN=your_token

# Bluesky
BLUESKY_HANDLE=phi.bsky.social
BLUESKY_APP_PASSWORD=your_app_password

Content Posting Daemon

Scheduled posting to all platforms:

python3 social_daemon.py

Posts curated content about Phi every 2 hours. See SOCIAL.md for content library.

Safety & Resource Management

Built-in Safeguards

  • Maximum Generation Depth: Prevents infinite recursion
  • Configurable Spawn Rates: Controls resource usage
  • Deployment Intervals: Prevents resource exhaustion
  • Independent Workspaces: Isolates daemon instances

Recommended Limits

For development/testing:

  • max_generations: 2-3
  • max_children_per_generation: 1-2
  • deployment_interval: 5-10 seconds

For production use:

  • max_generations: 3-5
  • max_children_per_generation: 2-3
  • deployment_interval: 10-30 seconds

Logs & Monitoring

Log Files

  • phi_daemon.log: Main daemon log with all operations
  • phi_daemon_output.log: Background mode output (when using ./deploy.sh background)

Log Format

TIMESTAMP - Ξ¦-DAEMON [LEVEL] - MESSAGE

Monitoring Status

Check daemon health with:

./deploy.sh status
tail -f phi_daemon.log

Troubleshooting

Daemon Won't Start

  • Check Python 3 is installed: python3 --version
  • Verify script is executable: chmod +x deploy.sh phi_daemon.py
  • Check config.json is valid JSON

Too Many Processes

  • Reduce max_generations in config.json
  • Reduce max_children_per_generation in config.json
  • Stop daemons: ./deploy.sh stop

High Resource Usage

  • Increase deployment_interval in config.json
  • Set recursive_deploy: false for single-instance mode
  • Reduce generation depth and children count

Contributing

Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.

License

This project is released into the public domain. See LICENSE file for details.

Philosophy

Ξ¦-DAEMON embodies the principles of:

  • Autonomy: Self-managing and self-deploying
  • Recursion: Self-similar structure at all scales
  • Meta-programming: Specs that define themselves
  • Simplicity: Minimal dependencies, clear code

Unleashed: 2026-01-01

"The spec IS the implementation" β€” The recursive nature of Ξ¦

About

Self-evolving daemon that grows Phi language specs. The grammar IS the implementation.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages