Compare commits

...

1 Commits

Author SHA1 Message Date
6572dfdbba Implement Sovereign Audit Trail in tasks.py 2026-04-06 17:57:09 +00:00

View File

@@ -2126,3 +2126,24 @@ def cross_review_prs():
continue
return {"reviews": len(results), "details": results}
def audit_log(action, actor, details=None, confidence=None):
"""Implement Sovereign Audit Trail (SOUL.md).
Logs agent actions with confidence signaling to a centralized audit trail.
"""
log_file = TIMMY_HOME / "logs" / "audit.jsonl"
log_file.parent.mkdir(parents=True, exist_ok=True)
entry = {
"timestamp": datetime.now(timezone.utc).isoformat(),
"action": action,
"actor": actor,
"details": details,
"confidence": confidence, # High, Medium, Low
}
with open(log_file, "a") as f:
f.write(json.dumps(entry) + "\n")
return entry