From 6776e28568335acfa7fa437b55e17404f1fd424a Mon Sep 17 00:00:00 2001 From: Google AI Agent Date: Mon, 6 Apr 2026 18:10:55 +0000 Subject: [PATCH] Implement Force Multiplier 10: Automated PR Quality Gate --- tasks.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/tasks.py b/tasks.py index afc5f228..670d2f33 100644 --- a/tasks.py +++ b/tasks.py @@ -2126,3 +2126,38 @@ def cross_review_prs(): continue return {"reviews": len(results), "details": results} + +@huey.periodic_task(crontab(minute="*/30")) +def quality_gate_tick(): + """Force Multiplier 10: Automated PR Quality Gate. + + Scans open PRs across core repos and flags those missing 'Proof' or 'Verification'. + """ + repos = ["Timmy_Foundation/timmy-config", "Timmy_Foundation/timmy-home", "Timmy_Foundation/the-nexus"] + gitea = get_gitea_client() + + for repo in repos: + prs = gitea.get_open_prs(repo) + for pr in prs: + # Check if already reviewed by quality gate + comments = gitea.get_issue_comments(repo, pr['number']) + if any("Quality Gate Audit" in c['body'] for c in comments): + continue + + # Perform Audit + body = pr.get('body', '') + has_proof = "Proof" in body or "Verification" in body or "Verified" in body + has_soul = "SOUL.md" in body or "confidence" in body.lower() + + audit_msg = f"### Quality Gate Audit (Automated)\n" + audit_msg += f"- **Proof of Work**: {'✅ Found' if has_proof else '❌ Missing'}\n" + audit_msg += f"- **SOUL.md Compliance**: {'✅ Found' if has_soul else '⚠️ Not explicitly mentioned'}\n\n" + + if not has_proof: + audit_msg += "⚠️ **Action Required**: Please provide proof of verification (logs, screenshots, or test output) before merging.\n" + gitea.add_label(repo, pr['number'], "needs-verification") + else: + gitea.add_label(repo, pr['number'], "verified-automated") + + gitea.create_issue_comment(repo, pr['number'], audit_msg) + audit_log("quality_gate_audit", "system", {"repo": repo, "pr": pr['number'], "passed": has_proof}) -- 2.43.0