fix(ai): don't write the scheduled posting time into recurring posts #79

Merged
kreativmonkey merged 2 commits from fix/recurring-posting-time into main 2026-06-13 21:53:58 +02:00
Owner

Problem

For recurring / announcement jobs the AI wrote the posting time (when the post is published) into the post body, as if it were the event time. The posting time should only be passed through for scheduling, never appear in the text — the event facts live in the template (source_content).

Root cause

recurringPublicationPlan (in internal/ai/prompts.go) added a line to the prompt's ## Publication plan:

This post publishes: <post_scheduled_at>

For the main recurring post this was the only time-shaped line in the prompt, so the model treated that posting timestamp as the event time and wrote it into the copy.

Fix

  • Remove the This post publishes: <time> line — the posting time is a scheduling-only field; the scheduler already uses post_scheduled_at to set the post's ScheduledAt, so it has no business in the text prompt.
  • Add an explicit guard: tell the model the publication time is set automatically and must never be mentioned; any time/date wording comes only from the template.
  • Announcements still get the real event date (main_event_at) — that is legitimate, referenceable content; only the posting time is suppressed.

Tests (added, TDD)

  • Main recurring prompt: the posting time (and This post publishes) is absent; the "set automatically — never mention" guard is present.
  • Announcement prompt: the posting time (09:00) is gone, while the event date line is kept.

go test ./..., go vet ./internal/ai/ pass.

🤖 Generated with Claude Code

## Problem For recurring / announcement jobs the AI wrote the **posting time** (when the post is published) into the post body, as if it were the **event** time. The posting time should only be passed through for scheduling, never appear in the text — the event facts live in the template (`source_content`). ## Root cause `recurringPublicationPlan` (in `internal/ai/prompts.go`) added a line to the prompt's `## Publication plan`: ``` This post publishes: <post_scheduled_at> ``` For the main recurring post this was the *only* time-shaped line in the prompt, so the model treated that posting timestamp as the event time and wrote it into the copy. ## Fix - **Remove** the `This post publishes: <time>` line — the posting time is a scheduling-only field; the scheduler already uses `post_scheduled_at` to set the post's `ScheduledAt`, so it has no business in the text prompt. - **Add an explicit guard**: tell the model the publication time is set automatically and must never be mentioned; any time/date wording comes only from the template. - Announcements still get the real **event date** (`main_event_at`) — that is legitimate, referenceable content; only the posting time is suppressed. ## Tests (added, TDD) - Main recurring prompt: the posting time (and `This post publishes`) is absent; the "set automatically — never mention" guard is present. - Announcement prompt: the posting time (09:00) is gone, while the event date line is kept. `go test ./...`, `go vet ./internal/ai/` pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(ai): stop recurring posts from writing the scheduled posting time
Some checks failed
CI/CD Workflow / Test Frontend (Node.js) (pull_request) Has been cancelled
CI/CD Workflow / Test Postgres Store (pull_request) Has been cancelled
CI/CD Workflow / Build and Publish Docker Image (pull_request) Has been cancelled
CI/CD Workflow / Trigger Dockhand Deployment (pull_request) Has been cancelled
CI/CD Workflow / E2E (Playwright + Go) (pull_request) Has been cancelled
CI/CD Workflow / Test Backend (Go) (pull_request) Has been cancelled
1cb89133b7
For recurring/announcement jobs the generation prompt listed "This post
publishes: <time>" (post_scheduled_at). With nothing else time-shaped in the
prompt, the model mistook that *posting* time for the *event* time and wrote
it into the post body.

The posting time is a scheduling-only field — the system already uses it to
set the post's ScheduledAt; it does not belong in the text. Remove that line
from the prompt and instead instruct the model that the publication time is
set automatically and must never appear in the text; event timing comes only
from the template (source_content). The real event date is still provided to
announcements (it is legitimate, referenceable content).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
style(ai): gofmt prompts.go (align moodAdjustmentHints)
All checks were successful
CI/CD Workflow / Test Backend (Go) (pull_request) Successful in 3m0s
CI/CD Workflow / Test Frontend (Node.js) (pull_request) Successful in 1m23s
CI/CD Workflow / Test Postgres Store (pull_request) Successful in 1m20s
CI/CD Workflow / E2E (Playwright + Go) (pull_request) Successful in 7m0s
CI/CD Workflow / Build and Publish Docker Image (pull_request) Has been skipped
CI/CD Workflow / Trigger Dockhand Deployment (pull_request) Has been skipped
a30337af9b
Pre-existing gofmt drift in the moodAdjustmentHints map; no behaviour change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
kreativmonkey referenced this pull request from a commit 2026-06-27 08:54:30 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kreativmonkey/goloom!79
No description provided.