feat(timing): the session-time strip — the session's active time as one packed band
The timing card gains a bottom band that reads where the session's ACTIVE time went: every completed step's slices — the TTFT wait, the decode blocks in stream order, the tool-run windows, and the in-step residue — packed gapless in occurrence order, each band's width its share of the cumulative active time (idle time between steps takes no track), with ticks at zero, the quartiles, and the full span. Host: the fold tiles each step at step/end (clamped into the step window, first-wins de-overlap so parallel runs paint their union, holes filled with the residue kind) into a new spans collection — bounded to the newest 2,000, riding the detail channel and the inline view, never the slim head. The decode window anchors at the first OBSERVABLE instant (the first token, or an earlier block marker the token packing could not stamp), so a redacted reasoning block keeps its span instead of being swallowed by the wait. stateVersion 22 → 23: the per-step collection cannot be backfilled by later events, so cached rows refold from the durable log. Client: the strip joins the card's hover link by KIND — a band hover lights every span of its kind plus the donut arc and the legend row, and the floating tip answers only the strip's own pointer (the mirror rule).
This commit is contained in:
1 parent
084a2d7f54
commit
9bec22959b
21 files changed
+1100
-45
No files matched your search
@@ -116,6 +116,8 @@ The Context Dashboard (the sidebar-foot panel) reads its `contextActivity` proje
|
||||
|
||||
The dashboard's per-day usage chart (the first row's right half) extends the `contextActivity` ledger with per-day pricing records — each day's billed buckets keyed provider → model → pricing period, the same `SessionCostUsage` raw material the timeline's session-cost totals carry, booked at each turn's initiation instant and priced client-side by the same book and estimator as the KPI band. Booking fees per (provider, model, period) changes the fold's state shape, so the unit's `stateVersion` bumps (1 → 2): on upgrade every cached `contextActivity` row reads version-stale, and the dashboard's existing warm-up (above) cold-refolds the corpus from the durable logs, rebuilding every day's tokens AND fees exactly the first time the panel opens. On the wire the field is additive-optional: a day folded before it existed (or whose settlements carried no model header or no usage) serves without it, and the chart degrades to tokens-only bars for those days — the same sanitizer contract every other projection value rides.
|
||||
|
||||
The timing card's session-time strip (the card's bottom band: every completed step's TTFT wait, decode blocks in stream order, tool-run windows, and in-step residue packed gapless in occurrence order — each slice's width is its share of the session's cumulative active time, with ticks at zero, the quartiles, and the full span) bumps the timeline projection's `stateVersion` (22 → 23): the strip's painted spans are a per-step collection the fold flushes at `step/end`, which later events cannot backfill for steps already folded (the timing totals' own v11 precedent), so on upgrade every cached timeline row is invalidated and refolded from the durable log, which rebuilds the spans for sessions started under older plugin builds; the v20 warm-up rebuilds idle sessions' rows the first time the dashboard opens. On the wire the collection is additive-optional — it rides the detail channel (and the inline value on channel-less hosts), never the slim head — so a payload folded before it existed serves without it, and the timing card shows no strip then. The spans are bounded to the newest 2,000 records (a plain count cap), so an outsize session's strip paints its recent window; untrusted spans are re-proved per item at the client's render boundary, the same sanitizer contract every collection rides.
|
||||
|
||||
To force a full refold of an existing session sooner, delete its cached projection row — it is a derived cache and is rebuilt from the durable log:
|
||||
|
||||
```bash
|
||||
|
||||
Reference in new issue
Block a user