function refactored: 'calculate_dir_snapshot' became 'compute_dir_state' and return a dict instead of a tuple (seems more consistent)