Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/renderer/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,7 @@ describe('usage_snapshot telemetry props', () => {
// A path-like project name that MUST NEVER reach telemetry: the snapshot never
// reads topProjects, and this guards against a future field accidentally doing so.
p.current.topProjects = [{
name: '/Users/torukmakto/secret-client/private-repo',
name: '/Users/x/secret-client/private-repo',
cost: 42, savingsUSD: 0, sessions: 1, avgCostPerSession: 42, sessionDetails: [],
}]
return p
Expand Down
4 changes: 2 additions & 2 deletions app/renderer/sections/Sessions.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function session(overrides: Partial<SessionRow> & Pick<SessionRow, 'sessionId' |
const rows: SessionRow[] = [
session({
sessionId: 'claude-session-123456789',
project: '-Users-torukmakto-Projects-codeburn',
project: '-Users-devuser-Projects-codeburn',
provider: 'claude',
models: ['Opus 4.8'],
cost: 8.41,
Expand Down Expand Up @@ -136,7 +136,7 @@ describe('Sessions', () => {
expect(screen.getByText('Codex').closest('.provider-h')).toHaveTextContent('Codex3 sessions$11.92')
expect(container.querySelectorAll('.session-row')).toHaveLength(6)
expect(screen.getByText('projects/codeburn')).toBeInTheDocument()
expect(screen.queryByText('-Users-torukmakto-Projects-codeburn')).not.toBeInTheDocument()
expect(screen.queryByText('-Users-devuser-Projects-codeburn')).not.toBeInTheDocument()
})

it('filters by project and offers to clear a search with no matches', async () => {
Expand Down
28 changes: 14 additions & 14 deletions app/renderer/sections/Settings.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ vi.mock('../lib/ipc', async orig => {
return { ...actual, codeburn: mocks }
})

const identity: Identity = { name: 'Toruk MacBook Pro', fingerprint: 'AA:11:22:33:44:55:66:77' }
const identity: Identity = { name: 'Studio MacBook Pro', fingerprint: 'AA:11:22:33:44:55:66:77' }
const actionOk: ActionResult = { ok: true, stdout: 'updated', stderr: '', code: 0 }
const devices: CombinedUsage = {
perDevice: [
{ id: 'local', name: 'Toruk MacBook Pro', local: true, cost: 120.1, calls: 100, sessions: 10, inputTokens: 1, outputTokens: 2, cacheCreateTokens: 3, cacheReadTokens: 4, totalTokens: 10 },
{ id: 'mini', name: 'toruk-mini', local: false, cost: 41.2, calls: 680, sessions: 34, inputTokens: 11, outputTokens: 12, cacheCreateTokens: 13, cacheReadTokens: 14, totalTokens: 50 },
{ id: 'local', name: 'Studio MacBook Pro', local: true, cost: 120.1, calls: 100, sessions: 10, inputTokens: 1, outputTokens: 2, cacheCreateTokens: 3, cacheReadTokens: 4, totalTokens: 10 },
{ id: 'mini', name: 'studio-mini', local: false, cost: 41.2, calls: 680, sessions: 34, inputTokens: 11, outputTokens: 12, cacheCreateTokens: 13, cacheReadTokens: 14, totalTokens: 50 },
],
combined: { cost: 161.3, calls: 780, sessions: 44, inputTokens: 12, outputTokens: 14, cacheCreateTokens: 16, cacheReadTokens: 18, totalTokens: 60, deviceCount: 2, reachableCount: 2 },
}
Expand Down Expand Up @@ -80,7 +80,7 @@ describe('Settings', () => {
mocks.getIdentity.mockResolvedValue(identity)
mocks.getDevices.mockResolvedValue(devices)
mocks.getDevicesScan.mockResolvedValue(scan)
mocks.getShareStatus.mockResolvedValue({ sharing: true, name: 'Toruk MacBook Pro', port: 9732, always: false, peers: 1, pending: [] })
mocks.getShareStatus.mockResolvedValue({ sharing: true, name: 'Studio MacBook Pro', port: 9732, always: false, peers: 1, pending: [] })
mocks.getQuota.mockResolvedValue(quotaProviders)
mocks.getPlans.mockResolvedValue({ currency: 'EUR', today: { cost: 0, savings: 0, calls: 0 }, month: { cost: 0, savings: 0, calls: 0 }, plans: { claude: { id: 'claude-max', provider: 'claude', budget: 200, spent: 48, percentUsed: 24, status: 'under', projectedMonthEnd: 120, daysUntilReset: 19, periodStart: '2026-07-01', periodEnd: '2026-08-01' } } })
mocks.getOverview.mockResolvedValue(overview)
Expand All @@ -95,7 +95,7 @@ describe('Settings', () => {
mocks.removeDevice.mockResolvedValue(actionOk)
mocks.setPlan.mockResolvedValue(actionOk)
mocks.resetPlan.mockResolvedValue(actionOk)
mocks.chooseDirectory.mockResolvedValue('/Users/toruk/Exports')
mocks.chooseDirectory.mockResolvedValue('/Users/x/Exports')
mocks.exportData.mockResolvedValue(actionOk)
mocks.telemetryTrack.mockResolvedValue(true)
mocks.telemetryStatus.mockResolvedValue(telemetryOff)
Expand Down Expand Up @@ -147,14 +147,14 @@ describe('Settings', () => {

await user.click(screen.getAllByRole('button', { name: 'Export' }).at(-1)!)
await user.click(screen.getByRole('button', { name: 'Choose folder…' }))
await screen.findByText('/Users/toruk/Exports')
await screen.findByText('/Users/x/Exports')
await user.click(screen.getByRole('button', { name: 'JSON' }))
await user.click(screen.getAllByRole('button', { name: 'Export' }).at(-1)!)
expect(mocks.telemetryTrack).toHaveBeenCalledWith('export', { format: 'json', provider: 'all' })

// The chosen folder is a real path on this machine and never travels.
const sent = JSON.stringify(mocks.telemetryTrack.mock.calls)
expect(sent).not.toContain('/Users/toruk')
expect(sent).not.toContain('/Users/x')
})

// The main process drops any event raised while telemetry is off, so an opt-in tracked
Expand Down Expand Up @@ -407,32 +407,32 @@ describe('Settings', () => {
await user.click(screen.getAllByRole('button', { name: 'Export' }).at(-1)!)
await user.click(screen.getByRole('button', { name: 'Choose folder…' }))
expect(mocks.chooseDirectory).toHaveBeenCalledOnce()
expect(await screen.findByText('/Users/toruk/Exports')).toBeInTheDocument()
expect(await screen.findByText('/Users/x/Exports')).toBeInTheDocument()
await user.click(screen.getByRole('button', { name: 'JSON' }))
await user.click(screen.getByLabelText('Provider'))
await user.click(screen.getByRole('option', { name: 'Claude' }))
await user.click(screen.getAllByRole('button', { name: 'Export' }).at(-1)!)
expect(mocks.exportData).toHaveBeenCalledWith('json', 'claude', '/Users/toruk/Exports')
expect(await screen.findByText('Exported to /Users/toruk/Exports')).toBeInTheDocument()
expect(mocks.exportData).toHaveBeenCalledWith('json', 'claude', '/Users/x/Exports')
expect(await screen.findByText('Exported to /Users/x/Exports')).toBeInTheDocument()
})

it('renders real device status and removes paired devices without fake pairing controls', async () => {
const user = userEvent.setup()
render(<Settings period="month" />)
await user.click(screen.getByRole('button', { name: 'Devices' }))
expect(await screen.findByText('Toruk MacBook Pro')).toBeInTheDocument()
expect(screen.getByText('Local device name: Toruk MacBook Pro')).toBeInTheDocument()
expect(await screen.findByText('Studio MacBook Pro')).toBeInTheDocument()
expect(screen.getByText('Local device name: Studio MacBook Pro')).toBeInTheDocument()
expect(await screen.findByText('Mac Studio')).toBeInTheDocument()
expect(screen.getByText('fingerprint 7F:2A:…:C4')).toBeInTheDocument()
expect(await screen.findByText('toruk-mini')).toBeInTheDocument()
expect(await screen.findByText('studio-mini')).toBeInTheDocument()
expect(screen.getByText('34 sessions · $41.20 this month')).toBeInTheDocument()
expect(screen.getByText('Visible')).toBeInTheDocument()
expect(screen.getByText(/Pairing is interactive/)).toBeInTheDocument()
expect(screen.queryByText('Approve')).not.toBeInTheDocument()
expect(screen.queryByText('Pull now')).not.toBeInTheDocument()
await user.click(screen.getByRole('button', { name: 'Remove' }))
await user.click(screen.getByRole('button', { name: 'Confirm' }))
expect(mocks.removeDevice).toHaveBeenCalledWith('toruk-mini')
expect(mocks.removeDevice).toHaveBeenCalledWith('studio-mini')
expect(screen.getByText('Combined view active · 2 devices')).toBeInTheDocument()
})

Expand Down
4 changes: 2 additions & 2 deletions perf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ It extends the [release-acceptance ledger](../docs/release-acceptance/README.md)
| Metric | Command | What the number is | What it is not |
|---|---|---|---|
| Cold start (wait-path) | `run-metric.mjs --metric cold-start-cli` | One-shot `status --format menubar-json` argv Desktop/Menu Bar already spawn | Installed window show / flame in the menu bar |
| Session parse | `--metric session-parse` | Cold parse of the synthetic fixture; MB/s and ms | Founder corpus (35 GB) |
| Session parse | `--metric session-parse` | Cold parse of the synthetic fixture; MB/s and ms | A large real corpus |
| Incremental re-parse | `--metric incremental-reparse` | Append two JSONL lines on the same inode, then re-run | Rewrite / inode change |
| Period switch | `--metric period-switch` | Warm `serve --stdio` 7D/30D p50/p95 | Installed Desktop 250 ms p95 on the live corpus |
| Dock/TUI interactions | `--metric dock-tui-proxy` | Overview-refresh and view-switch wait path | Capacity Dock hover (native, never spawns this argv) or TTY TUI keys |
| Memory | `--metric memory` | RSS after cold load; optional `--idle-ms 3600000` | Packaged app RSS |

Historical receipt, not this fixture: installed Desktop 0.9.21, live corpus, 2026-08-27, 7D useful summary **18286.98 ms** after 30 s idle. Spec target: **250 ms p95** ready summary, zero raw reads on unchanged generation. Evidence: `/Users/a/Documents/Codeburn-audits/snappy-performance-20260827T095615Z/baselines/installed-0.9.21/ui-period-baseline.json`.
Historical receipt, not this fixture: installed Desktop 0.9.21, live corpus, 2026-08-27, 7D useful summary **18286.98 ms** after 30 s idle. Spec target: **250 ms p95** ready summary, zero raw reads on unchanged generation. That receipt came from an installed-app audit run that is not published, so treat the number as historical context rather than something you can re-derive from this repo.

## One-command reproduction

Expand Down
2 changes: 1 addition & 1 deletion tests/live-sessions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ describe('scanTranscript', () => {

it('flags a sidechain and degrades with no usage at all', async () => {
const scan = await scanTranscript(await transcript([
{ type: 'user', sessionId: 'parent-1', isSidechain: true, cwd: '/Users/x/eywa' },
{ type: 'user', sessionId: 'parent-1', isSidechain: true, cwd: '/Users/x/atlas' },
]))
expect(scan.isSidechain).toBe(true)
expect(scan.sessionId).toBe('parent-1')
Expand Down
8 changes: 4 additions & 4 deletions tests/sessions-report.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,21 +107,21 @@ describe('sessions JSON emitter', () => {
it('hides home-directory slugs and renders compact agent/worktree names', () => {
const rows = aggregateSessions([makeProject()])
rows[0]!.sessionId = 'agent-a72cc958e305e4957'
rows[0]!.project = '-Users-torukmakto-Projects-eywa-eywa--claude-worktrees-issue-131'
rows[0]!.project = '-Users-devuser-Projects-eywa-eywa--claude-worktrees-issue-131'
const output = renderTable(rows, { terminalWidth: 160 })

expect(output).toContain('Agent a72cc958')
expect(output).toContain('eywa · issue-131')
expect(output).not.toContain('Users-torukmakto')
expect(output).not.toContain('Users-devuser')
})

it('normalizes Claude dot-worktree slugs without exposing the home directory', () => {
const rows = aggregateSessions([makeProject()])
rows[0]!.project = 'Users-torukmakto-codeburn-.claude-worktrees-agent-a213f7c77871f483f'
rows[0]!.project = 'Users-devuser-codeburn-.claude-worktrees-agent-a213f7c77871f483f'
const output = renderTable(rows, { terminalWidth: 120 })

expect(output).toContain('codeburn · agent a213f7c7')
expect(output).not.toContain('Users-torukmakto')
expect(output).not.toContain('Users-devuser')
expect(output).not.toContain('.claude-worktrees')
})

Expand Down
Loading