Skip to main content

Crate agentic_contracts

Crate agentic_contracts 

Source
Expand description

§Agentic Contracts v0.2.0

Shared contracts for the AgenticOS ecosystem.

This crate defines the traits, types, and standards that ALL sisters must implement. It serves as the single source of truth for:

  • Sister trait: Core lifecycle management
  • SessionManagement / WorkspaceManagement: Context handling (split in v0.2.0)
  • Grounding trait: Query-based evidence verification (rewritten in v0.2.0)
  • EventEmitter trait: Observability events
  • Queryable trait: Standard query interface
  • FileFormat traits: 20-year compatible file I/O (trait-based in v0.2.0)
  • Errors: Two-layer error model — ProtocolError + SisterError (new in v0.2.0)
  • Hydra: Placeholder traits for orchestrator integration (new in v0.2.0)

§What changed in v0.2.0

v0.1.0 was written based on THEORY. v0.2.0 was validated against REALITY (the actual implementations in 5 shipped sisters).

Key changes:

  • SisterFileHeader (96-byte “AGNT”) → FileFormatReader/FileFormatWriter traits
  • ContextManagement → split into SessionManagement + WorkspaceManagement
  • Grounding → query-based (no evidence_id), three methods: ground/evidence/suggest
  • SisterConfig → flexible data paths (single, multiple, or none)
  • Added ProtocolError for MCP/JSON-RPC errors (separate from SisterError)
  • Added hydra module with HydraBridge and ExecutionGate placeholders

§Usage

[dependencies]
agentic-contracts = "0.2"
use agentic_contracts::prelude::*;

pub struct MyNewSister {
    // ...
}

impl Sister for MyNewSister {
    const SISTER_TYPE: SisterType = SisterType::Memory;
    const FILE_EXTENSION: &'static str = "amem";
    // ...
}

§The Promise

  • ANY sister can be consumed by Hydra uniformly
  • ANY sister can work with ANY other sister
  • ANY file format will be readable in 20 years

Re-exports§

pub use prelude::*;

Modules§

context
Context management traits for all sisters.
errors
Standard error types for all sisters.
events
Event emission trait for observability.
file_format
File format specifications for 20-year compatibility.
grounding
Grounding trait for evidence verification (V2 Pattern).
hydra
Hydra integration placeholder traits.
prelude
query
Query trait for standard query interface.
receipts
Receipt integration with Identity sister.
sister
Core Sister trait that all sisters must implement.
types
Shared types used across all sisters.