Files
amethyst/commons/plans
Claude 5ad3304db3 refactor(commons): move LocalCache and its group out of the Android app
`LocalCache` (4,021 lines) had no Android imports and no app-package types —
only six references to the shell around it. It moves to
`commons/jvmAndroid/…/commons/model/cache/`, with `AntiSpamFilter`,
`CachePruner`, `CacheSearch`, `DvmHeartbeatRegistry` and `OnchainZapResolver`.
This is part A of the sweep plan's Wave 2; `desktopApp` still runs its own
`DesktopLocalCache` fork and is untouched here.

The six references become `LocalCacheHost`, a port collecting what the cache
cannot supply for itself: a scope, `isDebug`, the NIP-95 blob directory, the
relay stats sink, the relay's own pubkey and the main-thread assertion. Every
member defaults to the honest answer for a host that supplies none of them, so
the cache runs shell-less; Android installs `AmethystLocalCacheHost` from
`AppModules` next to `val cache`, before any event is consumed. The whole seam
cut is 101 changed lines. `dateFormatter` repoints to the twin that already
existed in `commons/util`.

`nip95BlobDir` is nullable, so `consume(FileStorageEvent)` grows one branch:
with nowhere to spill the blob, the note keeps the event whole rather than
loading a content-stripped copy whose bytes are on no disk. Android always
supplies the directory, so its behaviour is unchanged.

The plan flagged `CachePruner`/`CacheSearch` taking `Account` as needing a
design decision. `IAccount` needed no new members and Desktop needed no change:
`isHidden`, `hiddenWordsCase` and `followingKeySet()` are already on it, and
`isFollowing(user)` is `user.pubkeyHex in followingKeySet()`. `pruneHiddenEvents`
takes `LiveHiddenUsers` by value instead — `IAccount` exposes hidden users only
as hash codes, which would prune authors the reader never muted.

Also: `ILocalCache` was declared inline in `LocalCache.kt` and used nowhere
else, so it is hoisted to commonMain as the write-side port beside the
read-side `ICacheProvider`; `AntiSpamFilter` swaps `android.util.LruCache` for
`androidx.collection.LruCache`, whose Kotlin-nullable `get` makes the two
duplicate checks read each entry once into a local; and `njumpLink` moves to
`commons/util/ExternalLinks.kt` so the filter can log one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KkULS5SVq4GHDdoCzajKi8
2026-09-19 16:03:20 +00:00
..

commons plans

Audited 2026-06-30 (+ 2026-09-12 split entry). 7 plans: 3 shipped, 2 in-progress, 2 queued, 0 abandoned.

In progress

Plan Summary
2026-05-04-custom-feeds-plan.md Custom feed creation/discovery/management for Desktop; core model + builder + kind 31890 + desktop UI shipped, but relay-filter layer, DVM marketplace, kind 10090 sync, and list resolution still pending.
2026-05-06-nest-subscription-manager-extraction.md Split the per-speaker subscription state machine out of NestViewModel; only the ActiveSubscription stepping-stone is extracted so far.

Queued

Plan Summary
2026-04-21-event-renderer.md Cross-platform UI-agnostic RenderedEvent subsystem shared by Amy, Desktop, and Android; not started.
2026-05-30-amethyst-to-commons-migration.md Roadmap to move shared amethyst Android code into commons; keystone Account/LocalCache extraction not begun.
2026-08-03-poll-results-page.md Extended NIP-88 poll results page (per-option counts + who voted for what) for Android and Desktop; also specifies four tally-correctness fixes and the missing poll-relay subscription. Proposed, not started.

Shipped

Plan Summary
2026-09-12-audit-findings.md Bug/performance audit of commons + commonsUI after the split: 34 verified fixes shipped, 4 deferred with rationale, 6 rejected.
2026-09-12-commons-ui-split.md Split the Compose half of commons into the new :commonsUI module (same packages, api(:commons)), so cli no longer carries Compose/Skiko; records the classification method and follow-ups.

Archived (shipped)

Plan Summary
archive/2026-05-04-custom-feeds-testing-sheet.md Test sheet recording the completed custom-feeds phases (unit + manual coverage).
archive/2026-05-05-feed-builder-enhancements-plan.md Six FeedBuilderDialog enhancements (npub decode, author search, kind filters, edit/delete, save-as-feed, exclude authors) — all landed.