Multi-cohort support with per-member initial balance#358
Open
Multi-cohort support with per-member initial balance#358
Conversation
- Add global SQLite DB for users, cohorts, membership, and config - Per-cohort WebSocket routes at /api/ws/:cohort_name - REST endpoints for cohort listing and admin management - Restructure frontend routes under /[cohort_name]/ - Cohort selection page with auto-redirect for single cohort - Admin page for cohort/member/config management - Public auction access with auction-only mode - Cohort-scoped localStorage keys - Legacy DB auto-migration support
Resolve conflicts: - websocket_sudo.rs: drop removed market positions test - api.svelte.ts: keep both auctionOnly and sudoEnabled - +layout.svelte: keep stripped auth-only root layout - market/+page.svelte: keep getCurrentCohort, drop scenariosApi - Move performance page under [cohort_name]/ - Update scroll handler with hysteresis from main
… multi-cohort support - Add initial_balance column to cohort_member table with migration - Look up configured initial balance on account creation, falling back to legacy defaults (admin=100M, non-admin=0) when NULL - Split member management into dedicated /admin/cohorts/[name] detail page - Simplify admin page cohort list with navigation links - Add default_cohort_id config option - Update python client for multi-cohort WebSocket endpoints
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Add create_if_missing param to DB::init_with_path - Clean up global DB row if cohort DB init fails (prevents UNIQUE constraint on retry) - Add existing_db checkbox to admin UI (fails if DB file doesn't exist) - Add GlobalDB::delete_cohort for rollback - Add apiBase.ts, CORS and cross-origin fixes
sqlite:///data/foo.sqlite should resolve to /data/, not data/
- Backend endpoint lists .sqlite files not yet used by cohorts - Frontend shows them as buttons that fill the slug and check "use existing DB"
- CohortState.is_read_only is now AtomicBool, loaded per-message - Admin toggle updates the atomic, no restart needed
- New migration adds email column to global_user - ensure_global_user stores email from Kinde auth - Cohort members query falls back to global_user email - Admin "All Users" list shows emails and searches by email
- Display name editing for all users on accounts page (cross-cohort) - Admin user management: edit names, toggle admin, delete users with confirm modals - Account color coding: color field in proto/DB, color picker for admins, colored dots in act-as dropdown, colored header when acting as colored account - Switch cohort button only shown with multiple cohorts, moved to sidebar footer - Editable initial balance for non-instantiated cohort members - Fix 404 on admin page reload (disable prerender/SSR for admin routes) - Hide read-only toggle from main admin page (keep on cohort detail page)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/[cohort_name]/market, etc.), each cohort has its own SQLite database, and a global database tracks users/membership across cohorts/adminto a dedicated/admin/cohorts/[name]page with user combobox, email batch add, and initial balance inputsmetagamepackage updated for multi-cohort WebSocket endpoints (/api/ws/{cohort_name}) and cohort discovery via REST APIdefault_cohort_idsetting for python client/scenarios server targetingfixes: ARB-357 ARB-382
Test plan
dev.sh, login as admin, verify/adminshows cohort list with chevron links