<commit_before>module DeepCover
  module CheckCompletion
    def check_completion(wrap='((%{node}))')
      has_tracker :completion
      include InstanceMethods
      define_method(:rewrite) { "#{wrap}.tap{%{completion_tracker}}"}
    end

    module InstanceMethods
      def flow_completion_count
        completion_tracker_hits
      end

      def execution_count
        last = children_nodes.last
        return last.flow_completion_count if last
        super
      end
    end
  end
end<commit_msg>Fix check_completion to respect flow order of children<commit_after>module DeepCover
  module CheckCompletion
    def check_completion(wrap='((%{node}))')
      has_tracker :completion
      include InstanceMethods
      define_method(:rewrite) { "#{wrap}.tap{%{completion_tracker}}"}
    end

    module InstanceMethods
      def flow_completion_count
        completion_tracker_hits
      end

      def execution_count
        last = children_nodes_in_flow_order.last
        return last.flow_completion_count if last
        super
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.06548175865294668, 'fraction_numerical': 0.0, 'mean_word_length': 2.9338235294117645, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6181992', 'n_tokens_mistral': 309, 'n_tokens_neox': 291, 'n_words': 70}