Skip to content

fix(jcode-tui): cache_expected_warm should return false on is_estimate #133

Open

Description

@KooshaPari

Problem

cache_expected_warm() in crates/jcode-tui/src/tui/kv_cache_problem.rs:82
returns true whenever the CacheTtlInfo is not is_cold, even when
is_estimate is set. An estimate is a heuristic guess, not evidence of
a real warm cache hit, so this surfaces false positives in the
detect_kv_cache_problem warning pipeline.

Test failure

tui::tests::cache_estimate_is_not_evidence_of_an_expected_warm_hit fails
in CI Build & Test (Build & Test ubuntu-latest, line 2489 passed; 25 failed).

The first assertion (warm is warm) passes; the second (estimate is NOT warm)
fails because the implementation only checks is_cold.

Fix

crates/jcode-tui/src/tui/kv_cache_problem.rs:82 — extend the predicate:

cache_ttl
    .map(|info| !info.is_estimate && !info.is_cold)
    .unwrap_or(false)

The doc comment should make the estimate-not-evidence semantics explicit
so a future refactor doesn't reintroduce the same bug.

Resolution

Closed by #133.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions