pub struct TypesRootIntent {
pub id: IntentId,
pub kind: TypesIntentKind,
pub request: String,
pub objective: Option<TypesObjective>,
pub risk_posture: RiskPosture,
pub constraints: Vec<TypesIntentConstraint>,
pub active_packs: Vec<PackId>,
pub success_criteria: Vec<Criterion>,
pub budgets: TypesBudgets,
pub created_at: Option<Timestamp>,
}Expand description
Root Intent using builder pattern.
This is a modern version using typed-builder. The existing root_intent.rs RootIntent remains for backward compatibility.
§Example
use converge_core::types::{
TypesRootIntent, TypesIntentKind, TypesObjective, RiskPosture,
TypesBudgets, Criterion,
};
use converge_core::types::IntentId;
let intent = TypesRootIntent::builder()
.id(IntentId::new("intent-1"))
.kind(TypesIntentKind::GrowthStrategy)
.request("Find growth opportunities in Nordic B2B")
.objective(Some(TypesObjective::IncreaseDemand))
.risk_posture(RiskPosture::Balanced)
.success_criteria(vec![
Criterion::required("roi", "Achieve 15% ROI"),
])
.build();
assert_eq!(intent.id.as_str(), "intent-1");Fields§
§id: IntentIdUnique identifier.
kind: TypesIntentKindWhat kind of problem this addresses.
request: StringThe “job to be done” - the request from the user.
objective: Option<TypesObjective>Objective (what to optimize for).
risk_posture: RiskPostureRisk posture for execution.
constraints: Vec<TypesIntentConstraint>Constraints on execution.
active_packs: Vec<PackId>Which packs should participate in this run.
success_criteria: Vec<Criterion>Success criteria (per CONTEXT.md: RootIntent contains success_criteria).
budgets: TypesBudgetsExecution budgets.
created_at: Option<Timestamp>When the intent was created.
Implementations§
Source§impl TypesRootIntent
impl TypesRootIntent
Sourcepub fn builder() -> TypesRootIntentBuilder
pub fn builder() -> TypesRootIntentBuilder
Create a builder for building TypesRootIntent.
On the builder, call .id(...), .kind(...), .request(...), .objective(...)(optional), .risk_posture(...)(optional), .constraints(...)(optional), .active_packs(...)(optional), .success_criteria(...)(optional), .budgets(...)(optional), .created_at(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of TypesRootIntent.
Source§impl TypesRootIntent
impl TypesRootIntent
Sourcepub fn has_required_criteria(&self) -> bool
pub fn has_required_criteria(&self) -> bool
Check if this intent has required success criteria.
Sourcepub fn is_within_budgets(&self, cycles: u32, facts: u32) -> bool
pub fn is_within_budgets(&self, cycles: u32, facts: u32) -> bool
Check if all budgets are within limits.
Sourcepub fn hard_constraints(&self) -> impl Iterator<Item = &TypesIntentConstraint>
pub fn hard_constraints(&self) -> impl Iterator<Item = &TypesIntentConstraint>
Get hard constraints only.
Sourcepub fn activates_pack(&self, pack_id: &PackId) -> bool
pub fn activates_pack(&self, pack_id: &PackId) -> bool
Check whether a pack is active for this intent.
Trait Implementations§
Source§impl Clone for TypesRootIntent
impl Clone for TypesRootIntent
Source§fn clone(&self) -> TypesRootIntent
fn clone(&self) -> TypesRootIntent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more