Skip to content

fix(jcode-tui): cache_expected_warm returns false on estimates, not just cold (re-land of #134) #155

Open

Description

@KooshaPari

Re-land the cache_expected_warm guard from PR #134 as a single-file fix-forward directly on master. Drop the mod.rs re-export reorder (owned by PR #150 fix/tui-cache-expected-warm-unused-import, which also gates the re-export behind #[cfg(test)] so the existing mod.rs regression test calls super::cache_expected_warm() correctly).

cache_expected_warm now requires both:

  • a concrete TTL reading (i.e. NOT is_estimate), AND
  • not already cold (i.e. NOT is_cold)

Before: any non-cold value was considered warm. That misclassified estimates (is_estimate: true) as warm — a 60%-confidence guess is not evidence of a cached-state hit.

After: cache is only considered expected-warm when we have a TTL measurement AND it is not already cold.

The regression test cache_estimate_is_not_evidence_of_an_expected_warm_hit already lives in crates/jcode-tui/src/tui/mod.rs at master (line 1881) and will be reachable through PR #150's #[cfg(test)] gating of the cache_expected_warm re-export. This PR intentionally does NOT touch mod.rs per the fix-forward constraint.

Replaces the content of #134 with a 1-file branch. Operator should close #134 without merging.

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