pub struct WorkingSet {
pub config: WorkingSetConfig,
pub turn: u64,
pub entries: HashMap<String, WorkingSetEntry>,
}Expand description
Repo-aware working-set state.
Fields§
§config: WorkingSetConfigTracking configuration.
turn: u64Monotonic turn counter (increments on user messages).
entries: HashMap<String, WorkingSetEntry>Path entries keyed by workspace-relative path.
Implementations§
Source§impl WorkingSet
impl WorkingSet
Sourcepub fn observe_user_message(&mut self, text: &str, workspace: &Path)
pub fn observe_user_message(&mut self, text: &str, workspace: &Path)
Observe a user message and update the working set.
Sourcepub fn observe_tool_call(
&mut self,
tool_name: &str,
input: &Value,
output: Option<&str>,
workspace: &Path,
)
pub fn observe_tool_call( &mut self, tool_name: &str, input: &Value, output: Option<&str>, workspace: &Path, )
Observe a tool call (input and optional output).
Sourcepub fn rebuild_from_messages(&mut self, messages: &[Message], workspace: &Path)
pub fn rebuild_from_messages(&mut self, messages: &[Message], workspace: &Path)
Rebuild the working set from existing messages (best effort).
This is used when syncing a resumed session.
Sourcepub fn summary_block(
&self,
workspace: &Path,
read_allowed: &dyn Fn(&Path) -> bool,
) -> Option<String>
pub fn summary_block( &self, workspace: &Path, read_allowed: &dyn Fn(&Path) -> bool, ) -> Option<String>
Render a compact working-set block for the system prompt.
Byte-stable across next_turn() calls when no new paths are observed
(#280): the rendered lines drop the turn-relative touches and
last seen N turn(s) ago fields, and the order is taken from
sorted_for_prompt (turn-agnostic) instead of sorted_entries.
The block lands in the system prompt before the historical
conversation; any byte that drifts here cache-misses everything that
follows in DeepSeek’s KV prefix cache.
Trait Implementations§
Source§impl Clone for WorkingSet
impl Clone for WorkingSet
Source§impl Debug for WorkingSet
impl Debug for WorkingSet
Source§impl Default for WorkingSet
impl Default for WorkingSet
Source§impl<'de> Deserialize<'de> for WorkingSet
impl<'de> Deserialize<'de> for WorkingSet
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Forget for WorkingSet
impl Freeze for WorkingSet
impl Move for WorkingSet
impl RefUnwindSafe for WorkingSet
impl Send for WorkingSet
impl Sync for WorkingSet
impl Unpin for WorkingSet
impl UnsafeUnpin for WorkingSet
impl UnwindSafe for WorkingSet
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.