Skip to content

Moderator content-correction endpoint - #253

Merged
admdly merged 2 commits into
mainfrom
moderator-correct
Sep 23, 2026
Merged

admdly merged 2 commits into
mainfrom
moderator-correct

Conversation

@admdly

@admdly admdly commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Implements the moderator content-correction workflow decided in #251 (option b: direct overwrite as auto-approved revision).

  • New POST /extensions/{id}/moderator-correct (requireModerator, tag Moderation): body is ExtensionUpdateSchema + required correction_note (1–2000 chars). No ?notify query and no mail path — the correction is recorded in revision history only.
  • New ExtensionsDatabase.moderatorCorrect() next to delist()/relist(): one D1 batch() inserting an approved revision row (submitted_by/reviewer_id = moderator, epoch carried over) then publishing gated on changes() = 1. Guards: published, listed, no pending revision (409 — approve/reject first, no supersede), active moderator. Ownership columns and published_at untouched; revalidateCatalogue() on success.
  • Docs: lifecycle bullet plus a "Correcting Live Content" section (moderator-edit vs ask-author-resubmit vs D1 break-glass).
  • Tests: moderation-correct.test.ts (12 cases: auth, mid-request deactivation, 404, 409 ×3, 422 ×2, audit/ownership assertions, case-insensitive id, full owner-flow history) + revalidate purge test. Full v2 suite: 345 passed, tsc clean.

Closes #251.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-09-23T22:43:37.789736Z c35aa92 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@admdly admdly self-assigned this Sep 23, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 5 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/services/extensions/v2/db/extensions.ts Outdated
Comment thread test/services/extensions/v2/moderation-correct.test.ts
Comment thread test/services/extensions/v2/moderation-correct.test.ts

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0 issues found across 2 files (changes from recent commits).

Auto-approved: Adds a moderator-only content-correction endpoint that overwrites live extension content as an approved revision, with guards, docs, and tests. The change is additive, moderator-gated, audited in revision history, and does not alter existing behavior.

Re-trigger cubic

@admdly
admdly merged commit 4eab6eb into main Sep 23, 2026
9 checks passed
@admdly
admdly deleted the moderator-correct branch September 23, 2026 22:52
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.

Moderator content-correction workflow for Extensions directory

1 participant