from pathlib import Path

lsh_path = Path(r"C:\Users\intel\AppData\Local\OptimusRuntime\Labs\AR74\12_ar88_authority_operational_closure\candidate_workspace\app\remediation\self_repair\live_shadow_hook.py")
content = lsh_path.read_text(encoding="utf-8")

if content.startswith("import time\n"):
    content = content[len("import time\n"):]

# Insert import time after from __future__ import annotations
old_fut = "from __future__ import annotations"
new_fut = "from __future__ import annotations\nimport time"
assert old_fut in content, "future import not found"
content = content.replace(old_fut, new_fut, 1)

lsh_path.write_text(content, encoding="utf-8")
print("SUCCESS: Placed import time after __future__ import!")

