Skip to content

Nausmind/reddit-hackathon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

193 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CollabGuard + Semantic Sentry

A Reddit-native moderation workspace with semantic review, shared queue coordination, and human-confirmed workflows.

Reddit Devvit Chrome MV3 TypeScript and React

TypeScript, React, Vite, Node.js, Supabase

CollabGuard is a moderator-first collaboration system for Reddit communities. It combines a Devvit app for shared case review with a Chrome extension that surfaces evidence-backed semantic risk signals on Reddit. The system helps mod teams coordinate queue work, review difficult cases, send gentle reminders, escalate for consensus, and maintain audit trails.

It is not a strike system, auto-ban tool, autonomous enforcement bot, or replacement for human moderator judgment.


Product Preview

CollabGuard Devvit moderation dashboard

CollabGuard Devvit workspace
Shared queue, case details, voting, nudges, insights, audit history, and subreddit settings.

Semantic Sentry Chrome extension side panel

Semantic Sentry extension
Evidence-backed semantic review and queue handoff from Reddit into CollabGuard.


What This Repository Contains

Product Path Purpose
CollabGuard Devvit app collab-guard/ Main Reddit-native moderation workspace for queue review, claims, notes, voting, nudges, audit, settings, and Devvit menu workflows.
Semantic Sentry extension extension/ Chrome MV3 extension for in-context semantic review on Reddit and Supabase-backed handoff into CollabGuard.
Product and playtest docs docs/ Technical architecture, roadmap, menu action tests, Gentle Nudge tests, privacy policy, and terms.
Supabase bridge backend extension/supabase/ Edge Functions, migrations, and server-side semantic review / queue bridge infrastructure.

Core Capabilities

Capability CollabGuard Devvit Semantic Sentry Extension
Shared moderation queue Claim, release, prioritize, resolve, and audit queue items. Sends selected reviewed items into CollabGuard through pending queue actions.
Case collaboration Private notes, discussion, tags, case history, and status tracking. Adds semantic context and evidence before queue handoff.
Consensus review Start or reuse VoteCase workflows for hard cases. Can recommend escalation as a human-reviewed next step.
Gentle Nudge Preview, send, track, and review soft non-punitive reminders. Can queue nudge-oriented recommendations for moderators.
Insights Team activity, nudge outcomes, audit summaries, and workflow visibility. Supplies evidence-backed signals and bridge status.
Native Reddit UX Devvit dashboard, subreddit/post/comment menu actions, triggers, and scheduler jobs. Chrome side panel, comment chips, thread summaries, and Reddit DOM adapters.
Safety controls Mod-only routes, subreddit scoping, audit logs, delete cleanup, and no automatic enforcement. Opt-in scanning, evidence-required output, rate limits, and server-side secrets.

Architecture

flowchart LR
  subgraph Reddit["Reddit"]
    Posts["Posts and comments"]
    Menus["Devvit mod menus"]
  end

  subgraph Extension["Semantic Sentry Chrome Extension"]
    Adapter["Reddit DOM adapter"]
    Scanner["Scanner and cache"]
    Panel["React side panel"]
  end

  subgraph Supabase["Supabase Backend"]
    Edge["Edge Functions"]
    DB[("Postgres")]
    Pending[("pending_queue_actions")]
  end

  subgraph Devvit["CollabGuard Devvit App"]
    Dashboard["Moderator dashboard"]
    API["/api/* routes"]
    Internal["/internal/menu, /form, /triggers, /scheduler"]
    Redis[("Devvit Redis")]
  end

  Posts --> Adapter
  Adapter --> Scanner
  Scanner --> Panel
  Scanner --> Edge
  Edge --> DB
  Panel --> Pending
  Edge --> Pending
  Menus --> Internal
  Internal --> Redis
  API --> Redis
  Dashboard --> API
  Pending --> Internal
Loading

Data Flow

Step Flow Safety Boundary
1 Moderators review Reddit content in the extension or Devvit app. Features are moderator-oriented and subreddit-scoped.
2 Semantic Sentry scans opted-in Reddit surfaces and returns evidence-backed advisories. Provider calls happen server-side through Supabase Edge Functions.
3 A moderator chooses whether to send an item/action into CollabGuard. No one-click autonomous enforcement is enabled.
4 CollabGuard polls pending actions and records workflow state. Service-role keys stay server-side in Devvit settings.
5 Dashboard and menu actions expose claims, notes, nudges, votes, audit, and settings. State-changing routes require moderator context and write audit events.

CollabGuard Devvit App

Implemented workspace features include:

