aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-11-11 22:11:05 -0700
committerAdam Soltys <[email protected]>2026-11-11 22:11:05 -0700
commite87faa6ac650fe00388159ce149ec95777a11608 (patch)
treea0cae5793aa8953ab49e709f89b31f17a70bbf4b /tools
parentc7455ec7416fb39d4c57e92f5094cc3368b0edfb (diff)
downloadcoinosv3-e87faa6ac650fe00388159ce149ec95777a11608.tar.gz
coinosv3-e87faa6ac650fe00388159ce149ec95777a11608.zip
Post search shows a bot fleet's newsletter once, not forty-six times. "searching "fiatjaf" surfaced this same post over and over i guess from different people all boosting it" (Adam, 2026-11-11). Not boosts: about a dozen keys each post the NostrMag "Quiet Coup" issue every few hours, reworded a little each time (an emoji, "BREAKING", the picture moved), so the exact-repeat spam check never matches. In a search feed a post whose words and links overlap half or more (Jaccard) with one already shown is dropped; posts under 8 words are left alone. Measured on 120 live hits for "fiatjaf" from the three search relays: newsletter copies overlap 0.53 and up, distinct posts 0.45 at most; 46 copies → 1, nothing else dropped. post-search-test adds three reworded copies from three keys
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6UKGJyuGyZFxddYRxS
Diffstat (limited to 'tools')
-rw-r--r--tools/post-search-test.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/post-search-test.js b/tools/post-search-test.js
index 2f32812..81e5b62 100644
--- a/tools/post-search-test.js
+++ b/tools/post-search-test.js
@@ -13,6 +13,9 @@ const SK = generateSecretKey();
const now = Math.floor(Date.now() / 1000);
const post = finalizeEvent({ kind: 1, created_at: now - 300, tags: [], content: 'talked to fiatjaf about relays today' }, SK);
const parent = 'a'.repeat(64);
+// one newsletter, posted by bot keys with a word or emoji changed each time
+const NL = 'In this week\'s issue: The Quiet Coup: Fiatjaf Wipes Authorship From 57 NIPs. In a 12-hour window, the documentation layer was rewritten without consent. https://nostrmag.com/article/w45';
+const copies = ['📰 ' + NL, '🗞️ BREAKING ' + NL, NL + ' 👤 NM team'].map((content, i) => finalizeEvent({ kind: 1, created_at: now - 100 - i, tags: [], content }, generateSecretKey()));
const reply = finalizeEvent({ kind: 1, created_at: now - 200, tags: [['e', parent, '', 'reply']], content: 'fiatjaf would say just use a relay' }, SK);
const html = await buildHtml({ minify: true, pwa: false });
@@ -41,7 +44,7 @@ await page.evaluateOnNewDocument((hits) => {
};
window.WebSocket.prototype = Real.prototype;
Object.assign(window.WebSocket, Real);
-}, [post, reply]);
+}, [post, reply, ...copies]);
const errs = [];
page.on('pageerror', (e) => errs.push(String(e)));
const click = (t) => page.evaluate((x) => { const e = [...document.querySelectorAll('button')].find((n) => n.textContent.trim().toLowerCase().includes(x)); if (e) { e.click(); return true; } return false; }, t);
@@ -65,6 +68,9 @@ try {
await page.keyboard.press('Enter');
check('Enter opens a feed of posts that say it', await waitText('talked to fiatjaf about relays', 10000));
check('...replies too', await waitText('fiatjaf would say just use a relay', 3000));
+ await waitText('quiet coup', 10000); await sleep(1500);
+ const nl = await page.evaluate(() => (document.body.innerText.match(/Quiet Coup/g) || []).length);
+ check('a newsletter posted by three bot keys shows once', nl === 1, nl + ' copies');
const s = await page.evaluate(() => window.__searches.filter((x) => x.f.search === 'fiatjaf' && !(x.f.kinds || []).includes(0)));
check('asked NIP-50 relays for kind 1 with the words', s.length > 0 && s.every((x) => JSON.stringify(x.f.kinds) === '[1]'), JSON.stringify(s.map((x) => x.url)));
check('the feed is named for the search', await page.evaluate(() => [...document.querySelectorAll('.feed-chip')].some((c) => c.classList.contains('on') && c.textContent.includes('fiatjaf'))),