pub struct Agent { /* private fields */ }Expand description
Agent for deterministic AI-driven code operations.
The agent follows a strict loop:
- Observe: Gather context from the graph
- Constrain: Apply policy rules
- Plan: Generate execution steps
- Mutate: Apply changes
- Verify: Validate results
- Commit: Finalize transaction
Implementations§
Source§impl Agent
impl Agent
Sourcepub async fn observe(&self, query: &str) -> Result<Observation>
pub async fn observe(&self, query: &str) -> Result<Observation>
Observes the codebase to gather context for a query.
§Arguments
query- The natural language query or request
Sourcepub async fn constrain(
&self,
observation: Observation,
policies: Vec<Policy>,
) -> Result<ConstrainedPlan>
pub async fn constrain( &self, observation: Observation, policies: Vec<Policy>, ) -> Result<ConstrainedPlan>
Applies policy constraints to the observation.
§Arguments
observation- The observation to constrainpolicies- The policies to validate
Sourcepub async fn plan(&self, constrained: ConstrainedPlan) -> Result<ExecutionPlan>
pub async fn plan(&self, constrained: ConstrainedPlan) -> Result<ExecutionPlan>
Generates an execution plan from the constrained observation.
Sourcepub async fn mutate(&self, plan: ExecutionPlan) -> Result<MutationResult>
pub async fn mutate(&self, plan: ExecutionPlan) -> Result<MutationResult>
Executes the mutation phase of the plan.
Sourcepub async fn verify(
&self,
_result: MutationResult,
) -> Result<VerificationResult>
pub async fn verify( &self, _result: MutationResult, ) -> Result<VerificationResult>
Verifies the mutation result.
Sourcepub async fn commit(&self, result: VerificationResult) -> Result<CommitResult>
pub async fn commit(&self, result: VerificationResult) -> Result<CommitResult>
Commits the verified mutation.
Auto Trait Implementations§
impl Freeze for Agent
impl RefUnwindSafe for Agent
impl Send for Agent
impl Sync for Agent
impl Unpin for Agent
impl UnsafeUnpin for Agent
impl UnwindSafe for Agent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more