Summary
Wire social platform adapters into the job runner to execute social-monitor runs.
Details
The social monitoring run follows the same lifecycle as answer-visibility:
POST /projects/:name/runs with kind: 'social-monitor' creates run (status: queued)
- Job runner picks up via
onRunCreated callback
- Resolves project's configured social platforms + connections from DB
- For each platform: loads
SocialPlatformAdapter, calls searchMentions() with project keywords + canonical domains
- Deduplication: UPSERT on
(platform, external_id) — skip already-captured posts
- Inserts new mentions into
social_mentions table
- Run status:
completed / partial / failed based on per-platform results
Rate limiting
Reuse the ProviderQuotaPolicy pattern with a SocialQuotaPolicy equivalent per platform.
Social Platform Registry
Similar to ProviderRegistry, create a SocialPlatformRegistry that maps configured platforms to adapter instances.
Files
packages/canonry/src/job-runner.ts (extend)
packages/canonry/src/server.ts (wire social adapters)
packages/canonry/src/social-registry.ts (new)
Depends on
- Social contracts, DB migration, Reddit adapter issues
Acceptance Criteria
Summary
Wire social platform adapters into the job runner to execute
social-monitorruns.Details
The social monitoring run follows the same lifecycle as
answer-visibility:POST /projects/:name/runswithkind: 'social-monitor'creates run (status:queued)onRunCreatedcallbackSocialPlatformAdapter, callssearchMentions()with project keywords + canonical domains(platform, external_id)— skip already-captured postssocial_mentionstablecompleted/partial/failedbased on per-platform resultsRate limiting
Reuse the
ProviderQuotaPolicypattern with aSocialQuotaPolicyequivalent per platform.Social Platform Registry
Similar to
ProviderRegistry, create aSocialPlatformRegistrythat maps configured platforms to adapter instances.Files
packages/canonry/src/job-runner.ts(extend)packages/canonry/src/server.ts(wire social adapters)packages/canonry/src/social-registry.ts(new)Depends on
Acceptance Criteria
social-monitorruns execute through the job runner(platform, external_id)