Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .DS_Store
Binary file not shown.
377 changes: 167 additions & 210 deletions .gitignore

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions collab-guard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,28 +125,28 @@ If Gentle Nudge is enabled, create a mild low-effort test comment and confirm:

CollabGuard's AI features are advisory by default. They help moderators see what the model reviewed, what it suggested, why a guardrail skipped work, and where a human should make the final call. The AI Activity page reads from the same subreddit-scoped audit log as the rest of the workspace, so demo reviewers do not need terminal logs to understand what happened.

### Provider setup
### Provider setup (moderators — recommended)

Choose one provider for playtest. Gemini is the default when `AI_PROVIDER` is not set.
On a subreddit where CollabGuard is installed:

```bash
npx devvit settings set GEMINI_API_KEY
# enter: your Gemini API key
1. Open **mod tools** on the subreddit (⋯ menu).
2. Choose **Set AI API Keys**.
3. Select **Gemini** or **OpenAI**, paste the key, confirm write-only storage, and **Save**.

npx devvit settings set OPENAI_API_KEY
# enter: your OpenAI API key, if using OpenAI instead
Keys are stored **per subreddit in Redis** (write-only). Other moderators cannot read an existing key; they can only replace it. Then enable features in **Settings → AI Mod Tool** in the dashboard.

npx devvit settings set AI_PROVIDER
# enter: gemini or openai
### Provider setup (app developer fallback)

npx devvit settings set AI_VIOLATION_THRESHOLD
# optional: 0-10 score threshold for high-risk advisory flags, default 7
Optional global fallback for playtest (shared across installations):

```bash
npx devvit settings set GEMINI_API_KEY
npx devvit settings set OPENAI_API_KEY
npx devvit settings set AI_PROVIDER # gemini or openai
npx devvit settings list
# verify the settings are present
```

Do not commit provider keys. Devvit settings are stored by the platform, and the external AI domains are already allow-listed in `devvit.json`.
Subreddit Redis keys take precedence over Devvit global settings. Do not commit provider keys.

### Dashboard setup

Expand Down
14 changes: 11 additions & 3 deletions collab-guard/devvit.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://developers.reddit.com/schema/config-file.v1.json",
"name": "cgbaov2",
"name": "collab-guard-",
"post": {
"dir": "dist/client",
"entrypoints": {
Expand Down Expand Up @@ -84,14 +84,22 @@
"location": "subreddit",
"forUserType": "moderator",
"endpoint": "/internal/menu/open-settings"
},
{
"label": "CollabGuard: Set AI API Keys",
"description": "Store a Gemini or OpenAI key for this subreddit (write-only; mods cannot read it back).",
"location": "subreddit",
"forUserType": "moderator",
"endpoint": "/internal/menu/set-ai-api-keys"
}
]
},
"forms": {
"addCaseNote": "/internal/form/add-case-note",
"sendGentleNudge": "/internal/form/send-gentle-nudge",
"startConsensusReview": "/internal/form/start-consensus-review",
"resolveAndLog": "/internal/form/resolve-and-log"
"resolveAndLog": "/internal/form/resolve-and-log",
"setAiApiKeys": "/internal/form/set-ai-api-keys"
},
"triggers": {
"onAppInstall": "/internal/triggers/on-app-install",
Expand Down Expand Up @@ -177,6 +185,6 @@
}
},
"dev": {
"subreddit": "ModQueueLab"
"subreddit": "collab_guard__dev"
}
}
2 changes: 1 addition & 1 deletion collab-guard/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"private": true,
"name": "kim-chi-ngon-lam",
"name": "collab-guard-",
"version": "0.0.0",
"license": "BSD-3-Clause",
"type": "module",
Expand Down
Loading