pub struct WorkingMemory {
pub attempts: Vec<AttemptRecord>,
pub node_risk_map: HashMap<String, NodeRisk>,
pub best_score: i32,
pub best_attempt: Option<usize>,
pub low_risk_alternatives: Vec<NodeInfo>,
}Expand description
The complete working state for an agent repair/task session. Generic — tracks what the agent has done, what worked, what failed.
Fields§
§attempts: Vec<AttemptRecord>§node_risk_map: HashMap<String, NodeRisk>§best_score: i32§best_attempt: Option<usize>§low_risk_alternatives: Vec<NodeInfo>Low-risk alternative nodes found by graph analysis (cached after high-coupling failure).
Implementations§
Source§impl WorkingMemory
impl WorkingMemory
pub fn new() -> Self
Sourcepub fn record_edit(
&mut self,
round: usize,
files: Vec<String>,
applied: usize,
total: usize,
gid_ctx: GidContext,
feedback: String,
)
pub fn record_edit( &mut self, round: usize, files: Vec<String>, applied: usize, total: usize, gid_ctx: GidContext, feedback: String, )
Record an EDIT action with GID context.
Sourcepub fn record_test(
&mut self,
round: usize,
outcome: TestOutcome,
raw_feedback: String,
)
pub fn record_test( &mut self, round: usize, outcome: TestOutcome, raw_feedback: String, )
Record a TEST result. Updates best score and node risk map.
Sourcepub fn record_action(&mut self, round: usize, action: Action, feedback: String)
pub fn record_action(&mut self, round: usize, action: Action, feedback: String)
Record a non-test, non-edit action (READ, SEARCH, REVERT, query).
Sourcepub fn project_to_prompt(&self) -> String
pub fn project_to_prompt(&self) -> String
Project working memory to LLM-readable prompt text. Provides structured data — facts, not conclusions.
Sourcepub fn last_feedback(&self) -> &str
pub fn last_feedback(&self) -> &str
Get the last tool feedback for inclusion in the next prompt.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WorkingMemory
impl RefUnwindSafe for WorkingMemory
impl Send for WorkingMemory
impl Sync for WorkingMemory
impl Unpin for WorkingMemory
impl UnsafeUnpin for WorkingMemory
impl UnwindSafe for WorkingMemory
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