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: RecStatusImplementations§
Source§impl Recommendation
impl Recommendation
Sourcepub fn to_grain_spec(&self, namespace: &str) -> Result<GrainSpec>
pub fn to_grain_spec(&self, namespace: &str) -> Result<GrainSpec>
Serialize the immutable body into grain fields (excludes hash/status).
Sourcepub fn from_fields(hash: &str, fields: &Map<String, Value>) -> Result<Self>
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
impl Clone for Recommendation
Source§fn clone(&self) -> Recommendation
fn clone(&self) -> Recommendation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more