Cantrip.WardPolicy (Cantrip v1.3.3)

Copy Markdown View Source

Wards are the policy that bounds your loop. The runtime resolves them here: numeric and boolean wards compose by tightening, while passthrough ward data remains explicit policy for the gate or medium that enforces it.

Pure ward resolution and inspection.

Wards are policy data. This module is the Elixir-native home for resolving and querying those policies, leaving Cantrip.Circle as circle configuration data.

Summary

Functions

code_eval_timeout_ms(wards)

@spec code_eval_timeout_ms([map()]) :: pos_integer()

compose(parent_wards, child_wards)

@spec compose([map()], [map()]) :: [map()]

get(wards, key, default \\ nil)

@spec get([map()], atom(), term()) :: term()

max_batch_size(wards)

@spec max_batch_size([map()]) :: pos_integer()

max_children_total(wards)

@spec max_children_total([map()]) :: non_neg_integer() | nil

max_concurrent_children(wards)

@spec max_concurrent_children([map()]) :: pos_integer()

max_depth(wards)

@spec max_depth([map()]) :: non_neg_integer() | nil

max_turns(wards)

@spec max_turns([map()]) :: pos_integer() | nil

require_done_tool?(wards)

@spec require_done_tool?([map()]) :: boolean()

sandbox(wards)

@spec sandbox([map()]) :: atom() | nil

validate_child_spawn(parent_wards, child_circle)

@spec validate_child_spawn([map()], Cantrip.Circle.t() | map()) ::
  :ok | {:error, String.t()}