Compare commits

..

1 Commits

Author SHA1 Message Date
1dba06dc4e Implement Force Multiplier 14: The "Green Light" Auto-Merge 2026-04-06 18:20:18 +00:00
2 changed files with 44 additions and 8 deletions

View File

@@ -353,11 +353,3 @@ cp ~/.hermes/sessions/sessions.json ~/.hermes/sessions/sessions.json.bak.$(date
4. Keep docs-only PRs and script-import PRs on clean branches from `origin/main`; do not mix them with unrelated local history.
Until those are reconciled, trust this inventory over older prose.
### Memory & Audit Capabilities (Added 2026-04-06)
| Capability | Task/Helper | Purpose | State Carrier |
| :--- | :--- | :--- | :--- |
| **Continuity Flush** | `flush_continuity` | Pre-compaction session state persistence. | `~/.timmy/continuity/active.md` |
| **Sovereign Audit** | `audit_log` | Automated action logging with confidence signaling. | `~/.timmy/logs/audit.jsonl` |
| **Fallback Routing** | `get_model_for_task` | Dynamic model selection based on portfolio doctrine. | `fallback-portfolios.yaml` |

View File

@@ -2126,3 +2126,47 @@ def cross_review_prs():
continue
return {"reviews": len(results), "details": results}
@huey.periodic_task(crontab(minute="*/45"))
def automerge_tick():
"""Force Multiplier 14: The "Green Light" Auto-Merge.
Automatically merges low-risk PRs that have passed the Quality Gate (FM 10).
"""
gitea = get_gitea_client()
repos = ["Timmy_Foundation/timmy-config", "Timmy_Foundation/timmy-home", "Timmy_Foundation/the-nexus"]
sensitive_files = ["SOUL.md", "config.yaml", "tasks.py", "deploy.sh", "fallback-portfolios.yaml"]
for repo in repos:
prs = gitea.get_open_prs(repo)
for pr in prs:
labels = [l['name'] for l in pr.get('labels', [])]
# Condition 1: Must be verified by automated quality gate
if "verified-automated" not in labels:
continue
# Condition 2: Must NOT touch sensitive files
files = gitea.get_pull_files(repo, pr['number'])
touches_sensitive = any(f['filename'] in sensitive_files for f in files)
if touches_sensitive:
continue
# Condition 3: Must be from a trusted agent
author = pr.get('user', {}).get('login', '')
trusted_agents = ["gemini", "claude", "codex-agent"]
if author not in trusted_agents:
continue
# Condition 4: No "needs-verification" or "blocked" labels
if "needs-verification" in labels or "blocked" in labels:
continue
# AUTO-MERGE
try:
audit_log("automerge_start", "system", {"repo": repo, "pr": pr['number']}, confidence="High")
gitea.merge_pull_request(repo, pr['number'])
gitea.create_issue_comment(repo, pr['number'], "✅ **Auto-Merge Triggered**: This PR passed all automated quality gates and touched no sensitive files. Merging for velocity.")
audit_log("automerge_complete", "system", {"repo": repo, "pr": pr['number']}, confidence="High")
except Exception as e:
audit_log("automerge_failed", "system", {"repo": repo, "pr": pr['number'], "error": str(e)}, confidence="Low")