You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(storage): remove the unused legacy Usage session scanner #4059
Desktop Usage now reads canonical data through the selected Runtime Host. The legacy Storage path remains in SettingsStore, but repository-wide production-call-site inspection finds no consumer outside its own definition and dedicated tests.
Scope
Remove SettingsStore.usageStats and its readUsageStats import.
Remove packages/storage/src/usage-stats-store.ts.
Remove dedicated legacy-reader tests and stale public-entrypoint expectations.
The only importer of usage-stats-store.js is settings-store.ts:32.
Desktop's settings:usageStats IPC handler resolves through loadUsageStats(deps.client, ...) in runtime-host-usage-ipc-main.ts — the Runtime Host client, not SettingsStore. The single .usageStats( call site in the repository is window.maka.settings.usageStats(range, host) at settings-surface.tsx:636, which goes through that same Host path.
@maka/core/usage-stats/* is a separate module and stays untouched.
usage-stats-store is not in packages/storage's exports map, so removing it is not a public-API change.
One thing worth flagging up front, since it is the "stale public-entrypoint expectations" part of the scope: usage-stats-store.ts imports createSqliteSessionMetadataStore, and that import is the only reason ./settings-store reaches node:sqlite. With the scanner gone, public-entrypoints.test.ts fails on only the declared entrypoints load node:sqlite until './settings-store' is dropped from SQLITE_BACKED_ENTRYPOINTS. So this change also takes @maka/storage/settings-store off the package's SQLite boundary — the direction #1257 argued for. I'll update that list in the same change and say why, as its comment asks.
Local result so far: -696/+0 across four files. @maka/core and @maka/storage typecheck and build clean, and the Storage suite is 969 pass / 3 fail — unmodified main in the same container gives the same 3 failures (read-only and permission assertions that don't hold when the test process runs as root).
I can't build Desktop in my environment (Electron postinstall and one registry dependency are blocked), so the Desktop side is verified by reference inspection only. I'll state that explicitly in the PR rather than imply I ran it.
Hey, thx for your interest! Someone had already asked to work on this earlier, so I’ve reassigned it to them to avoid duplicate work. Thx for understanding!
Noting for triage: the code for this issue already landed in #4060 (refactor(storage): remove the unused legacy Usage session scanner, merged 2026-08-29) with Refs #4059 rather than Fixes #4059, so the issue stayed open. Current main no longer contains usage-stats-store / SettingsStore.usageStats / readUsageStats.
This issue can be closed as completed by #4060 unless maintainers want a separate checklist item kept open.
The code for this landed in #4060 (8237a9a0d, merged 2026-08-29), which used Refs rather than Fixes, so the issue stayed open. Current main no longer contains packages/storage/src/usage-stats-store.ts, SettingsStore.usageStats, or readUsageStats, and Desktop Usage reads through the selected Runtime Host. Closing as completed by #4060.
Activity
heeoneie commentedon Aug 28, 2026
I'd like to take this one.
I verified the premise before starting:
usage-stats-store.jsissettings-store.ts:32.settings:usageStatsIPC handler resolves throughloadUsageStats(deps.client, ...)inruntime-host-usage-ipc-main.ts— the Runtime Host client, notSettingsStore. The single.usageStats(call site in the repository iswindow.maka.settings.usageStats(range, host)atsettings-surface.tsx:636, which goes through that same Host path.@maka/core/usage-stats/*is a separate module and stays untouched.usage-stats-storeis not inpackages/storage'sexportsmap, so removing it is not a public-API change.One thing worth flagging up front, since it is the "stale public-entrypoint expectations" part of the scope:
usage-stats-store.tsimportscreateSqliteSessionMetadataStore, and that import is the only reason./settings-storereachesnode:sqlite. With the scanner gone,public-entrypoints.test.tsfails ononly the declared entrypoints load node:sqliteuntil'./settings-store'is dropped fromSQLITE_BACKED_ENTRYPOINTS. So this change also takes@maka/storage/settings-storeoff the package's SQLite boundary — the direction #1257 argued for. I'll update that list in the same change and say why, as its comment asks.Local result so far: -696/+0 across four files.
@maka/coreand@maka/storagetypecheck and build clean, and the Storage suite is 969 pass / 3 fail — unmodifiedmainin the same container gives the same 3 failures (read-only and permission assertions that don't hold when the test process runs as root).I can't build Desktop in my environment (Electron postinstall and one registry dependency are blocked), so the Desktop side is verified by reference inspection only. I'll state that explicitly in the PR rather than imply I ran it.
refactor(storage): delete the legacy Usage session scanner
test(storage): delete the legacy Usage reader tests
test(storage): drop ./settings-store from the SQLite entrypoint boundary
style(storage): collapse the settings type import biome now fits on o…
refactor(storage): remove the unused legacy Usage session scanner
refactor(storage): delete the legacy Usage session scanner
test(storage): delete the legacy Usage reader tests
test(storage): drop ./settings-store from the SQLite entrypoint boundary
style(storage): collapse the settings type import biome now fits on o…
refactor(storage): remove the unused legacy Usage session scanner
refactor(storage): delete the legacy Usage session scanner
test(storage): delete the legacy Usage reader tests
test(storage): drop ./settings-store from the SQLite entrypoint boundary
style(storage): collapse the settings type import biome now fits on o…
refactor(storage): remove the unused legacy Usage session scanner (#4060
Phoenix500526 commentedon Aug 29, 2026
take
me2seeks commentedon Aug 29, 2026
Hey, thx for your interest! Someone had already asked to work on this earlier, so I’ve reassigned it to them to avoid duplicate work. Thx for understanding!
Lxr-max commentedon Sep 15, 2026
take
github-actions commentedon Sep 15, 2026
Issue #4059 is already assigned to heeoneie, so it was not reassigned.
Lxr-max commentedon Sep 15, 2026
Noting for triage: the code for this issue already landed in #4060 (
refactor(storage): remove the unused legacy Usage session scanner, merged 2026-08-29) withRefs #4059rather thanFixes #4059, so the issue stayed open. Currentmainno longer containsusage-stats-store/SettingsStore.usageStats/readUsageStats.This issue can be closed as completed by #4060 unless maintainers want a separate checklist item kept open.
Lxr-max commentedon Sep 15, 2026
untake
Astro-Han commentedon Sep 17, 2026
The code for this landed in #4060 (
8237a9a0d, merged 2026-08-29), which usedRefsrather thanFixes, so the issue stayed open. Currentmainno longer containspackages/storage/src/usage-stats-store.ts,SettingsStore.usageStats, orreadUsageStats, and Desktop Usage reads through the selected Runtime Host. Closing as completed by #4060.