Skip to content

Auto-publish stories the AI moderator is confident about - #1504

Draft
jboolean wants to merge 5 commits into
masterfrom
ai-moderation-auto-approve
Draft

jboolean wants to merge 5 commits into
masterfrom
ai-moderation-auto-approve

Conversation

@jboolean

@jboolean jboolean commented Sep 19, 2026

Copy link
Copy Markdown
Owner

What this does

A story is published straight away when the AI moderator approves it, with no human review.

A story auto-publishes when all three are true:

  • the user is not banned
  • the moderation score clears MIN_REJECT_PROBABILITY
  • the recaptcha score is at least 0.7, matching the "% Human" flag on the review screen

An auto-published story gets state: published and lastReviewer: 'system'. This is how a banned user's story is auto-rejected today.

Emali template updates

Rather than add a fourth template, the two submission templates take an isPublished flag:

  • story-submitted covers a first submission, whether it is queued or already live
  • story-submitted-again covers a resubmission, whether it is queued or already live
  • story-auto-published is deleted

🤖 Generated with Claude Code

A submitted story that isn't from a banned user is now auto-published
when its AI moderation score clears MIN_REJECT_PROBABILITY, the same
way a banned user's story is auto-rejected: state set to published,
lastReviewer set to 'system'. The storyteller gets the
story-auto-published email instead of story-submitted.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Without a timeout, a hung (not just failing) OpenRouter request could
stall a story submission indefinitely before the surrounding
try/catch ever gets a chance to run.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Reuses the same 0.7 cutoff the admin review screen already flags
low-recaptcha stories with. A story below it still goes to human
review even if the AI moderator would have approved it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Same bug as master: a resubmission returned early before
evaluateStory ran. Fixed the same way here, and since this branch also
takes action on the score, made the auto-publish eligibility explicit
rather than leaving it as a side effect of the early return: only a
story's first-ever submission can auto-publish. A resubmission (often
following a human rejection or edit) always goes back to human review,
though it's still scored and shown as flags in the review screen.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…late

Moderation now runs on every submission, and a resubmitted story can
auto-publish. That combination had no email to send. Rather than add a
fourth template, we pass isPublished to story-submitted and
story-submitted-again, and delete story-auto-published.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

1 participant