Skip to main content

SopConfig

Struct SopConfig 

pub struct SopConfig {
Show 23 fields pub sops_dir: Option<String>, pub default_execution_mode: String, pub max_concurrent_total: usize, pub approval_timeout_secs: u64, pub max_finished_runs: usize, pub maintenance_interval_secs: u64, pub persist_runs: bool, pub run_store_backend: SopRunStoreBackend, pub run_state_dir: Option<String>, pub approval_mode: ApprovalMode, pub approval_timeout_action: ApprovalTimeoutAction, pub approval: SopApprovalConfig, pub step_scope_enforce: bool, pub step_mandatory_tools: Vec<String>, pub step_schema_enforce: bool, pub max_step_visits: u32, pub max_step_retries: u32, pub untrusted_payload_max_bytes: usize, pub untrusted_input_guard: String, pub untrusted_guard_sensitivity: f64, pub untrusted_frame_warning: bool, pub untrusted_outbound_redact: bool, pub procedural_memory_enabled: bool,
}
Expand description

Standard Operating Procedures engine configuration ([sop]).

The default_execution_mode field uses the SopExecutionMode type from sop::types (re-exported via sop::SopExecutionMode). To avoid circular module references, config stores it using the same enum definition.

Fields§

§sops_dir: Option<String>

Directory containing SOP definitions (subdirs with SOP.toml + SOP.md). A relative value resolves against the install root (matching the skill-bundles convention), so the documented shared/sops loads from <install>/shared/sops — the same directory the web/RPC SOP author writes to. An absolute or ~-prefixed value is used as-is. Unset by default; SOP runtime behavior activates only when this is set to a non-empty value, so leaving it unset (or an explicit empty value) keeps SOP loading disabled (unset/empty still falls back to <install>/shared/sops for offline CLI inspection).

§default_execution_mode: String

Default execution mode for SOPs that omit execution_mode. Values: auto, supervised (default), step_by_step, priority_based, deterministic.

§max_concurrent_total: usize

Maximum total concurrent SOP runs across all SOPs.

§approval_timeout_secs: u64

Approval timeout in seconds. When a run waits for approval longer than this, the configured approval_timeout_action is applied (default escalate: re-surface the gate to the out-of-band approver and never self-approve). Set to 0 to disable the timeout sweep.

§max_finished_runs: usize

Maximum number of finished runs kept in memory for status queries. Oldest runs are evicted when over capacity. 0 = unlimited.

§maintenance_interval_secs: u64

How often (seconds) the daemon runs the SOP maintenance tick: fire fail-closed approval timeouts (per approval_timeout_secs / approval_timeout_action), reap expired concurrency-claim leases, and prune terminal runs past max_finished_runs. Default 60; set to 0 to disable the tick entirely. The tick itself self-approves nothing - timeout handling is governed by approval_timeout_action (default escalate).

§persist_runs: bool

Persist run state durably across restarts. Default true: build_sop_engine selects the configured backend (sqlite) and in-flight runs - including runs parked at a HITL approval - survive a restart. This is the durable substrate the HITL admission model relies on so a pending approval is not lost when the daemon restarts. Set to false to opt back into ephemeral in-memory state.

§run_store_backend: SopRunStoreBackend

Durable run-state backend when persist_runs is true: sqlite (default, durable) or memory (explicitly non-durable, for tests/degraded).

§run_state_dir: Option<String>

Directory for the durable run store (created mode-0700). When omitted, <data_dir>/sop. Never OS-temp.

§approval_mode: ApprovalMode

WHO may clear a SOP approval gate. Layered with execution_mode / priority / requires_confirmation (those still apply). Default both keeps today’s behavior (the agent tool OR an out-of-band principal can clear a gate).

§approval_timeout_action: ApprovalTimeoutAction

What happens to a SOP gate that times out (after approval_timeout_secs). Default escalate is fail-closed: re-surface to the out-of-band approver and keep waiting, never self-approve. (The SOP-gate analog of the channel approval-routing fail-closed default; reconcile with that model if both land.)

§approval: SopApprovalConfig

Approval broker policy config ([sop.approval]): named approver groups and per-name approval policies (required group + quorum + escalation route) the approval broker consumes for group-membership and quorum checks. Members are channel-provided identities (a gateway user, a forge login), so this is a permanent identity source, not a stopgap; a future auth system adds another resolver alongside it rather than replacing it. An empty block means no broker policy applies (approval_mode alone governs a gate, unchanged behavior).

§step_scope_enforce: bool

Enforce per-step tool scope. Default false keeps tools: advisory.

§step_mandatory_tools: Vec<String>

Tool names that remain available while step scope is enforced.

§step_schema_enforce: bool

Enforce per-step input/output schemas when a step declares them.

§max_step_visits: u32

Maximum times a routed SOP run can visit one step.

§max_step_retries: u32

Maximum retries allowed by a step failure policy.

§untrusted_payload_max_bytes: usize

