An audit of everything on main since v0.9.23 turned up five places where
real detail had been used where an invented value would have done. None of
them is a credential and none identifies a customer, but a public
repository is the wrong home for any of it.
perf/README.md cited an absolute path into a private audit workspace on a
contributor's own machine, naming their home directory, the workspace's
naming scheme and a run timestamp accurate to the second, as "evidence" no
reader can open. The number stays; the path goes, and the text now says
plainly that the artifact is not published. The same file described the
measurement corpus as the founder's 35 GB of session history, which is a
personal fact about one identifiable person, so it is now described by what
it is rather than by whose it is.
The remaining three are fixtures: a private product name as a working
directory, the maintainer's real operating-system username inside the very
tests that assert such a path is redacted, and their two machine names in
the sharing tests. Using the real values proved nothing the invented ones do
not, and the redaction tests read better when the string being scrubbed is
obviously synthetic.
The rename retry landed, but its test kept the watcher reading in a
tight loop, and on real Windows that lost 8 runs in 12: a reader holding
the file open every instant is a race no bounded retry can win, because
an open handle blocks a rename until it closes. That is not a reader
either app has. The watcher now polls at 1ms, which still samples the
file thousands of times and still catches a lost update, while leaving
the writers room to rename. The locked path passes 15 of 15 on Windows,
and the unlocked path still reports a rolled-back write.
Also restores the lineage case the review asked for: a refresh where the
account id and refresh token are unchanged and only the id_token subject
moves, so the subject comparison is what discards the write. Both copies.
The Capacity Dock's glance popover rendered the machine-wide Today block in
every provider's card, so hovering Claude showed the total across every
provider as if it were Claude's.
CLI (add-only): ProviderCost and providerDetails now carry optional
inputTokens, outputTokens and sessions, summed per provider in all three
branches that build the provider list. They stay ABSENT when no day in the
period reported a breakdown, so a consumer can tell "no data" from zero.
STATUS_SNAPSHOT_RENDER_VERSION 4 -> 5, since a v4 snapshot's payload predates
the new fields; the daily cache already holds the tokens, so its version is
untouched.
App: the Today row reads the hovered provider's row out of providerDetails
(matched on the CLI provider id, which the dock's kimi entry bridges to
kimicode). Against a CLI that omits per-provider tokens the arrows drop out
rather than falling back to the global pair; a provider absent from a
breakdown that IS present reads as a real $0.00. The row keeps its fixed
frame, so the panel's computed height is unchanged either way.
The refresh reread auth.json before writing the rotated tokens but only
checked it was still ChatGPT mode, not that it was still the same login.
A `codex login` account switch, or a second CodeBurn process refreshing
the same credential, landing while our refresh was in flight let the late
response splice one account's tokens into another's document: a new
account id over an old refresh token, or an older refresh token over a
newer one. Either signs the user out or binds them to the wrong account.
The login the grant belongs to is now captured before the grant and
compared against the reread document on account id, refresh token and
id-token subject. A demonstrated mismatch discards the write and says so.
An unreadable or key-sparse file is not a mismatch and still writes, so a
rotated token is never dropped. Both the CLI and the Electron copy.
Two doors still skipped the credential drain. A closed pipe, which is
how `codeburn quota | head` ends, exited straight from the stdout error
handler; it drains first now, and resolves immediately for every command
with nothing outstanding. A throw from any provider left through the
same door as success without draining at all; the drain moved into a
finally, so one provider failing cannot strand another's rotation.
The drain also waited fifteen seconds for a request allowed thirty, so a
grant answering at twenty was abandoned by the very guard built for it.
The wait is now derived from the request timeout plus a margin, so the
two cannot drift, and giving up says so on stderr instead of leaving the
user to discover it the next time that provider asks them to sign in.
- codeburn quota could still exit with a rotated Codex token in flight:
the command ended with process.exit and the per-provider abort could
cut the grant after the server had rotated. The refresh stays, since
the usage endpoint rejects an expired access token, and every rotation
registers itself; the command awaits outstanding credential writes,
bounded to fifteen seconds, before it exits. Tests abort mid-grant and
time the provider out and still find the new token on disk.
- CODEBURN_MENUBAR_MSI let one environment variable send msiexec at any
file whose checksum the same party wrote. It is replaced by
`codeburn menubar --staged-msi <path>`, which must be absolute,
resolved, named as the release asset, inside a resources\menubar
directory whose grandparent holds CodeBurn.exe, a regular file with a
regular .sha256 beside it; the variable is refused with the reason.
- countBucket(0) reported one to ten turns for a model with none. Zero
is its own bucket.
The desktop app and the Windows tray both send a once-a-day usage
aggregate when the person has opted in. Each built its own, which meant
two schemas to keep honest. The CLI now computes one snapshot at the end
of the menubar payload and both apps send it verbatim.
Everything is bucketed and name-only: cost and count buckets, up to
eight models each with its top six task categories and their share of
turns, twelve categories with their top models, providers, MCP servers,
skills and tools by identifier with call buckets, a session count and
median length bucket, and cache hit and retry tax shares to two
decimals. Nothing derived from paths, project or branch names, or
message text can enter it; the builder only emits primitives and capped
containers. The raw model by task cross rides in through the options
bag and never lands in the payload itself.
The parity test builds the payload twice over the same warm cache and
expects the two to match. Since liveSessions landed, each session
carries idleSeconds, whole seconds since its last activity, so two
builds that straddle a second boundary differ by one and the test
fails at random. Seen on the macOS runner. stableShape now zeroes it
the way it already blanks the generated stamp.
The parity test builds the payload twice over the same warm cache and
expects the two to match. Since liveSessions landed, each session
carries idleSeconds, whole seconds since its last activity, so two
builds that straddle a second boundary differ by one and the test
fails at random. Seen on the macOS runner. stableShape now zeroes it
the way it already blanks the generated stamp.
Two of today's Windows fixes changed POSIX results. Guard flags counted
a backslash as a directory boundary on every platform, where it is an
ordinary filename character off Windows; it now counts only on win32,
while a forward slash counts everywhere so POSIX-shaped provider paths
still match on a Windows host. Hermes accepted drive-letter paths as
real workspaces on every host on the theory that a state.db can be read
on another machine; discovery is strictly local and the ledger contract
rules out restored databases, so that acceptance is Windows-only again.
The quota command races every provider read against a five second
timeout and exits as soon as output is written. The Codex read refreshes
the OAuth grant, and between parsing the grant and writing auth.json
there were two await points, so a timeout or the exit could land with
the old refresh token already retired server-side and the new one only
in memory, signing the user out of Codex. A rotated token was also
dropped when the re-read of auth.json failed or when the grant carried
no access token, and a failed write looked like a network error.
The persist path is now synchronous from the parsed grant to the atomic
rename, keeps the credential file's own private mode, falls back to the
in-memory document when auth.json cannot be re-read, persists a rotated
refresh token even without an access token, reports a failed write on
stderr, and the grant request no longer honours the caller's abort so a
rotation the server has committed cannot be cancelled mid-response.
Three gaps in the Windows route of `codeburn menubar`:
- A Microsoft Store install of the desktop app carries the tray inside
its package and never appears in the uninstall registry, so the CLI
downloaded and installed a second copy into Program Files. The Store
package is now detected first (Get-AppxPackage, bounded to five
seconds, any failure reads as "not a Store install") and its packaged
exe is launched instead; --force still installs the MSI and says the
Store copy is left in place.
- msiexec ran over a running tray. Windows Installer defers the file
swap to the next reboot in that case, so the post-install launch woke
the old process. The running tray is now asked to quit through its
own single-instance protocol, waited for, and killed only as a last
resort, before msiexec runs.
- The ownership marker was written only on the desktop route, so a
hand-installed tray could later be credited to the desktop app and
removed by its uninstaller. The CLI route now records "manual", and
an existing verdict is never rewritten.
readSecureFile rejects a login file with group or world bits on POSIX,
which is right for a real login. The Grok and Z.ai fixtures were written
with default permissions, so on Linux the product refused them and six
assertions saw transientFailure or disconnected. Windows has no mode bits
to check, which is why the branch only ever passed there.
os.homedir() reads USERPROFILE on Windows and never HOME, so the
isolation setup and every test that moved home were still resolving the
developer's real home directory. Fixtures came back empty, real sessions
leaked into counts, and the code under test wrote plans, receipts and a
sync ledger into the real ~/.config/codeburn during a run.
USERPROFILE now joins the redirected variables and a shared setHome()
helper moves HOME and USERPROFILE together; every spawn env carries both.
The remaining Windows-only failures were POSIX-shaped fixtures: chmod
tricks that only toggle a read-only attribute on NTFS, pid 1 as an
always-alive lock holder, splitting paths on '/', bare tar, mode-bit
expectations, and per-file timeouts too short for the cost of a tsx spawn.
Each gets a platform-aware equivalent so nothing is skipped on Windows and
the POSIX branches stay byte-for-byte what they were.
Full run on Windows: 267 files passed, 2 skipped, 3592 tests passed.
ProviderFilter.cliArg is both the --provider argument and the id the
payload-consistency guard matches against providerDetails. A case whose cliArg
is not a registry name silently disables that guard for its tab: the lookup
finds no detail row, so no contradiction is ever detected. Nothing in either
language can see both sides, so the contract is checked from the TypeScript
side, where the registry is importable and the Swift source is readable.
Table-driven over all 30 enum cases. No mapping needed fixing: .kimiCode
already yields `kimicode`, which is the registry name (`kimi-code` is not a
provider the CLI knows), and every other case resolves too. Setting .kimiCode
to `kimi-code` makes this suite fail, which is the check working.
The loader reads only the v3 path, so a hermes-session-ledger.v1.json from an
earlier install sat in the cache dir unread and undeleted. It is dead weight
that can only mislead: the parse-version bump forces a cold re-parse that
rebuilds every cursor from source, so nothing in it is recoverable. Unlink it
when the v3 file is absent.
The v2 test this replaces was vacuous. It wrote a v2 file and asserted the
ledger was empty, but the loader never looks at a v2 path, so it passed
whatever the code did. The replacement uses a real v1 fixture and asserts both
halves: the ledger loads empty AND the v1 file is gone afterwards.
The provider-scoped overlay blind-set a fresh slice for every date it could
produce one. A settled day's sources age off disk continuously, so that fresh
slice is a lower bound, not a correction, and the overlay replaced finalized
cache days with whatever the surviving files still explained. It ran over the
whole period and over the whole history, so the scoped view could report a
fraction of the same day the all-provider view served off the same cache.
The overlay now routes through mergeDayEntries with guardPartialSurvival:
fresh may FILL a (date, provider) the cache lacks and still wins inside the
settle window, but it can no longer SHRINK a settled day the cache already
holds. Filling has to keep working, because on a cold cache the scoped parse
is the only source a historical day has.
Measured on this machine over 2026-08-03..2026-09-01, comparing scoped
--provider claude against the claude slice of the unscoped run:
before $16649.42 / 81812 calls (short by $291.70 and 2507 calls)
after $16941.12 / 84319 calls (exact match, both fields)
Two open branches claim daily-cache version 30, so a v30 file on disk carries
unknown accounting. Bump this branch to 31 and move the Hermes
pending-rederive contract version with it, so a v30 file written under #1132's
accounting is treated as a foreign prior version: carried forward per slice,
never adopted as the finalized base.
The #946 copilot fixture seeded itself at DAILY_CACHE_VERSION - 5, a moving
target that crossed the copilot contract boundary (26) at this bump and
silently stopped granting the entitlement those tests exist to check. Pinned
to 25, which is the fixed historical version the fixture actually means.
Disclosure: the bump re-derives every day whose sources still survive, so
finalized history shifts. On the reviewer's machine Claude moved -0.78
percent. That is a corrected figure replacing a stale cached one, not a loss,
but it is a visible change to numbers users have already seen.
The desktop app's stderr on the VM carried "Antigravity quota unavailable:
Command failed: ps -ax -o pid=,command=" with "ps: unknown option -- x" on every
quota poll. Windows has no ps, and asking for one is a spawn failure rather than
an answer, so the provider reported a transient failure with a warning behind it
instead of simply not being there.
Win32_Process is the same listing by another name, and it is already how
src/providers/antigravity.ts finds these servers, so the quota adapter asks the
same way: PowerShell by absolute System32 path, argv only, no shell string, and
the Where-Object is a prefilter rather than the decision, which classifyProcessLine
still makes. There is no lsof either, so a pid's listening ports come from
netstat -ano; its state column is localized, so it is not matched on, and a row
that turns out not to be listening only costs one refused probe.
The guard this replaces was `win32 && !deps.execFile`, which the desktop app
defeated by injecting execFile, and which its own copy of the adapter never had
at all. Both copies now carry the same code, and the platform is injected so
either branch can be tested from either OS.
The Capacity Dock hover panel becomes a glance: a provider header, the
sessions running right now as pills with their context rings, a Today
strip, and a row of quota-window percentages, separated by hairlines.
Window percentages stay plain text until 70 percent so a healthy row
reads as text rather than a wall of colour. The panel stays 350pt wide;
every block height is a whole point and is summed into the panel frame,
since the hosting view does not size itself.
Running sessions are new CLI surface. `liveSessions` is add-only on the
menubar payload: sessions whose transcript was appended inside a 120s
window, carrying the branch, the model that answered last, and the
context that turn reported. Absence means "unknown", so the section
hides rather than claiming nothing is running. The block names projects
and branches, so sharing and MCP output strip it.
Today's totals needed no CLI change; the app simply was not decoding the
cache token counts the payload already carried.
Tauri names the install directory after the product and the binary after the
Cargo package, so what lands on disk is CodeBurn Menubar\codeburn-menubar.exe.
The registry read joined the product name onto InstallLocation instead and
produced CodeBurn Menubar\CodeBurn Menubar.exe, which has never existed.
Everything downstream was built from that path. `codeburn menubar` printed
"Launched CodeBurn Menubar." after spawning nothing, on both its paths: the one
that finds the right version already installed, and the one that has just
installed it. The desktop app stored it in companion.v1.json, so its Menu bar
and Sidebar switches sent --quit and --reload-settings to a file that is not
there, and the Run key it seeds pointed at the same missing file, which would
have failed silently at every login.
DisplayIcon comes first now, since an installer that writes one is naming the
binary rather than leaving it to be guessed. Tauri leaves it empty, so the path
that actually gets used is InstallLocation joined with the binary name, and the
binary name is a constant beside the product name rather than the product name
reused. Verified against this machine's registry: InstallLocation
"C:\Program Files\CodeBurn Menubar\", DisplayIcon empty, and one executable in
that directory called codeburn-menubar.exe.
The Electron desktop app is about to ship the matching windows-v* .msi in its
own resources, and it must not send every install of the desktop app to GitHub
for a file it already has. CODEBURN_MENUBAR_MSI names that file: the Windows
branch verifies the .sha256 beside it and hands it to the same msiexec call the
download path uses, so there is one installer rather than two.
Two rules that only matter for a bundled copy live here, beside the registry
read that answers them. Never downgrade: an installed menubar newer than the
bundled one was put there by a newer build and keeping it is the only safe
answer. And the marker at %LOCALAPPDATA%\codeburn-menubar\installed-by.json
credits whoever got there first, so a desktop uninstall can remove what the
desktop app installed and leave a manual `codeburn menubar` install alone. An
existing marker's verdict is never rewritten; an upgrade only refreshes the
version and the uninstall string it carries.
Nothing is launched from here. The caller that staged the MSI owns the tray
app's process, since it also has to be able to stop and restart it.
Ported from the menubar's ClinePassSubscriptionService, completing the set of
providers the Mac reads live so the Windows dock and settings can show the
same capacity.
ClinePass has no local login file: the key is one the user supplies, a
Keychain entry on the Mac and CLINEPASS_API_KEY (or CLINE_API_KEY) here. The
contract is published rather than internal, so a field that is present but
wrong is treated as a broken response instead of being skipped past; only an
unknown window type is ignored, so a fourth window would not break the
reading.
Ported from the menubar's GrokBuildSubscriptionService so Grok capacity
reaches every surface that reads the CLI, the Windows Capacity Dock
included.
The login the Grok CLI already owns in $GROK_HOME/auth.json is read
only: the file maps a scope to its token, so the current OIDC login is
preferred over the older sign-in entry and ties break by scope rather than by
key order. CodeBurn never refreshes it, so an expired login is terminal until
the user runs `grok login` again, and a file it cannot parse is reported as
that rather than as a signed-out user.
Grok bills one credit pool with no window label of its own, so the label
comes from the distance to the period end, as on the Mac. The settings call
that supplies the plan display name is best effort: losing it costs the
label, not the reading.
Ported from the menubar's ZaiSubscriptionService, so the Windows Capacity
Dock and the settings pane can read Z.ai capacity from the CLI the same way
the Mac reads it natively.
Credential order mirrors the menubar: a key the user supplied first (a
Keychain entry there, ZAI_API_KEY here), then the Z.ai login the Pi CLI
already keeps in ~/.pi/agent/auth.json. The key is used for one request and
never written anywhere.
Z.ai answers HTTP 200 with an authentication code in the body, so the decoder
reports that as a rejection rather than as an unreadable response, and it
keeps reading the older string-typed limit fields.
Ported from the menubar's CursorSubscriptionService so every surface that
reads the CLI, the Windows Capacity Dock included, sees the same Cursor
capacity the Mac shows.
The adapter opens Cursor's own VS Code state database read-only for the
`cursorAuth/accessToken` row, rebuilds the web session cookie from the user
id inside that JWT, and asks cursor.com for the usage summary. It never
refreshes the session and never writes: an expired token is terminal until
the user signs in to Cursor again, and a database Cursor is busy writing is
transient rather than a signed-out user.
Windows layouts are covered too: the database follows the VS Code convention
of each platform, so Windows reads it from AppData\Roaming.
The quota adapter only ever looked at ~/.config/github-copilot. Windows has
no such directory: the editor plugins write hosts.json and apps.json under
%LOCALAPPDATA%\github-copilot, so every signed-in Windows user was reported
as not connected and the Capacity Dock had nothing to show for Copilot.
The credential paths become an ordered list of directories resolved per
platform, and per call rather than at import, so the environment the paths
come from can still be changed by the caller. The XDG directory stays as a
second candidate on Windows for a token that arrived through a POSIX-style
shell home.
The fixture clamped to a local-time month start while the child is pinned
to TZ=UTC, so the clamp only worked at offset zero and the flake survived
the first minutes of each month everywhere else.
currentMonthTimestamp seeded at today 12:00 UTC, which is in the future
for the 12 hours before it. Rows timestamped in the future don't surface
in the overview, so every CI run between 00:00 and 12:00 UTC failed
'keeps overview budget lines only on unfiltered overviews' with
'No usage found'.
Seed five minutes back, pinned to month start on the 1st so the row
can't slip into the previous month.
Agent tabs filtered strictly on cost > 0, so a provider whose sessions
carry tokens but no recorded dollar cost (Hermes on a flat subscription,
free-tier models, unpriced models) vanished from the strip entirely.
The menubar payload now carries an activity signal per provider, and the
strip keys visibility off it: providers with real usage stay listed, while
providers merely discovered on disk stay hidden. Older payloads without
the signal keep the previous detected-provider behavior.
Applies consistently across the mac menubar, the Electron renderer, and
the Windows payload types.
Hermes writes estimated_cost_usd = 0.0 (not NULL) when cost_status is
'unknown' (no pricing data) or 'included' (flat subscription, e.g. Codex
plan). resolveHermesCost treated any non-null estimate as a recorded
amount, so every subscription-backed Hermes session reported $0.00 with
real token counts underneath.
Only trust positive estimates now; $0 falls through to the token-based
calculateCost. An explicit $0 actual_cost_usd (a real invoice amount)
still wins, and genuinely free models still land on $0 since litellm
prices them at 0.
Only Copilot CLI session-store rows carry total_nano_aiu, so a typical user
has a handful of exactly rated requests and hundreds of unrated ones, and
codeburn plan showed the exact-only sum as if it were the whole bill.
Price every unrated request from its tokens at listed API rates (1 credit =
$0.01) and carry that as estimatedCredits alongside creditRatedCalls /
creditUnratedCalls. A session that already carries an exact figure is never
estimated on top of: total_nano_aiu bills that request's whole token set,
JSONL twin included. spentCredits, the bar and percentUsed stay on GitHub's
exact figures. The plan headline, and status JSON via creditsNote, now say
how much of the total is estimated.