refactor(negentropy): audit fixes for interop tests

- Delete `strfryDrivesGeodeAsServer` — boots strfry but uses
  kmp-negentropy ↔ Geode, no actual strfry-vs-geode interop.
  Duplicates `Nip77NegentropyTest.negentropyComputesSymmetricDifference`.
- Strip speculative `negentropy { enabled = ... }` and `nofiles`
  blocks from the strfry config; defaults are what we want to test.
- `InteropSyncDriver.reconcile` → `negotiate`. The function
  computes the symmetric difference; it doesn't move events.
  Convert to `suspend fun` to drop a nested `runBlocking` that
  could deadlock under dispatcher pressure.
- Inline `pullSync` helper in GeodeVsGeodeNegentropySyncTest —
  it was a one-line wrapper with a misleading name.
- Batch `relayB.preload(needFromA)` instead of looping.
- Tighten `idsOnRelay(NormalizedRelayUrl)` signature (was
  re-parsing the string on every call).
- Drop redundant `assertTrue(size > cap)` after `assertEquals(11)`.
This commit is contained in:
Claude
2026-05-07 23:21:17 +00:00
parent 809955c360
commit 7c4f2b720a
4 changed files with 105 additions and 227 deletions
@@ -25,7 +25,6 @@ import com.vitorpamplona.quartz.nip01Core.signers.NostrSignerSync
import com.vitorpamplona.quartz.nip10Notes.TextNoteEvent
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertTrue
/**
* Verifies the NIP-77 negentropy id-and-time projection against the
@@ -92,9 +91,11 @@ class SnapshotIdsForNegentropyTest : BaseDBTest() {
// cap = 10; we have 30 rows, so the result must be 11
// (cap + 1 sentinel) — matches strfry's `maxSyncEvents`
// overflow-detection idiom.
// cap=10 with 30 rows → result must be the +1 sentinel
// (11 rows). Caller compares `size > cap` to detect
// overflow — matches strfry's `maxSyncEvents` idiom.
val capped = db.snapshotIdsForNegentropy(listOf(filter), maxEntries = 10)
assertEquals(11, capped.size)
assertTrue(capped.size > 10, "caller relies on size > cap as overflow signal")
// cap >= total: returns the whole set unchanged.
val whole = db.snapshotIdsForNegentropy(listOf(filter), maxEntries = 100)