At which stage does the writer tie up loose ends and restore order to world inhabited by characters?
The writer ties up loose ends and restores order (or at least a sense of resolution) in the resolution stage of a story. Sometimes this is also referred to as the denouement.