Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/ai-brain-core / sub_brains/hypothalamus/devtools/example_healer/handle_event.py |
| Date | Not specified in source |
| Repository | Janady13/ai-brain-core |
| Revision | f7275582f13ada80bfb3b1008089800ca26f4a23 |
| Branch | main |
| Path or archive member | sub_brains/hypothalamus/devtools/example_healer/handle_event.py |
| Original SHA-256 | 05fdf4b1635326a4c7980f26359e437368976fb740e90096f2f47d2bc15a7c77 |
| Git blob SHA | a001b2d11381f137caecd153ad0f198ef8a625db |
| Reading-copy SHA-256 | 05fdf4b1635326a4c7980f26359e437368976fb740e90096f2f47d2bc15a7c77 |
Every recorded occurrence
These 3 records contain identical original source bytes. Their paths and revisions remain part of the archive.
| Original record | Branch or archive | Revision / identifier | Original location |
|---|---|---|---|
| Janady13/ai-brain-core / sub_brains/hypothalamus/devtools/example_healer/handle_event.py | main | f7275582f13ada80bfb3b1008089800ca26f4a23 | Open original |
| Janady13/ai-brain-core / sub_brains/hypothalamus/devtools/example_healer/handle_event.py | claude/agi-architecture-diagram-01GJ7CohfKvLb77yiKpHqd6d | 365850e27004318edd582881225024026b118c2d | Open original |
| Janady13/ai-brain-core / sub_brains/hypothalamus/devtools/example_healer/handle_event.py | healer-core | 0fe4cbbaa91912149f1a8e32205371ff67017268 | Open original |
Recovered source transcript
Download complete source text ↓42 lines · 1.5 KB
#!/usr/bin/env python3
import ai_brain_env # auto-inserted by update_ai_brain_env_paths.sh
"""
example_healer.handle_event.py
Template: accepts --dry-run / --apply with --event json
"""
import argparse, json, sys, time
from pathlib import Path
LOG = Path.home() / "Desktop/AI_Brain" / "logs" / "example_healer.log"
def log(m):
t=time.strftime("%Y-%m-%d %H:%M:%S"); print(f"{t} {m}")
try:
with open(LOG,"a") as f: f.write(f"{t} {m}\n")
except: pass
def main():
p=argparse.ArgumentParser()
p.add_argument("--dry-run", action="store_true")
p.add_argument("--apply", action="store_true")
p.add_argument("--event", default=None)
args=p.parse_args()
if args.event:
evt=json.loads(args.event)
else:
raw=sys.stdin.read() or "{}"
evt=json.loads(raw)
log(f"example_healer invoked dry={args.dry_run} apply={args.apply} event={evt.get('error_type')}")
# Example behavior: if page_stalled -> attempt simple fix
if evt.get("error_type") in ("page_stalled","navigation_error"):
if args.dry_run:
print(json.dumps({"rc":0,"out":"Would flush DNS and restart browser"}))
sys.exit(0)
# apply: DO something benign for demo (no destructive actions)
# return success
print(json.dumps({"rc":0,"out":"Simulated fix applied: cleared network cache (simulated)"}))
sys.exit(0)
print(json.dumps({"rc":2,"out":"no-op"}))
sys.exit(2)
if __name__=='__main__':
main()