Skip to main content

GepCapsule

Struct GepCapsule 

Source
pub struct GepCapsule {
Show 19 fields pub capsule_type: String, pub schema_version: String, pub id: String, pub trigger: Vec<String>, pub gene: String, pub summary: String, pub content: Option<CapsuleContent>, pub diff: Option<String>, pub strategy: Option<Vec<String>>, pub confidence: f32, pub blast_radius: BlastRadius, pub outcome: CapsuleOutcome, pub success_streak: Option<u32>, pub env_fingerprint: Option<EnvFingerprint>, pub model_name: Option<String>, pub asset_id: String, pub trigger_context: Option<TriggerContext>, pub reused_asset_id: Option<String>, pub source_type: CapsuleSourceType,
}
Expand description

GEP-compatible Capsule definition

Fields§

§capsule_type: String

Asset type - always “Capsule”

§schema_version: String

Protocol schema version

§id: String

Unique identifier (e.g., capsule_1708123456789)

§trigger: Vec<String>

Signals that triggered this evolution

§gene: String

ID of the gene used

§summary: String

Human-readable description

§content: Option<CapsuleContent>

Structured description

§diff: Option<String>

Git diff of actual code changes

§strategy: Option<Vec<String>>

Ordered execution steps

§confidence: f32

Confidence 0.0-1.0

§blast_radius: BlastRadius

Blast radius

§outcome: CapsuleOutcome

Outcome

§success_streak: Option<u32>

Consecutive successes with this gene

§env_fingerprint: Option<EnvFingerprint>

Runtime environment snapshot

§model_name: Option<String>

LLM model that produced this capsule

§asset_id: String

Content-addressable hash

§trigger_context: Option<TriggerContext>

Trigger context (optional)

§reused_asset_id: Option<String>

ID of reused capsule (if reused)

§source_type: CapsuleSourceType

Source type: generated, reused, or reference

Implementations§

Source§

impl GepCapsule

Source

pub fn new( id: String, trigger: Vec<String>, gene: String, summary: String, diff: String, confidence: f32, ) -> Result<Self, AssetIdError>

Create a new GEP Capsule with computed asset_id

Source

pub fn validate(&self) -> Result<(), String>

Validate the capsule has minimum substance

Source

pub fn with_content(self, content: CapsuleContent) -> Self

Set the content

Source

pub fn with_strategy(self, strategy: Vec<String>) -> Self

Set the strategy

Source

pub fn with_blast_radius(self, files: usize, lines: usize) -> Self

Set the blast radius

Source

pub fn with_trigger_context(self, ctx: TriggerContext) -> Self

Set the trigger context

Source

pub fn as_reused(self, reused_id: String) -> Self

Mark as reused capsule

Trait Implementations§

Source§

impl Clone for GepCapsule

Source§

fn clone(&self) -> GepCapsule

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GepCapsule

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for GepCapsule

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<&Capsule> for GepCapsule

Convert from Oris core Capsule to GEP Capsule

Source§

fn from(oris_capsule: &Capsule) -> Self

Converts to this type from the input type.
Source§

impl Serialize for GepCapsule

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,