# seg Updated Dec 1, 2026 > Experimental state revision layer over MCP and REST. An LLM acts as the language interface, while seg enforces the declared schema, trust tiers, provenance, and retraction. - Base URL `https://seg-api.relog.run` - Docs `https://seg.relog.run/docs/` - Status: experimental, invite-only. Email hello@relog.run to request access. `seg` records observations against a declared session schema, resolves state by source trust tiers, and routes unresolved issues to the right tier. Each session has its own scope, source trust policy, vocabulary, rules, and constraints and can install builtin logics. REST, MCP, and the monitor share the same workspace data. ## Authentication Send `Authorization: Bearer ` to `/v1/*`, `/mcp`, and `/api/state`. Issued keys start with `seg_live_`. Each key is scoped to one workspace and carries a server-enforced `tier` (`>= 1`, default `1`; `T1` = authoritative root, larger numbers = less trusted) plus an optional pinned `source`. Clients can weaken their tier per observation (larger number), never strengthen it past the key or session cap. Resources in other workspaces return 404. Query-string tokens are rejected with 400. ## Health check Unauthenticated `GET /health` returns HTTP 200 with `{"status":"ok"}` or `{"status":"degraded"}`. ## REST Send JSON objects with `Content-Type: application/json` for write requests. A question mark marks an optional field. Session IDs use 1–64 lowercase ASCII letters, digits, hyphens, or underscores and start with a letter or digit. | Method | Path | Success | Input | | --- | --- | --- | --- | | GET | `/v1/sessions` | 200 | Query `limit?`, `offset?` | | POST | `/v1/sessions/open` | 201 / 200 | `id?`, `title?`, `edition?`, `logics?`, `include_vocabulary?`, `limit?`, `offset?`, `order?` | | GET | `/v1/sessions/{id}/state` | 200 | Query `detail?`, `entity?`, `attribute?`, `include_vocabulary?`, `limit?`, `offset?`, `order?` | | POST | `/v1/sessions/{id}/record` | 200 | Single record fields or `{"events":[...]}` (1–100) | | POST | `/v1/sessions/{id}/retract` | 200 | Exactly one of `source` or positive integer `event_id` | | POST | `/v1/sessions/{id}/tick` | 200 | `now` | | GET | `/v1/sessions/{id}/why` | 200 | Query `entity`, `attribute`, `limit?`, `offset?` | | POST | `/v1/sessions/{id}/schema` | 200 | Patch fields, `dry_run?` | | POST | `/v1/sessions/{id}/query` | 200 | `kind: "what_if"` (`retracts?`, `events?`, `now?`) or `kind: "ask"` (`goal`, `hypotheses?`, `include_explanations?`) | | POST | `/v1/sessions/{id}/compact` | 200 | `mode?` (`structural`, `candidates`, `prune`), `keep_per_source?`, `preserve_tiers?`, `limit?`, `targets?`, `dry_run?` | | DELETE | `/v1/sessions/{id}` | 200 | Empty body | Unknown or repeated query parameters and unknown JSON keys return 400. State and why requests require an empty body. Session IDs on session routes come from the path. REST and MCP use integer `limit` values from 1 to 500 and nonnegative integer `offset` values (default 0). A `*_total` field counts all matches before pagination, and `has_more` indicates more items follow in that endpoint's pagination direction. Full state facts and why start at the newest window and return items in chronological order (increasing `offset` skips newer items). Other endpoints paginate forward from the start of the requested order. ### Sessions and facts - **List** returns `editions`, `logics`, `sessions`, `sessions_total`, and `has_more`. Sessions are newest first (default `limit` 100). `editions` lists supported semantic editions (`["2026.1"]`) and `logics` contains the 8 sorted builtin logic names. Each session summary includes `id`, `title`, `created_at`, `updated_at`, `active_events`, `cells_count`, `rules_count`, `open_model`, `open_user`, and `quiescent`. A missing title is null. - **Open** (`POST /v1/sessions/open`) creates or resumes a session in one idempotent call and returns compact state fields plus `created` (boolean). Creating a new session returns 201 (`created: true`) and requires `key.tier <= 2` (otherwise 403); reopening an existing ID returns 200 (`created: false`) for any valid workspace key. Omit `id` to generate a UUID v4. `title` (up to 1,024 bytes), semantic `edition` (default `"2026.1"`), and `logics` apply only on creation and are pinned to the session header. - **State** (`GET /v1/sessions/{id}/state`) is strictly read-only. Default `detail=compact` returns `session`, `edition`, `clock`, `active_events`, `rules_count`, `commits_count`, `logics`, `scope`, `signals`, `capacity` (`active_events`, `max_active_events`, `compactable_events`, `needs_compaction`, turning true at `>= 80%`), `cells`, `cells_total`, `has_more`, `open`, and optionally `vocabulary`. Default `limit` is 100 cells. `order=recent` (default) puts most recently updated cells first; `order=oldest` follows first-seen order. `include_vocabulary` defaults to `true`. Attribute filters resolve aliases. - **Full state** (`detail=full`) adds `facts`, `facts_total`, `facts_has_more`, `rules`, `commits`, and `logic_contracts`. Facts are current values with `seq`, `entity`, `attribute`, `arity`, and `value` in chronological order (offset counts from newest). `logic_contracts` returns each installed logic's `name`, `summary`, `attributes`, `aliases`, and `alerts` (plus `rules` only when enabled for the workspace). Top-level `rules` and `commits` contain user expressions. - **Record** accepts either single-event fields or `{"events":[...]}` (1–100 observations validated before mutation and persisted in one transaction; mixing `events` with single-event fields returns 400). Schema vocabulary is always strict: undeclared attributes or new entities whose effective tier exceeds `scope.entity_max_tier` are not persisted and return `{"recorded":false,"ignored":true,"entity","attribute","reason","required_tier","escalate_to"}`. Exceeding the session's `max_active_events` cap returns HTTP 409 (`session_capacity_exceeded`) with `active_events`, `max_active_events`, and `compactable_events`. Single-event mode returns `recorded: true`, `session`, `event_id`, `entity`, `canonical_attribute`, `tier`, `rules_fired`, `revisions_applied`, `hit_round_limit`, `current`, `outdated`, `fallbacks`, `uncertain`, `open_total`, `open_model`, `open_user`, `needs_user_input`, `open`, and `capacity`. Batch mode returns `session`, `recorded_count`, `ignored_count`, `event_ids`, `rules_fired`, `revisions_applied`, `hit_round_limit`, `open_total`, `open_model`, `open_user`, `needs_user_input`, `open`, `capacity`, and `results`. - **Retract** returns `session`, `target`, and `retracted_events`. Use a nonempty `source` string or positive integer `event_id`. Retraction recomputes derived effects and can promote fallbacks. Retracting a source/event more trusted than `key.tier` (smaller tier number) or outside a key's pinned source returns 403. - **Tick** requires `key.tier <= 3` (otherwise 403), takes a nonempty `now` string, advances the clock, and runs time-dependent rules (idempotent when `now` matches the current clock). Returns `session`, `now`, `rules_fired`, `revisions_applied`, and `hit_round_limit`. - **Why** returns `session`, cell fields, optional `updated_at` (UTC ISO-8601 timestamp of the latest active observation on the cell), `provenance`, `provenance_total`, and `has_more` (default `limit` 50). Each provenance entry has `entry_id`, `source`, `action`, and `values`, plus `tier`, `wrong`, `depends_on`, `reason`, and `created_at` (UTC ISO-8601) when present. Both `entity` and `attribute` must be non-empty after trimming and at most 1,024 bytes. - **Query** (`POST /v1/sessions/{id}/query`) is strictly read-only and never mutates stored state. Supports `kind: "what_if"` (1–50 total ops across optional `retracts`, `events` honoring explicit `tier` or declared source tier without key-tier clamping, and `now` → `fact_changes`, `closed_open`, `new_open`, `remaining_open`, `ignored`, `retracted_events`, `rules_fired`, `revisions_applied`, `hit_round_limit`, `signals`) and `kind: "ask"` (`goal` 1–16 atoms `{entity, attribute, value, negated?}`, optional `hypotheses` 0–24, optional `include_explanations` → `verdict`: `entailed`/`refuted`/`contingent`/`unsatisfiable`, `necessary`, `next_questions` with `required_tier`/`escalate_to`/`condition?`, `why`, optional `explanations`, `truncated`). - **Compact** (`POST /v1/sessions/{id}/compact`) compacts a session in place in three modes: - `mode: "structural"` (default, requires `key.tier <= scope.schema_max_tier`): deterministic timeline compaction with mandatory equivalence verification; removes dead retractions (preserving per-source retraction reputation), collapses redundant clock steps, and prunes superseded lower-tier rewrites exceeding `keep_per_source` (`1..=64`, defaults to `scope.provenance_depth` or `1`) only for `tier > preserve_tiers` (`>= 1`, default `2`, preserving `T1`/`T2` audit history). Supports `dry_run: true`. - `mode: "candidates"` (read-only, any valid workspace key): returns up to `limit` (`1..=50`, default `30`) coldest unprotected `tier > preserve_tiers` cells sorted by `(query_hits, last_accessed_seq, latest_event_id)` ascending, excluding `tier <= preserve_tiers`, open escalations, attributes referenced by active rules/constraints, and entities depended on via `depends-on`/`located-in`. - `mode: "prune"` (requires `key.tier <= scope.schema_max_tier`): narrow cleanup over `targets` (`1..=50` `{entity, attribute, summary_value?, summary_reason?}`). Rejects protected core targets (`rejected_protected`) and refuses to apply (`safe: false`) if any protected target was requested or if pruning would introduce or drop any open escalation (`new_open`). Supports `dry_run: true`; replacement `summary_value` facts are recorded at `max(caller_tier, original_cell_tier)` (never escalating trust above the pruned cell). - **Delete** (`DELETE /v1/sessions/{id}`) deletes a session and its history; requires `key.tier <= scope.schema_max_tier` (403 otherwise). Returns `{"session","deleted"}`. Cells contain `entity`, `attribute`, `arity`, `current`, `outdated`, `fallbacks`, and `uncertain`. Vocabulary contains `attributes` (`name`, `arity`, `origin`: `logic` or `session`, optional `max_tier`) and `aliases` (`alias`, `canonical`). Record fields are `entity`, `attribute`, `values?`, `wrong?`, `source?` (default `user`, or the API key's pinned source; passing a different source than a pinned key returns 403), `reason?` (optional short provenance note, at most 256 UTF-8 bytes, shown only in `why`), and optional observation controls (`arity` is not accepted on `record` — define attributes in `schema` first): | Field | Values, default first | | --- | --- | | `polarity` | `pos`, `neg` | | `time` | `now`, `changed`, `future`, `temporary` | | `hedge` | `plain`, `hedged` (steps effective tier outward by `+1`, e.g. `T4` → `T5`) | | `tier` | integer `>= 1` (bounded by server to `max(key.tier, scope.sources[source])`) | Trust tier ladder (smaller = more trusted, open-ended outward): `T1` = authoritative root (human/DB/system), `T2` = copilot (human+LLM), `T3` = verified tool/checker, `T4` = autonomous LLM / undeclared source default, `T5+` = outer untrusted spheres. Independent corroboration across 2+ distinct external sources steps one sphere closer to `T1` (`-1`, based on the second-strongest source) up to `T2` (`T1` always requires direct authoritative input). Equal-tier conflicting assertions from distinct sources retreat to `tied`, and weaker denials never erode a stronger-tier fact. Supply at least one nonempty string in `values` or `wrong`. ### Session schema changes (`POST /v1/sessions/{id}/schema`) - **Preview (`dry_run: true`):** replays on a copy without saving and returns `dry_run: true`, `closed_open`, `new_open`, `remaining_open`, `fact_changes` (`entity`, `attribute`, `before`, `after`), and `rules_fired`. Allowed for any valid API key. - **Apply (`dry_run: false`, default):** requires `key.tier <= scope.schema_max_tier` (otherwise HTTP 403), applies and saves atomically, returning `session`, `defines_applied`, `aliases_applied`, `rules_applied`, `commits_applied`, `logics_applied`, and `rules_fired`. | Patch field | Value | | --- | --- | | `defines` | Array of `{attribute, arity, max_tier?}` (`single` or `multi`; optional integer `max_tier >= 1`) | | `aliases` | Array of `{alias, canonical}` | | `rules` | Array of structured rules (`name`, `kind`: `demote`/`exclusion`/`implication`, `when`: `[{attr, value}]`, `target_attr`, `target_value`, `strength`: 1–4) | | `raw_rules` | Array of `rexp` rule expressions | | `commits` | Array of `rexp` constraint expressions | | `logics` | Array of builtin logic names | | `scope` | `{capture?, ignore?, sources?, default_max_tier?, entity_max_tier?, schema_max_tier?, unverified?, provenance_depth?}` (replaces full scope; empty object resets to defaults) | | `forgive_sources` | Array of source names whose accumulated `untrusted` retraction history should be reset | Scope fields: `sources` (`[{source, tier}]`, `>= 1`; when non-empty, undeclared sources default to `T4`, and when empty, source tier falls back to `key.tier`), `default_max_tier` (default `4`), `entity_max_tier` (default `4`), `schema_max_tier` (default `2`; set to `1` to lock ontology, mutating compact/prune, and session deletion to `T1`), `unverified` (`"escalate"` default or `"silent"`), `provenance_depth` (`1..=64` or `null` unlimited; live per-`(entity, attribute, source)` cap for `T3+` that preserves `T1`/`T2`, never triggers `untrusted`, never lets `temporary` evict `now`, and applies to `multi` only on `changed` rewrites). #### `rexp` syntax (`raw_rules` and `commits`) Variables start with `?`. Single-token labels are unquoted symbols; quote values containing spaces. The `r/` prefix is reserved for the engine: never start user attributes, aliases, rule names, constraint names, or custom predicates with `r/`, and do not reuse builtin logic or rule names. - **Rules (`r/rule`):** `(r/rule (r/read ...) [(r/from ...)] [(r/where ...)] (r/to ...))`. Requires at least one positive pattern in `r/read` or `r/from`, plus `r/to`. - **Readable patterns:** `(current ?e ?attr ?v)`, `(updated ?e ?attr ?v)`, `(now ?t)`, and `(r/absent )` in `r/read` (variables appearing only inside `r/absent` are local wildcards; positive + absence patterns share an 8-pattern cap). - **Guards (`r/where`):** - `=`, `!=`, `<`, `<=`, `>`, `>=` (with optional nested binary arithmetic `+`, `-`, `*`, `/` over finite numbers; division by zero or invalid arithmetic fails the guard). - `starts-with`, `ends-with`, `contains` on text atoms. - `semver<`, `semver<=`, `semver>`, `semver>=`, `semver=` (SemVer 2.0.0, optional leading `v`, build metadata ignored for precedence). - **Actions (`r/to`, allowlisted):** - `(revise ?e ?attr ( ?v) [(because )])` where `` is `assert`, `change`, `not`, `for`, or `against`. - `(retract-source ?src)` and `(retract-event ?id)`. - `(alert/ ...)` for custom issues (nonempty name without `/` or whitespace; reserved kinds: `vocab`, `tied`, `empty`, `unverified`, `competition`, `commit`, `choice`, `commit-unsat`, `commit-limit`). - **Constraints (`r/commit`):** `(r/commit [] [(r/rank hard|)] (r/from ...) (r/to r/false | ...))`. #### Builtin logics (8) - `temporal`: `starts-at` (alias `since`), `expires-at` (alias `until`), `status` (`single`). Demotes `status=active` before start or at/after expiration; emits `expired` and `invalid_window`. - `hierarchy`: `depends-on`, `located-in` (`multi`), `status` (`single`). Transitive closure, cycle detection (`cycle`), and demoting active dependents of closed parents. - `deontic`: `must-have`, `forbidden` (`multi`). Emits `violation` for missing required attributes or prohibited values. - `trust`: emits `untrusted` after `>= 2` retractions (persisted across compaction; reset explicitly via `forgive_sources` in `schema`). - `defaults`: `kind`, `default-for-kind`, `default-attribute`, `default-value` (`single`). Applies a weak default (`for 1`) when the target attribute has no current value; overridden cleanly by explicit facts. - `lifecycle`: `lifecycle`, `status` (`single`), `depends-on` (`multi`). Archived entities lose active status; active dependents of deprecated or archived entities raise `lifecycle`. - `uniqueness`: `host`, `port`, `slug` (`single`), `route`, `unique-key` (`multi`). Raises `collision` when distinct entities share a resource. - `budget`: `budget-group` (`multi`), `budget-attr`, `budget-limit`, `budget-max-count` (`single`). Sums numeric values and counts items per group, per entity, or session-wide (resolving aliases); raises `budget` when limits are exceeded. ### Signals and open events Signals include `quiescent` (active events and no open items), `needs_review`, `needs_model_review`, `needs_user_input`, `open_total`, `open_model`, and `open_user`. Each open event has `kind`, `target` (`model` or `user`), and when tier-routed, `required_tier` (`>= 1`) and `escalate_to` (matching source names from `scope.sources` with `tier <= required_tier`; `required_tier <= 2` routes to `user`, `>= 3` routes to `model`): | Kind | Fields | | --- | --- | | `tied` | `entity`, `attribute`, `candidates`, `required_tier`, `escalate_to?` | | `unverified` | `entity`, `attribute`, `candidates`, `required_tier`, `escalate_to?` | | `empty` | `entity`, `attribute` | | `choice` | `definite_keep`, `definite_drop`, `variants` | | `constraint_violation`, `constraint_unsat` | `name`, `facts` | | `constraint_limit` | `name`, `reason`, `facts` | | `rule_competition` | `fact`, `rules` | | `violation` | `entity`, `policy`, `attribute`, `value?` | | `expired` | `entity`, `due` | | `invalid_window` | `entity`, `args` (`[starts_at, expires_at]`) | | `cycle` | `attribute` (relation), `args` (`[a, b]`) | | `lifecycle` | `entity`, `policy` (stage), `value` (dependency) | | `collision` | `policy` (kind), `args` (`[e1, e2, ...]`) | | `budget` | `entity`, `attribute`, `policy` (`sum`/`count`), `args` (`[actual, limit]`) | | `untrusted` | `source`, `count` | ### Errors and limits REST errors use `{"error":"..."}`: 400 invalid request/arguments/rule, 401 unauthorized (`WWW-Authenticate: Bearer`), 403 forbidden (key `tier` exceeds `schema_max_tier` on schema/compact/prune/delete, `> 2` when creating a new session, `> 3` on `tick`, exceeds target source/event tier on `retract`, or `source` differs from key's pinned source), 404 not found, 405 wrong method (`Allow`), 409 conflict (`session_capacity_exceeded` when active events reach `max_active_events`), 413/415/431 payload/content-type/header limits, 429 rate limit (`Retry-After`), 500/503 internal/unavailable. Defaults: 2,000 active events/session, 16 MiB history/session (64 MiB/workspace), 500 user rules/session, up to 32,768 active records in rule evaluation, 8 patterns/rule, 16 propagation rounds, 1–100 events/batch, 1,024 bytes per record or structured patch string, 256 bytes for `reason`, page `limit` 1–500, `compact` `keep_per_source`/`provenance_depth` 1–64 and `candidates.limit`/`prune.targets` 1–50. Global constraint resolution runs per connected conflict group (up to 512 facts and 1,024 constraints; degrades softly to `constraint_limit`). Read-only `query`: `what_if` 1–50 ops; `ask` 1–16 goal atoms, 24 hypotheses, depth 6, 64 branches, up to 3 `next_questions` and 3 `explanations`. Requests are rate-limited (HTTP 429 with `Retry-After`). ## MCP Connect to `POST https://seg-api.relog.run/mcp` using Streamable HTTP and JSON-RPC 2.0 with `Content-Type: application/json`. Include `Mcp-Session-Id` after initialization to retain the active session. `DELETE /mcp` closes the session (204). `GET /mcp` returns 405 (`Allow: POST, DELETE`). Codex: ```sh codex mcp add seg --url https://seg-api.relog.run/mcp --bearer-token-env-var SEG_API_TOKEN ``` Antigravity: ```sh agy mcp add --header "Authorization: Bearer $SEG_API_TOKEN" seg https://seg-api.relog.run/mcp ``` Claude Code: ```sh claude mcp add --transport http --scope user seg https://seg-api.relog.run/mcp --header "Authorization: Bearer $SEG_API_TOKEN" ``` OpenCode (`opencode.json`): ```json {"mcp":{"seg":{"type":"remote","url":"https://seg-api.relog.run/mcp","oauth":false,"headers":{"Authorization":"Bearer {env:SEG_API_TOKEN}"}}}} ``` JSON: ```json {"mcpServers":{"seg":{"url":"https://seg-api.relog.run/mcp","headers":{"Authorization":"Bearer "}}}} ``` | Tool | Annotations | Summary | | --- | --- | --- | | `seg_session_open` | idempotent | Create or resume a session, make it active, return compact state | | `seg_session_list` | read-only, idempotent | List sessions and available builtin logics | | `seg_state` | read-only, idempotent | Read compact state or full review (`detail: "full"`) | | `seg_record` | write | Record a single observation or batch (`events`, 1–100) with optional `reason` | | `seg_retract` | write | Retract by `source` or `event_id` and replay | | `seg_tick` | idempotent | Advance logical clock and propagate time rules | | `seg_why` | read-only, idempotent | Explain cell state and provenance (including `reason`) | | `seg_schema` | write | Apply or preview (`dry_run: true`) session scope, vocabulary, rules, commits, logics, and `forgive_sources` | | `seg_query` | read-only, idempotent | Run read-only `what_if` counterfactuals (1–50 ops) or goal-directed `ask` queries | | `seg_compact` | idempotent | Compact in place: `mode: "structural"` (deterministic), `"candidates"` (read-only coldest unprotected `T3+` cells), or `"prune"` (guarded narrow cleanup) | All 10 tools set `destructiveHint: false` and `openWorldHint: false`. Prompts: `seg-bootstrap` (`session?`) and `seg-review` (`session?`). ## Two-Phase Closed-Schema Workflow, Escalations & Compaction - **Phase 1 (Setup & Lock):** Open a session (`key.tier <= 2`), define its strict vocabulary (`defines` with optional `max_tier`), `scope.sources`, `default_max_tier`, `entity_max_tier`, optional `provenance_depth`, builtin `logics`, `rules`, and `commits` via `seg_schema` (`dry_run: true` to preview). Once reviewed, set `scope.schema_max_tier` to `1` to lock the ontology to `T1`. - **Phase 2 (Operate):** Connect autonomous LLM agents using pinned `T4` API keys (`tier` 4, pinned `source: "llm"`). Batch 2+ grounded observations in one `events` call. Treat `current` as active truth; never present `outdated`, `fallbacks`, or `uncertain`/`unverified` values as current. - **Tier-routed escalations & local verifiers:** Route `open` items using `required_tier` and `escalate_to`. For outer-tier items (`target: "model"`, `required_tier >= 3`), run local verifier scripts and record verified results via `seg_record` with an explicit verifier `source` (e.g., `check:`) and short `reason`. `seg` never executes user code on the server. - **Compaction protocol (`seg_compact`):** When `capacity.needs_compaction` is true or capacity is tight: (1) always run `mode: "structural", dry_run: true` first; (2) only if `compactable_events` is small, call read-only `mode: "candidates"`; (3) preview `mode: "prune", dry_run: true` and verify `safe: true` before applying; (4) never attempt to prune `T1`/`T2`, open escalations, or active dependencies—start a new session or escalate instead. Starter recipes for `seg_schema` / `POST /v1/sessions/{id}/schema`: - `project`: `{"defines":[{"attribute":"status","arity":"single"},{"attribute":"owner","arity":"single","max_tier":2},{"attribute":"environment","arity":"single"},{"attribute":"branch","arity":"single"},{"attribute":"lifecycle","arity":"single"},{"attribute":"starts-at","arity":"single"},{"attribute":"expires-at","arity":"single"},{"attribute":"stack","arity":"multi"},{"attribute":"decision","arity":"multi","max_tier":2},{"attribute":"blocker","arity":"multi"},{"attribute":"constraint","arity":"multi","max_tier":2},{"attribute":"depends-on","arity":"multi"}],"logics":["temporal","hierarchy","lifecycle"],"scope":{"sources":[{"source":"human","tier":1},{"source":"copilot","tier":2},{"source":"verifier","tier":3},{"source":"llm","tier":4}],"schema_max_tier":1,"ignore":["small-talk","brainstorming","temporary-working-directory"]}}` - `infra`: `{"defines":[{"attribute":"status","arity":"single"},{"attribute":"region","arity":"single"},{"attribute":"host","arity":"single","max_tier":2},{"attribute":"owner","arity":"single","max_tier":2},{"attribute":"port","arity":"single","max_tier":2},{"attribute":"version","arity":"single"},{"attribute":"slug","arity":"single"},{"attribute":"lifecycle","arity":"single"},{"attribute":"starts-at","arity":"single"},{"attribute":"expires-at","arity":"single"},{"attribute":"route","arity":"multi"},{"attribute":"depends-on","arity":"multi"},{"attribute":"located-in","arity":"multi"},{"attribute":"must-have","arity":"multi"},{"attribute":"forbidden","arity":"multi"},{"attribute":"budget-group","arity":"multi"}],"logics":["temporal","hierarchy","deontic","lifecycle","uniqueness","budget"],"scope":{"sources":[{"source":"human","tier":1},{"source":"ci","tier":2},{"source":"verifier","tier":3},{"source":"llm","tier":4}],"entity_max_tier":3,"schema_max_tier":1}}` - `policy/ops`: define session entities and critical attributes with `max_tier: 1` for authoritative fields and `max_tier: 3` for corroborated fields; lock with `scope.schema_max_tier: 1` once reviewed. ## Monitor `GET /api/state` accepts `session?`, `events?` (1–50, default 12), `entity?`, `limit?` (1–500, default 50), and `offset?`. Returns `tenant_id`, `sessions` (up to the 100 most recently updated sessions), and `selected` (`meta`, `clock`, `scope`, `active_events`, `signals`, `recent_events` with integer `tier` and optional `created_at`, `open` with `required_tier`/`escalate_to`, `cells_total`, `has_more`, `current`, `outdated`, `fallbacks`, `uncertain`).