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
@@ -63,7 +63,7 @@ spec:
if [ -n "$REGION_SESSION" ]; then
m10=(--m10-listen "$REGION_SESSION_LISTEN" --m10-cert /run/session/server.pem
--m10-key /run/session/server.key --m10-issuer /run/session/issuer.pub
--m10-environment "$REGION_SESSION" --session-window "$REGION_SESSION_WINDOW")
--m10-environment "$REGION_SESSION" --session-window-source db)
grant=(--m10-max-grant-lifetime "$REGION_M10_MAX_GRANT_LIFETIME")
fi
# Lineage keeps its 20 s drain. Both profiles take the overlay grant ceiling;
@@ -100,8 +100,6 @@ spec:
# Session listener address; the policy check allows only this loopback value
# outside region/dev-session-route.
- {name: REGION_SESSION_LISTEN, value: "127.0.0.1:7400"}
# Absolute UTC expiry; route overlays must provide activation-id:unix-seconds.
- {name: REGION_SESSION_WINDOW, value: ""}
# DEV-only grant ceiling; overlays must keep this within the server contract.
- {name: REGION_M10_MAX_GRANT_LIFETIME, value: "300"}
ports:
@@ -1,5 +1,5 @@
# With the route, the opt-in M10 QUIC listener binds the pod interface. The absolute
# expiry is committed so a delayed Argo sync fails closed (ADR-0087).
# With the route, the opt-in M10 QUIC listener binds the pod interface. Its session window
# is not in Git: the region reads it from SQL, set in the admin portal (ADR-0087 amendment).
apiVersion: apps/v1
kind: Deployment
metadata:
@@ -12,7 +12,6 @@ spec:
env:
- {name: REGION_SESSION, value: "dev"}
- {name: REGION_SESSION_LISTEN, value: "0.0.0.0:7400"}
- {name: REGION_SESSION_WINDOW, value: "dev-20261027T175219-2121894c:1793137939"}
- {name: REGION_M10_MAX_GRANT_LIFETIME, value: "14400"}
ports:
# QUIC (ADR-0090): UDP only; nothing listens on TCP 7400.
@@ -38,6 +38,8 @@ spec:
- {name: PGSERVICEFILE, value: /run/postgres/pg_service.conf}
- {name: EVO_PGPASS_SOURCE, value: /run/postgres/pgpass}
- {name: EVO_PG_RUNTIME_ROLE, value: set-by-overlay}
# ADR-0182: the admin API's group role; empty grants no admin functions.
- {name: EVO_PG_ADMIN_ROLE, value: ""}
resources:
requests: {cpu: 100m, memory: 64Mi}
limits: {memory: 128Mi}
@@ -24,3 +24,7 @@ patches:
- op: replace
path: /spec/template/spec/containers/0/env/3/value
value: aevolution_runtime
# Operator-created NOLOGIN group of the admin portal's login (ADR-0182).
- op: replace
path: /spec/template/spec/containers/0/env/4/value
value: aevolution_admin