Commit graph

2150 commits

Author SHA1 Message Date
ozymandiashh
016b8edaef feat(menubar): optional second row in the macOS menu bar item
The menu bar item could show one figure, so seeing subscription quota and
today's local usage at the same time meant opening the popover. This adds an
optional second line, off by default, configured from the existing
Settings > General > Display section: a "Second row" toggle plus a picker for
what it shows. All four metrics are figures the app already computes for the
popover, so nothing here adds a fetch or a refresh cadence: quota remaining
with its reset countdown for whichever connected provider is nearest its limit
(the same provider the flame already tints for), today's all-provider cost,
today's total tokens, or running sessions.

The rows are one attributed title. A paragraph style clamps text line height
but not an attachment, so the inline flame at the text's own point size dragged
the title to 24pt and AppKit clipped the second line away; the flame is
requested at 8pt and seated back inside the line, which puts every row
combination at exactly 20pt inside the standard 22pt menu bar, centred with 1pt
of slack above and below. Measured with NSAttributedString.boundingRect and
asserted in the tests, since those four numbers only work together.

With the setting off, or whenever the chosen metric has no data yet (no
connected provider with a quota window, no today payload, a CLI that predates
the liveSessions block), the title falls back to the previous single-row
composition unchanged: same font, same attributes, no paragraph style. The row
formatting is a pure type over the row settings and a plain-value payload
snapshot, so it is covered without an AppStore or a status item.

This is a deliberately reduced slice of the request. Not included: the layout
editor, presets, live preview, a third row, multiple items or aligned columns
per row, per-item provider/period/scope, optional labels, decimal precision,
reordering and text size. Keeping the formatter pure leaves room for those
later without touching the rendering path.

