Skip to content

feat(devvit): scaffold Reddit Devvit migration groundwork - #34

Merged
bakerboy448 merged 4 commits into
mainfrom
feat/devvit-migration
Sep 21, 2026
Merged

bakerboy448 merged 4 commits into
mainfrom
feat/devvit-migration

Conversation

@bakerboy448

Copy link
Copy Markdown
Collaborator

What

Re-platform groundwork for moving RedditModLog from a self-hosted PRAW daemon to a Reddit-hosted Devvit app — no self-hosting, no bot password, no SQLite. Produced by a multi-agent scrum (requirements → research → architecture → per-component implementation → scaffold).

Feasibility: confirmed. Devvit provides every primitive the bot uses: getModerationLog, get/updateWikiPage, Redis (replaces SQLite), scheduler cron + onModAction trigger, app/install settings.

Contents

  • devvit-migration/docs/ — requirements + feature-parity matrix (MoSCoW), two research reports (exact Devvit API shapes + Python→Devvit field mapping; Redis model, scheduler, settings, UI, publishing/limits), architecture (module layout, Redis key schema, execution model, gap list), STATUS, stored API reference.
  • devvit/ — TypeScript Devvit app scaffold (storage, modlog, render, wiki, settings, menu, main + types). Type-checks clean (tsc --noEmit, 0 errors).
  • README migration callout. Invariants preserved by design: anonymize-moderators (hardcoded), no user-profile links, 512KB wiki cap, dedup idempotency (no daemon).

Status — WIP / not shippable yet

Scaffold + design only. Not yet devvit playtest-validated against a live test subreddit. Every Devvit API call is a reviewed best-effort and must be verified in playtest before publishing. The existing Python app is untouched and remains supported. See devvit-migration/docs/STATUS.md.

🤖 Generated with Claude Code

…itecture + compiling TS app)

Re-platform groundwork for moving RedditModLog from a self-hosted PRAW daemon
to a Reddit-hosted Devvit app. Feasibility confirmed: getModerationLog,
get/updateWikiPage, Redis (replaces SQLite), scheduler cron + onModAction
trigger, and app settings cover every primitive the bot uses.

- devvit-migration/docs/: requirements + feature-parity matrix, two research
  reports (exact Devvit API shapes; Redis model + scheduler + settings + UI),
  architecture (module layout, Redis key schema, execution model, gap list),
  STATUS, and stored Reddit API reference
- devvit/: TypeScript app scaffold (storage, modlog, render, wiki, settings,
  menu, main + types) — type-checks clean (tsc --noEmit, 0 errors)
- README: migration callout; anonymize-moderators invariant + 512KB cap +
  no-user-profile-links preserved by design

Produced by a multi-agent scrum (requirements -> research -> architecture ->
per-component implementation -> scaffold). Generated TS is a reviewed starting
point; every Devvit API call must be validated in devvit playtest before publish.

Existing Python app is untouched and remains the supported version.
@coderabbitai

coderabbitai Bot commented Jun 24, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository: baker-scripts/RedditModLog/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 1199d505-ab92-4406-b714-c67fabe825a1

📥 Commits

Reviewing files that changed from the base of the PR and between aef6a2e and c52a910.

⛔ Files ignored due to path filters (1)
  • devvit/package-lock.json is excluded by !**/package-lock.json, !**/package-lock.json
📒 Files selected for processing (25)
  • .coderabbit.yaml
  • README.md
  • devvit-migration/README.md
  • devvit-migration/docs/01-requirements.md
  • devvit-migration/docs/02-research-api-shapes.md
  • devvit-migration/docs/03-research-platform.md
  • devvit-migration/docs/04-architecture.md
  • devvit-migration/docs/STATUS.md
  • devvit-migration/docs/reddit-api/getModerationLog.md
  • devvit/.gitignore
  • devvit/README.md
  • devvit/devvit.yaml
  • devvit/package.json
  • devvit/src/main.ts
  • devvit/src/menu.ts
  • devvit/src/modlog.ts
  • devvit/src/render.ts
  • devvit/src/settings.ts
  • devvit/src/storage.ts
  • devvit/src/types.ts
  • devvit/src/wiki.ts
  • devvit/test/fixtures.ts
  • devvit/test/mocks.ts
  • devvit/test/pipeline.test.ts
  • devvit/tsconfig.json
 _________________________________________________
< If you only knew now what you didn't know then. >
 -------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

A self-contained vitest harness (in-memory Redis + mock Reddit client +
fixtures) runs the real compiled pipeline offline — no Devvit auth needed —
covering ingest/filter, anonymize (INV-1), no-profile-links (INV-2), PII strip
(INV-4), retention, and hash-skip (INV-6). It surfaced two real bugs, now fixed:

- modlog.ts: ignored-moderator match was case-sensitive, so a lowercased
  ignore list (or mixed-case mod name) silently leaked ignored mods (e.g.
  AutoModerator) into the public wiki. Now case-insensitive (INV-8).
- render.ts: contentHash hashed the volatile 'Last Updated' timestamp, so the
  INV-6 skip never triggered and the wiki would be rewritten every cron run.
  Hash now excludes that line (mirrors the Python prod hotfix).
- fix pre-commit trailing-whitespace failure in a generated research doc
- .coderabbit.yaml: add review instructions for devvit/src + devvit/test
  (enforce the migration invariants, validate Devvit API usage) and exclude
  generated/vendored paths (devvit/dist, node_modules, package-lock)
STATUS.md marked essentially everything DONE, but FR-7 (combined
removal+reason rows) and FR-8 (conditional approval rows) are not
implemented anywhere in the pipeline, verified by executing the compiled
render/modlog modules. Also documents 3 other unresolved gaps found in
review: the classic-vs-Devvit-Web platform contradiction, the
onModAction trigger re-fetching the full moderation log instead of the
cheap dirty-flag path architecture §3 specifies, and an undisclosed
hash-skip behavior change vs the legacy Python implementation.

Filed #60, #61, #62 for the 3 HIGH items.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013tWLY4bQsLys38ekHnK8LS
@bakerboy448
bakerboy448 marked this pull request as ready for review September 21, 2026 19:31
@bakerboy448 bakerboy448 changed the title feat(devvit): scaffold Reddit Devvit migration (WIP) feat(devvit): scaffold Reddit Devvit migration groundwork Sep 21, 2026
@bakerboy448
bakerboy448 merged commit de487a5 into main Sep 21, 2026
4 of 5 checks passed
@bakerboy448
bakerboy448 deleted the feat/devvit-migration branch September 21, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant