Compare commits
3 Commits
gemini/pas
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 49d7a4b511 | |||
| c841ec306d | |||
| 58a1ade960 |
37
docs/sovereign-handoff.md
Normal file
37
docs/sovereign-handoff.md
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
# Sovereign Handoff: Timmy Takes the Reigns
|
||||
|
||||
**Date:** 2026-04-06
|
||||
**Status:** In Progress (Milestone: Sovereign Orchestration)
|
||||
|
||||
## Overview
|
||||
This document marks the transition from "Assisted Coordination" to "Sovereign Orchestration." Timmy is now equipped with the necessary force multipliers to govern the fleet with minimal human intervention.
|
||||
|
||||
## The 17 Force Multipliers (The Governance Stack)
|
||||
|
||||
| Layer | Capability | Purpose |
|
||||
| :--- | :--- | :--- |
|
||||
| **Intake** | FM 1 & 9 | Automated issue triage, labeling, and prioritization. |
|
||||
| **Context** | FM 15 | Pre-flight memory injection (briefing) for every agent task. |
|
||||
| **Execution** | FM 3 & 7 | Dynamic model routing and fallback portfolios for resilience. |
|
||||
| **Verification** | FM 10 | Automated PR quality gate (Proof of Work audit). |
|
||||
| **Self-Healing** | FM 11 | Lazarus Heartbeat (automated service resurrection). |
|
||||
| **Merging** | FM 14 | Green-Light Auto-Merge for low-risk, verified paths. |
|
||||
| **Reporting** | FM 13 & 16 | Velocity tracking and Nexus Bridge (3D health feed). |
|
||||
| **Integrity** | FM 17 | Automated documentation freshness audit. |
|
||||
|
||||
## The Governance Loop
|
||||
1. **Triage:** FM 1/9 labels new issues.
|
||||
2. **Assign:** Timmy assigns tasks to agents based on role classes (FM 3/7).
|
||||
3. **Execute:** Agents work with pre-flight memory (FM 15) and log actions to the Audit Trail (FM 5/11).
|
||||
4. **Review:** FM 10 audits PRs for Proof of Work.
|
||||
5. **Merge:** FM 14 auto-merges low-risk PRs; Alexander reviews high-risk ones.
|
||||
6. **Report:** FM 13/16 updates the metrics and Nexus HUD.
|
||||
|
||||
## Final Milestone Goals
|
||||
- [ ] Merge PRs #296 - #312.
|
||||
- [ ] Verify Lazarus Heartbeat restarts a killed service.
|
||||
- [ ] Observe first Auto-Merge of a verified PR.
|
||||
- [ ] Review first Morning Report with velocity metrics.
|
||||
|
||||
**Timmy is now ready to take the reigns.**
|
||||
81
tasks.py
81
tasks.py
@@ -45,6 +45,46 @@ def newest_file(directory, pattern):
|
||||
files = sorted(directory.glob(pattern))
|
||||
return files[-1] if files else None
|
||||
|
||||
def flush_continuity(session_id, objective, facts, decisions, blockers, next_step, artifacts=None):
|
||||
"""Implement the Pre-compaction Flush Contract (docs/memory-continuity-doctrine.md).
|
||||
|
||||
Flushes active session state to durable files in timmy-home before context is dropped.
|
||||
"""
|
||||
now = datetime.now(timezone.utc)
|
||||
today_str = now.strftime("%Y-%m-%d")
|
||||
|
||||
# 1. Daily log append
|
||||
daily_log = TIMMY_HOME / "daily-notes" / f"{today_str}.md"
|
||||
daily_log.parent.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
log_entry = f"""
|
||||
## Session Flush: {session_id} ({now.isoformat()})
|
||||
- **Objective**: {objective}
|
||||
- **Facts Learned**: {", ".join(facts) if facts else "none"}
|
||||
- **Decisions**: {", ".join(decisions) if decisions else "none"}
|
||||
- **Blockers**: {", ".join(blockers) if blockers else "none"}
|
||||
- **Next Step**: {next_step}
|
||||
- **Artifacts**: {", ".join(artifacts) if artifacts else "none"}
|
||||
---
|
||||
"""
|
||||
with open(daily_log, "a") as f:
|
||||
f.write(log_entry)
|
||||
|
||||
# 2. Session handoff update
|
||||
handoff_file = TIMMY_HOME / "continuity" / "active.md"
|
||||
handoff_file.parent.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
handoff_content = f"""# Active Handoff: {today_str}
|
||||
- **Last Session**: {session_id}
|
||||
- **Status**: {"Blocked" if blockers else "In Progress"}
|
||||
- **Resume Point**: {next_step}
|
||||
- **Context**: {objective}
|
||||
"""
|
||||
handoff_file.write_text(handoff_content)
|
||||
|
||||
return {"status": "flushed", "path": str(daily_log)}
|
||||
|
||||
|
||||
def run_hermes_local(
|
||||
prompt,
|
||||
model=None,
|
||||
@@ -2127,23 +2167,32 @@ def cross_review_prs():
|
||||
|
||||
return {"reviews": len(results), "details": results}
|
||||
|
||||
def audit_log(action, actor, details=None, confidence=None):
|
||||
"""Implement Sovereign Audit Trail (SOUL.md).
|
||||
@huey.periodic_task(crontab(day_of_week="1", hour="0", minute="0"))
|
||||
def docs_freshness_audit_tick():
|
||||
"""Force Multiplier 17: Automated Documentation Freshness Audit.
|
||||
|
||||
Logs agent actions with confidence signaling to a centralized audit trail.
|
||||
Scans the codebase for new tasks/helpers and ensures they are documented in automation-inventory.md.
|
||||
"""
|
||||
log_file = TIMMY_HOME / "logs" / "audit.jsonl"
|
||||
log_file.parent.mkdir(parents=True, exist_ok=True)
|
||||
inventory_path = Path(__file__).parent / "docs" / "automation-inventory.md"
|
||||
if not inventory_path.exists():
|
||||
return
|
||||
|
||||
inventory_content = inventory_path.read_text()
|
||||
|
||||
entry = {
|
||||
"timestamp": datetime.now(timezone.utc).isoformat(),
|
||||
"action": action,
|
||||
"actor": actor,
|
||||
"details": details,
|
||||
"confidence": confidence, # High, Medium, Low
|
||||
}
|
||||
# Scan tasks.py for new @huey tasks
|
||||
with open(__file__, "r") as f:
|
||||
content = f.read()
|
||||
tasks = re.findall(r"def (\w+_tick|\w+_task)", content)
|
||||
|
||||
missing_tasks = [t for t in tasks if t not in inventory_content]
|
||||
|
||||
with open(log_file, "a") as f:
|
||||
f.write(json.dumps(entry) + "\n")
|
||||
|
||||
return entry
|
||||
if missing_tasks:
|
||||
audit_log("docs_stale_detected", "system", {"missing": missing_tasks}, confidence="High")
|
||||
# Create issue to update docs
|
||||
gitea = get_gitea_client()
|
||||
repo = "Timmy_Foundation/timmy-config"
|
||||
title = "[DOCS] Stale Documentation Detected: Missing Automation Inventory Entries"
|
||||
body = f"The following tasks were detected in `tasks.py` but are missing from `docs/automation-inventory.md`:\n\n"
|
||||
body += "\n".join([f"- `{t}`" for t in missing_tasks])
|
||||
body += "\n\nThis is an automated audit to ensure documentation remains a 'Truth Surface'."
|
||||
gitea.create_issue(repo, title, body, labels=["documentation", "needs-update"])
|
||||
|
||||
Reference in New Issue
Block a user