Closes #1252
2026-09-12 06:37:46 -07:00
Resham Joshi
ef86348673
Merge pull request #1305 from getagentseal/fix/copilot-host-followups
fix(menubar): follow the credential's GitHub host for Copilot quota
2026-09-12 16:26:13 +03:00
Resham Joshi
ce59a3af32
Merge pull request #1307 from getagentseal/fix/projects-pane-followups
feat(app): Projects pane that scopes the desktop app to chosen projects
2026-09-12 16:21:34 +03:00
iamtoruk
0225088984 fix(quota): reject a Copilot host carrying a URL delimiter
The `.ghe.com` suffix check ran on a normalized string that still allowed
`?`, `#`, `\` and spaces, and that string was interpolated straight into
the request URL. `evil.com?.ghe.com` in a hosts.json key passes the
suffix check but builds a URL whose host is `api.evil.com`, so the
Authorization header lands on a host that was never approved. Verified
on macOS: URL(string:) parses it as host `api.evil.com`, path `/`.

Both readers now require the normalized host to look like a DNS name
before an endpoint is derived; anything else fails as an unsupported
host, with no request sent.
2026-09-12 06:14:26 -07:00
iamtoruk
4b9659bd78 fix(app): drop the instant-switch memo when the filter changes outside the app
reportMemoKey is section|period|provider|range|variant|boundary, with no
filter component, so an entry memoised before the filter changed is a valid
key for the other scope. A filter that appeared while the window was away
therefore repainted the unfiltered snapshot until the next fetch landed.

Clear the memo on the change only, where the re-read already compares the
observed flag against the persisted codeburn.projectFiltered: clearing on
every poll would throw the memo away wholesale for nothing.
2026-09-12 06:01:23 -07:00
iamtoruk
a3f2b0b112 feat(app): search and cost order for the Projects pane
The pane rendered one switch per detected project in whatever order the
report returned them: 2,762 rows on this machine, with nothing to type into
and the costliest buried at an arbitrary depth. Sort by lifetime cost
descending and narrow on a case-insensitive substring of the name or path,
with a "12 of 2,762" count beside the box once it narrows.

A substring pass over a few thousand rows is nothing, so no virtualisation.
The switches and the hide-a-pattern field are untouched, and the hidden
count still reads off the whole list, not the visible slice.
2026-09-12 06:01:23 -07:00
ozymandiashh
c872818eed test(quota): resolve the Copilot GHE fixture name with path.basename
The fake credential reader keyed its files by splitting the path on "/",
but the adapter builds the path with path.join, which uses a backslash on
Windows: every lookup missed there, so the credential read as absent and
the six adapter-level cases saw no request and a "disconnected" quota.
path.basename is separator-correct on both platforms. Test-only; the
reader itself is unchanged and the existing Windows path test still
covers the real directories.
2026-09-12 05:56:05 -07:00
ozymandiashh
8b5bd3ed4c fix(menubar): follow the credential's GitHub host for Copilot quota
Both Copilot quota readers hardcoded
https://api.github.com/copilot_internal/user and dropped the host their
credential was read from, so an enterprise on a GitHub Enterprise Cloud
data-residency host (<tenant>.ghe.com) could only ever report
"Temporarily unavailable": its token is not a dotcom token, and dotcom is
not an endpoint it may be sent to.

A discovered credential now carries its host. hosts.json is keyed by
GitHub host and newer apps.json files key by "<host>:<app id>", so the
token and the host always come from the same entry; the rungs that carry
no host of their own (an app-name apps.json key, COPILOT_GITHUB_TOKEN /
GH_TOKEN / GITHUB_TOKEN, gh auth token, a pasted token) mean dotcom. The
endpoint follows the host: api.github.com for github.com, and
api.<tenant>.ghe.com for an Enterprise Cloud host. With several hosts
signed in github.com wins, otherwise the first .ghe.com tenant in sorted
order, which keeps the pick stable across reads; with exactly one, that
host is used.

A host neither rule can address, such as a self-hosted GitHub Enterprise
Server install, fails with a message naming that host instead of falling
back to dotcom, and network and HTTP failures name the host that was
tried. macOS Settings now says which host answered in the Copilot
connection row. Tokens are still never logged and sanitizeForUI is
unchanged.

Closes #1286
2026-09-12 05:56:05 -07:00
iamtoruk
6d45db1e08 fix(app): re-read the project filter when it changes outside the window
The main process re-reads app-filter.json whenever the file changes, which
is what makes a hand edit land. The renderer only re-read it on its own
config mutations, so a filter that appeared any other way left
`projectFiltered` false: Settings kept offering Combined, the hero kept
saying "Combined · …", and buildOverviewArgs had already dropped
`--scope combined` because the filter was non-empty. The reading on screen
was a local, project-filtered total labelled as the combined one.

Re-read on a manual refresh and on every overview poll as well. It costs
one statSync the main process already memoizes by stat stamp.
2026-09-12 05:50:41 -07:00
iamtoruk
caae3df5cf fix(usage-aggregator): slice the 365-day history by the project filter
The headline is sliced to the requested projects (buildDurablePeriod runs
every historical cache day through sliceDayToProject) and today's days come
from the name-filtered parse, but `history.daily` was read straight out of
the day cache. Every surface built on it showed every project: the heatmap,
the streak, "N active days", month-to-date, the projected month, the daily
spend chart, the Spend punchcard and the daily-budget check.

On this machine, `status --format menubar-json --project=<one project>`
returned a $7.43 headline over a $2,993.61 month-to-date, and 137 of the
138 days in history.daily were byte-identical to the unfiltered run.

Same slice the headline already uses, so a cache day with no project split
contributes nothing here rather than everything, exactly as it does there.
2026-09-12 05:50:40 -07:00
Mathieu Stanowski
435a5c8d95 test(app): move the project-match parity test to the CLI suite
The desktop CI job runs `npm ci` inside app/ only, so an app-side test
that imports src/parser.ts cannot resolve the CLI's own dependencies: the
typecheck failed on chalk and strip-ansi before the suite even ran. A
local run hides it, because the repo root's node_modules sits one
directory up and resolves fine from there.

The test needs both halves by definition, so it moves to the suite that
has both, and projectMatch.ts names its new home. Nothing under app/
reaches into src/ any more: `tsc --listFiles` on the desktop project now
resolves no file outside app/.
2026-09-12 05:38:52 -07:00
Mathieu Stanowski
af10747e5d perf(app): serve the JSON report from the resident child
The Projects pane's list is `report --format json`, the heaviest read in
the app, and report was in neither routing table: not in SERVE_ROUTED on
the client, not in SERVE_OPTIONS on the server. Every open of the pane
paid a fresh node boot plus the full session-cache parse the resident
child exists to avoid, at interactive priority, holding one of the two
run slots for its whole duration and stalling the panels polling behind
it.

report is servable in its JSON form only: on every other format it is the
interactive dashboard, which cannot run in a child whose stdout is the
wire. allowed() refuses those and the client falls back to a one-shot
spawn, which is where a dashboard belongs. --refresh only paces that
dashboard, so it stays off the served surface.
2026-09-12 05:38:52 -07:00
Mathieu Stanowski
946fb75696 fix(app): stop reporting an export that wrote nothing as a success
codeburn export prints "No usage data found." and exits 0 when every
period came back empty, writing no file and no folder. That path was
unreachable from the app until the export started carrying the project
filter; an exclude list covering every detected project now empties all
three periods of the export window. runAction read the exit code, so the
Export pane toasted "Exported to <folder>" for a folder the CLI never
created.

Success reads the saved-path line the CLI prints only after a write, and
a run that wrote nothing comes back as a failed action whose message
names both causes. A CLI test pins both halves of that contract, since
the app cannot import from src/.
2026-09-12 05:38:52 -07:00
Mathieu Stanowski
f76ee91526 fix(app): list projects for the whole history, not the visible period
getUnfilteredProjects passed the period on screen, and the CLI builds
that list from the days the period covers. A project filter has no
period: it scopes every screen and every horizon at once. So an exclude
pattern for a project with no activity in the current period rendered as
"matches nothing detected" next to a Remove button, while the footer read
"Nothing is hidden." Clicking Remove there unhid the project on every
screen, from a control that had just called the pattern dead.

The list is lifetime now, and the period argument is gone from the
channel rather than left for a caller to get wrong. `all` is capped at
six months, so lifetime is the only horizon that can answer for the whole
filter.

The pane's memo key goes through reportMemoKey like every other pane, and
the fetch is off the poll interval: it is the heaviest read in the app, a
toggle cannot change an unfiltered list, and the only thing that can is a
project appearing, which the next open picks up.
2026-09-12 05:38:52 -07:00
Mathieu Stanowski
1e34d36144 fix(app): fail closed when the project filter cannot be read
The Projects pane commit claimed that a failed read keeps the last known
filter instead of unhiding. That only held once a filter had already been
read in this process: appFilterCache is module level, so it is null on
the FIRST read of every launch, and both failure paths fell back to the
empty filter there. statSync also rejects EACCES and EIO exactly the way
it rejects ENOENT, so an unreadable file and a missing one produced the
same answer.

A malformed or unreadable app-filter.json therefore made projectArgs()
return [], and every CLI fetch ran unfiltered: the hidden projects
painted, getProjectFilter reported an empty filter so the renderer
cleared its filtered state and re-offered Combined scope, and nothing
surfaced an error.

Only ENOENT means "no filter" now. Every other errno, and a parse failure
with nothing cached, throws. The handlers already wrap argv construction,
so a fetch fails closed into the panel's error state rather than
rendering a wider set of projects than the user asked for.

Writes are staged through a randomized temp file and renamed, the rule
saveConfig already follows in src/config.ts for the same directory: a
writeFileSync straight over the live path can be interrupted, and a
truncated filter is an unreadable filter.
2026-09-12 05:38:52 -07:00
Mathieu Stanowski
1b006ed2f7 fix(app): expand a leading ~ in a project pattern typed into the pane
A pattern typed into the Projects pane never passes through a shell, so
"~/work/app" reached the CLI as a literal tilde and matched nothing. It
is expanded in the main process now, on the way into app-filter.json and
on the way back out: the renderer has no home directory of its own, and a
tilde it cannot resolve would make its switches disagree with the argv
this process writes.

The file can also be hand-edited, so the expansion runs on read as well
as on write. projectMatch.test.ts covers the expanded shapes against the
CLI's matchesProjectPattern, which is what keeps the switch and the argv
on the same answer.
2026-09-12 05:38:52 -07:00
Mathieu Stanowski
6cac9d929c feat(app): add a Projects pane that scopes the desktop app to chosen projects
Screen-sharing or demoing the app exposed every project on the machine,
with no way to narrow it. Settings now has a Projects pane: one switch
per detected project, plus a field for hiding a pattern that matches
nothing detected yet.

The filter lives in ~/.config/codeburn/app-filter.json rather than
renderer storage, because the main process is where the CLI argv is
assembled. No file, or empty lists, means no filter, so the default is
unchanged for everyone who never opens the pane. CODEBURN_APP_FILTER
overrides the path and an empty value disables it, which is what the app
test suite sets so a real filter file cannot reach the assertions.

Details worth knowing:

- The pane's own project list is fetched WITHOUT the filter. Scoping it
  would hide the projects the checklist exists to switch back on.
- Patterns are passed as --project=<value>, never as two argv entries. A
  Claude project directory is encoded as "-Users-me-Web-thing", and a
  leading dash in its own argv slot parses as a flag.
- Combined scope and a project filter cannot both hold. The CLI rejects
  --scope combined next to --project/--exclude because paired devices
  report their usage unfiltered, and dropping the filter instead would
  put the hidden projects back inside the combined total, which is the
  one thing the pane exists to prevent. So the filter wins: Settings
  offers Local only while something is hidden (and says why), the
  renderer derives its effective scope from the filter so even the first
  poll of a filtered session is local, and buildOverviewArgs keeps the
  same rule as a guard for a stale caller.
- A read that fails on an existing file keeps the last known filter
  instead of falling back to the empty one. Unhiding every project on a
  torn write or a typo mid-edit is the one failure mode this pane cannot
  have. Only a missing file means "show everything" again.
- The pane's matcher lives in renderer/lib/projectMatch.ts, and
  projectMatch.test.ts pins it against the CLI's matchesProjectPattern
  over every pattern shape. A switch that disagrees with the argv it
  writes would lie about what is on screen.
- Writes are serialized: every write is computed from the filter on
  screen, so a second click before the first landed would be built from
  the pre-click value and drop it.
- export carries the filter too, since it writes project names into a
  file that gets shared. getPlans stays unfiltered, like combined scope:
  a plan is billed on every project, so scoping it would misreport the
  cycle.
2026-09-12 05:38:52 -07:00
Resham Joshi
cfa0f9fa07
Merge pull request #1304 from getagentseal/fix/daily-cache-underread-reconcile
fix(daily-cache): stop a frozen under-read from outranking the sources on disk
2026-09-12 15:10:06 +03:00
iamtoruk
f284fda1f0 perf(usage-aggregator): only reconcile days a live slice can win
Every historical day was cloned into the merge on every read, whether or
not anything needed healing. Pass only the dates where some provider's
live slice explains more calls than the cached one: on a healthy cache
that is none, and a date the cache already explains is served as it was
written rather than rebuilt from a live day back to the same numbers.
2026-09-12 04:58:13 -07:00
iamtoruk
aa775656f7 fix(daily-cache): keep the reconcile from rewriting a day's carried mark
The merge seeds each result day from `primary`, the live parse, which
carries no provenance. Marking every secondary day carried flagged every
date the cache and the parse agree on as preserved from expired logs;
not marking them at all silently dropped the mark from every date both
sides hold, including days only one of whose providers still has sources.

Re-assert it only where a secondary slice brought calls the primary could
not produce. An equal-call slice claims nothing, so a day the sources
fully explain drops the mark and a day with one expired provider keeps it.
2026-09-12 04:58:13 -07:00
Rick Culpepper (claude)
8b9140aed0 fix(daily-cache): stop a frozen under-read from outranking the sources on disk (#1217)
A day is derived into the durable cache once and then frozen behind the
watermark, while isPartialSurvival lets a fresh derivation SHRINK a day
inside the settle window. One parse that missed sources therefore became
permanent: the Overview headline sat 27% below the Daily Activity rows
printed underneath it, on days whose transcripts were intact the whole
time.

The read path already parses the dates it is reporting on, so let it
reconcile: per (date, provider) keep whichever derivation explains more
calls. A cached day whose transcripts have expired still wins, since
nothing live can outbid it, and an under-read cached row stops hiding
evidence that is sitting on disk. Ties go to the cache, so a re-pricing
still lands through the write path only.

The write path is untouched: what to freeze stays its decision, and a
still-settling day is still defined by its fresh parse.

Fixes #1217
2026-09-12 04:41:23 -07:00
Resham Joshi
5783c6d0af
Merge pull request #1303 from getagentseal/fix/per-provider-cache-completeness
fix(cache): record session-cache completeness per provider
2026-09-12 14:13:00 +03:00
Resham Joshi
c036e4d082
Merge pull request #1300 from getagentseal/fix/dock-quota-refresh-guard
fix(mac): keep dock quota fresh when the payload tick is skipped
2026-09-12 14:02:27 +03:00
Resham Joshi
fe63fd0dfb
Merge pull request #1302 from getagentseal/fix/project-filter-followups
fix(cli): scope compare self-corrections to filtered projects, warn on web
2026-09-12 14:02:24 +03:00
Resham Joshi
5ecc50a5f7
Merge pull request #1301 from getagentseal/fix/dsh-doctor-skips
fix(dsh): count every dropped session toward doctor
2026-09-12 14:02:03 +03:00
iamtoruk
830f3ff6d6 fix(cache): record session-cache completeness per provider
A scan is scoped on two axes, provider and date range, but completeness
was one whole-cache boolean. #1229 stopped a scoped run from stamping it
by adding a second, unfiltered discoverAllSessions to the stamp path,
which left scoped users on a multi-provider machine permanently cold and
paid an extra full discovery on every run.

Completeness now lives on the provider section, with an optional
completeFrom floor for the sources a date range filtered out. The
whole-cache flag keeps its meaning (an unscoped scan finished) and is
what a section with no flag of its own falls back to, so existing caches
read exactly as before and no version bump is needed. Discovery reports
which providers threw, and a provider that reported nothing because it
failed is never marked complete.
2026-09-12 04:00:40 -07:00
Resham Joshi
9fe765e26c
Merge pull request #1299 from getagentseal/ci/node-matrix
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
Tests / test (24) (push) Waiting to run
Tests / test (26) (push) Waiting to run
Tests / test-platforms (macos-latest) (push) Waiting to run
Tests / test-platforms (windows-latest) (push) Waiting to run
Tests / desktop (push) Waiting to run
ci: test on Node 24 and 26 as well as the 22 line
2026-09-12 13:50:34 +03:00
iamtoruk
6ee71e91c6 fix(cli): scope compare self-corrections to filtered projects, warn on web
compare --project filtered the model rows but scanned every session on the
machine for self-corrections. Scope the scan to the filtered projects'
sessions, and call reportUnmatchedProjectPatterns from web.
2026-09-12 03:49:43 -07:00
iamtoruk
556d402d18 fix(dsh): count every dropped session toward doctor
Sessions skipped for an unreadable header, a filename/header generation
mismatch, an ambiguous generation filename, or missing zstd support now
call onSkippedVersion, so doctor reports ERRORS instead of OK while
dropping sessions.

Missing zstd support is explained once from discovery rather than
producing one unreadable-header line per compressed log. Path-naming
notices dedup on the message kind and print at most three example paths,
instead of one unbounded line per file. The filename generation now
matches v(\d+): session.v0 is the unversioned generation, session.v03 is
generation 3, and a duplicate-encoded or non-safe generation is skipped
and counted rather than silently invisible.
2026-09-12 03:48:52 -07:00
iamtoruk
8b3cb68255 fix(mac): keep dock quota fresh when the payload tick is skipped
The background tick skips the whole refresh when local session files are
unchanged, but quota is server-side state, so the dock rings went stale
until the popover was opened. Run the quota half on skipped ticks, still
throttled by the subscription cadence.

Also refresh the dock providers before the Claude/Codex awaits so a slow
provider cannot delay them, anchor lastCodexRefreshAt on attempt like its
siblings, and query display sleep live instead of latching a flag that a
missed wake notification leaves stuck.
2026-09-12 03:47:46 -07:00
iamtoruk
615b6c75a0 ci: test on Node 24 and 26 as well as the 22 line 2026-09-12 03:43:24 -07:00
Resham Joshi
7d0083961d
Merge pull request #1298 from getagentseal/fix/project-filter-test-stderr
test(cli): stop asserting empty stderr in the project-filter command tests
2026-09-12 13:37:45 +03:00
iamtoruk
32c81c6f79 test(cli): stop asserting empty stderr, Node 24+ prints a deprecation warning 2026-09-12 03:30:29 -07:00
iamtoruk
a1805393de chore: require owner review via CODEOWNERS 2026-09-11 21:45:55 -07:00
ozymandiashh
effa656ef2
Merge pull request #1285 from mathieustan/feat/cli-project-filter
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
Tests / test-platforms (macos-latest) (push) Waiting to run
Tests / test-platforms (windows-latest) (push) Waiting to run
Tests / desktop (push) Waiting to run
fix(cli): honor --project/--exclude on every reporting command, and anchor absolute-path patterns
2026-09-11 20:15:20 +03:00
ozymandiashh
fef63c147a
Merge pull request #1284 from xiaozhenliu/fix/dsh-session-formats-1281
Fix DSH v0–v3 session discovery and usage accounting
2026-09-11 19:59:58 +03:00
Mathieu Stanowski
d8dfd72832 fix(cli): judge a pattern against the day cache, and never on screen
Three defects in the unmatched-pattern warning, all reported against a
path that is in fact correct.

`report`, `overview` and `status` judged a pattern against the live parse
plus the day cache, while `sessions`, `models`, `audit`, `compare`,
`optimize`, `yield` and `spend` judged it against the live parse alone.
On a project whose transcripts have expired, `overview --project <path>`
bills it while `sessions --project <path>` called the path wrong. The
check now falls back to the day cache, and only for what the live parse
missed, so the normal path reads no cache at all.

The warning also reached two places that must never see it. An Ink screen
owns the terminal, so it now honours the same `setInteractiveScanUI`
latch the parser checks before printing scan progress: `report --project
/typo` no longer writes over the dashboard. And `serve` routes every
stderr write into the progress-frame emitter, so `runStdioServe` calls
`suppressProjectFilterWarnings()` at startup rather than the module
reading argv, which a leading `--verbose` would have shifted.

SERVE_OPTIONS gains --project/--exclude for the seven commands that just
declared them, as the comment above it requires. Without that a filtered
request falls back to a cold spawn instead of the resident.
2026-09-11 17:29:55 +02:00
Mathieu Stanowski
740ec551e3 fix(cli): expand a leading ~ in a project pattern
A quoted '~/work/app' reaches the CLI unexpanded, and a pattern typed
into a field has no shell behind it at all. It was neither rooted nor a
substring of any stored path, so it selected nothing and said nothing.
The README made it worse by telling people to quote it.

A leading ~ is now expanded against the home directory and anchored like
any absolute path, so the quoted form selects the same project as the one
the shell would have expanded, and a wrong one is reported.

Two more from reading the hot path: the compiled filter only pays for the
project path key when some pattern is rooted and can read it, which the
day cache runs per project, per day, per provider slice; and
unmatchedRootedPatterns now calls matchesProjectPattern instead of
open-coding it.
2026-09-11 17:29:55 +02:00
Mathieu Stanowski
648fa40ebd feat(cli): warn when a rooted --project/--exclude names no project
A rooted pattern selects one project or nothing, so a typo does not
fail: it reports a total over a set nobody asked for, which reads
exactly like a correct answer. The run now says so on stderr, and the
exit status is untouched.

unmatchedRootedPatterns() tries each pattern on its own against the
UNFILTERED project list, which is what keeps it honest. Judged inside
filterProjectsByName instead, an earlier --project would mask a later
one selecting the same project, and an --exclude would be tested against
what --project had already removed. The message is period-scoped, since
a range-scoped parse is what was checked, and the durable path passes
the carried days' project identities alongside the live parse, so a
pattern naming only an expired-source project stays silent.

Nothing is reported under `serve`. That path routes process.stderr.write
into the progress-frame emitter (runCaptured), so a warning would reach
the desktop app as a scan-progress line.

The tests spawn the real CLI over a seeded corpus of two path siblings:
sessions for the commands that filter at the call site, spend and yield
for the two that take the patterns as arguments and filter inside, so
dropping the argument anywhere fails the suite. They also pin the shapes
that must stay silent: a pattern that selects something, a loose word, a
second --project overlapping the first, and an --exclude naming a
project --project had already removed.
2026-09-11 16:12:31 +02:00
Mathieu Stanowski
172b8f4df6 fix(cli): anchor an absolute-path project pattern to a segment boundary
filterProjectsByName matched every pattern as a raw substring, so
--exclude /a/my-company also removed the sibling /a/my-company-kit, and
no pattern the caller could type expressed "this project and not its
neighbours".

A rooted pattern (POSIX, Windows drive, UNC) now keys through
normalizeAbsProjectPathKey, the helper #1271 added for project identity,
and matches the way isProxiedPath matches proxyPaths: equal to the
project path, or a prefix of it on a path-segment boundary. Going
through that helper keeps one identity rule in the parser: identified
Windows paths casefold, POSIX case stays identity, and a Codex-style
stripped absolute path ("root/vault") keys the same as the pattern
"/root/vault" the user types. A pattern that is not rooted stays the
loose substring people type on the command line, so --project
my-company keeps covering my-company-kit and worktrees.

The rule lives in one closure (makeProjectFilter) applied to the live
parse and to the carry-forward day cache alike. The cache path had its
own copy, lowercasing and substring-matching, so a filtered headline
anchored today's live days while matching every cached day loosely: on a
carried day split across /Users/gone/app ($30) and /Users/gone/app-kit
($70), --exclude /Users/gone/app returned 0 instead of 70, and --exclude
/users/gone/app excluded both instead of neither. Both shapes are in
tests/project-filter-durable-totals.test.ts, the suite that exists to
pin that a filter selects the same projects whether it is resolved
against a fresh parse or against the cache.

The README gains the rules that were not written down: an absolute POSIX
path is case-sensitive while a Windows drive or UNC path folds case, and
a leading ~ is the shell's to expand.
2026-09-11 16:12:21 +02:00
xz
cd2e0dd43a Fix interleaved DSH accounting and preserve inclusive output 2026-09-11 21:12:15 +08:00
Mathieu Stanowski
29fcb38976 feat(cli): honor --project/--exclude on the remaining reporting commands
The README says these flags work on every command. They did not: only
report, overview, web, status, today, month and export declared them, so
sessions, models, compare, audit, optimize, yield and spend either
rejected the flag outright or silently reported the whole corpus.

Each command already funnels through parseAllSessions, so the filter is
applied at that single point with the shared filterProjectsByName. yield
and spend parse inside computeYield / computeSpendFlow, which now take
the patterns as optional arguments and default to filtering nothing.

README now states the matching rule instead of claiming "all commands".
2026-09-11 07:32:34 +02:00
xz
a2f1fe2007 Fix DSH v0-v3 session discovery and usage accounting 2026-09-11 12:40:36 +08:00
ozymandiashh
6a0f830b9b
Merge pull request #1229 from earbona23/test/scoped-run-stamps-whole-cache-complete
Some checks failed
CI / semgrep (push) Waiting to run
Tests / test (22) (push) Waiting to run
Tests / test (22.13.0) (push) Waiting to run
Tests / test-platforms (macos-latest) (push) Waiting to run
Tests / test-platforms (windows-latest) (push) Waiting to run
Tests / desktop (push) Waiting to run
macOS Menubar CI / test (push) Has been cancelled
fix(parser): avoid marking partially scanned caches complete (#912)
2026-09-10 23:19:15 +03:00
Resham Joshi
eaed42408c
Merge pull request #1283 from getagentseal/feat/update-notification
feat(mac): notify when an update is available
2026-09-10 23:00:19 +03:00
iamtoruk
5e8236f77f feat(mac): notify when an update is available 2026-09-10 12:39:38 -07:00
Resham Joshi
36dd897913
Merge pull request #1282 from Enclavet/fix/kiro-working-directory
fix(kiro): emit workingDirectory so sync attribution can resolve the repo
2026-09-10 22:20:43 +03:00
iamtoruk
7d6388a0ed fix(kiro): shorten the workingDirectory note 2026-09-10 12:14:14 -07:00
Andrew Lee
7d2722fb70 fix(kiro): emit workingDirectory so sync attribution can resolve the repo
Every kiro session was attribution-blind: `codeburn sync push --attribution`
reported "0 facts total" regardless of window, so no session→commit correlation
ever reached the endpoint.

project-path-v1 set out to fix exactly this and wired the session's directory to
`projectPath`. But sync attribution does not read that field. computeAttributionRecords
calls buildRepoGroups in "trusted-session-cwd" mode:

    const sourcePath = identityMode === 'trusted-session-cwd'
      ? session.workingDirectory
      : project.projectPath

so it resolves the repo from `workingDirectory`, then filters to sessions whose
own directory resolved (`group.ownIdentity`). With that field unset,
`isTrustedAbsoluteWorkingDirectory(undefined)` returns false on its first clause,
every session is dropped, and attributeCommits joins the repo's commits against
an empty session list. The path was being carried the whole time, just on the
field nothing consumed.

All three kiro parsers now emit workingDirectory from the same provider-recorded
value they already use for projectPath:

- CLI (~/.kiro/sessions/cli/<id>.jsonl): companion .json `cwd`
- v2 IDE (~/.kiro/sessions/<hash>/sess_<id>/): session.json `workspacePaths[0]`
- workspace sessions: record `workspaceDirectory`

Nothing downstream needed changing. parser.ts already stamps
`workingDirectoryProvenance: 'provider-field'` on any provider-set value that
passes the trust check, which is what the consumer requires — an unmarked value
is treated as synthesized from projectPath and fails closed.

Bumps PROVIDER_PARSE_VERSIONS.kiro to working-directory-v1. Entries cached under
project-path-v1 hold projectPath but no workingDirectory, so without the bump the
fix would miss every user who already has a warm cache — that is, everyone
upgrading.

Verified against a real corpus (2457 CLI sessions, 8 v2 IDE sessions):

    before:  Attribution: 0 facts total, would push 0 (0 sessions, 0 commits)
    after:   Attribution: 190 facts total, would push 190 (21 sessions, 169 commits)

Tests cover workingDirectory for all three session shapes, the home-root
rejection (observed in 5 of 8 real IDE sessions, whose workspacePaths is the
user's home directory), and re-parse of a project-path-v1 cache.

AI-Origin: human
2026-09-10 17:39:37 +00:00
Resham Joshi
0fea397d14
Merge pull request #1278 from avs-io/codex/copilot-disconnect-1273-20260909
Some checks are pending
CI / semgrep (push) Waiting to run
macOS Menubar CI / test (push) Waiting to run
Tests / test (22) (push) Waiting to run
Tests / test (22.13.0) (push) Waiting to run
Tests / test-platforms (macos-latest) (push) Waiting to run
Tests / test-platforms (windows-latest) (push) Waiting to run
Tests / desktop (push) Waiting to run
fix(mac): preserve explicit Copilot disconnect
2026-09-10 08:52:49 +03:00