Problem
Architecture spec devvit-migration/docs/04-architecture.md:246 (§3, "Execution Model Decision") specifies the onModAction trigger:
does NOT call getModerationLog and does NOT publish. Cheap, idempotent, self-loop-safe.
The shipped trigger contradicts this:
devvit/src/main.ts:174-191 — the ModAction trigger calls ingest(reddit, redis, cfg) on every single mod action.
devvit/src/modlog.ts:219-246 — ingest unconditionally calls fetchActions.
devvit/src/modlog.ts:191-202 — fetchActions issues reddit.getModerationLog({ subredditName, limit: cfg.fetchLimit, pageSize: 100 }).all(), a full listing re-fetch, not an incremental single-event ingest.
This means every moderation action on the subreddit triggers a full moderation-log re-fetch, not the cheap dirty-flag-only path the architecture decision describes. Also contradicts NFR-6 (devvit-migration/docs/01-requirements.md:149) which bounds normal-run cost assuming incremental ingest; a full re-fetch per action multiplies read-API load under active moderation and doesn't scale the way the architecture doc assumed when making the cron-primary/trigger-ingest tradeoff.
Fix
Either:
- Make the trigger truly incremental — extract/dedup/persist the single
ModAction event payload directly (no getModerationLog call), matching architecture §3's stated design, or
- If a full re-fetch on every trigger is intentional, update
04-architecture.md §3 to reflect that and re-evaluate whether the cron-primary design still holds (it was chosen partly because the trigger was assumed cheap).
References
PR #34 (feat/devvit-migration), devvit-migration/docs/STATUS.md §7b.
Problem
Architecture spec
devvit-migration/docs/04-architecture.md:246(§3, "Execution Model Decision") specifies theonModActiontrigger:The shipped trigger contradicts this:
devvit/src/main.ts:174-191— theModActiontrigger callsingest(reddit, redis, cfg)on every single mod action.devvit/src/modlog.ts:219-246—ingestunconditionally callsfetchActions.devvit/src/modlog.ts:191-202—fetchActionsissuesreddit.getModerationLog({ subredditName, limit: cfg.fetchLimit, pageSize: 100 }).all(), a full listing re-fetch, not an incremental single-event ingest.This means every moderation action on the subreddit triggers a full moderation-log re-fetch, not the cheap dirty-flag-only path the architecture decision describes. Also contradicts NFR-6 (
devvit-migration/docs/01-requirements.md:149) which bounds normal-run cost assuming incremental ingest; a full re-fetch per action multiplies read-API load under active moderation and doesn't scale the way the architecture doc assumed when making the cron-primary/trigger-ingest tradeoff.Fix
Either:
ModActionevent payload directly (nogetModerationLogcall), matching architecture §3's stated design, or04-architecture.md§3 to reflect that and re-evaluate whether the cron-primary design still holds (it was chosen partly because the trigger was assumed cheap).References
PR #34 (
feat/devvit-migration),devvit-migration/docs/STATUS.md§7b.