跳转到内容

ak.schema.account_data_operations.v1

← Schemas

Arkret Account Data Self-Management Operation DTOs
ak.schema.account_data_operations.v1 · file: schemas/account-data-operations.schema.json

Closed request/response DTOs for the self-surface actor-private account_data operations (ak.self.account_data.*). PUT builds a ak.account_data.set actor-private write; the server stores content verbatim (clients own canonical encoding and, for sensitive keys, client-side encryption). Every key is a server-versioned compare-and-set whole-value register: writes carry expected_server_revision and the accepted revision is expected_server_revision + 1, so concurrent multi-device writes converge instead of silently overwriting each other. See spec/v1/zh/models/account-data.md §5. account_data_key keys are dot-delimited namespaces validated against account-data-key-registry.json.

* $ · anyOf[5]
Closed request/response DTOs for the self-surface actor-private account_data operations (ak.self.account_data.*). PUT builds a ak.account_data.set actor-private write; the server stores content verbatim (clients own canonical encoding and, for sensitive keys, client-side encryption). Every key is a server-versioned compare-and-set whole-value register: writes carry expected_server_revision and the accepted revision is expected_server_revision + 1, so concurrent multi-device writes converge instead of silently overwriting each other. See spec/v1/zh/models/account-data.md §5. account_data_key keys are dot-delimited namespaces validated against account-data-key-registry.json.
anyOf · anyOf[0] · object · $ref #/$defs/account_data_replace_request_body
Carries the caller-signed ak.account_data.set Event and nothing else. The actor-private typed current result subject is composite[envelope.actor_id, payload.key], so the subject *is* the owner: the Event MUST be signed by the holder and the service MUST NOT author it under its own DID. key, expected_server_revision, and body / encrypted_payload live exclusively in set_event.event.payload and MUST NOT appear at the request top level. A tombstone payload is rejected here: erasure goes through ak.self.account_data.resource.delete.v1, which enforces the registered deletion_mode.
* set_event · allOf[2]
allOf · allOf[0] · object · $ref ./service-operation-dtos.schema.json#/$defs/EventAdmissionSubmission
One exact producer-signed Event submitted to the current governance Station, plus the approval signatures required by a grant, Realm governance or List WIP policy for the Event action or for this registered submit operation. There are no RealmCommit, typed current result, offline-lease or proof-bundle sidecars. approval_signatures is the only sidecar and it is deliberately outside event: the Event bytes and event_id are finished before any approval is signed, so attaching them never changes the Event (zh/authz/constraint-schema.md section 9.2.5).
* event · object · $ref ./event-envelope.schema.json
Closed producer-signed Event. Shared persistent Events become final only when the current Realm governance Station issues a RealmCommit in the derived Realm, Circle, or Sidecar stream.
allOf · allOf[0] · ?
allOf · allOf[1] · ?
allOf · allOf[2] · ?
allOf · allOf[3] · ?
allOf · allOf[4] · ?
allOf · allOf[5] · $ref #/$defs/registered_admission_shape · $ref #/$defs/registered_admission_shape
allOf · allOf[6] · $ref #/$defs/registered_execution_shape · $ref #/$defs/registered_execution_shape
allOf · allOf[7] · ?
allOf · allOf[8] · ?
allOf · allOf[9] · ?
allOf · allOf[10] · ?
allOf · allOf[11] · ?
allOf · allOf[12] · ?
allOf · allOf[13] · ?
allOf · allOf[14] · ?
allOf · allOf[15] · ?
allOf · allOf[16] · ?
allOf · allOf[17] · ?
allOf · allOf[18] · ?
allOf · allOf[19] · ?
allOf · allOf[20] · ?
allOf · allOf[21] · ?
allOf · allOf[22] · ?
allOf · allOf[23] · ?
allOf · allOf[24] · ?
allOf · allOf[25] · ?
allOf · allOf[26] · ?
allOf · allOf[27] · ?
allOf · allOf[28] · ?
allOf · allOf[29] · ?
allOf · allOf[30] · ?
allOf · allOf[31] · ?
allOf · allOf[32] · ?
allOf · allOf[33] · ?
allOf · allOf[34] · ?
allOf · allOf[35] · ?
allOf · allOf[36] · ?
allOf · allOf[37] · ?
allOf · allOf[38] · ?
allOf · allOf[39] · ?
allOf · allOf[40] · ?
allOf · allOf[41] · ?
allOf · allOf[42] · ?
allOf · allOf[43] · ?
allOf · allOf[44] · ?
allOf · allOf[45] · ?
allOf · allOf[46] · ?
allOf · allOf[47] · ?
allOf · allOf[48] · ?
allOf · allOf[49] · ?
allOf · allOf[50] · ?
allOf · allOf[51] · ?
allOf · allOf[52] · ?
allOf · allOf[53] · ?
allOf · allOf[54] · ?
allOf · allOf[55] · ?
allOf · allOf[56] · ?
allOf · allOf[57] · ?
allOf · allOf[58] · ?
allOf · allOf[59] · ?
allOf · allOf[60] · ?
allOf · allOf[61] · ?
allOf · allOf[62] · ?
allOf · allOf[63] · ?
allOf · allOf[64] · ?
allOf · allOf[65] · ?
allOf · allOf[66] · ?
allOf · allOf[67] · ?
allOf · allOf[68] · ?
allOf · allOf[69] · ?
allOf · allOf[70] · ?
allOf · allOf[71] · ?
allOf · allOf[72] · ?
allOf · allOf[73] · ?
allOf · allOf[74] · ?
allOf · allOf[75] · ?
allOf · allOf[76] · ?
allOf · allOf[77] · ?
allOf · allOf[78] · ?
allOf · allOf[79] · ?
allOf · allOf[80] · ?
allOf · allOf[81] · ?
allOf · allOf[82] · ?
allOf · allOf[83] · ?
allOf · allOf[84] · ?
allOf · allOf[85] · ?
allOf · allOf[86] · ?
allOf · allOf[87] · ?
allOf · allOf[88] · ?
allOf · allOf[89] · ?
allOf · allOf[90] · ?
allOf · allOf[91] · ?
allOf · allOf[92] · ?
allOf · allOf[93] · ?
allOf · allOf[94] · ?
allOf · allOf[95] · ?
allOf · allOf[96] · ?
allOf · allOf[97] · ?
allOf · allOf[98] · ?
allOf · allOf[99] · ?
allOf · allOf[100] · ?
allOf · allOf[101] · ?
allOf · allOf[102] · ?
allOf · allOf[103] · ?
allOf · allOf[104] · ?
allOf · allOf[105] · ?
allOf · allOf[106] · ?
allOf · allOf[107] · ?
allOf · allOf[108] · ?
allOf · allOf[109] · ?
allOf · allOf[110] · ?
allOf · allOf[111] · ?
allOf · allOf[112] · ?
allOf · allOf[113] · ?
allOf · allOf[114] · ?
allOf · allOf[115] · ?
allOf · allOf[116] · ?
allOf · allOf[117] · ?
allOf · allOf[118] · ?
allOf · allOf[119] · ?
allOf · allOf[120] · ?
allOf · allOf[121] · ?
allOf · allOf[122] · ?
allOf · allOf[123] · ?
allOf · allOf[124] · ?
allOf · allOf[125] · ?
allOf · allOf[126] · ?
allOf · allOf[127] · ?
allOf · allOf[128] · ?
allOf · allOf[129] · ?
allOf · allOf[130] · ?
allOf · allOf[131] · ?
allOf · allOf[132] · ?
allOf · allOf[133] · ?
allOf · allOf[134] · ?
allOf · allOf[135] · ?
allOf · allOf[136] · ?
allOf · allOf[137] · ?
allOf · allOf[138] · ?
allOf · allOf[139] · ?
allOf · allOf[140] · ?
* event_id · string · $ref ./common-ids.schema.json#/$defs/event_id
Complete Arkret Event cryptographic identity. The suffix is the canonical unpadded Base64URL encoding of exactly 33 octets: fixed current-v1 suite code 0x01 followed by all 32 octets of the SHA-256 Event digest. Regex validation is only lexical; receivers MUST decode, require 33 octets, require byte 0 == 0x01, canonical re-encode, and verify the full digest before use. Other registered digest suites remain available only to the typed domains that explicitly select them and MUST NOT appear in Event IDs.
pattern: ^ak:event:[A-Za-z0-9_-]{44}$
* kind · string
Standard ak.* Event kinds MUST appear in artifacts/registry/event-kind-registry.json. State convergence is defined by the registered pure reducer over kind + payload; producers do not submit typed current result writes.
pattern: ^ak\.[a-z0-9_]+(\.[a-z0-9_]+)*$
realm_id · string · $ref ./common-ids.schema.json#/$defs/realm_id
Retyped ak.realm.create Event token. It therefore carries the same fixed current-v1 0x01/SHA-256 content-address identity and is not selected by Realm state.
pattern: ^ak:realm:[A-Za-z0-9_-]{44}$
* scope_ref · $ref #/$defs/scope_ref · $ref #/$defs/scope_ref
Required producer-signed security scope. The closed union is ordinary existing realm, circle, or native sidecar scope plus the create-only realm_genesis exception. It enters proof.event_digest and E2EE AAD. Reducers independently derive the exact scope from schema-validated payload and accepted references; missing dependencies, nonexistent scope, realm_id mismatch, omitted sidecar_id, substituting circle for sidecar, or any unequal field is fail closed. Sidecar domain Event kinds remain Extension-owned; recognizing this native security shape does not make Kernel interpret the Sidecar reducer. Exact product targets remain inside recipient-visible ciphertext.
* actor_id · oneOf[2] · $ref ./common-ids.schema.json#/$defs/actor_id
Complete protocol identity for an Event author or Realm member: account carries the exact AccountId for every Station-hosted principal; service identifies a service acting as itself. The discriminator is validated against accepted registration and admission evidence; it never authorizes itself. Account and service are distinct, and no comparison may fall back to a bare principal_id. Agent and integration classification, provisioning, controller binding and credential authorization are independently verified facts, not identity variants. Account actors at different Stations MUST NOT share or inherit authority merely because their principal_id, DID controller or signing key matches, including membership, capability, RealmCommit-signing and recovery authority.
oneOf · oneOf[0] · object
* kind · const "account"
enum: "account"
* account_id · $ref #/$defs/account_id · $ref #/$defs/account_id
oneOf · oneOf[1] · object
* kind · const "service"
enum: "service"
* service_id · $ref #/$defs/did_core_id · $ref #/$defs/did_core_id
executed_by · oneOf[2] · $ref ./common-ids.schema.json#/$defs/actor_id
Complete protocol identity for an Event author or Realm member: account carries the exact AccountId for every Station-hosted principal; service identifies a service acting as itself. The discriminator is validated against accepted registration and admission evidence; it never authorizes itself. Account and service are distinct, and no comparison may fall back to a bare principal_id. Agent and integration classification, provisioning, controller binding and credential authorization are independently verified facts, not identity variants. Account actors at different Stations MUST NOT share or inherit authority merely because their principal_id, DID controller or signing key matches, including membership, capability, RealmCommit-signing and recovery authority.
oneOf · oneOf[0] · object
* kind · const "account"
enum: "account"
* account_id · $ref #/$defs/account_id · $ref #/$defs/account_id
oneOf · oneOf[1] · object
* kind · const "service"
enum: "service"
* service_id · $ref #/$defs/did_core_id · $ref #/$defs/did_core_id
authorization_ref · oneOf[6]
Optional. Required when executed_by is present. It identifies an accepted Grant, delegation Event, DID-document delegation, or one of the closed profile-specific authority constants. The current governance Station evaluates the reference against the target stream's committed state.
oneOf · oneOf[0] · $ref #/$defs/grant_ref · $ref #/$defs/grant_ref
oneOf · oneOf[1] · $ref #/$defs/event_ref · $ref #/$defs/event_ref
oneOf · oneOf[2] · $ref #/$defs/did_delegation_ref · $ref #/$defs/did_delegation_ref
oneOf · oneOf[3] · $ref #/$defs/direct_conversation_participant_authority_ref · $ref #/$defs/direct_conversation_participant_authority_ref
oneOf · oneOf[4] · $ref #/$defs/direct_conversation_bootstrap_authority_ref · $ref #/$defs/direct_conversation_bootstrap_authority_ref
oneOf · oneOf[5] · $ref #/$defs/membership_compensation_delegation_ref · $ref #/$defs/membership_compensation_delegation_ref
applet_id · $ref #/$defs/applet_id · $ref #/$defs/applet_id
Optional signed Applet provenance. Required by ak.profile.applet_* when the Event is introduced by an Applet, Ghost Actor, bridge, or delegated applet path. Enters canonical event bytes and therefore is covered by proof.event_digest. When present, authorization_ref MUST also be present and resolve to a real active registration/capability grant binding this applet_id, registration_epoch, action and resource per zh/extensions/applet-integration.md sections 4, 8 and 11. Service-actor self-signature proves provenance but is not an authorization substitute. Capability-gated actions require a grant covering action/resource. For subject_only operations the referenced grant binds only the exact active install and cannot replace the subject signature, FSM or independent action authority. Service self-authored Events use ActorId.service; the install grant subject MUST be the same exact ActorId.service as its producer; hosting Station and effective scope are verified separately without coercing a Service into an account variant.
external_ref · $ref #/$defs/external_ref · $ref #/$defs/external_ref
Optional signed external provenance reference for Applet / bridge-originated Events. It is covered by event_digest and MUST NOT be carried only in unsigned when used for loop prevention, audit, or external-message idempotency. Must not contain unauthorized external plaintext.
* created_at · $ref #/$defs/canonical_event_timestamp · $ref #/$defs/canonical_event_timestamp
semantic_refs · array<$ref #/$defs/semantic_ref>
Optional semantic refs with role. Omit when there are no semantic references; an explicitly empty array is not canonical. Admission selectors determine any required references. PCR policy recovery has no DID-root anchor reference; its policy/session/replacement-key authority is verified separately.
items · $ref #/$defs/semantic_ref · $ref #/$defs/semantic_ref
* payload · object
* producer_proof · $ref #/$defs/event_proof · $ref #/$defs/event_proof
The Event's sole portable producer proof. Storage receipts are separate objects and never authorize this Event. producer_proof and unsigned remain outside the canonical Event digest. Exact retries preserve the verified producer proof.
approval_signatures · array<$ref ./approval-signature.schema.json>
One ak.schema.approval_signature.v1 object per approver. An event-target signature binds approval_target.event_id equal to event.event_id. An operation-target signature is allowed only when capability-action-registry.json resolves its action to this exact carrier operation and binds request_canonical_digest to the original typed request with approval_signatures omitted. Every ingress that wraps EventAdmissionSubmission -- ordinary self submit, batch submission, control transactions, facade hand-off -- reuses this one field and MUST NOT define its own DTO. The array is omitted when no approval layer demands evidence; it MUST NOT be present and empty. The governance Station persists the evidence, the verification basis, the nonce consumption and the binding to this submission inside the same atomic acceptance transaction, and the shared Realm Event store keeps the original Event bytes unchanged.
items · object · $ref ./approval-signature.schema.json
The single approval evidence type of v1 (zh/authz/constraint-schema.md section 9.2). One approver signs one exact target: either a fully authored Event that has not been submitted yet, or the original typed RequestBody of one operation whose evidence carrier is registered in capability-action-registry.json. The object is not an Event, never enters Realm history, and MUST NOT be written into an EventEnvelope, a signed payload or an Event semantic_refs[] entry. It travels in the carrier registered for the approved action. It proves that an approver approved that target; it proves nothing about the initiator's own authority.
* input · $ref #/$defs/approval_signature_input · $ref #/$defs/approval_signature_input
* proof · $ref #/$defs/approval_signature_proof · $ref #/$defs/approval_signature_proof
allOf · allOf[1] · object
* event · object
* kind · const "ak.account_data.set"
enum: "ak.account_data.set"
* payload · object
anyOf · anyOf[1] · object · $ref #/$defs/account_data_entry
* account_data_key · string · $ref #/$defs/account_data_key
Dot-delimited account_data namespace key (e.g. ak.contacts.realm.<realm_id>, ak.account.blocklist). Control chars / whitespace / path separators are forbidden so the key is URL- and log-safe.
pattern: ^[^\s/\\?#\u0000-\u001f]+$
* revision · integer · $ref #/$defs/revision
Monotonic per-key revision counter. 0 means the key has never been written. Each accepted write or delete stores expected_server_revision + 1. The counter is a high-water mark: it MUST NOT go backwards, not even after a tombstone is garbage-collected, so a stale offline write can never resurrect a superseded value.
* content · ?
Caller-supplied opaque payload, stored verbatim. Any JSON value.
* updated_at · string (date-time) · format=date-time · $ref #/$defs/timestamp
Canonical Arkret-owned absolute instant. UTC Z form with exactly three millisecond digits. Whole seconds MUST use .000Z; offsets, missing/finer fractions, lowercase separators, leap seconds, and invalid Gregorian calendar dates are forbidden. Shape validation by this pattern is supplemented by semantic date validation.
pattern: ^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]\.[0-9]{3}Z$
anyOf · anyOf[2] · object · $ref #/$defs/account_data_list
* account_data_entries · array<$ref #/$defs/account_data_entry>
items · object · $ref #/$defs/account_data_entry
* account_data_key · string · $ref #/$defs/account_data_key
Dot-delimited account_data namespace key (e.g. ak.contacts.realm.<realm_id>, ak.account.blocklist). Control chars / whitespace / path separators are forbidden so the key is URL- and log-safe.
pattern: ^[^\s/\\?#\u0000-\u001f]+$
* revision · integer · $ref #/$defs/revision
Monotonic per-key revision counter. 0 means the key has never been written. Each accepted write or delete stores expected_server_revision + 1. The counter is a high-water mark: it MUST NOT go backwards, not even after a tombstone is garbage-collected, so a stale offline write can never resurrect a superseded value.
* content · ?
Caller-supplied opaque payload, stored verbatim. Any JSON value.
* updated_at · string (date-time) · format=date-time · $ref #/$defs/timestamp
Canonical Arkret-owned absolute instant. UTC Z form with exactly three millisecond digits. Whole seconds MUST use .000Z; offsets, missing/finer fractions, lowercase separators, leap seconds, and invalid Gregorian calendar dates are forbidden. Shape validation by this pattern is supplemented by semantic date validation.
pattern: ^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]\.[0-9]{3}Z$
anyOf · anyOf[3] · object · $ref #/$defs/account_data_delete_outcome
* account_data_key · string · $ref #/$defs/account_data_key
Dot-delimited account_data namespace key (e.g. ak.contacts.realm.<realm_id>, ak.account.blocklist). Control chars / whitespace / path separators are forbidden so the key is URL- and log-safe.
pattern: ^[^\s/\\?#\u0000-\u001f]+$
* revision · integer · $ref #/$defs/revision
Monotonic per-key revision counter. 0 means the key has never been written. Each accepted write or delete stores expected_server_revision + 1. The counter is a high-water mark: it MUST NOT go backwards, not even after a tombstone is garbage-collected, so a stale offline write can never resurrect a superseded value.
anyOf · anyOf[4] · object · $ref #/$defs/account_data_cas_conflict_details
Closed error.details payload for cas_conflict and not_found on ak.self.account_data.resource.*. It always carries the current revision so the caller can decrypt, re-apply its domain merge rule and issue exactly one new compare-and-set write without a second round trip.
* account_data_key · string · $ref #/$defs/account_data_key
Dot-delimited account_data namespace key (e.g. ak.contacts.realm.<realm_id>, ak.account.blocklist). Control chars / whitespace / path separators are forbidden so the key is URL- and log-safe.
pattern: ^[^\s/\\?#\u0000-\u001f]+$
* current_revision · integer · $ref #/$defs/revision
Monotonic per-key revision counter. 0 means the key has never been written. Each accepted write or delete stores expected_server_revision + 1. The counter is a high-water mark: it MUST NOT go backwards, not even after a tombstone is garbage-collected, so a stale offline write can never resurrect a superseded value.
current_entry · object · $ref #/$defs/account_data_entry
Present only when the key currently holds a live value. Omitted when the key is unset or holds a tombstone; current_revision is still authoritative in that case.
* account_data_key · string · $ref #/$defs/account_data_key
Dot-delimited account_data namespace key (e.g. ak.contacts.realm.<realm_id>, ak.account.blocklist). Control chars / whitespace / path separators are forbidden so the key is URL- and log-safe.
pattern: ^[^\s/\\?#\u0000-\u001f]+$
* revision · integer · $ref #/$defs/revision
Monotonic per-key revision counter. 0 means the key has never been written. Each accepted write or delete stores expected_server_revision + 1. The counter is a high-water mark: it MUST NOT go backwards, not even after a tombstone is garbage-collected, so a stale offline write can never resurrect a superseded value.
* content · ?
Caller-supplied opaque payload, stored verbatim. Any JSON value.
* updated_at · string (date-time) · format=date-time · $ref #/$defs/timestamp
Canonical Arkret-owned absolute instant. UTC Z form with exactly three millisecond digits. Whole seconds MUST use .000Z; offsets, missing/finer fractions, lowercase separators, leap seconds, and invalid Gregorian calendar dates are forbidden. Shape validation by this pattern is supplemented by semantic date validation.
pattern: ^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]\.[0-9]{3}Z$

Source