p = r"C:\Users\decid\Documents\projects\spt-core\.worktrees\ir57\crates\spt\tests\wake_resume_bind_e2e.rs"
lines = open(p, encoding="utf-8").read().split("\n")

target = None
for i, ln in enumerate(lines):
    if "[session.psyche_resume]" in ln and "psyche_dir" in ln:
        target = i
        break
assert target is not None, "line not found"
print("BEFORE:", lines[target])

# `{psyche_dir}` is RETIRED for this role — the manifest validator refuses it
# ("not a substitution key spt-core can fill for this role"). psyche_init still
# takes it; psyche_resume does not.
lines[target] = lines[target].replace('\\ncwd=\\"{{psyche_dir}}\\"', "")
print("AFTER: ", lines[target])

open(p, "w", encoding="utf-8", newline="").write("\n".join(lines))
