Skip to content

CreatorTrack University + Gamification (LIVE 2026-07-11)

Merged to main at 3306ade, deployed to prod (:3070 / app.creatortrack.ai) 2026-07-11 ~09:42 CDT, pushed to GitHub. Built on branch feat/ct-university-tasks-assets by the Fable-coordinator session; full build history in creatortrack-university-tasks-assets-build-2026-07-10, plan in memory/plans/creatortrack-university-gamification-2026-07-10.md.

Data model facts (load-bearing)

  • University catalog (university.courses/modules/lessons + quiz_questions/lesson_transcripts/channel_videos) is GLOBAL: no workspace_id; RLS = global-read for any authed user, owner-write. Global unique keys: courses(title), modules(course_id,title), lessons(module_id,url).
  • Progress is ACCOUNT-scoped: lesson_progress, quiz_attempts, lesson_notes, lesson_video_marks, course_certificates keyed to user, RLS self-or-owner; same progress in every workspace. comments stays workspace-scoped.
  • Lesson-note doc nodes pin to the user's kind='personal' workspace via personalWorkspaceId(tx,userId) in lib/university.ts, hidden by UNIVERSITY_NOTES_ROOT_MARKER.
  • Gamification: platform-wide CT Points (points_ledger, user_badges, user_streaks, streak_freezes, user_settings opt-out); profile shows combined total AND University-only subtotal.
  • Connections: mutual add-by-email + accept (user_connections); leaderboard week/month/lifetime scoped to connections; activity_events feed.
  • Subtasks: "Parent Task" self-relation on tasks.db (links in app.collection_relations, reverse-lookup index added); single parent, no completion cascade; checked/percent_checked rollup fns.
  • Certificates: issue re-verifies 100% completion in-tx, idempotent; public token page /certificates/[token] (in proxy.ts PUBLIC_PATHS, token is the credential).
  • University only visible where installed (404 otherwise); Creatorpedia/notes roots excluded from Pages tree and search.

Ops facts

  • Prod migration 2026-07-11: 9 pending applied; catalog reconcile deduped courses 14 to 7, modules 26 to 13, lessons 88 to 44, zero progress/notes/comments rows lost. Pre-migration full-DB backup: forge/data/backups/lifeos_prod_pre_university_catalog_migration_20260711T143555Z.dump (pg_restore verified).
  • Deploy script does NOT cap Node heap; run with NODE_OPTIONS=--max-old-space-size=6144 (known debt, see [[creatortrack-deploy-oom-typecheck]]).

Open follow-ups

  1. Soft-deleted accounts (90d retention) can linger in others' connection lists/leaderboards: connections/leaderboard SECURITY DEFINER fns (migration ...063057) lack a deleted_at filter. Needs a small follow-up migration.
  2. Runtime QA never exercised by a human: youtube current-time capture on video marks, certificate issue on a 100% course, signed-out certificate URL.
  3. Bake the heap cap into forge_creatortrack_deploy.sh.

Update 2026-07-11: 5 CreatorTrack-authored topic courses seeded to prod

Catalog grew from 7 creator-branded courses to 12: five new topic curricula (source CreatorTrack Curriculum, positions 7-11): Packaging/Ideation, Storytelling/Retention, Monetization/Business, AI Creator Workflow, Shorts+Analytics. 35 modules, 125 lessons, every lesson an oEmbed-verified YouTube video (kind youtube, nocookie embeds derived by seedCourse).

  • Seed script: creatortrack/scripts/seed-university-topic-courses.ts reading scripts/data/university-topic-courses.seed.json (idempotent, re-run safe; lesson url is the upsert key so video swaps insert-new rather than update, delete the old row by hand).
  • Research pack + JSON generator: forge/data/university/new-courses-2026-07-11/ (5 curricula .md, videos-*.json mappings, BUILD-SPEC.md, generate_seed_json.py).
  • Merged to main f0d9024, pushed; seeded straight into lifeos (no deploy needed, no app code changed). Verified on a creatortrack_dev_base clone first (double-run, counts stable), test DB dropped after.
  • Gotcha: creatortrack_dev_base originally lacked the university schema; FIXED 2026-07-11: migrations applied to the base and both university seeds run against it (12 courses / 167 lessons), so fresh dev clones now match prod. Seeding the base needs ADMIN PG creds (pg_hba does not allow lifeos_app into creatortrack_dev_base): PGDATABASE=creatortrack_dev_base PGUSER=<admin> PGPASSWORD=<admin> npx tsx scripts/seed-university-*.ts. Read-back verification queries need asUser(), identity-less db.execute sees 0 rows through RLS.

[Claude Code]

URL: https://mkdocs.justinsforge.com/memory/general/reference_creatortrack_university_gamification/