managarten/docs
Till JS 493db0c3b2 feat(personas): M2.a-c — persona schemas + admin endpoints + seed pipeline
Continuation of docs/plans/mana-mcp-and-personas.md. Personas are the
auto-test users the M3 runner will drive — they're real Mana users
(kind='persona', tier='founder'), registered through the same Better
Auth pipeline as humans, just stamped differently and metadata-tracked
so the persona-runner knows how to role-play them.

Schemas (auth namespace — personas are 1:1 with users, no reason for a
separate platform.* schema that the plan originally sketched)

- userKindEnum ('human' | 'persona' | 'system') + users.kind column,
  wired into better-auth additionalFields so the JWT/user object carry
  the flag. Default 'human' keeps every existing user untouched.
- auth.personas — 1:1 descriptor (archetype, systemPrompt, moduleMix
  jsonb, tickCadence, lastActiveAt). CASCADE from users.id.
- auth.persona_actions — tick-grouped audit of every tool call the
  runner makes (toolName, inputHash for dedup, result, latency).
- auth.persona_feedback — structured 1-5 ratings per module per tick,
  plus free-text notes. This is where the runner writes the
  self-reflection step at end of each tick.

Admin endpoints (/api/v1/admin/personas, admin-tier-gated)

- POST /            create-or-update by email. Uses auth.api.signUpEmail
                    if the user's new, then stamps kind+tier+verified
                    and upserts the personas row. Idempotent — safe to
                    re-run after catalog edits.
- GET  /            list with 7-day action count per persona.
- GET  /:id         detail + recent 20 actions + per-module feedback
                    aggregate.
- DELETE /:id       hard delete. Refuses non-persona users as
                    defense-in-depth: an admin typo here would cascade
                    through the full user-delete chain.

Catalog + seed pipeline (scripts/personas/)

- catalog.json      10 handwritten personas spanning 7 archetypes
                    (adhd-student, ceo-busy, creative-parent, solo-dev,
                    researcher, freelancer, overwhelmed-newbie).
                    Five pairs of personas that will later share
                    family/team spaces (cross-space setup is deferred
                    to M2.d per the plan).
- catalog.ts        zod-validated loader. Refines email to require
                    @mana.test TLD — non-existent, no bounce risk.
- password.ts       deterministic HMAC-SHA256(PERSONA_SEED_SECRET,
                    email). No stored per-persona credentials; the
                    runner re-derives on every login. Refuses the
                    dev-fallback secret in production.
- seed.ts           POST /admin/personas per catalog entry. Flags:
                    --auth=, --jwt=, --dry-run.
- cleanup.ts        Hard-delete every live persona. Warns when the
                    live set drifts from the catalog.

Root package.json:
  pnpm seed:personas
  pnpm seed:personas:cleanup

Extends the ESLint root-ignore list with `scripts/**` so Bun-typed
utility scripts don't fail the typed-parser check they weren't opted
into. Consistent with the rest of scripts/ being .mjs+.sh.

To go live (user action):
  pnpm docker:up
  cd services/mana-auth && bun run db:push
  export MANA_ADMIN_JWT=...
  pnpm seed:personas

