pub struct AnalyzeCtx<'a> { /* private fields */ }Expand description
The context handed to analyze. Read-only by construction.
Implementations§
Source§impl<'a> AnalyzeCtx<'a>
impl<'a> AnalyzeCtx<'a>
pub fn new( reader: &'a dyn SubstrateRead, params: &'a Params, namespaces: &'a [String], watermark_ms: Option<i64>, now_ms: i64, outcome_inputs: &'a [OutcomeInput], verdicts: &'a BTreeMap<String, String>, ) -> Self
Sourcepub fn with_decider(self, decider: Option<&'a Decider>) -> Self
pub fn with_decider(self, decider: Option<&'a Decider>) -> Self
Hand the analyzer the engine’s decision backend (or none). The engine sets it on a production pass and never on a replay.
Sourcepub fn decider(&self) -> Option<&'a Decider>
pub fn decider(&self) -> Option<&'a Decider>
The installed decision backend, if any. An analyzer that uses one must
check crate::decide::Decider::calibrated before letting a
probability propose or drop anything, and must treat an Err as “no
contribution” (fail-soft), never as a failed analysis.
Sourcepub fn verdict_for(&self, created_hash: &str) -> Option<&str>
pub fn verdict_for(&self, created_hash: &str) -> Option<&str>
The latest Verify-gate verdict for a grain an applied recommendation
created (held, regressed, drifted, held_costlier,
unmeasured), or None for a grain no apply created.
pub fn params(&self) -> &Params
pub fn now_ms(&self) -> i64
pub fn watermark_ms(&self) -> Option<i64>
pub fn capabilities(&self) -> Capabilities
pub fn outcome_inputs(&self) -> &[OutcomeInput]
Sourcepub fn grains_of_type(
&self,
grain_type: &str,
opts: ReadOpts,
) -> Result<Vec<GrainRecord>>
pub fn grains_of_type( &self, grain_type: &str, opts: ReadOpts, ) -> Result<Vec<GrainRecord>>
All grains of a type across the configured namespaces (or all namespaces when none are configured).
Sourcepub fn facts(&self) -> Result<Vec<GrainRecord>>
pub fn facts(&self) -> Result<Vec<GrainRecord>>
Live facts across configured namespaces.
Sourcepub fn observations(&self) -> Result<Vec<GrainRecord>>
pub fn observations(&self) -> Result<Vec<GrainRecord>>
Live observations across configured namespaces.
Sourcepub fn grains_in(
&self,
grain_type: &str,
namespace: &str,
) -> Result<Vec<GrainRecord>>
pub fn grains_in( &self, grain_type: &str, namespace: &str, ) -> Result<Vec<GrainRecord>>
Live grains of one type in ONE explicit namespace — for analyzers
whose datasource lives in a well-known system namespace (the run
journals in agent:harness) regardless of the sweep’s configured
scope.
Sourcepub fn skills(&self) -> Result<Vec<GrainRecord>>
pub fn skills(&self) -> Result<Vec<GrainRecord>>
Live Skill grains across configured namespaces.
Sourcepub fn goals(&self) -> Result<Vec<GrainRecord>>
pub fn goals(&self) -> Result<Vec<GrainRecord>>
Live Goal grains across configured namespaces.
Sourcepub fn tools_since(&self, since_ms: Option<i64>) -> Result<Vec<GrainRecord>>
pub fn tools_since(&self, since_ms: Option<i64>) -> Result<Vec<GrainRecord>>
Tool grains (captured tool calls), optionally windowed by a since
watermark, live only. The flagship analyzer’s input.
Sourcepub fn heads(&self) -> Result<Vec<HeadGroup>>
pub fn heads(&self) -> Result<Vec<HeadGroup>>
Entities with more than one live head (requires the forks capability).
Sourcepub fn telemetry(&self) -> Result<Option<TelemetryView>>
pub fn telemetry(&self) -> Result<Option<TelemetryView>>
A snapshot of the recall-telemetry rollups (requires the telemetry
capability). None when the substrate has no sidecar — a telemetry-fed
analyzer then degrades to an activation-ladder entry.