pub struct QualityScore {
pub value: f32,
pub tier: QualityTier,
pub signals: Vec<QualitySignal>,
pub computed_at: u64,
}Expand description
Composite quality score for a Record.
Formula (ARCHITECTURE.md §5):
quality =
has_imperative_verb × 0.20
+ has_causality × 0.25
+ has_severity × 0.10
+ has_reference × 0.15
+ length_score × 0.15
+ specificity_score × 0.15
penalties:
vague_phrase_detected → × 0.5
no_reason → × 0.6
too_short → × 0.4Layer 0 StaticAnalysis records default to 0.10 (Suppressed).
Recomputed by RecordQualityAnalyzer on every write and mati enrich.
Does not derive PartialEq — see module-level float equality note.
Fields§
§value: f320.0 (useless) → 1.0 (Claude-optimal)
tier: QualityTier§signals: Vec<QualitySignal>§computed_at: u64Unix timestamp (seconds) when this score was last computed.
0 = not yet computed (sentinel).
Implementations§
Source§impl QualityScore
impl QualityScore
Sourcepub fn layer0_default() -> Self
pub fn layer0_default() -> Self
Default for a Layer 0 StaticAnalysis stub — Suppressed, never injected.
Sourcepub fn doc_comment_default() -> Self
pub fn doc_comment_default() -> Self
Quality for a file record whose purpose was extracted from a language-
canonical doc comment (Rust //!, Go // Package, Python docstring).
Acceptable tier (0.40) passes the quality >= 0.4 injection gate.
Paired with confidence = 0.45 in init.rs, these records surface as
additionalContext (allow + attach) rather than deny + inject.
Sourcepub fn developer_entry_default() -> Self
pub fn developer_entry_default() -> Self
Quality for an auto-generated co-change gotcha (normal signal).
Acceptable tier (0.40): passes quality gate.
Paired with confidence = 0.45 (0.3–0.6 band) → additionalContext injection.
confirmed: true is set on the gotcha because co-change is objective git data,
but the confidence band keeps it out of the deny+inject path.
Quality for a developer-manually-added record (mati gotcha add, mati note).
Good tier (0.65): developer is explicitly asserting the record is important.
Paired with DeveloperManual confidence (0.80) + confirmed=true → deny+inject path.
pub fn cochange_default() -> Self
Sourcepub fn cochange_strong() -> Self
pub fn cochange_strong() -> Self
Quality for a strong co-change gotcha (ratio >= 0.90 AND count >= 20).
Acceptable tier (0.60): passes quality gate.
Paired with confidence = 0.65 → deny+inject path.
A near-perfect co-change ratio over 20+ commits is strong enough evidence
that Claude should be forced to see the coupling before editing either file.
Sourcepub fn tier_from_value(value: f32) -> QualityTier
pub fn tier_from_value(value: f32) -> QualityTier
Derive QualityTier from a raw score value (half-open intervals).
[0.0, 0.2) → Suppressed
[0.2, 0.4) → Poor
[0.4, 0.7) → Acceptable
[0.7, 0.9) → Good
[0.9, 1.0] → ExcellentTrait Implementations§
Source§impl Clone for QualityScore
impl Clone for QualityScore
Source§fn clone(&self) -> QualityScore
fn clone(&self) -> QualityScore
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for QualityScore
impl Debug for QualityScore
Source§impl<'de> Deserialize<'de> for QualityScore
impl<'de> Deserialize<'de> for QualityScore
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 Freeze for QualityScore
impl RefUnwindSafe for QualityScore
impl Send for QualityScore
impl Sync for QualityScore
impl Unpin for QualityScore
impl UnsafeUnpin for QualityScore
impl UnwindSafe for QualityScore
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
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>, which can then be
downcast into Box<dyn 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>, which 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.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> Fruit for T
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>
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>
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