Skip to content

DB (DOS.Me): give.campaign_comments table, one-level reply/moderation RPCs & reporting for #250 #262

Closed

Description

@JOY

Goal

Provide the DOS/DOS.Me database migration, RLS, SECURITY DEFINER RPCs, and pgTAP tests needed by DOS/Give#250 (Campaign comments with one reply level and moderation, line:campaigns). Per docs/product-owner-config.md, DOS/DOS.Me migrations belong to line:platform (Give Product Owner).

Requirements (DOS/DOS.Me)

  1. give.campaign_comments:
    • id uuid PK, campaign_id uuid NOT NULL REFERENCES give.campaigns(id), author_id uuid NOT NULL REFERENCES auth.users(id), parent_id uuid NULL REFERENCES give.campaign_comments(id) (enforcing at most one reply level: parent must belong to the same campaign_id and have parent_id IS NULL), body text NOT NULL (trimmed non-empty, length cap e.g. <= 2000), status text NOT NULL CHECK (status IN ('visible','hidden')), hidden_by uuid NULL, hidden_role text NULL, created_at timestamptz, edited_at timestamptz NULL.
    • RLS enabled; raw author_id / hidden_by protected per Give's privacy rules.
  2. Read & Write RPCs:
    • Public/signed-in read RPC (e.g. give.list_campaign_comments(p_campaign_id uuid, ...)): returns visible comments/replies on public campaigns (live and ended statuses) with display author name/avatar, is_organizer boolean, is_author boolean (auth.uid() = author_id), created_at, edited_at; moderators also see hidden comments and who hid what (audit_log).
    • Signed-in write RPCs with per-user rate limit: create comment/reply (on live and ended public campaigns), edit own comment, delete own comment, organizer hides comment on own campaign, moderator hides/unhides any comment (logged to give.audit_log).
    • Report a comment: reuse/extend give.campaign_reports (#207) or add comment report target + moderator action RPC.
  3. pgTAP tests: one-reply-level constraint, rate limit, body cap, guest write refusal, author edit/delete, organizer hide on own campaign only, moderator hide + audit_log, and comment reporting.

Once merged to DOS/DOS.Me dev, please comment on DOS/Give#250 with the exact RPC signatures and GIVE_* error codes.

Activity

  1. added
    po:agyOwned by Antigravity PO (mutual-exclusion parallel PO label)
    on Nov 18, 2026
  2. JOY commented on Nov 21, 2026

    @JOY
    ContributorAuthor

    claim: executor=Antigravity session=e194b52b-8b3a-491d-964a-f8f5e0092113 scope="DOS/DOS.Me give.campaign_comments migration + pgTAP" branch=antigravity/give-262-campaign-comments target=2026-11-22

  3. JOY commented on Nov 21, 2026

    @JOY
    ContributorAuthor

    checkpoint: session=e194b52b-8b3a-491d-964a-f8f5e0092113 PR=https://github.com/DOS/DOS.Me/pull/1853 sha=87886bd4a9fe3d092bce4cd9348cd3dce702607f status="In review" — Migration 20261129110000_give_campaign_comments.sql and 148/148 pgTAP tests pass locally (fresh replay + idempotent second replay + regression suites + fresh-context security review CLEAN_PASS). Waiting for DOS.Me CI checks and automated review.

  4. JOY commented on Nov 21, 2026

    @JOY
    ContributorAuthor

    PO acceptance: merge at e5f39af9dd782099f1395673f30b161d1352ca96 (DOS/DOS.Me#1853 -> dev)

  5. JOY commented on Nov 21, 2026

    @JOY
    ContributorAuthor

    checkpoint: session=e194b52b-8b3a-491d-964a-f8f5e0092113 PR=https://github.com/DOS/DOS.Me/pull/1853 merged_to=dev merge_commit=3b083257db79b16803180ebbfc5b6ed5e83b011c preview="Supabase Preview (Beta oyajkbadsykigtfrpdpg) SUCCESS" — Migration supabase/migrations/20261129150000_give_campaign_comments.sql and pgTAP supabase/tests/database/give_campaign_comments.test.sql (171/171 PASS in CI Give pgTAP tests (dev)) landed on DOS/DOS.Me dev and deployed cleanly to Supabase Beta (https://supabase.com/dashboard/project/oyajkbadsykigtfrpdpg). Exact RPC signatures and GIVE_* error codes posted on #250 (#250 (comment)).

  6. JOY commented on Nov 21, 2026

    @JOY
    ContributorAuthor

    handoff: session=e194b52b-8b3a-491d-964a-f8f5e0092113 to=83b36fa6-8c08-49d6-aeec-63bab02a5e52
    Done: Squashed and merged https://github.com/DOS/DOS.Me/pull/1853 into DOS/DOS.Me dev at merge commit 3b083257db79b16803180ebbfc5b6ed5e83b011c (supabase/migrations/20261129150000_give_campaign_comments.sql and supabase/tests/database/give_campaign_comments.test.sql). Posted exact RPC signatures, return shapes, and GIVE_* error codes on DOS/Give#250 (#250 (comment)). Removed local worktree and branch cleanly.
    Evidence: Required PR checks on e5f39af9dd782099f1395673f30b161d1352ca96 all green (Supabase migration replay (dev), Give pgTAP tests (dev) 171/171 PASS, Repository integrity, Validate pnpm lockfile); post-merge Supabase Preview (Beta oyajkbadsykigtfrpdpg, https://supabase.com/dashboard/project/oyajkbadsykigtfrpdpg) and Beta migration history preparation only COMPLETED/SUCCESS on 3b083257db79b16803180ebbfc5b6ed5e83b011c.
    Remaining: Production promotion (DOS/DOS.Me dev -> main with owner approval, handled exclusively by Claude PO Give Product Owner). Issue kept OPEN until Production deploy.
    Next step: Campaigns PO can dispatch DOS/Give#250 against Beta (oyajkbadsykigtfrpdpg); Claude PO promotes 20261129150000_give_campaign_comments.sql to Production main in the next coordinated release.
    Blockers: none for DOS/Give#250 on Beta; Production promotion awaits Claude PO release window + JOY approval.
    Branch: antigravity/give-262-campaign-comments (merged and deleted; DOS/DOS.Me dev at 3b083257db79b16803180ebbfc5b6ed5e83b011c).

  7. JOY commented on Nov 21, 2026

    @JOY
    ContributorAuthor

    claim: executor=Antigravity session=83b36fa6-8c08-49d6-aeec-63bab02a5e52 scope="Production steps, waiting for Claude PO (Give Product Owner) DOS/DOS.Me#1853 dev -> main promotion" branch=antigravity/give-262-campaign-comments target=2026-11-28

  8. JOY commented on Nov 21, 2026

    @JOY
    ContributorAuthor

    checkpoint: session=83b36fa6-8c08-49d6-aeec-63bab02a5e52 waiting for DOS/DOS.Me dev -> main Production promotion by Give Product Owner (Claude Code) after JOY approval; DOS/DOS.Me#1853 merged at 3b083257db79b16803180ebbfc5b6ed5e83b011c and verified on Supabase Preview (Beta). Unblocked #250.

  9. JOY commented on Nov 22, 2026

    @JOY
    ContributorAuthor

    done: session=83b36fa6-8c08-49d6-aeec-63bab02a5e52
    Promoted to Production and verified live:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    line:platformProduct line: platformpo:agyOwned by Antigravity PO (mutual-exclusion parallel PO label)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions