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::*;

/// Compliance / legal evidence bundle (TF-0012). Captures who acted, what authority they had, what policy allowed/denied the action, what approval was given, whether quorum was met, what proof was generated, when it happened, and whether the event chain is tamper-evident.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct EvidenceBundle {
    /// Version of the evidence-bundle schema.
    pub evidence_version: EvidenceBundle_EvidenceVersion,
    /// Stable identifier for this evidence bundle.
    pub bundle_id: String,
    pub trust_domain: TrustDomain,
    /// Incident the bundle is collecting evidence for.
    pub incident: EvidenceBundle_Incident,
    /// Distinct actors involved in this incident.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub actors: Option<Vec<ActorId>>,
    /// Proof events that constitute the audit trail. Order is the original hash-chain order.
    pub events: Vec<ProofEvent>,
    /// Policy decisions consulted while the incident unfolded.
    pub policy_decisions: Vec<PolicyDecision>,
    /// Approval responses captured during the incident.
    pub approvals: Vec<ApprovalResponse>,
    /// Ceremony records for each approval (so audits can see how each approval was collected).
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub ceremonies: Option<Vec<ApprovalCeremony>>,
    /// Quorum outcomes for any quorum-bound approval that resolved during the incident.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub quorum_outcomes: Option<Vec<EvidenceBundle_QuorumOutcomes_Item>>,
    /// Transparency-log / RFC 3161 anchors that strengthen this evidence.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub anchors: Option<Vec<EvidenceBundle_Anchors_Item>>,
    /// Optional L4 sealed evidence — the events array may be empty if the payload is sealed.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub encrypted_payload: Option<ProofBundleEncrypted>,
    /// Highest proof level any single event in this bundle was emitted at.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub level: Option<EvidenceBundle_Level>,
    pub issued_at: Timestamp,
    pub issuer: ActorId,
    pub signature: SignatureEnvelope,
}

#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct EvidenceBundle_Anchors_Item {
    /// Anchor backend kind.
    pub kind: String,
    /// Endpoint URL the anchor was submitted to.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub url: Option<String>,
    /// Backend-specific inclusion-proof blob.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub inclusion_proof: Option<serde_json::Value>,
}

/// Version of the evidence-bundle schema.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum EvidenceBundle_EvidenceVersion {
    #[serde(rename = "1")]
    V1,
}

/// Incident the bundle is collecting evidence for.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct EvidenceBundle_Incident {
    /// Human-readable incident label.
    pub label: String,
    pub started_at: Timestamp,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub ended_at: Option<Timestamp>,
    /// TF-0012 domain tags this evidence applies to.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub domains: Option<Vec<String>>,
    /// Free-text incident description.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub description: Option<String>,
}

/// Highest proof level any single event in this bundle was emitted at.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum EvidenceBundle_Level {
    #[serde(rename = "L0")]
    L0,
    #[serde(rename = "L1")]
    L1,
    #[serde(rename = "L2")]
    L2,
    #[serde(rename = "L3")]
    L3,
    #[serde(rename = "L4")]
    L4,
    #[serde(rename = "L5")]
    L5,
}

#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct EvidenceBundle_QuorumOutcomes_Item {
    /// ApprovalRequest the quorum resolved.
    pub request_id: String,
    /// Number of approvers required.
    pub min_approvers: i64,
    /// Eligible approver set.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub of: Option<Vec<ActorId>>,
    /// Subset of `of` that signed approve.
    pub approvers: Vec<ActorId>,
    /// Final aggregated decision.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub decision: Option<String>,
}