Skip to content

post-0.9.18 polish: compare flags in the TUI, context id prefix, active-days label - #860

Draft
avs-io wants to merge 3 commits into
getagentseal:mainfrom
avs-io:fix/post-0918-polish
Draft

post-0.9.18 polish: compare flags in the TUI, context id prefix, active-days label#860
avs-io wants to merge 3 commits into
getagentseal:mainfrom
avs-io:fix/post-0918-polish

Conversation

@avs-io

@avs-io avs-io commented Jul 29, 2026

Copy link
Copy Markdown
Member

Fixes #767 — three non-blocking UX nits from the pre-release sweep.

1. compare: the TUI ignored --model-a/--model-b

The default (TUI) format never passed the flags through to the interactive picker at all; only --format json honoured them. Both paths also required the canonical model id verbatim, with no way to pass the display name the picker itself shows.

Added findModelStat in src/compare-stats.ts: exact canonical-id match first, then a case-insensitive fallback through getShortModelName, the canonical-to-display map already used across the codebase, rather than a new alias table. renderCompare resolves the flags up front and seeds CompareView's state so a valid pair goes straight to results. The JSON path's "both or neither" validation now applies to the TUI path too.

2. context: a session id prefix worked on the CLI but not through the API

/api/context/tree called findClaudeSession/findCodexSession, which already resolve an 8-char prefix exactly as codeburn context <session> does, and then additionally required the resolved id to equal the input verbatim — defeating its own resolver. Removed the redundant check so the endpoint trusts the same resolution the CLI relies on, keeping id resolution in one place.

The bundled frontend sends full ids from /api/context/sessions, so relaxing this cannot change its behaviour.

3. report TUI: two different active-day counts on one screen

The count is correct by design and is not changed. The Daily Activity panel scans a fixed six-month window independent of the selected period tab, so scrolling always works; the headline's day count comes from the durable cache scoped to the active period, which also counts days whose session files have since expired. These are two questions with two denominators, not one number computed two ways. Re-deriving the panel from the durable series would need a second buildDurablePeriod call scoped independently of the period tab — a behaviour and performance change, not polish.

What changed is the label: the panel footer now reads of N days scanned instead of a bare of N, so the two figures no longer read as a contradiction. The Optimize view's footer at the equivalent line was checked and left alone — it counts findings, not days, and has no headline to contradict.

Adjacent finding, not part of item 3. While investigating, the interactive dashboard's Overview headline turned out to have no explanation for durable-cache carry-forward, though overview.ts's non-interactive report already has one. That wording is now shared as carriedCostNote and shown in the TUI as well. It explains carried cost, not the day count.

Testing

Red-before-green for each change. New or extended: findModelStat cases in compare-stats.test.ts; display-name resolution and lone-flag rejection in cli-emitters.test.ts; full-id, prefix and no-match cases against a live server in context-tree-api-prefix.test.ts; dailyActivityFooter wording in dashboard.test.ts; carriedCostNote in format-carried-cost-note.test.ts.

Full suite 2476 passed, tsc --noEmit clean.

Deliberately unchanged

overview.ts is untouched. Sharing carriedCostNote from there was tried and reverted: overview.ts has a local formatCost wrapper that adds thousands separators the shared helper does not replicate, so routing through it would have silently dropped that formatting on large carried-cost values.

avs-io added 3 commits July 29, 2026 22:58
…y names

The TUI comparison picker silently ignored --model-a/--model-b (only the
--format json path used them), and both paths required the canonical model
id verbatim with no way to pass the display name the picker itself shows
(e.g. "Opus 4.8" for claude-opus-4-8).

Adds findModelStat, a shared lookup that matches the canonical id first and
falls back to getShortModelName's existing canonical -> display mapping
(case-insensitive) rather than a new alias table. Both the JSON path and
renderCompare/CompareView now use it; renderCompare resolves --model-a/
--model-b up front and seeds CompareView's picked-models state so results
load immediately instead of showing the picker. Also validates "both or
neither" for the TUI (default) format, matching the JSON path.

Fixes getagentseal#767 (item 1).
`codeburn context <session>` accepts an 8-char session id prefix (findClaudeSession/
findCodexSession resolve it via startsWith), but /api/context/tree additionally
required the resolved ref's sessionId to equal the id passed in verbatim - so
the same prefix that works on the CLI 404s through the API.

findClaudeSession/findCodexSession are already the single source of truth for
prefix resolution used by the CLI; the API now trusts that resolution instead
of re-validating for an exact match afterwards, so both surfaces behave the
same way for a prefix.

Fixes getagentseal#767 (item 2).
…y-forward

Issue getagentseal#767 item 3 reports two different active-day counts on one dashboard
screen: the Daily Activity panel shows "of 37" (from a bounded live scan of
surviving session files) while the same period's headline can reflect more
days via the durable daily cache, which also counts days whose session files
have since expired. Each count is correct for what it measures - the panel
intentionally scans a fixed six-month window independent of the selected
period tab so scrolling always works, while the headline is scoped to the
active period tab.

Re-deriving the panel's count from the durable series was considered and
rejected: it would need a second buildDurablePeriod call scoped to six months
independent of the period tab, which is a behavior and perf change, not
polish. Kept the count unchanged and instead labelled the denominator -
dailyActivityFooter (src/dashboard.tsx) now renders "of N days scanned"
instead of a bare "of N", so the panel reads as "here's what the live scan
covered" rather than as a contradiction of the headline. Checked the
Optimize view's similar "Showing X-Y of Z" footer (line ~794): it counts
findings, not days, and isn't part of this ambiguity.

Also fixes an adjacent gap found while investigating: overview.ts's
non-interactive report already had a footnote for durable-cache carry-forward
("includes $X preserved from expired session logs") when carriedCostUSD > 0;
the interactive dashboard's Overview panel had no equivalent, so a headline
that included carried-forward cost had no explanation anywhere on screen.
Extracted the wording as carriedCostNote (format.ts) and surfaced
carriedCostUSD through DurableOverview so the TUI shows the same footnote.
This is separate from the active-day-count fix above - it explains cost
carry-forward, not day counts.

Fixes getagentseal#767 (item 3).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Post-0.9.18 polish: compare flags in TUI, context id asymmetry, active-days wording

1 participant