Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript
9.6 KB
Raw Blame

Self-hosted Desktop GFS operator parity

This page documents the self-hosted boundary that gives the initial Desktop identity GFS operator parity with its linked Control Admin. The relationship is created only by supported initial setup, is scoped to GFS, and is resolved from authoritative lifecycle state on every authorization decision.

Self-hosted Desktop GFS operator parity

Security boundary

Operator authority exists only when all of the following are true:

  1. The external session is authenticated.
  2. The Desktop user is active and its authentication generation matches the token.
  3. The linked Control Admin is active and its session generation matches.
  4. The current immutable link generation is active and matches both exact IDs.

Any missing, stale, retired, malformed, or conflicting state fails closed. A bare user UUID never implies operator authority. Revoking the link removes only the operator elevation; the Desktop user may continue using ordinary GFS permissions while active.

Lifecycle

  • Initial setup creates the Desktop identity, default membership, Control Admin, and generation 1 link atomically.
  • Control UI revoke records the actor, reason, request ID, idempotency outcome, and a retained revoked tombstone.
  • Reactivation inserts a new successor generation after an explicit row-version check. A revoked generation is never mutated back to active.
  • Parent retirement revokes the active generation before marking the parent retired. Restrictive foreign keys prevent hard deletion from erasing link history.
  • Session and authority generations are checked at the data-plane boundary, so previously issued tokens cannot continue to authorize a retired user or a revoked/stale operator generation.

Request and rate-limit boundaries

External REST applies the GFS edge backstop in this order:

token-IP 600/min → authenticated client-IP 1200/min → aggregate 1800/min

Control API then applies distributed, authority-aware limits:

  • token mint: 10/min per Desktop user;

  • per-class budgets, each applied per session, per (class, trusted client IP) and per resolved actor:

    Class Routes Default Env var
    resource resolve, capabilities, upload status, resources, affordances, children 480/min CONTROL_API_EXTERNAL_GFS_RESOURCE_READ_RL_PER_MIN
    proxy-read GET proxy/:rid 480/min CONTROL_API_EXTERNAL_GFS_PROXY_READ_RL_PER_MIN
    grants-read GET grants 120/min CONTROL_API_EXTERNAL_GFS_GRANTS_READ_RL_PER_MIN
    shares-read GET shares 120/min CONTROL_API_EXTERNAL_GFS_SHARES_READ_RL_PER_MIN
    mutations every write, grant and share mutation 90/min CONTROL_API_EXTERNAL_GFS_OPERATION_RL_PER_MIN
  • all classes together: 1200/min per trusted client IP. The four read defaults sum to the same 1200.

Each value is overridable up to a compiled ceiling. Control API refuses to boot when the mutation budget exceeds the resource, grants or shares read budget, or when any read budget exceeds the per-IP bucket. The proxy has no mutation counterpart and is checked only against the per-IP bucket.

These Postgres buckets count calendar minutes. Behind them, each route has a per-replica in-memory backstop whose 60 s window starts at the first request of a key. The two windows are not aligned, so one actor can get up to about 2L − 1 requests of one class through in any sliding 60 s, per Control API replica (959 at the 480 resource default), not L.

When the rate-limit Postgres backend cannot answer, the external GFS routes fail closed: 503 { "error": "gfs_rate_limit_unavailable" } with Retry-After: 2. The limiter uses its own pool (RATE_LIMIT_POOL_MAX, default 6), so a saturated core pool does not take it down. The limit is not skipped.

GFSC applies a second, per-replica limit to agent (host principal) calls: GFS_AGENT_READ_RL_PER_MIN_PER_REPLICA (default 300) and GFS_AGENT_WRITE_RL_PER_MIN_PER_REPLICA (default 120). Host Context Controller writes both into every gfsc pod from CONTEXT_MAPPER_GFSC_AGENT_READ_RL_PER_MIN_PER_REPLICA and CONTEXT_MAPPER_GFSC_AGENT_WRITE_RL_PER_MIN_PER_REPLICA. Changing either value, or the gfsc image, changes the gfsc pod template and restarts the gfsc fleet once.

The buckets remain separate. A request rejected by a narrower boundary cannot consume a broader bucket. IPv6 canonical-key normalization and cross-layer 429 header coherence are tracked as independent global follow-ups:

The non-GFS external directory, team, member, invitation, workflow, decision, notification, and OAuth route families also retain two independent edge gates: the source-IP backstop defaults to 1,200/min and the per-session fairness bucket defaults to 120/min; authenticated operation buckets default to 60/min where the route defines them. These are independent scopes, not one global numeric hierarchy: an operator may override any value without making the Control API fail to boot, and the service preserves the exact positive integer provided. At startup, a crossed recommendation (operation > session or session >= client-IP) emits an advisory diagnostic because one bucket may dominate or become redundant; it never silently clamps the operator's value. The IP gate is intentionally first, so rotating or malformed session tokens cannot evade the source-IP ceiling, while a shared NAT is not limited to the narrower per-session budget. These gates do not change the GFS read/mutation budgets above.

Migration sequence

Migration Responsibility
0091_gfs_desktop_operator_links Explicit initial_setup Desktop/Admin relationship.
0092_gfs_audit_actor_correlation Desktop actor, effective admin, source, and request correlation.
0093_gfs_desktop_operator_link_generations Immutable generations, lineage, tombstones, CAS, and restrictive parent FKs.
0094_desktop_user_retirement_lifecycle Active/retired Desktop lifecycle, typed retirement actors, and idempotent outcomes.
0095_gfs_lifecycle_authority_projection GFSC lifecycle projection, readiness checks, and least-privilege reads.
0096_control_admin_session_version_default Safe session-generation defaults for existing Control Admin rows.

The deployment pre-gate applies migrations in order, reconciles the runtime roles and ACL manifest, verifies readiness, and only then exposes consumers. Rollback disables new issuance and mutations; it does not down-migrate or delete retained lifecycle evidence.

Rollout and compatibility contract

The first deployment of generation-aware authority deliberately invalidates older external session tokens that do not carry authGeneration. Operators must expect an ordinary sign-in again after the rollout; this is a bounded security migration, not a legacy-token grace path. Deploy the Control API token producer only after the GFSC lifecycle projection and readiness gate are green, so a mixed fleet cannot issue claims an older data-plane verifier would silently ignore.

The external member-retirement endpoint now requires a non-empty reason and an Idempotency-Key. First-party Profile UI callers send both values. Clients using the external API directly must adopt this contract before upgrading; the server does not synthesize an idempotency key because doing so would make a retry non-deterministic and could duplicate a retirement side effect.

This is a version-one contract change: a direct caller that omits either field receives 400 and must be upgraded before the new Control API is rolled out. The first generation-aware deployment likewise invalidates pre-existing session tokens without authGeneration; users must sign in once after the rollout.

Validation surface

  • Unit and integration suites cover setup, authority resolution, lifecycle transitions, token generations, audit attribution, route guards, rate-limit bucket separation, migration/readiness contracts, and Desktop/Control UI states.
  • The browser certificate covers setup-linked operator access, operator root CRUD, ordinary-user behavior, grant/share lifecycle, visible Control UI revoke, reactivation/revoke generations, and audit correlation.
  • The supported branch-owned Minikube profile is reused with local images; the pre-gate binds the deployed marker to the exact worktree HEAD and cluster fingerprint.