feat(admin): session windows in SQL, opened from the admin portal (schema 62)
Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (client) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 4s
Foundation / checks (network) (push) Successful in 4s
Foundation / checks (postgres) (push) Successful in 4s
Foundation / checks (tsan) (push) Successful in 5s
Foundation / checks (deploy) (push) Successful in 4m33s
Foundation / postgres-tools (push) Successful in 2m14s
Foundation / server-image (push) Successful in 5m21s
Foundation / image (push) Successful in 6m18s

The dev session window moves from Git to SQL (ADR-0087 amendment): the admin
portal opens, extends (30 min to 4 h from now) and closes it, and the cellular
region re-reads it every 5 s with --session-window-source db. No push, sync or
restart per window; a closed window keeps the region running instead of
crash-looping.

- Schema 62: append-only session_windows (4 h cap, no rewrites),
  load_session_window_v1 for the runtime group, admin_set_session_window_v1
  and admin_session_windows_v1 for a dedicated admin group role, granted and
  audited each migration run when EVO_PG_ADMIN_ROLE is set (aevolution_admin in
  DEV). Schema 61's views are revoked from the runtime group.
- RegionSessions admission switch: while closed every Hello is refused before
  signature work and closing closes open sessions (new sessions were still
  admitted after expiry before).
- Admin API: GET/POST /api/regions/<n>/session-window, window state in the
  regions list; the portal's session-window card with history.
- Git: REGION_SESSION_WINDOW and the pre-push refresh rule are removed; the
  policy check requires the database source and refuses a committed window.

Needs the new image and the aevolution_admin role (with the portal's login in
aevolution-admin-pg) before a sync.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-27 15:13:02 -04:00
co-authored by Claude Opus 5.5
parent 510ecaee80
commit 46c106409e
31 changed files with 807 additions and 93 deletions
+10 -3
View File
@@ -53,6 +53,10 @@
namespace evo::server_app {
struct M10Options {
std::string listen, certificate, key, issuer, environment, session_window;
// ADR-0087 amendment: `--session-window-source db` reads the window from
// evolution.load_session_window_v1 every few seconds instead of --session-window
// (cellular profile only). Exactly one of the two is given.
bool window_from_database{};
// M10.5c: dev only, 60..14400 s; 0 keeps the default (300 s, ADR-0091).
std::uint64_t max_grant_lifetime{};
// M10.9 (ADR-0097, dev only): `--m10-load-governor off` keeps measuring and exposing the
@@ -68,15 +72,16 @@ struct M10Options {
std::vector<std::string> life_routes;
[[nodiscard]] bool session_any() const noexcept {
return !listen.empty() || !certificate.empty() || !key.empty() || !issuer.empty() ||
!environment.empty() || !session_window.empty() || max_grant_lifetime != 0 ||
!area.empty() || !handoff_key.empty() || !neighbours.empty() || !load_governor;
!environment.empty() || !session_window.empty() || window_from_database ||
max_grant_lifetime != 0 || !area.empty() || !handoff_key.empty() ||
!neighbours.empty() || !load_governor;
}
[[nodiscard]] bool any() const noexcept {
return session_any() || !life_routes.empty();
}
[[nodiscard]] bool complete() const noexcept {
return !listen.empty() && !certificate.empty() && !key.empty() && !issuer.empty() &&
!environment.empty() && !session_window.empty();
!environment.empty() && (session_window.empty() == window_from_database);
}
};
// Actions are handed to the host as soon as they are scheduled (at most 8 ticks ahead).
@@ -117,6 +122,8 @@ template <typename Host> class M10Bridge {
M10Bridge bridge;
if (!o.any())
return bridge;
if (o.window_from_database)
return fail("error m10-window-source"); // The cellular profile only.
const auto window = server::SessionWindow::open(o.session_window, wall_seconds());
if (!window)
return fail(window.error() == server::SessionWindow::Error::expired