upsert_identity
Create or update an identity record to persist allowed roles, independence class, and persona description, enabling persona continuity across projects.
Instructions
Create or update an identity record (cross-project actor declaration). Identity records persist allowed_roles / independence_class / persona_description in a key space separate from session state (prismind:identity:{user}:{identity_name}), realizing ADR-2026-05-27-09 D-3's persona-continuity gate at the API level. identity_name is the same string SessionState.author uses; list_context_authors joins the identity record onto each author entry so callers see allowed_roles in one round-trip. independence_class is required on every upsert (re-declared, not preserved) -- this is the '書き忘れ不能' guarantee. allowed_roles is required unless keep_allowed_roles=True. persona_description defaults to preserve-on-omit. embodiment is DEPRECATED (ADR-2026-05-29-12); runtime self-declared via the five APIs on Magickit (checkpoint/resume/chatroom_*). Pass omit or null; the field is preserved in the schema only for the staged migration window.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user | No | Owning user (defaults to the configured user_name). | |
| embodiment | No | DEPRECATED (ADR-2026-05-29-12). Pass null or omit. Runtime form is now self-declared on the five APIs at Magickit level. | |
| allowed_roles | No | Roles this identity may assume (e.g. ['proposer', 'reviewer']). Required unless keep_allowed_roles=True. An empty list [] is a legal explicit declaration of 'no allowed roles' (distinct from preserve -- use keep_allowed_roles=True for that). Magickit enforces; Prismind only persists. | |
| identity_name | Yes | Stable identity slug (e.g. 'Heisenberg'). Same value as SessionState.author. | |
| independence_class | Yes | Actor's gating class for ADR-09 D-3. Required on every upsert. | |
| keep_allowed_roles | No | If true, preserve the existing allowed_roles list. Mutually exclusive with allowed_roles. Only valid when the identity already exists. | |
| persona_description | No | Optional human-readable persona note. Omit to preserve the existing value. |