SIGN IN SIGN UP

fix(tui): keep sidebar breakdown visible during first-user-prompt window

When a session opened in TUI showed its full token breakdown and then
the user typed their first prompt, the entire breakdown drilldown
(System, Compartments, Facts, Memories, Tool Calls, Tool Defs)
disappeared until the assistant's first message arrived. Affected every
fresh-session-with-existing-history flow — i.e. reopening any project
session in TUI.

Root cause was in applyStickySnapshotCache. The flow per transform pass:
  1. User submits prompt.
  2. Transform runs before the model responds.
  3. `session_meta.last_input_tokens` is still 0 (no assistant usage yet).
  4. The fresh snapshot has compartmentInProgress=false, historianRunning=
     false, pendingOpsCount=0 (no work fired yet for the new turn).
  5. Old rule: `!hasInFlightEvidence(fresh)` → treat as reset → DELETE
     cache → return zero. Breakdown vanishes.

The check conflated "no work-in-flight signal" with "real reset". A real
reset (revert, manual flush, session delete) drops authoritative SQLite-
backed counts to zero alongside inputTokens. First-user-prompt does not
— compartments, memories, facts all survive.

Fix: only drop the cache when zero inputTokens coincides with counts
dropping below the cached values too. If compartments/memories survived,
the zero is a flicker and the cached breakdown sticks. The existing
in-flight-evidence path still preserves the cache for mid-turn historian
work. Updated tests to reflect the new "real reset" semantics and added
a regression locking in first-prompt sticky behavior.
U
ualtinok committed
afa21cbc539eca30327ea928312d00f3d03f1eea
Parent: 758deb0