Scan the Kimi Code stores for session dirs whose agents/*/wire.jsonl was
written inside the liveness window and fold them into the menubar
liveSessions block as provider kimicode, with the project from state.cwd,
the model from the last llm.request in the main wire tail, and sub-agent
wire mtimes as the session's sub-agent activity.
Chips were keyed by the string they display, which truncates a session
id to 12 characters and a project path to its last segment. Two sessions
whose ids share a prefix, or two projects with the same basename on the
same branch, produced one React key for two chips: React warned about
the duplicate and could reconcile or remove the wrong one.
filterChipKey returns the composite identity each dimension is already
normalized and removed by (provider + session id, project + branch), so
chips that read alike stay distinct to React while the display label is
left as short as it was.
The list reset its visible-row count to the first page whenever the
selection, the sort, the search or the data changed — but it wrote the
internal fallback state, and the app passes visibleCount as a controlled
prop so it can restore the depth from the nav history. The reset was
therefore dead: after Show more, changing the sort or removing a chip
left the reader 240 rows deep in a list that had just been reordered.
The owner now resets it in the same commit as the change it owns, so a
sort or selection change is one history entry rather than two, and no
reset can fire during a Back/Forward restore and discard the depth that
was just restored. The effect keeps serving the uncontrolled wiring and
says so.
The Pull requests section imported the PR selection builder and threaded
the drill-through callback through four component levels, but the row's
only handler was expand/collapse, so neither was ever invoked: every
other aggregate (day, model, category, project) reached the filtered
session list and the one report that names shipped work did not.
An expanded row now carries its own "View sessions for this pull request"
control above the work breakdown, matching the project entry in Spend. It
selects the PR by URL — the aggregation key of the by-PR report — and,
being a control of its own rather than the row, never toggles the
expansion it sits in. Rows with no per-turn detail get it too, and the
section renders no affordance at all when there is no destination wired.
The popover's quota warning painted its text in the same system yellow,
orange or red as its 12% pill. In light mode that measured 1.23:1 to 1.43:1
for yellow and at best 3.04:1 for red, and dark-mode red fell to 3.33:1. The
pill keeps its hue; the text and its glyph now take a per-appearance
foreground from QuotaWarningPalette that measures at least 5.29:1, and a test
holds every severity at WCAG AA against the pill composited over both ends of
the popover's background in both appearances.
The sentence named no window. AggregateQuotaStatus reduced each provider to
its worst window and kept only the percentage, so "Claude 70% of quota used"
was the 5-hour limit read next to a weekly 34%, and looked wrong. Each warning
now carries the winning window's label and reset, and the row reads
"Claude · 5-hour 71% · resets in 3h 12m" with the Capacity Dock's countdown,
one line per provider. The countdown is left off when there is no reset time
or it has passed, and "over limit" is kept for a window at or past 100%
instead of everything the danger band (90% and up) covers. The windows
compared, the 70% threshold and the flame's severity are unchanged.
"%@ of quota used" has no caller left and is retired; "resets in %@" is added
for en and zh-Hans.
Three ServeConnectionTests failed on roughly half of all macOS Menubar CI
runs and always passed on re-run. Each one raced a real clock or a real
child process against Swift-side work. A cooperative pool starved by
CPU-heavy suites that swift-testing schedules alongside can delay that work
by seconds.
- "cancelling a hung request returns promptly" asserted a 500 ms wall-clock
budget, and its fixture child exited after `sleep 1`. When the cancellation
hop was starved past those exits, the connection retried the request on
replacement children until the death budget answered ServeUnavailable. The
timeout path never fired, because the test used the real ten-minute budget.
The child now stays alive, the timeout comes from the manual clock, and the
test asserts that the caller sees CancellationError before any timeout fires.
- "a request queued during cancelled hydration completes on the same child"
read the child's event log as soon as the reply resumed the caller, but the
child appends "second-replied" only after writing that reply. The test now
waits for the log line. The manual clock also replaces its timeout recorder,
which really fired after 5 s.
- "external cancellations keep one child and safely discard late replies" let
the fixture reply 50 ms after reading, so a delayed cancel lost to the reply.
The child now holds each reply until the test has observed the cancellation.
Polling is bounded by a 30 s hang guard instead of 2 s. When a guarded await
expires, the guard releases the fixture, so a regression fails its assertions
instead of hanging the run. No production code changes.
Closes#1333
cli-cache-read-pipeline seeded its fresh Claude turn at now-10m and now-9m
while computing "today" from the UTC clock. For the first ten minutes after
UTC midnight those timestamps land on the previous day, so the fresh slice
falls outside `--days ...,today` and `--period today`: 1811 becomes 1111 and
4321 becomes 0. A PR run that started at 2026-09-13T00:03Z failed on every
leg while main's 23:32Z run passed on the same code.
Derive every date and timestamp from one `now` and clamp both seeds into
[today's UTC midnight, now], preserving user-before-assistant order, the
same idiom cli-status-menubar already uses. The CLI subprocess has no
injectable clock, so a run that crosses midnight after seeding now skips
with a note instead of failing.
menubar-project-identity had the same bug with a one-minute window (now-1m
against getDateRange('today')); clamp it the same way.
Refs #1216
When none of a session's messages produce a priced call, the SQLite
parser falls back to the totals on OpenCode's session row. That path
passed tokens_output alone to calculateCost and dropped
tokens_reasoning, while still reporting reasoningTokens, so thinking
tokens were shown but never charged. OpenCode bills reasoning at the
output rate and the per-message path already did the same.
Route both the fallback and buildAssistantCall through
billableOutputTokens so they share one rule with the cache-rehydration
path. The per-message change is behaviour-neutral for opencode and
kilo-code; it only removes the hand-rolled sum that let the fallback
drift.
Refs #1334
The notification, the Plan-tab detail and the hover-card line #725 added were
composed in a presentation type and shipped English to a zh-Hans user. Each is
one key now. reset_type is vendor data with no fixed vocabulary, so the four
cadence words OpenAI sends are translated and anything else rides through
verbatim inside a translated frame. compactAge stays character-identical with
the TypeScript side in English, which is what the contract was about: en is an
identity table. The dock's cache-read tooltip was bound to a let before its
call site, which is why the scan never saw it.
Every sentence #725 added is now one key with placeholders. The window label
keeps its English form in the persisted event and is translated at render
through a lookup on that form, because "weekly limit" -> "weekly" is a suffix
rule only English obeys; a label outside the known set reads through as before.
The 697 existing early-reset expectations pass untouched.
Every caption and help sentence #1267 added rendered English in a zh-Hans
build: they are composed in a presentation type, not at a view call site, so
neither the catalog diff nor the source scan could see them. Each sentence is
now one key with placeholders. The two stage captions reuse the Plan tab's
existing keys, and the countdown reuses the popover's. English output is
unchanged: the 329 existing pace expectations pass untouched.
Settings > General > Language offers System, English and 简体中文. It writes
AppleLanguages into the app's own preferences domain, the same key System
Settings > Language & Region > Applications writes, so the two surfaces are one
setting. The current value is read back from that domain rather than through
UserDefaults.standard, which falls through to the global domain and would
report the system language as CodeBurn's own override: System could then never
show as selected. An inline row offers the relaunch that applies it.
The 24-unit budget was a Character count, so "GitHub Copilot 剩余 12% · 6 小时
2 分" fitted it at 24 Characters while drawing 31 cells: a third wider than
the first row it is not allowed to exceed. abbreviate now measures East Asian
wide and fullwidth scalars as two. All-Latin rows are unchanged.
veryShortWeekdaySymbols gives en "M T W T F S S": two ambiguous pairs, and
two duplicate ForEach ids. shortWeekdaySymbols clipped to two units keeps
"Mo Tu We" in English and reads 周一 周二 in zh-Hans, 19.9pt in a 30pt cell.
Rebase resolution for #1289 onto main (#1306, #1313, #1314, #1315, #1328,
#1329). Conflicts kept both intents: main's second-row title composition,
glance-window accessibility actions, cache-read line, host field and merged
Notifications section keep their behaviour and now resolve through L(…).
Adds 14 keys to both tables, drops 4 that no longer have a call site, and
retranslates the two Copilot explanations main rewrote.
sanitizeForSharing spread current and emptied only topProjects and
topSessions, so the per-branch rows added with the payload block went out
verbatim: a branch such as exp/extraction-arms reached a peer device as
typed. Branch names encode ticket ids, customer names and feature
codenames, so they get what project and session rows get and leave the
payload entirely. Pseudonymizing was the alternative, but a branch-a1b2c3
row means nothing on another device's dashboard, and no shared surface
reads the block today.
Refs #1321, #1325
redactProjectNames rebuilt every row with a spread and replaced only the
fields it knew about, so identities added to the payload later rode
through untouched with include_project_names: false:
- topSessions[].projectKey, the raw sessions-list row key, is a
dash-encoded absolute working directory (-Users-<user>-Projects-<repo>).
Hash it with the project pseudonym, the way topProjects[].id already is.
- topSessions[].sessionId and topProjects[].sessionDetails[].sessionId are
the drill-through identity; a Codex id also carries the rollout
timestamp this pass blanks out of `date`. Hash them as session-xxxxxx.
provider stays: it is claude/codex, not identity.
- byBranch[].branch is the raw git branch, which encodes ticket ids,
customer names and feature codenames. Give each distinct branch a
stable branch-xxxxxx pseudonym and keep the row's numbers. A null
branch stays null: that is unbranched spend, not a name.
The new pseudonyms are domain-separated inside the digest so a branch and
a project of the same name do not share a hash; the project pseudonym
itself is unchanged. redactSessionDetails now takes its type from the
payload instead of a hand-copied inline type that had drifted from it,
which is why the leak type-checked. include_project_names: true is
unchanged.
Refs #1325, #1321
LocalizationCatalogTests diffs en against zh-Hans. That catches a key
translated in one locale and not the other, but it is blind to the failure
that actually happens: a feature ships a bare `Text("Second row")`, the
literal never becomes a key, both tables stay in perfect agreement, and a
zh-Hans build renders English. #1252 and #1243 landed exactly that way, which
is why the previous commit exists at all.
So this suite reads mac/Sources instead of the tables, in three passes that
cover each other:
1. Call sites. The SwiftUI and AppKit surfaces that put a string on screen —
Text/Button/Toggle/Picker/…, the accessibility modifiers, NSMenuItem,
NSAlert and window titles — must be handed `L(…)`, not a literal.
2. Display-label properties. `displayName`/`displayLabel`/`settingsLabel` are
how this codebase names an enum for a picker, and they are not call sites,
so a new metric case with a bare literal would slip past pass 1.
3. Catalog round-trip. Every key a view asks for has an entry in both
locales, and every entry has a call site — so a key added to the code but
not the table, or left behind after a rewording, fails too.
Scoped to avoid false positives rather than by suppressing findings:
- A literal is exempt when, with `\(…)` segments removed, nothing is left but
figures, symbols, or words in a three-entry vocabulary (`CodeBurn`, `tok`,
`USD`). That covers `Text("$25")`, `Text("\(count)")` and `Text("— ")`
without naming a single file, so the exemption cannot go stale.
- Pass 2 only looks at bracket-depth zero, which is what separates the
property's result (`case .pro: "Pro"`) from machinery it calls
(`Locale(identifier: "en_US")`).
- The two denylists are documented with reasons and keyed to the declaring
type, so `PlanType.displayName` being exempt does not exempt every
`displayName` in the app.
Comments are stripped first, or Localization.swift's own documentation of
`Text("literal")` would read as a violation; strings win over comment markers
so a URL in a literal does not swallow the rest of the file.
The scanner lives in its own file with no `import Testing` so the standalone
swiftc harness can exercise the shipped code rather than a copy of it —
`swift test` cannot run on this host, and a reimplementation would drift.
Mutation-checked: un-routing `Toggle(L("Second row"))` fails pass 1,
un-routing `MenubarSecondRowMetric.settingsLabel` fails pass 2, and dropping
`L("Show %@ usage")` fails pass 3. Writing it also turned up two real bugs in
the scan (`Label(` matching inside `.accessibilityLabel(`, and a nested
`enum PlanType` reporting its outer type), both now covered by a test.
Closes#1289
and #1286's Copilot host fix all shipped user-facing copy that bypasses the
catalog — neither of the first two PRs' diffs contains a single `L(` call. In a
zh-Hans build those strings render in English.
Sweeping mac/Sources the way the original extraction did brings 18 new keys,
and retires 2 that main reworded (the Copilot help paragraph gained the
GitHub Enterprise Cloud host rule; the connection detail now names the host
that answered rather than hardcoding api.github.com). 533 keys become 551.
Routed here:
- Second row: the Settings toggle, the metric picker and its four option
names, the help paragraph, and the row text itself — today's cost, today's
tokens, and the quota row with and without a provider label. The reset
countdown reuses the popover's own `%lldd %lldh` / `%lldh %lldm` / `%lldm`
keys rather than minting a second set, so the two countdowns cannot
disagree in a translated build.
- Capacity Dock glance: the switch hint and the named VoiceOver action.
- Copilot: the reworded help paragraph and the host-aware connection detail.
Kept verbatim, per the rules in the catalog header: provider, model and plan
names; `tok`; the `%.2f` amount and its currency symbol; and the window label
the gauge reports, which is provider data and doubles as the matching needle
in CapacityDockGlanceWindow — translating the generic fallback alone would
make one VoiceOver sentence half-Chinese depending on the provider selected.
Also localizes CodexUsage's credit-limit labels. Those are not new, they were
missed by the original extraction and the guard test in the next commit finds
them; leaving them would mean shipping a test that fails on main.
Verified with a standalone swiftc harness over both tables (`swift test`
cannot run on this host): key parity, no blank values, en identity, and
argument/literal-percent specifier parity, plus the new rows formatting
correctly in both locales.
A translation catalog rots in ways the compiler cannot see: a key added to a
view but not to zh-Hans shows English in a Chinese UI, a dropped key shows a
raw identifier, and a format specifier that disagrees between the tables is a
wrong number or a crash inside String(format:).
LocalizationCatalogTests reads both tables out of the resource bundle, the same
files L(_:) resolves at runtime, and asserts: the key sets are equal in both
directions; no value is blank; en repeats its key verbatim, which is what makes
the English fallback correct; argument specifiers match in count and order,
because String(format:) binds them positionally; literal `%%` counts match,
while allowing `%%` to move where Chinese word order demands it; no key is only
specifiers, which would leave a translator nothing to work with; and the shipped
localizations agree with L10n.supportedLocalizations, so Package.swift, the two
packaging scripts' CFBundleLocalizations and the Swift constant cannot drift.
Four cases then resolve representative presentation strings in both locales and
check that the English one equals what the presentation struct returns, which is
the link proving the struct reads the catalog rather than a stale hardcoded
string, and that a substituted product name survives translation.
The specifier test caught one bad key while being written: the Capacity Dock
connect button's accessibility label was `L("%@ %@", title, providerName)`,
which has no translatable content at all. It is plain interpolation now, and
both halves were already localized on their own.
CHANGELOG and mac/README document the user-visible part: the language follows
the system, overridable per app in System Settings, plus what adding a third
language requires.
Closes#1219
All 533 catalog keys translated into zh-Hans, so the menubar app now follows
the system language with no setting to find and no third-party library. AppKit
picks the table: `CFBundleLocalizations` in both packaging scripts advertises
`en` and `zh-Hans`, which is also what puts the app under System Settings >
Language & Region so a user can override the language for CodeBurn alone.
Wording follows macOS system apps rather than a literal gloss: 立即刷新,
断开连接, 存储并连接, 载入配额, 再试一次. Product nouns stay as users
already know them: provider, model and plan names (Claude, Codex, Gemini,
Opus, Sonnet, Antigravity), Token, Dock, API, OAuth, shell commands and file
paths, currency codes.
Format specifiers are identical to the English entry in count and argument
order. `%%` is a literal percent sign and not an argument, so it may move where
Chinese word order demands it ("%@ · %@ 达到 100%%"); the argument-consuming
specifiers may not, because String(format:) binds them positionally. The next
commit's test enforces exactly that distinction.
Numbers, dates and currency are untouched: they already went through
NumberFormatter / DateFormatter / asCurrency(), and `L(_:_:)` only substitutes
values those produced.