feat: Social monitoring job runner integration (#100)#124
Draft
feat: Social monitoring job runner integration (#100)#124
Conversation
- Add 'social-monitor' to runKindSchema in contracts - Add SocialPlatformAdapter interface and SocialMention contracts (social.ts) - Add social_mentions table to DB schema with (platform, external_id) unique index - Create SocialPlatformRegistry (mirrors ProviderRegistry pattern) - Add executeSocialMonitorRun() to JobRunner with per-platform error handling and partial/failed/completed status logic - Update runs API to accept 'social-monitor' kind - Pass kind through onRunCreated callback chain - Wire SocialPlatformRegistry into server.ts Fixes #100
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Wires social platform adapters into the job runner so that
social-monitorruns execute end-to-end. Adds theSocialPlatformRegistry,SocialPlatformAdaptercontract,social_mentionsDB table, and extends the job runner with deduplication, per-platform error handling, and correct partial/complete/failed status logic.Changes
packages/contracts/src/social.ts(new) —SocialPlatformAdapterinterface,SocialMention,SocialQuotaPolicy,SocialPlatformName, andSocialMentionDtoDTO schemapackages/contracts/src/run.ts— addsocial-monitortorunKindSchemapackages/contracts/src/index.ts— export newsocial.tspackages/db/src/schema.ts— addsocial_mentionstable with(platform, external_id)unique constraint for deduplicationpackages/canonry/src/social-registry.ts(new) —SocialPlatformRegistryclass mirroringProviderRegistrypatternpackages/canonry/src/job-runner.ts— addexecuteSocialMonitorRun()method; rate limiting via existingwaitForRateLimit; UPSERT-on-conflict deduplication; per-platform error tracking; partial/failed/completed statuspackages/canonry/src/server.ts— instantiateSocialPlatformRegistry, pass toJobRunner, routesocial-monitorruns to new executorpackages/api-routes/src/runs.ts— acceptsocial-monitorkind inPOST /projects/:name/runs; passkindthroughonRunCreatedcallbackpackages/api-routes/src/index.ts— updateonRunCreatedtype signature to includekindTesting
All existing tests pass (115 canonry tests + 116 api-routes tests + full typecheck + lint). Social-monitor execution is covered by the infrastructure; concrete adapter tests will be added alongside the Reddit adapter (tracked separately).
Fixes #100