openalice-bluegenie
Persona-first AI companion service for OpenAliceLabs. BlueGenie is an operational dashboard wrapped in a cozy mystical room (**The Sanctum**), where the **Blue Genie** — an anime djinn companion — tracks money, project quests, and self-state, and motivates the user with VN-style speech bubbles, achievement cards, and a relationship that deepens as real-world goals are met.
Architecture rating
18 owned tables with dedicated RLS migration and a GDPR /export.json endpoint signal real tenant isolation + data-subject rights; only 3 migrations total and FK/constraint depth unverified, so solid-but-young schema.
Valid manifest (100), 13 @feature annotations, descriptive README, AGENTS.md and docs/visual-identity present, but 387 missing docstrings and roadmap at 30/100 leave in-code architecture notes thin.
Manifest/features/code-health all 100 and full per-env compose layout show strong substrate adoption, undercut by env drift (VITE_API_URL undeclared, RUST_LOG unused), 1 cycle, 29 god modules and 8 duplicate signatures.
RLS migration (0002_rls.sql) + tenant-scoped /v1/me/* and /internal/me/{tenant_id}/export.json show isolation intent, but no visible rate-limiting, security headers, or SSRF guards, and 20 bare/broad excepts blur error boundaries — authn/authz mechanism unverified, graded conservatively.
Health probe green (200, 25ms, 100% 24h uptime) but RUST_LOG declared-yet-unused suggests structured logging not wired, and no metrics or tracing signals are present.
20 bare/broad excepts, 81 TODO/FIXME, a SubscriptionsList↔AddSubscriptionForm circular dependency and max complexity 25 indicate fragile error handling; no evidence of timeouts, retries, idempotency, or SIGTERM graceful shutdown.
Inspector reports no test count and the repo tree exposes only migrations (no tests/ or *_test files) — critical paths like RLS isolation and GDPR export appear entirely unverified.
source · auto-grader-2026-06-16
Ecosystem manifest
.atlas-deps.ymlBlueGenie — persona-first AI companion (The Sanctum): Money / Quests / Self panels, Ledger of Unlocks, Hybrid VRM+2D avatar.
- openalice-authshared-jwtvia SHARED_JWT_SECRETVerify oa_session JWTs on /v1/me/* routes via HS256 SHARED_JWT_SECRET
- via cargoShared HTTP plumbing: JWT extractor, CORS, /health, /metrics, rate-limit, internal-client
- via INTERNAL_SECRETGDPR fan-out — /internal/me/{tenant_id}/export.json called by tenants during /me/export
- via ANIM_URLLive VRM pose-frame stream (v2 only; v1 falls back to Mixamo idle loops)
- via PERSONA_INTERNAL_URLVRM upload/list/delete proxy — SPA talks only to BlueGenie, which forwards to persona-server
- via RT_URLPush real-time events (achievement unlocks, mood-mode broadcasts) for SPA SSE/WS subscriptions
- DATABASE_URL
- SHARED_JWT_SECRET
- INTERNAL_SECRET
- BLUEGENIE_ASSETS_DIR
- BLUEGENIE_PORT
- BLUEGENIE_BIND
- PERSONA_INTERNAL_URL
- RT_URL
- ANIM_URL
- TENANT_RATE_LIMIT_PER_MINUTE
- CORS_ORIGINS
- RUST_LOG
- POSTGRES_PASSWORD
- docker_image: openalice-bluegenie
- http_endpoint: https://bluegenie.blal.pro/v1/me/*
- http_endpoint: https://bluegenie.blal.pro/internal/me/{tenant_id}/export.json
- personas
- persona_assets
- persona_relationships
- persona_dialog_lines
- subscriptions
- bills
- income_sources
- category_targets
- transactions
- quests
- milestones
- achievements
- unlock_links
- mood_log
- daily_whispers
- pacts
- future_self_letters
- agent_messages
Atlas grepped the repo's source for env reads (rust env::var · ts process.env · py os.environ · shell $VAR) and diffed against the manifest's consumes_env. Two lists below: stale declarations and undeclared reads.
- VITE_API_URL
- RUST_LOG
Code composition
tokei · loc- TSX54.9%
- Rust23.2%
- TypeScript14.1%
- SQL2.4%
- JSON2.3%
- Other3.1%
- TSX54.9%
- Rust23.2%
- TypeScript14.1%
- SQL2.4%
- JSON2.3%
- Other3.1%
- TSX54.9%· 5,749
- Rust23.2%· 2,428
- TypeScript14.1%· 1,482
- SQL2.4%· 254
- JSON2.3%· 242
- YAML1.6%· 172
- CSS0.8%· 80
- TOML0.3%· 27
- +2 more0.4%· 46 · 2 files
| Language | % code | code | comments | blanks | files |
|---|---|---|---|---|---|
| TSX | 54.9% | 5,749 | 2,332 | 575 | 39 |
| Rust | 23.2% | 2,428 | 135 | 302 | 20 |
| TypeScript | 14.1% | 1,482 | 1,385 | 258 | 21 |
| SQL | 2.4% | 254 | 149 | 38 | 3 |
| JSON | 2.3% | 242 | 0 | 22 | 4 |
| YAML | 1.6% | 172 | 23 | 8 | 4 |
| CSS | 0.8% | 80 | 53 | 28 | 1 |
| TOML | 0.3% | 27 | 7 | 6 | 1 |
| Dockerfile | 0.2% | 23 | 8 | 12 | 1 |
| HTML | 0.2% | 23 | 10 | 4 | 1 |
| Markdown | 0.0% | 0 | 957 | 344 | 9 |
Telemetry ribbon · last 90 days
1 eventbluegenie/agent
1 feature- bluegenie.agent.chat-relaysrc/handlers/agent_chat.rs:3In-app ChatInputBar ↔ agent relay — user posts go in, agent replies come out, SPA polls /messages with a since-cursor.route:POST /v1/me/agent/inroute:POST /v1/me/agent/outroute:GET /v1/me/agent/messagessince 0.1.0
bluegenie/assets
1 feature- bluegenie.assets.unlock-cardssrc/handlers/assets.rs:32D unlock card pipeline — multipart PNG upload from Nano Banana 2, image-crate optimize, list/fetch/soft-delete under BLUEGENIE_ASSETS_DIR.route:POST /v1/me/assets/unlock-cardsroute:GET /v1/me/assets/unlock-cardsroute:GET /v1/me/assets/unlock-cards/{id}route:DELETE /v1/me/assets/unlock-cards/{id}since 0.1.0
bluegenie/auth
1 feature- bluegenie.auth.whoamisrc/handlers/auth.rs:3Clear the shared oa_session + oa_refresh cookies so the user signs out of every *.blal.pro product in one click.route:POST /v1/auth/logoutsince 0.1.0
bluegenie/core
2 features- bluegenie.bin.serversrc/main.rs:3Axum HTTP server entry — wires env, Postgres pool, JWT verifier, CORS, and per-tenant rate limit; listens on BLUEGENIE_PORT.bin:openalice-bluegeniesince 0.1.0
- bluegenie.crate.servicesrc/lib.rs:3BlueGenie backend crate — Money/Quests/Self panels, Ledger of Unlocks, persona registry, VRM proxy.bin:openalice-bluegeniesince 0.1.0
bluegenie/internal
1 feature- bluegenie.internal.gdpr-exportsrc/handlers/internal.rs:3GDPR fan-out slice — returns this tenant's BlueGenie data (subs, quests, achievements, letters, mood) as JSON for openalice-tenants to bundle into /me/export.route:GET /internal/me/{tenant_id}/export.jsonsince 0.1.0
bluegenie/ledger
1 feature- bluegenie.ledger.achievementssrc/handlers/ledger.rs:3Server-side achievement recompute — flips achieved_at, walks the unlock graph, fires persona dialog events on new unlocks.route:POST /v1/me/ledger/checksince 0.1.0
bluegenie/money
1 feature- bluegenie.money.runwaysrc/handlers/money.rs:3Category targets vs current-month actuals readout for the soft-budget UI band.route:GET /v1/me/money/categoriessince 0.1.0
bluegenie/ops
1 feature- bluegenie.ops.healthsrc/handlers/health.rs:3Traefik liveness probe returning plain-text "ok".route:GET /healthsince 0.1.0
bluegenie/persona
2 features- bluegenie.persona.registrysrc/handlers/personas.rs:3Persona registry — list/detail in v1 (Blue Genie only) with relationship state; multi-character writes deferred to v2.route:GET /v1/me/personasroute:GET /v1/me/personas/{id}route:POST /v1/me/personassince 0.1.0
- bluegenie.persona.vrm-proxysrc/handlers/vrm.rs:3Thin proxy around persona-server VRM upload/list/bind so the SPA only talks to bluegenie.blal.pro for the Blue Genie avatar slot.route:POST /v1/me/vrm/uploadroute:GET /v1/me/vrmroute:PUT /v1/me/vrm/{vrm_id}since 0.1.0
bluegenie/quests
1 feature- bluegenie.quests.questssrc/handlers/quests.rs:3Milestone add (auto-ordered) and idempotent completion endpoint for a quest's progress timeline.route:POST /v1/me/quests/{id}/milestonesroute:POST /v1/me/quests/{id}/milestones/{mid}/completesince 0.1.0
bluegenie/self
1 feature- bluegenie.self.moodsrc/handlers/self_panel.rs:3Future Self Letters — markdown body + Q&A JSONB, listed/created via this surface (TTS rendering deferred to v2).route:GET /v1/me/self/lettersroute:POST /v1/me/self/letterssince 0.1.0