refactor: promote 16 Tier-2 files to commonMain with a concurrency review
...
Instead of blindly porting synchronized blocks, each lock was judged:
Removed (guarded nothing, or a lock-free design exists):
- RelayAuthPromptBus: mutableMap+synchronized -> ConcurrentMap.getOrPut
with identity-check ownership; lock-free, cold path
- NappletLaunchRegistry: its JVM-only access-ordered LinkedHashMap +
@Synchronized trio became androidx.collection.LruCache (internally
synchronized, access-ordered cap - identical touch-on-resolve/evict
semantics); SecureRandom -> quartz RandomInstance
Kept as KmpLock (real multi-field invariants; uncontended lock beats
copy-per-write CAS on GC):
- ChatDeliveryTracker (hot OK path already lock-free via volatile
immutable maps; the lock coordinates three structures + eviction)
- NWCPaymentFilterAssembler (debounce set + job swap atomicity)
- NappletNotificationStore (per-coordinate insertion-ordered buckets)
- DeferredDeleteFileSystem (pending-set membership decides deletion)
Mechanical replacements throughout: java.util.concurrent atomics ->
kotlin.concurrent.atomics; ConcurrentHashMap -> quartz ConcurrentMap
(extended with putIfAbsent/remove(key,value)/clear across expect, JVM,
and native CoW actuals); System.currentTimeMillis -> TimeUtils.nowMillis;
java.io.IOException -> okio; TimeUnit TTL -> plain ms. speedLogger's
kotlin.concurrent.timer became a coroutine tick RelaySpeedLogger cancels
in destroy() - the old daemon timer ran forever.
Also promoted: BlossomAuth (quartz-only imports, unblocks the token
provider). Reclassified to blocked: NappletIdentityWatch (needs
NappletProtocolJson, pinned by java.util.Base64) and NamecoinNameService
(quartz ElectrumXClient is jvmAndroid).
Verified: verifyKmpPurity, JVM, iosArm64 compile + test-compile,
Android, desktop, and the quartz/commons/cli test suites.
Co-Authored-By: Claude <noreply@anthropic.com >
Claude-Session: https://claude.ai/code/session_011S1vbFWVVAMFDT8PTgdibV