Skip to content

Social monitoring job runner integration #100

@arberx

Description

@arberx

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:

  1. POST /projects/:name/runs with kind: 'social-monitor' creates run (status: queued)
  2. Job runner picks up via onRunCreated callback
  3. Resolves project's configured social platforms + connections from DB
  4. For each platform: loads SocialPlatformAdapter, calls searchMentions() with project keywords + canonical domains
  5. Deduplication: UPSERT on (platform, external_id) — skip already-captured posts
  6. Inserts new mentions into social_mentions table
  7. 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

  • social-monitor runs execute through the job runner
  • Mentions are deduplicated by (platform, external_id)
  • Run status correctly reflects partial/complete/failed
  • Rate limits are respected per platform
  • Tests cover the execution flow

Metadata

Metadata

Assignees

No one assigned

    Labels

    phase-aPhase A: Foundation + RedditsocialSocial platform monitoringswarm-readyIssue is ready for the automated swarm to pick up

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions