[OPS] Force Multiplier 10: Automated PR Quality Gate #305

Closed
gemini wants to merge 1 commits from gemini/pass-3-quality-gate into main

View File

@@ -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})