feat: scaffold DIH apps/* on shared @optimitron/db - #195
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
Important Review skippedToo many files! This PR contains 941 files, which is 841 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. Usage-priced reviews support at most 300 files. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (145)
📒 Files selected for processing (941)
You can disable this status message by setting the |
💡 Codex Reviewoptimitron/apps/warondisease/lib/auth.ts Lines 178 to 179 in 0327b31 When GitHub, Twitter, Discord, or Google OAuth completes, AGENTS.md reference: apps/warondisease/AGENTS.md:L33-L36 optimitron/apps/warondisease/app/api/votes/sync/route.ts Lines 231 to 232 in 0327b31 When a converted, cancelled, or soft-deleted invitation token is submitted by another signed-in voter, this lookup still returns its referrer, so the new vote receives optimitron/apps/warondisease/lib/referral.server.ts Lines 101 to 103 in 0327b31 For a referred user who has chosen a handle but left the dashboard privacy toggle off, this optimitron/apps/warondisease/lib/auth.ts Lines 116 to 121 in 0327b31 When Resend rejects a magic-link email—for example because of a transient provider error, quota, or invalid sender— optimitron/apps/warondisease/app/dashboard/actions.ts Lines 263 to 267 in 0327b31 When the shared database contains referrals for any referendum besides ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Follow-up: pruned for reviewability
|
Ready state after this pushDone
Vercel mess — intentional boundary
Smoke strategy
When you want review, PR is #195; treat as architecture + WoD gate, not production cutover. |
Code reviewReviewed via local checkout ( Bugs1. Referral invite send returns 500 on every user's 2nd invite optimitron/apps/warondisease/app/api/referral-invitations/route.ts Lines 180 to 192 in b9cbfb7 (byte-identical in apps/wishocracy/app/api/referral-invitations/route.ts#L180-L192 — not present in apps/dfda)
await prisma.emailLog.create({
data: { userId, toAddress: emailContact, templateId: "referral-invite-share", ... },
})
optimitron/packages/db/prisma/schema.prisma Lines 9618 to 9622 in b9cbfb7
2. Stripe webhook test file doesn't match the route it tests — all 7 tests fail
optimitron/apps/warondisease/app/api/stripe/webhook/route.ts Lines 1 to 20 in b9cbfb7
3. New migration omits ~18 foreign keys and most indexes for 12 new tables The only optimitron/packages/db/prisma/schema.prisma Lines 11045 to 11046 in b9cbfb7 No 4. Referral-tree privacy filter checks the wrong field — leaks private users optimitron/apps/warondisease/lib/referral.server.ts Lines 99 to 105 in b9cbfb7 (byte-identical in apps/dfda/lib/referral.server.ts and apps/wishocracy/lib/referral.server.ts)
user: {
OR: [{ person: { isPublic: true } }, { username: { not: null } }],
},This checks 5. optimitron/apps/warondisease/lib/referral.server.ts Lines 94 to 130 in b9cbfb7 The recursive CTE above this (lines 69-90) correctly computes multi-generation depth for the counts, but the separate 6. Recursive referral CTE has no cycle guard optimitron/apps/warondisease/lib/referral.server.ts Lines 71 to 91 in b9cbfb7
CLAUDE.md / AGENTS.md compliance7. New per-app docs mandate the opposite of root AGENTS.md's UI Style rule optimitron/apps/warondisease/CLAUDE.md Lines 156 to 168 in b9cbfb7 (same text also added at apps/warondisease/AGENTS.md, apps/dfda/CLAUDE.md/AGENTS.md, apps/wishocracy/CLAUDE.md/AGENTS.md)
This PR adds a "Neobrutalist Design Rules (CRITICAL - ALWAYS FOLLOW)" section mandating 8. Banned MLM term shipped verbatim
9. Banned "movement" campaign-identity language optimitron/apps/warondisease/components/dashboard/BadgesSection.tsx Lines 33 to 37 in b9cbfb7
10. Referral tree rendered as an MLM downline optimitron/apps/warondisease/components/dashboard/ImpactTreeCard.tsx Lines 44 to 57 in b9cbfb7 Stat blocks labeled "Direct Recruits" / "Downstream" / "Generations", plus per-person "Gen {depth}" badges further down (lines 93-98, 111) and "Every recruit counts — even the ones your recruits recruit" (line 147). This is direct recruit/downline/generation hierarchy framing, which the same Public Copy Rules quoted above ban on public surfaces. 🤖 Generated with automated code review |
PR review packetStart here
No user-facing page or component changes were inferred from changed files or the visual review manifest. Changed files considered
Updated automatically when this PR's preview or visual review reruns. |
194ba64 to
b20b974
Compare
Introduce neobrutalist-ui, impact-params, site-kit, and survey-embed, wire apps/* into the workspace, and add campaign compatibility schema. CI excludes @apps/* from package jobs until brand apps land in stacked PRs. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Split into stacked PRs for reviewable diffs (umbrella branch kept as recovery):
Merge bottom-up: 198 → 199 → 200 → 201 → 202. |
Existing Optimitron schema is sufficient. Remove Vote/Campaign/Donation and duplicate Wishocratic pair tables. Site-kit identity maps to Person.handle/displayName and User.referralCode. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
ab73663 to
39b8ebe
Compare
|
Follow-up: stripped DIH compatibility schema from the stack (existing Optimitron schema only). Latest tip is on the stacked PRs ending at #202 |
39b8ebe to
d4c02c4
Compare
Move DIH→item id aliases into @optimitron/data and upsert WishocraticItem rows from the canonical catalog (no packages/web imports, no invented names). Co-authored-by: Cursor <cursoragent@cursor.com>
d4c02c4 to
09e1ce1
Compare
Track visited voter ids through the recursive CTE so a referral cycle (A refers B, B refers A) can no longer be re-walked to the depth-20 cutoff, which was inflating totalDownstreamCount and maxDepth. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Full War on Disease Next entrypoint on shared Neon schema, with CI apps-warondisease-validate typecheck against the same Postgres pattern. Co-authored-by: Cursor <cursoragent@cursor.com>
Skills/links stubbed; soldiers and dashboard use Person.handle/displayName. Co-authored-by: Cursor <cursoragent@cursor.com>
Display name lives on Person after DIH schema strip. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
- signup: stop marking credentials accounts emailVerified on creation; matches packages/web's signup route and closes an account-takeover path via OAuth email linking. - weekly-emails cron: use the existing calculateUserRank() helper instead of a query that assigned every recipient the same count. - stripe session route: return only the fields the success page renders instead of full customer_details/metadata (billing address, phone, arbitrary metadata) to an unauthenticated lookup. - sitemap.xml: generate from the existing getSitemapRoutesForVariant() route registry instead of reading a public/sitemaps/*.xml file that is never generated or committed, which made the route always 404. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Includes PR review follow-ups (auth pages, sitemap, vitest setup). Co-authored-by: Cursor <cursoragent@cursor.com>
Uses shared DIH aliases + db ensureWishocraticItemsExist; includes PR review allocation write-path fixes. Co-authored-by: Cursor <cursoragent@cursor.com>
Thin satellites with verify-only Stripe tests, Person auth, and per-app build/embed defaults. Co-authored-by: Cursor <cursoragent@cursor.com>
09e1ce1 to
1110545
Compare
pnpm install --frozen-lockfile failed in CI because the lockfile predated apps/dfda's test-setup dependencies (vite-tsconfig-paths etc.) added in a later commit on this stack. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Summary
apps/*single-brand Next apps (warondisease, dfda, dih, wishocracy, survey, curedao, acceleratedmedicine) from dih-neobrutalist UI; leavepackages/webuntouched.@optimitron/db(drop per-app Prisma clients); treaty YES/NO goes throughReferendumslugone-percent-treaty+ReferendumVote.apps/SCHEMA-GAPS.md).Test plan
pnpm installat monorepo rootpnpm --filter @optimitron/db exec prisma generateone-percent-treaty(ACTIVE)cd apps/warondisease && pnpm exec tsc --noEmit(expect clean)pnpm dev:warondisease— vote flow localStorage → auth →/api/votes/syncwrites ReferendumVote20260807180000_campaign_apps_compatibilityonly if env still needs those columnspackages/webstill builds independently