43 lines
1.3 KiB
Python
43 lines
1.3 KiB
Python
#!/usr/bin/env python3
|
|
import json
|
|
import os
|
|
import sys
|
|
import requests
|
|
from pathlib import Path
|
|
|
|
# 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 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()
|