Commit Graph
16 Commits
Author SHA1 Message Date
Florian Schmidt 9f33dd8896 core: keep setting defaults for properties missing from the file
agent-review agent review: fail
With init-only properties, the source-generated reader set a property
missing from settings.json to its default value, not its initializer,
so the file failed validation and every setting fell back to defaults.
Any release that adds a setting would have reset all user settings.
Settings use settable properties now, and the snapshot's version field
too; the other persisted types were checked and keep their defaults.

Refs #1
2026-10-14 21:23:04 +02:00
Florian Schmidt 15c7e684bb build: one version for the app and the plugin
D11 replaces an installed plugin only when the shipped manifest is
newer, but the manifest version was kept by hand and still said
1.0.0.1, the version of a test build installed before the snapshot
sharing and appPath fixes, so that stale plugin was never replaced.
Directory.Build.props now holds the only version, 1.0.1; publish.py
stamps it into the shipped manifest and the app shows it in its title.

Tests that waited on real time (file retry, popup expiry) use
controlled timers, and real process waits have wider margins.

Refs #1
2026-10-14 21:08:22 +02:00
Florian Schmidt 5c5973aa6c app: date far projections and give charts distinct axis ticks
The popup showed only the time of a projection two days away, which
read as today; the popup and the panel now share one formatter that adds
the date unless the projection is today. Chart axes used max/4 steps,
which repeated labels for small or empty ranges; they now use whole 1,
2 or 5 steps and an empty chart shows only 0.

Refs #1
2026-10-14 20:54:12 +02:00
Florian Schmidt 4f4ed5fe17 docs: record parser scope, local days, child handles and appPath
D3 says which /usage lines are limit lines, D5 that days follow the
local calendar, D6 that probes get their own UTF-8 pipes because a GUI
host has no console, and D9 who supplies the app path in the snapshot.

Refs #1
2026-10-14 20:40:41 +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 183247bab5 app: add the Avalonia desktop app
Opening the app shows the stats panel: per-provider limit bars with the
pace marker, delta, reset and projection, token totals, hourly and daily
charts, limit history with its pace line, model and project tables and
recent diagnostics (R4, D8). Pace popups stack at the bottom right
without taking focus (R5). The tray, settings, single-instance
activation, start with the OS and the Stream Deck install policy (D11)
are wired to the Core engine. Avalonia 12.1.4 and
CommunityToolkit.Mvvm 8.4.2 are the new packages D8 calls for.

Refs #1
2026-10-14 20:08:11 +02:00
Florian Schmidt 3692cbd85b tools: mark publish.py executable
Refs #1
2026-10-14 20:08:11 +02:00
Florian Schmidt cd1fd5a306 streamdeck: add the plugin, its installer and packaging
The plugin is a NativeAOT executable that speaks the Stream Deck SDK v2
WebSocket protocol itself, reads snapshot.json and draws each key as
SVG (D10). The installer finds Elgato Stream Deck or OpenDeck, stages
the shipped plugin beside the installed one, stops a running host,
swaps and rolls back on failure (D11). tools/publish.py publishes the
app, CLI and plugin for win-x64 or linux-x64 into one folder.

Refs #1
2026-10-14 20:08:11 +02:00
Florian Schmidt c633c2bd3f docs: record the journaled history store in D5
The store now appends changes to a journal and compacts into monthly
files, shares files for readers on Windows, skips unchanged sources and
bounds Claude dedupe to 60 days. D5 says so, and what it gives up.

Refs #1
2026-10-14 20:00:18 +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
Florian Schmidt db890c5f68 tools: mark the scripts executable
Refs #1
2026-10-14 18:43:27 +02:00
Florian Schmidt 8533cfc2d2 tools: add the documentation check, Gitea API helper and agent review
check_docs.py verifies local links, anchors and the R and D IDs that
the decisions are cited by. gitea.sh calls the API with GITEA_TOKEN or
the stored git credential, handed to curl on stdin so it never shows in
a process list. agent-review.sh posts a review and sets the
agent-review status, refusing when the PR head moved.

Refs #1
2026-10-14 18:43:19 +02:00
Florian Schmidt 1bf378e4aa docs: record the store's single writer and app activation
Both the app and the CLI can refresh, so D5 now names one writer at a
time behind a lock file and gives the data directory an override for
tests. D8 says how a second start reaches the running instance without
a socket, which D9 rules out.

Refs #1
2026-10-14 18:35:27 +02:00
Florian Schmidt d3091cff16 docs: add requirements, decisions and agent workflow
Records R1 to R7 from the developer and the decisions D1 to D11 that the
v1 work builds on, plus the issue, branch and review workflow the agents
follow.

Refs #1
2026-10-14 18:34:42 +02:00
schmidt.florian 6d67f157a5 Initial commit 2026-10-14 18:20:11 +02:00