import os
import sys

lab = r"C:\Users\intel\AppData\Local\OptimusRuntime\Labs\AR74\12_ar88_authority_operational_closure"
candidate_ws = os.path.join(lab, "candidate_workspace")
sys.path.insert(0, candidate_ws)

import artifacts.brain_host.brain_host_tls as bh
from app.remediation.self_repair.live_shadow_hook import dispatch_live_shadow_hook

bh.OPERATIONAL_TASKS["task_debug_1"] = {
    "task_id": "task_debug_1",
    "mission_id": "task_debug_1",
    "status": "FAILED",
    "activity": []
}

snap = dict(bh.OPERATIONAL_TASKS["task_debug_1"])
print("Calling dispatch_live_shadow_hook with snap...")
dispatch_live_shadow_hook(snap, async_dispatch=False)
print("After dispatch activity in bh.OPERATIONAL_TASKS:")
for a in bh.OPERATIONAL_TASKS["task_debug_1"]["activity"]:
    print(" ", a)

