mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-10-05 11:18:24 +00:00
test: point the search-parity oracle at wss://search.brainstorm.world
Switch fetch_fixtures.py's default relay and the parity tests' docs from search-staging to the production search relay, and re-record tools/search-parity/fixture.json from it. The new corpus keeps the same shape: 8 cases x 8 events, every event satisfies its NIP-01 filter, and 8 of 64 carry no literal occurrence of their search term, so the KDoc's numbers still hold; its quoted examples are swapped for ones in the new recording. Also fixes the script's usage line, which pointed at a stale output path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BvR9ox7m91GLFUARuqj8o5
This commit is contained in:
+1
-1
@@ -30,7 +30,7 @@ import kotlinx.serialization.json.jsonPrimitive
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
* Real answers from a live vespa-relay (`search-staging.brainstorm.world`), recorded once by
|
||||
* Real answers from a live vespa-relay (`search.brainstorm.world`), recorded once by
|
||||
* `tools/search-parity/fetch_fixtures.py` and read from disk here.
|
||||
*
|
||||
* Recorded rather than fetched so `./gradlew test` stays offline and deterministic — a suite that
|
||||
|
||||
+3
-3
@@ -31,7 +31,7 @@ import kotlin.test.assertTrue
|
||||
*
|
||||
* ## What this can and cannot prove
|
||||
*
|
||||
* The oracle is `search-staging.brainstorm.world`, a vespa-relay — the same software Amethyst's
|
||||
* The oracle is `search.brainstorm.world`, a vespa-relay — the same software Amethyst's
|
||||
* token language was ported from. It is a **valid oracle for NIP-01 filtering** and **not one for
|
||||
* NIP-50 text matching**, and the difference is the whole design of this file.
|
||||
*
|
||||
@@ -42,8 +42,8 @@ import kotlin.test.assertTrue
|
||||
* pins it.
|
||||
*
|
||||
* NIP-50 is not closed. This relay retrieves topically, not lexically: asked for `bitcoin` it
|
||||
* returns a block-height summary that never says "bitcoin", and asked for `nostr` it returns "made
|
||||
* my display name refer to my npub's last characters". Eight of the 64 recorded events — 12% —
|
||||
* returns a liquidation-levels heatmap that only ever says "BTC", and asked for `"open source"` it
|
||||
* returns "FOSS you say will save you". Eight of the 64 recorded events — 12% —
|
||||
* contain no literal occurrence of the term that fetched them.
|
||||
*
|
||||
* The fixture is recorded with the `include:spam` lens, which waives the web-of-trust gate. That
|
||||
|
||||
@@ -6,7 +6,7 @@ Run by hand when the fixture needs refreshing; the test that consumes its output
|
||||
touches the network, so `./gradlew test` stays hermetic and offline.
|
||||
|
||||
./gradlew :cli:installDist
|
||||
tools/search-parity/fetch_fixtures.py > commons/src/jvmTest/resources/search-parity-fixture.json
|
||||
tools/search-parity/fetch_fixtures.py > tools/search-parity/fixture.json
|
||||
|
||||
Each case pins the filter FIELDS (kinds/tags/window) as flags rather than folding them into
|
||||
the search string, so the test can rebuild the identical NIP-01 Filter and assert our matcher
|
||||
@@ -18,7 +18,7 @@ import shlex
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
RELAY = os.environ.get("RELAY", "wss://search-staging.brainstorm.world")
|
||||
RELAY = os.environ.get("RELAY", "wss://search.brainstorm.world")
|
||||
AMY = os.environ.get("AMY", os.path.join(os.getcwd(), "cli/build/install/amy/bin/amy"))
|
||||
# The relay gates and ranks results through the searcher's web of trust, and answers an
|
||||
# anonymous query with nothing at all. `include:spam` waives that gate, which is what makes
|
||||
@@ -26,9 +26,9 @@ AMY = os.environ.get("AMY", os.path.join(os.getcwd(), "cli/build/install/amy/bin
|
||||
# to one account's trust graph and re-records differently as that graph moves.
|
||||
#
|
||||
# It does NOT make the relay lexical. Measured on this corpus, results still include events
|
||||
# carrying no literal occurrence of the term — asked for `nostr` it returns "made my display
|
||||
# name refer to my npub's last characters". Retrieval is semantic; see the parity test for why
|
||||
# that means text results are not compared.
|
||||
# carrying no literal occurrence of the term — asked for `"open source"` it returns "FOSS you say
|
||||
# will save you". Retrieval is semantic; see the parity test for why that means text results are
|
||||
# not compared.
|
||||
LENS = os.environ.get("LENS", "include:spam")
|
||||
LIMIT = os.environ.get("LIMIT", "8")
|
||||
TIMEOUT = os.environ.get("TIMEOUT", "30")
|
||||
|
||||
+881
-799
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user