Skip to content

chore: remove accidentally committed backup file #405

chore: remove accidentally committed backup file

chore: remove accidentally committed backup file #405

name: "🌌 LIVE - Quantum Python Auto-Switch Test"
on:
push:
branches: [ development ]
pull_request:
branches: [ development ]
workflow_dispatch:
jobs:
test-quantum-switch:
runs-on: ubuntu-latest
services:
redis:
image: redis:7
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e . redis
- name: Configure omnipkg and Establish Authoritative ENV_ID
id: setup_omnipkg
run: |
python - << 'EOF'
import json
import os
from pathlib import Path
from omnipkg.core import ConfigManager
config_dir = Path.home() / '.config' / 'omnipkg'
config_dir.mkdir(parents=True, exist_ok=True)
config = {
"interactive": False,
"auto_confirm": True,
"redis_url": "redis://localhost:6379"
}
with open(config_dir / 'config.json', 'w') as f:
json.dump(config, f, indent=2)
print("✅ Omnipkg configured for non-interactive use")
main_env_id = ConfigManager().env_id
print(f"Authoritative Environment ID for this job: {main_env_id}")
with open(os.environ['GITHUB_ENV'], 'a') as f:
f.write(f"OMNIPKG_ENV_ID_OVERRIDE={main_env_id}\n")
EOF
- name: Adopt and Switch to Python 3.14
env:
OMNIPKG_ENV_ID_OVERRIDE: ${{ env.OMNIPKG_ENV_ID_OVERRIDE }}
run: |
echo "--- Adopting Python 3.14 ---"
mkdir -p /tmp/omnipkg-artifacts
# FIX: Removed -y (unrecognized argument). Non-interactive config handles this.
omnipkg python adopt 3.14 2>&1 | tee /tmp/omnipkg-artifacts/adopt_314.txt
echo "## Python 3.14 Adoption Output" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat /tmp/omnipkg-artifacts/adopt_314.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "--- Switching to Python 3.14 ---"
# FIX: Removed -y
omnipkg swap python 3.14 2>&1 | tee /tmp/omnipkg-artifacts/swap_to_314.txt
echo "## Swap to Python 3.14 Output" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat /tmp/omnipkg-artifacts/swap_to_314.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
# Verify we're on 3.14 - check the full output for "3.14"
PYTHON_INFO=$(omnipkg info python 2>/dev/null)
echo "Python info output:"
echo "$PYTHON_INFO"
if echo "$PYTHON_INFO" | grep -q "Active Context:.*3.14" || \
echo "$PYTHON_INFO" | grep -q "Python 3.14.*currently active"; then
echo "✅ Successfully switched to Python 3.14"
else
echo "⚠️ Could not verify from info output, but swap command succeeded"
echo "Proceeding with test..."
fi
- name: Attempt to Install TensorFlow (Should Auto-Adopt 3.13 + Auto-Switch)
env:
OMNIPKG_ENV_ID_OVERRIDE: ${{ env.OMNIPKG_ENV_ID_OVERRIDE }}
run: |
echo "--- Attempting to install TensorFlow on Python 3.14 (incompatible) ---"
echo "This should trigger Quantum Healing, auto-adopt Python 3.13, and auto-switch to it..."
# This is the first command requiring a daemon.
# It will trigger the auto-start and relaunch logic.
# FIX: Removed -y
timeout 900 bash -c 'omnipkg install tensorflow' 2>&1 | tee /tmp/omnipkg-artifacts/tensorflow_install.txt
# PIPESTATUS[0] captures the exit code of omnipkg, not tee.
INSTALL_EXIT_CODE=${PIPESTATUS[0]}
echo "## TensorFlow Installation Output" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat /tmp/omnipkg-artifacts/tensorflow_install.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
# Check for quantum healing activation
if grep -q "QUANTUM HEALING: Python Incompatibility Detected" /tmp/omnipkg-artifacts/tensorflow_install.txt; then
echo "✅ Quantum Healing was triggered!"
else
echo "❌ Quantum Healing was NOT triggered!"
exit 1
fi
# Check for auto-switch to Python 3.13
if grep -q "Swapping active context to Python 3.13" /tmp/omnipkg-artifacts/tensorflow_install.txt || \
grep -q "Successfully switched omnipkg context to Python 3.13" /tmp/omnipkg-artifacts/tensorflow_install.txt; then
echo "✅ Auto-switched to Python 3.13!"
else
echo "❌ Did not auto-switch to Python 3.13!"
exit 1
fi
# Check for successful installation
if grep -q "All package operations complete" /tmp/omnipkg-artifacts/tensorflow_install.txt || \
grep -q "Retrying in new Python 3.13 context" /tmp/omnipkg-artifacts/tensorflow_install.txt; then
echo "✅ Installation completed successfully!"
else
echo "⚠️ Installation may not have completed fully"
fi
- name: Verify Final State
env:
OMNIPKG_ENV_ID_OVERRIDE: ${{ env.OMNIPKG_ENV_ID_OVERRIDE }}
run: |
echo "--- Verifying final state ---"
# Check current Python version - be more flexible with verification
FINAL_INFO=$(omnipkg info python 2>/dev/null)
echo "Final Python info:"
echo "$FINAL_INFO"
if echo "$FINAL_INFO" | grep -q "Active Context:.*3.13" || \
echo "$FINAL_INFO" | grep -q "Python 3.13.*currently active"; then
echo "✅ Confirmed: Now running on Python 3.13"
else
echo "⚠️ Could not verify exact version from info output"
echo "Checking if TensorFlow install succeeded as alternative verification..."
fi
# FIX: Removed -y
omnipkg info tensorflow 2>&1 | tee /tmp/omnipkg-artifacts/tensorflow_info.txt
if grep -q "Active Version:" /tmp/omnipkg-artifacts/tensorflow_info.txt; then
echo "✅ TensorFlow is installed and active!"
else
echo "⚠️ TensorFlow installation could not be verified"
fi
echo "## Final State Verification" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat /tmp/omnipkg-artifacts/tensorflow_info.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
- name: Test TensorFlow Import
env:
OMNIPKG_ENV_ID_OVERRIDE: ${{ env.OMNIPKG_ENV_ID_OVERRIDE }}
run: |
echo "--- Testing TensorFlow import ---"
PYTHON_INFO=$(omnipkg info python 2>/dev/null)
PYTHON_313_EXE=$(echo "$PYTHON_INFO" | grep 'Python 3.13:' | awk '{print $4}' || echo "")
if [ -n "$PYTHON_313_EXE" ]; then
echo "Testing TensorFlow import on Python 3.13..."
if "$PYTHON_313_EXE" -c "import tensorflow as tf; print(f'TensorFlow version: {tf.__version__}')" 2>&1 | tee /tmp/omnipkg-artifacts/tensorflow_import.txt; then
echo "✅ TensorFlow imports successfully!"
else
echo "❌ TensorFlow import failed!"
exit 1
fi
else
echo "⚠️ Could not find Python 3.13 executable"
exit 1
fi
- name: Generate Test Summary
if: always()
run: |
echo "## 🌌 Quantum Python Auto-Switch Test Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Test Scenario" >> $GITHUB_STEP_SUMMARY
echo "1. Manually adopted and swapped to Python 3.14" >> $GITHUB_STEP_SUMMARY
echo "2. Attempted to install TensorFlow (incompatible with Python 3.14)" >> $GITHUB_STEP_SUMMARY
echo "3. Omnipkg detected incompatibility via Quantum Healing" >> $GITHUB_STEP_SUMMARY
echo "4. **Auto-adopted Python 3.13** and **auto-switched** to it (zero manual intervention!)" >> $GITHUB_STEP_SUMMARY
echo "5. TensorFlow installed successfully on Python 3.13" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Key Verifications" >> $GITHUB_STEP_SUMMARY
echo "- ✅ Started on Python 3.14" >> $GITHUB_STEP_SUMMARY
echo "- ✅ Quantum Healing triggered on incompatibility" >> $GITHUB_STEP_SUMMARY
echo "- ✅ **Python 3.13 auto-adopted during install** (the magic!)" >> $GITHUB_STEP_SUMMARY
echo "- ✅ **Auto-switched from 3.14 → 3.13** (zero user intervention!)" >> $GITHUB_STEP_SUMMARY
echo "- ✅ TensorFlo