Commit graph

976 commits

Author SHA1 Message Date
iamtoruk
a1b4b22f51 fix(windows): close three holes in the cross-process preference lock
writeDockEnabled still did its own read, mutate and atomic write of
windows-dock.json, outside the lock the rest of the module takes. It is
the Node side of the dock's enabled switch, reached from the desktop
app's Sidebar toggle, so a toggle there could still land between the
tray app's read and its rename and erase whatever it had just stored,
which in practice is the rail's placement. It now merges through
patchTrayFile, which takes the lock for the whole cycle; enabled is
already an accepted dock key, so nothing is dropped on the way.

Stale-lock recovery could hand out two owners at once. Both sides did
"if abandoned, unlink and retry", and nothing stood between the check
and the unlink: contender A could already have removed the stale lock
and created a fresh one of its own, and B's unlink then deleted A's
fresh lock, leaving both of them holding the file. Windows' share mode
hides this most of the time, because a lock a live holder still has open
will not unlink at all, but the same protocol runs on Linux and macOS,
where the unlink always succeeds. Removing an abandoned lock is now
itself arbitrated, by the same exclusive create the lock uses, on a
sibling <lock>.takeover file. Only its winner may unlink, and only after
re-checking staleness under that right, so a rival that reclaimed first
keeps the lock it now holds. A takeover file is dropped on every path
out, never held across the wait, and one left behind by a reclaimer that
died is freed by the same staleness rule as the lock itself.

The cross-process test asserted only each side's final value, so it
noticed a lost update only when the last writes happened to collide: on
a deliberately broken lock it passed about one run in three, which is
weak evidence for the property it exists to prove. Each side now writes
a counter that only rises, and a reader thread watches the file for the
whole run. A separate reader is the point: neither writer can see its
own counter rolled back, because in the unlocked cycle each carries the
other side's value forward itself, so what it reads back is never older
than what it last read. With the lock both counters only ever rise in
the file; without it one falls. It now fails on every unlocked run.

Also: a placement that cannot be saved is logged instead of discarded
silently, since losing the lock under contention is a new way for the
rail to revert at the next launch; and the Codex sameLogin comment now
states outright that a replacement document carrying none of the three
identifying fields reads as the same login and is written over, which is
the deliberate side to err on.
2026-09-03 10:28:05 -07:00
iamtoruk
7533e96fe3 fix(quota): discard a Codex refresh whose login changed under it
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.
2026-09-03 07:59:42 -07:00
iamtoruk
378062ebc2 Merge remote-tracking branch 'origin/main' into feat/windows-capacity-dock 2026-09-03 05:16:32 -07:00
iamtoruk
7b2a6df333 fix(quota): guard both exits, and outlast the request being guarded
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.
2026-09-03 04:52:31 -07:00
iamtoruk
d84769edfe fix(cli): drain credential writes before exit, a staged-msi flag, a zero bucket
- 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.
2026-09-03 03:06:13 -07:00
iamtoruk
e3dd333949 feat(cli): an anonymised daily telemetry snapshot inside the menubar payload
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.
2026-09-03 01:18:22 -07:00
iamtoruk
6998c5ac07 fix: keep macOS and Linux path behaviour exact in guard flags and Hermes
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.
2026-09-02 15:11:01 -07:00
iamtoruk
a6005df140 fix(quota): persist a rotated Codex refresh token before anything can exit
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.
2026-09-02 15:11:01 -07:00
iamtoruk
dc802f545d fix(windows): make codeburn menubar safe beside the desktop app
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.
2026-09-02 15:08:52 -07:00
iamtoruk
673d7f2b21 fix(windows): nine Windows path and process bugs the CLI tests exposed
Making the CLI suite honest on Windows turned up product bugs that
POSIX never reaches:

- plugins: a bare `tar` resolves to Git for Windows' GNU tar, which reads
  a drive letter as a remote host and fails on every absolute path. The
  installer now prefers the bsdtar Windows ships in System32.
- antigravity statusline: the hook command was written with POSIX
  backslash escapes, which cmd.exe does not understand, so the installed
  path was broken for real Windows users.
