Skip to content

feat(agent,admin): alert pending map node moderators#12

Merged
Oba-One merged 2 commits into
mainfrom
codex/prd-622-map-moderation
Jul 12, 2026
Merged

feat(agent,admin): alert pending map node moderators#12
Oba-One merged 2 commits into
mainfrom
codex/prd-622-map-moderation

Conversation

@Oba-One

@Oba-One Oba-One commented Jul 11, 2026

Copy link
Copy Markdown
Member

Summary

  • Queue privacy-safe, idempotent Resend alerts and daily reminders for moderated map-node submissions.
  • Add Directus approval and failed-alert queues with role-scoped access, plus a self-cleaning approval-audit smoke test.
  • Preserve uncapped live-session onboarding while keeping honeypot and daily IP protection for moderated intake.

Validation

  • bun run typecheck
  • bun run test:agent
  • bun run test:content
  • bun run test:map-nodes
  • bun run agentic:check
  • bun run build
  • Local migration 019_map_node_moderation_notifications.sql and Directus content/Studio setup
  • bun run directus:steward:smoke
  • bun run directus:map-moderation:smoke

Linear: PRD-622

@Oba-One Oba-One added the automated/codex Created by Codex automation label Jul 11, 2026
@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ba91e11f-a21c-46fe-a61b-9fe7854a71a8

📥 Commits

Reviewing files that changed from the base of the PR and between 0deb62a and f255cf0.

📒 Files selected for processing (19)
  • .env.example
  • README.md
  • package.json
  • packages/admin/README.md
  • packages/agent/fly.toml
  • packages/agent/migrations/019_map_node_moderation_notifications.sql
  • packages/agent/src/map-node-moderation.ts
  • packages/agent/src/map-nodes.ts
  • packages/agent/src/server.ts
  • packages/website/src/components/page-sections/HomeMap.astro
  • scripts/agent-contract.test.ts
  • scripts/directus-map-moderation-smoke.ts
  • scripts/directus-operational-content-setup.ts
  • scripts/directus-studio-setup.test.ts
  • scripts/directus-studio-setup.ts
  • scripts/map-node-contract.test.ts
  • scripts/map-node-moderation-delivery.ts
  • scripts/map-node-moderation.test.ts
  • scripts/public-content-contract.test.ts

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added moderated map-node intake with daily IP limits and bot protection.
    • Added automated moderator email alerts and daily pending-approval reminders.
    • Added Directus links, approval tracking, retry handling, and moderation bookmarks.
    • Restricted alerts and moderation views to review-safe information.
  • Documentation

    • Documented moderated onboarding behavior, permissions, and operational procedures.
  • Tests

    • Added coverage for moderation delivery, access controls, rate limits, and sensitive-data protection.

Walkthrough

Map-node intake now supports moderated submissions with anti-abuse checks, durable notification delivery, Resend alerts, Directus moderation workflows, role-limited access, and operational tests and commands.

Changes

Map Node Moderation

Layer / File(s) Summary
Notification queue and delivery
packages/agent/migrations/..., packages/agent/src/map-node-moderation.ts
Adds the notification queue schema, moderation email generation, Resend delivery, retry lifecycle, daily digests, and deferred delivery.
Moderated intake and sweep wiring
packages/agent/src/map-nodes.ts, packages/agent/src/server.ts, packages/website/src/components/page-sections/HomeMap.astro
Adds honeypot validation, moderated-mode IP limits, notification enqueueing, website form capture, and scheduled moderation delivery.
Directus permissions and Studio setup
scripts/directus-operational-content-setup.ts, scripts/directus-studio-setup.ts, scripts/directus-map-moderation-smoke.ts
Configures restricted notification access, collection metadata, moderation bookmarks, status fields, and an end-to-end permission and audit check.
Scripts, tests, and operational documentation
.env.example, README.md, packages/admin/README.md, package.json, scripts/*
Adds configuration, delivery and smoke-test commands, contract coverage, email safety tests, and moderated-mode documentation.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant HomeMap
  participant NetworkAgent
  participant NotificationQueue
  participant Resend
  participant Directus
  HomeMap->>NetworkAgent: Submit map node
  NetworkAgent->>NotificationQueue: Store pending submission notification
  NetworkAgent->>Resend: Send moderator alert
  Resend-->>NetworkAgent: Return delivery result
  NetworkAgent->>Directus: Link moderator to submission record
  Directus-->>NetworkAgent: Approve or reject submission
Loading

Poem

I’m a rabbit with a tidy queue,
Alerting stewards when nodes are new.
Through Directus paths and Resend flight,
Pending maps hop toward review light.
Safe fields travel; secrets stay tight.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/prd-622-map-moderation

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.

@Oba-One Oba-One marked this pull request as ready for review July 12, 2026 00:32
@Oba-One Oba-One merged commit 421ae17 into main Jul 12, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated/codex Created by Codex automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant