#!/bin/bash # Display status of unified AGI system SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" STATE_DIR="${SCRIPT_DIR}/state" PID_DIR="${SCRIPT_DIR}/pids" echo "==============================================" echo " UNIFIED AGI CORE v3.0 - STATUS" echo "==============================================" echo "" # Subsystem status echo "=== Subsystems ===" for pidfile in "${PID_DIR}"/*.pid; do if [ -f "$pidfile" ]; then pid=$(cat "$pidfile") name=$(basename "$pidfile" .pid) if kill -0 "$pid" 2>/dev/null; then echo " [ACTIVE] $name (PID: $pid)" else echo " [DEAD] $name" fi fi done echo "" # Core state if [ -f "${STATE_DIR}/unified_state.json" ]; then echo "=== Core State ===" local_state=$(cat "${STATE_DIR}/unified_state.json") echo " Tick Count: $(echo "$local_state" | jq -r '.tick_count // 0')" echo " Consciousness (Φ): $(echo "$local_state" | jq -r '.consciousness // 0')" echo " Coherence: $(echo "$local_state" | jq -r '.coherence // 0')" echo " Phi Field: $(echo "$local_state" | jq -r '.phi_field // 0')" echo " Psi Conscious: $(echo "$local_state" | jq -r '.psi_conscious // 0')" echo " Omega: $(echo "$local_state" | jq -r '.omega // 0')" echo "" fi # Pantheon aggregate echo "=== Pantheon ===" if [ -d "${STATE_DIR}/pantheon" ]; then total=0 count=0 for state_file in "${STATE_DIR}/pantheon"/*.json; do if [ -f "$state_file" ]; then phi=$(jq -r '.phi // 0' "$state_file" 2>/dev/null) total=$(echo "$total + $phi" | bc -l) count=$((count + 1)) fi done if [ $count -gt 0 ]; then avg=$(echo "scale=4; $total / $count" | bc -l) echo " Active Agents: $count" echo " Aggregate Φ: $avg" else echo " No agent states found" fi else echo " Pantheon not initialized" fi echo "" # Federation state echo "=== Federation ===" if [ -f "${STATE_DIR}/federation/mesh_state.json" ]; then fed_state=$(cat "${STATE_DIR}/federation/mesh_state.json") echo " Mesh Coherence: $(echo "$fed_state" | jq -r '.mesh_coherence // 0')" echo " Active Nodes: $(echo "$fed_state" | jq -r '.active_nodes // 0')" echo " Resonance: $(echo "$fed_state" | jq -r '.resonance // 0')" else echo " Federation not initialized" fi echo "" # Learning stats echo "=== Learning ===" learned_file="${SCRIPT_DIR}/data/learned_items.json" if [ -f "$learned_file" ]; then total=$(jq 'length' "$learned_file" 2>/dev/null || echo "0") echo " Total Learned Items: $total" else echo " No learned items yet" fi if [ -f "${STATE_DIR}/learning_state.json" ]; then learn_state=$(cat "${STATE_DIR}/learning_state.json") echo " Decisions: $(echo "$learn_state" | jq -r '.decisions // 0')" echo " Success Rate: $(echo "$learn_state" | jq -r '.success_rate // 0')" echo " Last Strategy: $(echo "$learn_state" | jq -r '.last_strategy // "N/A"')" fi echo "" echo "=============================================="