- act undo: renaming a directory over an existing one raises EPERM on
  Windows, not ENOTEMPTY, so the snapshotted-destination retry never ran.
- parser: a worktree's main repository path was sliced from the
  slash-normalized copy of the gitdir, so it never matched session cwds.
- dashboard: home-relative project labels compared a slash-normalized
  path against an unnormalized homedir(), so no Windows path shortened.
- guard flags: a POSIX-shaped flag path from provider data never matched
  a subdirectory because the boundary check used the host separator only.
- claude desktop sessions: the discovery memo omitted homedir() from its
  key and served the previous home's paths once home moved.
- copilot: a JetBrains file:///C:/... URL kept its URL slash ahead of the
  drive letter, so the project's .git walk never resolved.
- hermes: a state.db written on another platform records that platform's
  path shape, so both absolute forms now count on every host.
2026-09-02 13:43:57 -07:00
Resham Joshi
3376d764e6
Merge pull request #1234 from avs-io/codex/provider-core-contract-repair
Repair provider usage and Hermes cost contracts
2026-09-02 11:50:56 -07:00
iamtoruk
3b60b724fe fix(models): group Trend rows and the models command by the same display name (#1239) 2026-09-02 10:40:39 -07:00
iamtoruk
d27b489328 Merge remote-tracking branch 'origin/main' into feat/windows-capacity-dock 2026-09-02 08:01:44 -07:00
iamtoruk
a8bddef84e fix(hermes): superseded v1 ledger file was left on disk forever
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.
2026-09-02 07:32:02 -07:00
iamtoruk
3e48f8d073 fix(aggregator): overlayProviderDaySlices overwrote settled cache days with shrunken parses
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)
2026-09-02 07:32:02 -07:00
iamtoruk
a8a3031b58 fix(cache): DAILY_CACHE_VERSION 30 collides with open PR #1132
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.
2026-09-02 07:32:02 -07:00
iamtoruk
6fa5dfbeb7 Merge remote-tracking branch 'origin/main' into wt1234 2026-09-02 07:06:47 -07:00
iamtoruk
4113ae30e0 fix(quota): Antigravity looks for its language server the Windows way
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.
2026-09-02 07:00:22 -07:00
Aditya Vikram Singh
0455250526 derive versioned Claude family labels 2026-09-02 19:15:57 +05:30
iamtoruk
53c5c7b370 feat(dock): glance popover with hero window, sessions and today strip
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.
2026-09-02 06:09:06 -07:00
iamtoruk
6eead02386 fix(cli): the installed tray app is codeburn-menubar.exe
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.
2026-09-02 05:59:54 -07:00
iamtoruk
9160f04946 feat(cli): install the tray app from an msi another installer staged
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.
2026-09-02 04:23:05 -07:00
Aditya Vikram Singh
4bebc37f2c repair Hermes ledger migration fidelity 2026-09-02 16:18:05 +05:30
Aditya Vikram Singh
38e6e19f29 harden provider period and cache contracts 2026-09-02 16:18:05 +05:30
Aditya Vikram Singh
7106db2c0e fix menubar provider usage contracts 2026-09-02 16:17:28 +05:30
iamtoruk
7a3eff0b22 feat(cli): live ClinePass quota in codeburn quota
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.
2026-09-01 17:01:33 -07:00
iamtoruk
29379dec49 feat(cli): live Grok Build quota in codeburn quota
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.
2026-09-01 17:00:01 -07:00
iamtoruk
cace8f2a71 feat(cli): live Z.ai GLM Coding Plan quota in codeburn quota
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.
2026-09-01 16:57:54 -07:00
iamtoruk
2106766a00 feat(cli): live Cursor quota in codeburn quota
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.
2026-09-01 16:55:40 -07:00
iamtoruk
f2224b5a70 fix(cli): read the Copilot plugin token from %LOCALAPPDATA% on Windows
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.
2026-09-01 16:52:44 -07:00
iamtoruk
db4f282209 fix(windows): surface Capacity Dock show errors instead of discarding them 2026-09-01 14:18:12 -07:00
iamtoruk
e593d2e0cc feat(cli): codeburn quota command reading provider capacity from the CLI 2026-09-01 12:48:58 -07:00
Resham Joshi
043ffd4822
Merge pull request #1214 from MiguelMachado-dev/feat/zero-cost-provider-visibility
feat(menubar): keep token-only and flat-rate providers visible in agent tabs
2026-09-01 05:08:32 -07:00
iamtoruk
2620cbb2bc fix(hermes): bump the parse version so cached zero-estimate sessions re-cost
The cost rule changed, so sessions whose state.db fingerprint has not
moved must be re-parsed or they keep serving the stale placeholder zero.
2026-09-01 05:06:20 -07:00
Miguel Machado
fee0f63fd0 feat(menubar): keep token-only and flat-rate providers visible in agent tabs
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.
2026-08-31 22:43:13 -03:00
Miguel Machado
c114424519 fix(hermes): don't trust a $0 estimated cost — calculate from tokens
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.
2026-08-31 22:41:18 -03:00
iamtoruk
71bd7607f3 docs(plan): calibrate the Copilot credit estimate wording against real session-store rows (#1199) 2026-08-31 03:13:04 -07:00
iamtoruk
616a1fada2 fix(plan): move the Copilot credits bar onto the estimate and print whole credits (#1199) 2026-08-31 03:10:29 -07:00
iamtoruk
d879d6590b fix(plan): estimate Copilot AI credits from tokens and say when the total is incomplete (#1199)
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.
2026-08-31 03:07:38 -07:00
iamtoruk
bc451ed1b6 fix(lock): heartbeat replaces the lock body atomically instead of truncating in place
The heartbeat rewrote session-refresh.lock with a plain writeFile,
which truncates before it writes, so any reader could observe an empty
or partial body for the width of the write. observe() tolerated that
window with retries, but every plain reader (the lock tests included)
raced it, which is the JSON parse flake behind #904.

The rewrite now lands next to the lock and renames over it, so a
reader sees the previous body or the next one, never a torn one. A
refused replace on Windows skips the tick, which staleness absorbs at
nine heartbeats per staleMs. observe() keeps its tolerance because
older codeburn versions sharing the cache dir still rewrite in place.

The new regression test hammers plain reads against a 1ms heartbeat:
it failed 5 of 5 runs against the old rewrite and passes 10 of 10
serial lock-suite runs with this change.
2026-08-30 03:29:01 -07:00
Aditya Vikram Singh
1487c75fa4
fix(tui): clean cache locks on confirmed exit (#1165) 2026-08-28 15:06:07 -07:00
Aditya Vikram Singh
81f1eb3d6a
perf(tui): show cached periods before refreshing sources (#1159)
* perf: paint Today before indexing TUI history

* perf(tui): serve cached periods before source refresh

* fix(tui): keep cached snapshots out of parse memo

* fix(tui): preserve provider and period truth

* fix(tui): label visible period while indexing

* fix(tui): recover provider switches and empty Today
2026-08-28 13:21:47 -07:00
Aditya Vikram Singh
9a93fdd77d
fix(tui): clear stale panels on settled resize (#1156) 2026-08-28 13:21:03 -07:00
Resham Joshi
2512f6e487
Merge pull request #1158 from getagentseal/feat/desktop-plugin-era
Some checks are pending
CI / semgrep (push) Waiting to run
Tests / test (22) (push) Waiting to run
Tests / test (22.13.0) (push) Waiting to run
feat(desktop): plugin manager, install flow, sharing consent center, dormant Team tab
2026-08-28 07:09:17 -07:00
Resham Joshi
4cb59e8404
Merge pull request #1154 from getagentseal/feat/plugin-commands
feat(plugins): socket phase 2 - command invocation, exporter seam, remote install (10A/10B/14A)
2026-08-28 07:08:58 -07:00
Resham Joshi
3b4d3fd665
Merge pull request #1153 from getagentseal/feat/consent-scheduler
feat(sync): consent-once auto-sync with acceptance fingerprint, receipts, and kill switch (CB-4)
2026-08-28 07:08:35 -07:00
Resham Joshi
25e595c06b
Merge pull request #1152 from getagentseal/feat/plugin-signing
feat(plugins): ed25519 release-key verification and plugin add/remove (9b)
2026-08-28 07:08:17 -07:00
Resham Joshi
aca73fb8d0
Merge pull request #1151 from getagentseal/feat/plugin-socket
feat(plugins): CB-3 plugin socket - wire guard, CLI inspector, payload seam
2026-08-28 07:07:40 -07:00
iamtoruk
747e6a619e feat(desktop): complete plugin-era UI with details, install flow, settings, and team registry
Implement five missing D1-D3 components for full plugin era desktop support:

1. PluginDetails modal (sections/PluginDetails.tsx): Display full plugin manifest with all syncAttributes disclosures verbatim, spanKinds, commands, and on-disk sections loaded via pluginInfo. Defensive rendering for unknown fields.

2. InstallFlow stepper modal (sections/InstallFlow.tsx): Three-step flow for plugin installation - Step 1 source selection (org name input or folder via chooseDirectory), Step 2 installation with spinner and CLI error display verbatim, Step 3 success confirmation with "View details" button. Special handling for no-sync-config errors.

3. Plugin row actions (update sections/Plugins.tsx): Add Details, Verify, and Remove action buttons to plugin list. Remove action shows confirm modal naming plugin. Wired to CLI bridge calls.

4. Settings > Sharing pane (sections/SettingsSharing.tsx): Complete automatic sync configuration UI within Settings panes. Empty state with "Set up automatic sync" flow: cadence selection (daily/hourly) + work-matching toggle -> disclosure text via syncAutoEnable(accept:false) -> scrollable display -> Accept flow. Active state displays fingerprint (truncated), acceptedAt, cadence, work-matching, receipts list. Drift detection with "Review and re-accept" button. Always-visible "Stop automatic sync" danger button.

5. Team tab registry (components/TeamRegistry.tsx): Detect "teams.*" keys in payload plugins record; render Team section in nav when present. v1 renderers for teams.week (spend card) and teams.status (status link to teams.codeburn.app). Unknown keys fallback rendered. schemaVersion > 1 displays update prompt.

All components reuse existing app patterns (card/list/button/modal styles, CSS tokens, no new dependencies). Tests added for component row states, disclosure flow, and Team tab detection. All gates pass: root 3839 tests, app 614 tests, typecheck clean, build succeeds.
2026-08-28 06:59:50 -07:00
iamtoruk
6d69803817 feat(desktop): plugin manager, install flow, sharing consent center, and dormant Team tab (plugin era D1-D3)
Part 1: Add --json output flags to three CLI commands for machine-readable output
- codeburn plugin list --json: array of plugin objects with status and capabilities
- codeburn plugin info <name> --json: manifest with dir and onDiskSections
- codeburn sync auto status --json: status object with configured, accepted, killed, receipts

Part 2: Implement Electron bridge with read and mutation handlers
- Read handlers: pluginList, pluginInfo, syncAutoStatus (return parsed JSON)
- Mutation handlers: pluginAdd, pluginRemove, pluginVerify, syncAutoEnable, syncAutoDisable
- All handlers follow existing Envelope pattern with proper error handling
- Special case: syncAutoEnable captures disclosure text when accept=false

Part 3: Renderer UI components (minimal implementation D1-D3 shell)
- Add Plugins section to nav rail at bottom (quiet entry, plugin icon)
- Implement PluginsSection component with list rendering for loaded/rejected plugins
- Update Section type and routing to include plugins navigation
- Add test coverage for Plugins panel row states
- Implemented as dormant Team tab registry placeholder for future plugin sections

Tests: All CLI tests (3839 passed), app tests (613 passed), E2E gates all passing
- CLI: tsc clean, vitest passes with 26 pre-existing jsdom errors
- App: typecheck clean, npm test green, npm run build succeeds
2026-08-28 06:58:55 -07:00