pub struct GotchaStore {
pub project_hash: String,
pub gotchas: Vec<Gotcha>,
pub error_log: Vec<SessionErrorLog>,
pub stats: GotchaStats,
pub updated_at: UtcDateTime,
pub pending_errors: Vec<PendingError>,
/* private fields */
}Fields§
§project_hash: String§gotchas: Vec<Gotcha>§error_log: Vec<SessionErrorLog>§stats: GotchaStats§updated_at: UtcDateTime§pending_errors: Vec<PendingError>Implementations§
Source§impl GotchaStore
impl GotchaStore
Source§impl GotchaStore
impl GotchaStore
Sourcepub fn learn_from_shell(
&mut self,
command: &str,
output: &str,
exit_code: i32,
files_touched: &[String],
session_id: &str,
) -> bool
pub fn learn_from_shell( &mut self, command: &str, output: &str, exit_code: i32, files_touched: &[String], session_id: &str, ) -> bool
Learn from one finished command: push a pending error on failure, or correlate a fix when a prior pending of the same command base now passes.
Returns true when durable state (gotchas / error log / stats) changed
and the caller should persist. Pure — no globals, no I/O — so the
correlation logic is unit-testable in isolation.
Source§impl GotchaStore
impl GotchaStore
pub fn detect_error( &mut self, output: &str, command: &str, exit_code: i32, files_touched: &[String], session_id: &str, ) -> bool
pub fn try_resolve_pending( &mut self, command: &str, files_touched: &[String], session_id: &str, ) -> Option<Gotcha>
pub fn report_gotcha( &mut self, trigger: &str, resolution: &str, category: &str, severity: &str, session_id: &str, ) -> Option<&Gotcha>
pub fn cross_session_boost(&mut self)
pub fn apply_decay(&mut self)
Sourcepub fn promotable(&self) -> Vec<&Gotcha>
pub fn promotable(&self) -> Vec<&Gotcha>
High-value gotchas eligible for promotion into durable project knowledge
(the loop-weighting bridge, #980): proven across sessions and shown to
prevent real errors. Read-only companion to Self::check_promotions,
sorted by confidence so callers can take the strongest first.
pub fn check_promotions(&mut self) -> Vec<(String, String, String, f32)>
pub fn extract_universal(&self) -> Vec<Gotcha>
pub fn top_relevant( &self, files_touched: &[String], limit: usize, ) -> Vec<&Gotcha>
pub fn format_injection_block(&self, files_touched: &[String]) -> String
pub fn add_universal(&mut self, gotcha: Gotcha)
pub fn mark_prevented(&mut self, gotcha_id: &str)
pub fn format_list(&self) -> String
Trait Implementations§
Source§impl Clone for GotchaStore
impl Clone for GotchaStore
Source§impl Debug for GotchaStore
impl Debug for GotchaStore
Source§impl<'de> Deserialize<'de> for GotchaStore
impl<'de> Deserialize<'de> for GotchaStore
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Forget for GotchaStore
impl Freeze for GotchaStorewhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Gotcha>: Freeze,
PhantomData<SessionErrorLog>: Freeze,
PhantomData<PendingError>: Freeze,
impl Move for GotchaStore
impl RefUnwindSafe for GotchaStore
impl Send for GotchaStorewhere
RawVecInner: Send,
impl Sync for GotchaStorewhere
RawVecInner: Sync,
impl Unpin for GotchaStore
impl UnsafeUnpin for GotchaStorewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Gotcha>: UnsafeUnpin,
PhantomData<SessionErrorLog>: UnsafeUnpin,
PhantomData<PendingError>: UnsafeUnpin,
impl UnwindSafe for GotchaStorewhere
RawVecInner: UnwindSafe,
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
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>,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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