pub struct ContractSister { /* private fields */ }Expand description
Contract facade wrapping the ContractEngine with SDK trait implementations.
Contract is session-scoped: policies and governance rules are loaded into a session context and can be queried, grounded, and audited.
Trait Implementations§
Source§impl EventEmitter for ContractSister
impl EventEmitter for ContractSister
Source§fn subscribe(&self, _filter: EventFilter) -> EventReceiver
fn subscribe(&self, _filter: EventFilter) -> EventReceiver
Subscribe to events with optional filter.
Source§fn recent_events(&self, limit: usize) -> Vec<SisterEvent>
fn recent_events(&self, limit: usize) -> Vec<SisterEvent>
Get recent events.
Source§fn emit(&self, event: SisterEvent)
fn emit(&self, event: SisterEvent)
Emit an event (for internal use).
Source§impl FileFormatReader for ContractSister
impl FileFormatReader for ContractSister
Source§fn read_file(path: &Path) -> SisterResult<Self>where
Self: Sized,
fn read_file(path: &Path) -> SisterResult<Self>where
Self: Sized,
Read a file with version handling
Source§fn can_read(path: &Path) -> SisterResult<FileInfo>
fn can_read(path: &Path) -> SisterResult<FileInfo>
Check if a file is readable (without full parse).
Returns file info for quick inspection
Source§fn file_version(path: &Path) -> SisterResult<Version>
fn file_version(path: &Path) -> SisterResult<Version>
Get file version without full parse
Source§impl FileFormatWriter for ContractSister
impl FileFormatWriter for ContractSister
Source§fn write_file(&self, path: &Path) -> SisterResult<()>
fn write_file(&self, path: &Path) -> SisterResult<()>
Write to a file path
Source§impl Grounding for ContractSister
impl Grounding for ContractSister
Source§fn ground(&self, claim: &str) -> SisterResult<GroundingResult>
fn ground(&self, claim: &str) -> SisterResult<GroundingResult>
Verify a claim against stored evidence. Read more
Source§fn evidence(
&self,
query: &str,
max_results: usize,
) -> SisterResult<Vec<EvidenceDetail>>
fn evidence( &self, query: &str, max_results: usize, ) -> SisterResult<Vec<EvidenceDetail>>
Get detailed evidence for a query. Read more
Source§fn suggest(
&self,
_query: &str,
limit: usize,
) -> SisterResult<Vec<GroundingSuggestion>>
fn suggest( &self, _query: &str, limit: usize, ) -> SisterResult<Vec<GroundingSuggestion>>
Find similar items when an exact match fails. Read more
Source§impl Queryable for ContractSister
impl Queryable for ContractSister
Source§fn query(&self, query: Query) -> SisterResult<QueryResult>
fn query(&self, query: Query) -> SisterResult<QueryResult>
Execute a query.
Source§fn supports_query(&self, query_type: &str) -> bool
fn supports_query(&self, query_type: &str) -> bool
Check if a query type is supported.
Source§fn query_types(&self) -> Vec<QueryTypeInfo>
fn query_types(&self) -> Vec<QueryTypeInfo>
List supported query types.
Source§fn search(&self, text: &str) -> Result<QueryResult, SisterError>
fn search(&self, text: &str) -> Result<QueryResult, SisterError>
Execute a simple search query.
Source§fn recent(&self, count: usize) -> Result<QueryResult, SisterError>
fn recent(&self, count: usize) -> Result<QueryResult, SisterError>
Get recent items.
Source§fn list(&self, limit: usize, offset: usize) -> Result<QueryResult, SisterError>
fn list(&self, limit: usize, offset: usize) -> Result<QueryResult, SisterError>
List items with pagination.
Source§impl ReceiptIntegration for ContractSister
impl ReceiptIntegration for ContractSister
Source§fn create_receipt(&self, action: ActionRecord) -> SisterResult<ReceiptId>
fn create_receipt(&self, action: ActionRecord) -> SisterResult<ReceiptId>
Create a receipt for an action (via Identity).
Source§fn get_receipt(&self, id: ReceiptId) -> SisterResult<Receipt>
fn get_receipt(&self, id: ReceiptId) -> SisterResult<Receipt>
Get receipt by ID (from Identity).
Source§fn list_receipts(&self, _filter: ReceiptFilter) -> SisterResult<Vec<Receipt>>
fn list_receipts(&self, _filter: ReceiptFilter) -> SisterResult<Vec<Receipt>>
List receipts for this sister.
Source§fn receipt_count(&self) -> Result<u64, SisterError>
fn receipt_count(&self) -> Result<u64, SisterError>
Get receipt count.
Source§fn receipts_for_action(
&self,
action_type: &str,
) -> Result<Vec<Receipt>, SisterError>
fn receipts_for_action( &self, action_type: &str, ) -> Result<Vec<Receipt>, SisterError>
Get receipts for a specific action type.
Source§impl SessionManagement for ContractSister
impl SessionManagement for ContractSister
Source§fn start_session(&mut self, name: &str) -> SisterResult<ContextId>
fn start_session(&mut self, name: &str) -> SisterResult<ContextId>
Start a new session. Returns the session ID.
The previous session (if any) is automatically ended
Source§fn end_session(&mut self) -> SisterResult<()>
fn end_session(&mut self) -> SisterResult<()>
End the current session.
After this, a new session must be started before operations
Source§fn current_session(&self) -> Option<ContextId>
fn current_session(&self) -> Option<ContextId>
Get the current session ID.
Returns None if no session is active
Source§fn current_session_info(&self) -> SisterResult<ContextInfo>
fn current_session_info(&self) -> SisterResult<ContextInfo>
Get info about the current session
Source§fn list_sessions(&self) -> SisterResult<Vec<ContextSummary>>
fn list_sessions(&self) -> SisterResult<Vec<ContextSummary>>
List all past sessions (most recent first)
Source§fn export_session(&self, _id: ContextId) -> SisterResult<ContextSnapshot>
fn export_session(&self, _id: ContextId) -> SisterResult<ContextSnapshot>
Export a session as a snapshot (for backup/transfer)
Source§fn import_session(
&mut self,
snapshot: ContextSnapshot,
) -> SisterResult<ContextId>
fn import_session( &mut self, snapshot: ContextSnapshot, ) -> SisterResult<ContextId>
Import a session from a snapshot
Source§fn start_session_with_metadata(
&mut self,
name: &str,
metadata: HashMap<String, Value>,
) -> Result<ContextId, SisterError>
fn start_session_with_metadata( &mut self, name: &str, metadata: HashMap<String, Value>, ) -> Result<ContextId, SisterError>
Start a new session with metadata
Source§fn get_session_info(&self, id: ContextId) -> Result<ContextInfo, SisterError>
fn get_session_info(&self, id: ContextId) -> Result<ContextInfo, SisterError>
Get info about a specific past session
Source§impl Sister for ContractSister
impl Sister for ContractSister
Source§const SISTER_TYPE: SisterType = SisterType::Contract
const SISTER_TYPE: SisterType = SisterType::Contract
The type of this sister
Source§const FILE_EXTENSION: &'static str = "acon"
const FILE_EXTENSION: &'static str = "acon"
File extension for this sister’s format (without dot)
Source§fn init(config: SisterConfig) -> SisterResult<Self>where
Self: Sized,
fn init(config: SisterConfig) -> SisterResult<Self>where
Self: Sized,
Initialize the sister with configuration
Source§fn health(&self) -> HealthStatus
fn health(&self) -> HealthStatus
Check health status
Source§fn shutdown(&mut self) -> SisterResult<()>
fn shutdown(&mut self) -> SisterResult<()>
Shutdown gracefully
Source§fn capabilities(&self) -> Vec<Capability>
fn capabilities(&self) -> Vec<Capability>
Get capabilities this sister provides
Source§fn sister_type(&self) -> SisterType
fn sister_type(&self) -> SisterType
Get the sister type
Source§fn file_extension(&self) -> &'static str
fn file_extension(&self) -> &'static str
Get the file extension
Source§fn is_healthy(&self) -> bool
fn is_healthy(&self) -> bool
Check if the sister is healthy
Source§fn mcp_prefix(&self) -> &'static str
fn mcp_prefix(&self) -> &'static str
Get MCP tool prefix
Auto Trait Implementations§
impl !Freeze for ContractSister
impl RefUnwindSafe for ContractSister
impl Send for ContractSister
impl Sync for ContractSister
impl Unpin for ContractSister
impl UnsafeUnpin for ContractSister
impl UnwindSafe for ContractSister
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more