Commit graph

1174 commits

Author SHA1 Message Date
iamtoruk
0381fc9e86 feat(core): dual-registry bridge + qwen exemplar migration (phase 8.1) 2026-07-26 14:26:00 -07:00
Resham Joshi
615e7231c2
Merge pull request #826 from getagentseal/phase7/act-apply
test(core+cli): act/apply stays host-derived — advisory findings gated (phase 7)
2026-07-26 14:06:18 -07:00
iamtoruk
dffd49a2c3 test(core+cli): act/apply stays host-derived — advisory findings gated (phase 7) 2026-07-26 14:02:43 -07:00
Resham Joshi
07f9998d72
Merge pull request #825 from getagentseal/phase6/classifier-gate
test(core): architecture gate — classification and free text can never enter core (phase 6)
2026-07-26 13:52:14 -07:00
iamtoruk
310c9860b0 test(core): architecture gate — classification and free text can never enter core (phase 6) 2026-07-26 13:48:02 -07:00
Resham Joshi
ae624c45b2
Merge pull request #824 from getagentseal/phase5/detectors
feat(core): duplicate-reads, junk-reads, context-bloat detectors over fingerprints (phase 5)
2026-07-26 13:36:32 -07:00
iamtoruk
1b17f61f9b feat(core): duplicate-reads, junk-reads, context-bloat detectors over fingerprints (phase 5)
Redesign the three token-waste detectors as pure @codeburn/core detectors that
consume an ObservationEnvelope of fingerprinted resource refs (never raw paths):

- Envelope schema 0.2.0: CallObservation gains optional resourceReads /
  resourceEdits (ResourceRef = {resourceId 16-hex, resourceClass}). claude/codex
  toObservations fingerprint toolSequence file paths into these; raw paths never
  cross the boundary. Keep observation-0.1.0.json frozen; emit 0.2.0.
- Host privacy key (D1): sync keystore under the codeburn config dir, random
  32-byte key generated on first use, stable across runs, never emitted.
- core/detectors: junk-reads, duplicate-reads, context-bloat — pure, zero
  fs/env, each emitting Finding[] with confidence(basis), machine-readable
  evidence, algorithmVersion.
- optimize.ts delegates the three to core, mapping Finding -> WasteFinding;
  display strings, fix payloads and trend stay host-derived.

Numbers parity: all optimize tests pass unchanged; frozen-corpus optimize JSON
(3552 sessions) is byte-identical PRE vs POST.
2026-07-26 13:31:26 -07:00
Resham Joshi
99f7b25766
Merge pull request #823 from getagentseal/phase4/codex-state
refactor(core): codex decoder with explicit serializable state, cost leaves the decoder (phase 4)
2026-07-26 12:53:00 -07:00
iamtoruk
b504838309 refactor(core): codex decoder with explicit serializable state, cost leaves the decoder (phase 4)
Carve the Codex decoder into @codeburn/core/providers/codex as a pure function
over supplied rollout records with EXPLICIT, JSON-serializable state
(CodexDecodeState): the running cumulative token counters, fork-replay cutoff,
mid-turn accumulators, id/turn bookkeeping, and the cross-file dedup memory
(seenKeys). Decoding a corpus in one pass equals decoding it in any number of
passes when the state threads between them (the resume invariant).

Cost leaves the decoder: the rich calls are cost-free and the CLI prices them
through the established estimated-cost seam (costBasis: 'estimated'), retiring
both Phase-0 residual calculateCost sites. The CLI codex provider is now
discovery + file streaming + cache I/O + pricing.

codex-results cache bumped to v8 (one deliberate bump): it persists the decoder
end-state blob + a byte offset + host-priced calls, so a grown rollout resumes
from the stored state and decodes only the appended bytes. Lossless — rollout
files are durable, so the one-time re-derive rebuilds identical data.

