Content Moderation System
Relevant source files
The following files were used as context for generating this wiki page:
The Content Moderation System provides administrative tools to manage and review user-generated content for the Inkweave platform. It functions as a secure, private interface that interacts with the primary Inkweave database to ensure platform safety and compliance.
The system is hosted as a separate Vercel project, isolated from the public-facing application to maintain administrative security. It incorporates the main Inkweave repository as a Git submodule, allowing administrators to utilize shared data types and logic while maintaining a distinct deployment lifecycle.
Sources: README.md:3-6
Architecture and Deployment
The moderation system utilizes a secure infrastructure to protect administrative functions. All administrative routes reside behind a Vercel Authentication layer, ensuring only authorized personnel access the tools.
The diagram shows the isolation of admin tools from the public application and the shared dependency on the central database.
Sources: README.md:4-6, docs/PLAN.md:12-18
Security and Access Control
Access to the moderation dashboard requires successful Vercel login. The application code is stored in a private repository (inkweave-admin) to prevent public exposure of administrative logic and internal API structures.
Sources: README.md:1-5
Moderation Workflow
Moderators follow a standardized process to review and action content. The system tracks the state of each item from initial creation to final determination.
Content Lifecycle
When a user creates content in the public application, the moderation system flags items based on automated triggers or manual reports. The admin interface displays these items in a review queue.
| State | Description | Action Required |
|---|---|---|
| Pending | Content newly flagged or reported. | Review by Moderator |
| Approved | Content verified as compliant. | No further action |
| Rejected | Content violates terms and is hidden. | Removal or User Warning |
| Escalated | Content requires senior admin review. | Higher-level intervention |
Sources: docs/PLAN.md:20-35, src/lib/moderation-actions.ts:45-60
Moderation Logic Flow
The following sequence describes how the admin tool processes a moderation action.
This flow illustrates the synchronous communication between the admin interface and the database during a review session.
Sources: src/app/admin/moderation/page.tsx:50-85, src/lib/moderation-actions.ts:10-30
Implementation Details
Data Structures
The system relies on shared models defined in the upstream/inkweave submodule. Key moderation entities include the content ID, the moderator's UID, and a timestamped audit log.
| Field | Type | Description |
|---|---|---|
targetId | UUID | Unique identifier of the post or user being moderated. |
moderatorId | String | Vercel User ID of the administrator. |
actionType | Enum | The specific action taken (e.g., DELETE, WARN, BAN). |
reason | String | Textual justification for the action. |
timestamp | Date | The exact time the action was recorded. |
Sources: src/lib/moderation-actions.ts:80-100, CLAUDE.md:15-22
Coding Rules
Developers contributing to the moderation system must follow strict guidelines defined in the project rules. This includes:
- Atomic Actions: All moderation updates must be wrapped in database transactions to prevent partial state updates.
- Audit Logging: No content can be altered without a corresponding entry in the moderation log.
- Submodule Sync: Changes to data types must be first applied to
upstream/inkweavebefore being consumed by the admin tool.
Sources: CLAUDE.md:5-12, README.md:5
Summary
The Content Moderation System within inkweave-admin serves as the primary governance tool for the Inkweave platform. By leveraging Vercel's secure deployment and a Git submodule architecture, it maintains a robust separation of concerns between public user features and internal administrative functions. The system ensures platform integrity through structured workflows, mandatory audit trails, and strict implementation standards.