Skip to content

feat: add Promote drip engine (Phase 1) - #93

Merged
ralyodio merged 2 commits into
masterfrom
feat/promote
Jul 15, 2026
Merged

ralyodio merged 2 commits into
masterfrom
feat/promote

Conversation

@Preshy

@Preshy Preshy commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements the Promote feature per docs/promote-prd.md (Phase 1 — Core drip engine).

Closes #92


What is Promote?

A global, top-level feature (peer of Ads and Alerts) where the user pastes a list of links, and AI writes a fresh, custom marketing pitch for each link x each platform, then drip-publishes them across all connected social accounts on a recurring cadence (default every 30 minutes). Every send is uniquely generated — never the same copy twice.

Changes

Database

  • supabase/migrations/20260713000000_promote.sql — promo_list, promo_link, promo_post tables + RLS + indexes + updated_at trigger

Library

  • lib/promote/generatePitch.ts — Dual-provider (Anthropic/OpenAI) copywriter with per-platform profiles (char limits, hashtag guidance, voice), anti-repeat prompt injection, link parsing/dedup, title fetching, cadence helpers
  • lib/promote/sweep.ts — processDuePromoteLists() with round-robin link selection, trickle/burst modes, credit gating via consume_credit, auto-pause on insufficient balance

Server Actions

  • app/actions/promote.ts — Full CRUD: createPromoteList, updatePromoteList, addLinksToList, removeLink, toggleLink, pausePromoteList, resumePromoteList, deletePromoteList, postNow

Pages

  • /promote — List index with stats (posts sent, credits spent)
  • /promote/new — Create form with links textarea, cadence picker, account multiselect, burn estimator
  • /promote/[id] — Detail view with settings editor, link management, recent posts log
  • /promote/accounts — Global account connection surface (reuses social setup forms)

Components

  • list-actions.tsx — Pause/Resume/PostNow/Delete buttons
  • promote-form.tsx — Create form with daily burn estimate
  • promote-edit-form.tsx — Settings editor
  • add-links-form.tsx — Add links to existing list
  • link-list.tsx — Link management (enable/disable/remove)

Worker

  • promoteSweep() on 60s interval in worker/index.ts, reuses sp_account pool + postViaAccount

Navigation

  • Promote link added to topnav after Ads

Tests

  • tests/promote/generate-pitch.test.ts — parseLinks, cadenceLabel, CADENCE_PRESETS

Verification

  • TypeScript compiles cleanly (no new errors)
  • All new files follow existing patterns (alerts, ads, social posting)

Implements the Promote feature per docs/promote-prd.md:

- Migration: promo_list, promo_link, promo_post tables + RLS + indexes
- Topnav: Promote link added after Ads
- Pages: /promote (index), /promote/new, /promote/[id], /promote/accounts
- Server actions: full CRUD (create, update, pause, resume, delete, post now)
- lib/promote/generatePitch.ts: dual-provider (Anthropic/OpenAI) copywriter
  with per-platform profiles and anti-repeat prompt injection
- lib/promote/sweep.ts: processDuePromoteLists() with round-robin link
  selection, trickle/burst modes, credit gating, auto-pause on low balance
- Worker: promoteSweep() on 60s interval, reuses sp_account pool + postViaAccount
- Components: list-actions, promote-form, edit-form, add-links, link-list
- Tests: parseLinks, cadenceLabel, CADENCE_PRESETS

Closes #92
@github-actions

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

@ralyodio

Copy link
Copy Markdown
Contributor

test is failing

@Preshy

Preshy commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

Fixed in the follow-up commit (27a36f1) — the sp_account count query was destructured as { data: accounts } instead of { count: acctCount }. All checks are green now.

@ralyodio
ralyodio merged commit debede1 into master Jul 15, 2026
8 checks passed
@ralyodio
ralyodio deleted the feat/promote branch July 15, 2026 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

promote prd

2 participants