Maximum bytes accepted from untrusted SOP trigger payload/topic content before char-boundary truncation. 0 disables the cap.

§untrusted_input_guard: String

Prompt-guard action for untrusted SOP trigger input: warn, block, or sanitize.

§untrusted_guard_sensitivity: f64

Prompt-guard and outbound-redaction sensitivity for untrusted SOP content.

§untrusted_frame_warning: bool

Include the explanatory warning text inside untrusted-content frames. Boundary framing itself is always on once wired.

§untrusted_outbound_redact: bool

Redact outbound SOP content before persistence/audit consumers write it. Intended to converge with the shared B/F redaction switch once those consumers land.

§procedural_memory_enabled: bool

Enable SOP procedural-memory proposal tooling. Default false keeps self-modifying SOP write-back opt-in while the SOP subsystem is Experimental.

Implementations§

Source§

impl SopConfig

Source

pub fn configurable_prefix() -> &'static str

Returns the #[prefix] value for this Configurable struct.

Source

pub fn init_requires_explicit_config() -> bool

True when this struct has a required leaf field that a bare/ancestor-prefix init_defaults scaffold must not materialize (it would fill the field with its Rust Default, which prune_empty_leaves then strips on save, leaving a partial sub-table that fails strict reload). Explicitly targeting this section (or a descendant of it) still scaffolds regardless of this flag, so the section can be materialized for the operator to fill in.

Source

pub fn secret_fields(&self) -> Vec<SecretFieldInfo>

Returns metadata about all #[secret] fields on this struct and nested children.

Source

pub fn secret_field_terminals() -> Vec<&'static str>

Source

pub fn encrypt_secrets(&mut self, store: &SecretStore) -> Result<(), Error>

Encrypt all secret fields in place using the provided store.

Source

pub fn decrypt_secrets(&mut self, store: &SecretStore) -> Result<(), Error>

Decrypt all secret fields in place using the provided store.

Source

pub fn set_secret(&mut self, name: &str, value: String) -> Result<(), Error>

Set a secret field by its full dotted name, dispatching to nested children.

Source

pub fn prop_fields(&self) -> Vec<PropFieldInfo>

Returns metadata about all property fields on this struct and nested children.

Source

pub fn get_prop(&self, name: &str) -> Result<String, Error>

Get a property value by its full dotted name, returning it as a display string.

Source

pub fn set_prop(&mut self, name: &str, value_str: &str) -> Result<(), Error>

Set a property value by its full dotted name, parsing from string.

Source

pub fn prop_is_secret(name: &str) -> bool

Check if a property name refers to a secret field (static, no instance needed).

Source

pub fn init_defaults(&mut self, prefix: Option<&str>) -> Vec<&'static str>

Instantiate None nested sections whose prefix matches. Returns the prefixes that were initialized.

Source

pub fn map_key_sections() -> Vec<MapKeySection>

Enumerate every map-keyed (HashMap<String, T>) and list-shaped (Vec<T>) section discoverable from this Configurable’s tree. The dashboard / CLI consume this to surface “+ Add” affordances without hardcoding the section list.

Source

pub fn nested_section_help(name: &str) -> Option<&'static str>

Help blurb for a #[nested] field on this struct, sourced from the field-level /// docstring. Returns None for unknown names so callers can fall through to a different lookup.

Source

pub fn nested_section_group(name: &str) -> Option<&'static str>

Source

pub fn get_map_keys(&self, section_path: &str) -> Option<Vec<String>>

Return the current alias keys at section_path, or None if the path doesn’t resolve to a map-keyed section in this tree.

Source

pub fn nested_option_entries(&self) -> Vec<NestedOptionEntry>

Source

pub fn create_map_key( &mut self, section_path: &str, map_key: &str, ) -> Result<bool, String>

Source

pub fn delete_map_key( &mut self, section_path: &str, map_key: &str, ) -> Result<bool, String>

Source

pub fn rename_map_key( &mut self, section_path: &str, map_key: &str, new_key: &str, ) -> Result<bool, String>

Source§

impl SopConfig

Source

pub fn runtime_enabled(&self) -> bool

Whether the SOP runtime (engine, tools, maintenance tick, run store) is active for this config. SOP loading is gated on a concrete definitions directory: a non-empty sops_dir enables it; an unset or explicit empty string keeps it disabled (the default is unset, so SOP runtime is off until an operator opts in). This is the single source of truth for activation, so callers must not re-derive it from sops_dir.is_some() — that treats an empty string as enabled and would break the disable path.

Trait Implementations§

Source§

impl Clone for SopConfig

Source§

fn clone(&self) -> SopConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · §

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SopConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for SopConfig

Source§

fn default() -> SopConfig

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for SopConfig

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<SopConfig, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for SopConfig

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl MaskSecrets for SopConfig

Source§

fn mask_secrets(&mut self)

Source§

fn restore_secrets_from(&mut self, current: &SopConfig)

Source§

impl Serialize for SopConfig

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more