[PLAT-3064] Only write value specifications on input edges where possible
[PLAT-4922] Fix error in graph pruning logic