pub struct Recommendation {Show 23 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 near_duplicate_of: Vec<NearDuplicate>,
pub replay: Option<Value>,
pub status: RecStatus,
}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).
near_duplicate_of: Vec<NearDuplicate>Live lessons on the same entity this authored lesson restates in
other words (Policy::near_duplicate = flag). The reviewer’s call
stays theirs — the card shows the existing rule beside the proposal.
replay: Option<Value>A plan_revision’s rehearsal against the journaled runs of the live
plan (the runtime’s shadow report: per-run outcome under incumbent vs
candidate, effects out of support, spend) — computed at proposal
time when the substrate can, so the reviewer approves from evidence,
not prose. Absent when the substrate has no runtime or the plan has
no journaled runs.
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