Area Status
Queue review Live queue, claim/release, stale claim expiry, filtering, sorting, and status updates.
Case details Notes, discussion, tags, reports, audit history, and sidebar actions.
Devvit menus Open case, view history, claim case, add note, send Gentle Nudge, start consensus review, resolve and log.
Gentle Nudge Config, preview, Shadow Mode, comment triggers, cooldowns, allowlist, watchlist, template overrides, feedback, history, and insights.
Voting Consensus review workflows with VoteCase reuse/creation and dashboard support.
Insights Mod Team Activity, nudge outcomes, queue metrics, and audit-derived workflow visibility.
Settings Subreddit config load/save, setup wizard support, digest settings, nudge controls, watchlist editor, and template customization.
Compliance Post/comment delete cleanup, account-deletion cleanup route, privacy policy, terms, and no Reddit-data training policy.

Quick commands:

cd collab-guard
npm install
npm run type-check
npm run lint
npm run test
npm run build
npm run dev

Playtest URL for the current app name:

https://www.reddit.com/r/ModQueueLab/?playtest=gu-steph

Semantic Sentry Extension

Implemented extension features include:

Area Status
Reddit scanning Comment and post scanning with cache and visibility controls.
Evidence policy Multi-layer evidence requirement across prompt, schema, sanitizer, DB, and UI.
Side panel Advisory card, thread context, filters, settings, queue handoff, and bridge feedback.
Supabase backend Edge Functions for scans, post scans, settings, health score, policies, verdict loading, enqueue, undo, status, and escalations.
CollabGuard bridge Pending queue actions consumed by the Devvit scheduler.
Packaging Chrome MV3 build in extension/dist/.

Quick commands:

cd extension
npm install
npm run type-check
npm run lint
npm run test
npm run build

Load locally:

  1. Open chrome://extensions.
  2. Enable Developer mode.
  3. Click Load unpacked.
  4. Select extension/dist/.

Configuration Overview

Config Where It Lives Notes
VITE_SUPABASE_URL extension/.env.local Browser-safe Supabase project URL.
VITE_SUPABASE_PUBLISHABLE_KEY extension/.env.local Browser-safe publishable key only.
VERTEX_API_KEY Supabase Edge Function secret Server-side model provider key; never bundled into the extension.
COLLAB_GUARD_SUPABASE_URL Devvit setting Supabase URL used by CollabGuard bridge polling.
COLLAB_GUARD_SUPABASE_SERVICE_ROLE_KEY Devvit setting Server-only Supabase service role key; never committed or exposed to client code.
permissions.http.domains collab-guard/devvit.json Must include the Supabase host that CollabGuard calls.

If Devvit reports HTTP request to domain ... is not allowed, verify that the Supabase URL host exactly matches collab-guard/devvit.json -> permissions.http.domains, then upload/playtest the updated Devvit app.


Verification

CollabGuard

cd collab-guard
npm run type-check
npm run test
npm run lint
npm run build

Extension

cd extension
npm run type-check
npm run test
npm run lint
npm run build

Supabase Edge Functions

cd extension
deno test --allow-all --config=supabase/functions/deno.json supabase/functions/

Safety and Compliance Position

Principle Implementation
Human-controlled moderation Moderators review and confirm workflow actions.
No auto-ban / no autonomous punishment The system does not automatically ban, remove, lock, approve, report, DM, or punish users.
Evidence-backed advisories Semantic Sentry drops labels that do not include evidence.
Subreddit scoping CollabGuard stores config and workflow state per subreddit.
Moderator-only workflows Dashboard APIs, menu actions, settings, notes, voting, and audit views are mod-gated.
Data minimization Nudge and audit records avoid storing full Reddit bodies where not needed.
Deleted content cleanup Devvit post/comment delete triggers remove item-scoped CollabGuard data.
Account deletion cleanup A server route removes or anonymizes deleted-user references where Devvit provides account deletion context.
Optional AI policy Optional Gemini/OpenAI-style features must use approved providers and must not train on Reddit data.

Documentation

Document Purpose
CollabGuard README Devvit app setup, bridge settings, and workspace details.
Extension README Chrome extension architecture, setup, and packaging.
Extension Setup Supabase and provider setup.
Extension Testing Manual and automated extension test plan.
Technical Spec System architecture and implementation notes.
Implementation Roadmap Feature status and launch readiness.
Menu Actions Playtest Devvit menu workflow playtest checklist.
Gentle Nudge Playtest Gentle Nudge and dashboard playtest checklist.
Terms of Service Devvit review readiness and app terms.
Privacy Policy Data use, deletion cleanup, and optional provider policy.

Repository Layout

reddit-hackathon/
├── collab-guard/          # Reddit Devvit app
├── extension/             # Chrome MV3 extension and Supabase backend
├── docs/                  # Product, technical, playtest, privacy, and terms docs
├── supabase/              # Shared/root Supabase migration artifacts
├── README.md
└── LICENSE

Project Status

This repository is in active hackathon development and playtesting. The main path is production-oriented for moderator workflows, but live validation should still be performed in r/ModQueueLab after Devvit uploads, Supabase deploys, extension builds, or allowlist changes.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages