Skip to main content

Features

Struct Features 

Source
pub struct Features {
    pub score: f32,
    pub loop_mode: f32,
    pub is_failure_pattern: f32,
    pub novelty: f32,
    pub repeat_count: f32,
    pub recovery: f32,
    pub evidence: f32,
}
Expand description

What the hook knows at the moment it decides whether to speak.

Fields§

§score: f32

Composite broker score of the best candidate capsule, in [0, 1].

§loop_mode: f32

1.0 when the agent is visibly repeating a failing command. A stuck agent should be interrupted sooner — this is the signal the old rule expressed by dropping the threshold.

§is_failure_pattern: f32

1.0 when the capsule is a failure_pattern — the kind most likely to prevent a wasted attempt rather than merely inform one.

§novelty: f32

1.0 when nothing has been injected yet this session, falling towards 0 as the session accumulates injections. Encodes “the tenth interruption is worth less than the first”.

§repeat_count: f32

How many times this exact command has already been observed failing, normalized: min(count, 5) / 5.

§recovery: f32

Time since the last injection, normalized against the refractory window: 0 immediately after one, 1 once well clear of it.

§evidence: f32

How strong the evidence was that something failed: 0 for a substring guess, 0.5 for a toolchain summary line, 1 for a real exit code. A guess should have to clear a higher bar than a fact.

Implementations§

Source§

impl Features

Source

pub const NAMES: [&'static str; 7]

Human-readable names, aligned with Self::to_vec. Used by brain policy --status so the weights mean something on screen.

Source

pub fn to_vec(self) -> [f32; 7]

Feature vector in weight order. Order is part of the persisted format.

Source

pub fn from_slice(v: &[f32]) -> Option<Self>

Reconstruct from a persisted vector (event payloads, training data).

Trait Implementations§

Source§

impl Clone for Features

Source§

fn clone(&self) -> Features

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Features

Source§

impl Debug for Features

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Features

Source§

fn eq(&self, other: &Features) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Features

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more