5b25d7e9e (shenggxhz on X) added 106 bytes of code to context.js while
the core scripts sat exactly at their budget (1,268,645 at its parent),
so TestCoreScriptBudget has been red on main since (1,268,751). The
budget is not raised; the change is packed instead:
- Routing passes the session key whole (sk, the conversation, or the
line's first request), so ctxCard keys on opts.session alone. Routing
is ctxCard's only caller.
- cacheOf takes a missing route, so the seed is `lastCache ||=
cacheOf(opts.prev)`, and the cache shows when lastCache is set: it is
set only by a shown cache (cacheShown) or by prev, which Routing passes
only for a request under way, so `live &&` added nothing.
- Three nearby lines in the same card packed to one statement each
(the health word, the big figure, the cache's class), same output.
core scripts now 1,268,634 of 1,268,645 (117 bytes less than 5b25d7e9e).
Run (mica-run, at this tree on 5b25d7e9e): go test ./internal/gui -run
'TestCoreScriptBudget|TestAppScriptBudget' ok; node --test routing-ctx-cache-long,
-still, -sessions, -fold, i18n-keys, context-cap, ctx-session-line: 150 of
154. The 4 reds are context-cap chromium en/zh (#6514) and ctx-session-line's
session-line test in both engines (#5801), red the same on main before this.
Broken by hand: without `|| lastCache` in the cache's condition, and
separately without the prev seed, routing-ctx-cache-long goes 12 of 22 red
in both engines.
Not tried: the real app; the change has no new behaviour, and the
Routing ctx GUI files cover the card's cache states in both engines.