Files
aevolution/include/evo/server/lifecycle/cellular_admin_view.hpp
T
dingoandClaude Opus 5.5 070c458dc5
Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (client) (push) Successful in 4s
Foundation / checks (ecs) (push) Successful in 5s
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (postgres) (push) Successful in 5s
Foundation / checks (network) (push) Successful in 5s
Foundation / checks (tsan) (push) Successful in 4s
Foundation / postgres-tools (push) Successful in 2m9s
Foundation / server-image (push) Successful in 5m23s
Foundation / image (push) Successful in 6m10s
feat(admin): bans, admin logout and time played (schema 64)
ADR-0182 section 11.
- Append-only account bans; a ban also revokes the account's grants (its live
  session closes at the next control renewal) and issue_account_grant refuses a
  banned account (EVL20 -> broker 403 account_banned). Lifting is another row.
- admin_logout_account_v1 revokes by account id.
- Session intervals recorded by claim/renew/release (signatures unchanged):
  time played, sessions and last seen per account.
- The region view carries each cell's lineage root; the portal counts living
  wildlife descended from an account's lives.
- Portal: Ban/Unban and Log out with reason and history; time played column.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 17:50:34 -04:00

38 lines
2.0 KiB
C++

#pragma once
#include "evo/server/lifecycle/cellular_lives.hpp"
#include <cstddef>
#include <functional>
#include <string>
// ADR-0182 read-only region view for the admin portal: every cell, pool and bubble of a
// cellular owner as compact JSON. It reads the committed in-memory state and changes nothing;
// it is not a simulation output, a checkpoint or a client protocol.
//
// {"world":W,"region":R,"tick":T,"rules":N,"area":[w,h],
// "spent":[e,c,n,p,o],"cells_total":N,"deposits_total":N,
// "cells":[["life","organism","account",x,y,extent,flags,members,
// reserve_e,reserve_c,reserve_n,reserve_p,reserve_o,body_mass,"root"],...],
// "deposits":[[id,kind,x,y,radius,e,c,n,p,o],...]}
//
// Cell positions are the lower-left corner of the square footprint and deposits their centre,
// in micrometres. Life and organism ids are decimal strings (bud ids exceed 2^53); `account`
// is the lowercase UUID, empty for wildlife; `root` the lineage root (the founder whose life
// request a lineage descends from, cellular_lineage_root). Flags: 1 wildlife, 2 the account's
// session is connected, 4 lingering, 8 suspended. Deposit kind: 0 patch, 1 pool, 2 bubble. Energy
// in pJ, matter in fg. Cells and deposits beyond the limits are left out (by ascending life id and
// deposit id); the totals still count them.
namespace evo::server {
struct CellularAdminViewLimits {
std::size_t cells{4096}, deposits{16384};
};
// True when the account's session is connected to this region.
using CellularAdminOnline = std::function<bool(const LifeAccount&)>;
[[nodiscard]] std::string render_cellular_admin_view(const CellularLives& state,
const CellularAdminOnline& online,
CellularAdminViewLimits limits = {});
// Lowercase 8-4-4-4-12 text of a 16-byte account.
[[nodiscard]] std::string cellular_account_text(const LifeAccount& account);
} // namespace evo::server