fn write_marker(dir: &Path, marker: &str, name: &str, state: &str) -> Result<()>
Writes a marker file inside dir to persist task completion state.
dir