Adds a codex path to the content-smuggling guardrail and the import-smoke
subpath set. Byte-parity verified against a frozen 826-file corpus (codex-only
and all-providers, rel_tol 1e-9); perf within ±1.5% cold / ±0.5% warm.
2026-07-26 12:44:10 -07:00
Resham Joshi
698a58cfdc
Merge pull request #822 from getagentseal/phase3/claude-carveout
refactor(core): carve Claude decode into @codeburn/core, CLI parser becomes adapter (phase 3)
2026-07-26 11:49:02 -07:00
iamtoruk
3c19b6fa07 refactor(core): carve Claude decode into @codeburn/core, CLI parser becomes adapter (phase 3)
Move the pure Claude JSONL decode out of packages/cli/src/parser.ts into
packages/core/src/providers/claude/: the large-line buffer scanner, line
parsing, compaction, per-call/turn extraction, rich-capture meta collectors,
turn grouping, and streaming dedup. These are pure over supplied records/lines
(no fs/env/clock/pricing) and carry content in-memory only at this host-facing
layer.

Add the minimizing transform toObservations(richDecode, {privacyKey,...}) that
maps the rich decode into the strict Phase-2 observation envelope: only
fingerprints, enums, numbers, timestamps, dedup keys, and canonical tool names
cross the boundary. Extend the content-smuggling guardrail with a real claude
decode -> toObservations case planting secrets in every captured free-text
field and asserting the serialized envelope surfaces none.

The CLI parser is now the adapter: it keeps all I/O, discovery, incremental
append, cache shapes, classification, and host-side pricing. parseApiCall /
parseAdvisorCalls / groupIntoTurns become thin wrappers that price the cost-free
core decode (calculateCost + local-model savings) and split raw bash commands
(strip-ansi stays out of the zod-only core), then map into ParsedApiCall /
ParsedTurn. Shared record + tool-vocab definitions move to core; the CLI
re-exports them so every existing import path is unchanged.

