tf-types 0.1.6

Core semantic types, traits, and schemas powering the TrustForge protocol.
Documentation
// GENERATED by `tf-schema codegen --target rust` — DO NOT EDIT BY HAND.

#![allow(unused_imports, non_camel_case_types, non_snake_case, clippy::all)]

use serde::{Deserialize, Serialize};
use super::*;

/// Catalog entry for one dangerous action.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct CatalogEntry {
    /// Dotted action name, e.g. file.delete.
    pub name: ActionName,
    /// Danger categories assigned to this action.
    pub danger_tags: Vec<DangerTag>,
    /// Risk class the catalog recommends.
    pub default_risk: RiskClass,
    /// Approval requirement the catalog recommends.
    pub default_approval: ApprovalRequirement,
    /// Whether this action is intrinsically reversible.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub default_reversible: Option<bool>,
    /// Tags that any contract using this action MUST also declare. Used by the deep validator.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub mandatory_tags: Option<Vec<DangerTag>>,
    /// Human-readable description of why this action is dangerous.
    pub description: String,
}

/// Canonical catalog of action names with their danger tags and default enforcement. Consumed by the agent-contract deep validator and AI integration guide.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct DangerousActions {
    /// Version of the dangerous-actions catalog schema itself.
    pub dangerous_actions_version: DangerousActions_DangerousActionsVersion,
    /// Stable catalog identifier, e.g. tf-dangerous-std.
    pub catalog_id: String,
    /// Human-readable description of this catalog.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub description: Option<String>,
    /// Known-dangerous action entries. Contracts should cross-reference this catalog when declaring danger_tags.
    pub actions: Vec<CatalogEntry>,
}

/// Version of the dangerous-actions catalog schema itself.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum DangerousActions_DangerousActionsVersion {
    #[serde(rename = "1")]
    V1,
}