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
- 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.
- 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. - 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). - Reuse the existing trail.
publish_requestsalready 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. - 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:
- Exposing moderation internals to creators. The pipeline's per-field
moderation_check_results, AI signal scores, and the raw matched keyword/phrase from an auto-flag stay admin-only. The creator sees human-decision granularity (category + reviewer message), never the detector's reasoning. (The creator's own pre-publish self-check already shows them their matched phrases — that's a different, pre-submission surface; seeContentPreCheckPanel.) - Changing the moderation pipeline or admin queue. The escalation ladder, verdict logic, and the
admin
PipelineRunPanelare untouched. This feature reads the creator-facing side of the same data. - Conversation publishing. Conversations have their own creator-review flow
(
conversation-publishing.md,web_conversations.moderation_status) distinct from the entity publish queue. The timeline component should be built so conversations could adopt it later, but wiring that flow in is a separate spec. - An appeals workflow. "Disagree with this rejection" is a future addition, not v1. v1 surfaces
the outcome and lets the creator edit + resubmit (which already chains via
prior_request_id). - Real-time push of moderation status. Existing
ContentGatePassed/ContentGateFlaggednotifications stay the live signal; this feature is the durable, on-demand view. No websocket.
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:
- Resubmission chain:
prior_request_idlinks a new request to the most recent rejected request for the same entity. NULL on first submission. The chain is the per-entity timeline. - Withdraw is non-destructive: a withdrawn request soft-cancels to
status = 5(withdrawn_atset), preserving the row. Only the legacyDELETE /{id}hard-deletes (Pending-only). - One active row at a time: unique partial index on
(entity_type, entity_id) WHERE status IN (0,1,4). Terminal rows (2Approved,3Rejected,5Withdrawn) stack up underneath. - Decision trail columns already present:
reviewer_message,reviewer_user_id,reviewed_at,rejection_categories[](moderator's category-level reason on reject),content_flags[](moderator's content annotation on approve),flag_reason(raw auto-flag text — sensitive),auto_checked,auto_approved,checks_run_at,withdrawn_at,created_at.
Status vocabulary: 0 Pending, 1 UnderReview, 2 Approved, 3 Rejected, 4 Flagged,
5 Withdrawn.
Endpoints today (PublishRequestsEndpoints.cs)
POST /api/publish-requests— submit (ownership + not-already-public + no-active-request guards).GET /api/publish-requests— paginated list of my requests, all entities. Exists but is surfaced nowhere — the frontend API client doesn't even wrap it.GET /api/publish-requests/{id}— single request (thin DTO).GET /api/publish-requests/check?entityType&entityId— current active status (this is what the toggle reads).POST /api/publish-requests/withdraw— soft-cancel at every active status: Pending(0), UnderReview(1) and Flagged(4) (owner decision 2026-09-24 — a claimed request used to be a dead end). 409already_resolvedonly when a moderator's decision committed first.DELETE /api/publish-requests/{id}— legacy hard-delete, Pending-only.
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
clientConsole/src/api/publishRequests.tswraps onlywithdraw.PublicVisibilityToggle(in 6 forms) flipsis_publicas a dirty form field, locks while a review is active, and hangs the schedule picker + role copy off itself.- Project entity list (
EntityListPanel) already tints rows bypublishRequestStatus(getPublishStatusStyle) and shows a "Published" badge — but In-review / Flagged are conveyed only by a subtle border, and the row dropdown has no publish action.
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 |
- The scheduled-publish picker becomes a sub-choice of the Publish dialog (now / schedule), not an always-present form field.
- The pre-check (
ContentPreCheckPanel) folds into the dialog as the pre-flight gate, instead of being a separate panel the creator must notice. - Lives in the workbench entity header + the project preview drawer (
EntityPreviewPanel), and replaces the in-form toggle in all six forms. Publishing is no longer coupled to the form's Save/Cancel commit.
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):
- Explicit status badge per row: In review (info), Flagged (warning), Published (success), Rejected (danger) — words, not just a border tint.
- State-driven publish actions in the row dropdown (
renderItemActions), owner-gated (ownerId === currentUserId): Publish… / Withdraw / Unpublish, each opening the sharedPublishControldialog (never silently firing a moderation request from a list click). - Enables batch publishing from one surface — author several entities, publish them without opening each editor.
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
- New:
GET /api/publish-requests/entity/{entityType}/{uuid}→ the full request chain for one entity (most-recent-first), as enriched DTOs. One call powers bothPublishControl's current-state read and the timeline. - Enrich
PublishRequestDto(anti-gaming-safe set): addstatusLabel,rejectionCategories,withdrawnAt,priorRequestId,autoApproved. Do not addflagReasonor check-result detail. - Reuse the existing global
GET /api/publish-requestsfor slice 5; add the frontend wrapper. WriteAsJsonAsync<T>+Results.Emptyfor the new typed responses (feedback_results_ok_serialization).
Implementation Plan (Sliced)
Each slice is independently shippable.
- Slice 1 — API & data 📋. Entity-scoped history endpoint + enriched (anti-gaming-safe)
PublishRequestDto+ repo method (read the chain) + frontendapi/publishRequests.tswrappers + TS types. No UI risk; pure read path. Targeted Database.Tests for the chain read. - Slice 2 —
PublishControl📋. Extract the lifecycle component, fold in pre-check + schedule, retirePublicVisibilityToggleacross all 6 forms. The original toggle-UX fix. - Slice 3 — History timeline 📋. Timeline UI consuming Slice 1, rendered in the workbench +
preview surfaces next to
PublishControl. - Slice 4 — Project list surfacing 📋. Status badges (upgrade the tint) + owner-gated dropdown
publish/withdraw actions opening the
PublishControldialog. - Slice 5 — Global "My Publishing" page 📋. New page consuming the existing global endpoint.
Open Questions
Dev-owned calls (engineering is mine; these carry product/policy weight):
- How much of the decision trail to expose (the anti-gaming line). Recommended default:
reviewer human message +
rejection_categories(category-level) ✅; rawflag_reason/ AI signal /moderation_check_results❌. Confirm the line, since it's a content-policy call. - The "Reviews" terminology collision. The project page already has a Reviews tab that
means collaborator proposals (
ProjectReviewsView), a different thing from moderation "In review". Rename that tab to Proposals to free the word, or keep it and label moderation state as "In moderation"? Recommend rename to Proposals. - Retention. Terminal
publish_requestsrows accumulate to form the history. Is there an eventual pruning policy that would truncate "full history", and should the timeline say so? - Does conversation publishing adopt this timeline in a later slice, or stay its own surface?
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):
- As a creator, I can publish an entity from the workbench via an explicit Publish action (not a form-field toggle I then have to Save), with the pre-check shown before I submit — reachable from the entity workbench header without insider knowledge.
- As a creator, I can see the history of an entity's publish/moderation outcomes (submitted, approved/rejected with the reviewer's message + category reasons, withdrawn, resubmitted) on the entity's workbench surface.
- As a creator, I can see each project entity's publish state at a glance (Draft / In review / Flagged / Published / Rejected) in the project entity list, and act on it (Publish / Withdraw / Unpublish) from the row dropdown.
- As a creator, I can see all my publish requests across every entity in one place (the global "My Publishing" page), filter by status, and jump from a row into that entity.
- As a creator, after a rejection I can edit and resubmit, and the new request is shown as a continuation of the same history (not an unrelated new row).
Behavior:
-
GET /api/publish-requests/entity/{type}/{uuid}returns the full request chain for an owned entity, most-recent-first, with the enriched DTO fields. - The enriched
PublishRequestDtoincludesrejectionCategories,withdrawnAt,priorRequestId,autoApproved,statusLabel. - Withdraw from the new surfaces succeeds at every active status — Pending(0), UnderReview(1),
Flagged(4) — and a moderator decision that committed first surfaces as
already_resolved. - A publish action from the project-list dropdown opens the
PublishControldialog (pre-check + now/schedule), never silently firing a moderation request. - Publishing is fully decoupled from the edit form's Save/Cancel —
PublicVisibilityToggleis removed from all 6 forms and no longer participates in form dirty-state.
Invariants that must stay true (carve-outs — verify a reviewer can break them if regressed):
- The creator-facing history and DTO never expose
flag_reason, AI signal scores, ormoderation_check_resultsdetail. (Break test: flag an entity via the pipeline, confirm the raw matched signal is absent from every creator response and the timeline.) - An entity with no publish history renders a clean Draft state + "not yet submitted" empty timeline — never an error or a blank panel.
- Publish/withdraw/unpublish actions are owner-gated on every surface; a project contributor who is not the entity owner sees state but no publish actions (they route through proposals).
- The admin moderation pipeline, queue, and
PipelineRunPanelbehavior are unchanged — this feature adds only a creator-facing read path over the same data.
Edges:
- Unauthorized / non-owner request to the entity-history endpoint returns 403/404 (no existence leak for entities the caller can't see).
- An entity mid-review (status 1) says a moderator is reviewing it and still offers Withdraw.
- A flagged entity shows the "waiting on a human reviewer" state and the edit-to-withdraw path, with no internal signal named.
- The global page paginates and renders an empty state for a creator with zero publish requests.
- Long reviewer messages / many rejection categories render without breaking the timeline layout; theme-compliant across themes; responsive at the shared breakpoints.