Skip to content

DB (DOS.Me): privacy-safe daily campaign view/referrer/share counters & analytics RPC for #252 #263

Closed

Description

@JOY

Goal

Provide the DOS/DOS.Me database migration, RLS, RPCs, and pgTAP tests needed by DOS/Give#252 (Organizer analytics: views, referrers and conversion per campaign, line:campaigns). Per docs/product-owner-config.md, DOS/DOS.Me migrations belong to line:platform (Give Product Owner).

Requirements (DOS/DOS.Me)

  1. Privacy-safe aggregate storage (zero PII):
    • No IP addresses, no user_id, no browser fingerprints stored.
    • Daily per-campaign counters by metric/referrer host bucket (direct, facebook.com, zalo, google, other) + daily share_clicks counter on public campaigns.
  2. Write & Read RPCs:
    • service_role write RPC (e.g. give.record_campaign_event(p_campaign_id uuid, p_event text, p_referrer text)) called from a rate-limited, bot-filtered Next.js route handler.
    • authenticated read RPC (e.g. give.get_campaign_analytics(p_campaign_id uuid, p_days int)): restricted strictly to the campaign's owner (organizer_id = auth.uid()) and give admins (RLS / explicit check), returning daily views, referrer breakdown, share clicks, and daily contribution count + amount computed from the ledger (never stored money counters).
  3. pgTAP tests: owner & admin can read; another organizer/user and anon are refused; money series derives strictly from ledger entries; counters increment idempotently/atomically per day & bucket.

Once merged to DOS/DOS.Me dev, please comment on DOS/Give#252 with the RPC signatures and 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=97b9788e-8871-40a9-95c1-cec083013cab scope="DOS/DOS.Me give campaign analytics migration + pgTAP" branch=antigravity/give-263-campaign-analytics target=2026-11-22

  3. JOY commented on Nov 21, 2026

    @JOY
    ContributorAuthor

    checkpoint: session=97b9788e-8871-40a9-95c1-cec083013cab opened https://github.com/DOS/DOS.Me/pull/1852 targeting dev at cbc0f957fdbb6b15479eedf4d743715dbc47877c (migration 20261129120000_give_campaign_analytics.sql + 99 pgTAP tests PASS, idempotency replay PASS, repository integrity PASS, fresh-context review CLEAN_PASS). Waiting for DOS/DOS.Me CI checks and automated reviews.

  4. JOY commented on Nov 21, 2026

    @JOY
    ContributorAuthor

    PO acceptance: merge at d6be6a340fa4816d6217a98c4b2346a313d5b60f (DOS/DOS.Me#1852 -> dev)

  5. JOY commented on Nov 21, 2026

    @JOY
    ContributorAuthor

    checkpoint: session=97b9788e-8871-40a9-95c1-cec083013cab merged https://github.com/DOS/DOS.Me/pull/1852 into DOS/DOS.Me dev at merge commit db6ccf74fa34c409822d045b8176f9469695d9f1 (from PR head d6be6a340fa4816d6217a98c4b2346a313d5b60f after PO acceptance). Post-merge dev checks: Beta Migration History Contract PASS (https://github.com/DOS/DOS.Me/actions/runs/44931420800), Secret Scan PASS (https://github.com/DOS/DOS.Me/actions/runs/44931420826). Posted exact RPC signatures, JSON payload shape, and GIVE_* error codes on #252 (#252 (comment)). Remaining: Production promotion (DOS/DOS.Me dev -> main) by Claude PO.

  6. JOY commented on Nov 21, 2026

    @JOY
    ContributorAuthor

    handoff: session=97b9788e-8871-40a9-95c1-cec083013cab to=83b36fa6-8c08-49d6-aeec-63bab02a5e52

    Done: Merged https://github.com/DOS/DOS.Me/pull/1852 (20261129120000_give_campaign_analytics.sql + give_campaign_analytics.test.sql) into DOS/DOS.Me dev at merge commit db6ccf74fa34c409822d045b8176f9469695d9f1 (from accepted PR head d6be6a340fa4816d6217a98c4b2346a313d5b60f). Posted full RPC signatures, JSON payload shape, and GIVE_* error codes on DOS/Give#252 (#252 (comment)). Removed isolated worktree and local/remote branches.
    Evidence: Pre-merge CI on d6be6a340fa4816d6217a98c4b2346a313d5b60f (Supabase Migration Replay (dev) PASS, Give pgTAP Tests PASS, Give Role Lock Run-time Check PASS, Repository Integrity PASS, Abuse Guardrails PASS, Secret Scan PASS, gemini-code-assist[bot] clean review PRR_kwDOKJ8P_88AAAABZgW0BQ, fresh-context subagent CLEAN_PASS, 99/99 local pgTAP PASS + 393/393 regression PASS). Post-merge DOS/DOS.Me dev (db6ccf74fa34c409822d045b8176f9469695d9f1): Supabase Preview (Beta) completed/success, Beta migration history preparation only completed/success (run 44931420800), Secret scan (gitleaks) completed/success (run 44931420826).
    Remaining: Production promotion (DOS/DOS.Me dev -> main) handled exclusively by Claude PO (Give Product Owner) after JOY's Production approval; close #263 only once deployed to Production.
    Next step: Campaigns PO can immediately dispatch DOS/Give#252 against Beta (DOS/DOS.Me dev already has 20261129120000_give_campaign_analytics.sql live via green Supabase Preview), and track #263 for Claude PO's dev -> main Production promotion.
    Blockers: none for DOS/Give#252 on Beta; Production promotion awaits Claude PO + JOY approval.
    Branch: merged to DOS/DOS.Me dev at db6ccf74fa34c409822d045b8176f9469695d9f1; feature branch antigravity/give-263-campaign-analytics deleted.

  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 dev -> main promotion" branch=antigravity/give-263-campaign-analytics 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#1852 merged at db6ccf74fa34c409822d045b8176f9469695d9f1 and verified on Supabase Preview (Beta). Unblocked #252.

  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