Commit Graph
4 Commits
Author SHA1 Message Date
Florian Schmidt fd30dfcea4 fix: address the first agent review of PR #2
agent-review agent review: pass
Blocking findings:
1. A Codex RPC error or early exit threw past LimitProbe and stopped the
   refresh loop, so Claude stopped updating too (D2). Every probe failure
   is now a failed probe result, the loop records an unexpected tick
   failure and keeps ticking, shutdown cancellation still propagates,
   the app reports failed operations, and the CLI exits 1 instead of
   crashing. Fake app-server modes in the GUI process host test errors,
   EOF and garbage.
2. Totals converted local midnight directly and threw where midnight
   does not exist (Cairo, Santiago, Beirut). Today and the week start
   through CalendarDays now.
3. Daily chart labels used UTC dates for local-day buckets; labels and
   tooltips now share the local date.

Review notes fixed as well: Claude Code installed with npm on Windows is
found through its native binary or cli.js; the plugin ends cleanly on a
bad host frame; Linux autostart honours XDG_CONFIG_HOME; the unused stub
installer and the worker names in docs are gone.

Refs #1
2026-10-14 21:50:09 +02:00
Florian Schmidt 50ac2aad3a fix: probe Claude from the GUI app and close integration gaps
- A GUI-subsystem host has no console code page, so .NET decoded the
  probes' UTF-8 output with code page 0 and Claude's /usage separators
  never matched: Claude showed as unavailable in the app but not in the
  CLI. Probe output is now decoded as UTF-8 and every probe gets valid
  standard handles, with stdin closed unless it is the Codex RPC. A
  GUI-subsystem test host reproduces it.
- The /usage parser stops at the contributing section and only reports
  lines that start like a limit line.
- snapshot.json no longer defaults appPath to the reader's own path. The
  app passes its path to the engine and a CLI refresh keeps it, so a
  Stream Deck key always starts the app (D9, D10).
- The CLI is finaltoken-cli on every platform: FinalToken.exe and
  finaltoken.exe cannot share a folder on Windows.
- Day series follow the local calendar day, as Today does.
- The dev-only migration from the first store format is gone.
- README.md is a short user guide.

Refs #1
2026-10-14 20:39:53 +02:00
Florian Schmidt c2f97e9384 core: write only new history and share files on Windows
The store rewrote all of history.json, 19 MB here, on every 60 s
refresh. It now appends each refresh's changes to a journal and compacts
into monthly files and a state checkpoint at 8 MiB, so an idle refresh
writes only snapshot.json. Bucket updates are keyed, unchanged limit
samples are kept at most hourly, Codex replays are bounded by session
totals, and Claude dedupe keys expire after 60 days.

Readers of atomically replaced files allow delete sharing, and the
replace retries briefly, so the Stream Deck plugin reading snapshot.json
cannot make a refresh fail. Claude's <synthetic> entries are skipped,
and repeated diagnostics fold into one entry with a count.

Refs #1
2026-10-14 19:59:58 +02:00
Florian Schmidt 14223b05df core: add the solution, Core engine, CLI and tests
Core implements the CLI-only collectors for Claude and Codex (D2 to D4),
the history store (D5), the refresh engine (D6), pace and popup
decisions (D7, D8), the snapshot contract (D9) and the Stream Deck
installer contract (D11). finaltoken status runs one refresh and prints
the snapshot. The app and plugin projects are placeholders so the
solution file is complete before they are built in parallel.

Refs #1
2026-10-14 19:09:54 +02:00