feat: Show honest qualifying-day progress and confidence (issue #77)
This commit is contained in:
@@ -92,6 +92,7 @@ class ProjectionResult:
|
||||
staleness_fact: Optional[str]
|
||||
degraded_identity_fact: Optional[str]
|
||||
zero_rate_fact: Optional[str]
|
||||
qualifying_days_progress: Optional[str] = None # Issue #77: honest qualifying-day progress
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
@@ -547,6 +548,16 @@ def compute_projection(conn, clock_now):
|
||||
days_below_coverage = sum(1 for d in segment_days
|
||||
if d["coverage"] < WARMING_COVERAGE_FLOOR or d["sample_count"] == 0)
|
||||
qualifying = total_days_count - days_below_coverage
|
||||
|
||||
# Issue #77: Show honest qualifying-day progress
|
||||
if total_days_count >= WARMING_MIN_DAYS:
|
||||
# After warm-up, show qualifying day details for transparency
|
||||
qualifying_days_progress = "%d of %d qualifying days" % (qualifying, total_days_count)
|
||||
if days_below_coverage > 0:
|
||||
qualifying_days_progress += " (%d below coverage)" % days_below_coverage
|
||||
else:
|
||||
qualifying_days_progress = None
|
||||
|
||||
if total_days_count < WARMING_MIN_DAYS or days_below_coverage > WARMING_MAX_LOW_COVERAGE:
|
||||
warming_fact = "warming up: %d of %d qualifying days" % (qualifying, WARMING_MIN_DAYS)
|
||||
facts.append(warming_fact)
|
||||
@@ -605,4 +616,5 @@ def compute_projection(conn, clock_now):
|
||||
staleness_fact=staleness_fact,
|
||||
degraded_identity_fact=degraded_identity_fact,
|
||||
zero_rate_fact=zero_rate_fact,
|
||||
qualifying_days_progress=qualifying_days_progress,
|
||||
)
|
||||
|
||||
@@ -379,8 +379,14 @@ def _format_projection(proj, freshness: str, service: Dict[str, Any],
|
||||
|
||||
# --- Confidence state + contributing facts (§6.7, §6.11) ---
|
||||
state_label = proj.confidence_state.value
|
||||
if proj.contributing_facts:
|
||||
facts_str = " · ".join(proj.contributing_facts)
|
||||
facts_list = list(proj.contributing_facts) if proj.contributing_facts else []
|
||||
|
||||
# Issue #77: Show qualifying day progress for honesty
|
||||
if proj.qualifying_days_progress:
|
||||
facts_list.insert(0, proj.qualifying_days_progress)
|
||||
|
||||
if facts_list:
|
||||
facts_str = " · ".join(facts_list)
|
||||
lines.append("%s evidence · %s" % (state_label, facts_str))
|
||||
else:
|
||||
lines.append("%s evidence" % state_label)
|
||||
|
||||
@@ -1197,6 +1197,11 @@ class FenrisTuiApp(App):
|
||||
ConfidenceState.UNSUPPORTED: "red",
|
||||
}[proj.confidence_state]
|
||||
facts = " · ".join(proj.contributing_facts[:3]) if proj.contributing_facts else "no facts"
|
||||
|
||||
# Issue #77: Show qualifying day progress for honesty
|
||||
if proj.qualifying_days_progress:
|
||||
facts = proj.qualifying_days_progress + " · " + facts
|
||||
|
||||
return "[bold]Projection confidence: [%s]%s[/%s][/bold]\n %s" % (
|
||||
color,
|
||||
proj.confidence_state.value,
|
||||
|
||||
Reference in New Issue
Block a user