No parse-version bump; CachedCall/CachedTurn shapes and values byte-identical.
Core runtime deps stay zod-only.
2026-07-26 11:39:01 -07:00
Resham Joshi
68a5f52af3
Merge pull request #821 from getagentseal/phase2/core-foundation
feat(core): observation schema, contracts, fingerprints, guardrail harnesses (phase 2)
2026-07-26 10:47:34 -07:00
iamtoruk
6295fb4627 feat(core): observation schema, contracts, fingerprints, guardrail harnesses (phase 2) 2026-07-26 10:43:21 -07:00
Resham Joshi
c02b193ed2
Merge pull request #820 from getagentseal/phase1/workspaces
chore(workspace): move CLI to packages/cli, add @codeburn/core skeleton (phase 1)
2026-07-26 10:23:16 -07:00
iamtoruk
dc97ab4936 chore(workspace): move CLI to packages/cli, add @codeburn/core skeleton (phase 1) 2026-07-26 10:19:33 -07:00
Resham Joshi
cdd343bd78
Merge pull request #819 from getagentseal/phase0/gap-batch
refactor(pricing): gap batch — cursor, kimicode; codex deferred with evidence
2026-07-26 09:47:45 -07:00
iamtoruk
a30bfed80e refactor(pricing): gap batch — cursor, kimicode; codex per investigation 2026-07-26 09:44:10 -07:00
Resham Joshi
b18506c758
Merge pull request #818 from getagentseal/phase0/shared-modules
refactor(pricing): shared parser modules + codebuff fallback (phase 0 close)
2026-07-26 09:37:45 -07:00
iamtoruk
a9b1f10b45 refactor(pricing): shared parser modules + codebuff fallback (phase 0 close) 2026-07-26 09:33:43 -07:00
Resham Joshi
6552b10bd8
Merge pull request #817 from getagentseal/phase0/kimi-batch3
refactor(pricing): fan-out — openclaw, crush
2026-07-26 09:22:23 -07:00
iamtoruk
71812eb60b refactor(pricing): fan-out — openclaw, crush 2026-07-26 08:37:28 -07:00
Resham Joshi
ed7d1fec29
Merge pull request #816 from getagentseal/phase0/fanout-batch3
refactor(pricing): fan-out batch 3 — hermes, kiro, codewhale
2026-07-26 08:33:57 -07:00
iamtoruk
c56f872cf3 refactor(pricing): fan-out batch 3 — hermes, kiro, codewhale 2026-07-26 08:31:27 -07:00
Resham Joshi
ef68324f76
Merge pull request #815 from getagentseal/phase0/misfits
refactor(pricing): misfit conversions — antigravity, mistral-vibe, copilot
2026-07-26 08:30:57 -07:00
iamtoruk
c617d6e176 refactor(pricing): misfit conversions — antigravity, mistral-vibe, copilot 2026-07-26 08:26:48 -07:00
Resham Joshi
8b0f927cf2
Merge pull request #814 from getagentseal/phase0/fanout-batch2
refactor(pricing): fan-out batch 2 — zed, gemini, kimi, pi/omp
2026-07-26 08:22:07 -07:00
Resham Joshi
10f973f0fb
Merge pull request #813 from getagentseal/phase0/kimi-batch2
refactor(pricing): fan-out — forge, grok, warp
2026-07-26 08:20:02 -07:00
iamtoruk
a3380b2453 refactor(pricing): fan-out batch 2 — zed, gemini, kimi, pi/omp 2026-07-26 08:18:23 -07:00
iamtoruk
e28ff73659 refactor(pricing): fan-out — forge, grok, warp 2026-07-26 08:17:20 -07:00
Resham Joshi
7bc5f3b044
Merge pull request #812 from getagentseal/phase0/kimi-audition
refactor(pricing): fan-out — zcode, cursor-agent
2026-07-26 08:12:05 -07:00
Resham Joshi
174c81c808
Merge pull request #811 from getagentseal/phase0/fanout-batch1
refactor(pricing): fan-out batch 1 — goose, mux, open-design, lingtai-tui, droid
2026-07-26 08:12:00 -07:00
iamtoruk
780c7462b5 refactor(pricing): fan-out — zcode, cursor-agent 2026-07-26 08:07:39 -07:00
iamtoruk
0eb0c6f2da refactor(pricing): fan-out batch 1 — goose, mux, open-design, lingtai-tui, droid 2026-07-26 08:06:53 -07:00
Resham Joshi
34905db773
Merge pull request #810 from getagentseal/phase0/pricing-lift-out
refactor(pricing): host-side pricing pass, decoders emit tokens + basis (phase 0 exemplar)
2026-07-26 07:59:44 -07:00
iamtoruk
6020fc8d8c refactor(pricing): host-side pricing pass, decoders emit tokens + basis (phase 0 exemplar) 2026-07-26 07:53:08 -07:00
Resham Joshi
85781999a5
Merge pull request #807 from ZacharyHu0/fix/update-failure-feedback
Some checks failed
CI / semgrep (push) Has been cancelled
fix(menubar): clarify update failure status
2026-07-26 07:12:57 -07:00
Resham Joshi
8b2c88e3cd
Merge pull request #808 from getagentseal/chore/escape-callback-page
chore(sync): HTML-escape callback page inputs
2026-07-26 07:08:43 -07:00
iamtoruk
d4f85ced71 chore(sync): HTML-escape callback page inputs 2026-07-26 07:05:44 -07:00
Resham Joshi
2c29352d80
Merge pull request #804 from Enclavet/fix-sync-setup-ux
fix(sync): setup error handling, Windows browser open, themed callback pages
2026-07-26 07:03:54 -07:00
Resham Joshi
2e2082061e
Merge pull request #803 from hyknerf/fix/802-menubar-right-click-menu
fix(mac): keep right-click status-item menu open and stable
2026-07-26 06:58:51 -07:00
Resham Joshi
264e8e1b50
Merge pull request #800 from getagentseal/fix/611-desktop-msix-sessions
fix(claude): discover Claude Desktop/Cowork sessions in Windows MSIX installs
2026-07-26 06:47:18 -07:00
Resham Joshi
32f34613ab
Merge pull request #794 from getagentseal/codex/microsoft-store-package
Desktop: add Microsoft Store package workflow
2026-07-26 06:40:54 -07:00
Resham Joshi
d2aa1e8984
Merge pull request #799 from getagentseal/fix/kimicode-visibility
kimicode: session discovery fixes + subscription quota in menubar
2026-07-26 06:37:20 -07:00
iamtoruk
494136a3e8 fix(menubar): keep showing Kimi quota when the login is idle, stamp stale data
Kimi Code tokens live ~15 min and only the CLI renews them, so the load
state sits in .terminalFailure as its dominant steady state between CLI
uses. The Plan tab and tab-strip chip flapped to a reconnect screen every
cycle even with a good last snapshot on hand.

