Publishing Lifecycle & Moderation History — Design Document

Overview

Publishing an entity is the moment a creator's private work becomes public — a deliberate milestone that routes through moderation. Today that milestone is modelled as a checkbox buried in the edit form (PublicVisibilityToggle), and once submitted the creator gets a single notification and then silence: there is no surface that answers "what's happening with my publish request, and what happened to it last time?"

This feature reframes publishing as a lifecycle with a visible history, surfaced where the creator actually works — the entity workbench and the project view — rather than as a form field plus a notification that scrolls away. It is built almost entirely on data the platform already records; the work is mostly exposing and surfacing a trail that exists but is invisible.

It serves one core creator need: "Let me see the state of my publishing, act on it directly, and understand what the moderation outcome was — without re-reading old notifications or guessing."

Design Goals

  1. Publishing is a lifecycle action, not a setting. A state machine (Draft → In review → Published / Rejected / Flagged → resubmit) with one contextual primary action, not a toggle the user flips and then separately Saves.
  2. Transparency without gameability. The creator sees the human decision trail (submitted, approved/rejected, the reviewer's message, category-level reasons, withdrawn, resubmitted). They do not see the moderation pipeline's internal AI signal scores or the raw auto-flag match — naming the signal is exactly what the pipeline is designed never to do (MODERATION_PIPELINE.md §anti-gaming). Transparency stops at the policy line.
  3. Surface in context. Per-entity history in the workbench; status + actions on the project entity list; a global "My Publishing" rollup. One API call per surface (feedback_data_driven_ui).
  4. Reuse the existing trail. publish_requests already chains resubmissions and stores the reviewer decision. This is surfacing, not new plumbing — net-new is one read endpoint, one enriched DTO, and the UI.
  5. One shared primitive. The publish toggle lives in six edit forms today; replace it once with a shared PublishControl + history timeline, extracted up front (feedback_rule_of_two_extract_immediately), not copied per form.

Non-Goals

Deliberately out of scope for this work:

What already exists (the substrate)

The point of this section: most of the "history" is already persisted — it's just not exposed or surfaced. Design against this, don't reinvent it.

Data model — publish_requests (database/v1/12_tables_moderation.sql)

One row per submission, and rows accumulate — the table already is the history:

Status vocabulary: 0 Pending, 1 UnderReview, 2 Approved, 3 Rejected, 4 Flagged, 5 Withdrawn.

Endpoints today (PublishRequestsEndpoints.cs)

PublishRequestDto is the bottleneck: it exposes status, reviewerMessage, reviewedAt, createdAt, requestMessage — and omits the rest of the trail: rejectionCategories, withdrawnAt, priorRequestId, auto_checked / auto_approved. So even where data exists, the creator can't see it.

Frontend today

The design

1. PublishControl — the lifecycle primitive

A shared component that derives state from isPublic + publishRequestStatus (both already on every entity detail DTO) and renders a status pill + one contextual action:

Derived state Condition Primary action
Draft private, no active request Publish… → opens dialog (runs pre-check, choose Publish now / Schedule, confirm)
In review status 0 / 1 Withdraw ("a moderator is reviewing it" note when 1; withdraw still works)
Flagged status 4 Withdraw to edit + "waiting on a human reviewer" copy
Published isPublic = true Unpublish (immediate)
Rejected last terminal 3 reviewer message + category reasons + Edit & resubmit
Withdrawn last terminal 5 Resubmit

2. History timeline

A read-only, collapsed-by-default timeline rendered beneath PublishControl, one row per lifecycle event for the entity, newest first:

● Resubmitted · 2026-06-20
✓ Approved · 2026-06-12 — "Looks great, thanks for the edits." (reviewer)
✗ Rejected · 2026-06-10 — categories: violence · "Tone down the graphic description in greeting #2."
● Submitted for review · 2026-06-09

Events are derived from the request chain (each publish_requests row → one or more timeline events by status + timestamps). Anti-gaming line: the timeline shows reviewer human messages + rejection_categories (category-level), and never flag_reason (raw match) or any moderation_check_results detail.

3. Project entity list

Upgrade the existing tint to a legible, actionable surface (extends the prior toggle-UX discussion):

4. Global "My Publishing" page

A creator rollup consuming the already-existing GET /api/publish-requests (just needs a frontend API wrapper + a page): every request across all entities, filterable by status, each row linking into the entity's workbench history. Lowest-effort slice — the endpoint is built.

API changes

Implementation Plan (Sliced)

Each slice is independently shippable.

Open Questions

Dev-owned calls (engineering is mine; these carry product/policy weight):

Current State / Status

📋 Planned — not started. Spec written 2026-06-25 against the existing publish_requests schema and PublishRequestsEndpoints. The toggle-UX problem that motivated it is described in the prior design discussion; this doc elevates it to the full lifecycle + history feature.

Acceptance Criteria

The feature is not done until every box below is verified ✅ against the running product.

User use cases — satisfiable + accessible (verify by driving the UI, not the code):

Behavior:

Invariants that must stay true (carve-outs — verify a reviewer can break them if regressed):

Edges: