sig
  module Host :
    sig
      module Ssh :
        sig
          type t = {
            address : string;
            port : int option;
            user : string option;
            add_ssh_options : string list;
          }
          val to_yojson : Ketrew_pure.Host.Ssh.t -> Yojson.Safe.json
          val of_yojson :
            Yojson.Safe.json ->
            Ketrew_pure.Host.Ssh.t Ppx_deriving_yojson_runtime.error_or
          val configure_ssh_batch_option :
            [ `Custom of string | `Dropbear | `Openssh ] -> unit
          val ssh_batch_option : Ketrew_pure.Host.Ssh.t -> string
        end
      type default_shell
      val default_shell_to_yojson :
        Ketrew_pure.Host.default_shell -> Yojson.Safe.json
      val default_shell_of_yojson :
        Yojson.Safe.json ->
        Ketrew_pure.Host.default_shell Ppx_deriving_yojson_runtime.error_or
      type t
      val to_yojson : Ketrew_pure.Host.t -> Yojson.Safe.json
      val of_yojson :
        Yojson.Safe.json ->
        Ketrew_pure.Host.t Ppx_deriving_yojson_runtime.error_or
      val default_shell :
        ?binary:string ->
        ?options:string list ->
        ?command_option:string -> string -> Ketrew_pure.Host.default_shell
      val localhost :
        ?execution_timeout:Internal_pervasives.Time.t ->
        ?default_shell:Ketrew_pure.Host.default_shell ->
        ?playground:Path.t -> ?name:string -> unit -> Ketrew_pure.Host.t
      val tmp_on_localhost : Ketrew_pure.Host.t
      val ssh :
        ?execution_timeout:Internal_pervasives.Time.t ->
        ?add_ssh_options:string list ->
        ?default_shell:Ketrew_pure.Host.default_shell ->
        ?playground:Path.t ->
        ?port:int ->
        ?user:string -> ?name:string -> string -> Ketrew_pure.Host.t
      val named :
        ?execution_timeout:Internal_pervasives.Time.t ->
        ?default_shell:Ketrew_pure.Host.default_shell ->
        ?playground:Path.t -> string -> Ketrew_pure.Host.t
      val with_ssh_connection :
        Ketrew_pure.Host.t -> Ketrew_pure.Host.Ssh.t -> Ketrew_pure.Host.t
      val shell_of_default_shell :
        Ketrew_pure.Host.t -> string -> string list
      val of_uri :
        Internal_pervasives.Uri.t ->
        (Ketrew_pure.Host.t, [> `Host_uri_parsing_error of string * string ])
        Pvem.Result.t
      val of_string :
        string ->
        (Ketrew_pure.Host.t, [> `Host_uri_parsing_error of string * string ])
        Pvem.Result.t
      val to_uri : Ketrew_pure.Host.t -> Internal_pervasives.Uri.t
      val to_string_hum : Ketrew_pure.Host.t -> string
      val log : Ketrew_pure.Host.t -> Internal_pervasives.Log.t
      val markup : Ketrew_pure.Host.t -> Internal_pervasives.Display_markup.t
      val execution_timeout :
        Ketrew_pure.Host.t -> Internal_pervasives.Time.t option
      val connection :
        Ketrew_pure.Host.t ->
        [ `Localhost | `Named of string | `Ssh of Ketrew_pure.Host.Ssh.t ]
      val playground : Ketrew_pure.Host.t -> Path.t option
    end
  module Monitored_script :
    sig
      type t = { playground : Path.t; program : Program.t; }
      val to_yojson : Ketrew_pure.Monitored_script.t -> Yojson.Safe.json
      val of_yojson :
        Yojson.Safe.json ->
        Ketrew_pure.Monitored_script.t Ppx_deriving_yojson_runtime.error_or
      val create :
        playground:Path.t -> Program.t -> Ketrew_pure.Monitored_script.t
      val log_file : Ketrew_pure.Monitored_script.t -> Path.t
      val pid_file : Ketrew_pure.Monitored_script.t -> Path.t
      val to_string :
        ?write_pid:bool -> Ketrew_pure.Monitored_script.t -> string
      val parse_log :
        string ->
        [ `After of string * string * string
        | `Before of string * string * string
        | `Error of string list
        | `Failure of string * string * string
        | `Start of string
        | `Success of string ] list
    end
  module Path :
    sig
      type t
      val to_yojson : Ketrew_pure.Path.t -> Yojson.Safe.json
      val of_yojson :
        Yojson.Safe.json ->
        Ketrew_pure.Path.t Ppx_deriving_yojson_runtime.error_or
      val file : string -> Ketrew_pure.Path.t
      val directory : string -> Ketrew_pure.Path.t
      val root : Ketrew_pure.Path.t
      val absolute_file_exn : string -> Ketrew_pure.Path.t
      val absolute_directory_exn : string -> Ketrew_pure.Path.t
      val relative_directory_exn : string -> Ketrew_pure.Path.t
      val relative_file_exn : string -> Ketrew_pure.Path.t
      val concat :
        Ketrew_pure.Path.t -> Ketrew_pure.Path.t -> Ketrew_pure.Path.t
      val to_string : Ketrew_pure.Path.t -> string
      val to_string_quoted : Ketrew_pure.Path.t -> string
      val exists_shell_condition : Ketrew_pure.Path.t -> string
      val size_shell_command : Ketrew_pure.Path.t -> string
      val markup : Ketrew_pure.Path.t -> Internal_pervasives.Display_markup.t
    end
  module Program :
    sig
      type t =
          [ `And of Ketrew_pure.Program.t list
          | `Exec of string list
          | `Shell_command of string ]
      val to_yojson : Ketrew_pure.Program.t -> Yojson.Safe.json
      val of_yojson :
        Yojson.Safe.json ->
        Ketrew_pure.Program.t Ppx_deriving_yojson_runtime.error_or
      val to_shell_commands : Ketrew_pure.Program.t -> string list
      val to_single_shell_command : Ketrew_pure.Program.t -> string
      val log : Ketrew_pure.Program.t -> Internal_pervasives.Log.t
      val to_string_hum : Ketrew_pure.Program.t -> string
      val markup :
        ?flatten:bool ->
        Ketrew_pure.Program.t -> Internal_pervasives.Display_markup.t
    end
  module Protocol :
    sig
      module Server_status :
        sig
          type t = {
            time : float;
            read_only : bool;
            tls : [ `Native | `None | `OpenSSL ];
            preemptive_bounds : int * int;
            preemptive_queue : int;
            libev : bool;
            database : string;
            host_timeout_upper_bound : float option;
            maximum_successive_attempts : int;
            concurrent_automaton_steps : int;
            gc_minor_words : float;
            gc_promoted_words : float;
            gc_major_words : float;
            gc_minor_collections : int;
            gc_major_collections : int;
            gc_heap_words : int;
            gc_heap_chunks : int;
            gc_compactions : int;
            gc_top_heap_words : int;
            gc_stack_size : int;
            enable_ssh_ui : bool;
          }
          val create :
            database:string ->
            host_timeout_upper_bound:float option ->
            maximum_successive_attempts:int ->
            concurrent_automaton_steps:int ->
            enable_ssh_ui:bool ->
            time:float ->
            read_only:bool ->
            tls:[ `Native | `None | `OpenSSL ] ->
            preemptive_bounds:int * int ->
            preemptive_queue:int ->
            libev:bool -> gc:Gc.stat -> Ketrew_pure.Protocol.Server_status.t
        end
      module Process_sub_protocol :
        sig
          module Command :
            sig
              type t = {
                connection : string;
                id : string;
                command : string;
              }
            end
          type up =
              [ `Get_all_ssh_ids of string
              | `Get_logs of string * [ `Full ]
              | `Kill of string
              | `Send_command of
                  Ketrew_pure.Protocol.Process_sub_protocol.Command.t
              | `Send_ssh_input of string * string
              | `Start_ssh_connection of
                  [ `Configured of string | `New of string * string ] ]
          module Ssh_connection :
            sig
              type status =
                  [ `Alive of
                      [ `Askpass_waiting_for_input of (float * string) list
                      | `Idle ]
                  | `Configured
                  | `Dead of string
                  | `Unknown of string ]
              type t = {
                id : string;
                name : string;
                uri : string;
                status :
                  Ketrew_pure.Protocol.Process_sub_protocol.Ssh_connection.status;
              }
            end
          module Command_output :
            sig
              type t = { id : string; stdout : string; stderr : string; }
            end
          type down =
              [ `Command_output of
                  Ketrew_pure.Protocol.Process_sub_protocol.Command_output.t
              | `Error of string
              | `List_of_ssh_ids of
                  Ketrew_pure.Protocol.Process_sub_protocol.Ssh_connection.t
                  list
              | `Logs of string * string
              | `Ok ]
        end
      module Down_message :
        sig
          type t =
              [ `Deferred_list_of_target_ids of string * int
              | `List_of_query_descriptions of (string * string) list
              | `List_of_target_flat_states of
                  (string * Target.State.Flat.t) list * float
              | `List_of_target_ids of string list * float
              | `List_of_target_summaries of (string * Target.Summary.t) list
              | `List_of_targets of Target.t list
              | `Missing_deferred
              | `Notifications of (float * string) list
              | `Ok
              | `Process of Ketrew_pure.Protocol.Process_sub_protocol.down
              | `Query_error of string
              | `Query_result of string
              | `Server_status of Ketrew_pure.Protocol.Server_status.t ]
          val to_json : t -> Yojson.Safe.json
          val of_json_exn : Yojson.Safe.json -> t
          val serialize : t -> string
          val deserialize_exn : string -> t
        end
      module Up_message :
        sig
          type time_constraint =
              [ `All
              | `Created_after of float
              | `Not_finished_before of float
              | `Status_changed_since of float ]
          type string_predicate = [ `Equals of string | `Matches of string ]
          type filter =
              [ `And of Ketrew_pure.Protocol.Up_message.filter list
              | `False
              | `Has_tag of Ketrew_pure.Protocol.Up_message.string_predicate
              | `Id of Ketrew_pure.Protocol.Up_message.string_predicate
              | `Name of Ketrew_pure.Protocol.Up_message.string_predicate
              | `Not of Ketrew_pure.Protocol.Up_message.filter
              | `Or of Ketrew_pure.Protocol.Up_message.filter list
              | `Status of
                  [ `Activated_by_user
                  | `Dead_because_of_dependencies
                  | `Failed_from_condition
                  | `Failed_from_running
                  | `Failed_from_starting
                  | `Killable
                  | `Killed_from_passive
                  | `Really_running
                  | `Simple of Target.State.simple ]
              | `True ]
          type target_query = {
            time_constraint : Ketrew_pure.Protocol.Up_message.time_constraint;
            filter : Ketrew_pure.Protocol.Up_message.filter;
          }
          val pp_target_query :
            Format.formatter ->
            Ketrew_pure.Protocol.Up_message.target_query ->
            Ppx_deriving_runtime.unit
          val show_target_query :
            Ketrew_pure.Protocol.Up_message.target_query ->
            Ppx_deriving_runtime.string
          type query_option = [ `Block_if_empty_at_most of float ]
          type t =
              [ `Call_query of string * string
              | `Get_available_queries of string
              | `Get_deferred of string * int * int
              | `Get_notifications of float option
              | `Get_server_status
              | `Get_target_flat_states of
                  [ `All | `Since of float ] * string list *
                  Ketrew_pure.Protocol.Up_message.query_option list
              | `Get_target_ids of
                  Ketrew_pure.Protocol.Up_message.target_query *
                  Ketrew_pure.Protocol.Up_message.query_option list
              | `Get_target_summaries of string list
              | `Get_targets of string list
              | `Kill_targets of string list
              | `Process of Ketrew_pure.Protocol.Process_sub_protocol.up
              | `Restart_targets of string list
              | `Submit_targets of Target.t list ]
          val to_json : t -> Yojson.Safe.json
          val of_json_exn : Yojson.Safe.json -> t
          val serialize : t -> string
          val deserialize_exn : string -> t
          val target_query_markup :
            Ketrew_pure.Protocol.Up_message.target_query ->
            Internal_pervasives.Display_markup.t
        end
    end
  module Reactive :
    sig
      type 'a signal = 'React.S.t
      type 'a signal_list_wrap = 'ReactiveData.RList.t
      module Source :
        sig
          type 'a t
          val create :
            ?eq:('-> '-> bool) -> '-> 'Ketrew_pure.Reactive.Source.t
          val set : 'Ketrew_pure.Reactive.Source.t -> '-> unit
          val signal :
            'Ketrew_pure.Reactive.Source.t ->
            'Ketrew_pure.Reactive.signal
          val value : 'Ketrew_pure.Reactive.Source.t -> 'a
          val modify :
            'Ketrew_pure.Reactive.Source.t -> f:('-> 'a) -> unit
          val modify_opt :
            'Ketrew_pure.Reactive.Source.t -> f:('-> 'a option) -> unit
          val map_signal :
            'Ketrew_pure.Reactive.Source.t ->
            f:('-> 'b) -> 'Ketrew_pure.Reactive.signal
        end
      module Signal :
        sig
          type 'a t = 'Ketrew_pure.Reactive.signal
          val map :
            'Ketrew_pure.Reactive.Signal.t ->
            f:('-> 'b) -> 'Ketrew_pure.Reactive.Signal.t
          val bind :
            'Ketrew_pure.Reactive.Signal.t ->
            f:('-> 'Ketrew_pure.Reactive.Signal.t) ->
            'Ketrew_pure.Reactive.Signal.t
          val constant : '-> 'Ketrew_pure.Reactive.Signal.t
          val value : 'Ketrew_pure.Reactive.Signal.t -> 'a
          val singleton :
            'Ketrew_pure.Reactive.Signal.t ->
            'Ketrew_pure.Reactive.signal_list_wrap
          val list :
            'a list Ketrew_pure.Reactive.Signal.t ->
            'Ketrew_pure.Reactive.signal_list_wrap
          val tuple_2 :
            'Ketrew_pure.Reactive.Signal.t ->
            'Ketrew_pure.Reactive.Signal.t ->
            ('a * 'b) Ketrew_pure.Reactive.Signal.t
          val tuple_3 :
            'Ketrew_pure.Reactive.Signal.t ->
            'Ketrew_pure.Reactive.Signal.t ->
            'Ketrew_pure.Reactive.Signal.t ->
            ('a * 'b * 'c) Ketrew_pure.Reactive.Signal.t
        end
    end
  module Target :
    sig
      module Command :
        sig
          type t = {
            host : Ketrew_pure.Host.t;
            action : Ketrew_pure.Program.t;
          }
          val shell :
            ?host:Ketrew_pure.Host.t ->
            string -> Ketrew_pure.Target.Command.t
          val program :
            ?host:Ketrew_pure.Host.t ->
            Ketrew_pure.Program.t -> Ketrew_pure.Target.Command.t
          val get_host : Ketrew_pure.Target.Command.t -> Ketrew_pure.Host.t
          val log : Ketrew_pure.Target.Command.t -> Internal_pervasives.Log.t
          val markup :
            Ketrew_pure.Target.Command.t ->
            Internal_pervasives.Display_markup.t
          val to_string_hum : Ketrew_pure.Target.Command.t -> string
        end
      module Volume :
        sig
          type structure =
              [ `Directory of
                  string * Ketrew_pure.Target.Volume.structure list
              | `File of string ]
          type t = {
            host : Ketrew_pure.Host.t;
            root : Ketrew_pure.Path.t;
            structure : Ketrew_pure.Target.Volume.structure;
          }
          val create :
            host:Ketrew_pure.Host.t ->
            root:Ketrew_pure.Path.t ->
            Ketrew_pure.Target.Volume.structure ->
            Ketrew_pure.Target.Volume.t
          val file : string -> Ketrew_pure.Target.Volume.structure
          val dir :
            string ->
            Ketrew_pure.Target.Volume.structure list ->
            Ketrew_pure.Target.Volume.structure
          val all_paths :
            Ketrew_pure.Target.Volume.t -> Ketrew_pure.Path.t list
          val log_structure :
            Ketrew_pure.Target.Volume.structure -> Internal_pervasives.Log.t
          val log : Ketrew_pure.Target.Volume.t -> Internal_pervasives.Log.t
          val markup :
            Ketrew_pure.Target.Volume.t ->
            Internal_pervasives.Display_markup.t
          val to_string_hum : Ketrew_pure.Target.Volume.t -> string
        end
      module Build_process :
        sig
          type t = [ `Long_running of string * string | `No_operation ]
          val nop : Ketrew_pure.Target.Build_process.t
        end
      type id = Internal_pervasives.Unique_id.t
      module Condition :
        sig
          type t =
              [ `And of Ketrew_pure.Target.Condition.t list
              | `Command_returns of Ketrew_pure.Target.Command.t * int
              | `Never
              | `Volume_exists of Ketrew_pure.Target.Volume.t
              | `Volume_size_bigger_than of Ketrew_pure.Target.Volume.t * int ]
          val log :
            Ketrew_pure.Target.Condition.t -> Internal_pervasives.Log.t
          val to_string_hum : Ketrew_pure.Target.Condition.t -> string
          val markup :
            Ketrew_pure.Target.Condition.t ->
            Internal_pervasives.Display_markup.t
        end
      module Equivalence :
        sig type t = [ `None | `Same_active_condition ] end
      module State :
        sig
          type t
          type simple = [ `Activable | `Failed | `In_progress | `Successful ]
          val simple_to_yojson :
            Ketrew_pure.Target.State.simple -> Yojson.Safe.json
          val simple_of_yojson :
            Yojson.Safe.json ->
            Ketrew_pure.Target.State.simple
            Ppx_deriving_yojson_runtime.error_or
          val pp_simple :
            Format.formatter ->
            Ketrew_pure.Target.State.simple -> Ppx_deriving_runtime.unit
          val show_simple :
            Ketrew_pure.Target.State.simple -> Ppx_deriving_runtime.string
          val simplify :
            Ketrew_pure.Target.State.t -> Ketrew_pure.Target.State.simple
          val name : Ketrew_pure.Target.State.t -> string
          type summary =
              [ `Time of Internal_pervasives.Time.t ] *
              [ `Log of string option ] * [ `Info of string list ]
          val summary :
            Ketrew_pure.Target.State.t -> Ketrew_pure.Target.State.summary
          val log :
            ?depth:int ->
            Ketrew_pure.Target.State.t -> Internal_pervasives.Log.t
          val passive_time :
            Ketrew_pure.Target.State.t -> Internal_pervasives.Time.t
          val finished_time :
            Ketrew_pure.Target.State.t -> Internal_pervasives.Time.t option
          module Is :
            sig
              val building : Ketrew_pure.Target.State.t -> bool
              val tried_to_start : Ketrew_pure.Target.State.t -> bool
              val started_running : Ketrew_pure.Target.State.t -> bool
              val starting : Ketrew_pure.Target.State.t -> bool
              val still_building : Ketrew_pure.Target.State.t -> bool
              val still_running : Ketrew_pure.Target.State.t -> bool
              val ran_successfully : Ketrew_pure.Target.State.t -> bool
              val successfully_did_nothing :
                Ketrew_pure.Target.State.t -> bool
              val active : Ketrew_pure.Target.State.t -> bool
              val verified_success : Ketrew_pure.Target.State.t -> bool
              val already_done : Ketrew_pure.Target.State.t -> bool
              val dependencies_failed : Ketrew_pure.Target.State.t -> bool
              val failed_running : Ketrew_pure.Target.State.t -> bool
              val failed_to_kill : Ketrew_pure.Target.State.t -> bool
              val failed_to_start : Ketrew_pure.Target.State.t -> bool
              val killing : Ketrew_pure.Target.State.t -> bool
              val tried_to_kill : Ketrew_pure.Target.State.t -> bool
              val tried_to_eval_condition :
                Ketrew_pure.Target.State.t -> bool
              val did_not_ensure_condition :
                Ketrew_pure.Target.State.t -> bool
              val killed : Ketrew_pure.Target.State.t -> bool
              val finished : Ketrew_pure.Target.State.t -> bool
              val passive : Ketrew_pure.Target.State.t -> bool
              val killable : Ketrew_pure.Target.State.t -> bool
              val dependency_dead : Ketrew_pure.Target.State.t -> bool
              val activated_by_user : Ketrew_pure.Target.State.t -> bool
              val killed_from_passive : Ketrew_pure.Target.State.t -> bool
              val failed_from_running : Ketrew_pure.Target.State.t -> bool
              val failed_from_starting : Ketrew_pure.Target.State.t -> bool
              val failed_from_condition : Ketrew_pure.Target.State.t -> bool
            end
          module Count :
            sig
              val consecutive_recent_attempts :
                Ketrew_pure.Target.State.t -> int
            end
          module Flat :
            sig
              type state = Ketrew_pure.Target.State.t
              type item = private {
                time : float;
                simple : Ketrew_pure.Target.State.simple;
                name : string;
                message : string option;
                more_info : string list;
                finished : bool;
                depth : int;
              }
              val item_to_yojson :
                Ketrew_pure.Target.State.Flat.item -> Yojson.Safe.json
              val item_of_yojson :
                Yojson.Safe.json ->
                Ketrew_pure.Target.State.Flat.item
                Ppx_deriving_yojson_runtime.error_or
              val time : Ketrew_pure.Target.State.Flat.item -> float
              val simple :
                Ketrew_pure.Target.State.Flat.item ->
                Ketrew_pure.Target.State.simple
              val name : Ketrew_pure.Target.State.Flat.item -> string
              val message :
                Ketrew_pure.Target.State.Flat.item -> string option
              val more_info :
                Ketrew_pure.Target.State.Flat.item -> string list
              val finished : Ketrew_pure.Target.State.Flat.item -> bool
              type t = private {
                history : Ketrew_pure.Target.State.Flat.item list;
              }
              val to_yojson :
                Ketrew_pure.Target.State.Flat.t -> Yojson.Safe.json
              val of_yojson :
                Yojson.Safe.json ->
                Ketrew_pure.Target.State.Flat.t
                Ppx_deriving_yojson_runtime.error_or
              val empty : unit -> Ketrew_pure.Target.State.Flat.t
              val of_state :
                Ketrew_pure.Target.State.Flat.state ->
                Ketrew_pure.Target.State.Flat.t
              val history :
                Ketrew_pure.Target.State.Flat.t ->
                Ketrew_pure.Target.State.Flat.item list
              val latest :
                Ketrew_pure.Target.State.Flat.t ->
                Ketrew_pure.Target.State.Flat.item option
              val since :
                Ketrew_pure.Target.State.Flat.t ->
                float -> Ketrew_pure.Target.State.Flat.t option
              val merge :
                Ketrew_pure.Target.State.Flat.t ->
                Ketrew_pure.Target.State.Flat.t ->
                Ketrew_pure.Target.State.Flat.t
            end
        end
      type t
      val to_yojson : Ketrew_pure.Target.t -> Yojson.Safe.json
      val of_yojson :
        Yojson.Safe.json ->
        Ketrew_pure.Target.t Ppx_deriving_yojson_runtime.error_or
      val create :
        ?id:Ketrew_pure.Target.id ->
        ?name:string ->
        ?metadata:[ `String of string ] ->
        ?depends_on:Ketrew_pure.Target.id list ->
        ?on_failure_activate:Ketrew_pure.Target.id list ->
        ?on_success_activate:Ketrew_pure.Target.id list ->
        ?make:Ketrew_pure.Target.Build_process.t ->
        ?condition:Ketrew_pure.Target.Condition.t ->
        ?equivalence:Ketrew_pure.Target.Equivalence.t ->
        ?tags:string list -> unit -> Ketrew_pure.Target.t
      val id : Ketrew_pure.Target.t -> Internal_pervasives.Unique_id.t
      val name : Ketrew_pure.Target.t -> string
      val depends_on : Ketrew_pure.Target.t -> Ketrew_pure.Target.id list
      val on_success_activate :
        Ketrew_pure.Target.t -> Ketrew_pure.Target.id list
      val on_failure_activate :
        Ketrew_pure.Target.t -> Ketrew_pure.Target.id list
      val metadata : Ketrew_pure.Target.t -> [ `String of string ] option
      val build_process :
        Ketrew_pure.Target.t -> Ketrew_pure.Target.Build_process.t
      val condition :
        Ketrew_pure.Target.t -> Ketrew_pure.Target.Condition.t option
      val equivalence :
        Ketrew_pure.Target.t -> Ketrew_pure.Target.Equivalence.t
      val additional_log :
        Ketrew_pure.Target.t -> (Internal_pervasives.Time.t * string) list
      val tags : Ketrew_pure.Target.t -> string list
      val state : Ketrew_pure.Target.t -> Ketrew_pure.Target.State.t
      module Automaton :
        sig
          type failure_reason
          type progress = [ `Changed_state | `No_change ]
          type 'a transition_callback =
              ?log:string ->
              '->
              Ketrew_pure.Target.t * Ketrew_pure.Target.Automaton.progress
          type severity = [ `Fatal | `Try_again ]
          type bookkeeping = {
            plugin_name : string;
            run_parameters : string;
          }
          type long_running_failure =
              Ketrew_pure.Target.Automaton.severity * string *
              Ketrew_pure.Target.Automaton.bookkeeping
          type long_running_action =
              (Ketrew_pure.Target.Automaton.bookkeeping,
               Ketrew_pure.Target.Automaton.long_running_failure)
              Pvem.Result.t
          type process_check =
              [ `Still_running of Ketrew_pure.Target.Automaton.bookkeeping
              | `Successful of Ketrew_pure.Target.Automaton.bookkeeping ]
          type process_status_check =
              (Ketrew_pure.Target.Automaton.process_check,
               Ketrew_pure.Target.Automaton.long_running_failure)
              Pvem.Result.t
          type condition_evaluation =
              (bool, Ketrew_pure.Target.Automaton.severity * string)
              Pvem.Result.t
          type dependencies_status =
              [ `All_succeeded
              | `At_least_one_failed of Ketrew_pure.Target.id list
              | `Still_processing ]
          type transition =
              [ `Activate of
                  Ketrew_pure.Target.id list *
                  unit Ketrew_pure.Target.Automaton.transition_callback
              | `Check_and_activate_dependencies of
                  Ketrew_pure.Target.Automaton.dependencies_status
                  Ketrew_pure.Target.Automaton.transition_callback
              | `Check_process of
                  Ketrew_pure.Target.Automaton.bookkeeping *
                  Ketrew_pure.Target.Automaton.process_status_check
                  Ketrew_pure.Target.Automaton.transition_callback
              | `Do_nothing of
                  unit Ketrew_pure.Target.Automaton.transition_callback
              | `Eval_condition of
                  Ketrew_pure.Target.Condition.t *
                  Ketrew_pure.Target.Automaton.condition_evaluation
                  Ketrew_pure.Target.Automaton.transition_callback
              | `Kill of
                  Ketrew_pure.Target.Automaton.bookkeeping *
                  Ketrew_pure.Target.Automaton.long_running_action
                  Ketrew_pure.Target.Automaton.transition_callback
              | `Start_running of
                  Ketrew_pure.Target.Automaton.bookkeeping *
                  Ketrew_pure.Target.Automaton.long_running_action
                  Ketrew_pure.Target.Automaton.transition_callback ]
          val transition :
            Ketrew_pure.Target.t -> Ketrew_pure.Target.Automaton.transition
        end
      val activate_exn :
        ?log:string ->
        Ketrew_pure.Target.t ->
        reason:[ `Dependency of Ketrew_pure.Target.id | `User ] ->
        Ketrew_pure.Target.t
      val kill :
        ?log:string -> Ketrew_pure.Target.t -> Ketrew_pure.Target.t option
      val reactivate :
        ?with_id:Ketrew_pure.Target.id ->
        ?with_name:string ->
        ?with_metadata:[ `String of string ] option ->
        ?log:string -> Ketrew_pure.Target.t -> Ketrew_pure.Target.t
      val is_equivalent :
        Ketrew_pure.Target.t -> Ketrew_pure.Target.t -> bool
      val log : Ketrew_pure.Target.t -> Internal_pervasives.Log.t
      val latest_run_parameters : Ketrew_pure.Target.t -> string option
      module Stored_target :
        sig
          type target = Ketrew_pure.Target.t
          type t
          val to_json :
            Ketrew_pure.Target.Stored_target.t -> Internal_pervasives.Json.t
          val serialize : Ketrew_pure.Target.Stored_target.t -> string
          val deserialize :
            string ->
            (Ketrew_pure.Target.Stored_target.t,
             [> `Target of [> `Deserilization of string ] ])
            Internal_pervasives.Result.t
          val get_target :
            Ketrew_pure.Target.Stored_target.t ->
            [ `Pointer of Ketrew_pure.Target.id
            | `Target of Ketrew_pure.Target.Stored_target.target ]
          val of_target :
            Ketrew_pure.Target.Stored_target.target ->
            Ketrew_pure.Target.Stored_target.t
          val id :
            Ketrew_pure.Target.Stored_target.t -> Ketrew_pure.Target.id
          val make_pointer :
            from:Ketrew_pure.Target.Stored_target.target ->
            pointing_to:Ketrew_pure.Target.Stored_target.target ->
            Ketrew_pure.Target.Stored_target.t
        end
      module Summary :
        sig
          type full_target = Ketrew_pure.Target.t
          type t
          val to_yojson : Ketrew_pure.Target.Summary.t -> Yojson.Safe.json
          val of_yojson :
            Yojson.Safe.json ->
            Ketrew_pure.Target.Summary.t Ppx_deriving_yojson_runtime.error_or
          val create :
            Ketrew_pure.Target.Summary.full_target ->
            Ketrew_pure.Target.Summary.t
          val id :
            Ketrew_pure.Target.Summary.t -> Internal_pervasives.Unique_id.t
          val name : Ketrew_pure.Target.Summary.t -> string
          val depends_on :
            Ketrew_pure.Target.Summary.t -> Ketrew_pure.Target.id list
          val on_success_activate :
            Ketrew_pure.Target.Summary.t -> Ketrew_pure.Target.id list
          val on_failure_activate :
            Ketrew_pure.Target.Summary.t -> Ketrew_pure.Target.id list
          val metadata :
            Ketrew_pure.Target.Summary.t -> [ `String of string ] option
          val build_process :
            Ketrew_pure.Target.Summary.t ->
            Ketrew_pure.Target.Build_process.t
          val condition :
            Ketrew_pure.Target.Summary.t ->
            Ketrew_pure.Target.Condition.t option
          val equivalence :
            Ketrew_pure.Target.Summary.t -> Ketrew_pure.Target.Equivalence.t
          val tags : Ketrew_pure.Target.Summary.t -> string list
        end
    end
end