sigil-crucible · run
Source declarations, signatures and documentation for run.
Source: sigil/node/sigil-crucible/src/run.rs. SHA-256: d0df4cfc9323a5eaea09c02bcf593bc142e260f077db8c6d2aac5efb7b1e39ba.
This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.
run::CruciblePolicy
Runtime policy for exposing Crucible. Canary/mainnet should boot with
fail_closed() until governance or an explicit launch gate enables it.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct CruciblePolicy {
pub enabled: bool,
pub coordinator_signed_verification: bool,
pub commitment_only_verification: bool,
pub redundant_verification: bool,
pub tee_verification: bool,
pub zk_verification: bool,
pub lineage_rewards: bool,
pub max_rollout_staleness_epochs: u64,
#[serde(default = "default_reward_token_id")]
pub reward_token_id: String,
pub reward_pool_account_did: String
}Source line: 9.
run::CruciblePolicy::fail_closed
pub fn fail_closed() -> Self;Source line: 24.
run::CruciblePolicy::mode_available
pub fn mode_available(&self, mode: VerifierMode) -> bool;Source line: 39.
run::CruciblePolicy::from_env
pub fn from_env() -> Result<Self, CrucibleError>;Source line: 49.
run::CruciblePolicy::require_enabled
pub fn require_enabled(&self) -> Result<(), CrucibleError>;Source line: 102.
run::CruciblePolicy::require_mode
pub fn require_mode(&self, mode: VerifierMode) -> Result<(), CrucibleError>;Source line: 110.
run::RolloutPolicy
Versioned rollout verification policy selected at run open.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct RolloutPolicy {
pub version: u32,
pub verifier_mode: VerifierMode,
pub max_staleness_epochs: u64,
pub min_verifier_attestations: u32,
pub allow_commitment_only: bool
}Source line: 122.
run::TrainingRunConfig
Immutable run configuration committed at open.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct TrainingRunConfig {
pub run_id: String,
pub coordinator_did: String,
pub reward_token_id: String,
pub reward_pool: u64,
pub model_family: String,
pub objective_commitment: ArtifactCommitment,
pub policy: RolloutPolicy,
pub eligible_verifier_dids: Vec<String>,
pub authorized_publishers: Vec<String>,
pub opened_at_epoch: u64,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub deadline_epoch: Option<u64>
}Source line: 132.
run::TrainingRunStatus
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum TrainingRunStatus {
Open,
Closed,
Cancelled,
}Source line: 149.
run::CloseReason
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum CloseReason {
Completed,
Expired,
Cancelled,
}Source line: 157.
run::TrainingRun
On-chain run state. It anchors policy, pool accounting, and weight heads; rollout bytes and model weights remain off-chain behind commitments.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct TrainingRun {
pub config: TrainingRunConfig,
pub status: TrainingRunStatus,
pub reward_pool_remaining: u64,
#[serde(default)]
pub reward_pool_reserved: u64,
#[serde(default)]
pub reward_pool_distributed: u64,
pub current_policy_version: u32,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub current_weight_root: Option<SigilHash>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub previous_weight_root: Option<SigilHash>,
pub opened_at_epoch: u64,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub closed_at_epoch: Option<u64>
}Source line: 166.
run::TrainingRun::open
pub fn open(
config: TrainingRunConfig,
launch_policy: &CruciblePolicy,
) -> Result<Self, CrucibleError>;Source line: 185.
run::TrainingRun::ensure_open
pub fn ensure_open(&self) -> Result<(), CrucibleError>;Source line: 231.
run::TrainingRun::verifier_is_eligible
pub fn verifier_is_eligible(&self, verifier_did: &str) -> bool;Source line: 239.
run::TrainingRun::publisher_is_authorized
pub fn publisher_is_authorized(&self, publisher_did: &str) -> bool;Source line: 249.
run::TrainingRun::reserve_reward
pub fn reserve_reward(&mut self, amount: u64) -> Result<(), CrucibleError>;Source line: 258.
run::TrainingRun::settle_reserved_reward
pub fn settle_reserved_reward(&mut self, amount: u64) -> Result<(), CrucibleError>;Source line: 278.
run::TrainingRun::refundable_reward_pool
pub fn refundable_reward_pool(&self) -> u64;Source line: 299.
run::TrainingRun::record_weight_root
pub fn record_weight_root(&mut self, model_root: SigilHash) -> Result<(), CrucibleError>;Source line: 304.
run::TrainingRun::can_close
pub fn can_close(&self, reason: CloseReason, current_epoch: u64) -> bool;Source line: 311.
run::TrainingRun::close
pub fn close(&mut self, reason: CloseReason, current_epoch: u64) -> Result<(), CrucibleError>;Source line: 327.