Extract the display decision into a pure KimiQuotaPresentation helper:
terminal-with-data shows the usage bars (flagged idle) and only the
no-data case falls through to reconnect. loadedBody stamps an 'as of
<time>' caption once a snapshot is older than 10 min, in every state that
renders it. The chip's kimiQuotaSummary downgrades terminal-with-data to
.stale so the bar and popover keep the last-known rows instead of the
reconnect card. Settings' connect/disconnect pane still explains the
terminal reason.

Adds KimiQuotaPresentationTests.
2026-07-26 06:35:13 -07:00
hao
4e9c3a1dfe fix(menubar): clarify update failure status 2026-07-26 15:20:13 +08:00
Andrew Lee
f54c48f350 fix(sync): setup error handling, Windows browser open, themed callback pages
- Catch errors in 'sync setup' action: AuthError/DiscoveryError (login
  timeout, port exhaustion, discovery failures) now print a clean one-line
  message and exit 1 instead of crashing Node with an unhandled rejection
  stack trace. Also guard the double rejection when all callback ports are
  in use (both 'ready' and the callback promise reject).
- Windows: open the auth URL via 'rundll32 url.dll,FileProtocolHandler'
  instead of 'cmd /c start'. cmd.exe splits its command line on '&', which
  truncated the OAuth query string at the first parameter, so the IdP
  received a bare /authorize request ('no parameters'). rundll32 receives
  the URL as a plain process argument with no shell parsing.
- Theme the OAuth callback landing pages to match the dashboard (warm
  paper background, ink text, forest-green success / terracotta failure),
  fully inline with no network or asset dependencies.

AI-Origin: human
2026-07-24 17:56:50 +00:00
Frenky Harry S. Sinaga
8e8b58626a
test(mac): lock status-item context menu policy (#802)
Extract StatusItemContextMenuPolicy (event mask, debounce, presentation
mode) and unit-test it so rightMouseUp + statusItemMenu cannot regress
to the flash/scroll-jump paths without a failing test.
2026-07-24 19:27:25 +07:00
Frenky Harry S. Sinaga
f7eafecb7f
fix(mac): keep right-click status-item menu open and stable
Present the context menu on rightMouseUp (not down) so the matching
mouse-up no longer dismisses it, and open via statusItem.menu +
performClick so AppKit tracks the menu under the status item instead of
manual popUp (which scrolled the Today row away on mouse move).

Clears statusItem.menu in menuDidClose so left-click still opens the
popover. Debounce + legacy rightMouseUp path retained for macOS <= 26.

Closes #802
2026-07-24 19:22:24 +07:00
ozymandiashh
d92b9fea43 fix(claude): discover Claude Desktop/Cowork sessions in Windows MSIX installs
The desktop sessions resolver returned a single per-platform path, so
Microsoft Store (MSIX) installs of Claude Desktop were invisible: their
data lives under %LOCALAPPDATA%\Packages\<Claude package>\LocalCache\Roaming\Claude\local-agent-mode-sessions
and a filesystem junction workaround breaks Cowork's own file access
(reported and verified in #611).

getDesktopSessionsDir() becomes getDesktopSessionsDirs(): an ordered,
deduped candidate list (override, then classic APPDATA, then MSIX packages
matching Claude_* or *.Claude_*, existence-checked, lexicographically
sorted; .config on Linux). Results are memoized per env-input tuple so the
parser's per-file classification never rescans Packages. All call sites
scan every candidate; macOS, Linux and classic Windows behavior unchanged.

Fixes #611
2026-07-24 00:30:30 +03:00
reviewer
576f47d854 menubar: add Kimi Code subscription quota tracking
Read ~/.kimi-code credentials directly and poll api.kimi.com
/coding/v1/usages for the weekly quota and rate-limit windows,
mirroring the existing Codex/Claude quota services.

- New KimiSubscriptionService with lenient decoding (string/number
  values, enum-style time units, derived used from remaining) and
  429 backoff
- Quota chip on the Kimi Code tab, Plan insight, and a Kimi tab in
  Settings with connect/disconnect
- Independent refresh cadence anchor so Kimi-only setups don't poll
  on every payload tick
- Expired tokens surface as terminal with automatic recovery once
  the CLI refreshes the credential file
- Keep insights visible for quota-capable providers on empty days
- Widen Settings so six tabs don't collapse into the overflow menu
2026-07-23 21:31:55 +02:00