diff --git a/docs/architecture/rolling-upgrades.md b/docs/architecture/rolling-upgrades.md index 37bd523009..7dc85b7ea5 100644 --- a/docs/architecture/rolling-upgrades.md +++ b/docs/architecture/rolling-upgrades.md @@ -1214,6 +1214,22 @@ See the [participant lifecycle baseline](cells.md#participant-lifecycle-baseline `tests/unit/test_ledger_invariants.py` check N's side, and the mixed-version gate does not check this rule. +79. **Namespace invitations** (`loom.namespace_invites`, migration + `123_namespace_invites.sql`): N-1 serves none of `grants.invite`, `grants.list_invites`, + `grants.cancel_invite` and `grants.accept_invite`, and answers one routed to it as an + unknown operation. N's dashboard sends a person's add to `grants.invite`, so while N-1 + serves, an add or an acceptance can fail on an N-1 replica and succeed on a retry that + reaches N. N-1's in-use check of a new name does not count an open invitation: a name + retired with one outstanding can be registered as new on an N-1 replica, and the link + would then grant on the new owner's namespace; cancel open invitations before retiring + a name during the rollout. N-1's user erasure does not take the user off the + invitations they made: one an N-1 replica runs leaves their `user:` as an + invitation's `created_by` until the TTL drops the row, a week after the link expires. + Those links admit nobody, since the erasure revoked the user's grants, and the + erasure's residue check does not count the table. After a rollback the table stays, + its rows dropped by TTL a week after they expire. No gate holds the rollout, and the + mixed-version gate does not check this rule. + ## What checks them `scripts/gates/mixed_version.py` (`make test-mixed-version`, the `mixed-version` CI job, diff --git a/docs/architecture/security.md b/docs/architecture/security.md index 05a1cb43ea..6fb3104145 100644 --- a/docs/architecture/security.md +++ b/docs/architecture/security.md @@ -918,8 +918,8 @@ made while another change to that account runs answers 409 `SIGNUP_IN_PROGRESS`, says only that a change is running. In use means a `loom.namespaces` row, a configured code-plane repository or tracker namespace, any row in a table the erasure census counts by namespace (`census.namespace_tables`), tombstoned or not, a live row in a table whose -rows a later owner would inherit (`namespace_census.STATE_TABLES`: grants, webhooks, task -inboxes, sources and the like), or, on the Postgres authority, a memory there +rows a later owner would inherit (`namespace_census.STATE_TABLES`: grants, open invitations, +webhooks, task inboxes, sources and the like), or, on the Postgres authority, a memory there (`steps_pg.pg_holds_namespace`). Every other table keyed by namespace is exempt with a reason (`tests/unit/test_in_use_coverage.py`), which a new table cannot skip. A namespace can hold such rows without a registry row when auto-registration failed or was off, for diff --git a/docs/architecture/sharing.md b/docs/architecture/sharing.md index 9dd427d934..5cfbbac798 100644 --- a/docs/architecture/sharing.md +++ b/docs/architecture/sharing.md @@ -194,6 +194,78 @@ admin. The group lands in that org; a member is a user id, held as `user:`. Membership is read by Loom on every request, never claimed by a token, so removing a member takes effect within the consistency window below. +## Invitations + +`grants.invite` gives a person a role by what an admin knows of them. An email verified +for an account (an SSO account or an `sso_links` row) is granted at once through +`grants.create`, under that account's handle. So is a login handle an account's row is +owned under, or a live grant in the org is stored under (a person whose tokens Loom did +not mint at sign-in has no account row), under the spelling stored for it. Only a +verified tie counts for an email: a row's `owner_email` and a grant's subject are +whatever their writer typed, and `namespace.register` takes any owner. A request with no +token, which only a server with auth off serves, grants every person as typed: no one +signs in there to accept a link. Any other email, one plain address as sign-up checks +it (a dot-atom local part and a domain IDNA encodes, so no list, display name or +comment), gets an invitation: a `loom.namespace_invites` row and the link +`/spaces#invite=&org=…&namespace=…`. The link is the credential. Only the secret's +SHA-256 is stored, as the row's `invite_id`, and the link works once, for seven days by +default (`invite_ttl_seconds`). The server emails it when `smtp_url`, `mail_from` and +`public_base_url` are set; otherwise, or when the send fails, the answer carries the link +for the admin to pass on. An invitation is made only on an active namespace, where its +link can be accepted. A handle no account holds is refused with 404, so a typo is never +kept as a grant for whoever signs up under that handle later. + +Where sign-in is single sign-on only (`oauth_login_provider = "oidc"`), the identity +provider verifies every account's email, so an email no account holds is granted as typed +through `grants.create` instead, and reaches that person at their first sign-in. There is +no link to pass on. + +For a person whose tokens Loom does not mint at sign-in (an upstream gateway's, +`loom mint-token`'s, or a trusted caller's on their behalf), an email gets a link too, +accepted by whoever opens it signed in, and a handle Loom has not seen yet is refused. +`grants.create` grants either as typed, for a subject the token's minter names. The +`gateway` identity provider does not mark such a server: a password server with sign-up +off infers it too, and there a grant by email would reach nobody. + +The server's mail is no relay for a namespace admin, whom any sign-up can make: it emails +at most 20 invitations an hour per inviter and 3 a day per address, counted in +`loom.auth_attempts` across the deployment (`server.auth.attempts`). Past either limit +the invitation is still made, and its link is the inviter's to pass on. + +`grants.accept_invite` gives the invitation's role to the signed-in caller, under the +handle they sign in with, stamped `granted_by` the invitation's maker. Only a person's +token accepts: a service account, a grant principal or a token of another org is refused. +Under a lease per invitation (`grant_claims.invite_change`) it checks that the link is +open, the namespace active and the maker still an admin, and marks the invitation +accepted. It grants after leaving the lease, so the grant's own claims, and an admin +grant's fan-out to a repository's branches, are never taken under it. One link never +admits two people: after a failed grant the link opens again only when no grant at or +above its role stands, so a failure after the grant row landed (a lost reply, a step after +the write) leaves it used. A higher role the caller holds already stands. + +An invitation never outlasts its maker's admin. Its maker is the account the admin +rests on: the caller, or a delegated token's creator, whose live grant holds the token to +it. `grants.invite` and `grants.accept_invite` both read that account's grants as the gate +reads them (`authz.subject_grant_role`): on a collection its own, its groups' and +everyone's, there or on a collection above; elsewhere its grant, or an inheriting service +account's creator's. The maker's account must also be active and their subject not +revoked, as for a token they delegated (`delegation.creator_account_active`, +`revocation.is_revoked` at the time the link was made). Short of any of these, the link is +not made, or admits nobody; a failed read answers 503, so the dashboard keeps the link. An +admin whose token alone makes them one (a platform admin, an operator's token) holds no +grant that a later read could tell from a revoked one, so they cannot make a link: an +admin through a grant invites the person. The open invitations name each maker. + +Self sign-up makes accounts in `self_signup_org` only. On a password server, a link to a +namespace of another org is accepted by an account an operator made there. + +A password account's email is never verified, which is why an email reaches one only +through an invitation: the link went to that address, and opening it proves the reader +got it. The whole link is a fragment, which a browser never sends to a server or puts in a +Referer. Namespaces in your org moves it out of the address into the tab's session +storage, where it waits until the person accepts it or closes the card, or the server +refuses it; where the browser refuses that storage, the card holds it until the page goes. + ## Consistency Every change to a grant, a group or the tree writes a row to `loom.acl_versions` for its @@ -282,22 +354,25 @@ replaced, so none reads as live again. It deletes their uploaded originals that writer's live document shares (each upload by an end user is recorded in `loom.blob_uploads`, because the document version that named it may have been replaced and merged away since), revokes and then deletes every grant naming `user:`, blanks their -id as the issuer of the grants they gave others (those grants stay), removes them from -every group, blanks their id as the creator of the collections they made (the collections -stay), and retires their personal collection's directory row (`namespace.delete` and -`collection.delete` refuse a personal collection: it goes only with its user's erasure). -The request ledger keeps the user's calls for cost with their `user:` subject -scrubbed, and the user's newest-call row is deleted. Deleting a SCIM group revokes the -grants that named it, so a group made later under the same id starts with none. -Collections that hold other writers' documents stay: Loom deletes only what its writer -asked to delete. `collection.delete` purges what its collection held (a namespace erasure -that takes the rows off disk) before the collection leaves the tree. A user-scope -`erasure.export` returns the chunks and the conversation rows (transcript turns, saved -messages and threads) that user owns in the collections its caller may read, and in the -user's own personal collection. An org admin may erase a collection's rows without -reading them; a platform admin sees every collection. Each section's read leaves out what -the caller may not see before its limit, so a hidden row never takes a visible row's place -on the page. +id as the issuer of the grants they gave others (those grants stay) and as the maker of +their invitations, closing the open ones, removes them from every group, blanks their id +as the creator of the collections they made (the collections stay), and retires their +personal collection's directory row (`namespace.delete` and `collection.delete` refuse a +personal collection: it goes only with its user's erasure). An accept or an invitation +already past its maker check as that step runs can still write their id, as a grant's +issuer or an invitation's maker, as a `grants.create` in flight can; such a link admits +nobody, since the step revokes the user's grants first. The request ledger keeps the +user's calls for cost with their `user:` subject scrubbed, and the user's newest-call +row is deleted. Deleting a SCIM group revokes the grants that named it, so a group made +later under the same id starts with none. Collections that hold other writers' documents +stay: Loom deletes only what its writer asked to delete. `collection.delete` purges what +its collection held (a namespace erasure that takes the rows off disk) before the +collection leaves the tree. A user-scope `erasure.export` returns the chunks and the +conversation rows (transcript turns, saved messages and threads) that user owns in the +collections its caller may read, and in the user's own personal collection. An org admin +may erase a collection's rows without reading them; a platform admin sees every +collection. Each section's read leaves out what the caller may not see before its limit, +so a hidden row never takes a visible row's place on the page. ## Namespace guides @@ -370,6 +445,18 @@ One text serves agents and people, so there is no second copy to drift. principals and differs per user; no one sort order clusters every user's union. - **Group membership in a token claim.** A claim is fixed until the token expires, so a removed member keeps access for the token's life. +- **A confirmation email for every password account.** Verified emails would let a grant + by email bind at sign-in, but every server would need mail to sign anyone up; an + invitation works with or without mail. +- **A pending grant by email, bound at the first sign-in under that email.** A password + sign-up names any email it likes, so whoever registered the address first would take + the grant. +- **The invitation's secret in the query string.** It would reach access logs and Referer + headers. +- **Binding acceptance to the invited address.** A password account has no verified email + to compare, so only the link can prove the address was reached. +- **Cancelling a maker's invitations when their grant is revoked.** A best-effort cascade + would leave a link open when it fails; reading the grant at acceptance fails closed. - **Inheritance resolved at write time.** Moving a collection would rewrite the grants of every descendant; resolving at check time from a cached tree costs a walk of at most eight parents. diff --git a/docs/architecture/storage-layout.md b/docs/architecture/storage-layout.md index bbbccbed42..fda7713848 100644 --- a/docs/architecture/storage-layout.md +++ b/docs/architecture/storage-layout.md @@ -934,6 +934,7 @@ copies of tables listed here, owned and removed by that run, and erasure reaches | `oauth_signin_state` | KeeperMap `claim_key` | Postgres `oauth_signin_state` | SoR | no content | 1 | strict compare-and-set per key with an expiry and optional verified sign-in email metadata: an `UPDATE … WHERE value = $old`; the KeeperMap expiry becomes `expires_at`, read by a sweep; named in `server/auth/claims.py`, `server/cli/secrets.py` | | `grant_claims` | KeeperMap `claim_key` | delete | Coord | no content | 1 | no code path writes it (its census entry says so); no module outside the census names the table (`server/auth/grant_claims.py` is the claim module, whose keys are in `_migration_lock`) | | `namespace_grants` | RMT(version) `(org, namespace, subject)`, by `org` | Postgres `namespace_grants` | SoR | step `grants.revoke` | 1 | every request's role check; a revoke takes effect within the grant cache's invalidation bound; named in `server/identity/store/grants.py`, `server/auth/self_signup.py` | +| `namespace_invites` | RMT(version) `(org, namespace, invite_id)`, TTL | Postgres `namespace_invites` | SoR | step `grants.revoke` | 1 | an invitation read by `(org, namespace, invite_id)` when its link is accepted or cancelled, the open ones when a namespace's members are shown, the open, unexpired ones by a new name's in-use check, and the ones a user made by that user's erasure; named in `server/identity/store/invites.py` | | `namespaces` | RMT(updated_at) `(org, namespace)`, by `org` | Postgres `namespaces` + ClickHouse mirror | SoR (head) | step `personal.retire`; step `collections.forget_owner` | 1 | the registry with its per-namespace settings, read by grants, sign-in and request paths through a cache; the mirror serves ClickHouse worker scans and the SQL surface views; named in `server/auth/self_signup.py`, `server/cli/hygiene.py` | | `collections` | RMT(version) `(org, namespace)` | Postgres `collections` | SoR | step `collections.forget_owner` | 1 | the collection tree grants inherit through; named in `server/identity/store/collections.py`, `server/identity/store/namespace_census.py` | | `acl_versions` | SMT(changes) `(org, kind)` | merge into Postgres `cache_generations` (kinds `grants`, `groups`, `collections`) | Coord | no content | 1 | a change counter caches poll; a generation row plus `NOTIFY` replaces it; named in `server/core/grant_cache.py` | @@ -1194,61 +1195,61 @@ a row names a step today's ClickHouse census owns, the `pg:` census row is owned Postgres step the flip splits off it, which joins `PG_ONLY_STEPS` ([restores](#restores)). -| Table | Key | Kind | Erasure | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `authority` | [storage authority](storage-authority.md#the-tables); paired with ClickHouse's `storage_authority` | SoR | no content | -| `pg_migrations` | the migration file | SoR | no content | -| `scope_generations` | [storage authority](storage-authority.md#the-tables) | SoR (a namespace's row allocates its revision `seq`) | no content | -| `cache_generations` | `(org, kind)` | Coord | no content | -| `memory_current` | [storage authority](storage-authority.md#the-tables) | SoR | census `pg:loom.memory_current` | -| `memory_revisions` | [storage authority](storage-authority.md#the-tables) | SoR | census `pg:loom.memory_revisions` | -| `memory_refusals` | `(org, scope_kind, scope_value, user_id, kind, units, digest)` | SoR, hash-only consent policy committed beside memory; no TTL | no content; retained across erasure | -| `memory_deliveries` | [storage authority](storage-authority.md#the-tables) | SoR | cascades with its revision | -| `idempotency`, `idempotency_fences` | [storage authority](storage-authority.md#the-tables) | SoR | census `pg:loom.idempotency`; `idempotency_fences` holds no content (the census's bound) | -| `erased_memories`, `erased_documents` | [storage authority](storage-authority.md#the-tables) | SoR | evidence, no content | -| `audit_outbox` | [storage authority](storage-authority.md#the-tables) | SoR | keys and ids, no values | -| `document_catalog`, `document_uploaders` | `(org, namespace, sha256)`, `(org, user_id, namespace, sha256)` | SoR | a `pg:` census row each, owned by the Postgres step the flip splits off the steps that own the census rows of `document_blobs` and `blob_uploads` today, which joins `PG_ONLY_STEPS` (`documents.tombstone`, and the user step through `document_uploaders`) | -| `knowledge_datasets` | [storage authority](storage-authority.md#the-tables) | SoR | census `pg:loom.knowledge_datasets`, step `pg_knowledge.delete` | -| `knowledge_jobs` | [storage authority](storage-authority.md#the-tables) | SoR | census `pg:loom.knowledge_jobs`, step `pg_knowledge.delete` | -| `mcp_worker_enrollment_challenges` | `(org, nonce)` | SoR | one-time account enrollment challenges of a canonical sign-in owner (`subject`; `user_id` is `-`), erased with the collection or by the owner's deletion (`pg_mcp_worker_enrollment.erase_subject`), never by a user erasure; census `pg:loom.mcp_worker_enrollment_challenges`, namespace step `pg_knowledge.delete` | -| `mcp_worker_accounts` | `(org, connection_id)` | SoR | opaque connection bindings and revocation generations of a canonical sign-in owner (`subject`; `user_id` is `-`), one collection per connection, erased with the collection or by the owner's deletion (`pg_mcp_worker_enrollment.erase_subject`), never by a user erasure; census `pg:loom.mcp_worker_accounts`, namespace step `pg_knowledge.delete` | -| `mcp_worker_approvals` | `(org, namespace, worker_id, profile_digest)` | SoR | a collection's allowed modes and approval generations, naming no subject (`user_id` is `-`), erased with the collection; census `pg:loom.mcp_worker_approvals`, namespace step `pg_knowledge.delete` | -| `mcp_worker_source_readers` | `(org, namespace, source_id, subject)` | SoR | explicit team reader bindings of a canonical sign-in reader (`subject`; `user_id` is `-`), erased with the collection or by the reader's deletion (`pg_mcp_worker_enrollment.erase_subject`), never by a user erasure; census `pg:loom.mcp_worker_source_readers`, namespace step `pg_knowledge.delete` | -| `knowledge_heads`, `knowledge_deliveries` | [storage authority](storage-authority.md#the-tables) | SoR | census `pg:loom.knowledge_heads`, `pg:loom.knowledge_deliveries` | -| `jobs`, `job_users`, `job_memories` | `(org, id)`, `(org, user_id, job_id)`, `(org, namespace, memory_id, job_id)` | SoR | a census row, a step by namespace and user, a redaction step | -| `leases`, `write_marks`, `graph_inflight` | `(org, name)`, `(org, namespace, surface)`, `(org, namespace, token)` | Coord | no content | -| `cursors` | `(org, consumer, scope)` | SoR | no content | -| `carry_acks` | `process` | Coord | no content | -| `analysis_secrets` | `id` | SoR | no content | -| `sql_access` | `(org, namespace, user_name)` | SoR | no content | -| `cell_self` | singleton | SoR until attach writes its fingerprint to the directory row, then Derived (rewritten from the directory on a restore, [cells](cells.md)) | no content | -| `tenancy` | `org` | SoR until attach places its org (the first cell's `recording` rows), then Derived (written back from the directory's placements on a restore, never deleted, [cells](cells.md)) | no content; an erasure leaves the org's row | -| `tenancy_mode` | singleton | Derived (the mode raised only upward from the directory's recorded mode on a restore, [cells](cells.md)) | no content | -| `cell_first` | singleton | Derived (written when absent and refused when it differs on a restore; written once, its update, delete and truncate refused by triggers, [cells](cells.md)) | no content | -| `cell_probe` (the probe nonce the `loom cell` commands write, [cells](cells.md)) | `name` | Coord | no content; deleted once the probe has read it | -| `job_parts` | `(org, job_id, seq)` | SoR | cascades with its job; `code_index.purge` reaches it through the job | -| `idempotency_revisions` | `(org, key_hash, namespace, seq)` | SoR | cascades with its record; redaction reaches replay answers through it | -| `revision_relations` | `(org, namespace, seq, ord)` | SoR | census `pg:loom.revision_relations`, step `pg_memory.delete`; cascades with its revision; redaction reaches it through its revision | -| `revision_sources` | `(org, user_id, namespace, seq)` | SoR | cascades with its revision; the user step deletes the user's rows; the user step and the census reach shared revisions through it | -| `table_moves`, `move_acks` | `move`, `(move, process)` | SoR, Coord | no content; `table_moves` also holds the registry of kept tables (each kept table's name and scope predicates) | -| `backfill_steps` | the column, index or check it sets | SoR | no content; the backfill step's completion record, which boots read ([schema rules](#postgres)) | -| `working_memory`, `records`, `operator_edges`, `context_offloads`, `session_briefs`, `session_brief_revisions`, `namespace_guides`, `learning_candidates`, `learning_supporters`, `conflict_allowlist` | led by `(org, namespace, …)`, the ClickHouse sort key today | SoR | a census row and a saga step each | -| `conversation_states` | `(org, namespace, agent, thread_id, msg_id)` | SoR | a census row and the `conversations.tombstone` step, by namespace and by the saver's `user_id` | -| `offload_bytes` | `(org, namespace, offload_id, part)`, its head's id and a part number | SoR | deleted with its head by the `context_offloads` step, and counted by its census row | -| `shared_current` | `(org, namespace, memory_key)` | SoR | a `pg:` census row and the provenance step `shared` has today, through `revision_sources` | -| `tasks`, `agent_runs` | `(org, inbox, task_id)`, `(org, namespace, run_id)` | SoR | a `pg:` census row each, owned by the Postgres step the flip splits off the step that owns its ClickHouse table's census row today, which joins `PG_ONLY_STEPS` (`tasks` in the namespace scope, `agent_runs` in both) | -| `task_inboxes`, `task_poster_policies` | `(org, inbox)`, `(org, inbox, poster, kind)` | SoR | no content | -| `erased_messages` | `(org, erasure_id, namespace, agent, thread_id, msg_id)` | SoR | evidence, no content; the messages a conversation erasure matched by their saver, which its ClickHouse replay reads, swept with its `erasure_ledger` row | -| `erasure_ledger` | [storage authority](storage-authority.md#the-tables) | SoR | evidence, no content; Postgres's erasure record, which `loom reconcile` runs again after a ClickHouse restore, swept after `erasure_ledger_days` | -| `record_schemas`, `namespace_visits`, `extraction_policies`, `namespace_policies`, `namespace_types`, `namespace_ontology`, `profile_schemas`, `user_state`, `webhooks`, `knowledge_sources`, `knowledge_mirrors`, `code_repos`, `qa_sources` | led by `org`, as the ClickHouse key | SoR | no memory content | -| `knowledge_uploads` | led by `org`, as the ClickHouse key | SoR | a `pg:` census row owned by the Postgres step split off `documents.tombstone` ([restores](#restores)) | -| `code_coverage_watches` | led by `org`, as the ClickHouse key | SoR | no memory content; reached by the Postgres part of `code_index.purge` ([restores](#restores)) | -| `revoked_tokens` | `(kind, key)`, kind `subject_or_jti` (the bare key, which holds both today), `cutoff` or `scim` | SoR | no content | -| `signing_keys`, `service_accounts`, `machine_identities`, `scim_users`, `sso_links`, `principal_groups`, `oauth_state`, `oauth_signin_state`, `namespace_grants`, `namespaces`, `collections`, `blacklist`, `org_model_calls` | as the ClickHouse key, `org` first where the table is per org, except the tables of the cell that [keys lead with `org`](#postgres) names | SoR | no memory content; the identity steps (`grants.revoke`, `groups.remove_member`, `personal.retire`, `collections.forget_owner`) rewrite `namespace_grants`, `principal_groups`, `namespaces` and `collections` | -| `auth_attempts` | kind, hashed key and window | Coord | no content | -| `deployment_config`, `runtime_overrides`, `provider_configuration`, `assistant_service` | as the ClickHouse key | SoR | no content | -| `instances` | process | Coord | no content | -| `embedder_calibration`, `namespace_calibration` | as the ClickHouse key, `org` first for `namespace_calibration` | Derived (rebuilt by a recalibration, at embedding cost) | no content | +| Table | Key | Kind | Erasure | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `authority` | [storage authority](storage-authority.md#the-tables); paired with ClickHouse's `storage_authority` | SoR | no content | +| `pg_migrations` | the migration file | SoR | no content | +| `scope_generations` | [storage authority](storage-authority.md#the-tables) | SoR (a namespace's row allocates its revision `seq`) | no content | +| `cache_generations` | `(org, kind)` | Coord | no content | +| `memory_current` | [storage authority](storage-authority.md#the-tables) | SoR | census `pg:loom.memory_current` | +| `memory_revisions` | [storage authority](storage-authority.md#the-tables) | SoR | census `pg:loom.memory_revisions` | +| `memory_refusals` | `(org, scope_kind, scope_value, user_id, kind, units, digest)` | SoR, hash-only consent policy committed beside memory; no TTL | no content; retained across erasure | +| `memory_deliveries` | [storage authority](storage-authority.md#the-tables) | SoR | cascades with its revision | +| `idempotency`, `idempotency_fences` | [storage authority](storage-authority.md#the-tables) | SoR | census `pg:loom.idempotency`; `idempotency_fences` holds no content (the census's bound) | +| `erased_memories`, `erased_documents` | [storage authority](storage-authority.md#the-tables) | SoR | evidence, no content | +| `audit_outbox` | [storage authority](storage-authority.md#the-tables) | SoR | keys and ids, no values | +| `document_catalog`, `document_uploaders` | `(org, namespace, sha256)`, `(org, user_id, namespace, sha256)` | SoR | a `pg:` census row each, owned by the Postgres step the flip splits off the steps that own the census rows of `document_blobs` and `blob_uploads` today, which joins `PG_ONLY_STEPS` (`documents.tombstone`, and the user step through `document_uploaders`) | +| `knowledge_datasets` | [storage authority](storage-authority.md#the-tables) | SoR | census `pg:loom.knowledge_datasets`, step `pg_knowledge.delete` | +| `knowledge_jobs` | [storage authority](storage-authority.md#the-tables) | SoR | census `pg:loom.knowledge_jobs`, step `pg_knowledge.delete` | +| `mcp_worker_enrollment_challenges` | `(org, nonce)` | SoR | one-time account enrollment challenges of a canonical sign-in owner (`subject`; `user_id` is `-`), erased with the collection or by the owner's deletion (`pg_mcp_worker_enrollment.erase_subject`), never by a user erasure; census `pg:loom.mcp_worker_enrollment_challenges`, namespace step `pg_knowledge.delete` | +| `mcp_worker_accounts` | `(org, connection_id)` | SoR | opaque connection bindings and revocation generations of a canonical sign-in owner (`subject`; `user_id` is `-`), one collection per connection, erased with the collection or by the owner's deletion (`pg_mcp_worker_enrollment.erase_subject`), never by a user erasure; census `pg:loom.mcp_worker_accounts`, namespace step `pg_knowledge.delete` | +| `mcp_worker_approvals` | `(org, namespace, worker_id, profile_digest)` | SoR | a collection's allowed modes and approval generations, naming no subject (`user_id` is `-`), erased with the collection; census `pg:loom.mcp_worker_approvals`, namespace step `pg_knowledge.delete` | +| `mcp_worker_source_readers` | `(org, namespace, source_id, subject)` | SoR | explicit team reader bindings of a canonical sign-in reader (`subject`; `user_id` is `-`), erased with the collection or by the reader's deletion (`pg_mcp_worker_enrollment.erase_subject`), never by a user erasure; census `pg:loom.mcp_worker_source_readers`, namespace step `pg_knowledge.delete` | +| `knowledge_heads`, `knowledge_deliveries` | [storage authority](storage-authority.md#the-tables) | SoR | census `pg:loom.knowledge_heads`, `pg:loom.knowledge_deliveries` | +| `jobs`, `job_users`, `job_memories` | `(org, id)`, `(org, user_id, job_id)`, `(org, namespace, memory_id, job_id)` | SoR | a census row, a step by namespace and user, a redaction step | +| `leases`, `write_marks`, `graph_inflight` | `(org, name)`, `(org, namespace, surface)`, `(org, namespace, token)` | Coord | no content | +| `cursors` | `(org, consumer, scope)` | SoR | no content | +| `carry_acks` | `process` | Coord | no content | +| `analysis_secrets` | `id` | SoR | no content | +| `sql_access` | `(org, namespace, user_name)` | SoR | no content | +| `cell_self` | singleton | SoR until attach writes its fingerprint to the directory row, then Derived (rewritten from the directory on a restore, [cells](cells.md)) | no content | +| `tenancy` | `org` | SoR until attach places its org (the first cell's `recording` rows), then Derived (written back from the directory's placements on a restore, never deleted, [cells](cells.md)) | no content; an erasure leaves the org's row | +| `tenancy_mode` | singleton | Derived (the mode raised only upward from the directory's recorded mode on a restore, [cells](cells.md)) | no content | +| `cell_first` | singleton | Derived (written when absent and refused when it differs on a restore; written once, its update, delete and truncate refused by triggers, [cells](cells.md)) | no content | +| `cell_probe` (the probe nonce the `loom cell` commands write, [cells](cells.md)) | `name` | Coord | no content; deleted once the probe has read it | +| `job_parts` | `(org, job_id, seq)` | SoR | cascades with its job; `code_index.purge` reaches it through the job | +| `idempotency_revisions` | `(org, key_hash, namespace, seq)` | SoR | cascades with its record; redaction reaches replay answers through it | +| `revision_relations` | `(org, namespace, seq, ord)` | SoR | census `pg:loom.revision_relations`, step `pg_memory.delete`; cascades with its revision; redaction reaches it through its revision | +| `revision_sources` | `(org, user_id, namespace, seq)` | SoR | cascades with its revision; the user step deletes the user's rows; the user step and the census reach shared revisions through it | +| `table_moves`, `move_acks` | `move`, `(move, process)` | SoR, Coord | no content; `table_moves` also holds the registry of kept tables (each kept table's name and scope predicates) | +| `backfill_steps` | the column, index or check it sets | SoR | no content; the backfill step's completion record, which boots read ([schema rules](#postgres)) | +| `working_memory`, `records`, `operator_edges`, `context_offloads`, `session_briefs`, `session_brief_revisions`, `namespace_guides`, `learning_candidates`, `learning_supporters`, `conflict_allowlist` | led by `(org, namespace, …)`, the ClickHouse sort key today | SoR | a census row and a saga step each | +| `conversation_states` | `(org, namespace, agent, thread_id, msg_id)` | SoR | a census row and the `conversations.tombstone` step, by namespace and by the saver's `user_id` | +| `offload_bytes` | `(org, namespace, offload_id, part)`, its head's id and a part number | SoR | deleted with its head by the `context_offloads` step, and counted by its census row | +| `shared_current` | `(org, namespace, memory_key)` | SoR | a `pg:` census row and the provenance step `shared` has today, through `revision_sources` | +| `tasks`, `agent_runs` | `(org, inbox, task_id)`, `(org, namespace, run_id)` | SoR | a `pg:` census row each, owned by the Postgres step the flip splits off the step that owns its ClickHouse table's census row today, which joins `PG_ONLY_STEPS` (`tasks` in the namespace scope, `agent_runs` in both) | +| `task_inboxes`, `task_poster_policies` | `(org, inbox)`, `(org, inbox, poster, kind)` | SoR | no content | +| `erased_messages` | `(org, erasure_id, namespace, agent, thread_id, msg_id)` | SoR | evidence, no content; the messages a conversation erasure matched by their saver, which its ClickHouse replay reads, swept with its `erasure_ledger` row | +| `erasure_ledger` | [storage authority](storage-authority.md#the-tables) | SoR | evidence, no content; Postgres's erasure record, which `loom reconcile` runs again after a ClickHouse restore, swept after `erasure_ledger_days` | +| `record_schemas`, `namespace_visits`, `extraction_policies`, `namespace_policies`, `namespace_types`, `namespace_ontology`, `profile_schemas`, `user_state`, `webhooks`, `knowledge_sources`, `knowledge_mirrors`, `code_repos`, `qa_sources` | led by `org`, as the ClickHouse key | SoR | no memory content | +| `knowledge_uploads` | led by `org`, as the ClickHouse key | SoR | a `pg:` census row owned by the Postgres step split off `documents.tombstone` ([restores](#restores)) | +| `code_coverage_watches` | led by `org`, as the ClickHouse key | SoR | no memory content; reached by the Postgres part of `code_index.purge` ([restores](#restores)) | +| `revoked_tokens` | `(kind, key)`, kind `subject_or_jti` (the bare key, which holds both today), `cutoff` or `scim` | SoR | no content | +| `signing_keys`, `service_accounts`, `machine_identities`, `scim_users`, `sso_links`, `principal_groups`, `oauth_state`, `oauth_signin_state`, `namespace_grants`, `namespace_invites`, `namespaces`, `collections`, `blacklist`, `org_model_calls` | as the ClickHouse key, `org` first where the table is per org, except the tables of the cell that [keys lead with `org`](#postgres) names | SoR | no memory content; the identity steps (`grants.revoke`, `groups.remove_member`, `personal.retire`, `collections.forget_owner`) rewrite `namespace_grants`, `namespace_invites`, `principal_groups`, `namespaces` and `collections` | +| `auth_attempts` | kind, hashed key and window | Coord | no content | +| `deployment_config`, `runtime_overrides`, `provider_configuration`, `assistant_service` | as the ClickHouse key | SoR | no content | +| `instances` | process | Coord | no content | +| `embedder_calibration`, `namespace_calibration` | as the ClickHouse key, `org` first for `namespace_calibration` | Derived (rebuilt by a recalibration, at embedding cost) | no content | A sweep deletes a `revoked_tokens` row ten days past its stored `expires_at`, as the ClickHouse TTL does today; a token without `exp`, an operator cutoff and every SCIM diff --git a/docs/features/dashboard.md b/docs/features/dashboard.md index b8f7caec7b..06ef9f628b 100644 --- a/docs/features/dashboard.md +++ b/docs/features/dashboard.md @@ -125,13 +125,19 @@ On Namespaces in your org, a search for the exact name of a namespace the list d show offers **Request access**, which is how a private namespace is asked for by name; a repository's or collection's name points to Repositories or the Library instead. **Invite** on a namespace you manage opens its members on the add field. The field takes a person's -login handle, which their account menu shows under **Signed in as** and which may be an -email, or a service account `sa:`. A collection's **Share** also takes a group -`group:`, an agent `agent:` or `everyone`. An email that is not a login handle reaches its owner only -once they sign in with it through single sign-on, or an operator links it to their account. -Until then the grant is kept as typed and reaches nobody. With sign-in on, **Settings** › -**Tokens** links to Namespaces in your org for giving a person access: a token is for a tool, -agent or script. +login handle, which their account menu shows under **Signed in as**, an email, or a +service account `sa:`. A collection's **Share** also takes a group `group:`, an +agent `agent:` or `everyone`. A login handle no account or live grant holds is +refused. An email is granted at once only when it is verified for an account; any other +email gets an [invitation](namespaces-and-sharing.md#membership-and-grants). The add +shows its link to copy, and the server emails it when it sends mail. The members dialog +and a repository's Access tab list it under **Invited**, with who made it and **Cancel**, +while it still admits someone: until it is accepted, cancelled or expired, or its maker no +longer administers the namespace. Where sign-in is single sign-on only, the email is +granted instead and reaches that person at their first sign-in. Whoever opens the link +signed in accepts it on Namespaces in your org, which then switches to the namespace; a +collection opens in the Library. With sign-in on, **Settings** › **Tokens** links to +Namespaces in your org for giving a person access: a token is for a tool, agent or script. The dashboard's text follows the [copy rules](../development/dashboard-design.md#rules-a-change-is-checked-against): its diff --git a/docs/features/namespaces-and-sharing.md b/docs/features/namespaces-and-sharing.md index 1c6df8c43e..d16f865257 100644 --- a/docs/features/namespaces-and-sharing.md +++ b/docs/features/namespaces-and-sharing.md @@ -71,18 +71,30 @@ account, or a service account `sa:`) a role on one namespace: `viewer` rea `writer` writes, `admin` manages grants and settings. The token carries the org and the namespaces it may reach; the grant table decides the role. -| Operation | Role | Does | -| -------------------------------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `grants.create` | admin | Grant a role. A create below the subject's current role is refused with 409 `GRANT_WOULD_DOWNGRADE` unless `replace=true`. | -| `grants.list` | viewer | Who has access, at which role, and any `pending_role`. | -| `grants.revoke` | admin | Remove a grant. | -| `grants.approve` | admin | Approve or reject a pending request, optionally with a different role. | -| `grants.pending_for_me` | viewer | Every pending request in the namespaces the caller administers, org-wide. | -| `namespace.browse` | viewer | Public namespaces in the org, never a collection (`closed` ones only with `include_closed`). | -| `namespace.join` | viewer | Self-join a public namespace. `viewer` is granted at once; a `writer` or `admin` request always lands pending, with no access until an admin approves. | -| `namespace.leave`, `namespace.cancel_request`, `namespace.mark_seen` | viewer | Drop one's own grant, withdraw a pending request, acknowledge an invitation. | -| `namespace.list_mine` | viewer | The namespaces the caller belongs to, each with its `kind` (`collection` for a collection) and `title`. | -| `namespace.list` | org admin | Every namespace in the org. | +| Operation | Role | Does | +| -------------------------------------------------------------------- | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `grants.create` | admin | Grant a role. A create below the subject's current role is refused with 409 `GRANT_WOULD_DOWNGRADE` unless `replace=true`. | +| `grants.invite` | admin | Give a person a role by login handle or email. An account's handle, or an email verified for one, is granted at once; any other email gets a single-use invitation link, emailed when the server has mail settings, or, where sign-in is single sign-on only, a grant that reaches that person at their first sign-in. A handle no account or live grant holds is refused. | +| `grants.list_invites`, `grants.cancel_invite` | admin | The open invitations, and withdraw one. | +| `grants.accept_invite` | a signed-in person | Accept an invitation link: its role goes to the account the caller signs in as. | +| `grants.list` | viewer | Who has access, at which role, and any `pending_role`. | +| `grants.revoke` | admin | Remove a grant. | +| `grants.approve` | admin | Approve or reject a pending request, optionally with a different role. | +| `grants.pending_for_me` | viewer | Every pending request in the namespaces the caller administers, org-wide. | +| `namespace.browse` | viewer | Public namespaces in the org, never a collection (`closed` ones only with `include_closed`). | +| `namespace.join` | viewer | Self-join a public namespace. `viewer` is granted at once; a `writer` or `admin` request always lands pending, with no access until an admin approves. | +| `namespace.leave`, `namespace.cancel_request`, `namespace.mark_seen` | viewer | Drop one's own grant, withdraw a pending request, record a visit (clears the namespace's new mark). | +| `namespace.list_mine` | viewer | The namespaces the caller belongs to, each with its `kind` (`collection` for a collection) and `title`. | +| `namespace.list` | org admin | Every namespace in the org. | + +A password account's email is never verified, so a grant by email reaches such an +account only through an invitation. The link is `/spaces#invite=…` on the dashboard, works +once, within seven days by default (`LOOM_INVITE_TTL_SECONDS`), and gives its role to +whoever opens it signed in, under their own login handle, as granted by the admin who made +it, while that admin still administers the namespace. To have the server email it, set +`LOOM_SMTP_URL` (`smtps://user:password@host:465`, or `smtp://…:587` with STARTTLS), +`LOOM_MAIL_FROM` and `LOOM_PUBLIC_BASE_URL`; without them, or when a send fails, the +dashboard shows the link to copy. The design is in [sharing](../architecture/sharing.md#invitations). Minting tokens, service accounts, read scopes and restricted namespaces are covered in the [tokens and grants guide](../guides/tokens-and-grants.md). diff --git a/docs/getting-started/connect-a-coding-agent.md b/docs/getting-started/connect-a-coding-agent.md index fe3312e543..b21eb91036 100644 --- a/docs/getting-started/connect-a-coding-agent.md +++ b/docs/getting-started/connect-a-coding-agent.md @@ -9,8 +9,11 @@ Loom gives Claude Code, Codex and Cursor shared long-term memory through plugins tools connected to the same self-hosted server. Invite each teammate to the team's namespace: **Invite people to this namespace** in the namespace picker, with that namespace picked, or **Invite** on Namespaces in your org. Each teammate makes their own token, and -their agents find the facts others save. A teammate without a dashboard account gets a token -from an operator (`loom mint-token`). Install the plugin or MCP entry below; the next +their agents find the facts others save. A teammate without an account is invited by email +and accepts once signed up; where sign-in is single sign-on only, the email is granted and +reaches them at their first sign-in. Self sign-up makes accounts in `LOOM_SELF_SIGNUP_ORG` +only, so for a namespace of another org, or where nobody can sign up, an operator makes +their token (`loom mint-token`). Install the plugin or MCP entry below; the next session can recall what an agent saved. What the Claude Code and Codex plugins send to Loom is in [data handling](../features/integrations/claude-code.md#data-handling). Conversation recording is off by default; the namespace owner turns it on with the **Record conversations** diff --git a/docs/guides/tokens-and-grants.md b/docs/guides/tokens-and-grants.md index 3c9f34e25e..d0b0cfec18 100644 --- a/docs/guides/tokens-and-grants.md +++ b/docs/guides/tokens-and-grants.md @@ -225,13 +225,17 @@ answer to the user (the entity graph, conversation reads, exports, admin ops) is namespace above what the token carries. Grants add; where the subject holds one, a token's claim goes no further than it. -| Op | Role | Does | -| ----------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------ | -| `grants.create` | admin | Give `subject` a `role`. Below the subject's current role it answers 409 `GRANT_WOULD_DOWNGRADE` unless `replace: true`. | -| `grants.revoke` | admin | Remove it; on a restricted namespace the grants of tokens the subject minted there go too. | -| `grants.list` | viewer | The namespace's grants. | -| `grants.approve` | admin | Activate a pending join request. Below the subject's current grant it answers 409: an approval never asks to lower one. | -| `grants.pending_for_me` | viewer | Requests waiting on the caller's approval. | +| Op | Role | Does | +| ----------------------- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `grants.create` | admin | Give `subject` a `role`. Below the subject's current role it answers 409 `GRANT_WOULD_DOWNGRADE` unless `replace: true`. | +| `grants.invite` | admin | Give a person a `role` by login handle or email: an account's handle or verified email is granted at once, any other email gets a single-use invitation link, or, where sign-in is single sign-on only, a grant as typed. A handle no account or live grant holds is refused (404). | +| `grants.accept_invite` | a signed-in person | Accept an invitation link; its role goes to the account the caller signs in as. | +| `grants.list_invites` | admin | The open invitations: each link that still admits someone. | +| `grants.cancel_invite` | admin | Withdraw an open invitation. | +| `grants.revoke` | admin | Remove it; on a restricted namespace the grants of tokens the subject minted there go too. | +| `grants.list` | viewer | The namespace's grants. | +| `grants.approve` | admin | Activate a pending join request. Below the subject's current grant it answers 409: an approval never asks to lower one. | +| `grants.pending_for_me` | viewer | Requests waiting on the caller's approval. | ```bash curl -s "$LOOM_BASE_URL/v1/grants.create" -H "Authorization: Bearer $ADMIN_TOKEN" \ @@ -253,11 +257,14 @@ curl -s "$LOOM_BASE_URL/v1/grants.create" -H "Authorization: Bearer $ADMIN_TOKEN owner proving the password from an SSO sign-in). A self-signup email is not: whoever typed the address first does not hold the grants written under it, which still cap that account's claims. Grant a self-signup account under its login handle, the namespace - it signed up with. A `grants.revoke` of an address no verified account holds, and that - never held a row of its own on the namespace, takes the rows stored under each - unverified account naming it, and the grants there of the tokens those accounts made. - When the address held a row of its own there, its revoke also takes the grants of the - tokens those accounts made there, unless one still holds an active grant of its own. + it signed up with, or invite its email with `grants.invite`, whose link the person + accepts signed in + ([invitations](../features/namespaces-and-sharing.md#membership-and-grants)). A + `grants.revoke` of an address no verified account holds, and that never held a row of + its own on the namespace, takes the rows stored under each unverified account naming it, + and the grants there of the tokens those accounts made. When the address held a row of + its own there, its revoke also takes the grants of the tokens those accounts made there, + unless one still holds an active grant of its own. - **Registering is owning.** `namespace.register` makes the caller the namespace's `admin`. With self-signup (`LOOM_IDENTITY_PROVIDER=trust-network`) the first principal to claim a name owns it; `loom claim-release --org --namespace ` revokes its grants, diff --git a/docs/reference/configuration.md b/docs/reference/configuration.md index cf8c6abdbf..1cec61f353 100644 --- a/docs/reference/configuration.md +++ b/docs/reference/configuration.md @@ -137,6 +137,10 @@ Authentication, tokens and identity providers. | `LOOM_WORKLOAD_EXCHANGES_PER_AGENT` | `int` | `300` | | Workload-token exchanges one agent of a trust (a token with an agent claim) may make in 10 minutes, so one agent's loop cannot spend the trust's. A trust without agents has only `workload_exchanges_per_trust`. | | `LOOM_SELF_SIGNUP` | `'off' \| 'open'` | `'off'` | | Browser self-signup: "off" (endpoint 404s) or "open" (/v1/auth/self-signup mints JWTs scoped to the requested namespace). A non-loopback bind refuses "open" unless identity_provider is "trust-network", allow_insecure is set, or oauth_login_provider is "oidc" (which closes sign-up). | | `LOOM_SELF_SIGNUP_ORG` | `str` | `'dev'` | | Default org for self-signed tokens. | +| `LOOM_SMTP_URL` | `str` | *(unset)* | | The mail server invitations go through: `smtps://user:password@host:465`, or `smtp://` on 587, which must offer STARTTLS. Empty: no email, and the inviter passes the link on. | +| `LOOM_MAIL_FROM` | `str` | `''` | | The From address of an invitation email, e.g. `Loom `. Empty sends none, as does an empty smtp_url or public_base_url (the link needs it). | +| `LOOM_SMTP_TIMEOUT_SECONDS` | `float` | `10.0` | | Seconds each step of an invitation email may wait on the mail server; past it the email is reported not sent and the link is shown to pass on. | +| `LOOM_INVITE_TTL_SECONDS` | `int` | `604800` | | Seconds an invitation link stays valid, at most 30 days: it admits whoever opens it. | | `LOOM_IDENTITY_PROVIDER` | `'' \| 'single-user' \| 'trust-network' \| 'gateway'` | `''` | | How callers authenticate: "single-user" (no auth, one anonymous identity), "trust-network" (self-signup, first claim wins) or "gateway" (an upstream proxy mints short-lived Loom JWTs with the shared HS256 secret; Loom only validates). Empty = inferred from auth_required and self_signup at boot. | | `LOOM_DASHBOARD_REDIRECT_URL` | `str` | `''` | | When set, a dashboard page load redirects (302) here instead of serving the SPA (Loom behind an aggregator). Deployment-specific; never hardcode. | | `LOOM_TRUSTED_CALLERS` | `str` | `''` | | Comma-separated subjects allowed to send `X-Loom-On-Behalf-Of` (a trusted aggregator passing each end-user's identity under one service token). Empty disables the header. | diff --git a/docs/reference/operations.md b/docs/reference/operations.md index bb796e5306..450b9eff73 100644 --- a/docs/reference/operations.md +++ b/docs/reference/operations.md @@ -124,7 +124,7 @@ python scripts/codegen/docs_reference.py --check # exit 1 when a region is stal -389 operations in 43 groups. Every op is served at `POST /v1/` and as the MCP tool `loom_` (dots become underscores). +393 operations in 43 groups. Every op is served at `POST /v1/` and as the MCP tool `loom_` (dots become underscores). Columns: **Role** is the minimum role (`viewer` < `writer` < `admin` < `org_admin` < `platform_admin`); **Kind** is `read` (idempotent, viewer, unaudited, writes nothing — MCP `readOnlyHint`), `idempotent` (safe to retry) or `write`; **Listed under `all`** says whether an MCP connection on the `all` toolset lists the op in `tools/list` (`code.*` ops only with `LOOM_MCP_CODE_TOOLS=true`); an op marked `no` is still callable by name or through `loom_op`, unless it is hidden from MCP; **Audit** marks ops that leave an `audit_log` row. @@ -376,9 +376,13 @@ Fields for every `grants` op: [operations/grants.md](operations/grants.md). | Operation | Summary | Role | Kind | Listed under `all` | Audit | | --- | --- | --- | --- | --- | --- | +| [`grants.accept_invite`](operations/grants.md#grantsaccept_invite) | Accept an invitation link as the signed-in person. | viewer | write | no | yes | | [`grants.approve`](operations/grants.md#grantsapprove) | Approve (or reject) a pending grant request. | admin | idempotent | no | yes | +| [`grants.cancel_invite`](operations/grants.md#grantscancel_invite) | Cancel an open invitation, so its link admits nobody. | admin | idempotent | no | yes | | [`grants.create`](operations/grants.md#grantscreate) | Grant another subject (user or service-account) viewer / writer / admin role on a namespace. | admin | idempotent | yes | yes | +| [`grants.invite`](operations/grants.md#grantsinvite) | Give a person a role on a namespace by login handle or email. | admin | write | no | yes | | [`grants.list`](operations/grants.md#grantslist) | List active grants on a namespace — who has access, at which role. | viewer | read | yes | | +| [`grants.list_invites`](operations/grants.md#grantslist_invites) | List a namespace's open invitations. | admin | idempotent | no | | | [`grants.pending_for_me`](operations/grants.md#grantspending_for_me) | Every pending request in the namespaces the caller administers, in one statement. | viewer | read | no | | | [`grants.revoke`](operations/grants.md#grantsrevoke) | Remove a subject's grant on a namespace. | admin | idempotent | no | yes | | [`grants.share_agent`](operations/grants.md#grantsshare_agent) | Let another agent of the caller's trust read, or write, the caller's own namespace. | writer | idempotent | no | yes | @@ -607,7 +611,7 @@ Fields for every `namespace` op: [operations/namespace.md](operations/namespace. | [`namespace.list_categories`](operations/namespace.md#namespacelist_categories) | Enumerate registered categories with item counts. | viewer | read | no | | | [`namespace.list_mine`](operations/namespace.md#namespacelist_mine) | List namespaces the caller is a member of (own + granted). | viewer | read | yes | | | [`namespace.list_ontology`](operations/namespace.md#namespacelist_ontology) | List the ontology terms (entity and relation kinds) registered for a namespace. | viewer | read | no | | -| [`namespace.mark_seen`](operations/namespace.md#namespacemark_seen) | Acknowledge a new-invitation indicator on a namespace. | viewer | idempotent | no | | +| [`namespace.mark_seen`](operations/namespace.md#namespacemark_seen) | Record a visit to a namespace, clearing its new mark. | viewer | idempotent | no | | | [`namespace.register`](operations/namespace.md#namespaceregister) | Create a shared memory workspace within an org; caller becomes admin. | viewer | idempotent | yes | yes | | [`namespace.register_category`](operations/namespace.md#namespaceregister_category) | Register a category in a namespace. | writer | write | no | yes | | [`namespace.register_ontology`](operations/namespace.md#namespaceregister_ontology) | Register an entity type or relation verb for a namespace. | admin | idempotent | yes | yes | diff --git a/docs/reference/operations/grants.md b/docs/reference/operations/grants.md index 52365d7121..9bb2c4b5cf 100644 --- a/docs/reference/operations/grants.md +++ b/docs/reference/operations/grants.md @@ -8,6 +8,23 @@ Every op is `POST /v1/` over HTTP and the MCP tool `loom_`. The identity +## `grants.accept_invite` + +Accept an invitation link as the signed-in person. + +`POST /v1/grants.accept_invite` · MCP `loom_grants_accept_invite` · role `viewer` · write · audited · not listed under the MCP `all` toolset + +| Input field | Type | Default | Meaning | +| --- | --- | --- | --- | +| `org` | `str` | required | The tenant (first element of the identity tuple). | +| `namespace` | `str` | required | The namespace the link names. | +| `secret` | `str` | required | The secret from the link's fragment. | + +| Output field | Type | Meaning | +| --- | --- | --- | +| `namespace` | `str` | The namespace the op reads or writes. | +| `role` | `Literal['viewer', 'writer', 'admin']` | The caller's role on the namespace now: the invitation's, or a higher one they held. | + ## `grants.approve` Approve (or reject) a pending grant request. @@ -30,6 +47,22 @@ Approve (or reject) a pending grant request. | `role` | `Literal['viewer', 'writer', 'admin'] \| None` | The role approved (for `reject`, the role the request would have had); None when no grant row existed for the subject. | | `decided_at` | `datetime` | When the decision was written (UTC). | +## `grants.cancel_invite` + +Cancel an open invitation, so its link admits nobody. + +`POST /v1/grants.cancel_invite` · MCP `loom_grants_cancel_invite` · role `admin` · idempotent · audited · not listed under the MCP `all` toolset + +| Input field | Type | Default | Meaning | +| --- | --- | --- | --- | +| `org` | `str` | required | The tenant (first element of the identity tuple). | +| `namespace` | `str` | required | The namespace the op reads or writes. | +| `invite_id` | `str` | required | The invitation, as grants.invite and grants.list_invites return it. | + +| Output field | Type | Meaning | +| --- | --- | --- | +| `cancelled` | `bool` | True when an open invitation was cancelled; false when none was open under the id. | + ## `grants.create` Grant another subject (user or service-account) viewer / writer / admin role on a namespace. @@ -53,6 +86,30 @@ Grant another subject (user or service-account) viewer / writer / admin role on | `role` | `Literal['viewer', 'writer', 'admin']` | The role now active for the subject. | | `granted_at` | `datetime` | When the grant row was written (UTC). | +## `grants.invite` + +Give a person a role on a namespace by login handle or email. + +`POST /v1/grants.invite` · MCP `loom_grants_invite` · role `admin` · write · audited · not listed under the MCP `all` toolset + +| Input field | Type | Default | Meaning | +| --- | --- | --- | --- | +| `org` | `str` | required | The tenant (first element of the identity tuple). | +| `namespace` | `str` | required | The namespace the op reads or writes. | +| `to` | `str` | required | The person to give `role`: a login handle an account or live grant holds (any other is refused), or an email, granted at once when verified for an account or under single sign-on only, and otherwise sent an invitation link. | +| `role` | `Literal['viewer', 'writer', 'admin']` | required | `viewer`, `writer` or `admin`; a code namespace takes only `viewer` and `admin`. | + +| Output field | Type | Meaning | +| --- | --- | --- | +| `outcome` | `Literal['granted', 'invited']` | "granted": the grant is written under `subject`; "invited": no account holds the email, and `link_path` opens the invitation. | +| `role` | `Literal['viewer', 'writer', 'admin']` | The role given, as asked. | +| `subject` | `str` | On "granted", the subject the grant is written under: the person's handle as stored (an account's, or a grant's), or, where sign-in is single sign-on only or the request has no token, `to` as typed. | +| `invite_id` | `str` | On "invited": the invitation, for grants.cancel_invite. | +| `link_path` | `str` | On "invited": the dashboard path that accepts it, its secret in the fragment. | +| `url` | `str` | `link_path` on the server's public_base_url; "" when that is unset. | +| `expires_at` | `datetime \| None` | On "invited": when the link stops working (UTC), `invite_ttl_seconds` after it was made. | +| `emailed` | `bool` | On "invited": the link was emailed to `to` (the server has mail settings). | + ## `grants.list` List active grants on a namespace — who has access, at which role. @@ -73,6 +130,21 @@ List active grants on a namespace — who has access, at which role. | `next_cursor` | `str \| None` | Pass as `cursor` for the next page; None when this page is the last. | | `truncated` | `bool` | True when more people follow this page (`next_cursor` is set). | +## `grants.list_invites` + +List a namespace's open invitations. + +`POST /v1/grants.list_invites` · MCP `loom_grants_list_invites` · role `admin` · idempotent · not listed under the MCP `all` toolset + +| Input field | Type | Default | Meaning | +| --- | --- | --- | --- | +| `org` | `str` | required | The tenant (first element of the identity tuple). | +| `namespace` | `str` | required | The namespace the op reads or writes. | + +| Output field | Type | Meaning | +| --- | --- | --- | +| `rows` | `list[_InviteEntry]` | The namespace's open links that still admit someone (not accepted, cancelled or expired, and with a maker who still stands), newest first; at most 200. | + ## `grants.pending_for_me` Every pending request in the namespaces the caller administers, in one statement. diff --git a/docs/reference/operations/namespace.md b/docs/reference/operations/namespace.md index 83a2ee29ec..f0e112310b 100644 --- a/docs/reference/operations/namespace.md +++ b/docs/reference/operations/namespace.md @@ -330,7 +330,7 @@ List the ontology terms (entity and relation kinds) registered for a namespace. ## `namespace.mark_seen` -Acknowledge a new-invitation indicator on a namespace. +Record a visit to a namespace, clearing its new mark. `POST /v1/namespace.mark_seen` · MCP `loom_namespace_mark_seen` · role `viewer` · idempotent · not listed under the MCP `all` toolset diff --git a/docs/reference/schema.md b/docs/reference/schema.md index 60356c1f34..d8eddf35dc 100644 --- a/docs/reference/schema.md +++ b/docs/reference/schema.md @@ -142,7 +142,7 @@ the `loom` tables each view reads, and, for each materialized view, its target, -198 tables, 5 views and 19 materialized views in the `loom` and `loom_telemetry` databases; a `loom_telemetry` object keeps its database prefix. +199 tables, 5 views and 19 materialized views in the `loom` and `loom_telemetry` databases; a `loom_telemetry` object keeps its database prefix. #### Tables @@ -291,6 +291,7 @@ the `loom` tables each view reads, and, for each materialized view, its target, | `namespace_calibration_result` | `ReplacingMergeTree(version)` | `(org, namespace)` | | | | | `namespace_grants` | `ReplacingMergeTree(version)` | `(org, namespace, subject)` | `org` | | | | `namespace_guides` | `MergeTree` | `(org, namespace, revision)` | | | | +| `namespace_invites` | `ReplacingMergeTree(version)` | `(org, namespace, invite_id)` | | `toDateTime(expires_at) + toIntervalDay(7)` | | | `namespace_ontology` | `ReplacingMergeTree(version)` | `(org, namespace, kind, name)` | `org` | | | | `namespace_policies` | `ReplacingMergeTree(version)` | `(org, namespace, policy_id)` | | | | | `namespace_snapshots` | `MergeTree` | `(org, source_namespace, created_at)` | `org` | | | diff --git a/docs/reference/status.md b/docs/reference/status.md index 21be16d80c..2036c8d72e 100644 --- a/docs/reference/status.md +++ b/docs/reference/status.md @@ -25,7 +25,7 @@ serves is in the [MCP reference](./mcp.md#toolsets). -389 operations, 275 of them experimental. +393 operations, 279 of them experimental. | Group | Stable | Experimental | | --- | --- | --- | @@ -47,7 +47,7 @@ serves is in the [MCP reference](./mcp.md#toolsets). | `erasure` | 2 | [`erasure.list`](operations/erasure.md#erasurelist), [`erasure.status`](operations/erasure.md#erasurestatus) | | `extraction_policy` | 0 | [`extraction_policy.clear`](operations/extraction_policy.md#extraction_policyclear), [`extraction_policy.get`](operations/extraction_policy.md#extraction_policyget), [`extraction_policy.set`](operations/extraction_policy.md#extraction_policyset) | | `facts` | 2 | [`facts.expire_by_adapter`](operations/facts.md#factsexpire_by_adapter), [`facts.path`](operations/facts.md#factspath), [`facts.related`](operations/facts.md#factsrelated) | -| `grants` | 2 | [`grants.approve`](operations/grants.md#grantsapprove), [`grants.pending_for_me`](operations/grants.md#grantspending_for_me), [`grants.revoke`](operations/grants.md#grantsrevoke), [`grants.share_agent`](operations/grants.md#grantsshare_agent), [`grants.unshare_agent`](operations/grants.md#grantsunshare_agent) | +| `grants` | 2 | [`grants.accept_invite`](operations/grants.md#grantsaccept_invite), [`grants.approve`](operations/grants.md#grantsapprove), [`grants.cancel_invite`](operations/grants.md#grantscancel_invite), [`grants.invite`](operations/grants.md#grantsinvite), [`grants.list_invites`](operations/grants.md#grantslist_invites), [`grants.pending_for_me`](operations/grants.md#grantspending_for_me), [`grants.revoke`](operations/grants.md#grantsrevoke), [`grants.share_agent`](operations/grants.md#grantsshare_agent), [`grants.unshare_agent`](operations/grants.md#grantsunshare_agent) | | `help` | 0 | [`help.get`](operations/help.md#helpget), [`help.search`](operations/help.md#helpsearch) | | `inbox` | 0 | [`inbox.list`](operations/inbox.md#inboxlist), [`inbox.policy_list`](operations/inbox.md#inboxpolicy_list), [`inbox.policy_set`](operations/inbox.md#inboxpolicy_set), [`inbox.principals`](operations/inbox.md#inboxprincipals), [`inbox.register`](operations/inbox.md#inboxregister) | | `insights` | 0 | [`insights.catalog`](operations/insights.md#insightscatalog), [`insights.query`](operations/insights.md#insightsquery) | diff --git a/frontend/src/api/invites.ts b/frontend/src/api/invites.ts new file mode 100644 index 0000000000..07cecd6091 --- /dev/null +++ b/frontend/src/api/invites.ts @@ -0,0 +1,58 @@ +// Inviting a person to a namespace: by a login handle or verified email they are granted at +// once; by any other email they get a single-use link, emailed when the server can send mail. +// Wire shapes mirror server/identity/api/models_grants.py. +import { post } from "../api"; +import type { GrantRole, Identity } from "../api"; + +type Scope = Pick; + +export interface InviteResult { + outcome: "granted" | "invited"; + role: GrantRole; + /** The subject granted, for `granted`. */ + subject: string; + invite_id: string; + /** `/spaces#invite=&org=…&namespace=…`, for `invited`: the link without the server's address. */ + link_path: string; + /** The whole link, when the server knows its public address. */ + url: string; + expires_at: string | null; + emailed: boolean; +} + +export interface OpenInvite { + invite_id: string; + email: string; + role: GrantRole; + created_by: string; + created_at: string; + expires_at: string; +} + +export function invite(id: Scope, to: string, role: GrantRole): Promise { + return post("/v1/grants.invite", { org: id.org, namespace: id.namespace, to, role }); +} + +export function listInvites(id: Scope): Promise<{ rows: OpenInvite[] }> { + return post("/v1/grants.list_invites", { org: id.org, namespace: id.namespace }); +} + +export function cancelInvite(id: Scope, inviteId: string): Promise<{ cancelled: boolean }> { + return post("/v1/grants.cancel_invite", { org: id.org, namespace: id.namespace, invite_id: inviteId }); +} + +export function acceptInvite(id: Scope, secret: string): Promise<{ namespace: string; role: GrantRole }> { + return post("/v1/grants.accept_invite", { org: id.org, namespace: id.namespace, secret }); +} + +/** The link to hand over: the server's own address when it knows it, else this page's. */ +export function inviteLink(r: Pick): string { + return r.url || `${window.location.origin}${r.link_path}`; +} + +/** A person's spelling, which `grants.invite` takes; a service account, a grant principal or + * everyone goes to `grants.create`, as the server's `has_aliases` and `is_reserved_subject` say. */ +export function isPersonSpelling(subject: string): boolean { + const last = subject.toLowerCase().split("/").pop() ?? ""; + return subject !== "*" && last !== "everyone" && !/^(sa|user|group|agent):/.test(last); +} diff --git a/frontend/src/components/Invitations.test.tsx b/frontend/src/components/Invitations.test.tsx new file mode 100644 index 0000000000..659d6899f1 --- /dev/null +++ b/frontend/src/components/Invitations.test.tsx @@ -0,0 +1,83 @@ +import { cleanup, render, screen, waitFor } from "../test/rtl"; +import userEvent from "@testing-library/user-event"; +import { afterEach, describe, expect, it, vi } from "vitest"; +import { cancelInvite, isPersonSpelling, listInvites } from "../api/invites"; +import { ApiError } from "../lib/errors"; +import { InviteSent, OpenInvitations } from "./Invitations"; + +vi.mock("../api/invites", async (importOriginal) => { + const actual = await importOriginal(); + return { ...actual, listInvites: vi.fn(), cancelInvite: vi.fn(async () => ({ cancelled: true })) }; +}); +afterEach(() => cleanup()); + +const sent = { + outcome: "invited" as const, + role: "writer" as const, + subject: "", + invite_id: "abc", + link_path: "/spaces#invite=s3cret&org=dev&namespace=team", + url: "", + expires_at: "2026-12-11T12:00:00Z", + emailed: false, +}; + +describe("InviteSent", () => { + it("hands over the link on this page's address when the server knows none", () => { + render(); + expect(screen.getByRole("status")).toHaveTextContent("No account in this org has verified pat@example.com."); + expect( + screen.getByText(`${window.location.origin}/spaces#invite=s3cret&org=dev&namespace=team`), + ).toBeInTheDocument(); + }); + + it("says it was emailed, and still shows the server's link", () => { + render( + , + ); + expect(screen.getByRole("status")).toHaveTextContent("Emailed an invitation to pat@example.com."); + expect(screen.getByText("https://loom.example.com/spaces#x")).toBeInTheDocument(); + }); +}); + +const open = { + invite_id: "abc", + email: "pat@example.com", + role: "writer" as const, + created_by: "ann", + created_at: "2026-12-04T12:00:00Z", + expires_at: "2026-12-11T12:00:00Z", +}; + +describe("OpenInvitations", () => { + it("lists the open invitations and cancels one", async () => { + vi.mocked(listInvites).mockResolvedValue({ rows: [open] }); + const user = userEvent.setup(); + render(); + await user.click(await screen.findByRole("button", { name: "Cancel the invitation to pat@example.com" })); + expect(cancelInvite).toHaveBeenCalledWith({ org: "dev", namespace: "team" }, "abc"); + await waitFor(() => expect(screen.queryByRole("region", { name: "Open invitations" })).toBeNull()); + }); + + it("says a failed read failed, not that there are none, and reads again on Retry", async () => { + vi.mocked(listInvites) + .mockRejectedValueOnce(new ApiError({ status: 503, code: "BACKEND_UNAVAILABLE", message: "grants unreadable" })) + .mockResolvedValueOnce({ rows: [{ ...open, email: "lee@example.com" }] }); + const user = userEvent.setup(); + render(); + expect(await screen.findByRole("alert")).toHaveTextContent("Couldn't load the invitations: grants unreadable"); + await user.click(screen.getByRole("button", { name: "Retry loading the invitations" })); + expect(await screen.findByText("lee@example.com")).toBeInTheDocument(); + }); +}); + +describe("isPersonSpelling", () => { + it("tells a person from a principal", () => { + for (const s of ["robin", "pat@example.com", "Pat"]) expect(isPersonSpelling(s)).toBe(true); + for (const s of ["sa:bot", "group:eng", "user:42", "agent:x", "everyone", "Everyone", "*", "acme/user:1"]) + expect(isPersonSpelling(s)).toBe(false); + }); +}); diff --git a/frontend/src/components/Invitations.tsx b/frontend/src/components/Invitations.tsx new file mode 100644 index 0000000000..42bdf7b2ea --- /dev/null +++ b/frontend/src/components/Invitations.tsx @@ -0,0 +1,105 @@ +import { useEffect, useState } from "react"; +import { Button } from "@clickhouse/click-ui/Button"; +import { cancelInvite, inviteLink, listInvites, type InviteResult, type OpenInvite } from "../api/invites"; +import { errorLine } from "../lib/errorWords"; +import { absoluteTime, fmtInt } from "../lib/format"; +import { CopyButton } from "./CopyButton"; +import { toastError } from "./Toast"; + +type Scope = { org: string; namespace: string }; + +/** What an invitation by email did: the link, and whether the server emailed it. */ +export function InviteSent({ email, result }: { email: string; result: InviteResult }) { + const link = inviteLink(result); + return ( +
+

+ {result.emailed + ? `Emailed an invitation to ${email}. You can also send them this link:` + : `No account in this org has verified ${email}. Send them this link:`} +

+
+ {link} + +
+

+ It works once, until {absoluteTime(result.expires_at)}: whoever opens it signed in gets the role, under the + account they sign in with. +

+
+ ); +} + +/** The namespace's open invitations, each with Cancel; nothing while there are none, and a + * failed read with Retry. `version` changes to read them again after an invitation is made. */ +export function OpenInvitations({ scope, version }: { scope: Scope; version: number }) { + const [rows, setRows] = useState([]); + const [error, setError] = useState(null); + const [reads, setReads] = useState(0); + const [busy, setBusy] = useState(null); + useEffect(() => { + let live = true; + listInvites(scope) + .then((r) => { + if (!live) return; + setRows(r.rows); + setError(null); + }) + .catch((e: unknown) => live && setError(errorLine(e, { read: true }))); + return () => { + live = false; + }; + }, [scope.org, scope.namespace, version, reads]); + // A line, not a second error state: the dialog's own list says it failed too in an outage. + if (error !== null && rows.length === 0) { + return ( +
+ Couldn't load the invitations: {error} + +
+ ); + } + if (rows.length === 0) return null; + + const cancel = async (row: OpenInvite) => { + setBusy(row.invite_id); + try { + await cancelInvite(scope, row.invite_id); + setRows((all) => all.filter((r) => r.invite_id !== row.invite_id)); + } catch (e) { + toastError("Couldn't cancel the invitation", e); + } finally { + setBusy(null); + } + }; + + return ( +
+
{`Invited (${fmtInt(rows.length)})`}
+
    + {rows.map((r) => ( +
  • + {r.email} + {`${r.role}, by ${r.created_by}, until ${absoluteTime(r.expires_at)}`} + +
  • + ))} +
+
+ ); +} diff --git a/frontend/src/components/SubjectHelp.tsx b/frontend/src/components/SubjectHelp.tsx index ba0e03d98a..9cb14525bc 100644 --- a/frontend/src/components/SubjectHelp.tsx +++ b/frontend/src/components/SubjectHelp.tsx @@ -1,12 +1,12 @@ -/** What a spelling in an add field reaches: a namespace's members and a repository's readers - * take the same subjects through `grants.create`, and a collection also takes a group, an agent - * and everyone. */ +/** What a spelling in an add field reaches: a person through `grants.invite`, the others + * through `grants.create`; a collection also takes a group, an agent and everyone. */ export function SubjectHelp({ id, collection = false }: { id: string; collection?: boolean }) { return (

- A login handle is the name a person signs in with, shown in their account menu under Signed in as; it may be an - email. Any other email reaches them only once they sign in with it through single sign-on, or an operator links it - to their account. A service account is sa:<name> + A login handle is the name a person signs in with, shown in their account menu under Signed in as. An email is + granted at once only when it is verified for an account; any other email gets an invitation link, emailed too when + this server sends mail, and whoever opens it signed in joins. Where sign-in is single sign-on only, the email is + granted instead. A service account is sa:<name> {collection ? ( <> , a group group:<id>, an agent{" "} diff --git a/frontend/src/flows/MembersDialog.fanout.test.tsx b/frontend/src/flows/MembersDialog.fanout.test.tsx index ddee88f32b..c31172f0e9 100644 --- a/frontend/src/flows/MembersDialog.fanout.test.tsx +++ b/frontend/src/flows/MembersDialog.fanout.test.tsx @@ -6,9 +6,23 @@ import { render, screen, fireEvent, waitFor } from "../test/rtl"; import { MembersDialog } from "./MembersDialog"; import { useStore } from "../lib/state"; import * as api from "../api"; +import * as invites from "../api/invites"; import { ApiError } from "../lib/errors"; import { ToastViewport } from "../components/Toast"; +vi.mock("../api/invites", async (importOriginal) => ({ + ...(await importOriginal()), + invite: vi.fn(async (_id: unknown, subject: string, role: string) => ({ + outcome: "granted" as const, + role, + subject, + invite_id: "", + link_path: "", + url: "", + expires_at: null, + emailed: false, + })), +})); vi.mock("../api", async (importOriginal) => { const actual = await importOriginal(); return { @@ -41,6 +55,7 @@ const elsewhere = { beforeEach(() => { vi.mocked(api.approveGrant).mockClear(); vi.mocked(api.createGrant).mockClear(); + vi.mocked(invites.invite).mockClear(); useStore.setState({ whoami: { authenticated: true, subject: "alice", org: "clickhouse", roles: ["ADMIN"] }, }); @@ -113,9 +128,9 @@ describe("MembersDialog approves a requester on every waiting branch at once", ( expect(screen.getByRole("button", { name: "Role for the new reader" })).toHaveTextContent("Reader"); fireEvent.change(screen.getByRole("textbox", { name: /reader to add/ }), { target: { value: subject } }); fireEvent.click(screen.getByRole("button", { name: /^Add$/ })); - await waitFor(() => expect(api.createGrant).toHaveBeenCalledTimes(n)); + await waitFor(() => expect(invites.invite).toHaveBeenCalledTimes(n)); } - expect(vi.mocked(api.createGrant).mock.calls.map((c) => [c[1], c[2]])).toEqual([ + expect(vi.mocked(invites.invite).mock.calls.map((c) => [c[1], c[2]])).toEqual([ ["reader-a", "viewer"], ["reader-b", "viewer"], ]); diff --git a/frontend/src/flows/MembersDialog.invite.test.tsx b/frontend/src/flows/MembersDialog.invite.test.tsx new file mode 100644 index 0000000000..b7fca49c84 --- /dev/null +++ b/frontend/src/flows/MembersDialog.invite.test.tsx @@ -0,0 +1,97 @@ +import { cleanup, render, screen, waitFor, within } from "../test/rtl"; +import userEvent from "@testing-library/user-event"; +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import * as api from "../api"; +import * as invites from "../api/invites"; +import { toast } from "../components/Toast"; +import { useStore } from "../lib/state"; +import { MembersDialog } from "./MembersDialog"; + +// A person is added through grants.invite: an account is granted at once; any other email +// gets a link the dialog shows to copy and lists as open. A service account goes through +// grants.create as typed. + +vi.mock("../api", async (importOriginal) => ({ + ...(await importOriginal()), + listGrants: vi.fn(async () => ({ rows: [] })), + createGrant: vi.fn(async () => ({})), +})); +vi.mock("../components/Toast", async (importOriginal) => ({ + ...(await importOriginal()), + toast: vi.fn(), +})); +vi.mock("../api/invites", async (importOriginal) => ({ + ...(await importOriginal()), + invite: vi.fn(), + listInvites: vi.fn(async () => ({ rows: [] })), +})); + +const invited = { + outcome: "invited" as const, + role: "writer" as const, + subject: "", + invite_id: "abc", + link_path: "/spaces#invite=s3cret&org=dev&namespace=team", + url: "https://loom.example.com/spaces#invite=s3cret&org=dev&namespace=team", + expires_at: "2026-12-11T12:00:00Z", + emailed: true, +}; + +beforeEach(() => { + vi.mocked(api.createGrant).mockClear(); + vi.mocked(invites.invite).mockReset(); + useStore.setState({ whoami: { authenticated: true, subject: "ann", org: "dev", roles: ["ADMIN"] } }); +}); +afterEach(() => cleanup()); + +async function add(subject: string) { + const user = userEvent.setup(); + render( {}} org="dev" namespace="team" kind="memory" />); + await user.click((await screen.findAllByRole("button", { name: /Add member/ }))[0]); + await user.type(await screen.findByRole("textbox", { name: /member to add/ }), `${subject}{Enter}`); +} + +describe("MembersDialog invites a person", () => { + it("shows an email's invitation link and lists it as open", async () => { + vi.mocked(invites.invite).mockResolvedValue(invited); + vi.mocked(invites.listInvites) + .mockResolvedValueOnce({ rows: [] }) + .mockResolvedValue({ + rows: [ + { + invite_id: "abc", + email: "pat@example.com", + role: "writer", + created_by: "ann", + created_at: "2026-12-04T12:00:00Z", + expires_at: "2026-12-11T12:00:00Z", + }, + ], + }); + await add("pat@example.com"); + expect(invites.invite).toHaveBeenCalledWith({ org: "dev", namespace: "team" }, "pat@example.com", "writer"); + const status = await screen.findByRole("status"); + expect(status).toHaveTextContent("Emailed an invitation to pat@example.com."); + expect(within(status).getByText(invited.url)).toBeInTheDocument(); + const open = await screen.findByRole("region", { name: "Open invitations" }); + expect(open).toHaveTextContent("pat@example.com"); + expect(api.createGrant).not.toHaveBeenCalled(); + }); + + it("grants an account's handle at once, under the subject the server names", async () => { + vi.mocked(invites.invite).mockResolvedValue({ ...invited, outcome: "granted", subject: "robin", invite_id: "" }); + await add("Robin"); + await waitFor(() => expect(toast).toHaveBeenCalledWith("Added robin as writer", "ok")); + expect(invites.invite).toHaveBeenCalledTimes(1); + expect(screen.queryByRole("status")).toBeNull(); + expect(screen.queryByRole("textbox", { name: /member to add/ })).toBeNull(); + }); + + it("grants a service account through grants.create, as typed", async () => { + await add("sa:triage"); + await waitFor(() => + expect(api.createGrant).toHaveBeenCalledWith({ org: "dev", namespace: "team" }, "sa:triage", "writer"), + ); + expect(invites.invite).not.toHaveBeenCalled(); + }); +}); diff --git a/frontend/src/flows/MembersDialog.loading.test.tsx b/frontend/src/flows/MembersDialog.loading.test.tsx index 2d910b0245..1f306f1df5 100644 --- a/frontend/src/flows/MembersDialog.loading.test.tsx +++ b/frontend/src/flows/MembersDialog.loading.test.tsx @@ -6,11 +6,16 @@ import { act, render, screen, fireEvent, waitFor } from "../test/rtl"; import { MembersDialog } from "./MembersDialog"; import { useStore } from "../lib/state"; import * as api from "../api"; +import { invite } from "../api/invites"; vi.mock("../api", async (importOriginal) => { const actual = await importOriginal(); - return { ...actual, listGrants: vi.fn(), approveGrant: vi.fn(async () => ({})), createGrant: vi.fn() }; + return { ...actual, listGrants: vi.fn(), approveGrant: vi.fn(async () => ({})) }; }); +vi.mock("../api/invites", async (importOriginal) => ({ + ...(await importOriginal()), + invite: vi.fn(), +})); const PENDING = { subject: "reporter-private", @@ -91,13 +96,15 @@ describe("MembersDialog opened on the add field", () => { it("describes the field by a refused add's error, then the help", async () => { vi.mocked(api.listGrants).mockResolvedValue({ rows: [] } as never); - vi.mocked(api.createGrant).mockRejectedValueOnce(new Error("That subject is not allowed here")); + vi.mocked(invite).mockRejectedValueOnce(new Error("No account in clickhouse signs in as pat")); render( {}} org="clickhouse" namespace="team" startAdding />); const field = await screen.findByRole("textbox", { name: /member to add/ }); fireEvent.change(field, { target: { value: "pat" } }); fireEvent.keyDown(field, { key: "Enter" }); await waitFor(() => - expect(field).toHaveAccessibleDescription(/^That subject is not allowed here.*A login handle is the name/), + expect(field).toHaveAccessibleDescription( + /^No account in clickhouse signs in as pat.*A login handle is the name/, + ), ); }); diff --git a/frontend/src/flows/MembersDialog.tsx b/frontend/src/flows/MembersDialog.tsx index fd12ac6095..d144c2888c 100644 --- a/frontend/src/flows/MembersDialog.tsx +++ b/frontend/src/flows/MembersDialog.tsx @@ -33,6 +33,8 @@ import { andList, fmtInt } from "../lib/format"; import { MORE_SHOWN, type ShowMoreRows, useShowMore } from "../lib/useShowMore"; import { grantSpellings, mySpellings, namesMe, subjectLabel } from "../lib/grantSubject"; import { PlaceLink } from "../components/ui/PlaceLink"; +import { invite, isPersonSpelling, type InviteResult } from "../api/invites"; +import { InviteSent, OpenInvitations } from "../components/Invitations"; /** What Remove's confirm says: who still gets in once the grant here goes. Sign-in off serves * every request, so it says only that the grant is revoked. */ @@ -236,6 +238,10 @@ export function MembersDialog({ const [cut, setCut] = useState(false); const [adding, setAdding] = useState(startAdding); const [newSubject, setNewSubject] = useState(""); + // The invitation an add just made, with its link to copy; and how many it has made, which + // reads the open invitations again. + const [sent, setSent] = useState<{ email: string; result: InviteResult } | null>(null); + const [invited, setInvited] = useState(0); // A code index has no writer role, so its default must be one the select offers. const defaultRole: GrantRole = isCode ? "viewer" : "writer"; const [newRole, setNewRole] = useState(defaultRole); @@ -316,8 +322,23 @@ export function MembersDialog({ setBusy("__add__"); setErr(null); try { - await createGrant({ org, namespace }, subj, newRole); - toast(`Added ${subjectLabel(subj, org)} as ${newRole}`, "ok"); + // A person by handle or email is invited: an account is granted at once, any other + // email gets a link. A service account, a group or everyone is granted as typed. + if (isPersonSpelling(subj)) { + const out = await invite({ org, namespace }, subj, newRole); + if (out.outcome === "invited") { + // The link stays on screen to copy, and the add field open for the next person. + setSent({ email: subj, result: out }); + setInvited((n) => n + 1); + setNewSubject(""); + return; + } + toast(`Added ${subjectLabel(out.subject, org)} as ${newRole}`, "ok"); + } else { + await createGrant({ org, namespace }, subj, newRole); + toast(`Added ${subjectLabel(subj, org)} as ${newRole}`, "ok"); + } + setSent(null); setNewSubject(""); setNewRole(defaultRole); setAdding(false); @@ -454,6 +475,7 @@ export function MembersDialog({ // The next open, if the caller keeps the dialog mounted, starts where this one did. setAdding(startAdding); setErr(null); + setSent(null); } onOpenChange(v); }} @@ -492,6 +514,7 @@ export function MembersDialog({ {cut && (

{`Only the first ${fmtInt(GRANTS_READ)} grants were read.`}

)} + {canManage && } {pendingRows.length > 0 && (
{`Pending requests (${fmtInt(pendingRows.length)})`}
@@ -701,9 +724,8 @@ export function MembersDialog({

{roles.find((r) => r.value === newRole)?.desc}

- {/* An email no verified account holds is stored as typed and reaches nobody: say so - before the add, not after. */} + {sent && } )} diff --git a/frontend/src/flows/fieldErrors.test.tsx b/frontend/src/flows/fieldErrors.test.tsx index 9aa6f8850e..eeeda238f3 100644 --- a/frontend/src/flows/fieldErrors.test.tsx +++ b/frontend/src/flows/fieldErrors.test.tsx @@ -23,6 +23,13 @@ vi.mock("../api", async (importOriginal) => { }), }; }); +// A person's handle or email is added through grants.invite, which refuses an unknown one. +vi.mock("../api/invites", async (importOriginal) => ({ + ...(await importOriginal()), + invite: vi.fn(async () => { + throw new Error("No such subject"); + }), +})); vi.mock("../api/tasks", async (importOriginal) => { const actual = await importOriginal(); return { diff --git a/frontend/src/lib/inviteLink.ts b/frontend/src/lib/inviteLink.ts new file mode 100644 index 0000000000..5932b3f064 --- /dev/null +++ b/frontend/src/lib/inviteLink.ts @@ -0,0 +1,29 @@ +// An invitation link (`/spaces#invite=&org=…&namespace=…`), taken out of the address +// into this tab's session by Namespaces in your org, which offers to accept it. A password +// sign-in reloads the page, fragment and all; single sign-on makes no link. + +/** The session key for an invitation link's `{ secret, org, namespace }`. */ +export const INVITE_LINK = "loom_invite_v1"; + +export interface InviteLink { + secret: string; + org: string; + namespace: string; +} + +/** Take an invitation link out of the address into this tab's session, and return it. */ +export function takeInviteLink(): InviteLink | null { + const { hash, pathname, search } = window.location; + if (!hash.startsWith("#invite=")) return null; + history.replaceState(history.state, "", pathname + search); + const p = new URLSearchParams(hash.slice(1)); + const [secret, org, namespace] = [p.get("invite"), p.get("org"), p.get("namespace")]; + if (!secret || !org || !namespace) return null; + const link = { secret, org, namespace }; + try { + sessionStorage.setItem(INVITE_LINK, JSON.stringify(link)); + } catch { + /* no session storage: the card holds it until the page goes */ + } + return link; +} diff --git a/frontend/src/views/Browse.tsx b/frontend/src/views/Browse.tsx index 7db9aaa851..60fa2c3d4c 100644 --- a/frontend/src/views/Browse.tsx +++ b/frontend/src/views/Browse.tsx @@ -22,6 +22,7 @@ import { COLLECTION_PREFIX, NAMESPACE_NAME, isCollectionName, isPersonalCollecti import { canEditGuide, roleOnNamespace } from "../lib/namespaceRole"; import { callReason } from "../lib/callReason"; import { CreateNamespaceDialog } from "../flows/CreateNamespaceDialog"; +import { InvitationCard } from "./InvitationCard"; import { useStore, useIdentity } from "../lib/state"; import { RowSkeleton } from "../components/Skeleton"; import { Alert, ListRow, LoadingSkeleton, PageHeader, Panel, SectionHeading, Tip } from "../components/ui"; @@ -440,6 +441,7 @@ export function Browse() { A namespace is a project's or an agent's memory. Join public namespaces in your org, or invite people into the ones you manage.

+ {/* The Repositories hint: under the description, or inside the folded code section when there is one. */} {managedCode.length === 0 && repoHint &&
{repoHint}
} diff --git a/frontend/src/views/Code.accessInvite.test.tsx b/frontend/src/views/Code.accessInvite.test.tsx new file mode 100644 index 0000000000..94820ad328 --- /dev/null +++ b/frontend/src/views/Code.accessInvite.test.tsx @@ -0,0 +1,55 @@ +/** + * The Access tab adds a person through grants.invite, and names the subject the server + * granted, which may be another spelling than the one typed. + */ +import userEvent from "@testing-library/user-event"; +import { cleanup, render, screen, waitFor } from "../test/rtl"; +import { afterEach, beforeEach, expect, it, vi } from "vitest"; +import { toast } from "../components/Toast"; +import * as invites from "../api/invites"; +import { useStore } from "../lib/state"; +import { AccessTab } from "./Code"; + +vi.mock("../api", async (importOriginal) => ({ + ...(await importOriginal()), + listGrants: vi.fn(async () => ({ rows: [{ subject: "alice", role: "admin", status: "active" }] })), + getNamespace: async () => ({ namespace: "code-app", join_policy: "approval" }), +})); +vi.mock("../api/invites", async (importOriginal) => ({ + ...(await importOriginal()), + invite: vi.fn(), + listInvites: vi.fn(async () => ({ rows: [] })), +})); +vi.mock("../lib/sharedReads", async (importOriginal) => ({ + ...(await importOriginal()), + sharedIndexStatus: async () => ({ org_readable: false }), +})); +vi.mock("../components/Toast", async (importOriginal) => ({ + ...(await importOriginal()), + toast: vi.fn(), +})); + +beforeEach(() => { + useStore.setState({ whoami: { authenticated: true, subject: "alice", org: "dev", roles: ["ADMIN"] } }); +}); +afterEach(() => cleanup()); + +it("names the handle the server granted, not what was typed", async () => { + vi.mocked(invites.invite).mockResolvedValue({ + outcome: "granted", + role: "viewer", + subject: "robin", + invite_id: "", + link_path: "", + url: "", + expires_at: null, + emailed: false, + }); + const user = userEvent.setup(); + render(); + const field = await screen.findByRole("textbox", { name: "Login handle or email of the reader to add" }); + await waitFor(() => expect(field).toBeEnabled()); + await user.type(field, "Robin{Enter}"); + await waitFor(() => expect(toast).toHaveBeenCalledWith(expect.stringMatching(/^robin is now a /), "ok")); + expect(invites.invite).toHaveBeenCalledWith({ org: "dev", namespace: "code-app" }, "Robin", expect.any(String)); +}); diff --git a/frontend/src/views/Code.tsx b/frontend/src/views/Code.tsx index b79747f466..b6b09cdc96 100644 --- a/frontend/src/views/Code.tsx +++ b/frontend/src/views/Code.tsx @@ -34,6 +34,8 @@ import { useAbortableEffect, useVisiblePoll } from "../lib/hooks"; import { EmptyState } from "../components/EmptyState"; import { ScopeBadge } from "../components/ScopeBadge"; import { SubjectHelp } from "../components/SubjectHelp"; +import { invite, isPersonSpelling, type InviteResult } from "../api/invites"; +import { InviteSent, OpenInvitations } from "../components/Invitations"; import { IconButton } from "../components/IconButton"; import { ChoiceGroup } from "../components/ui/ChoiceGroup"; import { Modal, ModalFooter } from "../components/ui/Modal"; @@ -3043,6 +3045,10 @@ export function AccessTab({ // grants.list refused the caller (a viewer read): not a reader, so not a maintainer. const [refused, setRefused] = useState(false); const [subject, setSubject] = useState(""); + // The invitation an add just made, with its link to copy; and how many, which reads the + // open invitations again. + const [sent, setSent] = useState<{ email: string; result: InviteResult } | null>(null); + const [invited, setInvited] = useState(0); const [role, setRole] = useState("viewer"); const [busy, setBusy] = useState(null); const [settingsOpen, setSettingsOpen] = useState(false); @@ -3188,8 +3194,21 @@ export function AccessTab({ if (!s || !canManage) return; setBusy("add"); try { - await createGrant(id, s, role); - toast(`${s} is now a ${roleWord(role)}`, "ok"); + // A person by handle or email is invited: an account is granted at once, any other + // email gets a link to copy. Any other principal goes to grants.create as typed. + let granted = s; + if (isPersonSpelling(s)) { + const out = await invite(id, s, role); + if (out.outcome === "invited") { + setSent({ email: s, result: out }); + setInvited((n) => n + 1); + setSubject(""); + return; + } + granted = out.subject; // the handle the server granted, which may differ from what was typed + } else await createGrant(id, s, role); + toast(`${granted} is now a ${roleWord(role)}`, "ok"); + setSent(null); setSubject(""); load(); } catch (err) { @@ -3592,8 +3611,14 @@ export function AccessTab({ Adding someone by name works under every rule. Agents read with a token that names this repository.

+ {sent && ( +
+ +
+ )} )} + {canManage && } )} diff --git a/frontend/src/views/CollectionSharing.test.tsx b/frontend/src/views/CollectionSharing.test.tsx index ed5ec173e8..f8e6eaec70 100644 --- a/frontend/src/views/CollectionSharing.test.tsx +++ b/frontend/src/views/CollectionSharing.test.tsx @@ -22,6 +22,23 @@ const api = vi.hoisted(() => ({ isAuthDisabled: vi.fn(() => false), })); vi.mock("../api", async (importOriginal) => ({ ...(await importOriginal()), ...api })); +// A person is added through grants.invite; a principal through grants.create. +const invites = vi.hoisted(() => ({ + invite: vi.fn(async (_id: unknown, subject: string, role: string) => ({ + outcome: "granted" as const, + role, + subject, + invite_id: "", + link_path: "", + url: "", + expires_at: null, + emailed: false, + })), +})); +vi.mock("../api/invites", async (importOriginal) => ({ + ...(await importOriginal()), + ...invites, +})); vi.mock("../components/ConfirmDialog", async (importOriginal) => ({ ...(await importOriginal()), confirmAction: async () => true, @@ -629,7 +646,7 @@ describe("the collection header", () => { fireEvent.click(within(dialog).getByRole("button", { name: "Add member" })); fireEvent.change(within(dialog).getByRole("textbox"), { target: { value: "bob" } }); fireEvent.click(within(dialog).getByRole("button", { name: "Add" })); - await waitFor(() => expect(api.createGrant).toHaveBeenCalled()); + await waitFor(() => expect(invites.invite).toHaveBeenCalled()); let answer: (v: unknown) => void = () => {}; api.listGrants.mockReturnValue(new Promise((r) => (answer = r))); fireEvent.click(within(dialog).getByRole("button", { name: "Close" })); @@ -712,7 +729,7 @@ describe("the collection header", () => { fireEvent.click(await within(dialog).findByRole("button", { name: "Add member" })); fireEvent.change(within(dialog).getByRole("textbox"), { target: { value: "bob" } }); fireEvent.click(within(dialog).getByRole("button", { name: "Add" })); - await waitFor(() => expect(api.createGrant).toHaveBeenCalled()); + await waitFor(() => expect(invites.invite).toHaveBeenCalled()); const through = await within(dialog).findByRole("region", { name: "Also can see it, through Engineering" }); fireEvent.click(within(through).getByRole("link", { name: "Engineering" })); await waitFor(() => expect(screen.queryByRole("dialog")).not.toBeInTheDocument()); diff --git a/frontend/src/views/InvitationCard.test.tsx b/frontend/src/views/InvitationCard.test.tsx new file mode 100644 index 0000000000..af2ff0d3a8 --- /dev/null +++ b/frontend/src/views/InvitationCard.test.tsx @@ -0,0 +1,255 @@ +import { act, cleanup, render, screen, waitFor } from "../test/rtl"; +import userEvent from "@testing-library/user-event"; +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import { listMine } from "../api"; +import { acceptInvite } from "../api/invites"; +import { INVITE_LINK, takeInviteLink } from "../lib/inviteLink"; +import { ApiError } from "../lib/errors"; +import { invalidateShared, sharedMine } from "../lib/sharedReads"; +import { useStore } from "../lib/state"; +import { InvitationCard } from "./InvitationCard"; + +// An invitation link's secret rides in the fragment; the card moves it into the tab's session +// and accepts it as the signed-in person. + +vi.mock("../api/invites", () => ({ acceptInvite: vi.fn() })); +vi.mock("../api", async (importOriginal) => ({ + ...(await importOriginal()), + listMine: vi.fn(async () => []), +})); + +beforeEach(() => { + sessionStorage.clear(); + vi.mocked(acceptInvite).mockReset(); + vi.mocked(listMine).mockClear(); + invalidateShared(); + useStore.setState({ identity: { org: "dev", namespace: "home", agent: "loom-ui" } }); +}); +afterEach(() => cleanup()); + +describe("takeInviteLink", () => { + it("moves the link out of the address into the session", () => { + history.replaceState(null, "", "/spaces#invite=s3cret&org=dev&namespace=team%2Falerts"); + takeInviteLink(); + expect(window.location.pathname + window.location.hash).toBe("/spaces"); + expect(JSON.parse(sessionStorage.getItem(INVITE_LINK) ?? "null")).toEqual({ + secret: "s3cret", + org: "dev", + namespace: "team/alerts", + }); + }); + + it("leaves any other fragment alone", () => { + history.replaceState(null, "", "/spaces#token=x"); + takeInviteLink(); + expect(window.location.hash).toBe("#token=x"); + expect(sessionStorage.getItem(INVITE_LINK)).toBeNull(); + }); +}); + +function opened(): void { + sessionStorage.setItem(INVITE_LINK, JSON.stringify({ secret: "s3cret", org: "dev", namespace: "alerts" })); + render(); +} + +describe("InvitationCard", () => { + it("accepts as the signed-in person and switches to the namespace", async () => { + vi.mocked(acceptInvite).mockResolvedValue({ namespace: "alerts", role: "writer" }); + await sharedMine("dev"); + const user = userEvent.setup(); + opened(); + expect(screen.getByRole("region", { name: "Invitation" })).toHaveTextContent("You're invited to alerts."); + await user.click(screen.getByRole("button", { name: "Accept invitation" })); + expect(acceptInvite).toHaveBeenCalledWith(expect.objectContaining({ org: "dev", namespace: "alerts" }), "s3cret"); + expect(useStore.getState().identity?.namespace).toBe("alerts"); + expect(sessionStorage.getItem(INVITE_LINK)).toBeNull(); + expect(screen.queryByRole("region", { name: "Invitation" })).toBeNull(); + // The new grant is read at once, not after the shared list_mine read's 30 s. + await sharedMine("dev"); + expect(listMine).toHaveBeenCalledTimes(2); + }); + + it("opens an accepted collection in the Library, keeping the namespace in use", async () => { + vi.mocked(acceptInvite).mockResolvedValue({ namespace: "col-runbooks", role: "viewer" }); + const real = useStore.getState().navigate; + const navigate = vi.fn(); + useStore.setState({ navigate }); + const user = userEvent.setup(); + opened(); + await user.click(screen.getByRole("button", { name: "Accept invitation" })); + expect(navigate).toHaveBeenCalledWith("knowledge", { query: { collection: "col-runbooks" } }); + expect(useStore.getState().identity?.namespace).toBe("home"); + useStore.setState({ navigate: real }); + }); + + it.each([ + [404, "RESOURCE_NOT_FOUND", "this invitation link is used, cancelled or expired: ask for a new one"], + [422, "VALIDATION_FAILED", "an invitation is accepted by a person, signed in as themselves"], + ])("says why a refused link is refused and offers only Close (%i %s)", async (status, code, message) => { + vi.mocked(acceptInvite).mockRejectedValue(new ApiError({ status, code, message })); + const user = userEvent.setup(); + opened(); + await user.click(screen.getByRole("button", { name: "Accept invitation" })); + expect(await screen.findByText(message, { exact: false })).toBeInTheDocument(); + expect(screen.queryByRole("button", { name: "Accept invitation" })).toBeNull(); + expect(sessionStorage.getItem(INVITE_LINK)).toBeNull(); + expect(useStore.getState().identity?.namespace).toBe("home"); + }); + + it("keeps the link when the 404 is not the server's refusal of it", async () => { + // A replica of the previous build answers an op it does not serve with a bare 404. + vi.mocked(acceptInvite).mockRejectedValueOnce(new ApiError({ status: 404, message: "Not Found" })); + const user = userEvent.setup(); + opened(); + await user.click(screen.getByRole("button", { name: "Accept invitation" })); + await waitFor(() => expect(screen.getByRole("button", { name: "Accept invitation" })).toBeEnabled()); + expect(acceptInvite).toHaveBeenCalledTimes(1); + expect(sessionStorage.getItem(INVITE_LINK)).not.toBeNull(); + }); + + it("shows a link pasted into a tab already on the page", async () => { + render(); + expect(screen.queryByRole("region", { name: "Invitation" })).toBeNull(); + history.replaceState(null, "", "/spaces#invite=s3cret&org=dev&namespace=alerts"); + act(() => { + window.dispatchEvent(new HashChangeEvent("hashchange")); + }); + try { + expect(await screen.findByRole("button", { name: "Accept invitation" })).toBeEnabled(); + } finally { + history.replaceState(null, "", "/"); + } + }); + + it("offers Accept for a link pasted after one was accepted", async () => { + vi.mocked(acceptInvite).mockResolvedValue({ namespace: "alerts", role: "writer" }); + const user = userEvent.setup(); + opened(); + await user.click(screen.getByRole("button", { name: "Accept invitation" })); + expect(screen.queryByRole("region", { name: "Invitation" })).toBeNull(); + history.replaceState(null, "", "/spaces#invite=other&org=dev&namespace=ops"); + act(() => { + window.dispatchEvent(new HashChangeEvent("hashchange")); + }); + try { + expect(await screen.findByRole("button", { name: "Accept invitation" })).toBeEnabled(); + } finally { + history.replaceState(null, "", "/"); + } + }); + + it.each([ + ["accepted", () => Promise.resolve({ namespace: "alerts", role: "writer" as const })], + ["refused", () => Promise.reject(new ApiError({ status: 404, code: "RESOURCE_NOT_FOUND", message: "used" }))], + ])("keeps a link pasted while another's accept is in flight, once that one is %s", async (_, answer) => { + let settle: () => void = () => {}; + vi.mocked(acceptInvite).mockReturnValueOnce( + new Promise((resolve, reject) => { + settle = () => void answer().then(resolve, reject); + }), + ); + const user = userEvent.setup(); + opened(); + await user.click(screen.getByRole("button", { name: "Accept invitation" })); + history.replaceState(null, "", "/spaces#invite=other&org=dev&namespace=ops"); + act(() => { + window.dispatchEvent(new HashChangeEvent("hashchange")); + }); + try { + await act(async () => settle()); + expect(screen.getByRole("region", { name: "Invitation" })).toHaveTextContent("You're invited to ops."); + await waitFor(() => expect(screen.getByRole("button", { name: "Accept invitation" })).toBeEnabled()); + expect(screen.queryByText(/used/)).toBeNull(); + expect(JSON.parse(sessionStorage.getItem(INVITE_LINK) ?? "null")?.secret).toBe("other"); + } finally { + history.replaceState(null, "", "/"); + } + }); + + it("leaves a link set aside by Not now aside when the fragment changes", async () => { + const user = userEvent.setup(); + opened(); + await user.click(screen.getByRole("button", { name: "Not now" })); + history.replaceState(null, "", "/spaces#token=x"); + act(() => { + window.dispatchEvent(new HashChangeEvent("hashchange")); + }); + try { + expect(screen.queryByRole("region", { name: "Invitation" })).toBeNull(); + } finally { + history.replaceState(null, "", "/"); + } + }); + + it("holds the link itself where session storage is refused", () => { + const refuse = vi.spyOn(Storage.prototype, "setItem").mockImplementation(() => { + throw new DOMException("blocked", "SecurityError"); + }); + try { + history.replaceState(null, "", "/spaces#invite=s3cret&org=dev&namespace=alerts"); + render(); + expect(screen.getByRole("button", { name: "Accept invitation" })).toBeEnabled(); + expect(window.location.hash).toBe(""); + } finally { + refuse.mockRestore(); + history.replaceState(null, "", "/"); + } + }); + + it("keeps the link and Accept through an outage", async () => { + vi.mocked(acceptInvite).mockRejectedValueOnce( + new ApiError({ status: 503, code: "BACKEND_UNAVAILABLE", message: "grants could not be read" }), + ); + const user = userEvent.setup(); + opened(); + await user.click(screen.getByRole("button", { name: "Accept invitation" })); + expect(await screen.findByText(/could not be read/)).toBeInTheDocument(); + expect(screen.getByRole("button", { name: "Accept invitation" })).toBeEnabled(); + expect(sessionStorage.getItem(INVITE_LINK)).not.toBeNull(); + }); + + it("keeps the link through a sign-in the session ended for", async () => { + vi.mocked(acceptInvite).mockRejectedValueOnce( + new ApiError({ status: 401, code: "AUTH_REQUIRED", message: "sign in again" }), + ); + const user = userEvent.setup(); + opened(); + await user.click(screen.getByRole("button", { name: "Accept invitation" })); + expect(await screen.findByText(/sign in again/i)).toBeInTheDocument(); + expect(screen.getByRole("button", { name: "Accept invitation" })).toBeEnabled(); + expect(sessionStorage.getItem(INVITE_LINK)).not.toBeNull(); + }); + + it("keeps the link for the next visit on Not now", async () => { + const user = userEvent.setup(); + opened(); + await user.click(screen.getByRole("button", { name: "Not now" })); + expect(screen.queryByRole("region", { name: "Invitation" })).toBeNull(); + expect(sessionStorage.getItem(INVITE_LINK)).not.toBeNull(); + cleanup(); + render(); + expect(screen.getByRole("region", { name: "Invitation" })).toBeInTheDocument(); + }); + + it("asks for a sign-in to another org's link instead of offering Accept", () => { + useStore.setState({ identity: { org: "acme", namespace: "home", agent: "loom-ui" } }); + opened(); + expect(screen.getByRole("region", { name: "Invitation" })).toHaveTextContent("Sign in to dev to accept it."); + expect(screen.queryByRole("button", { name: "Accept invitation" })).toBeNull(); + expect(screen.getByRole("button", { name: "Close" })).toBeInTheDocument(); + }); + + it("shows nothing without an invitation", () => { + render(); + expect(screen.queryByRole("region", { name: "Invitation" })).toBeNull(); + }); +}); + +describe("InvitationCard on an address that still carries the link", () => { + it("takes the link from the address itself", () => { + history.replaceState(null, "", "/spaces#invite=s3cret&org=dev&namespace=alerts"); + render(); + expect(screen.getByRole("region", { name: "Invitation" })).toHaveTextContent("You're invited to alerts."); + expect(window.location.hash).toBe(""); + }); +}); diff --git a/frontend/src/views/InvitationCard.tsx b/frontend/src/views/InvitationCard.tsx new file mode 100644 index 0000000000..26ba0c3a66 --- /dev/null +++ b/frontend/src/views/InvitationCard.tsx @@ -0,0 +1,125 @@ +import { useEffect, useState } from "react"; +import { Button } from "@clickhouse/click-ui/Button"; +import { setSavedNamespace } from "../api"; +import { acceptInvite } from "../api/invites"; +import { Alert } from "../components/ui"; +import { toast } from "../components/Toast"; +import { INVITE_LINK, type InviteLink, takeInviteLink } from "../lib/inviteLink"; +import { humanizeError } from "../lib/errorWords"; +import { ApiError } from "../lib/errors"; +import { isCollectionName } from "../lib/namespace"; +import { invalidateShared } from "../lib/sharedReads"; +import { useStore } from "../lib/state"; + +function kept(): InviteLink | null { + try { + const v = JSON.parse(sessionStorage.getItem(INVITE_LINK) ?? "null") as Partial | null; + if (v && typeof v.secret === "string" && typeof v.org === "string" && typeof v.namespace === "string") { + return { secret: v.secret, org: v.org, namespace: v.namespace }; + } + } catch { + /* unreadable or no session storage */ + } + return null; +} + +function stashed(): InviteLink | null { + // An address opened signed in, or after a password sign-in, still carries it. + const taken = takeInviteLink(); + return kept() ?? taken; +} + +/** Forget `secret`'s link, and not one pasted since. */ +function drop(secret: string): void { + if (kept()?.secret !== secret) return; + try { + sessionStorage.removeItem(INVITE_LINK); + } catch { + /* no session storage: nothing was kept */ + } +} + +/** The invitation link this tab opened, for the signed-in person to accept. */ +export function InvitationCard() { + const [link, setLink] = useState(stashed); + const [busy, setBusy] = useState(false); + // Each keyed by the link's secret: an answer about one link says nothing of one pasted since. + const [error, setError] = useState<{ secret: string; text: string } | null>(null); + // The server refused the link: RESOURCE_NOT_FOUND when it is used, cancelled or expired, + // VALIDATION_FAILED when this account cannot accept it. Only Close is left. + const [refusedSecret, setRefusedSecret] = useState(null); + const identity = useStore((s) => s.identity); + const setIdentity = useStore((s) => s.setIdentity); + const navigate = useStore((s) => s.navigate); + // A link pasted into a tab already on this page changes only the fragment. Only a link + // the address carries now: one Not now set aside stays aside. + useEffect(() => { + const opened = () => { + const next = takeInviteLink(); + if (next) setLink(next); + }; + window.addEventListener("hashchange", opened); + return () => window.removeEventListener("hashchange", opened); + }, []); + if (!link) return null; + + const refused = refusedSecret === link.secret; + const shownError = error?.secret === link.secret ? error.text : null; + // A link to another org is accepted only signed in there: the server refuses it here. + const elsewhere = Boolean(identity && identity.org !== link.org); + const close = () => { + drop(link.secret); + setLink(null); + }; + const accept = async () => { + const current = link; + setBusy(true); + setError(null); + try { + const out = await acceptInvite(current, current.secret); + drop(current.secret); + setLink((shown) => (shown?.secret === current.secret ? null : shown)); + toast(`Joined ${out.namespace} as ${out.role}`, "ok"); + invalidateShared("mine:"); + // A collection opens in the Library; a namespace becomes the one in use. + if (isCollectionName(out.namespace)) navigate("knowledge", { query: { collection: out.namespace } }); + else if (identity && identity.org === current.org) { + setIdentity({ ...identity, namespace: out.namespace }); + setSavedNamespace(out.namespace); + } + } catch (e) { + // Only the server's refusal of the link drops it: an ended session, a rate limit or a + // replica that does not serve the op yet keeps it for a retry. + if (e instanceof ApiError && (e.code === "RESOURCE_NOT_FOUND" || e.code === "VALIDATION_FAILED")) { + drop(current.secret); + setRefusedSecret(current.secret); + } + setError({ secret: current.secret, text: humanizeError(e) }); + } finally { + // The card stays mounted after an accept, and the next pasted link reuses it. + setBusy(false); + } + }; + + return ( +
+

+ You're invited to {link.namespace} + {elsewhere ? ` in ${link.org}. Sign in to ${link.org} to accept it.` : "."} + {elsewhere ? "" : " Accepting gives the account you're signed in as the role the invitation names."} +

+ {shownError && } +
+ {/* Not now keeps the link in this tab, so the card is back on the next visit. */} + + {!refused && !elsewhere && ( + + )} +
+
+ ); +} diff --git a/loom.example.yaml b/loom.example.yaml index 7327317ac8..56ea9ecd20 100644 --- a/loom.example.yaml +++ b/loom.example.yaml @@ -888,6 +888,18 @@ settings: # Default org for self-signed tokens. [restart] # self_signup_org: "dev" + # The From address of an invitation email, e.g. `Loom `. Empty sends + # none, as does an empty smtp_url or public_base_url (the link needs it). [restart] + # mail_from: "" + + # Seconds each step of an invitation email may wait on the mail server; past it the + # email is reported not sent and the link is shown to pass on. [restart] + # smtp_timeout_seconds: 10.0 + + # Seconds an invitation link stays valid, at most 30 days: it admits whoever opens it. + # [restart] + # invite_ttl_seconds: 604800 + # How callers authenticate: "single-user" (no auth, one anonymous identity), # "trust-network" (self-signup, first claim wins) or "gateway" (an upstream proxy # mints short-lived Loom JWTs with the shared HS256 secret; Loom only validates). diff --git a/schemas/loom-settings.schema.json b/schemas/loom-settings.schema.json index 30776d6b17..0b9a9a86f6 100644 --- a/schemas/loom-settings.schema.json +++ b/schemas/loom-settings.schema.json @@ -3291,6 +3291,13 @@ "type": "number", "description": "Seconds between this process's loom.instances heartbeats, each of which also compares it with the deployment's published configuration. A row not renewed for three intervals is not live." }, + "invite_ttl_seconds": { + "default": 604800, + "maximum": 2592000, + "minimum": 3600, + "type": "integer", + "description": "Seconds an invitation link stays valid, at most 30 days: it admits whoever opens it." + }, "jwt_audience": { "default": "loom-platform", "type": "string", @@ -4070,6 +4077,11 @@ "type": "string", "description": "Root log level. (Bind host/port are flags of `loom serve`, not settings.)" }, + "mail_from": { + "default": "", + "type": "string", + "description": "The From address of an invitation email, e.g. `Loom `. Empty sends none, as does an empty smtp_url or public_base_url (the link needs it)." + }, "max_request_bytes": { "default": 33554432, "type": "integer", @@ -6886,6 +6898,13 @@ "type": "number", "description": "Seconds a process keeps serving after SIGTERM while /v1/health/ready answers 503, so the load balancer stops routing to it before its port closes. Size it to the LB's probe interval × failure threshold. 0 = stop at once." }, + "smtp_timeout_seconds": { + "default": 10.0, + "exclusiveMinimum": 0, + "maximum": 60, + "type": "number", + "description": "Seconds each step of an invitation email may wait on the mail server; past it the email is reported not sent and the link is shown to pass on." + }, "storage_authority": { "default": "clickhouse", "enum": [ diff --git a/schemas/migrations/123_namespace_invites.sql b/schemas/migrations/123_namespace_invites.sql new file mode 100644 index 0000000000..d72ece6c20 --- /dev/null +++ b/schemas/migrations/123_namespace_invites.sql @@ -0,0 +1,29 @@ +-- Invitations to a namespace, for a person no account signs in as yet. +-- +-- grants.invite writes one row per invitation: the role it gives, the email it was made +-- for and who made it, whose admin grant grants.accept_invite reads again: an invitation +-- never outlasts its maker's admin. The link it hands out carries a random secret; the row +-- is keyed by the secret's SHA-256 (`invite_id`), so a row read out of storage admits nobody. +-- grants.accept_invite writes the row again with `state = 'accepted'` and who accepted +-- it, grants.cancel_invite with `state = 'cancelled'`. An invitation lives for +-- `expires_at` (Unix seconds); the TTL drops the rows a week after that. A build before +-- this one never reads the table. +CREATE TABLE IF NOT EXISTS loom.namespace_invites +( + org LowCardinality(String), + namespace LowCardinality(String), + invite_id String, + email String DEFAULT '', + role LowCardinality(String), + created_by String, + created_at DateTime64(3, 'UTC'), + expires_at UInt32, + state LowCardinality(String) DEFAULT 'open', + accepted_by String DEFAULT '', + changed_at DateTime64(3, 'UTC'), + version UInt64 DEFAULT toUInt64(toUnixTimestamp64Nano(now64(9))) +) +ENGINE = ReplacingMergeTree(version) +ORDER BY (org, namespace, invite_id) +TTL toDateTime(expires_at) + INTERVAL 7 DAY +SETTINGS non_replicated_deduplication_window = 1000; diff --git a/schemas/schema.sql b/schemas/schema.sql index 312e196b7f..2dc61cfc07 100644 --- a/schemas/schema.sql +++ b/schemas/schema.sql @@ -16,13 +16,13 @@ -- Do NOT hand-edit. Edit schemas/migrations/*.sql and re-dump. -- CI verifies this file matches what migrations would produce. -- --- Counts: 198 tables + 5 views + 19 materialized views. +-- Counts: 199 tables + 5 views + 19 materialized views. CREATE DATABASE IF NOT EXISTS `loom`; CREATE DATABASE IF NOT EXISTS `loom_telemetry`; -- ====================================================================== --- Tables (198) +-- Tables (199) -- ====================================================================== -- loom.acl_versions @@ -3393,6 +3393,27 @@ ENGINE = MergeTree ORDER BY (org, namespace, revision) SETTINGS non_replicated_deduplication_window = 1000, index_granularity = 8192; +-- loom.namespace_invites +CREATE TABLE IF NOT EXISTS loom.namespace_invites +( + `org` LowCardinality(String), + `namespace` LowCardinality(String), + `invite_id` String, + `email` String DEFAULT '', + `role` LowCardinality(String), + `created_by` String, + `created_at` DateTime64(3, 'UTC'), + `expires_at` UInt32, + `state` LowCardinality(String) DEFAULT 'open', + `accepted_by` String DEFAULT '', + `changed_at` DateTime64(3, 'UTC'), + `version` UInt64 DEFAULT toUInt64(toUnixTimestamp64Nano(now64(9))) +) +ENGINE = ReplacingMergeTree(version) +ORDER BY (org, namespace, invite_id) +TTL toDateTime(expires_at) + toIntervalDay(7) +SETTINGS non_replicated_deduplication_window = 1000, index_granularity = 8192; + -- loom.namespace_ontology CREATE TABLE IF NOT EXISTS loom.namespace_ontology ( diff --git a/sdk/go/client.gen.go b/sdk/go/client.gen.go index e7dda13d70..32a47bd69b 100644 --- a/sdk/go/client.gen.go +++ b/sdk/go/client.gen.go @@ -1049,21 +1049,45 @@ type FindingEvidence = wire.FindingEvidence // GrantEntry is a model used by Loom operations. type GrantEntry = wire.GrantEntry +// GrantsAcceptInviteInput is the request to grants.accept_invite. +type GrantsAcceptInviteInput = wire.GrantsAcceptInviteInput + +// GrantsAcceptInviteOutput is the response from grants.accept_invite. +type GrantsAcceptInviteOutput = wire.GrantsAcceptInviteOutput + // GrantsApproveInput is the request to grants.approve. type GrantsApproveInput = wire.GrantsApproveInput // GrantsApproveOutput is the response from grants.approve. type GrantsApproveOutput = wire.GrantsApproveOutput +// GrantsCancelInviteInput is the request to grants.cancel_invite. +type GrantsCancelInviteInput = wire.GrantsCancelInviteInput + +// GrantsCancelInviteOutput is the response from grants.cancel_invite. +type GrantsCancelInviteOutput = wire.GrantsCancelInviteOutput + // GrantsCreateInput is the request to grants.create. type GrantsCreateInput = wire.GrantsCreateInput // GrantsCreateOutput is the response from grants.create. type GrantsCreateOutput = wire.GrantsCreateOutput +// GrantsInviteInput is the request to grants.invite. +type GrantsInviteInput = wire.GrantsInviteInput + +// GrantsInviteOutput is the response from grants.invite. +type GrantsInviteOutput = wire.GrantsInviteOutput + // GrantsListInput is the request to grants.list. type GrantsListInput = wire.GrantsListInput +// GrantsListInvitesInput is the request to grants.list_invites. +type GrantsListInvitesInput = wire.GrantsListInvitesInput + +// GrantsListInvitesOutput is the response from grants.list_invites. +type GrantsListInvitesOutput = wire.GrantsListInvitesOutput + // GrantsListOutput is the response from grants.list. type GrantsListOutput = wire.GrantsListOutput @@ -1208,6 +1232,9 @@ type InventoryScope = wire.InventoryScope // InventorySection is a model used by Loom operations. type InventorySection = wire.InventorySection +// InviteEntry is a model used by Loom operations. +type InviteEntry = wire.InviteEntry + // KnowledgeAddInput is the request to knowledge.add. type KnowledgeAddInput = wire.KnowledgeAddInput @@ -5246,6 +5273,20 @@ func (s FactsService) Traverse(ctx context.Context, seedEntity string, opts ...O return callOperation[FactsTraverseOutput](s.client, ctx, "facts.traverse", in) } +// AcceptInvite calls grants.accept_invite. +// Use WithInput to supply additional request fields. +func (s GrantsService) AcceptInvite(ctx context.Context, secret string, opts ...Option[GrantsAcceptInviteInput]) (*GrantsAcceptInviteOutput, error) { + in := applyOptions(opts) + in.Secret = secret + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[GrantsAcceptInviteOutput](s.client, ctx, "grants.accept_invite", in) +} + // Approve calls grants.approve. // Use WithInput to supply additional request fields. func (s GrantsService) Approve(ctx context.Context, subject string, opts ...Option[GrantsApproveInput]) (*GrantsApproveOutput, error) { @@ -5260,6 +5301,20 @@ func (s GrantsService) Approve(ctx context.Context, subject string, opts ...Opti return callOperation[GrantsApproveOutput](s.client, ctx, "grants.approve", in) } +// CancelInvite calls grants.cancel_invite. +// Use WithInput to supply additional request fields. +func (s GrantsService) CancelInvite(ctx context.Context, inviteID string, opts ...Option[GrantsCancelInviteInput]) (*GrantsCancelInviteOutput, error) { + in := applyOptions(opts) + in.InviteID = inviteID + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[GrantsCancelInviteOutput](s.client, ctx, "grants.cancel_invite", in) +} + // Create calls grants.create. func (s GrantsService) Create(ctx context.Context, in GrantsCreateInput) (*GrantsCreateOutput, error) { if in.Namespace == "" { @@ -5271,6 +5326,17 @@ func (s GrantsService) Create(ctx context.Context, in GrantsCreateInput) (*Grant return callOperation[GrantsCreateOutput](s.client, ctx, "grants.create", in) } +// Invite calls grants.invite. +func (s GrantsService) Invite(ctx context.Context, in GrantsInviteInput) (*GrantsInviteOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[GrantsInviteOutput](s.client, ctx, "grants.invite", in) +} + // List calls grants.list. // Use WithInput to supply additional request fields. func (s GrantsService) List(ctx context.Context, opts ...Option[GrantsListInput]) (*GrantsListOutput, error) { @@ -5284,6 +5350,19 @@ func (s GrantsService) List(ctx context.Context, opts ...Option[GrantsListInput] return callOperation[GrantsListOutput](s.client, ctx, "grants.list", in) } +// ListInvites calls grants.list_invites. +// Use WithInput to supply additional request fields. +func (s GrantsService) ListInvites(ctx context.Context, opts ...Option[GrantsListInvitesInput]) (*GrantsListInvitesOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[GrantsListInvitesOutput](s.client, ctx, "grants.list_invites", in) +} + // PendingForMe calls grants.pending_for_me. // Use WithInput to supply additional request fields. func (s GrantsService) PendingForMe(ctx context.Context, opts ...Option[GrantsPendingForMeInput]) (*GrantsPendingForMeOutput, error) { diff --git a/sdk/go/wire/models.gen.go b/sdk/go/wire/models.gen.go index 8b77ed1ea6..19c91d5113 100644 --- a/sdk/go/wire/models.gen.go +++ b/sdk/go/wire/models.gen.go @@ -1,5 +1,5 @@ // Code generated by scripts/codegen/sdk_go_gen.py; DO NOT EDIT. -// Registry model schema SHA-256: 059d7a1662038b7981480c074fccd0286c7686b7fbf7de9ee6cc74ee2cadca82 +// Registry model schema SHA-256: ef6ef76d8ab06639fb10db115b9d763fa1e14163a9cc5ec792136951ecb36ffa // Package wire contains the Go requests and responses for Loom operations. package wire @@ -4502,6 +4502,23 @@ type GrantEntry struct { Also *[]string `json:"also,omitempty"` } +// GrantsAcceptInviteInput is the request to grants.accept_invite. +type GrantsAcceptInviteInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Secret string `json:"secret"` +} + +// GrantsAcceptInviteOutput is the response from grants.accept_invite. +type GrantsAcceptInviteOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Degraded *[]string `json:"degraded,omitempty"` + Namespace string `json:"namespace"` + Role string `json:"role"` +} + // GrantsApproveInput is the request to grants.approve. type GrantsApproveInput struct { Org string `json:"org"` @@ -4524,6 +4541,22 @@ type GrantsApproveOutput struct { DecidedAt string `json:"decided_at"` } +// GrantsCancelInviteInput is the request to grants.cancel_invite. +type GrantsCancelInviteInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + InviteID string `json:"invite_id"` +} + +// GrantsCancelInviteOutput is the response from grants.cancel_invite. +type GrantsCancelInviteOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Degraded *[]string `json:"degraded,omitempty"` + Cancelled bool `json:"cancelled"` +} + // GrantsCreateInput is the request to grants.create. type GrantsCreateInput struct { Org string `json:"org"` @@ -4547,6 +4580,30 @@ type GrantsCreateOutput struct { GrantedAt string `json:"granted_at"` } +// GrantsInviteInput is the request to grants.invite. +type GrantsInviteInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + To string `json:"to"` + Role string `json:"role"` +} + +// GrantsInviteOutput is the response from grants.invite. +type GrantsInviteOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Degraded *[]string `json:"degraded,omitempty"` + Outcome string `json:"outcome"` + Role string `json:"role"` + Subject *string `json:"subject,omitempty"` + InviteID *string `json:"invite_id,omitempty"` + LinkPath *string `json:"link_path,omitempty"` + URL *string `json:"url,omitempty"` + ExpiresAt Optional[string] `json:"expires_at,omitempty"` + Emailed *bool `json:"emailed,omitempty"` +} + // GrantsListInput is the request to grants.list. type GrantsListInput struct { Org string `json:"org"` @@ -4556,6 +4613,21 @@ type GrantsListInput struct { Fields Optional[[]string] `json:"fields,omitempty"` } +// GrantsListInvitesInput is the request to grants.list_invites. +type GrantsListInvitesInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` +} + +// GrantsListInvitesOutput is the response from grants.list_invites. +type GrantsListInvitesOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Degraded *[]string `json:"degraded,omitempty"` + Rows []InviteEntry `json:"rows"` +} + // GrantsListOutput is the response from grants.list. type GrantsListOutput struct { IgnoredArgs *[]string `json:"ignored_args,omitempty"` @@ -5075,6 +5147,16 @@ type InventorySection struct { Reason *string `json:"reason,omitempty"` } +// InviteEntry is a model used by Loom operations. +type InviteEntry struct { + InviteID string `json:"invite_id"` + Email string `json:"email"` + Role string `json:"role"` + CreatedBy string `json:"created_by"` + CreatedAt string `json:"created_at"` + ExpiresAt string `json:"expires_at"` +} + // KnowledgeAddInput is the request to knowledge.add. type KnowledgeAddInput struct { Org string `json:"org"` diff --git a/sdk/python/loom/client.py b/sdk/python/loom/client.py index ee4c6c6a48..17d7882c7c 100644 --- a/sdk/python/loom/client.py +++ b/sdk/python/loom/client.py @@ -1149,6 +1149,15 @@ class GrantsOps: def __init__(self, agent: Agent) -> None: self._agent = agent + async def accept_invite( + self, body: _ops.GrantsAcceptInviteBody | None = None, /, **options: Any + ) -> _ops.GrantsAcceptInviteOutput: + """`grants.accept_invite`.""" + return cast( + "_ops.GrantsAcceptInviteOutput", + await self._agent.call("grants.accept_invite", body, **options), + ) + async def approve( self, body: _ops.GrantsApproveBody | None = None, /, **options: Any ) -> _ops.GrantsApproveOutput: @@ -1157,6 +1166,15 @@ async def approve( "_ops.GrantsApproveOutput", await self._agent.call("grants.approve", body, **options) ) + async def cancel_invite( + self, body: _ops.GrantsCancelInviteBody | None = None, /, **options: Any + ) -> _ops.GrantsCancelInviteOutput: + """`grants.cancel_invite`.""" + return cast( + "_ops.GrantsCancelInviteOutput", + await self._agent.call("grants.cancel_invite", body, **options), + ) + async def create( self, body: _ops.GrantsCreateBody | None = None, /, **options: Any ) -> _ops.GrantsCreateOutput: @@ -1165,12 +1183,29 @@ async def create( "_ops.GrantsCreateOutput", await self._agent.call("grants.create", body, **options) ) + async def invite( + self, body: _ops.GrantsInviteBody | None = None, /, **options: Any + ) -> _ops.GrantsInviteOutput: + """`grants.invite`.""" + return cast( + "_ops.GrantsInviteOutput", await self._agent.call("grants.invite", body, **options) + ) + async def list( self, body: _ops.GrantsListBody | None = None, /, **options: Any ) -> _ops.GrantsListOutput: """`grants.list`.""" return cast("_ops.GrantsListOutput", await self._agent.call("grants.list", body, **options)) + async def list_invites( + self, body: _ops.GrantsListInvitesBody | None = None, /, **options: Any + ) -> _ops.GrantsListInvitesOutput: + """`grants.list_invites`.""" + return cast( + "_ops.GrantsListInvitesOutput", + await self._agent.call("grants.list_invites", body, **options), + ) + async def pending_for_me( self, body: _ops.GrantsPendingForMeBody | None = None, /, **options: Any ) -> _ops.GrantsPendingForMeOutput: diff --git a/sdk/python/loom/ops.py b/sdk/python/loom/ops.py index c5aa487c5b..e820164cca 100644 --- a/sdk/python/loom/ops.py +++ b/sdk/python/loom/ops.py @@ -153,9 +153,13 @@ class OpSpec: "facts.path", "facts.related", "facts.traverse", + "grants.accept_invite", "grants.approve", + "grants.cancel_invite", "grants.create", + "grants.invite", "grants.list", + "grants.list_invites", "grants.pending_for_me", "grants.revoke", "grants.share_agent", @@ -545,9 +549,13 @@ class OpSpec: "facts.path", "facts.related", "facts.traverse", + "grants.accept_invite", "grants.approve", + "grants.cancel_invite", "grants.create", + "grants.invite", "grants.list", + "grants.list_invites", "grants.pending_for_me", "grants.revoke", "grants.share_agent", @@ -2191,6 +2199,18 @@ class OpSpec: False, True, ), + "grants.accept_invite": OpSpec( + "grants.accept_invite", + "GrantsAcceptInviteInput", + "GrantsAcceptInviteBody", + "GrantsAcceptInviteOutput", + False, + "viewer", + "experimental", + 150, + True, + False, + ), "grants.approve": OpSpec( "grants.approve", "GrantsApproveInput", @@ -2203,6 +2223,18 @@ class OpSpec: True, False, ), + "grants.cancel_invite": OpSpec( + "grants.cancel_invite", + "GrantsCancelInviteInput", + "GrantsCancelInviteBody", + "GrantsCancelInviteOutput", + True, + "admin", + "experimental", + 80, + True, + False, + ), "grants.create": OpSpec( "grants.create", "GrantsCreateInput", @@ -2215,6 +2247,18 @@ class OpSpec: True, False, ), + "grants.invite": OpSpec( + "grants.invite", + "GrantsInviteInput", + "GrantsInviteBody", + "GrantsInviteOutput", + False, + "admin", + "experimental", + 3000, + True, + False, + ), "grants.list": OpSpec( "grants.list", "GrantsListInput", @@ -2227,6 +2271,18 @@ class OpSpec: False, True, ), + "grants.list_invites": OpSpec( + "grants.list_invites", + "GrantsListInvitesInput", + "GrantsListInvitesBody", + "GrantsListInvitesOutput", + True, + "admin", + "experimental", + 80, + False, + False, + ), "grants.pending_for_me": OpSpec( "grants.pending_for_me", "GrantsPendingForMeInput", @@ -10402,6 +10458,27 @@ class TraversalNode(TypedDict, total=False): path: NotRequired[list[str]] +class GrantsAcceptInviteInput(TypedDict, total=False): + "Accept an invitation link as the signed-in person." + + org: Required[str] + namespace: Required[str] + secret: Required[str] + + +class GrantsAcceptInviteBody(TypedDict, total=False): + "Accept an invitation link as the signed-in person." + + org: NotRequired[str] + namespace: NotRequired[str] + secret: Required[str] + + +class GrantsAcceptInviteOutput(TypedDict, total=False): + namespace: Required[str] + role: Required[Literal["viewer", "writer", "admin"]] + + class GrantsApproveInput(TypedDict, total=False): "Approve (or reject) a pending grant request." @@ -10430,6 +10507,26 @@ class GrantsApproveOutput(TypedDict, total=False): decided_at: Required[str] # date-time as ISO-8601 text +class GrantsCancelInviteInput(TypedDict, total=False): + "Cancel an open invitation, so its link admits nobody." + + org: Required[str] + namespace: Required[str] + invite_id: Required[str] + + +class GrantsCancelInviteBody(TypedDict, total=False): + "Cancel an open invitation, so its link admits nobody." + + org: NotRequired[str] + namespace: NotRequired[str] + invite_id: Required[str] + + +class GrantsCancelInviteOutput(TypedDict, total=False): + cancelled: Required[bool] + + class GrantsCreateInput(TypedDict, total=False): org: Required[str] namespace: Required[str] @@ -10456,6 +10553,35 @@ class GrantsCreateOutput(TypedDict, total=False): granted_at: Required[str] # date-time as ISO-8601 text +class GrantsInviteInput(TypedDict, total=False): + "Give a person a role on a namespace by login handle or email." + + org: Required[str] + namespace: Required[str] + to: Required[str] + role: Required[Literal["viewer", "writer", "admin"]] + + +class GrantsInviteBody(TypedDict, total=False): + "Give a person a role on a namespace by login handle or email." + + org: NotRequired[str] + namespace: NotRequired[str] + to: Required[str] + role: Required[Literal["viewer", "writer", "admin"]] + + +class GrantsInviteOutput(TypedDict, total=False): + outcome: Required[Literal["granted", "invited"]] + role: Required[Literal["viewer", "writer", "admin"]] + subject: NotRequired[str] + invite_id: NotRequired[str] + link_path: NotRequired[str] + url: NotRequired[str] + expires_at: NotRequired[Optional[str]] + emailed: NotRequired[bool] + + class GrantsListInput(TypedDict, total=False): org: Required[str] namespace: Required[str] @@ -10489,6 +10615,33 @@ class GrantEntry(TypedDict, total=False): also: NotRequired[list[str]] +class GrantsListInvitesInput(TypedDict, total=False): + "List a namespace's open invitations." + + org: Required[str] + namespace: Required[str] + + +class GrantsListInvitesBody(TypedDict, total=False): + "List a namespace's open invitations." + + org: NotRequired[str] + namespace: NotRequired[str] + + +class GrantsListInvitesOutput(TypedDict, total=False): + rows: Required[list["InviteEntry"]] + + +class InviteEntry(TypedDict, total=False): + invite_id: Required[str] + email: Required[str] + role: Required[Literal["viewer", "writer", "admin"]] + created_by: Required[str] + created_at: Required[str] # date-time as ISO-8601 text + expires_at: Required[str] # date-time as ISO-8601 text + + class GrantsPendingForMeInput(TypedDict, total=False): org: Required[str] limit: NotRequired[int] diff --git a/sdk/ruby/lib/clickhouse/loom/generated/ops.rb b/sdk/ruby/lib/clickhouse/loom/generated/ops.rb index 166885cad5..70db686cda 100644 --- a/sdk/ruby/lib/clickhouse/loom/generated/ops.rb +++ b/sdk/ruby/lib/clickhouse/loom/generated/ops.rb @@ -8,7 +8,7 @@ module Loom # Every served operation: its spec in OPS, and one method per op on the class # of its group (`client.memory.set(...)` is `memory.set`). module Generated - OP_COUNT = 389 + OP_COUNT = 393 # The declared spec of every served op, by name; the HTTP path is /v1/. OPS = { @@ -126,9 +126,13 @@ module Generated "facts.path" => OpSpec.new("facts.path", "facts", "path", true, true, "viewer", "experimental", %w[org namespace entity_a entity_b max_hops top_k_per_hop min_co_occur as_of relations labeled].freeze, %w[org namespace entity_a entity_b].freeze), "facts.related" => OpSpec.new("facts.related", "facts", "related", true, true, "viewer", "experimental", %w[org namespace entity top_k as_of].freeze, %w[org namespace entity].freeze), "facts.traverse" => OpSpec.new("facts.traverse", "facts", "traverse", true, true, "viewer", "stable", %w[org namespace seed_entity max_hops top_k_per_hop min_co_occur max_nodes as_of relations labeled hub_degree hub_share rank_by].freeze, %w[org namespace seed_entity].freeze), + "grants.accept_invite" => OpSpec.new("grants.accept_invite", "grants", "accept_invite", false, false, "viewer", "experimental", %w[org namespace secret].freeze, %w[org namespace secret].freeze), "grants.approve" => OpSpec.new("grants.approve", "grants", "approve", true, false, "admin", "experimental", %w[org namespace subject decision role].freeze, %w[org namespace subject].freeze), + "grants.cancel_invite" => OpSpec.new("grants.cancel_invite", "grants", "cancel_invite", true, false, "admin", "experimental", %w[org namespace invite_id].freeze, %w[org namespace invite_id].freeze), "grants.create" => OpSpec.new("grants.create", "grants", "create", true, false, "admin", "stable", %w[org namespace subject role granted_by replace].freeze, %w[org namespace subject role].freeze), + "grants.invite" => OpSpec.new("grants.invite", "grants", "invite", false, false, "admin", "experimental", %w[org namespace to role].freeze, %w[org namespace to role].freeze), "grants.list" => OpSpec.new("grants.list", "grants", "list", true, true, "viewer", "stable", %w[org namespace limit cursor fields].freeze, %w[org namespace].freeze), + "grants.list_invites" => OpSpec.new("grants.list_invites", "grants", "list_invites", true, false, "admin", "experimental", %w[org namespace].freeze, %w[org namespace].freeze), "grants.pending_for_me" => OpSpec.new("grants.pending_for_me", "grants", "pending_for_me", true, true, "viewer", "experimental", %w[org limit].freeze, %w[org].freeze), "grants.revoke" => OpSpec.new("grants.revoke", "grants", "revoke", true, false, "admin", "experimental", %w[org namespace subject].freeze, %w[org namespace subject].freeze), "grants.share_agent" => OpSpec.new("grants.share_agent", "grants", "share_agent", true, false, "writer", "experimental", %w[org namespace grantee role].freeze, %w[org namespace grantee].freeze), @@ -1172,6 +1176,13 @@ def traverse(body = nil, request_options: nil, **fields) # The `grants.*` operations. class GrantsOps < OpGroup + # `grants.accept_invite` (viewer, writes, experimental). + # Accept an invitation link as the signed-in person. + # Required: org, namespace, secret. + def accept_invite(body = nil, request_options: nil, **fields) + call_op("grants.accept_invite", body, fields, request_options) + end + # `grants.approve` (admin, writes, Idempotency-Key, experimental). # Approve (or reject) a pending grant request. # Required: org, namespace, subject. @@ -1179,18 +1190,39 @@ def approve(body = nil, request_options: nil, **fields) call_op("grants.approve", body, fields, request_options) end + # `grants.cancel_invite` (admin, writes, Idempotency-Key, experimental). + # Cancel an open invitation, so its link admits nobody. + # Required: org, namespace, invite_id. + def cancel_invite(body = nil, request_options: nil, **fields) + call_op("grants.cancel_invite", body, fields, request_options) + end + # `grants.create` (admin, writes, Idempotency-Key). # Required: org, namespace, subject, role. def create(body = nil, request_options: nil, **fields) call_op("grants.create", body, fields, request_options) end + # `grants.invite` (admin, writes, experimental). + # Give a person a role on a namespace by login handle or email. + # Required: org, namespace, to, role. + def invite(body = nil, request_options: nil, **fields) + call_op("grants.invite", body, fields, request_options) + end + # `grants.list` (viewer, read-only). # Required: org, namespace. def list(body = nil, request_options: nil, **fields) call_op("grants.list", body, fields, request_options) end + # `grants.list_invites` (admin, writes, Idempotency-Key, experimental). + # List a namespace's open invitations. + # Required: org, namespace. + def list_invites(body = nil, request_options: nil, **fields) + call_op("grants.list_invites", body, fields, request_options) + end + # `grants.pending_for_me` (viewer, read-only, experimental). # Required: org. def pending_for_me(body = nil, request_options: nil, **fields) diff --git a/sdk/rust/src/blocking_operations.rs b/sdk/rust/src/blocking_operations.rs index 29ca462393..558b386536 100644 --- a/sdk/rust/src/blocking_operations.rs +++ b/sdk/rust/src/blocking_operations.rs @@ -3948,6 +3948,74 @@ impl crate::blocking::Client { ) -> Result, crate::CallFailure> { self.call("grants.unshare_agent", &request, options) } + /// Call `grants.invite`. + pub fn grants_invite( + &self, + request: crate::GrantsInviteInput, + ) -> Result { + self.grants_invite_with_options(request, crate::CallOptions::default()) + .map(|result| result.data) + .map_err(|failure| failure.error) + } + /// Call `grants.invite` with per-request options and metadata. + pub fn grants_invite_with_options( + &self, + request: crate::GrantsInviteInput, + options: crate::CallOptions, + ) -> Result, crate::CallFailure> { + self.call("grants.invite", &request, options) + } + /// Call `grants.list_invites`. + pub fn grants_list_invites( + &self, + request: crate::GrantsListInvitesInput, + ) -> Result { + self.grants_list_invites_with_options(request, crate::CallOptions::default()) + .map(|result| result.data) + .map_err(|failure| failure.error) + } + /// Call `grants.list_invites` with per-request options and metadata. + pub fn grants_list_invites_with_options( + &self, + request: crate::GrantsListInvitesInput, + options: crate::CallOptions, + ) -> Result, crate::CallFailure> { + self.call("grants.list_invites", &request, options) + } + /// Call `grants.cancel_invite`. + pub fn grants_cancel_invite( + &self, + request: crate::GrantsCancelInviteInput, + ) -> Result { + self.grants_cancel_invite_with_options(request, crate::CallOptions::default()) + .map(|result| result.data) + .map_err(|failure| failure.error) + } + /// Call `grants.cancel_invite` with per-request options and metadata. + pub fn grants_cancel_invite_with_options( + &self, + request: crate::GrantsCancelInviteInput, + options: crate::CallOptions, + ) -> Result, crate::CallFailure> { + self.call("grants.cancel_invite", &request, options) + } + /// Call `grants.accept_invite`. + pub fn grants_accept_invite( + &self, + request: crate::GrantsAcceptInviteInput, + ) -> Result { + self.grants_accept_invite_with_options(request, crate::CallOptions::default()) + .map(|result| result.data) + .map_err(|failure| failure.error) + } + /// Call `grants.accept_invite` with per-request options and metadata. + pub fn grants_accept_invite_with_options( + &self, + request: crate::GrantsAcceptInviteInput, + options: crate::CallOptions, + ) -> Result, crate::CallFailure> { + self.call("grants.accept_invite", &request, options) + } /// Call `collection.budget_set`. pub fn collection_budget_set( &self, diff --git a/sdk/rust/src/operations.rs b/sdk/rust/src/operations.rs index 4b1f842454..380bc3385a 100644 --- a/sdk/rust/src/operations.rs +++ b/sdk/rust/src/operations.rs @@ -4233,6 +4233,78 @@ impl crate::Client { ) -> Result, crate::CallFailure> { self.call("grants.unshare_agent", &request, options).await } + /// Call `grants.invite`. + pub async fn grants_invite( + &self, + request: crate::GrantsInviteInput, + ) -> Result { + self.grants_invite_with_options(request, crate::CallOptions::default()) + .await + .map(|result| result.data) + .map_err(|failure| failure.error) + } + /// Call `grants.invite` with per-request options and metadata. + pub async fn grants_invite_with_options( + &self, + request: crate::GrantsInviteInput, + options: crate::CallOptions, + ) -> Result, crate::CallFailure> { + self.call("grants.invite", &request, options).await + } + /// Call `grants.list_invites`. + pub async fn grants_list_invites( + &self, + request: crate::GrantsListInvitesInput, + ) -> Result { + self.grants_list_invites_with_options(request, crate::CallOptions::default()) + .await + .map(|result| result.data) + .map_err(|failure| failure.error) + } + /// Call `grants.list_invites` with per-request options and metadata. + pub async fn grants_list_invites_with_options( + &self, + request: crate::GrantsListInvitesInput, + options: crate::CallOptions, + ) -> Result, crate::CallFailure> { + self.call("grants.list_invites", &request, options).await + } + /// Call `grants.cancel_invite`. + pub async fn grants_cancel_invite( + &self, + request: crate::GrantsCancelInviteInput, + ) -> Result { + self.grants_cancel_invite_with_options(request, crate::CallOptions::default()) + .await + .map(|result| result.data) + .map_err(|failure| failure.error) + } + /// Call `grants.cancel_invite` with per-request options and metadata. + pub async fn grants_cancel_invite_with_options( + &self, + request: crate::GrantsCancelInviteInput, + options: crate::CallOptions, + ) -> Result, crate::CallFailure> { + self.call("grants.cancel_invite", &request, options).await + } + /// Call `grants.accept_invite`. + pub async fn grants_accept_invite( + &self, + request: crate::GrantsAcceptInviteInput, + ) -> Result { + self.grants_accept_invite_with_options(request, crate::CallOptions::default()) + .await + .map(|result| result.data) + .map_err(|failure| failure.error) + } + /// Call `grants.accept_invite` with per-request options and metadata. + pub async fn grants_accept_invite_with_options( + &self, + request: crate::GrantsAcceptInviteInput, + options: crate::CallOptions, + ) -> Result, crate::CallFailure> { + self.call("grants.accept_invite", &request, options).await + } /// Call `collection.budget_set`. pub async fn collection_budget_set( &self, diff --git a/sdk/rust/src/wire_models.rs b/sdk/rust/src/wire_models.rs index df940e09ef..394fa0b0d2 100644 --- a/sdk/rust/src/wire_models.rs +++ b/sdk/rust/src/wire_models.rs @@ -1204,6 +1204,28 @@ pub(crate) const OP_POLICIES: &[OperationPolicy] = &[ &["namespace", "org"], &[], ), + ("grants.invite", false, false, &["namespace", "org"], &[]), + ( + "grants.list_invites", + true, + false, + &["namespace", "org"], + &[], + ), + ( + "grants.cancel_invite", + true, + false, + &["namespace", "org"], + &[], + ), + ( + "grants.accept_invite", + false, + false, + &["namespace", "org"], + &[], + ), ("collection.budget_set", true, false, &["org"], &[]), ("collection.create", true, false, &["org"], &[]), ("collection.move", true, false, &["org"], &[]), @@ -2032,6 +2054,7 @@ pub(crate) const NAMESPACE_HINT_EXCLUSIONS: &[&str] = &[ "extraction_policy.clear", "extraction_policy.get", "extraction_policy.set", + "grants.accept_invite", "memory.verify", ]; #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] @@ -22412,6 +22435,66 @@ impl FactsTraverseInput { } } +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[non_exhaustive] +pub enum GrantsAcceptInviteOutputRole { + #[serde(rename = "viewer")] + Viewer, + #[serde(rename = "writer")] + Writer, + #[serde(rename = "admin")] + Admin, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[non_exhaustive] +pub struct GrantsAcceptInviteOutput { + pub namespace: String, + pub role: GrantsAcceptInviteOutputRole, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[non_exhaustive] +pub struct GrantsAcceptInviteInput { + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_value" + )] + pub org: Option, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_value" + )] + pub namespace: Option, + pub secret: String, +} +impl GrantsAcceptInviteInput { + pub fn new(secret: impl Into) -> Self { + Self { + org: None, + namespace: None, + secret: secret.into(), + } + } + pub fn org(mut self, org: impl Into) -> Self { + self.org = Some(org.into()); + self + } + pub fn namespace(mut self, namespace: impl Into) -> Self { + self.namespace = Some(namespace.into()); + self + } + pub async fn send( + self, + client: &crate::Client, + options: crate::CallOptions, + ) -> Result, crate::CallFailure> { + client.call("grants.accept_invite", &self, options).await + } +} + #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] #[non_exhaustive] pub enum GrantsApproveOutputDecision { @@ -22531,6 +22614,54 @@ impl GrantsApproveInput { } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[non_exhaustive] +pub struct GrantsCancelInviteOutput { + pub cancelled: bool, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[non_exhaustive] +pub struct GrantsCancelInviteInput { + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_value" + )] + pub org: Option, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_value" + )] + pub namespace: Option, + pub invite_id: String, +} +impl GrantsCancelInviteInput { + pub fn new(invite_id: impl Into) -> Self { + Self { + org: None, + namespace: None, + invite_id: invite_id.into(), + } + } + pub fn org(mut self, org: impl Into) -> Self { + self.org = Some(org.into()); + self + } + pub fn namespace(mut self, namespace: impl Into) -> Self { + self.namespace = Some(namespace.into()); + self + } + pub async fn send( + self, + client: &crate::Client, + options: crate::CallOptions, + ) -> Result, crate::CallFailure> { + client.call("grants.cancel_invite", &self, options).await + } +} + #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] #[non_exhaustive] pub enum GrantsCreateOutputRole { @@ -22629,6 +22760,100 @@ impl GrantsCreateInput { } } +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[non_exhaustive] +pub enum GrantsInviteOutputOutcome { + #[serde(rename = "granted")] + Granted, + #[serde(rename = "invited")] + Invited, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[non_exhaustive] +pub enum GrantsInviteOutputRole { + #[serde(rename = "viewer")] + Viewer, + #[serde(rename = "writer")] + Writer, + #[serde(rename = "admin")] + Admin, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[non_exhaustive] +pub struct GrantsInviteOutput { + pub outcome: GrantsInviteOutputOutcome, + pub role: GrantsInviteOutputRole, + #[serde(default = "default_1035")] + pub subject: String, + #[serde(default = "default_1036")] + pub invite_id: String, + #[serde(default = "default_1037")] + pub link_path: String, + #[serde(default = "default_1038")] + pub url: String, + #[serde(default = "default_1039")] + pub expires_at: Option, + #[serde(default = "default_1040")] + pub emailed: bool, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[non_exhaustive] +pub enum GrantsInviteInputRole { + #[serde(rename = "viewer")] + Viewer, + #[serde(rename = "writer")] + Writer, + #[serde(rename = "admin")] + Admin, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[non_exhaustive] +pub struct GrantsInviteInput { + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_value" + )] + pub org: Option, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_value" + )] + pub namespace: Option, + pub to: String, + pub role: GrantsInviteInputRole, +} +impl GrantsInviteInput { + pub fn new(to: impl Into, role: GrantsInviteInputRole) -> Self { + Self { + org: None, + namespace: None, + to: to.into(), + role, + } + } + pub fn org(mut self, org: impl Into) -> Self { + self.org = Some(org.into()); + self + } + pub fn namespace(mut self, namespace: impl Into) -> Self { + self.namespace = Some(namespace.into()); + self + } + pub async fn send( + self, + client: &crate::Client, + options: crate::CallOptions, + ) -> Result, crate::CallFailure> { + client.call("grants.invite", &self, options).await + } +} + #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] #[non_exhaustive] pub enum GrantEntryRole { @@ -22717,9 +22942,9 @@ pub struct GrantEntry { #[non_exhaustive] pub struct GrantsListOutput { pub rows: Vec, - #[serde(default = "default_1035")] + #[serde(default = "default_1041")] pub next_cursor: Option, - #[serde(default = "default_1036")] + #[serde(default = "default_1042")] pub truncated: bool, } @@ -22809,6 +23034,79 @@ impl GrantsListInput { } } +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[non_exhaustive] +pub enum InviteEntryRole { + #[serde(rename = "viewer")] + Viewer, + #[serde(rename = "writer")] + Writer, + #[serde(rename = "admin")] + Admin, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[non_exhaustive] +pub struct InviteEntry { + pub invite_id: String, + pub email: String, + pub role: InviteEntryRole, + pub created_by: String, + pub created_at: String, + pub expires_at: String, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[non_exhaustive] +pub struct GrantsListInvitesOutput { + pub rows: Vec, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[non_exhaustive] +pub struct GrantsListInvitesInput { + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_value" + )] + pub org: Option, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_value" + )] + pub namespace: Option, +} +impl Default for GrantsListInvitesInput { + fn default() -> Self { + Self::new() + } +} +impl GrantsListInvitesInput { + pub fn new() -> Self { + Self { + org: None, + namespace: None, + } + } + pub fn org(mut self, org: impl Into) -> Self { + self.org = Some(org.into()); + self + } + pub fn namespace(mut self, namespace: impl Into) -> Self { + self.namespace = Some(namespace.into()); + self + } + pub async fn send( + self, + client: &crate::Client, + options: crate::CallOptions, + ) -> Result, crate::CallFailure> { + client.call("grants.list_invites", &self, options).await + } +} + #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] #[non_exhaustive] pub enum PendingForMeEntryCurrentRole { @@ -22835,12 +23133,12 @@ pub enum PendingForMeEntryRequestedRole { #[non_exhaustive] pub struct PendingForMeEntry { pub namespace: String, - #[serde(default = "default_1037")] + #[serde(default = "default_1043")] pub kind: String, pub subject: String, pub current_role: PendingForMeEntryCurrentRole, pub requested_role: PendingForMeEntryRequestedRole, - #[serde(default = "default_1038")] + #[serde(default = "default_1044")] pub pending_since: Option, } @@ -22899,7 +23197,7 @@ impl GrantsPendingForMeInput { #[non_exhaustive] pub struct GrantsRevokeOutput { pub revoked: bool, - #[serde(default = "default_1039")] + #[serde(default = "default_1045")] pub revoked_at: Option, } @@ -23029,7 +23327,7 @@ impl GrantsShareAgentInput { #[non_exhaustive] pub struct GrantsUnshareAgentOutput { pub revoked: bool, - #[serde(default = "default_1040")] + #[serde(default = "default_1046")] pub revoked_at: Option, } @@ -23089,7 +23387,7 @@ pub enum HelpGetOutputAudience { pub struct HelpOutlineEntry { pub section: String, pub anchor: String, - #[serde(default = "default_1048")] + #[serde(default = "default_1054")] pub heading: String, } @@ -23099,21 +23397,21 @@ pub struct HelpGetOutput { pub available: bool, pub found: bool, pub path: String, - #[serde(default = "default_1041")] + #[serde(default = "default_1047")] pub title: String, - #[serde(default = "default_1042")] + #[serde(default = "default_1048")] pub section: String, - #[serde(default = "default_1043")] + #[serde(default = "default_1049")] pub anchor: String, - #[serde(default = "default_1044")] + #[serde(default = "default_1050")] pub audience: HelpGetOutputAudience, - #[serde(default = "default_1045")] + #[serde(default = "default_1051")] pub text: String, - #[serde(default = "default_1046")] + #[serde(default = "default_1052")] pub truncated: bool, - #[serde(default = "default_1047")] + #[serde(default = "default_1053")] pub next_offset: Integer, - #[serde(default = "default_1049")] + #[serde(default = "default_1055")] pub sections: Vec, } @@ -23258,21 +23556,21 @@ pub struct InboxPayload { pub inbox: String, pub owner_agent: String, pub owner_namespace: String, - #[serde(default = "default_1050")] + #[serde(default = "default_1056")] pub description: String, - #[serde(default = "default_1051")] + #[serde(default = "default_1057")] pub posters: Vec, - #[serde(default = "default_1052")] + #[serde(default = "default_1058")] pub accept_disclosure: Vec, pub default_lease_seconds: Integer, pub max_attempts: Integer, pub max_defers: Integer, pub triage_escalate_after_seconds: Integer, - #[serde(default = "default_1053")] + #[serde(default = "default_1059")] pub webhook_url: String, - #[serde(default = "default_1054")] + #[serde(default = "default_1060")] pub created_by: String, - #[serde(default = "default_1055")] + #[serde(default = "default_1061")] pub owner_subject: String, pub created_at: String, pub updated_at: String, @@ -23382,9 +23680,9 @@ pub struct PolicyPayload { pub poster: String, pub kind: String, pub mode: PolicyPayloadMode, - #[serde(default = "default_1056")] + #[serde(default = "default_1062")] pub require_evidence: Vec, - #[serde(default = "default_1057")] + #[serde(default = "default_1063")] pub set_by: String, pub set_at: String, pub version: Integer, @@ -23454,7 +23752,7 @@ impl InboxPolicyListInput { pub struct InboxPolicySetOutput { #[serde(deserialize_with = "required_nullable")] pub policy: Option, - #[serde(default = "default_1058")] + #[serde(default = "default_1064")] pub removed: bool, } @@ -23583,15 +23881,15 @@ pub struct Principal { pub subject: String, pub label: String, pub kind: PrincipalKind, - #[serde(default = "default_1059")] + #[serde(default = "default_1065")] pub namespaces: Vec, - #[serde(default = "default_1060")] + #[serde(default = "default_1066")] pub roles: Vec, - #[serde(default = "default_1061")] + #[serde(default = "default_1067")] pub last_seen: Option, - #[serde(default = "default_1062")] + #[serde(default = "default_1068")] pub can_already_post: bool, - #[serde(default = "default_1063")] + #[serde(default = "default_1069")] pub listed: bool, } @@ -23953,15 +24251,15 @@ pub struct AnalysisColumn { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct InsightsQueryOutput { - #[serde(default = "default_1064")] + #[serde(default = "default_1070")] pub columns: Vec, - #[serde(default = "default_1065")] + #[serde(default = "default_1071")] pub rows: Vec>, - #[serde(default = "default_1066")] + #[serde(default = "default_1072")] pub row_count: Integer, - #[serde(default = "default_1067")] + #[serde(default = "default_1073")] pub truncated: bool, - #[serde(default = "default_1068")] + #[serde(default = "default_1074")] pub sql_digest: String, } @@ -24243,11 +24541,11 @@ pub enum CitationAnswerVerdict { #[non_exhaustive] pub struct CitationAnswer { pub verdict: CitationAnswerVerdict, - #[serde(default = "default_1069")] + #[serde(default = "default_1075")] pub reason: String, - #[serde(default = "default_1070")] + #[serde(default = "default_1076")] pub recheck: String, - #[serde(default = "default_1071")] + #[serde(default = "default_1077")] pub text_sha256: String, } @@ -24256,7 +24554,7 @@ pub struct CitationAnswer { pub struct KnowledgeCitationsCheckOutput { pub citations: Vec, pub verdict_counts: std::collections::HashMap, - #[serde(default = "default_1072")] + #[serde(default = "default_1078")] pub reason_counts: std::collections::HashMap, pub note: String, } @@ -24430,32 +24728,32 @@ pub struct DatasetOut { pub dataset_id: String, pub source_uri: String, pub name: String, - #[serde(default = "default_1073")] + #[serde(default = "default_1079")] pub sheet: String, - #[serde(default = "default_1074")] + #[serde(default = "default_1080")] pub row_start: Integer, - #[serde(default = "default_1075")] + #[serde(default = "default_1081")] pub row_end: Integer, pub revision: Integer, pub snapshot_id: String, pub schema_state: String, pub columns: Vec, - #[serde(default = "default_1076")] + #[serde(default = "default_1082")] pub clarifications: Vec, pub row_count: Integer, - #[serde(default = "default_1077")] + #[serde(default = "default_1083")] pub rejected_rows: Integer, - #[serde(default = "default_1078")] + #[serde(default = "default_1084")] pub rejected: Vec, - #[serde(default = "default_1079")] + #[serde(default = "default_1085")] pub complete: bool, - #[serde(default = "default_1080")] + #[serde(default = "default_1086")] pub approved_by: String, - #[serde(default = "default_1081")] + #[serde(default = "default_1087")] pub approved_at: Option, - #[serde(default = "default_1082")] + #[serde(default = "default_1088")] pub created_at: Option, - #[serde(default = "default_1083")] + #[serde(default = "default_1089")] pub rows: Vec>, } @@ -24463,9 +24761,9 @@ pub struct DatasetOut { #[non_exhaustive] pub struct KnowledgeDatasetApproveOutput { pub found: bool, - #[serde(default = "default_1084")] + #[serde(default = "default_1090")] pub dataset: Option, - #[serde(default = "default_1085")] + #[serde(default = "default_1091")] pub retyped: bool, } @@ -24559,9 +24857,9 @@ impl KnowledgeDatasetApproveInput { #[non_exhaustive] pub struct KnowledgeDatasetGetOutput { pub found: bool, - #[serde(default = "default_1086")] + #[serde(default = "default_1092")] pub revision: Integer, - #[serde(default = "default_1087")] + #[serde(default = "default_1093")] pub datasets: Vec, } @@ -24634,7 +24932,7 @@ impl KnowledgeDatasetGetInput { pub struct KnowledgeDocCluster { pub content_sha256: String, pub doc_count: Integer, - #[serde(default = "default_1088")] + #[serde(default = "default_1094")] pub docs: Vec>, } @@ -24644,16 +24942,16 @@ pub struct KnowledgeChunkCluster { pub content_sha256: String, pub chunk_count: Integer, pub uri_count: Integer, - #[serde(default = "default_1090")] + #[serde(default = "default_1096")] pub samples: Vec>, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct KnowledgeDedupListOutput { - #[serde(default = "default_1089")] + #[serde(default = "default_1095")] pub doc_clusters: Vec, - #[serde(default = "default_1091")] + #[serde(default = "default_1097")] pub chunk_clusters: Vec, } @@ -24730,7 +25028,7 @@ pub struct KnowledgeDedupResolveOutput { pub canonical_uri: String, pub duplicate_uri: String, pub decision: String, - #[serde(default = "default_1092")] + #[serde(default = "default_1098")] pub superseded_uri: String, } @@ -24849,24 +25147,24 @@ impl KnowledgeDeleteInput { #[non_exhaustive] pub struct KnowledgeFormat { pub format: String, - #[serde(default = "default_1093")] + #[serde(default = "default_1099")] pub extensions: Vec, - #[serde(default = "default_1094")] + #[serde(default = "default_1100")] pub media_types: Vec, - #[serde(default = "default_1095")] + #[serde(default = "default_1101")] pub available: Option, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct KnowledgeFormatsOutput { - #[serde(default = "default_1096")] + #[serde(default = "default_1102")] pub formats: Vec, - #[serde(default = "default_1097")] + #[serde(default = "default_1103")] pub max_upload_bytes: Integer, - #[serde(default = "default_1098")] + #[serde(default = "default_1104")] pub refused_extensions: Vec, - #[serde(default = "default_1099")] + #[serde(default = "default_1105")] pub default_format: String, } @@ -24968,7 +25266,7 @@ impl KnowledgeGapsDraftInput { pub struct KnowledgeGap { pub gap_id: String, pub head: String, - #[serde(default = "default_1100")] + #[serde(default = "default_1106")] pub samples: Vec, pub askers: Integer, pub asks: Integer, @@ -24978,13 +25276,13 @@ pub struct KnowledgeGap { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct KnowledgeGapsListOutput { - #[serde(default = "default_1101")] + #[serde(default = "default_1107")] pub gaps: Vec, - #[serde(default = "default_1102")] + #[serde(default = "default_1108")] pub built_at: Option, - #[serde(default = "default_1103")] + #[serde(default = "default_1109")] pub capturing: Option, - #[serde(default = "default_1104")] + #[serde(default = "default_1110")] pub enabled: bool, } @@ -25050,7 +25348,7 @@ pub struct KnowledgeIngestOutput { pub ingestion_id: String, pub state: String, pub source_uri: String, - #[serde(default = "default_1105")] + #[serde(default = "default_1111")] pub namespace: String, } @@ -25269,9 +25567,9 @@ impl KnowledgeIngestInput { #[non_exhaustive] pub struct KnowledgeIngestCancelOutput { pub found: bool, - #[serde(default = "default_1106")] + #[serde(default = "default_1112")] pub state: String, - #[serde(default = "default_1107")] + #[serde(default = "default_1113")] pub cancelled: bool, } @@ -25322,39 +25620,39 @@ impl KnowledgeIngestCancelInput { pub struct KnowledgeIngestStatusOutput { pub found: bool, pub ingestion_id: String, - #[serde(default = "default_1108")] + #[serde(default = "default_1114")] pub source_uri: String, - #[serde(default = "default_1109")] + #[serde(default = "default_1115")] pub state: String, - #[serde(default = "default_1110")] + #[serde(default = "default_1116")] pub stage: String, - #[serde(default = "default_1111")] + #[serde(default = "default_1117")] pub attempts: Integer, - #[serde(default = "default_1112")] + #[serde(default = "default_1118")] pub error_code: String, - #[serde(default = "default_1113")] + #[serde(default = "default_1119")] pub error_message: String, - #[serde(default = "default_1114")] + #[serde(default = "default_1120")] pub format: String, - #[serde(default = "default_1115")] + #[serde(default = "default_1121")] pub coverage: Option>, - #[serde(default = "default_1116")] + #[serde(default = "default_1122")] pub warnings: Vec, - #[serde(default = "default_1117")] + #[serde(default = "default_1123")] pub chunks: Integer, - #[serde(default = "default_1118")] + #[serde(default = "default_1124")] pub revision: Integer, - #[serde(default = "default_1119")] + #[serde(default = "default_1125")] pub expected_revision: Option, - #[serde(default = "default_1120")] + #[serde(default = "default_1126")] pub filename: String, - #[serde(default = "default_1121")] + #[serde(default = "default_1127")] pub retrieval: String, - #[serde(default = "default_1122")] + #[serde(default = "default_1128")] pub cancel_requested: bool, - #[serde(default = "default_1123")] + #[serde(default = "default_1129")] pub created_at: Option, - #[serde(default = "default_1124")] + #[serde(default = "default_1130")] pub updated_at: Option, } @@ -25411,21 +25709,21 @@ pub struct DocumentCount { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct DocumentTotals { - #[serde(default = "default_1125")] + #[serde(default = "default_1131")] pub live: Option, - #[serde(default = "default_1126")] + #[serde(default = "default_1132")] pub deleted: Option, - #[serde(default = "default_1127")] + #[serde(default = "default_1133")] pub newest_ingested_at: Option, - #[serde(default = "default_1128")] + #[serde(default = "default_1134")] pub by_format: Vec, - #[serde(default = "default_1129")] + #[serde(default = "default_1135")] pub by_source_scheme: Vec, - #[serde(default = "default_1130")] + #[serde(default = "default_1136")] pub earlier_revisions: Option, - #[serde(default = "default_1131")] + #[serde(default = "default_1137")] pub unnumbered: Option, - #[serde(default = "default_1132")] + #[serde(default = "default_1138")] pub retired_versions: Option, } @@ -25440,15 +25738,15 @@ pub struct ChunkModelCount { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct ChunkTotals { - #[serde(default = "default_1133")] + #[serde(default = "default_1139")] pub embedder_model: String, - #[serde(default = "default_1134")] + #[serde(default = "default_1140")] pub live: Option, - #[serde(default = "default_1135")] + #[serde(default = "default_1141")] pub searchable: Option, - #[serde(default = "default_1136")] + #[serde(default = "default_1142")] pub unembedded: Option, - #[serde(default = "default_1137")] + #[serde(default = "default_1143")] pub by_model: Vec, } @@ -25473,9 +25771,9 @@ pub struct DocumentDecisions { #[non_exhaustive] pub struct DecisionTotals { pub definition: String, - #[serde(default = "default_1138")] + #[serde(default = "default_1144")] pub refs: Vec, - #[serde(default = "default_1139")] + #[serde(default = "default_1145")] pub all_documents: Option, } @@ -25490,7 +25788,7 @@ pub struct DocumentChunks { pub min_chars: Integer, pub median_chars: Integer, pub max_chars: Integer, - #[serde(default = "default_1142")] + #[serde(default = "default_1148")] pub models: Vec, } @@ -25540,11 +25838,11 @@ pub struct IngestJob { pub failure_class: IngestJobFailureClass, pub queued_at: String, pub updated_at: String, - #[serde(default = "default_1147")] + #[serde(default = "default_1153")] pub ended_at: Option, - #[serde(default = "default_1148")] + #[serde(default = "default_1154")] pub next_attempt_at: Option, - #[serde(default = "default_1149")] + #[serde(default = "default_1155")] pub stalled: bool, } @@ -25554,11 +25852,11 @@ pub struct SourceJobs { pub source_uri: String, pub jobs: Integer, pub open_jobs: Integer, - #[serde(default = "default_1146")] + #[serde(default = "default_1152")] pub open_ingestion_id: String, pub latest: IngestJob, pub current: IngestJob, - #[serde(default = "default_1150")] + #[serde(default = "default_1156")] pub replaced: bool, } @@ -25571,18 +25869,18 @@ pub struct InspectDocument { pub source_scheme: String, pub version: Integer, pub revision: Integer, - #[serde(default = "default_1140")] + #[serde(default = "default_1146")] pub ingestion_id: String, pub ingested_at: String, - #[serde(default = "default_1141")] + #[serde(default = "default_1147")] pub retired_versions: Option, - #[serde(default = "default_1143")] + #[serde(default = "default_1149")] pub chunks: Option, - #[serde(default = "default_1144")] + #[serde(default = "default_1150")] pub decisions: Option, - #[serde(default = "default_1145")] - pub extraction: Option, #[serde(default = "default_1151")] + pub extraction: Option, + #[serde(default = "default_1157")] pub jobs: Option, } @@ -25627,40 +25925,40 @@ pub struct DocumentFinding { pub kind: DocumentFindingKind, pub rule_version: Integer, pub source_op: String, - #[serde(default = "default_1154")] + #[serde(default = "default_1160")] pub window_seconds: Option, - #[serde(default = "default_1155")] + #[serde(default = "default_1161")] pub population: Option, pub sample_limit: Integer, pub samples_complete: bool, - #[serde(default = "default_1156")] + #[serde(default = "default_1162")] pub evidence: Vec, - #[serde(default = "default_1157")] + #[serde(default = "default_1163")] pub exceptions: String, - #[serde(default = "default_1158")] + #[serde(default = "default_1164")] pub uncertainty: String, pub code: String, pub severity: DocumentFindingSeverity, pub count: Integer, pub share: f64, - #[serde(default = "default_1159")] + #[serde(default = "default_1165")] pub samples: Vec, - #[serde(default = "default_1160")] + #[serde(default = "default_1166")] pub ingested: Integer, - #[serde(default = "default_1161")] + #[serde(default = "default_1167")] pub ingested_samples: Vec, pub detail: String, pub remedy: String, - #[serde(default = "default_1162")] + #[serde(default = "default_1168")] pub refs: Vec, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct ReportCoverage { - #[serde(default = "default_1164")] + #[serde(default = "default_1170")] pub rules_run: Vec, - #[serde(default = "default_1165")] + #[serde(default = "default_1171")] pub rules_skipped: Vec, pub complete: bool, } @@ -25668,43 +25966,43 @@ pub struct ReportCoverage { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct IngestionTotals { - #[serde(default = "default_1166")] + #[serde(default = "default_1172")] pub sources: Option, - #[serde(default = "default_1167")] + #[serde(default = "default_1173")] pub without_document: Option, - #[serde(default = "default_1168")] + #[serde(default = "default_1174")] pub replaced: Option, - #[serde(default = "default_1169")] + #[serde(default = "default_1175")] pub pending: Option, - #[serde(default = "default_1170")] + #[serde(default = "default_1176")] pub processing: Option, - #[serde(default = "default_1171")] + #[serde(default = "default_1177")] pub stalled: Option, - #[serde(default = "default_1172")] + #[serde(default = "default_1178")] pub ready: Option, - #[serde(default = "default_1173")] + #[serde(default = "default_1179")] pub partial: Option, - #[serde(default = "default_1174")] + #[serde(default = "default_1180")] pub failed: Option, - #[serde(default = "default_1175")] + #[serde(default = "default_1181")] pub cancelled: Option, - #[serde(default = "default_1176")] + #[serde(default = "default_1182")] pub oldest_open_queued_at: Option, pub worker_enabled: bool, - #[serde(default = "default_1177")] + #[serde(default = "default_1183")] pub extractor_configured: Option, - #[serde(default = "default_1178")] + #[serde(default = "default_1184")] pub without_document_listed: Vec, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct ExtractionTotals { - #[serde(default = "default_1179")] + #[serde(default = "default_1185")] pub documents: Option, - #[serde(default = "default_1180")] + #[serde(default = "default_1186")] pub incomplete: Option, - #[serde(default = "default_1181")] + #[serde(default = "default_1187")] pub lost: Vec, } @@ -25734,31 +26032,31 @@ pub struct IngestFinding { pub kind: IngestFindingKind, pub rule_version: Integer, pub source_op: String, - #[serde(default = "default_1182")] + #[serde(default = "default_1188")] pub window_seconds: Option, - #[serde(default = "default_1183")] + #[serde(default = "default_1189")] pub population: Option, pub sample_limit: Integer, pub samples_complete: bool, - #[serde(default = "default_1184")] + #[serde(default = "default_1190")] pub evidence: Vec, - #[serde(default = "default_1185")] + #[serde(default = "default_1191")] pub exceptions: String, - #[serde(default = "default_1186")] + #[serde(default = "default_1192")] pub uncertainty: String, pub code: String, pub severity: IngestFindingSeverity, pub count: Integer, pub share: f64, - #[serde(default = "default_1187")] + #[serde(default = "default_1193")] pub samples: Vec, - #[serde(default = "default_1188")] + #[serde(default = "default_1194")] pub ingestion_ids: Vec, - #[serde(default = "default_1189")] + #[serde(default = "default_1195")] pub without_document: Integer, pub detail: String, pub remedy: String, - #[serde(default = "default_1190")] + #[serde(default = "default_1196")] pub refs: Vec, } @@ -25785,20 +26083,20 @@ pub struct KnowledgeInspectOutput { pub documents: DocumentTotals, pub chunks: ChunkTotals, pub decisions: DecisionTotals, - #[serde(default = "default_1152")] + #[serde(default = "default_1158")] pub listed: Vec, - #[serde(default = "default_1153")] + #[serde(default = "default_1159")] pub listed_complete: bool, - #[serde(default = "default_1163")] + #[serde(default = "default_1169")] pub findings: Vec, pub coverage: ReportCoverage, pub ingestions: IngestionTotals, pub extraction: ExtractionTotals, - #[serde(default = "default_1191")] + #[serde(default = "default_1197")] pub ingest_findings: Vec, - #[serde(default = "default_1192")] + #[serde(default = "default_1198")] pub memory_findings: Vec, - #[serde(default = "default_1193")] + #[serde(default = "default_1199")] pub skipped: Vec, } @@ -25945,7 +26243,7 @@ pub struct KnowledgeListEntry { #[non_exhaustive] pub struct KnowledgeListOutput { pub rows: Vec, - #[serde(default = "default_1194")] + #[serde(default = "default_1200")] pub next_cursor: Option, } @@ -26111,9 +26409,9 @@ pub enum KnowledgeMoveResultReason { #[non_exhaustive] pub struct KnowledgeMoveResult { pub source_uri: String, - #[serde(default = "default_1196")] + #[serde(default = "default_1202")] pub moved: bool, - #[serde(default = "default_1197")] + #[serde(default = "default_1203")] pub reason: KnowledgeMoveResultReason, } @@ -26121,9 +26419,9 @@ pub struct KnowledgeMoveResult { #[non_exhaustive] pub struct KnowledgeMoveOutput { pub found: bool, - #[serde(default = "default_1195")] + #[serde(default = "default_1201")] pub to_namespace: String, - #[serde(default = "default_1198")] + #[serde(default = "default_1204")] pub results: Vec, } @@ -26189,17 +26487,17 @@ pub struct OutlineEntry { pub struct KnowledgeOutlineOutput { pub found: bool, pub source_uri: String, - #[serde(default = "default_1199")] + #[serde(default = "default_1205")] pub title: String, - #[serde(default = "default_1200")] + #[serde(default = "default_1206")] pub structured: bool, - #[serde(default = "default_1201")] + #[serde(default = "default_1207")] pub chunk_count: Integer, - #[serde(default = "default_1202")] + #[serde(default = "default_1208")] pub sections: Vec, - #[serde(default = "default_1203")] + #[serde(default = "default_1209")] pub section_content: Option, - #[serde(default = "default_1204")] + #[serde(default = "default_1210")] pub section_chunk_idxs: Vec, } @@ -26306,12 +26604,12 @@ pub struct QueryReceipt { pub struct KnowledgeQueryOutput { pub columns: Vec, pub rows: Vec>, - #[serde(default = "default_1205")] + #[serde(default = "default_1211")] pub row_ids: Vec>, - #[serde(default = "default_1206")] + #[serde(default = "default_1212")] pub truncated: bool, pub complete: bool, - #[serde(default = "default_1207")] + #[serde(default = "default_1213")] pub incomplete: Vec, pub receipt: QueryReceipt, } @@ -26984,9 +27282,9 @@ pub struct QueryHistoryListOutputQueryHistorySource { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct QueryHistoryListOutput { - #[serde(default = "default_1208")] + #[serde(default = "default_1214")] pub enabled: bool, - #[serde(default = "default_1209")] + #[serde(default = "default_1215")] pub sources: Vec, } @@ -27117,7 +27415,7 @@ impl QueryHistoryRemoveInput { #[non_exhaustive] pub struct KnowledgeReadsOutput { pub window_days: Integer, - #[serde(default = "default_1210")] + #[serde(default = "default_1216")] pub reads: Vec>, } @@ -27220,15 +27518,15 @@ pub enum KnowledgeRestoreOutputOriginal { #[non_exhaustive] pub struct KnowledgeRestoreOutput { pub restored: bool, - #[serde(default = "default_1211")] + #[serde(default = "default_1217")] pub reason: KnowledgeRestoreOutputReason, - #[serde(default = "default_1212")] + #[serde(default = "default_1218")] pub doc_id: String, - #[serde(default = "default_1213")] + #[serde(default = "default_1219")] pub revision: Option, - #[serde(default = "default_1214")] + #[serde(default = "default_1220")] pub chunks_restored: Integer, - #[serde(default = "default_1215")] + #[serde(default = "default_1221")] pub original: KnowledgeRestoreOutputOriginal, } @@ -27301,35 +27599,35 @@ pub struct KnowledgeSourceCrawlProof { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct KnowledgeSourceProbe { - #[serde(default = "default_1220")] + #[serde(default = "default_1226")] pub documents: Integer, - #[serde(default = "default_1221")] + #[serde(default = "default_1227")] pub more: bool, - #[serde(default = "default_1222")] + #[serde(default = "default_1228")] pub sample: Vec, - #[serde(default = "default_1223")] + #[serde(default = "default_1229")] pub checked: Integer, - #[serde(default = "default_1224")] + #[serde(default = "default_1230")] pub sampled: bool, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct KnowledgeSourceAddOutput { - #[serde(default = "default_1216")] + #[serde(default = "default_1222")] pub crawl_proof: Option, pub name: String, pub kind: String, pub namespace: String, - #[serde(default = "default_1217")] + #[serde(default = "default_1223")] pub items: Vec>, - #[serde(default = "default_1218")] + #[serde(default = "default_1224")] pub include: Vec, - #[serde(default = "default_1219")] - pub config: std::collections::HashMap, #[serde(default = "default_1225")] + pub config: std::collections::HashMap, + #[serde(default = "default_1231")] pub probe: KnowledgeSourceProbe, - #[serde(default = "default_1226")] + #[serde(default = "default_1232")] pub dry_run: bool, } @@ -27546,21 +27844,21 @@ impl KnowledgeSourceAddInput { #[non_exhaustive] pub struct KnowledgeSourceCheckOutput { pub name: String, - #[serde(default = "default_1227")] + #[serde(default = "default_1233")] pub reachable: bool, - #[serde(default = "default_1228")] + #[serde(default = "default_1234")] pub documents: Integer, - #[serde(default = "default_1229")] + #[serde(default = "default_1235")] pub more: bool, - #[serde(default = "default_1230")] + #[serde(default = "default_1236")] pub sample: Vec, - #[serde(default = "default_1231")] + #[serde(default = "default_1237")] pub checked: Integer, - #[serde(default = "default_1232")] + #[serde(default = "default_1238")] pub sampled: bool, - #[serde(default = "default_1233")] + #[serde(default = "default_1239")] pub summary: String, - #[serde(default = "default_1234")] + #[serde(default = "default_1240")] pub checked_at: String, } @@ -27609,37 +27907,37 @@ impl KnowledgeSourceCheckInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct KnowledgeSourceSync { - #[serde(default = "default_1245")] + #[serde(default = "default_1251")] pub requested_at: String, - #[serde(default = "default_1246")] + #[serde(default = "default_1252")] pub last_synced_at: String, - #[serde(default = "default_1247")] + #[serde(default = "default_1253")] pub status: String, - #[serde(default = "default_1248")] + #[serde(default = "default_1254")] pub documents_seen: Integer, - #[serde(default = "default_1249")] + #[serde(default = "default_1255")] pub changed: Integer, - #[serde(default = "default_1250")] + #[serde(default = "default_1256")] pub removed: Integer, - #[serde(default = "default_1251")] + #[serde(default = "default_1257")] pub unconverted: Integer, - #[serde(default = "default_1252")] + #[serde(default = "default_1258")] pub unconverted_reasons: std::collections::HashMap, - #[serde(default = "default_1253")] + #[serde(default = "default_1259")] pub skipped: Integer, - #[serde(default = "default_1254")] + #[serde(default = "default_1260")] pub error: String, - #[serde(default = "default_1255")] + #[serde(default = "default_1261")] pub pending_extract: Integer, - #[serde(default = "default_1256")] + #[serde(default = "default_1262")] pub last_extracted_at: String, - #[serde(default = "default_1257")] + #[serde(default = "default_1263")] pub extracted: Integer, - #[serde(default = "default_1258")] + #[serde(default = "default_1264")] pub flagged_pinned: Integer, - #[serde(default = "default_1259")] + #[serde(default = "default_1265")] pub unextracted: Integer, - #[serde(default = "default_1260")] + #[serde(default = "default_1266")] pub extract_error: String, } @@ -27647,11 +27945,11 @@ pub struct KnowledgeSourceSync { #[non_exhaustive] pub struct KnowledgeSourceDocument { pub source_uri: String, - #[serde(default = "default_1262")] + #[serde(default = "default_1268")] pub title: String, - #[serde(default = "default_1263")] + #[serde(default = "default_1269")] pub source_revision: String, - #[serde(default = "default_1264")] + #[serde(default = "default_1270")] pub ingested_at: String, } @@ -27660,29 +27958,29 @@ pub struct KnowledgeSourceDocument { pub struct KnowledgeSourceInspectOutput { pub name: String, pub kind: String, - #[serde(default = "default_1235")] + #[serde(default = "default_1241")] pub credential_mode: String, - #[serde(default = "default_1236")] + #[serde(default = "default_1242")] pub owned_by_caller: bool, - #[serde(default = "default_1237")] + #[serde(default = "default_1243")] pub access: String, - #[serde(default = "default_1238")] + #[serde(default = "default_1244")] pub crawl_options: std::collections::HashMap, - #[serde(default = "default_1239")] + #[serde(default = "default_1245")] pub owner_subject: String, - #[serde(default = "default_1240")] + #[serde(default = "default_1246")] pub items: Vec>, - #[serde(default = "default_1241")] + #[serde(default = "default_1247")] pub include: Vec, - #[serde(default = "default_1242")] + #[serde(default = "default_1248")] pub config: std::collections::HashMap, - #[serde(default = "default_1243")] + #[serde(default = "default_1249")] pub created_by: String, - #[serde(default = "default_1244")] + #[serde(default = "default_1250")] pub created_at: String, - #[serde(default = "default_1261")] + #[serde(default = "default_1267")] pub sync: KnowledgeSourceSync, - #[serde(default = "default_1265")] + #[serde(default = "default_1271")] pub documents: Vec, } @@ -27735,40 +28033,40 @@ impl KnowledgeSourceInspectInput { pub struct KnowledgeSourceEntry { pub name: String, pub kind: String, - #[serde(default = "default_1266")] + #[serde(default = "default_1272")] pub credential_mode: String, - #[serde(default = "default_1267")] + #[serde(default = "default_1273")] pub owned_by_caller: bool, - #[serde(default = "default_1268")] + #[serde(default = "default_1274")] pub access: String, - #[serde(default = "default_1269")] + #[serde(default = "default_1275")] pub crawl_options: std::collections::HashMap, - #[serde(default = "default_1270")] + #[serde(default = "default_1276")] pub owner_subject: String, - #[serde(default = "default_1271")] + #[serde(default = "default_1277")] pub items: Vec>, - #[serde(default = "default_1272")] + #[serde(default = "default_1278")] pub include: Vec, - #[serde(default = "default_1273")] + #[serde(default = "default_1279")] pub config: std::collections::HashMap, - #[serde(default = "default_1274")] + #[serde(default = "default_1280")] pub created_by: String, - #[serde(default = "default_1275")] + #[serde(default = "default_1281")] pub created_at: String, - #[serde(default = "default_1276")] + #[serde(default = "default_1282")] pub sync: KnowledgeSourceSync, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct KnowledgeSourceListOutput { - #[serde(default = "default_1277")] + #[serde(default = "default_1283")] pub sources: Vec, - #[serde(default = "default_1278")] + #[serde(default = "default_1284")] pub enabled: bool, - #[serde(default = "default_1279")] + #[serde(default = "default_1285")] pub accepts_sources: bool, - #[serde(default = "default_1280")] + #[serde(default = "default_1286")] pub self_service: bool, } @@ -27863,7 +28161,7 @@ impl std::fmt::Debug for KnowledgeSourceLiveDocument { #[non_exhaustive] pub struct KnowledgeSourceLiveOutput { pub status: KnowledgeSourceLiveOutputStatus, - #[serde(default = "default_1281")] + #[serde(default = "default_1287")] pub document: Option, } impl std::fmt::Debug for KnowledgeSourceLiveOutput { @@ -27931,18 +28229,18 @@ impl KnowledgeSourceLiveInput { #[non_exhaustive] pub struct KnowledgeSourceParsedLink { pub link: String, - #[serde(default = "default_1282")] + #[serde(default = "default_1288")] pub kind: String, - #[serde(default = "default_1283")] + #[serde(default = "default_1289")] pub item: std::collections::HashMap, - #[serde(default = "default_1284")] + #[serde(default = "default_1290")] pub unreadable: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct KnowledgeSourceParseLinksOutput { - #[serde(default = "default_1285")] + #[serde(default = "default_1291")] pub links: Vec, } @@ -27993,25 +28291,25 @@ impl KnowledgeSourceParseLinksInput { #[derive(Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct PushStatusOutput { - #[serde(default = "default_1286")] + #[serde(default = "default_1292")] pub enabled: bool, - #[serde(default = "default_1287")] + #[serde(default = "default_1293")] pub status: String, - #[serde(default = "default_1288")] + #[serde(default = "default_1294")] pub provider: String, - #[serde(default = "default_1289")] + #[serde(default = "default_1295")] pub generation: String, - #[serde(default = "default_1290")] + #[serde(default = "default_1296")] pub callback_url: String, - #[serde(default = "default_1291")] + #[serde(default = "default_1297")] pub provider_id: String, - #[serde(default = "default_1292")] + #[serde(default = "default_1298")] pub challenge_fingerprint: String, - #[serde(default = "default_1293")] + #[serde(default = "default_1299")] pub verification_token: String, - #[serde(default = "default_1294")] + #[serde(default = "default_1300")] pub channels: Integer, - #[serde(default = "default_1295")] + #[serde(default = "default_1301")] pub expires_at: f64, } impl std::fmt::Debug for PushStatusOutput { @@ -28256,7 +28554,7 @@ impl PushStatusInput { #[non_exhaustive] pub struct KnowledgeSourceRemoveOutput { pub name: String, - #[serde(default = "default_1296")] + #[serde(default = "default_1302")] pub documents_pending: Integer, } @@ -28318,12 +28616,12 @@ impl KnowledgeSourceRemoveInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct KnowledgeSourceRotateOutput { - #[serde(default = "default_1297")] + #[serde(default = "default_1303")] pub crawl_proof: Option, pub name: String, - #[serde(default = "default_1298")] + #[serde(default = "default_1304")] pub probe: KnowledgeSourceProbe, - #[serde(default = "default_1299")] + #[serde(default = "default_1305")] pub rotated_at: String, } @@ -28375,7 +28673,7 @@ impl KnowledgeSourceRotateInput { #[non_exhaustive] pub struct KnowledgeSourceSyncNowOutput { pub name: String, - #[serde(default = "default_1300")] + #[serde(default = "default_1306")] pub enabled: bool, } @@ -28437,20 +28735,20 @@ impl KnowledgeSourceSyncNowInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct KnowledgeSourceUpdateOutput { - #[serde(default = "default_1301")] + #[serde(default = "default_1307")] pub crawl_proof: Option, pub name: String, - #[serde(default = "default_1302")] + #[serde(default = "default_1308")] pub items: Vec>, - #[serde(default = "default_1303")] + #[serde(default = "default_1309")] pub include: Vec, - #[serde(default = "default_1304")] + #[serde(default = "default_1310")] pub config: std::collections::HashMap, - #[serde(default = "default_1305")] + #[serde(default = "default_1311")] pub added: Vec>, - #[serde(default = "default_1306")] + #[serde(default = "default_1312")] pub removed: Vec>, - #[serde(default = "default_1307")] + #[serde(default = "default_1313")] pub probe: KnowledgeSourceProbe, } @@ -28593,7 +28891,7 @@ pub enum WorkerApproveOutputStatus { #[non_exhaustive] pub struct WorkerApproveOutput { pub status: WorkerApproveOutputStatus, - #[serde(default = "default_1308")] + #[serde(default = "default_1314")] pub approval_generation: Option, } @@ -28693,9 +28991,9 @@ pub enum WorkerEnrollOutputStatus { #[non_exhaustive] pub struct WorkerEnrollOutput { pub status: WorkerEnrollOutputStatus, - #[serde(default = "default_1309")] + #[serde(default = "default_1315")] pub connection_id: Option, - #[serde(default = "default_1310")] + #[serde(default = "default_1316")] pub connection_generation: Option, } @@ -28784,19 +29082,19 @@ pub enum ReaderPolicy { #[non_exhaustive] pub struct WorkerPreviewOutput { pub status: WorkerPreviewOutputStatus, - #[serde(default = "default_1311")] + #[serde(default = "default_1317")] pub reader_policy: Option, - #[serde(default = "default_1312")] + #[serde(default = "default_1318")] pub stores_copy: Option, - #[serde(default = "default_1313")] + #[serde(default = "default_1319")] pub disclosure: Option, - #[serde(default = "default_1314")] + #[serde(default = "default_1320")] pub selected: Option, - #[serde(default = "default_1315")] + #[serde(default = "default_1321")] pub fingerprint: Option, - #[serde(default = "default_1316")] + #[serde(default = "default_1322")] pub evidence: Option, - #[serde(default = "default_1317")] + #[serde(default = "default_1323")] pub expires_at: Option, } @@ -28968,9 +29266,9 @@ pub struct WorkerProfileCursor { #[non_exhaustive] pub struct WorkerProfilesOutput { pub status: WorkerProfilesOutputStatus, - #[serde(default = "default_1318")] + #[serde(default = "default_1324")] pub profiles: Vec, - #[serde(default = "default_1319")] + #[serde(default = "default_1325")] pub next_page: Option, } @@ -29083,9 +29381,9 @@ pub enum WorkerRegisterOutputStatus { #[non_exhaustive] pub struct WorkerRegisterOutput { pub status: WorkerRegisterOutputStatus, - #[serde(default = "default_1320")] + #[serde(default = "default_1326")] pub source_id: Option, - #[serde(default = "default_1321")] + #[serde(default = "default_1327")] pub name: Option, } @@ -29202,9 +29500,9 @@ impl WorkerRegisterInput { pub struct CitedChunk { pub source_uri: String, pub chunk_idx: Integer, - #[serde(default = "default_1323")] + #[serde(default = "default_1329")] pub revision: Integer, - #[serde(default = "default_1324")] + #[serde(default = "default_1330")] pub locator: Option>, } @@ -29213,12 +29511,12 @@ pub struct CitedChunk { pub struct SynthesizeCalculation { pub columns: Vec, pub rows: Vec>, - #[serde(default = "default_1331")] + #[serde(default = "default_1337")] pub row_ids: Vec>, - #[serde(default = "default_1332")] + #[serde(default = "default_1338")] pub truncated: bool, pub complete: bool, - #[serde(default = "default_1333")] + #[serde(default = "default_1339")] pub incomplete: Vec, pub receipt: QueryReceipt, pub citation: String, @@ -29232,23 +29530,23 @@ pub struct KnowledgeSynthesizeOutput { pub chunks_read: Integer, pub documents: Integer, pub reduce_rounds: Integer, - #[serde(default = "default_1322")] + #[serde(default = "default_1328")] pub citations: Vec, - #[serde(default = "default_1325")] + #[serde(default = "default_1331")] pub cited_chunks: Vec, - #[serde(default = "default_1326")] + #[serde(default = "default_1332")] pub unsupported_citations: Vec, - #[serde(default = "default_1327")] + #[serde(default = "default_1333")] pub truncated: bool, - #[serde(default = "default_1328")] + #[serde(default = "default_1334")] pub abstain: bool, - #[serde(default = "default_1329")] + #[serde(default = "default_1335")] pub abstain_reason: String, - #[serde(default = "default_1330")] + #[serde(default = "default_1336")] pub clarification: String, - #[serde(default = "default_1334")] + #[serde(default = "default_1340")] pub calculations: Vec, - #[serde(default = "default_1335")] + #[serde(default = "default_1341")] pub model: String, } @@ -29364,13 +29662,13 @@ impl KnowledgeSynthesizeInput { #[non_exhaustive] pub struct KnowledgeUpdateMetadataOutput { pub updated: bool, - #[serde(default = "default_1336")] + #[serde(default = "default_1342")] pub title: String, - #[serde(default = "default_1337")] + #[serde(default = "default_1343")] pub description: String, - #[serde(default = "default_1338")] + #[serde(default = "default_1344")] pub tags: Vec, - #[serde(default = "default_1339")] + #[serde(default = "default_1345")] pub chunks_reindexed: Integer, } @@ -29482,13 +29780,13 @@ pub struct KnowledgeUpsertOutput { pub chunks_superseded: Integer, pub embedding_model: String, pub embedding_dim: Integer, - #[serde(default = "default_1340")] + #[serde(default = "default_1346")] pub duplicate_of_uri: String, - #[serde(default = "default_1341")] + #[serde(default = "default_1347")] pub duplicate_chunk_count: Integer, - #[serde(default = "default_1342")] + #[serde(default = "default_1348")] pub namespace: String, - #[serde(default = "default_1343")] + #[serde(default = "default_1349")] pub source_uri: String, } @@ -29673,26 +29971,26 @@ pub struct LearningEntry { pub memory_type: String, pub proposed_value: Value, pub supporter_count: Integer, - #[serde(default = "default_1344")] + #[serde(default = "default_1350")] pub supporter_sessions: Integer, - #[serde(default = "default_1345")] + #[serde(default = "default_1351")] pub supporter_writers: Integer, pub confidence_avg: f64, pub supporters: Vec, pub rationale: String, - #[serde(default = "default_1346")] + #[serde(default = "default_1352")] pub source_kind: String, - #[serde(default = "default_1347")] + #[serde(default = "default_1353")] pub source_resource_id: String, - #[serde(default = "default_1348")] + #[serde(default = "default_1354")] pub agent: String, pub status: LearningEntryStatus, pub proposed_at: String, - #[serde(default = "default_1349")] + #[serde(default = "default_1355")] pub decided_at: Option, - #[serde(default = "default_1350")] + #[serde(default = "default_1356")] pub decided_by: String, - #[serde(default = "default_1351")] + #[serde(default = "default_1357")] pub decision_reason: String, } @@ -29895,11 +30193,11 @@ pub enum LearningsReviewOutputNewStatus { pub struct LearningsReviewOutput { pub candidate_id: String, pub new_status: LearningsReviewOutputNewStatus, - #[serde(default = "default_1352")] + #[serde(default = "default_1358")] pub promoted_to_shared: bool, - #[serde(default = "default_1353")] + #[serde(default = "default_1359")] pub promoted_to_knowledge: bool, - #[serde(default = "default_1354")] + #[serde(default = "default_1360")] pub knowledge_source_uri: String, pub decided_at: String, } @@ -30103,7 +30401,7 @@ impl MemoryAgentsListInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct AggregateRow { - #[serde(default = "default_1355")] + #[serde(default = "default_1361")] pub group: std::collections::HashMap, pub metric: f64, } @@ -30111,9 +30409,9 @@ pub struct AggregateRow { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryAggregateOutput { - #[serde(default = "default_1356")] + #[serde(default = "default_1362")] pub rows: Vec, - #[serde(default = "default_1357")] + #[serde(default = "default_1363")] pub sql_executed: String, } @@ -30281,15 +30579,15 @@ impl MemoryAggregateInput { pub struct BulkSetResult { pub memory_key: String, pub version: Integer, - #[serde(default = "default_1358")] + #[serde(default = "default_1364")] pub memory_id: String, - #[serde(default = "default_1359")] + #[serde(default = "default_1365")] pub conflict_verdict: String, - #[serde(default = "default_1360")] + #[serde(default = "default_1366")] pub peers: Vec, - #[serde(default = "default_1361")] + #[serde(default = "default_1367")] pub next: String, - #[serde(default = "default_1362")] + #[serde(default = "default_1368")] pub pinned_blocker_id: String, } @@ -30297,29 +30595,29 @@ pub struct BulkSetResult { #[non_exhaustive] pub struct MemoryBulkSetOutput { pub written: Vec, - #[serde(default = "default_1363")] + #[serde(default = "default_1369")] pub skipped_pinned: Vec, - #[serde(default = "default_1364")] + #[serde(default = "default_1370")] pub skipped_locked: Vec, - #[serde(default = "default_1365")] + #[serde(default = "default_1371")] pub skipped_blacklisted: Vec, - #[serde(default = "default_1366")] + #[serde(default = "default_1372")] pub merged: Vec, - #[serde(default = "default_1367")] + #[serde(default = "default_1373")] pub value_updates_linked: Integer, - #[serde(default = "default_1368")] + #[serde(default = "default_1374")] pub rejected_pinned: Vec, - #[serde(default = "default_1369")] + #[serde(default = "default_1375")] pub duplicates: Vec, - #[serde(default = "default_1370")] + #[serde(default = "default_1376")] pub conflicted: Vec, - #[serde(default = "default_1371")] + #[serde(default = "default_1377")] pub unchecked: Integer, - #[serde(default = "default_1372")] + #[serde(default = "default_1378")] pub retyped: Vec, - #[serde(default = "default_1373")] + #[serde(default = "default_1379")] pub identity_duplicates: std::collections::HashMap, - #[serde(default = "default_1374")] + #[serde(default = "default_1380")] pub stage_ms: std::collections::HashMap, } @@ -30469,18 +30767,18 @@ pub enum ApplyRowStatus { #[non_exhaustive] pub struct ApplyRow { pub memory_key: String, - #[serde(default = "default_1382")] + #[serde(default = "default_1388")] pub memory_id: String, - #[serde(default = "default_1383")] + #[serde(default = "default_1389")] pub agent: String, - #[serde(default = "default_1384")] + #[serde(default = "default_1390")] pub user_id: String, - #[serde(default = "default_1385")] + #[serde(default = "default_1391")] pub session_id: String, pub status: ApplyRowStatus, - #[serde(default = "default_1386")] + #[serde(default = "default_1392")] pub version: Option, - #[serde(default = "default_1387")] + #[serde(default = "default_1393")] pub detail: String, } @@ -30490,21 +30788,21 @@ pub struct MemoryApplyOutput { pub action: String, pub dry_run: bool, pub target: String, - #[serde(default = "default_1375")] + #[serde(default = "default_1381")] pub matched: Integer, - #[serde(default = "default_1376")] + #[serde(default = "default_1382")] pub applied: Integer, - #[serde(default = "default_1377")] + #[serde(default = "default_1383")] pub would_apply: Integer, - #[serde(default = "default_1378")] + #[serde(default = "default_1384")] pub refused: Integer, - #[serde(default = "default_1379")] + #[serde(default = "default_1385")] pub noop: Integer, - #[serde(default = "default_1380")] + #[serde(default = "default_1386")] pub failed: Integer, - #[serde(default = "default_1381")] + #[serde(default = "default_1387")] pub truncated: bool, - #[serde(default = "default_1388")] + #[serde(default = "default_1394")] pub rows: Vec, } @@ -31238,137 +31536,137 @@ pub enum MemoryAskOutputDeepFirst { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryAskOutput { - #[serde(default = "default_1389")] + #[serde(default = "default_1395")] pub answer: String, - #[serde(default = "default_1390")] + #[serde(default = "default_1396")] pub source: MemoryAskOutputSource, - #[serde(default = "default_1391")] + #[serde(default = "default_1397")] pub abstain: bool, - #[serde(default = "default_1392")] + #[serde(default = "default_1398")] pub abstain_reason: String, - #[serde(default = "default_1393")] + #[serde(default = "default_1399")] pub memory_keys: Vec, - #[serde(default = "default_1394")] + #[serde(default = "default_1400")] pub results: Vec, - #[serde(default = "default_1395")] + #[serde(default = "default_1401")] pub cited_sessions: Vec, - #[serde(default = "default_1396")] + #[serde(default = "default_1402")] pub next: String, - #[serde(default = "default_1397")] + #[serde(default = "default_1403")] pub synth_model: String, - #[serde(default = "default_1398")] + #[serde(default = "default_1404")] pub route_tier: MemoryAskOutputRouteTier, - #[serde(default = "default_1399")] + #[serde(default = "default_1405")] pub route_reason: String, - #[serde(default = "default_1400")] + #[serde(default = "default_1406")] pub llm_cache_hits: Integer, - #[serde(default = "default_1401")] + #[serde(default = "default_1407")] pub llm_cache_misses: Integer, - #[serde(default = "default_1402")] + #[serde(default = "default_1408")] pub llm_cache: bool, - #[serde(default = "default_1403")] + #[serde(default = "default_1409")] pub llm_cache_saved_usd: f64, - #[serde(default = "default_1404")] + #[serde(default = "default_1410")] pub temporal_consistency: Option, - #[serde(default = "default_1405")] + #[serde(default = "default_1411")] pub citation_concentration: Option, - #[serde(default = "default_1406")] + #[serde(default = "default_1412")] pub escalated: bool, - #[serde(default = "default_1407")] + #[serde(default = "default_1413")] pub gate_mode: String, - #[serde(default = "default_1408")] + #[serde(default = "default_1414")] pub gate_kept: Integer, - #[serde(default = "default_1409")] + #[serde(default = "default_1415")] pub gate_dropped: Integer, - #[serde(default = "default_1410")] + #[serde(default = "default_1416")] pub pending_extraction: Integer, - #[serde(default = "default_1411")] + #[serde(default = "default_1417")] pub pending_evidence: Integer, - #[serde(default = "default_1412")] + #[serde(default = "default_1418")] pub retrieval_query: String, - #[serde(default = "default_1413")] + #[serde(default = "default_1419")] pub facets: Vec, - #[serde(default = "default_1414")] + #[serde(default = "default_1420")] pub facet_memories_added: Integer, - #[serde(default = "default_1415")] + #[serde(default = "default_1421")] pub consistency: MemoryAskOutputConsistency, - #[serde(default = "default_1416")] + #[serde(default = "default_1422")] pub consistency_score: f64, - #[serde(default = "default_1417")] + #[serde(default = "default_1423")] pub consistency_note: String, - #[serde(default = "default_1418")] + #[serde(default = "default_1424")] pub identifier_chase_hops: Integer, - #[serde(default = "default_1419")] + #[serde(default = "default_1425")] pub identifier_chase_added: Integer, - #[serde(default = "default_1420")] + #[serde(default = "default_1426")] pub premise_conflict: String, - #[serde(default = "default_1421")] + #[serde(default = "default_1427")] pub premise_note: String, - #[serde(default = "default_1422")] + #[serde(default = "default_1428")] pub premise_verdict: String, - #[serde(default = "default_1423")] + #[serde(default = "default_1429")] pub attribution_note: String, - #[serde(default = "default_1424")] + #[serde(default = "default_1430")] pub depth: MemoryAskOutputDepth, - #[serde(default = "default_1425")] + #[serde(default = "default_1431")] pub deep_fired: bool, - #[serde(default = "default_1426")] + #[serde(default = "default_1432")] pub decomposed: Vec, - #[serde(default = "default_1427")] + #[serde(default = "default_1433")] pub decomposed_parts: Integer, - #[serde(default = "default_1428")] + #[serde(default = "default_1434")] pub superseded_dropped: Integer, - #[serde(default = "default_1429")] + #[serde(default = "default_1435")] pub stale_sentences_masked: Integer, - #[serde(default = "default_1430")] + #[serde(default = "default_1436")] pub entity_followed: Vec, - #[serde(default = "default_1431")] + #[serde(default = "default_1437")] pub when_evidence_turns: Integer, - #[serde(default = "default_1432")] + #[serde(default = "default_1438")] pub decompose_failed: Integer, - #[serde(default = "default_1433")] + #[serde(default = "default_1439")] pub pool_k: Integer, - #[serde(default = "default_1434")] + #[serde(default = "default_1440")] pub grounding: MemoryAskOutputGrounding, - #[serde(default = "default_1435")] + #[serde(default = "default_1441")] pub deep_reason: String, - #[serde(default = "default_1436")] + #[serde(default = "default_1442")] pub deep_keys: Vec, - #[serde(default = "default_1437")] + #[serde(default = "default_1443")] pub deep_chars: Integer, - #[serde(default = "default_1438")] + #[serde(default = "default_1444")] pub code_hits: Integer, - #[serde(default = "default_1439")] + #[serde(default = "default_1445")] pub pool_facts: Integer, - #[serde(default = "default_1440")] + #[serde(default = "default_1446")] pub pool_chunks: Integer, - #[serde(default = "default_1441")] + #[serde(default = "default_1447")] pub prompt_blocks: std::collections::HashMap, - #[serde(default = "default_1442")] + #[serde(default = "default_1448")] pub deep_selector: MemoryAskOutputDeepSelector, - #[serde(default = "default_1443")] + #[serde(default = "default_1449")] pub deep_first: MemoryAskOutputDeepFirst, - #[serde(default = "default_1444")] + #[serde(default = "default_1450")] pub synth_calls: Integer, - #[serde(default = "default_1445")] + #[serde(default = "default_1451")] pub synth_input_tokens: Integer, - #[serde(default = "default_1446")] + #[serde(default = "default_1452")] pub synth_cached_input_tokens: Integer, - #[serde(default = "default_1447")] + #[serde(default = "default_1453")] pub synth_cache_write_tokens: Integer, - #[serde(default = "default_1448")] + #[serde(default = "default_1454")] pub synth_cost_usd: f64, - #[serde(default = "default_1449")] + #[serde(default = "default_1455")] pub context_tokens_est: Integer, - #[serde(default = "default_1450")] + #[serde(default = "default_1456")] pub context_trimmed: Integer, - #[serde(default = "default_1451")] + #[serde(default = "default_1457")] pub summary_hits: Integer, - #[serde(default = "default_1452")] + #[serde(default = "default_1458")] pub knowledge_hits: Integer, - #[serde(default = "default_1453")] + #[serde(default = "default_1459")] pub timeline_rows: Integer, - #[serde(default = "default_1454")] + #[serde(default = "default_1460")] pub count_recomputed: bool, } @@ -32323,36 +32621,36 @@ pub struct MemoryAutoRetirement { pub reason: String, pub memory_id: String, pub memory_key: String, - #[serde(default = "default_1455")] + #[serde(default = "default_1461")] pub agent: String, - #[serde(default = "default_1456")] + #[serde(default = "default_1462")] pub user_id: String, - #[serde(default = "default_1457")] + #[serde(default = "default_1463")] pub session_id: String, - #[serde(default = "default_1458")] + #[serde(default = "default_1464")] pub superseded_by: String, - #[serde(default = "default_1459")] + #[serde(default = "default_1465")] pub superseded_by_key: String, - #[serde(default = "default_1460")] + #[serde(default = "default_1466")] pub label: String, - #[serde(default = "default_1461")] + #[serde(default = "default_1467")] pub unconfirmed: bool, - #[serde(default = "default_1462")] + #[serde(default = "default_1468")] pub judge_verdict: String, - #[serde(default = "default_1463")] + #[serde(default = "default_1469")] pub judge_confidence: Option, - #[serde(default = "default_1464")] + #[serde(default = "default_1470")] pub judge_model: String, - #[serde(default = "default_1465")] + #[serde(default = "default_1471")] pub judge_prompt_version: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryAutoRetirementsOutput { - #[serde(default = "default_1466")] + #[serde(default = "default_1472")] pub rows: Vec, - #[serde(default = "default_1467")] + #[serde(default = "default_1473")] pub next_cursor: Option, } @@ -32446,9 +32744,9 @@ impl MemoryAutoRetirementsInput { #[non_exhaustive] pub struct BacklinkVersion { pub version: Integer, - #[serde(default = "default_1469")] + #[serde(default = "default_1475")] pub status: String, - #[serde(default = "default_1470")] + #[serde(default = "default_1476")] pub created_at: String, } @@ -32456,7 +32754,7 @@ pub struct BacklinkVersion { #[non_exhaustive] pub struct BacklinkDigest { pub session_id: String, - #[serde(default = "default_1472")] + #[serde(default = "default_1478")] pub date: String, } @@ -32464,9 +32762,9 @@ pub struct BacklinkDigest { #[non_exhaustive] pub struct BacklinkEdge { pub memory_key: String, - #[serde(default = "default_1474")] + #[serde(default = "default_1480")] pub relation: String, - #[serde(default = "default_1475")] + #[serde(default = "default_1481")] pub created_at: String, } @@ -32474,7 +32772,7 @@ pub struct BacklinkEdge { #[non_exhaustive] pub struct BacklinkRelated { pub memory_key: String, - #[serde(default = "default_1479")] + #[serde(default = "default_1485")] pub shared_entities: Vec, } @@ -32482,19 +32780,19 @@ pub struct BacklinkRelated { #[non_exhaustive] pub struct MemoryBacklinksOutput { pub memory_key: String, - #[serde(default = "default_1468")] + #[serde(default = "default_1474")] pub found: bool, - #[serde(default = "default_1471")] + #[serde(default = "default_1477")] pub versions: Vec, - #[serde(default = "default_1473")] + #[serde(default = "default_1479")] pub digests: Vec, - #[serde(default = "default_1476")] + #[serde(default = "default_1482")] pub links_in: Vec, - #[serde(default = "default_1477")] + #[serde(default = "default_1483")] pub links_out: Vec, - #[serde(default = "default_1478")] + #[serde(default = "default_1484")] pub evidence_count: Integer, - #[serde(default = "default_1480")] + #[serde(default = "default_1486")] pub related: Vec, } @@ -32599,36 +32897,36 @@ impl MemoryBacklinksInput { #[non_exhaustive] pub struct BriefEvidence { pub memory_key: String, - #[serde(default = "default_1485")] + #[serde(default = "default_1491")] pub source: String, - #[serde(default = "default_1486")] + #[serde(default = "default_1492")] pub source_class: String, - #[serde(default = "default_1487")] + #[serde(default = "default_1493")] pub verified: bool, - #[serde(default = "default_1488")] + #[serde(default = "default_1494")] pub when: String, - #[serde(default = "default_1489")] + #[serde(default = "default_1495")] pub session_id: String, - #[serde(default = "default_1490")] + #[serde(default = "default_1496")] pub excerpt: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryBriefOutput { - #[serde(default = "default_1481")] + #[serde(default = "default_1487")] pub query: String, - #[serde(default = "default_1482")] + #[serde(default = "default_1488")] pub answer: String, - #[serde(default = "default_1483")] + #[serde(default = "default_1489")] pub abstained: bool, - #[serde(default = "default_1484")] + #[serde(default = "default_1490")] pub grounding: String, - #[serde(default = "default_1491")] + #[serde(default = "default_1497")] pub evidence: Vec, - #[serde(default = "default_1492")] + #[serde(default = "default_1498")] pub unknowns: Vec, - #[serde(default = "default_1493")] + #[serde(default = "default_1499")] pub next_reads: Vec, } @@ -33042,9 +33340,9 @@ pub struct MemoryBulkGetOutputMemoryGetOutput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryBulkGetOutput { - #[serde(default = "default_1494")] + #[serde(default = "default_1500")] pub results: std::collections::HashMap, - #[serde(default = "default_1495")] + #[serde(default = "default_1501")] pub missing: Vec, } @@ -33557,7 +33855,7 @@ pub struct MemoryClearOutput { pub cleared_at: String, pub rows_affected: std::collections::HashMap, pub total: Integer, - #[serde(default = "default_1496")] + #[serde(default = "default_1502")] pub locked_skipped: Integer, } @@ -33645,21 +33943,21 @@ pub struct MemoryConsolidateResult { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryConsolidateOutput { - #[serde(default = "default_1497")] + #[serde(default = "default_1503")] pub consolidated: Vec, - #[serde(default = "default_1498")] + #[serde(default = "default_1504")] pub examined: Integer, - #[serde(default = "default_1499")] + #[serde(default = "default_1505")] pub clusters_found: Integer, - #[serde(default = "default_1500")] + #[serde(default = "default_1506")] pub clusters_failed: Integer, - #[serde(default = "default_1501")] + #[serde(default = "default_1507")] pub clusters_refused_lossy: Integer, - #[serde(default = "default_1502")] + #[serde(default = "default_1508")] pub skipped_in_flight: Integer, - #[serde(default = "default_1503")] + #[serde(default = "default_1509")] pub tokens_in: Integer, - #[serde(default = "default_1504")] + #[serde(default = "default_1510")] pub tokens_out: Integer, } @@ -33800,7 +34098,7 @@ impl MemoryConsolidateInput { #[non_exhaustive] pub struct MemoryCopyToOutput { pub copied: bool, - #[serde(default = "default_1505")] + #[serde(default = "default_1511")] pub target_memory_id: String, pub target_namespace: String, pub target_key: String, @@ -33911,11 +34209,11 @@ impl MemoryCopyToInput { #[non_exhaustive] pub struct MemoryCrossPromoteOutput { pub promoted: bool, - #[serde(default = "default_1506")] + #[serde(default = "default_1512")] pub target_memory_id: String, pub target_namespace: String, pub target_key: String, - #[serde(default = "default_1507")] + #[serde(default = "default_1513")] pub cross_promoted_from_memory_id: String, } @@ -33998,23 +34296,23 @@ pub struct DedupCollapsePair { #[non_exhaustive] pub struct MemoryDedupCollapseOutput { pub namespace: String, - #[serde(default = "default_1508")] + #[serde(default = "default_1514")] pub prefix: String, - #[serde(default = "default_1509")] + #[serde(default = "default_1515")] pub dry_run: bool, - #[serde(default = "default_1510")] + #[serde(default = "default_1516")] pub pairs: Integer, - #[serde(default = "default_1511")] + #[serde(default = "default_1517")] pub canonical_live: Integer, - #[serde(default = "default_1512")] + #[serde(default = "default_1518")] pub orphans: Integer, - #[serde(default = "default_1513")] + #[serde(default = "default_1519")] pub mirror_stale: Integer, - #[serde(default = "default_1514")] + #[serde(default = "default_1520")] pub restamped: Integer, - #[serde(default = "default_1515")] + #[serde(default = "default_1521")] pub truncated: bool, - #[serde(default = "default_1516")] + #[serde(default = "default_1522")] pub sample: Vec, } @@ -34113,7 +34411,7 @@ pub struct DedupDuplicate { pub memory_id: String, pub memory_key: String, pub agent: String, - #[serde(default = "default_1519")] + #[serde(default = "default_1525")] pub created_at: Option, } @@ -34121,12 +34419,12 @@ pub struct DedupDuplicate { #[non_exhaustive] pub struct DedupCluster { pub canonical_id: String, - #[serde(default = "default_1517")] + #[serde(default = "default_1523")] pub canonical_key: String, - #[serde(default = "default_1518")] + #[serde(default = "default_1524")] pub canonical_agent: String, pub dup_count: Integer, - #[serde(default = "default_1520")] + #[serde(default = "default_1526")] pub duplicates: Vec, } @@ -34198,11 +34496,11 @@ pub struct MemoryDedupResolveOutput { pub canonical_key: String, pub duplicate_key: String, pub decision: String, - #[serde(default = "default_1521")] + #[serde(default = "default_1527")] pub canonical_tombstoned: bool, - #[serde(default = "default_1522")] + #[serde(default = "default_1528")] pub duplicate_tombstoned: bool, - #[serde(default = "default_1523")] + #[serde(default = "default_1529")] pub ignored_args: Vec, } @@ -34340,17 +34638,17 @@ pub struct LostName { pub struct DefinitionEntry { pub memory_key: String, pub promoted_at: String, - #[serde(default = "default_1524")] + #[serde(default = "default_1530")] pub capped: bool, - #[serde(default = "default_1525")] + #[serde(default = "default_1531")] pub term: Option, - #[serde(default = "default_1526")] + #[serde(default = "default_1532")] pub aliases: Vec, - #[serde(default = "default_1527")] + #[serde(default = "default_1533")] pub verdict: Option, - #[serde(default = "default_1528")] + #[serde(default = "default_1534")] pub lapse_reason: Option, - #[serde(default = "default_1529")] + #[serde(default = "default_1535")] pub lost: Vec, } @@ -34411,15 +34709,15 @@ impl MemoryDefinitionsListInput { #[non_exhaustive] pub struct MemoryDeleteVersionOutput { pub tombstoned: bool, - #[serde(default = "default_1530")] + #[serde(default = "default_1536")] pub version: Integer, - #[serde(default = "default_1531")] + #[serde(default = "default_1537")] pub found: bool, - #[serde(default = "default_1532")] + #[serde(default = "default_1538")] pub reason: String, - #[serde(default = "default_1533")] + #[serde(default = "default_1539")] pub dependents_tombstoned: Integer, - #[serde(default = "default_1534")] + #[serde(default = "default_1540")] pub dependents_downgraded: Integer, } @@ -34546,21 +34844,21 @@ pub struct DemonstrationRow { pub struct MemoryDemonstrateOutput { pub query: String, pub demonstrations: Vec, - #[serde(default = "default_1535")] + #[serde(default = "default_1541")] pub votes: std::collections::HashMap, - #[serde(default = "default_1536")] + #[serde(default = "default_1542")] pub predicted_label: String, - #[serde(default = "default_1537")] + #[serde(default = "default_1543")] pub margin: f64, - #[serde(default = "default_1538")] + #[serde(default = "default_1544")] pub abstain: bool, - #[serde(default = "default_1539")] + #[serde(default = "default_1545")] pub abstain_reason: String, - #[serde(default = "default_1540")] + #[serde(default = "default_1546")] pub few_shot_block: String, - #[serde(default = "default_1541")] + #[serde(default = "default_1547")] pub examined: Integer, - #[serde(default = "default_1542")] + #[serde(default = "default_1548")] pub labelled: Integer, } @@ -34700,7 +34998,7 @@ impl MemoryDemonstrateInput { pub struct MemoryDemoteOutput { pub demoted: bool, pub was_reversible: bool, - #[serde(default = "default_1543")] + #[serde(default = "default_1549")] pub tombstoned_at: Option, } @@ -34762,15 +35060,15 @@ impl MemoryDemoteInput { pub struct DigestRow { pub session_id: String, pub summary_text: String, - #[serde(default = "default_1544")] + #[serde(default = "default_1550")] pub key_facts: Vec, - #[serde(default = "default_1545")] + #[serde(default = "default_1551")] pub derived_from: Vec, - #[serde(default = "default_1546")] + #[serde(default = "default_1552")] pub valid_at: Option, - #[serde(default = "default_1547")] + #[serde(default = "default_1553")] pub created_at: Option, - #[serde(default = "default_1548")] + #[serde(default = "default_1554")] pub version: Integer, } @@ -34778,7 +35076,7 @@ pub struct DigestRow { #[non_exhaustive] pub struct MemoryDigestsOutput { pub rows: Vec, - #[serde(default = "default_1549")] + #[serde(default = "default_1555")] pub truncated: bool, } @@ -34903,17 +35201,17 @@ pub struct MemoryEvidenceItem { pub evidence_id: String, pub support_type: String, pub scope: MemoryEvidenceItemScope, - #[serde(default = "default_1553")] + #[serde(default = "default_1559")] pub role: String, - #[serde(default = "default_1554")] + #[serde(default = "default_1560")] pub observed_at: Option, - #[serde(default = "default_1555")] + #[serde(default = "default_1561")] pub content: String, - #[serde(default = "default_1556")] + #[serde(default = "default_1562")] pub char_start: Integer, - #[serde(default = "default_1557")] + #[serde(default = "default_1563")] pub char_end: Integer, - #[serde(default = "default_1558")] + #[serde(default = "default_1564")] pub span: String, } @@ -34921,23 +35219,23 @@ pub struct MemoryEvidenceItem { #[non_exhaustive] pub struct MemoryEvidenceOutput { pub found: bool, - #[serde(default = "default_1550")] + #[serde(default = "default_1556")] pub memory_key: String, - #[serde(default = "default_1551")] + #[serde(default = "default_1557")] pub memory_id: String, - #[serde(default = "default_1552")] + #[serde(default = "default_1558")] pub value: String, - #[serde(default = "default_1559")] + #[serde(default = "default_1565")] pub items: Vec, - #[serde(default = "default_1560")] + #[serde(default = "default_1566")] pub truncated: bool, - #[serde(default = "default_1561")] + #[serde(default = "default_1567")] pub cited: Integer, - #[serde(default = "default_1562")] + #[serde(default = "default_1568")] pub lexical: Integer, - #[serde(default = "default_1563")] + #[serde(default = "default_1569")] pub window: Integer, - #[serde(default = "default_1564")] + #[serde(default = "default_1570")] pub derived: Integer, } @@ -35042,26 +35340,26 @@ impl MemoryEvidenceInput { #[non_exhaustive] pub struct EvidenceChunk { pub session_id: String, - #[serde(default = "default_1565")] + #[serde(default = "default_1571")] pub chunk_index: Integer, pub content: String, - #[serde(default = "default_1566")] + #[serde(default = "default_1572")] pub content_sha256: String, - #[serde(default = "default_1567")] + #[serde(default = "default_1573")] pub agent: String, - #[serde(default = "default_1568")] + #[serde(default = "default_1574")] pub user_id: String, - #[serde(default = "default_1569")] + #[serde(default = "default_1575")] pub parent_memory_key: String, - #[serde(default = "default_1570")] + #[serde(default = "default_1576")] pub memory_keys: Vec, - #[serde(default = "default_1571")] + #[serde(default = "default_1577")] pub line_start: Integer, - #[serde(default = "default_1572")] + #[serde(default = "default_1578")] pub line_end: Integer, - #[serde(default = "default_1573")] + #[serde(default = "default_1579")] pub created_at: String, - #[serde(default = "default_1574")] + #[serde(default = "default_1580")] pub source_url: String, } @@ -35070,17 +35368,17 @@ pub struct EvidenceChunk { pub struct EvidenceDigest { pub session_id: String, pub summary_text: String, - #[serde(default = "default_1576")] + #[serde(default = "default_1582")] pub agent: String, - #[serde(default = "default_1577")] + #[serde(default = "default_1583")] pub user_id: String, - #[serde(default = "default_1578")] + #[serde(default = "default_1584")] pub key_facts: Vec, - #[serde(default = "default_1579")] + #[serde(default = "default_1585")] pub derived_from: Vec, - #[serde(default = "default_1580")] + #[serde(default = "default_1586")] pub valid_at: String, - #[serde(default = "default_1581")] + #[serde(default = "default_1587")] pub created_at: String, } @@ -35090,28 +35388,28 @@ pub struct EvidenceEdge { pub from_key: String, pub to_key: String, pub relation: String, - #[serde(default = "default_1583")] + #[serde(default = "default_1589")] pub confidence: f64, - #[serde(default = "default_1584")] + #[serde(default = "default_1590")] pub explanation: String, - #[serde(default = "default_1585")] + #[serde(default = "default_1591")] pub created_at: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryExportEvidenceOutput { - #[serde(default = "default_1575")] + #[serde(default = "default_1581")] pub chunks: Vec, - #[serde(default = "default_1582")] + #[serde(default = "default_1588")] pub digests: Vec, - #[serde(default = "default_1586")] + #[serde(default = "default_1592")] pub edges: Vec, - #[serde(default = "default_1587")] + #[serde(default = "default_1593")] pub has_more: bool, - #[serde(default = "default_1588")] + #[serde(default = "default_1594")] pub next_cursor: String, - #[serde(default = "default_1589")] + #[serde(default = "default_1595")] pub held_high: Integer, } @@ -35304,15 +35602,15 @@ impl ExposureSummaryInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryExtractionRetryMineOutput { - #[serde(default = "default_1590")] + #[serde(default = "default_1596")] pub requeued: Vec, - #[serde(default = "default_1591")] + #[serde(default = "default_1597")] pub not_failed: Vec, - #[serde(default = "default_1592")] + #[serde(default = "default_1598")] pub model_calls_off: Vec, - #[serde(default = "default_1593")] + #[serde(default = "default_1599")] pub expired: Vec, - #[serde(default = "default_1594")] + #[serde(default = "default_1600")] pub unknown: Vec, } @@ -35373,20 +35671,20 @@ pub struct ExtractionQueueRow { pub content_chars: Integer, pub written: Integer, pub last_error: String, - #[serde(default = "default_1595")] + #[serde(default = "default_1601")] pub enqueued_at: Option, - #[serde(default = "default_1596")] + #[serde(default = "default_1602")] pub updated_at: Option, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryExtractionStatusOutput { - #[serde(default = "default_1597")] + #[serde(default = "default_1603")] pub batches: Vec, - #[serde(default = "default_1598")] + #[serde(default = "default_1604")] pub pending: Integer, - #[serde(default = "default_1599")] + #[serde(default = "default_1605")] pub failed: Integer, } @@ -35534,13 +35832,13 @@ impl MemoryExtractionStatusInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryExtractionStatusMineOutput { - #[serde(default = "default_1600")] + #[serde(default = "default_1606")] pub batches: Vec, - #[serde(default = "default_1601")] + #[serde(default = "default_1607")] pub unknown: Vec, - #[serde(default = "default_1602")] + #[serde(default = "default_1608")] pub pending: Integer, - #[serde(default = "default_1603")] + #[serde(default = "default_1609")] pub failed: Integer, } @@ -35661,39 +35959,39 @@ pub struct MemoryForFileHit { pub memory_key: String, pub memory_type: String, pub value: String, - #[serde(default = "default_1604")] + #[serde(default = "default_1610")] pub value_truncated: bool, - #[serde(default = "default_1605")] + #[serde(default = "default_1611")] pub tags: Vec, - #[serde(default = "default_1606")] + #[serde(default = "default_1612")] pub confidence: f64, - #[serde(default = "default_1607")] + #[serde(default = "default_1613")] pub pinned: bool, - #[serde(default = "default_1608")] + #[serde(default = "default_1614")] pub status: String, - #[serde(default = "default_1609")] + #[serde(default = "default_1615")] pub agent: String, - #[serde(default = "default_1610")] + #[serde(default = "default_1616")] pub updated_at: Option, - #[serde(default = "default_1611")] + #[serde(default = "default_1617")] pub namespace: String, - #[serde(default = "default_1612")] + #[serde(default = "default_1618")] pub actor: String, - #[serde(default = "default_1613")] + #[serde(default = "default_1619")] pub supersedes_key: String, - #[serde(default = "default_1614")] + #[serde(default = "default_1620")] pub supersedes: String, - #[serde(default = "default_1615")] + #[serde(default = "default_1621")] pub supersedes_kind: MemoryForFileHitSupersedesKind, - #[serde(default = "default_1616")] + #[serde(default = "default_1622")] pub matched_files: Vec, - #[serde(default = "default_1617")] + #[serde(default = "default_1623")] pub source_resource_id: String, - #[serde(default = "default_1618")] + #[serde(default = "default_1624")] pub verification: MemoryForFileHitVerification, - #[serde(default = "default_1619")] + #[serde(default = "default_1625")] pub code_state: MemoryForFileHitCodeState, - #[serde(default = "default_1620")] + #[serde(default = "default_1626")] pub code_moved: Vec, } @@ -35703,7 +36001,7 @@ pub struct MemoryForFilePrintedRow { pub namespace: String, pub memory_key: String, pub line: String, - #[serde(default = "default_1624")] + #[serde(default = "default_1630")] pub binding: bool, } @@ -35713,13 +36011,13 @@ pub struct MemoryForFileOutput { pub path: String, pub total: Integer, pub hits: Vec, - #[serde(default = "default_1621")] + #[serde(default = "default_1627")] pub rendered: String, - #[serde(default = "default_1622")] + #[serde(default = "default_1628")] pub tokens_estimate: Integer, - #[serde(default = "default_1623")] + #[serde(default = "default_1629")] pub truncated: bool, - #[serde(default = "default_1625")] + #[serde(default = "default_1631")] pub printed: Vec, } @@ -35827,61 +36125,61 @@ impl MemoryForFileInput { #[non_exhaustive] pub struct MemoryGetByIdOutput { pub found: bool, - #[serde(default = "default_1626")] + #[serde(default = "default_1632")] pub memory_id: String, - #[serde(default = "default_1627")] + #[serde(default = "default_1633")] pub namespace: String, - #[serde(default = "default_1628")] + #[serde(default = "default_1634")] pub agent: String, - #[serde(default = "default_1629")] + #[serde(default = "default_1635")] pub user_id: String, - #[serde(default = "default_1630")] + #[serde(default = "default_1636")] pub session_id: String, - #[serde(default = "default_1631")] + #[serde(default = "default_1637")] pub memory_key: String, - #[serde(default = "default_1632")] + #[serde(default = "default_1638")] pub memory_type: Option, - #[serde(default = "default_1633")] + #[serde(default = "default_1639")] pub value: Value, - #[serde(default = "default_1634")] + #[serde(default = "default_1640")] pub confidence: Option, - #[serde(default = "default_1635")] + #[serde(default = "default_1641")] pub version: Option, - #[serde(default = "default_1636")] + #[serde(default = "default_1642")] pub created_at: Option, - #[serde(default = "default_1637")] + #[serde(default = "default_1643")] pub expires_at: Option, - #[serde(default = "default_1638")] + #[serde(default = "default_1644")] pub valid_at: Option, - #[serde(default = "default_1639")] + #[serde(default = "default_1645")] pub valid_to: Option, - #[serde(default = "default_1640")] + #[serde(default = "default_1646")] pub pinned: bool, - #[serde(default = "default_1641")] + #[serde(default = "default_1647")] pub content_sha256: String, - #[serde(default = "default_1642")] + #[serde(default = "default_1648")] pub verified_by: String, - #[serde(default = "default_1643")] + #[serde(default = "default_1649")] pub verified_at: Option, - #[serde(default = "default_1644")] + #[serde(default = "default_1650")] pub verification: String, - #[serde(default = "default_1645")] + #[serde(default = "default_1651")] pub sensitivity: String, - #[serde(default = "default_1646")] + #[serde(default = "default_1652")] pub actor: String, - #[serde(default = "default_1647")] + #[serde(default = "default_1653")] pub source_class: String, - #[serde(default = "default_1648")] + #[serde(default = "default_1654")] pub lock_mode: String, - #[serde(default = "default_1649")] + #[serde(default = "default_1655")] pub lock_reason: String, - #[serde(default = "default_1650")] + #[serde(default = "default_1656")] pub lock_until: Option, - #[serde(default = "default_1651")] + #[serde(default = "default_1657")] pub locked_by: String, - #[serde(default = "default_1652")] + #[serde(default = "default_1658")] pub on_expire: String, - #[serde(default = "default_1653")] + #[serde(default = "default_1659")] pub expire_reason: String, } @@ -35957,41 +36255,41 @@ pub struct MemoryHealthTopRow { pub memory_type: String, pub recall_count: Integer, pub used_count: Integer, - #[serde(default = "default_1656")] + #[serde(default = "default_1662")] pub harm_count: Integer, - #[serde(default = "default_1657")] + #[serde(default = "default_1663")] pub last_recalled_at: Option, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryHealthStaleness { - #[serde(default = "default_1659")] + #[serde(default = "default_1665")] pub by_age: std::collections::HashMap, - #[serde(default = "default_1660")] + #[serde(default = "default_1666")] pub with_validity_end: Integer, - #[serde(default = "default_1661")] + #[serde(default = "default_1667")] pub with_validity_end_share: f64, - #[serde(default = "default_1662")] + #[serde(default = "default_1668")] pub with_expiry: Integer, - #[serde(default = "default_1663")] + #[serde(default = "default_1669")] pub expiring_7d: Integer, - #[serde(default = "default_1664")] + #[serde(default = "default_1670")] pub pinned: Integer, - #[serde(default = "default_1665")] + #[serde(default = "default_1671")] pub days_since_reinforced_p50: Integer, - #[serde(default = "default_1666")] + #[serde(default = "default_1672")] pub days_since_reinforced_p90: Integer, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryHealthFootprint { - #[serde(default = "default_1668")] + #[serde(default = "default_1674")] pub value_chars: Integer, - #[serde(default = "default_1669")] + #[serde(default = "default_1675")] pub value_tokens_est: Integer, - #[serde(default = "default_1670")] + #[serde(default = "default_1676")] pub tokens_per_row_est: f64, } @@ -36001,19 +36299,19 @@ pub struct MemoryHealthOutput { pub live: Integer, pub recalled_ever: Integer, pub used_ever: Integer, - #[serde(default = "default_1654")] + #[serde(default = "default_1660")] pub harmed_ever: Integer, pub silent: Integer, pub silent_older: Integer, pub silent_share: f64, pub silent_after_days: Integer, - #[serde(default = "default_1655")] + #[serde(default = "default_1661")] pub by_type: Vec, - #[serde(default = "default_1658")] + #[serde(default = "default_1664")] pub top_recalled: Vec, - #[serde(default = "default_1667")] + #[serde(default = "default_1673")] pub staleness: MemoryHealthStaleness, - #[serde(default = "default_1671")] + #[serde(default = "default_1677")] pub footprint: MemoryHealthFootprint, } @@ -36133,51 +36431,51 @@ impl MemoryHealthInput { pub struct MemoryHistoryRow { pub memory_id: String, pub version: Integer, - #[serde(default = "default_1672")] + #[serde(default = "default_1678")] pub version_text: String, - #[serde(default = "default_1673")] + #[serde(default = "default_1679")] pub value: Value, pub confidence: f64, - #[serde(default = "default_1674")] + #[serde(default = "default_1680")] pub source_trace: String, - #[serde(default = "default_1675")] + #[serde(default = "default_1681")] pub pinned: bool, pub created_at: String, - #[serde(default = "default_1676")] + #[serde(default = "default_1682")] pub expires_at: Option, - #[serde(default = "default_1677")] + #[serde(default = "default_1683")] pub tombstoned_at: Option, - #[serde(default = "default_1678")] + #[serde(default = "default_1684")] pub redacted_at: Option, - #[serde(default = "default_1679")] + #[serde(default = "default_1685")] pub redaction_reason: String, - #[serde(default = "default_1680")] + #[serde(default = "default_1686")] pub content_sha256: String, - #[serde(default = "default_1681")] + #[serde(default = "default_1687")] pub actor: String, - #[serde(default = "default_1682")] + #[serde(default = "default_1688")] pub source_class: String, - #[serde(default = "default_1683")] + #[serde(default = "default_1689")] pub agent: String, - #[serde(default = "default_1684")] + #[serde(default = "default_1690")] pub written_at: Option, - #[serde(default = "default_1685")] + #[serde(default = "default_1691")] pub status: String, - #[serde(default = "default_1686")] + #[serde(default = "default_1692")] pub conflict_with: Vec, - #[serde(default = "default_1687")] + #[serde(default = "default_1693")] pub tags: Vec, - #[serde(default = "default_1688")] + #[serde(default = "default_1694")] pub verified_at: Option, - #[serde(default = "default_1689")] + #[serde(default = "default_1695")] pub verified_by: String, - #[serde(default = "default_1690")] + #[serde(default = "default_1696")] pub verified_sha256: String, - #[serde(default = "default_1691")] + #[serde(default = "default_1697")] pub lock_mode: String, - #[serde(default = "default_1692")] + #[serde(default = "default_1698")] pub lock_reason: String, - #[serde(default = "default_1693")] + #[serde(default = "default_1699")] pub lock_until: Option, } @@ -36287,13 +36585,13 @@ impl MemoryHistoryInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryImportTotals { - #[serde(default = "default_1694")] + #[serde(default = "default_1700")] pub written: Integer, - #[serde(default = "default_1695")] + #[serde(default = "default_1701")] pub held: Integer, - #[serde(default = "default_1696")] + #[serde(default = "default_1702")] pub skipped: Integer, - #[serde(default = "default_1697")] + #[serde(default = "default_1703")] pub refused: Integer, } @@ -36376,11 +36674,11 @@ pub struct MemoryImportResult { pub index: Integer, pub key: String, pub outcome: MemoryImportResultOutcome, - #[serde(default = "default_1698")] + #[serde(default = "default_1704")] pub reason: MemoryImportResultReason, - #[serde(default = "default_1699")] + #[serde(default = "default_1705")] pub held_by: String, - #[serde(default = "default_1700")] + #[serde(default = "default_1706")] pub note: MemoryImportResultNote, } @@ -36389,7 +36687,7 @@ pub struct MemoryImportResult { pub struct MemoryImportOutput { pub totals: MemoryImportTotals, pub results: Vec, - #[serde(default = "default_1701")] + #[serde(default = "default_1707")] pub dry_run: bool, } @@ -36582,9 +36880,9 @@ pub struct MemoryImportCuratedRow { pub section_heading: String, pub bytes_written: Integer, pub verdict: String, - #[serde(default = "default_1702")] + #[serde(default = "default_1708")] pub rejection_reason: String, - #[serde(default = "default_1703")] + #[serde(default = "default_1709")] pub pinned_blocker_id: Option, } @@ -36676,21 +36974,21 @@ impl MemoryImportCuratedInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryImportEvidenceOutput { - #[serde(default = "default_1704")] + #[serde(default = "default_1710")] pub chunks_written: Integer, - #[serde(default = "default_1705")] + #[serde(default = "default_1711")] pub links_written: Integer, - #[serde(default = "default_1706")] + #[serde(default = "default_1712")] pub digests_written: Integer, - #[serde(default = "default_1707")] + #[serde(default = "default_1713")] pub embedding_model: String, - #[serde(default = "default_1708")] + #[serde(default = "default_1714")] pub embedding_dim: Integer, - #[serde(default = "default_1709")] + #[serde(default = "default_1715")] pub edited: Vec, - #[serde(default = "default_1710")] + #[serde(default = "default_1716")] pub skipped: Integer, - #[serde(default = "default_1711")] + #[serde(default = "default_1717")] pub unchecked: Integer, } @@ -37027,7 +37325,7 @@ pub struct InspectRow { pub memory_key: String, pub memory_id: String, pub version: Integer, - #[serde(default = "default_1721")] + #[serde(default = "default_1727")] pub content_sha256: String, pub memory_type: String, pub status: String, @@ -37038,9 +37336,9 @@ pub struct InspectRow { pub actor: String, pub updated_at: String, pub sensitivity: String, - #[serde(default = "default_1722")] + #[serde(default = "default_1728")] pub versions: Integer, - #[serde(default = "default_1723")] + #[serde(default = "default_1729")] pub excerpt: String, } @@ -37048,27 +37346,27 @@ pub struct InspectRow { #[non_exhaustive] pub struct InspectView { pub definition: String, - #[serde(default = "default_1712")] + #[serde(default = "default_1718")] pub refs: Vec, - #[serde(default = "default_1713")] + #[serde(default = "default_1719")] pub live_rows: Integer, - #[serde(default = "default_1714")] + #[serde(default = "default_1720")] pub by_type: Vec, - #[serde(default = "default_1715")] + #[serde(default = "default_1721")] pub by_status: Vec, - #[serde(default = "default_1716")] + #[serde(default = "default_1722")] pub by_source_class: Vec, - #[serde(default = "default_1717")] + #[serde(default = "default_1723")] pub top_tags: Vec, - #[serde(default = "default_1718")] + #[serde(default = "default_1724")] pub categories: Vec, - #[serde(default = "default_1719")] + #[serde(default = "default_1725")] pub first_updated_at: Option, - #[serde(default = "default_1720")] + #[serde(default = "default_1726")] pub last_updated_at: Option, - #[serde(default = "default_1724")] + #[serde(default = "default_1730")] pub newest: Vec, - #[serde(default = "default_1725")] + #[serde(default = "default_1731")] pub complete: bool, } @@ -37084,32 +37382,32 @@ pub struct InspectCall { #[non_exhaustive] pub struct InspectActivity { pub window_seconds: Integer, - #[serde(default = "default_1726")] + #[serde(default = "default_1732")] pub calls: Vec, - #[serde(default = "default_1727")] + #[serde(default = "default_1733")] pub first_at: Option, - #[serde(default = "default_1728")] + #[serde(default = "default_1734")] pub last_at: Option, - #[serde(default = "default_1729")] + #[serde(default = "default_1735")] pub gap: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct InspectSettings { - #[serde(default = "default_1730")] + #[serde(default = "default_1736")] pub guide_revision: Integer, - #[serde(default = "default_1731")] + #[serde(default = "default_1737")] pub guide_summary: String, - #[serde(default = "default_1732")] + #[serde(default = "default_1738")] pub categories_registered: Integer, - #[serde(default = "default_1733")] + #[serde(default = "default_1739")] pub extraction_policy: Option, - #[serde(default = "default_1734")] + #[serde(default = "default_1740")] pub extraction_policy_unavailable: String, - #[serde(default = "default_1735")] + #[serde(default = "default_1741")] pub extraction_instructions: String, - #[serde(default = "default_1736")] + #[serde(default = "default_1742")] pub extraction_instructions_refs: Vec, } @@ -37125,7 +37423,7 @@ pub struct MemoryInspectOutput { pub others: InspectView, pub activity: InspectActivity, pub settings: InspectSettings, - #[serde(default = "default_1737")] + #[serde(default = "default_1743")] pub skipped: Vec, } @@ -37219,7 +37517,7 @@ pub struct MemoryKeyRef { #[non_exhaustive] pub struct MemoryKeysOutput { pub keys: Vec, - #[serde(default = "default_1738")] + #[serde(default = "default_1744")] pub truncated: bool, } @@ -37322,9 +37620,9 @@ pub struct LineageCandidate { pub decided_at: String, pub decided_by: String, pub match_confidence: LineageCandidateMatchConfidence, - #[serde(default = "default_1747")] + #[serde(default = "default_1753")] pub seeded_from_thread_id: String, - #[serde(default = "default_1748")] + #[serde(default = "default_1754")] pub seeded_from_msg_id: String, } @@ -37342,25 +37640,25 @@ pub struct LineageAuditEvent { pub struct MemoryLineageOutput { pub found: bool, pub memory_key: String, - #[serde(default = "default_1739")] + #[serde(default = "default_1745")] pub promotion_event: String, - #[serde(default = "default_1740")] + #[serde(default = "default_1746")] pub promoted_by: String, - #[serde(default = "default_1741")] + #[serde(default = "default_1747")] pub promoted_at: Option, - #[serde(default = "default_1742")] + #[serde(default = "default_1748")] pub rationale: String, - #[serde(default = "default_1743")] + #[serde(default = "default_1749")] pub source_trace: String, - #[serde(default = "default_1744")] + #[serde(default = "default_1750")] pub source_resource_id: String, - #[serde(default = "default_1745")] + #[serde(default = "default_1751")] pub mechanism: MemoryLineageOutputMechanism, - #[serde(default = "default_1746")] + #[serde(default = "default_1752")] pub supporters: Vec, - #[serde(default = "default_1749")] + #[serde(default = "default_1755")] pub candidate: Option, - #[serde(default = "default_1750")] + #[serde(default = "default_1756")] pub audit_chain: Vec, } @@ -37489,11 +37787,11 @@ pub struct MemoryLinkOutput { pub from_key: String, pub to_key: String, pub relation: String, - #[serde(default = "default_1751")] + #[serde(default = "default_1757")] pub confidence: f64, - #[serde(default = "default_1752")] + #[serde(default = "default_1758")] pub conflict_opened: bool, - #[serde(default = "default_1753")] + #[serde(default = "default_1759")] pub relation_defaulted: bool, } @@ -37807,17 +38105,17 @@ pub struct MemoryListEntry { pub struct MemoryListOutput { pub entries: Vec, pub truncated: bool, - #[serde(default = "default_1754")] + #[serde(default = "default_1760")] pub total: Integer, - #[serde(default = "default_1755")] + #[serde(default = "default_1761")] pub today: Integer, - #[serde(default = "default_1756")] + #[serde(default = "default_1762")] pub namespace_version: String, - #[serde(default = "default_1757")] + #[serde(default = "default_1763")] pub unchanged: bool, - #[serde(default = "default_1758")] + #[serde(default = "default_1764")] pub hidden: Integer, - #[serde(default = "default_1759")] + #[serde(default = "default_1765")] pub hidden_hint: String, } @@ -38203,19 +38501,19 @@ impl MemoryListInput { #[non_exhaustive] pub struct MemoryLockOutput { pub locked: bool, - #[serde(default = "default_1760")] + #[serde(default = "default_1766")] pub reason: String, - #[serde(default = "default_1761")] + #[serde(default = "default_1767")] pub memory_id: String, - #[serde(default = "default_1762")] + #[serde(default = "default_1768")] pub version: Option, - #[serde(default = "default_1763")] + #[serde(default = "default_1769")] pub lock_mode: String, - #[serde(default = "default_1764")] + #[serde(default = "default_1770")] pub lock_until: Option, - #[serde(default = "default_1765")] + #[serde(default = "default_1771")] pub locked_by: String, - #[serde(default = "default_1766")] + #[serde(default = "default_1772")] pub previous_mode: String, } @@ -38374,21 +38672,21 @@ pub struct MemoryMoveOutput { pub from_key: String, pub to_key: String, pub redirected: bool, - #[serde(default = "default_1767")] + #[serde(default = "default_1773")] pub memory_id: String, - #[serde(default = "default_1768")] + #[serde(default = "default_1774")] pub version: Integer, - #[serde(default = "default_1769")] + #[serde(default = "default_1775")] pub content_sha256: String, - #[serde(default = "default_1770")] + #[serde(default = "default_1776")] pub advisories: Vec, - #[serde(default = "default_1771")] + #[serde(default = "default_1777")] pub dry_run: bool, - #[serde(default = "default_1772")] + #[serde(default = "default_1778")] pub memory_type: String, - #[serde(default = "default_1773")] + #[serde(default = "default_1779")] pub value_preview: String, - #[serde(default = "default_1774")] + #[serde(default = "default_1780")] pub sensitivity: String, } @@ -38600,7 +38898,7 @@ impl MemoryMoveInput { pub struct MemoryOutcomeOutput { pub recorded: bool, pub evidence_count_after: Integer, - #[serde(default = "default_1775")] + #[serde(default = "default_1781")] pub quarantined: bool, } @@ -38843,13 +39141,13 @@ impl MemoryOutcomeRunInput { #[non_exhaustive] pub struct OutlineSession { pub session_id: String, - #[serde(default = "default_1777")] + #[serde(default = "default_1783")] pub date: String, - #[serde(default = "default_1778")] + #[serde(default = "default_1784")] pub headline: String, - #[serde(default = "default_1779")] + #[serde(default = "default_1785")] pub key_facts: Integer, - #[serde(default = "default_1780")] + #[serde(default = "default_1786")] pub rows: Integer, } @@ -38857,7 +39155,7 @@ pub struct OutlineSession { #[non_exhaustive] pub struct OutlineHub { pub entity: String, - #[serde(default = "default_1783")] + #[serde(default = "default_1789")] pub degree: Integer, } @@ -38865,28 +39163,28 @@ pub struct OutlineHub { #[non_exhaustive] pub struct OutlineCommunity { pub community_id: Integer, - #[serde(default = "default_1785")] + #[serde(default = "default_1791")] pub label: String, - #[serde(default = "default_1786")] + #[serde(default = "default_1792")] pub size: Integer, - #[serde(default = "default_1787")] + #[serde(default = "default_1793")] pub computed_at: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryOutlineOutput { - #[serde(default = "default_1776")] + #[serde(default = "default_1782")] pub rows_by_type: std::collections::HashMap, - #[serde(default = "default_1781")] + #[serde(default = "default_1787")] pub sessions: Vec, - #[serde(default = "default_1782")] + #[serde(default = "default_1788")] pub sessions_total: Integer, - #[serde(default = "default_1784")] + #[serde(default = "default_1790")] pub hubs: Vec, - #[serde(default = "default_1788")] + #[serde(default = "default_1794")] pub communities: Vec, - #[serde(default = "default_1789")] + #[serde(default = "default_1795")] pub profile_chars: Integer, } @@ -39038,7 +39336,7 @@ pub struct OwnerUsageRow { pub recalls: Integer, pub used: Integer, pub harm: Integer, - #[serde(default = "default_1790")] + #[serde(default = "default_1796")] pub last_recalled: Option, } @@ -39525,7 +39823,7 @@ pub struct MemoryPromoteOutput { pub shared_memory_key: String, pub promotion_event: String, pub reversible_until: String, - #[serde(default = "default_1791")] + #[serde(default = "default_1797")] pub ignored_args: Vec, } @@ -39694,18 +39992,18 @@ impl MemoryPromoteInput { pub struct MemoryProposalDecision { pub memory_key: String, pub decided: bool, - #[serde(default = "default_1793")] + #[serde(default = "default_1799")] pub status: String, - #[serde(default = "default_1794")] + #[serde(default = "default_1800")] pub reason: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryProposalDecideOutput { - #[serde(default = "default_1792")] + #[serde(default = "default_1798")] pub decided: Integer, - #[serde(default = "default_1795")] + #[serde(default = "default_1801")] pub results: Vec, } @@ -39806,35 +40104,35 @@ pub enum MemoryProposalReady { pub struct MemoryProposal { pub memory_key: String, pub memory_id: String, - #[serde(default = "default_1796")] + #[serde(default = "default_1802")] pub content_sha256: String, - #[serde(default = "default_1797")] + #[serde(default = "default_1803")] pub agent: String, - #[serde(default = "default_1798")] + #[serde(default = "default_1804")] pub actor: String, - #[serde(default = "default_1799")] + #[serde(default = "default_1805")] pub memory_type: String, - #[serde(default = "default_1800")] + #[serde(default = "default_1806")] pub value_preview: String, - #[serde(default = "default_1801")] + #[serde(default = "default_1807")] pub sensitivity: String, - #[serde(default = "default_1802")] + #[serde(default = "default_1808")] pub tags: Vec, - #[serde(default = "default_1803")] + #[serde(default = "default_1809")] pub created_at: String, - #[serde(default = "default_1804")] + #[serde(default = "default_1810")] pub graded_passes: Integer, - #[serde(default = "default_1805")] + #[serde(default = "default_1811")] pub graded_fails: Integer, - #[serde(default = "default_1806")] + #[serde(default = "default_1812")] pub last_graded_at: String, - #[serde(default = "default_1807")] + #[serde(default = "default_1813")] pub used_count: Integer, - #[serde(default = "default_1808")] + #[serde(default = "default_1814")] pub harm_count: Integer, - #[serde(default = "default_1809")] + #[serde(default = "default_1815")] pub ready: MemoryProposalReady, - #[serde(default = "default_1810")] + #[serde(default = "default_1816")] pub conflict_with: Vec, } @@ -39850,24 +40148,24 @@ pub enum ProposalPolicyMode { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct ProposalPolicy { - #[serde(default = "default_1813")] + #[serde(default = "default_1819")] pub mode: ProposalPolicyMode, - #[serde(default = "default_1814")] + #[serde(default = "default_1820")] pub min_passes: Integer, - #[serde(default = "default_1815")] + #[serde(default = "default_1821")] pub max_fails: Integer, - #[serde(default = "default_1816")] + #[serde(default = "default_1822")] pub reject_after_fails: Integer, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryProposalsOutput { - #[serde(default = "default_1811")] + #[serde(default = "default_1817")] pub proposals: Vec, - #[serde(default = "default_1812")] + #[serde(default = "default_1818")] pub total: Integer, - #[serde(default = "default_1817")] + #[serde(default = "default_1823")] pub policy: ProposalPolicy, } @@ -39996,19 +40294,19 @@ impl MemoryProposalsInput { pub struct MemoryProvenanceLink { pub direction: String, pub memory_key: String, - #[serde(default = "default_1831")] + #[serde(default = "default_1837")] pub relation: String, - #[serde(default = "default_1832")] + #[serde(default = "default_1838")] pub label: String, - #[serde(default = "default_1833")] + #[serde(default = "default_1839")] pub explanation: String, - #[serde(default = "default_1834")] + #[serde(default = "default_1840")] pub evidence: Vec, - #[serde(default = "default_1835")] + #[serde(default = "default_1841")] pub confidence: f64, - #[serde(default = "default_1836")] + #[serde(default = "default_1842")] pub author: String, - #[serde(default = "default_1837")] + #[serde(default = "default_1843")] pub run_id: String, } @@ -40016,33 +40314,33 @@ pub struct MemoryProvenanceLink { #[non_exhaustive] pub struct MemoryProvenanceOutput { pub found: bool, - #[serde(default = "default_1818")] + #[serde(default = "default_1824")] pub source_trace: String, - #[serde(default = "default_1819")] + #[serde(default = "default_1825")] pub source_kind: String, - #[serde(default = "default_1820")] + #[serde(default = "default_1826")] pub actor: String, - #[serde(default = "default_1821")] + #[serde(default = "default_1827")] pub source_class: String, - #[serde(default = "default_1822")] + #[serde(default = "default_1828")] pub source_label: String, - #[serde(default = "default_1823")] + #[serde(default = "default_1829")] pub thread_id: String, - #[serde(default = "default_1824")] + #[serde(default = "default_1830")] pub thread_exists: bool, - #[serde(default = "default_1825")] + #[serde(default = "default_1831")] pub thread_title: String, - #[serde(default = "default_1826")] + #[serde(default = "default_1832")] pub agent: String, - #[serde(default = "default_1827")] + #[serde(default = "default_1833")] pub session_id: String, - #[serde(default = "default_1828")] + #[serde(default = "default_1834")] pub run_id: String, - #[serde(default = "default_1829")] + #[serde(default = "default_1835")] pub written_at: String, - #[serde(default = "default_1830")] + #[serde(default = "default_1836")] pub source_resource_id: String, - #[serde(default = "default_1838")] + #[serde(default = "default_1844")] pub links: Vec, } @@ -40137,17 +40435,17 @@ impl MemoryProvenanceInput { pub struct RecallTurn { pub evidence_id: String, pub session_id: String, - #[serde(default = "default_1839")] + #[serde(default = "default_1845")] pub role: String, - #[serde(default = "default_1840")] + #[serde(default = "default_1846")] pub actor: String, - #[serde(default = "default_1841")] + #[serde(default = "default_1847")] pub observed_at: String, - #[serde(default = "default_1842")] + #[serde(default = "default_1848")] pub content: String, - #[serde(default = "default_1843")] + #[serde(default = "default_1849")] pub truncated: bool, - #[serde(default = "default_1844")] + #[serde(default = "default_1850")] pub matched_tokens: Integer, } @@ -40164,21 +40462,21 @@ pub enum MemoryRecallOutputOrder { #[non_exhaustive] pub struct MemoryRecallOutput { pub turns: Vec, - #[serde(default = "default_1845")] + #[serde(default = "default_1851")] pub total_matched: Integer, - #[serde(default = "default_1846")] + #[serde(default = "default_1852")] pub returned: Integer, - #[serde(default = "default_1847")] + #[serde(default = "default_1853")] pub has_more: bool, - #[serde(default = "default_1848")] + #[serde(default = "default_1854")] pub next_cursor: String, - #[serde(default = "default_1849")] + #[serde(default = "default_1855")] pub next_offset: Integer, - #[serde(default = "default_1850")] + #[serde(default = "default_1856")] pub order: MemoryRecallOutputOrder, - #[serde(default = "default_1851")] + #[serde(default = "default_1857")] pub query_tokens: Vec, - #[serde(default = "default_1852")] + #[serde(default = "default_1858")] pub tokens_returned: Integer, } @@ -40460,19 +40758,19 @@ pub struct MemoryRecordConflictRow { pub schema_name: String, pub memory_key: String, pub field_name: String, - #[serde(default = "default_1853")] + #[serde(default = "default_1859")] pub prior_value: Value, - #[serde(default = "default_1854")] + #[serde(default = "default_1860")] pub incoming_value: Value, pub prior_record_id: String, pub incoming_record_id: String, - #[serde(default = "default_1855")] + #[serde(default = "default_1861")] pub prior_memory_id: String, - #[serde(default = "default_1856")] + #[serde(default = "default_1862")] pub incoming_memory_id: String, - #[serde(default = "default_1857")] + #[serde(default = "default_1863")] pub detected_at: Option, - #[serde(default = "default_1858")] + #[serde(default = "default_1864")] pub resolved_at: Option, } @@ -40480,7 +40778,7 @@ pub struct MemoryRecordConflictRow { #[non_exhaustive] pub struct MemoryRecordConflictsOutput { pub rows: Vec, - #[serde(default = "default_1859")] + #[serde(default = "default_1865")] pub truncated: bool, } @@ -40590,19 +40888,19 @@ pub enum MemoryRecordRowStatus { #[non_exhaustive] pub struct MemoryRecordRow { pub record_id: String, - #[serde(default = "default_1860")] + #[serde(default = "default_1866")] pub memory_key: String, - #[serde(default = "default_1861")] + #[serde(default = "default_1867")] pub memory_id: String, - #[serde(default = "default_1862")] + #[serde(default = "default_1868")] pub record: std::collections::HashMap, - #[serde(default = "default_1863")] + #[serde(default = "default_1869")] pub field_states: std::collections::HashMap, - #[serde(default = "default_1864")] + #[serde(default = "default_1870")] pub status: MemoryRecordRowStatus, - #[serde(default = "default_1865")] + #[serde(default = "default_1871")] pub valid_at: Option, - #[serde(default = "default_1866")] + #[serde(default = "default_1872")] pub valid_to: Option, } @@ -40669,7 +40967,7 @@ impl MemoryRecordHistoryInput { #[non_exhaustive] pub struct MemoryRecordQueryOutput { pub rows: Vec, - #[serde(default = "default_1867")] + #[serde(default = "default_1873")] pub truncated: bool, } @@ -40893,15 +41191,15 @@ pub enum MemoryRecordWriteOutputKeySource { pub struct MemoryRecordWriteOutput { pub record_id: String, pub field_count: Integer, - #[serde(default = "default_1868")] + #[serde(default = "default_1874")] pub memory_key: String, - #[serde(default = "default_1869")] + #[serde(default = "default_1875")] pub key_source: MemoryRecordWriteOutputKeySource, - #[serde(default = "default_1870")] + #[serde(default = "default_1876")] pub fold: std::collections::HashMap, - #[serde(default = "default_1871")] + #[serde(default = "default_1877")] pub superseded_record_id: String, - #[serde(default = "default_1872")] + #[serde(default = "default_1878")] pub conflicts: Integer, } @@ -41144,13 +41442,13 @@ impl MemoryRecordWriteInput { #[non_exhaustive] pub struct MemoryRedactOutput { pub redacted: bool, - #[serde(default = "default_1873")] + #[serde(default = "default_1879")] pub refused_head: bool, - #[serde(default = "default_1874")] + #[serde(default = "default_1880")] pub redacted_at: Option, - #[serde(default = "default_1875")] + #[serde(default = "default_1881")] pub cache_rows_deleted: Integer, - #[serde(default = "default_1876")] + #[serde(default = "default_1882")] pub precedent_rows_deleted: Integer, } @@ -41310,7 +41608,7 @@ impl MemoryReindexInput { #[non_exhaustive] pub struct MemoryRejectOutput { pub rejected: bool, - #[serde(default = "default_1877")] + #[serde(default = "default_1883")] pub rejected_at: Option, } @@ -41426,7 +41724,7 @@ pub struct MemoryRelatedHit { pub struct MemoryRelatedOutput { pub results: Vec, pub source_entities: Vec, - #[serde(default = "default_1878")] + #[serde(default = "default_1884")] pub reason: String, } @@ -41541,13 +41839,13 @@ impl MemoryRelatedInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryResolveOrphanDuplicatesOutput { - #[serde(default = "default_1879")] + #[serde(default = "default_1885")] pub candidates: Integer, - #[serde(default = "default_1880")] + #[serde(default = "default_1886")] pub reactivated: Integer, - #[serde(default = "default_1881")] + #[serde(default = "default_1887")] pub dry_run: bool, - #[serde(default = "default_1882")] + #[serde(default = "default_1888")] pub memory_ids: Vec, } @@ -41624,15 +41922,15 @@ impl MemoryResolveOrphanDuplicatesInput { #[non_exhaustive] pub struct MemoryRestoreOutput { pub restored: bool, - #[serde(default = "default_1883")] + #[serde(default = "default_1889")] pub memory_id: Option, - #[serde(default = "default_1884")] + #[serde(default = "default_1890")] pub version: Option, - #[serde(default = "default_1885")] + #[serde(default = "default_1891")] pub expired: bool, - #[serde(default = "default_1886")] + #[serde(default = "default_1892")] pub redacted: bool, - #[serde(default = "default_1887")] + #[serde(default = "default_1893")] pub from_status: String, } @@ -41752,13 +42050,13 @@ pub struct SearchTraceHit { pub content_excerpt: String, pub distance: f64, pub similarity: f64, - #[serde(default = "default_1888")] + #[serde(default = "default_1894")] pub entity_boost: f64, pub rank_score: f64, pub rank: Integer, - #[serde(default = "default_1889")] + #[serde(default = "default_1895")] pub source: String, - #[serde(default = "default_1890")] + #[serde(default = "default_1896")] pub parent_memory_key: String, } @@ -41768,11 +42066,11 @@ pub struct MemorySearchTraceOutput { pub results: Vec, pub embedding_model: String, pub entity_filter: Vec, - #[serde(default = "default_1891")] + #[serde(default = "default_1897")] pub query_spellings: std::collections::HashMap, - #[serde(default = "default_1892")] + #[serde(default = "default_1898")] pub query_spellings_skipped: bool, - #[serde(default = "default_1893")] + #[serde(default = "default_1899")] pub stale_dropped: Integer, } @@ -42975,7 +43273,7 @@ pub struct SearchTraceLogRow { pub embedding_model: String, pub latency_ms: Integer, pub run_id: String, - #[serde(default = "default_1894")] + #[serde(default = "default_1900")] pub operation: String, } @@ -43084,71 +43382,71 @@ pub struct RefusedFact { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemorySetFromMessagesOutput { - #[serde(default = "default_1895")] + #[serde(default = "default_1901")] pub written: Vec, - #[serde(default = "default_1896")] + #[serde(default = "default_1902")] pub refused: Vec, - #[serde(default = "default_1897")] + #[serde(default = "default_1903")] pub tokens_in: Integer, - #[serde(default = "default_1898")] + #[serde(default = "default_1904")] pub tokens_out: Integer, - #[serde(default = "default_1899")] + #[serde(default = "default_1905")] pub llm_provider: String, - #[serde(default = "default_1900")] + #[serde(default = "default_1906")] pub llm_model: String, - #[serde(default = "default_1901")] + #[serde(default = "default_1907")] pub segments: Integer, - #[serde(default = "default_1902")] + #[serde(default = "default_1908")] pub foresight: Integer, - #[serde(default = "default_1903")] + #[serde(default = "default_1909")] pub forgotten: Integer, - #[serde(default = "default_1904")] + #[serde(default = "default_1910")] pub forgotten_keys: Vec, - #[serde(default = "default_1905")] + #[serde(default = "default_1911")] pub forget_requests: Integer, - #[serde(default = "default_1906")] + #[serde(default = "default_1912")] pub about_other: Integer, - #[serde(default = "default_1907")] + #[serde(default = "default_1913")] pub premise_facts: Integer, - #[serde(default = "default_1908")] + #[serde(default = "default_1914")] pub learning_candidates: Integer, - #[serde(default = "default_1909")] + #[serde(default = "default_1915")] pub ignored_args: Vec, - #[serde(default = "default_1910")] + #[serde(default = "default_1916")] pub segmenter: String, - #[serde(default = "default_1911")] + #[serde(default = "default_1917")] pub cached_tokens_in: Integer, - #[serde(default = "default_1912")] + #[serde(default = "default_1918")] pub ontology_warnings: Vec, - #[serde(default = "default_1913")] + #[serde(default = "default_1919")] pub evidence_ids: Vec, - #[serde(default = "default_1914")] + #[serde(default = "default_1920")] pub belief_source_links: Integer, - #[serde(default = "default_1915")] + #[serde(default = "default_1921")] pub pipeline_errors: Vec, - #[serde(default = "default_1916")] + #[serde(default = "default_1922")] pub value_updates_linked: Integer, - #[serde(default = "default_1917")] + #[serde(default = "default_1923")] pub stubbed_fields: Vec, - #[serde(default = "default_1918")] + #[serde(default = "default_1924")] pub degraded: Vec, - #[serde(default = "default_1919")] + #[serde(default = "default_1925")] pub deferred: bool, - #[serde(default = "default_1920")] + #[serde(default = "default_1926")] pub queue_id: String, - #[serde(default = "default_1921")] + #[serde(default = "default_1927")] pub deferred_by: String, - #[serde(default = "default_1922")] + #[serde(default = "default_1928")] pub stage_ms: std::collections::HashMap, - #[serde(default = "default_1923")] + #[serde(default = "default_1929")] pub observation_date_source: String, - #[serde(default = "default_1924")] + #[serde(default = "default_1930")] pub under_operator_policy: bool, - #[serde(default = "default_1925")] + #[serde(default = "default_1931")] pub extract_prompt_keys: Vec, - #[serde(default = "default_1926")] + #[serde(default = "default_1932")] pub llm_cache_hits: Integer, - #[serde(default = "default_1927")] + #[serde(default = "default_1933")] pub llm_cache_misses: Integer, } @@ -43603,22 +43901,22 @@ pub enum StackEntrySection { #[non_exhaustive] pub struct StackEntry { pub section: StackEntrySection, - #[serde(default = "default_1928")] + #[serde(default = "default_1934")] pub memory_key: String, - #[serde(default = "default_1929")] + #[serde(default = "default_1935")] pub memory_type: String, - #[serde(default = "default_1930")] + #[serde(default = "default_1936")] pub value: String, pub tokens: Integer, - #[serde(default = "default_1931")] + #[serde(default = "default_1937")] pub pinned: bool, - #[serde(default = "default_1932")] + #[serde(default = "default_1938")] pub recall_count: Integer, - #[serde(default = "default_1933")] + #[serde(default = "default_1939")] pub last_recalled_at: Option, - #[serde(default = "default_1934")] + #[serde(default = "default_1940")] pub actor: String, - #[serde(default = "default_1935")] + #[serde(default = "default_1941")] pub namespace: String, } @@ -43803,14 +44101,14 @@ impl MemoryStackInput { pub struct MemoryStatus { pub memory_id: String, pub status: String, - #[serde(default = "default_1936")] + #[serde(default = "default_1942")] pub superseded_by: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryStatusesOutput { - #[serde(default = "default_1937")] + #[serde(default = "default_1943")] pub rows: Vec, } @@ -43859,23 +44157,23 @@ impl MemoryStatusesInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemorySweepExpiredOutput { - #[serde(default = "default_1938")] + #[serde(default = "default_1944")] pub scanned: Integer, - #[serde(default = "default_1939")] + #[serde(default = "default_1945")] pub tombstoned: Integer, - #[serde(default = "default_1940")] + #[serde(default = "default_1946")] pub demoted: Integer, - #[serde(default = "default_1941")] + #[serde(default = "default_1947")] pub anonymized: Integer, - #[serde(default = "default_1942")] + #[serde(default = "default_1948")] pub locked_skipped: Integer, - #[serde(default = "default_1943")] + #[serde(default = "default_1949")] pub moved_skipped: Integer, - #[serde(default = "default_1944")] + #[serde(default = "default_1950")] pub dry_run: bool, - #[serde(default = "default_1945")] + #[serde(default = "default_1951")] pub sample: Vec>, - #[serde(default = "default_1946")] + #[serde(default = "default_1952")] pub failures: Vec, } @@ -43952,10 +44250,10 @@ pub struct MemoryTimelineEntry { pub memory_key: String, pub memory_type: String, pub content_excerpt: String, - #[serde(default = "default_1947")] + #[serde(default = "default_1953")] pub valid_at: Option, pub created_at: String, - #[serde(default = "default_1948")] + #[serde(default = "default_1954")] pub namespace: String, } @@ -43963,7 +44261,7 @@ pub struct MemoryTimelineEntry { #[non_exhaustive] pub struct MemoryTimelineOutput { pub events: Vec, - #[serde(default = "default_1949")] + #[serde(default = "default_1955")] pub total_matching: Integer, } @@ -44155,9 +44453,9 @@ impl MemoryTimelineInput { pub struct MemoryTouchResult { pub memory_key: String, pub touched: bool, - #[serde(default = "default_1952")] + #[serde(default = "default_1958")] pub version: Option, - #[serde(default = "default_1953")] + #[serde(default = "default_1959")] pub expires_at: Option, } @@ -44165,13 +44463,13 @@ pub struct MemoryTouchResult { #[non_exhaustive] pub struct MemoryTouchOutput { pub touched: bool, - #[serde(default = "default_1950")] + #[serde(default = "default_1956")] pub version: Option, - #[serde(default = "default_1951")] + #[serde(default = "default_1957")] pub expires_at: Option, - #[serde(default = "default_1954")] + #[serde(default = "default_1960")] pub results: Vec, - #[serde(default = "default_1955")] + #[serde(default = "default_1961")] pub touched_count: Integer, } @@ -44351,15 +44649,15 @@ impl MemoryTouchInput { #[non_exhaustive] pub struct MemoryUnlockOutput { pub unlocked: bool, - #[serde(default = "default_1956")] + #[serde(default = "default_1962")] pub reason: String, - #[serde(default = "default_1957")] + #[serde(default = "default_1963")] pub memory_id: String, - #[serde(default = "default_1958")] + #[serde(default = "default_1964")] pub version: Option, - #[serde(default = "default_1959")] + #[serde(default = "default_1965")] pub previous_mode: String, - #[serde(default = "default_1960")] + #[serde(default = "default_1966")] pub unlocked_by: String, } @@ -44464,11 +44762,11 @@ impl MemoryUnlockInput { #[non_exhaustive] pub struct MemoryUnpinOutput { pub unpinned: bool, - #[serde(default = "default_1961")] + #[serde(default = "default_1967")] pub reason: String, - #[serde(default = "default_1962")] + #[serde(default = "default_1968")] pub memory_id: String, - #[serde(default = "default_1963")] + #[serde(default = "default_1969")] pub version: Option, } @@ -44562,15 +44860,15 @@ impl MemoryUnpinInput { #[non_exhaustive] pub struct MemoryUpdateCandidate { pub memory_id: String, - #[serde(default = "default_1969")] + #[serde(default = "default_1975")] pub agent: String, - #[serde(default = "default_1970")] + #[serde(default = "default_1976")] pub user_id: String, - #[serde(default = "default_1971")] + #[serde(default = "default_1977")] pub session_id: String, - #[serde(default = "default_1972")] + #[serde(default = "default_1978")] pub version: Integer, - #[serde(default = "default_1973")] + #[serde(default = "default_1979")] pub status: String, } @@ -44578,23 +44876,23 @@ pub struct MemoryUpdateCandidate { #[non_exhaustive] pub struct MemoryUpdateOutput { pub updated: bool, - #[serde(default = "default_1964")] + #[serde(default = "default_1970")] pub memory_id: String, - #[serde(default = "default_1965")] + #[serde(default = "default_1971")] pub memory_key: String, - #[serde(default = "default_1966")] + #[serde(default = "default_1972")] pub new_version: Integer, - #[serde(default = "default_1967")] + #[serde(default = "default_1973")] pub content_sha256: String, - #[serde(default = "default_1968")] - pub reason: String, #[serde(default = "default_1974")] + pub reason: String, + #[serde(default = "default_1980")] pub candidates: Vec, - #[serde(default = "default_1975")] + #[serde(default = "default_1981")] pub conflict_verdict: String, - #[serde(default = "default_1976")] + #[serde(default = "default_1982")] pub conflict_peers: Integer, - #[serde(default = "default_1977")] + #[serde(default = "default_1983")] pub duplicate_of: String, } @@ -44803,15 +45101,15 @@ impl MemoryUpdateInput { #[non_exhaustive] pub struct MemoryUpdateByIdOutput { pub updated: bool, - #[serde(default = "default_1978")] + #[serde(default = "default_1984")] pub new_version: Integer, - #[serde(default = "default_1979")] + #[serde(default = "default_1985")] pub content_sha256: String, - #[serde(default = "default_1980")] + #[serde(default = "default_1986")] pub conflict_verdict: String, - #[serde(default = "default_1981")] + #[serde(default = "default_1987")] pub conflict_peers: Integer, - #[serde(default = "default_1982")] + #[serde(default = "default_1988")] pub duplicate_of: String, } @@ -44939,23 +45237,23 @@ impl MemoryUpdateByIdInput { #[non_exhaustive] pub struct MemoryVerifyOutput { pub found: bool, - #[serde(default = "default_1983")] + #[serde(default = "default_1989")] pub changed: bool, - #[serde(default = "default_1984")] + #[serde(default = "default_1990")] pub memory_id: String, - #[serde(default = "default_1985")] + #[serde(default = "default_1991")] pub memory_key: String, - #[serde(default = "default_1986")] + #[serde(default = "default_1992")] pub namespace: String, - #[serde(default = "default_1987")] + #[serde(default = "default_1993")] pub verified_by: String, - #[serde(default = "default_1988")] + #[serde(default = "default_1994")] pub verified_at: Option, - #[serde(default = "default_1989")] + #[serde(default = "default_1995")] pub verification: String, - #[serde(default = "default_1990")] + #[serde(default = "default_1996")] pub version: Integer, - #[serde(default = "default_1991")] + #[serde(default = "default_1997")] pub content_sha256: String, } @@ -45171,13 +45469,13 @@ pub struct SchemaFieldOutput { #[serde(rename = "type")] pub r#type: String, pub required: bool, - #[serde(default = "default_1994")] + #[serde(default = "default_2000")] pub identity: bool, - #[serde(default = "default_1995")] + #[serde(default = "default_2001")] pub enum_values: Vec, - #[serde(default = "default_1996")] + #[serde(default = "default_2002")] pub constraints: std::collections::HashMap, - #[serde(default = "default_1997")] + #[serde(default = "default_2003")] pub description: String, } @@ -45186,11 +45484,11 @@ pub struct SchemaFieldOutput { pub struct MemorySchemaSummary { pub schema_id: String, pub name: String, - #[serde(default = "default_1992")] + #[serde(default = "default_1998")] pub description: String, - #[serde(default = "default_1993")] + #[serde(default = "default_1999")] pub status: String, - #[serde(default = "default_1998")] + #[serde(default = "default_2004")] pub fields: Vec, } @@ -45605,13 +45903,13 @@ impl MemorySchemaRegisterInput { #[non_exhaustive] pub struct MentorPlane { pub plane: String, - #[serde(default = "default_2000")] + #[serde(default = "default_2006")] pub calls: Integer, - #[serde(default = "default_2001")] + #[serde(default = "default_2007")] pub available: Option, - #[serde(default = "default_2002")] + #[serde(default = "default_2008")] pub when: String, - #[serde(default = "default_2003")] + #[serde(default = "default_2009")] pub mentored: bool, } @@ -45621,11 +45919,11 @@ pub struct MentorHint { pub code: String, pub severity: String, pub text: String, - #[serde(default = "default_2005")] + #[serde(default = "default_2011")] pub ops: Vec, - #[serde(default = "default_2006")] + #[serde(default = "default_2012")] pub evidence: std::collections::HashMap, - #[serde(default = "default_2007")] + #[serde(default = "default_2013")] pub plane: Option, } @@ -45633,9 +45931,9 @@ pub struct MentorHint { #[non_exhaustive] pub struct MentorAdoption { pub code: String, - #[serde(default = "default_2009")] + #[serde(default = "default_2015")] pub shown_sessions: Integer, - #[serde(default = "default_2010")] + #[serde(default = "default_2016")] pub followed_sessions: Integer, } @@ -45671,7 +45969,7 @@ pub enum UsageRungSource { #[non_exhaustive] pub struct UsageRung { pub rung: UsageRungRung, - #[serde(default = "default_2012")] + #[serde(default = "default_2018")] pub count: Option, pub source: UsageRungSource, pub meaning: String, @@ -45686,27 +45984,27 @@ pub struct MentorBriefOutput { pub window_seconds: Integer, pub computed_at: String, pub sessions: Integer, - #[serde(default = "default_1999")] + #[serde(default = "default_2005")] pub usage: std::collections::HashMap, - #[serde(default = "default_2004")] + #[serde(default = "default_2010")] pub planes: Vec, - #[serde(default = "default_2008")] + #[serde(default = "default_2014")] pub hints: Vec, - #[serde(default = "default_2011")] + #[serde(default = "default_2017")] pub adoption: Vec, - #[serde(default = "default_2013")] + #[serde(default = "default_2019")] pub usage_evidence: Vec, - #[serde(default = "default_2014")] + #[serde(default = "default_2020")] pub ledger_from: Option, - #[serde(default = "default_2015")] + #[serde(default = "default_2021")] pub ledger_retention_days: Option, - #[serde(default = "default_2016")] + #[serde(default = "default_2022")] pub agents: Vec, - #[serde(default = "default_2017")] + #[serde(default = "default_2023")] pub agent_defaulted: bool, - #[serde(default = "default_2018")] + #[serde(default = "default_2024")] pub skipped: Vec, - #[serde(default = "default_2019")] + #[serde(default = "default_2025")] pub healthy: bool, } @@ -45855,33 +46153,33 @@ impl MentorGuideInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct NamespaceAuditSummary { - #[serde(default = "default_2020")] + #[serde(default = "default_2026")] pub live_rows: Integer, - #[serde(default = "default_2021")] + #[serde(default = "default_2027")] pub live_bytes: Integer, - #[serde(default = "default_2022")] + #[serde(default = "default_2028")] pub excerpt_bytes: Integer, - #[serde(default = "default_2023")] + #[serde(default = "default_2029")] pub version_rows: Integer, - #[serde(default = "default_2024")] + #[serde(default = "default_2030")] pub version_bytes: Integer, - #[serde(default = "default_2025")] + #[serde(default = "default_2031")] pub unembedded_rows: Integer, - #[serde(default = "default_2026")] + #[serde(default = "default_2032")] pub gets: Integer, - #[serde(default = "default_2027")] + #[serde(default = "default_2033")] pub searches: Integer, - #[serde(default = "default_2028")] + #[serde(default = "default_2034")] pub sets: Integer, - #[serde(default = "default_2029")] + #[serde(default = "default_2035")] pub get_search_ratio: f64, - #[serde(default = "default_2030")] + #[serde(default = "default_2036")] pub inspector_calls: Integer, - #[serde(default = "default_2031")] + #[serde(default = "default_2037")] pub typed_gets: Integer, - #[serde(default = "default_2032")] + #[serde(default = "default_2038")] pub written_in_window: Integer, - #[serde(default = "default_2033")] + #[serde(default = "default_2039")] pub ledger_calls: Integer, } @@ -45913,25 +46211,25 @@ pub struct NamespaceAuditFinding { pub kind: NamespaceAuditFindingKind, pub rule_version: Integer, pub source_op: String, - #[serde(default = "default_2034")] + #[serde(default = "default_2040")] pub window_seconds: Option, - #[serde(default = "default_2035")] + #[serde(default = "default_2041")] pub population: Option, pub sample_limit: Integer, pub samples_complete: bool, - #[serde(default = "default_2036")] + #[serde(default = "default_2042")] pub evidence: Vec, - #[serde(default = "default_2037")] + #[serde(default = "default_2043")] pub exceptions: String, - #[serde(default = "default_2038")] + #[serde(default = "default_2044")] pub uncertainty: String, pub code: String, pub severity: NamespaceAuditFindingSeverity, pub count: Integer, pub share: f64, - #[serde(default = "default_2039")] + #[serde(default = "default_2045")] pub bytes: Integer, - #[serde(default = "default_2040")] + #[serde(default = "default_2046")] pub samples: Vec>, pub detail: String, pub remedy: String, @@ -45946,7 +46244,7 @@ pub struct NamespaceAuditOutput { pub window_seconds: Integer, pub summary: NamespaceAuditSummary, pub findings: Vec, - #[serde(default = "default_2041")] + #[serde(default = "default_2047")] pub skipped: Vec, pub coverage: ReportCoverage, pub healthy: bool, @@ -46037,29 +46335,29 @@ pub enum BrowseEntryMyStatus { #[non_exhaustive] pub struct BrowseEntry { pub namespace: String, - #[serde(default = "default_2042")] + #[serde(default = "default_2048")] pub kind: String, pub description: String, pub owner_email: String, pub member_count: Integer, - #[serde(default = "default_2043")] + #[serde(default = "default_2049")] pub requires_approval: bool, pub created_at: String, - #[serde(default = "default_2044")] + #[serde(default = "default_2050")] pub join_policy: String, - #[serde(default = "default_2045")] + #[serde(default = "default_2051")] pub visibility: String, - #[serde(default = "default_2046")] + #[serde(default = "default_2052")] pub my_status: BrowseEntryMyStatus, - #[serde(default = "default_2047")] + #[serde(default = "default_2053")] pub my_role: String, - #[serde(default = "default_2048")] + #[serde(default = "default_2054")] pub repo: String, - #[serde(default = "default_2049")] + #[serde(default = "default_2055")] pub branch: String, - #[serde(default = "default_2050")] + #[serde(default = "default_2056")] pub guide_revision: Integer, - #[serde(default = "default_2051")] + #[serde(default = "default_2057")] pub guide_summary: String, } @@ -46163,9 +46461,9 @@ pub enum NamespaceCancelRequestOutputClearedRole { pub struct NamespaceCancelRequestOutput { pub cancelled: bool, pub namespace: String, - #[serde(default = "default_2052")] + #[serde(default = "default_2058")] pub cleared_role: Option, - #[serde(default = "default_2053")] + #[serde(default = "default_2059")] pub cancelled_at: Option, } @@ -46237,7 +46535,7 @@ pub struct NamespaceDeleteOutput { pub deleted: bool, pub namespace: String, pub updated_at: String, - #[serde(default = "default_2054")] + #[serde(default = "default_2060")] pub sources_retired: Vec, } @@ -46306,67 +46604,67 @@ pub enum NamespaceGetOutputClassification { pub struct NamespaceGetOutput { pub found: bool, pub namespace: String, - #[serde(default = "default_2055")] + #[serde(default = "default_2061")] pub kind: Option, - #[serde(default = "default_2056")] + #[serde(default = "default_2062")] pub owner_email: Option, - #[serde(default = "default_2057")] + #[serde(default = "default_2063")] pub description: Option, - #[serde(default = "default_2058")] + #[serde(default = "default_2064")] pub tags: Option>, - #[serde(default = "default_2059")] + #[serde(default = "default_2065")] pub active: Option, - #[serde(default = "default_2060")] + #[serde(default = "default_2066")] pub conversation_logging_enabled: Option, - #[serde(default = "default_2061")] + #[serde(default = "default_2067")] pub capture_generation_io: Option, - #[serde(default = "default_2062")] + #[serde(default = "default_2068")] pub coverage_sweep: Option, - #[serde(default = "default_2063")] + #[serde(default = "default_2069")] pub consolidation_enabled: Option, - #[serde(default = "default_2064")] + #[serde(default = "default_2070")] pub daily_cost_cap_usd: Option, - #[serde(default = "default_2065")] + #[serde(default = "default_2071")] pub daily_user_cost_cap_usd: Option, - #[serde(default = "default_2066")] + #[serde(default = "default_2072")] pub budget_alert_inbox: Option, - #[serde(default = "default_2067")] + #[serde(default = "default_2073")] pub conflict_threshold: Option, - #[serde(default = "default_2068")] + #[serde(default = "default_2074")] pub retention_days: Option, - #[serde(default = "default_2069")] + #[serde(default = "default_2075")] pub warm_days: Option, - #[serde(default = "default_2070")] + #[serde(default = "default_2076")] pub visibility: Option, - #[serde(default = "default_2071")] + #[serde(default = "default_2077")] pub requires_approval: Option, - #[serde(default = "default_2072")] + #[serde(default = "default_2078")] pub join_policy: Option, - #[serde(default = "default_2073")] + #[serde(default = "default_2079")] pub effective_join_policy: Option, - #[serde(default = "default_2074")] + #[serde(default = "default_2080")] pub retrieval_defaults: Option>, - #[serde(default = "default_2075")] + #[serde(default = "default_2081")] pub rerank_endpoint: Option, - #[serde(default = "default_2076")] + #[serde(default = "default_2082")] pub classify_endpoint: Option, - #[serde(default = "default_2077")] + #[serde(default = "default_2083")] pub default_conflict_policy: Option, - #[serde(default = "default_2078")] + #[serde(default = "default_2084")] pub proposal_policy: Option, - #[serde(default = "default_2079")] + #[serde(default = "default_2085")] pub code_change_policy: Option, - #[serde(default = "default_2080")] + #[serde(default = "default_2086")] pub tag_registry: Option>>, - #[serde(default = "default_2081")] + #[serde(default = "default_2087")] pub classification: Option, - #[serde(default = "default_2082")] + #[serde(default = "default_2088")] pub guide_revision: Option, - #[serde(default = "default_2083")] + #[serde(default = "default_2089")] pub guide_summary: Option, - #[serde(default = "default_2084")] + #[serde(default = "default_2090")] pub created_at: Option, - #[serde(default = "default_2085")] + #[serde(default = "default_2091")] pub updated_at: Option, } @@ -46419,17 +46717,17 @@ impl NamespaceGetInput { #[non_exhaustive] pub struct NamespaceGuideGetOutput { pub found: bool, - #[serde(default = "default_2086")] + #[serde(default = "default_2092")] pub revision: Integer, - #[serde(default = "default_2087")] + #[serde(default = "default_2093")] pub content: String, - #[serde(default = "default_2088")] + #[serde(default = "default_2094")] pub summary: String, - #[serde(default = "default_2089")] + #[serde(default = "default_2095")] pub note: String, - #[serde(default = "default_2090")] + #[serde(default = "default_2096")] pub updated_by: String, - #[serde(default = "default_2091")] + #[serde(default = "default_2097")] pub updated_at: Option, } @@ -46566,17 +46864,17 @@ impl NamespaceGuideHistoryInput { #[non_exhaustive] pub struct NamespaceGuideSetOutputNamespaceGuideGetOutput { pub found: bool, - #[serde(default = "default_2093")] + #[serde(default = "default_2099")] pub revision: Integer, - #[serde(default = "default_2094")] + #[serde(default = "default_2100")] pub content: String, - #[serde(default = "default_2095")] + #[serde(default = "default_2101")] pub summary: String, - #[serde(default = "default_2096")] + #[serde(default = "default_2102")] pub note: String, - #[serde(default = "default_2097")] + #[serde(default = "default_2103")] pub updated_by: String, - #[serde(default = "default_2098")] + #[serde(default = "default_2104")] pub updated_at: Option, } @@ -46584,10 +46882,10 @@ pub struct NamespaceGuideSetOutputNamespaceGuideGetOutput { #[non_exhaustive] pub struct NamespaceGuideSetOutput { pub written: bool, - #[serde(default = "default_2092")] + #[serde(default = "default_2098")] pub conflict: bool, pub revision: Integer, - #[serde(default = "default_2099")] + #[serde(default = "default_2105")] pub current: Option, } @@ -46708,7 +47006,7 @@ pub struct InventorySection { #[serde(deserialize_with = "required_nullable")] pub latest_at: Option, pub complete: bool, - #[serde(default = "default_2100")] + #[serde(default = "default_2106")] pub reason: String, } @@ -46738,10 +47036,10 @@ pub struct InventoryPopulation { pub population: InventoryPopulationPopulation, #[serde(deserialize_with = "required_nullable")] pub total: Option, - #[serde(default = "default_2101")] + #[serde(default = "default_2107")] pub top: Vec, pub complete: bool, - #[serde(default = "default_2102")] + #[serde(default = "default_2108")] pub reason: String, } @@ -46907,11 +47205,11 @@ pub struct NamespaceJoinOutput { pub joined: bool, pub namespace: String, pub role: NamespaceJoinOutputRole, - #[serde(default = "default_2103")] + #[serde(default = "default_2109")] pub status: String, - #[serde(default = "default_2104")] + #[serde(default = "default_2110")] pub requested_role: Option, - #[serde(default = "default_2105")] + #[serde(default = "default_2111")] pub pending_admins: Vec, pub joined_at: String, } @@ -47003,7 +47301,7 @@ impl NamespaceJoinInput { pub struct NamespaceLeaveOutput { pub left: bool, pub namespace: String, - #[serde(default = "default_2106")] + #[serde(default = "default_2112")] pub left_at: Option, } @@ -47080,27 +47378,27 @@ pub enum NamespaceEntryVisibility { #[non_exhaustive] pub struct NamespaceEntry { pub namespace: String, - #[serde(default = "default_2107")] + #[serde(default = "default_2113")] pub kind: String, pub owner_email: String, pub description: String, pub tags: Vec, pub active: bool, - #[serde(default = "default_2108")] + #[serde(default = "default_2114")] pub consolidation_enabled: bool, - #[serde(default = "default_2109")] + #[serde(default = "default_2115")] pub daily_cost_cap_usd: f64, - #[serde(default = "default_2110")] + #[serde(default = "default_2116")] pub daily_user_cost_cap_usd: f64, - #[serde(default = "default_2111")] + #[serde(default = "default_2117")] pub budget_alert_inbox: String, - #[serde(default = "default_2112")] + #[serde(default = "default_2118")] pub conflict_threshold: Option, - #[serde(default = "default_2113")] + #[serde(default = "default_2119")] pub retention_days: Integer, - #[serde(default = "default_2114")] + #[serde(default = "default_2120")] pub warm_days: Integer, - #[serde(default = "default_2115")] + #[serde(default = "default_2121")] pub visibility: NamespaceEntryVisibility, pub created_at: String, pub updated_at: String, @@ -47255,27 +47553,27 @@ pub enum MineEntryVisibility { pub struct MineEntry { pub namespace: String, pub role: String, - #[serde(default = "default_2116")] + #[serde(default = "default_2122")] pub status: String, - #[serde(default = "default_2117")] + #[serde(default = "default_2123")] pub pending_role: Option, - #[serde(default = "default_2118")] + #[serde(default = "default_2124")] pub pending_since: Option, - #[serde(default = "default_2119")] + #[serde(default = "default_2125")] pub pending_admins: Vec, - #[serde(default = "default_2120")] + #[serde(default = "default_2126")] pub visibility: MineEntryVisibility, - #[serde(default = "default_2121")] + #[serde(default = "default_2127")] pub kind: String, - #[serde(default = "default_2122")] + #[serde(default = "default_2128")] pub title: String, - #[serde(default = "default_2123")] + #[serde(default = "default_2129")] pub description: String, - #[serde(default = "default_2124")] + #[serde(default = "default_2130")] pub joined_at: Option, - #[serde(default = "default_2125")] + #[serde(default = "default_2131")] pub is_new: bool, - #[serde(default = "default_2126")] + #[serde(default = "default_2132")] pub inherited: bool, } @@ -47341,7 +47639,7 @@ pub struct OntologyEntry { pub name: String, pub status: String, pub description: String, - #[serde(default = "default_2127")] + #[serde(default = "default_2133")] pub cardinality: String, pub created_by: String, pub updated_at: String, @@ -47534,7 +47832,7 @@ pub struct NamespaceRegisterOutput { pub registered: bool, pub namespace: String, pub updated_at: String, - #[serde(default = "default_2128")] + #[serde(default = "default_2134")] pub visibility: NamespaceRegisterOutputVisibility, } @@ -48614,7 +48912,7 @@ impl NamespaceRegisterOntologyInput { #[non_exhaustive] pub struct NamespaceRestoreOutput { pub restored: bool, - #[serde(default = "default_2129")] + #[serde(default = "default_2135")] pub publication_pending: bool, pub target_namespace: String, pub snapshot_id: String, @@ -49501,15 +49799,15 @@ pub struct NamespaceRollbackOutput { pub version_at: Integer, pub reinstate: Integer, pub remove: Integer, - #[serde(default = "default_2130")] + #[serde(default = "default_2136")] pub skipped_no_head: Integer, - #[serde(default = "default_2131")] + #[serde(default = "default_2137")] pub skipped_already_gone: Integer, - #[serde(default = "default_2132")] + #[serde(default = "default_2138")] pub truncated: bool, - #[serde(default = "default_2133")] + #[serde(default = "default_2139")] pub sample: Vec>, - #[serde(default = "default_2134")] + #[serde(default = "default_2140")] pub applied_at: Option, } @@ -49688,101 +49986,101 @@ pub struct NamespaceSnapshotOutputSnapshotMemoryRow { pub confidence: f64, pub source_trace: String, pub pinned: bool, - #[serde(default = "default_2135")] + #[serde(default = "default_2141")] pub expires_at: Option, - #[serde(default = "default_2136")] + #[serde(default = "default_2142")] pub entities: Vec, - #[serde(default = "default_2137")] + #[serde(default = "default_2143")] pub version: Integer, - #[serde(default = "default_2138")] + #[serde(default = "default_2144")] pub content_sha256: String, - #[serde(default = "default_2139")] + #[serde(default = "default_2145")] pub actor: String, - #[serde(default = "default_2140")] + #[serde(default = "default_2146")] pub source_class: String, - #[serde(default = "default_2141")] + #[serde(default = "default_2147")] pub source_resource_id: String, - #[serde(default = "default_2142")] + #[serde(default = "default_2148")] pub verified_by: String, - #[serde(default = "default_2143")] + #[serde(default = "default_2149")] pub verified_at: Option, - #[serde(default = "default_2144")] + #[serde(default = "default_2150")] pub verified_sha256: String, - #[serde(default = "default_2145")] + #[serde(default = "default_2151")] pub grounding: String, - #[serde(default = "default_2146")] + #[serde(default = "default_2152")] pub evidence: String, - #[serde(default = "default_2147")] + #[serde(default = "default_2153")] pub tags: Vec, - #[serde(default = "default_2148")] + #[serde(default = "default_2154")] pub valid_at: Option, - #[serde(default = "default_2149")] + #[serde(default = "default_2155")] pub valid_to: Option, - #[serde(default = "default_2150")] + #[serde(default = "default_2156")] pub created_at: Option, - #[serde(default = "default_2151")] + #[serde(default = "default_2157")] pub updated_at: Option, - #[serde(default = "default_2152")] + #[serde(default = "default_2158")] pub value_json: String, - #[serde(default = "default_2153")] + #[serde(default = "default_2159")] pub status: NamespaceSnapshotOutputSnapshotMemoryRowStatus, - #[serde(default = "default_2154")] + #[serde(default = "default_2160")] pub requires_review: Option, - #[serde(default = "default_2155")] + #[serde(default = "default_2161")] pub conflict_with: Vec, - #[serde(default = "default_2156")] + #[serde(default = "default_2162")] pub duplicate_of: String, - #[serde(default = "default_2157")] + #[serde(default = "default_2163")] pub evidence_count: Integer, - #[serde(default = "default_2158")] + #[serde(default = "default_2164")] pub recall_count: Integer, - #[serde(default = "default_2159")] + #[serde(default = "default_2165")] pub last_recalled_at: Option, - #[serde(default = "default_2160")] + #[serde(default = "default_2166")] pub cross_promoted_from_memory_id: String, - #[serde(default = "default_2161")] + #[serde(default = "default_2167")] pub cross_promoted_from_namespace: String, - #[serde(default = "default_2162")] + #[serde(default = "default_2168")] pub superseded_by: String, - #[serde(default = "default_2163")] + #[serde(default = "default_2169")] pub rejection_reason: String, - #[serde(default = "default_2164")] + #[serde(default = "default_2170")] pub temporal_anchor: Option, - #[serde(default = "default_2165")] + #[serde(default = "default_2171")] pub temporal_confidence: f64, - #[serde(default = "default_2166")] + #[serde(default = "default_2172")] pub invalid_at: Option, - #[serde(default = "default_2167")] + #[serde(default = "default_2173")] pub char_limit: Option, - #[serde(default = "default_2168")] + #[serde(default = "default_2174")] pub reinforcement_count: Integer, - #[serde(default = "default_2169")] + #[serde(default = "default_2175")] pub last_reinforced_at: Option, - #[serde(default = "default_2170")] + #[serde(default = "default_2176")] pub mentioned_at: Option, - #[serde(default = "default_2171")] + #[serde(default = "default_2177")] pub sensitivity: String, - #[serde(default = "default_2172")] + #[serde(default = "default_2178")] pub redacted_at: Option, - #[serde(default = "default_2173")] + #[serde(default = "default_2179")] pub redaction_reason: String, - #[serde(default = "default_2174")] + #[serde(default = "default_2180")] pub lock_mode: String, - #[serde(default = "default_2175")] + #[serde(default = "default_2181")] pub lock_reason: String, - #[serde(default = "default_2176")] + #[serde(default = "default_2182")] pub lock_until: Option, - #[serde(default = "default_2177")] + #[serde(default = "default_2183")] pub locked_by: String, - #[serde(default = "default_2178")] + #[serde(default = "default_2184")] pub locked_at: Option, - #[serde(default = "default_2179")] + #[serde(default = "default_2185")] pub on_expire: String, - #[serde(default = "default_2180")] + #[serde(default = "default_2186")] pub expire_reason: String, - #[serde(default = "default_2181")] + #[serde(default = "default_2187")] pub files: Vec, - #[serde(default = "default_2182")] + #[serde(default = "default_2188")] pub concepts: Vec, } @@ -49791,11 +50089,11 @@ pub struct NamespaceSnapshotOutputSnapshotMemoryRow { pub struct NamespaceSnapshotOutputSnapshotTypeRow { pub memory_type: String, pub retention_days: Integer, - #[serde(default = "default_2183")] + #[serde(default = "default_2189")] pub dedup_threshold: Option, - #[serde(default = "default_2184")] + #[serde(default = "default_2190")] pub hot_quota: Integer, - #[serde(default = "default_2185")] + #[serde(default = "default_2191")] pub conflict_policy: String, } @@ -50010,7 +50308,7 @@ pub struct TaxonomyCommunity { pub community_id: Integer, pub label: String, pub size: Integer, - #[serde(default = "default_2186")] + #[serde(default = "default_2192")] pub top_entities: Vec, } @@ -50021,9 +50319,9 @@ pub struct NamespaceTaxonomyOutput { pub entities: Vec, pub memory_count: Integer, pub memory_types: Vec, - #[serde(default = "default_2187")] + #[serde(default = "default_2193")] pub communities: Vec, - #[serde(default = "default_2188")] + #[serde(default = "default_2194")] pub communities_computed_at: String, } @@ -50123,15 +50421,15 @@ pub enum TuneProposalTarget { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TuneEvidence { - #[serde(default = "default_2190")] + #[serde(default = "default_2196")] pub finding_codes: Vec, - #[serde(default = "default_2191")] + #[serde(default = "default_2197")] pub supporting_count: Integer, - #[serde(default = "default_2192")] + #[serde(default = "default_2198")] pub supporting: Vec, - #[serde(default = "default_2193")] + #[serde(default = "default_2199")] pub counter_count: Option, - #[serde(default = "default_2194")] + #[serde(default = "default_2200")] pub documents: Vec, } @@ -50157,10 +50455,10 @@ pub enum TuneApplyVia { #[non_exhaustive] pub struct TuneApply { pub op: String, - #[serde(default = "default_2198")] + #[serde(default = "default_2204")] pub via: TuneApplyVia, pub args: std::collections::HashMap, - #[serde(default = "default_2199")] + #[serde(default = "default_2205")] pub args_complete: bool, pub required_role: String, pub guard: String, @@ -50179,7 +50477,7 @@ pub struct ChunkStats { pub sections: Integer, pub sections_cut: Integer, pub max_input_tokens: Integer, - #[serde(default = "default_2201")] + #[serde(default = "default_2207")] pub over_input_limit: Option, } @@ -50199,25 +50497,25 @@ pub struct TuneProposal { pub title: String, pub rationale: String, pub current: String, - #[serde(default = "default_2189")] + #[serde(default = "default_2195")] pub current_revision: Option, pub proposed: String, pub evidence: TuneEvidence, - #[serde(default = "default_2195")] + #[serde(default = "default_2201")] pub affected_agents: Vec, - #[serde(default = "default_2196")] + #[serde(default = "default_2202")] pub affected_agents_total: Option, - #[serde(default = "default_2197")] + #[serde(default = "default_2203")] pub effect: TuneProposalEffect, pub historical: String, pub apply: TuneApply, - #[serde(default = "default_2200")] + #[serde(default = "default_2206")] pub apply_also: Vec, - #[serde(default = "default_2202")] + #[serde(default = "default_2208")] pub preview: Option, - #[serde(default = "default_2203")] + #[serde(default = "default_2209")] pub limits: String, - #[serde(default = "default_2204")] + #[serde(default = "default_2210")] pub refs: Vec, } @@ -50225,13 +50523,13 @@ pub struct TuneProposal { #[non_exhaustive] pub struct ChunkingSample { pub cap: Integer, - #[serde(default = "default_2210")] + #[serde(default = "default_2216")] pub population: Option, pub documents: Integer, pub unread: Integer, pub load_cap: Integer, pub embedder_model: String, - #[serde(default = "default_2211")] + #[serde(default = "default_2217")] pub input_token_limit: Option, pub current: ChunkStats, } @@ -50242,21 +50540,21 @@ pub struct NamespaceTuneOutput { pub org: String, pub namespace: String, pub computed_at: String, - #[serde(default = "default_2205")] + #[serde(default = "default_2211")] pub proposals: Vec, - #[serde(default = "default_2206")] + #[serde(default = "default_2212")] pub guide_revision: Option, - #[serde(default = "default_2207")] + #[serde(default = "default_2213")] pub categories_registered: Option, - #[serde(default = "default_2208")] + #[serde(default = "default_2214")] pub extraction_policy: Option, - #[serde(default = "default_2209")] + #[serde(default = "default_2215")] pub extraction_policy_unavailable: String, - #[serde(default = "default_2212")] + #[serde(default = "default_2218")] pub chunking: Option, - #[serde(default = "default_2213")] + #[serde(default = "default_2219")] pub skipped: Vec, - #[serde(default = "default_2214")] + #[serde(default = "default_2220")] pub model_used: bool, } @@ -50377,25 +50675,25 @@ pub struct NamespaceValidateFinding { pub kind: NamespaceValidateFindingKind, pub rule_version: Integer, pub source_op: String, - #[serde(default = "default_2215")] + #[serde(default = "default_2221")] pub window_seconds: Option, - #[serde(default = "default_2216")] + #[serde(default = "default_2222")] pub population: Option, pub sample_limit: Integer, pub samples_complete: bool, - #[serde(default = "default_2217")] + #[serde(default = "default_2223")] pub evidence: Vec, - #[serde(default = "default_2218")] + #[serde(default = "default_2224")] pub exceptions: String, - #[serde(default = "default_2219")] + #[serde(default = "default_2225")] pub uncertainty: String, pub check: String, pub severity: NamespaceValidateFindingSeverity, pub count: Integer, - #[serde(default = "default_2220")] + #[serde(default = "default_2226")] pub samples: Vec>, pub detail: String, - #[serde(default = "default_2221")] + #[serde(default = "default_2227")] pub totals: std::collections::HashMap, } @@ -50409,9 +50707,9 @@ pub struct NamespaceValidateOutput { pub warnings: Integer, pub infos: Integer, pub findings: Vec, - #[serde(default = "default_2222")] + #[serde(default = "default_2228")] pub skipped: Vec, - #[serde(default = "default_2223")] + #[serde(default = "default_2229")] pub keys_scoped: Integer, pub coverage: ReportCoverage, pub checked_at: String, @@ -50531,9 +50829,9 @@ impl NamespaceValidateInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct ObserveCrystallizeOutput { - #[serde(default = "default_2224")] + #[serde(default = "default_2230")] pub enqueued: Integer, - #[serde(default = "default_2225")] + #[serde(default = "default_2231")] pub session_id: String, } @@ -50630,23 +50928,23 @@ impl ObserveCrystallizeInput { #[non_exhaustive] pub struct ObserveRecordOutput { pub memory_key: String, - #[serde(default = "default_2226")] + #[serde(default = "default_2232")] pub memory_id: String, - #[serde(default = "default_2227")] + #[serde(default = "default_2233")] pub kind: String, - #[serde(default = "default_2228")] + #[serde(default = "default_2234")] pub tags: Vec, - #[serde(default = "default_2229")] + #[serde(default = "default_2235")] pub file_paths: Vec, - #[serde(default = "default_2230")] + #[serde(default = "default_2236")] pub content_sha256: String, - #[serde(default = "default_2231")] + #[serde(default = "default_2237")] pub tool_name: String, - #[serde(default = "default_2232")] + #[serde(default = "default_2238")] pub has_error: bool, - #[serde(default = "default_2233")] + #[serde(default = "default_2239")] pub narrative_chars: Integer, - #[serde(default = "default_2234")] + #[serde(default = "default_2240")] pub skipped_reason: String, } @@ -50877,7 +51175,7 @@ pub struct OpsIncident { pub subject: String, pub severity: OpsIncidentSeverity, pub detail: String, - #[serde(default = "default_2235")] + #[serde(default = "default_2241")] pub age_s: Option, } @@ -50896,7 +51194,7 @@ pub enum OpsIncidentsOutputRequests { #[non_exhaustive] pub struct OpsIncidentsOutput { pub status: OpsIncidentsOutputStatus, - #[serde(default = "default_2236")] + #[serde(default = "default_2242")] pub incidents: Vec, pub window_minutes: Integer, pub requests: OpsIncidentsOutputRequests, @@ -50940,26 +51238,26 @@ pub struct ProjectionFailureRow { pub failure_id: String, pub org: String, pub namespace: String, - #[serde(default = "default_2237")] + #[serde(default = "default_2243")] pub agent: String, pub projection: String, - #[serde(default = "default_2238")] + #[serde(default = "default_2244")] pub source_operation: String, - #[serde(default = "default_2239")] + #[serde(default = "default_2245")] pub source_resource_id: String, - #[serde(default = "default_2240")] + #[serde(default = "default_2246")] pub memory_keys: Vec, - #[serde(default = "default_2241")] + #[serde(default = "default_2247")] pub error_type: String, - #[serde(default = "default_2242")] + #[serde(default = "default_2248")] pub error_message: String, - #[serde(default = "default_2243")] + #[serde(default = "default_2249")] pub payload: std::collections::HashMap, - #[serde(default = "default_2244")] + #[serde(default = "default_2250")] pub status: String, - #[serde(default = "default_2245")] + #[serde(default = "default_2251")] pub created_at: Option, - #[serde(default = "default_2246")] + #[serde(default = "default_2252")] pub resolved_at: Option, } @@ -51113,22 +51411,22 @@ pub struct ProjectionFailureRetryRow { pub projection: String, pub retried: bool, pub resolved: bool, - #[serde(default = "default_2247")] + #[serde(default = "default_2253")] pub abandoned: bool, - #[serde(default = "default_2248")] + #[serde(default = "default_2254")] pub reason: String, - #[serde(default = "default_2249")] + #[serde(default = "default_2255")] pub error: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct ProjectionFailureRetryOutput { - #[serde(default = "default_2250")] + #[serde(default = "default_2256")] pub results: Vec, pub retried: Integer, pub resolved: Integer, - #[serde(default = "default_2251")] + #[serde(default = "default_2257")] pub abandoned: Integer, } @@ -51210,15 +51508,15 @@ impl ProjectionFailureRetryInput { pub struct OrgModelCallsOutput { pub org: String, pub enabled: bool, - #[serde(default = "default_2252")] + #[serde(default = "default_2258")] pub reason: String, - #[serde(default = "default_2253")] + #[serde(default = "default_2259")] pub updated_by: String, - #[serde(default = "default_2254")] + #[serde(default = "default_2260")] pub updated_at: Option, - #[serde(default = "default_2255")] + #[serde(default = "default_2261")] pub locked: bool, - #[serde(default = "default_2256")] + #[serde(default = "default_2262")] pub locked_by: String, } @@ -51557,7 +51855,7 @@ impl PolicyDecisionsInput { #[non_exhaustive] pub struct PolicyDeleteOutput { pub removed: bool, - #[serde(default = "default_2257")] + #[serde(default = "default_2263")] pub widening: bool, } @@ -51623,12 +51921,12 @@ pub struct PolicyRuleOut { pub condition: std::collections::HashMap, pub description: String, pub enabled: bool, - #[serde(default = "default_2258")] + #[serde(default = "default_2264")] pub mode: String, pub created_by: String, - #[serde(default = "default_2259")] + #[serde(default = "default_2265")] pub created_at: Option, - #[serde(default = "default_2260")] + #[serde(default = "default_2266")] pub updated_at: Option, } @@ -51700,9 +51998,9 @@ impl PolicyListInput { pub struct PolicySetOutput { pub rule: PolicyRuleOut, pub leaf_count: Integer, - #[serde(default = "default_2261")] + #[serde(default = "default_2267")] pub widening: bool, - #[serde(default = "default_2262")] + #[serde(default = "default_2268")] pub change: Vec, } @@ -51972,37 +52270,37 @@ pub struct ProcedureEvolveOutput { pub revision: Integer, pub changed: bool, pub template: bool, - #[serde(default = "default_2263")] + #[serde(default = "default_2269")] pub folded_runs: Integer, - #[serde(default = "default_2264")] + #[serde(default = "default_2270")] pub gate: ProcedureEvolveOutputGate, - #[serde(default = "default_2265")] + #[serde(default = "default_2271")] pub gate_mode: String, - #[serde(default = "default_2266")] + #[serde(default = "default_2272")] pub gate_llr: f64, - #[serde(default = "default_2267")] + #[serde(default = "default_2273")] pub gate_before: std::collections::HashMap, - #[serde(default = "default_2268")] + #[serde(default = "default_2274")] pub gate_after: std::collections::HashMap, - #[serde(default = "default_2269")] + #[serde(default = "default_2275")] pub gate_cost_before: std::collections::HashMap, - #[serde(default = "default_2270")] + #[serde(default = "default_2276")] pub gate_cost_after: std::collections::HashMap, - #[serde(default = "default_2271")] + #[serde(default = "default_2277")] pub gate_reason: String, - #[serde(default = "default_2272")] + #[serde(default = "default_2278")] pub dead_end_steps: Vec, - #[serde(default = "default_2273")] + #[serde(default = "default_2279")] pub fail_prone_steps: Vec, - #[serde(default = "default_2274")] + #[serde(default = "default_2280")] pub fail_prone_transitions: Vec, - #[serde(default = "default_2275")] + #[serde(default = "default_2281")] pub run_stats: std::collections::HashMap, - #[serde(default = "default_2276")] + #[serde(default = "default_2282")] pub strikes: Integer, - #[serde(default = "default_2277")] + #[serde(default = "default_2283")] pub quarantined: bool, - #[serde(default = "default_2278")] + #[serde(default = "default_2284")] pub retention: std::collections::HashMap, } @@ -52225,9 +52523,9 @@ pub struct ProcedureForkOutput { pub memory_key: String, pub version: Integer, pub name: String, - #[serde(default = "default_2279")] + #[serde(default = "default_2285")] pub steps: Vec, - #[serde(default = "default_2280")] + #[serde(default = "default_2286")] pub forked_from: std::collections::HashMap, } @@ -52487,32 +52785,32 @@ pub enum ProcedureLocateOutputStatus { #[non_exhaustive] pub struct ProcedureLocateOutput { pub memory_key: String, - #[serde(default = "default_2281")] + #[serde(default = "default_2287")] pub name: String, - #[serde(default = "default_2282")] + #[serde(default = "default_2288")] pub status: ProcedureLocateOutputStatus, pub matched: bool, - #[serde(default = "default_2283")] + #[serde(default = "default_2289")] pub active: Option>, - #[serde(default = "default_2284")] + #[serde(default = "default_2290")] pub hops: Vec>>, - #[serde(default = "default_2285")] + #[serde(default = "default_2291")] pub entry_nodes: Vec, - #[serde(default = "default_2286")] + #[serde(default = "default_2292")] pub dominant_next: Vec, - #[serde(default = "default_2287")] + #[serde(default = "default_2293")] pub revisits: std::collections::HashMap, - #[serde(default = "default_2288")] + #[serde(default = "default_2294")] pub looping: bool, - #[serde(default = "default_2289")] + #[serde(default = "default_2295")] pub exits: Vec, - #[serde(default = "default_2290")] + #[serde(default = "default_2296")] pub failure_notes: Vec>, - #[serde(default = "default_2291")] + #[serde(default = "default_2297")] pub rendered: String, - #[serde(default = "default_2292")] + #[serde(default = "default_2298")] pub run_stats: std::collections::HashMap, - #[serde(default = "default_2293")] + #[serde(default = "default_2299")] pub for_agent: std::collections::HashMap, } @@ -52667,43 +52965,43 @@ pub struct ProcedureMatch { pub name: String, pub situation: String, pub steps: Vec, - #[serde(default = "default_2294")] + #[serde(default = "default_2300")] pub tags: Vec, - #[serde(default = "default_2295")] + #[serde(default = "default_2301")] pub metadata: std::collections::HashMap, pub similarity: f64, pub memory_key: String, pub namespace: String, - #[serde(default = "default_2296")] + #[serde(default = "default_2302")] pub graph: Option>, - #[serde(default = "default_2297")] + #[serde(default = "default_2303")] pub template: bool, - #[serde(default = "default_2298")] + #[serde(default = "default_2304")] pub run_stats: std::collections::HashMap, - #[serde(default = "default_2299")] + #[serde(default = "default_2305")] pub status: ProcedureMatchStatus, - #[serde(default = "default_2300")] + #[serde(default = "default_2306")] pub quarantined: Option>, - #[serde(default = "default_2301")] + #[serde(default = "default_2307")] pub fail_prone_steps: Vec, - #[serde(default = "default_2302")] + #[serde(default = "default_2308")] pub revision: Integer, - #[serde(default = "default_2303")] + #[serde(default = "default_2309")] pub rejected_revisions: Vec>, - #[serde(default = "default_2304")] + #[serde(default = "default_2310")] pub tool_overlap: f64, - #[serde(default = "default_2305")] + #[serde(default = "default_2311")] pub score: f64, - #[serde(default = "default_2306")] + #[serde(default = "default_2312")] pub utility: f64, - #[serde(default = "default_2307")] + #[serde(default = "default_2313")] pub goal_similarity: Option, - #[serde(default = "default_2308")] + #[serde(default = "default_2314")] pub for_agent: std::collections::HashMap, - #[serde(default = "default_2309")] + #[serde(default = "default_2315")] pub run_stats_by_agent: std::collections::HashMap>, - #[serde(default = "default_2310")] + #[serde(default = "default_2316")] pub actor: String, } @@ -52711,11 +53009,11 @@ pub struct ProcedureMatch { #[non_exhaustive] pub struct ProcedureMatchOutput { pub matches: Vec, - #[serde(default = "default_2311")] + #[serde(default = "default_2317")] pub matched: Integer, - #[serde(default = "default_2312")] + #[serde(default = "default_2318")] pub procedure_key: String, - #[serde(default = "default_2313")] + #[serde(default = "default_2319")] pub score: f64, } @@ -53107,9 +53405,9 @@ pub struct ProcedureReviseOutput { pub revision: Integer, pub prior_revision: Integer, pub digest: String, - #[serde(default = "default_2314")] + #[serde(default = "default_2320")] pub steps: Vec, - #[serde(default = "default_2315")] + #[serde(default = "default_2321")] pub outcome: ProcedureReviseOutputOutcome, } @@ -53221,14 +53519,14 @@ pub struct ProfileActivityEntry { pub agent: String, pub last_activated_at: String, pub event_count: Integer, - #[serde(default = "default_2316")] + #[serde(default = "default_2322")] pub operations: Vec, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct ProfileActivityOutput { - #[serde(default = "default_2317")] + #[serde(default = "default_2323")] pub entries: Vec, } @@ -53336,17 +53634,17 @@ impl ProfileActivityInput { #[non_exhaustive] pub struct ProfileMutationOutput { pub version: Integer, - #[serde(default = "default_2318")] + #[serde(default = "default_2324")] pub memory_id: String, - #[serde(default = "default_2319")] + #[serde(default = "default_2325")] pub content_sha256: String, - #[serde(default = "default_2320")] + #[serde(default = "default_2326")] pub namespace: String, - #[serde(default = "default_2321")] + #[serde(default = "default_2327")] pub label: String, - #[serde(default = "default_2322")] + #[serde(default = "default_2328")] pub char_limit: Option, - #[serde(default = "default_2323")] + #[serde(default = "default_2329")] pub value_length: Integer, } @@ -53455,7 +53753,7 @@ pub struct ProfileRenderOutput { pub rendered: String, pub section_count: Integer, pub total_chars: Integer, - #[serde(default = "default_2324")] + #[serde(default = "default_2330")] pub labels: Vec, } @@ -53840,17 +54138,17 @@ pub enum ProfileStructuredOutputStatus { #[non_exhaustive] pub struct ProfileStructuredOutput { pub status: ProfileStructuredOutputStatus, - #[serde(default = "default_2325")] + #[serde(default = "default_2331")] pub profile: std::collections::HashMap, - #[serde(default = "default_2326")] + #[serde(default = "default_2332")] pub built_at: Option, - #[serde(default = "default_2327")] + #[serde(default = "default_2333")] pub memory_id: String, - #[serde(default = "default_2328")] + #[serde(default = "default_2334")] pub version: Integer, - #[serde(default = "default_2329")] + #[serde(default = "default_2335")] pub version_text: String, - #[serde(default = "default_2330")] + #[serde(default = "default_2336")] pub schema_sha256: String, } @@ -53967,13 +54265,13 @@ impl ProfileStructuredInput { #[non_exhaustive] pub struct ProfileSchemaOutput { pub found: bool, - #[serde(default = "default_2331")] + #[serde(default = "default_2337")] pub json_schema: std::collections::HashMap, - #[serde(default = "default_2332")] + #[serde(default = "default_2338")] pub schema_sha256: String, - #[serde(default = "default_2333")] + #[serde(default = "default_2339")] pub updated_by: String, - #[serde(default = "default_2334")] + #[serde(default = "default_2340")] pub updated_at: Option, } @@ -54126,10 +54424,10 @@ pub enum RunBeginOutputStatus { #[non_exhaustive] pub struct RunBeginOutput { pub run_id: String, - #[serde(default = "default_2335")] + #[serde(default = "default_2341")] pub status: RunBeginOutputStatus, pub started_at: String, - #[serde(default = "default_2336")] + #[serde(default = "default_2342")] pub next: String, } @@ -54337,31 +54635,31 @@ pub struct RunCompleteOutput { pub run_id: String, pub status: RunCompleteOutputStatus, pub duration_ms: Integer, - #[serde(default = "default_2337")] + #[serde(default = "default_2343")] pub used_applied: Integer, - #[serde(default = "default_2338")] + #[serde(default = "default_2344")] pub undelivered: Integer, - #[serde(default = "default_2339")] + #[serde(default = "default_2345")] pub evidence_applied: Integer, - #[serde(default = "default_2340")] + #[serde(default = "default_2346")] pub harm_applied: Integer, - #[serde(default = "default_2341")] + #[serde(default = "default_2347")] pub memories_written: Vec, - #[serde(default = "default_2342")] + #[serde(default = "default_2348")] pub recalled: Integer, - #[serde(default = "default_2343")] + #[serde(default = "default_2349")] pub observations: Integer, - #[serde(default = "default_2344")] + #[serde(default = "default_2350")] pub procedure_runs_recorded: Integer, - #[serde(default = "default_2345")] + #[serde(default = "default_2351")] pub reflection_key: String, - #[serde(default = "default_2346")] + #[serde(default = "default_2352")] pub retain: String, - #[serde(default = "default_2347")] + #[serde(default = "default_2353")] pub retained: Integer, - #[serde(default = "default_2348")] + #[serde(default = "default_2354")] pub demoted: Integer, - #[serde(default = "default_2349")] + #[serde(default = "default_2355")] pub expiring: Integer, } @@ -54902,25 +55200,25 @@ pub enum RunGetOutputOverBudgetItem { #[non_exhaustive] pub struct RunGetOutput { pub found: bool, - #[serde(default = "default_2350")] + #[serde(default = "default_2356")] pub run: Option, - #[serde(default = "default_2351")] + #[serde(default = "default_2357")] pub recalled: Integer, - #[serde(default = "default_2352")] + #[serde(default = "default_2358")] pub recalled_keys: Vec, - #[serde(default = "default_2353")] + #[serde(default = "default_2359")] pub memories_written: Vec, - #[serde(default = "default_2354")] + #[serde(default = "default_2360")] pub observations: Integer, - #[serde(default = "default_2355")] + #[serde(default = "default_2361")] pub turns: Integer, - #[serde(default = "default_2356")] + #[serde(default = "default_2362")] pub unpriced_turns: Integer, - #[serde(default = "default_2357")] + #[serde(default = "default_2363")] pub cost_usd: f64, - #[serde(default = "default_2358")] + #[serde(default = "default_2364")] pub elapsed_seconds: Integer, - #[serde(default = "default_2359")] + #[serde(default = "default_2365")] pub over_budget: Vec, } @@ -54987,17 +55285,17 @@ pub struct RunGradeProposal { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct RunGradeOutput { - #[serde(default = "default_2360")] + #[serde(default = "default_2366")] pub graded: Integer, - #[serde(default = "default_2361")] + #[serde(default = "default_2367")] pub run_ids: Vec, - #[serde(default = "default_2362")] + #[serde(default = "default_2368")] pub skipped_active: Integer, - #[serde(default = "default_2363")] + #[serde(default = "default_2369")] pub unchanged: Integer, - #[serde(default = "default_2364")] + #[serde(default = "default_2370")] pub memories_counted: Integer, - #[serde(default = "default_2365")] + #[serde(default = "default_2371")] pub proposals_decided: Vec, } @@ -55112,7 +55410,7 @@ impl RunGradeInput { #[non_exhaustive] pub struct RunListOutput { pub runs: Vec, - #[serde(default = "default_2366")] + #[serde(default = "default_2372")] pub total: Option, } @@ -55349,7 +55647,7 @@ pub enum RunRelianceItemState { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct RunRelianceRevision { - #[serde(default = "default_2367")] + #[serde(default = "default_2373")] pub versions: Vec, } @@ -55359,9 +55657,9 @@ pub struct RunRelianceItem { pub kind: String, pub key: String, pub state: RunRelianceItemState, - #[serde(default = "default_2368")] + #[serde(default = "default_2374")] pub revisions: Vec, - #[serde(default = "default_2369")] + #[serde(default = "default_2375")] pub last_served_at: String, } @@ -55369,9 +55667,9 @@ pub struct RunRelianceItem { #[non_exhaustive] pub struct RunRelianceOutput { pub found: bool, - #[serde(default = "default_2370")] + #[serde(default = "default_2376")] pub items: Vec, - #[serde(default = "default_2371")] + #[serde(default = "default_2377")] pub truncated: bool, } @@ -55420,19 +55718,19 @@ impl RunRelianceInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct RunRetractCreditOutput { - #[serde(default = "default_2372")] + #[serde(default = "default_2378")] pub run_id: String, - #[serde(default = "default_2373")] + #[serde(default = "default_2379")] pub used_retracted: Integer, - #[serde(default = "default_2374")] + #[serde(default = "default_2380")] pub evidence_retracted: Integer, - #[serde(default = "default_2375")] + #[serde(default = "default_2381")] pub harm_retracted: Integer, - #[serde(default = "default_2376")] + #[serde(default = "default_2382")] pub events_written: Integer, - #[serde(default = "default_2377")] + #[serde(default = "default_2383")] pub more: bool, - #[serde(default = "default_2378")] + #[serde(default = "default_2384")] pub dry_run: bool, } @@ -55589,39 +55887,39 @@ pub struct LiveSearchHit { pub title: String, pub url: String, pub provider: LiveSearchHitProvider, - #[serde(default = "default_2381")] + #[serde(default = "default_2387")] pub content: String, - #[serde(default = "default_2382")] + #[serde(default = "default_2388")] pub live: LiveSearchHitLive, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct LiveSearchResults { - #[serde(default = "default_2380")] + #[serde(default = "default_2386")] pub live: LiveSearchResultsLive, - #[serde(default = "default_2383")] + #[serde(default = "default_2389")] pub results: Vec, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct SearchOutput { - #[serde(default = "default_2379")] + #[serde(default = "default_2385")] pub tracker: Option>, - #[serde(default = "default_2384")] + #[serde(default = "default_2390")] pub live: Option, - #[serde(default = "default_2385")] + #[serde(default = "default_2391")] pub memory: std::collections::HashMap, - #[serde(default = "default_2386")] + #[serde(default = "default_2392")] pub knowledge: std::collections::HashMap, - #[serde(default = "default_2387")] + #[serde(default = "default_2393")] pub profile: std::collections::HashMap, - #[serde(default = "default_2388")] + #[serde(default = "default_2394")] pub conversations: std::collections::HashMap, - #[serde(default = "default_2389")] + #[serde(default = "default_2395")] pub withheld: Option>, - #[serde(default = "default_2390")] + #[serde(default = "default_2396")] pub namespaces_skipped: Vec, } @@ -55825,7 +56123,7 @@ impl SearchInput { pub struct SessionBriefDeleteOutput { pub deleted: bool, pub brief_key: String, - #[serde(default = "default_2391")] + #[serde(default = "default_2397")] pub revision: Integer, } @@ -55918,67 +56216,67 @@ impl SessionBriefDeleteInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct BriefDecision { - #[serde(default = "default_2400")] + #[serde(default = "default_2406")] pub what: String, - #[serde(default = "default_2401")] + #[serde(default = "default_2407")] pub why: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct BriefDeadEnd { - #[serde(default = "default_2403")] + #[serde(default = "default_2409")] pub tried: String, - #[serde(default = "default_2404")] + #[serde(default = "default_2410")] pub why_not: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct BriefDone { - #[serde(default = "default_2406")] + #[serde(default = "default_2412")] pub what: String, - #[serde(rename = "ref", default = "default_2407")] + #[serde(rename = "ref", default = "default_2413")] pub r#ref: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct BriefFile { - #[serde(default = "default_2411")] + #[serde(default = "default_2417")] pub path: String, - #[serde(default = "default_2412")] + #[serde(default = "default_2418")] pub role: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct BriefSections { - #[serde(default = "default_2397")] + #[serde(default = "default_2403")] pub goal: String, - #[serde(default = "default_2398")] + #[serde(default = "default_2404")] pub status: String, - #[serde(default = "default_2399")] + #[serde(default = "default_2405")] pub verification: String, - #[serde(default = "default_2402")] + #[serde(default = "default_2408")] pub decisions: Vec, - #[serde(default = "default_2405")] + #[serde(default = "default_2411")] pub dead_ends: Vec, - #[serde(default = "default_2408")] + #[serde(default = "default_2414")] pub done: Vec, - #[serde(default = "default_2409")] + #[serde(default = "default_2415")] pub open_questions: Vec, - #[serde(default = "default_2410")] + #[serde(default = "default_2416")] pub next_steps: Vec, - #[serde(default = "default_2413")] + #[serde(default = "default_2419")] pub files: Vec, - #[serde(default = "default_2414")] + #[serde(default = "default_2420")] pub constraints: Vec, - #[serde(default = "default_2415")] + #[serde(default = "default_2421")] pub pointers: Vec, - #[serde(default = "default_2416")] + #[serde(default = "default_2422")] pub client_summary: String, - #[serde(default = "default_2417")] + #[serde(default = "default_2423")] pub client_summary_at: String, } @@ -55986,45 +56284,45 @@ pub struct BriefSections { #[non_exhaustive] pub struct SessionBriefGetOutput { pub found: bool, - #[serde(default = "default_2392")] + #[serde(default = "default_2398")] pub brief_key: String, - #[serde(default = "default_2393")] + #[serde(default = "default_2399")] pub revision: Integer, - #[serde(default = "default_2394")] + #[serde(default = "default_2400")] pub snapshot_id: String, - #[serde(default = "default_2395")] + #[serde(default = "default_2401")] pub snapshot_key: String, - #[serde(default = "default_2396")] + #[serde(default = "default_2402")] pub rendered: String, - #[serde(default = "default_2418")] + #[serde(default = "default_2424")] pub sections: Option, - #[serde(default = "default_2419")] + #[serde(default = "default_2425")] pub project: String, - #[serde(default = "default_2420")] + #[serde(default = "default_2426")] pub branch: String, - #[serde(default = "default_2421")] + #[serde(default = "default_2427")] pub head_sha: String, - #[serde(default = "default_2422")] + #[serde(default = "default_2428")] pub author: String, - #[serde(default = "default_2423")] + #[serde(default = "default_2429")] pub trigger: String, - #[serde(default = "default_2424")] + #[serde(default = "default_2430")] pub actor: String, - #[serde(default = "default_2425")] + #[serde(default = "default_2431")] pub source_sessions: Vec, - #[serde(default = "default_2426")] + #[serde(default = "default_2432")] pub updated_at: Option, - #[serde(default = "default_2427")] + #[serde(default = "default_2433")] pub age_seconds: Integer, - #[serde(default = "default_2428")] + #[serde(default = "default_2434")] pub revisions: Integer, - #[serde(default = "default_2429")] + #[serde(default = "default_2435")] pub events_total: Integer, - #[serde(default = "default_2430")] + #[serde(default = "default_2436")] pub source_chars: Integer, - #[serde(default = "default_2431")] + #[serde(default = "default_2437")] pub brief_chars: Integer, - #[serde(default = "default_2432")] + #[serde(default = "default_2438")] pub deleted: bool, } @@ -56199,34 +56497,34 @@ impl SessionBriefGetInput { pub struct SessionBriefSummary { pub brief_key: String, pub revision: Integer, - #[serde(default = "default_2433")] + #[serde(default = "default_2439")] pub project: String, - #[serde(default = "default_2434")] + #[serde(default = "default_2440")] pub branch: String, - #[serde(default = "default_2435")] + #[serde(default = "default_2441")] pub agent: String, - #[serde(default = "default_2436")] + #[serde(default = "default_2442")] pub goal: String, - #[serde(default = "default_2437")] + #[serde(default = "default_2443")] pub status: String, - #[serde(default = "default_2438")] + #[serde(default = "default_2444")] pub author: String, - #[serde(default = "default_2439")] + #[serde(default = "default_2445")] pub actor: String, - #[serde(default = "default_2440")] + #[serde(default = "default_2446")] pub updated_at: Option, - #[serde(default = "default_2441")] + #[serde(default = "default_2447")] pub age_seconds: Integer, - #[serde(default = "default_2442")] + #[serde(default = "default_2448")] pub brief_chars: Integer, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct SessionBriefListOutput { - #[serde(default = "default_2443")] + #[serde(default = "default_2449")] pub briefs: Vec, - #[serde(default = "default_2444")] + #[serde(default = "default_2450")] pub rendered: String, } @@ -56366,25 +56664,25 @@ impl SessionBriefListInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct SessionBriefStats { - #[serde(default = "default_2448")] + #[serde(default = "default_2454")] pub events_in: Integer, - #[serde(default = "default_2449")] + #[serde(default = "default_2455")] pub windows: Integer, - #[serde(default = "default_2450")] + #[serde(default = "default_2456")] pub events_total: Integer, - #[serde(default = "default_2451")] + #[serde(default = "default_2457")] pub source_chars: Integer, - #[serde(default = "default_2452")] + #[serde(default = "default_2458")] pub brief_chars: Integer, - #[serde(default = "default_2453")] + #[serde(default = "default_2459")] pub compression_ratio: f64, - #[serde(default = "default_2454")] + #[serde(default = "default_2460")] pub dropped_ungrounded: Integer, - #[serde(default = "default_2455")] + #[serde(default = "default_2461")] pub tokens_in: Integer, - #[serde(default = "default_2456")] + #[serde(default = "default_2462")] pub tokens_out: Integer, - #[serde(default = "default_2457")] + #[serde(default = "default_2463")] pub llm_model: String, } @@ -56394,13 +56692,13 @@ pub struct SessionBriefSaveOutput { pub brief_key: String, pub revision: Integer, pub changed: bool, - #[serde(default = "default_2445")] + #[serde(default = "default_2451")] pub author: String, - #[serde(default = "default_2446")] + #[serde(default = "default_2452")] pub reason: String, - #[serde(default = "default_2447")] + #[serde(default = "default_2453")] pub rendered: String, - #[serde(default = "default_2458")] + #[serde(default = "default_2464")] pub stats: SessionBriefStats, } @@ -57145,39 +57443,39 @@ pub struct TaskPayload { pub priority: Integer, pub disclosure: TaskPayloadDisclosure, pub status: TaskPayloadStatus, - #[serde(default = "default_2459")] + #[serde(default = "default_2465")] pub reason: String, - #[serde(default = "default_2460")] + #[serde(default = "default_2466")] pub blocked_on: String, - #[serde(default = "default_2461")] + #[serde(default = "default_2467")] pub not_before: Option, - #[serde(default = "default_2462")] + #[serde(default = "default_2468")] pub resume_at: Option, - #[serde(default = "default_2463")] + #[serde(default = "default_2469")] pub deadline: Option, - #[serde(default = "default_2464")] + #[serde(default = "default_2470")] pub defer_count: Integer, pub title: String, - #[serde(default = "default_2465")] + #[serde(default = "default_2471")] pub brief: std::collections::HashMap, pub from_agent: String, - #[serde(default = "default_2466")] + #[serde(default = "default_2472")] pub from_subject: String, - #[serde(default = "default_2467")] + #[serde(default = "default_2473")] pub origin: String, - #[serde(default = "default_2468")] + #[serde(default = "default_2474")] pub parent_task_id: Option, - #[serde(default = "default_2469")] + #[serde(default = "default_2475")] pub owner: String, - #[serde(default = "default_2470")] + #[serde(default = "default_2476")] pub attempt: Integer, - #[serde(default = "default_2471")] + #[serde(default = "default_2477")] pub fence: Integer, - #[serde(default = "default_2472")] + #[serde(default = "default_2478")] pub lease_until: Option, - #[serde(default = "default_2473")] + #[serde(default = "default_2479")] pub outcome: std::collections::HashMap, - #[serde(default = "default_2474")] + #[serde(default = "default_2480")] pub last_actor: String, pub created_at: String, pub updated_at: String, @@ -57188,7 +57486,7 @@ pub struct TaskPayload { #[non_exhaustive] pub struct TaskOutput { pub task: TaskPayload, - #[serde(default = "default_2475")] + #[serde(default = "default_2481")] pub seq: Integer, } @@ -57589,10 +57887,10 @@ impl TaskCompleteInput { pub struct InboxCount { pub inbox: String, pub status: String, - #[serde(default = "default_2476")] + #[serde(default = "default_2482")] pub blocked_on: String, pub n: Integer, - #[serde(default = "default_2477")] + #[serde(default = "default_2483")] pub oldest: Option, } @@ -57679,7 +57977,7 @@ pub struct TaskCreateOutput { pub task: TaskPayload, pub created: bool, pub seq: Integer, - #[serde(default = "default_2478")] + #[serde(default = "default_2484")] pub next: String, } @@ -58018,7 +58316,7 @@ impl TaskFailInput { #[non_exhaustive] pub struct TaskGetOutput { pub found: bool, - #[serde(default = "default_2479")] + #[serde(default = "default_2485")] pub task: Option, } @@ -58152,23 +58450,23 @@ pub struct TaskEventPayload { pub task_id: String, pub inbox: String, pub event: String, - #[serde(default = "default_2480")] + #[serde(default = "default_2486")] pub from_status: String, - #[serde(default = "default_2481")] + #[serde(default = "default_2487")] pub to_status: String, - #[serde(default = "default_2482")] + #[serde(default = "default_2488")] pub actor: String, - #[serde(default = "default_2483")] + #[serde(default = "default_2489")] pub agent: String, - #[serde(default = "default_2484")] + #[serde(default = "default_2490")] pub fence: Integer, - #[serde(default = "default_2485")] + #[serde(default = "default_2491")] pub version: Integer, - #[serde(default = "default_2486")] + #[serde(default = "default_2492")] pub reason: String, - #[serde(default = "default_2487")] + #[serde(default = "default_2493")] pub patch: std::collections::HashMap, - #[serde(default = "default_2488")] + #[serde(default = "default_2494")] pub note: String, pub ts: String, } @@ -58508,7 +58806,7 @@ pub struct TaskPullOutput { pub tasks: Vec, pub waited_ms: Integer, pub backend: String, - #[serde(default = "default_2489")] + #[serde(default = "default_2495")] pub note: String, } @@ -58904,7 +59202,7 @@ impl TaskUnblockInput { pub struct TaskUpdateOutput { pub task: TaskPayload, pub seq: Integer, - #[serde(default = "default_2490")] + #[serde(default = "default_2496")] pub conflict: bool, } @@ -59267,19 +59565,19 @@ impl TaskReasonInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerAnswerOutput { - #[serde(default = "default_2491")] + #[serde(default = "default_2497")] pub intent: String, - #[serde(default = "default_2492")] + #[serde(default = "default_2498")] pub anchors: std::collections::HashMap, - #[serde(default = "default_2493")] + #[serde(default = "default_2499")] pub sections: Vec>, - #[serde(default = "default_2494")] + #[serde(default = "default_2500")] pub searched: Vec, - #[serde(default = "default_2495")] + #[serde(default = "default_2501")] pub lines: Vec, - #[serde(default = "default_2496")] + #[serde(default = "default_2502")] pub restricted: bool, - #[serde(default = "default_2497")] + #[serde(default = "default_2503")] pub verdict: String, } @@ -59375,17 +59673,17 @@ impl TrackerAnswerInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerBindingOutput { - #[serde(default = "default_2498")] + #[serde(default = "default_2504")] pub tracker_namespace: String, - #[serde(default = "default_2499")] + #[serde(default = "default_2505")] pub tracker_namespaces: Vec, - #[serde(default = "default_2500")] + #[serde(default = "default_2506")] pub restricted: bool, - #[serde(default = "default_2501")] + #[serde(default = "default_2507")] pub kind: String, - #[serde(default = "default_2502")] + #[serde(default = "default_2508")] pub authorized: bool, - #[serde(default = "default_2503")] + #[serde(default = "default_2509")] pub templates: Vec, } @@ -59438,13 +59736,13 @@ impl TrackerBindingInput { #[non_exhaustive] pub struct TrackerComponentOutput { pub component: String, - #[serde(default = "default_2504")] + #[serde(default = "default_2510")] pub risk: std::collections::HashMap, - #[serde(default = "default_2505")] + #[serde(default = "default_2511")] pub open_issues: Vec>, - #[serde(default = "default_2506")] + #[serde(default = "default_2512")] pub known: bool, - #[serde(default = "default_2507")] + #[serde(default = "default_2513")] pub tracker_unavailable: bool, } @@ -59505,9 +59803,9 @@ impl TrackerComponentInput { #[non_exhaustive] pub struct TrackerContractOutput { pub database: String, - #[serde(default = "default_2508")] + #[serde(default = "default_2514")] pub tables: Vec>, - #[serde(default = "default_2509")] + #[serde(default = "default_2515")] pub templates: std::collections::HashMap, } @@ -59560,66 +59858,66 @@ impl TrackerContractInput { #[non_exhaustive] pub struct TrackerLegStatus { pub name: String, - #[serde(default = "default_2520")] + #[serde(default = "default_2526")] pub status: String, - #[serde(default = "default_2521")] + #[serde(default = "default_2527")] pub reason: String, - #[serde(default = "default_2522")] + #[serde(default = "default_2528")] pub message: String, - #[serde(default = "default_2523")] + #[serde(default = "default_2529")] pub retried: bool, - #[serde(default = "default_2524")] + #[serde(default = "default_2530")] pub ms: Integer, - #[serde(default = "default_2525")] + #[serde(default = "default_2531")] pub cause: String, - #[serde(default = "default_2526")] + #[serde(default = "default_2532")] pub namespace: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerDuplicateCheckOutput { - #[serde(default = "default_2510")] + #[serde(default = "default_2516")] pub verdict: String, - #[serde(default = "default_2511")] + #[serde(default = "default_2517")] pub items: Vec>, - #[serde(default = "default_2512")] + #[serde(default = "default_2518")] pub undecided: bool, - #[serde(default = "default_2513")] + #[serde(default = "default_2519")] pub epistemic: String, - #[serde(default = "default_2514")] + #[serde(default = "default_2520")] pub thresholds: std::collections::HashMap, - #[serde(default = "default_2515")] + #[serde(default = "default_2521")] pub judge: std::collections::HashMap, - #[serde(default = "default_2516")] + #[serde(default = "default_2522")] pub fit_at: String, - #[serde(default = "default_2517")] + #[serde(default = "default_2523")] pub fit: std::collections::HashMap, - #[serde(default = "default_2518")] + #[serde(default = "default_2524")] pub query: std::collections::HashMap, - #[serde(default = "default_2519")] + #[serde(default = "default_2525")] pub legs: std::collections::HashMap, - #[serde(default = "default_2527")] + #[serde(default = "default_2533")] pub leg_status: Vec, - #[serde(default = "default_2528")] + #[serde(default = "default_2534")] pub tracker_unavailable: bool, - #[serde(default = "default_2529")] + #[serde(default = "default_2535")] pub namespaces: Vec, - #[serde(default = "default_2530")] + #[serde(default = "default_2536")] pub by_namespace: std::collections::HashMap>, - #[serde(default = "default_2531")] + #[serde(default = "default_2537")] pub closest: Vec>, - #[serde(default = "default_2532")] + #[serde(default = "default_2538")] pub needs: Vec>, - #[serde(default = "default_2533")] + #[serde(default = "default_2539")] pub closest_note: String, - #[serde(default = "default_2534")] + #[serde(default = "default_2540")] pub nearest: Vec>, - #[serde(default = "default_2535")] + #[serde(default = "default_2541")] pub rerank: std::collections::HashMap, - #[serde(default = "default_2536")] + #[serde(default = "default_2542")] pub answer: String, - #[serde(default = "default_2537")] + #[serde(default = "default_2543")] pub related_prs: Vec>, } @@ -59826,17 +60124,17 @@ impl TrackerDuplicateCheckInput { #[non_exhaustive] pub struct TrackerFlakyOutput { pub test_name: String, - #[serde(default = "default_2538")] + #[serde(default = "default_2544")] pub known_flaky: bool, - #[serde(default = "default_2539")] + #[serde(default = "default_2545")] pub open_issues: Integer, - #[serde(default = "default_2540")] + #[serde(default = "default_2546")] pub issues: Vec>, - #[serde(default = "default_2541")] + #[serde(default = "default_2547")] pub verdict: String, - #[serde(default = "default_2542")] + #[serde(default = "default_2548")] pub tracker_unavailable: bool, - #[serde(default = "default_2543")] + #[serde(default = "default_2549")] pub signal: Option>, } @@ -59919,9 +60217,9 @@ impl TrackerFlakyInput { #[non_exhaustive] pub struct TrackerItemOutput { pub items: Vec>, - #[serde(default = "default_2544")] + #[serde(default = "default_2550")] pub unknown: Vec, - #[serde(default = "default_2545")] + #[serde(default = "default_2551")] pub tracker_unavailable: bool, } @@ -59970,19 +60268,19 @@ impl TrackerItemInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerLinksOutput { - #[serde(default = "default_2546")] + #[serde(default = "default_2552")] pub subject: std::collections::HashMap, - #[serde(default = "default_2547")] + #[serde(default = "default_2553")] pub verdict: String, - #[serde(default = "default_2548")] + #[serde(default = "default_2554")] pub items: Vec>, - #[serde(default = "default_2549")] + #[serde(default = "default_2555")] pub epistemic: String, - #[serde(default = "default_2550")] + #[serde(default = "default_2556")] pub record: std::collections::HashMap, - #[serde(default = "default_2551")] + #[serde(default = "default_2557")] pub computed_at: String, - #[serde(default = "default_2552")] + #[serde(default = "default_2558")] pub tracker_unavailable: bool, } @@ -60080,11 +60378,11 @@ impl TrackerLinksInput { pub struct TrackerReleaseOutput { pub version: String, pub blockers: Vec>, - #[serde(default = "default_2553")] + #[serde(default = "default_2559")] pub active_blockers: Integer, - #[serde(default = "default_2554")] + #[serde(default = "default_2560")] pub health: std::collections::HashMap, - #[serde(default = "default_2555")] + #[serde(default = "default_2561")] pub tracker_unavailable: bool, } @@ -60133,17 +60431,17 @@ impl TrackerReleaseInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerSimilarOutput { - #[serde(default = "default_2556")] + #[serde(default = "default_2562")] pub items: Vec>, - #[serde(default = "default_2557")] + #[serde(default = "default_2563")] pub query: std::collections::HashMap, - #[serde(default = "default_2558")] + #[serde(default = "default_2564")] pub legs: std::collections::HashMap, - #[serde(default = "default_2559")] + #[serde(default = "default_2565")] pub epistemic: String, - #[serde(default = "default_2560")] + #[serde(default = "default_2566")] pub tracker_unavailable: bool, - #[serde(default = "default_2561")] + #[serde(default = "default_2567")] pub namespaces: Vec, } @@ -60264,19 +60562,19 @@ pub struct TrackerSourceAddOutput { pub name: String, pub host: String, pub database: String, - #[serde(default = "default_2562")] + #[serde(default = "default_2568")] pub namespaces: Vec>, - #[serde(default = "default_2563")] + #[serde(default = "default_2569")] pub contract: std::collections::HashMap, - #[serde(default = "default_2564")] + #[serde(default = "default_2570")] pub roles: Vec, - #[serde(default = "default_2565")] + #[serde(default = "default_2571")] pub my_role: String, - #[serde(default = "default_2566")] + #[serde(default = "default_2572")] pub dry_run: bool, - #[serde(default = "default_2567")] + #[serde(default = "default_2573")] pub written: bool, - #[serde(default = "default_2568")] + #[serde(default = "default_2574")] pub view_templates: std::collections::HashMap, } @@ -60439,13 +60737,13 @@ impl TrackerSourceAddInput { #[non_exhaustive] pub struct TrackerSourceCheckOutput { pub name: String, - #[serde(default = "default_2569")] + #[serde(default = "default_2575")] pub database: String, - #[serde(default = "default_2570")] + #[serde(default = "default_2576")] pub reachable: bool, - #[serde(default = "default_2571")] + #[serde(default = "default_2577")] pub contract: std::collections::HashMap, - #[serde(default = "default_2572")] + #[serde(default = "default_2578")] pub view_templates: std::collections::HashMap, } @@ -60485,11 +60783,11 @@ impl TrackerSourceCheckInput { pub struct TrackerSourceInspectOutput { pub host: String, pub database: String, - #[serde(default = "default_2573")] + #[serde(default = "default_2579")] pub tables: Vec>, - #[serde(default = "default_2574")] + #[serde(default = "default_2580")] pub roles: Vec, - #[serde(default = "default_2575")] + #[serde(default = "default_2581")] pub proposal: std::collections::HashMap, } @@ -60618,9 +60916,9 @@ impl TrackerSourceInspectInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerSourceListOutput { - #[serde(default = "default_2576")] + #[serde(default = "default_2582")] pub sources: Vec>, - #[serde(default = "default_2577")] + #[serde(default = "default_2583")] pub self_service: bool, } @@ -60673,9 +60971,9 @@ impl TrackerSourceListInput { #[non_exhaustive] pub struct TrackerSourceRemoveOutput { pub name: String, - #[serde(default = "default_2578")] + #[serde(default = "default_2584")] pub deactivated: bool, - #[serde(default = "default_2579")] + #[serde(default = "default_2585")] pub namespaces_retired: Vec, } @@ -60716,9 +61014,9 @@ impl TrackerSourceRemoveInput { #[non_exhaustive] pub struct TrackerSourceRotateOutput { pub name: String, - #[serde(default = "default_2580")] + #[serde(default = "default_2586")] pub contract: std::collections::HashMap, - #[serde(default = "default_2581")] + #[serde(default = "default_2587")] pub rotated_at: String, } @@ -60765,11 +61063,11 @@ impl TrackerSourceRotateInput { #[non_exhaustive] pub struct TrackerSourceSetMappingOutput { pub name: String, - #[serde(default = "default_2582")] + #[serde(default = "default_2588")] pub contract: std::collections::HashMap, - #[serde(default = "default_2583")] + #[serde(default = "default_2589")] pub dry_run: bool, - #[serde(default = "default_2584")] + #[serde(default = "default_2590")] pub written: bool, } @@ -60836,45 +61134,45 @@ impl TrackerSourceSetMappingInput { #[non_exhaustive] pub struct TrackerTestSignalOutput { pub test_name: String, - #[serde(default = "default_2585")] + #[serde(default = "default_2591")] pub verdict: String, - #[serde(default = "default_2586")] + #[serde(default = "default_2592")] pub why: Vec, - #[serde(default = "default_2587")] + #[serde(default = "default_2593")] pub lower_bound: f64, - #[serde(default = "default_2588")] + #[serde(default = "default_2594")] pub window_days: Integer, - #[serde(default = "default_2589")] + #[serde(default = "default_2595")] pub since: String, - #[serde(default = "default_2590")] + #[serde(default = "default_2596")] pub features: std::collections::HashMap, - #[serde(default = "default_2591")] + #[serde(default = "default_2597")] pub infra: std::collections::HashMap, - #[serde(default = "default_2592")] + #[serde(default = "default_2598")] pub churn: std::collections::HashMap, - #[serde(default = "default_2593")] + #[serde(default = "default_2599")] pub thresholds: std::collections::HashMap, - #[serde(default = "default_2594")] + #[serde(default = "default_2600")] pub source: String, - #[serde(default = "default_2595")] + #[serde(default = "default_2601")] pub timings_ms: std::collections::HashMap, - #[serde(default = "default_2596")] + #[serde(default = "default_2602")] pub tracker_unavailable: bool, - #[serde(default = "default_2597")] + #[serde(default = "default_2603")] pub rollup: std::collections::HashMap, - #[serde(default = "default_2598")] + #[serde(default = "default_2604")] pub streak: std::collections::HashMap, - #[serde(default = "default_2599")] + #[serde(default = "default_2605")] pub smells: std::collections::HashMap, - #[serde(default = "default_2600")] + #[serde(default = "default_2606")] pub prior: std::collections::HashMap, - #[serde(default = "default_2601")] + #[serde(default = "default_2607")] pub unavailable_reason: String, - #[serde(default = "default_2602")] + #[serde(default = "default_2608")] pub candidates: Vec>, - #[serde(default = "default_2603")] + #[serde(default = "default_2609")] pub candidate_matches: Integer, - #[serde(default = "default_2604")] + #[serde(default = "default_2610")] pub resolved_from: String, } @@ -60978,9 +61276,9 @@ impl TrackerTestSignalInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct UiVitalsOutput { - #[serde(default = "default_2605")] + #[serde(default = "default_2611")] pub recorded: bool, - #[serde(default = "default_2606")] + #[serde(default = "default_2612")] pub route: String, } @@ -61164,7 +61462,7 @@ pub struct WebhookDelivery { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct WebhookDeliveriesOutput { - #[serde(default = "default_2607")] + #[serde(default = "default_2613")] pub deliveries: Vec, } @@ -61286,14 +61584,14 @@ pub struct WebhookInfo { pub secret_ref: String, pub events: Vec, pub created_at: String, - #[serde(default = "default_2608")] + #[serde(default = "default_2614")] pub secret_present: bool, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct WebhookListOutput { - #[serde(default = "default_2609")] + #[serde(default = "default_2615")] pub webhooks: Vec, } @@ -61475,7 +61773,7 @@ pub struct WorkingMemoryMutationOutput { pub version: Integer, pub char_limit: Integer, pub value_length: Integer, - #[serde(default = "default_2610")] + #[serde(default = "default_2616")] pub fill_ratio: f64, } @@ -61699,15 +61997,15 @@ impl WorkingMemoryDeleteInput { pub struct WorkingMemoryGetOutput { pub found: bool, pub block_key: String, - #[serde(default = "default_2611")] + #[serde(default = "default_2617")] pub content: String, - #[serde(default = "default_2612")] + #[serde(default = "default_2618")] pub char_limit: Integer, - #[serde(default = "default_2613")] + #[serde(default = "default_2619")] pub version: Integer, - #[serde(default = "default_2614")] + #[serde(default = "default_2620")] pub updated_at: Option, - #[serde(default = "default_2615")] + #[serde(default = "default_2621")] pub fill_ratio: f64, } @@ -61818,7 +62116,7 @@ pub struct WorkingMemoryBlock { pub content: String, pub char_limit: Integer, pub version: Integer, - #[serde(default = "default_2616")] + #[serde(default = "default_2622")] pub updated_at: Option, } @@ -61826,7 +62124,7 @@ pub struct WorkingMemoryBlock { #[non_exhaustive] pub struct WorkingMemoryRenderOutput { pub rendered: String, - #[serde(default = "default_2617")] + #[serde(default = "default_2623")] pub blocks: Vec, pub block_count: Integer, pub total_chars: Integer, @@ -65300,4766 +65598,4784 @@ fn default_1033() -> Vec { fn default_1034() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1035() -> Option { +fn default_1035() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1036() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1037() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1038() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1039() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1036() -> bool { +fn default_1040() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1037() -> String { +fn default_1041() -> Option { + serde_json::from_str("null").expect("schema default") +} +fn default_1042() -> bool { + serde_json::from_str("false").expect("schema default") +} +fn default_1043() -> String { serde_json::from_str("\"memory\"").expect("schema default") } -fn default_1038() -> Option { +fn default_1044() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1039() -> Option { +fn default_1045() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1040() -> Option { +fn default_1046() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1041() -> String { +fn default_1047() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1042() -> String { +fn default_1048() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1043() -> String { +fn default_1049() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1044() -> HelpGetOutputAudience { +fn default_1050() -> HelpGetOutputAudience { serde_json::from_str("\"user\"").expect("schema default") } -fn default_1045() -> String { +fn default_1051() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1046() -> bool { +fn default_1052() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1047() -> Integer { +fn default_1053() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1048() -> String { +fn default_1054() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1049() -> Vec { +fn default_1055() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1050() -> String { +fn default_1056() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1051() -> Vec { +fn default_1057() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1052() -> Vec { +fn default_1058() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1053() -> String { +fn default_1059() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1054() -> String { +fn default_1060() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1055() -> String { +fn default_1061() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1056() -> Vec { +fn default_1062() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1057() -> String { +fn default_1063() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1058() -> bool { +fn default_1064() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1059() -> Vec { +fn default_1065() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1060() -> Vec { +fn default_1066() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1061() -> Option { +fn default_1067() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1062() -> bool { +fn default_1068() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1063() -> bool { +fn default_1069() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1064() -> Vec { +fn default_1070() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1065() -> Vec> { +fn default_1071() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1066() -> Integer { +fn default_1072() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1067() -> bool { +fn default_1073() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1068() -> String { +fn default_1074() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1069() -> String { +fn default_1075() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1070() -> String { +fn default_1076() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1071() -> String { +fn default_1077() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1072() -> std::collections::HashMap { +fn default_1078() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1073() -> String { +fn default_1079() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1074() -> Integer { +fn default_1080() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1075() -> Integer { +fn default_1081() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1076() -> Vec { +fn default_1082() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1077() -> Integer { +fn default_1083() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1078() -> Vec { +fn default_1084() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1079() -> bool { +fn default_1085() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_1080() -> String { +fn default_1086() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1081() -> Option { +fn default_1087() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1082() -> Option { +fn default_1088() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1083() -> Vec> { +fn default_1089() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1084() -> Option { +fn default_1090() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1085() -> bool { +fn default_1091() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1086() -> Integer { +fn default_1092() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1087() -> Vec { +fn default_1093() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1088() -> Vec> { +fn default_1094() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1089() -> Vec { +fn default_1095() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1090() -> Vec> { +fn default_1096() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1091() -> Vec { +fn default_1097() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1092() -> String { +fn default_1098() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1093() -> Vec { +fn default_1099() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1094() -> Vec { +fn default_1100() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1095() -> Option { +fn default_1101() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1096() -> Vec { +fn default_1102() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1097() -> Integer { +fn default_1103() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1098() -> Vec { +fn default_1104() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1099() -> String { +fn default_1105() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1100() -> Vec { +fn default_1106() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1101() -> Vec { +fn default_1107() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1102() -> Option { +fn default_1108() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1103() -> Option { +fn default_1109() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1104() -> bool { +fn default_1110() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1105() -> String { +fn default_1111() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1106() -> String { +fn default_1112() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1107() -> bool { +fn default_1113() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1108() -> String { +fn default_1114() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1109() -> String { +fn default_1115() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1110() -> String { +fn default_1116() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1111() -> Integer { +fn default_1117() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1112() -> String { +fn default_1118() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1113() -> String { +fn default_1119() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1114() -> String { +fn default_1120() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1115() -> Option> { +fn default_1121() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_1116() -> Vec { +fn default_1122() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1117() -> Integer { +fn default_1123() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1118() -> Integer { +fn default_1124() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1119() -> Option { +fn default_1125() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1120() -> String { +fn default_1126() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1121() -> String { +fn default_1127() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1122() -> bool { +fn default_1128() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1123() -> Option { +fn default_1129() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1124() -> Option { +fn default_1130() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1125() -> Option { +fn default_1131() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1126() -> Option { +fn default_1132() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1127() -> Option { +fn default_1133() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1128() -> Vec { +fn default_1134() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1129() -> Vec { +fn default_1135() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1130() -> Option { +fn default_1136() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1131() -> Option { +fn default_1137() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1132() -> Option { +fn default_1138() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1133() -> String { +fn default_1139() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1134() -> Option { +fn default_1140() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1135() -> Option { +fn default_1141() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1136() -> Option { +fn default_1142() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1137() -> Vec { +fn default_1143() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1138() -> Vec { +fn default_1144() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1139() -> Option { +fn default_1145() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1140() -> String { +fn default_1146() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1141() -> Option { +fn default_1147() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1142() -> Vec { +fn default_1148() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1143() -> Option { +fn default_1149() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1144() -> Option { +fn default_1150() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1145() -> Option { +fn default_1151() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1146() -> String { +fn default_1152() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1147() -> Option { +fn default_1153() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1148() -> Option { +fn default_1154() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1149() -> bool { +fn default_1155() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1150() -> bool { +fn default_1156() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1151() -> Option { +fn default_1157() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1152() -> Vec { +fn default_1158() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1153() -> bool { +fn default_1159() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1154() -> Option { +fn default_1160() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1155() -> Option { +fn default_1161() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1156() -> Vec { +fn default_1162() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1157() -> String { +fn default_1163() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1158() -> String { +fn default_1164() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1159() -> Vec { +fn default_1165() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1160() -> Integer { +fn default_1166() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1161() -> Vec { +fn default_1167() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1162() -> Vec { +fn default_1168() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1163() -> Vec { +fn default_1169() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1164() -> Vec { +fn default_1170() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1165() -> Vec { +fn default_1171() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1166() -> Option { +fn default_1172() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1167() -> Option { +fn default_1173() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1168() -> Option { +fn default_1174() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1169() -> Option { +fn default_1175() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1170() -> Option { +fn default_1176() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1171() -> Option { +fn default_1177() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1172() -> Option { +fn default_1178() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1173() -> Option { +fn default_1179() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1174() -> Option { +fn default_1180() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1175() -> Option { +fn default_1181() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1176() -> Option { +fn default_1182() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1177() -> Option { +fn default_1183() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1178() -> Vec { +fn default_1184() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1179() -> Option { +fn default_1185() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1180() -> Option { +fn default_1186() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1181() -> Vec { +fn default_1187() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1182() -> Option { +fn default_1188() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1183() -> Option { +fn default_1189() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1184() -> Vec { +fn default_1190() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1185() -> String { +fn default_1191() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1186() -> String { +fn default_1192() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1187() -> Vec { +fn default_1193() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1188() -> Vec { +fn default_1194() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1189() -> Integer { +fn default_1195() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1190() -> Vec { +fn default_1196() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1191() -> Vec { +fn default_1197() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1192() -> Vec { +fn default_1198() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1193() -> Vec { +fn default_1199() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1194() -> Option { +fn default_1200() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1195() -> String { +fn default_1201() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1196() -> bool { +fn default_1202() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1197() -> KnowledgeMoveResultReason { +fn default_1203() -> KnowledgeMoveResultReason { serde_json::from_str("\"\"").expect("schema default") } -fn default_1198() -> Vec { +fn default_1204() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1199() -> String { +fn default_1205() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1200() -> bool { +fn default_1206() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1201() -> Integer { +fn default_1207() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1202() -> Vec { +fn default_1208() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1203() -> Option { +fn default_1209() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1204() -> Vec { +fn default_1210() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1205() -> Vec> { +fn default_1211() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1206() -> bool { +fn default_1212() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1207() -> Vec { +fn default_1213() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1208() -> bool { +fn default_1214() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1209() -> Vec { +fn default_1215() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1210() -> Vec> { +fn default_1216() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1211() -> KnowledgeRestoreOutputReason { +fn default_1217() -> KnowledgeRestoreOutputReason { serde_json::from_str("\"\"").expect("schema default") } -fn default_1212() -> String { +fn default_1218() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1213() -> Option { +fn default_1219() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1214() -> Integer { +fn default_1220() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1215() -> KnowledgeRestoreOutputOriginal { +fn default_1221() -> KnowledgeRestoreOutputOriginal { serde_json::from_str("\"none\"").expect("schema default") } -fn default_1216() -> Option { +fn default_1222() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1217() -> Vec> { +fn default_1223() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1218() -> Vec { +fn default_1224() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1219() -> std::collections::HashMap { +fn default_1225() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1220() -> Integer { +fn default_1226() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1221() -> bool { +fn default_1227() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1222() -> Vec { +fn default_1228() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1223() -> Integer { +fn default_1229() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1224() -> bool { +fn default_1230() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1225() -> KnowledgeSourceProbe { +fn default_1231() -> KnowledgeSourceProbe { serde_json::from_str( "{\"documents\":0,\"more\":false,\"sample\":[],\"checked\":0,\"sampled\":false}", ) .expect("schema default") } -fn default_1226() -> bool { +fn default_1232() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1227() -> bool { +fn default_1233() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_1228() -> Integer { +fn default_1234() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1229() -> bool { +fn default_1235() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1230() -> Vec { +fn default_1236() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1231() -> Integer { +fn default_1237() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1232() -> bool { +fn default_1238() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1233() -> String { +fn default_1239() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1234() -> String { +fn default_1240() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1235() -> String { +fn default_1241() -> String { serde_json::from_str("\"shared\"").expect("schema default") } -fn default_1236() -> bool { +fn default_1242() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1237() -> String { +fn default_1243() -> String { serde_json::from_str("\"namespace\"").expect("schema default") } -fn default_1238() -> std::collections::HashMap { +fn default_1244() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1239() -> String { +fn default_1245() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1240() -> Vec> { +fn default_1246() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1241() -> Vec { +fn default_1247() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1242() -> std::collections::HashMap { +fn default_1248() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1243() -> String { +fn default_1249() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1244() -> String { +fn default_1250() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1245() -> String { +fn default_1251() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1246() -> String { +fn default_1252() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1247() -> String { +fn default_1253() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1248() -> Integer { +fn default_1254() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1249() -> Integer { +fn default_1255() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1250() -> Integer { +fn default_1256() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1251() -> Integer { +fn default_1257() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1252() -> std::collections::HashMap { +fn default_1258() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1253() -> Integer { +fn default_1259() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1254() -> String { +fn default_1260() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1255() -> Integer { +fn default_1261() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1256() -> String { +fn default_1262() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1257() -> Integer { +fn default_1263() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1258() -> Integer { +fn default_1264() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1259() -> Integer { +fn default_1265() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1260() -> String { +fn default_1266() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1261() -> KnowledgeSourceSync { +fn default_1267() -> KnowledgeSourceSync { serde_json::from_str("{\"requested_at\":\"\",\"last_synced_at\":\"\",\"status\":\"\",\"documents_seen\":0,\"changed\":0,\"removed\":0,\"unconverted\":0,\"unconverted_reasons\":{},\"skipped\":0,\"error\":\"\",\"pending_extract\":0,\"last_extracted_at\":\"\",\"extracted\":0,\"flagged_pinned\":0,\"unextracted\":0,\"extract_error\":\"\"}").expect("schema default") } -fn default_1262() -> String { +fn default_1268() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1263() -> String { +fn default_1269() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1264() -> String { +fn default_1270() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1265() -> Vec { +fn default_1271() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1266() -> String { +fn default_1272() -> String { serde_json::from_str("\"shared\"").expect("schema default") } -fn default_1267() -> bool { +fn default_1273() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1268() -> String { +fn default_1274() -> String { serde_json::from_str("\"namespace\"").expect("schema default") } -fn default_1269() -> std::collections::HashMap { +fn default_1275() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1270() -> String { +fn default_1276() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1271() -> Vec> { +fn default_1277() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1272() -> Vec { +fn default_1278() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1273() -> std::collections::HashMap { +fn default_1279() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1274() -> String { +fn default_1280() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1275() -> String { +fn default_1281() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1276() -> KnowledgeSourceSync { +fn default_1282() -> KnowledgeSourceSync { serde_json::from_str("{\"requested_at\":\"\",\"last_synced_at\":\"\",\"status\":\"\",\"documents_seen\":0,\"changed\":0,\"removed\":0,\"unconverted\":0,\"unconverted_reasons\":{},\"skipped\":0,\"error\":\"\",\"pending_extract\":0,\"last_extracted_at\":\"\",\"extracted\":0,\"flagged_pinned\":0,\"unextracted\":0,\"extract_error\":\"\"}").expect("schema default") } -fn default_1277() -> Vec { +fn default_1283() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1278() -> bool { +fn default_1284() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1279() -> bool { +fn default_1285() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_1280() -> bool { +fn default_1286() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_1281() -> Option { +fn default_1287() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1282() -> String { +fn default_1288() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1283() -> std::collections::HashMap { +fn default_1289() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1284() -> String { +fn default_1290() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1285() -> Vec { +fn default_1291() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1286() -> bool { +fn default_1292() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1287() -> String { +fn default_1293() -> String { serde_json::from_str("\"disabled\"").expect("schema default") } -fn default_1288() -> String { +fn default_1294() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1289() -> String { +fn default_1295() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1290() -> String { +fn default_1296() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1291() -> String { +fn default_1297() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1292() -> String { +fn default_1298() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1293() -> String { +fn default_1299() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1294() -> Integer { +fn default_1300() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1295() -> f64 { +fn default_1301() -> f64 { serde_json::from_str("0").expect("schema default") } -fn default_1296() -> Integer { +fn default_1302() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1297() -> Option { +fn default_1303() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1298() -> KnowledgeSourceProbe { +fn default_1304() -> KnowledgeSourceProbe { serde_json::from_str( "{\"documents\":0,\"more\":false,\"sample\":[],\"checked\":0,\"sampled\":false}", ) .expect("schema default") } -fn default_1299() -> String { +fn default_1305() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1300() -> bool { +fn default_1306() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1301() -> Option { +fn default_1307() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1302() -> Vec> { +fn default_1308() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1303() -> Vec { +fn default_1309() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1304() -> std::collections::HashMap { +fn default_1310() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1305() -> Vec> { +fn default_1311() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1306() -> Vec> { +fn default_1312() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1307() -> KnowledgeSourceProbe { +fn default_1313() -> KnowledgeSourceProbe { serde_json::from_str( "{\"documents\":0,\"more\":false,\"sample\":[],\"checked\":0,\"sampled\":false}", ) .expect("schema default") } -fn default_1308() -> Option { +fn default_1314() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1309() -> Option { +fn default_1315() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1310() -> Option { +fn default_1316() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1311() -> Option { +fn default_1317() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1312() -> Option { +fn default_1318() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1313() -> Option { +fn default_1319() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1314() -> Option { +fn default_1320() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1315() -> Option { +fn default_1321() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1316() -> Option { +fn default_1322() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1317() -> Option { +fn default_1323() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1318() -> Vec { +fn default_1324() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1319() -> Option { +fn default_1325() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1320() -> Option { +fn default_1326() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1321() -> Option { +fn default_1327() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1322() -> Vec { +fn default_1328() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1323() -> Integer { +fn default_1329() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1324() -> Option> { +fn default_1330() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_1325() -> Vec { +fn default_1331() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1326() -> Vec { +fn default_1332() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1327() -> bool { +fn default_1333() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1328() -> bool { +fn default_1334() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1329() -> String { +fn default_1335() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1330() -> String { +fn default_1336() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1331() -> Vec> { +fn default_1337() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1332() -> bool { +fn default_1338() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1333() -> Vec { +fn default_1339() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1334() -> Vec { +fn default_1340() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1335() -> String { +fn default_1341() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1336() -> String { +fn default_1342() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1337() -> String { +fn default_1343() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1338() -> Vec { +fn default_1344() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1339() -> Integer { +fn default_1345() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1340() -> String { +fn default_1346() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1341() -> Integer { +fn default_1347() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1342() -> String { +fn default_1348() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1343() -> String { +fn default_1349() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1344() -> Integer { +fn default_1350() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1345() -> Integer { +fn default_1351() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1346() -> String { +fn default_1352() -> String { serde_json::from_str("\"memory_supporters\"").expect("schema default") } -fn default_1347() -> String { +fn default_1353() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1348() -> String { +fn default_1354() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1349() -> Option { +fn default_1355() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1350() -> String { +fn default_1356() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1351() -> String { +fn default_1357() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1352() -> bool { +fn default_1358() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1353() -> bool { +fn default_1359() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1354() -> String { +fn default_1360() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1355() -> std::collections::HashMap { +fn default_1361() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1356() -> Vec { +fn default_1362() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1357() -> String { +fn default_1363() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1358() -> String { +fn default_1364() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1359() -> String { +fn default_1365() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1360() -> Vec { +fn default_1366() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1361() -> String { +fn default_1367() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1362() -> String { +fn default_1368() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1363() -> Vec { +fn default_1369() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1364() -> Vec { +fn default_1370() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1365() -> Vec { +fn default_1371() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1366() -> Vec { +fn default_1372() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1367() -> Integer { +fn default_1373() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1368() -> Vec { +fn default_1374() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1369() -> Vec { +fn default_1375() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1370() -> Vec { +fn default_1376() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1371() -> Integer { +fn default_1377() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1372() -> Vec { +fn default_1378() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1373() -> std::collections::HashMap { +fn default_1379() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1374() -> std::collections::HashMap { +fn default_1380() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1375() -> Integer { +fn default_1381() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1376() -> Integer { +fn default_1382() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1377() -> Integer { +fn default_1383() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1378() -> Integer { +fn default_1384() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1379() -> Integer { +fn default_1385() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1380() -> Integer { +fn default_1386() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1381() -> bool { +fn default_1387() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1382() -> String { +fn default_1388() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1383() -> String { +fn default_1389() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1384() -> String { +fn default_1390() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1385() -> String { +fn default_1391() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1386() -> Option { +fn default_1392() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1387() -> String { +fn default_1393() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1388() -> Vec { +fn default_1394() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1389() -> String { +fn default_1395() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1390() -> MemoryAskOutputSource { +fn default_1396() -> MemoryAskOutputSource { serde_json::from_str("\"synthesized\"").expect("schema default") } -fn default_1391() -> bool { +fn default_1397() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1392() -> String { +fn default_1398() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1393() -> Vec { +fn default_1399() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1394() -> Vec { +fn default_1400() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1395() -> Vec { +fn default_1401() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1396() -> String { +fn default_1402() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1397() -> String { +fn default_1403() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1398() -> MemoryAskOutputRouteTier { +fn default_1404() -> MemoryAskOutputRouteTier { serde_json::from_str("\"\"").expect("schema default") } -fn default_1399() -> String { +fn default_1405() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1400() -> Integer { +fn default_1406() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1401() -> Integer { +fn default_1407() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1402() -> bool { +fn default_1408() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1403() -> f64 { +fn default_1409() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_1404() -> Option { +fn default_1410() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1405() -> Option { +fn default_1411() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1406() -> bool { +fn default_1412() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1407() -> String { +fn default_1413() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1408() -> Integer { +fn default_1414() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1409() -> Integer { +fn default_1415() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1410() -> Integer { +fn default_1416() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1411() -> Integer { +fn default_1417() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1412() -> String { +fn default_1418() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1413() -> Vec { +fn default_1419() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1414() -> Integer { +fn default_1420() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1415() -> MemoryAskOutputConsistency { +fn default_1421() -> MemoryAskOutputConsistency { serde_json::from_str("\"\"").expect("schema default") } -fn default_1416() -> f64 { +fn default_1422() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_1417() -> String { +fn default_1423() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1418() -> Integer { +fn default_1424() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1419() -> Integer { +fn default_1425() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1420() -> String { +fn default_1426() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1421() -> String { +fn default_1427() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1422() -> String { +fn default_1428() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1423() -> String { +fn default_1429() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1424() -> MemoryAskOutputDepth { +fn default_1430() -> MemoryAskOutputDepth { serde_json::from_str("\"\"").expect("schema default") } -fn default_1425() -> bool { +fn default_1431() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1426() -> Vec { +fn default_1432() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1427() -> Integer { +fn default_1433() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1428() -> Integer { +fn default_1434() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1429() -> Integer { +fn default_1435() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1430() -> Vec { +fn default_1436() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1431() -> Integer { +fn default_1437() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1432() -> Integer { +fn default_1438() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1433() -> Integer { +fn default_1439() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1434() -> MemoryAskOutputGrounding { +fn default_1440() -> MemoryAskOutputGrounding { serde_json::from_str("\"\"").expect("schema default") } -fn default_1435() -> String { +fn default_1441() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1436() -> Vec { +fn default_1442() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1437() -> Integer { +fn default_1443() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1438() -> Integer { +fn default_1444() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1439() -> Integer { +fn default_1445() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1440() -> Integer { +fn default_1446() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1441() -> std::collections::HashMap { +fn default_1447() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1442() -> MemoryAskOutputDeepSelector { +fn default_1448() -> MemoryAskOutputDeepSelector { serde_json::from_str("\"\"").expect("schema default") } -fn default_1443() -> MemoryAskOutputDeepFirst { +fn default_1449() -> MemoryAskOutputDeepFirst { serde_json::from_str("\"\"").expect("schema default") } -fn default_1444() -> Integer { +fn default_1450() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1445() -> Integer { +fn default_1451() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1446() -> Integer { +fn default_1452() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1447() -> Integer { +fn default_1453() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1448() -> f64 { +fn default_1454() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_1449() -> Integer { +fn default_1455() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1450() -> Integer { +fn default_1456() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1451() -> Integer { +fn default_1457() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1452() -> Integer { +fn default_1458() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1453() -> Integer { +fn default_1459() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1454() -> bool { +fn default_1460() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1455() -> String { +fn default_1461() -> String { serde_json::from_str("\"-\"").expect("schema default") } -fn default_1456() -> String { +fn default_1462() -> String { serde_json::from_str("\"-\"").expect("schema default") } -fn default_1457() -> String { +fn default_1463() -> String { serde_json::from_str("\"-\"").expect("schema default") } -fn default_1458() -> String { +fn default_1464() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1459() -> String { +fn default_1465() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1460() -> String { +fn default_1466() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1461() -> bool { +fn default_1467() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1462() -> String { +fn default_1468() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1463() -> Option { +fn default_1469() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1464() -> String { +fn default_1470() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1465() -> String { +fn default_1471() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1466() -> Vec { +fn default_1472() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1467() -> Option { +fn default_1473() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1468() -> bool { +fn default_1474() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1469() -> String { +fn default_1475() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1470() -> String { +fn default_1476() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1471() -> Vec { +fn default_1477() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1472() -> String { +fn default_1478() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1473() -> Vec { +fn default_1479() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1474() -> String { +fn default_1480() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1475() -> String { +fn default_1481() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1476() -> Vec { +fn default_1482() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1477() -> Vec { +fn default_1483() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1478() -> Integer { +fn default_1484() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1479() -> Vec { +fn default_1485() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1480() -> Vec { +fn default_1486() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1481() -> String { +fn default_1487() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1482() -> String { +fn default_1488() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1483() -> bool { +fn default_1489() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1484() -> String { +fn default_1490() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1485() -> String { +fn default_1491() -> String { serde_json::from_str("\"fact\"").expect("schema default") } -fn default_1486() -> String { +fn default_1492() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1487() -> bool { +fn default_1493() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1488() -> String { +fn default_1494() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1489() -> String { +fn default_1495() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1490() -> String { +fn default_1496() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1491() -> Vec { +fn default_1497() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1492() -> Vec { +fn default_1498() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1493() -> Vec { +fn default_1499() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1494() -> std::collections::HashMap { +fn default_1500() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1495() -> Vec { +fn default_1501() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1496() -> Integer { +fn default_1502() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1497() -> Vec { +fn default_1503() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1498() -> Integer { +fn default_1504() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1499() -> Integer { +fn default_1505() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1500() -> Integer { +fn default_1506() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1501() -> Integer { +fn default_1507() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1502() -> Integer { +fn default_1508() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1503() -> Integer { +fn default_1509() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1504() -> Integer { +fn default_1510() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1505() -> String { +fn default_1511() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1506() -> String { +fn default_1512() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1507() -> String { +fn default_1513() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1508() -> String { +fn default_1514() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1509() -> bool { +fn default_1515() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_1510() -> Integer { +fn default_1516() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1511() -> Integer { +fn default_1517() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1512() -> Integer { +fn default_1518() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1513() -> Integer { +fn default_1519() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1514() -> Integer { +fn default_1520() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1515() -> bool { +fn default_1521() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1516() -> Vec { +fn default_1522() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1517() -> String { +fn default_1523() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1518() -> String { +fn default_1524() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1519() -> Option { +fn default_1525() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1520() -> Vec { +fn default_1526() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1521() -> bool { +fn default_1527() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1522() -> bool { +fn default_1528() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1523() -> Vec { +fn default_1529() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1524() -> bool { +fn default_1530() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1525() -> Option { +fn default_1531() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1526() -> Vec { +fn default_1532() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1527() -> Option { +fn default_1533() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1528() -> Option { +fn default_1534() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1529() -> Vec { +fn default_1535() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1530() -> Integer { +fn default_1536() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1531() -> bool { +fn default_1537() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_1532() -> String { +fn default_1538() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1533() -> Integer { +fn default_1539() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1534() -> Integer { +fn default_1540() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1535() -> std::collections::HashMap { +fn default_1541() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1536() -> String { +fn default_1542() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1537() -> f64 { +fn default_1543() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_1538() -> bool { +fn default_1544() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1539() -> String { +fn default_1545() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1540() -> String { +fn default_1546() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1541() -> Integer { +fn default_1547() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1542() -> Integer { +fn default_1548() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1543() -> Option { +fn default_1549() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1544() -> Vec { +fn default_1550() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1545() -> Vec { +fn default_1551() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1546() -> Option { +fn default_1552() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1547() -> Option { +fn default_1553() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1548() -> Integer { +fn default_1554() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1549() -> bool { +fn default_1555() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1550() -> String { +fn default_1556() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1551() -> String { +fn default_1557() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1552() -> String { +fn default_1558() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1553() -> String { +fn default_1559() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1554() -> Option { +fn default_1560() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1555() -> String { +fn default_1561() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1556() -> Integer { +fn default_1562() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1557() -> Integer { +fn default_1563() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1558() -> String { +fn default_1564() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1559() -> Vec { +fn default_1565() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1560() -> bool { +fn default_1566() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1561() -> Integer { +fn default_1567() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1562() -> Integer { +fn default_1568() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1563() -> Integer { +fn default_1569() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1564() -> Integer { +fn default_1570() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1565() -> Integer { +fn default_1571() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1566() -> String { +fn default_1572() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1567() -> String { +fn default_1573() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1568() -> String { +fn default_1574() -> String { serde_json::from_str("\"-\"").expect("schema default") } -fn default_1569() -> String { +fn default_1575() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1570() -> Vec { +fn default_1576() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1571() -> Integer { +fn default_1577() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1572() -> Integer { +fn default_1578() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1573() -> String { +fn default_1579() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1574() -> String { +fn default_1580() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1575() -> Vec { +fn default_1581() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1576() -> String { +fn default_1582() -> String { serde_json::from_str("\"-\"").expect("schema default") } -fn default_1577() -> String { +fn default_1583() -> String { serde_json::from_str("\"-\"").expect("schema default") } -fn default_1578() -> Vec { +fn default_1584() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1579() -> Vec { +fn default_1585() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1580() -> String { +fn default_1586() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1581() -> String { +fn default_1587() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1582() -> Vec { +fn default_1588() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1583() -> f64 { +fn default_1589() -> f64 { serde_json::from_str("1.0").expect("schema default") } -fn default_1584() -> String { +fn default_1590() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1585() -> String { +fn default_1591() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1586() -> Vec { +fn default_1592() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1587() -> bool { +fn default_1593() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1588() -> String { +fn default_1594() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1589() -> Integer { +fn default_1595() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1590() -> Vec { +fn default_1596() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1591() -> Vec { +fn default_1597() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1592() -> Vec { +fn default_1598() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1593() -> Vec { +fn default_1599() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1594() -> Vec { +fn default_1600() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1595() -> Option { +fn default_1601() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1596() -> Option { +fn default_1602() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1597() -> Vec { +fn default_1603() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1598() -> Integer { +fn default_1604() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1599() -> Integer { +fn default_1605() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1600() -> Vec { +fn default_1606() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1601() -> Vec { +fn default_1607() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1602() -> Integer { +fn default_1608() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1603() -> Integer { +fn default_1609() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1604() -> bool { +fn default_1610() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1605() -> Vec { +fn default_1611() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1606() -> f64 { +fn default_1612() -> f64 { serde_json::from_str("1.0").expect("schema default") } -fn default_1607() -> bool { +fn default_1613() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1608() -> String { +fn default_1614() -> String { serde_json::from_str("\"active\"").expect("schema default") } -fn default_1609() -> String { +fn default_1615() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1610() -> Option { +fn default_1616() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1611() -> String { +fn default_1617() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1612() -> String { +fn default_1618() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1613() -> String { +fn default_1619() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1614() -> String { +fn default_1620() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1615() -> MemoryForFileHitSupersedesKind { +fn default_1621() -> MemoryForFileHitSupersedesKind { serde_json::from_str("\"\"").expect("schema default") } -fn default_1616() -> Vec { +fn default_1622() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1617() -> String { +fn default_1623() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1618() -> MemoryForFileHitVerification { +fn default_1624() -> MemoryForFileHitVerification { serde_json::from_str("\"none\"").expect("schema default") } -fn default_1619() -> MemoryForFileHitCodeState { +fn default_1625() -> MemoryForFileHitCodeState { serde_json::from_str("\"\"").expect("schema default") } -fn default_1620() -> Vec { +fn default_1626() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1621() -> String { +fn default_1627() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1622() -> Integer { +fn default_1628() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1623() -> bool { +fn default_1629() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1624() -> bool { +fn default_1630() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1625() -> Vec { +fn default_1631() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1626() -> String { +fn default_1632() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1627() -> String { +fn default_1633() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1628() -> String { +fn default_1634() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1629() -> String { +fn default_1635() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1630() -> String { +fn default_1636() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1631() -> String { +fn default_1637() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1632() -> Option { +fn default_1638() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1633() -> Value { +fn default_1639() -> Value { serde_json::from_str("null").expect("schema default") } -fn default_1634() -> Option { +fn default_1640() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1635() -> Option { +fn default_1641() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1636() -> Option { +fn default_1642() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1637() -> Option { +fn default_1643() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1638() -> Option { +fn default_1644() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1639() -> Option { +fn default_1645() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1640() -> bool { +fn default_1646() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1641() -> String { +fn default_1647() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1642() -> String { +fn default_1648() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1643() -> Option { +fn default_1649() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1644() -> String { +fn default_1650() -> String { serde_json::from_str("\"none\"").expect("schema default") } -fn default_1645() -> String { +fn default_1651() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1646() -> String { +fn default_1652() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1647() -> String { +fn default_1653() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1648() -> String { +fn default_1654() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1649() -> String { +fn default_1655() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1650() -> Option { +fn default_1656() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1651() -> String { +fn default_1657() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1652() -> String { +fn default_1658() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1653() -> String { +fn default_1659() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1654() -> Integer { +fn default_1660() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1655() -> Vec { +fn default_1661() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1656() -> Integer { +fn default_1662() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1657() -> Option { +fn default_1663() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1658() -> Vec { +fn default_1664() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1659() -> std::collections::HashMap { +fn default_1665() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1660() -> Integer { +fn default_1666() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1661() -> f64 { +fn default_1667() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_1662() -> Integer { +fn default_1668() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1663() -> Integer { +fn default_1669() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1664() -> Integer { +fn default_1670() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1665() -> Integer { +fn default_1671() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1666() -> Integer { +fn default_1672() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1667() -> MemoryHealthStaleness { +fn default_1673() -> MemoryHealthStaleness { serde_json::from_str("{\"by_age\":{},\"with_validity_end\":0,\"with_validity_end_share\":0.0,\"with_expiry\":0,\"expiring_7d\":0,\"pinned\":0,\"days_since_reinforced_p50\":0,\"days_since_reinforced_p90\":0}").expect("schema default") } -fn default_1668() -> Integer { +fn default_1674() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1669() -> Integer { +fn default_1675() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1670() -> f64 { +fn default_1676() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_1671() -> MemoryHealthFootprint { +fn default_1677() -> MemoryHealthFootprint { serde_json::from_str("{\"value_chars\":0,\"value_tokens_est\":0,\"tokens_per_row_est\":0.0}") .expect("schema default") } -fn default_1672() -> String { +fn default_1678() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1673() -> Value { +fn default_1679() -> Value { serde_json::from_str("null").expect("schema default") } -fn default_1674() -> String { +fn default_1680() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1675() -> bool { +fn default_1681() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1676() -> Option { +fn default_1682() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1677() -> Option { +fn default_1683() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1678() -> Option { +fn default_1684() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1679() -> String { +fn default_1685() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1680() -> String { +fn default_1686() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1681() -> String { +fn default_1687() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1682() -> String { +fn default_1688() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1683() -> String { +fn default_1689() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1684() -> Option { +fn default_1690() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1685() -> String { +fn default_1691() -> String { serde_json::from_str("\"active\"").expect("schema default") } -fn default_1686() -> Vec { +fn default_1692() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1687() -> Vec { +fn default_1693() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1688() -> Option { +fn default_1694() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1689() -> String { +fn default_1695() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1690() -> String { +fn default_1696() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1691() -> String { +fn default_1697() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1692() -> String { +fn default_1698() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1693() -> Option { +fn default_1699() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1694() -> Integer { +fn default_1700() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1695() -> Integer { +fn default_1701() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1696() -> Integer { +fn default_1702() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1697() -> Integer { +fn default_1703() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1698() -> MemoryImportResultReason { +fn default_1704() -> MemoryImportResultReason { serde_json::from_str("\"\"").expect("schema default") } -fn default_1699() -> String { +fn default_1705() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1700() -> MemoryImportResultNote { +fn default_1706() -> MemoryImportResultNote { serde_json::from_str("\"\"").expect("schema default") } -fn default_1701() -> bool { +fn default_1707() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1702() -> String { +fn default_1708() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1703() -> Option { +fn default_1709() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1704() -> Integer { +fn default_1710() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1705() -> Integer { +fn default_1711() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1706() -> Integer { +fn default_1712() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1707() -> String { +fn default_1713() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1708() -> Integer { +fn default_1714() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1709() -> Vec { +fn default_1715() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1710() -> Integer { +fn default_1716() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1711() -> Integer { +fn default_1717() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1712() -> Vec { +fn default_1718() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1713() -> Integer { +fn default_1719() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1714() -> Vec { +fn default_1720() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1715() -> Vec { +fn default_1721() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1716() -> Vec { +fn default_1722() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1717() -> Vec { +fn default_1723() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1718() -> Vec { +fn default_1724() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1719() -> Option { +fn default_1725() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1720() -> Option { +fn default_1726() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1721() -> String { +fn default_1727() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1722() -> Integer { +fn default_1728() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1723() -> String { +fn default_1729() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1724() -> Vec { +fn default_1730() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1725() -> bool { +fn default_1731() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_1726() -> Vec { +fn default_1732() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1727() -> Option { +fn default_1733() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1728() -> Option { +fn default_1734() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1729() -> String { +fn default_1735() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1730() -> Integer { +fn default_1736() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1731() -> String { +fn default_1737() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1732() -> Integer { +fn default_1738() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1733() -> Option { +fn default_1739() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1734() -> String { +fn default_1740() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1735() -> String { +fn default_1741() -> String { serde_json::from_str("\"Each request that extracts memories from messages may send extraction instructions; no user, agent or session setting stores them.\"").expect("schema default") } -fn default_1736() -> Vec { +fn default_1742() -> Vec { serde_json::from_str("[\"memory.set_from_messages\",\"extraction_instructions\"]") .expect("schema default") } -fn default_1737() -> Vec { +fn default_1743() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1738() -> bool { +fn default_1744() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1739() -> String { +fn default_1745() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1740() -> String { +fn default_1746() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1741() -> Option { +fn default_1747() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1742() -> String { +fn default_1748() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1743() -> String { +fn default_1749() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1744() -> String { +fn default_1750() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1745() -> MemoryLineageOutputMechanism { +fn default_1751() -> MemoryLineageOutputMechanism { serde_json::from_str("\"unknown\"").expect("schema default") } -fn default_1746() -> Vec { +fn default_1752() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1747() -> String { +fn default_1753() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1748() -> String { +fn default_1754() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1749() -> Option { +fn default_1755() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1750() -> Vec { +fn default_1756() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1751() -> f64 { +fn default_1757() -> f64 { serde_json::from_str("1.0").expect("schema default") } -fn default_1752() -> bool { +fn default_1758() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1753() -> bool { +fn default_1759() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1754() -> Integer { +fn default_1760() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1755() -> Integer { +fn default_1761() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1756() -> String { +fn default_1762() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1757() -> bool { +fn default_1763() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1758() -> Integer { +fn default_1764() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1759() -> String { +fn default_1765() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1760() -> String { +fn default_1766() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1761() -> String { +fn default_1767() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1762() -> Option { +fn default_1768() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1763() -> String { +fn default_1769() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1764() -> Option { +fn default_1770() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1765() -> String { +fn default_1771() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1766() -> String { +fn default_1772() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1767() -> String { +fn default_1773() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1768() -> Integer { +fn default_1774() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1769() -> String { +fn default_1775() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1770() -> Vec { +fn default_1776() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1771() -> bool { +fn default_1777() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1772() -> String { +fn default_1778() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1773() -> String { +fn default_1779() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1774() -> String { +fn default_1780() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1775() -> bool { +fn default_1781() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1776() -> std::collections::HashMap { +fn default_1782() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1777() -> String { +fn default_1783() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1778() -> String { +fn default_1784() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1779() -> Integer { +fn default_1785() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1780() -> Integer { +fn default_1786() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1781() -> Vec { +fn default_1787() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1782() -> Integer { +fn default_1788() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1783() -> Integer { +fn default_1789() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1784() -> Vec { +fn default_1790() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1785() -> String { +fn default_1791() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1786() -> Integer { +fn default_1792() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1787() -> String { +fn default_1793() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1788() -> Vec { +fn default_1794() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1789() -> Integer { +fn default_1795() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1790() -> Option { +fn default_1796() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1791() -> Vec { +fn default_1797() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1792() -> Integer { +fn default_1798() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1793() -> String { +fn default_1799() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1794() -> String { +fn default_1800() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1795() -> Vec { +fn default_1801() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1796() -> String { +fn default_1802() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1797() -> String { +fn default_1803() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1798() -> String { +fn default_1804() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1799() -> String { +fn default_1805() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1800() -> String { +fn default_1806() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1801() -> String { +fn default_1807() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1802() -> Vec { +fn default_1808() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1803() -> String { +fn default_1809() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1804() -> Integer { +fn default_1810() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1805() -> Integer { +fn default_1811() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1806() -> String { +fn default_1812() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1807() -> Integer { +fn default_1813() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1808() -> Integer { +fn default_1814() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1809() -> MemoryProposalReady { +fn default_1815() -> MemoryProposalReady { serde_json::from_str("\"\"").expect("schema default") } -fn default_1810() -> Vec { +fn default_1816() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1811() -> Vec { +fn default_1817() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1812() -> Integer { +fn default_1818() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1813() -> ProposalPolicyMode { +fn default_1819() -> ProposalPolicyMode { serde_json::from_str("\"manual\"").expect("schema default") } -fn default_1814() -> Integer { +fn default_1820() -> Integer { serde_json::from_str("2").expect("schema default") } -fn default_1815() -> Integer { +fn default_1821() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1816() -> Integer { +fn default_1822() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1817() -> ProposalPolicy { +fn default_1823() -> ProposalPolicy { serde_json::from_str( "{\"mode\":\"manual\",\"min_passes\":2,\"max_fails\":0,\"reject_after_fails\":0}", ) .expect("schema default") } -fn default_1818() -> String { +fn default_1824() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1819() -> String { +fn default_1825() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1820() -> String { +fn default_1826() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1821() -> String { +fn default_1827() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1822() -> String { +fn default_1828() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1823() -> String { +fn default_1829() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1824() -> bool { +fn default_1830() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1825() -> String { +fn default_1831() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1826() -> String { +fn default_1832() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1827() -> String { +fn default_1833() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1828() -> String { +fn default_1834() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1829() -> String { +fn default_1835() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1830() -> String { +fn default_1836() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1831() -> String { +fn default_1837() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1832() -> String { +fn default_1838() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1833() -> String { +fn default_1839() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1834() -> Vec { +fn default_1840() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1835() -> f64 { +fn default_1841() -> f64 { serde_json::from_str("1.0").expect("schema default") } -fn default_1836() -> String { +fn default_1842() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1837() -> String { +fn default_1843() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1838() -> Vec { +fn default_1844() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1839() -> String { +fn default_1845() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1840() -> String { +fn default_1846() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1841() -> String { +fn default_1847() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1842() -> String { +fn default_1848() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1843() -> bool { +fn default_1849() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1844() -> Integer { +fn default_1850() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1845() -> Integer { +fn default_1851() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1846() -> Integer { +fn default_1852() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1847() -> bool { +fn default_1853() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1848() -> String { +fn default_1854() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1849() -> Integer { +fn default_1855() -> Integer { serde_json::from_str("-1").expect("schema default") } -fn default_1850() -> MemoryRecallOutputOrder { +fn default_1856() -> MemoryRecallOutputOrder { serde_json::from_str("\"recent\"").expect("schema default") } -fn default_1851() -> Vec { +fn default_1857() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1852() -> Integer { +fn default_1858() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1853() -> Value { +fn default_1859() -> Value { serde_json::from_str("null").expect("schema default") } -fn default_1854() -> Value { +fn default_1860() -> Value { serde_json::from_str("null").expect("schema default") } -fn default_1855() -> String { +fn default_1861() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1856() -> String { +fn default_1862() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1857() -> Option { +fn default_1863() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1858() -> Option { +fn default_1864() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1859() -> bool { +fn default_1865() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1860() -> String { +fn default_1866() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1861() -> String { +fn default_1867() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1862() -> std::collections::HashMap { +fn default_1868() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1863() -> std::collections::HashMap { +fn default_1869() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1864() -> MemoryRecordRowStatus { +fn default_1870() -> MemoryRecordRowStatus { serde_json::from_str("\"active\"").expect("schema default") } -fn default_1865() -> Option { +fn default_1871() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1866() -> Option { +fn default_1872() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1867() -> bool { +fn default_1873() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1868() -> String { +fn default_1874() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1869() -> MemoryRecordWriteOutputKeySource { +fn default_1875() -> MemoryRecordWriteOutputKeySource { serde_json::from_str("\"anonymous\"").expect("schema default") } -fn default_1870() -> std::collections::HashMap { +fn default_1876() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1871() -> String { +fn default_1877() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1872() -> Integer { +fn default_1878() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1873() -> bool { +fn default_1879() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1874() -> Option { +fn default_1880() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1875() -> Integer { +fn default_1881() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1876() -> Integer { +fn default_1882() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1877() -> Option { +fn default_1883() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1878() -> String { +fn default_1884() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1879() -> Integer { +fn default_1885() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1880() -> Integer { +fn default_1886() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1881() -> bool { +fn default_1887() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1882() -> Vec { +fn default_1888() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1883() -> Option { +fn default_1889() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1884() -> Option { +fn default_1890() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1885() -> bool { +fn default_1891() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1886() -> bool { +fn default_1892() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1887() -> String { +fn default_1893() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1888() -> f64 { +fn default_1894() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_1889() -> String { +fn default_1895() -> String { serde_json::from_str("\"fact\"").expect("schema default") } -fn default_1890() -> String { +fn default_1896() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1891() -> std::collections::HashMap { +fn default_1897() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1892() -> bool { +fn default_1898() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1893() -> Integer { +fn default_1899() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1894() -> String { +fn default_1900() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1895() -> Vec { +fn default_1901() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1896() -> Vec { +fn default_1902() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1897() -> Integer { +fn default_1903() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1898() -> Integer { +fn default_1904() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1899() -> String { +fn default_1905() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1900() -> String { +fn default_1906() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1901() -> Integer { +fn default_1907() -> Integer { serde_json::from_str("1").expect("schema default") } -fn default_1902() -> Integer { +fn default_1908() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1903() -> Integer { +fn default_1909() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1904() -> Vec { +fn default_1910() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1905() -> Integer { +fn default_1911() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1906() -> Integer { +fn default_1912() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1907() -> Integer { +fn default_1913() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1908() -> Integer { +fn default_1914() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1909() -> Vec { +fn default_1915() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1910() -> String { +fn default_1916() -> String { serde_json::from_str("\"whole\"").expect("schema default") } -fn default_1911() -> Integer { +fn default_1917() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1912() -> Vec { +fn default_1918() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1913() -> Vec { +fn default_1919() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1914() -> Integer { +fn default_1920() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1915() -> Vec { +fn default_1921() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1916() -> Integer { +fn default_1922() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1917() -> Vec { +fn default_1923() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1918() -> Vec { +fn default_1924() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1919() -> bool { +fn default_1925() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1920() -> String { +fn default_1926() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1921() -> String { +fn default_1927() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1922() -> std::collections::HashMap { +fn default_1928() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1923() -> String { +fn default_1929() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1924() -> bool { +fn default_1930() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1925() -> Vec { +fn default_1931() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1926() -> Integer { +fn default_1932() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1927() -> Integer { +fn default_1933() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1928() -> String { +fn default_1934() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1929() -> String { +fn default_1935() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1930() -> String { +fn default_1936() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1931() -> bool { +fn default_1937() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1932() -> Integer { +fn default_1938() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1933() -> Option { +fn default_1939() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1934() -> String { +fn default_1940() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1935() -> String { +fn default_1941() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1936() -> String { +fn default_1942() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1937() -> Vec { +fn default_1943() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1938() -> Integer { +fn default_1944() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1939() -> Integer { +fn default_1945() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1940() -> Integer { +fn default_1946() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1941() -> Integer { +fn default_1947() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1942() -> Integer { +fn default_1948() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1943() -> Integer { +fn default_1949() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1944() -> bool { +fn default_1950() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1945() -> Vec> { +fn default_1951() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1946() -> Vec { +fn default_1952() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1947() -> Option { +fn default_1953() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1948() -> String { +fn default_1954() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1949() -> Integer { +fn default_1955() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1950() -> Option { +fn default_1956() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1951() -> Option { +fn default_1957() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1952() -> Option { +fn default_1958() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1953() -> Option { +fn default_1959() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1954() -> Vec { +fn default_1960() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1955() -> Integer { +fn default_1961() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1956() -> String { +fn default_1962() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1957() -> String { +fn default_1963() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1958() -> Option { +fn default_1964() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1959() -> String { +fn default_1965() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1960() -> String { +fn default_1966() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1961() -> String { +fn default_1967() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1962() -> String { +fn default_1968() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1963() -> Option { +fn default_1969() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1964() -> String { +fn default_1970() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1965() -> String { +fn default_1971() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1966() -> Integer { +fn default_1972() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1967() -> String { +fn default_1973() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1968() -> String { +fn default_1974() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1969() -> String { +fn default_1975() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1970() -> String { +fn default_1976() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1971() -> String { +fn default_1977() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1972() -> Integer { +fn default_1978() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1973() -> String { +fn default_1979() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1974() -> Vec { +fn default_1980() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1975() -> String { +fn default_1981() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1976() -> Integer { +fn default_1982() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1977() -> String { +fn default_1983() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1978() -> Integer { +fn default_1984() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1979() -> String { +fn default_1985() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1980() -> String { +fn default_1986() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1981() -> Integer { +fn default_1987() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1982() -> String { +fn default_1988() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1983() -> bool { +fn default_1989() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1984() -> String { +fn default_1990() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1985() -> String { +fn default_1991() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1986() -> String { +fn default_1992() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1987() -> String { +fn default_1993() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1988() -> Option { +fn default_1994() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1989() -> String { +fn default_1995() -> String { serde_json::from_str("\"none\"").expect("schema default") } -fn default_1990() -> Integer { +fn default_1996() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1991() -> String { +fn default_1997() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1992() -> String { +fn default_1998() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1993() -> String { +fn default_1999() -> String { serde_json::from_str("\"active\"").expect("schema default") } -fn default_1994() -> bool { +fn default_2000() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1995() -> Vec { +fn default_2001() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1996() -> std::collections::HashMap { +fn default_2002() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1997() -> String { +fn default_2003() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1998() -> Vec { +fn default_2004() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1999() -> std::collections::HashMap { +fn default_2005() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2000() -> Integer { +fn default_2006() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2001() -> Option { +fn default_2007() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2002() -> String { +fn default_2008() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2003() -> bool { +fn default_2009() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2004() -> Vec { +fn default_2010() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2005() -> Vec { +fn default_2011() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2006() -> std::collections::HashMap { +fn default_2012() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2007() -> Option { +fn default_2013() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2008() -> Vec { +fn default_2014() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2009() -> Integer { +fn default_2015() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2010() -> Integer { +fn default_2016() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2011() -> Vec { +fn default_2017() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2012() -> Option { +fn default_2018() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2013() -> Vec { +fn default_2019() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2014() -> Option { +fn default_2020() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2015() -> Option { +fn default_2021() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2016() -> Vec { +fn default_2022() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2017() -> bool { +fn default_2023() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2018() -> Vec { +fn default_2024() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2019() -> bool { +fn default_2025() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2020() -> Integer { +fn default_2026() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2021() -> Integer { +fn default_2027() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2022() -> Integer { +fn default_2028() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2023() -> Integer { +fn default_2029() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2024() -> Integer { +fn default_2030() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2025() -> Integer { +fn default_2031() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2026() -> Integer { +fn default_2032() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2027() -> Integer { +fn default_2033() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2028() -> Integer { +fn default_2034() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2029() -> f64 { +fn default_2035() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2030() -> Integer { +fn default_2036() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2031() -> Integer { +fn default_2037() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2032() -> Integer { +fn default_2038() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2033() -> Integer { +fn default_2039() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2034() -> Option { +fn default_2040() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2035() -> Option { +fn default_2041() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2036() -> Vec { +fn default_2042() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2037() -> String { +fn default_2043() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2038() -> String { +fn default_2044() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2039() -> Integer { +fn default_2045() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2040() -> Vec> { +fn default_2046() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2041() -> Vec { +fn default_2047() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2042() -> String { +fn default_2048() -> String { serde_json::from_str("\"memory\"").expect("schema default") } -fn default_2043() -> bool { +fn default_2049() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2044() -> String { +fn default_2050() -> String { serde_json::from_str("\"approval\"").expect("schema default") } -fn default_2045() -> String { +fn default_2051() -> String { serde_json::from_str("\"public\"").expect("schema default") } -fn default_2046() -> BrowseEntryMyStatus { +fn default_2052() -> BrowseEntryMyStatus { serde_json::from_str("\"none\"").expect("schema default") } -fn default_2047() -> String { +fn default_2053() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2048() -> String { +fn default_2054() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2049() -> String { +fn default_2055() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2050() -> Integer { +fn default_2056() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2051() -> String { +fn default_2057() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2052() -> Option { +fn default_2058() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2053() -> Option { +fn default_2059() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2054() -> Vec { +fn default_2060() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2055() -> Option { +fn default_2061() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2056() -> Option { +fn default_2062() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2057() -> Option { +fn default_2063() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2058() -> Option> { +fn default_2064() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2059() -> Option { +fn default_2065() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2060() -> Option { +fn default_2066() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2061() -> Option { +fn default_2067() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2062() -> Option { +fn default_2068() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2063() -> Option { +fn default_2069() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2064() -> Option { +fn default_2070() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2065() -> Option { +fn default_2071() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2066() -> Option { +fn default_2072() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2067() -> Option { +fn default_2073() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2068() -> Option { +fn default_2074() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2069() -> Option { +fn default_2075() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2070() -> Option { +fn default_2076() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2071() -> Option { +fn default_2077() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2072() -> Option { +fn default_2078() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2073() -> Option { +fn default_2079() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2074() -> Option> { +fn default_2080() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2075() -> Option { +fn default_2081() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2076() -> Option { +fn default_2082() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2077() -> Option { +fn default_2083() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2078() -> Option { +fn default_2084() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2079() -> Option { +fn default_2085() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2080() -> Option>> { +fn default_2086() -> Option>> { serde_json::from_str("null").expect("schema default") } -fn default_2081() -> Option { +fn default_2087() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2082() -> Option { +fn default_2088() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2083() -> Option { +fn default_2089() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2084() -> Option { +fn default_2090() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2085() -> Option { +fn default_2091() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2086() -> Integer { +fn default_2092() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2087() -> String { +fn default_2093() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2088() -> String { +fn default_2094() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2089() -> String { +fn default_2095() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2090() -> String { +fn default_2096() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2091() -> Option { +fn default_2097() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2092() -> bool { +fn default_2098() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2093() -> Integer { +fn default_2099() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2094() -> String { +fn default_2100() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2095() -> String { +fn default_2101() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2096() -> String { +fn default_2102() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2097() -> String { +fn default_2103() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2098() -> Option { +fn default_2104() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2099() -> Option { +fn default_2105() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2100() -> String { +fn default_2106() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2101() -> Vec { +fn default_2107() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2102() -> String { +fn default_2108() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2103() -> String { +fn default_2109() -> String { serde_json::from_str("\"active\"").expect("schema default") } -fn default_2104() -> Option { +fn default_2110() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2105() -> Vec { +fn default_2111() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2106() -> Option { +fn default_2112() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2107() -> String { +fn default_2113() -> String { serde_json::from_str("\"memory\"").expect("schema default") } -fn default_2108() -> bool { +fn default_2114() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2109() -> f64 { +fn default_2115() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2110() -> f64 { +fn default_2116() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2111() -> String { +fn default_2117() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2112() -> Option { +fn default_2118() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2113() -> Integer { +fn default_2119() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2114() -> Integer { +fn default_2120() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2115() -> NamespaceEntryVisibility { +fn default_2121() -> NamespaceEntryVisibility { serde_json::from_str("\"private\"").expect("schema default") } -fn default_2116() -> String { +fn default_2122() -> String { serde_json::from_str("\"active\"").expect("schema default") } -fn default_2117() -> Option { +fn default_2123() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2118() -> Option { +fn default_2124() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2119() -> Vec { +fn default_2125() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2120() -> MineEntryVisibility { +fn default_2126() -> MineEntryVisibility { serde_json::from_str("\"private\"").expect("schema default") } -fn default_2121() -> String { +fn default_2127() -> String { serde_json::from_str("\"memory\"").expect("schema default") } -fn default_2122() -> String { +fn default_2128() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2123() -> String { +fn default_2129() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2124() -> Option { +fn default_2130() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2125() -> bool { +fn default_2131() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2126() -> bool { +fn default_2132() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2127() -> String { +fn default_2133() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2128() -> NamespaceRegisterOutputVisibility { +fn default_2134() -> NamespaceRegisterOutputVisibility { serde_json::from_str("\"private\"").expect("schema default") } -fn default_2129() -> bool { +fn default_2135() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2130() -> Integer { +fn default_2136() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2131() -> Integer { +fn default_2137() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2132() -> bool { +fn default_2138() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2133() -> Vec> { +fn default_2139() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2134() -> Option { +fn default_2140() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2135() -> Option { +fn default_2141() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2136() -> Vec { +fn default_2142() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2137() -> Integer { +fn default_2143() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2138() -> String { +fn default_2144() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2139() -> String { +fn default_2145() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2140() -> String { +fn default_2146() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2141() -> String { +fn default_2147() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2142() -> String { +fn default_2148() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2143() -> Option { +fn default_2149() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2144() -> String { +fn default_2150() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2145() -> String { +fn default_2151() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2146() -> String { +fn default_2152() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2147() -> Vec { +fn default_2153() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2148() -> Option { +fn default_2154() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2149() -> Option { +fn default_2155() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2150() -> Option { +fn default_2156() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2151() -> Option { +fn default_2157() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2152() -> String { +fn default_2158() -> String { serde_json::from_str("\"{}\"").expect("schema default") } -fn default_2153() -> NamespaceSnapshotOutputSnapshotMemoryRowStatus { +fn default_2159() -> NamespaceSnapshotOutputSnapshotMemoryRowStatus { serde_json::from_str("\"active\"").expect("schema default") } -fn default_2154() -> Option { +fn default_2160() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2155() -> Vec { +fn default_2161() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2156() -> String { +fn default_2162() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2157() -> Integer { +fn default_2163() -> Integer { serde_json::from_str("1").expect("schema default") } -fn default_2158() -> Integer { +fn default_2164() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2159() -> Option { +fn default_2165() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2160() -> String { +fn default_2166() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2161() -> String { +fn default_2167() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2162() -> String { +fn default_2168() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2163() -> String { +fn default_2169() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2164() -> Option { +fn default_2170() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2165() -> f64 { +fn default_2171() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2166() -> Option { +fn default_2172() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2167() -> Option { +fn default_2173() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2168() -> Integer { +fn default_2174() -> Integer { serde_json::from_str("1").expect("schema default") } -fn default_2169() -> Option { +fn default_2175() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2170() -> Option { +fn default_2176() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2171() -> String { +fn default_2177() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2172() -> Option { +fn default_2178() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2173() -> String { +fn default_2179() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2174() -> String { +fn default_2180() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2175() -> String { +fn default_2181() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2176() -> Option { +fn default_2182() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2177() -> String { +fn default_2183() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2178() -> Option { +fn default_2184() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2179() -> String { +fn default_2185() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2180() -> String { +fn default_2186() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2181() -> Vec { +fn default_2187() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2182() -> Vec { +fn default_2188() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2183() -> Option { +fn default_2189() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2184() -> Integer { +fn default_2190() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2185() -> String { +fn default_2191() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2186() -> Vec { +fn default_2192() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2187() -> Vec { +fn default_2193() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2188() -> String { +fn default_2194() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2189() -> Option { +fn default_2195() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2190() -> Vec { +fn default_2196() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2191() -> Integer { +fn default_2197() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2192() -> Vec { +fn default_2198() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2193() -> Option { +fn default_2199() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2194() -> Vec { +fn default_2200() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2195() -> Vec { +fn default_2201() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2196() -> Option { +fn default_2202() -> Option { serde_json::from_str("0").expect("schema default") } -fn default_2197() -> TuneProposalEffect { +fn default_2203() -> TuneProposalEffect { serde_json::from_str("\"future\"").expect("schema default") } -fn default_2198() -> TuneApplyVia { +fn default_2204() -> TuneApplyVia { serde_json::from_str("\"op\"").expect("schema default") } -fn default_2199() -> bool { +fn default_2205() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2200() -> Vec { +fn default_2206() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2201() -> Option { +fn default_2207() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2202() -> Option { +fn default_2208() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2203() -> String { +fn default_2209() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2204() -> Vec { +fn default_2210() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2205() -> Vec { +fn default_2211() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2206() -> Option { +fn default_2212() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2207() -> Option { +fn default_2213() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2208() -> Option { +fn default_2214() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2209() -> String { +fn default_2215() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2210() -> Option { +fn default_2216() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2211() -> Option { +fn default_2217() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2212() -> Option { +fn default_2218() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2213() -> Vec { +fn default_2219() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2214() -> bool { +fn default_2220() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2215() -> Option { +fn default_2221() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2216() -> Option { +fn default_2222() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2217() -> Vec { +fn default_2223() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2218() -> String { +fn default_2224() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2219() -> String { +fn default_2225() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2220() -> Vec> { +fn default_2226() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2221() -> std::collections::HashMap { +fn default_2227() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2222() -> Vec { +fn default_2228() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2223() -> Integer { +fn default_2229() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2224() -> Integer { +fn default_2230() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2225() -> String { +fn default_2231() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2226() -> String { +fn default_2232() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2227() -> String { +fn default_2233() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2228() -> Vec { +fn default_2234() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2229() -> Vec { +fn default_2235() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2230() -> String { +fn default_2236() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2231() -> String { +fn default_2237() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2232() -> bool { +fn default_2238() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2233() -> Integer { +fn default_2239() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2234() -> String { +fn default_2240() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2235() -> Option { +fn default_2241() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2236() -> Vec { +fn default_2242() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2237() -> String { +fn default_2243() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2238() -> String { +fn default_2244() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2239() -> String { +fn default_2245() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2240() -> Vec { +fn default_2246() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2241() -> String { +fn default_2247() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2242() -> String { +fn default_2248() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2243() -> std::collections::HashMap { +fn default_2249() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2244() -> String { +fn default_2250() -> String { serde_json::from_str("\"active\"").expect("schema default") } -fn default_2245() -> Option { +fn default_2251() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2246() -> Option { +fn default_2252() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2247() -> bool { +fn default_2253() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2248() -> String { +fn default_2254() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2249() -> String { +fn default_2255() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2250() -> Vec { +fn default_2256() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2251() -> Integer { +fn default_2257() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2252() -> String { +fn default_2258() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2253() -> String { +fn default_2259() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2254() -> Option { +fn default_2260() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2255() -> bool { +fn default_2261() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2256() -> String { +fn default_2262() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2257() -> bool { +fn default_2263() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2258() -> String { +fn default_2264() -> String { serde_json::from_str("\"inherit\"").expect("schema default") } -fn default_2259() -> Option { +fn default_2265() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2260() -> Option { +fn default_2266() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2261() -> bool { +fn default_2267() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2262() -> Vec { +fn default_2268() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2263() -> Integer { +fn default_2269() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2264() -> ProcedureEvolveOutputGate { +fn default_2270() -> ProcedureEvolveOutputGate { serde_json::from_str("\"none\"").expect("schema default") } -fn default_2265() -> String { +fn default_2271() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2266() -> f64 { +fn default_2272() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2267() -> std::collections::HashMap { +fn default_2273() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2268() -> std::collections::HashMap { +fn default_2274() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2269() -> std::collections::HashMap { +fn default_2275() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2270() -> std::collections::HashMap { +fn default_2276() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2271() -> String { +fn default_2277() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2272() -> Vec { +fn default_2278() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2273() -> Vec { +fn default_2279() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2274() -> Vec { +fn default_2280() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2275() -> std::collections::HashMap { +fn default_2281() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2276() -> Integer { +fn default_2282() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2277() -> bool { +fn default_2283() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2278() -> std::collections::HashMap { +fn default_2284() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2279() -> Vec { +fn default_2285() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2280() -> std::collections::HashMap { +fn default_2286() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2281() -> String { +fn default_2287() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2282() -> ProcedureLocateOutputStatus { +fn default_2288() -> ProcedureLocateOutputStatus { serde_json::from_str("\"authored\"").expect("schema default") } -fn default_2283() -> Option> { +fn default_2289() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2284() -> Vec>> { +fn default_2290() -> Vec>> { serde_json::from_str("[]").expect("schema default") } -fn default_2285() -> Vec { +fn default_2291() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2286() -> Vec { +fn default_2292() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2287() -> std::collections::HashMap { +fn default_2293() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2288() -> bool { +fn default_2294() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2289() -> Vec { +fn default_2295() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2290() -> Vec> { +fn default_2296() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2291() -> String { +fn default_2297() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2292() -> std::collections::HashMap { +fn default_2298() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2293() -> std::collections::HashMap { +fn default_2299() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2294() -> Vec { +fn default_2300() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2295() -> std::collections::HashMap { +fn default_2301() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2296() -> Option> { +fn default_2302() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2297() -> bool { +fn default_2303() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2298() -> std::collections::HashMap { +fn default_2304() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2299() -> ProcedureMatchStatus { +fn default_2305() -> ProcedureMatchStatus { serde_json::from_str("\"authored\"").expect("schema default") } -fn default_2300() -> Option> { +fn default_2306() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2301() -> Vec { +fn default_2307() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2302() -> Integer { +fn default_2308() -> Integer { serde_json::from_str("1").expect("schema default") } -fn default_2303() -> Vec> { +fn default_2309() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2304() -> f64 { +fn default_2310() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2305() -> f64 { +fn default_2311() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2306() -> f64 { +fn default_2312() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2307() -> Option { +fn default_2313() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2308() -> std::collections::HashMap { +fn default_2314() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2309() -> std::collections::HashMap> { +fn default_2315() -> std::collections::HashMap> { serde_json::from_str("{}").expect("schema default") } -fn default_2310() -> String { +fn default_2316() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2311() -> Integer { +fn default_2317() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2312() -> String { +fn default_2318() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2313() -> f64 { +fn default_2319() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2314() -> Vec { +fn default_2320() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2315() -> ProcedureReviseOutputOutcome { +fn default_2321() -> ProcedureReviseOutputOutcome { serde_json::from_str("\"opened\"").expect("schema default") } -fn default_2316() -> Vec { +fn default_2322() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2317() -> Vec { +fn default_2323() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2318() -> String { +fn default_2324() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2319() -> String { +fn default_2325() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2320() -> String { +fn default_2326() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2321() -> String { +fn default_2327() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2322() -> Option { +fn default_2328() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2323() -> Integer { +fn default_2329() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2324() -> Vec { +fn default_2330() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2325() -> std::collections::HashMap { +fn default_2331() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2326() -> Option { +fn default_2332() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2327() -> String { +fn default_2333() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2328() -> Integer { +fn default_2334() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2329() -> String { +fn default_2335() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2330() -> String { +fn default_2336() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2331() -> std::collections::HashMap { +fn default_2337() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2332() -> String { +fn default_2338() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2333() -> String { +fn default_2339() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2334() -> Option { +fn default_2340() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2335() -> RunBeginOutputStatus { +fn default_2341() -> RunBeginOutputStatus { serde_json::from_str("\"active\"").expect("schema default") } -fn default_2336() -> String { +fn default_2342() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2337() -> Integer { +fn default_2343() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2338() -> Integer { +fn default_2344() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2339() -> Integer { +fn default_2345() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2340() -> Integer { +fn default_2346() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2341() -> Vec { +fn default_2347() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2342() -> Integer { +fn default_2348() -> Integer { serde_json::from_str("-1").expect("schema default") } -fn default_2343() -> Integer { +fn default_2349() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2344() -> Integer { +fn default_2350() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2345() -> String { +fn default_2351() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2346() -> String { +fn default_2352() -> String { serde_json::from_str("\"keep\"").expect("schema default") } -fn default_2347() -> Integer { +fn default_2353() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2348() -> Integer { +fn default_2354() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2349() -> Integer { +fn default_2355() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2350() -> Option { +fn default_2356() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2351() -> Integer { +fn default_2357() -> Integer { serde_json::from_str("-1").expect("schema default") } -fn default_2352() -> Vec { +fn default_2358() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2353() -> Vec { +fn default_2359() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2354() -> Integer { +fn default_2360() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2355() -> Integer { +fn default_2361() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2356() -> Integer { +fn default_2362() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2357() -> f64 { +fn default_2363() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2358() -> Integer { +fn default_2364() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2359() -> Vec { +fn default_2365() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2360() -> Integer { +fn default_2366() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2361() -> Vec { +fn default_2367() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2362() -> Integer { +fn default_2368() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2363() -> Integer { +fn default_2369() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2364() -> Integer { +fn default_2370() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2365() -> Vec { +fn default_2371() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2366() -> Option { +fn default_2372() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2367() -> Vec { +fn default_2373() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2368() -> Vec { +fn default_2374() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2369() -> String { +fn default_2375() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2370() -> Vec { +fn default_2376() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2371() -> bool { +fn default_2377() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2372() -> String { +fn default_2378() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2373() -> Integer { +fn default_2379() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2374() -> Integer { +fn default_2380() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2375() -> Integer { +fn default_2381() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2376() -> Integer { +fn default_2382() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2377() -> bool { +fn default_2383() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2378() -> bool { +fn default_2384() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2379() -> Option> { +fn default_2385() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2380() -> LiveSearchResultsLive { +fn default_2386() -> LiveSearchResultsLive { serde_json::from_str("true").expect("schema default") } -fn default_2381() -> String { +fn default_2387() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2382() -> LiveSearchHitLive { +fn default_2388() -> LiveSearchHitLive { serde_json::from_str("true").expect("schema default") } -fn default_2383() -> Vec { +fn default_2389() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2384() -> Option { +fn default_2390() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2385() -> std::collections::HashMap { +fn default_2391() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2386() -> std::collections::HashMap { +fn default_2392() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2387() -> std::collections::HashMap { +fn default_2393() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2388() -> std::collections::HashMap { +fn default_2394() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2389() -> Option> { +fn default_2395() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2390() -> Vec { +fn default_2396() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2391() -> Integer { +fn default_2397() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2392() -> String { +fn default_2398() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2393() -> Integer { +fn default_2399() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2394() -> String { +fn default_2400() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2395() -> String { +fn default_2401() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2396() -> String { +fn default_2402() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2397() -> String { +fn default_2403() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2398() -> String { +fn default_2404() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2399() -> String { +fn default_2405() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2400() -> String { +fn default_2406() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2401() -> String { +fn default_2407() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2402() -> Vec { +fn default_2408() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2403() -> String { +fn default_2409() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2404() -> String { +fn default_2410() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2405() -> Vec { +fn default_2411() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2406() -> String { +fn default_2412() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2407() -> String { +fn default_2413() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2408() -> Vec { +fn default_2414() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2409() -> Vec { +fn default_2415() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2410() -> Vec { +fn default_2416() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2411() -> String { +fn default_2417() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2412() -> String { +fn default_2418() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2413() -> Vec { +fn default_2419() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2414() -> Vec { +fn default_2420() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2415() -> Vec { +fn default_2421() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2416() -> String { +fn default_2422() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2417() -> String { +fn default_2423() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2418() -> Option { +fn default_2424() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2419() -> String { +fn default_2425() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2420() -> String { +fn default_2426() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2421() -> String { +fn default_2427() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2422() -> String { +fn default_2428() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2423() -> String { +fn default_2429() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2424() -> String { +fn default_2430() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2425() -> Vec { +fn default_2431() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2426() -> Option { +fn default_2432() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2427() -> Integer { +fn default_2433() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2428() -> Integer { +fn default_2434() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2429() -> Integer { +fn default_2435() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2430() -> Integer { +fn default_2436() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2431() -> Integer { +fn default_2437() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2432() -> bool { +fn default_2438() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2433() -> String { +fn default_2439() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2434() -> String { +fn default_2440() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2435() -> String { +fn default_2441() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2436() -> String { +fn default_2442() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2437() -> String { +fn default_2443() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2438() -> String { +fn default_2444() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2439() -> String { +fn default_2445() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2440() -> Option { +fn default_2446() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2441() -> Integer { +fn default_2447() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2442() -> Integer { +fn default_2448() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2443() -> Vec { +fn default_2449() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2444() -> String { +fn default_2450() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2445() -> String { +fn default_2451() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2446() -> String { +fn default_2452() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2447() -> String { +fn default_2453() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2448() -> Integer { +fn default_2454() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2449() -> Integer { +fn default_2455() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2450() -> Integer { +fn default_2456() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2451() -> Integer { +fn default_2457() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2452() -> Integer { +fn default_2458() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2453() -> f64 { +fn default_2459() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2454() -> Integer { +fn default_2460() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2455() -> Integer { +fn default_2461() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2456() -> Integer { +fn default_2462() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2457() -> String { +fn default_2463() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2458() -> SessionBriefStats { +fn default_2464() -> SessionBriefStats { serde_json::from_str("{\"events_in\":0,\"windows\":0,\"events_total\":0,\"source_chars\":0,\"brief_chars\":0,\"compression_ratio\":0.0,\"dropped_ungrounded\":0,\"tokens_in\":0,\"tokens_out\":0,\"llm_model\":\"\"}").expect("schema default") } -fn default_2459() -> String { +fn default_2465() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2460() -> String { +fn default_2466() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2461() -> Option { +fn default_2467() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2462() -> Option { +fn default_2468() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2463() -> Option { +fn default_2469() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2464() -> Integer { +fn default_2470() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2465() -> std::collections::HashMap { +fn default_2471() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2466() -> String { +fn default_2472() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2467() -> String { +fn default_2473() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2468() -> Option { +fn default_2474() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2469() -> String { +fn default_2475() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2470() -> Integer { +fn default_2476() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2471() -> Integer { +fn default_2477() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2472() -> Option { +fn default_2478() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2473() -> std::collections::HashMap { +fn default_2479() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2474() -> String { +fn default_2480() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2475() -> Integer { +fn default_2481() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2476() -> String { +fn default_2482() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2477() -> Option { +fn default_2483() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2478() -> String { +fn default_2484() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2479() -> Option { +fn default_2485() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2480() -> String { +fn default_2486() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2481() -> String { +fn default_2487() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2482() -> String { +fn default_2488() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2483() -> String { +fn default_2489() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2484() -> Integer { +fn default_2490() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2485() -> Integer { +fn default_2491() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2486() -> String { +fn default_2492() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2487() -> std::collections::HashMap { +fn default_2493() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2488() -> String { +fn default_2494() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2489() -> String { +fn default_2495() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2490() -> bool { +fn default_2496() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2491() -> String { +fn default_2497() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2492() -> std::collections::HashMap { +fn default_2498() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2493() -> Vec> { +fn default_2499() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2494() -> Vec { +fn default_2500() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2495() -> Vec { +fn default_2501() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2496() -> bool { +fn default_2502() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2497() -> String { +fn default_2503() -> String { serde_json::from_str("\"unknown\"").expect("schema default") } -fn default_2498() -> String { +fn default_2504() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2499() -> Vec { +fn default_2505() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2500() -> bool { +fn default_2506() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2501() -> String { +fn default_2507() -> String { serde_json::from_str("\"none\"").expect("schema default") } -fn default_2502() -> bool { +fn default_2508() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2503() -> Vec { +fn default_2509() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2504() -> std::collections::HashMap { +fn default_2510() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2505() -> Vec> { +fn default_2511() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2506() -> bool { +fn default_2512() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2507() -> bool { +fn default_2513() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2508() -> Vec> { +fn default_2514() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2509() -> std::collections::HashMap { +fn default_2515() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2510() -> String { +fn default_2516() -> String { serde_json::from_str("\"none\"").expect("schema default") } -fn default_2511() -> Vec> { +fn default_2517() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2512() -> bool { +fn default_2518() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2513() -> String { +fn default_2519() -> String { serde_json::from_str("\"calibrated\"").expect("schema default") } -fn default_2514() -> std::collections::HashMap { +fn default_2520() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2515() -> std::collections::HashMap { +fn default_2521() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2516() -> String { +fn default_2522() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2517() -> std::collections::HashMap { +fn default_2523() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2518() -> std::collections::HashMap { +fn default_2524() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2519() -> std::collections::HashMap { +fn default_2525() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2520() -> String { +fn default_2526() -> String { serde_json::from_str("\"ok\"").expect("schema default") } -fn default_2521() -> String { +fn default_2527() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2522() -> String { +fn default_2528() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2523() -> bool { +fn default_2529() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2524() -> Integer { +fn default_2530() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2525() -> String { +fn default_2531() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2526() -> String { +fn default_2532() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2527() -> Vec { +fn default_2533() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2528() -> bool { +fn default_2534() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2529() -> Vec { +fn default_2535() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2530() -> std::collections::HashMap> { +fn default_2536() -> std::collections::HashMap> { serde_json::from_str("{}").expect("schema default") } -fn default_2531() -> Vec> { +fn default_2537() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2532() -> Vec> { +fn default_2538() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2533() -> String { +fn default_2539() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2534() -> Vec> { +fn default_2540() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2535() -> std::collections::HashMap { +fn default_2541() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2536() -> String { +fn default_2542() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2537() -> Vec> { +fn default_2543() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2538() -> bool { +fn default_2544() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2539() -> Integer { +fn default_2545() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2540() -> Vec> { +fn default_2546() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2541() -> String { +fn default_2547() -> String { serde_json::from_str("\"no_flaky_signal\"").expect("schema default") } -fn default_2542() -> bool { +fn default_2548() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2543() -> Option> { +fn default_2549() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2544() -> Vec { +fn default_2550() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2545() -> bool { +fn default_2551() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2546() -> std::collections::HashMap { +fn default_2552() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2547() -> String { +fn default_2553() -> String { serde_json::from_str("\"not_computed\"").expect("schema default") } -fn default_2548() -> Vec> { +fn default_2554() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2549() -> String { +fn default_2555() -> String { serde_json::from_str("\"candidate\"").expect("schema default") } -fn default_2550() -> std::collections::HashMap { +fn default_2556() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2551() -> String { +fn default_2557() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2552() -> bool { +fn default_2558() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2553() -> Integer { +fn default_2559() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2554() -> std::collections::HashMap { +fn default_2560() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2555() -> bool { +fn default_2561() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2556() -> Vec> { +fn default_2562() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2557() -> std::collections::HashMap { +fn default_2563() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2558() -> std::collections::HashMap { +fn default_2564() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2559() -> String { +fn default_2565() -> String { serde_json::from_str("\"lower_bound\"").expect("schema default") } -fn default_2560() -> bool { +fn default_2566() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2561() -> Vec { +fn default_2567() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2562() -> Vec> { +fn default_2568() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2563() -> std::collections::HashMap { +fn default_2569() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2564() -> Vec { +fn default_2570() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2565() -> String { +fn default_2571() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2566() -> bool { +fn default_2572() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2567() -> bool { +fn default_2573() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2568() -> std::collections::HashMap { +fn default_2574() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2569() -> String { +fn default_2575() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2570() -> bool { +fn default_2576() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2571() -> std::collections::HashMap { +fn default_2577() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2572() -> std::collections::HashMap { +fn default_2578() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2573() -> Vec> { +fn default_2579() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2574() -> Vec { +fn default_2580() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2575() -> std::collections::HashMap { +fn default_2581() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2576() -> Vec> { +fn default_2582() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2577() -> bool { +fn default_2583() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2578() -> bool { +fn default_2584() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2579() -> Vec { +fn default_2585() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2580() -> std::collections::HashMap { +fn default_2586() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2581() -> String { +fn default_2587() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2582() -> std::collections::HashMap { +fn default_2588() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2583() -> bool { +fn default_2589() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2584() -> bool { +fn default_2590() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2585() -> String { +fn default_2591() -> String { serde_json::from_str("\"no_signal\"").expect("schema default") } -fn default_2586() -> Vec { +fn default_2592() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2587() -> f64 { +fn default_2593() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2588() -> Integer { +fn default_2594() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2589() -> String { +fn default_2595() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2590() -> std::collections::HashMap { +fn default_2596() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2591() -> std::collections::HashMap { +fn default_2597() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2592() -> std::collections::HashMap { +fn default_2598() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2593() -> std::collections::HashMap { +fn default_2599() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2594() -> String { +fn default_2600() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2595() -> std::collections::HashMap { +fn default_2601() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2596() -> bool { +fn default_2602() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2597() -> std::collections::HashMap { +fn default_2603() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2598() -> std::collections::HashMap { +fn default_2604() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2599() -> std::collections::HashMap { +fn default_2605() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2600() -> std::collections::HashMap { +fn default_2606() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2601() -> String { +fn default_2607() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2602() -> Vec> { +fn default_2608() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2603() -> Integer { +fn default_2609() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2604() -> String { +fn default_2610() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2605() -> bool { +fn default_2611() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2606() -> String { +fn default_2612() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2607() -> Vec { +fn default_2613() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2608() -> bool { +fn default_2614() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2609() -> Vec { +fn default_2615() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2610() -> f64 { +fn default_2616() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2611() -> String { +fn default_2617() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2612() -> Integer { +fn default_2618() -> Integer { serde_json::from_str("4096").expect("schema default") } -fn default_2613() -> Integer { +fn default_2619() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2614() -> Option { +fn default_2620() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2615() -> f64 { +fn default_2621() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2616() -> Option { +fn default_2622() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2617() -> Vec { +fn default_2623() -> Vec { serde_json::from_str("[]").expect("schema default") } diff --git a/sdk/rust/tests/registry_contracts.rs b/sdk/rust/tests/registry_contracts.rs index 7fae81e196..942c6c07b6 100644 --- a/sdk/rust/tests/registry_contracts.rs +++ b/sdk/rust/tests/registry_contracts.rs @@ -7101,6 +7101,85 @@ fn grants_unshare_agent() { ); } #[test] +fn grants_invite() { + let value: clickhouse_loom::GrantsInviteInput = serde_json::from_str( + "{\"org\":\"sample\",\"namespace\":\"sample\",\"to\":\"sample\",\"role\":\"viewer\"}", + ) + .unwrap(); + let encoded = serde_json::to_value(value).unwrap(); + assert!(encoded.is_object()); + let value: clickhouse_loom::GrantsInviteOutput = + serde_json::from_str("{\"outcome\":\"granted\",\"role\":\"viewer\"}").unwrap(); + let encoded = serde_json::to_value(value).unwrap(); + assert!(encoded.is_object()); + assert_eq!( + encoded["subject"], + serde_json::from_str::("\"\"").unwrap(), + "grants.invite:subject" + ); + assert_eq!( + encoded["invite_id"], + serde_json::from_str::("\"\"").unwrap(), + "grants.invite:invite_id" + ); + assert_eq!( + encoded["link_path"], + serde_json::from_str::("\"\"").unwrap(), + "grants.invite:link_path" + ); + assert_eq!( + encoded["url"], + serde_json::from_str::("\"\"").unwrap(), + "grants.invite:url" + ); + assert_eq!( + encoded["expires_at"], + serde_json::from_str::("null").unwrap(), + "grants.invite:expires_at" + ); + assert_eq!( + encoded["emailed"], + serde_json::from_str::("false").unwrap(), + "grants.invite:emailed" + ); +} +#[test] +fn grants_list_invites() { + let value: clickhouse_loom::GrantsListInvitesInput = + serde_json::from_str("{\"org\":\"sample\",\"namespace\":\"sample\"}").unwrap(); + let encoded = serde_json::to_value(value).unwrap(); + assert!(encoded.is_object()); + let value: clickhouse_loom::GrantsListInvitesOutput = + serde_json::from_str("{\"rows\":[]}").unwrap(); + let encoded = serde_json::to_value(value).unwrap(); + assert!(encoded.is_object()); +} +#[test] +fn grants_cancel_invite() { + let value: clickhouse_loom::GrantsCancelInviteInput = serde_json::from_str( + "{\"org\":\"sample\",\"namespace\":\"sample\",\"invite_id\":\"sample\"}", + ) + .unwrap(); + let encoded = serde_json::to_value(value).unwrap(); + assert!(encoded.is_object()); + let value: clickhouse_loom::GrantsCancelInviteOutput = + serde_json::from_str("{\"cancelled\":false}").unwrap(); + let encoded = serde_json::to_value(value).unwrap(); + assert!(encoded.is_object()); +} +#[test] +fn grants_accept_invite() { + let value: clickhouse_loom::GrantsAcceptInviteInput = + serde_json::from_str("{\"org\":\"sample\",\"namespace\":\"sample\",\"secret\":\"sample\"}") + .unwrap(); + let encoded = serde_json::to_value(value).unwrap(); + assert!(encoded.is_object()); + let value: clickhouse_loom::GrantsAcceptInviteOutput = + serde_json::from_str("{\"namespace\":\"sample\",\"role\":\"viewer\"}").unwrap(); + let encoded = serde_json::to_value(value).unwrap(); + assert!(encoded.is_object()); +} +#[test] fn collection_budget_set() { let value: clickhouse_loom::CollectionBudgetSetInput = serde_json::from_str("{\"org\":\"sample\",\"namespace\":\"sample\"}").unwrap(); diff --git a/sdk/typescript/src/generated/ops.ts b/sdk/typescript/src/generated/ops.ts index 4b03537df0..1e501631d5 100644 --- a/sdk/typescript/src/generated/ops.ts +++ b/sdk/typescript/src/generated/ops.ts @@ -3286,6 +3286,17 @@ export interface FactsTraverseOutput { hubs?: string[]; } +export interface GrantsAcceptInviteInput { + org: string; + namespace: string; + secret: string; +} + +export interface GrantsAcceptInviteOutput { + namespace: string; + role: "viewer" | "writer" | "admin"; +} + export interface GrantsApproveInput { org: string; namespace: string; @@ -3302,6 +3313,16 @@ export interface GrantsApproveOutput { decided_at: string; // date-time } +export interface GrantsCancelInviteInput { + org: string; + namespace: string; + invite_id: string; +} + +export interface GrantsCancelInviteOutput { + cancelled: boolean; +} + export interface GrantsCreateInput { org: string; namespace: string; @@ -3319,6 +3340,24 @@ export interface GrantsCreateOutput { granted_at: string; // date-time } +export interface GrantsInviteInput { + org: string; + namespace: string; + to: string; + role: "viewer" | "writer" | "admin"; +} + +export interface GrantsInviteOutput { + outcome: "granted" | "invited"; + role: "viewer" | "writer" | "admin"; + subject?: string; + invite_id?: string; + link_path?: string; + url?: string; + expires_at?: string | null; + emailed?: boolean; +} + export interface GrantsListInput { org: string; namespace: string; @@ -3344,6 +3383,24 @@ export interface GrantsListOutput { truncated?: boolean; } +export interface GrantsListInvitesInput { + org: string; + namespace: string; +} + +export interface InviteEntry { + invite_id: string; + email: string; + role: "viewer" | "writer" | "admin"; + created_by: string; + created_at: string; // date-time + expires_at: string; // date-time +} + +export interface GrantsListInvitesOutput { + rows: InviteEntry[]; +} + export interface GrantsPendingForMeInput { org: string; limit?: number; @@ -11243,9 +11300,13 @@ export type OpName = | "facts.path" | "facts.related" | "facts.traverse" + | "grants.accept_invite" | "grants.approve" + | "grants.cancel_invite" | "grants.create" + | "grants.invite" | "grants.list" + | "grants.list_invites" | "grants.pending_for_me" | "grants.revoke" | "grants.share_agent" @@ -11635,9 +11696,13 @@ export interface OpMap { "facts.path": { input: FactsPathInput; output: FactsPathOutput }; "facts.related": { input: FactsRelatedInput; output: FactsRelatedOutput }; "facts.traverse": { input: FactsTraverseInput; output: FactsTraverseOutput }; + "grants.accept_invite": { input: GrantsAcceptInviteInput; output: GrantsAcceptInviteOutput }; "grants.approve": { input: GrantsApproveInput; output: GrantsApproveOutput }; + "grants.cancel_invite": { input: GrantsCancelInviteInput; output: GrantsCancelInviteOutput }; "grants.create": { input: GrantsCreateInput; output: GrantsCreateOutput }; + "grants.invite": { input: GrantsInviteInput; output: GrantsInviteOutput }; "grants.list": { input: GrantsListInput; output: GrantsListOutput }; + "grants.list_invites": { input: GrantsListInvitesInput; output: GrantsListInvitesOutput }; "grants.pending_for_me": { input: GrantsPendingForMeInput; output: GrantsPendingForMeOutput }; "grants.revoke": { input: GrantsRevokeInput; output: GrantsRevokeOutput }; "grants.share_agent": { input: GrantsShareAgentInput; output: GrantsShareAgentOutput }; @@ -12027,9 +12092,13 @@ export const OPS: readonly OpSpec[] = [ { name: "facts.path", group: "facts", method: "path", idempotent: true, role: "viewer", maturity: "experimental", budgetP99Ms: 250, audit: false, readOnly: true }, { name: "facts.related", group: "facts", method: "related", idempotent: true, role: "viewer", maturity: "experimental", budgetP99Ms: 60, audit: false, readOnly: true }, { name: "facts.traverse", group: "facts", method: "traverse", idempotent: true, role: "viewer", maturity: "stable", budgetP99Ms: 200, audit: false, readOnly: true }, + { name: "grants.accept_invite", group: "grants", method: "acceptInvite", idempotent: false, role: "viewer", maturity: "experimental", budgetP99Ms: 150, audit: true, readOnly: false }, { name: "grants.approve", group: "grants", method: "approve", idempotent: true, role: "admin", maturity: "experimental", budgetP99Ms: 80, audit: true, readOnly: false }, + { name: "grants.cancel_invite", group: "grants", method: "cancelInvite", idempotent: true, role: "admin", maturity: "experimental", budgetP99Ms: 80, audit: true, readOnly: false }, { name: "grants.create", group: "grants", method: "create", idempotent: true, role: "admin", maturity: "stable", budgetP99Ms: 50, audit: true, readOnly: false }, + { name: "grants.invite", group: "grants", method: "invite", idempotent: false, role: "admin", maturity: "experimental", budgetP99Ms: 3000, audit: true, readOnly: false }, { name: "grants.list", group: "grants", method: "list", idempotent: true, role: "viewer", maturity: "stable", budgetP99Ms: 80, audit: false, readOnly: true }, + { name: "grants.list_invites", group: "grants", method: "listInvites", idempotent: true, role: "admin", maturity: "experimental", budgetP99Ms: 80, audit: false, readOnly: false }, { name: "grants.pending_for_me", group: "grants", method: "pendingForMe", idempotent: true, role: "viewer", maturity: "experimental", budgetP99Ms: 150, audit: false, readOnly: true }, { name: "grants.revoke", group: "grants", method: "revoke", idempotent: true, role: "admin", maturity: "experimental", budgetP99Ms: 80, audit: true, readOnly: false }, { name: "grants.share_agent", group: "grants", method: "shareAgent", idempotent: true, role: "writer", maturity: "experimental", budgetP99Ms: 80, audit: true, readOnly: false }, @@ -12308,4 +12377,4 @@ export const OP_BY_NAME: Readonly> = Object.fromEntries( OPS.map((o) => [o.name, o]), ) as Readonly>; -export const GENERATED_OP_COUNT = 389; +export const GENERATED_OP_COUNT = 393; diff --git a/server/auth/authz.py b/server/auth/authz.py index beac34dbc7..1219ed3996 100644 --- a/server/auth/authz.py +++ b/server/auth/authz.py @@ -869,6 +869,15 @@ async def _lookup_grant(org: str, namespace: str, subject: str) -> Role | None: return role +async def subject_grant_role(org: str, namespace: str, subject: str) -> Role | None: + """The role `subject` holds on `namespace` through grants alone, no token's claim + counted: on a collection as `sharing.roles` reads it, elsewhere `_lookup_grant`. + A read that fails raises, or answers None and notes it (`fail_closed.unreadable`).""" + if sharing.is_collection(namespace): + return await sharing.granted_role(org, subject, namespace) + return await _lookup_grant(org, namespace, subject) + + class CachedGate: """`check_authorized` for one token in one org, for the listings and the default that must agree with the gate: the gate itself, handed the grant diff --git a/server/auth/grant_claims.py b/server/auth/grant_claims.py index 7092f532bd..e48b2405f1 100644 --- a/server/auth/grant_claims.py +++ b/server/auth/grant_claims.py @@ -19,7 +19,8 @@ (`maintainers.repo_change`), the repository's admins and the namespaces' admins, or the trusts; then a bot or a grant (several sorted by namespace). Taken the other way round, two changes wait each other out and both answer -503. +503. An invitation's claim (`invite_change`) is held alone: accepting spends the +link under it and grants after leaving it. """ from __future__ import annotations @@ -56,6 +57,14 @@ def grant_change(org: str, namespace: str, subject: str) -> AbstractAsyncContext ) +def invite_change(org: str, namespace: str, invite_id: str) -> AbstractAsyncContextManager[None]: + """Hold one invitation from the read that finds it open to the write that accepts or + cancels it: two people opening one link at once must not both be let in.""" + return _claimed( + "invite:" + json.dumps([org, namespace, invite_id]), f"an invitation to {org}/{namespace}" + ) + + def admins_change(org: str, namespace: str) -> AbstractAsyncContextManager[None]: """Hold the set of admins of `namespace` (or of a repository's branches, as `repo:`). A change that may take admin from someone takes it before the diff --git a/server/auth/self_signup.py b/server/auth/self_signup.py index 090b26fc5b..5b0c8d8bc2 100644 --- a/server/auth/self_signup.py +++ b/server/auth/self_signup.py @@ -209,7 +209,8 @@ async def _claim_account(input: SelfSignupInput, org: str, namespace: str) -> Se return await _claim_checked(input, org, namespace, subject, ch) -def _valid_signup_email(email: str) -> bool: +def valid_signup_email(email: str) -> bool: + """One plain address: a dot-atom local part and a domain IDNA encodes.""" local, _, domain = email.rpartition("@") if not local.isprintable() or not domain.isprintable(): return False @@ -248,7 +249,7 @@ async def _claim_checked( await _refuse_empowered(ch, org, namespace) contact_email = input.email.strip().lower() - if not _valid_signup_email(contact_email): + if not valid_signup_email(contact_email): raise HTTPException( status_code=400, detail={ diff --git a/server/auth/sharing.py b/server/auth/sharing.py index 66e15c9847..5091ca9a89 100644 --- a/server/auth/sharing.py +++ b/server/auth/sharing.py @@ -230,6 +230,17 @@ def _capped( return min(ceilings, key=lambda r: r.value) # type: ignore[union-attr] +async def granted_role(org: str, subject: str, namespace: str) -> Role | None: + """The role `subject`'s grants give it on the shared collection `namespace`, read as + `roles` reads them (its own, its groups' and everyone's, there or on a collection + above), with no token to cap it. A failed read raises.""" + collections = await tree(org) + if namespace not in collections.parent: + return None + maps = await _grant_maps(org, [subject, *await groups_of(org, subject), EVERYONE]) + return _best(maps, collections.lineage(namespace)) + + async def role(auth: AuthorizationClaims, org: str, namespace: str) -> Role | None: """The request's role on the collection `namespace`.""" return (await roles(auth, org, [namespace]))[namespace] diff --git a/server/erasure/app/saga_steps.py b/server/erasure/app/saga_steps.py index f3a17aed5d..b9267a5757 100644 --- a/server/erasure/app/saga_steps.py +++ b/server/erasure/app/saga_steps.py @@ -192,13 +192,15 @@ async def _step_scrub_usage_labels_by_user(org: str, user_id: str) -> int: async def _step_revoke_grants_by_user(org: str, user_id: str) -> int: """Every grant naming the user as a principal, `user:`, revoked (which moves the watermark) and then deleted; then the user's id off the - grants they gave others. Returns the grants revoked.""" + grants they gave others and the invitations they made. Returns the grants revoked.""" from server.identity.app.grants import forget_granter, revoke_subject + from server.identity.app.invites import forget_maker from server.memory.app.provenance import writer_actor principal = "user:" + user_id revoked = await revoke_subject(org, principal, actor=writer_actor("-")) await forget_granter(org, principal) + await forget_maker(org, principal) await principal_steps.delete_grant_rows_of_user(org, user_id) return revoked diff --git a/server/erasure/store/census.py b/server/erasure/store/census.py index 1e0ce762ad..511065c7bf 100644 --- a/server/erasure/store/census.py +++ b/server/erasure/store/census.py @@ -585,7 +585,7 @@ def owner(self, scope_type: str) -> str | None: "agent_runs.delete": ("loom.agent_run_claims",), # What a grant, a group and the collection tree say about a user as a # principal: identifiers, no memory content; rewritten, not counted. - "grants.revoke": ("loom.namespace_grants",), + "grants.revoke": ("loom.namespace_grants", "loom.namespace_invites"), "groups.remove_member": ("loom.principal_groups",), "personal.retire": ("loom.namespaces",), # Deactivates the namespace's sources and clears their credentials, and a crawl's diff --git a/server/identity/api/models_grants.py b/server/identity/api/models_grants.py index c91c2d480d..6f62a577c0 100644 --- a/server/identity/api/models_grants.py +++ b/server/identity/api/models_grants.py @@ -210,3 +210,92 @@ class GrantsUnshareAgentOutput(BaseModel): revoked: bool # When the revoke was written (UTC); None when nothing was revoked. revoked_at: datetime | None = None + + +class GrantsInviteInput(BaseModel): + """Give a person a role on a namespace by login handle or email.""" + + org: str + namespace: str + # The person to give `role`: a login handle an account or live grant holds (any other + # is refused), or an email, granted at once when verified for an account or under + # single sign-on only, and otherwise sent an invitation link. + to: str = Field(min_length=1, max_length=320) + # `viewer`, `writer` or `admin`; a code namespace takes only `viewer` and `admin`. + role: GrantRoleStr + + +class GrantsInviteOutput(BaseModel): + # "granted": the grant is written under `subject`; "invited": no account holds the + # email, and `link_path` opens the invitation. + outcome: Literal["granted", "invited"] + # The role given, as asked. + role: GrantRoleStr + # On "granted", the subject the grant is written under: the person's handle as stored + # (an account's, or a grant's), or, where sign-in is single sign-on only or the + # request has no token, `to` as typed. + subject: str = "" + # On "invited": the invitation, for grants.cancel_invite. + invite_id: str = "" + # On "invited": the dashboard path that accepts it, its secret in the fragment. Returned + # this once; Loom keeps only the secret's hash. + link_path: str = "" + # `link_path` on the server's public_base_url; "" when that is unset. + url: str = "" + # On "invited": when the link stops working (UTC), `invite_ttl_seconds` after it was made. + expires_at: datetime | None = None + # On "invited": the link was emailed to `to` (the server has mail settings). + emailed: bool = False + + +class GrantsListInvitesInput(BaseModel): + """List a namespace's open invitations.""" + + org: str + namespace: str + + +class _InviteEntry(BaseModel): + invite_id: str + # The address the invitation was made for. + email: str + role: GrantRoleStr + created_by: str + created_at: datetime + expires_at: datetime + + +class GrantsListInvitesOutput(BaseModel): + # The namespace's open links that still admit someone (not accepted, cancelled or + # expired, and with a maker who still stands), newest first; at most 200. + rows: list[_InviteEntry] + + +class GrantsCancelInviteInput(BaseModel): + """Cancel an open invitation, so its link admits nobody.""" + + org: str + namespace: str + # The invitation, as grants.invite and grants.list_invites return it. + invite_id: str = Field(min_length=1, max_length=64) + + +class GrantsCancelInviteOutput(BaseModel): + # True when an open invitation was cancelled; false when none was open under the id. + cancelled: bool + + +class GrantsAcceptInviteInput(BaseModel): + """Accept an invitation link as the signed-in person.""" + + org: str + # The namespace the link names. + namespace: str + # The secret from the link's fragment. + secret: str = Field(min_length=1, max_length=128) + + +class GrantsAcceptInviteOutput(BaseModel): + namespace: str + # The caller's role on the namespace now: the invitation's, or a higher one they held. + role: GrantRoleStr diff --git a/server/identity/api/ops_grants.py b/server/identity/api/ops_grants.py index 002ec3400f..ab7658dad0 100644 --- a/server/identity/api/ops_grants.py +++ b/server/identity/api/ops_grants.py @@ -3,11 +3,19 @@ from __future__ import annotations from server.identity.api.models_grants import ( + GrantsAcceptInviteInput, + GrantsAcceptInviteOutput, GrantsApproveInput, GrantsApproveOutput, + GrantsCancelInviteInput, + GrantsCancelInviteOutput, GrantsCreateInput, GrantsCreateOutput, + GrantsInviteInput, + GrantsInviteOutput, GrantsListInput, + GrantsListInvitesInput, + GrantsListInvitesOutput, GrantsListOutput, GrantsPendingForMeInput, GrantsPendingForMeOutput, @@ -29,6 +37,14 @@ handle_grants_pending_for_me, handle_grants_revoke, ) +from server.identity.app.invites import ( + accept_audit_subject, + handle_grants_accept_invite, + handle_grants_cancel_invite, + handle_grants_invite, + handle_grants_list_invites, + invite_audit_subject, +) from server.operations.base import Operation, Role grants_create = Operation( @@ -116,6 +132,58 @@ audit=True, ) +grants_invite = Operation( + name="grants.invite", + maturity="experimental", + input_model=GrantsInviteInput, + output_model=GrantsInviteOutput, + handler=handle_grants_invite, + # A retry after a lost reply makes a second link; the first stays listed to cancel. + idempotent=False, + required_role=Role.ADMIN, + audit=True, + audit_subject=invite_audit_subject, +) + +grants_list_invites = Operation( + name="grants.list_invites", + maturity="experimental", + input_model=GrantsListInvitesInput, + output_model=GrantsListInvitesOutput, + handler=handle_grants_list_invites, + idempotent=True, + # The addresses invited are the admins' to see, as the people to approve are. + required_role=Role.ADMIN, + audit=False, +) + +grants_cancel_invite = Operation( + name="grants.cancel_invite", + maturity="experimental", + input_model=GrantsCancelInviteInput, + output_model=GrantsCancelInviteOutput, + handler=handle_grants_cancel_invite, + idempotent=True, + required_role=Role.ADMIN, + audit=True, +) + +# The person accepting holds no grant on the namespace yet: the link's secret is what +# admits them, and the handler checks it, the person and the org. +grants_accept_invite = Operation( + name="grants.accept_invite", + maturity="experimental", + input_model=GrantsAcceptInviteInput, + output_model=GrantsAcceptInviteOutput, + handler=handle_grants_accept_invite, + # A second call finds the link used and answers 404. + idempotent=False, + required_role=Role.VIEWER, + audit=True, + audit_subject=accept_audit_subject, + skip_namespace_authz=True, +) + OPERATIONS: list[Operation] = [ grants_create, @@ -125,4 +193,8 @@ grants_approve, grants_share_agent, grants_unshare_agent, + grants_invite, + grants_list_invites, + grants_cancel_invite, + grants_accept_invite, ] diff --git a/server/identity/app/grants.py b/server/identity/app/grants.py index 9c5101a54b..3dc12ecfa2 100644 --- a/server/identity/app/grants.py +++ b/server/identity/app/grants.py @@ -78,7 +78,7 @@ async def adopt_namespace( return now -async def _enforce_code_ceiling(org: str, namespace: str, role: str) -> None: +async def enforce_code_ceiling(org: str, namespace: str, role: str) -> None: """On a code namespace `writer` does not exist; a reader (viewer) or maintainer (admin) may be granted or approved by anyone the transport's ADMIN gate let through: an org admin or a current maintainer of that repository.""" @@ -147,7 +147,7 @@ def _refuse_approval_below(current: str, target: str, input: GrantsApproveInput) ) -def _enforce_principal_target(namespace: str, subject: str) -> None: +def enforce_principal_target(namespace: str, subject: str) -> None: """A personal collection keeps its one grant; a group, an agent or `everyone` holds grants only on collections; a `user:`/`group:`/`agent:` subject needs a well-formed id.""" @@ -190,14 +190,19 @@ async def handle_grants_create(input: GrantsCreateInput) -> GrantsCreateOutput: async def create_grant( - input: GrantsCreateInput, may_replace: Callable[[GrantState], None] | None = None + input: GrantsCreateInput, + may_replace: Callable[[GrantState], None] | None = None, + *, + issuer: str | None = None, ) -> GrantsCreateOutput: """`grants.create`; `may_replace` raises for a live row this caller must - not write over, checked on the row read under the grant's claim.""" - await _enforce_code_ceiling(input.org, input.namespace, input.role) - _enforce_principal_target(input.namespace, input.subject) + not write over, checked on the row read under the grant's claim. `issuer` + is stamped as `granted_by` in place of the caller: the maker of an + invitation the caller accepts.""" + await enforce_code_ceiling(input.org, input.namespace, input.role) + enforce_principal_target(input.namespace, input.subject) async with _group_held(input.org, input.subject): - now = await _create_grant(input, may_replace) + now = await _create_grant(input, may_replace, issuer) return GrantsCreateOutput( org=input.org, namespace=input.namespace, @@ -208,7 +213,9 @@ async def create_grant( async def _create_grant( - input: GrantsCreateInput, may_replace: Callable[[GrantState], None] | None + input: GrantsCreateInput, + may_replace: Callable[[GrantState], None] | None, + issuer: str | None = None, ) -> datetime: """`grants.create`'s write and what follows it; returns when it was granted.""" # A grant to a verified email is written under its account's login handle, so the @@ -217,7 +224,7 @@ async def _create_grant( from server.auth.aliases import canonical_subject subject = await canonical_subject(input.org, input.subject) - now = await _write_or_lower(input, subject, may_replace) + now = await _write_or_lower(input, subject, may_replace, issuer) if input.role == "admin": # Admin flows to the repository's other branches: from an operator entry to # all of them, from a page-added branch to standard page-added ones. @@ -228,21 +235,24 @@ async def _create_grant( async def _write_or_lower( - input: GrantsCreateInput, subject: str, may_replace: Callable[[GrantState], None] | None + input: GrantsCreateInput, + subject: str, + may_replace: Callable[[GrantState], None] | None, + issuer: str | None = None, ) -> datetime: """Write the grant under its own claim, unless it lowers an active admin: only `replace=true` lowers a grant (else 409), and that goes through `_taking_admin`.""" async def _write(_row: GrantState | None) -> datetime: - return await _write_grant(input, subject, may_replace) + return await _write_grant(input, subject, may_replace, issuer) async with grant_change(input.org, input.namespace, subject): row = None if input.replace and input.role != "admin": row = await grants_repo.find_any_grant(input.org, input.namespace, subject) if row is None or not _active_admin(row): - return await _write_grant(input, subject, may_replace) + return await _write_grant(input, subject, may_replace, issuer) return await _taking_admin(input, subject, _write, lowered_to=input.role) @@ -250,6 +260,7 @@ async def _write_grant( input: GrantsCreateInput, subject: str, may_replace: Callable[[GrantState], None] | None = None, + issuer: str | None = None, ) -> datetime: """`grants.create`'s read of the current grant and its write, under the grant's claim.""" @@ -267,7 +278,9 @@ async def _write_grant( from server.auth.context import current_auth auth = current_auth() - granted_by = auth.subject if auth is not None and auth.subject else input.granted_by or "admin" + granted_by = issuer or ( + auth.subject if auth is not None and auth.subject else input.granted_by or "admin" + ) await grants_repo.insert_row( { "org": input.org, @@ -600,7 +613,7 @@ async def _write_revoke( async def handle_grants_approve(input: GrantsApproveInput) -> GrantsApproveOutput: """Approve or reject a pending grant. No-op if it doesn't exist.""" - _enforce_principal_target(input.namespace, input.subject) + enforce_principal_target(input.namespace, input.subject) async with grant_change(input.org, input.namespace, input.subject): out = await _decide_request(input) if out.decision == "approve" and out.role == "admin": @@ -646,7 +659,7 @@ async def _decide_request(input: GrantsApproveInput) -> GrantsApproveOutput: target_role = input.role or pending_role or row.role if input.decision == "approve" and not no_base_access: _refuse_approval_below(row.role, str(target_role), input) - await _enforce_code_ceiling(input.org, input.namespace, str(target_role)) + await enforce_code_ceiling(input.org, input.namespace, str(target_role)) # granted_by on the new row is the approver, not the requester — the # audit trail and the "approved by …" notification need the right person. from server.auth.context import current_auth diff --git a/server/identity/app/invite_mail.py b/server/identity/app/invite_mail.py new file mode 100644 index 0000000000..d5443e9b99 --- /dev/null +++ b/server/identity/app/invite_mail.py @@ -0,0 +1,80 @@ +"""The invitation email, sent over SMTP when `smtp_url`, `mail_from` and +`public_base_url` are set. A failed send is logged and reported as not sent: the +invitation stands, and whoever made it copies the link instead.""" + +from __future__ import annotations + +import asyncio +import logging +import smtplib +import ssl +from datetime import UTC, datetime +from email.message import EmailMessage +from urllib.parse import unquote, urlsplit + +from server.settings import settings + +log = logging.getLogger(__name__) + + +def can_send() -> bool: + return bool(settings.smtp_url and settings.mail_from and settings.public_base_url) + + +def _message( + to: str, *, inviter: str, namespace: str, role: str, url: str, expires_at: int +) -> EmailMessage: + until = datetime.fromtimestamp(expires_at, UTC).strftime("%d %B %Y, %H:%M UTC") + msg = EmailMessage() + msg["From"] = settings.mail_from + msg["To"] = to + msg["Subject"] = f"{inviter} invited you to {namespace} on Loom" + msg.set_content( + f"{inviter} invited you to the Loom namespace {namespace}, with the role {role}.\n\n" + f"Open this link, sign in, and accept:\n{url}\n\n" + f"The link works once, until {until}. If you did not expect it, ignore this email.\n" + ) + return msg + + +def _send(msg: EmailMessage) -> None: + u = urlsplit(settings.smtp_url) + host = u.hostname or "" + tls = ssl.create_default_context() + client: smtplib.SMTP + if u.scheme == "smtps": + client = smtplib.SMTP_SSL( + host, u.port or 465, context=tls, timeout=settings.smtp_timeout_seconds + ) + else: # smtp://, the only other scheme the setting takes + client = smtplib.SMTP(host, u.port or 587, timeout=settings.smtp_timeout_seconds) + with client: + if u.scheme == "smtp": + client.ehlo() + # The link admits whoever reads it, and a login's password goes with it: neither + # is sent in the clear. + if not client.has_extn("starttls"): + raise smtplib.SMTPNotSupportedError("the server offers no STARTTLS") + client.starttls(context=tls) + client.ehlo() + if u.username: + client.login(unquote(u.username), unquote(u.password or "")) + client.send_message(msg) + + +async def send_invite( + to: str, *, inviter: str, namespace: str, role: str, url: str, expires_at: int +) -> bool: + """Email the link to `to`, which the caller has checked may be mailed; True when the + mail server took it.""" + try: + # Inside: the email library refuses a header with a line break in it. + msg = _message( + to, inviter=inviter, namespace=namespace, role=role, url=url, expires_at=expires_at + ) + await asyncio.to_thread(_send, msg) + except Exception as e: # noqa: BLE001 — a failed email leaves the link to copy + # Not the address: the audit row leaves it out, and no erasure reaches the log. + log.warning("invite mail: not sent: %s", type(e).__name__) + return False + return True diff --git a/server/identity/app/invites.py b/server/identity/app/invites.py new file mode 100644 index 0000000000..bc56d94b4a --- /dev/null +++ b/server/identity/app/invites.py @@ -0,0 +1,423 @@ +"""grants.{invite,list_invites,cancel_invite,accept_invite} handlers. + +`grants.invite` gives a person a role by what an admin knows of them. An account +that signs in under the handle or verified email is granted at once. An email no +account holds gets an invitation: a link whose secret only its hash is kept of, +emailed when the server has mail settings, which gives whoever opens it, once, the +role, under the account they sign in with. A password account's email is never +verified, so this is how a person is reached by email on a server without single +sign-on. Where sign-in is single sign-on only (`oauth_login_provider = "oidc"`), every +account's email is verified by the identity provider, so the email is granted as typed +and reaches that person at their first sign-in, with no link to pass on. A handle no +account holds is refused, so a typo is never kept as a grant for whoever signs up +under it later. + +An invitation stands on its maker's admin grant there (a delegated token's creator's), read +as the gate reads grants when the link is made and again when it is accepted: it never +outlasts that admin, and an admin only a token's claim makes cannot make one. +""" + +from __future__ import annotations + +import logging +import time +from datetime import UTC, datetime +from typing import Any + +from server.auth.attempts import Attempts +from server.auth.authz import subject_grant_role +from server.auth.delegation import creator_account_active +from server.auth.fail_closed import reset, unreadable +from server.auth.grant_claims import invite_change +from server.auth.revocation import is_revoked +from server.auth.self_signup import valid_signup_email +from server.core.errors import ( + BackendUnavailableError, + GrantWouldDowngradeError, + NotFoundError, + ValidationError, +) +from server.core.logging_config import log_value +from server.core.principals import ( + USER, + end_user_revocation_subject, + has_aliases, + is_reserved_subject, + principal_id, +) +from server.core.shielded import finish_cleanup +from server.identity.api.models_grants import ( + GrantsAcceptInviteInput, + GrantsAcceptInviteOutput, + GrantsCancelInviteInput, + GrantsCancelInviteOutput, + GrantsCreateInput, + GrantsInviteInput, + GrantsInviteOutput, + GrantsListInvitesInput, + GrantsListInvitesOutput, + _InviteEntry, +) +from server.identity.app import invite_mail +from server.identity.app.grants import ( + create_grant, + enforce_code_ceiling, + enforce_principal_target, +) +from server.identity.domain import invites as domain +from server.identity.store import grants as grants_repo +from server.identity.store import invites as invites_repo +from server.identity.store import namespaces as namespaces_repo +from server.operations.base import GRANT_ROLES, GrantRoleStr, Role, grant_rank +from server.settings import settings + +log = logging.getLogger(__name__) + +# The open invitations a namespace lists. +_LISTED = 200 +# Invitation emails, so that the server's mail is no relay for a namespace admin (whom any +# sign-up can make): per inviter, and per address invited. Past either the invitation is +# still made, and its link is the inviter's to pass on. +_mail_by_inviter = Attempts("invite.mail.inviter", 20, 3600) +_mail_by_address = Attempts("invite.mail.address", 3, 86400) +_GONE = ( + "this invitation link is used, cancelled or expired, or whoever made it no longer " + "administers the namespace: ask for a new one" +) + + +def _role(value: str) -> GrantRoleStr | None: + """A role read back from a row; None for one this build does not know.""" + return next((r for r in GRANT_ROLES if r == value), None) + + +def _maker() -> str: + """Whose admin an invitation stands on: a delegated token's creator, else the caller.""" + from server.auth.context import current_auth + + auth = current_auth() + return str(auth.creator or auth.subject) if auth is not None else "" + + +def _person(to: str) -> str: + """`to` as a person's spelling, or a refusal that names the op for the others.""" + person = to.strip() + if not has_aliases(person.lower()) or is_reserved_subject(person): + raise ValidationError( + "invite a person by login handle or email; grants.create grants a service account, " + "a group or everyone" + ) + return person + + +async def _held(org: str, person: str) -> str | None: + """The subject an account signs in as for `person`, as stored; None when there is + none. An email counts only through the handle it is verified for: a row's + `owner_email` and a grant's subject are whatever their writer typed. A handle counts + when an active row is owned under it or a live grant in the org is stored under it + (a person whose tokens Loom did not mint at sign-in has no account row): sign-up + refuses such a name (`self_signup._refuse_empowered`), so no later account takes + a grant meant for it.""" + from server.auth.aliases import canonical_subject + + subject = await canonical_subject(org, person) + if subject != person: + return subject + if "@" in person: + return None + handle = await namespaces_repo.account_handle(org, person) + return handle or await grants_repo.granted_spelling(org, person) + + +async def handle_grants_invite(input: GrantsInviteInput) -> GrantsInviteOutput: + person = _person(input.to) + enforce_principal_target(input.namespace, person) + subject = await _held(input.org, person) + if subject is not None: + return await _granted(input, subject) + maker = _maker() + if not maker: + # A request with no token, which only auth off serves: no one signs in to accept. + return await _granted(input, person) + if "@" not in person: + raise NotFoundError( + f"no account in {input.org} signs in as {person!r}: check the login handle, " + "or invite them by email" + ) + if not valid_signup_email(person.lower()): + # One plain address, so it names one recipient and keys its own mail limit. + raise ValidationError(f"{person!r} is not an email address") + if settings.oauth_login_provider == "oidc": + return await _granted(input, person) + await enforce_code_ceiling(input.org, input.namespace, input.role) + if not await namespaces_repo.is_active(input.org, input.namespace): + raise NotFoundError( + f"{input.org}/{input.namespace} is not an active namespace: register or restore it " + "before inviting anyone" + ) + return await _invite(input, person.lower(), maker) + + +async def _granted(input: GrantsInviteInput, subject: str) -> GrantsInviteOutput: + await create_grant( + GrantsCreateInput( + org=input.org, namespace=input.namespace, subject=subject, role=input.role + ) + ) + return GrantsInviteOutput(outcome="granted", role=input.role, subject=subject) + + +async def _maker_stands(org: str, namespace: str, maker: str, made_at: int) -> bool: + """Whether `maker` still stands behind a link made at `made_at` (Unix seconds), as a + delegated token's creator stands behind it: `_maker_admin`, and neither they nor + tokens of theirs that old are revoked.""" + return await _maker_admin(org, namespace, maker) and not _revoked(org, maker, made_at) + + +def _revoked(org: str, maker: str, made_at: int) -> bool: + """Whether `maker`'s tokens as old as `made_at` are revoked, under the subject the + token check reads: an end user's is `/user:`.""" + key = end_user_revocation_subject(org, maker) if principal_id(maker, USER) else maker + return is_revoked(key, issued_at=made_at) + + +async def _maker_admin(org: str, namespace: str, maker: str) -> bool: + """Whether `maker`'s grants make them admin there (`authz.subject_grant_role`) and + their account is active. A read that fails answers 503, so a link is not given up + for an outage.""" + reset() # this decision's own reads, not an earlier one's in the request + role = await subject_grant_role(org, namespace, maker) + active = await creator_account_active(org, maker) + if unreadable(): + raise BackendUnavailableError("the inviter's grants could not be read: try again") + return role is not None and role.value >= Role.ADMIN.value and active + + +async def _invite(input: GrantsInviteInput, email: str, maker: str) -> GrantsInviteOutput: + if not await _maker_stands(input.org, input.namespace, maker, int(time.time())): + raise ValidationError( + f"an invitation link stands on its maker's admin grant on {input.org}/" + f"{input.namespace}, and {maker!r} holds none there with an active account: an " + "admin there through a grant invites them" + ) + secret = domain.new_secret() + now = datetime.now(UTC) + invite = domain.Invite( + org=input.org, + namespace=input.namespace, + invite_id=domain.invite_id(secret), + email=email, + role=input.role, + created_by=maker, + created_at=now, + expires_at=int(now.timestamp()) + settings.invite_ttl_seconds, + ) + # Asked before the row: a limit that cannot be read fails the invitation, not a link + # left listed that nobody was given. + may_mail = await _may_mail(input.org, maker, email) + await invites_repo.put(invite) + path = domain.link_path(input.org, input.namespace, secret) + base = settings.public_base_url.strip().rstrip("/") + url = f"{base}{path}" if base else "" + emailed = may_mail and await invite_mail.send_invite( + email, + inviter=invite.created_by, + namespace=input.namespace, + role=input.role, + url=url, + expires_at=invite.expires_at, + ) + return GrantsInviteOutput( + outcome="invited", + role=input.role, + invite_id=invite.invite_id, + link_path=path, + url=url, + expires_at=datetime.fromtimestamp(invite.expires_at, UTC), + emailed=emailed, + ) + + +async def _may_mail(org: str, inviter: str, email: str) -> bool: + """Whether this invitation may be emailed: the server sends mail, and neither the + inviter nor the address is past its limit.""" + if not invite_mail.can_send(): + return False + return await _mail_by_inviter.allow(f"{org}/{inviter}") and await _mail_by_address.allow(email) + + +async def handle_grants_list_invites(input: GrantsListInvitesInput) -> GrantsListInvitesOutput: + rows = await invites_repo.open_on(input.org, input.namespace, int(time.time()), _LISTED) + # A link whose maker no longer stands admits nobody, so it is not listed as open. + admin = { + m: await _maker_admin(input.org, input.namespace, m) for m in {r.created_by for r in rows} + } + return GrantsListInvitesOutput( + rows=[ + _InviteEntry( + invite_id=r.invite_id, + email=r.email, + role=role, + created_by=r.created_by, + created_at=r.created_at, + expires_at=datetime.fromtimestamp(r.expires_at, UTC), + ) + for r in rows + if admin[r.created_by] + and not _revoked(input.org, r.created_by, int(r.created_at.timestamp())) + and (role := _role(r.role)) is not None + ] + ) + + +async def handle_grants_cancel_invite(input: GrantsCancelInviteInput) -> GrantsCancelInviteOutput: + async with invite_change(input.org, input.namespace, input.invite_id): + invite = await invites_repo.get(input.org, input.namespace, input.invite_id) + if invite is None: + return GrantsCancelInviteOutput(cancelled=False) + was_open = invite.is_open(int(time.time())) + # An accepted one is closed too, so an accept whose grant then fails leaves it + # closed rather than open again after the cancel. + if was_open or invite.state == "accepted": + await invites_repo.put(invite.cancelled(datetime.now(UTC))) + return GrantsCancelInviteOutput(cancelled=was_open) + + +def _accepter(org: str) -> str: + """The signed-in person accepting: a service account, a principal or a token of + another org is refused.""" + from server.auth.context import current_auth + + auth = current_auth() + if auth is None or not auth.subject: + raise ValidationError("sign in to accept an invitation") + subject = str(auth.subject) + if auth.is_service_account or not has_aliases(subject) or is_reserved_subject(subject): + raise ValidationError("an invitation is accepted by a person, signed in as themselves") + if auth.org != org: + raise ValidationError(f"this invitation is to {org}: sign in to {org} to accept it") + return subject + + +async def handle_grants_accept_invite(input: GrantsAcceptInviteInput) -> GrantsAcceptInviteOutput: + subject = _accepter(input.org) + invite_id = domain.invite_id(input.secret) + spent: domain.Invite | None = None + try: + async with invite_change(input.org, input.namespace, invite_id): + invite = await invites_repo.get(input.org, input.namespace, invite_id) + role = None if invite is None else _role(invite.role) + if invite is None or role is None or not invite.is_open(int(time.time())): + raise NotFoundError(_GONE) + if not await namespaces_repo.is_active(input.org, input.namespace): + raise NotFoundError(_GONE) + made_at = int(invite.created_at.timestamp()) + if not await _maker_stands(invite.org, invite.namespace, invite.created_by, made_at): + raise NotFoundError(_GONE) + # Spent under the claim, before the grant: a link never lets two people in. The + # grant takes its own claims after this one, as `grant_claims` orders them. + spent = invite + await invites_repo.put(invite.accepted(subject, datetime.now(UTC))) + held = await _grant(invite, role, subject) + except BaseException: + if spent is not None: + await _reopen_after_failure(spent, subject) + raise + return GrantsAcceptInviteOutput(namespace=input.namespace, role=held) + + +async def _reopen_after_failure(invite: domain.Invite, subject: str) -> None: + """`_reopen_unless_granted`, run to its end through a cancellation (anyio repeats one + at every await); a reopen that fails leaves the link used.""" + try: + await finish_cleanup(_reopen_unless_granted(invite, subject), name="invite.reopen") + except Exception as e: # noqa: BLE001 — the failure's error is the answer; link stays used + log.warning( + "invitation %s on %s/%s stays used after a failed accept: %s", + log_value(invite.invite_id[:12]), + log_value(invite.org), + log_value(invite.namespace), + type(e).__name__, + ) + + +async def _reopen_unless_granted(invite: domain.Invite, subject: str) -> None: + """Open the link again after a failed grant, unless the grant landed before the + failure (a lost reply, a step after the write): then it stays used. The grant is read + under the subject `create_grant` writes it under. A read that fails raises, and the + link stays used.""" + from server.auth.aliases import canonical_subject + + async with invite_change(invite.org, invite.namespace, invite.invite_id): + granted_to = await canonical_subject(invite.org, subject) + # Read with sequential consistency, as every read under the claim is: right after + # the grant's own write, another replica may not have it yet. + held = await grants_repo.find_active_grant(invite.org, invite.namespace, granted_to) + if held is not None and grant_rank(held.role) >= grant_rank(invite.role): + return + current = await invites_repo.get(invite.org, invite.namespace, invite.invite_id) + # Unchanged since the accept, but for it: an erasure that took the maker off + # meanwhile keeps it closed. + spent = ("accepted", subject, invite.created_by) + if ( + current is not None + and (current.state, current.accepted_by, current.created_by) == spent + ): + await invites_repo.put(invite) + + +def invite_audit_subject(input: GrantsInviteInput, response: dict[str, Any]) -> dict[str, Any]: + """What an invitation's audit row records: who got the role, or the invitation by the + hash it is stored under, never the address it was made for.""" + out = { + "org": input.org, + "namespace": input.namespace, + "role": response["role"], + "outcome": response["outcome"], + } + if response["outcome"] == "granted": + out["subject"] = response["subject"] + else: + out["invite_id"] = response["invite_id"] + return out + + +def accept_audit_subject( + input: GrantsAcceptInviteInput, response: dict[str, Any] +) -> dict[str, Any]: + """What an acceptance's audit row records, never the link's secret: the invitation + spent, by the hash it is stored under, and the role the caller holds now.""" + return { + "org": input.org, + "namespace": input.namespace, + "invite_id": domain.invite_id(input.secret), + "role": response["role"], + } + + +async def _grant(invite: domain.Invite, role: GrantRoleStr, subject: str) -> GrantRoleStr: + """The invitation's role for `subject`, stamped as granted by its maker; a higher + role they hold already stands.""" + try: + await create_grant( + GrantsCreateInput( + org=invite.org, namespace=invite.namespace, subject=subject, role=role + ), + issuer=invite.created_by, + ) + except GrantWouldDowngradeError as e: + return _role(e.extra["current_role"]) or role + return role + + +async def forget_maker(org: str, maker: str) -> int: + """`maker` taken off every invitation they made in `org`, and each open one closed, + for an erasure: no link stands on an erased admin. Returns the invitations changed.""" + changed = 0 + for found in await invites_repo.made_by(org, maker): + async with invite_change(org, found.namespace, found.invite_id): + invite = await invites_repo.get(org, found.namespace, found.invite_id) + if invite is not None and invite.created_by == maker: + await invites_repo.put(invite.forgotten(datetime.now(UTC))) + changed += 1 + return changed diff --git a/server/identity/domain/invites.py b/server/identity/domain/invites.py new file mode 100644 index 0000000000..3da5316cc0 --- /dev/null +++ b/server/identity/domain/invites.py @@ -0,0 +1,81 @@ +"""An invitation to a namespace: a link that gives whoever opens it, once, a role there. + +The link carries a random secret; Loom keeps only its SHA-256 (`invite_id`), so a row +read out of storage is not a working link. An invitation is open until it is +accepted, cancelled or `expires_at` passes; a state this build does not know is closed. +""" + +from __future__ import annotations + +import hashlib +import secrets +from dataclasses import asdict, dataclass, replace +from datetime import datetime +from typing import Any +from urllib.parse import urlencode + +from server.core.datetimes import as_aware_utc + + +def new_secret() -> str: + return secrets.token_urlsafe(32) + + +def invite_id(secret: str) -> str: + return hashlib.sha256(secret.encode()).hexdigest() + + +def link_path(org: str, namespace: str, secret: str) -> str: + """The dashboard page that accepts it, Namespaces in your org. All of it is the + fragment, which a browser never sends to a server or puts in a Referer.""" + return "/spaces#" + urlencode({"invite": secret, "org": org, "namespace": namespace}) + + +@dataclass(frozen=True) +class Invite: + org: str + namespace: str + invite_id: str + email: str + role: str + created_by: str + created_at: datetime + expires_at: int + state: str = "open" + accepted_by: str = "" + changed_at: datetime | None = None + + def is_open(self, now: int) -> bool: + return self.state == "open" and now < self.expires_at + + def accepted(self, by: str, at: datetime) -> Invite: + return replace(self, state="accepted", accepted_by=by, changed_at=at) + + def cancelled(self, at: datetime) -> Invite: + return replace(self, state="cancelled", changed_at=at) + + def forgotten(self, at: datetime) -> Invite: + """Its maker's name taken off, and closed if it was open.""" + state = "cancelled" if self.state == "open" else self.state + return replace(self, created_by="", state=state, changed_at=at) + + def row(self) -> dict[str, Any]: + out = asdict(self) + out["changed_at"] = self.changed_at or self.created_at + return out + + @classmethod + def from_row(cls, r: dict[str, Any]) -> Invite: + return cls( + org=str(r["org"]), + namespace=str(r["namespace"]), + invite_id=str(r["invite_id"]), + email=str(r["email"]), + role=str(r["role"]), + created_by=str(r["created_by"]), + created_at=as_aware_utc(r["created_at"]), + expires_at=int(r["expires_at"]), + state=str(r["state"]), + accepted_by=str(r["accepted_by"]), + changed_at=as_aware_utc(r["changed_at"]), + ) diff --git a/server/identity/store/grants.py b/server/identity/store/grants.py index 686d48a51c..0afa312517 100644 --- a/server/identity/store/grants.py +++ b/server/identity/store/grants.py @@ -329,6 +329,21 @@ async def find_active_grant( return None if row is None else GrantState.from_row(row) +async def granted_spelling(org: str, subject: str, *, ch: _CHClient | None = None) -> str | None: + """The subject, as stored, of a live grant in `org` that matches `subject` in any + case; None when there is none.""" + row = await (ch or _default_client()).query_one( + """ + SELECT subject FROM loom.namespace_grants FINAL + WHERE org = {org:String} AND lower(subject) = lower({sub:String}) AND {live} + ORDER BY subject + LIMIT 1 + """.replace("{live}", LIVE_GRANT), + params={"org": org, "sub": subject}, + ) + return None if row is None else str(row["subject"]) + + async def live_rows_of( org: str, subject: str, *, ch: _CHClient | None = None ) -> list[dict[str, Any]]: diff --git a/server/identity/store/invites.py b/server/identity/store/invites.py new file mode 100644 index 0000000000..f9a104e188 --- /dev/null +++ b/server/identity/store/invites.py @@ -0,0 +1,73 @@ +"""Repository for loom.namespace_invites. + +One row per invitation, keyed by (org, namespace, invite_id); `invite_id` is the +SHA-256 of the link's secret. ReplacingMergeTree(version) keeps the newest +state, so an acceptance or a cancellation is a new row with a version past the +last (`next_version`). The caller holds the invitation's claim +(`grant_claims.invite_change`) from its read to that write. +""" + +from __future__ import annotations + +from typing import Any + +from server.core.ch import own_write_reads +from server.core.repo_base import _CHClient, _default_client +from server.core.versions import next_version +from server.identity.domain.invites import Invite + +TABLE = "loom.namespace_invites" +_COLUMNS = ( + "org, namespace, invite_id, email, role, created_by, created_at, expires_at, state, " + "accepted_by, changed_at" +) + + +async def put(invite: Invite, *, ch: _CHClient | None = None) -> None: + client = ch or _default_client() + row = invite.row() + row["version"] = await next_version( + client, + TABLE, + {"org": invite.org, "namespace": invite.namespace, "invite_id": invite.invite_id}, + ) + await client.insert(TABLE, [row], settings={"async_insert": 0, "wait_for_async_insert": 1}) + + +async def get( + org: str, namespace: str, invite_id: str, *, ch: _CHClient | None = None +) -> Invite | None: + """The invitation's newest state, read past a write another replica just took.""" + with own_write_reads(): + row = await (ch or _default_client()).query_one( + f"SELECT {_COLUMNS} FROM {TABLE} FINAL WHERE org = {{org:String}} " + "AND namespace = {ns:String} AND invite_id = {id:String} LIMIT 1", + params={"org": org, "ns": namespace, "id": invite_id}, + ) + return Invite.from_row(dict(row)) if row else None + + +async def open_on( + org: str, namespace: str, now: int, limit: int, *, ch: _CHClient | None = None +) -> list[Invite]: + """The namespace's invitations still open at `now` (Unix seconds), newest first.""" + with own_write_reads(): + rows: list[dict[str, Any]] = await (ch or _default_client()).query_all( + f"SELECT {_COLUMNS} FROM {TABLE} FINAL WHERE org = {{org:String}} " + "AND namespace = {ns:String} AND state = 'open' AND expires_at > {now:UInt32} " + "ORDER BY created_at DESC LIMIT {limit:UInt32}", + params={"org": org, "ns": namespace, "now": now, "limit": limit}, + ) + return [Invite.from_row(dict(r)) for r in rows] + + +async def made_by(org: str, maker: str, *, ch: _CHClient | None = None) -> list[Invite]: + """Every invitation in `org` that `maker` made, read past a write another replica + just took.""" + with own_write_reads(): + rows: list[dict[str, Any]] = await (ch or _default_client()).query_all( + f"SELECT {_COLUMNS} FROM {TABLE} FINAL WHERE org = {{org:String}} " + "AND created_by = {maker:String}", + params={"org": org, "maker": maker}, + ) + return [Invite.from_row(dict(r)) for r in rows] diff --git a/server/identity/store/namespace_census.py b/server/identity/store/namespace_census.py index bdf5e7bf4b..f759257f50 100644 --- a/server/identity/store/namespace_census.py +++ b/server/identity/store/namespace_census.py @@ -74,12 +74,15 @@ async def unregistered_live( _AT = "org = {org:String} AND namespace = {ns:String}" # Tables outside the erasure census whose live rows a later owner of the name would -# inherit (a grant, an outside target, a source, a mirror, a tree node, an identity -# link, an open erasure), each with the condition that makes its row live. Every other -# table keyed by namespace is counted by the census or exempt with a reason -# (tests/unit/test_in_use_coverage.py). +# inherit (a grant, an open invitation, an outside target, a source, a mirror, a tree +# node, an identity link, an open erasure), each with the condition that makes its row +# live. Every other table keyed by namespace is counted by the census or exempt with a +# reason (tests/unit/test_in_use_coverage.py). STATE_TABLES: dict[str, str] = { "loom.namespace_grants": f"FINAL WHERE {_AT} AND {LIVE_GRANT}", + # Accepting one grants its role on whatever the name then holds. + "loom.namespace_invites": f"FINAL WHERE {_AT} AND state = 'open'" + " AND expires_at > toUInt32(now())", "loom.memory_webhooks": f"FINAL WHERE {_AT} AND is_deleted = 0", "loom.task_inboxes": "FINAL WHERE org = {org:String} AND owner_namespace = {ns:String}" " AND is_deleted = 0", diff --git a/server/identity/store/namespaces.py b/server/identity/store/namespaces.py index aae3c35355..6a05a1d552 100644 --- a/server/identity/store/namespaces.py +++ b/server/identity/store/namespaces.py @@ -9,6 +9,7 @@ from datetime import datetime from typing import Any +from server.core.ch import own_write_reads from server.core.repo_base import _CHClient, _default_client @@ -92,6 +93,24 @@ async def is_active(org: str, namespace: str, *, ch: _CHClient | None = None) -> return row is not None +async def account_handle(org: str, subject: str, *, ch: _CHClient | None = None) -> str | None: + """The owner, as stored, of an active row of `org` owned under `subject` in any case + (an account's own row, or a namespace registered for that owner); None when none is. + Read past a row another replica just made.""" + with own_write_reads(): + row = await (ch or _default_client()).query_one( + """ + SELECT owner_email FROM loom.namespaces FINAL + WHERE org = {org:String} AND ifNull(active, true) = true + AND owner_email != '' AND lower(owner_email) = lower({sub:String}) + ORDER BY owner_email + LIMIT 1 + """, + params={"org": org, "sub": subject}, + ) + return None if row is None else str(row["owner_email"]) + + async def labels( org: str, namespaces: list[str], *, ch: _CHClient | None = None ) -> dict[str, dict[str, str]]: diff --git a/server/operations/reach_manifest.py b/server/operations/reach_manifest.py index 226e04eed7..edcf3e81d1 100644 --- a/server/operations/reach_manifest.py +++ b/server/operations/reach_manifest.py @@ -363,18 +363,34 @@ "sdk_method", "dashboard", ), + "grants.accept_invite": ( + "sdk_method", + "dashboard", + ), "grants.approve": ( "sdk_method", "dashboard", ), + "grants.cancel_invite": ( + "sdk_method", + "dashboard", + ), "grants.create": ( "sdk_method", "dashboard", ), + "grants.invite": ( + "sdk_method", + "dashboard", + ), "grants.list": ( "sdk_method", "dashboard", ), + "grants.list_invites": ( + "sdk_method", + "dashboard", + ), "grants.pending_for_me": ( "sdk_method", "dashboard", diff --git a/server/settings/_env.py b/server/settings/_env.py index c68d526cde..a56237d0cb 100644 --- a/server/settings/_env.py +++ b/server/settings/_env.py @@ -149,6 +149,8 @@ def unknown_env_keys(fields: Iterable[str], env_file: str | None) -> list[str]: r"(?:^|_)otlp_headers$", # A Postgres DSN carries the password: the memory authority's and the router's. r"(?:^|_)pg_dsn$", + # Its userinfo is the mail server's login. + r"^smtp_url$", ) ) ) diff --git a/server/settings/catalog.py b/server/settings/catalog.py index 9340602a79..87bdb9d643 100644 --- a/server/settings/catalog.py +++ b/server/settings/catalog.py @@ -464,6 +464,18 @@ def trusted_issuers(self) -> set[str]: # Default org for self-signed tokens. self_signup_org: str = "dev" + # The mail server invitations go through: `smtps://user:password@host:465`, or `smtp://` + # on 587, which must offer STARTTLS. Empty: no email, and the inviter passes the link on. + smtp_url: Annotated[str, Field(pattern=r"^(?:smtps?://.+)?$")] = "" + # The From address of an invitation email, e.g. `Loom `. Empty + # sends none, as does an empty smtp_url or public_base_url (the link needs it). + mail_from: str = "" + # Seconds each step of an invitation email may wait on the mail server; past it the + # email is reported not sent and the link is shown to pass on. + smtp_timeout_seconds: float = Field(default=10.0, gt=0, le=60) + # Seconds an invitation link stays valid, at most 30 days: it admits whoever opens it. + invite_ttl_seconds: int = Field(default=7 * 86400, ge=3600, le=30 * 86400) + # How callers authenticate: "single-user" (no auth, one anonymous identity), # "trust-network" (self-signup, first claim wins) or "gateway" (an upstream proxy # mints short-lived Loom JWTs with the shared HS256 secret; Loom only validates). @@ -6580,9 +6592,14 @@ class TrackerSettings(BaseModel): "facts.related": 60, # One frontier query per hop, up to max_hops. "facts.traverse": 200, + "grants.accept_invite": 150, "grants.approve": 80, + "grants.cancel_invite": 80, "grants.create": 50, + # A mail server's round trip when the invitation is emailed. + "grants.invite": 3000, "grants.list": 80, + "grants.list_invites": 80, "grants.pending_for_me": 150, "grants.revoke": 80, "grants.share_agent": 80, diff --git a/server/transport/mcp_descriptions.py b/server/transport/mcp_descriptions.py index 992cd0f326..64fe16cbc5 100644 --- a/server/transport/mcp_descriptions.py +++ b/server/transport/mcp_descriptions.py @@ -403,10 +403,10 @@ def revision_policy(update: str) -> str: "default answer to 'what are my workspaces' / 'where can I save " "this'. Each row has an `is_new` flag — true when someone " "granted access and the caller hasn't visited yet; surface " - "those as fresh invitations." + "those as newly shared." ), "namespace.mark_seen": ( - "Acknowledge a new-invitation indicator on a namespace. Call " + "Record a visit to a namespace, clearing its new mark. Call " "after surfacing rows from namespace.list_mine that had " "is_new=true, so the badge clears on the next list." ), @@ -463,11 +463,32 @@ def revision_policy(update: str) -> str: # ---- Grants (per-namespace access control) ---- "grants.create": ( "Grant another subject (user or service-account) viewer / writer " - "/ admin role on a namespace. Call when an admin wants to invite " - 'someone or change their role — "add Bob as writer on X", ' - '"give Carol admin on Y". The caller must already be admin on ' - "the target namespace. Lowering someone's current role is refused " - "(409 GRANT_WOULD_DOWNGRADE) unless replace=true is passed." + "/ admin role on a namespace. Call to grant a service account, a group " + 'or everyone, or to change the role of a member — "make Carol an admin of Y"; to add a ' + "person by login handle or email, call grants.invite. The caller must " + "already be admin on the target namespace. Lowering someone's current " + "role is refused (409 GRANT_WOULD_DOWNGRADE) unless replace=true is passed." + ), + "grants.invite": ( + "Give a person a role on a namespace by login handle or email. Call when " + 'an admin wants to add someone — "add bob@example.com as writer on X". ' + "A handle an account or a live grant holds, or an email verified for an " + "account, is granted at once; any other email gets " + "a single-use invitation link (emailed when the server sends mail) to pass " + "on, or, where sign-in is single sign-on only, a grant as typed; any other " + "handle is refused." + ), + "grants.list_invites": ( + "List a namespace's open invitations: the address, role, maker and expiry " + "of each link that still admits someone. Caller must be admin." + ), + "grants.cancel_invite": ( + "Cancel an open invitation by its invite_id, so its link admits nobody. " + "Caller must be admin on the namespace." + ), + "grants.accept_invite": ( + "Accept an invitation link as the signed-in person: it grants its role on " + "the namespace it names. Call with the secret from the link's fragment." ), "grants.list": ( "List active grants on a namespace — who has access, at which " diff --git a/tests/analyzer/cases/planes.py b/tests/analyzer/cases/planes.py index 0d031caf32..28aba77332 100644 --- a/tests/analyzer/cases/planes.py +++ b/tests/analyzer/cases/planes.py @@ -178,6 +178,7 @@ { "namespace_validate", "grants", + "_grants_invites", "context_offload", "knowledge", "_memory_consolidate", @@ -240,6 +241,7 @@ ("_knowledge_reads", "server.knowledge.app.document_reads"), ("_knowledge_dedup", "server.knowledge.app.dedup"), ("grants", "server.identity.app.grants"), + ("_grants_invites", "server.identity.app.invites"), ("policy", "server.identity.app.history_policy_ops"), ("learnings", "server.memory.app.learnings"), ("blacklist", "server.memory.app.blacklist"), diff --git a/tests/analyzer/shapes.txt b/tests/analyzer/shapes.txt index 9c7293ed4b..eb86cafaee 100644 --- a/tests/analyzer/shapes.txt +++ b/tests/analyzer/shapes.txt @@ -122,7 +122,6 @@ 0c999f060efc SELECT proposal_policy FROM loom.namespaces FINAL WHERE org = {org:String} AND namespace = {ns:String} LIMIT ? 0cfc88297bf0 SELECT count() AS n FROM loom.knowledge_ingestions WHERE org = {org:String} AND namespace = {ns:String} 0d0074d068cf SELECT queue_id, agent, user_id, session_id, status, attempts, message_count, content_chars, written, last_error, enqueued_at, updated_at FROM loom.memory_extraction_queue FINAL PREWHERE org = {org:St -0d61f55e9bf0 -- schemas/schema.sql -- -- Reference dump of `loom.*` and `loom_telemetry.*`: what replaying schemas/migrations/*.sql -- produces, auto-generated by scripts/ops/dump_schema.py from a live -- ClickHou 0db9931937d8 SELECT count() AS n FROM loom.memory WHERE org = {org:String} AND has(tags, ?) AND hasAny(tags, {src:Array(String)}) AND hasAny(arrayMap(t -> (namespace, t), tags), {pairs:Array(Tuple(String, String)) 0df388be7e18 SELECT count() AS n FROM loom.memory_projection_failures WHERE org = {org:String} AND (JSONExtractString(payload, ?) = {uid:String} OR arrayExists(e -> JSONExtractString(e, ?) = {uid:String}, JSONExtr 0df8d59119a4 SELECT org, namespace, policy_id, effect, description, actions, condition, enabled, mode, created_by, created_at, updated_at, tombstoned_at FROM loom.namespace_policies FINAL WHERE org = {org:String} @@ -412,6 +411,7 @@ 2f87519d6c67 SELECT count() AS n FROM loom.memory_records FINAL WHERE org = {org:String} AND namespace IN {ns:Array(String)} AND tombstoned_at IS NULL 2fa5c1f4e23c SELECT e.memory_key AS memory_key, e.memory_type AS memory_type, e.content_excerpt AS content_excerpt, e.status AS status, e.version AS version, -- The content hash, for the read receipt of a hit this 2fab97e447f4 SELECT count() AS n FROM loom.entity_vectors FINAL WHERE org = {org:String} AND namespace IN {ns:Array(String)} AND tombstoned_at IS NULL +2fb19a9fc0de -- schemas/schema.sql -- -- Reference dump of `loom.*` and `loom_telemetry.*`: what replaying schemas/migrations/*.sql -- produces, auto-generated by scripts/ops/dump_schema.py from a live -- ClickHou 2fc0cc735773 SELECT toString(evidence_id) AS eid, session_id, role, actor, toString(observed_at) AS observed, content, matched FROM ( SELECT evidence_id, session_id, role, actor, observed_at, content, tombstoned_a 2fd8ca033214 DELETE FROM loom.memory_chunks WHERE org = {org:String} AND namespace = {ns:String} AND agent = {a:String} AND user_id = {u:String} AND parent_memory_key = {k:String} AND if(session_id = {ss:String}, 303a1827c22d SELECT DISTINCT msg_id FROM loom.conversations WHERE org = {org:String} AND namespace = {ns:String} AND thread_id = {tid:String} AND msg_id IN {mids:Array(String)} AND is_saved AND tombstoned_at IS NU @@ -509,6 +509,7 @@ 39db945a8f03 ALTER TABLE loom.conversation_embeddings UPDATE tombstoned_at = {now:DateTime} WHERE (org = {org:String} AND tombstoned_at IS NULL AND user_id = {uid:String}) AND ({erasure_mutation_tag:String} = {era 39f9fbc2c519 SELECT count() AS n FROM loom.session_brief_revisions WHERE org = {org:String} AND user_id = {uid:String} 3a315e2ef1be ALTER TABLE loom.entity_canonical_map UPDATE tombstoned_at = {now:DateTime} WHERE (org = {org:String} AND tombstoned_at IS NULL AND namespace IN {ns:Array(String)}) AND ({erasure_mutation_tag:String} +3a57d058ba83 SELECT org, namespace, invite_id, email, role, created_by, created_at, expires_at, state, accepted_by, changed_at FROM loom.namespace_invites FINAL WHERE org = {org:String} AND namespace = {ns:String} 3a6169b72b54 SELECT count() AS n FROM loom.derived_facts WHERE org = {org:String} AND user_id = {uid:String} 3a8471ec9ffe SELECT pr_number, any(title) AS title, any(author) AS author, min(merged_at) AS merged_at, max(opened_at) AS opened_at, any(files) AS files, any(linked_issues) AS linked_issues FROM loom.code_pr_histo 3a88608e1703 SELECT count() AS n FROM loom.entity_triples WHERE org = {org:String} AND namespace IN {ns:Array(String)} AND ? @@ -547,7 +548,6 @@ 3e00482285b2 SELECT count() AS n FROM loom.entity_vectors WHERE org = {org:String} AND namespace = {ns:String} 3e18758b5b32 ALTER TABLE loom.session_outcomes_by_user DELETE WHERE (org = {org:String} AND namespace IN {ns:Array(String)}) AND ({erasure_mutation_tag:String} = {erasure_mutation_tag:String}) SETTINGS mutations_s 3e2075d7a93f SELECT count() AS n FROM loom.memory_record_fields FINAL WHERE org = {org:String} AND namespace = {ns:String} AND tombstoned_at IS NULL -3e2b5291eea1 SELECT ? AS in_use FROM ((SELECT ? FROM loom.namespace_grants FINAL WHERE org = {org:String} AND namespace = {ns:String} AND revoked_at IS NULL AND status = ? LIMIT ?) UNION ALL (SELECT ? FROM loom.me 3e750c517754 SELECT count() AS n FROM loom.memory_chunk_sources FINAL WHERE org = {org:String} AND namespace = {ns:String} AND tombstoned_at IS NULL 3ea44fb37980 ALTER TABLE loom.session_briefs DELETE WHERE (org = {org:String} AND namespace IN {ns:Array(String)}) AND ({erasure_mutation_tag:String} = {erasure_mutation_tag:String}) SETTINGS mutations_sync = ? 3eb6ce41ac13 SELECT agent, user_id, session_id, memory_key, memory_type, content_excerpt, toString(created_at) AS created_at, toString(valid_at) AS valid_at, version FROM loom.memory_embeddings FINAL WHERE org = { @@ -1349,6 +1349,7 @@ 93b6309f14f7 SELECT agent, count() AS rows, count() OVER () AS total, sum(count()) OVER () AS total_rows FROM loom.memory FINAL WHERE org = {org:String} AND namespace = {ns:String} AND tombstoned_at IS NULL AND st 93ec8d6c0770 SELECT run_id, toString(memory_id) AS mid, event_type, credited_at, actor, agent, consumer, sum(event_count) AS net, count() AS n FROM loom.memory_usage_events WHERE org = {org:String} AND namespace = 93fb8239f3f5 SELECT count() AS n FROM loom.memory_record_fields FINAL WHERE org = {org:String} AND tombstoned_at IS NULL AND namespace IN {ns:Array(String)} +9454d42e8f4e SELECT ? AS in_use FROM ((SELECT ? FROM loom.namespace_grants FINAL WHERE org = {org:String} AND namespace = {ns:String} AND revoked_at IS NULL AND status = ? LIMIT ?) UNION ALL (SELECT ? FROM loom.na 945db02b838d SELECT count() AS n FROM loom.session_brief_revisions WHERE org = {org:String} AND namespace IN {ns:Array(String)} AND ? 946786a56b8c SELECT agent, user_id, session_id, memory_key FROM loom.memory FINAL WHERE org = {org:String} AND namespace = {ns:String} AND tombstoned_at IS NULL AND startsWith(source_trace, {trace:String}) AND (ag 9476186d6a8c SELECT c.category_id AS category_id, count() AS rows FROM (SELECT memory_key, category_id FROM loom.memory_categories FINAL WHERE org = {org:String} AND namespace = {ns:String} AND tombstoned_at IS NU @@ -1824,6 +1825,7 @@ c4fb2b7ac3e8 ALTER TABLE loom.tasks DELETE WHERE (org = {org:String} AND namespa c529ba815261 SELECT e.memory_key AS memory_key, e.memory_type AS memory_type, e.content_excerpt AS content_excerpt, e.status AS status, e.version AS version, -- The content hash, for the read receipt of a hit this c53355b3cf3a SELECT c.session_id AS session_id, c.chunk_index AS chunk_index, c.parent_memory_key AS parent_memory_key, cosineDistance(c.embedding, {q:Array(Float32)}) AS distance FROM loom.memory_chunks AS c WHER c562da6b7b7f SELECT count() AS n FROM loom.entity_communities WHERE org = {org:String} AND namespace IN {ns:Array(String)} +c5e951112035 SELECT org, namespace, invite_id, email, role, created_by, created_at, expires_at, state, accepted_by, changed_at FROM loom.namespace_invites FINAL WHERE org = {org:String} AND namespace = {ns:String} c5f2a81cdd02 SELECT count() AS n FROM loom.consolidation_runs WHERE org = {org:String} AND user_id = {uid:String} c6056fca9bec ALTER TABLE loom.conflict_allowlist UPDATE tombstoned_at = {now:DateTime} WHERE (org = {org:String} AND tombstoned_at IS NULL AND namespace = {ns:String}) AND ({erasure_mutation_tag:String} = {erasure c6278079e133 SELECT namespace, agent, user_id, session_id, memory_key, toString(memory_id) AS mid, value, tags, files, toString(content_sha256) AS sha, version FROM loom.memory FINAL WHERE org = {org:String} AND n @@ -2106,6 +2108,7 @@ df5c577c685a SELECT sid, argMin(content_hash, start_line) AS h FROM ( SELECT arr df62986ef9b7 SELECT concat(?, toString(c.session_id), ?, toString(c.chunk_index)) AS memory_key, ? AS memory_type, substring(c.content, ?, ?) AS content_excerpt, c.content AS content_full, c.agent AS agent, c.user df875c426404 SELECT count() AS n FROM loom.memory_ask_precedents WHERE org = {org:String} AND namespace IN {ns:Array(String)} df886269fbb5 SELECT org, namespace FROM loom.namespace_grants FINAL WHERE role = ? AND revoked_at IS NULL AND status = ? AND (org, namespace) IN {keys:Array(Tuple(String, String))} GROUP BY org, namespace +df95e8727da8 SELECT subject FROM loom.namespace_grants FINAL WHERE org = {org:String} AND lower(subject) = lower({sub:String}) AND revoked_at IS NULL AND status = ? ORDER BY subject LIMIT ? df9a592b3176 SELECT min(version) AS v FROM loom.memory_versions WHERE org = {org:String} AND namespace = {ns:String} dfab46389b75 SELECT count() AS n FROM loom.memory_record_versions WHERE org = {org:String} AND namespace = {ns:String} AND ? dfb389c3eaaa SELECT count() AS n FROM loom.memory_records FINAL WHERE org = {org:String} AND namespace = {ns:String} AND tombstoned_at IS NULL @@ -2189,6 +2192,7 @@ e77b590b9f54 SELECT org, namespace, name, source_id, provider, generation, finge e77c1e05f3c4 SELECT count() AS n FROM loom.blob_uploads WHERE org = {org:String} AND namespace IN {ns:Array(String)} AND ? e7b42de1321e SELECT e.memory_key AS memory_key, e.memory_type AS memory_type, e.content_excerpt AS content_excerpt, e.status AS status, e.version AS version, -- The content hash, for the read receipt of a hit this e7d4c583cc0e ALTER TABLE loom.procedure_runs DELETE WHERE (org = {org:String} AND namespace = {ns:String}) AND ({erasure_mutation_tag:String} = {erasure_mutation_tag:String}) SETTINGS mutations_sync = ? +e7eec9ffed80 SELECT owner_email FROM loom.namespaces FINAL WHERE org = {org:String} AND ifNull(active, true) = true AND owner_email != ? AND lower(owner_email) = lower({sub:String}) ORDER BY owner_email LIMIT ? e7ef19d41a90 SELECT agent, user_id, session_id, embedding_model, summary_text, key_facts, derived_from, valid_at, created_at, version, length(key_facts) AS kf, length(derived_from) AS df, coalesce(valid_at, create e7f1d693d5b1 SELECT count() AS n FROM loom.entity_vectors WHERE org = {org:String} AND (user_id = {uid:String} OR (namespace, memory_key) IN {keys:Array(Tuple(String, String))}) e8009bd53bc4 SELECT number, head_sha FROM loom.code_gh_items FINAL WHERE org = {org:String} AND namespace = {ns:String} AND tombstoned_at IS NULL AND is_pr AND state = ? AND head_sha != ? ORDER BY updated_at DESC, diff --git a/tests/conftest.py b/tests/conftest.py index c74aba61ab..e21099f07b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -225,8 +225,9 @@ def pytest_sessionstart(session: pytest.Session) -> None: @pytest.fixture def mint_test_token(): - """A callable minting a service-account JWT for the test's own org, for - tests that construct `Agent(...)` with their own identity: + """A callable minting a JWT for the test's own org (a service account's unless + `is_service_account=False`, a person's), for tests that construct `Agent(...)` + with their own identity: tok = mint_test_token(org="my-test-org", namespaces=["*"]) async with Agent(org="my-test-org", ..., api_key=tok) as a: ... @@ -242,6 +243,7 @@ def _mint( subject: str = "test-suite", read_user_id: str | None = None, read_scope: str | None = None, + is_service_account: bool = True, ) -> str: return mint_token( subject=subject, @@ -249,7 +251,7 @@ def _mint( namespaces=namespaces or ["*"], roles=roles or ["writer"], ttl_seconds=ttl_seconds, - is_service_account=True, + is_service_account=is_service_account, read_user_id=read_user_id, read_scope=read_scope, ) diff --git a/tests/integration/test_grants_invite.py b/tests/integration/test_grants_invite.py new file mode 100644 index 0000000000..d7e2099fab --- /dev/null +++ b/tests/integration/test_grants_invite.py @@ -0,0 +1,225 @@ +"""An admin invites a person by an email no account holds; the person, signed in under +another login handle, accepts the link once and holds the role under that handle, +granted by the admin. Runs against a real Control Plane + ClickHouse (LOOM_BASE_URL, +LOOM_CH_*).""" + +from __future__ import annotations + +import uuid +from typing import Any +from urllib.parse import parse_qs, urlsplit + +import httpx + +from tests.integration._resources import unique_org + + +def _post(base: str, token: str, op: str, payload: dict) -> httpx.Response: + with httpx.Client(base_url=base, timeout=30.0) as c: + return c.post(f"/v1/{op}", json=payload, headers={"Authorization": f"Bearer {token}"}) + + +def _register(base: str, token: str, org: str, namespace: str, owner: str) -> None: + body = {"org": org, "namespace": namespace, "owner_email": owner} + r = _post(base, token, "namespace.register", body) + assert r.status_code == 200, r.text + + +def test_an_invited_email_is_accepted_once_under_the_accepters_handle( + control_plane_url: str, mint_test_token: Any +) -> None: + org = unique_org("invite") + ns = f"ns-{uuid.uuid4().hex[:8]}" + admin = mint_test_token( + is_service_account=False, org=org, subject="ann-admin", namespaces=[ns], roles=["admin"] + ) + _register(control_plane_url, admin, org, ns, "ann-admin") + + r = _post( + control_plane_url, + admin, + "grants.invite", + {"org": org, "namespace": ns, "to": "robin@example.com", "role": "writer"}, + ) + assert r.status_code == 200, r.text + made = r.json() + assert made["outcome"] == "invited" + secret = parse_qs(urlsplit(made["link_path"]).fragment)["invite"][0] + listed = _post(control_plane_url, admin, "grants.list_invites", {"org": org, "namespace": ns}) + assert [row["email"] for row in listed.json()["rows"]] == ["robin@example.com"] + + # The person signs in under a handle that is not the email. + person = mint_test_token( + is_service_account=False, + org=org, + subject="robin", + namespaces=[f"home-{ns}"], + roles=["viewer"], + ) + body = {"org": org, "namespace": ns, "secret": secret} + r = _post(control_plane_url, person, "grants.accept_invite", body) + assert r.status_code == 200, r.text + assert r.json() == {"namespace": ns, "role": "writer"} + + grants = _post(control_plane_url, admin, "grants.list", {"org": org, "namespace": ns}) + mine = [g for g in grants.json()["rows"] if g["subject"] == "robin"] + assert [(g["role"], g["granted_by"]) for g in mine] == [("writer", "ann-admin")] + + # Spent: a second open of the link admits nobody, and it is no longer listed. + other = mint_test_token( + is_service_account=False, + org=org, + subject="someone", + namespaces=[f"x-{ns}"], + roles=["viewer"], + ) + again = _post(control_plane_url, other, "grants.accept_invite", body) + assert again.status_code == 404, again.text + listed = _post(control_plane_url, admin, "grants.list_invites", {"org": org, "namespace": ns}) + assert listed.json()["rows"] == [] + + +def test_a_handle_no_account_holds_is_refused(control_plane_url: str, mint_test_token: Any) -> None: + org = unique_org("invite") + ns = f"ns-{uuid.uuid4().hex[:8]}" + admin = mint_test_token( + is_service_account=False, org=org, subject="ann-admin", namespaces=[ns], roles=["admin"] + ) + _register(control_plane_url, admin, org, ns, "ann-admin") + r = _post( + control_plane_url, + admin, + "grants.invite", + {"org": org, "namespace": ns, "to": "no-such-handle", "role": "viewer"}, + ) + assert r.status_code == 404, r.text + grants = _post(control_plane_url, admin, "grants.list", {"org": org, "namespace": ns}) + assert all(g["subject"] != "no-such-handle" for g in grants.json()["rows"]) + + +def test_a_handle_an_account_signs_in_as_is_granted_at_once( + control_plane_url: str, mint_test_token: Any +) -> None: + org = unique_org("invite") + ns = f"ns-{uuid.uuid4().hex[:8]}" + home = f"home-{ns}" + person = mint_test_token( + is_service_account=False, org=org, subject="robin", namespaces=[home], roles=["admin"] + ) + _register(control_plane_url, person, org, home, "robin") + admin = mint_test_token( + is_service_account=False, org=org, subject="ann-admin", namespaces=[ns], roles=["admin"] + ) + _register(control_plane_url, admin, org, ns, "ann-admin") + r = _post( + control_plane_url, + admin, + "grants.invite", + {"org": org, "namespace": ns, "to": "Robin", "role": "viewer"}, + ) + assert r.status_code == 200, r.text + assert (r.json()["outcome"], r.json()["subject"], r.json()["link_path"]) == ( + "granted", + "robin", + "", + ) + + +def test_a_handle_a_grant_names_is_held_and_an_email_a_row_names_is_not( + control_plane_url: str, mint_test_token: Any +) -> None: + """A grant under a handle is a person the org knows; an email a row's owner or a + grant names is whatever its writer typed, so it still gets a link.""" + org = unique_org("invite") + ns, other = f"ns-{uuid.uuid4().hex[:8]}", f"ops-{uuid.uuid4().hex[:8]}" + admin = mint_test_token( + is_service_account=False, + org=org, + subject="ann-admin", + namespaces=[ns, other], + roles=["admin"], + ) + _register(control_plane_url, admin, org, ns, "ann-admin") + _register(control_plane_url, admin, org, other, "platform@acme.example") + body = {"org": org, "namespace": other, "subject": "Dana-Ext", "role": "viewer"} + assert _post(control_plane_url, admin, "grants.create", body).status_code == 200 + + def _to(to: str) -> dict: + body = {"org": org, "namespace": ns, "to": to, "role": "viewer"} + r = _post(control_plane_url, admin, "grants.invite", body) + assert r.status_code == 200, r.text + return r.json() + + held = _to("dana-ext") + assert (held["outcome"], held["subject"]) == ("granted", "Dana-Ext") + assert _to("platform@acme.example")["outcome"] == "invited" + + +def _invite(base: str, token: str, org: str, ns: str, to: str) -> tuple[str, str]: + r = _post( + base, token, "grants.invite", {"org": org, "namespace": ns, "to": to, "role": "writer"} + ) + assert r.status_code == 200, r.text + made = r.json() + return made["invite_id"], parse_qs(urlsplit(made["link_path"]).fragment)["invite"][0] + + +def test_a_cancelled_link_is_unlisted_and_admits_nobody( + control_plane_url: str, mint_test_token: Any +) -> None: + org = unique_org("invite") + ns = f"ns-{uuid.uuid4().hex[:8]}" + admin = mint_test_token( + is_service_account=False, org=org, subject="ann-admin", namespaces=[ns], roles=["admin"] + ) + _register(control_plane_url, admin, org, ns, "ann-admin") + invite_id, secret = _invite(control_plane_url, admin, org, ns, "robin@example.com") + + body = {"org": org, "namespace": ns, "invite_id": invite_id} + r = _post(control_plane_url, admin, "grants.cancel_invite", body) + assert (r.status_code, r.json()) == (200, {"cancelled": True}), r.text + listed = _post(control_plane_url, admin, "grants.list_invites", {"org": org, "namespace": ns}) + assert listed.json()["rows"] == [] + person = mint_test_token( + is_service_account=False, + org=org, + subject="robin", + namespaces=[f"home-{ns}"], + roles=["viewer"], + ) + accept = {"org": org, "namespace": ns, "secret": secret} + assert _post(control_plane_url, person, "grants.accept_invite", accept).status_code == 404 + + +def test_a_link_stops_when_its_maker_loses_admin( + control_plane_url: str, mint_test_token: Any +) -> None: + org = unique_org("invite") + ns = f"ns-{uuid.uuid4().hex[:8]}" + ann = mint_test_token( + is_service_account=False, org=org, subject="ann-admin", namespaces=[ns], roles=["admin"] + ) + _register(control_plane_url, ann, org, ns, "ann-admin") # ann's admin is her own grant + _, secret = _invite(control_plane_url, ann, org, ns, "robin@example.com") + + # Another admin stays, so ann's grant can go. + grant = {"org": org, "namespace": ns, "subject": "bea-admin", "role": "admin"} + assert _post(control_plane_url, ann, "grants.create", grant).status_code == 200 + bea = mint_test_token( + is_service_account=False, org=org, subject="bea-admin", namespaces=[ns], roles=["admin"] + ) + revoke = {"org": org, "namespace": ns, "subject": "ann-admin"} + r = _post(control_plane_url, bea, "grants.revoke", revoke) + assert r.status_code == 200 and r.json()["revoked"] is True, r.text + + person = mint_test_token( + is_service_account=False, + org=org, + subject="robin", + namespaces=[f"home-{ns}"], + roles=["viewer"], + ) + accept = {"org": org, "namespace": ns, "secret": secret} + r = _post(control_plane_url, person, "grants.accept_invite", accept) + assert r.status_code == 404, r.text + assert "no longer administers" in r.text diff --git a/tests/unit/snapshots/sdk_public_api.json b/tests/unit/snapshots/sdk_public_api.json index f47833b2c0..e891e31807 100644 --- a/tests/unit/snapshots/sdk_public_api.json +++ b/tests/unit/snapshots/sdk_public_api.json @@ -783,18 +783,34 @@ "grants": { "class": "GrantsOps", "methods": { + "accept_invite": [ + "body", + "options" + ], "approve": [ "body", "options" ], + "cancel_invite": [ + "body", + "options" + ], "create": [ "body", "options" ], + "invite": [ + "body", + "options" + ], "list": [ "body", "options" ], + "list_invites": [ + "body", + "options" + ], "pending_for_me": [ "body", "options" diff --git a/tests/unit/snapshots/settings_defaults.json b/tests/unit/snapshots/settings_defaults.json index 683ed6c896..8ddd3f8c4e 100644 --- a/tests/unit/snapshots/settings_defaults.json +++ b/tests/unit/snapshots/settings_defaults.json @@ -586,6 +586,7 @@ "inference_workload_token_mode": "exchange", "insights_agents_connected_ttl_s": 60.0, "instance_heartbeat_seconds": 10.0, + "invite_ttl_seconds": 604800, "jwt_audience": "loom-platform", "jwt_end_user_issuers_json": "", "jwt_end_user_jwks_refresh_seconds": 300.0, @@ -716,6 +717,7 @@ "local_llm_base_url": "http://localhost:11434/v1", "log_format": "text", "log_level": "info", + "mail_from": "", "max_request_bytes": 33554432, "mcp_always_load_tools": "code.search,code.symbol", "mcp_auth_mode": "required", @@ -1209,6 +1211,7 @@ "session_brief_max_windows": 4, "session_brief_window_chars": 24000, "shutdown_ready_delay_s": 15.0, + "smtp_timeout_seconds": 10.0, "storage_authority": "clickhouse", "storage_frontend_assets_retry_max_s": 60.0, "storage_frontend_assets_retry_s": 2.0, diff --git a/tests/unit/test_agent_shares.py b/tests/unit/test_agent_shares.py index 8e4944d831..8e4851df2c 100644 --- a/tests/unit/test_agent_shares.py +++ b/tests/unit/test_agent_shares.py @@ -365,7 +365,7 @@ async def insert_row(row: Any, **kw: Any) -> None: monkeypatch.setattr(grants_app.grants_repo, "find_active_grant", find_active_grant) monkeypatch.setattr(grants_app.grants_repo, "insert_row", insert_row) monkeypatch.setattr(grants_app, "grant_change", lambda *a: _Claim()) - monkeypatch.setattr(grants_app, "_enforce_code_ceiling", no_ceiling) + monkeypatch.setattr(grants_app, "enforce_code_ceiling", no_ceiling) monkeypatch.setattr(aliases, "canonical_subject", canonical) check = agent_shares._made_by("sa:fleet:a", "sa:fleet:b", "fleet-a") body = GrantsCreateInput(org="acme", namespace="fleet-a", subject="sa:fleet:b", role=role) diff --git a/tests/unit/test_audit_subject_credentials.py b/tests/unit/test_audit_subject_credentials.py index 9d3bc2d607..cc60a3e25d 100644 --- a/tests/unit/test_audit_subject_credentials.py +++ b/tests/unit/test_audit_subject_credentials.py @@ -131,6 +131,38 @@ def test_code_repo_add_audits_what_was_registered_not_what_was_asked() -> None: assert subject["authenticated"] is False +def test_grants_accept_invite_audits_the_invitation_by_its_hash() -> None: + from server.identity.api.models_grants import GrantsAcceptInviteInput + from server.identity.domain.invites import invite_id + + accept = GrantsAcceptInviteInput(org="acme", namespace="team", secret=SECRET) + subject = _subject("grants.accept_invite", accept, {"namespace": "team", "role": "writer"}) + _assert_no_credential(subject) + assert subject == { + "org": "acme", + "namespace": "team", + "invite_id": invite_id(SECRET), + "role": "writer", + } + + +def test_grants_invite_audits_who_got_the_role_never_the_address() -> None: + from server.identity.api.models_grants import GrantsInviteInput + + asked = GrantsInviteInput(org="acme", namespace="team", to="m@example.com", role="writer") + granted = {"outcome": "granted", "role": "writer", "subject": "robin"} + assert _subject("grants.invite", asked, granted) == { + "org": "acme", + "namespace": "team", + "role": "writer", + "outcome": "granted", + "subject": "robin", + } + invited = {"outcome": "invited", "role": "writer", "subject": "", "invite_id": "h"} + subject = _subject("grants.invite", asked, invited) + assert subject["invite_id"] == "h" and "m@example.com" not in json.dumps(subject) + + def test_the_matcher_tells_credentials_from_lookalikes() -> None: for name in ( "password", diff --git a/tests/unit/test_auth_aliases.py b/tests/unit/test_auth_aliases.py index b3eaa4f7bd..383f2d9447 100644 --- a/tests/unit/test_auth_aliases.py +++ b/tests/unit/test_auth_aliases.py @@ -93,7 +93,7 @@ async def _insert(row: dict, **_k) -> None: monkeypatch.setattr(grants_repo, "find_active_grant", _none) monkeypatch.setattr(grants_repo, "insert_row", _insert) - monkeypatch.setattr(grants_mod, "_enforce_code_ceiling", _none) + monkeypatch.setattr(grants_mod, "enforce_code_ceiling", _none) monkeypatch.setattr("server.core.ch.get_client", lambda: _ch([])) # released: nothing tied al._CACHE[("acme", "alice@acme.io")] = (time.monotonic(), ("alice@acme.io", "alice")) await grants_mod.handle_grants_create( diff --git a/tests/unit/test_cell_scan_tables.py b/tests/unit/test_cell_scan_tables.py index e4cb5cee0e..b59e031c78 100644 --- a/tests/unit/test_cell_scan_tables.py +++ b/tests/unit/test_cell_scan_tables.py @@ -137,6 +137,7 @@ "loom.memory_webhooks", "loom.namespace_calibration_result", "loom.namespace_grants", + "loom.namespace_invites", "loom.namespace_guides", "loom.namespace_ontology", "loom.namespace_policies", diff --git a/tests/unit/test_erasure_audit_actor.py b/tests/unit/test_erasure_audit_actor.py index 966895508a..ff622a3fab 100644 --- a/tests/unit/test_erasure_audit_actor.py +++ b/tests/unit/test_erasure_audit_actor.py @@ -137,7 +137,7 @@ async def test_a_tokenless_resume_of_a_user_saga_names_the_ledgers_actor( """The real user saga resumed without a token: `erasure.completed` names the ledger's actor, else the resuming process (the CLI's pipeline actor, or the worker).""" - from server.identity.app import grants + from server.identity.app import grants, invites _, audits, _ = recorded @@ -149,6 +149,7 @@ async def _none(*a: Any, **kw: Any) -> None: monkeypatch.setattr(grants, "revoke_subject", _revoke) monkeypatch.setattr(grants, "forget_granter", _none) + monkeypatch.setattr(invites, "forget_maker", _none) set_current_auth(None) with pipeline_actor(outer): await saga.run_saga(**_resume_args(stored)) diff --git a/tests/unit/test_grant_claims.py b/tests/unit/test_grant_claims.py index d24e3c90ec..6512c955da 100644 --- a/tests/unit/test_grant_claims.py +++ b/tests/unit/test_grant_claims.py @@ -180,7 +180,7 @@ async def _nothing(*_a: Any, **_k: Any) -> None: monkeypatch.setattr(grants_repo, "find_active_grant", _active) monkeypatch.setattr(grants_repo, "insert_row", _insert) monkeypatch.setattr("server.auth.aliases.canonical_subject", _same) - monkeypatch.setattr(grants_app, "_enforce_code_ceiling", _nothing) + monkeypatch.setattr(grants_app, "enforce_code_ceiling", _nothing) monkeypatch.setattr("server.code.app.index.maintainers.sync_quietly", _nothing) async def _promote() -> None: @@ -280,7 +280,7 @@ async def _nothing(*_a: Any, **_k: Any) -> None: ): monkeypatch.setattr(grants_repo, name, fake) monkeypatch.setattr("server.auth.aliases.canonical_subject", _same) - monkeypatch.setattr(grants_app, "_enforce_code_ceiling", _nothing) + monkeypatch.setattr(grants_app, "enforce_code_ceiling", _nothing) return gone diff --git a/tests/unit/test_grants_create_downgrade.py b/tests/unit/test_grants_create_downgrade.py index 541a8e64db..dee8287b3d 100644 --- a/tests/unit/test_grants_create_downgrade.py +++ b/tests/unit/test_grants_create_downgrade.py @@ -44,7 +44,7 @@ async def _no_ceiling(*_a: Any, **_k: Any) -> None: monkeypatch.setattr(grants_repo, "find_active_grant", _find) monkeypatch.setattr(grants_repo, "find_any_grant", _find) monkeypatch.setattr(grants_repo, "insert_row", _insert) - monkeypatch.setattr(grants_mod, "_enforce_code_ceiling", _no_ceiling) + monkeypatch.setattr(grants_mod, "enforce_code_ceiling", _no_ceiling) return inserted, looked_up diff --git a/tests/unit/test_grants_create_stamps_granter.py b/tests/unit/test_grants_create_stamps_granter.py index d04fda0da4..9e54c34436 100644 --- a/tests/unit/test_grants_create_stamps_granter.py +++ b/tests/unit/test_grants_create_stamps_granter.py @@ -36,7 +36,7 @@ async def _canonical(org: str, subject: str) -> str: monkeypatch.setattr(grants_repo, "find_active_grant", _find) monkeypatch.setattr(grants_repo, "insert_row", _insert) - monkeypatch.setattr(grants_mod, "_enforce_code_ceiling", _no_ceiling) + monkeypatch.setattr(grants_mod, "enforce_code_ceiling", _no_ceiling) monkeypatch.setattr("server.auth.aliases.canonical_subject", _canonical) yield rows set_current_auth(None) diff --git a/tests/unit/test_grants_invite.py b/tests/unit/test_grants_invite.py new file mode 100644 index 0000000000..bbb458706e --- /dev/null +++ b/tests/unit/test_grants_invite.py @@ -0,0 +1,911 @@ +"""grants.invite gives a person a role by their handle or email: a grant when an account +signs in under it, an invitation link for an email no account holds, and a refusal for +a handle no account holds. grants.accept_invite spends a link once, for the signed-in +person, stamped as granted by the invitation's maker; a failed grant leaves it open.""" + +from __future__ import annotations + +import asyncio +import contextlib +import smtplib +import time +from collections.abc import AsyncIterator, Awaitable, Callable, Iterator +from dataclasses import replace +from datetime import UTC, datetime +from typing import Any, ClassVar +from urllib.parse import parse_qs, urlsplit + +import anyio +import pytest + +from server.auth import fail_closed +from server.auth.context import set_current_auth +from server.auth.jwt import AuthInfo +from server.core.ch import own_write_reads, sequential_reads_active +from server.core.errors import ( + BackendUnavailableError, + GrantWouldDowngradeError, + NotFoundError, + ValidationError, +) +from server.identity.api.models_grants import ( + GrantsAcceptInviteInput, + GrantsCancelInviteInput, + GrantsCreateInput, + GrantsInviteInput, + GrantsListInvitesInput, +) +from server.identity.app import invite_mail +from server.identity.app import invites as mod +from server.identity.domain import invites as domain +from server.identity.domain.grants import GrantState +from server.identity.store import invites as invites_repo +from server.operations.base import Role +from server.settings import settings +from tests.unit.schema_ddl import column_names + + +class World: + """The rows the handlers read and write, in memory.""" + + def __init__(self) -> None: + self.invites: dict[str, domain.Invite] = {} + self.writes: list[domain.Invite] = [] + # Rows' owners: an account's handle, or whatever `namespace.register` was given. + self.accounts = {"robin", "platform@acme.example"} + # Handles a live grant in the org is stored under, as stored. + self.granted = {"Carol", "bob@example.com"} + self.verified = {"sso@example.com": "sso-handle"} + self.grants: list[tuple[GrantsCreateInput, str | None]] = [] + self.grant_error: BaseException | None = None + # The grant row lands before `grant_error` is raised (a lost reply). + self.grant_lands = False + # What each maker's own grant on the namespace reads as. + self.maker_roles: dict[str, Role | None] = {"admin-ann": Role.ADMIN} + # Makers whose account is disabled, and subjects revoked outright. + self.disabled: set[str] = set() + self.revoked: set[str] = set() + self.active = True + self.mail: list[dict[str, Any]] = [] + self.may_mail = True + self.mail_asked: list[tuple[Any, ...]] = [] + self.mail_error: BaseException | None = None + # Raised by the write that spends a link, after it lands (a lost reply). + self.put_error: BaseException | None = None + # Cancelled from inside the grant, as a client gone mid-request cancels it. + self.cancel: anyio.CancelScope | None = None + # Run while the grant is in flight, before it lands or fails. + self.during_grant: Callable[[], Awaitable[Any]] | None = None + + +@pytest.fixture +def world(monkeypatch: pytest.MonkeyPatch) -> Iterator[World]: + w = World() + + async def put(invite: domain.Invite, **_: Any) -> None: + w.invites[invite.invite_id] = invite + w.writes.append(invite) + if w.put_error is not None and invite.state == "accepted": + raise w.put_error + + async def get(org: str, namespace: str, invite_id: str, **_: Any) -> domain.Invite | None: + found = w.invites.get(invite_id) + await anyio.lowlevel.checkpoint() # answered as of the read, before another write + return found if found and (found.org, found.namespace) == (org, namespace) else None + + async def open_on( + org: str, namespace: str, now: int, limit: int, **_: Any + ) -> list[domain.Invite]: + return [i for i in w.invites.values() if i.is_open(now)][:limit] + + async def account_handle(org: str, subject: str, **_: Any) -> str | None: + return next((a for a in w.accounts if a.lower() == subject.lower()), None) + + async def granted_spelling(org: str, subject: str, **_: Any) -> str | None: + return next((g for g in w.granted if g.lower() == subject.lower()), None) + + async def made_by(org: str, maker: str, **_: Any) -> list[domain.Invite]: + return [i for i in w.invites.values() if (i.org, i.created_by) == (org, maker)] + + async def is_active(org: str, namespace: str, **_: Any) -> bool: + return w.active + + async def canonical(org: str, subject: str, **_: Any) -> str: + return w.verified.get(subject.lower(), subject) + + async def create_grant(input: GrantsCreateInput, *_a: Any, issuer: str | None = None) -> None: + # Written under the handle a verified email ties to, as the real one writes it. + input = input.model_copy(update={"subject": w.verified.get(input.subject, input.subject)}) + if w.cancel is not None: + w.cancel.cancel() + await anyio.lowlevel.checkpoint() + if w.during_grant is not None: + await w.during_grant() + if w.grant_lands: + w.grants.append((input, issuer)) + if w.grant_error is not None: + raise w.grant_error + if not w.grant_lands: + w.grants.append((input, issuer)) + + async def subject_grant_role(org: str, namespace: str, subject: str) -> Role | None: + return w.maker_roles.get(subject) + + async def account_active(org: str, creator: str) -> bool: + return creator not in w.disabled + + async def find_active_grant(org: str, namespace: str, subject: str, **_: Any) -> Any: + if not sequential_reads_active(): + return None # a replica that has not seen the grant just written + held = [ + g for g, _ in w.grants if (g.org, g.namespace, g.subject) == (org, namespace, subject) + ] + if not held: + return None + return GrantState( + role=held[-1].role, + granted_by="", + status="active", + pending_role=None, + pending_since=None, + ) + + async def no_ceiling(*_a: Any, **_k: Any) -> None: + return None + + @contextlib.asynccontextmanager + async def claimed(*_a: Any) -> AsyncIterator[None]: + await anyio.lowlevel.checkpoint() # the lease's own round trip, where a cancel lands + with own_write_reads(): # as the real claim reads under it + yield + + async def send(to: str, **kw: Any) -> bool: + w.mail.append({"to": to, **kw}) + return True + + monkeypatch.setattr(mod.invites_repo, "put", put) + monkeypatch.setattr(mod.invites_repo, "get", get) + monkeypatch.setattr(mod.invites_repo, "open_on", open_on) + monkeypatch.setattr(mod.invites_repo, "made_by", made_by) + monkeypatch.setattr(mod.namespaces_repo, "account_handle", account_handle) + monkeypatch.setattr(mod.grants_repo, "granted_spelling", granted_spelling) + monkeypatch.setattr(mod.namespaces_repo, "is_active", is_active) + monkeypatch.setattr("server.auth.aliases.canonical_subject", canonical) + monkeypatch.setattr(mod, "create_grant", create_grant) + monkeypatch.setattr(mod, "subject_grant_role", subject_grant_role) + monkeypatch.setattr(mod, "creator_account_active", account_active) + monkeypatch.setattr(mod, "is_revoked", lambda subject, **_: subject in w.revoked) + monkeypatch.setattr(mod.grants_repo, "find_active_grant", find_active_grant) + monkeypatch.setattr(mod, "enforce_code_ceiling", no_ceiling) + monkeypatch.setattr(mod, "invite_change", claimed) + monkeypatch.setattr(mod.invite_mail, "send_invite", send) + + async def may_mail(*a: Any) -> bool: + if w.mail_error is not None: + raise w.mail_error + w.mail_asked.append(a) + return w.may_mail + + monkeypatch.setattr(mod, "_may_mail", may_mail) + signed_in("admin-ann") + yield w + set_current_auth(None) + fail_closed.reset() + + +def signed_in(subject: str, *, org: str = "o", service: bool = False, creator: str = "") -> None: + set_current_auth( + AuthInfo( + subject=subject, + org=org, + namespaces=("ns",), + roles=(Role.WRITER,), + is_service_account=service, + creator=creator, + ) + ) + + +async def invite(to: str, role: str = "writer") -> Any: + return await mod.handle_grants_invite( + GrantsInviteInput(org="o", namespace="ns", to=to, role=role) # type: ignore[arg-type] + ) + + +def secret_of(link_path: str) -> str: + parts = urlsplit(link_path) + assert (parts.path, parts.query) == ("/spaces", "") + fragment = parse_qs(parts.fragment) + assert (fragment["org"], fragment["namespace"]) == (["o"], ["ns"]) + return fragment["invite"][0] + + +async def accept(secret: str) -> Any: + return await mod.handle_grants_accept_invite( + GrantsAcceptInviteInput(org="o", namespace="ns", secret=secret) + ) + + +@pytest.mark.asyncio +async def test_a_handle_an_account_signs_in_as_is_granted_at_once(world: World) -> None: + out = await invite("Robin") + assert (out.outcome, out.subject, out.link_path) == ("granted", "robin", "") + assert [(g.subject, g.role) for g, _ in world.grants] == [("robin", "writer")] + assert world.invites == {} + + +@pytest.mark.asyncio +async def test_a_handle_a_live_grant_is_stored_under_is_granted_under_that_spelling( + world: World, +) -> None: + """A person whose tokens Loom did not mint at sign-in has no account row.""" + out = await invite("carol") + assert (out.outcome, out.subject) == ("granted", "Carol") + assert [g.subject for g, _ in world.grants] == ["Carol"] + + +@pytest.mark.parametrize("to", ["bob@example.com", "platform@acme.example"]) +@pytest.mark.asyncio +async def test_an_email_only_a_grant_or_a_rows_owner_names_still_gets_a_link( + world: World, to: str +) -> None: + """`grants.create` stores an email as typed and `namespace.register` takes any owner, + so neither is an account that signs in.""" + out = await invite(to) + assert out.outcome == "invited" and world.grants == [] + + +@pytest.mark.asyncio +async def test_a_verified_email_is_granted_under_its_handle(world: World) -> None: + out = await invite("sso@example.com", "viewer") + assert (out.outcome, out.subject) == ("granted", "sso-handle") + assert world.invites == {} + + +@pytest.mark.asyncio +async def test_a_handle_no_account_holds_is_refused_and_writes_nothing(world: World) -> None: + with pytest.raises(NotFoundError, match="no account in o signs in as 'robinn'"): + await invite("robinn") + assert world.grants == [] and world.invites == {} + + +@pytest.mark.parametrize("to", ["sa:bot", "SA:bot", "group:eng", "everyone", "user:42", "agent:x"]) +@pytest.mark.asyncio +async def test_a_principal_is_left_to_grants_create(world: World, to: str) -> None: + with pytest.raises(ValidationError, match="grants.create"): + await invite(to) + + +@pytest.mark.parametrize( + "to", + [ + "victim@example.com,x1", + "victim@example.com;x1", + "Victim ", + "victim@example.com (x)", + '"v x"@example.com', + "victim@localhost", + ".a..b.@example.com", + ], +) +@pytest.mark.asyncio +async def test_only_one_plain_address_gets_a_link(world: World, to: str) -> None: + """A list, a display name or a comment would name other recipients, or key the + address's mail limit by a string that is not the address.""" + with pytest.raises(ValidationError): + await invite(to) + assert world.invites == {} and world.grants == [] and world.mail == [] + + +@pytest.mark.asyncio +async def test_an_address_sign_up_takes_gets_a_link(world: World) -> None: + out = await invite("jörg@bücher.example") + assert out.outcome == "invited" + assert world.invites[out.invite_id].email == "jörg@bücher.example" + + +@pytest.mark.asyncio +async def test_a_request_with_no_token_grants_a_person_as_typed(world: World) -> None: + """Only auth off serves one, and no one signs in there to accept a link.""" + set_current_auth(None) + out = await invite("new@example.com") + assert (out.outcome, out.subject) == ("granted", "new@example.com") + # Answered under the subject the grant is written under. + assert (await invite("sso@example.com")).subject == "sso-handle" + assert world.invites == {} + + +@pytest.mark.asyncio +async def test_a_mail_limit_that_cannot_be_read_leaves_no_link_listed(world: World) -> None: + world.mail_error = BackendUnavailableError("down") + with pytest.raises(BackendUnavailableError): + await invite("robin@example.com") + assert world.writes == [] + + +@pytest.mark.asyncio +async def test_an_email_no_account_holds_gets_a_link_kept_only_as_its_hash(world: World) -> None: + out = await invite("Robin@Example.com") + assert out.outcome == "invited" and out.emailed is True + secret = secret_of(out.link_path) + stored = world.invites[out.invite_id] + assert out.invite_id == domain.invite_id(secret) != secret + assert secret not in repr(stored) + assert (stored.email, stored.role, stored.created_by, stored.state) == ( + "robin@example.com", + "writer", + "admin-ann", + "open", + ) + assert stored.expires_at - time.time() == pytest.approx(settings.invite_ttl_seconds, abs=5) + assert world.mail[0]["to"] == "robin@example.com" + listed = await mod.handle_grants_list_invites(GrantsListInvitesInput(org="o", namespace="ns")) + assert [r.email for r in listed.rows] == ["robin@example.com"] + + +@pytest.mark.asyncio +async def test_past_the_mail_limits_the_link_is_still_made_and_not_emailed(world: World) -> None: + world.may_mail = False + out = await invite("robin@example.com") + assert (out.outcome, out.emailed, world.mail) == ("invited", False, []) + assert out.invite_id in world.invites + + +@pytest.mark.asyncio +async def test_mail_waits_for_the_settings_then_counts_inviter_and_address( + monkeypatch: pytest.MonkeyPatch, +) -> None: + asked: list[tuple[str, str]] = [] + + class Gate: + def __init__(self, name: str, answer: bool) -> None: + self.name, self.answer = name, answer + + async def allow(self, key: str) -> bool: + asked.append((self.name, key)) + return self.answer + + monkeypatch.setattr(mod, "_mail_by_inviter", Gate("inviter", True)) + monkeypatch.setattr(mod, "_mail_by_address", Gate("address", False)) + monkeypatch.setattr(invite_mail, "can_send", lambda: False) + assert await mod._may_mail("o", "ann", "m@example.com") is False + assert asked == [] + monkeypatch.setattr(invite_mail, "can_send", lambda: True) + assert await mod._may_mail("o", "ann", "m@example.com") is False + assert asked == [("inviter", "o/ann"), ("address", "m@example.com")] + + +@pytest.mark.asyncio +async def test_mail_stops_at_twenty_an_hour_per_inviter_and_three_a_day_per_address( + auth_attempts: Any, monkeypatch: pytest.MonkeyPatch +) -> None: + monkeypatch.setattr(invite_mail, "can_send", lambda: True) + to_one = [await mod._may_mail("o", f"ann-{i}", "m@example.com") for i in range(4)] + assert to_one == [True, True, True, False] + by_one = [await mod._may_mail("o", "bea", f"p{i}@example.com") for i in range(21)] + assert by_one == [True] * 20 + [False] + + +@pytest.mark.asyncio +async def test_the_link_lets_one_person_in_once_as_granted_by_its_maker(world: World) -> None: + secret = secret_of((await invite("robin@example.com")).link_path) + signed_in("robin") + out = await accept(secret) + assert (out.namespace, out.role) == ("ns", "writer") + assert [(g.subject, g.role, issuer) for g, issuer in world.grants] == [ + ("robin", "writer", "admin-ann") + ] + assert world.invites[domain.invite_id(secret)].accepted_by == "robin" + signed_in("someone-else") + with pytest.raises(NotFoundError, match="used, cancelled or expired"): + await accept(secret) + assert len(world.grants) == 1 + + +@pytest.mark.asyncio +async def test_a_higher_role_held_already_stands(world: World) -> None: + secret = secret_of((await invite("robin@example.com", "viewer")).link_path) + world.grant_error = GrantWouldDowngradeError(current_role="admin", requested_role="viewer") + signed_in("robin") + assert (await accept(secret)).role == "admin" + assert world.invites[domain.invite_id(secret)].state == "accepted" + + +@pytest.mark.asyncio +async def test_a_failed_grant_leaves_the_link_open(world: World) -> None: + secret = secret_of((await invite("robin@example.com")).link_path) + world.grant_error = BackendUnavailableError("down") + signed_in("robin") + with pytest.raises(BackendUnavailableError): + await accept(secret) + iid = domain.invite_id(secret) + assert [w.state for w in world.writes if w.invite_id == iid] == ["open", "accepted", "open"] + world.grant_error = None + assert (await accept(secret)).role == "writer" + + +@pytest.mark.asyncio +async def test_a_lost_reply_to_the_spend_leaves_the_link_open(world: World) -> None: + secret = secret_of((await invite("robin@example.com")).link_path) + world.put_error = BackendUnavailableError("lost reply") + signed_in("robin") + with pytest.raises(BackendUnavailableError): + await accept(secret) + iid = domain.invite_id(secret) + assert [w.state for w in world.writes if w.invite_id == iid] == ["open", "accepted", "open"] + assert world.grants == [] + + +@pytest.mark.asyncio +async def test_a_cancelled_accept_leaves_the_link_open(world: World) -> None: + """anyio raises a cancellation again at every await of its scope: the reopen still + runs to its end.""" + secret = secret_of((await invite("robin@example.com")).link_path) + signed_in("robin") + with anyio.CancelScope() as scope: + world.cancel = scope + await accept(secret) + assert scope.cancelled_caught + iid = domain.invite_id(secret) + assert [w.state for w in world.writes if w.invite_id == iid] == ["open", "accepted", "open"] + assert world.grants == [] + + +@pytest.mark.asyncio +async def test_two_people_opening_one_link_at_once_let_in_one( + world: World, monkeypatch: pytest.MonkeyPatch +) -> None: + from server.auth import grant_claims + from tests.unit.claims_fake import memory_claims + + claims = memory_claims(monkeypatch) + monkeypatch.setattr(grant_claims, "take", claims.take) + monkeypatch.setattr(mod, "invite_change", grant_claims.invite_change) + secret = secret_of((await invite("robin@example.com")).link_path) + + async def as_(subject: str) -> Any: + signed_in(subject) + return await accept(secret) + + got = await asyncio.gather(as_("robin"), as_("carol"), return_exceptions=True) + assert sorted(type(g).__name__ for g in got) == ["GrantsAcceptInviteOutput", "NotFoundError"] + assert len(world.grants) == 1 + + +@pytest.mark.asyncio +async def test_a_namespace_retired_since_the_invitation_admits_nobody(world: World) -> None: + secret = secret_of((await invite("robin@example.com")).link_path) + world.active = False + signed_in("robin") + with pytest.raises(NotFoundError): + await accept(secret) + assert world.grants == [] and world.invites[domain.invite_id(secret)].state == "open" + + +@pytest.mark.asyncio +async def test_a_cancel_while_a_failing_accept_is_in_flight_keeps_the_link_closed( + world: World, +) -> None: + out = await invite("robin@example.com") + answers: list[bool] = [] + + async def cancel() -> None: + signed_in("admin-ann") + scope = GrantsCancelInviteInput(org="o", namespace="ns", invite_id=out.invite_id) + answers.append((await mod.handle_grants_cancel_invite(scope)).cancelled) + signed_in("robin") + + world.during_grant, world.grant_error = cancel, BackendUnavailableError("down") + signed_in("robin") + with pytest.raises(BackendUnavailableError): + await accept(secret_of(out.link_path)) + # Not open when the cancel came, so not cancelled by it; and not reopened after it. + assert answers == [False] and world.invites[out.invite_id].state == "cancelled" + + +@pytest.mark.asyncio +async def test_a_failure_after_the_grant_landed_leaves_the_link_used(world: World) -> None: + secret = secret_of((await invite("robin@example.com")).link_path) + world.grant_error, world.grant_lands = BackendUnavailableError("lost reply"), True + signed_in("robin") + with pytest.raises(BackendUnavailableError): + await accept(secret) + iid = domain.invite_id(secret) + assert [w.state for w in world.writes if w.invite_id == iid] == ["open", "accepted"] + world.grant_error, world.grant_lands = None, False + signed_in("someone-else") + with pytest.raises(NotFoundError): + await accept(secret) + assert [g.subject for g, _ in world.grants] == ["robin"] + + +@pytest.mark.asyncio +async def test_an_invitation_never_outlasts_its_makers_admin(world: World) -> None: + secret = secret_of((await invite("robin@example.com")).link_path) + world.maker_roles["admin-ann"] = Role.WRITER # lowered, or None when revoked + signed_in("robin") + with pytest.raises(NotFoundError, match="no longer administers"): + await accept(secret) + assert world.invites[domain.invite_id(secret)].state == "open" + assert world.grants == [] + + +@pytest.mark.asyncio +async def test_an_admin_only_a_token_makes_makes_no_link(world: World) -> None: + """A platform admin or an operator's token holds no grant a later read could tell + from a revoked one.""" + world.maker_roles = {} + with pytest.raises(ValidationError, match="'admin-ann' holds none there"): + await invite("robin@example.com") + assert world.invites == {} and world.mail_asked == [] + + +@pytest.mark.asyncio +async def test_a_delegated_tokens_link_stands_on_its_creators_admin(world: World) -> None: + signed_in("sa:helper-1a2b", service=True, creator="admin-ann") + out = await invite("robin@example.com") + assert world.invites[out.invite_id].created_by == "admin-ann" + assert world.mail_asked == [("o", "admin-ann", "robin@example.com")] + world.maker_roles["admin-ann"] = None # the creator's admin revoked + signed_in("robin") + with pytest.raises(NotFoundError, match="no longer administers"): + await accept(secret_of(out.link_path)) + assert world.grants == [] + + +@pytest.mark.asyncio +async def test_a_failed_read_of_the_makers_grants_refuses( + world: World, monkeypatch: pytest.MonkeyPatch +) -> None: + secret = secret_of((await invite("robin@example.com")).link_path) + + async def unreadable(*_a: Any) -> Role | None: + fail_closed.note_unreadable() + return None + + monkeypatch.setattr(mod, "subject_grant_role", unreadable) + signed_in("robin") + with pytest.raises(BackendUnavailableError, match="could not be read"): + await accept(secret) # a 503: the dashboard keeps the link + assert world.invites[domain.invite_id(secret)].state == "open" + signed_in("admin-ann") + with pytest.raises(BackendUnavailableError, match="could not be read"): + await invite("other@example.com") + assert world.grants == [] and len(world.invites) == 1 + + +@pytest.mark.parametrize("ended", ["disabled", "revoked"]) +@pytest.mark.asyncio +async def test_a_link_stops_with_its_makers_account(world: World, ended: str) -> None: + """As a token delegated by the maker stops: a disabled account, or a revoked subject.""" + secret = secret_of((await invite("robin@example.com")).link_path) + getattr(world, ended).add("admin-ann") + signed_in("robin") + with pytest.raises(NotFoundError, match="no longer administers"): + await accept(secret) + assert world.grants == [] and world.invites[domain.invite_id(secret)].state == "open" + + +@pytest.mark.parametrize("ended", ["lowered", "disabled", "revoked"]) +@pytest.mark.asyncio +async def test_a_link_whose_maker_no_longer_stands_is_not_listed(world: World, ended: str) -> None: + """It admits nobody, so the members dialog does not show it as open.""" + await invite("robin@example.com") + scope = GrantsListInvitesInput(org="o", namespace="ns") + assert len((await mod.handle_grants_list_invites(scope)).rows) == 1 + if ended == "lowered": + world.maker_roles["admin-ann"] = Role.WRITER + else: + getattr(world, ended).add("admin-ann") + assert (await mod.handle_grants_list_invites(scope)).rows == [] + + +@pytest.mark.asyncio +async def test_an_end_users_links_stop_with_their_revocation(world: World) -> None: + """An end user's tokens are revoked under `/user:`, and so are their links.""" + world.maker_roles["user:42"] = Role.ADMIN + signed_in("user:42") + secret = secret_of((await invite("robin@example.com")).link_path) + world.revoked.add("o/user:42") + listed = await mod.handle_grants_list_invites(GrantsListInvitesInput(org="o", namespace="ns")) + assert listed.rows == [] + signed_in("robin") + with pytest.raises(NotFoundError, match="no longer administers"): + await accept(secret) + assert world.grants == [] + + +@pytest.mark.asyncio +async def test_a_failed_read_earlier_in_the_request_does_not_refuse_the_maker( + world: World, +) -> None: + fail_closed.note_unreadable() # a read the gate made and survived + assert (await invite("robin@example.com")).outcome == "invited" + + +@pytest.mark.asyncio +async def test_a_role_this_build_does_not_know_is_unlisted_and_admits_nobody( + world: World, +) -> None: + out = await invite("robin@example.com") + world.invites[out.invite_id] = replace(world.invites[out.invite_id], role="owner") + listed = await mod.handle_grants_list_invites(GrantsListInvitesInput(org="o", namespace="ns")) + assert listed.rows == [] + signed_in("robin") + with pytest.raises(NotFoundError): + await accept(secret_of(out.link_path)) + assert world.grants == [] + + +@pytest.mark.asyncio +async def test_an_erased_makers_links_close_and_lose_their_name(world: World) -> None: + opened = await invite("a@example.com") + used = await invite("b@example.com") + signed_in("robin") + await accept(secret_of(used.link_path)) + assert await mod.forget_maker("o", "admin-ann") == 2 + assert [(i.state, i.created_by) for i in world.invites.values()] == [ + ("cancelled", ""), + ("accepted", ""), + ] + with pytest.raises(NotFoundError): + await accept(secret_of(opened.link_path)) + + +@pytest.mark.asyncio +async def test_an_inactive_namespace_gets_no_invitation(world: World) -> None: + world.active = False + with pytest.raises(NotFoundError, match="not an active namespace"): + await invite("robin@example.com") + assert world.invites == {} + + +@pytest.mark.asyncio +async def test_where_sign_in_is_single_sign_on_only_an_email_is_granted_as_typed( + world: World, monkeypatch: pytest.MonkeyPatch +) -> None: + monkeypatch.setattr(settings, "oauth_login_provider", "oidc") + out = await invite("New@Example.com") + assert (out.outcome, out.subject, out.link_path) == ("granted", "New@Example.com", "") + assert [(g.subject, g.role) for g, _ in world.grants] == [("New@Example.com", "writer")] + assert world.invites == {} and world.mail == [] + + +def test_a_state_this_build_does_not_know_is_closed() -> None: + made = datetime(2026, 1, 1, tzinfo=UTC) + open_row = domain.Invite( + org="o", + namespace="ns", + invite_id="h", + email="m@example.com", + role="writer", + created_by="ann", + created_at=made, + expires_at=2**31, + ).row() + assert domain.Invite.from_row(open_row).is_open(0) + assert not domain.Invite.from_row({**open_row, "state": "revoked"}).is_open(0) + + +@pytest.mark.asyncio +async def test_an_expired_or_cancelled_link_admits_nobody(world: World) -> None: + expired = secret_of((await invite("a@example.com")).link_path) + iid = domain.invite_id(expired) + world.invites[iid] = replace(world.invites[iid], expires_at=int(time.time()) - 1) + cancelled = (await invite("b@example.com")).invite_id + out = await mod.handle_grants_cancel_invite( + GrantsCancelInviteInput(org="o", namespace="ns", invite_id=cancelled) + ) + assert out.cancelled is True + assert (world.invites[cancelled].state, world.invites[cancelled].accepted_by) == ( + "cancelled", + "", + ) + again = await mod.handle_grants_cancel_invite( + GrantsCancelInviteInput(org="o", namespace="ns", invite_id=cancelled) + ) + assert again.cancelled is False + signed_in("robin") + with pytest.raises(NotFoundError): + await accept(expired) + with pytest.raises(NotFoundError): + await accept("not-a-link") + assert world.grants == [] + + +@pytest.mark.parametrize( + ("subject", "org", "service", "words"), + [ + ("sa:bot", "o", True, "a person"), + ("bot", "o", True, "a person"), # a service account's token, its subject unprefixed + ("group:eng", "o", False, "a person"), + ("robin", "other", False, "sign in to o"), + ], +) +@pytest.mark.asyncio +async def test_only_a_person_of_the_org_accepts( + world: World, subject: str, org: str, service: bool, words: str +) -> None: + secret = secret_of((await invite("robin@example.com")).link_path) + signed_in(subject, org=org, service=service) + with pytest.raises(ValidationError, match=words): + await accept(secret) + assert world.invites[domain.invite_id(secret)].state == "open" + + +@pytest.mark.asyncio +async def test_the_mail_carries_the_link(monkeypatch: pytest.MonkeyPatch) -> None: + sent: list[Any] = [] + monkeypatch.setattr(invite_mail, "_send", sent.append) + args = {"inviter": "ann", "namespace": "ns", "role": "writer", "url": "u", "expires_at": 0} + monkeypatch.setattr(settings, "mail_from", "Loom ") + assert await invite_mail.send_invite("m@example.com", **{**args, "url": "https://x/l#s"}) + assert "https://x/l#s" in sent[0].get_content() + # A header with a line break is refused by the email library: reported as not sent. + assert await invite_mail.send_invite("m@example.com\nBcc: x@y.z", **args) is False + + +def test_a_mail_server_url_of_another_scheme_is_refused_at_load() -> None: + from pydantic import ValidationError + + from server.settings import Settings + + for url in ("", "smtp://mail.example.com", "smtps://u:p@mail.example.com:465"): + assert Settings(_env_file=None, smtp_url=url).smtp_url == url # type: ignore[call-arg] + for url in ("smtp+starttls://mail.example.com", "mail://x", "smtp://"): + with pytest.raises(ValidationError, match="smtp_url"): + Settings(_env_file=None, smtp_url=url) # type: ignore[call-arg] + + +class _SMTP: + """smtplib's client as `_send` drives it, recording what it was asked.""" + + opened: ClassVar[list[tuple[str, int, float]]] = [] + last: ClassVar[_SMTP] + starttls_offered = True + + def __init__(self, host: str, port: int, *, timeout: float, context: Any = None) -> None: + self.calls: list[Any] = [] + type(self).opened.append((host, port, timeout)) + type(self).last = self + + def __enter__(self) -> _SMTP: + return self + + def __exit__(self, *_: object) -> None: + return None + + def ehlo(self) -> None: + self.calls.append("ehlo") + + def has_extn(self, name: str) -> bool: + return self.starttls_offered and name == "starttls" + + def starttls(self, *, context: Any) -> None: + self.calls.append("starttls") + + def login(self, user: str, password: str) -> None: + self.calls.append(("login", user, password)) + + def send_message(self, msg: Any) -> None: + self.calls.append("send") + + +def test_smtp_is_reached_within_the_timeout_and_sends_only_over_tls( + monkeypatch: pytest.MonkeyPatch, +) -> None: + monkeypatch.setattr(_SMTP, "opened", []) + monkeypatch.setattr(smtplib, "SMTP", _SMTP) + monkeypatch.setattr(smtplib, "SMTP_SSL", _SMTP) + monkeypatch.setattr(settings, "smtp_timeout_seconds", 3.0) + msg = invite_mail._message( + "m@example.com", inviter="ann", namespace="ns", role="writer", url="u", expires_at=0 + ) + + monkeypatch.setattr(settings, "smtp_url", "smtps://loom%40example.com:p%40ss@mail.example.com") + invite_mail._send(msg) + assert _SMTP.last.calls == [("login", "loom@example.com", "p@ss"), "send"] + + monkeypatch.setattr(settings, "smtp_url", "smtp://loom:pw@mail.example.com") + invite_mail._send(msg) + assert _SMTP.last.calls == ["ehlo", "starttls", "ehlo", ("login", "loom", "pw"), "send"] + assert _SMTP.opened == [("mail.example.com", 465, 3.0), ("mail.example.com", 587, 3.0)] + + # A server without STARTTLS sees neither the password nor the link, login or not. + monkeypatch.setattr(_SMTP, "starttls_offered", False) + for url in ("smtp://loom:pw@mail.example.com", "smtp://mail.example.com"): + monkeypatch.setattr(settings, "smtp_url", url) + with pytest.raises(smtplib.SMTPNotSupportedError): + invite_mail._send(msg) + assert _SMTP.last.calls == ["ehlo"] + + +class _Rows: + def __init__(self) -> None: + self.rows: list[dict[str, Any]] = [] + + async def query_one(self, sql: str, params: dict[str, Any]) -> dict[str, Any]: + return {"v": len(self.rows) + 1} # `next_version`'s read + + async def insert(self, table: str, rows: list[dict[str, Any]], **_: Any) -> None: + assert table == "loom.namespace_invites" + self.rows.extend(rows) + + +@pytest.mark.asyncio +async def test_every_write_of_an_invitation_carries_every_column() -> None: + """Under FINAL a column a rewrite left out would fall back to its default.""" + ch = _Rows() + made = datetime(2026, 1, 1, tzinfo=UTC) + invite = domain.Invite( + org="acme", + namespace="team", + invite_id="h", + email="m@example.com", + role="writer", + created_by="ann", + created_at=made, + expires_at=1, + ) + await invites_repo.put(invite, ch=ch) # type: ignore[arg-type] + await invites_repo.put(invite.accepted("lee", made), ch=ch) # type: ignore[arg-type] + await invites_repo.put(invite.forgotten(made), ch=ch) # type: ignore[arg-type] + assert [sorted(r) for r in ch.rows] == [sorted(column_names("namespace_invites"))] * 3 + assert [(r["state"], r["accepted_by"], r["version"]) for r in ch.rows] == [ + ("open", "", 1), + ("accepted", "lee", 2), + ("cancelled", "", 3), + ] + + +@pytest.mark.asyncio +async def test_a_grant_written_under_the_accepters_handle_keeps_the_link_used( + world: World, +) -> None: + """The accepter signs in as a verified email; the grant lands under its handle.""" + secret = secret_of((await invite("robin@example.com")).link_path) + world.grant_error, world.grant_lands = BackendUnavailableError("lost reply"), True + signed_in("sso@example.com") + with pytest.raises(BackendUnavailableError): + await accept(secret) + assert [g.subject for g, _ in world.grants] == ["sso-handle"] + assert world.invites[domain.invite_id(secret)].state == "accepted" + + +@pytest.mark.asyncio +async def test_a_link_its_maker_was_erased_from_during_a_failed_grant_stays_closed( + world: World, monkeypatch: pytest.MonkeyPatch +) -> None: + secret = secret_of((await invite("robin@example.com")).link_path) + + async def erased_meanwhile(*_a: Any, **_k: Any) -> None: + await mod.forget_maker("o", "admin-ann") + raise BackendUnavailableError("down") + + monkeypatch.setattr(mod, "create_grant", erased_meanwhile) + signed_in("robin") + with pytest.raises(BackendUnavailableError): + await accept(secret) + stored = world.invites[domain.invite_id(secret)] + assert (stored.state, stored.created_by) == ("accepted", "") + + +@pytest.mark.asyncio +async def test_a_users_erasure_takes_them_off_their_invitations( + world: World, monkeypatch: pytest.MonkeyPatch +) -> None: + from server.erasure.app import saga_steps + from server.identity.app import grants + + async def _zero(*_a: Any, **_k: Any) -> int: + return 0 + + monkeypatch.setattr(grants, "revoke_subject", _zero) + monkeypatch.setattr(grants, "forget_granter", _zero) + monkeypatch.setattr(saga_steps.principal_steps, "delete_grant_rows_of_user", _zero) + world.maker_roles["user:42"] = Role.ADMIN + signed_in("user:42") + made = await invite("robin@example.com") + await saga_steps._step_revoke_grants_by_user("o", "42") + left = world.invites[made.invite_id] + assert (left.state, left.created_by) == ("cancelled", "") diff --git a/tests/unit/test_invites_store_sql.py b/tests/unit/test_invites_store_sql.py new file mode 100644 index 0000000000..4e68073a0d --- /dev/null +++ b/tests/unit/test_invites_store_sql.py @@ -0,0 +1,85 @@ +"""The invitation store's reads, and the two reads that say a person is held, on +clickhouse-local against the real tables: the newest state of an invitation wins, the +open list and an erasure's read find what they promise, and a held handle comes back in +the spelling it is stored under.""" + +from __future__ import annotations + +import time +from datetime import UTC, datetime +from pathlib import Path + +import pytest + +from server.identity.domain.invites import Invite +from server.identity.store import grants as grants_repo +from server.identity.store import invites as invites_repo +from server.identity.store import namespaces as namespaces_repo +from tests.unit.clickhouse_local import CLICKHOUSE, KeptCH, ddl + +pytestmark = pytest.mark.skipif(CLICKHOUSE is None, reason="clickhouse binary not installed") + +MADE = datetime(2026, 1, 1, tzinfo=UTC) +LATER = int(time.time()) + 30 * 86400 + + +def _invite( + invite_id: str, maker: str = "ann", namespace: str = "team", expires_at: int = LATER +) -> Invite: + return Invite( + org="acme", + namespace=namespace, + invite_id=invite_id, + email="m@example.com", + role="writer", + created_by=maker, + created_at=MADE, + expires_at=expires_at, + ) + + +@pytest.mark.asyncio +async def test_the_newest_state_wins_and_each_read_finds_what_it_promises( + tmp_path: Path, +) -> None: + ch = KeptCH(tmp_path, ddl("namespace_invites")) + await invites_repo.put(_invite("a"), ch=ch) # type: ignore[arg-type] + await invites_repo.put(_invite("a").accepted("lee", MADE), ch=ch) # type: ignore[arg-type] + await invites_repo.put(_invite("b"), ch=ch) # type: ignore[arg-type] + soon = int(time.time()) + 3600 # past it for the open list, short of the table's TTL + await invites_repo.put(_invite("c", expires_at=soon), ch=ch) # type: ignore[arg-type] + await invites_repo.put(_invite("d", maker="bea", namespace="other"), ch=ch) # type: ignore[arg-type] + + got = await invites_repo.get("acme", "team", "a", ch=ch) # type: ignore[arg-type] + assert got == _invite("a").accepted("lee", MADE) + assert await invites_repo.get("acme", "other", "a", ch=ch) is None # type: ignore[arg-type] + listed = await invites_repo.open_on("acme", "team", soon + 1, 10, ch=ch) # type: ignore[arg-type] + assert [i.invite_id for i in listed] == ["b"] + made = await invites_repo.made_by("acme", "ann", ch=ch) # type: ignore[arg-type] + assert sorted(i.invite_id for i in made) == ["a", "b", "c"] + assert [i.invite_id for i in await invites_repo.made_by("acme", "bea", ch=ch)] == ["d"] # type: ignore[arg-type] + assert await invites_repo.made_by("other-org", "ann", ch=ch) == [] # type: ignore[arg-type] + + +@pytest.mark.asyncio +async def test_a_held_handle_comes_back_as_stored(tmp_path: Path) -> None: + ch = KeptCH( + tmp_path, + ddl("namespaces"), + ddl("namespace_grants"), + "INSERT INTO loom.namespaces (org, namespace, owner_email, active, created_at," + " updated_at) VALUES ('acme', 'robin', 'Robin', 1, now(), now())," + " ('acme', 'gone', 'Gone', 0, now(), now())", + "INSERT INTO loom.namespace_grants (org, namespace, subject, role, status, granted_by," + " version) VALUES ('acme', 'team', 'Carol', 'writer', 'active', 'op', 1)," + " ('acme', 'team', 'dan', 'writer', 'pending', 'op', 1)", + "INSERT INTO loom.namespace_grants (org, namespace, subject, role, status, granted_by," + " revoked_at, version) VALUES ('acme', 'team', 'eve', 'writer', 'active', 'op'," + " now(), 1)", + ) + assert await namespaces_repo.account_handle("acme", "robin", ch=ch) == "Robin" # type: ignore[arg-type] + assert await namespaces_repo.account_handle("acme", "gone", ch=ch) is None # type: ignore[arg-type] + assert await namespaces_repo.account_handle("other", "robin", ch=ch) is None # type: ignore[arg-type] + assert await grants_repo.granted_spelling("acme", "carol", ch=ch) == "Carol" # type: ignore[arg-type] + assert await grants_repo.granted_spelling("acme", "dan", ch=ch) is None # type: ignore[arg-type] + assert await grants_repo.granted_spelling("acme", "eve", ch=ch) is None # type: ignore[arg-type] diff --git a/tests/unit/test_repo_maintainers.py b/tests/unit/test_repo_maintainers.py index 33b33ba829..6d4ab0c922 100644 --- a/tests/unit/test_repo_maintainers.py +++ b/tests/unit/test_repo_maintainers.py @@ -1234,7 +1234,7 @@ async def _revoke(org: str, ns: str, subject: str, **_k: Any) -> None: monkeypatch.setattr(grants_repo, "find_active_grant", _find) monkeypatch.setattr(grants_repo, "insert_row", _insert) - monkeypatch.setattr(grants_mod, "_enforce_code_ceiling", _no_ceiling) + monkeypatch.setattr(grants_mod, "enforce_code_ceiling", _no_ceiling) monkeypatch.setattr(maintainers, "sync_quietly", _sync) monkeypatch.setattr(maintainers, "revoke_repo_maintainer", _revoke) return calls diff --git a/tests/unit/test_rmt_write_paths.py b/tests/unit/test_rmt_write_paths.py index b902df8309..ab1caba4e7 100644 --- a/tests/unit/test_rmt_write_paths.py +++ b/tests/unit/test_rmt_write_paths.py @@ -154,6 +154,7 @@ "memory_versions": ("view", "memory_versions_mv"), "namespace_calibration_result": ("gap", "memory"), "namespace_grants": ("gap", "platform"), + "namespace_invites": ("builder", "test_grants_invite.py"), "namespace_ontology": ("gap", "platform"), "namespace_policies": ("builder", "test_repository_column_sets_match_schema.py"), "namespace_types": ("gap", "platform"), diff --git a/tests/unit/test_schema_baseline.py b/tests/unit/test_schema_baseline.py index 64a7fa1090..a82f85ad83 100644 --- a/tests/unit/test_schema_baseline.py +++ b/tests/unit/test_schema_baseline.py @@ -178,6 +178,7 @@ def test_the_journal_files() -> None: "120_usage_label_provenance.sql", "121_code_repo_base_namespace.sql", "122_read_receipts.sql", + "123_namespace_invites.sql", ] diff --git a/tests/unit/test_settings_env_contract.py b/tests/unit/test_settings_env_contract.py index a0d5e4d6d5..28347795c0 100644 --- a/tests/unit/test_settings_env_contract.py +++ b/tests/unit/test_settings_env_contract.py @@ -103,6 +103,7 @@ def _bounded(f: FieldInfo, value: float) -> bool: "cell_router_token": "lcr_" + "0" * 128, "router_operator_sha256": "0" * 64, "router_operator_token": "lco_" + "0" * 128, + "smtp_url": "smtps://mail.example:465", # The four other code_git_proxy_* settings load only beside it, and the bundle for # the proxy's own certificate only beside an https one. "code_git_proxy_url": "https://proxy.example:8443", diff --git a/tests/unit/test_sharing.py b/tests/unit/test_sharing.py index 2e23cc9b50..e496e3eb2b 100644 --- a/tests/unit/test_sharing.py +++ b/tests/unit/test_sharing.py @@ -200,6 +200,19 @@ def test_a_group_grant_on_a_parent_reaches_its_child(org_state: dict[str, Any]) assert _shared(_user("alice")) == ["col-q3", "col-q3-docs"] +def test_a_subjects_grants_alone_reach_a_collection_through_a_group_and_a_parent( + org_state: dict[str, Any], +) -> None: + """What an invitation's maker holds: the role `sharing.roles` reads, with no token.""" + from server.auth.authz import subject_grant_role + + org_state["grants"] = {"group:finance": {"col-q3": 3}} + role = asyncio.run(subject_grant_role(ORG, "col-q3-docs", "user:alice")) + assert role is Role.ADMIN + assert asyncio.run(subject_grant_role(ORG, "col-q3-docs", "user:bob")) is None + assert asyncio.run(subject_grant_role(ORG, "col-gone", "user:alice")) is None + + def test_the_best_role_of_every_principal_wins(org_state: dict[str, Any]) -> None: org_state["grants"] = {"group:finance": {"col-q3": 1}, "user:alice": {"col-q3-docs": 2}} assert _role(_user("alice"), "col-q3-docs") is Role.WRITER @@ -635,10 +648,10 @@ def test_a_grant_to_a_principal_in_another_case_is_refused(subject: str) -> None """In another case, or after a `/` (the shape of an end user's revocation key): no token carries such a subject, so no grant names one.""" from server.core.errors import ValidationError - from server.identity.app.grants import _enforce_principal_target + from server.identity.app.grants import enforce_principal_target with pytest.raises(ValidationError, match="well-formed principal"): - _enforce_principal_target("col-hr", subject) + enforce_principal_target("col-hr", subject) @pytest.mark.parametrize( @@ -1208,11 +1221,11 @@ def test_a_grant_to_everyone_reaches_every_member_of_the_org(org_state: dict[str def test_everyone_holds_grants_on_collections_only_and_no_token_is_it() -> None: from server.core.errors import ValidationError from server.core.principals import is_reserved_subject - from server.identity.app.grants import _enforce_principal_target + from server.identity.app.grants import enforce_principal_target - _enforce_principal_target("col-hr", "everyone") + enforce_principal_target("col-hr", "everyone") with pytest.raises(ValidationError, match="collections only"): - _enforce_principal_target("team", "everyone") + enforce_principal_target("team", "everyone") assert is_reserved_subject("Everyone"), "no token, in any case, is everyone" diff --git a/tests/unit/test_signup_name_in_use.py b/tests/unit/test_signup_name_in_use.py index 58c35b7ab6..700137ead4 100644 --- a/tests/unit/test_signup_name_in_use.py +++ b/tests/unit/test_signup_name_in_use.py @@ -481,6 +481,18 @@ def _held(*rows: str) -> bool: " VALUES ('dev', 'team', 'kim', {flag}, 1)", ("false", "true"), ), + ( + "INSERT INTO loom.namespace_invites (org, namespace, invite_id, role, created_by," + " created_at, expires_at, state, changed_at) VALUES ('dev', 'team', 'i', 'writer'," + " 'kim', now64(3), toUInt32(now()) + 3600, {flag}, now64(3))", + ("'open'", "'cancelled'"), + ), + ( + "INSERT INTO loom.namespace_invites (org, namespace, invite_id, role, created_by," + " created_at, expires_at, changed_at) VALUES ('dev', 'team', 'i', 'writer'," + " 'kim', now64(3), toUInt32(now()) {flag}, now64(3))", + ("+ 3600", "- 1"), + ), ( "INSERT INTO loom.sso_links (email, org, namespace, linked, version)" " VALUES ('kim@x.test', 'dev', 'team', {flag}, 1)",