Skip to content

Feat/novelty and browser reuse#2

Merged
C-Moir merged 2 commits into
masterfrom
feat/novelty-and-browser-reuse
Apr 20, 2026
Merged

Feat/novelty and browser reuse#2
C-Moir merged 2 commits into
masterfrom
feat/novelty-and-browser-reuse

Conversation

@C-Moir
Copy link
Copy Markdown
Owner

@C-Moir C-Moir commented Apr 20, 2026

No description provided.

Cam and others added 2 commits April 20, 2026 17:34
Previously tryPlaywright launched a new chromium process per screenshot.
With 5 workers doing clean-path screenshots concurrently, that could spawn
5 parallel chromium processes which thrashed memory on lower-spec boxes and
serialised the pipeline behind ~1-3s browser startups.

Now: a module-level singleton browser, lazily launched on first screenshot,
shared across workers. Each screenshot gets a fresh page; the browser only
closes on process signal. A 'disconnected' listener clears the handle if
the browser dies unexpectedly so the next call re-launches.

SIGINT/SIGTERM handlers in index.js invoke closeBrowser() so we don't
leave dangling chromium processes after Ctrl+C.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
CT logs fire on every TLS cert event, which for Let's Encrypt means a cert
every 90 days per long-running site. Most of what the tool surfaced was
renewals of existing sites, not actual new deployments — undermining the
"live feed of new deployments" premise.

New module lib/novelty.js queues a crt.sh lookup per hostname at 3s
intervals (~1200/hr, below the public rate limit). Verdict is based on how
many certs crt.sh has ever issued for that hostname:
  1 cert  -> 'new'     (this is the one we just saw — no prior history)
  2+ certs -> 'renewal' (existing site got a new LE cert)
  failure -> 'unknown' (crt.sh timeout/502 — graceful degrade)

Integration:
- index.js kicks novelty.classify() after processEntry finishes; initial
  status is 'checking', updates when the worker lands a verdict and
  re-broadcasts to any live SSE client.
- Cached results live in an LRU-bounded Map so repeat hits are instant.
- lib/history.js + /api/history projection both include novelty now, so
  the history page carries the signal too.

UI (public/index.html):
- Novelty badge per card — 'new' (accent), 'renewal' (muted), 'checking'.
- '🆕 New only' filter chip in the main filter row; ANDs with other
  filters for composable exploration.

Verified in browser: within 60s of cold boot, 21 entries processed, 1 new,
1 renewal, 1 unknown, rest still checking (worker catching up). 'New only'
filter correctly shows just the single genuinely-new deployment.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@C-Moir C-Moir merged commit 1c950cc into master Apr 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant