Files
stargue-publishing-engine/apps/scheduler/package.json
T
Angelo B. J. Luidens c0dad39d55 Stage 4.1: BullMQ publish worker + Redis/Postgres integration
- apps/scheduler/src/queue.ts: PUBLISH_QUEUE, BullMQ-compatible Redis connection
  factory, queue factory, default retry/backoff job opts.
- apps/scheduler/src/worker.ts: makePublishWorker factory drives the publish-loop
  state machine (queued -> dispatching -> published | failed/dlq) and persists
  each transition to publications. Dispatcher is injected (fake in tests; the
  LinkedIn client swaps in once Gate 0.9 / CMA lands).
- apps/scheduler/src/main.ts: runnable entry; boots the worker; LinkedIn dispatch
  is fail-closed until CMA is approved.
- apps/scheduler/src/worker.integration.test.ts: gated behind INTEGRATION=1;
  verifies enqueue -> consume -> row published within 5s, and failure -> dlq with
  error recorded. Run against real Redis + Postgres.

Closes the Stage 4.1 DoD (enqueue -> worker-consume -> DB row updated within 5s).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-03 15:12:44 -04:00

27 lines
621 B
JSON

{
"name": "@stargue/scheduler",
"version": "0.1.0",
"private": true,
"type": "module",
"scripts": {
"build": "tsc --noEmit",
"dev": "bun --watch src/main.ts",
"start": "bun src/main.ts",
"typecheck": "tsc --noEmit",
"test": "vitest run",
"lint": "echo 'lint pending'"
},
"dependencies": {
"@stargue/linkedin-client": "workspace:*",
"@stargue/schema": "workspace:*",
"@stargue/observability": "workspace:*",
"bullmq": "^5.30.0",
"drizzle-orm": "^0.36.0",
"ioredis": "^5.4.0"
},
"devDependencies": {
"vitest": "^2.1.0",
"typescript": "^5.7.0"
}
}