Skip to content

Add Delivery Modes (UI + persistence) and wire into AI flow; scaffold server & client - #19

Merged
jaden688 merged 1 commit into
mainfrom
codex/implement-production-ready-dailycast-platform
Feb 1, 2026
Merged

jaden688 merged 1 commit into
mainfrom
codex/implement-production-ready-dailycast-platform

Conversation

@jaden688

@jaden688 jaden688 commented Feb 1, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Introduce a runtime, per-user Delivery Mode system to control tone/cadence of newly generated episodes without modifying archival data.
  • Surface Delivery Mode in the UI so users can pick modes (including a broadcast-safe “Savage Mode” that only affects new content), and persist that preference per user.
  • Keep archive content immutable and clearly marked as read-only in the history view.
  • Unblock local dev by fixing a client API parsing issue and add minimal server/client scaffolds to prepare for launch-ready workflows.

Description

  • Added delivery mode definitions and helpers in src/lib/delivery-modes.ts and a buildDeliveryPrompt helper to turn a mode into LLM guidance for generation.
  • Persisted user delivery preference by adding deliveryMode to UserSettings in src/lib/settings.ts and updated loadUserSettings/saveUserSettings to merge defaults.
  • Implemented a DeliveryModeSelector UI component at src/components/delivery-mode-selector.tsx and integrated it into the episode workspace (src/app/page.tsx), saving selections via saveUserSettings.
  • Wired the selected mode into the AI summarization flow by extending summarizeSocialFeed input schema (src/ai/flows/summarize-social-feed.ts) and injecting the deliveryMode prompt; updated generateNewEpisode signature and callers to pass the mode (src/app/actions.ts, src/app/page.tsx).
  • Marked historical episodes as read-only with visual cues in src/app/history/page.tsx so archives remain explicitly immutable.
  • Fixed a parsing/typo issue in src/lib/api.ts that caused dev-time compile errors.
  • Added a minimal Express TypeScript server scaffold under server/ (routes, Prisma schema, AI provider stub, Dockerfile), and a small Vite + React client scaffold under client/, and updated docker-compose.yml to include server and client services.

Testing

  • Started the local dev server with npm run dev and the Next.js application compiled and served after fixing the src/lib/api.ts parse error (dev server reported Ready). — Success.
  • Ran headless browser automation to exercise the UI; initial Chromium runs timed out or crashed in this environment, but subsequent WebKit-run Playwright script completed and produced a screenshot artifact of the Delivery Mode UI (artifacts/delivery-mode.png). — Partial success (Chromium timed out, WebKit succeeded and captured UI).
  • No unit test runner was executed in this rollout; the existing src/lib/settings.test.ts was updated to include the new deliveryMode field but automated unit tests were not run. — Not executed.

Codex Task

@vercel

vercel Bot commented Feb 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
daily-cast Error Error Feb 1, 2026 2:44pm

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @jaden688! 👋

Your private repo does not have access to Sourcery.

Please upgrade to continue using Sourcery ✨

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b3e7ca8f5e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +35 to +37
router.delete('/:feedId', requireAuth, async (req: AuthRequest, res) => {
await prisma.feedConnection.delete({ where: { id: req.params.feedId } });
res.status(204).send();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Enforce ownership when deleting feeds

The delete handler removes a FeedConnection solely by id, so any authenticated user who can learn or guess another user’s feed ID can delete it. Because requireAuth only verifies the token and doesn’t check ownership, this route should scope the delete to userId (e.g., deleteMany with { id, userId } or a prior ownership check) to prevent cross-tenant data loss.

Useful? React with 👍 / 👎.

Comment on lines +46 to +48
router.delete('/:episodeId', requireAuth, async (req: AuthRequest, res) => {
await prisma.episode.delete({ where: { id: req.params.episodeId } });
res.status(204).send();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Enforce ownership when deleting episodes

The episode delete endpoint deletes by id without verifying that the episode belongs to the authenticated user. As written, any user with a valid token could delete another user’s episode if they obtain its ID. This should be scoped to userId (or validated before deletion) to avoid cross-account data deletion.

Useful? React with 👍 / 👎.

@jaden688
jaden688 merged commit feb379e into main Feb 1, 2026
5 of 6 checks passed
@jaden688
jaden688 deleted the codex/implement-production-ready-dailycast-platform branch March 24, 2026 00:34

This branch had an error being deployed

1 failed deployment
Preview — b3e7ca8f Deployed Feb 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant