Skip to content
Draft
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
22 changes: 22 additions & 0 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,33 @@ reviews:
poem: false
review_status: true
collapse_walkthrough: false
path_filters:
- "!devvit/dist/**"
- "!devvit/node_modules/**"
- "!**/package-lock.json"
path_instructions:
- path: "*.py"
instructions: |
Review for security issues — validate all user inputs.
Check for proper error handling and logging.
- path: "devvit/src/**/*.ts"
instructions: |
Devvit (Reddit Developer Platform) app. Enforce the migration invariants:
moderator names must always be anonymized (INV-1, never a real name);
only post/comment permalinks may be linked, never user profiles (INV-2);
removal-reason text must be email-censored and pipe-escaped (INV-4);
wiki content must stay under the 512KB cap (INV-3); the content hash used
for skip-if-unchanged must exclude volatile data like the Last Updated
timestamp (INV-6); ingest must be idempotent/deduped since there is no
daemon (INV-5). Verify Devvit API usage (reddit.getModerationLog,
get/updateWikiPage, context.redis, scheduler) and flag any unvalidated
// TODO(devvit-api) call. Prefer type-safe, injected clients over globals.
- path: "devvit/test/**/*.ts"
instructions: |
Offline mock-Reddit test harness. Check that the security invariants
(anonymize, no profile links, PII strip, dedup, retention, hash-skip)
are actually asserted, and that mocks faithfully match the real Devvit
API shapes they stand in for.
- path: ".github/workflows/**"
instructions: |
Check for command injection via untrusted GitHub context variables.
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

Automatically publishes Reddit moderation logs to a subreddit wiki page with modmail inquiry links.

> **🧪 Devvit migration in progress.** A re-platform of this bot to a Reddit-hosted [Devvit](https://developers.reddit.com/) app (no self-hosting, no bot password, no SQLite) is being scaffolded under [`devvit/`](devvit/) with requirements, research, and architecture docs in [`devvit-migration/docs/`](devvit-migration/). The Python app documented below remains the supported version. See [`devvit-migration/README.md`](devvit-migration/README.md) for status.

## Features

* 📊 Publishes modlogs as organized markdown tables with unique content tracking IDs
Expand Down
30 changes: 30 additions & 0 deletions devvit-migration/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# RedditModLog → Devvit Migration

Re-platforming the Python/PRAW **Reddit Modlog Wiki Publisher** into a **Devvit** app that runs on Reddit's Developer Platform — no self-hosted daemon, no bot-password credential, no SQLite. The published wiki output and its transparency/privacy guarantees stay recognizably identical.

**Feasibility: confirmed.** Devvit provides every primitive the bot needs:

| Python (PRAW) | Devvit equivalent |
| --- | --- |
| `subreddit.mod.log(limit=N)` | `reddit.getModerationLog({ subredditName, type?, limit })` |
| `subreddit.wiki[page].edit()` | `reddit.getWikiPage` / `reddit.updateWikiPage` (512 KB cap unchanged) |
| SQLite dedup + retention + hash-cache | `context.redis` (strings for dedup, sorted-set by timestamp for retention, hash for wiki-hash cache) |
| Continuous daemon (`update_interval`) | `Devvit.addSchedulerJob` + cron (1-min min granularity) + optional `onModAction` trigger |
| `config.json` / env / CLI (19 options) | Devvit app + per-install settings (`anonymize_moderators` hardcoded true) |
| Docker / s6 / systemd | Reddit-hosted (serverless, free); publish via app review |

## Layout

- [`docs/01-requirements.md`](docs/01-requirements.md) — product requirements, feature-parity matrix (MoSCoW), risk register, MVP acceptance criteria
- [`docs/02-research-api-shapes.md`](docs/02-research-api-shapes.md) — exact Devvit Reddit-API signatures (`getModerationLog`, `ModAction`, wiki) with Python→Devvit field mapping
- [`docs/03-research-platform.md`](docs/03-research-platform.md) — Redis data model, scheduler/trigger, settings, webview/UI, publishing & limits
- [`docs/04-architecture.md`](docs/04-architecture.md) — module layout, Redis key schema, execution model, settings schema, phased plan, gap list
- [`docs/STATUS.md`](docs/STATUS.md) — what is scaffolded vs. TODO, mapped to the parity matrix
- [`docs/reddit-api/`](docs/reddit-api/) — stored Devvit API reference snippets
- [`../devvit/`](../devvit/) — the Devvit app scaffold (TypeScript; compiles clean via `tsc --noEmit`)

## Status

Scaffold stage: requirements + research + architecture complete; component modules (`storage`, `modlog`, `render`, `wiki`, `settings`, `menu`, `main`) written and type-checking clean. Not yet `devvit upload`-tested against a live test subreddit. See [`docs/STATUS.md`](docs/STATUS.md).

This scaffold was produced by a multi-agent scrum (requirements → research → architecture → per-component implementation → scaffold). Treat the generated TypeScript as a reviewed starting point, not a shipped app — every Devvit API call should be validated in `devvit playtest` before publishing.
Loading
Loading