<commit_before>module SmartAnswer
  class BridgeOfDeathFlow < Flow
    def define
      name 'bridge-of-death'
      status :draft

      value_question :what_is_your_name? do
        save_input_as :your_name
        next_node :what_is_your_quest?
      end

      multiple_choice :what_is_your_quest? do
        option :to_seek_the_holy_grail
        option :to_rescue_the_princess
        option :dunno

        permitted_next_nodes = [
          :what_is_the_capital_of_assyria?,
          :what_is_your_favorite_colour?
        ]
        next_node(permitted: permitted_next_nodes) do |response|
          if your_name =~ /robin/i and response == 'to_seek_the_holy_grail'
            :what_is_the_capital_of_assyria?
          else
            :what_is_your_favorite_colour?
          end
        end
      end

      value_question :what_is_the_capital_of_assyria? do
        save_input_as :capital_of_assyria
        next_node :auuuuuuuugh
      end

      multiple_choice :what_is_your_favorite_colour? do
        option :blue
        option :blue_no_yellow
        option :red

        permitted_next_nodes = [
          :auuuuuuuugh,
          :done
        ]
        next_node(permitted: permitted_next_nodes) do |response|
          case response
          when 'blue', 'red'
            :done
          when 'blue_no_yellow'
            :auuuuuuuugh
          end
        end
      end

      outcome :done
      outcome :auuuuuuuugh
    end
  end
end<commit_msg>Use `permitted: :auto` in bridge-of-death fixture<commit_after>module SmartAnswer
  class BridgeOfDeathFlow < Flow
    def define
      name 'bridge-of-death'
      status :draft

      value_question :what_is_your_name? do
        save_input_as :your_name
        next_node :what_is_your_quest?
      end

      multiple_choice :what_is_your_quest? do
        option :to_seek_the_holy_grail
        option :to_rescue_the_princess
        option :dunno

        next_node(permitted: :auto) do |response|
          if your_name =~ /robin/i and response == 'to_seek_the_holy_grail'
            question :what_is_the_capital_of_assyria?
          else
            question :what_is_your_favorite_colour?
          end
        end
      end

      value_question :what_is_the_capital_of_assyria? do
        save_input_as :capital_of_assyria
        next_node :auuuuuuuugh
      end

      multiple_choice :what_is_your_favorite_colour? do
        option :blue
        option :blue_no_yellow
        option :red

        next_node(permitted: :auto) do |response|
          case response
          when 'blue', 'red'
            outcome :done
          when 'blue_no_yellow'
            outcome :auuuuuuuugh
          end
        end
      end

      outcome :done
      outcome :auuuuuuuugh
    end
  end
end
{'fraction_non_alphanumeric': 0.05185451926539431, 'fraction_numerical': 0.0, 'mean_word_length': 2.026143790849673, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 7, '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': '2646577', 'n_tokens_mistral': 903, 'n_tokens_neox': 871, 'n_words': 182}