M2.d deferred: cross-space (family/team/practice) memberships between
persona pairs. Better Auth's org-invite flow is multi-step and would
roughly double the M2 scope; the persona-runner (M3) can operate in
personal spaces first, shared-space tests land as their own milestone.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 13:55:14 +02:00
..
architecture docs: update tool coverage table + server-side research + templates 2026-04-16 12:35:40 +02:00
central-services refactor(arcade, shared-ui): migrate CommandBar to GlobalSpotlight, delete CommandBar 2026-04-15 01:17:55 +02:00
decisions chore: complete ManaCore → Mana rename (docs, go modules, plists, images) 2026-04-07 12:26:10 +02:00
future docs: add langfristige Roadmap-Punkte zu AI_AGENTS_IDEAS.md 2026-04-16 15:27:38 +02:00
modules feat(sleep): add sleep module with tracking, hygiene checklists, and stats 2026-04-13 21:19:52 +02:00
optimizable docs(optimizable): add manual-test-backlog as the "zu testen" register 2026-04-22 19:02:55 +02:00
plans feat(personas): M2.a-c — persona schemas + admin endpoints + seed pipeline 2026-04-23 13:55:14 +02:00
postmortems chore: tidy root files + reorganize a few stale docs 2026-04-08 12:15:27 +02:00
reports docs(gemini-deep-research): Mac-Mini deploy log 2026-04-22 2026-04-22 18:22:31 +02:00
test-examples chore: complete ManaCore → Mana rename (docs, go modules, plists, images) 2026-04-07 12:26:10 +02:00
ANALYTICS.md refactor: rename zitare -> quotes (Zitate) 2026-04-14 20:59:16 +02:00
APP_GAP_ANALYSIS.md chore: misc fixes, new services, lockfile cleanup 2026-03-28 10:27:35 +01:00
APP_ONBOARDING.md chore: complete ManaCore → Mana rename (docs, go modules, plists, images) 2026-04-07 12:26:10 +02:00
ARCHITECTURE_MIGRATION_REPORT.md refactor: rename zitare -> quotes (Zitate) 2026-04-14 20:59:16 +02:00
CAPACITY_PLANNING.md refactor: rename zitare -> quotes (Zitate) 2026-04-14 20:59:16 +02:00
CARDS_POSTGRES_MIGRATION.md chore: complete ManaCore → Mana rename (docs, go modules, plists, images) 2026-04-07 12:26:10 +02:00
CLOUDFLARE_DOMAINS.md refactor: rename zitare -> quotes (Zitate) 2026-04-14 20:59:16 +02:00
CLOUDFLARE_FALLBACK.md refactor: rename nutriphi module to food (Essen) 2026-04-14 15:30:07 +02:00
CLUSTER_HARDWARE_ANALYSE.md rename(taktik): rebrand to Times 2026-03-30 15:44:18 +02:00
complexity-hotspots.md chore(audit): module complexity reports + workbench map 2026-04-14 19:47:42 +02:00
complexity-map.html chore(audit): module complexity reports + workbench map 2026-04-14 19:47:42 +02:00
CONTEXT_INTELLIGENCE_REPORT.md docs: add Context Intelligence research report 2026-04-14 19:50:25 +02:00
DATABASE_MIGRATIONS.md chore: complete ManaCore → Mana rename (docs, go modules, plists, images) 2026-04-07 12:26:10 +02:00
DEPLOYMENT.md chore: complete ManaCore → Mana rename (docs, go modules, plists, images) 2026-04-07 12:26:10 +02:00
DEVELOPMENT_SCRIPTS.md chore: complete ManaCore → Mana rename (docs, go modules, plists, images) 2026-04-07 12:26:10 +02:00
DEVLOG_GUIDELINES.md feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
DISCORD_NOTIFICATIONS_SETUP.md feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
DOCKER_GUIDE.md chore: complete ManaCore → Mana rename (docs, go modules, plists, images) 2026-04-07 12:26:10 +02:00
ENVIRONMENT_VARIABLES.md feat(env): persistent dev secrets via .env.secrets override 2026-04-08 17:50:37 +02:00
ERROR_TRACKING.md refactor: rename zitare -> quotes (Zitate) 2026-04-14 20:59:16 +02:00
EXPO_SDK_UPGRADE.md chore: complete ManaCore → Mana rename (docs, go modules, plists, images) 2026-04-07 12:26:10 +02:00
EXTERNAL_SERVICES.md refactor: rename zitare -> quotes (Zitate) 2026-04-14 20:59:16 +02:00
EXTERNAL_SSD_OPPORTUNITIES.md refactor: rename nutriphi module to food (Essen) 2026-04-14 15:30:07 +02:00
FIX_COLIMA_MOUNTS.md chore: complete ManaCore → Mana rename (docs, go modules, plists, images) 2026-04-07 12:26:10 +02:00
GIT_WORKFLOW.md chore: complete ManaCore → Mana rename (docs, go modules, plists, images) 2026-04-07 12:26:10 +02:00
I18N.md chore: complete ManaCore → Mana rename (docs, go modules, plists, images) 2026-04-07 12:26:10 +02:00
LOCAL_DEVELOPMENT.md refactor: rename zitare -> quotes (Zitate) 2026-04-14 20:59:16 +02:00
LOCAL_LLM_MODELS.md feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
LOCAL_STT_MODELS.md 📝 docs: add design UX guidelines and local model documentation 2026-01-27 01:32:31 +01:00
MAC_MINI_SERVER.md fix(mana-auth) + chore: rewrite /api/v1/auth/login JWT mint, remove Matrix stack 2026-04-08 16:32:13 +02:00
MAIL_SERVER.md feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
MANA_BOX_HARDWARE.md rename(taktik): rebrand to Times 2026-03-30 15:44:18 +02:00
MANA_EARNING_SYSTEM.md refactor: rename zitare -> quotes (Zitate) 2026-04-14 20:59:16 +02:00
MANA_VALUES.md feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
MICROSERVICES_API_OVERVIEW.md refactor: rename zitare -> quotes (Zitate) 2026-04-14 20:59:16 +02:00
MOBILE_DESKTOP_APP_STRATEGY.md feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
module-coupling.md chore(audit): module complexity reports + workbench map 2026-04-14 19:47:42 +02:00
module-health.md chore(audit): module complexity reports + workbench map 2026-04-14 19:47:42 +02:00
MODULE_REGISTRY.md feat(invoices): close Phase-2 gaps — finance cross-link + structured addresses 2026-04-20 18:58:18 +02:00
MONETIZATION_REPORT.md refactor: rename zitare -> quotes (Zitate) 2026-04-14 20:59:16 +02:00
MONITORING.md refactor: rename zitare -> quotes (Zitate) 2026-04-14 20:59:16 +02:00
OBSERVABILITY_GAPS.md chore: complete ManaCore → Mana rename (docs, go modules, plists, images) 2026-04-07 12:26:10 +02:00
OLLAMA_MODELS.md chore: complete ManaCore → Mana rename (docs, go modules, plists, images) 2026-04-07 12:26:10 +02:00
PLAN_TAURI_V2.md chore: complete ManaCore → Mana rename (docs, go modules, plists, images) 2026-04-07 12:26:10 +02:00
PORT_SCHEMA.md feat(mcp): M1+M1.5 MCP gateway + tool-registry + shared-crypto 2026-04-23 13:18:35 +02:00
POSTGRES_BACKUP.md fix(infra): simplify PostgreSQL backup to pg_dumpall + pg_basebackup 2026-03-24 11:39:20 +01:00
PRE_LAUNCH_CLEANUP.md refactor: rename zitare -> quotes (Zitate) 2026-04-14 20:59:16 +02:00
PROD_READINESS_SCORE.md feat: rename ManaCore to Mana across entire codebase 2026-04-05 20:00:13 +02:00
PROJECT_OVERVIEW.md refactor: rename nutriphi module to food (Essen) 2026-04-14 15:30:07 +02:00
PWA_GUIDE.md refactor: rename zitare -> quotes (Zitate) 2026-04-14 20:59:16 +02:00
RECOMMENDED_SERVICES.md refactor: rename zitare -> quotes (Zitate) 2026-04-14 20:59:16 +02:00
REFACTORING_AUDIT_2026_04.md refactor: rename nutriphi module to food (Essen) 2026-04-14 15:30:07 +02:00
SEPA_ACTIVATION_CHECKLIST.md chore: complete ManaCore → Mana rename (docs, go modules, plists, images) 2026-04-07 12:26:10 +02:00
SETUP_TEMPLATES.md refactor: rename zitare -> quotes (Zitate) 2026-04-14 20:59:16 +02:00
SHARED_PACKAGES_ROADMAP.md chore: complete ManaCore → Mana rename (docs, go modules, plists, images) 2026-04-07 12:26:10 +02:00
SYNC_BILLING_PLAN.md feat(credits): add sync billing — monthly credit subscription for cloud sync 2026-04-10 22:21:58 +02:00
TECH_STACK_INDEPENDENCE.md refactor: rename nutriphi module to food (Essen) 2026-04-14 15:30:07 +02:00
TECHNOLOGY_AUDIT_2026_03.md refactor: rename zitare -> quotes (Zitate) 2026-04-14 20:59:16 +02:00
TESTING_DEPLOYMENT_CHECKLIST.md chore: complete ManaCore → Mana rename (docs, go modules, plists, images) 2026-04-07 12:26:10 +02:00
URL_SCHEMA.md refactor: rename zitare -> quotes (Zitate) 2026-04-14 20:59:16 +02:00
USER_SETTINGS.md refactor: rename zitare -> quotes (Zitate) 2026-04-14 20:59:16 +02:00
VERSIONING.md refactor: rename zitare -> quotes (Zitate) 2026-04-14 20:59:16 +02:00
WHO_MODULE.md docs(who): RFC for the historical-figure guessing module 2026-04-09 13:08:07 +02:00
WINDOWS_GPU_SERVER_SETUP.md fix(mana-voice-bot): move default port 3050 → 3024 + Windows GPU deployment notes 2026-04-08 13:14:57 +02:00