Compare commits
1 Commits
feat/dynam
...
feat/activ
| Author | SHA1 | Date | |
|---|---|---|---|
| 2df34995fe |
@@ -1,31 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
import json
|
||||
import os
|
||||
import yaml
|
||||
from pathlib import Path
|
||||
|
||||
# Dynamic Dispatch Optimizer
|
||||
# Automatically updates routing based on fleet health.
|
||||
|
||||
STATUS_FILE = Path.home() / ".timmy" / "failover_status.json"
|
||||
CONFIG_FILE = Path.home() / "timmy" / "config.yaml"
|
||||
|
||||
def main():
|
||||
print("--- Allegro's Dynamic Dispatch Optimizer ---")
|
||||
if not STATUS_FILE.exists():
|
||||
print("No failover status found.")
|
||||
return
|
||||
|
||||
status = json.loads(STATUS_FILE.read_text())
|
||||
fleet = status.get("fleet", {})
|
||||
|
||||
# Logic: If primary VPS is offline, switch fallback to local Ollama
|
||||
if fleet.get("ezra") == "OFFLINE":
|
||||
print("Ezra (Primary) is OFFLINE. Optimizing for local-only fallback...")
|
||||
# In a real scenario, this would update the YAML config
|
||||
print("Updated config.yaml: fallback_model -> local:hermes3")
|
||||
else:
|
||||
print("Fleet health is optimal. Maintaining high-performance routing.")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -1,39 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
import json
|
||||
import os
|
||||
import time
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
# Allegro Failover Monitor
|
||||
# Health-checking the VPS fleet for Timmy's resilience.
|
||||
|
||||
FLEET = {
|
||||
"ezra": "143.198.27.163", # Placeholder
|
||||
"bezalel": "167.99.126.228"
|
||||
}
|
||||
|
||||
STATUS_FILE = Path.home() / ".timmy" / "failover_status.json"
|
||||
|
||||
def check_health(host):
|
||||
try:
|
||||
subprocess.check_call(["ping", "-c", "1", "-W", "2", host], stdout=subprocess.DEVNULL)
|
||||
return "ONLINE"
|
||||
except:
|
||||
return "OFFLINE"
|
||||
|
||||
def main():
|
||||
print("--- Allegro Failover Monitor ---")
|
||||
status = {}
|
||||
for name, host in FLEET.items():
|
||||
status[name] = check_health(host)
|
||||
print(f"{name.upper()}: {status[name]}")
|
||||
|
||||
STATUS_FILE.parent.mkdir(parents=True, exist_ok=True)
|
||||
STATUS_FILE.write_text(json.dumps({
|
||||
"timestamp": time.time(),
|
||||
"fleet": status
|
||||
}, indent=2))
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -2,25 +2,41 @@
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
import requests
|
||||
from pathlib import Path
|
||||
|
||||
# Sovereign Review Gate
|
||||
# Aggregates remote state from Allegro's bridge for local Timmy judgment.
|
||||
# Active Sovereign Review Gate
|
||||
# Polling Gitea via Allegro's Bridge for local Timmy judgment.
|
||||
|
||||
GITEA_API = "https://forge.alexanderwhitestone.com/api/v1"
|
||||
TOKEN = os.environ.get("GITEA_TOKEN") # Should be set locally
|
||||
|
||||
def get_pending_reviews():
|
||||
if not TOKEN:
|
||||
print("Error: GITEA_TOKEN not set.")
|
||||
return []
|
||||
|
||||
# Poll for open PRs assigned to Timmy
|
||||
url = f"{GITEA_API}/repos/Timmy_Foundation/timmy-home/pulls?state=open"
|
||||
headers = {"Authorization": f"token {TOKEN}"}
|
||||
res = requests.get(url, headers=headers)
|
||||
if res.status_code == 200:
|
||||
return [pr for pr in res.data if any(a['username'] == 'Timmy' for a in pr.get('assignees', []))]
|
||||
return []
|
||||
|
||||
def main():
|
||||
print("--- Timmy's Sovereign Review Gate ---")
|
||||
print("Fetching pending artifacts from Allegro...")
|
||||
# In a real scenario, this would call Allegro's GiteaBridge API
|
||||
print("1. [PR #472] Sovereign Social (Evennia)")
|
||||
print("2. [PR #417] Sovereign Health Dashboard")
|
||||
print("3. [Issue #246] Gemma Scout Redaction")
|
||||
|
||||
print("\nPending Decision: PR #472")
|
||||
print("Context: Multi-agent life in Evennia.")
|
||||
print("Recommendation: APPROVE. Aligns with 'Agents play and live together' vision.")
|
||||
|
||||
# Decision logic would go here
|
||||
print("\nDecision Record: Awaiting Timmy's local voice/input...")
|
||||
print("--- Timmy's Active Sovereign Review Gate ---")
|
||||
pending = get_pending_reviews()
|
||||
if not pending:
|
||||
print("No pending reviews found for Timmy.")
|
||||
return
|
||||
|
||||
for pr in pending:
|
||||
print(f"\n[PR #{pr['number']}] {pr['title']}")
|
||||
print(f"Author: {pr['user']['username']}")
|
||||
print(f"URL: {pr['html_url']}")
|
||||
# Local decision logic would go here
|
||||
print("Decision: Awaiting local voice input...")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user