Coalition structure: design¶
Status: agreed direction, 2026-12-03. Replaces decision 0001 ("one database per tenant"): one install now serves a whole coalition.
What the owner asked for¶
- Easy install. A web setup wizard, built last so it reflects how everything behaves.
- Coalition-ready. Setup asks "Is this a coalition?". If yes, the site is three sites in one: coalition home › alliance homes › corp homes. Alliances can't see other alliances' pages, and corps can't see other corps' pages. Coalition leaders see everything, so verification and background checks are open to leadership.
- Automatic tokens. Pilots grant everything once and can restrict it afterwards.
- A clearer character page, and a home page per org that its leaders can easily edit with updates.
Decisions (owner's answers)¶
| Question | Answer |
|---|---|
| How alliances and corps get in | Coalition leaders add member alliances by name. Corps of those alliances appear automatically as their pilots sign in. |
| Who leads each level | Read from the game, plus Nexus groups. Corp CEO and directors are corp leaders. Leaders of the alliance's executor corp are alliance leaders. Each level can add more people through its leadership group. |
| What members see | Their own corp, their alliance and the coalition home. Never sibling alliances or corps. Leaders see everything below their level. |
| Tokens | The first sign-in asks for every scope the org needs, after one plain-language disclosure screen. Pilots switch categories off later, and leadership sees who restricted what. |
Model¶
org_units one row per coalition / alliance / corporation page
id, kind (coalition | alliance | corporation), parent_id, eve_id (NULL for the coalition),
name, slug, created_at
- exactly one root: the coalition, or the alliance (or corp) in a single-org install
- alliances are added by coalition leaders; corporation units are created automatically the
first time a pilot from a member alliance signs in
org_unit_leaders (a view) who leads a unit, and why
org_unit_id, account_id, character_id, source
(ceo | director | executor_ceo | executor_director | group)
- computed on every read from eve_corporation_info (CEO), character_corp_roles (directors,
ignored after 26 hours without a re-read) and eve_alliance_info (executor corp)
- group rows come from the unit's leadership group (org_units.leader_group_id)
home_posts the editable home page of each unit
id, org_unit_id, author_account_id, title, body (Markdown), pinned, created_at, updated_at
Where a pilot belongs follows their main character: corp unit → its alliance unit → the coalition. Alts in other corps don't widen what a pilot can see.
Visibility rule (one function, enforced server-side): an account can see a unit if it is
the unit itself or an ancestor of the pilot's corp unit. It can lead (manage, view member
data, run checks) a unit if it leads that unit or any ancestor of it. Every leadership API takes
a unit ID and checks can_lead(account, unit). Nothing filters only in the UI.
States stay. Today's States (Member, Blue, Guest) still decide access and Discord roles. The org tree decides which pages and which pilots' data someone can see. A "member of the coalition" State is simply "main's alliance is a member alliance", which the setup wizard creates.
Permissions become scoped. Global admin permissions (admin.*) stay for coalition-level
admins. New per-unit abilities (edit home page, view members, view audit data, manage the
leadership group) are granted by leading a unit, not by global permissions.
Tokens¶
- Leadership (in the wizard, then on the coalition settings page) picks the scope set the org needs, grouped into plain-language categories: Skills & clones, Location & ship, Wallet, Mail, Assets, Contracts, Contacts & standings, and so on.
- First sign-in: one disclosure screen lists the categories and who can see each (the pilot's corp, alliance and coalition leadership). Accepting records consent (policy version, time, IP) and requests every scope at CCP. Alts linked later go through the same screen.
- Afterwards, the character page has a switch per category. Switching one off works like today's withdrawal: Nexus stops using those scopes at once and the record is stamped. The next sign-in replaces the token at CCP without them. Switching back on goes through CCP again.
- Leadership's member list shows each pilot's restrictions. Scopes are the organisation's categories, not a per-State list.
Character page¶
One page per character, in plain sections with a short "what this is and who can see it" line each: identity and corp history, skills (SP, queue), clones and implants, location and ship, wallet summary, assets summary, contracts and mail (counts and recent items). Each section shows the category switch that feeds it. A section whose category is off says so instead of showing stale data. Data comes from ESI sweeps on the existing job queue, cached with ETags.
The same page, opened by a leader, is the background-check view for that pilot (read-only, and every view is audit-logged).
Home pages¶
Each unit's home shows its updates (pinned first), a short "about" block, and links to its groups and Discord. Leaders of the unit, or of any unit above it, can post, edit, pin and delete updates with a Markdown editor and preview. Members see their corp, alliance and coalition homes as three tabs or one combined feed.
Build order¶
Step 1 is built (migration 0009, crates/core-api/src/org.rs, Admin → Organisation).
Step 2 is built (migration 0010, crates/core-api/src/home.rs, Home Pages).
Step 3 is built (migration 0011, crates/core-api/src/scopes.rs): the disclosure shows before
every sign-in (one click), not only the first, so a pilot always sees what is being granted.
Step 4 is built (migration 0012, crates/core-api/src/pilot.rs, /pilot/<id>): summaries only,
leader views audit-logged as character.profile_viewed.
Step 5 is built (crates/core-api/src/leadership.rs, Members): the member list per unit
with checks, registration per corporation, and an audit-logged CSV export.
- Org tree and scoped access: schema, membership from the main, leaders from ESI roles
(needs
esi-characters.read_corporation_roles.v1) and leadership groups, the visibility functions, and admin screens to add alliances. Reverse decision 0001. - Home pages with editable updates.
- Automatic tokens: scope categories, the first-sign-in disclosure, per-category switches, and the leadership restrictions view.
- Character page: ESI collection jobs and the in-depth page, which doubles as the leadership background-check view.
- Leadership tools: member lists per unit with compliance and checks (Phase 3 HR begins).
- Setup wizard (last): "Is this a coalition?", then org name, member alliances, EVE app,
Discord, scope categories. Tested end to end on a fresh
docker compose up.
The OIDC provider moves after step 5. Its claims will carry the org path (coalition, alliance, corp), which is what other coalition tools need.