Public declaration syntax from forge-rs/crates/forge-code-safety/src/approval.rs Original source SHA-256: a0eb59fe0fcba3cbe2cf6385565358fea5dfad1003a1ea3357c54cd316a7c592 Function bodies and constant values are omitted. This is not the complete implementation. Source line 49 #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ApprovalRequest { /// The DID of the agent requesting approval. pub agent_did: String, /// The operation type (e.g., "delete", "modify_protected", "force_push"). pub operation: String, /// The file or directory path the operation targets. pub path: PathBuf, /// The assessed risk level of the operation. pub risk_level: RiskLevel, /// The agent's justification for why the operation is needed. pub justification: String } Source line 64 #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ApprovalResponse { /// Unique identifier for this approval decision. pub decision_id: String, /// Whether the operation was approved. pub approved: bool, /// The entity that made the approval decision. pub reviewer: String, /// Why the decision was made. pub reason: String, /// When the decision was made. pub decided_at: DateTime, /// Optional conditions attached to the approval. pub conditions: Vec } Source line 89 #[async_trait] pub trait ApprovalGate: Send + Sync { /// Requests approval for a file operation. /// /// # Arguments /// /// * `request` - The approval request with details about the operation. /// /// # Returns /// /// An [`ApprovalResponse`] indicating whether the operation was approved. async fn request_approval(&self, request: &ApprovalRequest) -> ApprovalResponse; } Source line 106 pub struct AutoDenyGate; Source line 130 pub struct AutoApproveGate; Source line 155 pub struct RiskBasedGate { } Source line 167 pub fn new(max_auto_approve: RiskLevel) -> Self;