Skip to main content

Recommendation

Struct Recommendation 

Source
pub struct Recommendation {
Show 21 fields pub hash: String, pub analyzer: String, pub params_snapshot: Map<String, Value>, pub origin: Origin, pub target_ref: String, pub action_kind: ActionKind, pub dedup_key: String, pub summary: Summary, pub severity: Severity, pub proposal: Proposal, pub destructive: bool, pub rollbackable: bool, pub evidence: Vec<String>, pub evidence_query: Option<String>, pub metric: Option<MetricSnapshot>, pub confidence: f64, pub importance: f64, pub created_at_ms: i64, pub guidance: Option<String>, pub evalset_hash: Option<String>, pub status: RecStatus,
}
Expand description

A stored recommendation. hash (the content address) and status (the index-layer cache) are set by the engine, not serialized into the grain body — the body is immutable content, the lifecycle lives in the state index and the audit chain.

Fields§

§hash: String§analyzer: String§params_snapshot: Map<String, Value>§origin: Origin§target_ref: String§action_kind: ActionKind§dedup_key: String§summary: Summary§severity: Severity§proposal: Proposal§destructive: bool§rollbackable: bool§evidence: Vec<String>§evidence_query: Option<String>§metric: Option<MetricSnapshot>§confidence: f64§importance: f64§created_at_ms: i64§guidance: Option<String>

Optional LLM guidance: an ENRICH note on a deterministic recommendation, or an origin = llm draft’s own rationale (§9). Whitelisted, capped text — it never replaces the engine-templated summary.

§evalset_hash: Option<String>

Rule E1’s pin (§7.4): the evalset hash a code_revision was gated against — REQUIRED for code targets, forbidden elsewhere (a recommendation targets code XOR an evalset, never both, and only code carries the pin). Shown at review; checked live at apply (superseded evalset ⇒ the pin is stale ⇒ re-gate).

§status: RecStatus

Implementations§

Source§

impl Recommendation

Source

pub fn to_grain_spec(&self, namespace: &str) -> Result<GrainSpec>

Serialize the immutable body into grain fields (excludes hash/status).

Source

pub fn from_fields(hash: &str, fields: &Map<String, Value>) -> Result<Self>

Reconstruct from a stored grain body. hash comes from the record’s address; status is supplied from the state index by the caller. Rule E1 is RE-CHECKED here — a hand-authored recommendation grain must not smuggle an unpinned code revision past the stamped path.

Trait Implementations§

Source§

impl Clone for Recommendation

Source§

fn clone(&self) -> Recommendation

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Recommendation

Source§

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

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

impl<'de> Deserialize<'de> for Recommendation

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 PartialEq for Recommendation

Source§

fn eq(&self, other: &Recommendation) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Recommendation

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
Source§

impl StructuralPartialEq for Recommendation

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.