pub struct StylingHealth {
pub formula_version: u32,
pub score: f64,
pub grade: &'static str,
pub penalties: StylingHealthPenalties,
pub confidence: StylingHealthConfidence,
pub confidence_reason: Option<String>,
}Expand description
Project-level styling-health score: a SECOND health axis computed purely from
the structural CSS analytics (CssAnalyticsReport), orthogonal to the JS/TS
code-health HealthScore. Surfaced only alongside the --css analytics, so
a plain fallow health run is byte-unchanged. The code score and grade stay
untouched: styling health is additive, never folded into the code score.
Like HealthScore, the score starts at 100 and subtracts capped per-category
penalties; the grade reuses the shared letter_grade thresholds verbatim
(A>=85, B>=70, C>=55, D>=40, F<40), so the two axes are read on one scale.
Fields§
§formula_version: u32Styling formula version; see STYLING_HEALTH_FORMULA_VERSION.
score: f64Styling-health score in [0, 100]; higher is healthier.
grade: &'static strLetter grade from the shared letter_grade thresholds.
penalties: StylingHealthPenaltiesPer-category penalty breakdown.
confidence: StylingHealthConfidenceHow much to trust the grade. Low in either of two cases, High
otherwise (see confidence_reason for which): (1) the analyzed CSS surface
is too thin for the declaration-normalized penalty rubric to be reliable
(the gradeable, non-atomic declaration count is below 50); or (2) the
project’s CSS is predominantly flat compile-time-atomic CSS-in-JS
(StyleX/Panda), whose structure is not assessable, so the grade reflects
token hygiene only regardless of declaration count. This is descriptive
metadata that NEVER feeds the score: score/grade/penalties are
byte-identical whether confidence is high or low. Gate on this confidence
flag, which is the complete signal; do NOT reconstruct it from
total_declarations, since that summary count includes atomic declarations
the grade excludes (a large all-atomic project is Low despite a high
total_declarations).
confidence_reason: Option<String>Human-readable reason the grade is low-confidence: either the declaration
and stylesheet counts a thin grade was computed from, or that structure is
not assessable for compile-time-atomic CSS-in-JS. None when confidence is
High. Prose, not a stable machine field: gate on confidence, not on
this string.