Skip to main content

tf_types/generated/
proof_event.rs

1// GENERATED by `tf-schema codegen --target rust` — DO NOT EDIT BY HAND.
2
3#![allow(unused_imports, non_camel_case_types, non_snake_case, clippy::all)]
4
5use serde::{Deserialize, Serialize};
6use super::*;
7
8/// Signed record of an important event (TF-0005). Hash-chain verification lives in Phase 2.
9#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
10pub struct ProofEvent {
11    /// Version of the proof-event schema itself.
12    pub event_version: ProofEvent_EventVersion,
13    /// Stable event identifier.
14    pub id: String,
15    /// Dotted event-type identifier, e.g. session.established, action.approved.
16    #[serde(rename = "type")]
17    pub type_: String,
18    /// Actor that produced the event.
19    pub actor_id: ActorId,
20    /// Specific actor instance that produced the event.
21    #[serde(skip_serializing_if = "Option::is_none", default)]
22    pub instance_id: Option<InstanceId>,
23    /// Session identifier this event belongs to.
24    #[serde(skip_serializing_if = "Option::is_none", default)]
25    pub session_id: Option<String>,
26    /// When the event occurred.
27    pub timestamp: Timestamp,
28    /// Proof level at which this event was emitted.
29    pub level: ProofLevel,
30    /// Reference to the object this event is about (capability ID, file hash, etc.).
31    #[serde(skip_serializing_if = "Option::is_none", default)]
32    pub subject_ref: Option<String>,
33    /// Hash of the event's associated payload.
34    #[serde(skip_serializing_if = "Option::is_none", default)]
35    pub payload_hash: Option<HashRef>,
36    /// Hash of the immediately preceding event in the hash-chain.
37    #[serde(skip_serializing_if = "Option::is_none", default)]
38    pub parent_hash: Option<HashRef>,
39    /// Free-form context object carried with the event.
40    #[serde(skip_serializing_if = "Option::is_none", default)]
41    pub context: Option<serde_json::Value>,
42    /// Chain of responsibility for this event: who/what authorised, requested, and executed the action. TF-0006 "chain of responsibility".
43    #[serde(skip_serializing_if = "Option::is_none", default)]
44    pub provenance: Option<ProofEvent_Provenance>,
45    /// Signature envelope over the canonical form of this event (not verified in the foundation phase).
46    pub signature: SignatureEnvelope,
47}
48
49/// Version of the proof-event schema itself.
50#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
51pub enum ProofEvent_EventVersion {
52    #[serde(rename = "1")]
53    V1,
54}
55
56/// Chain of responsibility for this event: who/what authorised, requested, and executed the action. TF-0006 "chain of responsibility".
57#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
58pub struct ProofEvent_Provenance {
59    /// Human originator.
60    #[serde(skip_serializing_if = "Option::is_none", default)]
61    pub human: Option<ActorId>,
62    /// AI agent that issued the request.
63    #[serde(skip_serializing_if = "Option::is_none", default)]
64    pub agent: Option<ActorId>,
65    /// Specific running instance of the agent.
66    #[serde(skip_serializing_if = "Option::is_none", default)]
67    pub instance: Option<InstanceId>,
68    /// Model identifier (provider-prefixed) the agent invoked, e.g. anthropic:claude-opus-4-7.
69    #[serde(skip_serializing_if = "Option::is_none", default)]
70    pub model: Option<String>,
71    /// Tool / function name (e.g. MCP tool) the agent called.
72    #[serde(skip_serializing_if = "Option::is_none", default)]
73    pub tool: Option<String>,
74    /// Action the agent originally asked to perform.
75    #[serde(skip_serializing_if = "Option::is_none", default)]
76    pub requested_action: Option<ActionName>,
77}