feat(tap): add durable recompute and URL enrichment workers - #1
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (15)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughAdds Caddy as the public reverse proxy; moves label recomputation to a durable SQLite job queue with a background recompute worker; adds a URL enrichment worker and URL-check cache; scoring now reads precomputed urlResolution; updates startup, metrics, Docker/scripts, docs, and tests. ChangesReverse Proxy, Worker Orchestration, and Job Infrastructure
Recompute Worker and Tap Handler Refactoring
URL Enrichment Worker and Deferred Resolution
Architecture, Deployment, and Tests
Sequence Diagram(s)sequenceDiagram
participant TapStream as Tap Stream
participant TapHandler as Tap Handler
participant DB as SQLite (recompute_jobs)
participant RecomputeWorker as Recompute Worker
participant LabelsDB as SQLite (labels)
participant UrlWorker as URL Enrichment Worker
participant UrlDB as SQLite (url_checks)
participant DNS as DNS resolver
participant HTTP as HTTP fetch
TapStream->>TapHandler: record event (org/profile upsert or delete)
TapHandler->>DB: enqueueRecomputeJob('recompute-org', did) or recordPendingDelete()
TapHandler-->>TapStream: ack
RecomputeWorker->>DB: claimDueRecomputeJob()
DB-->>RecomputeWorker: RecomputeJob
RecomputeWorker->>UrlDB: getUrlResolutionMapForDid(did)
UrlDB-->>RecomputeWorker: urlResolution map
RecomputeWorker->>LabelsDB: scoreActivity() with urlResolution
LabelsDB-->>RecomputeWorker: computed labels / HF refresh
RecomputeWorker->>LabelsDB: updateLabels()
RecomputeWorker->>DB: completeRecomputeJob()
UrlWorker->>UrlDB: getDueUrlCheck()
UrlDB-->>UrlWorker: URL to resolve
UrlWorker->>DNS: lookupHostAddresses(host)
DNS-->>UrlWorker: addresses
UrlWorker->>HTTP: fetch(url) (HEAD/GET, follow redirects)
HTTP-->>UrlWorker: response or error
UrlWorker->>UrlDB: recordUrlCheckOk() or recordUrlCheckFailure()
alt resolution state changed
UrlWorker->>DB: enqueueRecomputeJob('recompute-org', did)
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
Summary
Verification
Out of scope
Summary by CodeRabbit
New Features
Improvements
Documentation
Tests