From bcd0596f1b6b242c6c98bec6f4705850e9b367f5 Mon Sep 17 00:00:00 2001 From: Anthony Ettinger Date: Sun, 8 Nov 2026 16:58:20 +0000 Subject: [PATCH] fix(brisk): drop screenshot placeholders on the pwa host too The pwa sweep moved the brisk adapter to brisk.pwa.pit.world but, by design, left the regex-escaped brisk\.news in SCREENSHOT alone. brisk builds its /api/screenshot placeholder URLs on its own host, so once it serves from the pwa host those placeholders would be carried into the collection as item images. Match both hosts. Also fixes the rest of the CI breakage from the sweep: - reflow house-aggregators.test.js, whose longer URLs broke biome format (the step that failed in CI and hid the test failures below); - installmap recordId test expected agenticjobs.work for an endpoint the sweep had moved to agenticjobs.pwa.pit.world. Co-Authored-By: Claude Opus 5.5 --- packages/adapters/src/brisk.js | 4 +++- test/house-aggregators.test.js | 26 ++++++++++++++++++++------ test/installmap.test.js | 4 +++- test/news-directories.test.js | 2 ++ 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/packages/adapters/src/brisk.js b/packages/adapters/src/brisk.js index 705db37..d554e51 100644 --- a/packages/adapters/src/brisk.js +++ b/packages/adapters/src/brisk.js @@ -55,8 +55,10 @@ const FEED_URL = /\/comments\/|\/feeds?\/|\.(?:xml|rss|atom)(?:$|\?)/i; /** * brisk renders a card image on demand at its own `/api/screenshot`. Carrying * that would point every image in this collection at another site's renderer. + * brisk now serves from brisk.pwa.pit.world and builds these URLs on its own + * host, so both the old and the current host are matched. */ -const SCREENSHOT = /^https?:\/\/[^/]*brisk\.news\/api\/screenshot/i; +const SCREENSHOT = /^https?:\/\/[^/]*(?:brisk\.news|brisk\.pwa\.pit\.world)\/api\/screenshot/i; /** * Decoded, whitespace-collapsed, and null when nothing is left. diff --git a/test/house-aggregators.test.js b/test/house-aggregators.test.js index 6bfd05b..91622d8 100644 --- a/test/house-aggregators.test.js +++ b/test/house-aggregators.test.js @@ -350,7 +350,10 @@ describe('aiornot', () => { { config: { feeds: ['trending', 'latest'] } }, ); await adapterByName('aiornot').pull(c); - expect(seen).toEqual(['https://aiornot.pwa.pit.world/rss.xml', 'https://aiornot.pwa.pit.world/rss/trending.xml']); + expect(seen).toEqual([ + 'https://aiornot.pwa.pit.world/rss.xml', + 'https://aiornot.pwa.pit.world/rss/trending.xml', + ]); }); }); @@ -361,7 +364,9 @@ describe('agenticjobs', () => { expect(it.kind).toBe('job'); expect(it.externalId).toBe('3b0d293e-e2af-4609-af4d-1c4762a48a1e'); expect(it.title).toBe('promote us to your other communities — Profullstack, Inc.'); - expect(it.url).toBe('https://agenticjobs.pwa.pit.world/jobs/promote-us-to-your-other-communities'); + expect(it.url).toBe( + 'https://agenticjobs.pwa.pit.world/jobs/promote-us-to-your-other-communities', + ); expect(it.publishedAt.toISOString()).toBe('2026-09-11T11:33:18.752Z'); expect(it.tags).toEqual([ 'agenticjobs', @@ -387,7 +392,9 @@ describe('agenticjobs', () => { test('walks offset pages and stops at the total', async () => { const page = await fixture('agenticjobs-jobs.json'); - const { ctx: c, seen } = ctx('agenticjobs', { 'https://agenticjobs.pwa.pit.world/api/v1/jobs': page }); + const { ctx: c, seen } = ctx('agenticjobs', { + 'https://agenticjobs.pwa.pit.world/api/v1/jobs': page, + }); const out = await adapterByName('agenticjobs').pull(c); expect(out.items.length).toBe(2); // Two postings of a total of two: the first page is also the last. @@ -431,7 +438,9 @@ describe('tsbb', () => { 'tsbb', { 'https://tsbb.pwa.pit.world/api/v1/forums': await fixture('tsbb-forums.json'), - 'https://tsbb.pwa.pit.world/f/announcements/feed.xml': await fixture('tsbb-feed-announcements.xml'), + 'https://tsbb.pwa.pit.world/f/announcements/feed.xml': await fixture( + 'tsbb-feed-announcements.xml', + ), 'https://tsbb.pwa.pit.world/f/general/feed.xml': await fixture('tsbb-feed-general.xml'), }, { log: (m) => lines.push(m) }, @@ -532,7 +541,10 @@ describe('c0upons', () => { const full = Array.from({ length: 200 }, (_, i) => ({ ...rows[2], id: 1000 + i })); const { ctx: c, seen } = ctx('c0upons', { 'https://c0upons.pwa.pit.world/api/coupons?limit=200&offset=0': JSON.stringify(full), - 'https://c0upons.pwa.pit.world/api/coupons?limit=200&offset=200': JSON.stringify([full[199], rows[0]]), + 'https://c0upons.pwa.pit.world/api/coupons?limit=200&offset=200': JSON.stringify([ + full[199], + rows[0], + ]), }); const out = await adapterByName('c0upons').pull(c); expect(seen.length).toBe(2); @@ -843,7 +855,9 @@ describe('weedforcrypto', () => { batches.push(step.value); step = await run.next(); } - expect(seen).toEqual(['https://weedforcrypto.pwa.pit.world/api/v1/dispensaries?limit=200&page=1']); + expect(seen).toEqual([ + 'https://weedforcrypto.pwa.pit.world/api/v1/dispensaries?limit=200&page=1', + ]); expect(batches).toHaveLength(1); expect(batches[0].items).toHaveLength(2); expect(batches[0].cursor).toEqual({}); diff --git a/test/installmap.test.js b/test/installmap.test.js index 1f0a39e..7167339 100644 --- a/test/installmap.test.js +++ b/test/installmap.test.js @@ -80,7 +80,9 @@ describe('which rows, and where their servers are', () => { test('the record id drops the endpoint name, as the spec derives it', () => { expect(recordId('https://mcp.anakin.io/mcp', 'anakin.io')).toBe('mcp.anakin.io'); - expect(recordId('https://agenticjobs.pwa.pit.world/api/mcp', 'x')).toBe('agenticjobs.work'); + expect(recordId('https://agenticjobs.pwa.pit.world/api/mcp', 'x')).toBe( + 'agenticjobs.pwa.pit.world', + ); expect(recordId('https://a.example/v1/mcp', 'x')).toBe('a.example'); expect(recordId('https://a.example/tenant/mcp', 'x')).toBe('a.example/tenant'); expect(recordId(null, 'Example.com')).toBe('example.com'); diff --git a/test/news-directories.test.js b/test/news-directories.test.js index 73bb8bc..829674f 100644 --- a/test/news-directories.test.js +++ b/test/news-directories.test.js @@ -186,6 +186,8 @@ describe('brisk: the small web only', () => { test('the on-demand screenshot placeholder is not carried as an image', () => { const shot = 'https://brisk.pwa.pit.world/api/screenshot?url=https%3A%2F%2Fexample.com'; expect(brisk.toItem(row({ imageUrl: shot })).imageUrl).toBeNull(); + const oldShot = 'https://brisk.news/api/screenshot?url=https%3A%2F%2Fexample.com'; + expect(brisk.toItem(row({ imageUrl: oldShot })).imageUrl).toBeNull(); expect(brisk.toItem(row()).imageUrl).toBe('https://popcorn.cx/img/moc.jpg'); });