sophia: refactor node-planner locking