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
Draft
post-0.9.18 polish: compare flags in the TUI, context id prefix, active-days label#860avs-io wants to merge 3 commits into
avs-io wants to merge 3 commits into
Conversation
…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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #767 — three non-blocking UX nits from the pre-release sweep.
1. compare: the TUI ignored
--model-a/--model-bThe default (TUI) format never passed the flags through to the interactive picker at all; only
--format jsonhonoured them. Both paths also required the canonical model id verbatim, with no way to pass the display name the picker itself shows.Added
findModelStatinsrc/compare-stats.ts: exact canonical-id match first, then a case-insensitive fallback throughgetShortModelName, the canonical-to-display map already used across the codebase, rather than a new alias table.renderCompareresolves the flags up front and seedsCompareView'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/treecalledfindClaudeSession/findCodexSession, which already resolve an 8-char prefix exactly ascodeburn 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
buildDurablePeriodcall 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 scannedinstead of a bareof 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 ascarriedCostNoteand shown in the TUI as well. It explains carried cost, not the day count.Testing
Red-before-green for each change. New or extended:
findModelStatcases incompare-stats.test.ts; display-name resolution and lone-flag rejection incli-emitters.test.ts; full-id, prefix and no-match cases against a live server incontext-tree-api-prefix.test.ts;dailyActivityFooterwording indashboard.test.ts;carriedCostNoteinformat-carried-cost-note.test.ts.Full suite 2476 passed,
tsc --noEmitclean.Deliberately unchanged
overview.tsis untouched. SharingcarriedCostNotefrom there was tried and reverted:overview.tshas a localformatCostwrapper 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.